aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-13 20:46:18 +0400
committerDmitry Antipov2013-09-13 20:46:18 +0400
commitfcd42c11c0e0e5fa3ab931ad2126b1d855ba240f (patch)
tree292f51c029f5651ef19e3058132385c9b03f15a3 /src
parentbc2c0769db73f5acd7545b4c3f74cae29e4e4315 (diff)
downloademacs-fcd42c11c0e0e5fa3ab931ad2126b1d855ba240f.tar.gz
emacs-fcd42c11c0e0e5fa3ab931ad2126b1d855ba240f.zip
Unify Fx_focus_frame between all ports.
* src/frame.h (x_focus_frame): New prototype. * src/xfns.c (Fx_focus_frame): Remove. (syms_of_xfns): Do not defsubr it. (x_focus_frame): X implementation. * src/nsfns.m (Fx_focus_frame): Remove. (syms_of_nsfns): Do not defsubr it. (x_focus_frame): NS implementation. * src/w32term.c (Fx_focus_frame): Remove. (x_focus_on_frame): Rename to... (x_focus_frame): W32 implementation. * src/w32term.h (x_focus_on_frame): Remove prototype. * src/w32fns.c (Fx_focus_frame): Remove. (syms_of_w32fns): Do not defsubr it. * src/frame.c (Fx_focus_frame): Define here. (syms_of_frame): Defsubr here. * src/gtkutil.c (xg_tool_bar_callback): Use x_focus_frame. * lisp/frame.el (x-focus-frame): Mark as declared in frame.c.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/frame.c9
-rw-r--r--src/frame.h1
-rw-r--r--src/gtkutil.c6
-rw-r--r--src/nsfns.m11
-rw-r--r--src/w32fns.c10
-rw-r--r--src/w32term.c2
-rw-r--r--src/w32term.h2
-rw-r--r--src/xfns.c10
9 files changed, 38 insertions, 33 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 57cb776038a..cc8704da2a1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,25 @@
12013-09-13 Dmitry Antipov <dmantipov@yandex.ru> 12013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Unify Fx_focus_frame between all ports.
4 * frame.h (x_focus_frame): New prototype.
5 * xfns.c (Fx_focus_frame): Remove.
6 (syms_of_xfns): Do not defsubr it.
7 (x_focus_frame): X implementation.
8 * nsfns.m (Fx_focus_frame): Remove.
9 (syms_of_nsfns): Do not defsubr it.
10 (x_focus_frame): NS implementation.
11 * w32term.c (Fx_focus_frame): Remove.
12 (x_focus_on_frame): Rename to...
13 (x_focus_frame): W32 implementation.
14 * w32term.h (x_focus_on_frame): Remove prototype.
15 * w32fns.c (Fx_focus_frame): Remove.
16 (syms_of_w32fns): Do not defsubr it.
17 * frame.c (Fx_focus_frame): Define here.
18 (syms_of_frame): Defsubr here.
19 * gtkutil.c (xg_tool_bar_callback): Use x_focus_frame.
20
212013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
22
3 Unify FRAME_window_system_DISPLAY_INFO macros between all ports. 23 Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
4 All of them are replaced with FRAME_DISPLAY_INFO, defined in 24 All of them are replaced with FRAME_DISPLAY_INFO, defined in
5 each port to reference the port-specific window system data. 25 each port to reference the port-specific window system data.
diff --git a/src/frame.c b/src/frame.c
index 0de3152166e..74e57f9b5f2 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1901,6 +1901,14 @@ See `redirect-frame-focus'. */)
1901 return FRAME_FOCUS_FRAME (decode_live_frame (frame)); 1901 return FRAME_FOCUS_FRAME (decode_live_frame (frame));
1902} 1902}
1903 1903
1904DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
1905 doc: /* Set the input focus to FRAME.
1906FRAME nil means use the selected frame. */)
1907 (Lisp_Object frame)
1908{
1909 x_focus_frame (decode_window_system_frame (frame));
1910 return Qnil;
1911}
1904 1912
1905 1913
1906/* Return the value of frame parameter PROP in frame FRAME. */ 1914/* Return the value of frame parameter PROP in frame FRAME. */
@@ -4524,6 +4532,7 @@ automatically. See also `mouse-autoselect-window'. */);
4524 defsubr (&Svisible_frame_list); 4532 defsubr (&Svisible_frame_list);
4525 defsubr (&Sraise_frame); 4533 defsubr (&Sraise_frame);
4526 defsubr (&Slower_frame); 4534 defsubr (&Slower_frame);
4535 defsubr (&Sx_focus_frame);
4527 defsubr (&Sredirect_frame_focus); 4536 defsubr (&Sredirect_frame_focus);
4528 defsubr (&Sframe_focus); 4537 defsubr (&Sframe_focus);
4529 defsubr (&Sframe_parameters); 4538 defsubr (&Sframe_parameters);
diff --git a/src/frame.h b/src/frame.h
index 4184ce24a17..ea550f4a2fa 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1263,6 +1263,7 @@ extern void x_sync (struct frame *);
1263 1263
1264extern void x_query_colors (struct frame *f, XColor *, int); 1264extern void x_query_colors (struct frame *f, XColor *, int);
1265extern void x_query_color (struct frame *f, XColor *); 1265extern void x_query_color (struct frame *f, XColor *);
1266extern void x_focus_frame (struct frame *);
1266 1267
1267#endif /* HAVE_WINDOW_SYSTEM */ 1268#endif /* HAVE_WINDOW_SYSTEM */
1268 1269
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 064145282bc..95154ef9b52 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3975,9 +3975,9 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
3975 event.modifiers = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), mod); 3975 event.modifiers = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), mod);
3976 kbd_buffer_store_event (&event); 3976 kbd_buffer_store_event (&event);
3977 3977
3978 /* Return focus to the frame after we have clicked on a detached 3978 /* Return focus to the frame after we have clicked on a detached
3979 tool bar button. */ 3979 tool bar button. */
3980 Fx_focus_frame (frame); 3980 x_focus_frame (f);
3981} 3981}
3982 3982
3983/* Callback function invoked when a tool bar item is pressed in a detached 3983/* Callback function invoked when a tool bar item is pressed in a detached
diff --git a/src/nsfns.m b/src/nsfns.m
index 2d828991ffe..8eaf529ed04 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1339,13 +1339,9 @@ This function is an internal primitive--use `make-frame' instead. */)
1339 return unbind_to (count, frame); 1339 return unbind_to (count, frame);
1340} 1340}
1341 1341
1342 1342void
1343DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, 1343x_focus_frame (struct frame *f)
1344 doc: /* Set the input focus to FRAME.
1345FRAME nil means use the selected frame. */)
1346 (Lisp_Object frame)
1347{ 1344{
1348 struct frame *f = decode_window_system_frame (frame);
1349 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 1345 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1350 1346
1351 if (dpyinfo->x_focus_frame != f) 1347 if (dpyinfo->x_focus_frame != f)
@@ -1356,8 +1352,6 @@ FRAME nil means use the selected frame. */)
1356 [[view window] makeKeyAndOrderFront: view]; 1352 [[view window] makeKeyAndOrderFront: view];
1357 unblock_input (); 1353 unblock_input ();
1358 } 1354 }
1359
1360 return Qnil;
1361} 1355}
1362 1356
1363 1357
@@ -2894,7 +2888,6 @@ be used as the image of the icon representing the frame. */);
2894 defsubr (&Sns_list_services); 2888 defsubr (&Sns_list_services);
2895 defsubr (&Sns_perform_service); 2889 defsubr (&Sns_perform_service);
2896 defsubr (&Sns_convert_utf8_nfd_to_nfc); 2890 defsubr (&Sns_convert_utf8_nfd_to_nfc);
2897 defsubr (&Sx_focus_frame);
2898 defsubr (&Sns_popup_font_panel); 2891 defsubr (&Sns_popup_font_panel);
2899 defsubr (&Sns_popup_color_panel); 2892 defsubr (&Sns_popup_color_panel);
2900 2893
diff --git a/src/w32fns.c b/src/w32fns.c
index d2defeed529..0e8b8ab5a5b 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4622,15 +4622,6 @@ x_get_focus_frame (struct frame *frame)
4622 return xfocus; 4622 return xfocus;
4623} 4623}
4624 4624
4625DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
4626 doc: /* Give FRAME input focus, raising to foreground if necessary. */)
4627 (Lisp_Object frame)
4628{
4629 x_focus_on_frame (decode_window_system_frame (frame));
4630 return Qnil;
4631}
4632
4633
4634DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, 4625DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
4635 doc: /* Internal function called by `color-defined-p', which see. 4626 doc: /* Internal function called by `color-defined-p', which see.
4636\(Note that the Nextstep version of this function ignores FRAME.) */) 4627\(Note that the Nextstep version of this function ignores FRAME.) */)
@@ -7857,7 +7848,6 @@ only be necessary if the default setting causes problems. */);
7857 defsubr (&Sx_close_connection); 7848 defsubr (&Sx_close_connection);
7858 defsubr (&Sx_display_list); 7849 defsubr (&Sx_display_list);
7859 defsubr (&Sx_synchronize); 7850 defsubr (&Sx_synchronize);
7860 defsubr (&Sx_focus_frame);
7861 7851
7862 /* W32 specific functions */ 7852 /* W32 specific functions */
7863 7853
diff --git a/src/w32term.c b/src/w32term.c
index f86f7d351aa..cb7327b21b7 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5806,7 +5806,7 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
5806/* focus shifting, raising and lowering. */ 5806/* focus shifting, raising and lowering. */
5807 5807
5808void 5808void
5809x_focus_on_frame (struct frame *f) 5809x_focus_frame (struct frame *f)
5810{ 5810{
5811 struct w32_display_info *dpyinfo = &one_w32_display_info; 5811 struct w32_display_info *dpyinfo = &one_w32_display_info;
5812 5812
diff --git a/src/w32term.h b/src/w32term.h
index 68c0245acb9..5146fa8ef3a 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -199,8 +199,6 @@ Lisp_Object display_x_get_resource (struct w32_display_info *,
199 Lisp_Object, Lisp_Object, 199 Lisp_Object, Lisp_Object,
200 Lisp_Object, Lisp_Object); 200 Lisp_Object, Lisp_Object);
201 201
202extern void x_focus_on_frame (struct frame *f);
203
204/* also defined in xterm.h XXX: factor out to common header */ 202/* also defined in xterm.h XXX: factor out to common header */
205 203
206extern struct w32_display_info *w32_term_init (Lisp_Object, 204extern struct w32_display_info *w32_term_init (Lisp_Object,
diff --git a/src/xfns.c b/src/xfns.c
index df5f0a742d9..ecd1ce7bc95 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3252,12 +3252,9 @@ x_get_focus_frame (struct frame *frame)
3252 policy. But I think it's okay to use when it's clearly done 3252 policy. But I think it's okay to use when it's clearly done
3253 following a user-command. */ 3253 following a user-command. */
3254 3254
3255DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, 3255void
3256 doc: /* Set the input focus to FRAME. 3256x_focus_frame (struct frame *f)
3257FRAME nil means use the selected frame. */)
3258 (Lisp_Object frame)
3259{ 3257{
3260 struct frame *f = decode_window_system_frame (frame);
3261 Display *dpy = FRAME_X_DISPLAY (f); 3258 Display *dpy = FRAME_X_DISPLAY (f);
3262 3259
3263 block_input (); 3260 block_input ();
@@ -3279,8 +3276,6 @@ FRAME nil means use the selected frame. */)
3279 3276
3280 x_uncatch_errors (); 3277 x_uncatch_errors ();
3281 unblock_input (); 3278 unblock_input ();
3282
3283 return Qnil;
3284} 3279}
3285 3280
3286 3281
@@ -6170,7 +6165,6 @@ When using Gtk+ tooltips, the tooltip face is not used. */);
6170 defsubr (&Sx_close_connection); 6165 defsubr (&Sx_close_connection);
6171 defsubr (&Sx_display_list); 6166 defsubr (&Sx_display_list);
6172 defsubr (&Sx_synchronize); 6167 defsubr (&Sx_synchronize);
6173 defsubr (&Sx_focus_frame);
6174 defsubr (&Sx_backspace_delete_keys_p); 6168 defsubr (&Sx_backspace_delete_keys_p);
6175 6169
6176 defsubr (&Sx_show_tip); 6170 defsubr (&Sx_show_tip);