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