aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-toggle.c22
-rw-r--r--widgets/table/e-table-extras.c8
-rw-r--r--widgets/table/e-table-memory-store.c8
-rw-r--r--widgets/table/e-table-memory.c8
-rw-r--r--widgets/table/e-table-search.c8
-rw-r--r--widgets/table/e-table-without.c8
-rw-r--r--widgets/table/e-tree-memory.c8
-rw-r--r--widgets/table/e-tree-selection-model.c8
-rw-r--r--widgets/table/e-tree-sorted.c10
-rw-r--r--widgets/table/e-tree-table-adapter.c10
-rw-r--r--widgets/table/e-tree.c8
11 files changed, 31 insertions, 75 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);
diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c
index f6dc1118da..c2fc291c3a 100644
--- a/widgets/table/e-table-extras.c
+++ b/widgets/table/e-table-extras.c
@@ -41,10 +41,6 @@
#include "e-table-extras.h"
#include "e-table-sorting-utils.h"
-#define E_TABLE_EXTRAS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TABLE_EXTRAS, ETableExtrasPrivate))
-
struct _ETableExtrasPrivate {
GHashTable *cells;
GHashTable *compares;
@@ -61,7 +57,7 @@ ete_finalize (GObject *object)
{
ETableExtrasPrivate *priv;
- priv = E_TABLE_EXTRAS_GET_PRIVATE (object);
+ priv = E_TABLE_EXTRAS (object)->priv;
if (priv->cells) {
g_hash_table_destroy (priv->cells);
@@ -234,7 +230,7 @@ ete_init (ETableExtras *extras)
{
ECell *cell, *sub_cell;
- extras->priv = E_TABLE_EXTRAS_GET_PRIVATE (extras);
+ extras->priv = G_TYPE_INSTANCE_GET_PRIVATE (extras, E_TYPE_TABLE_EXTRAS, ETableExtrasPrivate);
extras->priv->cells = g_hash_table_new_full (
g_str_hash, g_str_equal,
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
index 5a0263b308..37816c8a18 100644
--- a/widgets/table/e-table-memory-store.c
+++ b/widgets/table/e-table-memory-store.c
@@ -28,10 +28,6 @@
#include "e-table-memory-store.h"
-#define E_TABLE_MEMORY_STORE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TABLE_MEMORY_STORE, ETableMemoryStorePrivate))
-
#define STORE_LOCATOR(etms, col, row) (*((etms)->priv->store + (row) * (etms)->priv->col_count + (col)))
struct _ETableMemoryStorePrivate {
@@ -230,7 +226,7 @@ etms_finalize (GObject *object)
{
ETableMemoryStorePrivate *priv;
- priv = E_TABLE_MEMORY_STORE_GET_PRIVATE (object);
+ priv = E_TABLE_MEMORY_STORE (object)->priv;
e_table_memory_store_clear (E_TABLE_MEMORY_STORE (object));
@@ -244,7 +240,7 @@ etms_finalize (GObject *object)
static void
e_table_memory_store_init (ETableMemoryStore *etms)
{
- etms->priv = E_TABLE_MEMORY_STORE_GET_PRIVATE (etms);
+ etms->priv = G_TYPE_INSTANCE_GET_PRIVATE (etms, E_TYPE_TABLE_MEMORY_STORE, ETableMemoryStorePrivate);
}
static void
diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c
index 0c0237531b..d55aa04b51 100644
--- a/widgets/table/e-table-memory.c
+++ b/widgets/table/e-table-memory.c
@@ -37,10 +37,6 @@
#include "e-table-memory.h"
-#define E_TABLE_MEMORY_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TABLE_MEMORY, ETableMemoryPrivate))
-
G_DEFINE_TYPE (ETableMemory, e_table_memory, E_TYPE_TABLE_MODEL)
struct _ETableMemoryPrivate {
@@ -54,7 +50,7 @@ etmm_finalize (GObject *object)
{
ETableMemoryPrivate *priv;
- priv = E_TABLE_MEMORY_GET_PRIVATE (object);
+ priv = E_TABLE_MEMORY (object)->priv;
g_free (priv->data);
@@ -88,7 +84,7 @@ e_table_memory_class_init (ETableMemoryClass *class)
static void
e_table_memory_init (ETableMemory *etmm)
{
- etmm->priv = E_TABLE_MEMORY_GET_PRIVATE (etmm);
+ etmm->priv = G_TYPE_INSTANCE_GET_PRIVATE (etmm, E_TYPE_TABLE_MEMORY, ETableMemoryPrivate);
}
/**
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
index 10ed919571..23e8cdf002 100644
--- a/widgets/table/e-table-search.c
+++ b/widgets/table/e-table-search.c
@@ -30,10 +30,6 @@
#define d(x)
-#define E_TABLE_SEARCH_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TABLE_SEARCH, ETableSearchPrivate))
-
d (static gint depth = 0)
struct _ETableSearchPrivate {
@@ -112,7 +108,7 @@ e_table_search_finalize (GObject *object)
{
ETableSearchPrivate *priv;
- priv = E_TABLE_SEARCH_GET_PRIVATE (object);
+ priv = E_TABLE_SEARCH (object)->priv;
drop_timeout (E_TABLE_SEARCH (object));
@@ -157,7 +153,7 @@ e_table_search_class_init (ETableSearchClass *class)
static void
e_table_search_init (ETableSearch *ets)
{
- ets->priv = E_TABLE_SEARCH_GET_PRIVATE (ets);
+ ets->priv = G_TYPE_INSTANCE_GET_PRIVATE (ets, E_TYPE_TABLE_SEARCH, ETableSearchPrivate);
ets->priv->search_string = g_strdup ("");
}
diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c
index 881c21bf16..54e733fdad 100644
--- a/widgets/table/e-table-without.c
+++ b/widgets/table/e-table-without.c
@@ -30,10 +30,6 @@
#include "e-table-without.h"
-#define E_TABLE_WITHOUT_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TABLE_WITHOUT, ETableWithoutPrivate))
-
/* workaround for avoiding API breakage */
#define etw_get_type e_table_without_get_type
G_DEFINE_TYPE (ETableWithout, etw, E_TYPE_TABLE_SUBSET)
@@ -141,7 +137,7 @@ etw_dispose (GObject *object)
{
ETableWithoutPrivate *priv;
- priv = E_TABLE_WITHOUT_GET_PRIVATE (object);
+ priv = E_TABLE_WITHOUT (object)->priv;
if (priv->hash != NULL) {
g_hash_table_foreach (priv->hash, delete_hash_element, object);
@@ -252,7 +248,7 @@ etw_class_init (ETableWithoutClass *class)
static void
etw_init (ETableWithout *etw)
{
- etw->priv = E_TABLE_WITHOUT_GET_PRIVATE (etw);
+ etw->priv = G_TYPE_INSTANCE_GET_PRIVATE (etw, E_TYPE_TABLE_WITHOUT, ETableWithoutPrivate);
}
ETableModel *
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index bb26fa773f..5c7b8f46d2 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -37,10 +37,6 @@
#include "e-tree-memory.h"
-#define E_TREE_MEMORY_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TREE_MEMORY, ETreeMemoryPrivate))
-
G_DEFINE_TYPE (ETreeMemory, e_tree_memory, E_TYPE_TREE_MODEL)
enum {
@@ -221,7 +217,7 @@ etmm_dispose (GObject *object)
{
ETreeMemoryPrivate *priv;
- priv = E_TREE_MEMORY_GET_PRIVATE (object);
+ priv = E_TREE_MEMORY (object)->priv;
if (priv->root)
e_tree_memory_node_remove (
@@ -393,7 +389,7 @@ e_tree_memory_class_init (ETreeMemoryClass *class)
static void
e_tree_memory_init (ETreeMemory *etmm)
{
- etmm->priv = E_TREE_MEMORY_GET_PRIVATE (etmm);
+ etmm->priv = G_TYPE_INSTANCE_GET_PRIVATE (etmm, E_TYPE_TREE_MEMORY, ETreeMemoryPrivate);
}
/**
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index cd438a77e2..18ec388530 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -29,10 +29,6 @@
#include "e-tree-selection-model.h"
-#define E_TREE_SELECTION_MODEL_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelPrivate))
-
G_DEFINE_TYPE (
ETreeSelectionModel, e_tree_selection_model, E_TYPE_SELECTION_MODEL)
@@ -290,7 +286,7 @@ etsm_finalize (GObject *object)
{
ETreeSelectionModelPrivate *priv;
- priv = E_TREE_SELECTION_MODEL_GET_PRIVATE (object);
+ priv = E_TREE_SELECTION_MODEL (object)->priv;
clear_selection (E_TREE_SELECTION_MODEL (object));
g_hash_table_destroy (priv->paths);
@@ -745,7 +741,7 @@ e_tree_selection_model_get_cursor (ETreeSelectionModel *etsm)
static void
e_tree_selection_model_init (ETreeSelectionModel *etsm)
{
- etsm->priv = E_TREE_SELECTION_MODEL_GET_PRIVATE (etsm);
+ etsm->priv = G_TYPE_INSTANCE_GET_PRIVATE (etsm, E_TYPE_TREE_SELECTION_MODEL, ETreeSelectionModelPrivate);
etsm->priv->paths = g_hash_table_new (NULL, NULL);
etsm->priv->cursor_col = -1;
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index 40b10c0dec..5b5bc80f24 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -48,10 +48,6 @@
#define d(x)
-#define E_TREE_SORTED_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TREE_SORTED, ETreeSortedPrivate))
-
G_DEFINE_TYPE (ETreeSorted, e_tree_sorted, E_TYPE_TREE_MODEL)
enum {
@@ -588,7 +584,7 @@ ets_dispose (GObject *object)
{
ETreeSortedPrivate *priv;
- priv = E_TREE_SORTED_GET_PRIVATE (object);
+ priv = E_TREE_SORTED (object)->priv;
if (priv->source) {
g_signal_handler_disconnect (
@@ -654,7 +650,7 @@ ets_finalize (GObject *object)
{
ETreeSortedPrivate *priv;
- priv = E_TREE_SORTED_GET_PRIVATE (object);
+ priv = E_TREE_SORTED (object)->priv;
if (priv->root)
free_path (priv->root);
@@ -1207,7 +1203,7 @@ e_tree_sorted_class_init (ETreeSortedClass *class)
static void
e_tree_sorted_init (ETreeSorted *ets)
{
- ets->priv = E_TREE_SORTED_GET_PRIVATE (ets);
+ ets->priv = G_TYPE_INSTANCE_GET_PRIVATE (ets, E_TYPE_TREE_SORTED, ETreeSortedPrivate);
}
/**
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 4ca80d97a0..bbeed6ee38 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -38,10 +38,6 @@
#include "e-table-sorting-utils.h"
#include "e-tree-table-adapter.h"
-#define E_TREE_TABLE_ADAPTER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TREE_TABLE_ADAPTER, ETreeTableAdapterPrivate))
-
/* workaround for avoiding API breakage */
#define etta_get_type e_tree_table_adapter_get_type
G_DEFINE_TYPE (ETreeTableAdapter, etta, E_TYPE_TABLE_MODEL)
@@ -514,7 +510,7 @@ etta_finalize (GObject *object)
{
ETreeTableAdapterPrivate *priv;
- priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (object);
+ priv = E_TREE_TABLE_ADAPTER (object)->priv;
if (priv->resort_idle_id) {
g_source_remove (priv->resort_idle_id);
@@ -539,7 +535,7 @@ etta_dispose (GObject *object)
{
ETreeTableAdapterPrivate *priv;
- priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (object);
+ priv = E_TREE_TABLE_ADAPTER (object)->priv;
if (priv->sort_info) {
g_signal_handler_disconnect (
@@ -747,7 +743,7 @@ etta_class_init (ETreeTableAdapterClass *class)
static void
etta_init (ETreeTableAdapter *etta)
{
- etta->priv = E_TREE_TABLE_ADAPTER_GET_PRIVATE (etta);
+ etta->priv = G_TYPE_INSTANCE_GET_PRIVATE (etta, E_TYPE_TREE_TABLE_ADAPTER, ETreeTableAdapterPrivate);
etta->priv->root_visible = TRUE;
etta->priv->remap_needed = TRUE;
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index fd5340dcad..dfbc3ccdce 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -56,10 +56,6 @@
#define d(x)
-#define E_TREE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_TREE, ETreePrivate))
-
enum {
CURSOR_CHANGE,
CURSOR_ACTIVATED,
@@ -387,7 +383,7 @@ et_dispose (GObject *object)
{
ETreePrivate *priv;
- priv = E_TREE_GET_PRIVATE (object);
+ priv = E_TREE (object)->priv;
if (priv->search != NULL) {
g_signal_handler_disconnect (
@@ -585,7 +581,7 @@ e_tree_init (ETree *e_tree)
gtk_table_set_homogeneous (GTK_TABLE (e_tree), FALSE);
- e_tree->priv = E_TREE_GET_PRIVATE (e_tree);
+ e_tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (e_tree, E_TYPE_TREE, ETreePrivate);
e_tree->priv->alternating_row_colors = 1;
e_tree->priv->horizontal_draw_grid = 1;