comparison lwlib/xlwmenu.c @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children bcdc7deadc19
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
63 offset(menu.fallback_font_list), 63 offset(menu.fallback_font_list),
64 /* We must use an iso8859-1 font here, or people without $LANG set lose. 64 /* We must use an iso8859-1 font here, or people without $LANG set lose.
65 It's fair to assume that those who do have $LANG set also have the 65 It's fair to assume that those who do have $LANG set also have the
66 *fontList resource set, or at least know how to deal with this. 66 *fontList resource set, or at least know how to deal with this.
67 */ 67 */
68 XtRString, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"}, 68 XtRString, (String) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
69 #else 69 #else
70 {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), 70 {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
71 offset(menu.font),XtRString, "XtDefaultFont"}, 71 offset(menu.font), XtRString, "XtDefaultFont"},
72 #endif 72 #endif
73 {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), 73 {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
74 offset(menu.foreground), XtRString, "XtDefaultForeground"}, 74 offset(menu.foreground), XtRString, (String) "XtDefaultForeground"},
75 {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel), 75 {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel),
76 offset(menu.button_foreground), XtRString, "XtDefaultForeground"}, 76 offset(menu.button_foreground), XtRString, (String)"XtDefaultForeground"},
77 {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension), 77 {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension),
78 offset(menu.margin), XtRImmediate, (XtPointer)2}, 78 offset(menu.margin), XtRImmediate, (XtPointer)2},
79 {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), 79 {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension),
80 offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2}, 80 offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2},
81 {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), 81 {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension),
137 #endif 137 #endif
138 138
139 static XtActionsRec 139 static XtActionsRec
140 xlwMenuActionsList [] = 140 xlwMenuActionsList [] =
141 { 141 {
142 {"start", Start}, 142 {(String) "start", Start},
143 {"drag", Drag}, 143 {(String) "drag", Drag},
144 {"select", Select}, 144 {(String) "select", Select},
145 }; 145 };
146 146
147 #define SuperClass ((CoreWidgetClass)&coreClassRec) 147 #define SuperClass ((CoreWidgetClass)&coreClassRec)
148 148
149 XlwMenuClassRec xlwMenuClassRec = 149 XlwMenuClassRec xlwMenuClassRec =
150 { 150 {
151 { /* CoreClass fields initialization */ 151 { /* CoreClass fields initialization */
152 (WidgetClass) SuperClass, /* superclass */ 152 (WidgetClass) SuperClass, /* superclass */
153 "XlwMenu", /* class_name */ 153 (String) "XlwMenu", /* class_name */
154 sizeof(XlwMenuRec), /* size */ 154 sizeof(XlwMenuRec), /* size */
155 XlwMenuClassInitialize, /* class_initialize */ 155 XlwMenuClassInitialize, /* class_initialize */
156 NULL, /* class_part_initialize */ 156 NULL, /* class_part_initialize */
157 FALSE, /* class_inited */ 157 FALSE, /* class_inited */
158 XlwMenuInitialize, /* initialize */ 158 XlwMenuInitialize, /* initialize */
365 For example: 365 For example:
366 366
367 "Kill Buffer" -> "killBuffer" 367 "Kill Buffer" -> "killBuffer"
368 "Find File..." -> "findFile" 368 "Find File..." -> "findFile"
369 "Search and Replace..." -> "searchAndReplace" 369 "Search and Replace..." -> "searchAndReplace"
370 "C++ Mode Commands" -> "cppModeCommands"
370 */ 371 */
371 372
372 # define GOOD_CHAR(c) (((c) >= 'a' && (c) <= 'z') || \ 373 # define GOOD_CHAR(c) (((c) >= 'a' && (c) <= 'z') || \
373 ((c) >= 'A' && (c) <= 'Z') || \ 374 ((c) >= 'A' && (c) <= 'Z') || \
374 ((c) >= '0' && (c) <= '9') || \ 375 ((c) >= '0' && (c) <= '9') || \
391 *out = *in; 392 *out = *in;
392 in++; 393 in++;
393 out++; 394 out++;
394 } 395 }
395 } 396 }
397 else if ((unsigned char)*in == '+')
398 {
399 /* for char '+' convert to 'P', e.g for C++ to cPP */
400 *out = 'P';
401 in++;
402 out++;
403 }
396 else 404 else
397 { 405 {
398 /* A bogus char between words; skip it. */ 406 /* A bogus char between words; skip it. */
399 in++; 407 in++;
400 } 408 }
401 } 409 }
410
411 /* Add the following define to --cflags to generate a translation
412 file for menu localizations */
413 #ifdef PRINT_XLWMENU_RESOURCE_CONVERSIONS
414 printf("Emacs*XlwMenu.%s.labelString:\t%s\n", outpointer, inpointer);
415 #endif
402 *out = 0; 416 *out = 0;
403 #undef GOOD_CHAR 417 #undef GOOD_CHAR
404 } 418 }
405 419
406 static XtResource 420 static XtResource
407 nameResource[] = 421 nameResource[] =
408 { 422 {
409 { "labelString", "LabelString", XtRString, sizeof(String), 423 { (String) "labelString", (String) "LabelString", XtRString, sizeof(String),
410 0, XtRImmediate, 0 } 424 0, XtRImmediate, 0 }
411 }; 425 };
412 426
413 /* 427 /*
414 * This function looks through string searching for parameter 428 * This function looks through string searching for parameter