comparison src/EmacsFrame.c @ 4521:383ab474a241

Fix docstring typo.
author Stephen J. Turnbull <stephen@xemacs.org>
date Tue, 28 Oct 2008 10:38:26 +0900
parents 374186f156d5
children fc7067b7f407
comparison
equal deleted inserted replaced
4520:279cadceaa13 4521:383ab474a241
41 41
42 #include <X11/Shell.h> 42 #include <X11/Shell.h>
43 #include "EmacsFrameP.h" 43 #include "EmacsFrameP.h"
44 #include "EmacsManager.h" /* for EmacsManagerChangeSize */ 44 #include "EmacsManager.h" /* for EmacsManagerChangeSize */
45 #include "xmu.h" 45 #include "xmu.h"
46 #include "../lwlib/xt-wrappers.h"
46 47
47 static void EmacsFrameClassInitialize (void); 48 static void EmacsFrameClassInitialize (void);
48 static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *); 49 static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *);
49 static void EmacsFrameRealize (Widget, XtValueMask*, XSetWindowAttributes*); 50 static void EmacsFrameRealize (Widget, XtValueMask*, XSetWindowAttributes*);
50 static void EmacsFrameResize (Widget widget); 51 static void EmacsFrameResize (Widget widget);
58 59
59 #undef XtOffset 60 #undef XtOffset
60 #define XtOffset(p_type,field) \ 61 #define XtOffset(p_type,field) \
61 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) 62 ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
62 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field) 63 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
63 64 #define res(name,_class,intrepr,type,member,extrepr,value) \
65 Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
64 static XtResource resources[] = { 66 static XtResource resources[] = {
65 { XtNgeometry, XtCGeometry, 67 res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0),
66 XtRString, sizeof (String), 68 res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, False),
67 offset (geometry), XtRString, (XtPointer) 0 }, 69
68 { XtNiconic, XtCIconic, 70 res (XtNemacsFrame, XtCEmacsFrame, XtRPointer, XtPointer,
69 XtRBoolean, sizeof (Boolean), 71 frame, XtRImmediate, 0),
70 offset (iconic), XtRImmediate, (XtPointer) False }, 72 res (XtNmenubar, XtCMenubar, XtRBoolean, Boolean,
71 73 menubar_p, XtRImmediate, True),
72 { XtNemacsFrame, XtCEmacsFrame, 74 res (XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, Boolean,
73 XtRPointer, sizeof (XtPointer), 75 initially_unmapped, XtRImmediate, False),
74 offset (frame), XtRImmediate, 0 }, 76 res (XtNminibuffer, XtCMinibuffer, XtRBoolean, Boolean,
75 { XtNmenubar, XtCMenubar, 77 minibuffer, XtRImmediate, True),
76 XtRBoolean, sizeof (Boolean), 78 res (XtNunsplittable, XtCUnsplittable, XtRBoolean, Boolean,
77 offset (menubar_p), XtRImmediate, (XtPointer) True }, 79 unsplittable, XtRImmediate, False),
78 { XtNinitiallyUnmapped, XtCInitiallyUnmapped, 80 res (XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, int,
79 XtRBoolean, sizeof (Boolean), 81 internal_border_width, XtRImmediate, 4),
80 offset (initially_unmapped), XtRImmediate, (XtPointer) False },
81 { XtNminibuffer, XtCMinibuffer,
82 XtRBoolean, sizeof (Boolean),
83 offset (minibuffer), XtRImmediate, (XtPointer) True },
84 { XtNunsplittable, XtCUnsplittable,
85 XtRBoolean, sizeof (Boolean),
86 offset (unsplittable), XtRImmediate, (XtPointer) False },
87 { XtNinternalBorderWidth, XtCInternalBorderWidth,
88 XtRInt, sizeof (int),
89 offset (internal_border_width), XtRImmediate, (XtPointer)4 },
90 #ifdef HAVE_SCROLLBARS 82 #ifdef HAVE_SCROLLBARS
91 { XtNscrollBarWidth, XtCScrollBarWidth, 83 res (XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, int,
92 XtRInt, sizeof (int), 84 scrollbar_width, XtRImmediate, -1),
93 offset (scrollbar_width), XtRImmediate, (XtPointer)-1 }, 85 res (XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, int,
94 { XtNscrollBarHeight, XtCScrollBarHeight, 86 scrollbar_height, XtRImmediate, -1),
95 XtRInt, sizeof (int), 87 res (XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement,
96 offset (scrollbar_height), XtRImmediate, (XtPointer)-1 }, 88 unsigned char, scrollbar_placement, XtRImmediate,
97 { XtNscrollBarPlacement, XtCScrollBarPlacement,
98 XtRScrollBarPlacement, sizeof (unsigned char),
99 offset (scrollbar_placement), XtRImmediate,
100 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ 89 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
101 defined (LWLIB_SCROLLBARS_ATHENA3D) 90 defined (LWLIB_SCROLLBARS_ATHENA3D)
102 (XtPointer) XtBOTTOM_RIGHT 91 XtBOTTOM_RIGHT
103 #else 92 #else
104 (XtPointer) XtBOTTOM_LEFT 93 XtBOTTOM_LEFT
105 #endif 94 #endif
106 }, 95 ),
107 #endif /* HAVE_SCROLLBARS */ 96 #endif /* HAVE_SCROLLBARS */
108 97
109 #ifdef HAVE_TOOLBARS 98 #ifdef HAVE_TOOLBARS
110 { XtNtopToolBarHeight, XtCTopToolBarHeight, 99 res (XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, int,
111 XtRInt, sizeof (int), 100 top_toolbar_height, XtRImmediate, -1),
112 offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 }, 101 res (XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, int,
113 { XtNbottomToolBarHeight, XtCBottomToolBarHeight, 102 bottom_toolbar_height, XtRImmediate, -1),
114 XtRInt, sizeof (int), 103 res (XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, int,
115 offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 }, 104 left_toolbar_width, XtRImmediate, -1),
116 { XtNleftToolBarWidth, XtCLeftToolBarWidth, 105 res (XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, int,
117 XtRInt, sizeof (int), 106 right_toolbar_width, XtRImmediate, -1),
118 offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 }, 107 res (XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, int,
119 { XtNrightToolBarWidth, XtCRightToolBarWidth, 108 top_toolbar_border_width, XtRImmediate, -1),
120 XtRInt, sizeof (int), 109 res (XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, int,
121 offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 }, 110 bottom_toolbar_border_width, XtRImmediate, -1),
122 { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, 111 res (XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt,
123 XtRInt, sizeof (int), 112 int, left_toolbar_border_width, XtRImmediate, -1),
124 offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, 113 res (XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt,
125 { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, 114 int, right_toolbar_border_width, XtRImmediate, -1),
126 XtRInt, sizeof (int), 115 res (XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension,
127 offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 }, 116 Dimension, toolbar_shadow_thickness, XtRImmediate, 2),
128 { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth,
129 XtRInt, sizeof (int),
130 offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
131 { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth,
132 XtRInt, sizeof (int),
133 offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
134 { XtNtoolBarShadowThickness, XtCToolBarShadowThickness,
135 XtRDimension, sizeof (Dimension),
136 offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 },
137 #endif /* HAVE_TOOLBARS */ 117 #endif /* HAVE_TOOLBARS */
138 118
139 { XtNinterline, XtCInterline, 119 res (XtNinterline, XtCInterline, XtRInt, int,
140 XtRInt, sizeof (int), 120 interline, XtRImmediate, 0),
141 offset (interline), XtRImmediate, (XtPointer)0 }, 121 res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *,
142 { 122 font, XtRImmediate, 0),
143 XtNfont, XtCFont, 123 res (XtNforeground, XtCForeground, XtRPixel, Pixel,
144 XtRFontStruct, sizeof (XFontStruct *), 124 foreground_pixel, XtRString, "Black"),
145 offset(font), XtRImmediate, (XtPointer)0 125 res (XtNbackground, XtCBackground, XtRPixel, Pixel,
146 }, 126 background_pixel, XtRString, "Gray80"),
147 { XtNforeground, XtCForeground, 127 res (XtNcursorColor, XtCForeground, XtRPixel, Pixel,
148 XtRPixel, sizeof (Pixel), 128 cursor_color, XtRString, "XtDefaultForeground"),
149 offset(foreground_pixel), XtRString, (XtPointer) "Black" }, 129 res (XtNbarCursor, XtCBarCursor, XtRBoolean, Boolean,
150 { XtNbackground, XtCBackground, 130 bar_cursor, XtRImmediate, 0),
151 XtRPixel, sizeof (Pixel), 131 res (XtNvisualBell, XtCVisualBell, XtRBoolean, Boolean,
152 offset(background_pixel), XtRString, (XtPointer) "Gray80" }, 132 visual_bell, XtRImmediate, 0),
153 { XtNcursorColor, XtCForeground, 133 res (XtNbellVolume, XtCBellVolume, XtRInt, int,
154 XtRPixel, sizeof (Pixel), 134 bell_volume, XtRImmediate, 0),
155 offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" }, 135 res (XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, Boolean,
156 { XtNbarCursor, XtCBarCursor, 136 use_backing_store, XtRImmediate, 0),
157 XtRBoolean, sizeof (Boolean), 137 res (XtNpreferredWidth, XtCPreferredWidth, XtRDimension, Dimension,
158 offset (bar_cursor), XtRImmediate, (XtPointer)0 }, 138 preferred_width, XtRImmediate, 0),
159 { XtNvisualBell, XtCVisualBell, 139 res (XtNpreferredHeight, XtCPreferredHeight, XtRDimension, Dimension,
160 XtRBoolean, sizeof (Boolean), 140 preferred_height, XtRImmediate, 0),
161 offset (visual_bell), XtRImmediate, (XtPointer)0 },
162 { XtNbellVolume, XtCBellVolume,
163 XtRInt, sizeof (int),
164 offset (bell_volume), XtRImmediate, (XtPointer)0 },
165 { XtNuseBackingStore, XtCUseBackingStore,
166 XtRBoolean, sizeof (Boolean),
167 offset (use_backing_store), XtRImmediate, (XtPointer)0 },
168 { XtNpreferredWidth, XtCPreferredWidth,
169 XtRDimension, sizeof (Dimension),
170 offset (preferred_width), XtRImmediate, (XtPointer)0 },
171 { XtNpreferredHeight, XtCPreferredHeight,
172 XtRDimension, sizeof (Dimension),
173 offset (preferred_height), XtRImmediate, (XtPointer)0 },
174 }; 141 };
175 142
176 #undef offset 143 #undef offset
177 144
178 /* Xt is stupid and dumb. 145 /* Xt is stupid and dumb.
179 Xt is stupid and dumb. 146 Xt is stupid and dumb.
180 Xt is stupid and dumb. */ 147 Xt is stupid and dumb. */
181 148
182 static XtActionsRec 149 static XtActionsRec
183 emacsFrameActionsTable [] = { 150 emacsFrameActionsTable [] = {
184 {"mapping", (XtActionProc) emacs_Xt_mapping_action}, 151 { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action},
185 }; 152 };
186 153
187 static char 154 static char
188 emacsFrameTranslations [] = "\ 155 emacsFrameTranslations [] = "\
189 <Mapping>: mapping()\n\ 156 <Mapping>: mapping()\n\
198 #ifdef LWLIB_USES_MOTIF 165 #ifdef LWLIB_USES_MOTIF
199 /* superclass */ (WidgetClass) &xmPrimitiveClassRec, 166 /* superclass */ (WidgetClass) &xmPrimitiveClassRec,
200 #else 167 #else
201 /* superclass */ &widgetClassRec, 168 /* superclass */ &widgetClassRec,
202 #endif 169 #endif
203 /* class_name */ "EmacsFrame", 170 /* class_name */ (String) "EmacsFrame",
204 /* widget_size */ sizeof (EmacsFrameRec), 171 /* widget_size */ sizeof (EmacsFrameRec),
205 /* class_initialize */ EmacsFrameClassInitialize, 172 /* class_initialize */ EmacsFrameClassInitialize,
206 /* class_part_initialize */ 0, 173 /* class_part_initialize */ 0,
207 /* class_inited */ FALSE, 174 /* class_inited */ FALSE,
208 /* initialize */ EmacsFrameInitialize, 175 /* initialize */ EmacsFrameInitialize,
651 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) 618 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
652 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows); 619 x_wm_set_variable_size (FRAME_X_SHELL_WIDGET (f), columns, rows);
653 620
654 { 621 {
655 Arg al [2]; 622 Arg al [2];
656 XtSetArg (al [0], XtNwidth, pixel_width); 623 Xt_SET_ARG (al [0], XtNwidth, pixel_width);
657 XtSetArg (al [1], XtNheight, pixel_height); 624 Xt_SET_ARG (al [1], XtNheight, pixel_height);
658 XtSetValues ((Widget) ew, al, countof (al)); 625 XtSetValues ((Widget) ew, al, countof (al));
659 } 626 }
660 } 627 }