commit: Fix docstring typo (and commit only this fix).
16 years, 1 month
Stephen Turnbull
changeset: 4523:6a3006b372608e97b2617a232ba950e1b1bb2b08
tag: tip
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Wed Oct 29 03:44:31 2008 +0900
files: lisp/ChangeLog lisp/version.el
description:
Fix docstring typo (and commit only this fix).
diff -r fc7067b7f407dff47e9931de44c2eda21c9a0402 -r 6a3006b372608e97b2617a232ba950e1b1bb2b08 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Oct 29 03:37:16 2008 +0900
+++ b/lisp/ChangeLog Wed Oct 29 03:44:31 2008 +0900
@@ -1,3 +1,7 @@ 2008-09-30 Stephen J. Turnbull <stephe
+2008-10-28 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * version.el (xemacs-betaname): Fix docstring typo. (Thanks, Ville!)
+
2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
* version.el (xemacs-betaname):
diff -r fc7067b7f407dff47e9931de44c2eda21c9a0402 -r 6a3006b372608e97b2617a232ba950e1b1bb2b08 lisp/version.el
--- a/lisp/version.el Wed Oct 29 03:37:16 2008 +0900
+++ b/lisp/version.el Wed Oct 29 03:44:31 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.
-It value is derived from `emacs-beta-version'. It is mutually exclusive
+Its value is derived from `emacs-beta-version'. It is mutually exclusive
with `emacs-patch-level'.")
(defconst emacs-version
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Backout last patch; forgot to specify file.
16 years, 1 month
Stephen Turnbull
changeset: 4522:fc7067b7f407dff47e9931de44c2eda21c9a0402
tag: tip
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Wed Oct 29 03:37:16 2008 +0900
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
description:
Backout last patch; forgot to specify file.
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lisp/ChangeLog
--- 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 <stephe
-2008-10-28 Stephen J. Turnbull <stephen(a)xemacs.org>
-
- * version.el (xemacs-betaname): Fix docstring typo. (Thanks, Ville!)
-
2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
* version.el (xemacs-betaname):
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lisp/version.el
--- 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
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/ChangeLog
--- 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 <stephe
-2008-10-26 Stephen J. Turnbull <stephen(a)xemacs.org>
-
- * lwlib-Xm.c (xm_update_progress): Set all values!
-
2007-09-15 Jerry James <james(a)xemacs.org>
* xlwmenu.c (XlwMenuDestroy): Release XftFont resources
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/lwlib-Xaw.c
--- 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 @@ xaw_update_scrollbar (widget_instance *i
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 @@ xaw_update_one_widget (widget_instance *
#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 @@ xaw_update_one_widget (widget_instance *
#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 @@ xaw_update_one_value (widget_instance *i
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;
-
- Xt_GET_VALUE (widget, XtNstring, &buf);
+ XtSetArg (al [0], XtNstring, &buf);
+ XtGetValues (widget, al, 1);
+
if (val->value)
{
free (val->value);
@@ -322,7 +339,7 @@ static XtActionProc wm_delete_window (Wi
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 @@ make_dialog (const char* name, Widget pa
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 @@ make_dialog (const char* name, Widget pa
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 @@ make_dialog (const char* name, Widget pa
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 @@ make_dialog (const char* name, Widget pa
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 @@ xaw_generic_callback (Widget widget, XtP
if (XtIsSubclass (widget, toggleWidgetClass))
{
Boolean check;
-
- Xt_GET_VALUE (widget, XtNstate, &check);
-
- Xt_SET_VALUE (widget, XtNstate, !check);
+ Arg al [1];
+
+ XtSetArg (al [0], XtNstate, &check);
+ XtGetValues (widget, al, 1);
+
+ 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 @@ xaw_generic_callback (Widget widget, XtP
#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 @@ wm_delete_window (Widget shell, XtPointe
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 @@ xaw_create_scrollbar (widget_instance *i
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 @@ xaw_create_button (widget_instance *inst
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 @@ xaw_create_button (widget_instance *inst
{
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 @@ xaw_create_label (Widget parent, widget_
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 @@ xaw_create_progress (widget_instance *in
#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++;
-#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], XtNsensitive, True); ac++;
+#endif
+
+ 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 @@ xaw_create_text_field (widget_instance *
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 @@ xaw_creation_table [] =
#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}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/lwlib-Xlw.c
--- 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 @@ xlw_create_menubar (widget_instance* ins
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 @@ xlw_create_popup_menu (widget_instance*
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 @@ xlw_create_scrollbar (widget_instance *i
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++;
-
- 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], 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++;
+
+ 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 @@ xlw_update_scrollbar (widget_instance *U
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 @@ xlw_create_tab_control (widget_instance
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 @@ static void build_tabs_in_widget (widget
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 @@ xlw_create_clip_window (widget_instance
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 @@ xlw_update_one_widget (widget_instance*
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
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/lwlib-Xm.c
--- 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 @@ xm_update_label (widget_instance* UNUSED
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 @@ xm_update_label (widget_instance* UNUSED
}
}
- 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* i
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 @@ xm_update_progress (widget_instance* UNU
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++;
- }
- height = (Dimension) lw_get_value_arg (val, XtNheight);
- width = (Dimension) lw_get_value_arg (val, XtNwidth);
+ XtSetArg (al [ac], XmNeditable, val->enabled); 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++;
}
XtSetValues (scale, al, ac);
@@ -416,8 +419,8 @@ xm_update_toggle (widget_instance* insta
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 @@ xm_update_radiobox (widget_instance* ins
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 @@ xm_update_radiobox (widget_instance* ins
{
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 @@ make_menu_in_widget (widget_instance* in
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 @@ make_menu_in_widget (widget_instance* in
{
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 @@ make_menu_in_widget (widget_instance* in
/* #### - 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 @@ make_menu_in_widget (widget_instance* in
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 @@ make_menu_in_widget (widget_instance* in
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_one_menu_entry (widget_instance*
/* 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_one_menu_entry (widget_instance*
/* 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 @@ update_one_menu_entry (widget_instance*
{
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 @@ xm_update_scrollbar (widget_instance *in
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 @@ xm_update_one_widget (widget_instance* i
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 @@ xm_update_one_widget (widget_instance* i
{
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 @@ xm_update_one_value (widget_instance* in
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 @@ xm_update_one_value (widget_instance* in
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 @@ xm_update_one_value (widget_instance* in
{
int set = False;
Widget toggle = radio->composite.children [i];
-
- Xt_GET_VALUE (toggle, XmNset, &set);
+ Arg al [1];
+
+ XtSetArg (al [0], XmNset, &set);
+ XtGetValues (toggle, al, 1);
if (set)
{
if (val->value)
@@ -1105,42 +1130,42 @@ make_dialog (char* UNUSED (name), Widget
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 @@ make_dialog (char* UNUSED (name), Widget
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 @@ make_dialog (char* UNUSED (name), Widget
{
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 @@ make_dialog (char* UNUSED (name), Widget
/* 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 @@ make_dialog (char* UNUSED (name), Widget
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 @@ make_dialog (char* UNUSED (name), Widget
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 @@ make_dialog (char* UNUSED (name), Widget
{
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 @@ make_dialog (char* UNUSED (name), Widget
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 @@ make_dialog (char* UNUSED (name), Widget
/* 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 @@ recenter_widget (Widget widget)
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 @@ recenter_widget (Widget widget)
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 @@ recycle_instance (destroyed_instance* in
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 @@ make_menubar (widget_instance* instance)
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 @@ make_scrollbar (widget_instance *instanc
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++;
-
- 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], 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++;
+
+ 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 @@ xm_create_button (widget_instance *insta
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 @@ xm_create_button (widget_instance *insta
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 @@ xm_create_progress (widget_instance *ins
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++;
- }
- 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], XmNeditable, val->enabled); 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 @@ xm_create_text_field (widget_instance *i
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 @@ xm_create_label (Widget parent, widget_v
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 @@ xm_create_combo_box (widget_instance *in
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 @@ xm_popup_menu (Widget widget, XEvent *ev
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 @@ set_min_dialog_size (Widget w)
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 @@ do_call (Widget widget, XtPointer closur
widget_instance* instance = (widget_instance*)closure;
Widget instance_widget;
LWLIB_ID id;
+ Arg al [1];
if (!instance)
return;
@@ -2001,7 +2027,8 @@ do_call (Widget widget, XtPointer closur
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 @@ xm_generic_callback (Widget widget, XtPo
|| XtClass (widget) == xmToggleButtonGadgetClass)
{
Boolean check;
-
- Xt_GET_VALUE (widget, XmNset, &check);
- Xt_SET_VALUE (widget, XmNset, !check);
+ Arg al [1];
+
+ 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);
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/lwlib.c
--- 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 @@ void lw_add_value_args_to_args (widget_v
}
}
-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)
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/lwlib.h
--- 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
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwcheckbox.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
#include "../src/xmu.h"
-#include "xt-wrappers.h"
#include "xlwcheckboxP.h"
@@ -90,12 +89,10 @@ static char defaultTranslations[] =
-#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 = {
CheckboxClassRec checkboxClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- (String) "Checkbox", /* class_name */
+ "Checkbox", /* class_name */
sizeof(CheckboxRec), /* size */
CheckboxClassInit, /* class_initialize */
NULL, /* class_part_initialize */
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwgauge.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#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 @@ static char defaultTranslations[] =
-#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 GC Get_GC (GaugeWidget, Pixel);
static XtActionsRec actionsList[] =
{
- { (String) "select", GaugeSelect },
- { (String) "paste", GaugePaste },
+ {"select", GaugeSelect},
+ {"paste", GaugePaste},
} ;
@@ -159,7 +162,7 @@ GaugeClassRec gaugeClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) &labelClassRec,
- /* class_name */ (String) "Gauge",
+ /* class_name */ "Gauge",
/* widget_size */ sizeof(GaugeRec),
/* class_initialize */ GaugeClassInit,
/* class_part_initialize */ NULL,
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwmenu.c
--- 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 @@ xlwMenuTranslations [] =
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"),
-#else
- fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
- "XtDefaultFont"),
+ XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
+#else
+ {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),
-#else
- dimres (XmNshadowThickness, XmCShadowThickness, XtRDimension,
- shadow_thickness, 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),
-
+ {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
+ sizeof (Dimension), offset (menu.shadow_thickness),
+ XtRImmediate, (XtPointer) 2},
+#else
+ {XmNshadowThickness, XmCShadowThickness, XtRDimension,
+ sizeof (Dimension), offset (menu.shadow_thickness),
+ XtRImmediate, (XtPointer) 2},
+#endif
+ {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
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 @@ XlwMenuClassRec xlwMenuClassRec =
{
{ /* 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
static XtResource
nameResource[] =
{
- { (String) "labelString", (String) "LabelString", XtRString, sizeof(String),
+ { "labelString", "LabelString", XtRString, sizeof(String),
0, XtRImmediate, 0 }
};
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwradio.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#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 void RadioSize (RadioWidget, Dime
static XtActionsRec actionsList[] =
{
- { (String) "highlight", RadioHighlight },
- { (String) "unhighlight", RadioUnhighlight },
+ {"highlight", RadioHighlight},
+ {"unhighlight", RadioUnhighlight},
};
#define SuperClass ((ToggleWidgetClass)&toggleClassRec)
@@ -126,7 +125,7 @@ RadioClassRec radioClassRec = {
RadioClassRec radioClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- (String) "Radio", /* class_name */
+ "Radio", /* class_name */
sizeof(RadioRec), /* size */
RadioClassInit, /* class_initialize */
RadioClassPartInit, /* class_part_initialize */
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwscrollbar.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#include <X11/bitmaps/gray>
#include "lwlib-colors.h"
-#include "xt-wrappers.h"
#include "xlwscrollbarP.h"
#include "xlwscrollbar.h"
@@ -114,79 +113,90 @@ typedef enum
} 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)
-
- res (XmNforeground, XmCForeground, XtRPixel, Pixel,
- foreground, XtRImmediate, XtDefaultForeground),
- res (XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
- Pixel, topShadowColor, XtRImmediate, ~0),
- res (XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
- Pixel, bottomShadowColor, XtRImmediate, ~0),
-
- res (XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
- Pixmap, topShadowPixmap, XtRImmediate, None),
- res (XmNbottomShadowPixmap, XmCBottomShadowPixmap,
- XtRPixmap, Pixmap, bottomShadowPixmap, XtRImmediate, None),
-
- res (XmNtroughColor, XmCTroughColor, XtRPixel, Pixel, troughColor,
- XtRImmediate, ~0),
-
- res (XmNshadowThickness, XmCShadowThickness, XtRInt, int,
- shadowThickness, XtRImmediate, 2),
-
- Xt_RESOURCE (XmNborderWidth, XmCBorderWidth, XtRDimension, Dimension,
- offset(core.border_width), XtRImmediate, 0),
-
- res (XmNshowArrows, XmCShowArrows, XtRBoolean, Boolean, showArrows,
- XtRImmediate, True),
-
- 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),
-
- 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),
-
- 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),
+ { XmNforeground, XmCForeground, XtRPixel, sizeof(Pixel),
+ offset(sb.foreground), XtRImmediate, (XtPointer) XtDefaultForeground },
+
+ { 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},
+
+ { XmNtroughColor, XmCTroughColor, XtRPixel, sizeof(Pixel),
+ offset(sb.troughColor), XtRImmediate, (XtPointer)~0 },
+
+ { XmNshadowThickness, XmCShadowThickness, XtRInt,
+ sizeof(int), offset(sb.shadowThickness), XtRImmediate, (XtPointer)2 },
+
+ { XmNborderWidth, XmCBorderWidth, XtRDimension,
+ sizeof(Dimension), offset(core.border_width), XtRImmediate,
+ (XtPointer)0 },
+
+ { XmNshowArrows, XmCShowArrows, XtRBoolean,
+ sizeof(Boolean), offset(sb.showArrows), XtRImmediate, (XtPointer)True },
+
+ { XmNinitialDelay, XmCInitialDelay, XtRInt, sizeof(int),
+ offset(sb.initialDelay), XtRImmediate, (XtPointer) 250 },
+ { XmNrepeatDelay, XmCRepeatDelay, XtRInt, sizeof(int),
+ offset(sb.repeatDelay), XtRImmediate, (XtPointer) 50 },
+
+ { XmNorientation, XmCOrientation, XtROrientation,
+ sizeof(unsigned char), offset(sb.orientation), XtRImmediate,
+ (XtPointer) XmVERTICAL },
+
+ { 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},
+
+ { 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),
-
- res (XmNarrowPosition, XmCArrowPosition, XtRString, char *,
- arrowPosition, XtRImmediate, NULL),
-#undef offset
-#undef res
+ { XmNsliderStyle, XmCSliderStyle, XtRString, sizeof(char *),
+ offset(sb.sliderStyle), XtRImmediate, NULL},
+ { XmNknobStyle, XmCKnobStyle, XtRString, sizeof(char *),
+ offset(sb.knobStyle), XtRImmediate, NULL},
+
+ { XmNarrowPosition, XmCArrowPosition, XtRString, sizeof(char *),
+ offset(sb.arrowPosition), XtRImmediate, NULL},
};
/*-------------------------- Prototypes ---------------------------------*/
@@ -208,13 +218,13 @@ static void Realize(Widget widget, XtVal
/*-------------------------- 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 @@ XlwScrollBarClassRec xlwScrollBarClassRe
/* core_class fields */
{
/* superclass */ (WidgetClass) &coreClassRec,
- /* class_name */ (String) "XlwScrollBar",
+ /* class_name */ "XlwScrollBar",
/* widget_size */ sizeof(XlwScrollBarRec),
/* class_initialize */ NULL,
/* class_part_init */ NULL,
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 lwlib/xlwtabs.c
--- 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 char accelTable[] = " #augment\n\
" ;
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"),
-#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),
+ {XtNxftFont, XtCXftFont, XtRString, sizeof(String),
+ offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" },
+#endif
+ {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 void TabsAllocGreyGC( TabsWidget
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 @@ TabsClassRec tabsClassRec = {
{
/* 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? */
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/EmacsFrame.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#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 @@ emacs_Xt_mapping_action (Widget w, XEven
#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),
-
- 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),
+ { XtNgeometry, XtCGeometry,
+ XtRString, sizeof (String),
+ offset (geometry), XtRString, (XtPointer) 0 },
+ { XtNiconic, XtCIconic,
+ XtRBoolean, sizeof (Boolean),
+ offset (iconic), XtRImmediate, (XtPointer) False },
+
+ { 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 XtResource resources[] = {
static XtActionsRec
emacsFrameActionsTable [] = {
- { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action},
+ {"mapping", (XtActionProc) emacs_Xt_mapping_action},
};
static char
@@ -167,7 +200,7 @@ EmacsFrameClassRec emacsFrameClassRec =
#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 @@ EmacsFrameSetCharSize (Widget widget, in
{
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));
}
}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/EmacsManager.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#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 @@ Boston, MA 02111-1307, USA. */
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 @@ EmacsManagerClassRec emacsManagerClassRe
#else
/* superclass */ (WidgetClass) &compositeClassRec,
#endif
- /* class_name */ (String) "EmacsManager",
+ /* class_name */ "EmacsManager",
/* widget_size */ sizeof (EmacsManagerRec),
/* class_initialize */ ClassInitialize,
/* class_part_init */ NULL,
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/EmacsShell-sub.c
--- 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 @@ Boston, MA 02111-1307, USA. */
#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[] = {
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),
-#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
+ { XtNx, XtCPosition,
+ XtRPosition, sizeof (Position),
+ coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE },
+ { XtNy, XtCPosition,
+ XtRPosition, sizeof (Position),
+ coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE },
+#endif
+ { 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 @@ update_size_hints_internal (EMACS_SHELL_
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);
}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/console-x.h
--- 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
@@ -65,6 +65,18 @@ Boston, MA 02111-1307, USA. */
#if (XlibSpecificationRelease < 5)
# 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
@@ -200,7 +212,7 @@ void describe_XIMStyles (XIMStyles *sty
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 */
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/device-x.c
--- 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_emacs_application_class;
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"),
-
- 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),
-
- Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"),
- Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL),
+ {"-geometry", ".geometry", XrmoptionSepArg, NULL},
+ {"-iconic", ".iconic", XrmoptionNoArg, "yes"},
+
+ {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
+ {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
+ {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL},
+ {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", 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),
-
- 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),
+ {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
+ {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
+ {"-title", "*TopLevelEmacsShell.title", 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 @@ compute_x_app_name (int argc, Extbyte **
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
static int
have_xemacs_resources_in_xrdb (Display *dpy)
{
- const char *xdefs, *key;
+ char *xdefs, *key;
int len;
#ifdef INFODOCK
@@ -692,9 +688,9 @@ x_init_device (struct device *d, Lisp_Ob
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 @@ x_init_device (struct device *d, Lisp_Ob
}
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 @@ x_init_device (struct device *d, Lisp_Ob
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 @@ x_init_device (struct device *d, Lisp_Ob
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);
}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/emacs.c
--- 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 @@ Return the directory name in which the E
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 @@ argmatch (Wexttext **argv, int argc, con
}
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",
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/emodules.c
--- 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 @@ the variable `load-modules-quietly' is n
*/
(file, name, version))
{
- const CIbyte *mod, *mname, *mver;
+ CIbyte *mod, *mname, *mver;
int speccount = specpdl_depth();
CHECK_STRING(file);
@@ -136,7 +136,7 @@ soon as the last reference to symbols wi
(file, name, version))
{
int x;
- const CIbyte *mod, *mname, *mver;
+ CIbyte *mod, *mname, *mver;
Lisp_Object foundname = Qnil;
struct gcpro gcpro1;
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/event-Xt.c
--- 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_
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 @@ emacs_Xt_event_widget_focus_out (Widget
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
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/event-stream.c
--- 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;
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);
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/file-coding.c
--- 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 @@ eol_type_to_symbol (enum eol_type type)
struct subsidiary_type
{
- const Ascbyte *extension;
- const Ascbyte *mnemonic_ext;
+ Ascbyte *extension;
+ Ascbyte *mnemonic_ext;
enum eol_type eol;
};
@@ -944,8 +944,8 @@ setup_eol_coding_systems (Lisp_Object co
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 @@ setup_eol_coding_systems (Lisp_Object co
*/
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 @@ make_coding_system_1 (Lisp_Object name_o
}
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)
{
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/file-coding.h
--- 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);
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);
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/frame-x.c
--- 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 @@ x_wm_set_cell_size (Widget wmshell, int
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 @@ x_wm_set_variable_size (Widget wmshell,
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 @@ x_set_frame_text_value (struct frame *f,
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 @@ x_initialize_frame_size (struct frame *f
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 @@ x_initialize_frame_size (struct frame *f
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 @@ x_initialize_frame_size (struct frame *f
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 @@ x_create_widgets (struct frame *f, Lisp_
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 @@ x_create_widgets (struct frame *f, Lisp_
/* 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 @@ x_create_widgets (struct frame *f, Lisp_
/* 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 @@ x_set_frame_icon (struct frame *f)
/* 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 @@ x_set_frame_position (struct frame *f, i
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 @@ x_set_frame_position (struct frame *f, i
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 @@ x_update_frame_external_traits (struct f
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 @@ x_update_frame_external_traits (struct f
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 @@ x_update_frame_external_traits (struct f
#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++;
}
}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/gif_io.c
--- 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 @@ int GifClose(GifFileType *GifFile)
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 *GetGifError(int errore)
{
- const char *Err;
+ char *Err;
switch(errore) {
case D_GIF_ERR_OPEN_FAILED:
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/glyphs-x.c
--- 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 @@ x_redisplay_widget (Lisp_Image_Instance
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 @@ update_tab_widget_face (widget_value* wv
(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 @@ x_widget_instantiate (Lisp_Object image_
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 @@ x_button_instantiate (Lisp_Object image_
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 @@ x_progress_gauge_redisplay (Lisp_Object
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 @@ x_tab_control_redisplay (Lisp_Object ima
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 @@ x_tab_control_redisplay (Lisp_Object ima
{
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;
}
}
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/input-method-xlib.c
--- 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 @@ XIM_init_frame (struct frame *f)
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 @@ describe_XIC (XIC xic)
}
void
-describe_XRectangle (const char *name, XRectangle *r)
+describe_XRectangle (char *name, XRectangle *r)
{
if (r == NULL)
stderr_out ("%s: NULL\n", name);
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/menubar-x.c
--- 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 @@ make_dummy_xbutton_event (XEvent *dummy,
{
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;
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/mule-coding.c
--- 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 @@ ccl_putprop (Lisp_Object codesys, Lisp_O
{
Lisp_Object sym;
struct ccl_program test_ccl;
- const Ascbyte *suffix;
+ Ascbyte *suffix;
/* Check key first. */
if (EQ (key, Qdecode))
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/print.c
--- 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 @@ enum printing_badness
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];
diff -r 383ab474a24153898db7bc967d04d3411625f067 -r fc7067b7f407dff47e9931de44c2eda21c9a0402 src/redisplay.c
--- 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 @@ tail_recurse:
{
invalid:
{
- const char *str = GETTEXT ("*invalid*");
+ char *str = GETTEXT ("*invalid*");
Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */
if (size <= *offset)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Fix docstring typo.
16 years, 1 month
Stephen Turnbull
changeset: 4521:383ab474a24153898db7bc967d04d3411625f067
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Tue Oct 28 10:38:26 2008 +0900
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
description:
Fix docstring typo.
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Oct 27 09:51:51 2008 +0900
+++ b/lisp/ChangeLog Tue Oct 28 10:38:26 2008 +0900
@@ -1,3 +1,7 @@ 2008-09-30 Stephen J. Turnbull <stephe
+2008-10-28 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * version.el (xemacs-betaname): Fix docstring typo. (Thanks, Ville!)
+
2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
* version.el (xemacs-betaname):
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lisp/version.el
--- a/lisp/version.el Mon Oct 27 09:51:51 2008 +0900
+++ b/lisp/version.el Tue Oct 28 10:38:26 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.
-It value is derived from `emacs-beta-version'. It is mutually exclusive
+Its value is derived from `emacs-beta-version'. It is mutually exclusive
with `emacs-patch-level'.")
(defconst emacs-version
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/ChangeLog
--- a/lwlib/ChangeLog Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/ChangeLog Tue Oct 28 10:38:26 2008 +0900
@@ -1,3 +1,7 @@ 2007-09-15 Jerry James <james(a)xemacs.o
+2008-10-26 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * lwlib-Xm.c (xm_update_progress): Set all values!
+
2007-09-15 Jerry James <james(a)xemacs.org>
* xlwmenu.c (XlwMenuDestroy): Release XftFont resources
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/lwlib-Xaw.c
--- a/lwlib/lwlib-Xaw.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/lwlib-Xaw.c Tue Oct 28 10:38:26 2008 +0900
@@ -88,15 +88,15 @@ xaw_update_scrollbar (widget_instance *i
Arg al [10];
/* First size and position the scrollbar widget. */
- 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);
+ 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);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb);
- XtSetArg (al [1], XtNshown, &widget_shown);
+ Xt_SET_ARG (al [0], XtNtopOfThumb, &widget_topOfThumb);
+ Xt_SET_ARG (al [1], XtNshown, &widget_shown);
XtGetValues (widget, al, 2);
new_shown = (double) data->slider_size /
@@ -142,47 +142,37 @@ xaw_update_one_widget (widget_instance *
#endif
#ifdef LWLIB_DIALOGS_ATHENA
else if (XtIsSubclass (widget, dialogWidgetClass))
- {
- Arg al [1];
- XtSetArg (al [0], XtNlabel, val->contents->value);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNlabel, val->contents->value);
#endif /* LWLIB_DIALOGS_ATHENA */
#ifdef LWLIB_WIDGETS_ATHENA
else if (XtClass (widget) == labelWidgetClass)
- {
- Arg al [1];
- XtSetArg (al [0], XtNlabel, val->value);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNlabel, val->value);
#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
- 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);
+ {
+ 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);
}
#endif /* ! LWLIB_DIALOGS_ATHENA3D */
lw_remove_accelerator_spec (val->value);
- XtSetArg (al [0], XtNlabel, val->value);
- XtSetArg (al [1], XtNsensitive, val->enabled);
+ Xt_SET_ARG (al [0], XtNlabel, val->value);
+ Xt_SET_ARG (al [1], XtNsensitive, val->enabled);
/* Force centered button text. See above. */
- XtSetArg (al [2], XtNjustify, XtJustifyCenter);
+ Xt_SET_ARG (al [2], XtNjustify, XtJustifyCenter);
XtSetValues (widget, al, 3);
XtRemoveAllCallbacks (widget, XtNcallback);
@@ -190,10 +180,7 @@ xaw_update_one_widget (widget_instance *
#ifdef LWLIB_WIDGETS_ATHENA
/* set the selected state */
if (XtIsSubclass (widget, toggleWidgetClass))
- {
- XtSetArg (al [0], XtNstate, val->selected);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNstate, val->selected);
#endif /* LWLIB_WIDGETS_ATHENA */
}
#endif /* LWLIB_DIALOGS_ATHENA */
@@ -219,19 +206,15 @@ xaw_update_one_value (widget_instance *i
if (XtIsSubclass (widget, toggleWidgetClass))
{
- Arg al [1];
- XtSetArg (al [0], XtNstate, &val->selected);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XtNstate, &val->selected);
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);
@@ -339,7 +322,7 @@ static XtActionProc wm_delete_window (Wi
static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
XtPointer call_data);
static XtActionsRec xaw_actions [] = {
- {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
+ { (String) "lwlib_delete_dialog", (XtActionProc) wm_delete_window}
};
static Boolean actions_initted = False;
@@ -375,9 +358,9 @@ make_dialog (const char* name, Widget pa
override = XtParseTranslationTable (overrideTrans);
ac = 0;
- XtSetArg (av[ac], XtNtitle, shell_title); ac++;
- XtSetArg (av[ac], XtNallowShellResize, True); ac++;
- XtSetArg (av[ac], XtNtransientFor, parent); ac++;
+ 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++;
shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
parent, av, ac);
XtOverrideTranslations (shell, override);
@@ -390,12 +373,12 @@ make_dialog (const char* name, Widget pa
for (i = 0; i < left_buttons; i++)
{
ac = 0;
- 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++;
+ 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++;
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
@@ -410,18 +393,18 @@ make_dialog (const char* name, Widget pa
window) but I can't seem to make it do it.
*/
ac = 0;
- 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++;
+ 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++;
button = XtCreateManagedWidget ("separator",
/* labelWidgetClass, */
/* This has to be Command to fake out
@@ -432,12 +415,12 @@ make_dialog (const char* name, Widget pa
for (i = 0; i < right_buttons; i++)
{
ac = 0;
- 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++;
+ 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++;
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
@@ -525,13 +508,10 @@ xaw_generic_callback (Widget widget, XtP
if (XtIsSubclass (widget, toggleWidgetClass))
{
Boolean check;
- Arg al [1];
-
- XtSetArg (al [0], XtNstate, &check);
- XtGetValues (widget, al, 1);
-
- XtSetArg (al [0], XtNstate, !check);
- XtSetValues (widget, al, 1);
+
+ Xt_GET_VALUE (widget, XtNstate, &check);
+
+ Xt_SET_VALUE (widget, XtNstate, !check);
}
#endif /* LWLIB_WIDGETS_ATHENA */
lw_internal_update_other_instances (widget, closure, call_data);
@@ -549,11 +529,7 @@ xaw_generic_callback (Widget widget, XtP
#if 0
user_data = NULL;
- {
- Arg al [1];
- XtSetArg (al [0], XtNuserData, &user_data);
- XtGetValues (widget, al, 1);
- }
+ Xt_GET_VALUE (widget, XtNuserData, &user_data);
#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
@@ -594,11 +570,10 @@ wm_delete_window (Widget shell, XtPointe
LWLIB_ID id;
Widget *kids = 0;
Widget widget;
- Arg al [1];
+
if (! XtIsSubclass (shell, shellWidgetClass))
abort ();
- XtSetArg (al [0], XtNchildren, &kids);
- XtGetValues (shell, al, 1);
+ Xt_GET_VALUE (shell, XtNchildren, &kids);
if (!kids || !*kids) abort ();
for (widget = *kids;
@@ -697,11 +672,11 @@ xaw_create_scrollbar (widget_instance *i
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. */
- 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++;
+ 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++;
return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
instance->parent, av, ac);
@@ -730,13 +705,13 @@ xaw_create_button (widget_instance *inst
Widget button = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
+ 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++;
/* 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. */
- XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -749,7 +724,7 @@ xaw_create_button (widget_instance *inst
{
if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XtNstate, val->selected); ac++;
+ Xt_SET_ARG (al [ac], XtNstate, val->selected); ac++;
button = XtCreateWidget
(val->name,
val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
@@ -783,9 +758,9 @@ xaw_create_label (Widget parent, widget_
int ac = 0;
Widget label = 0;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
+ 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++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -868,20 +843,20 @@ xaw_create_progress (widget_instance *in
#if 0 /* This looks too awful, although more correct. */
if (!val->call_data)
{
- XtSetArg (al [ac], XtNsensitive, False); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, False); ac++;
}
else
{
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
}
#else
- XtSetArg (al [ac], XtNsensitive, True); ac++;
-#endif
-
- 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++;
+ Xt_SET_ARG (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++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -915,18 +890,18 @@ xaw_create_text_field (widget_instance *
Widget text = 0;
widget_value* val = instance->info->val;
- 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++;
+ 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++;
#if 0
- XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
+ Xt_SET_ARG (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
#endif
if (val->value)
{
- XtSetArg (al [ac], XtNstring, val->value); ac++;
+ Xt_SET_ARG (al [ac], XtNstring, val->value); ac++;
}
/* add any args the user supplied for creation time */
@@ -956,8 +931,8 @@ xaw_creation_table [] =
#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}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/lwlib-Xlw.c
--- a/lwlib/lwlib-Xlw.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/lwlib-Xlw.c Tue Oct 28 10:38:26 2008 +0900
@@ -122,7 +122,7 @@ xlw_create_menubar (widget_instance* ins
Arg al [1];
Widget widget;
- XtSetArg (al [0], XtNmenu, instance->info->val);
+ Xt_SET_ARG (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 @@ xlw_create_popup_menu (widget_instance*
popup_shell = XtCreatePopupShell (instance->info->name,
overrideShellWidgetClass,
instance->parent, NULL, 0);
- XtSetArg (al [0], XtNmenu, instance->info->val);
- XtSetArg (al [1], XtNhorizontal, False);
+ Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
+ Xt_SET_ARG (al [1], XtNhorizontal, False);
widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
popup_shell, al, 2);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
@@ -234,20 +234,20 @@ xlw_create_scrollbar (widget_instance *i
callbacks[0].closure = (XtPointer) instance;
- 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++;
-
- 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++;
+ 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++;
+
+ 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++;
return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass,
instance->parent, al, ac);
@@ -278,15 +278,15 @@ xlw_update_scrollbar (widget_instance *U
Arg al [4];
/* First size and position the scrollbar widget. */
- 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);
+ 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);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
- XtSetArg (al [1], XmNvalue, &widget_val);
+ Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+ Xt_SET_ARG (al [1], XmNvalue, &widget_val);
XtGetValues (widget, al, 2);
percent = (double) data->slider_size /
@@ -382,9 +382,9 @@ xlw_create_tab_control (widget_instance
Widget tab = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++;
- XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
+ 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++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -406,7 +406,7 @@ static void build_tabs_in_widget (widget
Arg al[1];
/* Children are always invisible, don't permit resizing. */
- XtSetArg (al[0], XtNresizable, False);
+ Xt_SET_ARG (al[0], XtNresizable, False);
for (cur = val; cur; cur = cur->next)
{
@@ -479,8 +479,8 @@ xlw_create_clip_window (widget_instance
Widget clip = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++;
- XtSetArg (al [ac], XtNsensitive, True); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, True); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -557,13 +557,11 @@ xlw_update_one_widget (widget_instance*
else if (class_ == xlwMenuWidgetClass)
{
XlwMenuWidget mw;
- Arg al [1];
if (XtIsShell (widget))
mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
else
mw = (XlwMenuWidget)widget;
- XtSetArg (al [0], XtNmenu, val);
- XtSetValues (widget, al, 1); /* #### mw unused! */
+ Xt_SET_VALUE (widget, XtNmenu, val); /* #### mw unused! */
}
#endif
#ifdef LWLIB_SCROLLBARS_LUCID
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/lwlib-Xm.c
--- a/lwlib/lwlib-Xm.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/lwlib-Xm.c Tue Oct 28 10:38:26 2008 +0900
@@ -216,8 +216,7 @@ xm_update_label (widget_instance* UNUSED
int type;
/* Don't clobber pixmap types. */
- XtSetArg (al [0], XmNlabelType, &type);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNlabelType, &type);
if (type == XmPIXMAP)
return;
@@ -280,14 +279,14 @@ xm_update_label (widget_instance* UNUSED
}
}
- XtSetArg (al [ac], XmNlabelString, built_string); ac++;
- XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelString, built_string); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelType, XmSTRING); ac++;
}
if (val->key)
{
key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
- XtSetArg (al [ac], XmNacceleratorText, key_string); ac++;
+ Xt_SET_ARG (al [ac], XmNacceleratorText, key_string); ac++;
}
if (ac)
@@ -342,9 +341,7 @@ xm_update_pushbutton (widget_instance* i
xm_update_pushbutton (widget_instance* instance, Widget widget,
widget_value* UNUSED (val))
{
- Arg al [1];
- XtSetArg (al [0], XmNalignment, XmALIGNMENT_CENTER);
- XtSetValues (widget, al, 1);
+ Xt_SET_VALUE (widget, XmNalignment, XmALIGNMENT_CENTER);
XtRemoveAllCallbacks (widget, XmNactivateCallback);
XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
}
@@ -360,21 +357,21 @@ xm_update_progress (widget_instance* UNU
Dimension width = 0;
if (!val->call_data)
{
- XtSetArg (al [ac], XmNeditable, False); ac++;
+ Xt_SET_ARG (al [ac], XmNeditable, False); ac++;
}
else
{
- XtSetArg (al [ac], XmNeditable, val->enabled); ac++;
- }
- height = (Dimension)lw_get_value_arg (val, XtNheight);
- width = (Dimension)lw_get_value_arg (val, XtNwidth);
+ Xt_SET_ARG (al [ac], XmNeditable, val->enabled); ac++;
+ }
+ height = (Dimension) lw_get_value_arg (val, XtNheight);
+ width = (Dimension) lw_get_value_arg (val, XtNwidth);
if (height > 0)
{
- XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++;
}
if (width > 0)
{
- XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++;
}
XtSetValues (scale, al, ac);
@@ -419,8 +416,8 @@ xm_update_toggle (widget_instance* insta
XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
XtAddCallback (widget, XmNvalueChangedCallback, xm_generic_callback,
instance);
- XtSetArg (al [0], XmNset, val->selected);
- XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
+ Xt_SET_ARG (al [0], XmNset, val->selected);
+ Xt_SET_ARG (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
XtSetValues (widget, al, 1);
}
@@ -447,8 +444,8 @@ xm_update_radiobox (widget_instance* ins
if (toggle)
{
Arg al [2];
- XtSetArg (al [0], XmNsensitive, cur->enabled);
- XtSetArg (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
+ Xt_SET_ARG (al [0], XmNsensitive, cur->enabled);
+ Xt_SET_ARG (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
XtSetValues (toggle, al, 2);
}
}
@@ -458,11 +455,7 @@ xm_update_radiobox (widget_instance* ins
{
toggle = XtNameToWidget (widget, val->value);
if (toggle)
- {
- Arg al [1];
- XtSetArg (al [0], XmNset, True);
- XtSetValues (toggle, al, 1);
- }
+ Xt_SET_VALUE (toggle, XmNset, True);
}
}
@@ -511,8 +504,7 @@ make_menu_in_widget (widget_instance* in
children = (Widget*)XtMalloc (num_children * sizeof (Widget));
/* tricky way to know if this RowColumn is a menubar or a pulldown... */
- XtSetArg (al [0], XmNisHomogeneous, &menubar_p);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNisHomogeneous, &menubar_p);
/* add the unmap callback for popups and pulldowns */
/*** this sounds bogus ***/
@@ -528,9 +520,9 @@ make_menu_in_widget (widget_instance* in
{
ac = 0;
button = 0;
- XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, cur->call_data); ac++;
+ 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++;
switch (cur->type)
{
@@ -545,14 +537,14 @@ make_menu_in_widget (widget_instance* in
/* #### - 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 */
- XtSetArg (al [ac], XmNseparatorType, cur->value), ac++;
+ Xt_SET_ARG (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);
- XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
+ Xt_SET_ARG (al [ac], XmNsubMenuId, menu); ac++;
button = XmCreateCascadeButton (widget, cur->name, al, ac);
xm_safe_update_label (instance, button, cur);
@@ -567,10 +559,10 @@ make_menu_in_widget (widget_instance* in
button = XmCreateLabel (widget, cur->name, al, ac);
else if (cur->type == TOGGLE_TYPE || cur->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XmNindicatorType,
+ Xt_SET_ARG (al [ac], XmNindicatorType,
(cur->type == TOGGLE_TYPE ?
- XmN_OF_MANY : XmONE_OF_MANY)); ac++;
- XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+ XmN_OF_MANY : XmONE_OF_MANY)); ac++;
+ Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++;
button = XmCreateToggleButtonGadget (widget, cur->name, al, ac);
}
else
@@ -597,11 +589,7 @@ make_menu_in_widget (widget_instance* in
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)
- {
- ac = 0;
- XtSetArg (al [ac], XmNmenuHelpWidget, button); ac++;
- XtSetValues (widget, al, ac);
- }
+ Xt_SET_VALUE (widget, XmNmenuHelpWidget, button);
if (num_children)
XtManageChildren (children, num_children);
@@ -623,8 +611,8 @@ update_one_menu_entry (widget_instance*
/* update the sensitivity and userdata */
/* Common to all widget types */
- XtSetArg (al [0], XmNsensitive, val->enabled);
- XtSetArg (al [1], XmNuserData, val->call_data);
+ Xt_SET_ARG (al [0], XmNsensitive, val->enabled);
+ Xt_SET_ARG (al [1], XmNuserData, val->call_data);
XtSetValues (widget, al, 2);
/* update the menu button as a label. */
@@ -642,8 +630,7 @@ update_one_menu_entry (widget_instance*
/* update the pulldown/pullaside as needed */
menu = NULL;
- XtSetArg (al [0], XmNsubMenuId, &menu);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNsubMenuId, &menu);
contents = val->contents;
@@ -653,16 +640,12 @@ update_one_menu_entry (widget_instance*
{
menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
make_menu_in_widget (instance, menu, contents);
- ac = 0;
- XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
- XtSetValues (widget, al, ac);
+ Xt_SET_VALUE (widget, XmNsubMenuId, menu);
}
}
else if (!contents)
{
- ac = 0;
- XtSetArg (al [ac], XmNsubMenuId, NULL); ac++;
- XtSetValues (widget, al, ac);
+ Xt_SET_VALUE (widget, XmNsubMenuId, NULL);
XtDestroyWidget (menu);
}
else if (deep_p && contents->change != NO_CHANGE)
@@ -772,15 +755,15 @@ xm_update_scrollbar (widget_instance *in
Arg al [4];
/* First size and position the scrollbar widget. */
- 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);
+ 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);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
- XtSetArg (al [1], XmNvalue, &widget_val);
+ Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+ Xt_SET_ARG (al [1], XmNvalue, &widget_val);
XtGetValues (widget, al, 2);
percent = (double) data->slider_size /
@@ -845,8 +828,8 @@ xm_update_one_widget (widget_instance* i
val->edited = False;
/* Common to all widget types */
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
XtSetValues (widget, al, ac);
#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)
@@ -875,8 +858,7 @@ xm_update_one_widget (widget_instance* i
{
Boolean radiobox = 0;
- XtSetArg (al [0], XmNradioBehavior, &radiobox);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
if (radiobox)
xm_update_radiobox (instance, widget, val);
@@ -938,9 +920,7 @@ xm_update_one_value (widget_instance* in
if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass)
{
- Arg al [1];
- XtSetArg (al [0], XmNset, &val->selected);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNset, &val->selected);
val->edited = True;
}
else if (class_ == xmTextWidgetClass)
@@ -960,11 +940,8 @@ xm_update_one_value (widget_instance* in
else if (class_ == xmRowColumnWidgetClass)
{
Boolean radiobox = 0;
- {
- Arg al [1];
- XtSetArg (al [0], XmNradioBehavior, &radiobox);
- XtGetValues (widget, al, 1);
- }
+
+ Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
if (radiobox)
{
@@ -974,10 +951,8 @@ xm_update_one_value (widget_instance* in
{
int set = False;
Widget toggle = radio->composite.children [i];
- Arg al [1];
-
- XtSetArg (al [0], XmNset, &set);
- XtGetValues (toggle, al, 1);
+
+ Xt_GET_VALUE (toggle, XmNset, &set);
if (set)
{
if (val->value)
@@ -1130,42 +1105,42 @@ make_dialog (char* UNUSED (name), Widget
if (pop_up_p)
{
ac = 0;
- XtSetArg(al[ac], XmNtitle, shell_title); ac++;
- XtSetArg(al[ac], XtNallowShellResize, True); ac++;
- XtSetArg(al[ac], XmNdeleteResponse, XmUNMAP); ac++;
+ 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++;
result = XmCreateDialogShell (parent, "dialog", al, ac);
- XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
-/* XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); 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++;
form = XmCreateForm (result, (char *) shell_title, al, ac);
}
else
{
ac = 0;
- XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE); ac++;
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
form = XmCreateForm (parent, (char *) shell_title, al, ac);
result = form;
}
ac = 0;
- 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++;
+ 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++;
row = XmCreateRowColumn (form, "row", al, ac);
n_children = 0;
@@ -1176,10 +1151,10 @@ make_dialog (char* UNUSED (name), Widget
ac = 0;
if (i == 0)
{
- XtSetArg(al[ac], XmNhighlightThickness, 1); ac++;
- XtSetArg(al[ac], XmNshowAsDefault, TRUE); ac++;
+ Xt_SET_ARG(al[ac], XmNhighlightThickness, 1); ac++;
+ Xt_SET_ARG(al[ac], XmNshowAsDefault, TRUE); ac++;
}
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
children [n_children] = XmCreatePushButton (row, button_name, al, ac);
DO_DND_KLUDGE (children [n_children]);
@@ -1187,7 +1162,7 @@ make_dialog (char* UNUSED (name), Widget
{
button = children [n_children];
ac = 0;
- XtSetArg(al[ac], XmNdefaultButton, button); ac++;
+ Xt_SET_ARG(al[ac], XmNdefaultButton, button); ac++;
XtSetValues (row, al, ac);
#ifdef ARMANDACTIVATE_KLUDGE /* See comment above */
@@ -1204,9 +1179,8 @@ make_dialog (char* UNUSED (name), Widget
/* invisible separator button */
ac = 0;
- XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++;
- children [n_children] = XmCreateLabel (row, "separator_button",
- al, ac);
+ Xt_SET_ARG (al[ac], XmNmappedWhenManaged, FALSE); ac++;
+ children [n_children] = XmCreateLabel (row, "separator_button", al, ac);
DO_DND_KLUDGE (children [n_children]);
n_children++;
@@ -1215,7 +1189,7 @@ make_dialog (char* UNUSED (name), Widget
char button_name [16];
sprintf (button_name, "button%d", left_buttons + i + 1);
ac = 0;
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(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];
@@ -1225,53 +1199,53 @@ make_dialog (char* UNUSED (name), Widget
XtManageChildren (children, n_children);
ac = 0;
- 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++;
+ 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++;
separator = XmCreateSeparator (form, "", al, ac);
ac = 0;
- 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++;
+ 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++;
icon = XmCreateLabel (form, (char *) icon_name, al, ac);
DO_DND_KLUDGE (icon);
ac = 0;
- 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++;
+ 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++;
icon_separator = XmCreateLabel (form, "", al, ac);
DO_DND_KLUDGE (icon_separator);
if (text_input_slot)
{
ac = 0;
- 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++;
+ 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++;
value = XmCreateTextField (form, "value", al, ac);
DO_DND_KLUDGE (value);
}
@@ -1279,19 +1253,19 @@ make_dialog (char* UNUSED (name), Widget
{
Widget radio_butt;
ac = 0;
- 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++;
+ 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++;
value = XmCreateRadioBox (form, "radiobutton1", al, ac);
ac = 0;
i = 0;
@@ -1306,16 +1280,16 @@ make_dialog (char* UNUSED (name), Widget
else if (list)
{
ac = 0;
- 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++;
+ 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++;
value = XmCreateScrolledList (form, "list", al, ac);
/* this is the easiest way I found to have the double click in the
@@ -1325,18 +1299,18 @@ make_dialog (char* UNUSED (name), Widget
/* else add nothing; it's a separator */
ac = 0;
- 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++;
+ 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++;
message = XmCreateLabel (form, "message", al, ac);
DO_DND_KLUDGE (message);
@@ -1427,12 +1401,12 @@ recenter_widget (Widget widget)
Position y;
Arg al [2];
- XtSetArg (al [0], XtNwidth, &child_width);
- XtSetArg (al [1], XtNheight, &child_height);
+ Xt_SET_ARG (al [0], XtNwidth, &child_width);
+ Xt_SET_ARG (al [1], XtNheight, &child_height);
XtGetValues (widget, al, 2);
- XtSetArg (al [0], XtNwidth, &parent_width);
- XtSetArg (al [1], XtNheight, &parent_height);
+ Xt_SET_ARG (al [0], XtNwidth, &parent_width);
+ Xt_SET_ARG (al [1], XtNheight, &parent_height);
XtGetValues (parent, al, 2);
x = (Position) ((parent_width - child_width) / 2);
@@ -1450,8 +1424,8 @@ recenter_widget (Widget widget)
if (y < 0)
y = 0;
- XtSetArg (al [0], XtNx, x);
- XtSetArg (al [1], XtNy, y);
+ Xt_SET_ARG (al [0], XtNx, x);
+ Xt_SET_ARG (al [1], XtNy, y);
XtSetValues (widget, al, 2);
}
@@ -1484,8 +1458,8 @@ recycle_instance (destroyed_instance* in
if (separator)
{
Arg al [2];
- XtSetArg (al [0], XtNwidth, 5);
- XtSetArg (al [1], XtNheight, 5);
+ Xt_SET_ARG (al [0], XtNwidth, 5);
+ Xt_SET_ARG (al [1], XtNheight, 5);
XtSetValues (separator, al, 2);
}
@@ -1581,8 +1555,8 @@ make_menubar (widget_instance* instance)
Arg al[10];
int ac = 0;
- XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
- XtSetArg(al[ac], XmNshadowThickness, 3); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNshadowThickness, 3); ac++;
return XmCreateMenuBar (instance->parent, instance->info->name, al, ac);
}
@@ -1622,21 +1596,22 @@ make_scrollbar (widget_instance *instanc
callbacks[0].closure = (XtPointer) instance;
- 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++;
-
- 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++;
+ 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++;
+
+ 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++;
return XmCreateScrollBar (instance->parent, instance->info->name, al, ac);
}
@@ -1665,14 +1640,14 @@ xm_create_button (widget_instance *insta
Widget button = 0;
widget_value* val = instance->info->val;
- 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++;
+ 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++;
/* 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. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1682,11 +1657,11 @@ xm_create_button (widget_instance *insta
else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XmNset, val->selected); ac++;
- XtSetArg (al [ac], XmNindicatorType,
+ Xt_SET_ARG (al [ac], XmNset, val->selected); ac++;
+ Xt_SET_ARG (al [ac], XmNindicatorType,
(val->type == TOGGLE_TYPE ?
- XmN_OF_MANY : XmONE_OF_MANY)); ac++;
- XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+ XmN_OF_MANY : XmONE_OF_MANY)); ac++;
+ Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++;
button = XmCreateToggleButton (instance->parent, val->name, al, ac);
XtRemoveAllCallbacks (button, XmNvalueChangedCallback);
XtAddCallback (button, XmNvalueChangedCallback, xm_generic_callback,
@@ -1715,30 +1690,30 @@ xm_create_progress (widget_instance *ins
widget_value* val = instance->info->val;
if (!val->call_data)
{
- XtSetArg (al [ac], XmNeditable, False); ac++;
+ Xt_SET_ARG (al [ac], XmNeditable, False); ac++;
}
else
{
- XtSetArg (al [ac], XmNeditable, val->enabled); 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++;
+ Xt_SET_ARG (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++;
/* 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. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (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)
{
- XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++;
}
if (width > 0)
{
- XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++;
}
/* add any args the user supplied for creation time */
@@ -1762,14 +1737,14 @@ xm_create_text_field (widget_instance *i
Widget text = 0;
widget_value* val = instance->info->val;
- 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++;
+ 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++;
/* 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. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1797,13 +1772,13 @@ xm_create_label (Widget parent, widget_v
int ac = 0;
Widget label = 0;
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ 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++;
/* 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. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1829,14 +1804,14 @@ xm_create_combo_box (widget_instance *in
Widget combo = 0;
widget_value* val = instance->info->val;
- 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++;
+ 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++;
/* 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. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1944,7 +1919,7 @@ xm_popup_menu (Widget widget, XEvent *ev
if (trans)
{
Arg al [1];
- XtSetArg (al [0], XmNmenuPost, trans);
+ Xt_SET_ARG (al [0], XmNmenuPost, trans);
XtSetValues (widget, al, 1);
}
XmMenuPosition (widget, (XButtonPressedEvent *) event);
@@ -1963,12 +1938,12 @@ set_min_dialog_size (Widget w)
short height;
Arg al [2];
- XtSetArg (al [0], XmNwidth, &width);
- XtSetArg (al [1], XmNheight, &height);
+ Xt_SET_ARG (al [0], XmNwidth, &width);
+ Xt_SET_ARG (al [1], XmNheight, &height);
XtGetValues (w, al, 2);
- XtSetArg (al [0], XmNminWidth, width);
- XtSetArg (al [1], XmNminHeight, height);
+ Xt_SET_ARG (al [0], XmNminWidth, width);
+ Xt_SET_ARG (al [1], XmNminHeight, height);
XtSetValues (w, al, 2);
}
@@ -2014,7 +1989,6 @@ do_call (Widget widget, XtPointer closur
widget_instance* instance = (widget_instance*)closure;
Widget instance_widget;
LWLIB_ID id;
- Arg al [1];
if (!instance)
return;
@@ -2027,8 +2001,7 @@ do_call (Widget widget, XtPointer closur
id = instance->info->id;
user_data = NULL;
- XtSetArg(al [0], XmNuserData, &user_data);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNuserData, &user_data);
switch (type)
{
case pre_activate:
@@ -2080,13 +2053,9 @@ xm_generic_callback (Widget widget, XtPo
|| XtClass (widget) == xmToggleButtonGadgetClass)
{
Boolean check;
- Arg al [1];
-
- XtSetArg (al [0], XmNset, &check);
- XtGetValues (widget, al, 1);
-
- XtSetArg (al [0], XmNset, !check);
- XtSetValues (widget, al, 1);
+
+ Xt_GET_VALUE (widget, XmNset, &check);
+ Xt_SET_VALUE (widget, XmNset, !check);
}
#endif
lw_internal_update_other_instances (widget, closure, call_data);
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/lwlib.c
--- a/lwlib/lwlib.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/lwlib.c Tue Oct 28 10:38:26 2008 +0900
@@ -1385,7 +1385,7 @@ void lw_add_value_args_to_args (widget_v
}
}
-XtArgVal lw_get_value_arg (widget_value* wv, String name)
+XtArgVal lw_get_value_arg (widget_value* wv, const String name)
{
int i;
if (wv->args)
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/lwlib.h
--- a/lwlib/lwlib.h Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/lwlib.h Tue Oct 28 10:38:26 2008 +0900
@@ -2,6 +2,7 @@
#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
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwcheckbox.c
--- a/lwlib/xlwcheckbox.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwcheckbox.c Tue Oct 28 10:38:26 2008 +0900
@@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
#include "../src/xmu.h"
+#include "xt-wrappers.h"
#include "xlwcheckboxP.h"
@@ -89,10 +90,12 @@ static char defaultTranslations[] =
-#define offset(field) XtOffsetOf(CheckboxRec, field)
+#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)
static XtResource resources[] = {
- {XtNtristate, XtCTristate, XtRBoolean, sizeof(Boolean),
- offset(checkbox.tristate), XtRImmediate, (XtPointer)FALSE},
+ res (XtNtristate, XtCTristate, XtRBoolean, Boolean, tristate,
+ XtRImmediate, FALSE),
} ;
#undef offset
@@ -127,7 +130,7 @@ CheckboxClassRec checkboxClassRec = {
CheckboxClassRec checkboxClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- "Checkbox", /* class_name */
+ (String) "Checkbox", /* class_name */
sizeof(CheckboxRec), /* size */
CheckboxClassInit, /* class_initialize */
NULL, /* class_part_initialize */
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwgauge.c
--- a/lwlib/xlwgauge.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwgauge.c Tue Oct 28 10:38:26 2008 +0900
@@ -53,6 +53,7 @@ Boston, MA 02111-1307, USA. */
#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
@@ -77,33 +78,29 @@ static char defaultTranslations[] =
-#define offset(field) XtOffsetOf(GaugeRec, field)
+#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)
static XtResource resources[] = {
- {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},
+ 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),
};
#undef offset
-
+#undef res
/* member functions */
@@ -146,8 +143,8 @@ static GC Get_GC (GaugeWidget, Pixel);
static XtActionsRec actionsList[] =
{
- {"select", GaugeSelect},
- {"paste", GaugePaste},
+ { (String) "select", GaugeSelect },
+ { (String) "paste", GaugePaste },
} ;
@@ -162,7 +159,7 @@ GaugeClassRec gaugeClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) &labelClassRec,
- /* class_name */ "Gauge",
+ /* class_name */ (String) "Gauge",
/* widget_size */ sizeof(GaugeRec),
/* class_initialize */ GaugeClassInit,
/* class_part_initialize */ NULL,
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwmenu.c
--- a/lwlib/xlwmenu.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwmenu.c Tue Oct 28 10:38:26 2008 +0900
@@ -70,100 +70,112 @@ xlwMenuTranslations [] =
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. */
- {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),
+ mflres (XmNfontList, XmCFontList, font_list, XtRImmediate, 0),
+ mflres (XtNfont, XtCFont, font_list_2, XtRImmediate, 0),
+ mflres (XmNfontList, XmCFontList, 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"},
-#else
- {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
- offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
+ XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"),
+#else
+ fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
+ "XtDefaultFont"),
#ifdef USE_XFT_MENUBARS
- {XtNfcFontName, XtCFcFontName, XtRString, sizeof (String),
- offset(menu.fcFontName),
- XtRString, (XtPointer) NULL},
+ fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName,
+ "sans-serif-12:bold"),
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwtabs.c. */
- {XtNxftFont, XtCXftFont, XtRString, sizeof(XtPointer),
- offset(menu.xftFontName), XtRString, (XtPointer) "Helvetica-12:bold" },
+ fontres (XtNxftFont, XtCXftFont, XtRString, XtPointer, xftFontName,
+ "Helvetica-12:bold"),
#endif
# ifdef USE_XFONTSET
/* #### Consider using the same method as for Motif; see the comment in
XlwMenuInitialize(). */
- {XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
- offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
+ fontres (XtNfontSet, XtCFontSet, XtRFontSet, XFontSet, font_set,
+ "XtDefaultFontSet"),
# endif
#endif
- {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},
+ 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),
#if 0
- {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
- sizeof (Dimension), offset (menu.shadow_thickness),
- XtRImmediate, (XtPointer) 2},
-#else
- {XmNshadowThickness, XmCShadowThickness, XtRDimension,
- sizeof (Dimension), offset (menu.shadow_thickness),
- XtRImmediate, (XtPointer) 2},
-#endif
- {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},
+ dimres (XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
+ shadow_thickness, 2),
+#else
+ dimres (XmNshadowThickness, XmCShadowThickness, XtRDimension,
+ shadow_thickness, 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),
+
+#undef offset
+#undef mflres
+#undef fontres
+#undef dimres
+#undef boolres
+#undef cbres
+#undef pixres
+#undef fgpixres
+#undef nullpixres
+#undef pmres
};
-#undef offset
static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_,
ArgList args, Cardinal *num_args);
@@ -186,9 +198,9 @@ static XtActionsRec
static XtActionsRec
xlwMenuActionsList [] =
{
- {"start", Start},
- {"drag", Drag},
- {"select", Select},
+ { (String) "start", Start},
+ { (String) "drag", Drag},
+ { (String) "select", Select},
};
#define SuperClass ((CoreWidgetClass)&coreClassRec)
@@ -197,7 +209,7 @@ XlwMenuClassRec xlwMenuClassRec =
{
{ /* CoreClass fields initialization */
(WidgetClass) SuperClass, /* superclass */
- "XlwMenu", /* class_name */
+ (String) "XlwMenu", /* class_name */
sizeof(XlwMenuRec), /* size */
XlwMenuClassInitialize, /* class_initialize */
NULL, /* class_part_initialize */
@@ -495,7 +507,7 @@ static XtResource
static XtResource
nameResource[] =
{
- { "labelString", "LabelString", XtRString, sizeof(String),
+ { (String) "labelString", (String) "LabelString", XtRString, sizeof(String),
0, XtRImmediate, 0 }
};
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwradio.c
--- a/lwlib/xlwradio.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwradio.c Tue Oct 28 10:38:26 2008 +0900
@@ -55,6 +55,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
#include "../src/xmu.h"
+#include "xt-wrappers.h"
#include "xlwradioP.h"
#define BOX_SIZE 13
@@ -116,8 +117,8 @@ static void RadioSize (RadioWidget, Dime
static XtActionsRec actionsList[] =
{
- {"highlight", RadioHighlight},
- {"unhighlight", RadioUnhighlight},
+ { (String) "highlight", RadioHighlight },
+ { (String) "unhighlight", RadioUnhighlight },
};
#define SuperClass ((ToggleWidgetClass)&toggleClassRec)
@@ -125,7 +126,7 @@ RadioClassRec radioClassRec = {
RadioClassRec radioClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- "Radio", /* class_name */
+ (String) "Radio", /* class_name */
sizeof(RadioRec), /* size */
RadioClassInit, /* class_initialize */
RadioClassPartInit, /* class_part_initialize */
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwscrollbar.c
--- a/lwlib/xlwscrollbar.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwscrollbar.c Tue Oct 28 10:38:26 2008 +0900
@@ -79,6 +79,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/bitmaps/gray>
#include "lwlib-colors.h"
+#include "xt-wrappers.h"
#include "xlwscrollbarP.h"
#include "xlwscrollbar.h"
@@ -113,90 +114,79 @@ typedef enum
} SliderStyle;
/*-------------------------- Resources ----------------------------------*/
+
+static XtResource resources[] = {
#define offset(field) XtOffset(XlwScrollBarWidget, field)
-
-static XtResource resources[] = {
- { XmNforeground, XmCForeground, XtRPixel, sizeof(Pixel),
- offset(sb.foreground), XtRImmediate, (XtPointer) XtDefaultForeground },
-
- { 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},
-
- { XmNtroughColor, XmCTroughColor, XtRPixel, sizeof(Pixel),
- offset(sb.troughColor), XtRImmediate, (XtPointer)~0 },
-
- { XmNshadowThickness, XmCShadowThickness, XtRInt,
- sizeof(int), offset(sb.shadowThickness), XtRImmediate, (XtPointer)2 },
-
- { XmNborderWidth, XmCBorderWidth, XtRDimension,
- sizeof(Dimension), offset(core.border_width), XtRImmediate,
- (XtPointer)0 },
-
- { XmNshowArrows, XmCShowArrows, XtRBoolean,
- sizeof(Boolean), offset(sb.showArrows), XtRImmediate, (XtPointer)True },
-
- { XmNinitialDelay, XmCInitialDelay, XtRInt, sizeof(int),
- offset(sb.initialDelay), XtRImmediate, (XtPointer) 250 },
- { XmNrepeatDelay, XmCRepeatDelay, XtRInt, sizeof(int),
- offset(sb.repeatDelay), XtRImmediate, (XtPointer) 50 },
-
- { XmNorientation, XmCOrientation, XtROrientation,
- sizeof(unsigned char), offset(sb.orientation), XtRImmediate,
- (XtPointer) XmVERTICAL },
-
- { 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},
-
- { 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},
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(sb.member), extrepr, value)
+
+ res (XmNforeground, XmCForeground, XtRPixel, Pixel,
+ foreground, XtRImmediate, XtDefaultForeground),
+ res (XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
+ Pixel, topShadowColor, XtRImmediate, ~0),
+ res (XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
+ Pixel, bottomShadowColor, XtRImmediate, ~0),
+
+ res (XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
+ Pixmap, topShadowPixmap, XtRImmediate, None),
+ res (XmNbottomShadowPixmap, XmCBottomShadowPixmap,
+ XtRPixmap, Pixmap, bottomShadowPixmap, XtRImmediate, None),
+
+ res (XmNtroughColor, XmCTroughColor, XtRPixel, Pixel, troughColor,
+ XtRImmediate, ~0),
+
+ res (XmNshadowThickness, XmCShadowThickness, XtRInt, int,
+ shadowThickness, XtRImmediate, 2),
+
+ Xt_RESOURCE (XmNborderWidth, XmCBorderWidth, XtRDimension, Dimension,
+ offset(core.border_width), XtRImmediate, 0),
+
+ res (XmNshowArrows, XmCShowArrows, XtRBoolean, Boolean, showArrows,
+ XtRImmediate, True),
+
+ 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),
+
+ 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),
+
+ 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),
/* "knob" is obsolete; use "slider" instead. */
- { XmNsliderStyle, XmCSliderStyle, XtRString, sizeof(char *),
- offset(sb.sliderStyle), XtRImmediate, NULL},
- { XmNknobStyle, XmCKnobStyle, XtRString, sizeof(char *),
- offset(sb.knobStyle), XtRImmediate, NULL},
-
- { XmNarrowPosition, XmCArrowPosition, XtRString, sizeof(char *),
- offset(sb.arrowPosition), XtRImmediate, NULL},
+ res (XmNsliderStyle, XmCSliderStyle, XtRString, char *,
+ sliderStyle, XtRImmediate, NULL),
+ res (XmNknobStyle, XmCKnobStyle, XtRString, char *,
+ knobStyle, XtRImmediate, NULL),
+
+ res (XmNarrowPosition, XmCArrowPosition, XtRString, char *,
+ arrowPosition, XtRImmediate, NULL),
+#undef offset
+#undef res
};
/*-------------------------- Prototypes ---------------------------------*/
@@ -218,13 +208,13 @@ static void Realize(Widget widget, XtVal
/*-------------------------- Actions Table ------------------------------*/
static XtActionsRec actions[] =
{
- {"Select", Select},
- {"PageDownOrRight", PageDownOrRight},
- {"PageUpOrLeft", PageUpOrLeft},
- {"Drag", Drag},
- {"Release", Release},
- {"Jump", Jump},
- {"Abort", Abort},
+ { (String) "Select", Select},
+ { (String) "PageDownOrRight", PageDownOrRight},
+ { (String) "PageUpOrLeft", PageUpOrLeft},
+ { (String) "Drag", Drag},
+ { (String) "Release", Release},
+ { (String) "Jump", Jump},
+ { (String) "Abort", Abort},
};
/*--------------------- Default Translation Table -----------------------*/
@@ -243,7 +233,7 @@ XlwScrollBarClassRec xlwScrollBarClassRe
/* core_class fields */
{
/* superclass */ (WidgetClass) &coreClassRec,
- /* class_name */ "XlwScrollBar",
+ /* class_name */ (String) "XlwScrollBar",
/* widget_size */ sizeof(XlwScrollBarRec),
/* class_initialize */ NULL,
/* class_part_init */ NULL,
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 lwlib/xlwtabs.c
--- a/lwlib/xlwtabs.c Mon Oct 27 09:51:51 2008 +0900
+++ b/lwlib/xlwtabs.c Tue Oct 28 10:38:26 2008 +0900
@@ -142,64 +142,69 @@ static char accelTable[] = " #augment\n\
" ;
static XtAccelerators defaultAccelerators ; /* #### Never used */
+static XtResource resources[] = {
#define offset(field) XtOffsetOf(TabsRec, tabs.field)
-static XtResource resources[] = {
-
- {XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, sizeof(Boolean),
- offset(selectInsensitive), XtRImmediate, (XtPointer) True},
- {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
- offset(font), XtRString, (XtPointer) XtDefaultFont},
+#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),
#ifdef USE_XFT_TABS
/* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
or XtDefaultFont? */
- {XtNfcFontName, XtCFcFontName, XtRString, sizeof(String),
- offset(fcFontName), XtRString, (XtPointer) NULL },
+ res (XtNfcFontName, XtCFcFontName, XtRString, String,
+ fcFontName, XtRString, NULL),
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwmenu.c. */
- {XtNxftFont, XtCXftFont, XtRString, sizeof(String),
- offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" },
-#endif
- {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},
+ res (XtNxftFont, XtCXftFont, XtRString, String,
+ xftFontName, XtRString, "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),
+#undef offset
+#undef res
};
+
+
+ /* constraint resources */
+
+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),
#undef offset
-
-
-
- /* constraint resources */
-
-#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field)
-static XtResource tabsConstraintResources[] = {
- {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 res
} ;
-#undef offset
@@ -318,10 +323,10 @@ static void TabsAllocGreyGC( TabsWidget
static XtActionsRec actionsList[] =
{
- {"select", TabsSelect},
- {"page", TabsPage},
- {"highlight", TabsHighlight},
- {"unhighlight", TabsUnhighlight},
+ { (String) "select", TabsSelect },
+ { (String) "page", TabsPage },
+ { (String) "highlight", TabsHighlight },
+ { (String) "unhighlight", TabsUnhighlight },
} ;
@@ -341,7 +346,7 @@ TabsClassRec tabsClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) SuperClass,
- /* class_name */ "Tabs",
+ /* class_name */ (String) "Tabs",
/* widget_size */ sizeof(TabsRec),
/* class_initialize */ TabsClassInit,
/* class_part_init */ NULL, /* TODO? */
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/EmacsFrame.c
--- a/src/EmacsFrame.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/EmacsFrame.c Tue Oct 28 10:38:26 2008 +0900
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
#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 *);
@@ -60,117 +61,83 @@ emacs_Xt_mapping_action (Widget w, XEven
#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[] = {
- { XtNgeometry, XtCGeometry,
- XtRString, sizeof (String),
- offset (geometry), XtRString, (XtPointer) 0 },
- { XtNiconic, XtCIconic,
- XtRBoolean, sizeof (Boolean),
- offset (iconic), XtRImmediate, (XtPointer) False },
-
- { 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 },
+ res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0),
+ res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, 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),
#ifdef HAVE_SCROLLBARS
- { 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,
+ 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,
#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
defined (LWLIB_SCROLLBARS_ATHENA3D)
- (XtPointer) XtBOTTOM_RIGHT
+ XtBOTTOM_RIGHT
#else
- (XtPointer) XtBOTTOM_LEFT
+ XtBOTTOM_LEFT
#endif
- },
+ ),
#endif /* HAVE_SCROLLBARS */
#ifdef HAVE_TOOLBARS
- { 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 },
+ 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),
#endif /* HAVE_TOOLBARS */
- { 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 },
+ 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),
};
#undef offset
@@ -181,7 +148,7 @@ static XtResource resources[] = {
static XtActionsRec
emacsFrameActionsTable [] = {
- {"mapping", (XtActionProc) emacs_Xt_mapping_action},
+ { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action},
};
static char
@@ -200,7 +167,7 @@ EmacsFrameClassRec emacsFrameClassRec =
#else
/* superclass */ &widgetClassRec,
#endif
- /* class_name */ "EmacsFrame",
+ /* class_name */ (String) "EmacsFrame",
/* widget_size */ sizeof (EmacsFrameRec),
/* class_initialize */ EmacsFrameClassInitialize,
/* class_part_initialize */ 0,
@@ -653,8 +620,8 @@ EmacsFrameSetCharSize (Widget widget, in
{
Arg al [2];
- XtSetArg (al [0], XtNwidth, pixel_width);
- XtSetArg (al [1], XtNheight, pixel_height);
+ Xt_SET_ARG (al [0], XtNwidth, pixel_width);
+ Xt_SET_ARG (al [1], XtNheight, pixel_height);
XtSetValues ((Widget) ew, al, countof (al));
}
}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/EmacsManager.c
--- a/src/EmacsManager.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/EmacsManager.c Tue Oct 28 10:38:26 2008 +0900
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#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
@@ -39,15 +40,14 @@ Boston, MA 02111-1307, USA. */
static XtResource resources[] = {
#define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field)
- { 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 },
+#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),
};
/****************************************************************
@@ -75,7 +75,7 @@ EmacsManagerClassRec emacsManagerClassRe
#else
/* superclass */ (WidgetClass) &compositeClassRec,
#endif
- /* class_name */ "EmacsManager",
+ /* class_name */ (String) "EmacsManager",
/* widget_size */ sizeof (EmacsManagerRec),
/* class_initialize */ ClassInitialize,
/* class_part_init */ NULL,
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/EmacsShell-sub.c
--- a/src/EmacsShell-sub.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/EmacsShell-sub.c Tue Oct 28 10:38:26 2008 +0900
@@ -89,6 +89,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/Vendor.h>
#include <X11/VendorP.h>
#include "EmacsShellP.h"
+#include "../lwlib/xt-wrappers.h"
#define ABORT abort
@@ -134,30 +135,28 @@ static XtResource resources[] = {
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. */
- { XtNx, XtCPosition,
- XtRPosition, sizeof (Position),
- coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE },
- { XtNy, XtCPosition,
- XtRPosition, sizeof (Position),
- coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE },
-#endif
- { 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 },
+ motifres (XtNx, x),
+ motifres (XtNy, y),
+#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
};
static CompositeClassExtensionRec compositeClassExtRec = {
@@ -259,12 +258,12 @@ update_size_hints_internal (EMACS_SHELL_
printf (" base size set to: %d %d\n", base_width, base_height);
fflush (stdout);
#endif
- 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);
+ 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);
XtSetValues ((Widget) w, al, 4);
}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/console-x.h
--- a/src/console-x.h Mon Oct 27 09:51:51 2008 +0900
+++ b/src/console-x.h Tue Oct 28 10:38:26 2008 +0900
@@ -65,18 +65,6 @@ Boston, MA 02111-1307, USA. */
#if (XlibSpecificationRelease < 5)
# 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
@@ -212,7 +200,7 @@ void describe_XIMStyles (XIMStyles *sty
void describe_XIMStyles (XIMStyles *styles);
void describe_XIC (XIC ic);
void describe_event_mask (unsigned long mask);
-void describe_XRectangle (char *name, XRectangle *rect);
+void describe_XRectangle (const char *name, XRectangle *rect);
void describe_Status (Status status);
#endif /* DEBUG_XEMACS */
#endif /* XIM_XLIB */
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/device-x.c
--- a/src/device-x.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/device-x.c Tue Oct 28 10:38:26 2008 +0900
@@ -79,29 +79,33 @@ Lisp_Object Vx_emacs_application_class;
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[] =
{
- {"-geometry", ".geometry", XrmoptionSepArg, NULL},
- {"-iconic", ".iconic", XrmoptionNoArg, "yes"},
-
- {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
- {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
- {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL},
- {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL},
-
- {"-privatecolormap", ".privateColormap", XrmoptionNoArg, "yes"},
- {"-visual", ".EmacsVisual", XrmoptionSepArg, NULL},
+ Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "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),
+
+ Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"),
+ Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL),
/* #### Beware! If the type of the shell changes, update this. */
- {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
- {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
- {"-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
-
- {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
- {"-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
- {"-mc", "*pointerColor", XrmoptionSepArg, NULL},
- {"-cr", "*cursorColor", XrmoptionSepArg, NULL},
- {"-fontset", "*FontSet", XrmoptionSepArg, NULL},
+ Xrm_ODR ("-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-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),
};
static const struct memory_description x_device_data_description_1 [] = {
@@ -329,7 +333,7 @@ compute_x_app_name (int argc, Extbyte **
if (argc > 0 && argv[0] && *argv[0])
return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0];
- return "xemacs";
+ return (Extbyte *) "xemacs"; /* shut up g++ 4.3 */
}
/*
@@ -343,7 +347,7 @@ static int
static int
have_xemacs_resources_in_xrdb (Display *dpy)
{
- char *xdefs, *key;
+ const char *xdefs, *key;
int len;
#ifdef INFODOCK
@@ -688,9 +692,9 @@ x_init_device (struct device *d, Lisp_Ob
does not override resources defined elsewhere */
const Extbyte *data_dir;
Extbyte *path;
- Extbyte *format;
+ const Extbyte *format;
XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
- Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+ const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
Extbyte *locale_end;
if (STRINGP (Vx_app_defaults_directory) &&
@@ -739,7 +743,11 @@ x_init_device (struct device *d, Lisp_Ob
}
no_data_directory:
- xfree (locale, Extbyte*);
+ {
+ /* Cast off const for G++ 4.3. */
+ Extbyte *temp = (Extbyte *) locale;
+ xfree (temp, Extbyte*);
+ }
}
#endif /* MULE */
@@ -861,9 +869,9 @@ x_init_device (struct device *d, Lisp_Ob
be the place. Make sure it doesn't conflict with GNOME. */
{
Arg al[3];
- XtSetArg (al[0], XtNvisual, visual);
- XtSetArg (al[1], XtNdepth, depth);
- XtSetArg (al[2], XtNcolormap, cmap);
+ Xt_SET_ARG (al[0], XtNvisual, visual);
+ Xt_SET_ARG (al[1], XtNdepth, depth);
+ Xt_SET_ARG (al[2], XtNcolormap, cmap);
app_shell = XtAppCreateShell (NULL, app_class,
applicationShellWidgetClass,
@@ -880,11 +888,13 @@ x_init_device (struct device *d, Lisp_Ob
and set it to the size of the root window for child placement purposes */
{
Arg al[5];
- 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)));
+ 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)));
XtSetValues (app_shell, al, countof (al));
XtRealizeWidget (app_shell);
}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/emacs.c
--- a/src/emacs.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/emacs.c Tue Oct 28 10:38:26 2008 +0900
@@ -806,7 +806,7 @@ Return the directory name in which the E
enough information to do it right. */
static int
-argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr,
+argmatch (Wexttext **argv, int argc, const Ascbyte *sstr, const Ascbyte *lstr,
int minlen, Wexttext **valptr, int *skipptr)
{
Wexttext *p = NULL;
@@ -862,7 +862,7 @@ argmatch (Wexttext **argv, int argc, Asc
}
static void
-check_compatible_window_system (Ascbyte *must)
+check_compatible_window_system (const Ascbyte *must)
{
if (display_use && strcmp (display_use, must))
fatal ("Incompatible window system type `%s': `%s' already specified",
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/emodules.c
--- a/src/emodules.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/emodules.c Tue Oct 28 10:38:26 2008 +0900
@@ -96,7 +96,7 @@ the variable `load-modules-quietly' is n
*/
(file, name, version))
{
- CIbyte *mod, *mname, *mver;
+ const CIbyte *mod, *mname, *mver;
int speccount = specpdl_depth();
CHECK_STRING(file);
@@ -136,7 +136,7 @@ soon as the last reference to symbols wi
(file, name, version))
{
int x;
- CIbyte *mod, *mname, *mver;
+ const CIbyte *mod, *mname, *mver;
Lisp_Object foundname = Qnil;
struct gcpro gcpro1;
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/event-Xt.c
--- a/src/event-Xt.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/event-Xt.c Tue Oct 28 10:38:26 2008 +0900
@@ -109,7 +109,9 @@ extern SELECT_TYPE input_wait_mask, non_
extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask;
extern SELECT_TYPE process_only_mask, tty_only_mask;
-static const String x_fallback_resources[] =
+/* #### 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[] =
{
/* This file is automatically generated from the app-defaults file
in ../etc/Emacs.ad. These resources are consulted only if no
@@ -3126,8 +3128,8 @@ emacs_Xt_event_widget_focus_out (Widget
static XtActionsRec widgetActionsList[] =
{
- {"widget-focus-in", emacs_Xt_event_widget_focus_in },
- {"widget-focus-out", emacs_Xt_event_widget_focus_out },
+ { (String) "widget-focus-in", emacs_Xt_event_widget_focus_in },
+ { (String) "widget-focus-out", emacs_Xt_event_widget_focus_out },
};
static void
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/event-stream.c
--- a/src/event-stream.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/event-stream.c Tue Oct 28 10:38:26 2008 +0900
@@ -255,7 +255,7 @@ Fixnum debug_emacs_events;
Fixnum debug_emacs_events;
static void
-external_debugging_print_event (char *event_description, Lisp_Object event)
+external_debugging_print_event (const char *event_description, Lisp_Object event)
{
write_c_string (Qexternal_debugging_output, "(");
write_c_string (Qexternal_debugging_output, event_description);
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/file-coding.c
--- a/src/file-coding.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/file-coding.c Tue Oct 28 10:38:26 2008 +0900
@@ -897,8 +897,8 @@ eol_type_to_symbol (enum eol_type type)
struct subsidiary_type
{
- Ascbyte *extension;
- Ascbyte *mnemonic_ext;
+ const Ascbyte *extension;
+ const Ascbyte *mnemonic_ext;
enum eol_type eol;
};
@@ -944,8 +944,8 @@ setup_eol_coding_systems (Lisp_Object co
for (i = 0; i < countof (coding_subsidiary_list); i++)
{
- Ascbyte *extension = coding_subsidiary_list[i].extension;
- Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext;
+ const Ascbyte *extension = coding_subsidiary_list[i].extension;
+ const 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 @@ setup_eol_coding_systems (Lisp_Object co
*/
static Lisp_Object
-make_coding_system_1 (Lisp_Object name_or_existing, Ascbyte *prefix,
+make_coding_system_1 (Lisp_Object name_or_existing, const Ascbyte *prefix,
Lisp_Object type, Lisp_Object description,
Lisp_Object props)
{
@@ -1192,7 +1192,7 @@ make_coding_system_1 (Lisp_Object name_o
}
Lisp_Object
-make_internal_coding_system (Lisp_Object existing, Ascbyte *prefix,
+make_internal_coding_system (Lisp_Object existing, const Ascbyte *prefix,
Lisp_Object type, Lisp_Object description,
Lisp_Object props)
{
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/file-coding.h
--- a/src/file-coding.h Mon Oct 27 09:51:51 2008 +0900
+++ b/src/file-coding.h Tue Oct 28 10:38:26 2008 +0900
@@ -1046,7 +1046,7 @@ Ichar decode_big5_char (int o1, int o2);
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,
- Ascbyte *prefix,
+ const Ascbyte *prefix,
Lisp_Object type,
Lisp_Object description,
Lisp_Object props);
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/frame-x.c
--- a/src/frame-x.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/frame-x.c Tue Oct 28 10:38:26 2008 +0900
@@ -280,8 +280,8 @@ x_wm_set_cell_size (Widget wmshell, int
if (cw <= 0 || ch <= 0)
ABORT ();
- XtSetArg (al[0], XtNwidthInc, cw);
- XtSetArg (al[1], XtNheightInc, ch);
+ Xt_SET_ARG (al[0], XtNwidthInc, cw);
+ Xt_SET_ARG (al[1], XtNheightInc, ch);
XtSetValues (wmshell, al, 2);
}
@@ -298,8 +298,8 @@ x_wm_set_variable_size (Widget wmshell,
fflush (stdout);
#endif
- XtSetArg (al[0], XtNwidthCells, width);
- XtSetArg (al[1], XtNheightCells, height);
+ Xt_SET_ARG (al[0], XtNwidthCells, width);
+ Xt_SET_ARG (al[1], XtNheightCells, height);
XtSetValues (wmshell, al, 2);
}
@@ -668,8 +668,8 @@ x_set_frame_text_value (struct frame *f,
if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
{
Arg al[2];
- XtSetArg (al[0], Xt_resource_name, new_XtValue);
- XtSetArg (al[1], Xt_resource_encoding_name, encoding);
+ Xt_SET_ARG (al[0], Xt_resource_name, new_XtValue);
+ Xt_SET_ARG (al[1], Xt_resource_encoding_name, encoding);
XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
}
}
@@ -1539,8 +1539,8 @@ x_initialize_frame_size (struct frame *f
if (! (frame_flags & (WidthValue | HeightValue)))
{
Arg al[2];
- XtSetArg (al [0], XtNwidth, &frame_w);
- XtSetArg (al [1], XtNheight, &frame_h);
+ Xt_SET_ARG (al [0], XtNwidth, &frame_w);
+ Xt_SET_ARG (al [1], XtNheight, &frame_h);
XtGetValues (ew, al, 2);
if (!frame_w && !frame_h)
{
@@ -1554,8 +1554,8 @@ x_initialize_frame_size (struct frame *f
if (frame_flags & (XValue | YValue))
{
Arg al[2];
- XtSetArg (al [0], XtNwidth, &frame_w);
- XtSetArg (al [1], XtNheight, &frame_h);
+ Xt_SET_ARG (al [0], XtNwidth, &frame_w);
+ Xt_SET_ARG (al [1], XtNheight, &frame_h);
XtGetValues (ew, al, 2);
if (frame_flags & XNegative)
@@ -1563,8 +1563,8 @@ x_initialize_frame_size (struct frame *f
if (frame_flags & YNegative)
frame_y += frame_h;
- XtSetArg (al [0], XtNx, frame_x);
- XtSetArg (al [1], XtNy, frame_y);
+ Xt_SET_ARG (al [0], XtNx, frame_x);
+ Xt_SET_ARG (al [1], XtNy, frame_y);
XtSetValues (ew, al, 2);
}
return;
@@ -1869,40 +1869,40 @@ x_create_widgets (struct frame *f, Lisp_
FRAME_X_TOP_LEVEL_FRAME_P (f) = 1;
ac = 0;
- XtSetArg (al[ac], XtNallowShellResize, True); ac++;
+ Xt_SET_ARG (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. */
- XtSetArg (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
+ Xt_SET_ARG (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
#endif
#ifdef EXTERNAL_WIDGET
if (window_id)
{
- XtSetArg (al[ac], XtNwindow, window_id); ac++;
+ Xt_SET_ARG (al[ac], XtNwindow, window_id); ac++;
}
else
#endif /* EXTERNAL_WIDGET */
{
- 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++;
+ 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++;
}
if (!NILP (overridep))
{
- XtSetArg (al[ac], XtNoverrideRedirect, True); ac++;
+ Xt_SET_ARG (al[ac], XtNoverrideRedirect, True); ac++;
}
/* #### maybe we should check for FRAMEP instead? */
if (!NILP (parent))
{
parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent));
- XtSetArg (al[ac], XtNtransientFor, parentwid); ac++;
+ Xt_SET_ARG (al[ac], XtNtransientFor, parentwid); ac++;
}
shell = XtCreatePopupShell ("shell",
@@ -1921,9 +1921,9 @@ x_create_widgets (struct frame *f, Lisp_
/* Create the manager widget */
ac = 0;
- XtSetArg (al[ac], XtNvisual, visual); ac++;
- XtSetArg (al[ac], XtNdepth, depth); ac++;
- XtSetArg (al[ac], XtNcolormap, cmap); 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++;
container = XtCreateWidget ("container",
emacsManagerWidgetClass, shell, al, ac);
@@ -1935,11 +1935,11 @@ x_create_widgets (struct frame *f, Lisp_
/* Create the text area */
ac = 0;
- 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++;
+ 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++;
text = XtCreateWidget (name, emacsFrameClass, container, al, ac);
FRAME_X_TEXT_WIDGET (f) = text;
@@ -2198,8 +2198,8 @@ x_set_frame_icon (struct frame *f)
/* Store the X data into the widget. */
{
Arg al[2];
- XtSetArg (al[0], XtNiconPixmap, x_pixmap);
- XtSetArg (al[1], XtNiconMask, x_mask);
+ Xt_SET_ARG (al[0], XtNiconPixmap, x_pixmap);
+ Xt_SET_ARG (al[1], XtNiconMask, x_mask);
XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
}
}
@@ -2264,9 +2264,9 @@ x_set_frame_position (struct frame *f, i
int win_gravity;
Arg al[3];
- XtSetArg (al[0], XtNwidth, &shell_w);
- XtSetArg (al[1], XtNheight, &shell_h);
- XtSetArg (al[2], XtNborderWidth, &shell_bord);
+ Xt_SET_ARG (al[0], XtNwidth, &shell_w);
+ Xt_SET_ARG (al[1], XtNheight, &shell_h);
+ Xt_SET_ARG (al[2], XtNborderWidth, &shell_bord);
XtGetValues (w, al, 3);
win_gravity =
@@ -2283,9 +2283,9 @@ x_set_frame_position (struct frame *f, i
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). */
- XtSetArg (al[0], XtNwinGravity, win_gravity);
- XtSetArg (al[1], XtNx, xoff);
- XtSetArg (al[2], XtNy, yoff);
+ Xt_SET_ARG (al[0], XtNwinGravity, win_gravity);
+ Xt_SET_ARG (al[1], XtNx, xoff);
+ Xt_SET_ARG (al[2], XtNy, yoff);
XtSetValues (w, al, 3);
/* Sometimes you will find that
@@ -2709,7 +2709,7 @@ x_update_frame_external_traits (struct f
if (!EQ (color, Vthe_null_color_instance))
{
fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
+ Xt_SET_ARG (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
}
}
else if (EQ (name, Qbackground))
@@ -2720,7 +2720,7 @@ x_update_frame_external_traits (struct f
if (!EQ (color, Vthe_null_color_instance))
{
bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
+ Xt_SET_ARG (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
}
/* Really crappy way to force the modeline shadows to be
@@ -2754,15 +2754,15 @@ x_update_frame_external_traits (struct f
#ifdef USE_XFT
else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)))
{
- XtSetArg (al[ac], XtNxftFont,
+ Xt_SET_ARG (al[ac], XtNxftFont,
(void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)));
ac++;
}
#endif
else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)))
{
- XtSetArg (al[ac], XtNfont,
- (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
+ Xt_SET_ARG (al[ac], XtNfont,
+ (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
ac++;
}
}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/gif_io.c
--- a/src/gif_io.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/gif_io.c Tue Oct 28 10:38:26 2008 +0900
@@ -140,7 +140,7 @@ int GifClose(GifFileType *GifFile)
return ((*(GifIO->CloseFunc))(GifIO->CloseFunc_data));
}
-static char *GifErrorString[14] = {
+static const 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 *GetGifError(int errore)
{
- char *Err;
+ const char *Err;
switch(errore) {
case D_GIF_ERR_OPEN_FAILED:
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/glyphs-x.c
--- a/src/glyphs-x.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/glyphs-x.c Tue Oct 28 10:38:26 2008 +0900
@@ -2234,8 +2234,8 @@ x_redisplay_widget (Lisp_Image_Instance
if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
{
Arg al[2];
- XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
- XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
+ Xt_SET_ARG (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
+ Xt_SET_ARG (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 @@ update_tab_widget_face (widget_value* wv
(IMAGE_INSTANCE_WIDGET_FACE (ii),
domain);
XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
- lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel);
+ lw_add_widget_value_arg (val, (String) XtNtabForeground, fcolor.pixel);
wv->change = VISIBLE_CHANGE;
val->change = VISIBLE_CHANGE;
@@ -2539,8 +2539,8 @@ x_widget_instantiate (Lisp_Object image_
offset the redisplay of the widget by the amount the text
widget is inside the manager. */
ac = 0;
- XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
- XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
+ 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++;
XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac);
XtSetMappedWhenManaged (wid, TRUE);
@@ -2608,11 +2608,11 @@ x_button_instantiate (Lisp_Object image_
Arg al [2];
int ac =0;
#ifdef LWLIB_WIDGETS_MOTIF
- XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++;
- XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
+ Xt_SET_ARG (al [ac], XmNlabelType, XmPIXMAP); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
ac++;
#else
- XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
+ Xt_SET_ARG (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
#endif
XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
}
@@ -2683,11 +2683,9 @@ x_progress_gauge_redisplay (Lisp_Object
if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
{
- Arg al [1];
Lisp_Object val;
val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value;
- XtSetArg (al[0], XtNvalue, XINT (val));
- XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 1);
+ Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (p), XtNvalue, XINT (val));
}
}
@@ -2773,7 +2771,6 @@ x_tab_control_redisplay (Lisp_Object ima
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;
@@ -2789,8 +2786,8 @@ x_tab_control_redisplay (Lisp_Object ima
{
if (!strcmp (XtName (children [i]), name))
{
- XtSetArg (al [0], XtNtopWidget, children [i]);
- XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1);
+ Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (ii),
+ XtNtopWidget, children [i]);
break;
}
}
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/input-method-xlib.c
--- a/src/input-method-xlib.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/input-method-xlib.c Tue Oct 28 10:38:26 2008 +0900
@@ -286,19 +286,19 @@ XIM_init_frame (struct frame *f)
xic_vars_t xic_vars;
XIC xic;
-#define res(name, class_, representation, field, default_value) \
- { name, class_, representation, sizeof(xic_vars.field), \
- XtOffsetOf(xic_vars_t, field), XtRString, default_value }
+#define res(name, class_, representation, field, default_value) \
+ Xt_RESOURCE (name, class_, representation, 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, (XtPointer) DefaultXIMStyles),
- res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, (XtPointer) XtDefaultFontSet),
- res(XtNximForeground, XtCForeground, XtRPixel, fg, (XtPointer) XtDefaultForeground),
- res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground)
+ res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, DefaultXIMStyles),
+ res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, XtDefaultFontSet),
+ res(XtNximForeground, XtCForeground, XtRPixel, fg, XtDefaultForeground),
+ res(XtNximBackground, XtCBackground, XtRPixel, bg, XtDefaultBackground)
};
-
+#undef res
xim = DEVICE_X_XIM (d);
@@ -977,7 +977,7 @@ describe_XIC (XIC xic)
}
void
-describe_XRectangle (char *name, XRectangle *r)
+describe_XRectangle (const char *name, XRectangle *r)
{
if (r == NULL)
stderr_out ("%s: NULL\n", name);
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/menubar-x.c
--- a/src/menubar-x.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/menubar-x.c Tue Oct 28 10:38:26 2008 +0900
@@ -690,13 +690,13 @@ make_dummy_xbutton_event (XEvent *dummy,
{
Widget shell = XtParent (daddy);
- XtSetArg (al [0], XtNx, &shellx);
- XtSetArg (al [1], XtNy, &shelly);
+ Xt_SET_ARG (al [0], XtNx, &shellx);
+ Xt_SET_ARG (al [1], XtNy, &shelly);
XtGetValues (shell, al, 2);
}
#endif
- XtSetArg (al [0], XtNx, &framex);
- XtSetArg (al [1], XtNy, &framey);
+ Xt_SET_ARG (al [0], XtNx, &framex);
+ Xt_SET_ARG (al [1], XtNy, &framey);
XtGetValues (daddy, al, 2);
btn->x_root = shellx + framex + btn->x;
btn->y_root = shelly + framey + btn->y;
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/mule-coding.c
--- a/src/mule-coding.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/mule-coding.c Tue Oct 28 10:38:26 2008 +0900
@@ -3339,7 +3339,7 @@ ccl_putprop (Lisp_Object codesys, Lisp_O
{
Lisp_Object sym;
struct ccl_program test_ccl;
- Ascbyte *suffix;
+ const Ascbyte *suffix;
/* Check key first. */
if (EQ (key, Qdecode))
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/print.c
--- a/src/print.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/print.c Tue Oct 28 10:38:26 2008 +0900
@@ -1527,7 +1527,7 @@ enum printing_badness
static void
printing_major_badness (Lisp_Object printcharfun,
- Ascbyte *badness_string, int type, void *val,
+ const Ascbyte *badness_string, int type, void *val,
enum printing_badness badness)
{
Ibyte buf[666];
diff -r 279cadceaa13bf3ccae066cb71092466e6175fc1 -r 383ab474a24153898db7bc967d04d3411625f067 src/redisplay.c
--- a/src/redisplay.c Mon Oct 27 09:51:51 2008 +0900
+++ b/src/redisplay.c Tue Oct 28 10:38:26 2008 +0900
@@ -4447,7 +4447,7 @@ tail_recurse:
{
invalid:
{
- char *str = GETTEXT ("*invalid*");
+ const char *str = GETTEXT ("*invalid*");
Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */
if (size <= *offset)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC 21.5] Improve doc of beta-version-name
16 years, 1 month
Stephen J. Turnbull
APPROVE COMMIT 21.5
Comments on wording welcome.
diff -r e0a8c796f955 -r 41c84a94258b lisp/ChangeLog
--- a/lisp/ChangeLog Sat Sep 27 16:38:11 2008 +0900
+++ b/lisp/ChangeLog Tue Sep 30 12:35:05 2008 +0900
@@ -1,3 +1,8 @@
+2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * version.el (xemacs-betaname):
+ Document relation to other version variables.
+
2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
* subr.el (with-string-as-buffer-contents):
diff -r e0a8c796f955 -r 41c84a94258b lisp/version.el
--- a/lisp/version.el Sat Sep 27 16:38:11 2008 +0900
+++ b/lisp/version.el Tue Sep 30 12:35:05 2008 +0900
@@ -33,7 +33,9 @@
(defconst xemacs-betaname
(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")
+Warning, this variable did not exist in XEmacs versions prior to 20.3.
+It value is derived from `emacs-beta-version'. It is mutually exclusive
+with `emacs-patch-level'.")
(defconst emacs-version
(format "%d.%d %s%s%s%s%s"
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Improve beta-version-name docstring.
16 years, 1 month
Stephen Turnbull
changeset: 4519:41c84a94258b8689c6af62e04ef3c2abcbe0db58
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Tue Sep 30 12:35:05 2008 +0900
files: lisp/ChangeLog lisp/version.el
description:
Improve beta-version-name docstring.
diff -r e0a8c796f955d2559194ffbf875c1d415087f99d -r 41c84a94258b8689c6af62e04ef3c2abcbe0db58 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Sep 27 16:38:11 2008 +0900
+++ b/lisp/ChangeLog Tue Sep 30 12:35:05 2008 +0900
@@ -1,3 +1,8 @@ 2008-09-27 Stephen J. Turnbull <stephe
+2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * version.el (xemacs-betaname):
+ Document relation to other version variables.
+
2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
* subr.el (with-string-as-buffer-contents):
diff -r e0a8c796f955d2559194ffbf875c1d415087f99d -r 41c84a94258b8689c6af62e04ef3c2abcbe0db58 lisp/version.el
--- a/lisp/version.el Sat Sep 27 16:38:11 2008 +0900
+++ b/lisp/version.el Tue Sep 30 12:35:05 2008 +0900
@@ -33,7 +33,9 @@
(defconst xemacs-betaname
(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")
+Warning, this variable did not exist in XEmacs versions prior to 20.3.
+It value is derived from `emacs-beta-version'. It is mutually exclusive
+with `emacs-patch-level'.")
(defconst emacs-version
(format "%d.%d %s%s%s%s%s"
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Merge in doc and test changes from September 2008.
16 years, 1 month
Stephen Turnbull
changeset: 4520:279cadceaa13bf3ccae066cb71092466e6175fc1
tag: tip
parent: 4515:bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2
parent: 4519:41c84a94258b8689c6af62e04ef3c2abcbe0db58
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Mon Oct 27 09:51:51 2008 +0900
files:
description:
Merge in doc and test changes from September 2008.
diff -r bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2 -r 279cadceaa13bf3ccae066cb71092466e6175fc1 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Oct 26 21:26:42 2008 +0900
+++ b/lisp/ChangeLog Mon Oct 27 09:51:51 2008 +0900
@@ -1,3 +1,13 @@ 2008-08-31 Aidan Kehoe <kehoea@parhasa
+2008-09-30 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * version.el (xemacs-betaname):
+ Document relation to other version variables.
+
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * subr.el (with-string-as-buffer-contents):
+ Document initial position of point.
+
2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
* window.el (only-window-p): New.
diff -r bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2 -r 279cadceaa13bf3ccae066cb71092466e6175fc1 lisp/subr.el
--- a/lisp/subr.el Sun Oct 26 21:26:42 2008 +0900
+++ b/lisp/subr.el Mon Oct 27 09:51:51 2008 +0900
@@ -645,6 +645,7 @@ Value is what BODY returns."
;; Moved from mule-coding.el.
(defmacro with-string-as-buffer-contents (str &rest body)
"With the contents of the current buffer being STR, run BODY.
+Point starts positioned to end of buffer.
Returns the new contents of the buffer, as modified by BODY.
The original current buffer is restored afterwards."
`(with-temp-buffer
diff -r bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2 -r 279cadceaa13bf3ccae066cb71092466e6175fc1 lisp/version.el
--- a/lisp/version.el Sun Oct 26 21:26:42 2008 +0900
+++ b/lisp/version.el Mon Oct 27 09:51:51 2008 +0900
@@ -33,7 +33,9 @@
(defconst xemacs-betaname
(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")
+Warning, this variable did not exist in XEmacs versions prior to 20.3.
+It value is derived from `emacs-beta-version'. It is mutually exclusive
+with `emacs-patch-level'.")
(defconst emacs-version
(format "%d.%d %s%s%s%s%s"
diff -r bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2 -r 279cadceaa13bf3ccae066cb71092466e6175fc1 tests/ChangeLog
--- a/tests/ChangeLog Sun Oct 26 21:26:42 2008 +0900
+++ b/tests/ChangeLog Mon Oct 27 09:51:51 2008 +0900
@@ -1,3 +1,12 @@ 2008-08-27 Aidan Kehoe <kehoea@parhasa
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: Add test for at_dot regexp.
+
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: `with-string-as-buffer-contents'
+ leaves point at end of buffer, so must move point to beginning.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
diff -r bbce7f6de2d61e0c1852d90d99b94cefb9bd53d2 -r 279cadceaa13bf3ccae066cb71092466e6175fc1 tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Sun Oct 26 21:26:42 2008 +0900
+++ b/tests/automated/regexp-tests.el Mon Oct 27 09:51:51 2008 +0900
@@ -526,6 +526,7 @@ baaaa
(with-string-as-buffer-contents
"-]-----------------------------][]]------------------------"
+ (goto-char (point-min))
(skip-chars-forward (skip-chars-quote "-[]"))
(Assert (= (point) (point-max)))
(skip-chars-backward (skip-chars-quote "-[]"))
@@ -544,3 +545,21 @@ baaaa
;; via `replace-regexp-in-string', but we should specifically test bogus
;; combinations of STRING and STRBUFFER.
+;; empty string at point
+;; Thanks Julian Bradford on XEmacs Beta
+;; <18652.54975.894512.880956(a)krk.inf.ed.ac.uk>
+(with-string-as-buffer-contents "aáa"
+ (goto-char (point-min))
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 1))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 2))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 3))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 4)))
+
+
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Add test for at_dot regexp.
16 years, 1 month
Stephen Turnbull
changeset: 4518:e0a8c796f955d2559194ffbf875c1d415087f99d
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Sep 27 16:38:11 2008 +0900
files: tests/ChangeLog tests/automated/regexp-tests.el
description:
Add test for at_dot regexp.
diff -r 5e8f6469169f510de040ea59a106e1de5c29c73f -r e0a8c796f955d2559194ffbf875c1d415087f99d tests/ChangeLog
--- a/tests/ChangeLog Sat Sep 27 16:34:40 2008 +0900
+++ b/tests/ChangeLog Sat Sep 27 16:38:11 2008 +0900
@@ -1,3 +1,7 @@ 2008-09-27 Stephen J. Turnbull <stephe
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: Add test for at_dot regexp.
+
2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
* automated/regexp-tests.el: `with-string-as-buffer-contents'
diff -r 5e8f6469169f510de040ea59a106e1de5c29c73f -r e0a8c796f955d2559194ffbf875c1d415087f99d tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Sat Sep 27 16:34:40 2008 +0900
+++ b/tests/automated/regexp-tests.el Sat Sep 27 16:38:11 2008 +0900
@@ -545,3 +545,21 @@ baaaa
;; via `replace-regexp-in-string', but we should specifically test bogus
;; combinations of STRING and STRBUFFER.
+;; empty string at point
+;; Thanks Julian Bradford on XEmacs Beta
+;; <18652.54975.894512.880956(a)krk.inf.ed.ac.uk>
+(with-string-as-buffer-contents "aáa"
+ (goto-char (point-min))
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 1))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 2))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 3))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 4)))
+
+
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Fix up initial condition for skip-chars test.
16 years, 1 month
Stephen Turnbull
changeset: 4517:5e8f6469169f510de040ea59a106e1de5c29c73f
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Sep 27 16:34:40 2008 +0900
files: tests/ChangeLog tests/automated/regexp-tests.el
description:
Fix up initial condition for skip-chars test.
diff -r e96f3aca4d63ae750580ce3d8b84201321340723 -r 5e8f6469169f510de040ea59a106e1de5c29c73f tests/ChangeLog
--- a/tests/ChangeLog Sat Sep 27 16:31:32 2008 +0900
+++ b/tests/ChangeLog Sat Sep 27 16:34:40 2008 +0900
@@ -1,3 +1,8 @@ 2008-08-27 Aidan Kehoe <kehoea@parhasa
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: `with-string-as-buffer-contents'
+ leaves point at end of buffer, so must move point to beginning.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
diff -r e96f3aca4d63ae750580ce3d8b84201321340723 -r 5e8f6469169f510de040ea59a106e1de5c29c73f tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Sat Sep 27 16:31:32 2008 +0900
+++ b/tests/automated/regexp-tests.el Sat Sep 27 16:34:40 2008 +0900
@@ -526,6 +526,7 @@ baaaa
(with-string-as-buffer-contents
"-]-----------------------------][]]------------------------"
+ (goto-char (point-min))
(skip-chars-forward (skip-chars-quote "-[]"))
(Assert (= (point) (point-max)))
(skip-chars-backward (skip-chars-quote "-[]"))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Document initial position of point in `with-string-as-buffer-contents'.
16 years, 1 month
Stephen Turnbull
changeset: 4516:e96f3aca4d63ae750580ce3d8b84201321340723
parent: 4507:83e35df20028429b49acb60906054e176629b1f0
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Sep 27 16:31:32 2008 +0900
files: lisp/ChangeLog lisp/subr.el
description:
Document initial position of point in `with-string-as-buffer-contents'.
diff -r 83e35df20028429b49acb60906054e176629b1f0 -r e96f3aca4d63ae750580ce3d8b84201321340723 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Sep 08 08:48:22 2008 +0200
+++ b/lisp/ChangeLog Sat Sep 27 16:31:32 2008 +0900
@@ -1,3 +1,8 @@ 2008-08-31 Aidan Kehoe <kehoea@parhasa
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * subr.el (with-string-as-buffer-contents):
+ Document initial position of point.
+
2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
* window.el (only-window-p): New.
diff -r 83e35df20028429b49acb60906054e176629b1f0 -r e96f3aca4d63ae750580ce3d8b84201321340723 lisp/subr.el
--- a/lisp/subr.el Mon Sep 08 08:48:22 2008 +0200
+++ b/lisp/subr.el Sat Sep 27 16:31:32 2008 +0900
@@ -645,6 +645,7 @@ Value is what BODY returns."
;; Moved from mule-coding.el.
(defmacro with-string-as-buffer-contents (str &rest body)
"With the contents of the current buffer being STR, run BODY.
+Point starts positioned to end of buffer.
Returns the new contents of the buffer, as modified by BODY.
The original current buffer is restored afterwards."
`(with-temp-buffer
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC 21.5] with-string-as-buffer-contents initializes point to eob
16 years, 1 month
Stephen J. Turnbull
APPROVE COMMIT 21.5
The attached patch just fixes a test that misuses this macro.
RFC: I think Aidan's expectation that w-s-a-b-c will initialize point
to (point-min) is very natural. Should we make it so? Or should we
just document the correct usage of the macro?
If so, is somebody willing to grep the core and package sources for
uses and check to see if there are any conflicting uses? Also compare
to GNU, if they have it!
Note: the test as written will remain correct if we make this change.
diff -r e96f3aca4d63 -r 5e8f6469169f tests/ChangeLog
--- a/tests/ChangeLog Sat Sep 27 16:31:32 2008 +0900
+++ b/tests/ChangeLog Sat Sep 27 16:34:40 2008 +0900
@@ -1,3 +1,8 @@
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: `with-string-as-buffer-contents'
+ leaves point at end of buffer, so must move point to beginning.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
diff -r e96f3aca4d63 -r 5e8f6469169f tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Sat Sep 27 16:31:32 2008 +0900
+++ b/tests/automated/regexp-tests.el Sat Sep 27 16:34:40 2008 +0900
@@ -526,6 +526,7 @@
(with-string-as-buffer-contents
"-]-----------------------------][]]------------------------"
+ (goto-char (point-min))
(skip-chars-forward (skip-chars-quote "-[]"))
(Assert (= (point) (point-max)))
(skip-chars-backward (skip-chars-quote "-[]"))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches