summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/Makefile.am1
-rw-r--r--src/gtkext/dockstation-int.h58
-rw-r--r--src/gtkext/grid-int.h77
-rw-r--r--src/gtkext/helpers.h43
-rw-r--r--src/gtkext/hexview.c2
-rw-r--r--src/gtkext/panel-int.h4
-rw-r--r--src/gtkext/panel.c2
7 files changed, 183 insertions, 4 deletions
diff --git a/src/gtkext/Makefile.am b/src/gtkext/Makefile.am
index 2eb6821..57834b2 100644
--- a/src/gtkext/Makefile.am
+++ b/src/gtkext/Makefile.am
@@ -42,6 +42,7 @@ libgtkext4_la_SOURCES = \
dockstation.h dockstation.c \
grid-int.h \
grid.h grid.c \
+ helpers.h \
hexview-int.h \
hexview.h hexview.c \
panel-int.h \
diff --git a/src/gtkext/dockstation-int.h b/src/gtkext/dockstation-int.h
new file mode 100644
index 0000000..a44371a
--- /dev/null
+++ b/src/gtkext/dockstation-int.h
@@ -0,0 +1,58 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * dockstation.h - prototypes internes pour la manipulation et l'affichage de composants rassemblés
+ *
+ * Copyright (C) 2024 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GTKEXT_DOCKSTATION_INT_H
+#define _GTKEXT_DOCKSTATION_INT_H
+
+
+#include "dockstation.h"
+
+
+
+/* Station de réception pour concentration d'éléments (instance) */
+struct _GtkDockStation
+{
+ GtkWidget parent; /* A laisser en premier */
+
+};
+
+/* Station de réception pour concentration d'éléments (classe) */
+struct _GtkDockStationClass
+{
+ GtkWidgetClass parent; /* A laisser en premier */
+
+ /* Signaux */
+
+ void (* dock_widget) (GtkDockStation *, GtkWidget *);
+ void (* undock_widget) (GtkDockStation *, GtkWidget *);
+
+ void (* switch_widget) (GtkDockStation *, GtkWidget *);
+
+ void (* menu_requested) (GtkDockStation *, GtkWidget *);
+ void (* close_requested) (GtkDockStation *, GtkWidget *);
+
+};
+
+
+
+#endif /* _GTKEXT_DOCKSTATION_INT_H */
diff --git a/src/gtkext/grid-int.h b/src/gtkext/grid-int.h
new file mode 100644
index 0000000..5ae48ad
--- /dev/null
+++ b/src/gtkext/grid-int.h
@@ -0,0 +1,77 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * grid-int.h - prototypes interne pour un composant d'affichage avec des chemins vers les composants contenus
+ *
+ * Copyright (C) 2024 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GTKEXT_GRID_INT_H
+#define _GTKEXT_GRID_INT_H
+
+
+#include "grid.h"
+
+
+
+/* -------------------------- GESTION DES TUILES AFFICHEES -------------------------- */
+
+
+/* Informations concernant une tuile */
+typedef struct _grid_tile_t
+{
+ struct _grid_tile_t *parent; /* Tuile parente */
+
+ GtkWidget *widget; /* Support d'affichage */
+
+ char *path; /* Chemin d'accès */
+
+ struct _grid_tile_t *children[2]; /* Tuiles encastrées ou 2xNULL */
+
+} grid_tile_t;
+
+
+
+/* --------------------------- INTERFACE DU COMPOSANT GTK --------------------------- */
+
+
+/* Conteneur pour un affichage en tuiles nommées (instance) */
+struct _GtkTilingGrid
+{
+ GtkWidget parent; /* A laisser en premier */
+
+ grid_tile_t *tiles; /* Tuiles représentées */
+
+ GtkTiledPanel *def_panel; /* Panneau principal par défaut*/
+
+};
+
+/* Conteneur pour un affichage en tuiles nommées (classe) */
+struct _GtkTilingGridClass
+{
+ GtkWidgetClass parent; /* A laisser en premier */
+
+ /* Signaux */
+
+ void (* station_created) (GtkTilingGrid *, GtkDockStation *, gpointer);
+
+};
+
+
+
+#endif /* _GTKEXT_GRID_INT_H */
diff --git a/src/gtkext/helpers.h b/src/gtkext/helpers.h
new file mode 100644
index 0000000..3f8b3cd
--- /dev/null
+++ b/src/gtkext/helpers.h
@@ -0,0 +1,43 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * helpers.h - prototypes pour la simplification des interactions de base avec GTK
+ *
+ * Copyright (C) 2024 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GTKEXT_HELPERS_H
+#define _GTKEXT_HELPERS_H
+
+
+#include <assert.h>
+#include <glib-object.h>
+
+
+
+/**
+ * Facilités de transmission de paramètres pour les fonctions de type
+ * gtk_widget_class_bind_template_callback_full() et gtk_builder_cscope_add_callback_symbol().
+ */
+
+#define BUILDER_CB(cb) \
+ #cb, G_CALLBACK(cb)
+
+
+
+#endif /* _GTKEXT_HELPERS_H */
diff --git a/src/gtkext/hexview.c b/src/gtkext/hexview.c
index 7363079..6a78ce6 100644
--- a/src/gtkext/hexview.c
+++ b/src/gtkext/hexview.c
@@ -110,7 +110,7 @@ static void gtk_hex_view_class_init(GtkHexViewClass *class)
widget = GTK_WIDGET_CLASS(class);
- gtk_widget_class_set_css_name(widget, "GtkHexView");
+ // REMME gtk_widget_class_set_css_name(widget, "GtkHexView");
g_type_ensure(GTK_TYPE_COMPOSING_AREA);
diff --git a/src/gtkext/panel-int.h b/src/gtkext/panel-int.h
index 7699f73..593e5b4 100644
--- a/src/gtkext/panel-int.h
+++ b/src/gtkext/panel-int.h
@@ -33,14 +33,14 @@
/* Elément réactif pour panneaux de l'éditeur (instance) */
struct _GtkTiledPanel
{
- GtkWidget parent; /* A laisser en premier */
+ GtkBox parent; /* A laisser en premier */
};
/* Elément réactif pour panneaux de l'éditeur (classe) */
struct _GtkTiledPanelClass
{
- GtkWidgetClass parent; /* A laisser en premier */
+ GtkBoxClass parent; /* A laisser en premier */
};
diff --git a/src/gtkext/panel.c b/src/gtkext/panel.c
index f0c39aa..b2817fa 100644
--- a/src/gtkext/panel.c
+++ b/src/gtkext/panel.c
@@ -51,7 +51,7 @@ static void gtk_tiled_panel_finalize(GtkTiledPanel *);
/* Détermine le type du conteneur d'affichage en tuiles nommées. */
-G_DEFINE_TYPE(GtkTiledPanel, gtk_tiled_panel, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE(GtkTiledPanel, gtk_tiled_panel, GTK_TYPE_BOX)
/******************************************************************************