comparison lwlib/lwlib-Xlw.c @ 4528:726060ee587c g++-warning-removal-2008-10-28

First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 04:06:33 +0900
parents fc7067b7f407
children 5460287a3327
comparison
equal deleted inserted replaced
4524:03ba50f7ecd7 4528:726060ee587c
120 xlw_create_menubar (widget_instance* instance) 120 xlw_create_menubar (widget_instance* instance)
121 { 121 {
122 Arg al [1]; 122 Arg al [1];
123 Widget widget; 123 Widget widget;
124 124
125 XtSetArg (al [0], XtNmenu, instance->info->val); 125 Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
126 widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass, 126 widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
127 instance->parent, al, 1); 127 instance->parent, al, 1);
128 XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); 128 XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
129 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); 129 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
130 return widget; 130 return widget;
137 Widget popup_shell, widget; 137 Widget popup_shell, widget;
138 138
139 popup_shell = XtCreatePopupShell (instance->info->name, 139 popup_shell = XtCreatePopupShell (instance->info->name,
140 overrideShellWidgetClass, 140 overrideShellWidgetClass,
141 instance->parent, NULL, 0); 141 instance->parent, NULL, 0);
142 XtSetArg (al [0], XtNmenu, instance->info->val); 142 Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
143 XtSetArg (al [1], XtNhorizontal, False); 143 Xt_SET_ARG (al [1], XtNhorizontal, False);
144 widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass, 144 widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
145 popup_shell, al, 2); 145 popup_shell, al, 2);
146 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); 146 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
147 147
148 return popup_shell; 148 return popup_shell;
232 static XtCallbackRec callbacks[2] = 232 static XtCallbackRec callbacks[2] =
233 { {xlw_scrollbar_callback, NULL}, {NULL, NULL} }; 233 { {xlw_scrollbar_callback, NULL}, {NULL, NULL} };
234 234
235 callbacks[0].closure = (XtPointer) instance; 235 callbacks[0].closure = (XtPointer) instance;
236 236
237 XtSetArg (al[ac], XmNminimum, 1); ac++; 237 Xt_SET_ARG (al[ac], XmNminimum, 1); ac++;
238 XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++; 238 Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++;
239 XtSetArg (al[ac], XmNincrement, 1); ac++; 239 Xt_SET_ARG (al[ac], XmNincrement, 1); ac++;
240 XtSetArg (al[ac], XmNpageIncrement, 1); ac++; 240 Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++;
241 XtSetArg (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++; 241 Xt_SET_ARG (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
242 242
243 XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++; 243 Xt_SET_ARG (al[ac], XmNdecrementCallback, callbacks); ac++;
244 XtSetArg (al[ac], XmNdragCallback, callbacks); ac++; 244 Xt_SET_ARG (al[ac], XmNdragCallback, callbacks); ac++;
245 XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++; 245 Xt_SET_ARG (al[ac], XmNincrementCallback, callbacks); ac++;
246 XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++; 246 Xt_SET_ARG (al[ac], XmNpageDecrementCallback, callbacks); ac++;
247 XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++; 247 Xt_SET_ARG (al[ac], XmNpageIncrementCallback, callbacks); ac++;
248 XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++; 248 Xt_SET_ARG (al[ac], XmNtoBottomCallback, callbacks); ac++;
249 XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++; 249 Xt_SET_ARG (al[ac], XmNtoTopCallback, callbacks); ac++;
250 XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++; 250 Xt_SET_ARG (al[ac], XmNvalueChangedCallback, callbacks); ac++;
251 251
252 return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass, 252 return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass,
253 instance->parent, al, ac); 253 instance->parent, al, ac);
254 } 254 }
255 255
276 int new_sliderSize, new_value; 276 int new_sliderSize, new_value;
277 double percent; 277 double percent;
278 Arg al [4]; 278 Arg al [4];
279 279
280 /* First size and position the scrollbar widget. */ 280 /* First size and position the scrollbar widget. */
281 XtSetArg (al [0], XtNx, data->scrollbar_x); 281 Xt_SET_ARG (al [0], XtNx, data->scrollbar_x);
282 XtSetArg (al [1], XtNy, data->scrollbar_y); 282 Xt_SET_ARG (al [1], XtNy, data->scrollbar_y);
283 XtSetArg (al [2], XtNwidth, data->scrollbar_width); 283 Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width);
284 XtSetArg (al [3], XtNheight, data->scrollbar_height); 284 Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
285 XtSetValues (widget, al, 4); 285 XtSetValues (widget, al, 4);
286 286
287 /* Now size the scrollbar's slider. */ 287 /* Now size the scrollbar's slider. */
288 XtSetArg (al [0], XmNsliderSize, &widget_sliderSize); 288 Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
289 XtSetArg (al [1], XmNvalue, &widget_val); 289 Xt_SET_ARG (al [1], XmNvalue, &widget_val);
290 XtGetValues (widget, al, 2); 290 XtGetValues (widget, al, 2);
291 291
292 percent = (double) data->slider_size / 292 percent = (double) data->slider_size /
293 (double) (data->maximum - data->minimum); 293 (double) (data->maximum - data->minimum);
294 percent = (percent > 1.0 ? 1.0 : percent); 294 percent = (percent > 1.0 ? 1.0 : percent);
380 Arg al[20]; 380 Arg al[20];
381 int ac = 0; 381 int ac = 0;
382 Widget tab = 0; 382 Widget tab = 0;
383 widget_value* val = instance->info->val; 383 widget_value* val = instance->info->val;
384 384
385 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; 385 Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
386 XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++; 386 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++;
387 XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; 387 Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++;
388 388
389 /* add any args the user supplied for creation time */ 389 /* add any args the user supplied for creation time */
390 lw_add_value_args_to_args (val, al, &ac); 390 lw_add_value_args_to_args (val, al, &ac);
391 391
392 tab = XtCreateManagedWidget (val->name, tabsWidgetClass, 392 tab = XtCreateManagedWidget (val->name, tabsWidgetClass,
404 { 404 {
405 widget_value* cur = val; 405 widget_value* cur = val;
406 Arg al[1]; 406 Arg al[1];
407 407
408 /* Children are always invisible, don't permit resizing. */ 408 /* Children are always invisible, don't permit resizing. */
409 XtSetArg (al[0], XtNresizable, False); 409 Xt_SET_ARG (al[0], XtNresizable, False);
410 410
411 for (cur = val; cur; cur = cur->next) 411 for (cur = val; cur; cur = cur->next)
412 { 412 {
413 if (cur->value) 413 if (cur->value)
414 { 414 {
477 Arg al[20]; 477 Arg al[20];
478 int ac = 0; 478 int ac = 0;
479 Widget clip = 0; 479 Widget clip = 0;
480 widget_value* val = instance->info->val; 480 widget_value* val = instance->info->val;
481 481
482 XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++; 482 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++;
483 XtSetArg (al [ac], XtNsensitive, True); ac++; 483 Xt_SET_ARG (al [ac], XtNsensitive, True); ac++;
484 /* add any args the user supplied for creation time */ 484 /* add any args the user supplied for creation time */
485 lw_add_value_args_to_args (val, al, &ac); 485 lw_add_value_args_to_args (val, al, &ac);
486 486
487 /* Create a clip window to contain the subwidget. Incredibly the 487 /* Create a clip window to contain the subwidget. Incredibly the
488 XEmacs manager seems to be the most appropriate widget for 488 XEmacs manager seems to be the most appropriate widget for
555 ; 555 ;
556 #ifdef LWLIB_MENUBARS_LUCID 556 #ifdef LWLIB_MENUBARS_LUCID
557 else if (class_ == xlwMenuWidgetClass) 557 else if (class_ == xlwMenuWidgetClass)
558 { 558 {
559 XlwMenuWidget mw; 559 XlwMenuWidget mw;
560 Arg al [1];
561 if (XtIsShell (widget)) 560 if (XtIsShell (widget))
562 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0]; 561 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
563 else 562 else
564 mw = (XlwMenuWidget)widget; 563 mw = (XlwMenuWidget)widget;
565 XtSetArg (al [0], XtNmenu, val); 564 Xt_SET_VALUE (widget, XtNmenu, val); /* #### mw unused! */
566 XtSetValues (widget, al, 1); /* #### mw unused! */
567 } 565 }
568 #endif 566 #endif
569 #ifdef LWLIB_SCROLLBARS_LUCID 567 #ifdef LWLIB_SCROLLBARS_LUCID
570 else if (class_ == xlwScrollBarWidgetClass) 568 else if (class_ == xlwScrollBarWidgetClass)
571 { 569 {