aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-toggle.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table/e-cell-toggle.c')
-rw-r--r--widgets/table/e-cell-toggle.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index ae7fcc703b..3d514c40e4 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -38,10 +38,6 @@
#include "e-cell-toggle.h"
#include "e-table-item.h"
-#define E_CELL_TOGGLE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_CELL_TOGGLE, ECellTogglePrivate))
-
struct _ECellTogglePrivate {
gchar **icon_names;
guint n_icon_names;
@@ -100,7 +96,7 @@ cell_toggle_dispose (GObject *object)
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE_GET_PRIVATE (object);
+ priv = E_CELL_TOGGLE (object)->priv;
if (priv->empty != NULL) {
g_object_unref (priv->empty);
@@ -120,7 +116,7 @@ cell_toggle_finalize (GObject *object)
ECellTogglePrivate *priv;
guint ii;
- priv = E_CELL_TOGGLE_GET_PRIVATE (object);
+ priv = E_CELL_TOGGLE (object)->priv;
/* The array is not NULL-terminated,
* so g_strfreev() will not work. */
@@ -187,7 +183,7 @@ cell_toggle_draw (ECellView *ecell_view,
const gint value = GPOINTER_TO_INT (
e_table_model_value_at (ecell_view->e_table_model, model_col, row));
- priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+ priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
if (value < 0 || value >= priv->pixbufs->len) {
g_warning ("Value from the table model is %d, the states we support are [0..%d)\n",
@@ -222,7 +218,7 @@ etog_set_value (ECellToggleView *toggle_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE_GET_PRIVATE (toggle_view->cell_view.ecell);
+ priv = E_CELL_TOGGLE (toggle_view->cell_view.ecell)->priv;
if (value >= priv->pixbufs->len)
value = 0;
@@ -270,7 +266,7 @@ cell_toggle_height (ECellView *ecell_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+ priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
return priv->height;
}
@@ -292,7 +288,7 @@ cell_toggle_print (ECellView *ecell_view,
cairo_t *cr;
- priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+ priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
if (value >= priv->pixbufs->len) {
g_warning ("Value from the table model is %d, the states we support are [0..%d)\n",
@@ -328,7 +324,7 @@ cell_toggle_print_height (ECellView *ecell_view,
{
ECellTogglePrivate *priv;
- priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+ priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
return priv->height;
}
@@ -343,7 +339,7 @@ cell_toggle_max_width (ECellView *ecell_view,
gint number_of_rows;
gint row;
- priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
+ priv = E_CELL_TOGGLE (ecell_view->ecell)->priv;
number_of_rows = e_table_model_row_count (ecell_view->e_table_model);
for (row = 0; row < number_of_rows; row++) {
@@ -390,7 +386,7 @@ e_cell_toggle_class_init (ECellToggleClass *class)
static void
e_cell_toggle_init (ECellToggle *cell_toggle)
{
- cell_toggle->priv = E_CELL_TOGGLE_GET_PRIVATE (cell_toggle);
+ cell_toggle->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell_toggle, E_TYPE_CELL_TOGGLE, ECellTogglePrivate);
cell_toggle->priv->empty =
gdk_pixbuf_new_from_xpm_data (empty_xpm);