From 2cd98812779dd3254b4956ea39d6e6338f3feb8d Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 17 Sep 2013 16:59:45 +0400 Subject: [PATCH] * frame.h (x_set_bitmap_icon) [!HAVE_NS]: New function. (x_icon_type): Remove prototype. (x_bitmap_icon) [!HAVE_NS]: Declare as such. * frame.c (x_icon_type): Remove. * w32term.c (x_make_frame_visible, x_iconify_frame): * xterm.c (x_make_frame_visible, x_iconify_frame): Use x_set_bitmap_icon to factor out common code. --- src/ChangeLog | 10 ++++++++++ src/frame.c | 16 ---------------- src/frame.h | 21 +++++++++++++++++---- src/w32term.c | 12 ++---------- src/xterm.c | 10 ++-------- 5 files changed, 31 insertions(+), 38 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8583bbb19fb..e900cfb1bb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2013-09-17 Dmitry Antipov + + * frame.h (x_set_bitmap_icon) [!HAVE_NS]: New function. + (x_icon_type): Remove prototype. + (x_bitmap_icon) [!HAVE_NS]: Declare as such. + * frame.c (x_icon_type): Remove. + * w32term.c (x_make_frame_visible, x_iconify_frame): + * xterm.c (x_make_frame_visible, x_iconify_frame): + Use x_set_bitmap_icon to factor out common code. + 2013-09-17 Dmitry Antipov * dispextern.h (check_x_display_info, x_get_string_resource): diff --git a/src/frame.c b/src/frame.c index 1f2b2b9c223..365629d0f48 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3381,22 +3381,6 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; } - - -/* Return non-nil if frame F wants a bitmap icon. */ - -Lisp_Object -x_icon_type (struct frame *f) -{ - Lisp_Object tem; - - tem = assq_no_quit (Qicon_type, f->param_alist); - if (CONSP (tem)) - return XCDR (tem); - else - return Qnil; -} - void x_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { diff --git a/src/frame.h b/src/frame.h index c5ad71628ab..f5fd7dbcc36 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1230,8 +1230,6 @@ extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object, extern void x_set_scroll_bar_width (struct frame *, Lisp_Object, Lisp_Object); -extern Lisp_Object x_icon_type (struct frame *); - extern long x_figure_window_size (struct frame *, Lisp_Object, bool); extern void x_set_alpha (struct frame *, Lisp_Object, Lisp_Object); @@ -1260,7 +1258,6 @@ extern void x_set_tool_bar_lines (struct frame *f, Lisp_Object oldval); extern void x_activate_menubar (struct frame *); extern void x_real_positions (struct frame *, int *, int *); -extern int x_bitmap_icon (struct frame *, Lisp_Object); extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); @@ -1279,8 +1276,24 @@ extern void x_query_colors (struct frame *f, XColor *, int); extern void x_query_color (struct frame *f, XColor *); extern void x_focus_frame (struct frame *); +#ifndef HAVE_NS + +extern int x_bitmap_icon (struct frame *, Lisp_Object); + +/* Set F's bitmap icon, if specified among F's parameters. */ + +FRAME_INLINE void +x_set_bitmap_icon (struct frame *f) +{ + Lisp_Object obj = assq_no_quit (Qicon_type, f->param_alist); + + if (CONSP (obj)) + x_bitmap_icon (f, XCDR (obj)); +} + +#endif /* !HAVE_NS */ + #endif /* HAVE_WINDOW_SYSTEM */ - FRAME_INLINE void flush_frame (struct frame *f) diff --git a/src/w32term.c b/src/w32term.c index 912fb3cc68c..59fdf130592 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5915,13 +5915,9 @@ w32_frame_raise_lower (struct frame *f, int raise_flag) void x_make_frame_visible (struct frame *f) { - Lisp_Object type; - block_input (); - type = x_icon_type (f); - if (!NILP (type)) - x_bitmap_icon (f, type); + x_set_bitmap_icon (f); if (! FRAME_VISIBLE_P (f)) { @@ -6031,8 +6027,6 @@ x_make_frame_invisible (struct frame *f) void x_iconify_frame (struct frame *f) { - Lisp_Object type; - /* Don't keep the highlight on an invisible frame. */ if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f) FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0; @@ -6042,9 +6036,7 @@ x_iconify_frame (struct frame *f) block_input (); - type = x_icon_type (f); - if (!NILP (type)) - x_bitmap_icon (f, type); + x_set_bitmap_icon (f); /* Simulate the user minimizing the frame. */ SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); diff --git a/src/xterm.c b/src/xterm.c index 1adc5b3d03f..fadcdbfea98 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9008,7 +9008,6 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg, void x_make_frame_visible (struct frame *f) { - Lisp_Object type; int original_top, original_left; int retry_count = 2; @@ -9016,9 +9015,7 @@ x_make_frame_visible (struct frame *f) block_input (); - type = x_icon_type (f); - if (!NILP (type)) - x_bitmap_icon (f, type); + x_set_bitmap_icon (f); if (! FRAME_VISIBLE_P (f)) { @@ -9225,7 +9222,6 @@ x_iconify_frame (struct frame *f) #ifdef USE_X_TOOLKIT int result; #endif - Lisp_Object type; /* Don't keep the highlight on an invisible frame. */ if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f) @@ -9236,9 +9232,7 @@ x_iconify_frame (struct frame *f) block_input (); - type = x_icon_type (f); - if (!NILP (type)) - x_bitmap_icon (f, type); + x_set_bitmap_icon (f); #if defined (USE_GTK) if (FRAME_GTK_OUTER_WIDGET (f)) -- 2.39.2