1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
/* $XConsortium: IconH.c /main/5 1995/07/15 20:52:17 drk $ */
/*
* Motif
*
* Copyright (c) 1987-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
*/
/*
* HISTORY
*/
/*
* IconH.c: The IconHeader widget methods.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <Xm/IconHP.h>
/******** Static Function Declarations ********/
static void ClassPartInitialize(
WidgetClass wc);
static Widget GetContainerParent(Widget);
/******** End Static Function Declarations ********/
static XtResource resources[] =
{
{
XmNcontainerID,XmCContainerID,XmRWidget,
sizeof(Widget),
XtOffset(XmIconHeader,iconh.container_ID),
XmRImmediate,(XtPointer)NULL},
};
/* That should not be necessary, but inheriting extension is
not very well understood yet */
static XmGadgetClassExtRec GadClassExtRec = {
NULL,
NULLQUARK,
XmGadgetClassExtVersion,
sizeof(XmGadgetClassExtRec),
XmInheritBaselineProc, /* widget_baseline */
XmInheritDisplayRectProc, /* widget_display_rect */
XmInheritMarginsProc, /* widget_margins */
};
externaldef( xmiconheaderclassrec) XmIconHeaderClassRec xmIconHeaderClassRec =
{ /* RectObjClassPart */
{
(WidgetClass) &xmIconGadgetClassRec, /* superclass */
"XmIconHeader", /* class_name */
sizeof (XmIconHeaderRec), /* widget_size */
NULL, /* class_initialize */
ClassPartInitialize, /* class_part_initialize*/
False, /* class_inited */
NULL, /* initialize */
NULL, /* initialize_hook */
NULL, /* realize */
NULL, /* actions */
0, /* num_actions */
resources, /* resources */
XtNumber (resources), /* num_resources */
NULLQUARK, /* xrm_class */
True, /* compress_motion */
True, /* compress_exposure */
True, /* compress_enterleave */
False, /* visible_interest */
NULL, /* destroy */
NULL, /* resize */
XtInheritExpose, /* expose */
NULL, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback private */
NULL, /* tm_table */
XtInheritQueryGeometry, /* query_geometry */
NULL, /* display_accelerator */
NULL, /* extension */
},
/* XmGadget Class Part */
{
XmInheritBorderHighlight, /* border_highlight */
XmInheritBorderUnhighlight, /* border_unhighlight */
NULL, /* arm_and_activate */
XmInheritInputDispatch, /* input_dispatch */
XmInheritVisualChange, /* visual_change */
NULL, /* get_resources */
0, /* num_get_resources */
NULL, /* class_cache_part */
(XtPointer)&GadClassExtRec, /* extension */
},
/* XmIconGadget Class Part */
{
GetContainerParent, /* get_container_parent */
NULL, /* extension */
},
/* XmIconHeader Class Part */
{
NULL, /* extension */
},
};
externaldef(xmiconheaderclass) WidgetClass
xmIconHeaderClass=(WidgetClass)&xmIconHeaderClassRec;
/*----------------
| RectObj methods |
----------------*/
/************************************************************************
* ClassPartInitialize
* Parms(IconGadgetClass)
* returns void
*
* Set Motif Fast subclass initialize bit.
************************************************************************/
static void
ClassPartInitialize(
WidgetClass wc)
{
_XmFastSubclassInit(wc,XmICONHEADER_BIT);
}
/************************************************************************
* GetContainerParent class method
*
************************************************************************/
static Widget
GetContainerParent(
Widget wid)
{
return (((XmIconHeader)(wid))->iconh.container_ID);
}
/*-------------------
| External functions |
-------------------*/
/************************************************************************
* XmCreateIconHeader
*
* Create an instance of a xmIconHeaderClass widget and
* return it's id.
************************************************************************/
Widget
XmCreateIconHeader(
Widget parent,
char *name,
ArgList arglist,
Cardinal argcount)
{
return(XtCreateWidget(name,xmIconHeaderClass,parent,arglist,argcount));
}
|