Commit f5497e45 authored by Adrian Robert's avatar Adrian Robert
Browse files

(ns_appkit_version_str): Rename from ns_appkit_version. ...

(ns_appkit_version_str): Rename from ns_appkit_version.  (ns_appkit_version_int): New function.  (x-server-version): Use ns_appkit_version_int and follow 21+ convention of returning 3 integers
parent d00da9d7
2008-12-31 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfns.m (ns_appkit_version_str): Rename from ns_appkit_version.
(ns_appkit_version_int): New function.
(x-server-version): Use ns_appkit_version_int and follow 21+
convention of returning 3 integers.
2008-12-30 Kenichi Handa <handa@m17n.org> 2008-12-30 Kenichi Handa <handa@m17n.org>
   
* character.h (CHAR_VARIATION_SELECTOR_P): New macro. * character.h (CHAR_VARIATION_SELECTOR_P): New macro.
......
...@@ -952,7 +952,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -952,7 +952,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
#define Xstr(x) Str(x) #define Xstr(x) Str(x)
static Lisp_Object static Lisp_Object
ns_appkit_version () ns_appkit_version_str ()
{ {
char tmp[80]; char tmp[80];
...@@ -967,6 +967,21 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -967,6 +967,21 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
} }
/* This is for use by x-server-version and collapses all version info we
have into a single int. For a better picture of the implementation
running, use ns_appkit_version_str.*/
static int
ns_appkit_version_int ()
{
#ifdef NS_IMPL_GNUSTEP
return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GNU_MINOR_VERSION;
#elif defined(NS_IMPL_COCOA)
return (int)NSAppKitVersionNumber;
#endif
return 0;
}
static void static void
x_icon (struct frame *f, Lisp_Object parms) x_icon (struct frame *f, Lisp_Object parms)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
...@@ -1602,14 +1617,26 @@ DISPLAY should be either a frame or a display name (a string). ...@@ -1602,14 +1617,26 @@ DISPLAY should be either a frame or a display name (a string).
DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
doc: /* Return the version number of Nextstep display server DISPLAY. doc: /* Return the version numbers of the server of DISPLAY.
The value is a list of three integers: the major and minor
version numbers of the X Protocol in use, and the distributor-specific
release number. See also the function `x-server-vendor'.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string). DISPLAY should be either a frame or a display name (a string).
If omitted or nil, the selected frame's display is used. If omitted or nil, that stands for the selected frame's display. */)
See also the function `ns-server-vendor'. */)
(display) (display)
Lisp_Object display; Lisp_Object display;
{ {
return ns_appkit_version (); /*NOTE: it is unclear what would best correspond with "protocol";
we return 10.3, meaning Panther, since this is roughly the
level that GNUstep's APIs correspond to.
The last number is where we distinguish between the Apple
and GNUstep implementations ("distributor-specific release
number") and give int'ized versions of major.minor. */
return Fcons (make_number (10),
Fcons (make_number (3),
Fcons (make_number (ns_appkit_version_int()), Qnil)));
} }
...@@ -2658,7 +2685,7 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename ...@@ -2658,7 +2685,7 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
DEFVAR_LISP ("ns-version-string", &Vns_version_string, DEFVAR_LISP ("ns-version-string", &Vns_version_string,
doc: /* Toolkit version for NS Windowing. */); doc: /* Toolkit version for NS Windowing. */);
Vns_version_string = ns_appkit_version (); Vns_version_string = ns_appkit_version_str ();
defsubr (&Sns_read_file_name); defsubr (&Sns_read_file_name);
defsubr (&Sns_get_resource); defsubr (&Sns_get_resource);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment