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