diff options
| author | Yuuki Harano | 2020-05-12 22:39:15 +0900 |
|---|---|---|
| committer | Jeff Walsh | 2020-11-24 12:24:40 +1100 |
| commit | d68633bfa1124e32f6aa6a288a9c7b2098a39bd8 (patch) | |
| tree | cff14bac6d7ece318d90b72e2e1919a195798c72 /src/pgtkterm.c | |
| parent | fe2297ce7aa0e400f4a80484e2872dcee0de1391 (diff) | |
| download | emacs-d68633bfa1124e32f6aa6a288a9c7b2098a39bd8.tar.gz emacs-d68633bfa1124e32f6aa6a288a9c7b2098a39bd8.zip | |
* src/pgtkterm.c (pgtk_defined_color): support gtk special colors
Color functions take the frame
* src/gtkutil.c (xg_check_special_colors): pass frame as argument.
* src/pgtkfns.c (x_set_foreground_color, x_set_background_color,
x_set_cursor_color, pgtk_set_scroll_bar_foreground,
pgtk_set_scroll_bar_background, Fxw_color_defined_p,
Fxw_color_values): pass frame as argument.
* src/pgtkterm.c (pgtk_parse_color): take frame as argument.
(pgtk_lisp_to_color): take frame as argument, and pass it.
Remove pgtk_lisp_to_color
* src/pgtkfns.c (x_set_foreground_color, x_set_background_color,
x_set_cursor_color): use x_decode_color instead of pgtk_lisp_to_color.
(Fxw_color_defined_p, Fxw_color_values):
use pgtk_defined_color instead of pgtk_lisp_to_color.
* src/pgtkterm.c (pgtk_lisp_to_color): remove.
* src/gtkutil.c (xg_check_special_colors): change color format
* src/pgtkterm.h: remove pgtk_lisp_to_color declaration
Diffstat (limited to 'src/pgtkterm.c')
| -rw-r--r-- | src/pgtkterm.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 2d1a990483f..ef8daba720a 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -6436,7 +6436,9 @@ pgtk_defined_color (struct frame *f, | |||
| 6436 | int r; | 6436 | int r; |
| 6437 | 6437 | ||
| 6438 | block_input (); | 6438 | block_input (); |
| 6439 | r = pgtk_parse_color (name, color_def); | 6439 | r = xg_check_special_colors(f, name, color_def); |
| 6440 | if (!r) | ||
| 6441 | r = pgtk_parse_color (f, name, color_def); | ||
| 6440 | unblock_input (); | 6442 | unblock_input (); |
| 6441 | return r; | 6443 | return r; |
| 6442 | } | 6444 | } |
| @@ -6449,7 +6451,7 @@ pgtk_defined_color (struct frame *f, | |||
| 6449 | and names we've actually looked up; list-colors-display is probably | 6451 | and names we've actually looked up; list-colors-display is probably |
| 6450 | the most color-intensive case we're likely to hit. */ | 6452 | the most color-intensive case we're likely to hit. */ |
| 6451 | 6453 | ||
| 6452 | int pgtk_parse_color (const char *color_name, Emacs_Color *color) | 6454 | int pgtk_parse_color (struct frame *f, const char *color_name, Emacs_Color *color) |
| 6453 | { | 6455 | { |
| 6454 | PGTK_TRACE("pgtk_parse_color: %s", color_name); | 6456 | PGTK_TRACE("pgtk_parse_color: %s", color_name); |
| 6455 | 6457 | ||
| @@ -6468,20 +6470,6 @@ int pgtk_parse_color (const char *color_name, Emacs_Color *color) | |||
| 6468 | return 0; | 6470 | return 0; |
| 6469 | } | 6471 | } |
| 6470 | 6472 | ||
| 6471 | int | ||
| 6472 | pgtk_lisp_to_color (Lisp_Object color, Emacs_Color *col) | ||
| 6473 | /* -------------------------------------------------------------------------- | ||
| 6474 | Convert a Lisp string object to a NS color | ||
| 6475 | -------------------------------------------------------------------------- */ | ||
| 6476 | { | ||
| 6477 | PGTK_TRACE("pgtk_lisp_to_color"); | ||
| 6478 | if (STRINGP (color)) | ||
| 6479 | return !pgtk_parse_color (SSDATA (color), col); | ||
| 6480 | else if (SYMBOLP (color)) | ||
| 6481 | return !pgtk_parse_color (SSDATA (SYMBOL_NAME (color)), col); | ||
| 6482 | return 1; | ||
| 6483 | } | ||
| 6484 | |||
| 6485 | /* On frame F, translate pixel colors to RGB values for the NCOLORS | 6473 | /* On frame F, translate pixel colors to RGB values for the NCOLORS |
| 6486 | colors in COLORS. On W32, we no longer try to map colors to | 6474 | colors in COLORS. On W32, we no longer try to map colors to |
| 6487 | a palette. */ | 6475 | a palette. */ |