From add611caeebe4c504652f99895c30846af239339 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 18 May 2010 23:35:50 +0000 Subject: Displayed the about window. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@157 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 47 +++++++++++++++++ Makefile.am | 12 ++++- pixmaps/Makefile.am | 19 ++++++- pixmaps/openida.png | Bin 0 -> 22219 bytes pixmaps/openida.xcf | Bin 0 -> 474578 bytes pixmaps/openida_text.png | Bin 0 -> 8474 bytes pixmaps/openida_text.xcf | Bin 0 -> 337234 bytes pixmaps/revision.png | Bin 0 -> 601 bytes pixmaps/revision_0.png | Bin 0 -> 760 bytes pixmaps/revision_1.png | Bin 0 -> 545 bytes pixmaps/revision_2.png | Bin 0 -> 727 bytes pixmaps/revision_3.png | Bin 0 -> 719 bytes pixmaps/revision_4.png | Bin 0 -> 691 bytes pixmaps/revision_5.png | Bin 0 -> 746 bytes pixmaps/revision_6.png | Bin 0 -> 775 bytes pixmaps/revision_7.png | Bin 0 -> 585 bytes pixmaps/revision_8.png | Bin 0 -> 802 bytes pixmaps/revision_9.png | Bin 0 -> 791 bytes revision.h | 31 ++++++++++++ src/dialogs/Makefile.am | 1 + src/dialogs/about.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++ src/dialogs/about.h | 37 ++++++++++++++ src/dialogs/plugins.h | 6 +-- src/editor.c | 39 +++++++++++++++ src/format/Makefile.am | 9 +++- src/gtkext/support.h | 6 +-- 26 files changed, 325 insertions(+), 10 deletions(-) create mode 100644 pixmaps/openida.png create mode 100644 pixmaps/openida.xcf create mode 100644 pixmaps/openida_text.png create mode 100644 pixmaps/openida_text.xcf create mode 100644 pixmaps/revision.png create mode 100644 pixmaps/revision_0.png create mode 100644 pixmaps/revision_1.png create mode 100644 pixmaps/revision_2.png create mode 100644 pixmaps/revision_3.png create mode 100644 pixmaps/revision_4.png create mode 100644 pixmaps/revision_5.png create mode 100644 pixmaps/revision_6.png create mode 100644 pixmaps/revision_7.png create mode 100644 pixmaps/revision_8.png create mode 100644 pixmaps/revision_9.png create mode 100644 revision.h create mode 100644 src/dialogs/about.c create mode 100644 src/dialogs/about.h diff --git a/ChangeLog b/ChangeLog index 1796965..5334f77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,50 @@ +10-05-19 Cyrille Bagard + + * Makefile.am: + Compute the revision number based on SVN. + + * pixmaps/Makefile.am: + Install most of the new pictures. + + * pixmaps/openida.png: + * pixmaps/openida_text.png: + * pixmaps/openida_text.xcf: + * pixmaps/openida.xcf: + * pixmaps/revision_0.png: + * pixmaps/revision_1.png: + * pixmaps/revision_2.png: + * pixmaps/revision_3.png: + * pixmaps/revision_4.png: + * pixmaps/revision_5.png: + * pixmaps/revision_6.png: + * pixmaps/revision_7.png: + * pixmaps/revision_8.png: + * pixmaps/revision_9.png: + * pixmaps/revision.png: + New entries: add all pictures needed for the about window. + + * revision.h: + Create the header file containing the revision number. + + * src/dialogs/about.c: + * src/dialogs/about.h: + New entries: display the about window. + + * src/dialogs/Makefile.am: + Add the about.[ch] to libdialogs_a_SOURCES. + + * src/dialogs/plugins.h: + Typo. + + * src/editor.c: + Add a help/about menu. + + * src/format/Makefile.am: + Exclude the dwarf directory from compilation (for now). + + * src/gtkext/support.h: + Typo. + 10-05-17 Cyrille Bagard * configure.ac: diff --git a/Makefile.am b/Makefile.am index a28f09b..13a6314 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,15 @@ -EXTRA_DIST = config.rpath config.rpath config.rpath ChangeLog +BUILT_SOURCES = revision.h + +.svn: + @[ -d $@ ] || touch $@ + +revision.h: .svn + @nb=`svn log . -l 1 -q | grep r | cut -d ' ' -f 1 | tr -d 'r'` ; \ + sed -i "s/#define REVISION .*$$/#define REVISION $$nb/" $@ ; \ + [ -f $< ] && rm $< + +EXTRA_DIST = config.rpath config.rpath config.rpath config.rpath ChangeLog SUBDIRS = pixmaps src plugins diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am index e725e15..0de7e75 100644 --- a/pixmaps/Makefile.am +++ b/pixmaps/Makefile.am @@ -1,8 +1,23 @@ +REVISION_PIX = \ + revision_0.png \ + revision_1.png \ + revision_2.png \ + revision_3.png \ + revision_4.png \ + revision_5.png \ + revision_6.png \ + revision_7.png \ + revision_8.png \ + revision_9.png \ + revision.png + EXTRA_DIST = \ + openida.xcf \ + openida_text.xcf \ + $(REVISION_PIX) \ dropwin_back.png - oidapixdir = $(datadir)/openida -oidapix_DATA = $(EXTRA_DIST) +oidapix_DATA = dropwin_back.png $(REVISION_PIX) diff --git a/pixmaps/openida.png b/pixmaps/openida.png new file mode 100644 index 0000000..29cc7d2 Binary files /dev/null and b/pixmaps/openida.png differ diff --git a/pixmaps/openida.xcf b/pixmaps/openida.xcf new file mode 100644 index 0000000..fbf9426 Binary files /dev/null and b/pixmaps/openida.xcf differ diff --git a/pixmaps/openida_text.png b/pixmaps/openida_text.png new file mode 100644 index 0000000..5915f2e Binary files /dev/null and b/pixmaps/openida_text.png differ diff --git a/pixmaps/openida_text.xcf b/pixmaps/openida_text.xcf new file mode 100644 index 0000000..24513b0 Binary files /dev/null and b/pixmaps/openida_text.xcf differ diff --git a/pixmaps/revision.png b/pixmaps/revision.png new file mode 100644 index 0000000..330e108 Binary files /dev/null and b/pixmaps/revision.png differ diff --git a/pixmaps/revision_0.png b/pixmaps/revision_0.png new file mode 100644 index 0000000..0a468de Binary files /dev/null and b/pixmaps/revision_0.png differ diff --git a/pixmaps/revision_1.png b/pixmaps/revision_1.png new file mode 100644 index 0000000..738a881 Binary files /dev/null and b/pixmaps/revision_1.png differ diff --git a/pixmaps/revision_2.png b/pixmaps/revision_2.png new file mode 100644 index 0000000..b567b80 Binary files /dev/null and b/pixmaps/revision_2.png differ diff --git a/pixmaps/revision_3.png b/pixmaps/revision_3.png new file mode 100644 index 0000000..7f5e3fc Binary files /dev/null and b/pixmaps/revision_3.png differ diff --git a/pixmaps/revision_4.png b/pixmaps/revision_4.png new file mode 100644 index 0000000..a21ccbb Binary files /dev/null and b/pixmaps/revision_4.png differ diff --git a/pixmaps/revision_5.png b/pixmaps/revision_5.png new file mode 100644 index 0000000..a9130d9 Binary files /dev/null and b/pixmaps/revision_5.png differ diff --git a/pixmaps/revision_6.png b/pixmaps/revision_6.png new file mode 100644 index 0000000..291febd Binary files /dev/null and b/pixmaps/revision_6.png differ diff --git a/pixmaps/revision_7.png b/pixmaps/revision_7.png new file mode 100644 index 0000000..ccd4d4e Binary files /dev/null and b/pixmaps/revision_7.png differ diff --git a/pixmaps/revision_8.png b/pixmaps/revision_8.png new file mode 100644 index 0000000..054c250 Binary files /dev/null and b/pixmaps/revision_8.png differ diff --git a/pixmaps/revision_9.png b/pixmaps/revision_9.png new file mode 100644 index 0000000..1123669 Binary files /dev/null and b/pixmaps/revision_9.png differ diff --git a/revision.h b/revision.h new file mode 100644 index 0000000..4178a11 --- /dev/null +++ b/revision.h @@ -0,0 +1,31 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * revision.h - inscription du numéro de révision SVN + * + * Copyright (C) 2010 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 . + */ + + +#ifndef _DIALOGS_REVISION_H +#define _DIALOGS_REVISION_H + + +#define REVISION 156 + + +#endif /* _DIALOGS_REVISION_H */ diff --git a/src/dialogs/Makefile.am b/src/dialogs/Makefile.am index 2970d0a..289e5a5 100644 --- a/src/dialogs/Makefile.am +++ b/src/dialogs/Makefile.am @@ -2,6 +2,7 @@ lib_LIBRARIES = libdialogs.a libdialogs_a_SOURCES = \ + about.h about.c \ binparts.h binparts.c \ export.h export.c \ plugins.h plugins.c diff --git a/src/dialogs/about.c b/src/dialogs/about.c new file mode 100644 index 0000000..4f34a2c --- /dev/null +++ b/src/dialogs/about.c @@ -0,0 +1,128 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * about.h - boîte de dialogue d'information sur le programme + * + * Copyright (C) 2010 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 "about.h" + + +#include +#include + + +#include "../gtkext/easygtk.h" +#include "../gtkext/support.h" +#include "../../revision.h" + + + +#define _(str) str + + + +/****************************************************************************** +* * +* Paramètres : 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_about_dialog(GtkWindow *parent) +{ + GtkWidget *result; /* Fenêtre à renvoyer */ + GtkStyle *style; /* Style associé à la fenêtre */ + GtkWidget *fixed; /* Support global */ + gchar *filename; /* Chemin d'accès au fichier */ + GtkWidget *image; /* Image chargée */ + unsigned int revision; /* Numéro de révision */ + unsigned int i; /* Boucle de parcours */ + unsigned int level; /* Unité la plus importante */ + char buffer[16]; /* Nom d'image à forger */ + GtkWidget *label; /* Etiquette inférieure */ + + result = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_set_size_request(result, 350, 430); + gtk_container_set_border_width(GTK_CONTAINER(result), 0); + gtk_window_set_title(GTK_WINDOW(result), _("About")); + gtk_window_set_transient_for(GTK_WINDOW(result), parent); + gtk_window_set_default_size(GTK_WINDOW(result), 350, 430); + gtk_window_set_type_hint(GTK_WINDOW(result), GDK_WINDOW_TYPE_HINT_DIALOG); + + style = gtk_widget_get_style(result); + gtk_widget_modify_bg(result, GTK_STATE_NORMAL, &style->black); + + fixed = gtk_fixed_new(); + gtk_widget_show(fixed); + gtk_container_add(GTK_CONTAINER(result), fixed); + + /* Images principales */ + + filename = find_pixmap_file("openida.png"); + image = qck_create_image(NULL, NULL, filename); + gtk_fixed_put(GTK_FIXED(fixed), image, 10, 10); + gtk_widget_set_size_request(image, 330, 300); + + filename = find_pixmap_file("openida_text.png"); + image = qck_create_image(NULL, NULL, filename); + gtk_fixed_put(GTK_FIXED(fixed), image, 85, 330); + gtk_widget_set_size_request(image, 179, 36); + + /* Numéro de révision */ + + filename = find_pixmap_file("revision.png"); + image = qck_create_image(NULL, NULL, filename); + gtk_fixed_put(GTK_FIXED(fixed), image, 172, 360); + gtk_widget_set_size_request(image, 14, 18); + + revision = REVISION; + + for (i = 0; revision > 0; i++) + { + level = log(revision) / log(10); + level = pow(10, level); + + snprintf(buffer, 16, "revision_%u.png", revision / level); + + filename = find_pixmap_file(buffer); + image = qck_create_image(NULL, NULL, filename); + gtk_fixed_put(GTK_FIXED(fixed), image, 186 + i * 14, 360); + gtk_widget_set_size_request(image, 14, 18); + + revision %= level; + + } + + /* Copyright */ + + label = qck_create_label(NULL, NULL, "Copyright (C) 2008-2010 Cyrille Bagard"); + gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_fixed_put(GTK_FIXED(fixed), label, 0, 400); + gtk_widget_set_size_request(label, 350, 20); + + return result; + +} diff --git a/src/dialogs/about.h b/src/dialogs/about.h new file mode 100644 index 0000000..6d934d7 --- /dev/null +++ b/src/dialogs/about.h @@ -0,0 +1,37 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * about.h - prototypes pour la boîte de dialogue d'information sur le programme + * + * Copyright (C) 2010 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 . + */ + + +#ifndef _DIALOGS_ABOUT_H +#define _DIALOGS_ABOUT_H + + +#include + + + +/* Construit la fenêtre d'informations sur le logiciel. */ +GtkWidget *create_about_dialog(GtkWindow *); + + + +#endif /* _DIALOGS_ABOUT_H */ diff --git a/src/dialogs/plugins.h b/src/dialogs/plugins.h index 5de15ca..f0ea164 100644 --- a/src/dialogs/plugins.h +++ b/src/dialogs/plugins.h @@ -21,8 +21,8 @@ */ -#ifndef _DIALOGS_SECTIONS_H -#define _DIALOGS_SECTIONS_H +#ifndef _DIALOGS_PLUGINS_H +#define _DIALOGS_PLUGINS_H #include @@ -37,4 +37,4 @@ GtkWidget *create_plugins_selection_dialog(GOpenidaBinary *, GtkWindow *); -#endif /* _DLG_SECTIONS_H */ +#endif /* _DIALOGS_PLUGINS_H */ diff --git a/src/editor.c b/src/editor.c index 63be9d1..f038de6 100644 --- a/src/editor.c +++ b/src/editor.c @@ -49,6 +49,7 @@ #include "gtkext/gtkdockpanel.h" #include "debug/debuggers.h" +#include "dialogs/about.h" #include "dialogs/binparts.h" #include "dialogs/export.h" #include "dialogs/plugins.h" @@ -143,6 +144,10 @@ void update_debug_menu_items(GObject *, gboolean); +/* Réagit avec le menu "Aide -> A propos de...". */ +static void mcb_help_about(GtkMenuItem *, GObject *); + + @@ -389,6 +394,16 @@ GtkWidget *create_editor(void) + menuitem = gtk_menu_item_new_with_mnemonic(_("_Help")); + gtk_widget_show(menuitem); + gtk_container_add(GTK_CONTAINER(menuboard), menuitem); + + menubar = gtk_menu_new(); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menubar); + + submenuitem = qck_create_menu_item(NULL, NULL, _("About"), G_CALLBACK(mcb_help_about), result); + gtk_container_add(GTK_CONTAINER(menubar), submenuitem); + @@ -1393,6 +1408,30 @@ void update_debug_menu_items(GObject *ref, gboolean stopped) +/****************************************************************************** +* * +* Paramètres : menuitem = élément de menu sélectionné. * +* ref = adresse de l'espace de référencement global. * +* * +* Description : Réagit avec le menu "Aide -> A propos de...". * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void mcb_help_about(GtkMenuItem *menuitem, GObject *ref) +{ + GtkWidget *dialog; /* Boîte de dialogue à montrer */ + + dialog = create_about_dialog(GTK_WINDOW(ref)); + gtk_widget_show(dialog); + +} + + + /****************************************************************************** * * diff --git a/src/format/Makefile.am b/src/format/Makefile.am index 61fc0c6..c6be803 100644 --- a/src/format/Makefile.am +++ b/src/format/Makefile.am @@ -22,12 +22,19 @@ libformat_la_SOURCES = \ libformat_la_LIBADD = \ dex/libformatdex.la \ - dwarf/libformatdwarf.la \ elf/libformatelf.la \ java/libformatjava.la \ mangling/libformatmangling.la \ pe/libformatpe.la +# libformat_la_LIBADD = \ +# dex/libformatdex.la \ +# dwarf/libformatdwarf.la \ +# elf/libformatelf.la \ +# java/libformatjava.la \ +# mangling/libformatmangling.la \ +# pe/libformatpe.la + libformat_la_LDFLAGS = diff --git a/src/gtkext/support.h b/src/gtkext/support.h index 9d3373b..8664750 100644 --- a/src/gtkext/support.h +++ b/src/gtkext/support.h @@ -22,8 +22,8 @@ */ -#ifndef _SUPPORT_H -#define _SUPPORT_H +#ifndef _GTKEXT_SUPPORT_H +#define _GTKEXT_SUPPORT_H #include @@ -38,4 +38,4 @@ gchar *find_pixmap_file(const char *); -#endif /* _SUPPORT_H */ +#endif /* _GTKEXT_SUPPORT_H */ -- cgit v0.11.2-87-g4458