diff options
| author | Paul Reilly | 1994-10-02 13:29:03 +0000 |
|---|---|---|
| committer | Paul Reilly | 1994-10-02 13:29:03 +0000 |
| commit | 6c32dd68aaf22ac476fd76a5aec8445bf9ec592b (patch) | |
| tree | edca401d719a81a6a34705564299bf6207c7aad3 /src | |
| parent | 69524b98c04f34b7c94aad971cef4fd7a3d4ef3d (diff) | |
| download | emacs-6c32dd68aaf22ac476fd76a5aec8445bf9ec592b.tar.gz emacs-6c32dd68aaf22ac476fd76a5aec8445bf9ec592b.zip | |
(HACK_EDITRES): Declare if using X11R5.
(widget_id_tick): New variable.
(x_any_window_to_frame): Use lw_window_is_in_menubar() for
widget set independence.
(x_window): Renamed screen_widget to frame_widget. Use
lw_create_widget() and lw_set_main_areas() for widget set
independence. Enable using editres for X11R5.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/xfns.c b/src/xfns.c index 4255d7f2fec..846d636be1e 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -71,6 +71,16 @@ extern void abort (); | |||
| 71 | 71 | ||
| 72 | #include "../lwlib/lwlib.h" | 72 | #include "../lwlib/lwlib.h" |
| 73 | 73 | ||
| 74 | /* Do the EDITRES protocol if running X11R5 */ | ||
| 75 | #if (XtSpecificationRelease >= 5) | ||
| 76 | #define HACK_EDITRES | ||
| 77 | extern void _XEditResCheckMessages(); | ||
| 78 | #endif /* R5 + Athena */ | ||
| 79 | |||
| 80 | /* Unique id counter for widgets created by the Lucid Widget | ||
| 81 | Library. */ | ||
| 82 | extern LWLIB_ID widget_id_tick; | ||
| 83 | |||
| 74 | /* The one and only application context associated with the connection | 84 | /* The one and only application context associated with the connection |
| 75 | to the one and only X display that Emacs uses. */ | 85 | to the one and only X display that Emacs uses. */ |
| 76 | XtAppContext Xt_app_con; | 86 | XtAppContext Xt_app_con; |
| @@ -315,8 +325,7 @@ x_any_window_to_frame (wdesc) | |||
| 315 | || wdesc == XtWindow (x->edit_widget)) | 325 | || wdesc == XtWindow (x->edit_widget)) |
| 316 | return f; | 326 | return f; |
| 317 | /* Match if the window is this frame's menubar. */ | 327 | /* Match if the window is this frame's menubar. */ |
| 318 | if (x->menubar_widget | 328 | if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) |
| 319 | && wdesc == XtWindow (x->menubar_widget)) | ||
| 320 | return f; | 329 | return f; |
| 321 | } | 330 | } |
| 322 | return 0; | 331 | return 0; |
| @@ -1921,7 +1930,7 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 1921 | 1930 | ||
| 1922 | Widget shell_widget; | 1931 | Widget shell_widget; |
| 1923 | Widget pane_widget; | 1932 | Widget pane_widget; |
| 1924 | Widget screen_widget; | 1933 | Widget frame_widget; |
| 1925 | char* name; | 1934 | char* name; |
| 1926 | Arg al [25]; | 1935 | Arg al [25]; |
| 1927 | int ac; | 1936 | int ac; |
| @@ -1943,12 +1952,12 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 1943 | f->display.x->widget = shell_widget; | 1952 | f->display.x->widget = shell_widget; |
| 1944 | /* maybe_set_screen_title_format (shell_widget); */ | 1953 | /* maybe_set_screen_title_format (shell_widget); */ |
| 1945 | 1954 | ||
| 1946 | 1955 | pane_widget = lw_create_widget ("main", "pane", widget_id_tick++, | |
| 1947 | ac = 0; | 1956 | (widget_value *) NULL, |
| 1948 | XtSetArg (al[ac], XtNborderWidth, 0); ac++; | 1957 | shell_widget, False, |
| 1949 | pane_widget = XtCreateWidget ("pane", | 1958 | (lw_callback) NULL, |
| 1950 | panedWidgetClass, | 1959 | (lw_callback) NULL, |
| 1951 | shell_widget, al, ac); | 1960 | (lw_callback) NULL); |
| 1952 | 1961 | ||
| 1953 | f->display.x->column_widget = pane_widget; | 1962 | f->display.x->column_widget = pane_widget; |
| 1954 | 1963 | ||
| @@ -1964,15 +1973,16 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 1964 | XtSetArg (al[ac], XtNallowResize, 1); ac++; | 1973 | XtSetArg (al[ac], XtNallowResize, 1); ac++; |
| 1965 | XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; | 1974 | XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; |
| 1966 | XtSetArg (al[ac], XtNemacsFrame, f); ac++; | 1975 | XtSetArg (al[ac], XtNemacsFrame, f); ac++; |
| 1967 | screen_widget = XtCreateWidget (name, | 1976 | frame_widget = XtCreateWidget (name, |
| 1968 | emacsFrameClass, | 1977 | emacsFrameClass, |
| 1969 | pane_widget, al, ac); | 1978 | pane_widget, al, ac); |
| 1979 | lw_set_main_areas (pane_widget, f->display.x->menubar_widget, frame_widget); | ||
| 1970 | 1980 | ||
| 1971 | f->display.x->edit_widget = screen_widget; | 1981 | f->display.x->edit_widget = frame_widget; |
| 1972 | 1982 | ||
| 1973 | if (f->display.x->menubar_widget) | 1983 | if (f->display.x->menubar_widget) |
| 1974 | XtManageChild (f->display.x->menubar_widget); | 1984 | XtManageChild (f->display.x->menubar_widget); |
| 1975 | XtManageChild (screen_widget); | 1985 | XtManageChild (frame_widget); |
| 1976 | 1986 | ||
| 1977 | /* Do some needed geometry management. */ | 1987 | /* Do some needed geometry management. */ |
| 1978 | { | 1988 | { |
| @@ -2023,7 +2033,7 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 2023 | XtManageChild (pane_widget); | 2033 | XtManageChild (pane_widget); |
| 2024 | XtRealizeWidget (shell_widget); | 2034 | XtRealizeWidget (shell_widget); |
| 2025 | 2035 | ||
| 2026 | FRAME_X_WINDOW (f) = XtWindow (screen_widget); | 2036 | FRAME_X_WINDOW (f) = XtWindow (frame_widget); |
| 2027 | 2037 | ||
| 2028 | validate_x_resource_name (); | 2038 | validate_x_resource_name (); |
| 2029 | class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; | 2039 | class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; |
| @@ -2036,11 +2046,15 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 2036 | 2046 | ||
| 2037 | hack_wm_protocols (shell_widget); | 2047 | hack_wm_protocols (shell_widget); |
| 2038 | 2048 | ||
| 2049 | #ifdef HACK_EDITRES | ||
| 2050 | XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); | ||
| 2051 | #endif | ||
| 2052 | |||
| 2039 | /* Do a stupid property change to force the server to generate a | 2053 | /* Do a stupid property change to force the server to generate a |
| 2040 | propertyNotify event so that the event_stream server timestamp will | 2054 | propertyNotify event so that the event_stream server timestamp will |
| 2041 | be initialized to something relevant to the time we created the window. | 2055 | be initialized to something relevant to the time we created the window. |
| 2042 | */ | 2056 | */ |
| 2043 | XChangeProperty (XtDisplay (screen_widget), XtWindow (screen_widget), | 2057 | XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), |
| 2044 | Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend, | 2058 | Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend, |
| 2045 | (unsigned char*) NULL, 0); | 2059 | (unsigned char*) NULL, 0); |
| 2046 | 2060 | ||
| @@ -2050,7 +2064,7 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 2050 | XChangeWindowAttributes (XtDisplay (shell_widget), XtWindow (shell_widget), | 2064 | XChangeWindowAttributes (XtDisplay (shell_widget), XtWindow (shell_widget), |
| 2051 | attribute_mask, &attributes); | 2065 | attribute_mask, &attributes); |
| 2052 | 2066 | ||
| 2053 | XtMapWidget (screen_widget); | 2067 | XtMapWidget (frame_widget); |
| 2054 | 2068 | ||
| 2055 | /* x_set_name normally ignores requests to set the name if the | 2069 | /* x_set_name normally ignores requests to set the name if the |
| 2056 | requested name is the same as the current name. This is the one | 2070 | requested name is the same as the current name. This is the one |