9#ifndef GP_WIDGET_TABS_H
10#define GP_WIDGET_TABS_H
17struct gp_widget_tabs {
18 unsigned int active_tab;
23 struct gp_widget_tab *tabs;
28enum gp_widget_tabs_event_type {
29 GP_WIDGET_TABS_DEACTIVATED,
30 GP_WIDGET_TABS_ACTIVATED,
42gp_widget *gp_widget_tabs_new(
unsigned int tabs_cnt,
unsigned int active_tab,
43 const char *tab_labels[],
int flags);
52unsigned int gp_widget_tabs_cnt(gp_widget *self);
63gp_widget *gp_widget_tabs_put(gp_widget *self,
unsigned int tab,
74static inline gp_widget *gp_widget_tabs_rem(gp_widget *self,
unsigned int tab)
76 return gp_widget_tabs_put(self, tab, NULL);
87gp_widget *gp_widget_tabs_child_get(gp_widget *self,
unsigned int tab);
89static inline void gp_widget_tabs_del(gp_widget *self,
unsigned int tab)
91 gp_widget *ret = gp_widget_tabs_rem(self, tab);
104void gp_widget_tabs_tab_ins(gp_widget *self,
unsigned int tab,
105 const char *label, gp_widget *child);
116unsigned int gp_widget_tabs_tab_append(gp_widget *self,
117 const char *label, gp_widget *child);
126static inline void gp_widget_tabs_tab_prepend(gp_widget *self,
130 return gp_widget_tabs_tab_ins(self, 0, label, child);
141gp_widget *gp_widget_tabs_tab_rem(gp_widget *self,
unsigned int tab);
151int gp_widget_tabs_tab_rem_by_child(gp_widget *self, gp_widget *child);
163static inline int gp_widget_tabs_tab_del_by_child(gp_widget *self, gp_widget *child)
165 if (!gp_widget_tabs_tab_rem_by_child(self, child))
168 gp_widget_free(child);
181static inline void gp_widget_tabs_tab_del(gp_widget *self,
unsigned int tab)
183 gp_widget *ret = gp_widget_tabs_tab_rem(self, tab);
195unsigned int gp_widget_tabs_active_get(gp_widget *self);
204gp_widget *gp_widget_tabs_active_child_get(gp_widget *self);
212void gp_widget_tabs_active_set(gp_widget *self,
unsigned int tab);
221void gp_widget_tabs_active_set_rel(gp_widget *self,
int dir,
int wrap_around);
231int gp_widget_tabs_tab_by_child(gp_widget *self, gp_widget *child);
241const char *gp_widget_tabs_label_get(gp_widget *self,
unsigned int tab);
250const char *gp_widget_tabs_active_label_get(gp_widget *self);