void
haiku_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
+ Emacs_Color color;
+ struct face *defface;
+
CHECK_STRING (arg);
block_input ();
- Emacs_Color color;
-
if (haiku_get_color (SSDATA (arg), &color))
{
store_frame_param (f, Qbackground_color, oldval);
if (FRAME_HAIKU_VIEW (f))
{
- struct face *defface;
-
BView_draw_lock (FRAME_HAIKU_VIEW (f), false, 0, 0, 0, 0);
BView_SetViewColor (FRAME_HAIKU_VIEW (f), color.pixel);
BView_draw_unlock (FRAME_HAIKU_VIEW (f));
void
haiku_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- CHECK_STRING (arg);
+ Emacs_Color color, fore_pixel;
+ CHECK_STRING (arg);
block_input ();
- Emacs_Color color, fore_pixel;
if (haiku_get_color (SSDATA (arg), &color))
{
{
unsigned char *data;
int32_t bytes_per_row;
- int mono_p;
- int left;
- int right;
- int top;
- int bottom;
+ int mono_p, left, right, top, bottom, byte;
data = BBitmap_data (bitmap);
BBitmap_dimensions (bitmap, &left, &top, &right, &bottom,
if (!mono_p)
return ((uint32_t *) (data + (bytes_per_row * y)))[x];
- int byte = y * bytes_per_row + x / 8;
+ byte = y * bytes_per_row + x / 8;
return data[byte] & (1 << (x % 8));
}
void
haiku_put_pixel (haiku bitmap, int x, int y, unsigned long pixel)
{
- unsigned char *data;
+ unsigned char *data, *byte;
int32_t bytes_per_row;
- int mono_p;
- int left;
- int right;
- int top;
- int bottom;
+ int mono_p, left, right, top, bottom;
+ ptrdiff_t off, bit, xoff;
data = BBitmap_data (bitmap);
BBitmap_dimensions (bitmap, &left, &top, &right, &bottom,
if (mono_p)
{
- ptrdiff_t off = y * bytes_per_row;
- ptrdiff_t bit = x % 8;
- ptrdiff_t xoff = x / 8;
+ off = y * bytes_per_row;
+ bit = x % 8;
+ xoff = x / 8;
- unsigned char *byte = data + off + xoff;
+ byte = data + off + xoff;
if (!pixel)
*byte &= ~(1 << bit);
else
}
void
-haiku_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+haiku_set_internal_border_width (struct frame *f, Lisp_Object arg,
+ Lisp_Object oldval)
{
int old_width = FRAME_INTERNAL_BORDER_WIDTH (f);
int new_width = check_int_nonnegative (arg);
return check_haiku_display_info (object);
}
-/* Rename frame F to NAME. If NAME is nil, set F's name to "GNU
- Emacs". If EXPLICIT_P is non-zero, that indicates Lisp code is
- setting the name, not redisplay; in that case, set F's name to NAME
- and set F->explicit_name; if NAME is nil, clear F->explicit_name.
+/* Rename frame F to NAME. If NAME is nil, set F's name to the
+ default name. If EXPLICIT_P is non-zero, that indicates Lisp code
+ is setting the name, not redisplay; in that case, set F's name to
+ NAME and set F->explicit_name; if NAME is nil, clear
+ F->explicit_name.
If EXPLICIT_P is zero, it means redisplay is setting the name; the
name provided will be ignored if explicit_name is set. */
void
haiku_set_name (struct frame *f, Lisp_Object name, bool explicit_p)
{
+ struct haiku_display_info *dpyinfo;
+
if (explicit_p)
{
if (f->explicit_name && NILP (name))
- update_mode_lines = 24;
+ update_mode_lines = 37;
f->explicit_name = !NILP (name);
}
else if (f->explicit_name)
return;
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
if (NILP (name))
- name = build_unibyte_string ("GNU Emacs");
+ name = dpyinfo->default_name;
if (!NILP (Fstring_equal (name, f->name)))
return;
{
#endif
EmacsView_set_up_double_buffering (FRAME_HAIKU_VIEW (f));
+
if (!NILP (old_value))
- {
- SET_FRAME_GARBAGED (f);
- expose_frame (f, 0, 0, 0, 0);
- }
+ expose_frame (f, 0, 0, 0, 0);
#ifndef USE_BE_CAIRO
}
else
selected frame's display. */)
(void)
{
- if (!x_display_list)
- return Qnil;
-
struct frame *f = SELECTED_FRAME ();
+ void *view;
+ int x, y;
- if (FRAME_INITIAL_P (f) || !FRAME_HAIKU_P (f)
- || !FRAME_HAIKU_VIEW (f))
+ if (FRAME_INITIAL_P (f) || !FRAME_HAIKU_P (f))
return Qnil;
block_input ();
- void *view = FRAME_HAIKU_VIEW (f);
-
- int x, y;
+ view = FRAME_HAIKU_VIEW (f);
BView_get_mouse (view, &x, &y);
BView_convert_to_screen (view, &x, &y);
unblock_input ();
(Lisp_Object color, Lisp_Object frame)
{
Emacs_Color col;
+
CHECK_STRING (color);
decode_window_system_frame (frame);
(Lisp_Object color, Lisp_Object frame)
{
Emacs_Color col;
+
CHECK_STRING (color);
decode_window_system_frame (frame);
return Qnil;
}
unblock_input ();
- return list3i (lrint (col.red), lrint (col.green), lrint (col.blue));
+
+ return list3i (lrint (col.red), lrint (col.green),
+ lrint (col.blue));
}
DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
doc: /* SKIP: real doc in xfns.c. */)
(Lisp_Object frame)
{
- struct frame *f = decode_live_frame (frame);
- check_window_system (f);
+ struct frame *f = decode_window_system_frame (frame);
return EmacsView_double_buffered_p (FRAME_HAIKU_VIEW (f)) ? Qt : Qnil;
}
doc: /* SKIP: real doc in xfns.c. */)
(Lisp_Object terminal)
{
+ struct frame *f;
+
if (FRAMEP (terminal))
{
- CHECK_LIVE_FRAME (terminal);
- struct frame *f = decode_window_system_frame (terminal);
+ f = decode_window_system_frame (terminal);
- if (FRAME_HAIKU_VIEW (f) &&
- EmacsView_double_buffered_p (FRAME_HAIKU_VIEW (f)))
+ if (FRAME_HAIKU_VIEW (f)
+ && EmacsView_double_buffered_p (FRAME_HAIKU_VIEW (f)))
return FRAME_PARENT_FRAME (f) ? Qwhen_mapped : Qalways;
else
return Qnot_useful;
|| b->y < r.y || b->y >= r.y + r.height)
{
f->mouse_moved = true;
- dpyinfo->last_mouse_scroll_bar = NULL;
note_mouse_highlight (f, b->x, b->y);
remember_mouse_glyph (f, b->x, b->y,
&FRAME_DISPLAY_INFO (f)->last_mouse_glyph);
{
struct haiku_display_info *dpyinfo;
struct terminal *terminal;
-
- Lisp_Object color_file, color_map;
+ Lisp_Object color_file, color_map, system_name;
+ ptrdiff_t nbytes;
+ void *name_buffer;
block_input ();
Fset_input_interrupt_mode (Qt);
BCursor_from_id (CURSOR_ID_NO_CURSOR));
#undef ASSIGN_CURSOR
+ system_name = Fsystem_name ();
+
+ if (STRINGP (system_name))
+ {
+ nbytes = sizeof "GNU Emacs" + sizeof " at ";
+
+ if (INT_ADD_WRAPV (nbytes, SBYTES (system_name), &nbytes))
+ memory_full (SIZE_MAX);
+
+ name_buffer = alloca (nbytes);
+ sprintf (name_buffer, "%s%s%s", "GNU Emacs",
+ " at ", SDATA (system_name));
+ dpyinfo->default_name = build_string (name_buffer);
+ }
+ else
+ dpyinfo->default_name = build_string ("GNU Emacs");
+
unblock_input ();
return dpyinfo;
mark_haiku_display (void)
{
if (x_display_list)
- mark_object (x_display_list->color_map);
+ {
+ mark_object (x_display_list->color_map);
+ mark_object (x_display_list->default_name);
+ }
}
void