summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbufferline.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c
index ff64604..ac838b8 100644
--- a/src/glibext/gbufferline.c
+++ b/src/glibext/gbufferline.c
@@ -29,6 +29,7 @@
#include <gtk/gtk.h> /* Récupération du langage par défaut ; FIXME ? */
+#include "chrysamarshal.h"
#include "../common/extstr.h"
#include "../gtkext/support.h"
@@ -108,6 +109,10 @@ struct _GBufferLineClass
cairo_surface_t *entrypoint_img; /* Image pour les entrées */
cairo_surface_t *bookmark_img; /* Image pour les signets */
+ /* Signaux */
+
+ void (* flip_flag) (GBufferLine *, BufferLineFlags, BufferLineFlags);
+
};
@@ -445,19 +450,27 @@ static void g_buffer_line_class_init(GBufferLineClass *class)
gchar *filename; /* Chemin d'accès à utiliser */
filename = find_pixmap_file("entrypoint.png");
- /* assert(filename != NULL); */
+ assert(filename != NULL);
class->entrypoint_img = cairo_image_surface_create_from_png(filename);
g_free(filename);
filename = find_pixmap_file("bookmark.png");
- /* assert(filename != NULL); */
+ assert(filename != NULL);
class->bookmark_img = cairo_image_surface_create_from_png(filename);
g_free(filename);
+ g_signal_new("flip-flag",
+ G_TYPE_BUFFER_LINE,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(GBufferLineClass, flip_flag),
+ NULL, NULL,
+ g_cclosure_user_marshal_VOID__ENUM_ENUM,
+ G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+
}
@@ -1172,7 +1185,13 @@ void g_buffer_line_start_merge_at(GBufferLine *line, BufferLineColumn start)
void g_buffer_line_add_flag(GBufferLine *line, BufferLineFlags flag)
{
- line->flags |= flag;
+ if ((line->flags & flag) == 0)
+ {
+ g_signal_emit_by_name(line, "flip-flag", line->flags, flag);
+
+ line->flags |= flag;
+
+ }
}
@@ -1211,7 +1230,13 @@ BufferLineFlags g_buffer_line_get_flags(const GBufferLine *line)
void g_buffer_line_remove_flag(GBufferLine *line, BufferLineFlags flag)
{
- line->flags &= ~flag;
+ if ((line->flags & flag) != 0)
+ {
+ g_signal_emit_by_name(line, "flip-flag", line->flags, flag);
+
+ line->flags &= ~flag;
+
+ }
}