Exemple #1
0
/*ARGSUSED*/
void
XmuCvtStringToBackingStore(XrmValue *args, Cardinal *num_args,
			   XrmValuePtr fromVal, XrmValuePtr toVal)
{
    XrmQuark	q;
  char name[11];
    static int	backingStoreType;

    if (*num_args != 0)
        XtWarning("String to BackingStore conversion needs no extra arguments");

  InitializeQuarks();
  XmuNCopyISOLatin1Lowered(name, (char *)fromVal->addr, sizeof(name));

  q = XrmStringToQuark (name);
  if (q == QnotUseful)
	backingStoreType = NotUseful;
  else if (q == QwhenMapped)
    	backingStoreType = WhenMapped;
  else if (q == Qalways)
	backingStoreType = Always;
  else if (q == Qdefault)
    	backingStoreType = Always + WhenMapped + NotUseful;
  else
    {
      XtStringConversionWarning((char *)fromVal->addr, XtRBackingStore);
      return;
    }
  toVal->size = sizeof(int);
  toVal->addr = (XPointer)&backingStoreType;
}
Exemple #2
0
/*ARGSUSED*/
void
XmuCvtStringToJustify(XrmValuePtr args, Cardinal *num_args,
		      XrmValuePtr fromVal, XrmValuePtr toVal)
{
    static XtJustify	e;
    XrmQuark    q;
  char *s = (char *)fromVal->addr;
  char name[7];

  if (s == NULL)
    return;

  InitializeQuarks();
  XmuNCopyISOLatin1Lowered(name, s, sizeof(name));

  q = XrmStringToQuark(name);

    toVal->size = sizeof(XtJustify);
  toVal->addr = (XPointer)&e;

  if (q == Qleft)
    e = XtJustifyLeft;
  else if (q == Qcenter)
    e = XtJustifyCenter;
  else if (q == Qright)
    e = XtJustifyRight;
  else
    {
    toVal->addr = NULL;
    XtStringConversionWarning((char *)fromVal->addr, XtRJustify);
    }
}
Exemple #3
0
/*ARGSUSED*/
void
XmuCvtStringToOrientation(XrmValuePtr args, Cardinal *num_args,
			  XrmValuePtr fromVal, XrmValuePtr toVal)
{
    static XtOrientation orient;
    XrmQuark	q;
  char name[11];

  InitializeQuarks();
  XmuNCopyISOLatin1Lowered(name, (char *)fromVal->addr, sizeof(name));
  q = XrmStringToQuark(name);

  toVal->size = sizeof(XtJustify);
  toVal->addr = (XPointer)&orient;

  if (q == Qhorizontal)
    	orient = XtorientHorizontal;
  else if (q == Qvertical)
    	orient = XtorientVertical;
  else
    {
      toVal->addr = NULL;
      XtStringConversionWarning((char *)fromVal->addr, XtROrientation);
    }
}