diff options
| author | Anders Lindgren | 2016-01-23 14:13:20 +0100 |
|---|---|---|
| committer | Anders Lindgren | 2016-01-23 14:16:41 +0100 |
| commit | c32f3bc4a383280587cf790b89f6c781d78cc42d (patch) | |
| tree | 8d5bf2e2b0cbf3e60a84e807cbcc664734468284 /src | |
| parent | 371154b481b478128030a095b6075a94eb5ffe3e (diff) | |
| download | emacs-c32f3bc4a383280587cf790b89f6c781d78cc42d.tar.gz emacs-c32f3bc4a383280587cf790b89f6c781d78cc42d.zip | |
Unbreak the GNUstep build.
* src/nsterm.m ([EmacsBell init]): In GNUstep, don't use the
predefined "caution" image. Add trace.
(x_set_window_size): Remove unused variables `cols' and `rows'.
(ns_draw_fringe_bitmap): Exclude assignment of `fromRect' when
GNUstep is used.
([EmacsView updateFrameSize:]): Remove unused variable `win'.
([EmacsWindow zoom:]): Remove unused variable `f'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index b270e0e58b5..860c55de70f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1161,11 +1161,24 @@ ns_clip_to_row (struct window *w, struct glyph_row *row, | |||
| 1161 | 1161 | ||
| 1162 | - (id)init; | 1162 | - (id)init; |
| 1163 | { | 1163 | { |
| 1164 | NSTRACE ("[EmacsBell init]"); | ||
| 1164 | if ((self = [super init])) | 1165 | if ((self = [super init])) |
| 1165 | { | 1166 | { |
| 1166 | nestCount = 0; | 1167 | nestCount = 0; |
| 1167 | isAttached = false; | 1168 | isAttached = false; |
| 1169 | #ifdef NS_IMPL_GNUSTEP | ||
| 1170 | // GNUstep doesn't provide named images. This was reported in | ||
| 1171 | // 2011, see https://savannah.gnu.org/bugs/?33396 | ||
| 1172 | // | ||
| 1173 | // As a drop in replacment, a semi tranparent gray square is used. | ||
| 1174 | self.image = [[NSImage alloc] initWithSize:NSMakeSize(32, 32)]; | ||
| 1175 | [self.image lockFocus]; | ||
| 1176 | [[NSColor colorForEmacsRed:0.5 green:0.5 blue:0.5 alpha:0.5] set]; | ||
| 1177 | NSRectFill(NSMakeRect(0, 0, 32, 32)); | ||
| 1178 | [self.image unlockFocus]; | ||
| 1179 | #else | ||
| 1168 | self.image = [NSImage imageNamed:NSImageNameCaution]; | 1180 | self.image = [NSImage imageNamed:NSImageNameCaution]; |
| 1181 | #endif | ||
| 1169 | } | 1182 | } |
| 1170 | return self; | 1183 | return self; |
| 1171 | } | 1184 | } |
| @@ -1572,7 +1585,6 @@ x_set_window_size (struct frame *f, | |||
| 1572 | NSRect wr = [window frame]; | 1585 | NSRect wr = [window frame]; |
| 1573 | int tb = FRAME_EXTERNAL_TOOL_BAR (f); | 1586 | int tb = FRAME_EXTERNAL_TOOL_BAR (f); |
| 1574 | int pixelwidth, pixelheight; | 1587 | int pixelwidth, pixelheight; |
| 1575 | int rows, cols; | ||
| 1576 | int orig_height = wr.size.height; | 1588 | int orig_height = wr.size.height; |
| 1577 | 1589 | ||
| 1578 | NSTRACE ("x_set_window_size"); | 1590 | NSTRACE ("x_set_window_size"); |
| @@ -1590,15 +1602,11 @@ x_set_window_size (struct frame *f, | |||
| 1590 | { | 1602 | { |
| 1591 | pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); | 1603 | pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); |
| 1592 | pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); | 1604 | pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); |
| 1593 | cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); | ||
| 1594 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight); | ||
| 1595 | } | 1605 | } |
| 1596 | else | 1606 | else |
| 1597 | { | 1607 | { |
| 1598 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); | 1608 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); |
| 1599 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); | 1609 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); |
| 1600 | cols = width; | ||
| 1601 | rows = height; | ||
| 1602 | } | 1610 | } |
| 1603 | 1611 | ||
| 1604 | /* If we have a toolbar, take its height into account. */ | 1612 | /* If we have a toolbar, take its height into account. */ |
| @@ -2631,13 +2639,13 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, | |||
| 2631 | [img setXBMColor: bm_color]; | 2639 | [img setXBMColor: bm_color]; |
| 2632 | } | 2640 | } |
| 2633 | 2641 | ||
| 2642 | #ifdef NS_IMPL_COCOA | ||
| 2634 | // Note: For periodic images, the full image height is "h + hd". | 2643 | // Note: For periodic images, the full image height is "h + hd". |
| 2635 | // By using the height h, a suitable part of the image is used. | 2644 | // By using the height h, a suitable part of the image is used. |
| 2636 | NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h); | 2645 | NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h); |
| 2637 | 2646 | ||
| 2638 | NSTRACE_RECT ("fromRect", fromRect); | 2647 | NSTRACE_RECT ("fromRect", fromRect); |
| 2639 | 2648 | ||
| 2640 | #ifdef NS_IMPL_COCOA | ||
| 2641 | [img drawInRect: r | 2649 | [img drawInRect: r |
| 2642 | fromRect: fromRect | 2650 | fromRect: fromRect |
| 2643 | operation: NSCompositeSourceOver | 2651 | operation: NSCompositeSourceOver |
| @@ -6357,7 +6365,6 @@ not_in_argv (NSString *arg) | |||
| 6357 | if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) | 6365 | if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) |
| 6358 | { | 6366 | { |
| 6359 | NSView *view = FRAME_NS_VIEW (emacsframe); | 6367 | NSView *view = FRAME_NS_VIEW (emacsframe); |
| 6360 | NSWindow *win = [view window]; | ||
| 6361 | 6368 | ||
| 6362 | change_frame_size (emacsframe, | 6369 | change_frame_size (emacsframe, |
| 6363 | FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww), | 6370 | FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww), |
| @@ -7778,8 +7785,6 @@ not_in_argv (NSString *arg) | |||
| 7778 | 7785 | ||
| 7779 | - (void)zoom:(id)sender | 7786 | - (void)zoom:(id)sender |
| 7780 | { | 7787 | { |
| 7781 | struct frame * f = SELECTED_FRAME (); | ||
| 7782 | |||
| 7783 | NSTRACE ("[EmacsWindow zoom:]"); | 7788 | NSTRACE ("[EmacsWindow zoom:]"); |
| 7784 | 7789 | ||
| 7785 | ns_update_auto_hide_menu_bar(); | 7790 | ns_update_auto_hide_menu_bar(); |