summaryrefslogtreecommitdiff
path: root/src/glibext/gbinarycursor.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-14 11:48:54 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-14 11:48:54 (GMT)
commitbea3337108fa5b59b8f6fdbe016d5ed6a6300bc6 (patch)
tree517abf46e76b2a6cc8ddb3ac2dec5ffacc28a128 /src/glibext/gbinarycursor.c
parente0af5dc9c01a5b9649c68ec63109ba98b6843329 (diff)
Begun to switch to abstract locations in internal rendering buffers.
Diffstat (limited to 'src/glibext/gbinarycursor.c')
-rw-r--r--src/glibext/gbinarycursor.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/glibext/gbinarycursor.c b/src/glibext/gbinarycursor.c
index 3bd7199..470022c 100644
--- a/src/glibext/gbinarycursor.c
+++ b/src/glibext/gbinarycursor.c
@@ -24,11 +24,14 @@
#include "gbinarycursor.h"
+#include "glinecursor-int.h"
+
+
/* Suivi de positions dans un panneau de chargement (instance) */
struct _GBinaryCursor
{
- GObject parent; /* A laisser en premier */
+ GLineCursor parent; /* A laisser en premier */
vmpa2t addr; /* Position mémoire du curseur */
@@ -37,7 +40,7 @@ struct _GBinaryCursor
/* Suivi de positions dans un panneau de chargement (classe) */
struct _GBinaryCursorClass
{
- GObjectClass parent; /* A laisser en premier */
+ GLineCursorClass parent; /* A laisser en premier */
};
@@ -54,10 +57,13 @@ static void g_binary_cursor_dispose(GBinaryCursor *);
/* Procède à la libération totale de la mémoire. */
static void g_binary_cursor_finalize(GBinaryCursor *);
+/* Compare deux suivis d'emplacements. */
+static int g_binary_cursor_compare(const GBinaryCursor *, const GBinaryCursor *);
+
/* Détermine le type du gestionnaire de largeurs associées aux lignes. */
-G_DEFINE_TYPE(GBinaryCursor, g_binary_cursor, G_TYPE_OBJECT);
+G_DEFINE_TYPE(GBinaryCursor, g_binary_cursor, G_TYPE_LINE_CURSOR);
/******************************************************************************
@@ -75,12 +81,17 @@ G_DEFINE_TYPE(GBinaryCursor, g_binary_cursor, G_TYPE_OBJECT);
static void g_binary_cursor_class_init(GBinaryCursorClass *class)
{
GObjectClass *object; /* Autre version de la classe */
+ GLineCursorClass *line; /* Version parente de la classe*/
object = G_OBJECT_CLASS(class);
object->dispose = (GObjectFinalizeFunc/* ! */)g_binary_cursor_dispose;
object->finalize = (GObjectFinalizeFunc)g_binary_cursor_finalize;
+ line = G_LINE_CURSOR_CLASS(class);
+
+ line->compare = (compare_cursor_fc)g_binary_cursor_compare;
+
}
@@ -166,6 +177,30 @@ GLineCursor *g_binary_cursor_new(void)
/******************************************************************************
* *
+* Paramètres : cursor = premier suivi d'emplacement à comparer. *
+* other = second suivi d'emplacement à comparer. *
+* *
+* Description : Compare deux suivis d'emplacements. *
+* *
+* Retour : Bilan de la comparaison. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static int g_binary_cursor_compare(const GBinaryCursor *cursor, const GBinaryCursor *other)
+{
+ int result; /* Bilan à renvoyer */
+
+ result = cmp_vmpa(&cursor->addr, &other->addr);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : cursor = suivi de positions à mettre à jour. *
* addr = emplacement dans le binaire visé. *
* *