[gtkhtml] Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml] Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
- Date: Thu, 24 Feb 2011 13:06:34 +0000 (UTC)
commit ceea255eab2bfd77a0fdf880e239bae4f43a4310
Author: Milan Crha <mcrha redhat com>
Date: Thu Feb 24 14:05:57 2011 +0100
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
components/editor/gtkhtml-color-combo.c | 16 ++++++----------
components/editor/gtkhtml-color-palette.c | 8 ++------
components/editor/gtkhtml-color-state.c | 10 +++-------
components/editor/gtkhtml-color-swatch.c | 12 ++++--------
components/editor/gtkhtml-combo-box.c | 10 +++-------
components/editor/gtkhtml-editor-private.h | 4 ----
components/editor/gtkhtml-editor.c | 2 +-
components/editor/gtkhtml-face-action.c | 20 ++++++++------------
components/editor/gtkhtml-face-chooser-menu.c | 7 +------
components/editor/gtkhtml-face-tool-button.c | 14 +++++---------
components/editor/gtkhtml-image-chooser-dialog.c | 13 ++++---------
components/editor/gtkhtml-spell-checker.c | 10 +++-------
components/editor/gtkhtml-spell-dialog.c | 10 +++-------
13 files changed, 43 insertions(+), 93 deletions(-)
---
diff --git a/components/editor/gtkhtml-color-combo.c b/components/editor/gtkhtml-color-combo.c
index e07fe1f..1418e1e 100644
--- a/components/editor/gtkhtml-color-combo.c
+++ b/components/editor/gtkhtml-color-combo.c
@@ -30,10 +30,6 @@
#define NUM_CUSTOM_COLORS 8
-#define GTKHTML_COLOR_COMBO_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_COLOR_COMBO, GtkhtmlColorComboPrivate))
-
enum {
PROP_0,
PROP_CURRENT_COLOR,
@@ -499,7 +495,7 @@ color_combo_get_property (GObject *object,
GtkhtmlColorComboPrivate *priv;
GdkColor color;
- priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (object);
+ priv = GTKHTML_COLOR_COMBO (object)->priv;
switch (property_id) {
case PROP_CURRENT_COLOR:
@@ -553,7 +549,7 @@ color_combo_dispose (GObject *object)
GtkhtmlColorComboPrivate *priv;
gint ii;
- priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (object);
+ priv = GTKHTML_COLOR_COMBO (object)->priv;
if (priv->color_button != NULL) {
g_object_unref (priv->color_button);
@@ -606,7 +602,7 @@ color_combo_get_preferred_width (GtkWidget *widget,
{
GtkhtmlColorComboPrivate *priv;
- priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_COMBO (widget)->priv;
gtk_widget_get_preferred_width (priv->toggle_button, minimum_width, natural_width);
}
@@ -618,7 +614,7 @@ color_combo_get_preferred_height (GtkWidget *widget,
{
GtkhtmlColorComboPrivate *priv;
- priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_COMBO (widget)->priv;
gtk_widget_get_preferred_height (priv->toggle_button, minimum_height, natural_height);
}
@@ -629,7 +625,7 @@ color_combo_size_allocate (GtkWidget *widget,
{
GtkhtmlColorComboPrivate *priv;
- priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_COMBO (widget)->priv;
gtk_widget_set_allocation (widget, allocation);
gtk_widget_size_allocate (priv->toggle_button, allocation);
@@ -855,7 +851,7 @@ color_combo_init (GtkhtmlColorCombo *combo)
GtkWidget *window;
guint ii;
- combo->priv = GTKHTML_COLOR_COMBO_GET_PRIVATE (combo);
+ combo->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo, GTKHTML_TYPE_COLOR_COMBO, GtkhtmlColorComboPrivate);
state = gtkhtml_color_state_new ();
gtkhtml_color_combo_set_state (combo, state);
diff --git a/components/editor/gtkhtml-color-palette.c b/components/editor/gtkhtml-color-palette.c
index 2a0de8b..df169b0 100644
--- a/components/editor/gtkhtml-color-palette.c
+++ b/components/editor/gtkhtml-color-palette.c
@@ -27,10 +27,6 @@
#include <string.h>
#include <glib/gi18n-lib.h>
-#define GTKHTML_COLOR_PALETTE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_COLOR_PALETTE, GtkhtmlColorPalettePrivate))
-
enum {
CHANGED,
LAST_SIGNAL
@@ -49,7 +45,7 @@ color_palette_finalize (GObject *object)
{
GtkhtmlColorPalettePrivate *priv;
- priv = GTKHTML_COLOR_PALETTE_GET_PRIVATE (object);
+ priv = GTKHTML_COLOR_PALETTE (object)->priv;
g_hash_table_destroy (priv->index);
g_slist_free (priv->list);
@@ -89,7 +85,7 @@ color_palette_init (GtkhtmlColorPalette *palette)
(GDestroyNotify) gdk_color_free,
(GDestroyNotify) NULL);
- palette->priv = GTKHTML_COLOR_PALETTE_GET_PRIVATE (palette);
+ palette->priv = G_TYPE_INSTANCE_GET_PRIVATE (palette, GTKHTML_TYPE_COLOR_PALETTE, GtkhtmlColorPalettePrivate);
palette->priv->index = index;
}
diff --git a/components/editor/gtkhtml-color-state.c b/components/editor/gtkhtml-color-state.c
index dec4979..dfb90b8 100644
--- a/components/editor/gtkhtml-color-state.c
+++ b/components/editor/gtkhtml-color-state.c
@@ -22,10 +22,6 @@
#include <glib/gi18n-lib.h>
-#define GTKHTML_COLOR_STATE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_COLOR_STATE, GtkhtmlColorStatePrivate))
-
enum {
PROP_0,
PROP_CURRENT_COLOR,
@@ -150,7 +146,7 @@ color_state_dispose (GObject *object)
{
GtkhtmlColorStatePrivate *priv;
- priv = GTKHTML_COLOR_STATE_GET_PRIVATE (object);
+ priv = GTKHTML_COLOR_STATE (object)->priv;
if (priv->palette != NULL) {
g_signal_handler_disconnect (
@@ -169,7 +165,7 @@ color_state_finalize (GObject *object)
{
GtkhtmlColorStatePrivate *priv;
- priv = GTKHTML_COLOR_STATE_GET_PRIVATE (object);
+ priv = GTKHTML_COLOR_STATE (object)->priv;
if (priv->current_color != NULL)
gdk_color_free (priv->current_color);
@@ -264,7 +260,7 @@ color_state_init (GtkhtmlColorState *state)
{
GtkhtmlColorPalette *palette;
- state->priv = GTKHTML_COLOR_STATE_GET_PRIVATE (state);
+ state->priv = G_TYPE_INSTANCE_GET_PRIVATE (state, GTKHTML_TYPE_COLOR_STATE, GtkhtmlColorStatePrivate);
palette = gtkhtml_color_palette_new ();
gtkhtml_color_state_set_palette (state, palette);
diff --git a/components/editor/gtkhtml-color-swatch.c b/components/editor/gtkhtml-color-swatch.c
index 8115c83..f6620bd 100644
--- a/components/editor/gtkhtml-color-swatch.c
+++ b/components/editor/gtkhtml-color-swatch.c
@@ -22,10 +22,6 @@
#include <glib/gi18n-lib.h>
-#define GTKHTML_COLOR_SWATCH_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_COLOR_SWATCH, GtkhtmlColorSwatchPrivate))
-
enum {
PROP_0,
PROP_COLOR,
@@ -134,7 +130,7 @@ color_swatch_get_preferred_width (GtkWidget *widget,
{
GtkhtmlColorSwatchPrivate *priv;
- priv = GTKHTML_COLOR_SWATCH_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_SWATCH (widget)->priv;
gtk_widget_get_preferred_width (
priv->frame, minimum_width, natural_width);
@@ -147,7 +143,7 @@ color_swatch_get_preferred_height (GtkWidget *widget,
{
GtkhtmlColorSwatchPrivate *priv;
- priv = GTKHTML_COLOR_SWATCH_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_SWATCH (widget)->priv;
gtk_widget_get_preferred_height (
priv->frame, minimum_height, natural_height);
@@ -159,7 +155,7 @@ color_swatch_size_allocate (GtkWidget *widget,
{
GtkhtmlColorSwatchPrivate *priv;
- priv = GTKHTML_COLOR_SWATCH_GET_PRIVATE (widget);
+ priv = GTKHTML_COLOR_SWATCH (widget)->priv;
gtk_widget_set_allocation (widget, allocation);
gtk_widget_size_allocate (priv->frame, allocation);
@@ -212,7 +208,7 @@ color_swatch_init (GtkhtmlColorSwatch *swatch)
GtkWidget *container;
GtkWidget *widget;
- swatch->priv = GTKHTML_COLOR_SWATCH_GET_PRIVATE (swatch);
+ swatch->priv = G_TYPE_INSTANCE_GET_PRIVATE (swatch, GTKHTML_TYPE_COLOR_SWATCH, GtkhtmlColorSwatchPrivate);
widget = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (swatch), widget);
diff --git a/components/editor/gtkhtml-combo-box.c b/components/editor/gtkhtml-combo-box.c
index e6bad02..a0927eb 100644
--- a/components/editor/gtkhtml-combo-box.c
+++ b/components/editor/gtkhtml-combo-box.c
@@ -22,10 +22,6 @@
#include <glib/gi18n-lib.h>
-#define GTKHTML_COMBO_BOX_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_COMBO_BOX, GtkhtmlComboBoxPrivate))
-
enum {
COLUMN_ACTION,
COLUMN_SORT
@@ -249,7 +245,7 @@ combo_box_get_property (GObject *object,
static void
combo_box_dispose (GObject *object)
{
- GtkhtmlComboBoxPrivate *priv = GTKHTML_COMBO_BOX_GET_PRIVATE (object);
+ GtkhtmlComboBoxPrivate *priv = GTKHTML_COMBO_BOX (object)->priv;
if (priv->action != NULL) {
g_object_unref (priv->action);
@@ -270,7 +266,7 @@ combo_box_dispose (GObject *object)
static void
combo_box_finalize (GObject *object)
{
- GtkhtmlComboBoxPrivate *priv = GTKHTML_COMBO_BOX_GET_PRIVATE (object);
+ GtkhtmlComboBoxPrivate *priv = GTKHTML_COMBO_BOX (object)->priv;
g_hash_table_destroy (priv->index);
@@ -358,7 +354,7 @@ combo_box_class_init (GtkhtmlComboBoxClass *class)
static void
combo_box_init (GtkhtmlComboBox *combo_box)
{
- combo_box->priv = GTKHTML_COMBO_BOX_GET_PRIVATE (combo_box);
+ combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box, GTKHTML_TYPE_COMBO_BOX, GtkhtmlComboBoxPrivate);
combo_box->priv->index = g_hash_table_new_full (
g_direct_hash, g_direct_equal,
diff --git a/components/editor/gtkhtml-editor-private.h b/components/editor/gtkhtml-editor-private.h
index 7197915..e18aa08 100644
--- a/components/editor/gtkhtml-editor-private.h
+++ b/components/editor/gtkhtml-editor-private.h
@@ -73,10 +73,6 @@
/* Marshalling */
#include "gtkhtml-editor-marshal.h"
-#define GTKHTML_EDITOR_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_EDITOR, GtkhtmlEditorPrivate))
-
/* Shorthand, requires a variable named "editor". */
#define ACTION(name) (GTKHTML_EDITOR_ACTION_##name (editor))
#define WIDGET(name) (GTKHTML_EDITOR_WIDGET_##name (editor))
diff --git a/components/editor/gtkhtml-editor.c b/components/editor/gtkhtml-editor.c
index 3c4c549..3088f22 100644
--- a/components/editor/gtkhtml-editor.c
+++ b/components/editor/gtkhtml-editor.c
@@ -963,7 +963,7 @@ editor_class_init (GtkhtmlEditorClass *class)
static void
editor_init (GtkhtmlEditor *editor)
{
- editor->priv = GTKHTML_EDITOR_GET_PRIVATE (editor);
+ editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor, GTKHTML_TYPE_EDITOR, GtkhtmlEditorPrivate);
editor->vbox = g_object_ref_sink (gtk_vbox_new (FALSE, 0));
gtk_widget_show (editor->vbox);
diff --git a/components/editor/gtkhtml-face-action.c b/components/editor/gtkhtml-face-action.c
index c5fc278..12b4c24 100644
--- a/components/editor/gtkhtml-face-action.c
+++ b/components/editor/gtkhtml-face-action.c
@@ -23,10 +23,6 @@
#include "gtkhtml-face-chooser-menu.h"
#include "gtkhtml-face-tool-button.h"
-#define GTKHTML_FACE_ACTION_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_FACE_ACTION, GtkhtmlFaceActionPrivate))
-
struct _GtkhtmlFaceActionPrivate {
GList *choosers;
GtkhtmlFaceChooser *current_chooser;
@@ -87,7 +83,7 @@ face_action_finalize (GObject *object)
{
GtkhtmlFaceActionPrivate *priv;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (object);
+ priv = GTKHTML_FACE_ACTION (object)->priv;
g_list_free (priv->choosers);
@@ -100,7 +96,7 @@ face_action_activate (GtkAction *action)
{
GtkhtmlFaceActionPrivate *priv;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (action);
+ priv = GTKHTML_FACE_ACTION (action)->priv;
priv->current_chooser = NULL;
}
@@ -131,7 +127,7 @@ face_action_connect_proxy (GtkAction *action,
{
GtkhtmlFaceActionPrivate *priv;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (action);
+ priv = GTKHTML_FACE_ACTION (action)->priv;
if (!GTKHTML_IS_FACE_CHOOSER (proxy))
goto chainup;
@@ -154,7 +150,7 @@ face_action_disconnect_proxy (GtkAction *action,
{
GtkhtmlFaceActionPrivate *priv;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (action);
+ priv = GTKHTML_FACE_ACTION (action)->priv;
priv->choosers = g_list_remove (priv->choosers, proxy);
@@ -168,7 +164,7 @@ face_action_create_menu (GtkAction *action)
GtkhtmlFaceActionPrivate *priv;
GtkWidget *widget;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (action);
+ priv = GTKHTML_FACE_ACTION (action)->priv;
widget = gtkhtml_face_chooser_menu_new ();
@@ -187,7 +183,7 @@ face_action_get_current_face (GtkhtmlFaceChooser *chooser)
GtkhtmlFaceActionPrivate *priv;
GtkhtmlFace *face = NULL;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (chooser);
+ priv = GTKHTML_FACE_ACTION (chooser)->priv;
if (priv->current_chooser != NULL)
face = gtkhtml_face_chooser_get_current_face (
@@ -203,7 +199,7 @@ face_action_set_current_face (GtkhtmlFaceChooser *chooser,
GtkhtmlFaceActionPrivate *priv;
GList *iter;
- priv = GTKHTML_FACE_ACTION_GET_PRIVATE (chooser);
+ priv = GTKHTML_FACE_ACTION (chooser)->priv;
for (iter = priv->choosers; iter != NULL; iter = iter->next) {
GtkhtmlFaceChooser *proxy_chooser = iter->data;
@@ -248,7 +244,7 @@ face_action_iface_init (GtkhtmlFaceChooserIface *iface)
static void
face_action_init (GtkhtmlFaceAction *action)
{
- action->priv = GTKHTML_FACE_ACTION_GET_PRIVATE (action);
+ action->priv = G_TYPE_INSTANCE_GET_PRIVATE (action, GTKHTML_TYPE_FACE_ACTION, GtkhtmlFaceActionPrivate);
}
GType
diff --git a/components/editor/gtkhtml-face-chooser-menu.c b/components/editor/gtkhtml-face-chooser-menu.c
index a6aba96..7b99d40 100644
--- a/components/editor/gtkhtml-face-chooser-menu.c
+++ b/components/editor/gtkhtml-face-chooser-menu.c
@@ -23,10 +23,6 @@
#include <glib/gi18n-lib.h>
-#define GTKHTML_FACE_CHOOSER_MENU_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_FACE_CHOOSER_MENU, GtkhtmlFaceChooserMenuPrivate))
-
struct _GtkhtmlFaceChooserMenuPrivate {
gint dummy;
};
@@ -140,8 +136,7 @@ face_chooser_menu_init (GtkhtmlFaceChooserMenu *chooser_menu)
GtkhtmlFaceChooser *chooser;
GList *list, *iter;
- chooser_menu->priv =
- GTKHTML_FACE_CHOOSER_MENU_GET_PRIVATE (chooser_menu);
+ chooser_menu->priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser_menu, GTKHTML_TYPE_FACE_CHOOSER_MENU, GtkhtmlFaceChooserMenuPrivate);
chooser = GTKHTML_FACE_CHOOSER (chooser_menu);
list = gtkhtml_face_chooser_get_items (chooser);
diff --git a/components/editor/gtkhtml-face-tool-button.c b/components/editor/gtkhtml-face-tool-button.c
index 05a7149..8ddfe18 100644
--- a/components/editor/gtkhtml-face-tool-button.c
+++ b/components/editor/gtkhtml-face-tool-button.c
@@ -30,10 +30,6 @@
#include "gtkhtml-face-chooser.h"
-#define GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_FACE_TOOL_BUTTON, GtkhtmlFaceToolButtonPrivate))
-
/* XXX Should calculate this dynamically. */
#define NUM_ROWS 7
#define NUM_COLS 3
@@ -250,7 +246,7 @@ face_tool_button_get_property (GObject *object,
{
GtkhtmlFaceToolButtonPrivate *priv;
- priv = GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE (object);
+ priv = GTKHTML_FACE_TOOL_BUTTON (object)->priv;
switch (property_id) {
case PROP_CURRENT_FACE:
@@ -273,7 +269,7 @@ face_tool_button_dispose (GObject *object)
{
GtkhtmlFaceToolButtonPrivate *priv;
- priv = GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE (object);
+ priv = GTKHTML_FACE_TOOL_BUTTON (object)->priv;
if (priv->window != NULL) {
g_object_unref (priv->window);
@@ -393,7 +389,7 @@ face_tool_button_get_current_face (GtkhtmlFaceChooser *chooser)
{
GtkhtmlFaceToolButtonPrivate *priv;
- priv = GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE (chooser);
+ priv = GTKHTML_FACE_TOOL_BUTTON (chooser)->priv;
if (priv->active_button == NULL)
return NULL;
@@ -408,7 +404,7 @@ face_tool_button_set_current_face (GtkhtmlFaceChooser *chooser,
GtkhtmlFaceToolButtonPrivate *priv;
GList *list, *iter;
- priv = GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE (chooser);
+ priv = GTKHTML_FACE_TOOL_BUTTON (chooser)->priv;
list = gtk_container_get_children (GTK_CONTAINER (priv->table));
@@ -520,7 +516,7 @@ face_tool_button_init (GtkhtmlFaceToolButton *button)
GList *list, *iter;
gint ii;
- button->priv = GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE (button);
+ button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button, GTKHTML_TYPE_FACE_TOOL_BUTTON, GtkhtmlFaceToolButtonPrivate);
/* Build the pop-up window. */
diff --git a/components/editor/gtkhtml-image-chooser-dialog.c b/components/editor/gtkhtml-image-chooser-dialog.c
index 7fc8b1c..64aea5d 100644
--- a/components/editor/gtkhtml-image-chooser-dialog.c
+++ b/components/editor/gtkhtml-image-chooser-dialog.c
@@ -18,11 +18,6 @@
#include "gtkhtml-image-chooser-dialog.h"
-#define GTKHTML_IMAGE_CHOOSER_DIALOG_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_IMAGE_CHOOSER_DIALOG, \
- GtkhtmlImageChooserDialogPrivate))
-
#define PREVIEW_WIDTH 256
#define PREVIEW_HEIGHT 256
@@ -106,7 +101,7 @@ image_chooser_dialog_update_preview (GtkFileChooser *file_chooser)
GFile *preview_file;
Context *context;
- priv = GTKHTML_IMAGE_CHOOSER_DIALOG_GET_PRIVATE (file_chooser);
+ priv = GTKHTML_IMAGE_CHOOSER_DIALOG (file_chooser)->priv;
preview_file = gtk_file_chooser_get_preview_file (file_chooser);
preview_widget = gtk_file_chooser_get_preview_widget (file_chooser);
@@ -176,7 +171,7 @@ image_chooser_dialog_dispose (GObject *object)
{
GtkhtmlImageChooserDialogPrivate *priv;
- priv = GTKHTML_IMAGE_CHOOSER_DIALOG_GET_PRIVATE (object);
+ priv = GTKHTML_IMAGE_CHOOSER_DIALOG (object)->priv;
if (priv->cancellable != NULL) {
g_cancellable_cancel (priv->cancellable);
@@ -194,7 +189,7 @@ image_chooser_dialog_finalize (GObject *object)
{
GtkhtmlImageChooserDialogPrivate *priv;
- priv = GTKHTML_IMAGE_CHOOSER_DIALOG_GET_PRIVATE (object);
+ priv = GTKHTML_IMAGE_CHOOSER_DIALOG (object)->priv;
g_free (priv->current_folder);
@@ -258,7 +253,7 @@ gtkhtml_image_chooser_dialog_class_init (GtkhtmlImageChooserDialogClass *class)
static void
gtkhtml_image_chooser_dialog_init (GtkhtmlImageChooserDialog *dialog)
{
- dialog->priv = GTKHTML_IMAGE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+ dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GTKHTML_TYPE_IMAGE_CHOOSER_DIALOG, GtkhtmlImageChooserDialogPrivate);
g_signal_connect (
dialog, "update-preview",
diff --git a/components/editor/gtkhtml-spell-checker.c b/components/editor/gtkhtml-spell-checker.c
index 0b9f2fc..eac7918 100644
--- a/components/editor/gtkhtml-spell-checker.c
+++ b/components/editor/gtkhtml-spell-checker.c
@@ -26,10 +26,6 @@
#include "gtkhtml-spell-marshal.h"
-#define GTKHTML_SPELL_CHECKER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_SPELL_CHECKER, GtkhtmlSpellCheckerPrivate))
-
enum {
PROP_0,
PROP_LANGUAGE
@@ -135,7 +131,7 @@ spell_checker_set_property (GObject *object,
{
GtkhtmlSpellCheckerPrivate *priv;
- priv = GTKHTML_SPELL_CHECKER_GET_PRIVATE (object);
+ priv = GTKHTML_SPELL_CHECKER (object)->priv;
switch (property_id) {
case PROP_LANGUAGE:
@@ -168,7 +164,7 @@ spell_checker_finalize (GObject *object)
{
GtkhtmlSpellCheckerPrivate *priv;
- priv = GTKHTML_SPELL_CHECKER_GET_PRIVATE (object);
+ priv = GTKHTML_SPELL_CHECKER (object)->priv;
if (priv->dict != NULL)
enchant_broker_free_dict (priv->broker, priv->dict);
@@ -241,7 +237,7 @@ spell_checker_class_init (GtkhtmlSpellCheckerClass *class)
static void
spell_checker_init (GtkhtmlSpellChecker *checker)
{
- checker->priv = GTKHTML_SPELL_CHECKER_GET_PRIVATE (checker);
+ checker->priv = G_TYPE_INSTANCE_GET_PRIVATE (checker, GTKHTML_TYPE_SPELL_CHECKER, GtkhtmlSpellCheckerPrivate);
checker->priv->broker = enchant_broker_init ();
}
diff --git a/components/editor/gtkhtml-spell-dialog.c b/components/editor/gtkhtml-spell-dialog.c
index b923d7f..9663997 100644
--- a/components/editor/gtkhtml-spell-dialog.c
+++ b/components/editor/gtkhtml-spell-dialog.c
@@ -23,10 +23,6 @@
#include <glib/gi18n-lib.h>
#include "gtkhtml-spell-checker.h"
-#define GTKHTML_SPELL_DIALOG_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), GTKHTML_TYPE_SPELL_DIALOG, GtkhtmlSpellDialogPrivate))
-
enum {
COMBO_COLUMN_CHECKER, /* GTKHTML_TYPE_SPELL_CHECKER */
COMBO_COLUMN_TEXT /* G_TYPE_STRING */
@@ -277,7 +273,7 @@ spell_dialog_dispose (GObject *object)
{
GtkhtmlSpellDialogPrivate *priv;
- priv = GTKHTML_SPELL_DIALOG_GET_PRIVATE (object);
+ priv = GTKHTML_SPELL_DIALOG (object)->priv;
if (priv->add_word_button != NULL) {
g_object_unref (priv->add_word_button);
@@ -328,7 +324,7 @@ spell_dialog_finalize (GObject *object)
{
GtkhtmlSpellDialogPrivate *priv;
- priv = GTKHTML_SPELL_DIALOG_GET_PRIVATE (object);
+ priv = GTKHTML_SPELL_DIALOG (object)->priv;
g_free (priv->word);
@@ -423,7 +419,7 @@ spell_dialog_init (GtkhtmlSpellDialog *dialog)
GtkWidget *widget;
gchar *markup;
- dialog->priv = GTKHTML_SPELL_DIALOG_GET_PRIVATE (dialog);
+ dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GTKHTML_TYPE_SPELL_DIALOG, GtkhtmlSpellDialogPrivate);
g_signal_connect (
dialog, "notify::word", G_CALLBACK (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]