diff options
Diffstat (limited to 'src/widget.c')
| -rw-r--r-- | src/widget.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/src/widget.c b/src/widget.c index 6d871ad7cb2..0cb1013b971 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* The emacs frame widget. | 1 | /* The emacs frame widget. |
| 2 | Copyright (C) 1992-1993, 2000-2011 Free Software Foundation, Inc. | 2 | Copyright (C) 1992-1993, 2000-2012 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -86,12 +86,12 @@ static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry | |||
| 86 | #undef XtOffset | 86 | #undef XtOffset |
| 87 | #define XtOffset(p_type,field) \ | 87 | #define XtOffset(p_type,field) \ |
| 88 | ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) | 88 | ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0))) |
| 89 | #define offset(field) XtOffset(EmacsFrame, emacs_frame.field) | 89 | #define offset(field) XtOffset (EmacsFrame, emacs_frame.field) |
| 90 | 90 | ||
| 91 | static XtResource resources[] = { | 91 | static XtResource resources[] = { |
| 92 | {XtNgeometry, XtCGeometry, XtRString, sizeof(String), | 92 | {XtNgeometry, XtCGeometry, XtRString, sizeof (String), |
| 93 | offset (geometry), XtRString, (XtPointer) 0}, | 93 | offset (geometry), XtRString, (XtPointer) 0}, |
| 94 | {XtNiconic, XtCIconic, XtRBoolean, sizeof(Boolean), | 94 | {XtNiconic, XtCIconic, XtRBoolean, sizeof (Boolean), |
| 95 | offset (iconic), XtRImmediate, (XtPointer) False}, | 95 | offset (iconic), XtRImmediate, (XtPointer) False}, |
| 96 | 96 | ||
| 97 | {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer), | 97 | {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer), |
| @@ -105,12 +105,12 @@ static XtResource resources[] = { | |||
| 105 | offset (internal_border_width), XtRImmediate, (XtPointer)4}, | 105 | offset (internal_border_width), XtRImmediate, (XtPointer)4}, |
| 106 | {XtNinterline, XtCInterline, XtRInt, sizeof (int), | 106 | {XtNinterline, XtCInterline, XtRInt, sizeof (int), |
| 107 | offset (interline), XtRImmediate, (XtPointer)0}, | 107 | offset (interline), XtRImmediate, (XtPointer)0}, |
| 108 | {XtNfont, XtCFont, XtRFontStruct, sizeof(struct font *), | 108 | {XtNfont, XtCFont, XtRFontStruct, sizeof (struct font *), |
| 109 | offset(font),XtRString, DEFAULT_FACE_FONT}, | 109 | offset (font),XtRString, DEFAULT_FACE_FONT}, |
| 110 | {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), | 110 | {XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel), |
| 111 | offset(foreground_pixel), XtRString, "XtDefaultForeground"}, | 111 | offset (foreground_pixel), XtRString, "XtDefaultForeground"}, |
| 112 | {XtNcursorColor, XtCForeground, XtRPixel, sizeof(Pixel), | 112 | {XtNcursorColor, XtCForeground, XtRPixel, sizeof (Pixel), |
| 113 | offset(cursor_color), XtRString, "XtDefaultForeground"}, | 113 | offset (cursor_color), XtRString, "XtDefaultForeground"}, |
| 114 | {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean), | 114 | {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean), |
| 115 | offset (bar_cursor), XtRImmediate, (XtPointer)0}, | 115 | offset (bar_cursor), XtRImmediate, (XtPointer)0}, |
| 116 | {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean), | 116 | {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean), |
| @@ -141,7 +141,7 @@ static EmacsFrameClassRec emacsFrameClassRec = { | |||
| 141 | { /* core fields */ | 141 | { /* core fields */ |
| 142 | /* superclass */ &widgetClassRec, | 142 | /* superclass */ &widgetClassRec, |
| 143 | /* class_name */ "EmacsFrame", | 143 | /* class_name */ "EmacsFrame", |
| 144 | /* widget_size */ sizeof(EmacsFrameRec), | 144 | /* widget_size */ sizeof (EmacsFrameRec), |
| 145 | /* class_initialize */ 0, | 145 | /* class_initialize */ 0, |
| 146 | /* class_part_initialize */ 0, | 146 | /* class_part_initialize */ 0, |
| 147 | /* class_inited */ FALSE, | 147 | /* class_inited */ FALSE, |
| @@ -151,7 +151,7 @@ static EmacsFrameClassRec emacsFrameClassRec = { | |||
| 151 | /* actions */ 0, /*emacsFrameActionsTable*/ | 151 | /* actions */ 0, /*emacsFrameActionsTable*/ |
| 152 | /* num_actions */ 0, /*XtNumber (emacsFrameActionsTable)*/ | 152 | /* num_actions */ 0, /*XtNumber (emacsFrameActionsTable)*/ |
| 153 | /* resources */ resources, | 153 | /* resources */ resources, |
| 154 | /* resource_count */ XtNumber(resources), | 154 | /* resource_count */ XtNumber (resources), |
| 155 | /* xrm_class */ NULLQUARK, | 155 | /* xrm_class */ NULLQUARK, |
| 156 | /* compress_motion */ TRUE, | 156 | /* compress_motion */ TRUE, |
| 157 | /* compress_exposure */ TRUE, | 157 | /* compress_exposure */ TRUE, |
| @@ -224,8 +224,7 @@ get_wm_shell (Widget w) | |||
| 224 | #if 0 /* Currently not used. */ | 224 | #if 0 /* Currently not used. */ |
| 225 | 225 | ||
| 226 | static void | 226 | static void |
| 227 | mark_shell_size_user_specified (wmshell) | 227 | mark_shell_size_user_specified (Widget wmshell) |
| 228 | Widget wmshell; | ||
| 229 | { | 228 | { |
| 230 | if (! XtIsWMShell (wmshell)) abort (); | 229 | if (! XtIsWMShell (wmshell)) abort (); |
| 231 | /* This is kind of sleazy, but I can't see how else to tell it to make it | 230 | /* This is kind of sleazy, but I can't see how else to tell it to make it |
| @@ -477,6 +476,9 @@ update_wm_hints (EmacsFrame ew) | |||
| 477 | int base_height; | 476 | int base_height; |
| 478 | int min_rows = 0, min_cols = 0; | 477 | int min_rows = 0, min_cols = 0; |
| 479 | 478 | ||
| 479 | /* This happens when the frame is just created. */ | ||
| 480 | if (! wmshell) return; | ||
| 481 | |||
| 480 | #if 0 | 482 | #if 0 |
| 481 | check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); | 483 | check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); |
| 482 | #endif | 484 | #endif |
| @@ -507,11 +509,18 @@ update_wm_hints (EmacsFrame ew) | |||
| 507 | NULL); | 509 | NULL); |
| 508 | } | 510 | } |
| 509 | 511 | ||
| 512 | void | ||
| 513 | widget_update_wm_size_hints (Widget widget) | ||
| 514 | { | ||
| 515 | EmacsFrame ew = (EmacsFrame)widget; | ||
| 516 | update_wm_hints (ew); | ||
| 517 | } | ||
| 518 | |||
| 519 | |||
| 510 | #if 0 | 520 | #if 0 |
| 511 | 521 | ||
| 512 | static void | 522 | static void |
| 513 | create_frame_gcs (ew) | 523 | create_frame_gcs (EmacsFrame ew) |
| 514 | EmacsFrame ew; | ||
| 515 | { | 524 | { |
| 516 | struct frame *s = ew->emacs_frame.frame; | 525 | struct frame *s = ew->emacs_frame.frame; |
| 517 | 526 | ||
| @@ -576,7 +585,7 @@ setup_frame_gcs (EmacsFrame ew) | |||
| 576 | never actually get used as a background tile! | 585 | never actually get used as a background tile! |
| 577 | */ | 586 | */ |
| 578 | blank_tile | 587 | blank_tile |
| 579 | = XCreatePixmapFromBitmapData (XtDisplay(ew), | 588 | = XCreatePixmapFromBitmapData (XtDisplay (ew), |
| 580 | RootWindowOfScreen (XtScreen (ew)), | 589 | RootWindowOfScreen (XtScreen (ew)), |
| 581 | setup_frame_cursor_bits, 2, 2, | 590 | setup_frame_cursor_bits, 2, 2, |
| 582 | 0, 1, ew->core.depth); | 591 | 0, 1, ew->core.depth); |
| @@ -810,7 +819,7 @@ EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeome | |||
| 810 | return result->request_mode ? XtGeometryAlmost : XtGeometryYes; | 819 | return result->request_mode ? XtGeometryAlmost : XtGeometryYes; |
| 811 | } | 820 | } |
| 812 | 821 | ||
| 813 | /* Special entrypoints */ | 822 | /* Special entry points */ |
| 814 | void | 823 | void |
| 815 | EmacsFrameSetCharSize (Widget widget, int columns, int rows) | 824 | EmacsFrameSetCharSize (Widget widget, int columns, int rows) |
| 816 | { | 825 | { |