Mercurial > emacs
comparison src/xfns.c @ 47058:9e33c7ce6379
(x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist.
(Vblink_cursor_alist): New variable.
(syms_of_xfns): Initialize and defvar it.
(x_specified_cursor_type): Recognize Qbox for filled box.
Exceptions are hollow boxes.
(Qbox, Qhollow): New variables.
(syms_of_xfns): Initialize and staticpro them.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 27 Aug 2002 18:45:01 +0000 |
parents | 0baf57bc9d62 |
children | 527c24dbb2b1 |
comparison
equal
deleted
inserted
replaced
47057:004e8a6d7bd5 | 47058:9e33c7ce6379 |
---|---|
181 | 181 |
182 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */ | 182 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */ |
183 | 183 |
184 Lisp_Object Vx_pixel_size_width_font_regexp; | 184 Lisp_Object Vx_pixel_size_width_font_regexp; |
185 | 185 |
186 /* How to blink the cursor off. */ | |
187 Lisp_Object Vblink_cursor_alist; | |
188 | |
186 Lisp_Object Qauto_raise; | 189 Lisp_Object Qauto_raise; |
187 Lisp_Object Qauto_lower; | 190 Lisp_Object Qauto_lower; |
188 Lisp_Object Qbar, Qhbar; | 191 Lisp_Object Qbar, Qhbar, Qbox, Qhollow; |
189 Lisp_Object Qborder_color; | 192 Lisp_Object Qborder_color; |
190 Lisp_Object Qborder_width; | 193 Lisp_Object Qborder_width; |
191 Lisp_Object Qbox; | 194 Lisp_Object Qbox; |
192 Lisp_Object Qcursor_color; | 195 Lisp_Object Qcursor_color; |
193 Lisp_Object Qcursor_type; | 196 Lisp_Object Qcursor_type; |
1871 type = HBAR_CURSOR; | 1874 type = HBAR_CURSOR; |
1872 *width = XINT (XCDR (arg)); | 1875 *width = XINT (XCDR (arg)); |
1873 } | 1876 } |
1874 else if (NILP (arg)) | 1877 else if (NILP (arg)) |
1875 type = NO_CURSOR; | 1878 type = NO_CURSOR; |
1879 else if (EQ (arg, Qbox)) | |
1880 type = FILLED_BOX_CURSOR; | |
1876 else | 1881 else |
1877 /* Treat anything unknown as "box cursor". | 1882 /* Treat anything unknown as "hollow box cursor". |
1878 It was bad to signal an error; people have trouble fixing | 1883 It was bad to signal an error; people have trouble fixing |
1879 .Xdefaults with Emacs, when it has something bad in it. */ | 1884 .Xdefaults with Emacs, when it has something bad in it. */ |
1880 type = FILLED_BOX_CURSOR; | 1885 type = HOLLOW_BOX_CURSOR; |
1881 | 1886 |
1882 return type; | 1887 return type; |
1883 } | 1888 } |
1884 | 1889 |
1885 void | 1890 void |
1886 x_set_cursor_type (f, arg, oldval) | 1891 x_set_cursor_type (f, arg, oldval) |
1887 FRAME_PTR f; | 1892 FRAME_PTR f; |
1888 Lisp_Object arg, oldval; | 1893 Lisp_Object arg, oldval; |
1889 { | 1894 { |
1890 int width; | 1895 int width; |
1896 Lisp_Object tem; | |
1891 | 1897 |
1892 FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); | 1898 FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); |
1893 f->output_data.x->cursor_width = width; | 1899 f->output_data.x->cursor_width = width; |
1894 | 1900 |
1895 /* Make sure the cursor gets redrawn. */ | 1901 /* Make sure the cursor gets redrawn. */ |
1896 cursor_type_changed = 1; | 1902 cursor_type_changed = 1; |
1903 | |
1904 /* By default, set up the blink-off state depending on the on-state. */ | |
1905 | |
1906 if (FRAME_DESIRED_CURSOR (f) == FILLED_BOX_CURSOR) | |
1907 FRAME_BLINK_OFF_CURSOR (f) = HOLLOW_BOX_CURSOR; | |
1908 else if (FRAME_DESIRED_CURSOR (f) == BAR_CURSOR && FRAME_CURSOR_WIDTH (f) > 1) | |
1909 { | |
1910 FRAME_BLINK_OFF_CURSOR (f) = BAR_CURSOR; | |
1911 FRAME_BLINK_OFF_CURSOR_WIDTH (f) = 1; | |
1912 } | |
1913 else | |
1914 FRAME_BLINK_OFF_CURSOR (f) = NO_CURSOR; | |
1915 | |
1916 tem = Fassoc (arg, Vblink_cursor_alist); | |
1917 if (!NILP (tem)) | |
1918 { | |
1919 FRAME_BLINK_OFF_CURSOR (f) | |
1920 = x_specified_cursor_type (XCDR (tem), &width); | |
1921 f->output_data.x->blink_off_cursor_width = width; | |
1922 } | |
1897 } | 1923 } |
1898 | 1924 |
1899 void | 1925 void |
1900 x_set_icon_type (f, arg, oldval) | 1926 x_set_icon_type (f, arg, oldval) |
1901 struct frame *f; | 1927 struct frame *f; |
11842 staticpro (&Qauto_lower); | 11868 staticpro (&Qauto_lower); |
11843 Qbar = intern ("bar"); | 11869 Qbar = intern ("bar"); |
11844 staticpro (&Qbar); | 11870 staticpro (&Qbar); |
11845 Qhbar = intern ("hbar"); | 11871 Qhbar = intern ("hbar"); |
11846 staticpro (&Qhbar); | 11872 staticpro (&Qhbar); |
11873 Qbox = intern ("box"); | |
11874 staticpro (&Qbox); | |
11875 Qhollow = intern ("hollow"); | |
11876 staticpro (&Qhollow); | |
11847 Qborder_color = intern ("border-color"); | 11877 Qborder_color = intern ("border-color"); |
11848 staticpro (&Qborder_color); | 11878 staticpro (&Qborder_color); |
11849 Qborder_width = intern ("border-width"); | 11879 Qborder_width = intern ("border-width"); |
11850 staticpro (&Qborder_width); | 11880 staticpro (&Qborder_width); |
11851 Qbox = intern ("box"); | 11881 Qbox = intern ("box"); |
11952 Fput (Qundefined_color, Qerror_message, | 11982 Fput (Qundefined_color, Qerror_message, |
11953 build_string ("Undefined color")); | 11983 build_string ("Undefined color")); |
11954 | 11984 |
11955 init_x_parm_symbols (); | 11985 init_x_parm_symbols (); |
11956 | 11986 |
11987 DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist, | |
11988 doc: /* Alist specifying how to blink the cursor off. | |
11989 Each element has the form (ON-STATE . OFF-STATE). Whenever the | |
11990 `cursor-type' frame-parameter or variable equals ON-STATE, | |
11991 comparing using `equal', Emacs uses OFF-STATE to specify | |
11992 how to blink it off. */); | |
11993 Vblink_cursor_alist = Qnil; | |
11994 | |
11957 DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images, | 11995 DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images, |
11958 doc: /* Non-nil means always draw a cross over disabled images. | 11996 doc: /* Non-nil means always draw a cross over disabled images. |
11959 Disabled images are those having an `:conversion disabled' property. | 11997 Disabled images are those having an `:conversion disabled' property. |
11960 A cross is always drawn on black & white displays. */); | 11998 A cross is always drawn on black & white displays. */); |
11961 cross_disabled_images = 0; | 11999 cross_disabled_images = 0; |