[gnome-flashback] screenshot: add "finished" signal to GfFlashspot
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] screenshot: add "finished" signal to GfFlashspot
- Date: Thu, 10 Sep 2015 18:28:37 +0000 (UTC)
commit c4a7e269d4d162aecb7f0677a06abdca5e1183dc
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Sep 10 17:41:02 2015 +0300
screenshot: add "finished" signal to GfFlashspot
gnome-flashback/libscreenshot/gf-flashspot.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libscreenshot/gf-flashspot.c b/gnome-flashback/libscreenshot/gf-flashspot.c
index ef29ba8..4bfd834 100644
--- a/gnome-flashback/libscreenshot/gf-flashspot.c
+++ b/gnome-flashback/libscreenshot/gf-flashspot.c
@@ -40,6 +40,15 @@ struct _GfFlashspot
guint fade_id;
};
+enum
+{
+ SIGNAL_FINISHED,
+
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
G_DEFINE_TYPE (GfFlashspot, gf_flashspot, G_TYPE_OBJECT)
static gboolean
@@ -57,6 +66,8 @@ fade (gpointer user_data)
{
gtk_widget_hide (flashspot->window);
+ g_signal_emit (flashspot, signals[SIGNAL_FINISHED], 0);
+
flashspot->fade_id = 0;
return G_SOURCE_REMOVE;
}
@@ -77,6 +88,8 @@ start_fade (gpointer user_data)
{
gtk_widget_hide (flashspot->window);
+ g_signal_emit (flashspot, signals[SIGNAL_FINISHED], 0);
+
flashspot->flash_id = 0;
return G_SOURCE_REMOVE;
}
@@ -127,6 +140,13 @@ gf_flashspot_class_init (GfFlashspotClass *flashspot_class)
object_class = G_OBJECT_CLASS (flashspot_class);
object_class->dispose = gf_flashspot_dispose;
+
+ signals[SIGNAL_FINISHED] =
+ g_signal_new ("finished",
+ G_OBJECT_CLASS_TYPE (flashspot_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]