+
+ class->focus_tab = gtk_notebook_focus_tab;
+ class->select_page = gtk_notebook_select_page;
+ class->change_current_page = gtk_notebook_change_current_page;
+ class->move_focus_out = gtk_notebook_move_focus_out;
+
+ g_object_class_install_property (gobject_class,
+ PROP_PAGE,
+ g_param_spec_int ("page",
+ _("Page"),
+ _("The index of the current page"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_TAB_POS,
+ g_param_spec_enum ("tab_pos",
+ _("Tab Position"),
+ _("Which side of the notebook holds the tabs"),
+ GTK_TYPE_POSITION_TYPE,
+ GTK_POS_TOP,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_TAB_BORDER,
+ g_param_spec_uint ("tab_border",
+ _("Tab Border"),
+ _("Width of the border around the tab labels"),
+ 0,
+ G_MAXUINT,
+ 2,
+ G_PARAM_WRITABLE));
+ g_object_class_install_property (gobject_class,
+ PROP_TAB_HBORDER,
+ g_param_spec_uint ("tab_hborder",
+ _("Horizontal Tab Border"),
+ _("Width of the horizontal border of tab labels"),
+ 0,
+ G_MAXUINT,
+ 2,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_TAB_VBORDER,
+ g_param_spec_uint ("tab_vborder",
+ _("Vertical Tab Border"),
+ _("Width of the vertical border of tab labels"),
+ 0,
+ G_MAXUINT,
+ 2,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_SHOW_TABS,
+ g_param_spec_boolean ("show_tabs",
+ _("Show Tabs"),
+ _("Whether tabs should be shown or not"),
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_SHOW_BORDER,
+ g_param_spec_boolean ("show_border",
+ _("Show Border"),
+ _("Whether the border should be shown or not"),
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_SCROLLABLE,
+ g_param_spec_boolean ("scrollable",
+ _("Scrollable"),
+ _("If TRUE, scroll arrows are added if there are too many tabs to fit"),
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_ENABLE_POPUP,
+ g_param_spec_boolean ("enable_popup",
+ _("Enable Popup"),
+ _("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"),
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_HOMOGENEOUS,
+ g_param_spec_boolean ("homogeneous",
+ _("Homogeneous"),
+ _("Whether tabs should have homogeneous sizes"),
+ FALSE,
+ G_PARAM_READWRITE));
+
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_TAB_LABEL,
+ g_param_spec_string ("tab_label",
+ _("Tab label"),
+ _("The string displayed on the childs tab label"),
+ NULL,
+ G_PARAM_READWRITE));
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_MENU_LABEL,
+ g_param_spec_string ("menu_label",
+ _("Menu label"),
+ _("The string displayed in the childs menu entry"),
+ NULL,
+ G_PARAM_READWRITE));
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_POSITION,
+ g_param_spec_int ("position",
+ _("Position"),
+ _("The index of the child in the parent"),
+ -1, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_TAB_EXPAND,
+ g_param_spec_boolean ("tab_expand",
+ _("Tab expand"),
+ _("Whether to expand the childs tab or not"),
+ TRUE,
+ G_PARAM_READWRITE));
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_TAB_FILL,
+ g_param_spec_boolean ("tab_fill",
+ _("Tab fill"),
+ _("Wheather the childs tab should fill the allocated area or not"),
+ TRUE,
+ G_PARAM_READWRITE));
+ gtk_container_class_install_child_property (container_class,
+ CHILD_PROP_TAB_PACK,
+ g_param_spec_enum ("tab_pack",
+ _("Tab pack type"),
+ _("A GtkPackType indicating whether the child is packed with reference to the start or end of the parent"),
+ GTK_TYPE_PACK_TYPE, GTK_PACK_START,
+ G_PARAM_READWRITE));
+
+ notebook_signals[SWITCH_PAGE] =
+ g_signal_new ("switch_page",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkNotebookClass, switch_page),
+ NULL, NULL,
+ _gtk_marshal_VOID__POINTER_UINT,
+ G_TYPE_NONE, 2,
+ G_TYPE_POINTER,
+ G_TYPE_UINT);
+ notebook_signals[FOCUS_TAB] =
+ g_signal_new ("focus_tab",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkNotebookClass, focus_tab),
+ NULL, NULL,
+ _gtk_marshal_BOOLEAN__ENUM,
+ G_TYPE_BOOLEAN, 1,
+ GTK_TYPE_NOTEBOOK_TAB);
+ notebook_signals[SELECT_PAGE] =
+ g_signal_new ("select_page",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkNotebookClass, select_page),
+ NULL, NULL,
+ _gtk_marshal_BOOLEAN__BOOLEAN,
+ G_TYPE_BOOLEAN, 1,
+ G_TYPE_BOOLEAN);
+ notebook_signals[CHANGE_CURRENT_PAGE] =
+ g_signal_new ("change_current_page",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkNotebookClass, change_current_page),
+ NULL, NULL,
+ _gtk_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+ notebook_signals[MOVE_FOCUS_OUT] =
+ g_signal_new ("move_focus_out",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (GtkNotebookClass, move_focus_out),
+ NULL, NULL,
+ _gtk_marshal_VOID__ENUM,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_DIRECTION_TYPE);
+
+
+ binding_set = gtk_binding_set_by_class (class);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_space, 0,
+ "select_page", 1,
+ G_TYPE_BOOLEAN, FALSE);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KP_Space, 0,
+ "select_page", 1,
+ G_TYPE_BOOLEAN, FALSE);
+
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_Home, 0,
+ "focus_tab", 1,
+ GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KP_Home, 0,
+ "focus_tab", 1,
+ GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_FIRST);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_End, 0,
+ "focus_tab", 1,
+ GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KP_End, 0,
+ "focus_tab", 1,
+ GTK_TYPE_NOTEBOOK_TAB, GTK_NOTEBOOK_TAB_LAST);
+
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_Page_Up, GDK_CONTROL_MASK,
+ "change_current_page", 1,
+ G_TYPE_INT, -1);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_Page_Down, GDK_CONTROL_MASK,
+ "change_current_page", 1,
+ G_TYPE_INT, 1);
+
+ add_arrow_bindings (binding_set, GDK_Up, GTK_DIR_UP);
+ add_arrow_bindings (binding_set, GDK_Down, GTK_DIR_DOWN);
+ add_arrow_bindings (binding_set, GDK_Left, GTK_DIR_LEFT);
+ add_arrow_bindings (binding_set, GDK_Right, GTK_DIR_RIGHT);
+
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);