1 #ifndef _TERM_CONTAINER_H__
2 #define _TERM_CONTAINER_H__ 1
3 
4 
5 typedef struct _Term_Container Term_Container;
6 typedef struct _Sizeinfo Sizeinfo;
7 
8 struct _Sizeinfo
9 {
10    int min_w;
11    int min_h;
12    int step_x;
13    int step_y;
14    int req_w;
15    int req_h;
16    int bg_min_w;
17    int bg_min_h;
18    int req;
19 };
20 
21 typedef enum _Term_Container_Type
22 {
23    TERM_CONTAINER_TYPE_UNKNOWN = 0,
24    TERM_CONTAINER_TYPE_SOLO,
25    TERM_CONTAINER_TYPE_SPLIT,
26    TERM_CONTAINER_TYPE_TABS,
27    TERM_CONTAINER_TYPE_WIN
28 } Term_Container_Type;
29 
30 typedef enum _Split_Direction {
31      SPLIT_DIRECTION_NONE,
32      SPLIT_DIRECTION_LEFT,
33      SPLIT_DIRECTION_RIGHT,
34      SPLIT_DIRECTION_TOP,
35      SPLIT_DIRECTION_BOTTOM,
36      SPLIT_DIRECTION_TABS,
37 } Split_Direction;
38 
39 struct _Term_Container {
40      Term_Container_Type type;
41      Term_Container *parent;
42      Win *wn;
43      Evas_Object *selector_img;
44      Eina_Bool is_focused;
45      const char *title;
46 
47      Term *(*term_next)(const Term_Container *tc, const Term_Container *child);
48      Term *(*term_prev)(const Term_Container *tc, const Term_Container *child);
49      Term *(*term_up)(const Term_Container *tc, const Term_Container *child);
50      Term *(*term_down)(const Term_Container *tc, const Term_Container *child);
51      Term *(*term_left)(const Term_Container *tc, const Term_Container *child);
52      Term *(*term_right)(const Term_Container *tc, const Term_Container *child);
53      Term *(*term_first)(const Term_Container *tc);
54      Term *(*term_last)(const Term_Container *tc);
55      Term *(*focused_term_get)(const Term_Container *tc);
56      Evas_Object* (*get_evas_object)(const Term_Container *container);
57      Term *(*find_term_at_coords)(const Term_Container *container,
58                                   Evas_Coord mx, Evas_Coord my);
59      void (*split)(Term_Container *tc, Term_Container *child,
60                    Term *from, const char *cmd, Eina_Bool is_horizontal);
61      int (*split_direction)(Term_Container *tc,
62                             Term_Container *child_orig,
63                             Term_Container *child_new,
64                              Split_Direction direction);
65      void (*size_eval)(Term_Container *container, Sizeinfo *info);
66      void (*swallow)(Term_Container *container, Term_Container *orig,
67                      Term_Container *new_child);
68      void (*focus)(Term_Container *tc, Term_Container *relative);
69      void (*unfocus)(Term_Container *tc, Term_Container *relative);
70      void (*set_title)(Term_Container *tc, Term_Container *child, const char *title);
71      void (*bell)(Term_Container *tc, Term_Container *child);
72      void (*close)(Term_Container *container, Term_Container *child);
73      void (*update)(Term_Container *tc);
74      Eina_Bool (*is_visible)(const Term_Container *tc, const Term_Container *child);
75      /* Only valid for splits/tabs */
76      void (*detach)(Term_Container *container, Term_Container *solo_child);
77 };
78 
79 #endif
80