mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
Make GtkNotebookPage an object
This commit is contained in:
parent
0e29408215
commit
85fb368834
@ -292,6 +292,8 @@ enum {
|
||||
|
||||
struct _GtkNotebookPage
|
||||
{
|
||||
GObject *instance;
|
||||
|
||||
GtkWidget *child;
|
||||
GtkWidget *tab_label;
|
||||
GtkWidget *menu_label;
|
||||
@ -312,6 +314,34 @@ struct _GtkNotebookPage
|
||||
gulong notify_visible_handler;
|
||||
};
|
||||
|
||||
struct _GtkNotebookPageClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkNotebookPage, gtk_notebook_page, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gtk_notebook_page_init (GtkNotebookPage *page)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_notebook_page_finalize (GObject *object)
|
||||
{
|
||||
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (object);
|
||||
|
||||
G_OBJECT_CLASS (gtk_notebook_page_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_notebook_page_class_init (GtkNotebookPageClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = gtk_notebook_page_finalize;
|
||||
}
|
||||
|
||||
static const char *src_notebook_targets [] = {
|
||||
"GTK_NOTEBOOK_TAB",
|
||||
"application/x-rootwindow-drop"
|
||||
@ -3947,7 +3977,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
|
||||
|
||||
gtk_widget_freeze_child_notify (child);
|
||||
|
||||
page = g_slice_new0 (GtkNotebookPage);
|
||||
page = g_object_new (GTK_TYPE_NOTEBOOK_PAGE, NULL);
|
||||
page->child = child;
|
||||
|
||||
nchildren = g_list_length (priv->children);
|
||||
@ -4228,7 +4258,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
|
||||
|
||||
gtk_widget_unparent (page->tab_widget);
|
||||
|
||||
g_slice_free (GtkNotebookPage, page);
|
||||
g_object_unref (page);
|
||||
|
||||
gtk_notebook_update_labels (notebook);
|
||||
if (need_resize)
|
||||
|
@ -43,6 +43,16 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
|
||||
#define GTK_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
|
||||
|
||||
#define GTK_TYPE_NOTEBOOK_PAGE (gtk_notebook_page_get_type ())
|
||||
#define GTK_NOTEBOOK_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK_PAGE, GtkNotebookPage))
|
||||
#define GTK_NOTEBOOK_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK_PAGE, GtkNotebookPageClass))
|
||||
#define GTK_IS_NOTEBOOK_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK_PAGE))
|
||||
#define GTK_IS_NOTEBOOK_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_PAGE))
|
||||
#define GTK_NOTEBOOK_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_PAGE, GtkNotebookPageClass))
|
||||
|
||||
typedef struct _GtkNotebookPage GtkNotebookPage;
|
||||
typedef struct _GtkNotebookPageClass GtkNotebookPageClass;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@ -289,6 +299,15 @@ void gtk_notebook_set_action_widget (GtkNotebook *notebook,
|
||||
GtkWidget *widget,
|
||||
GtkPackType pack_type);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_notebook_page_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkNotebookPage *gtk_notebook_get_page (GtkNotebook *notebook,
|
||||
GtkWidget *child);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWidget *gtk_notebook_page_get_child (GtkNotebookPage *page);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_NOTEBOOK_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user