>From e588d3efad0cc410237a78c41af26eca6ca24318 Mon Sep 17 00:00:00 2001 From: Charles A. Roelli Date: Tue, 23 May 2017 20:52:56 +0200 Subject: [PATCH] Fix NS build in MacOS 10.6 --- src/nsimage.m | 8 ++++---- src/nsmenu.m | 12 ++++++------ src/nsterm.h | 38 +++++++++++++++++++------------------- src/nsterm.m | 20 ++++++++++---------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/nsimage.m b/src/nsimage.m index fb2322a..8c0cbd5 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -152,7 +152,7 @@ Updated by Christian Limpach (chris@nice.ch) @implementation EmacsImage -+ (instancetype)allocInitFromFile: (Lisp_Object)file ++ allocInitFromFile: (Lisp_Object)file { NSImageRep *imgRep; Lisp_Object found; @@ -197,7 +197,7 @@ - (void)dealloc /* Create image from monochrome bitmap. If both FG and BG are 0 (black), set the background to white and make it transparent. */ -- (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h +- initFromXBM: (unsigned char *)bits width: (int)w height: (int)h fg: (unsigned long)fg bg: (unsigned long)bg { unsigned char *planes[5]; @@ -269,7 +269,7 @@ - (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h } /* Set color for a bitmap image. */ -- (instancetype)setXBMColor: (NSColor *)color +- setXBMColor: (NSColor *)color { NSSize s = [self size]; unsigned char *planes[5]; @@ -309,7 +309,7 @@ - (instancetype)setXBMColor: (NSColor *)color } -- (instancetype)initForXPMWithDepth: (int)depth width: (int)width height: (int)height +- initForXPMWithDepth: (int)depth width: (int)width height: (int)height { NSSize s = {width, height}; int i; diff --git a/src/nsmenu.m b/src/nsmenu.m index 37a1a62..2847bc6 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -493,7 +493,7 @@ @implementation EmacsMenu /* override designated initializer */ -- (instancetype)initWithTitle: (NSString *)title +- initWithTitle: (NSString *)title { frame = 0; if ((self = [super initWithTitle: title])) @@ -503,7 +503,7 @@ - (instancetype)initWithTitle: (NSString *)title /* used for top-level */ -- (instancetype)initWithTitle: (NSString *)title frame: (struct frame *)f +- initWithTitle: (NSString *)title frame: (struct frame *)f { [self initWithTitle: title]; frame = f; @@ -1146,7 +1146,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f @implementation EmacsToolbar -- (instancetype)initForView: (EmacsView *)view withIdentifier: (NSString *)identifier +- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier { NSTRACE ("[EmacsToolbar initForView: withIdentifier:]"); @@ -1302,7 +1302,7 @@ - (void)setVisible:(BOOL)shown display. */ @implementation EmacsTooltip -- (instancetype)init +- init { NSColor *col = [NSColor colorWithCalibratedRed: 1.0 green: 1.0 blue: 0.792 alpha: 0.95]; @@ -1493,7 +1493,7 @@ @implementation EmacsDialogPanel #define TEXTHEIGHT 20.0 #define MINCELLWIDTH 90.0 -- (instancetype)initWithContentRect: (NSRect)contentRect styleMask: (NSWindowStyleMask)aStyle +- initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)backingType defer: (BOOL)flag { NSSize spacing = {SPACER, SPACER}; @@ -1697,7 +1697,7 @@ - (void)clicked: sender } -- (instancetype)initFromContents: (Lisp_Object)contents isQuestion: (BOOL)isQ +- initFromContents: (Lisp_Object)contents isQuestion: (BOOL)isQ { Lisp_Object head; [super init]; diff --git a/src/nsterm.h b/src/nsterm.h index 443a40e..63472f2 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -451,16 +451,16 @@ } /* AppKit-side interface */ -- (instancetype)menuDown: (id)sender; -- (instancetype)toolbarClicked: (id)item; -- (instancetype)toggleToolbar: (id)sender; +- menuDown: (id)sender; +- toolbarClicked: (id)item; +- toggleToolbar: (id)sender; - (void)keyDown: (NSEvent *)theEvent; - (void)mouseDown: (NSEvent *)theEvent; - (void)mouseUp: (NSEvent *)theEvent; -- (instancetype)setMiniwindowImage: (BOOL)setMini; +- setMiniwindowImage: (BOOL)setMini; /* Emacs-side interface */ -- (instancetype) initFrameFromEmacs: (struct frame *) f; +- initFrameFromEmacs: (struct frame *) f; - (void) createToolbar: (struct frame *)f; - (void) setRows: (int) r andColumns: (int) c; - (void) setWindowClosing: (BOOL)closing; @@ -520,7 +520,7 @@ unsigned long keyEquivModMask; } -- (instancetype)initWithTitle: (NSString *)title frame: (struct frame *)f; +- initWithTitle: (NSString *)title frame: (struct frame *)f; - (void)setFrame: (struct frame *)f; - (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */ - (NSString *)parseKeyEquiv: (const char *)key; @@ -554,7 +554,7 @@ NSArray *prevIdentifiers; unsigned long enablement, prevEnablement; } -- (instancetype) initForView: (EmacsView *)view withIdentifier: (NSString *)identifier; +- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier; - (void) clearActive; - (void) clearAll; - (BOOL) changed; @@ -589,7 +589,7 @@ Lisp_Object dialog_return; Lisp_Object *button_values; } -- (instancetype)initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; +- initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ; - (void)process_dialog: (Lisp_Object)list; - (void)addButton: (char *)str value: (int)tag row: (int)row; - (void)addString: (char *)str row: (int)row; @@ -608,7 +608,7 @@ NSTextField *textField; NSTimer *timer; } -- (instancetype) init; +- init; - (void) setText: (char *)text; - (void) showAtX: (int)x Y: (int)y for: (int)seconds; - (void) hide; @@ -656,12 +656,12 @@ NSColor *stippleMask; unsigned long xbm_fg; } -+ (instancetype)allocInitFromFile: (Lisp_Object)file; ++ allocInitFromFile: (Lisp_Object)file; - (void)dealloc; -- (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h +- initFromXBM: (unsigned char *)bits width: (int)w height: (int)h fg: (unsigned long)fg bg: (unsigned long)bg; -- (instancetype)setXBMColor: (NSColor *)color; -- (instancetype)initForXPMWithDepth: (int)depth width: (int)width height: (int)height; +- setXBMColor: (NSColor *)color; +- initForXPMWithDepth: (int)depth width: (int)width height: (int)height; - (void)setPixmapData; - (unsigned long)getPixelAtX: (int)x Y: (int)y; - (void)setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r @@ -700,16 +700,16 @@ int em_whole; } -- (instancetype) initFrame: (NSRect )r window: (Lisp_Object)win; +- initFrame: (NSRect )r window: (Lisp_Object)win; - (void)setFrame: (NSRect)r; -- (instancetype) setPosition: (int) position portion: (int) portion whole: (int) whole; +- setPosition: (int) position portion: (int) portion whole: (int) whole; - (int) checkSamePosition: (int)position portion: (int)portion whole: (int)whole; - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e; -- (instancetype)repeatScroll: (NSTimer *)sender; -- (instancetype)condemn; -- (instancetype)reprieve; +- repeatScroll: (NSTimer *)sender; +- condemn; +- reprieve; - (bool)judge; + (CGFloat)scrollerWidth; @end @@ -732,7 +732,7 @@ unsigned long maxChar, maxGlyph; long i, len; } -- (instancetype)initWithCapacity: (unsigned long) c; +- initWithCapacity: (unsigned long) c; - (void) setString: (NSString *)str font: (NSFont *)font; @end #endif /* NS_IMPL_COCOA */ diff --git a/src/nsterm.m b/src/nsterm.m index e69aa43..b0bb9ec 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6897,7 +6897,7 @@ This avoids an extra clear and redraw (flicker) at frame creation. */ } -- (instancetype) initFrameFromEmacs: (struct frame *)f +- initFrameFromEmacs: (struct frame *)f { NSRect r, wr; Lisp_Object tem; @@ -7627,7 +7627,7 @@ - (void)mouseExited: (NSEvent *)theEvent } -- (instancetype)menuDown: sender +- menuDown: sender { NSTRACE ("[EmacsView menuDown:]"); if (context_menu_value == -1) @@ -7652,7 +7652,7 @@ - (EmacsToolbar *)toolbar /* this gets called on toolbar button click */ -- (instancetype)toolbarClicked: (id)item +- toolbarClicked: (id)item { NSEvent *theEvent; int idx = [item tag] * TOOL_BAR_ITEM_NSLOTS; @@ -7678,7 +7678,7 @@ - (instancetype)toolbarClicked: (id)item } -- (instancetype)toggleToolbar: (id)sender +- toggleToolbar: (id)sender { NSTRACE ("[EmacsView toggleToolbar:]"); @@ -7906,7 +7906,7 @@ - (BOOL) writeSelectionToPasteboard: (NSPasteboard *)pb types: (NSArray *)types (gives a miniaturized version of the window); currently we use the latter for frames whose active buffer doesn't correspond to any file (e.g., '*scratch*') */ -- (instancetype)setMiniwindowImage: (BOOL) setMini +- setMiniwindowImage: (BOOL) setMini { id image = [[self window] miniwindowImage]; NSTRACE ("[EmacsView setMiniwindowImage:%d]", setMini); @@ -8258,7 +8258,7 @@ + (CGFloat) scrollerWidth return r; } -- (instancetype)initFrame: (NSRect )r window: (Lisp_Object)nwin +- initFrame: (NSRect )r window: (Lisp_Object)nwin { NSTRACE ("[EmacsScroller initFrame: window:]"); @@ -8342,7 +8342,7 @@ - (void)dealloc } -- (instancetype)condemn +- condemn { NSTRACE ("[EmacsScroller condemn]"); condemned =YES; @@ -8350,7 +8350,7 @@ - (instancetype)condemn } -- (instancetype)reprieve +- reprieve { NSTRACE ("[EmacsScroller reprieve]"); condemned =NO; @@ -8405,7 +8405,7 @@ - (int) checkSamePosition: (int) position portion: (int) portion } -- (instancetype)setPosition: (int)position portion: (int)portion whole: (int)whole +- setPosition: (int)position portion: (int)portion whole: (int)whole { NSTRACE ("[EmacsScroller setPosition:portion:whole:]"); @@ -8484,7 +8484,7 @@ - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e /* called manually thru timer to implement repeated button action w/hold-down */ -- (instancetype)repeatScroll: (NSTimer *)scrollEntry +- repeatScroll: (NSTimer *)scrollEntry { NSEvent *e = [[self window] currentEvent]; NSPoint p = [[self window] mouseLocationOutsideOfEventStream]; -- 1.7.4.4