summaryrefslogtreecommitdiff
path: root/src/glibext/gbufferline.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-02-23 22:56:59 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-02-23 22:56:59 (GMT)
commita5cd2e6519456f49a0f0d9d76dfac0ff89d8bbb1 (patch)
treecc5c0d06836f132ba559eacf4323ce56b67e9d47 /src/glibext/gbufferline.c
parent08f3cc8d6262c9b5412a008c6210e88cd840da85 (diff)
Fixed a bug: do not close the connection after the initial handshake.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@478 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gbufferline.c')
-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;
+
+ }
}