[eog/gnome-2-32] Add a EogImage::file-changed signal
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/gnome-2-32] Add a EogImage::file-changed signal
- Date: Tue, 14 Sep 2010 12:17:03 +0000 (UTC)
commit bb1cb9e580666b423a22c0a9d3ab946d48b08f07
Author: Claudio Saavedra <csaavedra igalia com>
Date: Fri Sep 10 17:51:37 2010 +0300
Add a EogImage::file-changed signal
This is going to be useful to broadcast changes in the underlying file
doc/reference/eog-sections.txt | 1 +
src/eog-image.c | 23 +++++++++++++++++++++++
src/eog-image.h | 4 ++++
3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/eog-sections.txt b/doc/reference/eog-sections.txt
index ce16d85..0a1593b 100644
--- a/doc/reference/eog-sections.txt
+++ b/doc/reference/eog-sections.txt
@@ -38,6 +38,7 @@ eog_image_apply_display_profile
eog_image_undo
eog_image_get_supported_mime_types
eog_image_is_supported_mime_type
+eog_image_file_changed
<SUBSECTION Standard>
EOG_IMAGE
EOG_IS_IMAGE
diff --git a/src/eog-image.c b/src/eog-image.c
index c069399..6d72b5a 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -75,6 +75,7 @@ enum {
SIGNAL_THUMBNAIL_CHANGED,
SIGNAL_SAVE_PROGRESS,
SIGNAL_NEXT_FRAME,
+ SIGNAL_FILE_CHANGED,
SIGNAL_LAST
};
@@ -266,6 +267,14 @@ eog_image_class_init (EogImageClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
+ signals[SIGNAL_FILE_CHANGED] = g_signal_new ("file-changed",
+ EOG_TYPE_IMAGE,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EogImageClass, file_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
g_type_class_add_private (object_class, sizeof (EogImagePrivate));
}
@@ -2212,3 +2221,17 @@ eog_image_get_transform (EogImage *img)
}
#endif
+
+/**
+ * eog_image_file_changed:
+ * @img: a #EogImage
+ *
+ * Emits EogImage::file-changed signal
+ **/
+void
+eog_image_file_changed (EogImage *img)
+{
+ g_return_if_fail (EOG_IS_IMAGE (img));
+
+ g_signal_emit (img, signals[SIGNAL_FILE_CHANGED], 0);
+}
diff --git a/src/eog-image.h b/src/eog-image.h
index 75181f9..2855983 100644
--- a/src/eog-image.h
+++ b/src/eog-image.h
@@ -112,6 +112,8 @@ struct _EogImageClass {
void (* next_frame) (EogImage *img,
gint delay);
+
+ void (* file_changed) (EogImage *img);
};
GType eog_image_get_type (void) G_GNUC_CONST;
@@ -209,6 +211,8 @@ RsvgHandle *eog_image_get_svg (EogImage *img);
EogTransform *eog_image_get_transform (EogImage *img);
#endif
+void eog_image_file_changed (EogImage *img);
+
G_END_DECLS
#endif /* __EOG_IMAGE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]