summaryrefslogtreecommitdiff
path: root/src/haiku_font_support.cc
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-27 05:18:50 +0000
committerPo Lu <luangruo@yahoo.com>2022-04-27 05:19:15 +0000
commit0bea75c95a7e59c50be437956916cc0835655575 (patch)
tree0540633d8e9fdce6428c99755a366dc094327c7a /src/haiku_font_support.cc
parentf1e11deca641c3fd6d571afb6b8618143a16d226 (diff)
downloademacs-0bea75c95a7e59c50be437956916cc0835655575.tar.gz
emacs-0bea75c95a7e59c50be437956916cc0835655575.tar.bz2
emacs-0bea75c95a7e59c50be437956916cc0835655575.zip
Add simple session management support to Haiku
* lisp/term/common-win.el (emacs-save-session-functions): Move from x-win.el to common-win.el. * lisp/term/haiku-win.el (haiku-save-session-reply) (emacs-session-save, handle-save-session): New functions. * lisp/term/x-win.el (emacs-save-session-functions): Delete. * src/haiku_font_support.cc (font_style_to_flags): * src/haiku_support.h (enum haiku_font_weight): Turn weight macros into enum. (struct haiku_font_pattern): Likewise. (struct haiku_session_manager_reply): New struct. * src/haiku_io.c (haiku_io_init): Create sm port. * src/haiku_support.cc (QuitRequested): Wait for reply from sm port. * src/haikufns.c (Fhaiku_save_session_reply): New function. (syms_of_haikufns): Define new subr. * src/haikuterm.c (haiku_read_socket): Send session management events. (haiku_term_init): Check new port.
Diffstat (limited to 'src/haiku_font_support.cc')
-rw-r--r--src/haiku_font_support.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc
index 8da2437d660..9acdd652e34 100644
--- a/src/haiku_font_support.cc
+++ b/src/haiku_font_support.cc
@@ -292,10 +292,11 @@ font_style_to_flags (char *st, struct haiku_font_pattern *pattern)
{
char *style = strdup (st);
char *token;
- pattern->weight = -1;
+ int tok = 0;
+
+ pattern->weight = NO_WEIGHT;
pattern->width = NO_WIDTH;
pattern->slant = NO_SLANT;
- int tok = 0;
while ((token = std::strtok (!tok ? style : NULL, " ")) && tok < 3)
{
@@ -317,7 +318,7 @@ font_style_to_flags (char *st, struct haiku_font_pattern *pattern)
if (pattern->width == NO_WIDTH)
pattern->width = NORMAL_WIDTH;
- if (pattern->weight == -1)
+ if (pattern->weight == NO_WEIGHT)
pattern->weight = HAIKU_REGULAR;
}
else if (token && (!strcmp (token, "SemiBold")
@@ -370,7 +371,7 @@ font_style_to_flags (char *st, struct haiku_font_pattern *pattern)
tok++;
}
- if (pattern->weight != -1)
+ if (pattern->weight != NO_WEIGHT)
pattern->specified |= FSPEC_WEIGHT;
if (pattern->slant != NO_SLANT)
pattern->specified |= FSPEC_SLANT;