Mercurial > hg > xemacs-beta
comparison src/frame-tty.c @ 153:25f70ba0133c r20-3b3
Import from CVS: tag r20-3b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:38:25 +0200 |
parents | 538048ae2ab8 |
children | 43dd3413c7c7 |
comparison
equal
deleted
inserted
replaced
152:4c132ee2d62b | 153:25f70ba0133c |
---|---|
28 #include <config.h> | 28 #include <config.h> |
29 #include "lisp.h" | 29 #include "lisp.h" |
30 | 30 |
31 #include "console-tty.h" | 31 #include "console-tty.h" |
32 #include "frame.h" | 32 #include "frame.h" |
33 | |
34 #ifdef HAVE_GPM | |
35 #include <gpm.h> | |
36 #endif | |
33 | 37 |
34 | 38 |
35 /* Default properties to use when creating frames. */ | 39 /* Default properties to use when creating frames. */ |
36 Lisp_Object Vdefault_tty_frame_plist; | 40 Lisp_Object Vdefault_tty_frame_plist; |
37 | 41 |
80 { | 84 { |
81 if (first_on_console) | 85 if (first_on_console) |
82 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f)); | 86 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f)); |
83 } | 87 } |
84 | 88 |
89 #ifdef HAVE_GPM | |
90 static int | |
91 tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y) | |
92 { | |
93 Gpm_Event ev; | |
94 int num_buttons; | |
95 | |
96 num_buttons = Gpm_GetSnapshot(&ev); | |
97 *x = ev.x; | |
98 *y = ev.y; | |
99 *frame = DEVICE_SELECTED_FRAME (d); | |
100 return (1); | |
101 } | |
102 | |
103 static void | |
104 tty_set_mouse_position (struct window *w, int x, int y) | |
105 { | |
106 /* XXX | |
107 I couldn't find any GPM functions that set the mouse position. | |
108 Mr. Perry had left this function empty; that must be why. | |
109 karlheg | |
110 */ | |
111 } | |
112 | |
113 #endif | |
114 | |
115 | |
85 /* Change from withdrawn state to mapped state. */ | 116 /* Change from withdrawn state to mapped state. */ |
86 static void | 117 static void |
87 tty_make_frame_visible (struct frame *f) | 118 tty_make_frame_visible (struct frame *f) |
88 { | 119 { |
89 if (!FRAME_VISIBLE_P(f)) | 120 if (!FRAME_VISIBLE_P(f)) |
168 console_type_create_frame_tty (void) | 199 console_type_create_frame_tty (void) |
169 { | 200 { |
170 CONSOLE_HAS_METHOD (tty, init_frame_1); | 201 CONSOLE_HAS_METHOD (tty, init_frame_1); |
171 CONSOLE_HAS_METHOD (tty, init_frame_3); | 202 CONSOLE_HAS_METHOD (tty, init_frame_3); |
172 CONSOLE_HAS_METHOD (tty, after_init_frame); | 203 CONSOLE_HAS_METHOD (tty, after_init_frame); |
204 #ifdef HAVE_GPM | |
205 CONSOLE_HAS_METHOD (tty, get_mouse_position); | |
206 CONSOLE_HAS_METHOD (tty, set_mouse_position); | |
207 #endif | |
173 CONSOLE_HAS_METHOD (tty, make_frame_visible); | 208 CONSOLE_HAS_METHOD (tty, make_frame_visible); |
174 CONSOLE_HAS_METHOD (tty, make_frame_invisible); | 209 CONSOLE_HAS_METHOD (tty, make_frame_invisible); |
175 CONSOLE_HAS_METHOD (tty, frame_visible_p); | 210 CONSOLE_HAS_METHOD (tty, frame_visible_p); |
176 CONSOLE_HAS_METHOD (tty, raise_frame); | 211 CONSOLE_HAS_METHOD (tty, raise_frame); |
177 CONSOLE_HAS_METHOD (tty, lower_frame); | 212 CONSOLE_HAS_METHOD (tty, lower_frame); |
188 */ ); | 223 */ ); |
189 Vdefault_tty_frame_plist = Qnil; | 224 Vdefault_tty_frame_plist = Qnil; |
190 | 225 |
191 tty_console_methods->device_specific_frame_props = | 226 tty_console_methods->device_specific_frame_props = |
192 &Vdefault_tty_frame_plist; | 227 &Vdefault_tty_frame_plist; |
193 } | 228 |
229 /* Tty frames are now supported. Advertise a feature to indicate this. */ | |
230 Fprovide (intern ("tty-frames")); | |
231 } |