Mercurial > hg > xemacs-beta
changeset 4522:fc7067b7f407
Backout last patch; forgot to specify file.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Wed, 29 Oct 2008 03:37:16 +0900 |
parents | 383ab474a241 |
children | 6a3006b37260 |
files | lisp/ChangeLog lisp/version.el lwlib/ChangeLog lwlib/lwlib-Xaw.c lwlib/lwlib-Xlw.c lwlib/lwlib-Xm.c lwlib/lwlib.c lwlib/lwlib.h lwlib/xlwcheckbox.c lwlib/xlwgauge.c lwlib/xlwmenu.c lwlib/xlwradio.c lwlib/xlwscrollbar.c lwlib/xlwtabs.c src/EmacsFrame.c src/EmacsManager.c src/EmacsShell-sub.c src/console-x.h src/device-x.c src/emacs.c src/emodules.c src/event-Xt.c src/event-stream.c src/file-coding.c src/file-coding.h src/frame-x.c src/gif_io.c src/glyphs-x.c src/input-method-xlib.c src/menubar-x.c src/mule-coding.c src/print.c src/redisplay.c |
diffstat | 33 files changed, 890 insertions(+), 812 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Oct 28 10:38:26 2008 +0900 +++ b/lisp/ChangeLog Wed Oct 29 03:37:16 2008 +0900 @@ -1,7 +1,3 @@ -2008-10-28 Stephen J. Turnbull <stephen@xemacs.org> - - * version.el (xemacs-betaname): Fix docstring typo. (Thanks, Ville!) - 2008-09-30 Stephen J. Turnbull <stephen@xemacs.org> * version.el (xemacs-betaname):
--- a/lisp/version.el Tue Oct 28 10:38:26 2008 +0900 +++ b/lisp/version.el Wed Oct 29 03:37:16 2008 +0900 @@ -34,7 +34,7 @@ (and emacs-beta-version (format "(beta%d)" emacs-beta-version)) "Non-nil when this is a test (beta) version of XEmacs. Warning, this variable did not exist in XEmacs versions prior to 20.3. -Its value is derived from `emacs-beta-version'. It is mutually exclusive +It value is derived from `emacs-beta-version'. It is mutually exclusive with `emacs-patch-level'.") (defconst emacs-version
--- a/lwlib/ChangeLog Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/ChangeLog Wed Oct 29 03:37:16 2008 +0900 @@ -1,7 +1,3 @@ -2008-10-26 Stephen J. Turnbull <stephen@xemacs.org> - - * lwlib-Xm.c (xm_update_progress): Set all values! - 2007-09-15 Jerry James <james@xemacs.org> * xlwmenu.c (XlwMenuDestroy): Release XftFont resources
--- a/lwlib/lwlib-Xaw.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/lwlib-Xaw.c Wed Oct 29 03:37:16 2008 +0900 @@ -88,15 +88,15 @@ Arg al [10]; /* First size and position the scrollbar widget. */ - Xt_SET_ARG (al [0], XtNx, data->scrollbar_x); - Xt_SET_ARG (al [1], XtNy, data->scrollbar_y); - Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width); - Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height); + XtSetArg (al [0], XtNx, data->scrollbar_x); + XtSetArg (al [1], XtNy, data->scrollbar_y); + XtSetArg (al [2], XtNwidth, data->scrollbar_width); + XtSetArg (al [3], XtNheight, data->scrollbar_height); XtSetValues (widget, al, 4); /* Now size the scrollbar's slider. */ - Xt_SET_ARG (al [0], XtNtopOfThumb, &widget_topOfThumb); - Xt_SET_ARG (al [1], XtNshown, &widget_shown); + XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb); + XtSetArg (al [1], XtNshown, &widget_shown); XtGetValues (widget, al, 2); new_shown = (double) data->slider_size / @@ -142,37 +142,47 @@ #endif #ifdef LWLIB_DIALOGS_ATHENA else if (XtIsSubclass (widget, dialogWidgetClass)) - Xt_SET_VALUE (widget, XtNlabel, val->contents->value); + { + Arg al [1]; + XtSetArg (al [0], XtNlabel, val->contents->value); + XtSetValues (widget, al, 1); + } #endif /* LWLIB_DIALOGS_ATHENA */ #ifdef LWLIB_WIDGETS_ATHENA else if (XtClass (widget) == labelWidgetClass) - Xt_SET_VALUE (widget, XtNlabel, val->value); + { + Arg al [1]; + XtSetArg (al [0], XtNlabel, val->value); + XtSetValues (widget, al, 1); + } #endif /* LWLIB_WIDGETS_ATHENA */ #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA) else if (XtIsSubclass (widget, commandWidgetClass)) { + Dimension bw = 0; Arg al [3]; + XtSetArg (al [0], XtNborderWidth, &bw); + XtGetValues (widget, al, 1); #ifndef LWLIB_DIALOGS_ATHENA3D - { - Dimension bw = 0; - Xt_GET_VALUE (widget, XtNborderWidth, &bw); - if (bw == 0) - /* Don't let buttons end up with 0 borderwidth, that's ugly... - Yeah, all this should really be done through app-defaults files - or fallback resources, but that's a whole different can of worms - that I don't feel like opening right now. Making Athena widgets - not look like shit is just entirely too much work. - */ - Xt_SET_VALUE (widget, XtNborderWidth, 1); + if (bw == 0) + /* Don't let buttons end up with 0 borderwidth, that's ugly... + Yeah, all this should really be done through app-defaults files + or fallback resources, but that's a whole different can of worms + that I don't feel like opening right now. Making Athena widgets + not look like shit is just entirely too much work. + */ + { + XtSetArg (al [0], XtNborderWidth, 1); + XtSetValues (widget, al, 1); } #endif /* ! LWLIB_DIALOGS_ATHENA3D */ lw_remove_accelerator_spec (val->value); - Xt_SET_ARG (al [0], XtNlabel, val->value); - Xt_SET_ARG (al [1], XtNsensitive, val->enabled); + XtSetArg (al [0], XtNlabel, val->value); + XtSetArg (al [1], XtNsensitive, val->enabled); /* Force centered button text. See above. */ - Xt_SET_ARG (al [2], XtNjustify, XtJustifyCenter); + XtSetArg (al [2], XtNjustify, XtJustifyCenter); XtSetValues (widget, al, 3); XtRemoveAllCallbacks (widget, XtNcallback); @@ -180,7 +190,10 @@ #ifdef LWLIB_WIDGETS_ATHENA /* set the selected state */ if (XtIsSubclass (widget, toggleWidgetClass)) - Xt_SET_VALUE (widget, XtNstate, val->selected); + { + XtSetArg (al [0], XtNstate, val->selected); + XtSetValues (widget, al, 1); + } #endif /* LWLIB_WIDGETS_ATHENA */ } #endif /* LWLIB_DIALOGS_ATHENA */ @@ -206,15 +219,19 @@ if (XtIsSubclass (widget, toggleWidgetClass)) { - Xt_GET_VALUE (widget, XtNstate, &val->selected); + Arg al [1]; + XtSetArg (al [0], XtNstate, &val->selected); + XtGetValues (widget, al, 1); val->edited = True; } #ifndef NEED_MOTIF else if (XtIsSubclass (widget, asciiTextWidgetClass)) { + Arg al [2]; String buf = 0; + XtSetArg (al [0], XtNstring, &buf); + XtGetValues (widget, al, 1); - Xt_GET_VALUE (widget, XtNstring, &buf); if (val->value) { free (val->value); @@ -322,7 +339,7 @@ static XtActionProc wm_delete_window (Widget shell, XtPointer closure, XtPointer call_data); static XtActionsRec xaw_actions [] = { - { (String) "lwlib_delete_dialog", (XtActionProc) wm_delete_window} + {"lwlib_delete_dialog", (XtActionProc) wm_delete_window} }; static Boolean actions_initted = False; @@ -358,9 +375,9 @@ override = XtParseTranslationTable (overrideTrans); ac = 0; - Xt_SET_ARG (av[ac], XtNtitle, shell_title); ac++; - Xt_SET_ARG (av[ac], XtNallowShellResize, True); ac++; - Xt_SET_ARG (av[ac], XtNtransientFor, parent); ac++; + XtSetArg (av[ac], XtNtitle, shell_title); ac++; + XtSetArg (av[ac], XtNallowShellResize, True); ac++; + XtSetArg (av[ac], XtNtransientFor, parent); ac++; shell = XtCreatePopupShell ("dialog", transientShellWidgetClass, parent, av, ac); XtOverrideTranslations (shell, override); @@ -373,12 +390,12 @@ for (i = 0; i < left_buttons; i++) { ac = 0; - Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; - Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++; - Xt_SET_ARG (av [ac], XtNright, XtChainLeft); ac++; - Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNresizable, True); ac++; + XtSetArg (av [ac], XtNfromHoriz, button); ac++; + XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; + XtSetArg (av [ac], XtNright, XtChainLeft); ac++; + XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; + XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; + XtSetArg (av [ac], XtNresizable, True); ac++; sprintf (button_name, "button%d", ++bc); button = XtCreateManagedWidget (button_name, commandWidgetClass, dialog, av, ac); @@ -393,18 +410,18 @@ window) but I can't seem to make it do it. */ ac = 0; - Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; -/* Xt_SET_ARG (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */ - Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++; - Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++; - Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNlabel, ""); ac++; - Xt_SET_ARG (av [ac], XtNwidth, 30); /* #### aaack!! */ ac++; - Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++; - Xt_SET_ARG (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++; - Xt_SET_ARG (av [ac], XtNresizable, False); ac++; - Xt_SET_ARG (av [ac], XtNsensitive, False); ac++; + XtSetArg (av [ac], XtNfromHoriz, button); ac++; +/* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */ + XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; + XtSetArg (av [ac], XtNright, XtChainRight); ac++; + XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; + XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; + XtSetArg (av [ac], XtNlabel, ""); ac++; + XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */ + XtSetArg (av [ac], XtNborderWidth, 0); ac++; + XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++; + XtSetArg (av [ac], XtNresizable, False); ac++; + XtSetArg (av [ac], XtNsensitive, False); ac++; button = XtCreateManagedWidget ("separator", /* labelWidgetClass, */ /* This has to be Command to fake out @@ -415,12 +432,12 @@ for (i = 0; i < right_buttons; i++) { ac = 0; - Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; - Xt_SET_ARG (av [ac], XtNleft, XtChainRight); ac++; - Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++; - Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; - Xt_SET_ARG (av [ac], XtNresizable, True); ac++; + XtSetArg (av [ac], XtNfromHoriz, button); ac++; + XtSetArg (av [ac], XtNleft, XtChainRight); ac++; + XtSetArg (av [ac], XtNright, XtChainRight); ac++; + XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; + XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; + XtSetArg (av [ac], XtNresizable, True); ac++; sprintf (button_name, "button%d", ++bc); button = XtCreateManagedWidget (button_name, commandWidgetClass, dialog, av, ac); @@ -508,10 +525,13 @@ if (XtIsSubclass (widget, toggleWidgetClass)) { Boolean check; + Arg al [1]; - Xt_GET_VALUE (widget, XtNstate, &check); + XtSetArg (al [0], XtNstate, &check); + XtGetValues (widget, al, 1); - Xt_SET_VALUE (widget, XtNstate, !check); + XtSetArg (al [0], XtNstate, !check); + XtSetValues (widget, al, 1); } #endif /* LWLIB_WIDGETS_ATHENA */ lw_internal_update_other_instances (widget, closure, call_data); @@ -529,7 +549,11 @@ #if 0 user_data = NULL; - Xt_GET_VALUE (widget, XtNuserData, &user_data); + { + Arg al [1]; + XtSetArg (al [0], XtNuserData, &user_data); + XtGetValues (widget, al, 1); + } #else /* Damn! Athena doesn't give us a way to hang our own data on the buttons, so we have to go find it... I guess this assumes that @@ -570,10 +594,11 @@ LWLIB_ID id; Widget *kids = 0; Widget widget; - + Arg al [1]; if (! XtIsSubclass (shell, shellWidgetClass)) abort (); - Xt_GET_VALUE (shell, XtNchildren, &kids); + XtSetArg (al [0], XtNchildren, &kids); + XtGetValues (shell, al, 1); if (!kids || !*kids) abort (); for (widget = *kids; @@ -672,11 +697,11 @@ top-level aware of this so that people could have a border but so few people use the Athena scrollbar now that it really isn't worth the effort, at least not at the moment. */ - Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++; - Xt_SET_ARG (av [ac], XtNorientation, - vertical ? XtorientVertical : XtorientHorizontal); ac++; - Xt_SET_ARG (av [ac], "jumpProc", jumpCallbacks); ac++; - Xt_SET_ARG (av [ac], "scrollProc", scrollCallbacks); ac++; + XtSetArg (av [ac], XtNborderWidth, 0); ac++; + XtSetArg (av [ac], XtNorientation, + vertical ? XtorientVertical : XtorientHorizontal); ac++; + XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++; + XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++; return XtCreateWidget (instance->info->name, scrollbarWidgetClass, instance->parent, av, ac); @@ -705,13 +730,13 @@ Widget button = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -724,7 +749,7 @@ { if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) { - Xt_SET_ARG (al [ac], XtNstate, val->selected); ac++; + XtSetArg (al [ac], XtNstate, val->selected); ac++; button = XtCreateWidget (val->name, val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass, @@ -758,9 +783,9 @@ int ac = 0; Widget label = 0; - Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -843,20 +868,20 @@ #if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { - Xt_SET_ARG (al [ac], XtNsensitive, False); ac++; + XtSetArg (al [ac], XtNsensitive, False); ac++; } else { - Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; } #else - Xt_SET_ARG (al [ac], XtNsensitive, True); ac++; + XtSetArg (al [ac], XtNsensitive, True); ac++; #endif - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++; - Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; - Xt_SET_ARG (al [ac], XtNntics, (Cardinal)10); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; + XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; + XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -890,18 +915,18 @@ Widget text = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; - Xt_SET_ARG (al [ac], XtNtype, XawAsciiString); ac++; - Xt_SET_ARG (al [ac], XtNeditType, XawtextEdit); ac++; - Xt_SET_ARG (al [ac], XtNuseStringInPlace, False); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XtNtype, XawAsciiString); ac++; + XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++; + XtSetArg (al [ac], XtNuseStringInPlace, False); ac++; #if 0 - Xt_SET_ARG (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++; + XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++; #endif if (val->value) { - Xt_SET_ARG (al [ac], XtNstring, val->value); ac++; + XtSetArg (al [ac], XtNstring, val->value); ac++; } /* add any args the user supplied for creation time */ @@ -931,8 +956,8 @@ #endif #ifdef LWLIB_WIDGETS_ATHENA {"button", xaw_create_button }, - {"label", xaw_create_label_field }, - {"text-field", xaw_create_text_field }, + { "label", xaw_create_label_field }, + {"text-field", xaw_create_text_field }, {"progress", xaw_create_progress }, #endif {NULL, NULL}
--- a/lwlib/lwlib-Xlw.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/lwlib-Xlw.c Wed Oct 29 03:37:16 2008 +0900 @@ -122,7 +122,7 @@ Arg al [1]; Widget widget; - Xt_SET_ARG (al [0], XtNmenu, instance->info->val); + XtSetArg (al [0], XtNmenu, instance->info->val); widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass, instance->parent, al, 1); XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); @@ -139,8 +139,8 @@ popup_shell = XtCreatePopupShell (instance->info->name, overrideShellWidgetClass, instance->parent, NULL, 0); - Xt_SET_ARG (al [0], XtNmenu, instance->info->val); - Xt_SET_ARG (al [1], XtNhorizontal, False); + XtSetArg (al [0], XtNmenu, instance->info->val); + XtSetArg (al [1], XtNhorizontal, False); widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass, popup_shell, al, 2); XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); @@ -234,20 +234,20 @@ callbacks[0].closure = (XtPointer) instance; - Xt_SET_ARG (al[ac], XmNminimum, 1); ac++; - Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++; - Xt_SET_ARG (al[ac], XmNincrement, 1); ac++; - Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++; - Xt_SET_ARG (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++; + XtSetArg (al[ac], XmNminimum, 1); ac++; + XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++; + XtSetArg (al[ac], XmNincrement, 1); ac++; + XtSetArg (al[ac], XmNpageIncrement, 1); ac++; + XtSetArg (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++; - Xt_SET_ARG (al[ac], XmNdecrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNdragCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNincrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNpageDecrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNpageIncrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNtoBottomCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNtoTopCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNvalueChangedCallback, callbacks); ac++; + XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNdragCallback, callbacks); ac++; + XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++; + XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++; + XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++; return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass, instance->parent, al, ac); @@ -278,15 +278,15 @@ Arg al [4]; /* First size and position the scrollbar widget. */ - Xt_SET_ARG (al [0], XtNx, data->scrollbar_x); - Xt_SET_ARG (al [1], XtNy, data->scrollbar_y); - Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width); - Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height); + XtSetArg (al [0], XtNx, data->scrollbar_x); + XtSetArg (al [1], XtNy, data->scrollbar_y); + XtSetArg (al [2], XtNwidth, data->scrollbar_width); + XtSetArg (al [3], XtNheight, data->scrollbar_height); XtSetValues (widget, al, 4); /* Now size the scrollbar's slider. */ - Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize); - Xt_SET_ARG (al [1], XmNvalue, &widget_val); + XtSetArg (al [0], XmNsliderSize, &widget_sliderSize); + XtSetArg (al [1], XmNvalue, &widget_val); XtGetValues (widget, al, 2); percent = (double) data->slider_size / @@ -382,9 +382,9 @@ Widget tab = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++; - Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++; + XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++; + XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -406,7 +406,7 @@ Arg al[1]; /* Children are always invisible, don't permit resizing. */ - Xt_SET_ARG (al[0], XtNresizable, False); + XtSetArg (al[0], XtNresizable, False); for (cur = val; cur; cur = cur->next) { @@ -479,8 +479,8 @@ Widget clip = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++; - Xt_SET_ARG (al [ac], XtNsensitive, True); ac++; + XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++; + XtSetArg (al [ac], XtNsensitive, True); ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -557,11 +557,13 @@ else if (class_ == xlwMenuWidgetClass) { XlwMenuWidget mw; + Arg al [1]; if (XtIsShell (widget)) mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0]; else mw = (XlwMenuWidget)widget; - Xt_SET_VALUE (widget, XtNmenu, val); /* #### mw unused! */ + XtSetArg (al [0], XtNmenu, val); + XtSetValues (widget, al, 1); /* #### mw unused! */ } #endif #ifdef LWLIB_SCROLLBARS_LUCID
--- a/lwlib/lwlib-Xm.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/lwlib-Xm.c Wed Oct 29 03:37:16 2008 +0900 @@ -216,7 +216,8 @@ int type; /* Don't clobber pixmap types. */ - Xt_GET_VALUE (widget, XmNlabelType, &type); + XtSetArg (al [0], XmNlabelType, &type); + XtGetValues (widget, al, 1); if (type == XmPIXMAP) return; @@ -279,14 +280,14 @@ } } - Xt_SET_ARG (al [ac], XmNlabelString, built_string); ac++; - Xt_SET_ARG (al [ac], XmNlabelType, XmSTRING); ac++; + XtSetArg (al [ac], XmNlabelString, built_string); ac++; + XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++; } if (val->key) { key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); - Xt_SET_ARG (al [ac], XmNacceleratorText, key_string); ac++; + XtSetArg (al [ac], XmNacceleratorText, key_string); ac++; } if (ac) @@ -341,7 +342,9 @@ xm_update_pushbutton (widget_instance* instance, Widget widget, widget_value* UNUSED (val)) { - Xt_SET_VALUE (widget, XmNalignment, XmALIGNMENT_CENTER); + Arg al [1]; + XtSetArg (al [0], XmNalignment, XmALIGNMENT_CENTER); + XtSetValues (widget, al, 1); XtRemoveAllCallbacks (widget, XmNactivateCallback); XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); } @@ -357,21 +360,21 @@ Dimension width = 0; if (!val->call_data) { - Xt_SET_ARG (al [ac], XmNeditable, False); ac++; + XtSetArg (al [ac], XmNeditable, False); ac++; } else { - Xt_SET_ARG (al [ac], XmNeditable, val->enabled); ac++; + XtSetArg (al [ac], XmNeditable, val->enabled); ac++; } - height = (Dimension) lw_get_value_arg (val, XtNheight); - width = (Dimension) lw_get_value_arg (val, XtNwidth); + height = (Dimension)lw_get_value_arg (val, XtNheight); + width = (Dimension)lw_get_value_arg (val, XtNwidth); if (height > 0) { - Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++; + XtSetArg (al [ac], XmNscaleHeight, height); ac++; } if (width > 0) { - Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++; + XtSetArg (al [ac], XmNscaleWidth, width); ac++; } XtSetValues (scale, al, ac); @@ -416,8 +419,8 @@ XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); XtAddCallback (widget, XmNvalueChangedCallback, xm_generic_callback, instance); - Xt_SET_ARG (al [0], XmNset, val->selected); - Xt_SET_ARG (al [1], XmNalignment, XmALIGNMENT_BEGINNING); + XtSetArg (al [0], XmNset, val->selected); + XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING); XtSetValues (widget, al, 1); } @@ -444,8 +447,8 @@ if (toggle) { Arg al [2]; - Xt_SET_ARG (al [0], XmNsensitive, cur->enabled); - Xt_SET_ARG (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False)); + XtSetArg (al [0], XmNsensitive, cur->enabled); + XtSetArg (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False)); XtSetValues (toggle, al, 2); } } @@ -455,7 +458,11 @@ { toggle = XtNameToWidget (widget, val->value); if (toggle) - Xt_SET_VALUE (toggle, XmNset, True); + { + Arg al [1]; + XtSetArg (al [0], XmNset, True); + XtSetValues (toggle, al, 1); + } } } @@ -504,7 +511,8 @@ children = (Widget*)XtMalloc (num_children * sizeof (Widget)); /* tricky way to know if this RowColumn is a menubar or a pulldown... */ - Xt_GET_VALUE (widget, XmNisHomogeneous, &menubar_p); + XtSetArg (al [0], XmNisHomogeneous, &menubar_p); + XtGetValues (widget, al, 1); /* add the unmap callback for popups and pulldowns */ /*** this sounds bogus ***/ @@ -520,9 +528,9 @@ { ac = 0; button = 0; - Xt_SET_ARG (al [ac], XmNsensitive, cur->enabled); ac++; - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNuserData, cur->call_data); ac++; + XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNuserData, cur->call_data); ac++; switch (cur->type) { @@ -537,14 +545,14 @@ /* #### - xlwmenu.h supports several types that motif does not. Also, motif supports pixmaps w/ type NO_LINE and lwlib provides no way to access that functionality. --Stig */ - Xt_SET_ARG (al [ac], XmNseparatorType, cur->value); ac++; + XtSetArg (al [ac], XmNseparatorType, cur->value), ac++; } button = XmCreateSeparator (widget, "separator", al, ac); break; case CASCADE_TYPE: menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0); make_menu_in_widget (instance, menu, cur->contents); - Xt_SET_ARG (al [ac], XmNsubMenuId, menu); ac++; + XtSetArg (al [ac], XmNsubMenuId, menu); ac++; button = XmCreateCascadeButton (widget, cur->name, al, ac); xm_safe_update_label (instance, button, cur); @@ -559,10 +567,10 @@ button = XmCreateLabel (widget, cur->name, al, ac); else if (cur->type == TOGGLE_TYPE || cur->type == RADIO_TYPE) { - Xt_SET_ARG (al [ac], XmNindicatorType, + XtSetArg (al [ac], XmNindicatorType, (cur->type == TOGGLE_TYPE ? - XmN_OF_MANY : XmONE_OF_MANY)); ac++; - Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++; + XmN_OF_MANY : XmONE_OF_MANY)); ac++; + XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++; button = XmCreateToggleButtonGadget (widget, cur->name, al, ac); } else @@ -589,7 +597,11 @@ height if you don't manage them until after you set this and as a bonus the Help menu ends up where it is supposed to. */ if (button) - Xt_SET_VALUE (widget, XmNmenuHelpWidget, button); + { + ac = 0; + XtSetArg (al [ac], XmNmenuHelpWidget, button); ac++; + XtSetValues (widget, al, ac); + } if (num_children) XtManageChildren (children, num_children); @@ -611,8 +623,8 @@ /* update the sensitivity and userdata */ /* Common to all widget types */ - Xt_SET_ARG (al [0], XmNsensitive, val->enabled); - Xt_SET_ARG (al [1], XmNuserData, val->call_data); + XtSetArg (al [0], XmNsensitive, val->enabled); + XtSetArg (al [1], XmNuserData, val->call_data); XtSetValues (widget, al, 2); /* update the menu button as a label. */ @@ -630,7 +642,8 @@ /* update the pulldown/pullaside as needed */ menu = NULL; - Xt_GET_VALUE (widget, XmNsubMenuId, &menu); + XtSetArg (al [0], XmNsubMenuId, &menu); + XtGetValues (widget, al, 1); contents = val->contents; @@ -640,12 +653,16 @@ { menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0); make_menu_in_widget (instance, menu, contents); - Xt_SET_VALUE (widget, XmNsubMenuId, menu); + ac = 0; + XtSetArg (al [ac], XmNsubMenuId, menu); ac++; + XtSetValues (widget, al, ac); } } else if (!contents) { - Xt_SET_VALUE (widget, XmNsubMenuId, NULL); + ac = 0; + XtSetArg (al [ac], XmNsubMenuId, NULL); ac++; + XtSetValues (widget, al, ac); XtDestroyWidget (menu); } else if (deep_p && contents->change != NO_CHANGE) @@ -755,15 +772,15 @@ Arg al [4]; /* First size and position the scrollbar widget. */ - Xt_SET_ARG (al [0], XtNx, data->scrollbar_x); - Xt_SET_ARG (al [1], XtNy, data->scrollbar_y); - Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width); - Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height); + XtSetArg (al [0], XtNx, data->scrollbar_x); + XtSetArg (al [1], XtNy, data->scrollbar_y); + XtSetArg (al [2], XtNwidth, data->scrollbar_width); + XtSetArg (al [3], XtNheight, data->scrollbar_height); XtSetValues (widget, al, 4); /* Now size the scrollbar's slider. */ - Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize); - Xt_SET_ARG (al [1], XmNvalue, &widget_val); + XtSetArg (al [0], XmNsliderSize, &widget_sliderSize); + XtSetArg (al [1], XmNvalue, &widget_val); XtGetValues (widget, al, 2); percent = (double) data->slider_size / @@ -828,8 +845,8 @@ val->edited = False; /* Common to all widget types */ - Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetValues (widget, al, ac); #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF) @@ -858,7 +875,8 @@ { Boolean radiobox = 0; - Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox); + XtSetArg (al [0], XmNradioBehavior, &radiobox); + XtGetValues (widget, al, 1); if (radiobox) xm_update_radiobox (instance, widget, val); @@ -920,7 +938,9 @@ if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass) { - Xt_GET_VALUE (widget, XmNset, &val->selected); + Arg al [1]; + XtSetArg (al [0], XmNset, &val->selected); + XtGetValues (widget, al, 1); val->edited = True; } else if (class_ == xmTextWidgetClass) @@ -940,8 +960,11 @@ else if (class_ == xmRowColumnWidgetClass) { Boolean radiobox = 0; - - Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox); + { + Arg al [1]; + XtSetArg (al [0], XmNradioBehavior, &radiobox); + XtGetValues (widget, al, 1); + } if (radiobox) { @@ -951,8 +974,10 @@ { int set = False; Widget toggle = radio->composite.children [i]; + Arg al [1]; - Xt_GET_VALUE (toggle, XmNset, &set); + XtSetArg (al [0], XmNset, &set); + XtGetValues (toggle, al, 1); if (set) { if (val->value) @@ -1105,42 +1130,42 @@ if (pop_up_p) { ac = 0; - Xt_SET_ARG(al[ac], XmNtitle, shell_title); ac++; - Xt_SET_ARG(al[ac], XtNallowShellResize, True); ac++; - Xt_SET_ARG(al[ac], XmNdeleteResponse, XmUNMAP); ac++; + XtSetArg(al[ac], XmNtitle, shell_title); ac++; + XtSetArg(al[ac], XtNallowShellResize, True); ac++; + XtSetArg(al[ac], XmNdeleteResponse, XmUNMAP); ac++; result = XmCreateDialogShell (parent, "dialog", al, ac); - Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE); ac++; -/* Xt_SET_ARG(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */ - Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; + XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++; +/* XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */ + XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; form = XmCreateForm (result, (char *) shell_title, al, ac); } else { ac = 0; - Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE); ac++; - Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; + XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++; + XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; form = XmCreateForm (parent, (char *) shell_title, al, ac); result = form; } ac = 0; - Xt_SET_ARG(al[ac], XmNpacking, XmPACK_COLUMN); ac++; - Xt_SET_ARG(al[ac], XmNorientation, XmVERTICAL); ac++; - Xt_SET_ARG(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++; - Xt_SET_ARG(al[ac], XmNmarginWidth, 0); ac++; - Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++; - Xt_SET_ARG(al[ac], XmNspacing, 13); ac++; - Xt_SET_ARG(al[ac], XmNadjustLast, False); ac++; - Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; - Xt_SET_ARG(al[ac], XmNisAligned, True); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++; + XtSetArg(al[ac], XmNpacking, XmPACK_COLUMN); ac++; + XtSetArg(al[ac], XmNorientation, XmVERTICAL); ac++; + XtSetArg(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++; + XtSetArg(al[ac], XmNmarginWidth, 0); ac++; + XtSetArg(al[ac], XmNmarginHeight, 0); ac++; + XtSetArg(al[ac], XmNspacing, 13); ac++; + XtSetArg(al[ac], XmNadjustLast, False); ac++; + XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; + XtSetArg(al[ac], XmNisAligned, True); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 13); ac++; row = XmCreateRowColumn (form, "row", al, ac); n_children = 0; @@ -1151,10 +1176,10 @@ ac = 0; if (i == 0) { - Xt_SET_ARG(al[ac], XmNhighlightThickness, 1); ac++; - Xt_SET_ARG(al[ac], XmNshowAsDefault, TRUE); ac++; + XtSetArg(al[ac], XmNhighlightThickness, 1); ac++; + XtSetArg(al[ac], XmNshowAsDefault, TRUE); ac++; } - Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; + XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; children [n_children] = XmCreatePushButton (row, button_name, al, ac); DO_DND_KLUDGE (children [n_children]); @@ -1162,7 +1187,7 @@ { button = children [n_children]; ac = 0; - Xt_SET_ARG(al[ac], XmNdefaultButton, button); ac++; + XtSetArg(al[ac], XmNdefaultButton, button); ac++; XtSetValues (row, al, ac); #ifdef ARMANDACTIVATE_KLUDGE /* See comment above */ @@ -1179,8 +1204,9 @@ /* invisible separator button */ ac = 0; - Xt_SET_ARG (al[ac], XmNmappedWhenManaged, FALSE); ac++; - children [n_children] = XmCreateLabel (row, "separator_button", al, ac); + XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++; + children [n_children] = XmCreateLabel (row, "separator_button", + al, ac); DO_DND_KLUDGE (children [n_children]); n_children++; @@ -1189,7 +1215,7 @@ char button_name [16]; sprintf (button_name, "button%d", left_buttons + i + 1); ac = 0; - Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; + XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; children [n_children] = XmCreatePushButton (row, button_name, al, ac); DO_DND_KLUDGE (children [n_children]); if (! button) button = children [n_children]; @@ -1199,53 +1225,53 @@ XtManageChildren (children, n_children); ac = 0; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, row); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 0); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 0); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomWidget, row); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNleftOffset, 0); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 0); ac++; separator = XmCreateSeparator (form, "", al, ac); ac = 0; - Xt_SET_ARG(al[ac], XmNlabelType, XmPIXMAP); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNtopOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNlabelType, XmPIXMAP); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNtopOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; icon = XmCreateLabel (form, (char *) icon_name, al, ac); DO_DND_KLUDGE (icon); ac = 0; - Xt_SET_ARG(al[ac], XmNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNtopOffset, 6); ac++; - Xt_SET_ARG(al[ac], XmNtopWidget, icon); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 6); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNtopOffset, 6); ac++; + XtSetArg(al[ac], XmNtopWidget, icon); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 6); ac++; + XtSetArg(al[ac], XmNbottomWidget, separator); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; icon_separator = XmCreateLabel (form, "", al, ac); DO_DND_KLUDGE (icon_separator); if (text_input_slot) { ac = 0; - Xt_SET_ARG(al[ac], XmNcolumns, 50); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++; + XtSetArg(al[ac], XmNcolumns, 50); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomWidget, separator); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNleftWidget, icon); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 13); ac++; value = XmCreateTextField (form, "value", al, ac); DO_DND_KLUDGE (value); } @@ -1253,19 +1279,19 @@ { Widget radio_butt; ac = 0; - Xt_SET_ARG(al[ac], XmNmarginWidth, 0); ac++; - Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++; - Xt_SET_ARG(al[ac], XmNspacing, 13); ac++; - Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; - Xt_SET_ARG(al[ac], XmNorientation, XmHORIZONTAL); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++; + XtSetArg(al[ac], XmNmarginWidth, 0); ac++; + XtSetArg(al[ac], XmNmarginHeight, 0); ac++; + XtSetArg(al[ac], XmNspacing, 13); ac++; + XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; + XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomWidget, separator); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNleftWidget, icon); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 13); ac++; value = XmCreateRadioBox (form, "radiobutton1", al, ac); ac = 0; i = 0; @@ -1280,16 +1306,16 @@ else if (list) { ac = 0; - Xt_SET_ARG(al[ac], XmNvisibleItemCount, 5); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++; + XtSetArg(al[ac], XmNvisibleItemCount, 5); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomWidget, separator); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNleftWidget, icon); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 13); ac++; value = XmCreateScrolledList (form, "list", al, ac); /* this is the easiest way I found to have the double click in the @@ -1299,18 +1325,18 @@ /* else add nothing; it's a separator */ ac = 0; - Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNtopOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNbottomWidget, - text_input_slot || radio_box || list ? value : separator); ac++; - Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; - Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++; - Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++; - Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; - Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++; + XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNtopOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNbottomOffset, 13); ac++; + XtSetArg(al[ac], XmNbottomWidget, + text_input_slot || radio_box || list ? value : separator); ac++; + XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; + XtSetArg(al[ac], XmNleftOffset, 13); ac++; + XtSetArg(al[ac], XmNleftWidget, icon); ac++; + XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; + XtSetArg(al[ac], XmNrightOffset, 13); ac++; message = XmCreateLabel (form, "message", al, ac); DO_DND_KLUDGE (message); @@ -1401,12 +1427,12 @@ Position y; Arg al [2]; - Xt_SET_ARG (al [0], XtNwidth, &child_width); - Xt_SET_ARG (al [1], XtNheight, &child_height); + XtSetArg (al [0], XtNwidth, &child_width); + XtSetArg (al [1], XtNheight, &child_height); XtGetValues (widget, al, 2); - Xt_SET_ARG (al [0], XtNwidth, &parent_width); - Xt_SET_ARG (al [1], XtNheight, &parent_height); + XtSetArg (al [0], XtNwidth, &parent_width); + XtSetArg (al [1], XtNheight, &parent_height); XtGetValues (parent, al, 2); x = (Position) ((parent_width - child_width) / 2); @@ -1424,8 +1450,8 @@ if (y < 0) y = 0; - Xt_SET_ARG (al [0], XtNx, x); - Xt_SET_ARG (al [1], XtNy, y); + XtSetArg (al [0], XtNx, x); + XtSetArg (al [1], XtNy, y); XtSetValues (widget, al, 2); } @@ -1458,8 +1484,8 @@ if (separator) { Arg al [2]; - Xt_SET_ARG (al [0], XtNwidth, 5); - Xt_SET_ARG (al [1], XtNheight, 5); + XtSetArg (al [0], XtNwidth, 5); + XtSetArg (al [1], XtNheight, 5); XtSetValues (separator, al, 2); } @@ -1555,8 +1581,8 @@ Arg al[10]; int ac = 0; - Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++; - Xt_SET_ARG(al[ac], XmNshadowThickness, 3); ac++; + XtSetArg(al[ac], XmNmarginHeight, 0); ac++; + XtSetArg(al[ac], XmNshadowThickness, 3); ac++; return XmCreateMenuBar (instance->parent, instance->info->name, al, ac); } @@ -1596,22 +1622,21 @@ callbacks[0].closure = (XtPointer) instance; - Xt_SET_ARG (al[ac], XmNminimum, 1); ac++; - Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++; - Xt_SET_ARG (al[ac], XmNincrement, 1); ac++; - Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++; - Xt_SET_ARG (al[ac], XmNborderWidth, 0); ac++; - Xt_SET_ARG (al[ac], XmNorientation, - vertical ? XmVERTICAL : XmHORIZONTAL); ac++; + XtSetArg (al[ac], XmNminimum, 1); ac++; + XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++; + XtSetArg (al[ac], XmNincrement, 1); ac++; + XtSetArg (al[ac], XmNpageIncrement, 1); ac++; + XtSetArg (al[ac], XmNborderWidth, 0); ac++; + XtSetArg (al[ac], XmNorientation, vertical ? XmVERTICAL : XmHORIZONTAL); ac++; - Xt_SET_ARG (al[ac], XmNdecrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNdragCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNincrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNpageDecrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNpageIncrementCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNtoBottomCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNtoTopCallback, callbacks); ac++; - Xt_SET_ARG (al[ac], XmNvalueChangedCallback, callbacks); ac++; + XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNdragCallback, callbacks); ac++; + XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++; + XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++; + XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++; + XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++; return XmCreateScrollBar (instance->parent, instance->info->name, al, ac); } @@ -1640,14 +1665,14 @@ Widget button = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++; - Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -1657,11 +1682,11 @@ else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) { - Xt_SET_ARG (al [ac], XmNset, val->selected); ac++; - Xt_SET_ARG (al [ac], XmNindicatorType, + XtSetArg (al [ac], XmNset, val->selected); ac++; + XtSetArg (al [ac], XmNindicatorType, (val->type == TOGGLE_TYPE ? - XmN_OF_MANY : XmONE_OF_MANY)); ac++; - Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++; + XmN_OF_MANY : XmONE_OF_MANY)); ac++; + XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++; button = XmCreateToggleButton (instance->parent, val->name, al, ac); XtRemoveAllCallbacks (button, XmNvalueChangedCallback); XtAddCallback (button, XmNvalueChangedCallback, xm_generic_callback, @@ -1690,30 +1715,30 @@ widget_value* val = instance->info->val; if (!val->call_data) { - Xt_SET_ARG (al [ac], XmNeditable, False); ac++; + XtSetArg (al [ac], XmNeditable, False); ac++; } else { - Xt_SET_ARG (al [ac], XmNeditable, val->enabled); ac++; + XtSetArg (al [ac], XmNeditable, val->enabled); ac++; } - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++; - Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++; - Xt_SET_ARG (al [ac], XmNorientation, XmHORIZONTAL); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XmNorientation, XmHORIZONTAL); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; height = (Dimension)lw_get_value_arg (val, XtNheight); width = (Dimension)lw_get_value_arg (val, XtNwidth); if (height > 0) { - Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++; + XtSetArg (al [ac], XmNscaleHeight, height); ac++; } if (width > 0) { - Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++; + XtSetArg (al [ac], XmNscaleWidth, width); ac++; } /* add any args the user supplied for creation time */ @@ -1737,14 +1762,14 @@ Widget text = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++; - Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -1772,13 +1797,13 @@ int ac = 0; Widget label = 0; - Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -1804,14 +1829,14 @@ Widget combo = 0; widget_value* val = instance->info->val; - Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++; - Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; - Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++; - Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++; + XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; + XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; + XtSetArg (al [ac], XmNuserData, val->call_data); ac++; + XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; /* The highlight doesn't appear to be dynamically set which makes it look ugly. I think this may be a LessTif bug but for now we just get rid of it. */ - Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++; + XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; /* add any args the user supplied for creation time */ lw_add_value_args_to_args (val, al, &ac); @@ -1919,7 +1944,7 @@ if (trans) { Arg al [1]; - Xt_SET_ARG (al [0], XmNmenuPost, trans); + XtSetArg (al [0], XmNmenuPost, trans); XtSetValues (widget, al, 1); } XmMenuPosition (widget, (XButtonPressedEvent *) event); @@ -1938,12 +1963,12 @@ short height; Arg al [2]; - Xt_SET_ARG (al [0], XmNwidth, &width); - Xt_SET_ARG (al [1], XmNheight, &height); + XtSetArg (al [0], XmNwidth, &width); + XtSetArg (al [1], XmNheight, &height); XtGetValues (w, al, 2); - Xt_SET_ARG (al [0], XmNminWidth, width); - Xt_SET_ARG (al [1], XmNminHeight, height); + XtSetArg (al [0], XmNminWidth, width); + XtSetArg (al [1], XmNminHeight, height); XtSetValues (w, al, 2); } @@ -1989,6 +2014,7 @@ widget_instance* instance = (widget_instance*)closure; Widget instance_widget; LWLIB_ID id; + Arg al [1]; if (!instance) return; @@ -2001,7 +2027,8 @@ id = instance->info->id; user_data = NULL; - Xt_GET_VALUE (widget, XmNuserData, &user_data); + XtSetArg(al [0], XmNuserData, &user_data); + XtGetValues (widget, al, 1); switch (type) { case pre_activate: @@ -2053,9 +2080,13 @@ || XtClass (widget) == xmToggleButtonGadgetClass) { Boolean check; + Arg al [1]; - Xt_GET_VALUE (widget, XmNset, &check); - Xt_SET_VALUE (widget, XmNset, !check); + XtSetArg (al [0], XmNset, &check); + XtGetValues (widget, al, 1); + + XtSetArg (al [0], XmNset, !check); + XtSetValues (widget, al, 1); } #endif lw_internal_update_other_instances (widget, closure, call_data);
--- a/lwlib/lwlib.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/lwlib.c Wed Oct 29 03:37:16 2008 +0900 @@ -1385,7 +1385,7 @@ } } -XtArgVal lw_get_value_arg (widget_value* wv, const String name) +XtArgVal lw_get_value_arg (widget_value* wv, String name) { int i; if (wv->args)
--- a/lwlib/lwlib.h Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/lwlib.h Wed Oct 29 03:37:16 2008 +0900 @@ -2,7 +2,6 @@ #define INCLUDED_lwlib_h_ #include <X11/Intrinsic.h> -#include "xt-wrappers.h" #if defined (LWLIB_MENUBARS_LUCID) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_MENUBARS_ATHENA) #define NEED_MENUBARS
--- a/lwlib/xlwcheckbox.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwcheckbox.c Wed Oct 29 03:37:16 2008 +0900 @@ -40,7 +40,6 @@ #include <X11/StringDefs.h> #include ATHENA_XawInit_h_ #include "../src/xmu.h" -#include "xt-wrappers.h" #include "xlwcheckboxP.h" @@ -90,12 +89,10 @@ -#define offset(field) XtOffsetOf(CheckboxRec, checkbox.field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) +#define offset(field) XtOffsetOf(CheckboxRec, field) static XtResource resources[] = { - res (XtNtristate, XtCTristate, XtRBoolean, Boolean, tristate, - XtRImmediate, FALSE), + {XtNtristate, XtCTristate, XtRBoolean, sizeof(Boolean), + offset(checkbox.tristate), XtRImmediate, (XtPointer)FALSE}, } ; #undef offset @@ -130,7 +127,7 @@ CheckboxClassRec checkboxClassRec = { { (WidgetClass) SuperClass, /* superclass */ - (String) "Checkbox", /* class_name */ + "Checkbox", /* class_name */ sizeof(CheckboxRec), /* size */ CheckboxClassInit, /* class_initialize */ NULL, /* class_part_initialize */
--- a/lwlib/xlwgauge.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwgauge.c Wed Oct 29 03:37:16 2008 +0900 @@ -53,7 +53,6 @@ #include <X11/Xatom.h> #include <X11/StringDefs.h> #include ATHENA_XawInit_h_ -#include "xt-wrappers.h" #include "xlwgaugeP.h" #include "../src/xmu.h" #ifdef HAVE_XMU @@ -78,29 +77,33 @@ -#define offset(field) XtOffsetOf(GaugeRec, gauge.field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) +#define offset(field) XtOffsetOf(GaugeRec, field) static XtResource resources[] = { - res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0), - res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0), - res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100), - res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate, 0), - res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate, 0), - res (XtNlabels, XtCLabels, XtRStringArray, String *, labels, - XtRStringArray, NULL), - res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp, - XtRImmediate, FALSE), - res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean, - autoScaleDown, XtRImmediate, FALSE), - res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation, - orientation, XtRImmediate, XtorientHorizontal), - res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0), - res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue, - XtRImmediate, NULL), + {XtNvalue, XtCValue, XtRInt, sizeof(int), + offset(gauge.value), XtRImmediate, (XtPointer)0}, + {XtNminValue, XtCMinValue, XtRInt, sizeof(int), + offset(gauge.v0), XtRImmediate, (XtPointer)0}, + {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int), + offset(gauge.v1), XtRImmediate, (XtPointer)100}, + {XtNntics, XtCNTics, XtRInt, sizeof(int), + offset(gauge.ntics), XtRImmediate, (XtPointer) 0}, + {XtNnlabels, XtCNLabels, XtRInt, sizeof(int), + offset(gauge.nlabels), XtRImmediate, (XtPointer) 0}, + {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *), + offset(gauge.labels), XtRStringArray, NULL}, + {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean), + offset(gauge.autoScaleUp), XtRImmediate, FALSE}, + {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean), + offset(gauge.autoScaleDown), XtRImmediate, FALSE}, + {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation), + offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal}, + {XtNupdate, XtCInterval, XtRInt, sizeof(int), + offset(gauge.update), XtRImmediate, (XtPointer)0}, + {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer), + offset(gauge.getValue), XtRImmediate, (XtPointer)NULL}, }; #undef offset -#undef res + /* member functions */ @@ -143,8 +146,8 @@ static XtActionsRec actionsList[] = { - { (String) "select", GaugeSelect }, - { (String) "paste", GaugePaste }, + {"select", GaugeSelect}, + {"paste", GaugePaste}, } ; @@ -159,7 +162,7 @@ { /* core_class fields */ /* superclass */ (WidgetClass) &labelClassRec, - /* class_name */ (String) "Gauge", + /* class_name */ "Gauge", /* widget_size */ sizeof(GaugeRec), /* class_initialize */ GaugeClassInit, /* class_part_initialize */ NULL,
--- a/lwlib/xlwmenu.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwmenu.c Wed Oct 29 03:37:16 2008 +0900 @@ -70,112 +70,100 @@ extern Widget lw_menubar_widget; +#define offset(field) XtOffset(XlwMenuWidget, field) static XtResource xlwMenuResources[] = { -/* The offset macro is a standard trick. The remaining macros are an - experiment to compress redundancies in resource descriptions, and shut - up GCC 4.3 (the String casts, which keep G++ from complaining about - implicit conversions from const char *). */ -#define offset(field) XtOffset(XlwMenuWidget, menu.field) -#define fontres(name,_class,repr,type,member,value) \ - Xt_RESOURCE (name, _class, repr, type, offset(member), XtRString, value) -#define mflres(name,cls,member,repr,value) \ - Xt_RESOURCE (name, cls, XmRFontList, XmFontList, offset(member), repr, value) -#define dimres(name,cls,repr,member,value) \ - Xt_RESOURCE (name, cls, repr, Dimension, offset(member), XtRImmediate, value) -#define boolres(nm,cls,member,val) \ - Xt_RESOURCE (nm, cls, XtRBoolean, Boolean, offset(member), XtRImmediate, val) -#define cbres(name,member,value) \ - Xt_RESOURCE (name, XtCCallback, XtRCallback, XtPointer, offset(member), \ - XtRCallback, value) -#define pixres(name,_class,member,repr,value) \ - Xt_RESOURCE (name, _class, XtRPixel, Pixel, offset(member), repr, value) -#define fgpixres(name,_class,member) \ - pixres (name, _class, member, XtRString, "XtDefaultForeground") -#define nullpixres(name,_class,member) \ - pixres (name, _class, member, XtRImmediate, -1) -#define pmres(name,cls,member) \ - Xt_RESOURCE (name, cls, XtRPixmap, Pixmap, offset(member), XtRImmediate, None) - #if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS) /* There are three font list resources, so that we can accept either of the resources *fontList: or *font:, and so that we can tell the difference between them being specified, and being defaulted to a font from the XtRString specified here. */ - mflres (XmNfontList, XmCFontList, font_list, XtRImmediate, 0), - mflres (XtNfont, XtCFont, font_list_2, XtRImmediate, 0), - mflres (XmNfontList, XmCFontList, fallback_font_list, + {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), + offset(menu.font_list), XtRImmediate, (XtPointer)0}, + {XtNfont, XtCFont, XmRFontList, sizeof(XmFontList), + offset(menu.font_list_2),XtRImmediate, (XtPointer)0}, + {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), + offset(menu.fallback_font_list), /* We must use an iso8859-1 font here, or people without $LANG set lose. It's fair to assume that those who do have $LANG set also have the *fontList resource set, or at least know how to deal with this. */ - XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"), + XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"}, #else - fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font, - "XtDefaultFont"), + {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"}, #ifdef USE_XFT_MENUBARS - fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName, - "sans-serif-12:bold"), + {XtNfcFontName, XtCFcFontName, XtRString, sizeof (String), + offset(menu.fcFontName), + XtRString, (XtPointer) NULL}, /* #### This needs to be fixed to give a proper type and converter for XftFonts. See also xlwtabs.c. */ - fontres (XtNxftFont, XtCXftFont, XtRString, XtPointer, xftFontName, - "Helvetica-12:bold"), + {XtNxftFont, XtCXftFont, XtRString, sizeof(XtPointer), + offset(menu.xftFontName), XtRString, (XtPointer) "Helvetica-12:bold" }, #endif # ifdef USE_XFONTSET /* #### Consider using the same method as for Motif; see the comment in XlwMenuInitialize(). */ - fontres (XtNfontSet, XtCFontSet, XtRFontSet, XFontSet, font_set, - "XtDefaultFontSet"), + {XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet), + offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"}, # endif #endif - fgpixres (XtNforeground, XtCForeground, foreground), - fgpixres (XtNbuttonForeground, XtCButtonForeground, button_foreground), - fgpixres (XtNhighlightForeground, XtCHighlightForeground, - highlight_foreground), - fgpixres (XtNtitleForeground, XtCTitleForeground, title_foreground), - dimres (XtNmargin, XtCMargin, XtRDimension, margin, 2), - dimres (XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, - horizontal_margin, 2), - dimres (XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, - vertical_margin, 1), - dimres (XmNspacing, XmCSpacing, XmRHorizontalDimension, column_spacing, 4), - dimres (XmNindicatorSize, XmCIndicatorSize, XtRDimension, indicator_size, 0), + {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + offset(menu.foreground), XtRString, (XtPointer) "XtDefaultForeground"}, + {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel), + offset(menu.button_foreground), XtRString, (XtPointer) "XtDefaultForeground"}, + {XtNhighlightForeground, XtCHighlightForeground, XtRPixel, sizeof(Pixel), + offset(menu.highlight_foreground), XtRString, (XtPointer) "XtDefaultForeground"}, + {XtNtitleForeground, XtCTitleForeground, XtRPixel, sizeof(Pixel), + offset(menu.title_foreground), XtRString, (XtPointer) "XtDefaultForeground"}, + {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension), + offset(menu.margin), XtRImmediate, (XtPointer)2}, + {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), + offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2}, + {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), + offset(menu.vertical_margin), XtRImmediate, (XtPointer)1}, + {XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), + offset(menu.column_spacing), XtRImmediate, (XtPointer)4}, + {XmNindicatorSize, XmCIndicatorSize, XtRDimension, sizeof(Dimension), + offset(menu.indicator_size), XtRImmediate, (XtPointer)0}, #if 0 - dimres (XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, - shadow_thickness, 2), + {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, + sizeof (Dimension), offset (menu.shadow_thickness), + XtRImmediate, (XtPointer) 2}, #else - dimres (XmNshadowThickness, XmCShadowThickness, XtRDimension, - shadow_thickness, 2), + {XmNshadowThickness, XmCShadowThickness, XtRDimension, + sizeof (Dimension), offset (menu.shadow_thickness), + XtRImmediate, (XtPointer) 2}, #endif - nullpixres (XmNselectColor, XmCSelectColor, select_color), - nullpixres (XmNtopShadowColor, XmCTopShadowColor, top_shadow_color), - nullpixres (XmNbottomShadowColor, XmCBottomShadowColor, bottom_shadow_color), - pmres (XmNtopShadowPixmap, XmCTopShadowPixmap, top_shadow_pixmap), - pmres (XmNbottomShadowPixmap, XmCBottomShadowPixmap, bottom_shadow_pixmap), - - cbres (XtNopen, open, NULL), - cbres (XtNselect, select, NULL), - Xt_RESOURCE (XtNmenu, XtCMenu, XtRPointer, XtPointer, offset(contents), - XtRImmediate, NULL), - Xt_RESOURCE (XtNcursor, XtCCursor, XtRCursor, Cursor, offset(cursor_shape), - XtRString, "right_ptr"), - Xt_RESOURCE (XtNhorizontal, XtCHorizontal, XtRInt, int, offset(horizontal), - XtRImmediate, True), - boolres (XtNuseBackingStore, XtCUseBackingStore, use_backing_store, False), - boolres (XtNbounceDown, XtCBounceDown, bounce_down, True), - boolres (XtNresourceLabels, XtCResourceLabels, lookup_labels, False), - + {XmNselectColor, XmCSelectColor, XtRPixel, sizeof (Pixel), + offset (menu.select_color), XtRImmediate, (XtPointer)-1}, + {XmNtopShadowColor, XmCTopShadowColor, XtRPixel, sizeof (Pixel), + offset (menu.top_shadow_color), XtRImmediate, (XtPointer)-1}, + {XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel, sizeof (Pixel), + offset (menu.bottom_shadow_color), XtRImmediate, (XtPointer)-1}, + {XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap, sizeof (Pixmap), + offset (menu.top_shadow_pixmap), XtRImmediate, (XtPointer)None}, + {XmNbottomShadowPixmap, XmCBottomShadowPixmap, XtRPixmap, sizeof (Pixmap), + offset (menu.bottom_shadow_pixmap), XtRImmediate, (XtPointer)None}, + + {XtNopen, XtCCallback, XtRCallback, sizeof(XtPointer), + offset(menu.open), XtRCallback, (XtPointer)NULL}, + {XtNselect, XtCCallback, XtRCallback, sizeof(XtPointer), + offset(menu.select), XtRCallback, (XtPointer)NULL}, + {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer), + offset(menu.contents), XtRImmediate, (XtPointer)NULL}, + {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor), + offset(menu.cursor_shape), XtRString, (XtPointer) "right_ptr"}, + {XtNhorizontal, XtCHorizontal, XtRInt, sizeof(int), + offset(menu.horizontal), XtRImmediate, (XtPointer)True}, + {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean), + offset (menu.use_backing_store), XtRImmediate, (XtPointer)False}, + {XtNbounceDown, XtCBounceDown, XtRBoolean, sizeof (Boolean), + offset (menu.bounce_down), XtRImmediate, (XtPointer)True}, + {XtNresourceLabels, XtCResourceLabels, XtRBoolean, sizeof (Boolean), + offset (menu.lookup_labels), XtRImmediate, (XtPointer)False}, +}; #undef offset -#undef mflres -#undef fontres -#undef dimres -#undef boolres -#undef cbres -#undef pixres -#undef fgpixres -#undef nullpixres -#undef pmres -}; static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_, ArgList args, Cardinal *num_args); @@ -198,9 +186,9 @@ static XtActionsRec xlwMenuActionsList [] = { - { (String) "start", Start}, - { (String) "drag", Drag}, - { (String) "select", Select}, + {"start", Start}, + {"drag", Drag}, + {"select", Select}, }; #define SuperClass ((CoreWidgetClass)&coreClassRec) @@ -209,7 +197,7 @@ { { /* CoreClass fields initialization */ (WidgetClass) SuperClass, /* superclass */ - (String) "XlwMenu", /* class_name */ + "XlwMenu", /* class_name */ sizeof(XlwMenuRec), /* size */ XlwMenuClassInitialize, /* class_initialize */ NULL, /* class_part_initialize */ @@ -507,7 +495,7 @@ static XtResource nameResource[] = { - { (String) "labelString", (String) "LabelString", XtRString, sizeof(String), + { "labelString", "LabelString", XtRString, sizeof(String), 0, XtRImmediate, 0 } };
--- a/lwlib/xlwradio.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwradio.c Wed Oct 29 03:37:16 2008 +0900 @@ -55,7 +55,6 @@ #include <X11/StringDefs.h> #include ATHENA_XawInit_h_ #include "../src/xmu.h" -#include "xt-wrappers.h" #include "xlwradioP.h" #define BOX_SIZE 13 @@ -117,8 +116,8 @@ static XtActionsRec actionsList[] = { - { (String) "highlight", RadioHighlight }, - { (String) "unhighlight", RadioUnhighlight }, + {"highlight", RadioHighlight}, + {"unhighlight", RadioUnhighlight}, }; #define SuperClass ((ToggleWidgetClass)&toggleClassRec) @@ -126,7 +125,7 @@ RadioClassRec radioClassRec = { { (WidgetClass) SuperClass, /* superclass */ - (String) "Radio", /* class_name */ + "Radio", /* class_name */ sizeof(RadioRec), /* size */ RadioClassInit, /* class_initialize */ RadioClassPartInit, /* class_part_initialize */
--- a/lwlib/xlwscrollbar.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwscrollbar.c Wed Oct 29 03:37:16 2008 +0900 @@ -79,7 +79,6 @@ #include <X11/bitmaps/gray> #include "lwlib-colors.h" -#include "xt-wrappers.h" #include "xlwscrollbarP.h" #include "xlwscrollbar.h" @@ -114,79 +113,90 @@ } SliderStyle; /*-------------------------- Resources ----------------------------------*/ +#define offset(field) XtOffset(XlwScrollBarWidget, field) static XtResource resources[] = { -#define offset(field) XtOffset(XlwScrollBarWidget, field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(sb.member), extrepr, value) + { XmNforeground, XmCForeground, XtRPixel, sizeof(Pixel), + offset(sb.foreground), XtRImmediate, (XtPointer) XtDefaultForeground }, - res (XmNforeground, XmCForeground, XtRPixel, Pixel, - foreground, XtRImmediate, XtDefaultForeground), - res (XmNtopShadowColor, XmCTopShadowColor, XtRPixel, - Pixel, topShadowColor, XtRImmediate, ~0), - res (XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel, - Pixel, bottomShadowColor, XtRImmediate, ~0), + { XmNtopShadowColor, XmCTopShadowColor, XtRPixel, + sizeof(Pixel), offset(sb.topShadowColor), XtRImmediate, (XtPointer) ~0 }, + { XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel, + sizeof(Pixel), offset(sb.bottomShadowColor), XtRImmediate, + (XtPointer)~0 }, + + { XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap, + sizeof (Pixmap), offset(sb.topShadowPixmap), XtRImmediate, + (XtPointer)None}, + { XmNbottomShadowPixmap, XmCBottomShadowPixmap, + XtRPixmap, sizeof (Pixmap), offset(sb.bottomShadowPixmap), + XtRImmediate, (XtPointer)None}, - res (XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap, - Pixmap, topShadowPixmap, XtRImmediate, None), - res (XmNbottomShadowPixmap, XmCBottomShadowPixmap, - XtRPixmap, Pixmap, bottomShadowPixmap, XtRImmediate, None), + { XmNtroughColor, XmCTroughColor, XtRPixel, sizeof(Pixel), + offset(sb.troughColor), XtRImmediate, (XtPointer)~0 }, - res (XmNtroughColor, XmCTroughColor, XtRPixel, Pixel, troughColor, - XtRImmediate, ~0), + { XmNshadowThickness, XmCShadowThickness, XtRInt, + sizeof(int), offset(sb.shadowThickness), XtRImmediate, (XtPointer)2 }, - res (XmNshadowThickness, XmCShadowThickness, XtRInt, int, - shadowThickness, XtRImmediate, 2), + { XmNborderWidth, XmCBorderWidth, XtRDimension, + sizeof(Dimension), offset(core.border_width), XtRImmediate, + (XtPointer)0 }, - Xt_RESOURCE (XmNborderWidth, XmCBorderWidth, XtRDimension, Dimension, - offset(core.border_width), XtRImmediate, 0), + { XmNshowArrows, XmCShowArrows, XtRBoolean, + sizeof(Boolean), offset(sb.showArrows), XtRImmediate, (XtPointer)True }, - res (XmNshowArrows, XmCShowArrows, XtRBoolean, Boolean, showArrows, - XtRImmediate, True), + { XmNinitialDelay, XmCInitialDelay, XtRInt, sizeof(int), + offset(sb.initialDelay), XtRImmediate, (XtPointer) 250 }, + { XmNrepeatDelay, XmCRepeatDelay, XtRInt, sizeof(int), + offset(sb.repeatDelay), XtRImmediate, (XtPointer) 50 }, - res (XmNinitialDelay, XmCInitialDelay, XtRInt, int, initialDelay, - XtRImmediate, 250), - res (XmNrepeatDelay, XmCRepeatDelay, XtRInt, int, repeatDelay, - XtRImmediate, 50), - - res (XmNorientation, XmCOrientation, XtROrientation, - unsigned char, orientation, XtRImmediate, XmVERTICAL), + { XmNorientation, XmCOrientation, XtROrientation, + sizeof(unsigned char), offset(sb.orientation), XtRImmediate, + (XtPointer) XmVERTICAL }, - res (XmNminimum, XmCMinimum, XtRInt, int, minimum, XtRImmediate, 0), - res (XmNmaximum, XmCMaximum, XtRInt, int, maximum, XtRImmediate, 100), - res (XmNvalue, XmCValue, XtRInt, int, value, XtRImmediate, 0), - res (XmNsliderSize, XmCSliderSize, XtRInt, int, sliderSize, XtRImmediate, 10), - res (XmNincrement, XmCIncrement, XtRInt, int, increment, XtRImmediate, 1), - res (XmNpageIncrement, XmCPageIncrement, XtRInt, int, - pageIncrement, XtRImmediate, 10), + { XmNminimum, XmCMinimum, XtRInt, sizeof(int), + offset(sb.minimum), XtRImmediate, (XtPointer) 0}, + { XmNmaximum, XmCMaximum, XtRInt, sizeof(int), + offset(sb.maximum), XtRImmediate, (XtPointer) 100}, + { XmNvalue, XmCValue, XtRInt, sizeof(int), + offset(sb.value), XtRImmediate, (XtPointer) 0}, + { XmNsliderSize, XmCSliderSize, XtRInt, sizeof(int), + offset(sb.sliderSize), XtRImmediate, (XtPointer) 10}, + { XmNincrement, XmCIncrement, XtRInt, sizeof(int), + offset(sb.increment), XtRImmediate, (XtPointer) 1}, + { XmNpageIncrement, XmCPageIncrement, XtRInt, sizeof(int), + offset(sb.pageIncrement), XtRImmediate, (XtPointer) 10}, - res (XmNvalueChangedCallback, XmCValueChangedCallback, - XtRCallback, XtPointer, valueChangedCBL, XtRCallback, NULL), - res (XmNincrementCallback, XmCIncrementCallback, - XtRCallback, XtPointer, incrementCBL, XtRCallback, NULL), - res (XmNdecrementCallback, XmCDecrementCallback, - XtRCallback, XtPointer, decrementCBL, XtRCallback, NULL), - res (XmNpageIncrementCallback, XmCPageIncrementCallback, - XtRCallback, XtPointer, pageIncrementCBL, XtRCallback, NULL), - res (XmNpageDecrementCallback, XmCPageDecrementCallback, - XtRCallback, XtPointer, pageDecrementCBL, XtRCallback, NULL), - res (XmNtoTopCallback, XmCToTopCallback, XtRCallback, - XtPointer, toTopCBL, XtRCallback, NULL), - res (XmNtoBottomCallback, XmCToBottomCallback, XtRCallback, - XtPointer, toBottomCBL, XtRCallback, NULL), - res (XmNdragCallback, XmCDragCallback, XtRCallback, - XtPointer, dragCBL, XtRCallback, NULL), + { XmNvalueChangedCallback, XmCValueChangedCallback, + XtRCallback, sizeof(XtPointer), offset(sb.valueChangedCBL), + XtRCallback, NULL}, + { XmNincrementCallback, XmCIncrementCallback, + XtRCallback, sizeof(XtPointer), offset(sb.incrementCBL), + XtRCallback, NULL}, + { XmNdecrementCallback, XmCDecrementCallback, + XtRCallback, sizeof(XtPointer), offset(sb.decrementCBL), + XtRCallback, NULL}, + { XmNpageIncrementCallback, XmCPageIncrementCallback, + XtRCallback, sizeof(XtPointer), offset(sb.pageIncrementCBL), + XtRCallback, NULL}, + { XmNpageDecrementCallback, XmCPageDecrementCallback, + XtRCallback, sizeof(XtPointer), offset(sb.pageDecrementCBL), + XtRCallback, NULL}, + { XmNtoTopCallback, XmCToTopCallback, XtRCallback, + sizeof(XtPointer), offset(sb.toTopCBL), XtRCallback, NULL}, + { XmNtoBottomCallback, XmCToBottomCallback, XtRCallback, + sizeof(XtPointer), offset(sb.toBottomCBL), XtRCallback, NULL}, + { XmNdragCallback, XmCDragCallback, XtRCallback, + sizeof(XtPointer), offset(sb.dragCBL), XtRCallback, NULL}, /* "knob" is obsolete; use "slider" instead. */ - res (XmNsliderStyle, XmCSliderStyle, XtRString, char *, - sliderStyle, XtRImmediate, NULL), - res (XmNknobStyle, XmCKnobStyle, XtRString, char *, - knobStyle, XtRImmediate, NULL), + { XmNsliderStyle, XmCSliderStyle, XtRString, sizeof(char *), + offset(sb.sliderStyle), XtRImmediate, NULL}, + { XmNknobStyle, XmCKnobStyle, XtRString, sizeof(char *), + offset(sb.knobStyle), XtRImmediate, NULL}, - res (XmNarrowPosition, XmCArrowPosition, XtRString, char *, - arrowPosition, XtRImmediate, NULL), -#undef offset -#undef res + { XmNarrowPosition, XmCArrowPosition, XtRString, sizeof(char *), + offset(sb.arrowPosition), XtRImmediate, NULL}, }; /*-------------------------- Prototypes ---------------------------------*/ @@ -208,13 +218,13 @@ /*-------------------------- Actions Table ------------------------------*/ static XtActionsRec actions[] = { - { (String) "Select", Select}, - { (String) "PageDownOrRight", PageDownOrRight}, - { (String) "PageUpOrLeft", PageUpOrLeft}, - { (String) "Drag", Drag}, - { (String) "Release", Release}, - { (String) "Jump", Jump}, - { (String) "Abort", Abort}, + {"Select", Select}, + {"PageDownOrRight", PageDownOrRight}, + {"PageUpOrLeft", PageUpOrLeft}, + {"Drag", Drag}, + {"Release", Release}, + {"Jump", Jump}, + {"Abort", Abort}, }; /*--------------------- Default Translation Table -----------------------*/ @@ -233,7 +243,7 @@ /* core_class fields */ { /* superclass */ (WidgetClass) &coreClassRec, - /* class_name */ (String) "XlwScrollBar", + /* class_name */ "XlwScrollBar", /* widget_size */ sizeof(XlwScrollBarRec), /* class_initialize */ NULL, /* class_part_init */ NULL,
--- a/lwlib/xlwtabs.c Tue Oct 28 10:38:26 2008 +0900 +++ b/lwlib/xlwtabs.c Wed Oct 29 03:37:16 2008 +0900 @@ -142,69 +142,64 @@ " ; static XtAccelerators defaultAccelerators ; /* #### Never used */ +#define offset(field) XtOffsetOf(TabsRec, tabs.field) static XtResource resources[] = { -#define offset(field) XtOffsetOf(TabsRec, tabs.field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) - res (XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, Boolean, - selectInsensitive, XtRImmediate, True), - res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, - font, XtRString, XtDefaultFont), + {XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, sizeof(Boolean), + offset(selectInsensitive), XtRImmediate, (XtPointer) True}, + {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + offset(font), XtRString, (XtPointer) XtDefaultFont}, #ifdef USE_XFT_TABS /* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here? or XtDefaultFont? */ - res (XtNfcFontName, XtCFcFontName, XtRString, String, - fcFontName, XtRString, NULL), + {XtNfcFontName, XtCFcFontName, XtRString, sizeof(String), + offset(fcFontName), XtRString, (XtPointer) NULL }, /* #### This needs to be fixed to give a proper type and converter for XftFonts. See also xlwmenu.c. */ - res (XtNxftFont, XtCXftFont, XtRString, String, - xftFontName, XtRString, "Helvetica-12"), + {XtNxftFont, XtCXftFont, XtRString, sizeof(String), + offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" }, #endif - res (XtNinternalWidth, XtCWidth, XtRDimension, Dimension, - internalWidth, XtRImmediate, 4), - res (XtNinternalHeight, XtCHeight, XtRDimension, Dimension, - internalHeight, XtRImmediate, 4), - Xt_RESOURCE (XtNborderWidth, XtCBorderWidth, XtRDimension, Dimension, - XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, 0), - res (XtNtopWidget, XtCTopWidget, XtRWidget, Widget, - topWidget, XtRImmediate, NULL), - res (XtNcallback, XtCCallback, XtRCallback, XtPointer, - callbacks, XtRCallback, NULL), - res (XtNpopdownCallback, XtCCallback, XtRCallback, XtPointer, - popdownCallbacks, XtRCallback, NULL), - res (XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, Boolean, - be_nice_to_cmap, XtRImmediate, True), - res (XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, int, - top_shadow_contrast, XtRImmediate, 20), - res (XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, int, - bot_shadow_contrast, XtRImmediate, 40), - res (XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, int, - insensitive_contrast, XtRImmediate, 33), - Xt_RESOURCE (XtNaccelerators, XtCAccelerators, XtRAcceleratorTable, - XtTranslations, XtOffsetOf(TabsRec,core.accelerators), - XtRString, accelTable), + {XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension), + offset(internalWidth), XtRImmediate, (XtPointer)4 }, + {XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension), + offset(internalHeight), XtRImmediate, (XtPointer)4 }, + {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), + XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)0}, + {XtNtopWidget, XtCTopWidget, XtRWidget, sizeof(Widget), + offset(topWidget), XtRImmediate, NULL}, + {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer), + offset(callbacks), XtRCallback, NULL}, + {XtNpopdownCallback, XtCCallback, XtRCallback, sizeof(XtPointer), + offset(popdownCallbacks), XtRCallback, NULL}, + {XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, sizeof(Boolean), + offset(be_nice_to_cmap), XtRImmediate, (XtPointer) True}, + {XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, sizeof(int), + offset(top_shadow_contrast), XtRImmediate, (XtPointer) 20}, + {XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, sizeof(int), + offset(bot_shadow_contrast), XtRImmediate, (XtPointer) 40}, + {XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, sizeof(int), + offset(insensitive_contrast), XtRImmediate, (XtPointer) 33}, + {XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,sizeof(XtTranslations), + XtOffsetOf(TabsRec,core.accelerators), XtRString, accelTable}, +}; #undef offset -#undef res -}; + /* constraint resources */ +#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field) static XtResource tabsConstraintResources[] = { -#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) - res (XtNtabLabel, XtCLabel, XtRString, String, label, XtRString, NULL), - res (XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, Pixmap, left_bitmap, - XtRImmediate, None), - res (XtNtabForeground, XtCForeground, XtRPixel, Pixel, foreground, - XtRString, XtDefaultForeground), - res (XtNresizable, XtCResizable, XtRBoolean, Boolean, resizable, - XtRImmediate, True), + {XtNtabLabel, XtCLabel, XtRString, sizeof(String), + offset(label), XtRString, NULL}, + {XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, sizeof(Pixmap), + offset(left_bitmap), XtRImmediate, None}, + {XtNtabForeground, XtCForeground, XtRPixel, sizeof(Pixel), + offset(foreground), XtRString, (XtPointer) XtDefaultForeground}, + {XtNresizable, XtCResizable, XtRBoolean, sizeof(Boolean), + offset(resizable), XtRImmediate, (XtPointer) True}, +} ; #undef offset -#undef res -} ; @@ -323,10 +318,10 @@ static XtActionsRec actionsList[] = { - { (String) "select", TabsSelect }, - { (String) "page", TabsPage }, - { (String) "highlight", TabsHighlight }, - { (String) "unhighlight", TabsUnhighlight }, + {"select", TabsSelect}, + {"page", TabsPage}, + {"highlight", TabsHighlight}, + {"unhighlight", TabsUnhighlight}, } ; @@ -346,7 +341,7 @@ { /* core_class fields */ /* superclass */ (WidgetClass) SuperClass, - /* class_name */ (String) "Tabs", + /* class_name */ "Tabs", /* widget_size */ sizeof(TabsRec), /* class_initialize */ TabsClassInit, /* class_part_init */ NULL, /* TODO? */
--- a/src/EmacsFrame.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/EmacsFrame.c Wed Oct 29 03:37:16 2008 +0900 @@ -43,7 +43,6 @@ #include "EmacsFrameP.h" #include "EmacsManager.h" /* for EmacsManagerChangeSize */ #include "xmu.h" -#include "../lwlib/xt-wrappers.h" static void EmacsFrameClassInitialize (void); static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *); @@ -61,83 +60,117 @@ #define XtOffset(p_type,field) \ ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) #define offset(field) XtOffset (EmacsFrame, emacs_frame.field) -#define res(name,_class,intrepr,type,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) + static XtResource resources[] = { - res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0), - res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, False), + { XtNgeometry, XtCGeometry, + XtRString, sizeof (String), + offset (geometry), XtRString, (XtPointer) 0 }, + { XtNiconic, XtCIconic, + XtRBoolean, sizeof (Boolean), + offset (iconic), XtRImmediate, (XtPointer) False }, - res (XtNemacsFrame, XtCEmacsFrame, XtRPointer, XtPointer, - frame, XtRImmediate, 0), - res (XtNmenubar, XtCMenubar, XtRBoolean, Boolean, - menubar_p, XtRImmediate, True), - res (XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, Boolean, - initially_unmapped, XtRImmediate, False), - res (XtNminibuffer, XtCMinibuffer, XtRBoolean, Boolean, - minibuffer, XtRImmediate, True), - res (XtNunsplittable, XtCUnsplittable, XtRBoolean, Boolean, - unsplittable, XtRImmediate, False), - res (XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, int, - internal_border_width, XtRImmediate, 4), + { XtNemacsFrame, XtCEmacsFrame, + XtRPointer, sizeof (XtPointer), + offset (frame), XtRImmediate, 0 }, + { XtNmenubar, XtCMenubar, + XtRBoolean, sizeof (Boolean), + offset (menubar_p), XtRImmediate, (XtPointer) True }, + { XtNinitiallyUnmapped, XtCInitiallyUnmapped, + XtRBoolean, sizeof (Boolean), + offset (initially_unmapped), XtRImmediate, (XtPointer) False }, + { XtNminibuffer, XtCMinibuffer, + XtRBoolean, sizeof (Boolean), + offset (minibuffer), XtRImmediate, (XtPointer) True }, + { XtNunsplittable, XtCUnsplittable, + XtRBoolean, sizeof (Boolean), + offset (unsplittable), XtRImmediate, (XtPointer) False }, + { XtNinternalBorderWidth, XtCInternalBorderWidth, + XtRInt, sizeof (int), + offset (internal_border_width), XtRImmediate, (XtPointer)4 }, #ifdef HAVE_SCROLLBARS - res (XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, int, - scrollbar_width, XtRImmediate, -1), - res (XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, int, - scrollbar_height, XtRImmediate, -1), - res (XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement, - unsigned char, scrollbar_placement, XtRImmediate, + { XtNscrollBarWidth, XtCScrollBarWidth, + XtRInt, sizeof (int), + offset (scrollbar_width), XtRImmediate, (XtPointer)-1 }, + { XtNscrollBarHeight, XtCScrollBarHeight, + XtRInt, sizeof (int), + offset (scrollbar_height), XtRImmediate, (XtPointer)-1 }, + { XtNscrollBarPlacement, XtCScrollBarPlacement, + XtRScrollBarPlacement, sizeof (unsigned char), + offset (scrollbar_placement), XtRImmediate, #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ defined (LWLIB_SCROLLBARS_ATHENA3D) - XtBOTTOM_RIGHT + (XtPointer) XtBOTTOM_RIGHT #else - XtBOTTOM_LEFT + (XtPointer) XtBOTTOM_LEFT #endif - ), + }, #endif /* HAVE_SCROLLBARS */ #ifdef HAVE_TOOLBARS - res (XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, int, - top_toolbar_height, XtRImmediate, -1), - res (XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, int, - bottom_toolbar_height, XtRImmediate, -1), - res (XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, int, - left_toolbar_width, XtRImmediate, -1), - res (XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, int, - right_toolbar_width, XtRImmediate, -1), - res (XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, int, - top_toolbar_border_width, XtRImmediate, -1), - res (XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, int, - bottom_toolbar_border_width, XtRImmediate, -1), - res (XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt, - int, left_toolbar_border_width, XtRImmediate, -1), - res (XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt, - int, right_toolbar_border_width, XtRImmediate, -1), - res (XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension, - Dimension, toolbar_shadow_thickness, XtRImmediate, 2), + { XtNtopToolBarHeight, XtCTopToolBarHeight, + XtRInt, sizeof (int), + offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 }, + { XtNbottomToolBarHeight, XtCBottomToolBarHeight, + XtRInt, sizeof (int), + offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 }, + { XtNleftToolBarWidth, XtCLeftToolBarWidth, + XtRInt, sizeof (int), + offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 }, + { XtNrightToolBarWidth, XtCRightToolBarWidth, + XtRInt, sizeof (int), + offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 }, + { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, + XtRInt, sizeof (int), + offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, + { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, + XtRInt, sizeof (int), + offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, + { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, + XtRInt, sizeof (int), + offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, + { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, + XtRInt, sizeof (int), + offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, + { XtNtoolBarShadowThickness, XtCToolBarShadowThickness, + XtRDimension, sizeof (Dimension), + offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 }, #endif /* HAVE_TOOLBARS */ - res (XtNinterline, XtCInterline, XtRInt, int, - interline, XtRImmediate, 0), - res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, - font, XtRImmediate, 0), - res (XtNforeground, XtCForeground, XtRPixel, Pixel, - foreground_pixel, XtRString, "Black"), - res (XtNbackground, XtCBackground, XtRPixel, Pixel, - background_pixel, XtRString, "Gray80"), - res (XtNcursorColor, XtCForeground, XtRPixel, Pixel, - cursor_color, XtRString, "XtDefaultForeground"), - res (XtNbarCursor, XtCBarCursor, XtRBoolean, Boolean, - bar_cursor, XtRImmediate, 0), - res (XtNvisualBell, XtCVisualBell, XtRBoolean, Boolean, - visual_bell, XtRImmediate, 0), - res (XtNbellVolume, XtCBellVolume, XtRInt, int, - bell_volume, XtRImmediate, 0), - res (XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, Boolean, - use_backing_store, XtRImmediate, 0), - res (XtNpreferredWidth, XtCPreferredWidth, XtRDimension, Dimension, - preferred_width, XtRImmediate, 0), - res (XtNpreferredHeight, XtCPreferredHeight, XtRDimension, Dimension, - preferred_height, XtRImmediate, 0), + { XtNinterline, XtCInterline, + XtRInt, sizeof (int), + offset (interline), XtRImmediate, (XtPointer)0 }, + { + XtNfont, XtCFont, + XtRFontStruct, sizeof (XFontStruct *), + offset(font), XtRImmediate, (XtPointer)0 + }, + { XtNforeground, XtCForeground, + XtRPixel, sizeof (Pixel), + offset(foreground_pixel), XtRString, (XtPointer) "Black" }, + { XtNbackground, XtCBackground, + XtRPixel, sizeof (Pixel), + offset(background_pixel), XtRString, (XtPointer) "Gray80" }, + { XtNcursorColor, XtCForeground, + XtRPixel, sizeof (Pixel), + offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" }, + { XtNbarCursor, XtCBarCursor, + XtRBoolean, sizeof (Boolean), + offset (bar_cursor), XtRImmediate, (XtPointer)0 }, + { XtNvisualBell, XtCVisualBell, + XtRBoolean, sizeof (Boolean), + offset (visual_bell), XtRImmediate, (XtPointer)0 }, + { XtNbellVolume, XtCBellVolume, + XtRInt, sizeof (int), + offset (bell_volume), XtRImmediate, (XtPointer)0 }, + { XtNuseBackingStore, XtCUseBackingStore, + XtRBoolean, sizeof (Boolean), + offset (use_backing_store), XtRImmediate, (XtPointer)0 }, + { XtNpreferredWidth, XtCPreferredWidth, + XtRDimension, sizeof (Dimension), + offset (preferred_width), XtRImmediate, (XtPointer)0 }, + { XtNpreferredHeight, XtCPreferredHeight, + XtRDimension, sizeof (Dimension), + offset (preferred_height), XtRImmediate, (XtPointer)0 }, }; #undef offset @@ -148,7 +181,7 @@ static XtActionsRec emacsFrameActionsTable [] = { - { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action}, + {"mapping", (XtActionProc) emacs_Xt_mapping_action}, }; static char @@ -167,7 +200,7 @@ #else /* superclass */ &widgetClassRec, #endif - /* class_name */ (String) "EmacsFrame", + /* class_name */ "EmacsFrame", /* widget_size */ sizeof (EmacsFrameRec), /* class_initialize */ EmacsFrameClassInitialize, /* class_part_initialize */ 0, @@ -620,8 +653,8 @@ { Arg al [2]; - Xt_SET_ARG (al [0], XtNwidth, pixel_width); - Xt_SET_ARG (al [1], XtNheight, pixel_height); + XtSetArg (al [0], XtNwidth, pixel_width); + XtSetArg (al [1], XtNheight, pixel_height); XtSetValues ((Widget) ew, al, countof (al)); } }
--- a/src/EmacsManager.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/EmacsManager.c Wed Oct 29 03:37:16 2008 +0900 @@ -32,7 +32,6 @@ #include <Xm/RowColumn.h> #endif /* LWLIB_MENUBARS_MOTIF */ #include "compiler.h" -#include "../lwlib/xt-wrappers.h" /* For I, Emacs, am a kind god. Unlike the goddess Athena and the Titan Motif, I require no ritual sacrifices to placate the lesser @@ -40,14 +39,15 @@ static XtResource resources[] = { #define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field) -#define res(name,_class,intrepr,size,member,extrepr,value) \ - Xt_RESOURCE (name, _class, intrepr, size, offset(member), extrepr, value) - res (XtNresizeCallback, XtCCallback, XtRCallback, XtCallbackList, - resize_callback, XtRImmediate, 0), - res (XtNqueryGeometryCallback, XtCCallback, XtRCallback, XtCallbackList, - query_geometry_callback, XtRImmediate, 0), - res (XtNuserData, XtCUserData, XtRPointer, XtPointer, - user_data, XtRImmediate, 0), + { XtNresizeCallback, XtCCallback, + XtRCallback, sizeof (XtCallbackList), + offset(resize_callback), XtRImmediate, (XtPointer) 0 }, + { XtNqueryGeometryCallback, XtCCallback, + XtRCallback, sizeof (XtCallbackList), + offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 }, + { XtNuserData, XtCUserData, + XtRPointer, sizeof (XtPointer), + offset(user_data), XtRImmediate, (XtPointer) 0 }, }; /**************************************************************** @@ -75,7 +75,7 @@ #else /* superclass */ (WidgetClass) &compositeClassRec, #endif - /* class_name */ (String) "EmacsManager", + /* class_name */ "EmacsManager", /* widget_size */ sizeof (EmacsManagerRec), /* class_initialize */ ClassInitialize, /* class_part_init */ NULL,
--- a/src/EmacsShell-sub.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/EmacsShell-sub.c Wed Oct 29 03:37:16 2008 +0900 @@ -89,7 +89,6 @@ #include <X11/Vendor.h> #include <X11/VendorP.h> #include "EmacsShellP.h" -#include "../lwlib/xt-wrappers.h" #define ABORT abort @@ -135,28 +134,30 @@ static XtResource resources[] = { #define offset(field) XtOffset(EMACS_SHELL_WIDGET, emacs_shell.field) #define coreoffset(field) XtOffset(EMACS_SHELL_WIDGET, core.field) -#define res(name,_class,member,size) \ - { (String) name, (String) _class, XtRInt, sizeof (int), \ - offset (member), XtRImmediate, (XtPointer)0 } -#define motifres(name,member) \ - { (String) name, XtCPosition, XtRPosition, sizeof (Position), \ - coreoffset (member), XtRImmediate, (XtPointer)BIGSIZE } #ifdef LWLIB_USES_MOTIF /* *** BOGOSITY^10! *** The Motif VendorShell fucks around with the default values for X and Y, for no obvious reason. This causes Shell to indicate that the defaults of (0,0) were program-specified, instead of letting the WM do what it wants. */ - motifres (XtNx, x), - motifres (XtNy, y), + { XtNx, XtCPosition, + XtRPosition, sizeof (Position), + coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE }, + { XtNy, XtCPosition, + XtRPosition, sizeof (Position), + coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE }, #endif - res (XtNwidthCells, XtCWidthCells, width_cells, 0), - res (XtNheightCells, XtCHeightCells, height_cells, 0), - res (XtNminWidthCells, XtCMinWidthCells, min_width_cells, 0), - res (XtNminHeightCells, XtCMinHeightCells, min_height_cells, 0), -#undef offset -#undef coreoffset -#undef res -#undef motifres + { XtNwidthCells, XtCWidthCells, + XtRInt, sizeof (int), + offset (width_cells), XtRImmediate, (XtPointer)0 }, + { XtNheightCells, XtCHeightCells, + XtRInt, sizeof (int), + offset (height_cells), XtRImmediate, (XtPointer)0 }, + { XtNminWidthCells, XtCMinWidthCells, + XtRInt, sizeof (int), + offset (min_width_cells), XtRImmediate, (XtPointer)0 }, + { XtNminHeightCells, XtCMinHeightCells, + XtRInt, sizeof (int), + offset (min_height_cells), XtRImmediate, (XtPointer)0 }, }; static CompositeClassExtensionRec compositeClassExtRec = { @@ -258,12 +259,12 @@ printf (" base size set to: %d %d\n", base_width, base_height); fflush (stdout); #endif - Xt_SET_ARG(al [0], XtNbaseWidth, base_width); - Xt_SET_ARG(al [1], XtNbaseHeight, base_height); - Xt_SET_ARG(al [2], XtNminWidth, base_width + - cell_width * w->emacs_shell.min_width_cells); - Xt_SET_ARG(al [3], XtNminHeight, base_height + - cell_height * w->emacs_shell.min_height_cells); + XtSetArg(al [0], XtNbaseWidth, base_width); + XtSetArg(al [1], XtNbaseHeight, base_height); + XtSetArg(al [2], XtNminWidth, base_width + + cell_width * w->emacs_shell.min_width_cells); + XtSetArg(al [3], XtNminHeight, base_height + + cell_height * w->emacs_shell.min_height_cells); XtSetValues ((Widget) w, al, 4); }
--- a/src/console-x.h Tue Oct 28 10:38:26 2008 +0900 +++ b/src/console-x.h Wed Oct 29 03:37:16 2008 +0900 @@ -66,6 +66,18 @@ # define XPointer char * #endif +#define Xt_SET_VALUE(widget, resource, value) do { \ + Arg al; \ + XtSetArg (al, resource, value); \ + XtSetValues (widget, &al, 1); \ +} while (0) + +#define Xt_GET_VALUE(widget, resource, location) do { \ + Arg al; \ + XtSetArg (al, resource, location); \ + XtGetValues (widget, &al, 1); \ +} while (0) + #ifdef __cplusplus #define X_CLASSFIELD c_class #else @@ -200,7 +212,7 @@ void describe_XIMStyles (XIMStyles *styles); void describe_XIC (XIC ic); void describe_event_mask (unsigned long mask); -void describe_XRectangle (const char *name, XRectangle *rect); +void describe_XRectangle (char *name, XRectangle *rect); void describe_Status (Status status); #endif /* DEBUG_XEMACS */ #endif /* XIM_XLIB */
--- a/src/device-x.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/device-x.c Wed Oct 29 03:37:16 2008 +0900 @@ -79,33 +79,29 @@ Lisp_Object Vx_initial_argv_list; /* #### ugh! */ -/* Shut up G++ 4.3. */ -#define Xrm_ODR(option,resource,type,default) \ - { (String) option, (String) resource, type, default } - static XrmOptionDescRec emacs_options[] = { - Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL), - Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "yes"), + {"-geometry", ".geometry", XrmoptionSepArg, NULL}, + {"-iconic", ".iconic", XrmoptionNoArg, "yes"}, - Xrm_ODR ("-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), - Xrm_ODR ("-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), - Xrm_ODR ("-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL), - Xrm_ODR ("-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL), + {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL}, + {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL}, + {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL}, + {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL}, - Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"), - Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL), + {"-privatecolormap", ".privateColormap", XrmoptionNoArg, "yes"}, + {"-visual", ".EmacsVisual", XrmoptionSepArg, NULL}, /* #### Beware! If the type of the shell changes, update this. */ - Xrm_ODR ("-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), - Xrm_ODR ("-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), - Xrm_ODR ("-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), + {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, + {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, + {"-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, - Xrm_ODR ("-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), - Xrm_ODR ("-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), - Xrm_ODR ("-mc", "*pointerColor", XrmoptionSepArg, NULL), - Xrm_ODR ("-cr", "*cursorColor", XrmoptionSepArg, NULL), - Xrm_ODR ("-fontset", "*FontSet", XrmoptionSepArg, NULL), + {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL}, + {"-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL}, + {"-mc", "*pointerColor", XrmoptionSepArg, NULL}, + {"-cr", "*cursorColor", XrmoptionSepArg, NULL}, + {"-fontset", "*FontSet", XrmoptionSepArg, NULL}, }; static const struct memory_description x_device_data_description_1 [] = { @@ -333,7 +329,7 @@ if (argc > 0 && argv[0] && *argv[0]) return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0]; - return (Extbyte *) "xemacs"; /* shut up g++ 4.3 */ + return "xemacs"; } /* @@ -347,7 +343,7 @@ static int have_xemacs_resources_in_xrdb (Display *dpy) { - const char *xdefs, *key; + char *xdefs, *key; int len; #ifdef INFODOCK @@ -692,9 +688,9 @@ does not override resources defined elsewhere */ const Extbyte *data_dir; Extbyte *path; - const Extbyte *format; + Extbyte *format; XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ - const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); + Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); Extbyte *locale_end; if (STRINGP (Vx_app_defaults_directory) && @@ -743,11 +739,7 @@ } no_data_directory: - { - /* Cast off const for G++ 4.3. */ - Extbyte *temp = (Extbyte *) locale; - xfree (temp, Extbyte*); - } + xfree (locale, Extbyte*); } #endif /* MULE */ @@ -869,9 +861,9 @@ be the place. Make sure it doesn't conflict with GNOME. */ { Arg al[3]; - Xt_SET_ARG (al[0], XtNvisual, visual); - Xt_SET_ARG (al[1], XtNdepth, depth); - Xt_SET_ARG (al[2], XtNcolormap, cmap); + XtSetArg (al[0], XtNvisual, visual); + XtSetArg (al[1], XtNdepth, depth); + XtSetArg (al[2], XtNcolormap, cmap); app_shell = XtAppCreateShell (NULL, app_class, applicationShellWidgetClass, @@ -888,13 +880,11 @@ and set it to the size of the root window for child placement purposes */ { Arg al[5]; - Xt_SET_ARG (al[0], XtNmappedWhenManaged, False); - Xt_SET_ARG (al[1], XtNx, 0); - Xt_SET_ARG (al[2], XtNy, 0); - Xt_SET_ARG (al[3], XtNwidth, - WidthOfScreen (ScreenOfDisplay (dpy, screen))); - Xt_SET_ARG (al[4], XtNheight, - HeightOfScreen (ScreenOfDisplay (dpy, screen))); + XtSetArg (al[0], XtNmappedWhenManaged, False); + XtSetArg (al[1], XtNx, 0); + XtSetArg (al[2], XtNy, 0); + XtSetArg (al[3], XtNwidth, WidthOfScreen (ScreenOfDisplay (dpy, screen))); + XtSetArg (al[4], XtNheight, HeightOfScreen (ScreenOfDisplay (dpy, screen))); XtSetValues (app_shell, al, countof (al)); XtRealizeWidget (app_shell); }
--- a/src/emacs.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/emacs.c Wed Oct 29 03:37:16 2008 +0900 @@ -806,7 +806,7 @@ enough information to do it right. */ static int -argmatch (Wexttext **argv, int argc, const Ascbyte *sstr, const Ascbyte *lstr, +argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr, int minlen, Wexttext **valptr, int *skipptr) { Wexttext *p = NULL; @@ -862,7 +862,7 @@ } static void -check_compatible_window_system (const Ascbyte *must) +check_compatible_window_system (Ascbyte *must) { if (display_use && strcmp (display_use, must)) fatal ("Incompatible window system type `%s': `%s' already specified",
--- a/src/emodules.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/emodules.c Wed Oct 29 03:37:16 2008 +0900 @@ -96,7 +96,7 @@ */ (file, name, version)) { - const CIbyte *mod, *mname, *mver; + CIbyte *mod, *mname, *mver; int speccount = specpdl_depth(); CHECK_STRING(file); @@ -136,7 +136,7 @@ (file, name, version)) { int x; - const CIbyte *mod, *mname, *mver; + CIbyte *mod, *mname, *mver; Lisp_Object foundname = Qnil; struct gcpro gcpro1;
--- a/src/event-Xt.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/event-Xt.c Wed Oct 29 03:37:16 2008 +0900 @@ -109,9 +109,7 @@ extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask; extern SELECT_TYPE process_only_mask, tty_only_mask; -/* #### This should be String, but G++ 4.3 doesn't apply the const - specifier the same way for String (typedef'd to char*) and char*. */ -static const char * x_fallback_resources[] = +static const String x_fallback_resources[] = { /* This file is automatically generated from the app-defaults file in ../etc/Emacs.ad. These resources are consulted only if no @@ -3128,8 +3126,8 @@ static XtActionsRec widgetActionsList[] = { - { (String) "widget-focus-in", emacs_Xt_event_widget_focus_in }, - { (String) "widget-focus-out", emacs_Xt_event_widget_focus_out }, + {"widget-focus-in", emacs_Xt_event_widget_focus_in }, + {"widget-focus-out", emacs_Xt_event_widget_focus_out }, }; static void
--- a/src/event-stream.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/event-stream.c Wed Oct 29 03:37:16 2008 +0900 @@ -255,7 +255,7 @@ Fixnum debug_emacs_events; static void -external_debugging_print_event (const char *event_description, Lisp_Object event) +external_debugging_print_event (char *event_description, Lisp_Object event) { write_c_string (Qexternal_debugging_output, "("); write_c_string (Qexternal_debugging_output, event_description);
--- a/src/file-coding.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/file-coding.c Wed Oct 29 03:37:16 2008 +0900 @@ -897,8 +897,8 @@ struct subsidiary_type { - const Ascbyte *extension; - const Ascbyte *mnemonic_ext; + Ascbyte *extension; + Ascbyte *mnemonic_ext; enum eol_type eol; }; @@ -944,8 +944,8 @@ for (i = 0; i < countof (coding_subsidiary_list); i++) { - const Ascbyte *extension = coding_subsidiary_list[i].extension; - const Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext; + Ascbyte *extension = coding_subsidiary_list[i].extension; + Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext; enum eol_type eol = coding_subsidiary_list[i].eol; qxestrcpy_ascii (codesys_name + len, extension); @@ -1021,7 +1021,7 @@ */ static Lisp_Object -make_coding_system_1 (Lisp_Object name_or_existing, const Ascbyte *prefix, +make_coding_system_1 (Lisp_Object name_or_existing, Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props) { @@ -1192,7 +1192,7 @@ } Lisp_Object -make_internal_coding_system (Lisp_Object existing, const Ascbyte *prefix, +make_internal_coding_system (Lisp_Object existing, Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props) {
--- a/src/file-coding.h Tue Oct 28 10:38:26 2008 +0900 +++ b/src/file-coding.h Wed Oct 29 03:37:16 2008 +0900 @@ -1046,7 +1046,7 @@ Ichar decode_big5_char (int o1, int o2); void add_entry_to_coding_system_type_list (struct coding_system_methods *m); Lisp_Object make_internal_coding_system (Lisp_Object existing, - const Ascbyte *prefix, + Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props);
--- a/src/frame-x.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/frame-x.c Wed Oct 29 03:37:16 2008 +0900 @@ -280,8 +280,8 @@ if (cw <= 0 || ch <= 0) ABORT (); - Xt_SET_ARG (al[0], XtNwidthInc, cw); - Xt_SET_ARG (al[1], XtNheightInc, ch); + XtSetArg (al[0], XtNwidthInc, cw); + XtSetArg (al[1], XtNheightInc, ch); XtSetValues (wmshell, al, 2); } @@ -298,8 +298,8 @@ fflush (stdout); #endif - Xt_SET_ARG (al[0], XtNwidthCells, width); - Xt_SET_ARG (al[1], XtNheightCells, height); + XtSetArg (al[0], XtNwidthCells, width); + XtSetArg (al[1], XtNheightCells, height); XtSetValues (wmshell, al, 2); } @@ -668,8 +668,8 @@ if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) { Arg al[2]; - Xt_SET_ARG (al[0], Xt_resource_name, new_XtValue); - Xt_SET_ARG (al[1], Xt_resource_encoding_name, encoding); + XtSetArg (al[0], Xt_resource_name, new_XtValue); + XtSetArg (al[1], Xt_resource_encoding_name, encoding); XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); } } @@ -1539,8 +1539,8 @@ if (! (frame_flags & (WidthValue | HeightValue))) { Arg al[2]; - Xt_SET_ARG (al [0], XtNwidth, &frame_w); - Xt_SET_ARG (al [1], XtNheight, &frame_h); + XtSetArg (al [0], XtNwidth, &frame_w); + XtSetArg (al [1], XtNheight, &frame_h); XtGetValues (ew, al, 2); if (!frame_w && !frame_h) { @@ -1554,8 +1554,8 @@ if (frame_flags & (XValue | YValue)) { Arg al[2]; - Xt_SET_ARG (al [0], XtNwidth, &frame_w); - Xt_SET_ARG (al [1], XtNheight, &frame_h); + XtSetArg (al [0], XtNwidth, &frame_w); + XtSetArg (al [1], XtNheight, &frame_h); XtGetValues (ew, al, 2); if (frame_flags & XNegative) @@ -1563,8 +1563,8 @@ if (frame_flags & YNegative) frame_y += frame_h; - Xt_SET_ARG (al [0], XtNx, frame_x); - Xt_SET_ARG (al [1], XtNy, frame_y); + XtSetArg (al [0], XtNx, frame_x); + XtSetArg (al [1], XtNy, frame_y); XtSetValues (ew, al, 2); } return; @@ -1869,40 +1869,40 @@ FRAME_X_TOP_LEVEL_FRAME_P (f) = 1; ac = 0; - Xt_SET_ARG (al[ac], XtNallowShellResize, True); ac++; + XtSetArg (al[ac], XtNallowShellResize, True); ac++; #ifdef LWLIB_USES_MOTIF /* Motif sucks beans. Without this in here, it will delete the window out from under us when it receives a WM_DESTROY_WINDOW message from the WM. */ - Xt_SET_ARG (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++; + XtSetArg (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++; #endif #ifdef EXTERNAL_WIDGET if (window_id) { - Xt_SET_ARG (al[ac], XtNwindow, window_id); ac++; + XtSetArg (al[ac], XtNwindow, window_id); ac++; } else #endif /* EXTERNAL_WIDGET */ { - Xt_SET_ARG (al[ac], XtNinput, True); ac++; - Xt_SET_ARG (al[ac], XtNminWidthCells, 10); ac++; - Xt_SET_ARG (al[ac], XtNminHeightCells, 1); ac++; - Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; - Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; - Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; + XtSetArg (al[ac], XtNinput, True); ac++; + XtSetArg (al[ac], XtNminWidthCells, 10); ac++; + XtSetArg (al[ac], XtNminHeightCells, 1); ac++; + XtSetArg (al[ac], XtNvisual, visual); ac++; + XtSetArg (al[ac], XtNdepth, depth); ac++; + XtSetArg (al[ac], XtNcolormap, cmap); ac++; } if (!NILP (overridep)) { - Xt_SET_ARG (al[ac], XtNoverrideRedirect, True); ac++; + XtSetArg (al[ac], XtNoverrideRedirect, True); ac++; } /* #### maybe we should check for FRAMEP instead? */ if (!NILP (parent)) { parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent)); - Xt_SET_ARG (al[ac], XtNtransientFor, parentwid); ac++; + XtSetArg (al[ac], XtNtransientFor, parentwid); ac++; } shell = XtCreatePopupShell ("shell", @@ -1921,9 +1921,9 @@ /* Create the manager widget */ ac = 0; - Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; - Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; - Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; + XtSetArg (al[ac], XtNvisual, visual); ac++; + XtSetArg (al[ac], XtNdepth, depth); ac++; + XtSetArg (al[ac], XtNcolormap, cmap); ac++; container = XtCreateWidget ("container", emacsManagerWidgetClass, shell, al, ac); @@ -1935,11 +1935,11 @@ /* Create the text area */ ac = 0; - Xt_SET_ARG (al[ac], XtNvisual, visual); ac++; - Xt_SET_ARG (al[ac], XtNdepth, depth); ac++; - Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++; - Xt_SET_ARG (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */ - Xt_SET_ARG (al[ac], XtNemacsFrame, f); ac++; + XtSetArg (al[ac], XtNvisual, visual); ac++; + XtSetArg (al[ac], XtNdepth, depth); ac++; + XtSetArg (al[ac], XtNcolormap, cmap); ac++; + XtSetArg (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */ + XtSetArg (al[ac], XtNemacsFrame, f); ac++; text = XtCreateWidget (name, emacsFrameClass, container, al, ac); FRAME_X_TEXT_WIDGET (f) = text; @@ -2198,8 +2198,8 @@ /* Store the X data into the widget. */ { Arg al[2]; - Xt_SET_ARG (al[0], XtNiconPixmap, x_pixmap); - Xt_SET_ARG (al[1], XtNiconMask, x_mask); + XtSetArg (al[0], XtNiconPixmap, x_pixmap); + XtSetArg (al[1], XtNiconMask, x_mask); XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); } } @@ -2264,9 +2264,9 @@ int win_gravity; Arg al[3]; - Xt_SET_ARG (al[0], XtNwidth, &shell_w); - Xt_SET_ARG (al[1], XtNheight, &shell_h); - Xt_SET_ARG (al[2], XtNborderWidth, &shell_bord); + XtSetArg (al[0], XtNwidth, &shell_w); + XtSetArg (al[1], XtNheight, &shell_h); + XtSetArg (al[2], XtNborderWidth, &shell_bord); XtGetValues (w, al, 3); win_gravity = @@ -2283,9 +2283,9 @@ come back at the right place. We can't look at s->visible to determine whether it is iconified because it might not be up-to-date yet (the queue might not be processed). */ - Xt_SET_ARG (al[0], XtNwinGravity, win_gravity); - Xt_SET_ARG (al[1], XtNx, xoff); - Xt_SET_ARG (al[2], XtNy, yoff); + XtSetArg (al[0], XtNwinGravity, win_gravity); + XtSetArg (al[1], XtNx, xoff); + XtSetArg (al[2], XtNy, yoff); XtSetValues (w, al, 3); /* Sometimes you will find that @@ -2709,7 +2709,7 @@ if (!EQ (color, Vthe_null_color_instance)) { fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); - Xt_SET_ARG (al[ac], XtNforeground, (void *) fgc.pixel); ac++; + XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++; } } else if (EQ (name, Qbackground)) @@ -2720,7 +2720,7 @@ if (!EQ (color, Vthe_null_color_instance)) { bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)); - Xt_SET_ARG (al[ac], XtNbackground, (void *) bgc.pixel); ac++; + XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++; } /* Really crappy way to force the modeline shadows to be @@ -2754,15 +2754,15 @@ #ifdef USE_XFT else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))) { - Xt_SET_ARG (al[ac], XtNxftFont, + XtSetArg (al[ac], XtNxftFont, (void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))); ac++; } #endif else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))) { - Xt_SET_ARG (al[ac], XtNfont, - (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))); + XtSetArg (al[ac], XtNfont, + (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))); ac++; } }
--- a/src/gif_io.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/gif_io.c Wed Oct 29 03:37:16 2008 +0900 @@ -140,7 +140,7 @@ return ((*(GifIO->CloseFunc))(GifIO->CloseFunc_data)); } -static const char *GifErrorString[14] = { +static char *GifErrorString[14] = { "Failed to open given file", /* D_GIF_ERR_OPEN_FAILED */ "Failed to read from given file", /* D_GIF_ERR_READ_FAILED */ "Given file is NOT a GIF file", /* D_GIF_ERR_NOT_GIF_FILE */ @@ -164,7 +164,7 @@ *****************************************************************************/ const char *GetGifError(int errore) { - const char *Err; + char *Err; switch(errore) { case D_GIF_ERR_OPEN_FAILED:
--- a/src/glyphs-x.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/glyphs-x.c Wed Oct 29 03:37:16 2008 +0900 @@ -2234,8 +2234,8 @@ if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed) { Arg al[2]; - Xt_SET_ARG (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); - Xt_SET_ARG (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p)); + XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); + XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p)); XtGetValues (FRAME_X_TEXT_WIDGET (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2); } @@ -2424,7 +2424,7 @@ (IMAGE_INSTANCE_WIDGET_FACE (ii), domain); XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)); - lw_add_widget_value_arg (val, (String) XtNtabForeground, fcolor.pixel); + lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel); wv->change = VISIBLE_CHANGE; val->change = VISIBLE_CHANGE; @@ -2539,8 +2539,8 @@ offset the redisplay of the widget by the amount the text widget is inside the manager. */ ac = 0; - Xt_SET_ARG (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++; - Xt_SET_ARG (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++; + XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++; + XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++; XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac); XtSetMappedWhenManaged (wid, TRUE); @@ -2608,11 +2608,11 @@ Arg al [2]; int ac =0; #ifdef LWLIB_WIDGETS_MOTIF - Xt_SET_ARG (al [ac], XmNlabelType, XmPIXMAP); ac++; - Xt_SET_ARG (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); + XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++; + XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; #else - Xt_SET_ARG (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; + XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++; #endif XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac); } @@ -2683,9 +2683,11 @@ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { + Arg al [1]; Lisp_Object val; val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value; - Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (p), XtNvalue, XINT (val)); + XtSetArg (al[0], XtNvalue, XINT (val)); + XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 1); } } @@ -2771,6 +2773,7 @@ Lisp_Object old_selected = gui_item_list_find_selected (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii))); + Arg al [1]; char* name; unsigned int num_children, i; Widget* children; @@ -2786,8 +2789,8 @@ { if (!strcmp (XtName (children [i]), name)) { - Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (ii), - XtNtopWidget, children [i]); + XtSetArg (al [0], XtNtopWidget, children [i]); + XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1); break; } }
--- a/src/input-method-xlib.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/input-method-xlib.c Wed Oct 29 03:37:16 2008 +0900 @@ -286,19 +286,19 @@ xic_vars_t xic_vars; XIC xic; -#define res(name, class_, representation, field, default_value) \ - Xt_RESOURCE (name, class_, representation, xic_vars.field, \ - XtOffsetOf(xic_vars_t, field), XtRString, default_value) +#define res(name, class_, representation, field, default_value) \ + { name, class_, representation, sizeof(xic_vars.field), \ + XtOffsetOf(xic_vars_t, field), XtRString, default_value } static XtResource resources[] = { /* name class represent'n field default value */ - res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, DefaultXIMStyles), - res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, XtDefaultFontSet), - res(XtNximForeground, XtCForeground, XtRPixel, fg, XtDefaultForeground), - res(XtNximBackground, XtCBackground, XtRPixel, bg, XtDefaultBackground) + res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, (XtPointer) DefaultXIMStyles), + res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, (XtPointer) XtDefaultFontSet), + res(XtNximForeground, XtCForeground, XtRPixel, fg, (XtPointer) XtDefaultForeground), + res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground) }; -#undef res + xim = DEVICE_X_XIM (d); @@ -977,7 +977,7 @@ } void -describe_XRectangle (const char *name, XRectangle *r) +describe_XRectangle (char *name, XRectangle *r) { if (r == NULL) stderr_out ("%s: NULL\n", name);
--- a/src/menubar-x.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/menubar-x.c Wed Oct 29 03:37:16 2008 +0900 @@ -690,13 +690,13 @@ { Widget shell = XtParent (daddy); - Xt_SET_ARG (al [0], XtNx, &shellx); - Xt_SET_ARG (al [1], XtNy, &shelly); + XtSetArg (al [0], XtNx, &shellx); + XtSetArg (al [1], XtNy, &shelly); XtGetValues (shell, al, 2); } #endif - Xt_SET_ARG (al [0], XtNx, &framex); - Xt_SET_ARG (al [1], XtNy, &framey); + XtSetArg (al [0], XtNx, &framex); + XtSetArg (al [1], XtNy, &framey); XtGetValues (daddy, al, 2); btn->x_root = shellx + framex + btn->x; btn->y_root = shelly + framey + btn->y;
--- a/src/mule-coding.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/mule-coding.c Wed Oct 29 03:37:16 2008 +0900 @@ -3339,7 +3339,7 @@ { Lisp_Object sym; struct ccl_program test_ccl; - const Ascbyte *suffix; + Ascbyte *suffix; /* Check key first. */ if (EQ (key, Qdecode))
--- a/src/print.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/print.c Wed Oct 29 03:37:16 2008 +0900 @@ -1527,7 +1527,7 @@ static void printing_major_badness (Lisp_Object printcharfun, - const Ascbyte *badness_string, int type, void *val, + Ascbyte *badness_string, int type, void *val, enum printing_badness badness) { Ibyte buf[666];
--- a/src/redisplay.c Tue Oct 28 10:38:26 2008 +0900 +++ b/src/redisplay.c Wed Oct 29 03:37:16 2008 +0900 @@ -4447,7 +4447,7 @@ { invalid: { - const char *str = GETTEXT ("*invalid*"); + char *str = GETTEXT ("*invalid*"); Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */ if (size <= *offset)