コード例 #1
0
/************************************************************************
 * restoreKeybd()
 *
 * restore any state information saved with saveKeybd.
 * This is called from restoreSession with the application
 * shell and the special xrm database retrieved for restore.
 ************************************************************************/
void 
restoreKeybd(
        Widget shell,
        XrmDatabase db )
{
    XrmName xrm_name[5];
    XrmRepresentation rep_type;
    XrmValue value;

    xrm_name [0] = XrmStringToQuark ("keyboardDlg");
    xrm_name [2] = NULL;

    /* get x position */
    xrm_name [1] = XrmStringToQuark ("x");
    if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
      XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr)); save.poscnt++;
      save.restoreFlag = True;
    }

    /* get y position */
    xrm_name [1] = XrmStringToQuark ("y");
    if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
      XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr)); save.poscnt++;
    }

    xrm_name [1] = XrmStringToQuark ("ismapped");
    XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
    /* Are we supposed to be mapped? */
    if (strcmp(value.addr, "True") == 0)
      popup_keyboardBB(shell);
}
コード例 #2
0
static void 
activateCB(
        Widget w,
        XtPointer client_data,
        XtPointer call_data )
{
  
  DtControlCallbackStruct *cbs = 
        (DtControlCallbackStruct *) call_data;
  char *cd;
  cd = (char *) client_data;
   
  /* if any other event besides an activate
     event invokes this callback, don't invoke 
     any dialogs.  Just ignore the event.
  */
  if (cbs->reason != XmCR_ACTIVATE) return;

  if (strcmp(cd, COLOR) == 0)
    Customize(style.shell);
  
  else if (strcmp(cd, FONT) == 0)
    popup_fontBB(style.shell);
  
  else if (strcmp(cd, BACKDROP) == 0)
    BackdropDialog (style.shell);
  
  else if (strcmp(cd, KEYBOARD) == 0)
    popup_keyboardBB(style.shell);
  
  else if (strcmp(cd, MOUSE) == 0)
    popup_mouseBB(style.shell);
  
  else if (strcmp(cd, BEEP) == 0)
    popup_audioBB(style.shell);
            
  else if (strcmp(cd, SCREEN) == 0)
    popup_screenBB(style.shell);
  
  else if (strcmp(cd, DTWM) == 0)
    popup_dtwmBB(style.shell);
  
  else if (strcmp(cd, STARTUP) == 0)
    popup_startupBB(style.shell);

  else if (strcmp(cd, I18N) == 0)
    popup_i18nBB(style.shell);

}