Mercurial > hg > xemacs-beta
comparison src/EmacsFrame.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 74fd4e045ea6 |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
55 emacs_Xt_mapping_action (Widget w, XEvent* event); | 55 emacs_Xt_mapping_action (Widget w, XEvent* event); |
56 | 56 |
57 #undef XtOffset | 57 #undef XtOffset |
58 #define XtOffset(p_type,field) \ | 58 #define XtOffset(p_type,field) \ |
59 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) | 59 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) |
60 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field) | 60 #define offset(field) XtOffset(EmacsFrame, emacs_frame.field) |
61 | 61 |
62 static XtResource resources[] = { | 62 static XtResource resources[] = { |
63 { XtNgeometry, XtCGeometry, | 63 {XtNgeometry, XtCGeometry, XtRString, sizeof(String), |
64 XtRString, sizeof (String), | 64 offset (geometry), XtRString, (XtPointer) 0}, |
65 offset (geometry), XtRString, (XtPointer) 0 }, | 65 {XtNiconic, XtCIconic, XtRBoolean, sizeof(Boolean), |
66 { XtNiconic, XtCIconic, | 66 offset (iconic), XtRImmediate, (XtPointer) False}, |
67 XtRBoolean, sizeof (Boolean), | 67 |
68 offset (iconic), XtRImmediate, (XtPointer) False }, | 68 {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer), |
69 | 69 offset (frame), XtRImmediate, 0}, |
70 { XtNemacsFrame, XtCEmacsFrame, | 70 {XtNmenubar, XtCMenubar, XtRBoolean, sizeof (Boolean), |
71 XtRPointer, sizeof (XtPointer), | 71 offset (menubar_p), XtRImmediate, (XtPointer) True}, |
72 offset (frame), XtRImmediate, 0 }, | 72 {XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, sizeof (Boolean), |
73 { XtNmenubar, XtCMenubar, | 73 offset (initially_unmapped), XtRImmediate, (XtPointer) False}, |
74 XtRBoolean, sizeof (Boolean), | 74 {XtNminibuffer, XtCMinibuffer, XtRBoolean, sizeof (Boolean), |
75 offset (menubar_p), XtRImmediate, (XtPointer) True }, | 75 offset (minibuffer), XtRImmediate, (XtPointer) True}, |
76 { XtNinitiallyUnmapped, XtCInitiallyUnmapped, | 76 {XtNunsplittable, XtCUnsplittable, XtRBoolean, sizeof (Boolean), |
77 XtRBoolean, sizeof (Boolean), | 77 offset (unsplittable), XtRImmediate, (XtPointer) False}, |
78 offset (initially_unmapped), XtRImmediate, (XtPointer) False }, | 78 {XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, sizeof (int), |
79 { XtNminibuffer, XtCMinibuffer, | 79 offset (internal_border_width), XtRImmediate, (XtPointer)4}, |
80 XtRBoolean, sizeof (Boolean), | |
81 offset (minibuffer), XtRImmediate, (XtPointer) True }, | |
82 { XtNunsplittable, XtCUnsplittable, | |
83 XtRBoolean, sizeof (Boolean), | |
84 offset (unsplittable), XtRImmediate, (XtPointer) False }, | |
85 { XtNinternalBorderWidth, XtCInternalBorderWidth, | |
86 XtRInt, sizeof (int), | |
87 offset (internal_border_width), XtRImmediate, (XtPointer)4 }, | |
88 #ifdef HAVE_SCROLLBARS | 80 #ifdef HAVE_SCROLLBARS |
89 { XtNscrollBarWidth, XtCScrollBarWidth, | 81 {XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, sizeof (int), |
90 XtRInt, sizeof (int), | 82 offset (scrollbar_width), XtRImmediate, (XtPointer)-1}, |
91 offset (scrollbar_width), XtRImmediate, (XtPointer)-1 }, | 83 {XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, sizeof (int), |
92 { XtNscrollBarHeight, XtCScrollBarHeight, | 84 offset (scrollbar_height), XtRImmediate, (XtPointer)-1}, |
93 XtRInt, sizeof (int), | 85 {XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement, |
94 offset (scrollbar_height), XtRImmediate, (XtPointer)-1 }, | 86 sizeof(unsigned char), offset(scrollbar_placement), XtRImmediate, |
95 { XtNscrollBarPlacement, XtCScrollBarPlacement, | |
96 XtRScrollBarPlacement, sizeof (unsigned char), | |
97 offset (scrollbar_placement), XtRImmediate, | |
98 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ | 87 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ |
99 defined (LWLIB_SCROLLBARS_ATHENA3D) | 88 defined (LWLIB_SCROLLBARS_ATHENA3D) |
100 (XtPointer) XtBOTTOM_RIGHT | 89 (XtPointer) XtBOTTOM_RIGHT |
101 #else | 90 #else |
102 (XtPointer) XtBOTTOM_LEFT | 91 (XtPointer) XtBOTTOM_LEFT |
103 #endif | 92 #endif |
104 }, | 93 }, |
105 #endif /* HAVE_SCROLLBARS */ | 94 #endif /* HAVE_SCROLLBARS */ |
106 | |
107 #ifdef HAVE_TOOLBARS | 95 #ifdef HAVE_TOOLBARS |
108 { XtNtopToolBarHeight, XtCTopToolBarHeight, | 96 {XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, sizeof (int), |
109 XtRInt, sizeof (int), | 97 offset (top_toolbar_height), XtRImmediate, (XtPointer)-1}, |
110 offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 }, | 98 {XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, sizeof (int), |
111 { XtNbottomToolBarHeight, XtCBottomToolBarHeight, | 99 offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1}, |
112 XtRInt, sizeof (int), | 100 {XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, sizeof (int), |
113 offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 }, | 101 offset (left_toolbar_width), XtRImmediate, (XtPointer)-1}, |
114 { XtNleftToolBarWidth, XtCLeftToolBarWidth, | 102 {XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, sizeof (int), |
115 XtRInt, sizeof (int), | 103 offset (right_toolbar_width), XtRImmediate, (XtPointer)-1}, |
116 offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 }, | 104 {XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, |
117 { XtNrightToolBarWidth, XtCRightToolBarWidth, | 105 sizeof (int), |
118 XtRInt, sizeof (int), | 106 offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1}, |
119 offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 }, | 107 {XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, |
120 { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, | 108 sizeof (int), |
121 XtRInt, sizeof (int), | 109 offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1}, |
122 offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, | 110 {XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt, |
123 { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, | 111 sizeof (int), |
124 XtRInt, sizeof (int), | 112 offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1}, |
125 offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, | 113 {XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt, |
126 { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, | 114 sizeof (int), |
127 XtRInt, sizeof (int), | 115 offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1}, |
128 offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, | 116 {XtNtopToolBarShadowColor, XtCTopToolBarShadowColor, XtRPixel, sizeof(Pixel), |
129 { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, | 117 offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"}, |
130 XtRInt, sizeof (int), | 118 {XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor, XtRPixel, |
131 offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, | 119 sizeof(Pixel), offset(bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"}, |
132 { XtNtopToolBarShadowColor, XtCTopToolBarShadowColor, | 120 {XtNbackgroundToolBarColor, XtCBackgroundToolBarColor, XtRPixel, |
133 XtRPixel, sizeof (Pixel), | 121 sizeof(Pixel), offset(background_toolbar_pixel), XtRImmediate, |
134 offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" }, | 122 (XtPointer)-1}, |
135 { XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor, | 123 {XtNforegroundToolBarColor, XtCForegroundToolBarColor, XtRPixel, |
136 XtRPixel, sizeof (Pixel), | 124 sizeof(Pixel), offset(foreground_toolbar_pixel), XtRImmediate, |
137 offset (bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" }, | 125 (XtPointer)-1}, |
138 { XtNbackgroundToolBarColor, XtCBackgroundToolBarColor, | 126 {XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap, XtRPixmap, |
139 XtRPixel, sizeof (Pixel), | 127 sizeof (Pixmap), offset(top_toolbar_shadow_pixmap), XtRImmediate, |
140 offset (background_toolbar_pixel), XtRImmediate, (XtPointer)-1 }, | 128 (XtPointer)None}, |
141 { XtNforegroundToolBarColor, XtCForegroundToolBarColor, | 129 {XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap, XtRPixmap, |
142 XtRPixel, sizeof (Pixel), | 130 sizeof (Pixmap), offset(bottom_toolbar_shadow_pixmap), XtRImmediate, |
143 offset (foreground_toolbar_pixel), XtRImmediate, (XtPointer)-1 }, | 131 (XtPointer)None}, |
144 { XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap, | 132 {XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension, |
145 XtRPixmap, sizeof (Pixmap), | 133 sizeof (Dimension), offset (toolbar_shadow_thickness), XtRImmediate, |
146 offset (top_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None }, | 134 (XtPointer)2}, |
147 { XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap, | |
148 XtRPixmap, sizeof (Pixmap), | |
149 offset (bottom_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None }, | |
150 { XtNtoolBarShadowThickness, XtCToolBarShadowThickness, | |
151 XtRDimension, sizeof (Dimension), | |
152 offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 }, | |
153 #endif /* HAVE_TOOLBARS */ | 135 #endif /* HAVE_TOOLBARS */ |
154 | 136 {XtNinterline, XtCInterline, XtRInt, sizeof (int), |
155 { XtNinterline, XtCInterline, | 137 offset (interline), XtRImmediate, (XtPointer)0}, |
156 XtRInt, sizeof (int), | |
157 offset (interline), XtRImmediate, (XtPointer)0 }, | |
158 { | 138 { |
159 #ifdef I18N4 | 139 #ifdef I18N4 |
160 XtNfontSet, XtCFontSet, | 140 XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet), |
161 XtRFontSet, sizeof (XFontSet), | |
162 #else | 141 #else |
163 XtNfont, XtCFont, | 142 XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), |
164 XtRFontStruct, sizeof (XFontStruct *), | |
165 #endif | 143 #endif |
166 offset(font), XtRImmediate, (XtPointer)0 | 144 offset(font), XtRImmediate, (XtPointer)0 |
167 }, | 145 }, |
168 { XtNforeground, XtCForeground, | 146 {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), |
169 XtRPixel, sizeof (Pixel), | 147 offset(foreground_pixel), XtRString, (XtPointer) "Black"}, |
170 offset(foreground_pixel), XtRString, (XtPointer) "Black" }, | 148 {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel), |
171 { XtNbackground, XtCBackground, | 149 offset(background_pixel), XtRString, (XtPointer) "Gray80"}, |
172 XtRPixel, sizeof (Pixel), | 150 {XtNcursorColor, XtCForeground, XtRPixel, sizeof(Pixel), |
173 offset(background_pixel), XtRString, (XtPointer) "Gray80" }, | 151 offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground"}, |
174 { XtNcursorColor, XtCForeground, | 152 {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean), |
175 XtRPixel, sizeof (Pixel), | 153 offset (bar_cursor), XtRImmediate, (XtPointer)0}, |
176 offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" }, | 154 {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean), |
177 { XtNbarCursor, XtCBarCursor, | 155 offset (visual_bell), XtRImmediate, (XtPointer)0}, |
178 XtRBoolean, sizeof (Boolean), | 156 {XtNbellVolume, XtCBellVolume, XtRInt, sizeof (int), |
179 offset (bar_cursor), XtRImmediate, (XtPointer)0 }, | 157 offset (bell_volume), XtRImmediate, (XtPointer)0}, |
180 { XtNvisualBell, XtCVisualBell, | 158 {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean), |
181 XtRBoolean, sizeof (Boolean), | 159 offset (use_backing_store), XtRImmediate, (XtPointer)0}, |
182 offset (visual_bell), XtRImmediate, (XtPointer)0 }, | 160 {XtNpreferredWidth, XtCPreferredWidth, XtRDimension, sizeof (Dimension), |
183 { XtNbellVolume, XtCBellVolume, | 161 offset (preferred_width), XtRImmediate, (XtPointer)0}, |
184 XtRInt, sizeof (int), | 162 {XtNpreferredHeight, XtCPreferredHeight, XtRDimension, sizeof (Dimension), |
185 offset (bell_volume), XtRImmediate, (XtPointer)0 }, | 163 offset (preferred_height), XtRImmediate, (XtPointer)0}, |
186 { XtNuseBackingStore, XtCUseBackingStore, | |
187 XtRBoolean, sizeof (Boolean), | |
188 offset (use_backing_store), XtRImmediate, (XtPointer)0 }, | |
189 { XtNpreferredWidth, XtCPreferredWidth, | |
190 XtRDimension, sizeof (Dimension), | |
191 offset (preferred_width), XtRImmediate, (XtPointer)0 }, | |
192 { XtNpreferredHeight, XtCPreferredHeight, | |
193 XtRDimension, sizeof (Dimension), | |
194 offset (preferred_height), XtRImmediate, (XtPointer)0 }, | |
195 }; | 164 }; |
196 | 165 |
197 #undef offset | 166 #undef offset |
198 | 167 |
199 /* Xt is stupid and dumb. | 168 /* Xt is stupid and dumb. |
220 /* superclass */ (WidgetClass) &xmPrimitiveClassRec, | 189 /* superclass */ (WidgetClass) &xmPrimitiveClassRec, |
221 #else | 190 #else |
222 /* superclass */ &widgetClassRec, | 191 /* superclass */ &widgetClassRec, |
223 #endif | 192 #endif |
224 /* class_name */ "EmacsFrame", | 193 /* class_name */ "EmacsFrame", |
225 /* widget_size */ sizeof (EmacsFrameRec), | 194 /* widget_size */ sizeof(EmacsFrameRec), |
226 /* class_initialize */ EmacsFrameClassInitialize, | 195 /* class_initialize */ EmacsFrameClassInitialize, |
227 /* class_part_initialize */ 0, | 196 /* class_part_initialize */ 0, |
228 /* class_inited */ FALSE, | 197 /* class_inited */ FALSE, |
229 /* initialize */ EmacsFrameInitialize, | 198 /* initialize */ EmacsFrameInitialize, |
230 /* initialize_hook */ 0, | 199 /* initialize_hook */ 0, |
231 /* realize */ EmacsFrameRealize, | 200 /* realize */ EmacsFrameRealize, |
232 /* actions */ emacsFrameActionsTable, | 201 /* actions */ emacsFrameActionsTable, |
233 /* num_actions */ XtNumber (emacsFrameActionsTable), | 202 /* num_actions */ XtNumber (emacsFrameActionsTable), |
234 /* resources */ resources, | 203 /* resources */ resources, |
235 /* resource_count */ XtNumber (resources), | 204 /* resource_count */ XtNumber(resources), |
236 /* xrm_class */ NULLQUARK, | 205 /* xrm_class */ NULLQUARK, |
237 /* compress_motion */ TRUE, | 206 /* compress_motion */ TRUE, |
238 /* compress_exposure */ TRUE, | 207 /* compress_exposure */ TRUE, |
239 /* compress_enterleave */ TRUE, | 208 /* compress_enterleave */ TRUE, |
240 /* visible_interest */ FALSE, | 209 /* visible_interest */ FALSE, |
578 else | 547 else |
579 return XtGeometryYes; | 548 return XtGeometryYes; |
580 } | 549 } |
581 | 550 |
582 /* Xt string-to-scrollbar-placement converter */ | 551 /* Xt string-to-scrollbar-placement converter */ |
583 /* #### Convert this to a `new-style' converter (See XtAddTypeConverter) */ | 552 /* ### Convert this to a `new-style' converter (See XtAddTypeConverter) */ |
584 | 553 |
585 /* This variable cannot be a stack variable. */ | 554 /* This variable cannot be a stack variable. */ |
586 static unsigned char cvt_string_scrollbar_placement; | 555 static unsigned char cvt_string_scrollbar_placement; |
587 | 556 |
588 /* ARGSUSED */ | 557 /* ARGSUSED */ |