Changeset 103 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Apr 29, 1998, 7:06:44 PM (27 years ago)
Author:
ansari
Message:

Optimisation du traitement des evenements avec XtAddEvenetHandler Reza 19/04/98

Location:
trunk/SophyaPI/PI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pibwdgx.cc

    r90 r103  
    3737XtSetValues(XtWdg(), wargs, 3);
    3838
     39((PIXtBaseWidget)XtWdg())->pixtbase.myeventmask = 0;
    3940XtUninstallTranslations(XtWdg());
    4041
     
    7576void PIBaseWdgX::ActivatePtrCross()
    7677{
    77 XtTranslations trans;
    78 trans = XtParseTranslationTable
    79         ("<Enter>: enter_pixtbase() \n <Leave>: leave_pixtbase()");
    80 XtAugmentTranslations(XtWdg(), trans);
    81 //XtFree((char *)trans);
    82 
     78XtAddEventHandler( XtWdg(), EnterWindowMask | LeaveWindowMask,
     79                   FALSE, event_handler_pixtbase, NULL);
    8380return;
    8481}
     
    8885void PIBaseWdgX::ActivateButton(int bid)
    8986{
    90 XtTranslations trans;
    91 char strans[256];
    92 if ((bid<1) || (bid > 3))  return;
    93 sprintf(strans,"<Btn%dDown>: bud%d_pixtbase() \n <Btn%dUp>: buu%d_pixtbase()",
    94         bid, bid, bid, bid);
    95 trans = XtParseTranslationTable(strans);
    96 
    97 XtAugmentTranslations(XtWdg(), trans);
    98 // XtFree((char *)trans);
    9987#ifdef DEBUG_PIBWDGX
    100 printf("PIBaseWdgX::ActivateButton \n%s \n", strans);
     88printf("PIBaseWdgX::ActivateButton %d \n \n", bid);
    10189#endif
     90if ( (bid < 1) && (bid > 3) ) return;
     91XtAddEventHandler( XtWdg(), ButtonPressMask | ButtonReleaseMask,
     92                   FALSE, event_handler_pixtbase, NULL);
     93if (bid == 1)  ((PIXtBaseWidget)XtWdg())->pixtbase.myeventmask |= Button1Mask ;
     94else if (bid == 2) ((PIXtBaseWidget)XtWdg())->pixtbase.myeventmask |= Button2Mask ;
     95else if (bid == 3) ((PIXtBaseWidget)XtWdg())->pixtbase.myeventmask |= Button3Mask ;
    10296return;
    10397}
     
    106100void PIBaseWdgX::ActivateMove(int bid)
    107101{
    108 XtTranslations trans;
    109 char strans[256];
    110 if ((bid<1) || (bid > 3))  return;
    111 sprintf(strans,"<Btn%dMotion>: mov%d_pixtbase()", bid, bid);
    112 //sprintf(strans,"Button%d <PtrMoved>: mov%d_pixtbase()", bid, bid);
    113 trans = XtParseTranslationTable(strans);
    114 
    115 XtAugmentTranslations(XtWdg(), trans);
    116 // XtFree((char *)trans);
    117102#ifdef DEBUG_PIBWDGX
    118 printf("PIBaseWdgX::ActivateMove \n%s \n", strans);
     103printf("PIBaseWdgX::ActivateMove %d \n \n", bid);
    119104#endif
     105unsigned long evtmask ;
     106
     107if ( (bid < 1) && (bid > 3) ) return;
     108if (bid == 1)  evtmask = Button1MotionMask | PointerMotionHintMask ;
     109else if (bid == 2) evtmask = Button2MotionMask | PointerMotionHintMask ;
     110else if (bid == 3) evtmask = Button3MotionMask | PointerMotionHintMask ;
     111XtAddEventHandler( XtWdg(), evtmask, FALSE, event_handler_pixtbase, NULL);
    120112return;
    121113}
     
    125117void PIBaseWdgX::ActivateKeyboard()
    126118{
    127 XtTranslations trans;
    128 trans = XtParseTranslationTable("<Key>: keyb_pixtbase()");
    129 XtAugmentTranslations(XtWdg(), trans);
    130 // XtFree((char *)trans);
     119XtAddEventHandler( XtWdg(), KeyPressMask, FALSE, event_handler_pixtbase, NULL);
     120((PIXtBaseWidget)XtWdg())->pixtbase.myeventmask |= ShiftMask ;
    131121return;
    132122}
  • trunk/SophyaPI/PI/pixtbase.cc

    r71 r103  
    2424
    2525
    26 static void     leave_pixtbase   (Widget, XEvent*, String* ,Cardinal*);
    27 static void     enter_pixtbase   (Widget, XEvent*, String* ,Cardinal*);
    28 static void     buu1_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    29 static void     bud1_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    30 static void     buu2_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    31 static void     bud2_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    32 static void     buu3_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    33 static void     bud3_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    34 static void     mov1_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    35 static void     mov2_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    36 static void     mov3_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
    37 static void     keyb_pixtbase    (Widget, XEvent*, String* ,Cardinal*);
     26static Boolean  acceptfocus_pixtbase   (Widget, Time* );
    3827
    3928
     
    4332};
    4433
    45 /*
    46 static char translations[] =  "\
    47                       <BtnDown>: bud1_pixtbase(None)\n\
    48              Button1 <PtrMoved>: mov1_pixtbase(None)\n\
    49                         <BtnUp>: buu1_pixtbase(None)\n\
    50                           <Key>: keyb_pixtbase(None)";
    51 */
    52 
    53 static XtActionsRec actions[] =
    54 {
    55   { "leave_pixtbase" , (XtActionProc)leave_pixtbase} ,
    56   { "enter_pixtbase" , (XtActionProc)enter_pixtbase} ,
    57   { "buu1_pixtbase" , (XtActionProc)buu1_pixtbase} ,
    58   { "bud1_pixtbase" , (XtActionProc)bud1_pixtbase} ,
    59   { "buu2_pixtbase" , (XtActionProc)buu2_pixtbase} ,
    60   { "bud2_pixtbase" , (XtActionProc)bud2_pixtbase} ,
    61   { "buu3_pixtbase" , (XtActionProc)buu3_pixtbase} ,
    62   { "bud3_pixtbase" , (XtActionProc)bud3_pixtbase} ,
    63   { "mov1_pixtbase" , (XtActionProc)mov1_pixtbase} ,
    64   { "mov2_pixtbase" , (XtActionProc)mov2_pixtbase} ,
    65   { "mov3_pixtbase" , (XtActionProc)mov3_pixtbase} ,
    66   { "keyb_pixtbase" , (XtActionProc)keyb_pixtbase} ,
    67 };
    6834
    6935PIXtBaseClassRec  piXtBaseClassRec = {
     
    8046NULL,                           /* notify that initialize called    */
    8147XtInheritRealize,               /* XCreateWindow for widget         */
    82 actions,                        /* widget semantics name to proc map*/
    83 XtNumber(actions),              /* number of entries in actions     */
     48// actions,                     /* widget semantics name to proc map*/
     49// XtNumber(actions),           /* number of entries in actions     */
     50NULL,                           /* widget semantics name to proc map*/
     510,                              /* number of entries in actions     */
    8452resources,                      /* resources             */
    8553XtNumber(resources),            /* resources             */
     
    9664XtInheritSetValuesAlmost,       /* set_values got "Almost" geo reply*/
    9765NULL,                           /* notify that get_values called    */
    98 XtInheritAcceptFocus,           /* assign input focus to widget     */
     66// XtInheritAcceptFocus,           /* assign input focus to widget     */
     67acceptfocus_pixtbase,           /* assign input focus to widget     */
    9968XtVersion,                      /* version of intrinsics used       */
    10069NULL,                           /* list of callback offsets         */
     
    193162
    194163/* Nouvelle-Fonction */
    195 static void enter_pixtbase (Widget wdgp, XEvent* evt,
    196                             String* /*args*/, Cardinal* /*narg*/)
    197 {
    198 #ifdef DEBUG_PIXTB
    199 printf("Debug_enter_pixtbase: Wdg=%lx Object= %lx \n", (long)wdgp,
    200 (long)(((PIXtBaseWidget)wdgp)->pixtbase.objet) );
    201 #endif
    202 last_time_xevt = evt->xcrossing.time;
    203 last_serial_xevt = evt->xcrossing.serial;
    204 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    205    (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Enter();
    206 return;
    207 }
    208 
    209 /* Nouvelle-Fonction */
    210 static void leave_pixtbase (Widget wdgp, XEvent* evt,
    211                             String* /*args*/, Cardinal* /*narg*/)
    212 {
    213 #ifdef DEBUG_PIXTB
    214 printf("Debug_leave_pixtbase: Wdg=%lx Object= %lx \n", (long)wdgp,
    215 (long)(((PIXtBaseWidget)wdgp)->pixtbase.objet) );
    216 #endif
    217 last_time_xevt = evt->xcrossing.time;
    218 last_serial_xevt = evt->xcrossing.serial;
    219 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    220    (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Leave();
    221 return;
    222 }
    223 
    224 /* Nouvelle-Fonction */
    225 static void bud1_pixtbase (Widget wdgp, XEvent* evt,
    226                            String* /*args*/, Cardinal* /*narg*/)
    227 
    228 {
    229 last_time_xevt = evt->xbutton.time;
    230 last_serial_xevt = evt->xbutton.serial;
    231 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    232   {
    233   int x,y;
    234   x = evt->xbutton.x;
    235   y = evt->xbutton.y;
    236   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But1Press(x,y);
     164static Boolean  acceptfocus_pixtbase   (Widget wdgp , Time* )
     165{
     166printf("acceptfocus_pixtbase() %x %x \n",  ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask, ShiftMask );
     167if (  ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & ShiftMask  )  return TRUE;
     168else return FALSE;
     169}
     170
     171/* -------- Fonction de traitement des evenements --------- */
     172/* Nouvelle-Fonction */
     173void event_handler_pixtbase (Widget wdgp, XtPointer /*closure*/,
     174                             XEvent* evt, Boolean* cont)
     175{
     176
     177*cont = FALSE ;
     178switch (evt->type) {
     179  case EnterNotify :
     180#ifdef DEBUG_PIXTB
     181    printf("Debug_enter_pixtbase: Wdg=%lx Object= %lx \n", (long)wdgp,
     182           (long)(((PIXtBaseWidget)wdgp)->pixtbase.objet) );
     183#endif
     184    last_time_xevt = evt->xcrossing.time;
     185    last_serial_xevt = evt->xcrossing.serial;
     186//    if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
     187    (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Enter();
     188  break;
     189
     190  case LeaveNotify :
     191#ifdef DEBUG_PIXTB
     192    printf("Debug_leave_pixtbase: Wdg=%lx Object= %lx \n", (long)wdgp,
     193           (long)(((PIXtBaseWidget)wdgp)->pixtbase.objet) );
     194#endif
     195    last_time_xevt = evt->xcrossing.time;
     196    last_serial_xevt = evt->xcrossing.serial;
     197//    if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
     198       (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Leave();
     199  break;
     200
     201  case ButtonPress :
     202    last_time_xevt = evt->xbutton.time;
     203    last_serial_xevt = evt->xbutton.serial;
     204    if ( (evt->xbutton.button == 1) && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button1Mask) )
     205      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But1Press(evt->xbutton.x, evt->xbutton.y);
     206    else  if ( (evt->xbutton.button == 2) && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button2Mask) )
     207      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But2Press(evt->xbutton.x, evt->xbutton.y);
     208    else  if ( (evt->xbutton.button == 3)  && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button3Mask) )
     209      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But3Press(evt->xbutton.x, evt->xbutton.y);
     210  break;
     211
     212  case ButtonRelease :
     213    last_time_xevt = evt->xbutton.time;
     214    last_serial_xevt = evt->xbutton.serial;
     215    if ( (evt->xbutton.button == 1) && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button1Mask) )
     216      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But1Release(evt->xbutton.x, evt->xbutton.y);
     217    else  if ( (evt->xbutton.button == 2) && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button2Mask) )
     218      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But2Release(evt->xbutton.x, evt->xbutton.y);
     219    else  if ( (evt->xbutton.button == 3)  && ( ((PIXtBaseWidget)wdgp)->pixtbase.myeventmask & Button3Mask) )
     220      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But3Release(evt->xbutton.x, evt->xbutton.y);
     221  break;
     222
     223  case MotionNotify :
     224    {
     225    int xw, yw, xr, yr;
     226    unsigned int key_but;
     227    Window rw, cw;
     228    if ( evt->xmotion.is_hint == NotifyHint ) {
     229      if (!XQueryPointer( XtDisplay(wdgp), evt->xmotion.window, &rw, &cw,
     230                  &xr, &yr, &xw, &yw, &key_but) ) break ;
     231      }
     232    else { key_but =  evt->xmotion.state ; xw = evt->xmotion.x;  yw = evt->xmotion.y; }
     233    if  ( !(key_but & ( Button1Mask | Button2Mask | Button3Mask ) ) ) break;
     234      last_time_xevt = evt->xmotion.time;
     235      last_serial_xevt = evt->xmotion.serial;
     236      if  (key_but & Button1Mask )
     237        (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr1Move(xw, yw);
     238      else  if (key_but & Button2Mask )
     239        (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr2Move(xw, yw);
     240      else  if (key_but & Button3Mask )
     241        (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr3Move(xw, yw);
     242    }
     243  break;
     244
     245  case KeyPress :
     246    {
     247    XComposeStatus cs;
     248    KeySym key;
     249    char buf[10];
     250    int i,nc,rkey;
     251    PIKeyModifier kmod;
     252 
     253    kmod = PIKM_Blank;
     254    nc = XLookupString(&(evt->xkey), buf, 10, &key, &cs);
     255
     256    if  (evt->xkey.state & ShiftMask)   
     257      kmod = (PIKeyModifier) (kmod | PIKM_Shift);
     258    if  (evt->xkey.state & ControlMask)
     259      kmod = (PIKeyModifier) (kmod | PIKM_Cntl);
     260    if  (evt->xkey.state & Mod1Mask)   
     261      kmod = (PIKeyModifier) (kmod | PIKM_Alt);
     262    switch (key) {
     263      case XK_Return :
     264        rkey = PIK_Return;
     265      break;
     266      case XK_KP_Enter :
     267        rkey = PIK_Enter;
     268      break;
     269      case XK_Up :
     270        rkey = PIK_Up;
     271      break;
     272      case XK_Down :
     273        rkey = PIK_Down;
     274      break;
     275      case XK_Left :
     276        rkey = PIK_Left;
     277      break;
     278      case XK_Right :
     279        rkey = PIK_Right;
     280      break;
     281      case XK_Prior :
     282        rkey = PIK_Previous;
     283      break;
     284      case XK_Next :
     285        rkey = PIK_Next;
     286      break;
     287      default :
     288        rkey = 0;
     289      break;
     290    }
     291    if (rkey > 0)  (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard(rkey, kmod);
     292    else for(i=0; i<nc; i++) 
     293      (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard((int)(buf[i]), kmod);
    237294  }
    238 return;
    239 }
    240 
    241 /* Nouvelle-Fonction */
    242 static void buu1_pixtbase (Widget wdgp, XEvent* evt,
    243                            String* /*args*/, Cardinal* /*narg*/)
    244 
    245 {
    246 last_time_xevt = evt->xbutton.time;
    247 last_serial_xevt = evt->xbutton.serial;
    248 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    249   {
    250   int x,y;
    251   x = evt->xbutton.x;
    252   y = evt->xbutton.y; 
    253   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But1Release(x,y);
    254   }
    255 return;
    256 }
    257 /* Nouvelle-Fonction */
    258 static void bud2_pixtbase (Widget wdgp, XEvent* evt,
    259                            String* /*args*/, Cardinal* /*narg*/)
    260 
    261 {
    262 last_time_xevt = evt->xbutton.time;
    263 last_serial_xevt = evt->xbutton.serial;
    264 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    265   {
    266   int x,y;
    267   x = evt->xbutton.x;
    268   y = evt->xbutton.y; 
    269   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But2Press(x,y);
    270 }
    271 return;
    272 }
    273 
    274 /* Nouvelle-Fonction */
    275 static void buu2_pixtbase (Widget wdgp, XEvent* evt,
    276                            String* /*args*/, Cardinal* /*narg*/)
    277 {
    278 last_time_xevt = evt->xbutton.time;
    279 last_serial_xevt = evt->xbutton.serial;
    280 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    281   {
    282   int x,y;
    283   x = evt->xbutton.x;
    284   y = evt->xbutton.y; 
    285   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But2Release(x,y);
    286   }
    287 return;
    288 }
    289 
    290 
    291 /* Nouvelle-Fonction */
    292 static void bud3_pixtbase (Widget wdgp, XEvent* evt,
    293                            String* /*args*/, Cardinal* /*narg*/)
    294 
    295 {
    296 last_time_xevt = evt->xbutton.time;
    297 last_serial_xevt = evt->xbutton.serial;
    298 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    299   {
    300   int x,y;
    301   x = evt->xbutton.x;
    302   y = evt->xbutton.y; 
    303   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But3Press(x,y);
    304 }
    305 return;
    306 }
    307 
    308 /* Nouvelle-Fonction */
    309 static void buu3_pixtbase (Widget wdgp, XEvent* evt,
    310                            String* /*args*/, Cardinal* /*narg*/)
    311 
    312 {
    313 last_time_xevt = evt->xbutton.time;
    314 last_serial_xevt = evt->xbutton.serial;
    315 if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
    316   {
    317   int x,y;
    318   x = evt->xbutton.x;
    319   y = evt->xbutton.y; 
    320   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->But3Release(x,y);
    321 }
    322 return;
    323 }
    324 
    325 /* Nouvelle-Fonction */
    326 static void mov1_pixtbase (Widget wdgp, XEvent* evt,
    327                            String* /*args*/, Cardinal* /*narg*/)
    328 {
    329 last_time_xevt = evt->xbutton.time;
    330 last_serial_xevt = evt->xbutton.serial;
    331 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
    332   {
    333   int x,y;
    334   x = evt->xbutton.x;
    335   y = evt->xbutton.y; 
    336   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr1Move(x,y);
    337   }
    338 return;
    339 }
    340 
    341 /* Nouvelle-Fonction */
    342 static void mov2_pixtbase (Widget wdgp, XEvent* evt,
    343                            String* /*args*/, Cardinal* /*narg*/)
    344 {
    345 last_time_xevt = evt->xbutton.time;
    346 last_serial_xevt = evt->xbutton.serial;
    347 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
    348   {
    349   int x,y;
    350   x = evt->xbutton.x;
    351   y = evt->xbutton.y; 
    352   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr2Move(x,y);
    353   }
    354 return;
    355 }
    356 
    357 /* Nouvelle-Fonction */
    358 static void mov3_pixtbase (Widget wdgp, XEvent* evt,
    359                            String* /*args*/, Cardinal* /*narg*/)
    360 {
    361 last_time_xevt = evt->xbutton.time;
    362 last_serial_xevt = evt->xbutton.serial;
    363 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
    364   {
    365   int x,y;
    366   x = evt->xbutton.x;
    367   y = evt->xbutton.y; 
    368   (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Ptr3Move(x,y);
    369   }
    370 return;
    371 }
    372 
    373 /* Nouvelle-Fonction */
    374 static void keyb_pixtbase (Widget wdgp, XEvent* evt,
    375                            String* /*args*/, Cardinal* /*narg*/)
    376 {
    377 last_time_xevt = evt->xkey.time;
    378 last_serial_xevt = evt->xkey.serial;
    379 
    380 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
    381   {
    382   XComposeStatus cs;
    383   KeySym key;
    384   char buf[10];
    385   int i,nc,rkey;
    386   PIKeyModifier kmod;
    387  
    388   kmod = PIKM_Blank;
    389   nc = XLookupString(&(evt->xkey), buf, 10, &key, &cs);
    390 
    391   if  (evt->xkey.state & ShiftMask)   
    392     kmod = (PIKeyModifier) (kmod | PIKM_Shift);
    393   if  (evt->xkey.state & ControlMask)
    394     kmod = (PIKeyModifier) (kmod | PIKM_Cntl);
    395   if  (evt->xkey.state & Mod1Mask)   
    396     kmod = (PIKeyModifier) (kmod | PIKM_Alt);
    397   switch (key) {
    398     case XK_Return :
    399       rkey = PIK_Return;
    400       break;
    401     case XK_KP_Enter :
    402       rkey = PIK_Enter;
    403       break;
    404     case XK_Up :
    405       rkey = PIK_Up;
    406       break;
    407     case XK_Down :
    408       rkey = PIK_Down;
    409       break;
    410     case XK_Left :
    411       rkey = PIK_Left;
    412       break;
    413     case XK_Right :
    414       rkey = PIK_Right;
    415       break;
    416     case XK_Prior :
    417       rkey = PIK_Previous;
    418       break;
    419     case XK_Next :
    420       rkey = PIK_Next;
    421       break;
    422     default :
    423       rkey = 0;
    424       break;
    425   }
    426   if (rkey > 0)  (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard(rkey, kmod);
    427   else for(i=0; i<nc; i++) 
    428     (((PIXtBaseWidget)wdgp)->pixtbase.objet)->Keyboard((int)(buf[i]), kmod);
    429 }
    430 return;
    431 }
    432 
    433 
    434 /* Nouvelle-Fonction
    435 static void get_GCs (PIXtBaseWidget wdgp)
    436 {
    437 
    438 XGCValues       values;
    439 XtGCMask        mask;
    440 Display *dpy;
    441 
    442 dpy = XtDisplay(wdgp);
    443 
    444 mask              = GCForeground | GCBackground ;
    445 values.foreground = WhitePixel(dpy, XDefaultScreen(dpy));
    446 values.background = BlackPixel(dpy, XDefaultScreen(dpy));
    447 wdgp->pixtbase.defgc      = XtGetGC((Widget) wdgp, mask, &values);
    448 return;
    449 }
    450 */
    451 
    452 /* Nouvelle-Fonction
    453 static void free_GCs (PIXtBaseWidget wdgp)
    454 {
    455 XtReleaseGC ((Widget) wdgp, wdgp->pixtbase.defgc);
    456 }
    457 
    458 */
    459 
     295  break;
     296}
     297
     298return;
     299}
     300
     301
  • trunk/SophyaPI/PI/pixtbase.h

    r2 r103  
    1010typedef struct _PIXtBaseRec      * PIXtBaseWidget;
    1111
    12 #define PIXNobject      "object"
     12#define PIXNobject      "mypiobject"
    1313
    1414extern WidgetClass piXtBaseWidgetClass;
    1515
     16void event_handler_pixtbase (Widget wdgp, XtPointer closure,
     17                             XEvent* evt, Boolean* cont);
     18
    1619#endif /* PIXTBASE_H_SEEN */
  • trunk/SophyaPI/PI/pixtbaseP.h

    r2 r103  
    2323{
    2424PIBaseWdgX  * objet;
     25unsigned long myeventmask;
    2526} PIXtBasePart;
    2627
Note: See TracChangeset for help on using the changeset viewer.