emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src ChangeLog nsfns.m


From: Adrian Robert
Subject: [Emacs-diffs] emacs/src ChangeLog nsfns.m
Date: Wed, 31 Dec 2008 14:59:39 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 08/12/31 14:59:39

Modified files:
        src            : ChangeLog nsfns.m 

Log message:
        (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

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7239&r2=1.7240
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsfns.m?cvsroot=emacs&r1=1.29&r2=1.30

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7239
retrieving revision 1.7240
diff -u -b -r1.7239 -r1.7240
--- ChangeLog   30 Dec 2008 23:42:40 -0000      1.7239
+++ ChangeLog   31 Dec 2008 14:59:37 -0000      1.7240
@@ -1,3 +1,10 @@
+2008-12-31  Adrian Robert  <address@hidden>
+
+       * 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  <address@hidden>
 
        * character.h (CHAR_VARIATION_SELECTOR_P): New macro.

Index: nsfns.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfns.m,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- nsfns.m     7 Dec 2008 05:00:56 -0000       1.29
+++ nsfns.m     31 Dec 2008 14:59:39 -0000      1.30
@@ -952,7 +952,7 @@
 #define Xstr(x) Str(x)
 
 static Lisp_Object
-ns_appkit_version ()
+ns_appkit_version_str ()
 {
   char tmp[80];
 
@@ -967,6 +967,21 @@
 }
 
 
+/* 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
 x_icon (struct frame *f, Lisp_Object parms)
 /* --------------------------------------------------------------------------
@@ -1602,14 +1617,26 @@
 
 
 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).
-If omitted or nil, the selected frame's display is used.
-See also the function `ns-server-vendor'.  */)
+If omitted or nil, that stands for the selected frame's display.  */)
      (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 @@
 
   DEFVAR_LISP ("ns-version-string", &Vns_version_string,
                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_get_resource);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]