/* Chrysalide - Outil d'analyse de fichiers binaires
 * panel.c - panneau dédié à la présentation de notes
 *
 * Copyright (C) 2025 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 this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#include "panel.h"


#include <gtkext/helpers.h>


#include "panel-int.h"



/* ------------------------- COEUR D'UN PANNEAU D'AFFICHAGE ------------------------- */


/* Initialise la classe des panneaux pour binaires. */
static void gtk_python_notebook_panel_class_init(GtkPythonNotebookPanelClass *);

/* Initialise une instance de panneau pour binaire. */
static void gtk_python_notebook_panel_init(GtkPythonNotebookPanel *);

/* Supprime toutes les références externes. */
static void gtk_python_notebook_panel_dispose(GObject *);

/* Procède à la libération totale de la mémoire. */
static void gtk_python_notebook_panel_finalize(GObject *);



/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */


/* Fournit les composants adaptés pour la barre de titre. */
//static GListStore *gtk_python_notebook_panel_get_title_widgets(GtkTiledPanel *, bool);



/* ---------------------------------------------------------------------------------- */
/*                           COEUR D'UN PANNEAU D'AFFICHAGE                           */
/* ---------------------------------------------------------------------------------- */


/* Indique le type défini pour un panneau de présentation de notes. */
G_DEFINE_TYPE(GtkPythonNotebookPanel, gtk_python_notebook_panel, GTK_TYPE_TILED_PANEL);


/******************************************************************************
*                                                                             *
*  Paramètres  : class = classe à initialiser.                                *
*                                                                             *
*  Description : Initialise la classe des panneaux pour binaires.             *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void gtk_python_notebook_panel_class_init(GtkPythonNotebookPanelClass *class)
{
    GObjectClass *object;                   /* Autre version de la classe  */
    GtkWidgetClass *widget;                 /* Classe de haut niveau       */
    GtkTiledPanelClass *panel;              /* Version parente de classe   */

    object = G_OBJECT_CLASS(class);

    object->dispose = gtk_python_notebook_panel_dispose;
    object->finalize = gtk_python_notebook_panel_finalize;

    widget = GTK_WIDGET_CLASS(class);

    gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gui/panels/pynb-panel.ui");

    //gtk_widget_class_bind_template_child(widget, GtkPythonNotebookPanel, summary);

    panel = GTK_TILED_PANEL_CLASS(class);

    //panel->get_widgets = (get_tiled_panel_widgets_cb)gtk_python_notebook_panel_get_title_widgets;

}


/******************************************************************************
*                                                                             *
*  Paramètres  : panel = instance à initialiser.                              *
*                                                                             *
*  Description : Initialise une instance de panneau pour binaire.             *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void gtk_python_notebook_panel_init(GtkPythonNotebookPanel *panel)
{
    gtk_widget_init_template(GTK_WIDGET(panel));

}


/******************************************************************************
*                                                                             *
*  Paramètres  : object = instance d'objet GLib à traiter.                    *
*                                                                             *
*  Description : Supprime toutes les références externes.                     *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void gtk_python_notebook_panel_dispose(GObject *object)
{
    gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_PYTHON_NOTEBOOK_PANEL);

    G_OBJECT_CLASS(gtk_python_notebook_panel_parent_class)->dispose(object);

}


/******************************************************************************
*                                                                             *
*  Paramètres  : object = instance d'objet GLib à traiter.                    *
*                                                                             *
*  Description : Procède à la libération totale de la mémoire.                *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

static void gtk_python_notebook_panel_finalize(GObject *object)
{
    G_OBJECT_CLASS(gtk_python_notebook_panel_parent_class)->finalize(object);

}


/******************************************************************************
*                                                                             *
*  Paramètres  : -                                                            *
*                                                                             *
*  Description : Crée une nouvelle instance de panneau de présentation.       *
*                                                                             *
*  Retour      : Composant GTK mis en place.                                  *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

GtkTiledPanel *gtk_python_notebook_panel_new(void)
{
    GtkTiledPanel *result;                  /* Instance à retourner        */

    result = g_object_new(GTK_TYPE_PYTHON_NOTEBOOK_PANEL, NULL);

    if (!gtk_python_notebook_panel_create(GTK_PYTHON_NOTEBOOK_PANEL(result)))
        g_clear_object(&result);

    return result;

}


/******************************************************************************
*                                                                             *
*  Paramètres  : panel = panneau de recherche et récupération à remplir.      *
*                                                                             *
*  Description : Met en place nouvelle instance de panneau de présentation.   *
*                                                                             *
*  Retour      : Bilan de l'opération.                                        *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

bool gtk_python_notebook_panel_create(GtkPythonNotebookPanel *panel)
{
    bool result;                            /* Bilan à retourner           */

    result = true;

    return result;

}