1 /* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */
2 
3 #ifndef __BEOS_H__
4 #define __BEOS_H__
5 
6 #include <pobl/bl_types.h>
7 
8 #ifdef __UI_WINDOW_H__
9 
10 /* for BView */
11 
12 void view_alloc(ui_window_t *uiwindow, int x, int y, u_int width, u_int height);
13 
14 void view_dealloc(void *view);
15 
16 void view_update(void *view, int force_expose);
17 
18 void view_set_clip(void *view, int x, int y, u_int width, u_int height);
19 
20 void view_unset_clip(void *view);
21 
22 void view_draw_string(void *view, ui_font_t *font, ui_color_t *fg_color, int x, int y, char *str,
23                       size_t len);
24 
25 void view_draw_string16(void *view, ui_font_t *font, ui_color_t *fg_color, int x, int y,
26                         XChar2b *str, size_t len);
27 
28 void view_fill_with(void *view, ui_color_t *color, int x, int y, u_int width, u_int height);
29 
30 void view_draw_rect_frame(void *view, ui_color_t *color, int x1, int y1, int x2, int y2);
31 
32 void view_copy_area(void *view, Pixmap src, int src_x, int src_y, u_int width, u_int height,
33                     int dst_x, int dst_y);
34 
35 void view_scroll(void *view, int src_x, int src_y, u_int width, u_int height, int dst_x, int dst_y);
36 
37 void view_bg_color_changed(void *view);
38 
39 void view_visual_bell(void *view);
40 
41 void view_set_input_focus(void *view);
42 
43 void view_resize(void *view, u_int width, u_int height);
44 
45 void view_move(void *view, int x, int y);
46 
47 void view_set_hidden(void *view, int flag);
48 
49 void view_reset_uiwindow(ui_window_t *uiwindow);
50 
51 /* for BWindow */
52 void window_alloc(ui_window_t *root, int x, int y, u_int width, u_int height, int popup,
53                   int geom_hint);
54 
55 void window_show(void *window);
56 
57 void window_dealloc(void *window);
58 
59 void window_move(void *window, int x, int y);
60 
61 void window_resize(void *window, int width, int height);
62 
63 void window_get_position(void *window, int *x, int *y);
64 
65 void window_set_title(void *window, const char *title);
66 
67 void *window_get_orphan(void *window, int idx);
68 
69 /* for BApplication */
70 
71 void app_urgent_bell(int on);
72 
73 /* for Clipboard */
74 
75 void beos_clipboard_set(const u_char *utf8, size_t len);
76 
77 int beos_clipboard_get(u_char **utf8, size_t *len);
78 
79 void beos_beep(void);
80 
81 #endif /* __UI_WINDOW_H__ */
82 
83 void *beos_create_font(const char *font_family, float size, int is_italic, int is_bold);
84 
85 char *beos_get_font_family(void *bfont);
86 
87 void beos_release_font(void *bfont);
88 
89 void beos_font_get_metrics(void *bfont, u_int *width, u_int *height, u_int *ascent);
90 
91 u_int beos_font_get_advance(void *bfont, int size_attr, u_int16_t *utf16,
92                             u_int len, u_int32_t glyph);
93 
94 void *beos_create_image(const void *data, u_int len, u_int width, u_int height);
95 
96 void beos_destroy_image(void *bitmap);
97 
98 void *beos_load_image(const char *path, u_int *width, u_int *height);
99 
100 void *beos_resize_image(void *bitmap, u_int width, u_int height);
101 
102 u_char *beos_get_bits(void *bitmap);
103 
104 /* Utility */
105 
106 char *beos_dialog_password(const char *msg);
107 
108 int beos_dialog_okcancel(const char *msg);
109 
110 int beos_dialog_alert(const char *msg);
111 
112 void beos_lock(void);
113 
114 void beos_unlock(void);
115 
116 #endif
117