/* OpenIDA - Outil d'analyse de fichiers binaires
* dlg_sections.h - boîte de dialogue permettant une sélection des sections
*
* Copyright (C) 2008 Cyrille Bagard
*
* This file is part of OpenIDA.
*
* OpenIDA 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.
*
* OpenIDA 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 Foobar. If not, see .
*/
#include "dlg_sections.h"
#include "gtkext/easygtk.h"
#define _(str) str
/* Charge les sections sélectionnées pour le projet courant. */
void load_project_sections(openida_project *, GObject *);
/******************************************************************************
* *
* Paramètres : project = informations sur le project actuellement ouvert. *
* *
* Description : Construit la fenêtre de sélection des sections. *
* *
* Retour : Adresse de la fenêtre mise en place. *
* *
* Remarques : - *
* *
******************************************************************************/
GtkWidget *create_sections_dialog(openida_project *project)
{
GtkWidget *result; /* Fenêtre à renvoyer */
GtkWidget *vbox1;
GtkWidget *hbox1;
GtkWidget *label; /* Etiquette à afficher */
GtkWidget *combobox1;
GtkWidget *alignment; /* Adaptation de disposition */
GtkWidget *frame; /* Support avec encadrement */
GtkWidget *vbox2;
GtkWidget *hbox2;
GtkWidget *comboboxentry1;
GtkWidget *hbox3;
GtkWidget *scrolledwindow1;
GtkWidget *treeview1;
GtkWidget *vbuttonbox1;
GtkWidget *hbuttonbox1;
GtkWidget *button; /* Bouton de commande */
result = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request(result, 400, 300);
gtk_container_set_border_width(GTK_CONTAINER(result), 8);
gtk_window_set_title(GTK_WINDOW(result), _("Sections selection"));
gtk_window_set_position(GTK_WINDOW(result), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(result), 500, 400);
gtk_window_set_type_hint(GTK_WINDOW(result), GDK_WINDOW_TYPE_HINT_DIALOG);
vbox1 = gtk_vbox_new(FALSE, 8);
gtk_widget_show(vbox1);
gtk_container_add(GTK_CONTAINER(result), vbox1);
hbox1 = gtk_hbox_new(FALSE, 8);
gtk_widget_show(hbox1);
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
label = qck_create_label(NULL, NULL, _("Binary :"));
gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 0);
combobox1 = gtk_combo_box_new_text();
gtk_widget_show(combobox1);
gtk_box_pack_start(GTK_BOX(hbox1), combobox1, TRUE, TRUE, 0);
frame = qck_create_frame(_("Content to display"), &alignment, 4, 4, 12, 0);
gtk_box_pack_start(GTK_BOX(vbox1), frame, TRUE, TRUE, 0);
vbox2 = gtk_vbox_new(FALSE, 8);
gtk_widget_show(vbox2);
gtk_container_add(GTK_CONTAINER(alignment), vbox2);
hbox2 = gtk_hbox_new(FALSE, 8);
gtk_widget_show(hbox2);
gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
label = qck_create_label(NULL, NULL, _("Model :"));
gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
comboboxentry1 = qck_create_combobox(NULL, NULL, G_CALLBACK(NULL), NULL);
gtk_box_pack_start(GTK_BOX(hbox2), comboboxentry1, TRUE, TRUE, 0);
button = qck_create_button_with_img(NULL, NULL, "gtk-add", G_CALLBACK(NULL), NULL);
gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0);
button = qck_create_button_with_img(NULL, NULL, "gtk-remove", G_CALLBACK(NULL), NULL);
gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0);
hbox3 = gtk_hbox_new(FALSE, 8);
gtk_widget_show(hbox3);
gtk_box_pack_start(GTK_BOX(vbox2), hbox3, TRUE, TRUE, 0);
scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
gtk_widget_show(scrolledwindow1);
gtk_box_pack_start(GTK_BOX(hbox3), scrolledwindow1, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_SHADOW_IN);
treeview1 = gtk_tree_view_new();
gtk_widget_show(treeview1);
gtk_container_add(GTK_CONTAINER(scrolledwindow1), treeview1);
vbuttonbox1 = gtk_vbutton_box_new();
gtk_widget_show(vbuttonbox1);
gtk_box_pack_start(GTK_BOX(hbox3), vbuttonbox1, FALSE, FALSE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox1), GTK_BUTTONBOX_SPREAD);
button = qck_create_button_with_img(NULL, NULL, "gtk-add", G_CALLBACK(NULL), NULL);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button);
button = qck_create_button_with_img(NULL, NULL, "gtk-remove", G_CALLBACK(NULL), NULL);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button);
hbuttonbox1 = gtk_hbutton_box_new();
gtk_widget_show(hbuttonbox1);
gtk_box_pack_start(GTK_BOX(vbox1), hbuttonbox1, FALSE, FALSE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox1), GTK_BUTTONBOX_END);
button = qck_create_button_from_stock(NULL, NULL, "gtk-ok", G_CALLBACK(NULL), NULL);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button);
button = qck_create_button_from_stock(NULL, NULL, "gtk-cancel", G_CALLBACK(NULL), NULL);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button);
return result;
}
/******************************************************************************
* *
* Paramètres : project = informations sur le project actuellement ouvert. *
* ref = espace de référencement principal. *
* *
* Description : Charge les sections sélectionnées pour le projet courant. *
* *
* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
void load_project_sections(openida_project *project, GObject *ref)
{
/*
gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), _("Never automatically"));
gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), _("When the window gets the focus"));
gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), _("On click on the window"));
*/
}