Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

316 строки
12 KiB

  1. /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
  2. /* GTK - The GIMP Toolkit
  3. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. */
  20. /*
  21. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  22. * file for a list of people on the GTK+ Team. See the ChangeLog
  23. * files for a list of changes. These files are distributed with
  24. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  25. */
  26. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  27. #error "Only <gtk/gtk.h> can be included directly."
  28. #endif
  29. #ifndef __GTK_NOTEBOOK_H__
  30. #define __GTK_NOTEBOOK_H__
  31. #include <gtk/gtkcontainer.h>
  32. G_BEGIN_DECLS
  33. #define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
  34. #define GTK_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
  35. #define GTK_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
  36. #define GTK_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK))
  37. #define GTK_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
  38. #define GTK_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
  39. typedef enum
  40. {
  41. GTK_NOTEBOOK_TAB_FIRST,
  42. GTK_NOTEBOOK_TAB_LAST
  43. } GtkNotebookTab;
  44. typedef struct _GtkNotebook GtkNotebook;
  45. typedef struct _GtkNotebookClass GtkNotebookClass;
  46. #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
  47. typedef struct _GtkNotebookPage GtkNotebookPage;
  48. #endif
  49. struct _GtkNotebook
  50. {
  51. GtkContainer container;
  52. #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
  53. GtkNotebookPage *GSEAL (cur_page);
  54. #else
  55. gpointer GSEAL (cur_page);
  56. #endif
  57. GList *GSEAL (children);
  58. GList *GSEAL (first_tab); /* The first tab visible (for scrolling notebooks) */
  59. GList *GSEAL (focus_tab);
  60. GtkWidget *GSEAL (menu);
  61. GdkWindow *GSEAL (event_window);
  62. guint32 GSEAL (timer);
  63. guint16 GSEAL (tab_hborder);
  64. guint16 GSEAL (tab_vborder);
  65. guint GSEAL (show_tabs) : 1;
  66. guint GSEAL (homogeneous) : 1;
  67. guint GSEAL (show_border) : 1;
  68. guint GSEAL (tab_pos) : 2;
  69. guint GSEAL (scrollable) : 1;
  70. guint GSEAL (in_child) : 3;
  71. guint GSEAL (click_child) : 3;
  72. guint GSEAL (button) : 2;
  73. guint GSEAL (need_timer) : 1;
  74. guint GSEAL (child_has_focus) : 1;
  75. guint GSEAL (have_visible_child) : 1;
  76. guint GSEAL (focus_out) : 1; /* Flag used by ::move-focus-out implementation */
  77. guint GSEAL (has_before_previous) : 1;
  78. guint GSEAL (has_before_next) : 1;
  79. guint GSEAL (has_after_previous) : 1;
  80. guint GSEAL (has_after_next) : 1;
  81. };
  82. struct _GtkNotebookClass
  83. {
  84. GtkContainerClass parent_class;
  85. void (* switch_page) (GtkNotebook *notebook,
  86. #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
  87. GtkNotebookPage *page,
  88. #else
  89. gpointer page,
  90. #endif
  91. guint page_num);
  92. /* Action signals for keybindings */
  93. gboolean (* select_page) (GtkNotebook *notebook,
  94. gboolean move_focus);
  95. gboolean (* focus_tab) (GtkNotebook *notebook,
  96. GtkNotebookTab type);
  97. gboolean (* change_current_page) (GtkNotebook *notebook,
  98. gint offset);
  99. void (* move_focus_out) (GtkNotebook *notebook,
  100. GtkDirectionType direction);
  101. gboolean (* reorder_tab) (GtkNotebook *notebook,
  102. GtkDirectionType direction,
  103. gboolean move_to_last);
  104. /* More vfuncs */
  105. gint (* insert_page) (GtkNotebook *notebook,
  106. GtkWidget *child,
  107. GtkWidget *tab_label,
  108. GtkWidget *menu_label,
  109. gint position);
  110. GtkNotebook * (* create_window) (GtkNotebook *notebook,
  111. GtkWidget *page,
  112. gint x,
  113. gint y);
  114. void (*_gtk_reserved1) (void);
  115. };
  116. typedef GtkNotebook* (*GtkNotebookWindowCreationFunc) (GtkNotebook *source,
  117. GtkWidget *page,
  118. gint x,
  119. gint y,
  120. gpointer data);
  121. /***********************************************************
  122. * Creation, insertion, deletion *
  123. ***********************************************************/
  124. GType gtk_notebook_get_type (void) G_GNUC_CONST;
  125. GtkWidget * gtk_notebook_new (void);
  126. gint gtk_notebook_append_page (GtkNotebook *notebook,
  127. GtkWidget *child,
  128. GtkWidget *tab_label);
  129. gint gtk_notebook_append_page_menu (GtkNotebook *notebook,
  130. GtkWidget *child,
  131. GtkWidget *tab_label,
  132. GtkWidget *menu_label);
  133. gint gtk_notebook_prepend_page (GtkNotebook *notebook,
  134. GtkWidget *child,
  135. GtkWidget *tab_label);
  136. gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
  137. GtkWidget *child,
  138. GtkWidget *tab_label,
  139. GtkWidget *menu_label);
  140. gint gtk_notebook_insert_page (GtkNotebook *notebook,
  141. GtkWidget *child,
  142. GtkWidget *tab_label,
  143. gint position);
  144. gint gtk_notebook_insert_page_menu (GtkNotebook *notebook,
  145. GtkWidget *child,
  146. GtkWidget *tab_label,
  147. GtkWidget *menu_label,
  148. gint position);
  149. void gtk_notebook_remove_page (GtkNotebook *notebook,
  150. gint page_num);
  151. /***********************************************************
  152. * Tabs drag and drop *
  153. ***********************************************************/
  154. void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func,
  155. gpointer data,
  156. GDestroyNotify destroy);
  157. #ifndef GTK_DISABLE_DEPRECATED
  158. void gtk_notebook_set_group_id (GtkNotebook *notebook,
  159. gint group_id);
  160. gint gtk_notebook_get_group_id (GtkNotebook *notebook);
  161. #endif /* GTK_DISABLE_DEPRECATED */
  162. void gtk_notebook_set_group (GtkNotebook *notebook,
  163. gpointer group);
  164. gpointer gtk_notebook_get_group (GtkNotebook *notebook);
  165. /***********************************************************
  166. * query, set current NotebookPage *
  167. ***********************************************************/
  168. gint gtk_notebook_get_current_page (GtkNotebook *notebook);
  169. GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
  170. gint page_num);
  171. gint gtk_notebook_get_n_pages (GtkNotebook *notebook);
  172. gint gtk_notebook_page_num (GtkNotebook *notebook,
  173. GtkWidget *child);
  174. void gtk_notebook_set_current_page (GtkNotebook *notebook,
  175. gint page_num);
  176. void gtk_notebook_next_page (GtkNotebook *notebook);
  177. void gtk_notebook_prev_page (GtkNotebook *notebook);
  178. /***********************************************************
  179. * set Notebook, NotebookTab style *
  180. ***********************************************************/
  181. void gtk_notebook_set_show_border (GtkNotebook *notebook,
  182. gboolean show_border);
  183. gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
  184. void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
  185. gboolean show_tabs);
  186. gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
  187. void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
  188. GtkPositionType pos);
  189. GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
  190. #ifndef GTK_DISABLE_DEPRECATED
  191. void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
  192. gboolean homogeneous);
  193. void gtk_notebook_set_tab_border (GtkNotebook *notebook,
  194. guint border_width);
  195. void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
  196. guint tab_hborder);
  197. void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
  198. guint tab_vborder);
  199. #endif /* GTK_DISABLE_DEPRECATED */
  200. void gtk_notebook_set_scrollable (GtkNotebook *notebook,
  201. gboolean scrollable);
  202. gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
  203. guint16 gtk_notebook_get_tab_hborder (GtkNotebook *notebook);
  204. guint16 gtk_notebook_get_tab_vborder (GtkNotebook *notebook);
  205. /***********************************************************
  206. * enable/disable PopupMenu *
  207. ***********************************************************/
  208. void gtk_notebook_popup_enable (GtkNotebook *notebook);
  209. void gtk_notebook_popup_disable (GtkNotebook *notebook);
  210. /***********************************************************
  211. * query/set NotebookPage Properties *
  212. ***********************************************************/
  213. GtkWidget * gtk_notebook_get_tab_label (GtkNotebook *notebook,
  214. GtkWidget *child);
  215. void gtk_notebook_set_tab_label (GtkNotebook *notebook,
  216. GtkWidget *child,
  217. GtkWidget *tab_label);
  218. void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
  219. GtkWidget *child,
  220. const gchar *tab_text);
  221. G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
  222. GtkWidget *child);
  223. GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
  224. GtkWidget *child);
  225. void gtk_notebook_set_menu_label (GtkNotebook *notebook,
  226. GtkWidget *child,
  227. GtkWidget *menu_label);
  228. void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
  229. GtkWidget *child,
  230. const gchar *menu_text);
  231. G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
  232. GtkWidget *child);
  233. #ifndef GTK_DISABLE_DEPRECATED
  234. void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
  235. GtkWidget *child,
  236. gboolean *expand,
  237. gboolean *fill,
  238. GtkPackType *pack_type);
  239. void gtk_notebook_set_tab_label_packing (GtkNotebook *notebook,
  240. GtkWidget *child,
  241. gboolean expand,
  242. gboolean fill,
  243. GtkPackType pack_type);
  244. #endif
  245. void gtk_notebook_reorder_child (GtkNotebook *notebook,
  246. GtkWidget *child,
  247. gint position);
  248. gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
  249. GtkWidget *child);
  250. void gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
  251. GtkWidget *child,
  252. gboolean reorderable);
  253. gboolean gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
  254. GtkWidget *child);
  255. void gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
  256. GtkWidget *child,
  257. gboolean detachable);
  258. GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
  259. GtkPackType pack_type);
  260. void gtk_notebook_set_action_widget (GtkNotebook *notebook,
  261. GtkWidget *widget,
  262. GtkPackType pack_type);
  263. #ifndef GTK_DISABLE_DEPRECATED
  264. #define gtk_notebook_current_page gtk_notebook_get_current_page
  265. #define gtk_notebook_set_page gtk_notebook_set_current_page
  266. #endif /* GTK_DISABLE_DEPRECATED */
  267. G_END_DECLS
  268. #endif /* __GTK_NOTEBOOK_H__ */