diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 97 |
1 files changed, 1 insertions, 96 deletions
diff --git a/src/xfns.c b/src/xfns.c index 882d641e226..f3f16d4abe1 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -183,12 +183,8 @@ Lisp_Object Vx_bitmap_file_path; | |||
| 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 | |||
| 189 | Lisp_Object Qauto_raise; | 186 | Lisp_Object Qauto_raise; |
| 190 | Lisp_Object Qauto_lower; | 187 | Lisp_Object Qauto_lower; |
| 191 | Lisp_Object Qbar, Qhbar, Qbox, Qhollow; | ||
| 192 | Lisp_Object Qborder_color; | 188 | Lisp_Object Qborder_color; |
| 193 | Lisp_Object Qborder_width; | 189 | Lisp_Object Qborder_width; |
| 194 | Lisp_Object Qbox; | 190 | Lisp_Object Qbox; |
| @@ -1837,89 +1833,16 @@ x_set_border_pixel (f, pix) | |||
| 1837 | } | 1833 | } |
| 1838 | 1834 | ||
| 1839 | 1835 | ||
| 1840 | /* Value is the internal representation of the specified cursor type | ||
| 1841 | ARG. If type is BAR_CURSOR, return in *WIDTH the specified width | ||
| 1842 | of the bar cursor. */ | ||
| 1843 | |||
| 1844 | enum text_cursor_kinds | ||
| 1845 | x_specified_cursor_type (arg, width) | ||
| 1846 | Lisp_Object arg; | ||
| 1847 | int *width; | ||
| 1848 | { | ||
| 1849 | enum text_cursor_kinds type; | ||
| 1850 | |||
| 1851 | if (EQ (arg, Qbar)) | ||
| 1852 | { | ||
| 1853 | type = BAR_CURSOR; | ||
| 1854 | *width = 2; | ||
| 1855 | } | ||
| 1856 | else if (CONSP (arg) | ||
| 1857 | && EQ (XCAR (arg), Qbar) | ||
| 1858 | && INTEGERP (XCDR (arg)) | ||
| 1859 | && XINT (XCDR (arg)) >= 0) | ||
| 1860 | { | ||
| 1861 | type = BAR_CURSOR; | ||
| 1862 | *width = XINT (XCDR (arg)); | ||
| 1863 | } | ||
| 1864 | else if (EQ (arg, Qhbar)) | ||
| 1865 | { | ||
| 1866 | type = HBAR_CURSOR; | ||
| 1867 | *width = 2; | ||
| 1868 | } | ||
| 1869 | else if (CONSP (arg) | ||
| 1870 | && EQ (XCAR (arg), Qhbar) | ||
| 1871 | && INTEGERP (XCDR (arg)) | ||
| 1872 | && XINT (XCDR (arg)) >= 0) | ||
| 1873 | { | ||
| 1874 | type = HBAR_CURSOR; | ||
| 1875 | *width = XINT (XCDR (arg)); | ||
| 1876 | } | ||
| 1877 | else if (NILP (arg)) | ||
| 1878 | type = NO_CURSOR; | ||
| 1879 | else if (EQ (arg, Qbox)) | ||
| 1880 | type = FILLED_BOX_CURSOR; | ||
| 1881 | else | ||
| 1882 | /* Treat anything unknown as "hollow box cursor". | ||
| 1883 | It was bad to signal an error; people have trouble fixing | ||
| 1884 | .Xdefaults with Emacs, when it has something bad in it. */ | ||
| 1885 | type = HOLLOW_BOX_CURSOR; | ||
| 1886 | |||
| 1887 | return type; | ||
| 1888 | } | ||
| 1889 | 1836 | ||
| 1890 | void | 1837 | void |
| 1891 | x_set_cursor_type (f, arg, oldval) | 1838 | x_set_cursor_type (f, arg, oldval) |
| 1892 | FRAME_PTR f; | 1839 | FRAME_PTR f; |
| 1893 | Lisp_Object arg, oldval; | 1840 | Lisp_Object arg, oldval; |
| 1894 | { | 1841 | { |
| 1895 | int width; | 1842 | set_frame_cursor_types (f, arg); |
| 1896 | Lisp_Object tem; | ||
| 1897 | |||
| 1898 | FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); | ||
| 1899 | f->output_data.x->cursor_width = width; | ||
| 1900 | 1843 | ||
| 1901 | /* Make sure the cursor gets redrawn. */ | 1844 | /* Make sure the cursor gets redrawn. */ |
| 1902 | cursor_type_changed = 1; | 1845 | 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 | } | ||
| 1923 | } | 1846 | } |
| 1924 | 1847 | ||
| 1925 | void | 1848 | void |
| @@ -11867,20 +11790,10 @@ syms_of_xfns () | |||
| 11867 | staticpro (&Qauto_raise); | 11790 | staticpro (&Qauto_raise); |
| 11868 | Qauto_lower = intern ("auto-lower"); | 11791 | Qauto_lower = intern ("auto-lower"); |
| 11869 | staticpro (&Qauto_lower); | 11792 | staticpro (&Qauto_lower); |
| 11870 | Qbar = intern ("bar"); | ||
| 11871 | staticpro (&Qbar); | ||
| 11872 | Qhbar = intern ("hbar"); | ||
| 11873 | staticpro (&Qhbar); | ||
| 11874 | Qbox = intern ("box"); | ||
| 11875 | staticpro (&Qbox); | ||
| 11876 | Qhollow = intern ("hollow"); | ||
| 11877 | staticpro (&Qhollow); | ||
| 11878 | Qborder_color = intern ("border-color"); | 11793 | Qborder_color = intern ("border-color"); |
| 11879 | staticpro (&Qborder_color); | 11794 | staticpro (&Qborder_color); |
| 11880 | Qborder_width = intern ("border-width"); | 11795 | Qborder_width = intern ("border-width"); |
| 11881 | staticpro (&Qborder_width); | 11796 | staticpro (&Qborder_width); |
| 11882 | Qbox = intern ("box"); | ||
| 11883 | staticpro (&Qbox); | ||
| 11884 | Qcursor_color = intern ("cursor-color"); | 11797 | Qcursor_color = intern ("cursor-color"); |
| 11885 | staticpro (&Qcursor_color); | 11798 | staticpro (&Qcursor_color); |
| 11886 | Qcursor_type = intern ("cursor-type"); | 11799 | Qcursor_type = intern ("cursor-type"); |
| @@ -11985,14 +11898,6 @@ syms_of_xfns () | |||
| 11985 | 11898 | ||
| 11986 | init_x_parm_symbols (); | 11899 | init_x_parm_symbols (); |
| 11987 | 11900 | ||
| 11988 | DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist, | ||
| 11989 | doc: /* Alist specifying how to blink the cursor off. | ||
| 11990 | Each element has the form (ON-STATE . OFF-STATE). Whenever the | ||
| 11991 | `cursor-type' frame-parameter or variable equals ON-STATE, | ||
| 11992 | comparing using `equal', Emacs uses OFF-STATE to specify | ||
| 11993 | how to blink it off. */); | ||
| 11994 | Vblink_cursor_alist = Qnil; | ||
| 11995 | |||
| 11996 | DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images, | 11901 | DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images, |
| 11997 | doc: /* Non-nil means always draw a cross over disabled images. | 11902 | doc: /* Non-nil means always draw a cross over disabled images. |
| 11998 | Disabled images are those having an `:conversion disabled' property. | 11903 | Disabled images are those having an `:conversion disabled' property. |