Mercurial > emacs
comparison src/nsfns.m @ 100802:ded357c75f85
(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
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Wed, 31 Dec 2008 14:59:37 +0000 |
parents | b78192f63101 |
children | 03cb6ea90f92 |
comparison
equal
deleted
inserted
replaced
100801:da95fec1ae70 | 100802:ded357c75f85 |
---|---|
950 | 950 |
951 #define Str(x) #x | 951 #define Str(x) #x |
952 #define Xstr(x) Str(x) | 952 #define Xstr(x) Str(x) |
953 | 953 |
954 static Lisp_Object | 954 static Lisp_Object |
955 ns_appkit_version () | 955 ns_appkit_version_str () |
956 { | 956 { |
957 char tmp[80]; | 957 char tmp[80]; |
958 | 958 |
959 #ifdef NS_IMPL_GNUSTEP | 959 #ifdef NS_IMPL_GNUSTEP |
960 sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION)); | 960 sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION)); |
962 sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber); | 962 sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber); |
963 #else | 963 #else |
964 tmp = "ns-unknown"; | 964 tmp = "ns-unknown"; |
965 #endif | 965 #endif |
966 return build_string (tmp); | 966 return build_string (tmp); |
967 } | |
968 | |
969 | |
970 /* This is for use by x-server-version and collapses all version info we | |
971 have into a single int. For a better picture of the implementation | |
972 running, use ns_appkit_version_str.*/ | |
973 static int | |
974 ns_appkit_version_int () | |
975 { | |
976 #ifdef NS_IMPL_GNUSTEP | |
977 return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GNU_MINOR_VERSION; | |
978 #elif defined(NS_IMPL_COCOA) | |
979 return (int)NSAppKitVersionNumber; | |
980 #endif | |
981 return 0; | |
967 } | 982 } |
968 | 983 |
969 | 984 |
970 static void | 985 static void |
971 x_icon (struct frame *f, Lisp_Object parms) | 986 x_icon (struct frame *f, Lisp_Object parms) |
1600 #endif | 1615 #endif |
1601 } | 1616 } |
1602 | 1617 |
1603 | 1618 |
1604 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, | 1619 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
1605 doc: /* Return the version number of Nextstep display server DISPLAY. | 1620 doc: /* Return the version numbers of the server of DISPLAY. |
1621 The value is a list of three integers: the major and minor | |
1622 version numbers of the X Protocol in use, and the distributor-specific | |
1623 release number. See also the function `x-server-vendor'. | |
1624 | |
1625 The optional argument DISPLAY specifies which display to ask about. | |
1606 DISPLAY should be either a frame or a display name (a string). | 1626 DISPLAY should be either a frame or a display name (a string). |
1607 If omitted or nil, the selected frame's display is used. | 1627 If omitted or nil, that stands for the selected frame's display. */) |
1608 See also the function `ns-server-vendor'. */) | |
1609 (display) | 1628 (display) |
1610 Lisp_Object display; | 1629 Lisp_Object display; |
1611 { | 1630 { |
1612 return ns_appkit_version (); | 1631 /*NOTE: it is unclear what would best correspond with "protocol"; |
1632 we return 10.3, meaning Panther, since this is roughly the | |
1633 level that GNUstep's APIs correspond to. | |
1634 The last number is where we distinguish between the Apple | |
1635 and GNUstep implementations ("distributor-specific release | |
1636 number") and give int'ized versions of major.minor. */ | |
1637 return Fcons (make_number (10), | |
1638 Fcons (make_number (3), | |
1639 Fcons (make_number (ns_appkit_version_int()), Qnil))); | |
1613 } | 1640 } |
1614 | 1641 |
1615 | 1642 |
1616 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, | 1643 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, |
1617 doc: /* Return the number of screens on Nextstep display server DISPLAY. | 1644 doc: /* Return the number of screens on Nextstep display server DISPLAY. |
2656 be used as the image of the icon representing the frame. */); | 2683 be used as the image of the icon representing the frame. */); |
2657 Vns_icon_type_alist = Fcons (Qt, Qnil); | 2684 Vns_icon_type_alist = Fcons (Qt, Qnil); |
2658 | 2685 |
2659 DEFVAR_LISP ("ns-version-string", &Vns_version_string, | 2686 DEFVAR_LISP ("ns-version-string", &Vns_version_string, |
2660 doc: /* Toolkit version for NS Windowing. */); | 2687 doc: /* Toolkit version for NS Windowing. */); |
2661 Vns_version_string = ns_appkit_version (); | 2688 Vns_version_string = ns_appkit_version_str (); |
2662 | 2689 |
2663 defsubr (&Sns_read_file_name); | 2690 defsubr (&Sns_read_file_name); |
2664 defsubr (&Sns_get_resource); | 2691 defsubr (&Sns_get_resource); |
2665 defsubr (&Sns_set_resource); | 2692 defsubr (&Sns_set_resource); |
2666 defsubr (&Sxw_display_color_p); /* this and next called directly by C code */ | 2693 defsubr (&Sxw_display_color_p); /* this and next called directly by C code */ |