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'.
This commit is contained in:
Anders Lindgren 2016-01-23 14:13:20 +01:00
parent 371154b481
commit c32f3bc4a3

View file

@ -1161,11 +1161,24 @@ @implementation EmacsBell
- (id)init; - (id)init;
{ {
NSTRACE ("[EmacsBell init]");
if ((self = [super init])) if ((self = [super init]))
{ {
nestCount = 0; nestCount = 0;
isAttached = false; isAttached = false;
#ifdef NS_IMPL_GNUSTEP
// GNUstep doesn't provide named images. This was reported in
// 2011, see https://savannah.gnu.org/bugs/?33396
//
// As a drop in replacment, a semi tranparent gray square is used.
self.image = [[NSImage alloc] initWithSize:NSMakeSize(32, 32)];
[self.image lockFocus];
[[NSColor colorForEmacsRed:0.5 green:0.5 blue:0.5 alpha:0.5] set];
NSRectFill(NSMakeRect(0, 0, 32, 32));
[self.image unlockFocus];
#else
self.image = [NSImage imageNamed:NSImageNameCaution]; self.image = [NSImage imageNamed:NSImageNameCaution];
#endif
} }
return self; return self;
} }
@ -1572,7 +1585,6 @@ static void hide_bell ()
NSRect wr = [window frame]; NSRect wr = [window frame];
int tb = FRAME_EXTERNAL_TOOL_BAR (f); int tb = FRAME_EXTERNAL_TOOL_BAR (f);
int pixelwidth, pixelheight; int pixelwidth, pixelheight;
int rows, cols;
int orig_height = wr.size.height; int orig_height = wr.size.height;
NSTRACE ("x_set_window_size"); NSTRACE ("x_set_window_size");
@ -1590,15 +1602,11 @@ static void hide_bell ()
{ {
pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
} }
else else
{ {
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
cols = width;
rows = height;
} }
/* If we have a toolbar, take its height into account. */ /* If we have a toolbar, take its height into account. */
@ -2631,13 +2639,13 @@ static void hide_bell ()
[img setXBMColor: bm_color]; [img setXBMColor: bm_color];
} }
#ifdef NS_IMPL_COCOA
// Note: For periodic images, the full image height is "h + hd". // Note: For periodic images, the full image height is "h + hd".
// By using the height h, a suitable part of the image is used. // By using the height h, a suitable part of the image is used.
NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h); NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h);
NSTRACE_RECT ("fromRect", fromRect); NSTRACE_RECT ("fromRect", fromRect);
#ifdef NS_IMPL_COCOA
[img drawInRect: r [img drawInRect: r
fromRect: fromRect fromRect: fromRect
operation: NSCompositeSourceOver operation: NSCompositeSourceOver
@ -6357,7 +6365,6 @@ - (void) updateFrameSize: (BOOL) delay;
if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
{ {
NSView *view = FRAME_NS_VIEW (emacsframe); NSView *view = FRAME_NS_VIEW (emacsframe);
NSWindow *win = [view window];
change_frame_size (emacsframe, change_frame_size (emacsframe,
FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww), FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww),
@ -7778,8 +7785,6 @@ - (void)performZoom:(id)sender
- (void)zoom:(id)sender - (void)zoom:(id)sender
{ {
struct frame * f = SELECTED_FRAME ();
NSTRACE ("[EmacsWindow zoom:]"); NSTRACE ("[EmacsWindow zoom:]");
ns_update_auto_hide_menu_bar(); ns_update_auto_hide_menu_bar();