Example #1
0
static void
XawVendorShellClassInitialize(void)
{
    static XtConvertArgRec screenConvertArg[] = {
        {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)}
    };
#ifdef XAW_MULTIPLANE_PIXMAPS
    static XtConvertArgRec _XawCvtStrToPix[] = {
	{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)},
	{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
	     sizeof(Colormap)},
	{XtWidgetBaseOffset,
	     (XtPointer)XtOffsetOf(WidgetRec, core.background_pixel),
	     sizeof(Pixel)}
    };
#endif

    XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,
		   screenConvertArg, XtNumber(screenConvertArg));

#ifdef XAW_MULTIPLANE_PIXMAPS
    XtSetTypeConverter(XtRString, XtRBitmap,
		       (XtTypeConverter)_XawCvtStringToPixmap,
		       _XawCvtStrToPix, XtNumber(_XawCvtStrToPix),
		       XtCacheByDisplay, (XtDestructor)NULL);
#else
    XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
		   screenConvertArg, XtNumber(screenConvertArg));
#endif

    XtSetTypeConverter("CompoundText", XtRString, XawCvtCompoundTextToString,
			NULL, 0, XtCacheNone, NULL);
}
Example #2
0
void _DtTermPrimInitRepTypes(void)
{
    static Boolean first = True;

    _DtTermProcessLock();
    if (first) {
	/* register our resource converters... */
#ifdef NotDefined
	(void) XtSetTypeConverter(XmRString, DtRDtTermTerminalSize,
		CvtStringToTerminalSize, NULL, 0, XtCacheNone,
		CvtStringToTerminalSizeDestroy);
#endif /* NotDefined */
	(void) XtSetTypeConverter(XmRString, DtRDtTermTerminalSizeList,
		CvtStringToTerminalSizeList, NULL, 0, XtCacheNone,
		CvtStringToTerminalSizeListDestroy);
	(void) XmRepTypeRegister(DtRDtTermEmulationMode,
		TermEmulationModeStrings,
		NULL, (unsigned char ) XtNumber(TermEmulationModeStrings));
	(void) XmRepTypeRegister(DtRDtTermCharCursorStyle,
		CharCursorStyleStrings,
		NULL, (unsigned char ) XtNumber(CharCursorStyleStrings));

	_DtTermPrimEmulationMode = XmRepTypeGetId(DtRDtTermEmulationMode);
	_DtTermPrimCharCursorStyle = XmRepTypeGetId(DtRDtTermCharCursorStyle);

	first = False;
    }
    _DtTermProcessUnlock();

    return;
}
Example #3
0
static void
XawFormClassInitialize(void)
{
    static XtConvertArgRec parentCvtArgs[] = {
	{XtBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.parent),
	 sizeof(Widget)}
    };

    char name[12];

    XawInitializeWidgetSet();
    XmuNCopyISOLatin1Lowered(name, XtEchainLeft, sizeof(name));
    QchainLeft = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainRight, sizeof(name));
    QchainRight = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainTop, sizeof(name));
    QchainTop = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainBottom, sizeof(name));
    QchainBottom = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtErubber, sizeof(name));
    Qrubber = XrmStringToQuark(name);

    XtAddConverter(XtRString, XtREdgeType, _CvtStringToEdgeType, NULL, 0);
    XtSetTypeConverter(XtREdgeType, XtRString, CvtEdgeTypeToString,
		       NULL, 0, XtCacheNone, NULL);
    XtSetTypeConverter(XtRString, XtRWidget, XmuNewCvtStringToWidget,
		       parentCvtArgs, XtNumber(parentCvtArgs), XtCacheNone,
		       NULL);
    XtSetTypeConverter(XtRWidget, XtRString, XmuCvtWidgetToString,
		       NULL, 0, XtCacheNone, NULL);
}
Example #4
0
File: Command.c Project: aosm/X11
static void
XawCommandClassInitialize(void)
{
    XawInitializeWidgetSet();
    XtSetTypeConverter(XtRString, XtRShapeStyle, XmuCvtStringToShapeStyle,
		       NULL, 0, XtCacheNone, NULL);
    XtSetTypeConverter(XtRShapeStyle, XtRString, XmuCvtShapeStyleToString,
		       NULL, 0, XtCacheNone, NULL);
}
Example #5
0
File: Tree.c Project: PNCG/genesis
static void ClassInitialize()
{
    XtSetTypeConverter (XtRString, XtRTreemode,
                        XoCvtStringToTreemode, NULL, 0 ,
                        XtCacheNone, NULL);
    XtSetTypeConverter (XtRString, XtRHlmode,
                        XoCvtStringToHlmode, NULL, 0 ,
                        XtCacheNone, NULL);
}
Example #6
0
static void
ClassInitialize()
{
    XtSetTypeConverter(XmRString, XmRLabelAlignment,
                       CvtStringToLabelAlignment, NULL, 0,
                       XtCacheAll, NULL);

    XtSetTypeConverter(XmRString, XmRLabelPosition,
                       CvtStringToLabelPosition, NULL, 0,
                       XtCacheAll, NULL);
}
Example #7
0
static void ClassInitialize(void)
{
	_InitializeWidgetSet();

	XtSetTypeConverter(XtRString , XtRBox_type , cvtStringToBoxType,
                 NULL , 0 , XtCacheNone , NULL);

	XtSetTypeConverter(XtRString , XtRBackingStore ,
		 (XtTypeConverter)XmuCvtStringToBackingStore ,
                 NULL , 0 , XtCacheNone , NULL);

}
Example #8
0
File: Simple.c Project: aosm/X11
static void
XawSimpleClassInitialize(void)
{
    static XtConvertArgRec convertArg[] = {
    {
      XtWidgetBaseOffset,
      (XtPointer)XtOffsetOf(WidgetRec, core.screen),
      sizeof(Screen *)
    },
    {
      XtResourceString,
      (XtPointer)XtNpointerColor,
      sizeof(Pixel)
    },
    {
      XtResourceString,
      (XtPointer)XtNpointerColorBackground,
      sizeof(Pixel)
    },
    {
      XtWidgetBaseOffset,
      (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
      sizeof(Colormap)
    },
    };

    XawInitializeWidgetSet();
    XtSetTypeConverter(XtRString, XtRColorCursor, XmuCvtStringToColorCursor,
		       convertArg, XtNumber(convertArg), XtCacheByDisplay, NULL);
}
Example #9
0
static void ClassInitialize(void)
{
    _InitializeWidgetSet();

    XtSetTypeConverter(XtRString, XtRNwsJustify, cvtStringToJustify,
                       NULL, 0, XtCacheNone, NULL);
}
Example #10
0
/*
 * Function:
 *	XawSmeBSBClassInitialize
 *
 * Description:
 *	Initializes the SmeBSBObject.
 */
static void 
XawSmeBSBClassInitialize(void)
{
    XawInitializeWidgetSet();
    XtAddConverter(XtRString, XtRJustify, XmuCvtStringToJustify, NULL, 0);
    XtSetTypeConverter(XtRJustify, XtRString, XmuCvtJustifyToString,
		       NULL, 0, XtCacheNone, NULL);
}
Example #11
0
File: Tree.c Project: aosm/X11libs
static void
XawTreeClassInitialize(void)
{
    XawInitializeWidgetSet();
  XtAddConverter(XtRString, XtRGravity, XmuCvtStringToGravity, NULL, 0);
  XtSetTypeConverter(XtRGravity, XtRString, XmuCvtGravityToString,
		     NULL, 0, XtCacheNone, NULL);
}
/*
 * Implementation
 */
static void
XawScrollbarClassInitialize(void)
{
    XawInitializeWidgetSet();
    XtAddConverter(XtRString, XtROrientation, XmuCvtStringToOrientation,
		   NULL, 0);
    XtSetTypeConverter(XtROrientation, XtRString, XmuCvtOrientationToString,
		       NULL, 0, XtCacheNone, NULL);
}
Example #13
0
File: RepType.c Project: att/uwin
XmRepTypeId
XmRepTypeRegister(String rep_type,
		  String *value_names,
		  unsigned char *values,
		  unsigned char num_values)
{
    int i, len;
    char *cp;
    XmRepTypeId id = XmRepTypeGetId(rep_type);
    XmRepTypeEntryRec ne;
    XtConvertArgRec Args[1];

    if (id != XmREP_TYPE_INVALID)
    {
	return id;
    }

    if (number_of_types + 1 > max_number_of_types)
    {
	max_number_of_types = (max_number_of_types + 1) * 2;

	rep_types = (XmRepTypeList)XtRealloc((char *)rep_types,
					     sizeof(XmRepTypeListRec) *
					     max_number_of_types);
    }

    /* Find the total size of the lists and strings, and allocate it */

    len = 0;
    for (i = 0; i < num_values; i++)
	len += strlen(value_names[i]);
    cp = XtMalloc(strlen(rep_type) + 1 + num_values *
		  (values ? sizeof(String) + 2 : sizeof(String) + 1) + len);

    /* Copy the data into the new record */

    ne.rep_type_name = rep_type;
    ne.value_names = value_names;
    ne.values = values;
    ne.num_values = num_values;
    ne.reverse_installed = False;
    ne.rep_type_id = number_of_types;
    __XmRepTypeCopyRecord(rep_types + number_of_types, &ne, (String *)cp,
			  (char *)((String *)cp + num_values));

    /* now install the forward converter */

    Args[0].address_mode = XtImmediate;
    Args[0].address_id = (XtPointer)(long)number_of_types;
    Args[0].size = sizeof(XmRepTypeId);

    XtSetTypeConverter(XmRString, rep_type,
		       __XmCvtStringToRep,
		       Args, 1, XtCacheNone, NULL);
    return number_of_types++;
}
Example #14
0
File: Logo.c Project: aosm/X11
static void 
ClassInitialize(void)
{
#ifdef XRENDER
    XtSetTypeConverter (XtRString, XtRXftColor, 
			XmuCvtStringToXftColor, 
			xftColorConvertArgs, XtNumber(xftColorConvertArgs),
			XtCacheByDisplay, XmuFreeXftColor);
#endif
}
Example #15
0
/*
 * Function:
 *	XawAsciiSrcClassInitialize()
 *
 * Description:
 *	  Initializes the asciiSrcObjectClass and install the converters for
 *	AsciiType <-> String.
 */
static void
XawAsciiSrcClassInitialize(void)
{
    XawInitializeWidgetSet();
    Qstring = XrmPermStringToQuark(XtEstring);
    Qfile = XrmPermStringToQuark(XtEfile);
    XtAddConverter(XtRString, XtRAsciiType, CvtStringToAsciiType, NULL, 0);
    XtSetTypeConverter(XtRAsciiType, XtRString, CvtAsciiTypeToString,
		       NULL, 0, XtCacheNone, NULL);
}
Example #16
0
static void
XawVendorShellClassInitialize(void)
{
    static XtConvertArgRec screenConvertArg[] = {
        {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)}
    };

    XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,      
		   screenConvertArg, XtNumber(screenConvertArg));

    XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
		   screenConvertArg, XtNumber(screenConvertArg));

    XtSetTypeConverter("CompoundText", XtRString, XawCvtCompoundTextToString,
			NULL, 0, XtCacheNone, NULL);
}
Example #17
0
/*
 * standard help callback
 */
void
wl_help(Widget w, XtPointer closure, XtPointer call)
{
static	int	firsttime = TRUE;
	XtResource hr[] = {
		{
			XwlNhelpChapter, XwlCHelpChapter,
			XtRString, sizeof(String), XtOffsetOf(HELP, chapter),
			XtRString, NULL
		}, {
			XwlNhelpSection, XwlCHelpSection,
			XtRString, sizeof(String), XtOffsetOf(HELP, section),
			XtRString, NULL
		}, {
			XwlNhelpType, XwlCHelpType,
			XwlRHelpType, sizeof(WL_HELPFN), XtOffsetOf(HELP, f),
			XtRString, (XtPointer)"remote"
		}
	};
	HELP		help;
	WLP_HELP	h;
	USEUP(call); USEUP(closure);

	if(firsttime) {
		XtSetTypeConverter(XtRString, XwlRHelpType, string2help,
						NULL, 0, XtCacheNone, NULL);
		firsttime = FALSE;
	}

	for(; w != NULL; w = XtParent(w))
		if(XtHasCallbacks(w, XmNhelpCallback) == XtCallbackHasSome)
			break;
	if(w == NULL)
		return;

	memset((void *)&help, '\0', sizeof(help));
	XtGetApplicationResources(w, &help, &hr[0], XtNumber(hr), NULL, 0);
	if(help.f == NULL || help.chapter == NULL)
		return;
	h.chapter = help.chapter;
	h.section = help.section;

	help.f(w, &h);
}
Example #18
0
File: RepType.c Project: att/uwin
void
XmRepTypeAddReverse(XmRepTypeId rep_type_id)
{
    XmRepTypeEntry entry;
    XtConvertArgRec Args[1];

    if ((unsigned short)rep_type_id >= number_of_types)
	return;
    entry = rep_types + rep_type_id;

    if (!entry->reverse_installed)
    {
	entry->reverse_installed = True;

	Args[0].address_mode = XtImmediate;
	Args[0].address_id = (XtPointer)(long)entry->rep_type_id;
	Args[0].size = sizeof(XmRepTypeId);

	XtSetTypeConverter(entry->rep_type_name, XmRString,
			   (XtTypeConverter)__XmCvtRepToString,
			   Args, 1, XtCacheNone, NULL);
    }
}
Example #19
0
/*
 * Implementation
 */
static void
XawTextSinkClassPartInitialize(WidgetClass wc)
{
    TextSinkObjectClass t_src, superC;
#ifndef OLDXAW
    static XtConvertArgRec CvtArgs[] = {
      {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.self),
       sizeof(Widget)},
    };
#endif

    t_src = (TextSinkObjectClass) wc;
    superC = (TextSinkObjectClass) t_src->object_class.superclass;

#ifndef OLDXAW
    extension_rec.record_type = XrmPermStringToQuark("TextSink");
    extension_rec.next_extension = (XtPointer)t_src->text_sink_class.extension;
    t_src->text_sink_class.extension = &extension_rec;

    Qdefault = XrmPermStringToQuark("default");
#endif

    /* 
     * We don't need to check for null super since we'll get to TextSink
     * eventually.
     */
    if (t_src->text_sink_class.DisplayText == XtInheritDisplayText)
	t_src->text_sink_class.DisplayText =
	    superC->text_sink_class.DisplayText;

    if (t_src->text_sink_class.InsertCursor == XtInheritInsertCursor)
	t_src->text_sink_class.InsertCursor =
	    superC->text_sink_class.InsertCursor;

    if (t_src->text_sink_class.ClearToBackground== XtInheritClearToBackground)
	t_src->text_sink_class.ClearToBackground =
	    superC->text_sink_class.ClearToBackground;

    if (t_src->text_sink_class.FindPosition == XtInheritFindPosition)
	t_src->text_sink_class.FindPosition =
	    superC->text_sink_class.FindPosition;

    if (t_src->text_sink_class.FindDistance == XtInheritFindDistance)
	t_src->text_sink_class.FindDistance =
	    superC->text_sink_class.FindDistance;

    if (t_src->text_sink_class.Resolve == XtInheritResolve)
	t_src->text_sink_class.Resolve =
	    superC->text_sink_class.Resolve;

    if (t_src->text_sink_class.MaxLines == XtInheritMaxLines)
	t_src->text_sink_class.MaxLines =
	    superC->text_sink_class.MaxLines;

    if (t_src->text_sink_class.MaxHeight == XtInheritMaxHeight)
	t_src->text_sink_class.MaxHeight =
	    superC->text_sink_class.MaxHeight;

    if (t_src->text_sink_class.SetTabs == XtInheritSetTabs)
	t_src->text_sink_class.SetTabs =
	    superC->text_sink_class.SetTabs;

    if (t_src->text_sink_class.GetCursorBounds == XtInheritGetCursorBounds)
	t_src->text_sink_class.GetCursorBounds =
	    superC->text_sink_class.GetCursorBounds;

#ifndef OLDXAW
    XtSetTypeConverter(XtRString, XawRTextProperties, CvtStringToPropertyList,
		       &CvtArgs[0], XtNumber(CvtArgs), XtCacheNone, NULL);
    XtSetTypeConverter(XawRTextProperties, XtRString, CvtPropertyListToString,
		       NULL, 0, XtCacheNone, NULL);
#endif
}
Example #20
0
File: Var.c Project: PNCG/genesis
static void ClassInitialize()
{
  XtSetTypeConverter (XtRString, XtRVarmode,
                      XoCvtStringToVarmode, NULL, 0 ,
                      XtCacheNone, NULL);
}
Example #21
0
/*
 * Implementation
 */
void
XawInitializeDefaultConverters(void)
{
  static Boolean first_time = True;

  if (first_time == False)
    return;

  first_time = False;

  /* Replace with more apropriate converters */
  XtSetTypeConverter(XtRCallback, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRColormap, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRFunction, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRPointer, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRScreen, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRStringArray, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRVisual, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRWidget, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRWidgetList, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRWindow, XtRString, _XawCvtCARD32ToString,
		     NULL, 0, XtCacheNone, NULL);

  XtSetTypeConverter(XtRAtom, XtRString, _XawCvtAtomToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRBool, XtRString,  _XawCvtBoolToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRBoolean, XtRString,  _XawCvtBooleanToString,
		     NULL, 0,  XtCacheNone, NULL);
  XtSetTypeConverter(XtRCardinal, XtRString, _XawCvtCardinalToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRDimension, XtRString, _XawCvtDimensionToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XawRDisplayList, XtRString, _XawCvtDisplayListToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRFontStruct, XtRString, _XawCvtFontStructToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRInt, XtRString, _XawCvtIntToString,
		     NULL, 0, XtCacheNone, NULL);
  XtSetTypeConverter(XtRPixel, XtRString, _XawCvtPixelToString,
		     &PixelArgs[0], XtNumber(PixelArgs), XtCacheNone, NULL);
  XtSetTypeConverter(XtRPixmap, XtRString, _XawCvtPixmapToString,
		     &DLArgs[0], XtNumber(DLArgs), XtCacheNone, NULL);
  XtSetTypeConverter(XtRPosition, XtRString, _XawCvtPositionToString,
		     NULL, 0, XtCacheNone,  NULL);
  XtSetTypeConverter(XtRShort, XtRString, _XawCvtShortToString,
		     NULL, 0, XtCacheNone,  NULL);
  XtSetTypeConverter(XtRString, XawRDisplayList, _XawCvtStringToDisplayList,
		     &DLArgs[0], XtNumber(DLArgs), XtCacheAll, NULL);
  XtSetTypeConverter(XtRString, XtRPixmap, _XawCvtStringToPixmap,
		     &DLArgs[0], XtNumber(DLArgs), XtCacheAll, NULL);
  XtSetTypeConverter(XtRUnsignedChar, XtRString, _XawCvtUnsignedCharToString,
		     NULL, 0, XtCacheNone, NULL);
}