2 * Copyright 2001-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _INTERFACE_DEFS_H
6 #define _INTERFACE_DEFS_H
9 #include <GraphicsDefs.h>
19 // some handy UTF-8 characters
21 #define B_UTF8_BULLET "\xE2\x80\xA2"
22 #define B_UTF8_ELLIPSIS "\xE2\x80\xA6"
23 #define B_UTF8_OPEN_QUOTE "\xE2\x80\x9C"
24 #define B_UTF8_CLOSE_QUOTE "\xE2\x80\x9D"
25 #define B_UTF8_COPYRIGHT "\xC2\xA9"
26 #define B_UTF8_REGISTERED "\xC2\xAE"
27 #define B_UTF8_TRADEMARK "\xE2\x84\xA2"
28 #define B_UTF8_SMILING_FACE "\xE2\x98\xBB"
29 #define B_UTF8_HIROSHI "\xE5\xBC\x98"
32 #define B_MAX_MOUSE_BUTTONS 16
63 B_FUNCTION_KEY
= 0x10,
65 // for Japanese and Korean keyboards
66 B_KATAKANA_HIRAGANA
= 0xf2,
67 B_HANKAKU_ZENKAKU
= 0xf3,
95 uint32 left_shift_key
;
96 uint32 right_shift_key
;
97 uint32 left_command_key
;
98 uint32 right_command_key
;
99 uint32 left_control_key
;
100 uint32 right_control_key
;
101 uint32 left_option_key
;
102 uint32 right_option_key
;
104 uint32 lock_settings
;
105 int32 control_map
[128];
106 int32 option_caps_shift_map
[128];
107 int32 option_caps_map
[128];
108 int32 option_shift_map
[128];
109 int32 option_map
[128];
110 int32 caps_shift_map
[128];
112 int32 shift_map
[128];
113 int32 normal_map
[128];
114 int32 acute_dead_key
[32];
115 int32 grave_dead_key
[32];
116 int32 circumflex_dead_key
[32];
117 int32 dieresis_dead_key
[32];
118 int32 tilde_dead_key
[32];
121 uint32 circumflex_tables
;
122 uint32 dieresis_tables
;
127 B_CONTROL_TABLE
= 0x00000001,
128 B_OPTION_CAPS_SHIFT_TABLE
= 0x00000002,
129 B_OPTION_CAPS_TABLE
= 0x00000004,
130 B_OPTION_SHIFT_TABLE
= 0x00000008,
131 B_OPTION_TABLE
= 0x00000010,
132 B_CAPS_SHIFT_TABLE
= 0x00000020,
133 B_CAPS_TABLE
= 0x00000040,
134 B_SHIFT_TABLE
= 0x00000080,
135 B_NORMAL_TABLE
= 0x00000100
140 B_SHIFT_KEY
= 0x00000001,
141 B_COMMAND_KEY
= 0x00000002,
142 B_CONTROL_KEY
= 0x00000004,
143 B_CAPS_LOCK
= 0x00000008,
144 B_SCROLL_LOCK
= 0x00000010,
145 B_NUM_LOCK
= 0x00000020,
146 B_OPTION_KEY
= 0x00000040,
147 B_MENU_KEY
= 0x00000080,
148 B_LEFT_SHIFT_KEY
= 0x00000100,
149 B_RIGHT_SHIFT_KEY
= 0x00000200,
150 B_LEFT_COMMAND_KEY
= 0x00000400,
151 B_RIGHT_COMMAND_KEY
= 0x00000800,
152 B_LEFT_CONTROL_KEY
= 0x00001000,
153 B_RIGHT_CONTROL_KEY
= 0x00002000,
154 B_LEFT_OPTION_KEY
= 0x00004000,
155 B_RIGHT_OPTION_KEY
= 0x00008000
162 uint32 button
[B_MAX_MOUSE_BUTTONS
];
167 B_CLICK_TO_FOCUS_MOUSE
= -1,
168 B_FOCUS_FOLLOWS_MOUSE
= 1
171 enum mode_focus_follows_mouse
{
172 B_NORMAL_FOCUS_FOLLOWS_MOUSE
= 0,
173 B_WARP_FOCUS_FOLLOWS_MOUSE
= 1,
174 B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE
= 2
178 // View orientation/alignment/style
197 struct scroll_bar_info
{
209 B_ALIGN_HORIZONTAL_CENTER
= B_ALIGN_CENTER
,
211 B_ALIGN_HORIZONTAL_UNSET
= -1L,
212 B_ALIGN_USE_FULL_WIDTH
= -2L
215 enum vertical_alignment
{
217 B_ALIGN_MIDDLE
= 0x20,
218 B_ALIGN_BOTTOM
= 0x30,
220 B_ALIGN_VERTICAL_CENTER
= B_ALIGN_MIDDLE
,
222 B_ALIGN_VERTICAL_UNSET
= -1L,
223 B_ALIGN_NO_VERTICAL
= B_ALIGN_VERTICAL_UNSET
,
224 B_ALIGN_USE_FULL_HEIGHT
= -2L
228 // Layout spacing and insets, see BControlLook::ComposeSpacing()
232 B_USE_DEFAULT_SPACING
= -1002,
233 B_USE_ITEM_SPACING
= -1003,
234 B_USE_ITEM_INSETS
= -1003,
235 B_USE_HALF_ITEM_SPACING
= -1004,
236 B_USE_HALF_ITEM_INSETS
= -1004,
237 B_USE_WINDOW_INSETS
= -1005,
238 B_USE_WINDOW_SPACING
= -1005,
239 B_USE_SMALL_INSETS
= -1006,
240 B_USE_SMALL_SPACING
= -1006,
241 B_USE_BIG_INSETS
= -1007,
242 B_USE_BIG_SPACING
= -1007
246 // Line join and cap modes
257 B_ROUND_CAP
= B_ROUND_JOIN
,
258 B_BUTT_CAP
= B_BUTT_JOIN
,
259 B_SQUARE_CAP
= B_SQUARE_JOIN
262 const float B_DEFAULT_MITER_LIMIT
= 10.0F
;
265 // Polygon filling rules
273 // Bitmap and overlay constants
276 B_TILE_BITMAP_X
= 0x00000001,
277 B_TILE_BITMAP_Y
= 0x00000002,
278 B_TILE_BITMAP
= 0x00000003
281 enum overlay_options
{
282 B_OVERLAY_FILTER_HORIZONTAL
= 0x00010000,
283 B_OVERLAY_FILTER_VERTICAL
= 0x00020000,
284 B_OVERLAY_MIRROR
= 0x00040000,
285 B_OVERLAY_TRANSFER_CHANNEL
= 0x00080000
288 enum bitmap_drawing_options
{
289 B_FILTER_BITMAP_BILINEAR
= 0x00000100,
291 B_WAIT_FOR_RETRACE
= 0x00000800
299 B_PANEL_BACKGROUND_COLOR
= 1,
300 B_PANEL_TEXT_COLOR
= 10,
301 B_DOCUMENT_BACKGROUND_COLOR
= 11,
302 B_DOCUMENT_TEXT_COLOR
= 12,
303 B_CONTROL_BACKGROUND_COLOR
= 13,
304 B_CONTROL_TEXT_COLOR
= 14,
305 B_CONTROL_BORDER_COLOR
= 15,
306 B_CONTROL_HIGHLIGHT_COLOR
= 16,
307 B_CONTROL_MARK_COLOR
= 27,
308 B_NAVIGATION_BASE_COLOR
= 4,
309 B_NAVIGATION_PULSE_COLOR
= 17,
313 B_LINK_TEXT_COLOR
= 33,
314 B_LINK_HOVER_COLOR
= 34,
315 B_LINK_VISITED_COLOR
= 35,
316 B_LINK_ACTIVE_COLOR
= 36,
318 B_MENU_BACKGROUND_COLOR
= 2,
319 B_MENU_SELECTED_BACKGROUND_COLOR
= 6,
320 B_MENU_ITEM_TEXT_COLOR
= 7,
321 B_MENU_SELECTED_ITEM_TEXT_COLOR
= 8,
322 B_MENU_SELECTED_BORDER_COLOR
= 9,
324 B_LIST_BACKGROUND_COLOR
= 28,
325 B_LIST_SELECTED_BACKGROUND_COLOR
= 29,
326 B_LIST_ITEM_TEXT_COLOR
= 30,
327 B_LIST_SELECTED_ITEM_TEXT_COLOR
= 31,
329 B_SCROLL_BAR_THUMB_COLOR
= 32,
331 B_TOOL_TIP_BACKGROUND_COLOR
= 20,
332 B_TOOL_TIP_TEXT_COLOR
= 21,
334 B_STATUS_BAR_COLOR
= 37,
336 B_SUCCESS_COLOR
= 100,
337 B_FAILURE_COLOR
= 101,
339 B_WINDOW_TAB_COLOR
= 3,
340 B_WINDOW_TEXT_COLOR
= 22,
341 B_WINDOW_INACTIVE_TAB_COLOR
= 23,
342 B_WINDOW_INACTIVE_TEXT_COLOR
= 24,
344 B_WINDOW_BORDER_COLOR
= 25,
345 B_WINDOW_INACTIVE_BORDER_COLOR
= 26,
347 // Old name synonyms.
348 B_KEYBOARD_NAVIGATION_COLOR
= B_NAVIGATION_BASE_COLOR
,
349 B_MENU_SELECTION_BACKGROUND_COLOR
= B_MENU_SELECTED_BACKGROUND_COLOR
,
351 // The following constants are deprecated, do not use in new code.
353 // see BScreen class for B_DESKTOP_COLOR replacement
359 const float B_LIGHTEN_MAX_TINT
= 0.0f
; // 216 --> 255.0 (255)
360 const float B_LIGHTEN_2_TINT
= 0.385f
; // 216 --> 240.0 (240)
361 const float B_LIGHTEN_1_TINT
= 0.590f
; // 216 --> 232.0 (232)
363 const float B_NO_TINT
= 1.0f
; // 216 --> 216.0 (216)
365 const float B_DARKEN_1_TINT
= 1.147f
; // 216 --> 184.2 (184)
366 const float B_DARKEN_2_TINT
= 1.295f
; // 216 --> 152.3 (152)
367 const float B_DARKEN_3_TINT
= 1.407f
; // 216 --> 128.1 (128)
368 const float B_DARKEN_4_TINT
= 1.555f
; // 216 --> 96.1 (96)
369 const float B_DARKEN_MAX_TINT
= 2.0f
; // 216 --> 0.0 (0)
370 // effects on standard gray level
372 const float B_DISABLED_LABEL_TINT
= B_DARKEN_3_TINT
;
373 const float B_HIGHLIGHT_BACKGROUND_TINT
= B_DARKEN_2_TINT
;
374 const float B_DISABLED_MARK_TINT
= B_LIGHTEN_2_TINT
;
377 // Icon related constants
379 // Values for [Set]IconBitmap() of various view classes. Not all types are
380 // applicable for all views.
382 B_INACTIVE_ICON_BITMAP
= 0x00,
383 B_ACTIVE_ICON_BITMAP
= 0x01,
384 B_PARTIALLY_ACTIVATE_ICON_BITMAP
= 0x02,
386 // flag, can be combined with any of the above
387 B_DISABLED_ICON_BITMAP
= 0x80,
388 // disabled version of the specified bitmap
391 // flags for SetIconBitmap() of various view classes
393 B_KEEP_ICON_BITMAP
= 0x0001,
394 // transfer bitmap ownership to the view
397 // flags for SetIcon() of various view classes
399 B_TRIM_ICON_BITMAP
= 0x0100,
400 // crop the bitmap to the not fully transparent area; may change the
402 B_TRIM_ICON_BITMAP_KEEP_ASPECT
= 0x0200,
403 // like B_TRIM_BITMAP, but keeps the aspect ratio
404 B_CREATE_ACTIVE_ICON_BITMAP
= 0x0400,
405 B_CREATE_PARTIALLY_ACTIVE_ICON_BITMAP
= 0x0800,
406 B_CREATE_DISABLED_ICON_BITMAPS
= 0x1000,
410 status_t
get_deskbar_frame(BRect
* frame
);
412 const color_map
* system_colors();
414 status_t
set_screen_space(int32 index
, uint32 resolution
,
417 status_t
get_scroll_bar_info(scroll_bar_info
* info
);
418 status_t
set_scroll_bar_info(scroll_bar_info
* info
);
420 status_t
get_mouse_type(int32
* type
);
421 status_t
set_mouse_type(int32 type
);
422 status_t
get_mouse_map(mouse_map
* map
);
423 status_t
set_mouse_map(mouse_map
* map
);
424 status_t
get_click_speed(bigtime_t
* speed
);
425 status_t
set_click_speed(bigtime_t speed
);
426 status_t
get_mouse_speed(int32
* speed
);
427 status_t
set_mouse_speed(int32 speed
);
428 status_t
get_mouse_acceleration(int32
* speed
);
429 status_t
set_mouse_acceleration(int32 speed
);
431 status_t
get_key_repeat_rate(int32
* rate
);
432 status_t
set_key_repeat_rate(int32 rate
);
433 status_t
get_key_repeat_delay(bigtime_t
* delay
);
434 status_t
set_key_repeat_delay(bigtime_t delay
);
437 status_t
get_key_info(key_info
* info
);
438 void get_key_map(key_map
** _map
, char** _keyBuffer
);
439 status_t
get_keyboard_id(uint16
* _id
);
440 status_t
get_modifier_key(uint32 modifier
, uint32
*key
);
441 void set_modifier_key(uint32 modifier
, uint32 key
);
442 void set_keyboard_locks(uint32 modifiers
);
444 rgb_color
keyboard_navigation_color();
446 int32
count_workspaces();
447 void set_workspace_count(int32 count
);
448 int32
current_workspace();
449 void activate_workspace(int32 workspace
);
451 bigtime_t
idle_time();
453 void run_select_printer_panel();
454 void run_add_printer_panel();
457 void set_focus_follows_mouse(bool follow
);
458 bool focus_follows_mouse();
460 void set_mouse_mode(mode_mouse mode
);
461 mode_mouse
mouse_mode();
463 void set_focus_follows_mouse_mode(mode_focus_follows_mouse mode
);
464 mode_focus_follows_mouse
focus_follows_mouse_mode();
466 status_t
get_mouse(BPoint
* screenWhere
, uint32
* buttons
);
467 status_t
get_mouse_bitmap(BBitmap
** bitmap
, BPoint
* hotspot
);
469 void set_accept_first_click(bool acceptFirstClick
);
470 bool accept_first_click();
472 rgb_color
ui_color(color_which which
);
473 const char* ui_color_name(color_which which
);
474 color_which
which_ui_color(const char* name
);
475 void set_ui_color(const color_which
& which
, const rgb_color
& color
);
476 void set_ui_colors(const BMessage
* colors
);
477 rgb_color
tint_color(rgb_color color
, float tint
);
479 extern "C" status_t
_init_interface_kit_();
480 // for convenience, should be removed including the friend declarations
483 #endif // _INTERFACE_DEFS_H