1 | #ifndef INC_BARNOWL_WINDOW_H |
---|
2 | #define INC_BARNOWL_WINDOW_H |
---|
3 | |
---|
4 | #include <glib.h> |
---|
5 | #include <glib-object.h> |
---|
6 | |
---|
7 | #ifdef HAVE_STDBOOL_H |
---|
8 | #include <stdbool.h> |
---|
9 | #else |
---|
10 | #ifndef HAVE__BOOL |
---|
11 | #define _Bool signed char |
---|
12 | #endif |
---|
13 | #define bool _Bool |
---|
14 | #define false 0 |
---|
15 | #define true 1 |
---|
16 | #define __bool_true_false_are_defined 1 |
---|
17 | #endif /* HAVE_STDBOOL_H */ |
---|
18 | |
---|
19 | G_BEGIN_DECLS |
---|
20 | |
---|
21 | #define OWL_TYPE_WINDOW (owl_window_get_type ()) |
---|
22 | #define OWL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OWL_TYPE_WINDOW, OwlWindow)) |
---|
23 | #define OWL_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OWL_TYPE_WINDOW)) |
---|
24 | #define OWL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OWL_TYPE_WINDOW, OwlWindowClass)) |
---|
25 | #define OWL_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OWL_TYPE_WINDOW)) |
---|
26 | #define OWL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OWL_TYPE_WINDOW, OwlWindowClass)) |
---|
27 | |
---|
28 | typedef struct _owl_window OwlWindow; |
---|
29 | typedef struct _OwlWindowClass OwlWindowClass; |
---|
30 | typedef OwlWindow owl_window; /* meh */ |
---|
31 | |
---|
32 | struct _OwlWindowClass |
---|
33 | { |
---|
34 | GObjectClass parent_class; |
---|
35 | /* default implementations for signals */ |
---|
36 | void (*redraw)(owl_window *, WINDOW *); |
---|
37 | void (*resized)(owl_window *); |
---|
38 | }; |
---|
39 | |
---|
40 | GType owl_window_get_type(void); |
---|
41 | |
---|
42 | owl_window *owl_window_get_screen(void); |
---|
43 | |
---|
44 | owl_window *owl_window_new(owl_window *parent); |
---|
45 | void owl_window_unlink(owl_window *w); |
---|
46 | |
---|
47 | void owl_window_children_foreach(owl_window *parent, GFunc func, gpointer user_data); |
---|
48 | |
---|
49 | owl_window *owl_window_parent(owl_window *parent); |
---|
50 | owl_window *owl_window_first_child(owl_window *parent); |
---|
51 | owl_window *owl_window_next_sibling(owl_window *w); |
---|
52 | owl_window *owl_window_previous_sibling(owl_window *w); |
---|
53 | |
---|
54 | void owl_window_show(owl_window *w); |
---|
55 | void owl_window_show_all(owl_window *w); |
---|
56 | void owl_window_hide(owl_window *w); |
---|
57 | bool owl_window_is_shown(owl_window *w); |
---|
58 | bool owl_window_is_realized(owl_window *w); |
---|
59 | bool owl_window_is_toplevel(owl_window *w); |
---|
60 | bool owl_window_is_subwin(owl_window *w); |
---|
61 | |
---|
62 | void owl_window_set_cursor(owl_window *w); |
---|
63 | void owl_window_set_default_cursor(owl_window *w); |
---|
64 | |
---|
65 | void owl_window_dirty(owl_window *w); |
---|
66 | void owl_window_dirty_children(owl_window *w); |
---|
67 | void owl_window_redraw_scheduled(void); |
---|
68 | |
---|
69 | void owl_window_get_position(owl_window *w, int *nlines, int *ncols, int *begin_y, int *begin_x); |
---|
70 | void owl_window_set_position(owl_window *w, int nlines, int ncols, int begin_y, int begin_x); |
---|
71 | void owl_window_move(owl_window *w, int begin_y, int begin_x); |
---|
72 | void owl_window_resize(owl_window *w, int nlines, int ncols); |
---|
73 | |
---|
74 | /* Standard callback functions in windowcb.c */ |
---|
75 | |
---|
76 | void owl_window_erase_cb(owl_window *w, WINDOW *win, void *user_data); |
---|
77 | void owl_window_fill_parent_cb(owl_window *parent, void *user_data); |
---|
78 | |
---|
79 | G_END_DECLS |
---|
80 | |
---|
81 | #endif /* INC_BARNOWL_WINDOW_H */ |
---|