summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2011-07-08 12:04:23 +0200
committerJan Djärv <jan.h.d@swipnet.se>2011-07-08 12:04:23 +0200
commit4393663bc52fc24c15aa9c1779dfc23d3a0f901f (patch)
treeac7c3b0fd0cf38005423465b7779da4ed2c3bb87 /src/nsterm.m
parent2287ac9896c30303d7f469a3e5cb348fbbbd9e23 (diff)
downloademacs-4393663bc52fc24c15aa9c1779dfc23d3a0f901f.tar.gz
Fix warnings in ns*m files: Replace deprecated methods, declare new interfaces.
* emacs.c: Declare unexec_init_emacs_zone. * nsfns.m (check_ns_display_info): Cast to long and use %ld in error to avoid warning. * nsimage.m (allocInitFromFile): Don't use deprecated method bestRepresentationForDevice on OSX >= 10.6. * nsmenu.m (fillWithWidgetValue): Don't use depercated method sizeToFit on OSX >= 10.2. * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods cString and lossyCString on OSX >= 10.4 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4) (MAC_OS_X_VERSION_10_5): Define if not defined. (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6. (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6. (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6. * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and variable firstTime not needed on OSX >= 10.6. (setPosition): setFloatValue:knobProportion: is deprecated on OSX >= 10.5. Use setKnobProportion, setDoubleValue.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index ac95409ee7e..b724b6a02f3 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4515,7 +4515,9 @@ ns_term_shutdown (int sig)
unsigned fnKeysym = 0;
int flags;
static NSMutableArray *nsEvArray;
+#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
static BOOL firstTime = YES;
+#endif
int left_is_none;
NSTRACE (keyDown);
@@ -4703,13 +4705,15 @@ ns_term_shutdown (int sig)
}
}
+
+#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
/* if we get here we should send the key for input manager processing */
if (firstTime && [[NSInputManager currentInputManager]
wantsToDelayTextChangeNotifications] == NO)
fprintf (stderr,
"Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n");
firstTime = NO;
-
+#endif
if (NS_KEYLOG && !processingCompose)
fprintf (stderr, "keyDown: Begin compose sequence.\n");
@@ -6066,14 +6070,26 @@ ns_term_shutdown (int sig)
em_whole = whole;
if (portion >= whole)
- [self setFloatValue: 0.0 knobProportion: 1.0];
+ {
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ [self setKnobProportion: 1.0];
+ [self setDoubleValue: 1.0];
+#else
+ [self setFloatValue: 0.0 knobProportion: 1.0];
+#endif
+ }
else
{
float pos, por;
portion = max ((float)whole*min_portion/pixel_height, portion);
pos = (float)position / (whole - portion);
por = (float)portion/whole;
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ [self setKnobProportion: por];
+ [self setDoubleValue: pos];
+#else
[self setFloatValue: pos knobProportion: por];
+#endif
}
return self;
}