version 1.28 | | version 1.29 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: request.c,v 1.28 2001/11/19 23:30:28 michtoen Exp $"; | | * "$Id: request.c,v 1.29 2001/12/03 07:51:46 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
void SetFaceMode(char *buf, int len, NewSocket *ns) | | void SetFaceMode(char *buf, int len, NewSocket *ns) |
{ | | { |
| | char tmp[256]; |
| | |
int mask =(atoi(buf) & CF_FACE_CACHE), mode=(atoi(buf) & ~CF_FACE_CACHE); | | int mask =(atoi(buf) & CF_FACE_CACHE), mode=(atoi(buf) & ~CF_FACE_CACHE); |
| | |
if (mode==CF_FACE_NONE) { | | if (mode==CF_FACE_NONE) { |
ns->facemode=Send_Face_None; | | ns->facemode=Send_Face_None; |
} | | |
else if (mode==CF_FACE_BITMAP) { | | |
ns->facemode=Send_Face_Bitmap; | | |
} else if (mode==CF_FACE_XPM) { | | |
ns->facemode=Send_Face_Pixmap; | | |
} else if (mode==CF_FACE_PNG) { | | } else if (mode==CF_FACE_PNG) { |
ns->facemode=Send_Face_Png; | | ns->facemode=Send_Face_Png; |
#ifdef ESRV_DEBUG | | |
} else { | | } else { |
| | sprintf(tmp,"drawinfo %d %s", NDI_RED,"Warning - send unsupported face mode. Will use Png"); |
| | Write_String_To_Socket(ns, tmp, strlen(tmp)); |
| | #ifdef ESRV_DEBUG |
LOG(llevDebug,"SetFaceMode: Invalid mode from client: %d\n", mode); | | LOG(llevDebug,"SetFaceMode: Invalid mode from client: %d\n", mode); |
#endif | | #endif |
} | | } |
| | |
sl.len += strlen(new_faces[face_num].name); | | sl.len += strlen(new_faces[face_num].name); |
Send_With_Handling(ns, &sl); | | Send_With_Handling(ns, &sl); |
} | | } |
else if (ns->facemode == Send_Face_Pixmap) { | | |
strcpy((char*)sl.buf, "pixmap "); | | |
sl.len=strlen((char*)sl.buf); | | |
SockList_AddInt(&sl, face_num); | | |
SockList_AddInt(&sl, faces[face_num].datalen[1]); | | |
memcpy(sl.buf+sl.len, faces[face_num].data[1], faces[face_num].datalen[1]); | | |
sl.len += faces[face_num].datalen[1]; | | |
/* LOG(llevDebug,"sending pixmap %d, len %d\n", face_num, faces[face_num].datalen);*/ | | |
Send_With_Handling(ns, &sl); | | |
} else if (ns->facemode == Send_Face_Bitmap) { | | |
strcpy((char*)sl.buf, "bitmap "); | | |
sl.len=strlen((char*)sl.buf); | | |
SockList_AddInt(&sl, face_num); | | |
SockList_AddChar(&sl, new_faces[face_num].fg); | | |
SockList_AddChar(&sl, new_faces[face_num].bg); | | |
memcpy(sl.buf+sl.len, faces[face_num].data[0], faces[face_num].datalen[0]); | | |
memcpy(sl.buf+sl.len, faces[face_num].data[0], 3*24); | | |
sl.len += faces[face_num].datalen[0]; | | |
Send_With_Handling(ns, &sl); | | |
} | | |
else if (ns->facemode == Send_Face_Png) { | | else if (ns->facemode == Send_Face_Png) { |
strcpy((char*)sl.buf, "image "); | | strcpy((char*)sl.buf, "image "); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
SockList_AddInt(&sl, face_num); | | SockList_AddInt(&sl, face_num); |
SockList_AddInt(&sl, faces[face_num].datalen[2]); | | SockList_AddInt(&sl, faces[face_num].datalen[PNG_FACE_INDEX]); |
memcpy(sl.buf+sl.len, faces[face_num].data[2], faces[face_num].datalen[2]); | | memcpy(sl.buf+sl.len, faces[face_num].data[PNG_FACE_INDEX], faces[face_num].datalen[PNG_FACE_INDEX]); |
sl.len += faces[face_num].datalen[2]; | | sl.len += faces[face_num].datalen[PNG_FACE_INDEX]; |
/* LOG(llevDebug,"sending png %d, len %d\n", face_num, faces[face_num].datalen);*/ | | /* LOG(llevDebug,"sending png %d, len %d\n", face_num, faces[face_num].datalen);*/ |
Send_With_Handling(ns, &sl); | | Send_With_Handling(ns, &sl); |
} else { | | } else { |