+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $XConsortium: PrinterBox.c /main/10 1996/11/20 12:59:48 cde-hp $ */
/*
* dtpdm/PrinterBox.c
*/
static SizeCtl* SizeCtlNew();
static void SizeCtlDelete(SizeCtl* me);
-static int SizeCtlStrColl(void* e1, void* e2);
+static int SizeCtlStrColl(const void* e1, const void* e2);
static void SizeCtlSetSizeLists(PdmOidList** oids,
XmStringTable* xmstrs,
PdmOidLinkedList* oids_ll);
PdmPrinterBoxData* data = (PdmPrinterBoxData*)me->subclass_data;
const char* strval;
PdmOidMediumSS* medium_ss_supported;
- PdmOidTrayMediumList* input_trays_medium;
+ PdmOidTrayMediumList* input_trays_medium = NULL;
+#if 0 && defined(PRINTING_SUPPORTED)
/*
* printer model description
*/
strval = PdmXpGetStringValue(pdm_xp, XPDocAttr,
pdmoid_att_document_format);
data->document_format = PdmOidDocumentFormatParse(strval);
+#endif /* PRINTING_SUPPORTED */
if((char*)NULL == data->document_format)
{
/*
* document format not specified, try to obtain
* document-formats-supported, and obtain up the default from it
*/
+#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPPrinterAttr,
pdmoid_att_document_formats_supported);
data->document_format = PdmOidDocumentFormatDefault(strval);
+#endif /* PRINTING_SUPPORTED */
}
/*
* document attributes supported
*/
+#if 0 && defined(PRINTING_SUPPORTED)
strval = PdmXpGetStringValue(pdm_xp, XPPrinterAttr,
pdmoid_att_document_attributes_supported);
data->document_attrs_supported = PdmOidListNew(strval);
*/
PdmOidMediumSSDelete(medium_ss_supported);
PdmOidTrayMediumListDelete(input_trays_medium);
+#endif /* PRINTING_SUPPORTED */
}
/*
static void
PdmPrinterBoxSetAttr(PdmSetupBox* me, PdmXp* pdm_xp)
{
+#if 0 && defined(PRINTING_SUPPORTED)
PdmPrinterBoxData* data = (PdmPrinterBoxData*)me->subclass_data;
/*
* orientation
*/
PdmXpSetValue(pdm_xp, XPDocAttr, pdmoid_att_default_input_tray,
TrayCtlGetTray(data->tray_ctl));
+#endif /* PRINTING_SUPPORTED */
}
/*
PdmSetupBox* me = (PdmSetupBox*)client_data;
PdmPrinterBoxData* data = (PdmPrinterBoxData*)me->subclass_data;
typedef struct {
- Position x, y;
- Dimension width, height;
+ XtArgVal /* Position */ x, y;
+ XtArgVal /* Dimension */ width, height;
} PdmRect;
PdmRect rt, rs, ro, rp, c1, c2, r1, r2;
/*
OrientCtlResizeCB(Widget w, XtPointer client_data, XtPointer call_data)
{
OrientCtl* me = (OrientCtl*)client_data;
- Dimension height, width, margin_width, new_width;
- Position menu_x, menu_y, icon_x, icon_y;
- Dimension menu_h, menu_w, icon_h, icon_w;
+ XtArgVal /* Dimension */ height, width, margin_width, new_width;
+ XtArgVal /* Position */ menu_x, menu_y, icon_x, icon_y;
+ XtArgVal /* Dimension */ menu_h, menu_w, icon_h, icon_w;
/*
* get current layout info
*/
OrientCtlSelectCB(Widget w, XtPointer client_data, XtPointer call_data)
{
OrientCtl* me;
- int selected_item = (int)client_data;
+ XtArgVal /* int */ selected_item = (XtArgVal)client_data;
XtVaGetValues(w, XmNuserData, &me, NULL);
OrientCtlSetSelectedItem(me, selected_item);
PlexCtlResizeCB(Widget w, XtPointer client_data, XtPointer call_data)
{
PlexCtl* me = (PlexCtl*)client_data;
- Dimension height, width, margin_width, new_width;
- Position menu_x, menu_y, icon_x, icon_y;
- Dimension menu_h, menu_w, icon_h, icon_w;
+ XtArgVal /* Dimension */ height, width, margin_width, new_width;
+ XtArgVal /* Position */ menu_x, menu_y, icon_x, icon_y;
+ XtArgVal /* Dimension */ menu_h, menu_w, icon_h, icon_w;
/*
* get current layout info
*/
PlexCtlSelectCB(Widget w, XtPointer client_data, XtPointer call_data)
{
PlexCtl* me;
- int selected_item = (int)client_data;
+ XtArgVal /* int */ selected_item = (XtArgVal)client_data;
XtVaGetValues(w, XmNuserData, &me, NULL);
PlexCtlSetSelectedItem(me, selected_item);
TrayCtlResizeCB(Widget w, XtPointer client_data, XtPointer call_data)
{
TrayCtl* me = (TrayCtl*)client_data;
- Dimension height, menu_h;
- Position menu_y;
+ XtArgVal /* Dimension */ height, menu_h;
+ XtArgVal /* Position */ menu_y;
/*
* get current layout info
*/
TrayCtlSelectCB(Widget w, XtPointer client_data, XtPointer call_data)
{
TrayCtl* me;
- int selected_item = (int)client_data;
+ XtArgVal /* int */ selected_item = (XtArgVal)client_data;
XtVaGetValues(w, XmNuserData, &me, NULL);
TrayCtlSetSelectedItem(me, selected_item);
*
*/
static int
-SizeCtlStrColl(void* e1, void* e2)
+SizeCtlStrColl(const void* e1, const void* e2)
{
- SizeCtlSortRec *r1 = e1, *r2 = e2;
+ const SizeCtlSortRec *r1 = e1, *r2 = e2;
return strcoll(r1->str, r2->str);
}
SizeCtlResizeCB(Widget w, XtPointer client_data, XtPointer call_data)
{
SizeCtl* me = (SizeCtl*)client_data;
- Dimension height, width, margin_width, new_width;
- Position list_x, list_y, radio_x, radio_y;
- Dimension list_h, list_w, radio_h, radio_w;
+ XtArgVal /* Dimension */ height, width, margin_width, new_width;
+ XtArgVal /* Position */ list_x, list_y, radio_x, radio_y;
+ XtArgVal /* Dimension */ list_h, list_w, radio_h, radio_w;
Widget scrolled_list = XtParent(me->list_box);
/*
* get current layout info
NULL);
if(activate_proc != (XtCallbackProc)NULL)
XtAddCallback(button, XmNactivateCallback,
- activate_proc, (XtPointer)i);
+ activate_proc, (XtPointer)(XtArgVal)i);
if(i == initial_item)
initial_selected = button;
}
Dimension* max_width, Dimension* max_height)
{
Dimension width, height;
+ XtArgVal width0, height0;
/*
* set the pixmap in the label
*/
* get the label dimensions
*/
XtVaGetValues(icon_label,
- XmNwidth, &width,
- XmNheight, &height,
+ XmNwidth, &width0,
+ XmNheight, &height0,
NULL);
+ width = (Dimension)width0;
+ height = (Dimension)height0;
/*
* update the max dimensions
*/
Boolean stipple)
{
PdmPixmapList* me = (PdmPixmapList*)XtCalloc(1, sizeof(PdmPixmapList));
+ XtArgVal fg, bg;
me->pixmap = (Pixmap*)XtCalloc(count, sizeof(Pixmap));
me->image_name = (char**)XtCalloc(count, sizeof(char*));
me->stipple = None;
}
XtVaGetValues(w,
- XmNforeground, &me->foreground,
- XmNbackground, &me->background,
+ XmNforeground, &fg,
+ XmNbackground, &bg,
NULL);
+ me->foreground = (Pixel)fg;
+ me->background = (Pixel)bg;
return me;
}
static void
SetListBoxSelection(Widget list_box, int position)
{
+ XtArgVal visible_item_count0, item_count0;
int visible_item_count;
int item_count;
int middle_offset;
* it the initial selection.
*/
XtVaGetValues(list_box,
- XmNitemCount, &item_count,
- XmNvisibleItemCount, &visible_item_count,
+ XmNitemCount, &item_count0,
+ XmNvisibleItemCount, &visible_item_count0,
NULL);
+ item_count = (int)item_count0;
+ visible_item_count = (int)visible_item_count0;
if(item_count > visible_item_count)
{