diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-07-14 11:48:54 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-07-14 11:48:54 (GMT) |
commit | bea3337108fa5b59b8f6fdbe016d5ed6a6300bc6 (patch) | |
tree | 517abf46e76b2a6cc8ddb3ac2dec5ffacc28a128 /src/gtkext | |
parent | e0af5dc9c01a5b9649c68ec63109ba98b6843329 (diff) |
Begun to switch to abstract locations in internal rendering buffers.
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkbufferdisplay.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c index 45c7193..3ef77b5 100644 --- a/src/gtkext/gtkbufferdisplay.c +++ b/src/gtkext/gtkbufferdisplay.c @@ -31,6 +31,7 @@ #include "../core/params.h" +#include "../glibext/gbinarycursor.h" // REMME @@ -475,7 +476,8 @@ static gboolean gtk_buffer_display_key_press(GtkWidget *widget, GdkEventKey *eve GtkBufferDisplay *display; /* Autre version du composant */ GtkDisplayPanel *panel; /* Autre version du composant */ bool ctrl; /* Statut de la touche Contrôle*/ - cairo_rectangle_int_t area; /* Emplacement de curseur */ + cairo_rectangle_int_t area; /* Emplacement de curseur #1 */ + GLineCursor *cursor; /* Emplacement de curseur #2 */ vmpa2t addr; /* Adresse du nouveau curseur */ bool status; /* Validité d'un déplacement */ @@ -515,10 +517,15 @@ static gboolean gtk_buffer_display_key_press(GtkWidget *widget, GdkEventKey *eve ctrl = (event->state & GDK_CONTROL_MASK); area = display->caret; - status = g_buffer_view_move_caret(display->view, ctrl, dir, panel->display_options, &area, &addr); + status = g_buffer_view_move_caret(display->view, ctrl, dir, panel->display_options, &area, &cursor); if (status) { + //////////////////////// + g_binary_cursor_get_info(G_BINARY_CURSOR(cursor), &addr); + g_object_unref(G_OBJECT(cursor)); + //////////////////////// + gtk_buffer_display_relocate_caret(display, &area, &addr); _gtk_display_panel_scroll_to_address(panel, &addr, SPT_RAW, false); } @@ -843,12 +850,21 @@ static bool _gtk_buffer_display_move_caret_to(GtkBufferDisplay *display, gint x, { bool result; /* Bilan à retourner */ GtkDisplayPanel *panel; /* Autre version du composant */ - vmpa2t addr; /* Position mémoire associée */ cairo_rectangle_int_t new; /* Nouvel emplacement calculé */ + GLineCursor *cursor; /* Emplacement de curseur */ + vmpa2t addr; /* Position mémoire associée */ panel = GTK_DISPLAY_PANEL(display); - result = g_buffer_view_compute_caret_full(display->view, x, y, panel->display_options, &new, &addr); + result = g_buffer_view_compute_caret_full(display->view, x, y, panel->display_options, &new, &cursor); + + //////////////////////// + if (result) + { + g_binary_cursor_get_info(G_BINARY_CURSOR(cursor), &addr); + g_object_unref(G_OBJECT(cursor)); + } + //////////////////////// if (result) gtk_buffer_display_relocate_caret(display, &new, &addr); |