[gtk+] widget: Remove state-flags leftovers
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Remove state-flags leftovers
- Date: Wed, 2 Nov 2016 19:34:13 +0000 (UTC)
commit 773c16076bec9b1e32b197adedf58eac2bf4892e
Author: Timm Bäder <mail baedert org>
Date: Tue Nov 1 20:28:28 2016 +0100
widget: Remove state-flags leftovers
gtk/gtkbutton.c | 10 +++++-----
gtk/gtkcellrendererspinner.c | 26 --------------------------
gtk/gtkenums.h | 33 ---------------------------------
gtk/gtkpathbar.c | 10 +++++-----
gtk/gtkwidget.h | 2 --
5 files changed, 10 insertions(+), 71 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 048b2c1..6e3734e 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -140,8 +140,8 @@ static void gtk_button_update_state (GtkButton *button);
static void gtk_button_finish_activate (GtkButton *button,
gboolean do_it);
-static void gtk_button_state_changed (GtkWidget *widget,
- GtkStateType previous_state);
+static void gtk_button_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous_state);
static void gtk_button_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_button_do_release (GtkButton *button,
@@ -229,7 +229,7 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->key_release_event = gtk_button_key_release;
widget_class->enter_notify_event = gtk_button_enter_notify;
widget_class->leave_notify_event = gtk_button_leave_notify;
- widget_class->state_changed = gtk_button_state_changed;
+ widget_class->state_flags_changed = gtk_button_state_flags_changed;
widget_class->grab_notify = gtk_button_grab_notify;
container_class->add = gtk_button_add;
@@ -1290,8 +1290,8 @@ gtk_button_screen_changed (GtkWidget *widget,
}
static void
-gtk_button_state_changed (GtkWidget *widget,
- GtkStateType previous_state)
+gtk_button_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous_state)
{
GtkButton *button = GTK_BUTTON (widget);
diff --git a/gtk/gtkcellrendererspinner.c b/gtk/gtkcellrendererspinner.c
index dc7a0d1..3e86a4f 100644
--- a/gtk/gtkcellrendererspinner.c
+++ b/gtk/gtkcellrendererspinner.c
@@ -326,9 +326,6 @@ gtk_cell_renderer_spinner_get_size (GtkCellRenderer *cellr,
static void
gtk_paint_spinner (GtkStyleContext *context,
cairo_t *cr,
- GtkStateType state_type,
- GtkWidget *widget,
- const gchar *detail,
guint step,
gint x,
gint y,
@@ -400,7 +397,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
{
GtkCellRendererSpinner *cell = GTK_CELL_RENDERER_SPINNER (cellr);
GtkCellRendererSpinnerPrivate *priv = cell->priv;
- GtkStateType state;
GdkRectangle pix_rect;
GdkRectangle draw_rect;
gint xpad, ypad;
@@ -424,25 +420,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect))
return;
- state = GTK_STATE_NORMAL;
- if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE) ||
- !gtk_cell_renderer_get_sensitive (cellr))
- {
- state = GTK_STATE_INSENSITIVE;
- }
- else
- {
- if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
- {
- if (gtk_widget_has_focus (widget))
- state = GTK_STATE_SELECTED;
- else
- state = GTK_STATE_ACTIVE;
- }
- else
- state = GTK_STATE_PRELIGHT;
- }
-
cairo_save (cr);
gdk_cairo_rectangle (cr, cell_area);
@@ -450,9 +427,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
gtk_paint_spinner (gtk_widget_get_style_context (widget),
cr,
- state,
- widget,
- "cell",
priv->pulse,
draw_rect.x, draw_rect.y,
draw_rect.width, draw_rect.height);
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index b4ef057..65ef2c5 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -482,39 +482,6 @@ typedef enum
/* Widget states */
/**
- * GtkStateType:
- * @GTK_STATE_NORMAL: State during normal operation.
- * @GTK_STATE_ACTIVE: State of a currently active widget, such as a depressed button.
- * @GTK_STATE_PRELIGHT: State indicating that the mouse pointer is over
- * the widget and the widget will respond to mouse clicks.
- * @GTK_STATE_SELECTED: State of a selected item, such the selected row in a list.
- * @GTK_STATE_INSENSITIVE: State indicating that the widget is
- * unresponsive to user actions.
- * @GTK_STATE_INCONSISTENT: The widget is inconsistent, such as checkbuttons
- * or radiobuttons that aren’t either set to %TRUE nor %FALSE,
- * or buttons requiring the user attention.
- * @GTK_STATE_FOCUSED: The widget has the keyboard focus.
- *
- * This type indicates the current state of a widget; the state determines how
- * the widget is drawn. The #GtkStateType enumeration is also used to
- * identify different colors in a #GtkStyle for drawing, so states can be
- * used for subparts of a widget as well as entire widgets.
- *
- * Deprecated: 3.14: All APIs that are using this enumeration have been deprecated
- * in favor of alternatives using #GtkStateFlags.
- */
-typedef enum
-{
- GTK_STATE_NORMAL,
- GTK_STATE_ACTIVE,
- GTK_STATE_PRELIGHT,
- GTK_STATE_SELECTED,
- GTK_STATE_INSENSITIVE,
- GTK_STATE_INCONSISTENT,
- GTK_STATE_FOCUSED
-} GtkStateType;
-
-/**
* GtkToolbarStyle:
* @GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.
* @GTK_TOOLBAR_TEXT: Buttons display only text labels in the toolbar.
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 76dddbc..fdb4223 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -155,8 +155,8 @@ static gboolean gtk_path_bar_slider_button_release(GtkWidget *widget,
GtkPathBar *path_bar);
static void gtk_path_bar_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
-static void gtk_path_bar_state_changed (GtkWidget *widget,
- GtkStateType previous_state);
+static void gtk_path_bar_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous_state);
static void gtk_path_bar_style_updated (GtkWidget *widget);
static void gtk_path_bar_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen);
@@ -231,7 +231,7 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
widget_class->style_updated = gtk_path_bar_style_updated;
widget_class->screen_changed = gtk_path_bar_screen_changed;
widget_class->grab_notify = gtk_path_bar_grab_notify;
- widget_class->state_changed = gtk_path_bar_state_changed;
+ widget_class->state_flags_changed = gtk_path_bar_state_flags_changed;
widget_class->scroll_event = gtk_path_bar_scroll;
container_class->add = gtk_path_bar_add;
@@ -1099,8 +1099,8 @@ gtk_path_bar_grab_notify (GtkWidget *widget,
}
static void
-gtk_path_bar_state_changed (GtkWidget *widget,
- GtkStateType previous_state)
+gtk_path_bar_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous_state)
{
if (!gtk_widget_is_sensitive (widget))
gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 0683233..ba52529 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -342,8 +342,6 @@ struct _GtkWidgetClass
void (* unrealize) (GtkWidget *widget);
void (* size_allocate) (GtkWidget *widget,
GtkAllocation *allocation);
- void (* state_changed) (GtkWidget *widget,
- GtkStateType previous_state);
void (* state_flags_changed) (GtkWidget *widget,
GtkStateFlags previous_state_flags);
void (* parent_set) (GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]