From: Jan D Date: Thu, 1 Jul 2010 12:16:33 +0000 (+0200) Subject: Rename FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT to aid common code. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~51^2~81^2~66^2~7 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=581a81003c3fde96eacdf66d4efa144842276073;p=emacs.git Rename FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT to aid common code. * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update FRAME_TOOLBAR_HEIGHT. * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. --- diff --git a/src/ChangeLog b/src/ChangeLog index c6af9f218ae..bd975446b3d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2010-07-01 Jan Djärv + * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed + FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. + + * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH + + * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update + FRAME_TOOLBAR_HEIGHT. + * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add BLOCK/UNBLOCK_INPUT so asserts don't trigger. diff --git a/src/nsmenu.m b/src/nsmenu.m index 5fc3d0f5a41..9034b051297 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1001,6 +1001,7 @@ free_frame_tool_bar (FRAME_PTR f) { BLOCK_INPUT; [[FRAME_NS_VIEW (f) toolbar] setVisible: NO]; + FRAME_TOOLBAR_HEIGHT (f) = 0; UNBLOCK_INPUT; } @@ -1011,7 +1012,9 @@ update_frame_tool_bar (FRAME_PTR f) -------------------------------------------------------------------------- */ { int i; - EmacsToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar]; + EmacsView *view = FRAME_NS_VIEW (f); + NSWindow *window = [view window]; + EmacsToolbar *toolbar = [view toolbar]; BLOCK_INPUT; [toolbar clearActive]; @@ -1097,6 +1100,9 @@ update_frame_tool_bar (FRAME_PTR f) [newDict release]; } + FRAME_TOOLBAR_HEIGHT (f) = + NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) + - FRAME_NS_TITLEBAR_HEIGHT (f); UNBLOCK_INPUT; } diff --git a/src/nsterm.h b/src/nsterm.h index 01086e63b69..5b24eb6f289 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -606,7 +606,7 @@ struct x_output #define NS_FACE_FOREGROUND(f) ((f)->foreground) #define NS_FACE_BACKGROUND(f) ((f)->background) #define FRAME_NS_TITLEBAR_HEIGHT(f) ((f)->output_data.ns->titlebar_height) -#define FRAME_NS_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height) +#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height) #define FONT_WIDTH(f) ((f)->max_width) #define FONT_HEIGHT(f) ((f)->height) diff --git a/src/nsterm.m b/src/nsterm.m index 14b824057da..afafc153f9e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1138,15 +1138,15 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) /* NOTE: previously this would generate wrong result if toolbar not yet displayed and fixing toolbar_height=32 helped, but now (200903) seems no longer needed */ - FRAME_NS_TOOLBAR_HEIGHT (f) = + FRAME_TOOLBAR_HEIGHT (f) = NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) - FRAME_NS_TITLEBAR_HEIGHT (f); else - FRAME_NS_TOOLBAR_HEIGHT (f) = 0; + FRAME_TOOLBAR_HEIGHT (f) = 0; wr.size.width = pixelwidth + f->border_width; wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f) - + FRAME_NS_TOOLBAR_HEIGHT (f); + + FRAME_TOOLBAR_HEIGHT (f); /* constrain to screen if we can */ if (screen) @@ -4894,16 +4894,16 @@ ns_term_shutdown (int sig) rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, frameSize.height #ifdef NS_IMPL_GNUSTEP - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + 3 - - FRAME_NS_TOOLBAR_HEIGHT (emacsframe)); + - FRAME_TOOLBAR_HEIGHT (emacsframe)); #else - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) - - FRAME_NS_TOOLBAR_HEIGHT (emacsframe)); + - FRAME_TOOLBAR_HEIGHT (emacsframe)); #endif if (rows < MINHEIGHT) rows = MINHEIGHT; frameSize.height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (emacsframe, rows) + FRAME_NS_TITLEBAR_HEIGHT (emacsframe) - + FRAME_NS_TOOLBAR_HEIGHT (emacsframe); + + FRAME_TOOLBAR_HEIGHT (emacsframe); #ifdef NS_IMPL_COCOA { /* this sets window title to have size in it; the wm does this under GS */ @@ -5114,7 +5114,7 @@ ns_term_shutdown (int sig) [toggleButton setTarget: self]; [toggleButton setAction: @selector (toggleToolbar: )]; #endif - FRAME_NS_TOOLBAR_HEIGHT (f) = 0; + FRAME_TOOLBAR_HEIGHT (f) = 0; tem = f->icon_name; if (!NILP (tem))