Mercurial > emacs
annotate lwlib/lwlib.h @ 83004:7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.
lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.
lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell). Use tty-create-frame-with-faces,
not make-terminal-frame.
src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.
src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.
src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.
src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init. Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info. Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.
src/dispextern.h: Updated prototypes.
src/dispnew.c: Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.
src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.
src/process.c: Include frame.h before termhooks.h.
src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here. Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.
src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error.
src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X.
src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.
src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.
src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.
src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.
src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.
src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 05 Jan 2004 05:54:35 +0000 |
parents | 695cf19ef79e |
children | 8a28788cef84 375f2633d815 |
rev | line source |
---|---|
5626 | 1 #ifndef LWLIB_H |
2 #define LWLIB_H | |
3 | |
4 #include <X11/Intrinsic.h> | |
5 | |
6 /* | |
7 ** Widget values depend on the Widget type: | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41766
diff
changeset
|
8 ** |
5626 | 9 ** widget: (name value key enabled data contents/selected) |
10 ** | |
11 ** label: ("name" "string" NULL NULL NULL NULL) | |
12 ** button: ("name" "string" "key" T/F data <default-button-p>) | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41766
diff
changeset
|
13 ** button w/menu: |
5626 | 14 ** ("name" "string" "key" T/F data (label|button|button w/menu...)) |
15 ** menubar: ("name" NULL NULL T/F data (button w/menu)) | |
16 ** selectable thing: | |
17 ** ("name" "string" "key" T/F data T/F) | |
18 ** checkbox: selectable thing | |
19 ** radio: ("name" NULL NULL T/F data (selectable thing...)) | |
20 ** strings: ("name" NULL NULL T/F data (selectable thing...)) | |
21 ** text: ("name" "string" <ign> T/F data) | |
8784 | 22 ** main: ("name") |
5626 | 23 */ |
24 | |
25 typedef unsigned long LWLIB_ID; | |
26 | |
27 typedef enum _change_type | |
28 { | |
29 NO_CHANGE = 0, | |
30 INVISIBLE_CHANGE = 1, | |
31 VISIBLE_CHANGE = 2, | |
32 STRUCTURAL_CHANGE = 3 | |
33 } change_type; | |
34 | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
35 enum button_type |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
36 { |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
37 BUTTON_TYPE_NONE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
38 BUTTON_TYPE_TOGGLE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
39 BUTTON_TYPE_RADIO |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
40 }; |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
41 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
42 /* Menu separator types. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
43 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
44 enum menu_separator |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
45 { |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
46 /* These values are Motif compatible. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
47 SEPARATOR_NO_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
48 SEPARATOR_SINGLE_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
49 SEPARATOR_DOUBLE_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
50 SEPARATOR_SINGLE_DASHED_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
51 SEPARATOR_DOUBLE_DASHED_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
52 SEPARATOR_SHADOW_ETCHED_IN, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
53 SEPARATOR_SHADOW_ETCHED_OUT, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
54 SEPARATOR_SHADOW_ETCHED_IN_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
55 SEPARATOR_SHADOW_ETCHED_OUT_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
56 |
41766
32d440813da1
(_widget_value): `help' has type Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
29466
diff
changeset
|
57 /* The following are supported by Lucid menus. */ |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
58 SEPARATOR_SHADOW_DOUBLE_ETCHED_IN, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
59 SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
60 SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
61 SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
62 }; |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
63 |
5626 | 64 typedef struct _widget_value |
65 { | |
66 /* name of widget */ | |
67 char* name; | |
68 /* value (meaning depend on widget type) */ | |
69 char* value; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41766
diff
changeset
|
70 /* keyboard equivalent. no implications for XtTranslations */ |
5626 | 71 char* key; |
41766
32d440813da1
(_widget_value): `help' has type Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
29466
diff
changeset
|
72 /* Help string or nil if none. |
32d440813da1
(_widget_value): `help' has type Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
29466
diff
changeset
|
73 GC finds this string through the frame's menu_bar_vector |
32d440813da1
(_widget_value): `help' has type Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
29466
diff
changeset
|
74 or through menu_items. */ |
32d440813da1
(_widget_value): `help' has type Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
29466
diff
changeset
|
75 Lisp_Object help; |
5626 | 76 /* true if enabled */ |
77 Boolean enabled; | |
78 /* true if selected */ | |
79 Boolean selected; | |
80 /* true if was edited (maintained by get_value) */ | |
81 Boolean edited; | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
82 /* The type of a button. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
83 enum button_type button_type; |
5626 | 84 /* true if has changed (maintained by lw library) */ |
85 change_type change; | |
14878
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
86 /* true if this widget itself has changed, |
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
87 but not counting the other widgets found in the `next' field. */ |
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
88 change_type this_one_change; |
5626 | 89 /* Contents of the sub-widgets, also selected slot for checkbox */ |
90 struct _widget_value* contents; | |
91 /* data passed to callback */ | |
92 XtPointer call_data; | |
93 /* next one in the list */ | |
94 struct _widget_value* next; | |
95 /* slot for the toolkit dependent part. Always initialize to NULL. */ | |
96 void* toolkit_data; | |
97 /* tell us if we should free the toolkit data slot when freeing the | |
98 widget_value itself. */ | |
99 Boolean free_toolkit_data; | |
100 | |
101 /* we resource the widget_value structures; this points to the next | |
102 one on the free list if this one has been deallocated. | |
103 */ | |
104 struct _widget_value *free_list; | |
105 } widget_value; | |
106 | |
107 | |
29466 | 108 typedef void (*lw_callback) __P ((Widget w, LWLIB_ID id, void* data)); |
5626 | 109 |
29466 | 110 void lw_register_widget __P ((char* type, char* name, LWLIB_ID id, |
111 widget_value* val, lw_callback pre_activate_cb, | |
112 lw_callback selection_cb, | |
113 lw_callback post_activate_cb, | |
114 lw_callback highlight_cb)); | |
115 Widget lw_get_widget __P ((LWLIB_ID id, Widget parent, Boolean pop_up_p)); | |
116 Widget lw_make_widget __P ((LWLIB_ID id, Widget parent, Boolean pop_up_p)); | |
117 Widget lw_create_widget __P ((char* type, char* name, LWLIB_ID id, | |
118 widget_value* val, Widget parent, Boolean pop_up_p, | |
119 lw_callback pre_activate_cb, | |
120 lw_callback selection_cb, | |
121 lw_callback post_activate_cb, | |
122 lw_callback highlight_cb)); | |
123 LWLIB_ID lw_get_widget_id __P ((Widget w)); | |
124 int lw_modify_all_widgets __P ((LWLIB_ID id, widget_value* val, Boolean deep_p)); | |
125 void lw_destroy_widget __P ((Widget w)); | |
126 void lw_destroy_all_widgets __P ((LWLIB_ID id)); | |
127 void lw_destroy_everything __P ((void)); | |
128 void lw_destroy_all_pop_ups __P ((void)); | |
129 Widget lw_raise_all_pop_up_widgets __P ((void)); | |
130 widget_value* lw_get_all_values __P ((LWLIB_ID id)); | |
131 Boolean lw_get_some_values __P ((LWLIB_ID id, widget_value* val)); | |
132 void lw_pop_up_all_widgets __P ((LWLIB_ID id)); | |
133 void lw_pop_down_all_widgets __P ((LWLIB_ID id)); | |
5626 | 134 widget_value *malloc_widget_value (); |
29466 | 135 void free_widget_value __P ((widget_value *)); |
136 void lw_popup_menu __P ((Widget, XEvent *)); | |
5626 | 137 |
138 /* Toolkit independent way of focusing on a Widget at the Xt level. */ | |
29466 | 139 void lw_set_keyboard_focus __P ((Widget parent, Widget w)); |
5626 | 140 |
141 /* Silly Energize hack to invert the "sheet" button */ | |
29466 | 142 void lw_show_busy __P ((Widget w, Boolean busy)); |
8784 | 143 |
144 /* Silly hack to assist with Lucid/Athena geometry management. */ | |
29466 | 145 void lw_refigure_widget __P ((Widget w, Boolean doit)); |
8784 | 146 |
147 /* Toolkit independent way of determining if an event occurred on a | |
148 menubar. */ | |
29466 | 149 Boolean lw_window_is_in_menubar __P ((Window win, Widget menubar_widget)); |
8784 | 150 |
151 /* Manage resizing: TRUE permits resizing widget w; FALSE disallows it. */ | |
29466 | 152 void lw_allow_resizing __P ((Widget w, Boolean flag)); |
5626 | 153 |
9064 | 154 /* Set up the main window. */ |
29466 | 155 void lw_set_main_areas __P ((Widget parent, |
9064 | 156 Widget menubar, |
29466 | 157 Widget work_area)); |
9064 | 158 |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
159 /* Value is non-zero if LABEL is a menu separator. If it is, *TYPE is |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
160 set to an appropriate enumerator of type enum menu_separator. |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
161 MOTIF_P non-zero means map separator types not supported by Motif |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
162 to similar ones that are supported. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
163 |
29466 | 164 int lw_separator_p __P ((char *label, enum menu_separator *type, |
165 int motif_p)); | |
166 | |
167 void lwlib_bcopy __P ((char*, char*, int)); | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
168 |
5626 | 169 #endif /* LWLIB_H */ |
52401 | 170 |
171 /* arch-tag: 44d818d5-7eb2-4d87-acd7-b992bb0d5d20 | |
172 (do not change this comment) */ |