summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-26 20:42:08 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-05-26 20:42:08 -0400
commit8dba12e1c5cab5f48dbf8e5a400e8748ad7aac79 (patch)
tree254e878708810dfbf3e02d1d6c4ff26851e8b1ed
parent367f350f1f0b0f0ecb2a96eb3744e8c6b05edc19 (diff)
downloadgtk+-8dba12e1c5cab5f48dbf8e5a400e8748ad7aac79.tar.gz
cell renderer progress: Drop the priv pointer
-rw-r--r--gtk/gtkcellrendererprogress.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c
index 62a2563d00..bd2ae8bb01 100644
--- a/gtk/gtkcellrendererprogress.c
+++ b/gtk/gtkcellrendererprogress.c
@@ -64,9 +64,6 @@ typedef struct _GtkCellRendererProgressPrivate GtkCellRendererProgressPrivate;
struct _GtkCellRendererProgress
{
GtkCellRenderer parent_instance;
-
- /*< private >*/
- GtkCellRendererProgressPrivate *priv;
};
struct _GtkCellRendererProgressClass
@@ -239,10 +236,7 @@ gtk_cell_renderer_progress_class_init (GtkCellRendererProgressClass *klass)
static void
gtk_cell_renderer_progress_init (GtkCellRendererProgress *cellprogress)
{
- GtkCellRendererProgressPrivate *priv;
-
- cellprogress->priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
- priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
priv->value = 0;
priv->text = NULL;
@@ -277,7 +271,7 @@ static void
gtk_cell_renderer_progress_finalize (GObject *object)
{
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (object);
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
g_free (priv->text);
g_free (priv->label);
@@ -292,7 +286,7 @@ gtk_cell_renderer_progress_get_property (GObject *object,
GParamSpec *pspec)
{
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (object);
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
switch (param_id)
{
@@ -329,7 +323,7 @@ gtk_cell_renderer_progress_set_property (GObject *object,
GParamSpec *pspec)
{
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (object);
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
switch (param_id)
{
@@ -373,7 +367,7 @@ gtk_cell_renderer_progress_set_property (GObject *object,
static void
recompute_label (GtkCellRendererProgress *cellprogress)
{
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
gchar *label;
if (priv->text)
@@ -391,9 +385,11 @@ static void
gtk_cell_renderer_progress_set_value (GtkCellRendererProgress *cellprogress,
gint value)
{
- if (cellprogress->priv->value != value)
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
+
+ if (priv->value != value)
{
- cellprogress->priv->value = value;
+ priv->value = value;
recompute_label (cellprogress);
g_object_notify (G_OBJECT (cellprogress), "value");
}
@@ -403,11 +399,12 @@ static void
gtk_cell_renderer_progress_set_text (GtkCellRendererProgress *cellprogress,
const gchar *text)
{
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
gchar *new_text;
new_text = g_strdup (text);
- g_free (cellprogress->priv->text);
- cellprogress->priv->text = new_text;
+ g_free (priv->text);
+ priv->text = new_text;
recompute_label (cellprogress);
g_object_notify (G_OBJECT (cellprogress), "text");
}
@@ -416,7 +413,7 @@ static void
gtk_cell_renderer_progress_set_pulse (GtkCellRendererProgress *cellprogress,
gint pulse)
{
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
if (pulse != priv->pulse)
{
@@ -466,7 +463,7 @@ gtk_cell_renderer_progress_get_size (GtkCellRenderer *cell,
gint *height)
{
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (cell);
- GtkCellRendererProgressPrivate *priv = cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
gint w, h;
gchar *text;
@@ -557,7 +554,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
GtkCellRendererState flags)
{
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (cell);
- GtkCellRendererProgressPrivate *priv= cellprogress->priv;
+ GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
GtkStyleContext *context;
GtkBorder padding;
PangoLayout *layout;