diff options
| author | Adrian Robert | 2009-09-23 18:20:03 +0000 |
|---|---|---|
| committer | Adrian Robert | 2009-09-23 18:20:03 +0000 |
| commit | 6aba198c838d175fd2f2e08d48042a1ad1b59717 (patch) | |
| tree | b20a1c2ef8a2b3521e75fe7c7cd01df27cac1815 | |
| parent | 4f02f0c98945fb41b116a8fb2302f16b21444a1c (diff) | |
| download | emacs-6aba198c838d175fd2f2e08d48042a1ad1b59717.tar.gz emacs-6aba198c838d175fd2f2e08d48042a1ad1b59717.zip | |
* nsterm.m (EV_TIMESTAMP, x_set_window_size)
(EmacsApp-application:openFiles:): Remove GNUstep conditionals.
(EmacsScroller-setPosition:portion:whole:): Remove -display call
under GNUstep.
(EmacsView-initFrameFromEmacs:): Set autoresizing mask.
| -rw-r--r-- | src/nsterm.m | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index e09037bceb5..aecd3e7bfdf 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -248,12 +248,7 @@ static BOOL inNsSelect = 0; | |||
| 248 | [e buttonNumber] - 1) | 248 | [e buttonNumber] - 1) |
| 249 | 249 | ||
| 250 | /* Convert the time field to a timestamp in milliseconds. */ | 250 | /* Convert the time field to a timestamp in milliseconds. */ |
| 251 | #ifdef NS_IMPL_GNUSTEP | ||
| 252 | /* Apple says timestamp is in seconds, but GNUstep seems to be returning msec */ | ||
| 253 | #define EV_TIMESTAMP(e) ([e timestamp]) | ||
| 254 | #else | ||
| 255 | #define EV_TIMESTAMP(e) ([e timestamp] * 1000) | 251 | #define EV_TIMESTAMP(e) ([e timestamp] * 1000) |
| 256 | #endif /* not gnustep */ | ||
| 257 | 252 | ||
| 258 | /* This is a piece of code which is common to all the event handling | 253 | /* This is a piece of code which is common to all the event handling |
| 259 | methods. Maybe it should even be a function. */ | 254 | methods. Maybe it should even be a function. */ |
| @@ -1139,19 +1134,12 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) | |||
| 1139 | 1134 | ||
| 1140 | /* If we have a toolbar, take its height into account. */ | 1135 | /* If we have a toolbar, take its height into account. */ |
| 1141 | if (tb) | 1136 | if (tb) |
| 1137 | /* NOTE: previously this would generate wrong result if toolbar not | ||
| 1138 | yet displayed and fixing toolbar_height=32 helped, but | ||
| 1139 | now (200903) seems no longer needed */ | ||
| 1142 | FRAME_NS_TOOLBAR_HEIGHT (f) = | 1140 | FRAME_NS_TOOLBAR_HEIGHT (f) = |
| 1143 | /* XXX: GNUstep has not yet implemented the first method below, added | ||
| 1144 | in Panther, however the second is incorrect under Cocoa. */ | ||
| 1145 | #ifdef NS_IMPL_COCOA | ||
| 1146 | NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) | 1141 | NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) |
| 1147 | /* NOTE: previously this would generate wrong result if toolbar not | 1142 | - FRAME_NS_TITLEBAR_HEIGHT (f); |
| 1148 | yet displayed and fixing toolbar_height=32 helped, but | ||
| 1149 | now (200903) seems no longer needed */ | ||
| 1150 | #else | ||
| 1151 | NSHeight ([NSWindow frameRectForContentRect: NSMakeRect (0, 0, 0, 0) | ||
| 1152 | styleMask: [window styleMask]]) | ||
| 1153 | #endif | ||
| 1154 | - FRAME_NS_TITLEBAR_HEIGHT (f); | ||
| 1155 | else | 1143 | else |
| 1156 | FRAME_NS_TOOLBAR_HEIGHT (f) = 0; | 1144 | FRAME_NS_TOOLBAR_HEIGHT (f) = 0; |
| 1157 | 1145 | ||
| @@ -4155,11 +4143,7 @@ ns_term_shutdown (int sig) | |||
| 4155 | while ((file = [files nextObject]) != nil) | 4143 | while ((file = [files nextObject]) != nil) |
| 4156 | [ns_pending_files addObject: file]; | 4144 | [ns_pending_files addObject: file]; |
| 4157 | 4145 | ||
| 4158 | /* TODO: when GNUstep implements this (and we require that version of | ||
| 4159 | GNUstep), remove. */ | ||
| 4160 | #ifndef NS_IMPL_GNUSTEP | ||
| 4161 | [self replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; | 4146 | [self replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; |
| 4162 | #endif /* !NS_IMPL_GNUSTEP */ | ||
| 4163 | 4147 | ||
| 4164 | } | 4148 | } |
| 4165 | 4149 | ||
| @@ -5100,6 +5084,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5100 | r = NSMakeRect (0, 0, FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, f->text_cols), | 5084 | r = NSMakeRect (0, 0, FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, f->text_cols), |
| 5101 | FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, f->text_lines)); | 5085 | FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, f->text_lines)); |
| 5102 | [self initWithFrame: r]; | 5086 | [self initWithFrame: r]; |
| 5087 | [self setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; | ||
| 5103 | 5088 | ||
| 5104 | FRAME_NS_VIEW (f) = self; | 5089 | FRAME_NS_VIEW (f) = self; |
| 5105 | emacsframe = f; | 5090 | emacsframe = f; |
| @@ -5711,8 +5696,13 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5711 | [self setEnabled: YES]; | 5696 | [self setEnabled: YES]; |
| 5712 | 5697 | ||
| 5713 | /* Ensure auto resizing of scrollbars occurs within the emacs frame's view | 5698 | /* Ensure auto resizing of scrollbars occurs within the emacs frame's view |
| 5714 | locked against the right, top and bottom edges. */ | 5699 | locked against the top and bottom edges, and right edge on OS X, where |
| 5700 | scrollers are on right. */ | ||
| 5701 | #ifdef NS_IMPL_GNUSTEP | ||
| 5702 | [self setAutoresizingMask: NSViewMaxXMargin | NSViewHeightSizable]; | ||
| 5703 | #else | ||
| 5715 | [self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; | 5704 | [self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; |
| 5705 | #endif | ||
| 5716 | 5706 | ||
| 5717 | win = nwin; | 5707 | win = nwin; |
| 5718 | condemned = NO; | 5708 | condemned = NO; |
| @@ -5833,9 +5823,6 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5833 | por = (float)portion/whole; | 5823 | por = (float)portion/whole; |
| 5834 | [self setFloatValue: pos knobProportion: por]; | 5824 | [self setFloatValue: pos knobProportion: por]; |
| 5835 | } | 5825 | } |
| 5836 | #ifdef NS_IMPL_GNUSTEP | ||
| 5837 | [self display]; | ||
| 5838 | #endif | ||
| 5839 | return self; | 5826 | return self; |
| 5840 | } | 5827 | } |
| 5841 | 5828 | ||