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