diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
commit | 1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (patch) | |
tree | c3581ceb7f8586f2f6822de563927a1246dd33a5 /src/gui/panels/bookmarks.c | |
parent | 6122bb7f34b178d4c07285adae16afcc55294b1f (diff) |
Rewritten the whole API dealing with panels.
Diffstat (limited to 'src/gui/panels/bookmarks.c')
-rw-r--r-- | src/gui/panels/bookmarks.c | 71 |
1 files changed, 43 insertions, 28 deletions
diff --git a/src/gui/panels/bookmarks.c b/src/gui/panels/bookmarks.c index 46069c1..b57e657 100644 --- a/src/gui/panels/bookmarks.c +++ b/src/gui/panels/bookmarks.c @@ -106,7 +106,10 @@ static void g_bookmarks_panel_dispose(GBookmarksPanel *); static void g_bookmarks_panel_finalize(GBookmarksPanel *); /* Fournit le nom interne attribué à l'élément réactif. */ -static char *g_bookmarks_panel_get_key(const GBookmarksPanel *); +static char *g_bookmarks_panel_class_get_key(const GBookmarksPanelClass *); + +/* Indique le chemin initial de la localisation d'un panneau. */ +static char *g_bookmarks_panel_class_get_path(const GBookmarksPanelClass *); /* Réagit à un changement d'affichage principal de contenu. */ static void change_bookmarks_panel_current_content(GBookmarksPanel *, GLoadedContent *, GLoadedContent *); @@ -180,7 +183,7 @@ G_DEFINE_TYPE(GBookmarksPanel, g_bookmarks_panel, G_TYPE_PANEL_ITEM); /****************************************************************************** * * -* Paramètres : klass = classe à initialiser. * +* Paramètres : class = classe à initialiser. * * * * Description : Initialise la classe des panneaux des paramètres de config. * * * @@ -190,27 +193,29 @@ G_DEFINE_TYPE(GBookmarksPanel, g_bookmarks_panel, G_TYPE_PANEL_ITEM); * * ******************************************************************************/ -static void g_bookmarks_panel_class_init(GBookmarksPanelClass *klass) +static void g_bookmarks_panel_class_init(GBookmarksPanelClass *class) { GObjectClass *object; /* Autre version de la classe */ GEditorItemClass *item; /* Encore une autre vision... */ GPanelItemClass *panel; /* Version parente de la classe*/ gchar *filename; /* Chemin d'accès à utiliser */ - object = G_OBJECT_CLASS(klass); + object = G_OBJECT_CLASS(class); object->dispose = (GObjectFinalizeFunc/* ! */)g_bookmarks_panel_dispose; object->finalize = (GObjectFinalizeFunc)g_bookmarks_panel_finalize; - item = G_EDITOR_ITEM_CLASS(klass); + item = G_EDITOR_ITEM_CLASS(class); - item->get_key = (get_item_key_fc)g_bookmarks_panel_get_key; + item->get_key = (get_item_key_fc)g_bookmarks_panel_class_get_key; item->change_content = (change_item_content_fc)change_bookmarks_panel_current_content; - panel = G_PANEL_ITEM_CLASS(klass); + panel = G_PANEL_ITEM_CLASS(class); - panel->can_search = true; + panel->dock_at_startup = gtk_panel_item_class_return_false; + panel->can_search = gtk_panel_item_class_return_true; + panel->get_path = (get_panel_path_fc)g_bookmarks_panel_class_get_path; panel->update_filtered = (update_filtered_fc)update_filtered_bookmarks; @@ -219,7 +224,7 @@ static void g_bookmarks_panel_class_init(GBookmarksPanelClass *klass) filename = find_pixmap_file("bookmark.png"); assert(filename != NULL); - klass->bookmark_img = cairo_image_surface_create_from_png(filename); + class->bookmark_img = cairo_image_surface_create_from_png(filename); g_free(filename); @@ -249,15 +254,10 @@ static void g_bookmarks_panel_init(GBookmarksPanel *panel) pitem = G_PANEL_ITEM(panel); - pitem->personality = PIP_SINGLETON; - pitem->widget = G_NAMED_WIDGET(gtk_built_named_widget_new_for_panel(_("Bookmarks"), _("Bookmarks for the current binary"), PANEL_BOOKMARKS_ID)); - pitem->dock_at_startup = false; - pitem->path = strdup("Ms"); - /* Représentation graphique */ builder = gtk_built_named_widget_get_builder(GTK_BUILT_NAMED_WIDGET(pitem->widget)); @@ -343,29 +343,44 @@ static void g_bookmarks_panel_finalize(GBookmarksPanel *panel) /****************************************************************************** * * -* Paramètres : - * +* Paramètres : class = classe à consulter. * * * -* Description : Crée un panneau d'affichage des paramètres de configuration. * +* Description : Fournit le nom interne attribué à l'élément réactif. * * * -* Retour : Adresse de la structure mise en place. * +* Retour : Désignation (courte) de l'élément de l'éditeur. * * * * Remarques : - * * * ******************************************************************************/ -GPanelItem *g_bookmarks_panel_new(void) +static char *g_bookmarks_panel_class_get_key(const GBookmarksPanelClass *class) { - GPanelItem *result; /* Structure à retourner */ + char *result; /* Description à renvoyer */ - result = g_object_new(G_TYPE_BOOKMARKS_PANEL, NULL); + result = strdup(PANEL_BOOKMARKS_ID); - //reload_config_into_treeview(G_BOOKMARKS_PANEL(result), get_main_configuration()); + return result; +} - //GDbCollection *g_loaded_binary_find_collection(GLoadedBinary *binary, DBFeatures feature) +/****************************************************************************** +* * +* Paramètres : class = classe à consulter. * +* * +* Description : Indique le chemin initial de la localisation d'un panneau. * +* * +* Retour : Chemin fixé associé à la position initiale. * +* * +* Remarques : - * +* * +******************************************************************************/ +static char *g_bookmarks_panel_class_get_path(const GBookmarksPanelClass *class) +{ + char *result; /* Emplacement à retourner */ + result = strdup("Ms"); return result; @@ -374,21 +389,21 @@ GPanelItem *g_bookmarks_panel_new(void) /****************************************************************************** * * -* Paramètres : panel = instance à consulter. * +* Paramètres : - * * * -* Description : Fournit le nom interne attribué à l'élément réactif. * +* Description : Crée un panneau d'affichage des paramètres de configuration. * * * -* Retour : Désignation (courte) de l'élément de l'éditeur. * +* Retour : Adresse de la structure mise en place. * * * * Remarques : - * * * ******************************************************************************/ -static char *g_bookmarks_panel_get_key(const GBookmarksPanel *panel) +GPanelItem *g_bookmarks_panel_new(void) { - char *result; /* Description à renvoyer */ + GPanelItem *result; /* Structure à retourner */ - result = strdup(PANEL_BOOKMARKS_ID); + result = g_object_new(G_TYPE_BOOKMARKS_PANEL, NULL); return result; |