Hiroyuki Ikezoe
ikezo****@users*****
Sun Jan 7 18:57:56 JST 2007
Index: kazehakase/src/kz-notebook.c diff -u kazehakase/src/kz-notebook.c:1.16 kazehakase/src/kz-notebook.c:1.17 --- kazehakase/src/kz-notebook.c:1.16 Sun Jan 7 06:06:20 2007 +++ kazehakase/src/kz-notebook.c Sun Jan 7 18:57:55 2007 @@ -52,6 +52,8 @@ typedef struct _KzNotebookPrivate KzNotebookPrivate; struct _KzNotebookPrivate { + /* Kazehakase */ + KzWindow *kz; /* tabs */ GList *open_hist; GList *view_hist; @@ -59,10 +61,6 @@ #define KZ_NOTEBOOK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_NOTEBOOK, KzNotebookPrivate)) -static GObject *constructor (GType type, - guint n_props, - GObjectConstructParam *props); - static void dispose (GObject *object); static void set_property (GObject *object, guint prop_id, @@ -102,7 +100,6 @@ notebook_class = (GtkNotebookClass *)klass; /* GtkObject signals */ - gobject_class->constructor = constructor; gobject_class->dispose = dispose; gobject_class->set_property = set_property; gobject_class->get_property = get_property; @@ -131,11 +128,9 @@ { KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(notebook); - /* widgets */ - notebook->kz = NULL; - - priv->open_hist = NULL; - priv->view_hist = NULL; + priv->kz = NULL; + priv->open_hist = NULL; + priv->view_hist = NULL; gtk_drag_dest_set(GTK_WIDGET(notebook), GTK_DEST_DEFAULT_ALL, @@ -144,33 +139,16 @@ } -static GObject * -constructor (GType type, - guint n_props, - GObjectConstructParam *props) -{ - KzNotebook *notebook; - GObject *object; - GObjectClass *klass = G_OBJECT_CLASS(kz_notebook_parent_class); - - object = klass->constructor(type, n_props, props); - - notebook = KZ_NOTEBOOK(object); - - return object; -} - - static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - KzNotebook *notebook = KZ_NOTEBOOK(object); + KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(object); switch (prop_id) { case PROP_KZ_WINDOW: - notebook->kz = g_object_ref(g_value_get_object(value)); + priv->kz = g_object_ref(g_value_get_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -182,12 +160,12 @@ get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - KzNotebook *notebook = KZ_NOTEBOOK(object); + KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(object); switch (prop_id) { case PROP_KZ_WINDOW: - g_value_set_object(value, notebook->kz); + g_value_set_object(value, priv->kz); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -213,13 +191,12 @@ static void dispose (GObject *object) { - KzNotebook *notebook = KZ_NOTEBOOK(object); - KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(notebook); + KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(object); - if (notebook->kz) + if (priv->kz) { - g_object_unref(notebook->kz); - notebook->kz = NULL; + g_object_unref(priv->kz); + priv->kz = NULL; } if (priv->open_hist) @@ -251,9 +228,10 @@ guint info, guint time) { - KzWindow *kz = KZ_NOTEBOOK(widget)->kz; - g_return_if_fail(KZ_IS_WINDOW(kz)); + KzWindow *kz; + g_return_if_fail(KZ_IS_WINDOW(widget)); + kz = KZ_NOTEBOOK_GET_PRIVATE(widget)->kz; switch (info) { case TARGET_KAZEHAKASE_TAB: @@ -333,12 +311,12 @@ title = kz_embed_ensure_title(kzembed); if (title) { - gtk_window_set_title(GTK_WINDOW(KZ_NOTEBOOK(notebook)->kz), title); + gtk_window_set_title(GTK_WINDOW(priv->kz), title); g_free(title); } else { - gtk_window_set_title(GTK_WINDOW(KZ_NOTEBOOK(notebook)->kz), _("Kazehakase")); + gtk_window_set_title(GTK_WINDOW(priv->kz), _("Kazehakase")); } priv->view_hist = g_list_remove(priv->view_hist, kzembed); @@ -357,7 +335,7 @@ KZ_CONF_GET("Tab", "focus_loc_ent_new", focus, BOOL) && focus) { - g_idle_add(idle_focus_location_entry, KZ_NOTEBOOK(notebook)->kz); + g_idle_add(idle_focus_location_entry, priv->kz); } } @@ -462,9 +440,9 @@ { gchar *ret_page = NULL; KzTabLabel *kztab = NULL; - KzWindow *kz = notebook->kz; GtkWidget *next = NULL; KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(notebook); + KzWindow *kz = priv->kz; kztab = KZ_TAB_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), widget)); GtkWidget *current = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), @@ -577,7 +555,8 @@ KzNotebookPrivate *dest_priv, *src_priv; /* create new tab label */ - new_kztab = KZ_TAB_LABEL(kz_tab_label_new(dest_notebook->kz, KZ_EMBED(widget))); + dest_priv = KZ_NOTEBOOK_GET_PRIVATE(dest_notebook); + new_kztab = KZ_TAB_LABEL(kz_tab_label_new(dest_priv->kz, KZ_EMBED(widget))); /* move the page to this window */ g_object_ref(widget); @@ -587,7 +566,6 @@ GTK_WIDGET(new_kztab)); g_object_unref(widget); - dest_priv = KZ_NOTEBOOK_GET_PRIVATE(dest_notebook); src_priv = KZ_NOTEBOOK_GET_PRIVATE(src_notebook); /* remove view_hist */ src_priv->view_hist = g_list_remove(src_priv->view_hist, Index: kazehakase/src/kz-notebook.h diff -u kazehakase/src/kz-notebook.h:1.8 kazehakase/src/kz-notebook.h:1.9 --- kazehakase/src/kz-notebook.h:1.8 Sun Jan 7 06:06:20 2007 +++ kazehakase/src/kz-notebook.h Sun Jan 7 18:57:55 2007 @@ -21,9 +21,6 @@ struct _KzNotebook { GtkNotebook parent; - - /* Kazehakase */ - KzWindow *kz; }; struct _KzNotebookClass Index: kazehakase/src/kz-tab-label.h diff -u kazehakase/src/kz-tab-label.h:1.24 kazehakase/src/kz-tab-label.h:1.25 --- kazehakase/src/kz-tab-label.h:1.24 Fri Sep 23 21:16:08 2005 +++ kazehakase/src/kz-tab-label.h Sun Jan 7 18:57:55 2007 @@ -102,13 +102,13 @@ gboolean lock); gboolean kz_tab_label_get_auto_refresh (KzTabLabel *kztab); void kz_tab_label_set_auto_refresh (KzTabLabel *kztab, - gboolean auto_refresh); -gboolean kz_tab_label_get_javascript (KzTabLabel *kztab); -void kz_tab_label_set_javascript (KzTabLabel *kztab, - gboolean javascript); + gboolean auto_refresh); +gboolean kz_tab_label_get_javascript (KzTabLabel *kztab); +void kz_tab_label_set_javascript (KzTabLabel *kztab, + gboolean javascript); -void -kz_tab_label_set_history (KzTabLabel *kztab, KzBookmark *history); +void kz_tab_label_set_history (KzTabLabel *kztab, + KzBookmark *history); G_END_DECLS #endif /* __KZ_TAB_LABEL_H__ */