[gimp] app: small cleanup in gimpwidgets-utils.c
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: small cleanup in gimpwidgets-utils.c
- Date: Sun, 29 Oct 2017 14:20:22 +0000 (UTC)
commit 601f1bde9872b1897590f4cf6fcfb05de39015b2
Author: Ell <ell_se yahoo com>
Date: Sun Oct 29 09:48:00 2017 -0400
app: small cleanup in gimpwidgets-utils.c
Fix comment typos, and move the gimp_widget_blink() code to the
same location as its prototype.
app/widgets/gimpwidgets-utils.c | 166 +++++++++++++++++++-------------------
1 files changed, 83 insertions(+), 83 deletions(-)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index f0385c3..b35fb69 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1308,8 +1308,8 @@ gimp_highlight_widget_expose (GtkWidget *widget,
* @highlight:
*
* Turns highlighting for @widget on or off according to
- * @highlight, in a similar fashion to gtk_drag_higlight()
- * and gtk_drag_unhiglight().
+ * @highlight, in a similar fashion to gtk_drag_highlight()
+ * and gtk_drag_unhighlight().
**/
void
gimp_highlight_widget (GtkWidget *widget,
@@ -1333,6 +1333,87 @@ gimp_highlight_widget (GtkWidget *widget,
gtk_widget_queue_draw (widget);
}
+typedef struct
+{
+ gint timeout_id;
+ gint counter;
+} WidgetBlink;
+
+static WidgetBlink *
+widget_blink_new (void)
+{
+ WidgetBlink *blink;
+
+ blink = g_slice_new (WidgetBlink);
+
+ blink->timeout_id = 0;
+ blink->counter = 0;
+
+ return blink;
+}
+
+static void
+widget_blink_free (WidgetBlink *blink)
+{
+ if (blink->timeout_id)
+ {
+ g_source_remove (blink->timeout_id);
+ blink->timeout_id = 0;
+ }
+
+ g_slice_free (WidgetBlink, blink);
+}
+
+static gboolean
+gimp_widget_blink_timeout (GtkWidget *widget)
+{
+ WidgetBlink *blink;
+
+ blink = g_object_get_data (G_OBJECT (widget), "gimp-widget-blink");
+
+ gimp_highlight_widget (widget, blink->counter % 2 == 1);
+ blink->counter++;
+
+ if (blink->counter == 3)
+ {
+ blink->timeout_id = 0;
+
+ g_object_set_data (G_OBJECT (widget), "gimp-widget-blink", NULL);
+
+ return G_SOURCE_REMOVE;
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+void
+gimp_widget_blink (GtkWidget *widget)
+{
+ WidgetBlink *blink;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ blink = widget_blink_new ();
+
+ g_object_set_data_full (G_OBJECT (widget), "gimp-widget-blink", blink,
+ (GDestroyNotify) widget_blink_free);
+
+ blink->timeout_id = g_timeout_add (150,
+ (GSourceFunc) gimp_widget_blink_timeout,
+ widget);
+
+ gimp_highlight_widget (widget, TRUE);
+}
+
+void gimp_widget_blink_cancel (GtkWidget *widget)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ gimp_highlight_widget (widget, FALSE);
+
+ g_object_set_data (G_OBJECT (widget), "gimp-widget-blink", NULL);
+}
+
/**
* gimp_dock_with_window_new:
* @factory: a #GimpDialogFacotry
@@ -1615,84 +1696,3 @@ gimp_color_profile_store_add_defaults (GimpColorProfileStore *store,
return TRUE;
}
-
-typedef struct
-{
- gint timeout_id;
- gint counter;
-} WidgetBlink;
-
-static WidgetBlink *
-widget_blink_new (void)
-{
- WidgetBlink *blink;
-
- blink = g_slice_new (WidgetBlink);
-
- blink->timeout_id = 0;
- blink->counter = 0;
-
- return blink;
-}
-
-static void
-widget_blink_free (WidgetBlink *blink)
-{
- if (blink->timeout_id)
- {
- g_source_remove (blink->timeout_id);
- blink->timeout_id = 0;
- }
-
- g_slice_free (WidgetBlink, blink);
-}
-
-static gboolean
-gimp_widget_blink_timeout (GtkWidget *widget)
-{
- WidgetBlink *blink;
-
- blink = g_object_get_data (G_OBJECT (widget), "gimp-widget-blink");
-
- gimp_highlight_widget (widget, blink->counter % 2 == 1);
- blink->counter++;
-
- if (blink->counter == 3)
- {
- blink->timeout_id = 0;
-
- g_object_set_data (G_OBJECT (widget), "gimp-widget-blink", NULL);
-
- return G_SOURCE_REMOVE;
- }
-
- return G_SOURCE_CONTINUE;
-}
-
-void
-gimp_widget_blink (GtkWidget *widget)
-{
- WidgetBlink *blink;
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- blink = widget_blink_new ();
-
- g_object_set_data_full (G_OBJECT (widget), "gimp-widget-blink", blink,
- (GDestroyNotify) widget_blink_free);
-
- blink->timeout_id = g_timeout_add (150,
- (GSourceFunc) gimp_widget_blink_timeout,
- widget);
-
- gimp_highlight_widget (widget, TRUE);
-}
-
-void gimp_widget_blink_cancel (GtkWidget *widget)
-{
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- gimp_highlight_widget (widget, FALSE);
-
- g_object_set_data (G_OBJECT (widget), "gimp-widget-blink", NULL);
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]