summaryrefslogtreecommitdiff
path: root/src/nsfns.m
diff options
context:
space:
mode:
authorAdrian Robert <Adrian.B.Robert@gmail.com>2008-10-22 12:51:29 +0000
committerAdrian Robert <Adrian.B.Robert@gmail.com>2008-10-22 12:51:29 +0000
commitcb83c00bd13b63c0d0752698e4ad441968bc04ac (patch)
tree5d084c901b9b4d0962875f80be6d6351b92de1bb /src/nsfns.m
parent20a360544d7e9f11e2fb2eed73e7f5e6a0d152bb (diff)
downloademacs-cb83c00bd13b63c0d0752698e4ad441968bc04ac.tar.gz
* lisp/version.el (emacs-version): Change '*Step' to 'NS' for consistency with other documentation. * src/nsfns.m (ns_appkit_version): New function. (x-server-version): Use it. (syms_of_nsfns): Define ns-version-string here, not nsterm.m. (x-server-vendor): Don't check_ns(). * nsterm.m (syms_of_nsterm): Drop ns-version-string.
Diffstat (limited to 'src/nsfns.m')
-rw-r--r--src/nsfns.m45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index f14851b698f..459c058f7ca 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -86,7 +86,10 @@ char panelOK = 0;
/* Alist of elements (REGEXP . IMAGE) for images of icons associated
to frames.*/
-Lisp_Object Vns_icon_type_alist;
+static Lisp_Object Vns_icon_type_alist;
+
+/* Toolkit version support. */
+static Lisp_Object Vns_version_string;
EmacsTooltip *ns_tooltip;
@@ -950,6 +953,25 @@ ns_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
}
+#define Str(x) #x
+#define Xstr(x) Str(x)
+
+static Lisp_Object
+ns_appkit_version ()
+{
+ char tmp[80];
+
+#ifdef NS_IMPL_GNUSTEP
+ sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION));
+#elif defined(NS_IMPL_COCOA)
+ sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber);
+#else
+ tmp = "ns-unknown";
+#endif
+ return build_string (tmp);
+}
+
+
static void
x_icon (struct frame *f, Lisp_Object parms)
/* --------------------------------------------------------------------------
@@ -1019,6 +1041,13 @@ frame_parm_handler ns_frame_parm_handlers[] =
};
+
+/* ==========================================================================
+
+ Lisp definitions
+
+ ========================================================================== */
+
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms.
@@ -1321,12 +1350,6 @@ be shared by the new frame. */)
}
-/* ==========================================================================
-
- Lisp definitions
-
- ========================================================================== */
-
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
@@ -1575,7 +1598,6 @@ If omitted or nil, the selected frame's display is used. */)
(display)
Lisp_Object display;
{
- check_ns ();
#ifdef NS_IMPL_GNUSTEP
return build_string ("GNU");
#else
@@ -1592,8 +1614,7 @@ See also the function `ns-server-vendor'. */)
(display)
Lisp_Object display;
{
- /* FIXME: return GUI version on GNUstep, ?? on OS X */
- return build_string ("1.0");
+ return ns_appkit_version ();
}
@@ -2640,6 +2661,10 @@ When you miniaturize a Group, Summary or Article frame, Gnus.tiff will
be used as the image of the icon representing the frame. */);
Vns_icon_type_alist = Fcons (Qt, Qnil);
+ DEFVAR_LISP ("ns-version-string", &Vns_version_string,
+ doc: /* Toolkit version for NS Windowing. */);
+ Vns_version_string = ns_appkit_version ();
+
defsubr (&Sns_read_file_name);
defsubr (&Sns_get_resource);
defsubr (&Sns_set_resource);