/* Chrysalide - Outil d'analyse de fichiers binaires
* plugins.c - boîte de dialogue permettant une sélection des greffons
*
* Copyright (C) 2010-2012 Cyrille Bagard
*
* This file is part of Chrysalide.
*
* 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 "plugins.h"
#define _(str) str
/******************************************************************************
* *
* Paramètres : binary = informations sur le binaire actuellement ouvert. *
* parent = fenêtre parente à surpasser. *
* *
* Description : Construit la fenêtre de sélection des sections. *
* *
* Retour : Adresse de la fenêtre mise en place. *
* *
* Remarques : - *
* *
******************************************************************************/
GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *parent)
{
GtkWidget *result; /* Fenêtre à renvoyer */
GObject *ref; /* Espace de référencements */
GtkWidget *vbox1;
GtkWidget *hbox3;
GtkWidget *scrolledwindow1;
GtkWidget *treeview1;
GtkWidget *vbox2;
GtkWidget *vbuttonbox1;
GtkWidget *button7;
GtkWidget *image3;
GtkWidget *button8;
GtkWidget *image4;
GtkWidget *hseparator1;
GtkWidget *vbuttonbox2;
GtkWidget *button9;
GtkWidget *image5;
GtkWidget *button10;
GtkWidget *image6;
GtkWidget *scrolledwindow2;
GtkWidget *treeview2;
GtkWidget *expander1;
GtkWidget *hbox4;
GtkWidget *vbox3;
GtkWidget *label5;
GtkWidget *label8;
GtkWidget *label6;
GtkWidget *label9;
GtkWidget *label7;
GtkWidget *label10;
GtkWidget *frame1;
GtkWidget *alignment3;
GtkWidget *label12;
GtkWidget *label11;
GtkWidget *label3;
GtkWidget *hseparator2;
GtkWidget *hbuttonbox1;
GtkWidget *button1;
GtkWidget *alignment1;
GtkWidget *hbox1;
GtkWidget *image1;
GtkWidget *label1;
GtkWidget *button2;
GtkWidget *alignment2;
GtkWidget *hbox2;
GtkWidget *image2;
GtkWidget *label2;
result = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request(result, 600, 400);
gtk_container_set_border_width(GTK_CONTAINER(result), 8);
gtk_window_set_title(GTK_WINDOW(result), _("Plugins selection"));
gtk_window_set_transient_for(GTK_WINDOW(result), parent);
gtk_window_set_default_size(GTK_WINDOW(result), 600, 400);
gtk_window_set_type_hint(GTK_WINDOW(result), GDK_WINDOW_TYPE_HINT_DIALOG);
ref= G_OBJECT(result);
g_object_set_data(ref, "binary", binary);
vbox1 = gtk_vbox_new(FALSE, 8);
gtk_widget_show(vbox1);
gtk_container_add(GTK_CONTAINER(result), vbox1);
gtk_container_set_border_width(GTK_CONTAINER(vbox1), 8);
hbox3 = gtk_hbox_new(FALSE, 8);
gtk_widget_show(hbox3);
gtk_box_pack_start(GTK_BOX(vbox1), 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_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);
vbox2 = gtk_vbox_new(TRUE, 0);
gtk_widget_show(vbox2);
gtk_box_pack_start(GTK_BOX(hbox3), vbox2, FALSE, FALSE, 0);
vbuttonbox1 = gtk_vbutton_box_new();
gtk_widget_show(vbuttonbox1);
gtk_box_pack_start(GTK_BOX(vbox2), vbuttonbox1, FALSE, FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbuttonbox1), 8);
gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox1), GTK_BUTTONBOX_END);
gtk_box_set_spacing(GTK_BOX(vbuttonbox1), 8);
button7 = gtk_button_new();
gtk_widget_show(button7);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button7);
image3 = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image3);
gtk_container_add(GTK_CONTAINER(button7), image3);
button8 = gtk_button_new();
gtk_widget_show(button8);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button8);
image4 = gtk_image_new_from_stock("gtk-remove", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image4);
gtk_container_add(GTK_CONTAINER(button8), image4);
hseparator1 = gtk_hseparator_new();
gtk_widget_show(hseparator1);
gtk_box_pack_start(GTK_BOX(vbox2), hseparator1, FALSE, FALSE, 0);
vbuttonbox2 = gtk_vbutton_box_new();
gtk_widget_show(vbuttonbox2);
gtk_box_pack_start(GTK_BOX(vbox2), vbuttonbox2, FALSE, FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbuttonbox2), 8);
gtk_box_set_spacing(GTK_BOX(vbuttonbox2), 8);
button9 = gtk_button_new();
gtk_widget_show(button9);
gtk_container_add(GTK_CONTAINER(vbuttonbox2), button9);
image5 = gtk_image_new_from_stock("gtk-go-up", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image5);
gtk_container_add(GTK_CONTAINER(button9), image5);
button10 = gtk_button_new();
gtk_widget_show(button10);
gtk_container_add(GTK_CONTAINER(vbuttonbox2), button10);
image6 = gtk_image_new_from_stock("gtk-go-down", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image6);
gtk_container_add(GTK_CONTAINER(button10), image6);
scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL);
gtk_widget_show(scrolledwindow2);
gtk_box_pack_start(GTK_BOX(hbox3), scrolledwindow2, TRUE, TRUE, 0);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow2), GTK_SHADOW_IN);
treeview2 = gtk_tree_view_new();
gtk_widget_show(treeview2);
gtk_container_add(GTK_CONTAINER(scrolledwindow2), treeview2);
expander1 = gtk_expander_new(NULL);
gtk_widget_show(expander1);
gtk_box_pack_start(GTK_BOX(vbox1), expander1, FALSE, FALSE, 0);
gtk_expander_set_expanded(GTK_EXPANDER(expander1), TRUE);
hbox4 = gtk_hbox_new(FALSE, 0);
gtk_widget_show(hbox4);
gtk_container_add(GTK_CONTAINER(expander1), hbox4);
vbox3 = gtk_vbox_new(FALSE, 0);
gtk_widget_show(vbox3);
gtk_box_pack_start(GTK_BOX(hbox4), vbox3, TRUE, TRUE, 0);
label5 = gtk_label_new(_("Author:"));
gtk_widget_show(label5);
gtk_box_pack_start(GTK_BOX(vbox3), label5, FALSE, FALSE, 0);
gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5);
label8 = gtk_label_new(_("label8"));
gtk_widget_show(label8);
gtk_box_pack_start(GTK_BOX(vbox3), label8, FALSE, FALSE, 0);
label6 = gtk_label_new(_("Version:"));
gtk_widget_show(label6);
gtk_box_pack_start(GTK_BOX(vbox3), label6, FALSE, FALSE, 0);
gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);
label9 = gtk_label_new(_("label9"));
gtk_widget_show(label9);
gtk_box_pack_start(GTK_BOX(vbox3), label9, FALSE, FALSE, 0);
label7 = gtk_label_new(_("URL:"));
gtk_widget_show(label7);
gtk_box_pack_start(GTK_BOX(vbox3), label7, FALSE, FALSE, 0);
gtk_misc_set_alignment(GTK_MISC(label7), 0, 0.5);
label10 = gtk_label_new(_("label10"));
gtk_widget_show(label10);
gtk_box_pack_start(GTK_BOX(vbox3), label10, FALSE, FALSE, 0);
frame1 = gtk_frame_new(NULL);
gtk_widget_show(frame1);
gtk_box_pack_start(GTK_BOX(hbox4), frame1, TRUE, TRUE, 0);
gtk_frame_set_shadow_type(GTK_FRAME(frame1), GTK_SHADOW_NONE);
alignment3 = gtk_alignment_new(0.5, 0.5, 1, 1);
gtk_widget_show(alignment3);
gtk_container_add(GTK_CONTAINER(frame1), alignment3);
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment3), 0, 0, 12, 0);
label12 = gtk_label_new(_("label12"));
gtk_widget_show(label12);
gtk_container_add(GTK_CONTAINER(alignment3), label12);
gtk_misc_set_alignment(GTK_MISC(label12), 0, 0);
label11 = gtk_label_new(_("Action"));
gtk_widget_show(label11);
gtk_frame_set_label_widget(GTK_FRAME(frame1), label11);
gtk_label_set_use_markup(GTK_LABEL(label11), TRUE);
label3 = gtk_label_new(_("Details:"));
gtk_widget_show(label3);
gtk_expander_set_label_widget(GTK_EXPANDER(expander1), label3);
gtk_label_set_use_markup(GTK_LABEL(label3), TRUE);
hseparator2 = gtk_hseparator_new();
gtk_widget_show(hseparator2);
gtk_box_pack_start(GTK_BOX(vbox1), hseparator2, FALSE, FALSE, 0);
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);
gtk_box_set_spacing(GTK_BOX(hbuttonbox1), 8);
button1 = gtk_button_new();
gtk_widget_show(button1);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button1);
alignment1 = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_widget_show(alignment1);
gtk_container_add(GTK_CONTAINER(button1), alignment1);
hbox1 = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hbox1);
gtk_container_add(GTK_CONTAINER(alignment1), hbox1);
image1 = gtk_image_new_from_stock("gtk-apply", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image1);
gtk_box_pack_start(GTK_BOX(hbox1), image1, FALSE, FALSE, 0);
label1 = gtk_label_new_with_mnemonic(_("Apply"));
gtk_widget_show(label1);
gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0);
button2 = gtk_button_new();
gtk_widget_show(button2);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button2);
alignment2 = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_widget_show(alignment2);
gtk_container_add(GTK_CONTAINER(button2), alignment2);
hbox2 = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hbox2);
gtk_container_add(GTK_CONTAINER(alignment2), hbox2);
image2 = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image2);
gtk_box_pack_start(GTK_BOX(hbox2), image2, FALSE, FALSE, 0);
label2 = gtk_label_new_with_mnemonic(_("Cancel"));
gtk_widget_show(label2);
gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 0);
return result;
}