diff options
Diffstat (limited to 'src/gui/panels/glance.c')
-rw-r--r-- | src/gui/panels/glance.c | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c index 22d4890..9be8b63 100644 --- a/src/gui/panels/glance.c +++ b/src/gui/panels/glance.c @@ -89,7 +89,10 @@ static void g_glance_panel_dispose(GGlancePanel *); static void g_glance_panel_finalize(GGlancePanel *); /* Fournit le nom interne attribué à l'élément réactif. */ -static char *g_glance_panel_get_key(const GGlancePanel *); +static char *g_glance_panel_class_get_key(const GGlancePanelClass *); + +/* Indique le chemin initial de la localisation d'un panneau. */ +static char *g_glance_panel_class_get_path(const GGlancePanelClass *); /* Lance une actualisation du fait d'un changement de support. */ static void change_glance_panel_current_view(GGlancePanel *, GLoadedPanel *, GLoadedPanel *); @@ -129,7 +132,7 @@ G_DEFINE_TYPE(GGlancePanel, g_glance_panel, G_TYPE_PANEL_ITEM); /****************************************************************************** * * -* Paramètres : klass = classe à initialiser. * +* Paramètres : class = classe à initialiser. * * * * Description : Initialise la classe des panneaux d'aperçu rapide. * * * @@ -139,29 +142,34 @@ G_DEFINE_TYPE(GGlancePanel, g_glance_panel, G_TYPE_PANEL_ITEM); * * ******************************************************************************/ -static void g_glance_panel_class_init(GGlancePanelClass *klass) +static void g_glance_panel_class_init(GGlancePanelClass *class) { GObjectClass *object; /* Autre version de la classe */ GEditorItemClass *item; /* Encore une autre vision... */ + GPanelItemClass *panel; /* Version parente de la classe*/ GtkIconTheme *theme; /* Thème GTK offrant des icones*/ - object = G_OBJECT_CLASS(klass); + object = G_OBJECT_CLASS(class); object->dispose = (GObjectFinalizeFunc/* ! */)g_glance_panel_dispose; object->finalize = (GObjectFinalizeFunc)g_glance_panel_finalize; - item = G_EDITOR_ITEM_CLASS(klass); + item = G_EDITOR_ITEM_CLASS(class); - item->get_key = (get_item_key_fc)g_glance_panel_get_key; + item->get_key = (get_item_key_fc)g_glance_panel_class_get_key; item->change_view = (change_item_view_fc)change_glance_panel_current_view; item->update_view = (update_item_view_fc)update_glance_panel_view; + panel = G_PANEL_ITEM_CLASS(class); + + panel->get_path = (get_panel_path_fc)g_glance_panel_class_get_path; + theme = gtk_icon_theme_get_default(); - klass->no_image_32 = gtk_icon_theme_lookup_icon(theme, "image-missing", 32, GTK_ICON_LOOKUP_FORCE_SIZE); - klass->no_image_64 = gtk_icon_theme_lookup_icon(theme, "image-missing", 64, GTK_ICON_LOOKUP_FORCE_SIZE); - klass->no_image_128 = gtk_icon_theme_lookup_icon(theme, "image-missing", 128, GTK_ICON_LOOKUP_FORCE_SIZE); + class->no_image_32 = gtk_icon_theme_lookup_icon(theme, "image-missing", 32, GTK_ICON_LOOKUP_FORCE_SIZE); + class->no_image_64 = gtk_icon_theme_lookup_icon(theme, "image-missing", 64, GTK_ICON_LOOKUP_FORCE_SIZE); + class->no_image_128 = gtk_icon_theme_lookup_icon(theme, "image-missing", 128, GTK_ICON_LOOKUP_FORCE_SIZE); } @@ -187,15 +195,10 @@ static void g_glance_panel_init(GGlancePanel *panel) pitem = G_PANEL_ITEM(panel); - pitem->personality = PIP_SINGLETON; - pitem->widget = G_NAMED_WIDGET(gtk_built_named_widget_new_for_panel(_("Glance"), _("Glimpse of the display content"), PANEL_GLANCE_ID)); - pitem->dock_at_startup = true; - pitem->path = strdup("MEs"); - /* Représentation graphique */ builder = gtk_built_named_widget_get_builder(GTK_BUILT_NAMED_WIDGET(pitem->widget)); @@ -260,21 +263,21 @@ static void g_glance_panel_finalize(GGlancePanel *panel) /****************************************************************************** * * -* Paramètres : - * +* Paramètres : class = classe à consulter. * * * -* Description : Crée un panneau d'aperçu rapide. * +* 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_glance_panel_new(void) +static char *g_glance_panel_class_get_key(const GGlancePanelClass *class) { - GPanelItem *result; /* Structure à retourner */ + char *result; /* Description à renvoyer */ - result = g_object_new(G_TYPE_GLANCE_PANEL, NULL); + result = strdup(PANEL_GLANCE_ID); return result; @@ -283,21 +286,44 @@ GPanelItem *g_glance_panel_new(void) /****************************************************************************** * * -* Paramètres : panel = instance à consulter. * +* Paramètres : class = classe à consulter. * * * -* Description : Fournit le nom interne attribué à l'élément réactif. * +* Description : Indique le chemin initial de la localisation d'un panneau. * * * -* Retour : Désignation (courte) de l'élément de l'éditeur. * +* Retour : Chemin fixé associé à la position initiale. * * * * Remarques : - * * * ******************************************************************************/ -static char *g_glance_panel_get_key(const GGlancePanel *panel) +static char *g_glance_panel_class_get_path(const GGlancePanelClass *class) { - char *result; /* Description à renvoyer */ + char *result; /* Emplacement à retourner */ - result = strdup(PANEL_GLANCE_ID); + result = strdup("MEs"); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Crée un panneau d'aperçu rapide. * +* * +* Retour : Adresse de la structure mise en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GPanelItem *g_glance_panel_new(void) +{ + GPanelItem *result; /* Structure à retourner */ + + result = g_object_new(G_TYPE_GLANCE_PANEL, NULL); return result; |