summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-28 14:13:48 +0200
committerinfirit <[email protected]>2015-07-28 20:02:12 +0200
commitc47626fceef2faf0f09ca61a5e6934a06517332b (patch)
tree3217671a2c427d01c2c84e121f26a1f9e4812be7 /src
parenta0fb3a8910cf0c9d4d2ec7d24faba5a68109da32 (diff)
downloadmate-notification-daemon-c47626fceef2faf0f09ca61a5e6934a06517332b.tar.bz2
mate-notification-daemon-c47626fceef2faf0f09ca61a5e6934a06517332b.tar.xz
Use accessor functions instead of direct access
Diffstat (limited to 'src')
-rw-r--r--src/themes/slider/theme.c15
-rw-r--r--src/themes/standard/theme.c2
2 files changed, 10 insertions, 7 deletions
diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c
index 213263c..e06bee6 100644
--- a/src/themes/slider/theme.c
+++ b/src/themes/slider/theme.c
@@ -122,6 +122,7 @@ static void fill_background(GtkWidget* widget, WindowData* windata, cairo_t* cr)
GdkRGBA fg_color;
GdkRGBA bg_color;
#else
+ GtkStyle *style;
GdkColor color;
#endif
double r, g, b;
@@ -157,7 +158,9 @@ static void fill_background(GtkWidget* widget, WindowData* windata, cairo_t* cr)
cairo_stroke(cr);
#else
- color = widget->style->bg[GTK_STATE_NORMAL];
+ style = gtk_widget_get_style (widget);
+
+ color = style->bg[GTK_STATE_NORMAL];
r = (float) color.red / 65535.0;
g = (float) color.green / 65535.0;
b = (float) color.blue / 65535.0;
@@ -167,7 +170,7 @@ static void fill_background(GtkWidget* widget, WindowData* windata, cairo_t* cr)
/* Should we show urgency somehow? Probably doesn't
* have any meaningful value to the user... */
- color = widget->style->text_aa[GTK_STATE_NORMAL];
+ color = style->text_aa[GTK_STATE_NORMAL];
r = (float) color.red / 65535.0;
g = (float) color.green / 65535.0;
b = (float) color.blue / 65535.0;
@@ -504,13 +507,13 @@ static void override_style(GtkWidget* widget, GtkStyle* previous_style)
GdkColor fg;
GdkColor bg;
- style = gtk_style_copy(widget->style);
+ style = gtk_style_copy(gtk_widget_get_style (widget));
if (previous_style == NULL || (previous_style != NULL && (previous_style->bg[GTK_STATE_NORMAL].red != style->bg[GTK_STATE_NORMAL].red || previous_style->bg[GTK_STATE_NORMAL].green != style->bg[GTK_STATE_NORMAL].green || previous_style->bg[GTK_STATE_NORMAL].blue != style->bg[GTK_STATE_NORMAL].blue)))
{
state = (GtkStateType) 0;
- while (state < (GtkStateType) G_N_ELEMENTS(widget->style->bg))
+ while (state < (GtkStateType) G_N_ELEMENTS(style->bg))
{
color_reverse(&style->bg[state], &bg);
gtk_widget_modify_bg(widget, state, &bg);
@@ -522,7 +525,7 @@ static void override_style(GtkWidget* widget, GtkStyle* previous_style)
{
state = (GtkStateType) 0;
- while (state < (GtkStateType) G_N_ELEMENTS(widget->style->fg))
+ while (state < (GtkStateType) G_N_ELEMENTS(style->fg))
{
color_reverse(&style->fg[state], &fg);
gtk_widget_modify_fg(widget, state, &fg);
@@ -992,7 +995,7 @@ static gboolean on_countdown_expose(GtkWidget* pie, GdkEventExpose* event, Windo
g = color.green;
b = color.blue;
#else
- color = windata->win->style->bg[GTK_STATE_NORMAL];
+ color = style->bg[GTK_STATE_NORMAL];
r = (float) color.red / 65535.0;
g = (float) color.green / 65535.0;
b = (float) color.blue / 65535.0;
diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c
index 0e75a4f..940b874 100644
--- a/src/themes/standard/theme.c
+++ b/src/themes/standard/theme.c
@@ -461,7 +461,7 @@ static void draw_border(GtkWidget* widget, WindowData *windata, cairo_t* cr)
#if GTK_CHECK_VERSION(3, 0, 0)
/* FIXME!!! */
#else
- gdk_window_shape_combine_region(windata->win->window, windata->window_region, 0, 0);
+ gdk_window_shape_combine_region (gtk_widget_get_window (windata->win), windata->window_region, 0, 0);
#endif
g_free(windata->border_points);
windata->border_points = NULL;