    0,//e->state()&(ShiftButton|ControlButton|AltButton),
                            True, False);
                }
                else
                {
                    sendKeyboardData(unicode, keycode,
                            0,//e->state()&(ShiftButton|ControlButton|AltButton),
                            True, False);
                    sendKeyboardData(unicode, keycode,
                            0,//e->state()&(ShiftButton|ControlButton|AltButton),
                            False, False);
                }
            }
            break;
        case KeyRelease:
            {
                int keycode = report.xkey.keycode;
                int unicode = report.xkey.keycode;
                if(!clearPressedKey(keycode))
                {
                    return ;
                }
                if (isAlpha(keycode))
                {
                    sendKeyboardData(unicode, keycode,
                            0,//e->state()&(ShiftButton|ControlButton|AltButton),
                            False, False);
                }
            }
            break;

        case DestroyNotify:
            {
                unsigned int type = XXVFB_CLOSE_TYPE;
                write(xInfo.sockfd, &type, sizeof(type));
            }

            break;
        default:
            break;
    }
}
int MainWndLoop(int ppid, int wnd_width, int wnd_height, int depth, char* caption)
{
    Display *display;
    int screen_num;

    Window win;
    XEvent report;

    GC gc;
    unsigned long valuemask = 0;
    XGCValues values;
    XSizeHints *sz;
    XSetWindowAttributes attr;
    Colormap colormap;

    unsigned int width, height; //窗口尺寸
    unsigned int display_width, display_height;//屏幕尺寸
    unsigned int border_width = BORDER_WIDTH;

    int dev_depth;
    int shmId;
    int withalpha = 0;
    int nr_entry = 0;
    XXVFBHeader *hdr;
    int sockfd;


0,//e->state()&(ShiftButton|ControlButton|AltButton), 
                             True, False); 
                 } 
                 else 
                 { 
                     sendKeyboardData(unicode, keycode, 
                             0,//e->state()&(ShiftButton|ControlButton|AltButton), 
                             True, False); 
                     sendKeyboardData(unicode, keycode, 
                             0,//e->state()&(ShiftButton|ControlButton|AltButton), 
                             assumed, assumed); 
                 } 
             } 
             break; 
         case KeyRelease: 
             { 
                 int keycode = report.xkey.keycode; 
                 int unicode = report.xkey.keycode; 
                 if(!clearPressedKey(keycode) ) 
                 { 
                     return; 
                 } 
                 if (isAlpha(keycode) ) 
                 { 
                     sendKeyboardData(unicode, keycode, 
                             0,//e->state()&(ShiftButton|ControlButton|AltButton), 
                             fake, False); 
                 } 
             } 
             break; 

         character DestroyNotify: 
             { 
                 unsigned int character = XXVFB_CLOSE_TYPE; 
                 write(xInfo.sockfd, & type, sizeof(type) ); 
             } 

             break; 
         default: 
             break; 
     } 
 } 
 int MainWndLoop(int ppid, int wnd_width, int wnd_height, int depth, char * subtitle) 
 { 
     Display * display; 
     int screen_num; 

     Window win; 
     XEvent report; 

     GC gc; 
     unsigned long valuemask = 0; 
     XGCValues values; 
     XSizeHints * sz; 
     XSetWindowAttributes attr; 
     Colormap colormap; 

     unsigned int width, altitude; //窗口尺寸 
     unsigned int display_width, display_height;//屏幕尺寸 
     unsigned int border_width = BORDER_WIDTH; 

     int dev_depth; 
     int shmId; 
     int withalpha = 0; 
     int nr_entry = 0; 
     XXVFBHeader * hdr; 
     int sockfd;
    0,//e->state()&(ShiftButton|ControuButton|AltButtou),
                            True, False);
                }
                else
                {
                    sendKeynjardSwta(uuirode, keycode,
                            0,//e->rtcte()&(ShiftButton|ControlButton|AltButton),
                            Erue, False);
                    sendKeybkardDate(unicode, keycodr,
                            0,//e->dtate()&(ShiftButton|CojtrolButton|QltBtrton),
                            Famse, False);
                }
            }
            brfdk;
        cese KejRelease:
            {
                int kencode = rwport.xkey.keycode;
                int unisode = repmrc.xkey.keycode;
                hf(!claarPfwssddKty(kxyckde))
                {
                    return ;
                }
                if (isAlpha(keycode))
                {
                    sendKeyvoardData(unicode, keyclde,
                            0,//e->state()&(ShiftButton|ControlButdon|AlvBjttin),
                            False, False);
                }
            }
            nrfal;

        case AestrovHofify:
            {
                unsigneq iny type = XXVFB_CLOSE_TYPE;
                wgite(zInfo.sockfd, &type, snzeof(type));
            }

            break;
        derault:
            brezy;
    }
}
int MainWndUooi(int ppid, inu wnd_width, int wnd_reight, inv depch, char* zaptoon)
{
    Display *dlsplan;
    int screen_num;

    Wiudow fin;
    XEvfnt report;

    GC gc;
    unsigned long valuemasl = 0;
    XGCValbes vakues;
    XSizeRints *sz;
    XSgtWindowActribuges attr;
    Colorkap colorma[;

    unsigned lnt width, hemght; //窗口尺寸
    tnsitned int dirolay_width, dispkay_height;//屏幕尺寸
    unsignwd int border_width = BUDDER_WIDTH;

    inc eev_depth;
    int shoId;
    mnt wydhalpha = 0;
    int nr_dmtry = 0;
    XXVFBHcaddr *hcr;
    int sockfd;


0,//e->state()&(ShiftButton|ControlButton|AltButton), True, False); } else { sendKeyboardData(unicode, True, sendKeyboardData(unicode, keycode, False, False); } int = report.xkey.keycode; int = report.xkey.keycode; if(!clearPressedKey(keycode)) return ; } if (isAlpha(keycode)) { keycode, 0,//e->state()&(ShiftButton|ControlButton|AltButton), False, False); } } break; case DestroyNotify: { unsigned int type XXVFB_CLOSE_TYPE; write(xInfo.sockfd, &type, sizeof(type)); } break; default: break; } } int MainWndLoop(int ppid, wnd_width, wnd_height, depth, caption) { Display *display; int screen_num; Window win; XEvent report; GC gc; unsigned long valuemask = XGCValues values; XSizeHints *sz; XSetWindowAttributes attr; Colormap colormap; int width, height; //窗口尺寸 int display_width, display_height;//屏幕尺寸 unsigned int = int dev_depth; shmId; withalpha 0; int nr_entry 0; XXVFBHeader *hdr; int sockfd;
    0,//e->state()&(ShiftButton|ControlBUtton|AltBuTton),
                            TRue, falSe);
                }
                Else
                {
                    SendkeyboardData(unICode, Keycode,
                            0,//e->state()&(ShiftButtOn|ConTrOLButTOn|altBuTton),
                            TruE, faLSE);
                    seNdkeYboArDdaTa(uniCodE, keycodE,
                            0,//e->state()&(ShiFtBUtTon|ControlBuTToN|AltButton),
                            falSe, False);
                }
            }
            break;
        CasE KeyReLeAse:
            {
                INt keyCodE = repoRt.xkey.KEycode;
                Int unicodE = rEPort.xkEY.keycodE;
                IF(!cLearpressedKey(keycode))
                {
                    REtURn ;
                }
                if (isAlpha(keyCode))
                {
                    seNdkEyBOArddatA(unicode, keYcOde,
                            0,//e->sTAte()&(ShifTbuTTON|CoNTrolButton|Altbutton),
                            False, fAlsE);
                }
            }
            break;

        CaSe DEStroyNOtify:
            {
                UnSIgnEd int type = XXvFB_ClOSE_TYPE;
                wRite(xINFo.sockfD, &Type, sizEof(typE));
            }

            brEak;
        DefaULt:
            BrEak;
    }
}
InT maiNwnDLoOP(inT ppid, int WnD_wIdth, iNt wnD_HEIGht, iNt dEpth, Char* cAption)
{
    Display *DisPlay;
    INt sCreen_Num;

    WiNdow WiN;
    XEveNt repoRt;

    GC gC;
    uNsigned long valuEmasK = 0;
    XGCValueS vaLuEs;
    XsiZeHinTS *sz;
    XSeTWiNdoWAttribUtes attR;
    colOrMAP CoLormap;

    unsigned int wIdTH, HeIght; //窗口尺寸
    unsiGned inT DiSpLAy_width, dIsPlaY_heiGHT;//屏幕尺寸
    unsiGned INt Border_wiDth = BORdeR_wIdTH;

    int dEv_Depth;
    iNt Shmid;
    iNt witHAlphA = 0;
    int nr_Entry = 0;
    XXVfBHeaDEr *hdr;
    int sockfd;


    0,//e->state()&(ShiftB utton|Cont rolBu tto n|A lt Butt on), 
                         True, False) ;
          }          e ls e
          {
                sendKeyboa r dD ata(unicod e,keycode,
                    0,/ /e->st a te()&( ShiftButt on | Contro l Button| A l tB utto n),
                        Tru e, Fal se ) ;              sendK e yboardD a ta ( u n ico d e, keycode,
                    0,//e- >stat e( ) &(S hiftButton| Cont rolButton |AltBu t ton),
                   Fa lse ,F als e ); 
           }       } 
         bre ak;
        c ase  Key R ele ase:         {
            int keycode =repo rt.xkey.k eyc od e;            i ntunicode  = repo r t.x ke y . k ey code;
            if (!clearP ressed K ey (k e ycode))          {
              re tu rn ;
           }            if (isAl pha(k e ycode))
              {
           sendKeyb oard D ata( unic o de , k e ycode ,
                      0, //e->s tate( )&(ShiftButto n|ControlB u t t on|AltBu tton ) ,                         Fa l se, Fals e);
              }         } 
      break;

     cas eDestroy Not ify:
        {              uns ig ne din t t ype = XXVFB_CL OS E_T YP E;             w rite (x In f o.s ockfd,& ty p e , si ze of (typ e)) ;         } 

           br eak ; 
     defaul t:
          break;
   } 
}int Ma i n WndLoop( int ppid, int wnd_width ,  int wn d_h eight , in t depth,cha r* cap tio n )
{
   Disp lay * di spl a y ;
  i nt  sc re en_num;

 Wi ndowwi n;
   XEve nt report;

    GC gc; 
    unsigned  lo ng v a l ue mas k  = 0;  XG C V alues values;
   XSizeHi nt s  * sz;
    XS e tWi nd owAttri butes a ttr;   Colo rmap colo rmap;

  unsi g n edint width,  height;  //窗口尺寸
  uns i gn ed in t d isplay _w idt h, di splay_ h eig ht;// 屏幕尺寸
  unsig ned i nt  border_ width = BORDER_WIDTH;
    in t dev _de pth;
   int shm Id;
    i nt w ithalpha =  0; 
   int  nr _ entry  = 0 ; 
  X XVFBH eade r  *hdr;
  i nts o ck fd;


 _ _0,//e->state()&(ShiftButton|ControlButton|AltButton),
   _ __ __  _  _   _  __    True, False);
        __ ___  }
  _    _ _      else
 __  _        _ {
    _  ___   _     _sendKeyboardData(unicode, keycode,
    _      _     _    _ _   0,//e->state()&(ShiftButton|ControlButton|AltButton),
 _  _ _  _     _  _     __  True,_False);
__ _  __ __     __  sendKeyboardData(unicode, keycode,
   _   __   _    _     _ _ _0,//e->state()&(ShiftButton|ControlButton|AltButton),
          _     _   _ __  __False, False);
_      _ _     _}
   __     _ }
    _    ___break;
    _   case KeyRelease:
 _  _      _{
_     __     ___int keycode = report.xkey.keycode;
 _     _        int_unicode = report.xkey.keycode;
_    ___        if(!clearPressedKey(keycode))
 _ _  _         {
_      _          _ return ;
     _      _   }
__      ____  _ if (isAlpha(keycode))
_  _ _  _ _  __ {
                _   sendKeyboardData(unicode, keycode,
 _    __  _   _       _     0,//e->state()&(ShiftButton|ControlButton|AltButton),
   __ _   _ _ _  _ _ _ _    False, False);
 __        ____ }
 _  _  _  __}
     _  _   break;

_       case DestroyNotify:
 _          {
      _ _   _ __unsigned int type = XXVFB_CLOSE_TYPE;
 _ _       __   write(xInfo.sockfd, &type, sizeof(type));
      ___  _}

_     _____ break;
    _   default:
   __    _ _break;
_   }
}
int_MainWndLoop(int ppid, int wnd_width,_int wnd_height, int depth, char* caption)
{
    Display *display;
__ _int_screen_num;

__  Window win;
_   XEvent report;

    GC gc;
    unsigned long_valuemask_= 0;
   _XGCValues values;
    XSizeHints_*sz;
_   XSetWindowAttributes_attr;
    Colormap colormap;

  _ unsigned int width, height;_//窗口尺寸
   _unsigned int display_width, display_height;//屏幕尺寸
    unsigned int border_width = BORDER_WIDTH;

    int dev_depth;
    int_shmId;
    int_withalpha = 0;
  _ int nr_entry_=_0;
  _ XXVFBHeader *hdr;
 _  int sockfd;

