[Xfce4-commits] r22827 - in xarchiver/branches/xarchiver-psybsd: . libxarchiver pixmaps po src

Stephan Arts stephan at xfce.org
Fri Aug 18 23:22:26 UTC 2006


Author: stephan
Date: 2006-08-18 23:22:24 +0000 (Fri, 18 Aug 2006)
New Revision: 22827

Added:
   xarchiver/branches/xarchiver-psybsd/pixmaps/add_button.png
   xarchiver/branches/xarchiver-psybsd/pixmaps/extract_button.png
   xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.c
   xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.h
   xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.c
   xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.h
Removed:
   xarchiver/branches/xarchiver-psybsd/pixmaps/add_folder.png
Modified:
   xarchiver/branches/xarchiver-psybsd/TODO
   xarchiver/branches/xarchiver-psybsd/configure.in.in
   xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
   xarchiver/branches/xarchiver-psybsd/po/POTFILES.in
   xarchiver/branches/xarchiver-psybsd/po/nl.po
   xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot
   xarchiver/branches/xarchiver-psybsd/src/Makefile.am
   xarchiver/branches/xarchiver-psybsd/src/main_window.c
   xarchiver/branches/xarchiver-psybsd/src/main_window.h
   xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
Log:

Updated .desktop file (Bug #2174)
Copied icons of xarchiver trunk
Started working on menu- and toolbar.

Updated TODO



Modified: xarchiver/branches/xarchiver-psybsd/TODO
===================================================================
--- xarchiver/branches/xarchiver-psybsd/TODO	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/TODO	2006-08-18 23:22:24 UTC (rev 22827)
@@ -8,11 +8,26 @@
 | IMPORTANT                                         IMPORTANT |
 ---------------------------------------------------------------
   
-  Comment library functionsi
++-+-+-+
+
+	Implement View support (for all support-objects)
++-+-+-+
+
+	Implement Rar Support object.
+
+	Implement UnRar Support object. (separate ?!)
++-+-+-+
+
+  Comment library functions
     (explain their purpose)
++-+-+-+
 
   Make thunar-vfs dependency optional.
     (Can be replaced by an internal libmime)
++-+-+-+
 
+  Implement multi-threading (for libarchive support)
++-+-+-+
+
   Complete TODO-file
-
++-+-+-+

Modified: xarchiver/branches/xarchiver-psybsd/configure.in.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/configure.in.in	2006-08-18 23:22:24 UTC (rev 22827)
@@ -18,12 +18,16 @@
 m4_define([xarchiver_version_tag], [svn]) # Leave empty for releases
 m4_define([xarchiver_version], [ifelse(xarchiver_version_branch(), [], [xarchiver_version_major().xarchiver_version_minor().xarchiver_version_micro()ifelse(xarchiver_version_nano(), [], [], [.xarchiver_version_nano()])], [xarchiver_version_branch()])-ifelse(xarchiver_version_tag(), [svn], [xarchiver_version_tag()-xarchiver_version_build()], [xarchiver_version_tag()])])
 
+AC_COPYRIGHT([Copyright (c) 2006
+        The Xfce development team. All rights reserved.
+
+Written for Xfce by Stephan Arts <psybsd at gmail.com>.])
+
 AC_INIT([Xarchiver], [xarchiver_version], [])
 AC_PREREQ([2.50])
 
-
 XARCHIVER_VERSION=xarchiver_version
-AM_INIT_AUTOMAKE([Xarchiver], [$XARCHIVER_VERSION])
+AM_INIT_AUTOMAKE([xarchiver], [$XARCHIVER_VERSION])
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE
 

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c	2006-08-18 23:22:24 UTC (rev 22827)
@@ -90,6 +90,10 @@
 void
 lxa_archive_support_gnu_tar_class_init(LXAArchiveSupportGnuTarClass *supportclass)
 {
+	/* TODO
+	 * Implement properties.
+	 *
+	 */
 }
 
 LXAArchiveSupport*

Added: xarchiver/branches/xarchiver-psybsd/pixmaps/add_button.png
===================================================================
(Binary files differ)


Property changes on: xarchiver/branches/xarchiver-psybsd/pixmaps/add_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: xarchiver/branches/xarchiver-psybsd/pixmaps/add_folder.png

Added: xarchiver/branches/xarchiver-psybsd/pixmaps/extract_button.png
===================================================================
(Binary files differ)


Property changes on: xarchiver/branches/xarchiver-psybsd/pixmaps/extract_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: xarchiver/branches/xarchiver-psybsd/po/POTFILES.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/POTFILES.in	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/po/POTFILES.in	2006-08-18 23:22:24 UTC (rev 22827)
@@ -1,8 +1,13 @@
 libxarchiver/libxarchiver.c
 libxarchiver/archive.c
 libxarchiver/archive-support.c
-libxarchiver/compression-support.c
+libxarchiver/archive-support-gnu-tar.c
+libxarchiver/archive-support-zip.c
 libxarchiver/internals.c
 
 src/main.c
+src/main_window.c
 src/new_dialog.c
+src/extract_dialog.c
+src/main_window_menu_bar.c
+src/main_window_tool_bar.c

Modified: xarchiver/branches/xarchiver-psybsd/po/nl.po
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/nl.po	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/po/nl.po	2006-08-18 23:22:24 UTC (rev 22827)
@@ -6,8 +6,8 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: xarchiver 0.3.9psybsd\n"
-"Report-Msgid-Bugs-To: psybsd at gmail.com\n"
-"POT-Creation-Date: 2006-08-03 17:01+0200\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-08-19 01:15+0200\n"
 "PO-Revision-Date: 2006-07-20 16:36+0200\n"
 "Last-Translator: Stephan Arts <psybsd at gmail.com>\n"
 "Language-Team: Dutch <vertaling at vrijschrift.org>\n"
@@ -16,74 +16,43 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: ../src/main.c:52
+#: ../src/main.c:49
 msgid "[destination path]"
 msgstr "[bestemmings map]"
 
-#: ../src/main.c:60
+#: ../src/main.c:57
 msgid "[archive path] [file1] [file2] ... [fileN]"
 msgstr "[archief map] [bestand1] [bestand2] ... [bestandN]"
 
-#: ../src/main.c:64
+#: ../src/main.c:61
 msgid "[file1] [file2] ... [fileN]"
 msgstr "[bestand1] [bestand2] ... [bestandN]"
 
 #: ../src/main.c:106
-#, c-format
-msgid "Could not add file(s) to archive '%s'"
-msgstr "Kan bestand(en) niet toevoegen aan archief '%s'"
-
-#: ../src/main.c:109 ../src/main.c:205
-#, c-format
-msgid "Could not extract archive '%s'"
-msgstr "Kan archief '%s' niet uitpakken"
-
-#: ../src/main.c:112
-#, c-format
-msgid "Could not remove file(s) from archive '%s'"
-msgstr "Kon bestand(en) niet verwijderen uit archief '%s'"
-
-#: ../src/main.c:135
-#, c-format
-msgid "File '%s' does not exist: ABORTING"
-msgstr "Bestand '%s' bestaat niet"
-
-#: ../src/main.c:169
 msgid "[archive name]"
 msgstr "[archief naam]"
 
-#: ../src/main.c:218
-msgid "You should provide at least one file to add\n"
-msgstr "U moet ten minste een bestand toevoegen\n"
+#: ../src/main.c:159
+msgid "Could not create archive, MIME-type unsupported"
+msgstr "Kan archief niet maken, MIME-type wordt niet ondersteund"
 
-#: ../src/main.c:329
-msgid "Archive type unknown\n"
-msgstr "Onbekend archieftype\n"
+#: ../src/new_dialog.c:85
+msgid "Create new archive"
+msgstr "Maak nieuw archief"
 
-#: ../src/new_dialog.c:76
-msgid "Archive type:"
-msgstr "Archieftype:"
+#: ../src/extract_dialog.c:78
+msgid "Extract"
+msgstr "Uitpakken"
 
-#: ../src/new_dialog.c:88
-msgid "Automatic"
-msgstr "Automatisch"
+#: ../src/extract_dialog.c:87
+msgid "Extract archive"
+msgstr "Archief uitpakken"
 
-#: ../src/new_dialog.c:98 ../src/new_dialog.c:163
-msgid "Tar (uncompressed) '.tar'"
-msgstr "Tar (ongecomprimeerd) '.tar'"
+#~ msgid "_Archive"
+#~ msgstr "_Archief"
 
-#: ../src/new_dialog.c:108 ../src/new_dialog.c:169
-msgid "Gzip compressed Tar '.tar.gz'"
-msgstr "Gzip gecomprimeerde Tar '.tar.gz'"
+#~ msgid "A_ction"
+#~ msgstr "A_ctie"
 
-#: ../src/new_dialog.c:118 ../src/new_dialog.c:176
-msgid "Bzip2 compressed Tar '.tar.bz2'"
-msgstr "Bzip2 gecomprimeerde Tar '.tar.bz2'"
-
-#: ../src/new_dialog.c:129 ../src/new_dialog.c:185
-msgid "Zip archive '.zip'"
-msgstr "Zip archief '.zip'"
-
-#: ../src/new_dialog.c:157
-msgid "Create new archive"
-msgstr "Maak nieuw archief"
+#~ msgid "_Help"
+#~ msgstr "_Help"

Modified: xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot	2006-08-18 23:22:24 UTC (rev 22827)
@@ -3,13 +3,12 @@
 # This file is distributed under the same license as the PACKAGE package.
 # FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
 #
-#: ../src/main.c:50 ../src/main.c:54 ../src/main.c:58 ../src/main.c:62
 #, fuzzy
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: psybsd at gmail.com\n"
-"POT-Creation-Date: 2006-07-28 14:58+0200\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-08-19 01:15+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -17,74 +16,34 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../src/main.c:51
+#: ../src/main.c:49
 msgid "[destination path]"
 msgstr ""
 
-#: ../src/main.c:59
+#: ../src/main.c:57
 msgid "[archive path] [file1] [file2] ... [fileN]"
 msgstr ""
 
-#: ../src/main.c:63
+#: ../src/main.c:61
 msgid "[file1] [file2] ... [fileN]"
 msgstr ""
 
-#: ../src/main.c:105
-#, c-format
-msgid "Could not add file(s) to archive '%s'"
-msgstr ""
-
-#: ../src/main.c:108 ../src/main.c:197
-#, c-format
-msgid "Could not extract archive '%s'"
-msgstr ""
-
-#: ../src/main.c:111
-#, c-format
-msgid "Could not remove file(s) from archive '%s'"
-msgstr ""
-
-#: ../src/main.c:134
-#, c-format
-msgid "File '%s' does not exist: ABORTING"
-msgstr ""
-
-#: ../src/main.c:168
+#: ../src/main.c:106
 msgid "[archive name]"
 msgstr ""
 
-#: ../src/main.c:209
-msgid "You should provide at least one file to add\n"
+#: ../src/main.c:159
+msgid "Could not create archive, MIME-type unsupported"
 msgstr ""
 
-#: ../src/main.c:302
-msgid "Archive type unknown\n"
+#: ../src/new_dialog.c:85
+msgid "Create new archive"
 msgstr ""
 
-#: ../src/new_dialog.c:76
-msgid "Archive type:"
+#: ../src/extract_dialog.c:78
+msgid "Extract"
 msgstr ""
 
-#: ../src/new_dialog.c:88
-msgid "Automatic"
+#: ../src/extract_dialog.c:87
+msgid "Extract archive"
 msgstr ""
-
-#: ../src/new_dialog.c:98 ../src/new_dialog.c:163
-msgid "Tar (uncompressed) '.tar'"
-msgstr ""
-
-#: ../src/new_dialog.c:108 ../src/new_dialog.c:169
-msgid "Gzip compressed Tar '.tar.gz'"
-msgstr ""
-
-#: ../src/new_dialog.c:118 ../src/new_dialog.c:176
-msgid "Bzip2 compressed Tar '.tar.bz2'"
-msgstr ""
-
-#: ../src/new_dialog.c:129 ../src/new_dialog.c:185
-msgid "Zip archive '.zip'"
-msgstr ""
-
-#: ../src/new_dialog.c:157
-msgid "Create new archive"
-msgstr ""

Modified: xarchiver/branches/xarchiver-psybsd/src/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/Makefile.am	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/src/Makefile.am	2006-08-18 23:22:24 UTC (rev 22827)
@@ -3,6 +3,8 @@
 xarchiver_SOURCES = \
 	main.c main.h \
 	main_window.c main_window.h \
+	main_window_menu_bar.c main_window_menu_bar.h \
+	main_window_tool_bar.c main_window_tool_bar.h \
 	new_dialog.c new_dialog.h \
 	extract_dialog.c extract_dialog.h
 

Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c	2006-08-18 23:22:24 UTC (rev 22827)
@@ -20,13 +20,15 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <libxarchiver/libxarchiver.h>
+#include "main_window_menu_bar.h"
+#include "main_window_tool_bar.h"
 #include "main_window.h"
 
 static void
-xa_main_window_class_init(XAMainWindowClass *archive_class);
+xa_main_window_class_init(XAMainWindowClass *);
 
 static void
-xa_main_window_init(XAMainWindow *archive);
+xa_main_window_init(XAMainWindow *);
 
 GType
 xa_main_window_get_type ()
@@ -55,13 +57,26 @@
 }
 
 static void
-xa_main_window_class_init(XAMainWindowClass *dialog_class)
+xa_main_window_class_init(XAMainWindowClass *window_class)
 {
 }
 
 static void
-xa_main_window_init(XAMainWindow *dialog)
+xa_main_window_init(XAMainWindow *window)
 {
+	gtk_window_set_default_icon_from_file(DATADIR "/pixmaps/xarchiver.png", NULL);
+	window->main_vbox = gtk_vbox_new(FALSE, 0);
+	window->menubar = xa_main_window_menu_bar_new();
+	window->toolbar = xa_main_window_tool_bar_new();
+
+	gtk_box_pack_start(GTK_BOX(window->main_vbox), window->menubar, 0, FALSE, FALSE);
+	gtk_box_pack_start(GTK_BOX(window->main_vbox), window->toolbar, 0, FALSE, FALSE);
+
+	gtk_widget_show(window->main_vbox);
+	gtk_widget_show_all(window->menubar);
+	gtk_widget_show_all(window->toolbar);
+
+	gtk_container_add(GTK_CONTAINER(window), window->main_vbox);
 }
 
 GtkWidget *
@@ -70,8 +85,40 @@
 	GtkWidget *window;
 
 	window = g_object_new(xa_main_window_get_type(),
-			"title", PACKAGE_STRING,
+			"title", "Xarchiver " PACKAGE_VERSION,
 			NULL);
 
 	return window;
 }
+
+GtkWidget *
+xa_main_window_find_image(gchar *filename, GtkIconSize size)
+{
+	GError *error = NULL;
+    GtkWidget *file_image;
+	gchar *path;
+	path = g_strconcat(DATADIR, "/xarchiver/pixmaps/", filename, NULL);
+	GdkPixbuf *file_pixbuf = gdk_pixbuf_new_from_file(path, &error);
+	if(!file_pixbuf)
+	{
+		/*
+		* perhaps xarchiver has not been installed and is being executed from source dir
+		*/
+		g_free(error);
+		error = NULL;
+		path = g_strconcat("./pixmaps/", filename, NULL);
+		file_pixbuf = gdk_pixbuf_new_from_file(path, &error);
+    }
+    if(file_pixbuf)
+    {
+		file_image = gtk_image_new_from_pixbuf(file_pixbuf);
+		g_object_unref(file_pixbuf);
+    }
+    else
+	{
+		g_free(error);
+		file_image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, size);
+    }
+    g_free(path);
+    return file_image;
+}

Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.h	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.h	2006-08-18 23:22:24 UTC (rev 22827)
@@ -43,6 +43,9 @@
 struct _XAMainWindow
 {
 	GtkWindow parent;
+	GtkWidget *main_vbox;
+	GtkWidget *menubar;
+	GtkWidget *toolbar;
 };
 
 typedef struct _XAMainWindowClass XAMainWindowClass;
@@ -53,6 +56,7 @@
 };
 
 GtkWidget *xa_main_window_new();
+GtkWidget *xa_main_window_find_image(gchar *, GtkIconSize);
 
 G_END_DECLS
 #endif /* __XARCHIVER_MAIN_WINDOW_H__ */

Added: xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.c	                        (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.c	2006-08-18 23:22:24 UTC (rev 22827)
@@ -0,0 +1,123 @@
+/*
+ *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ *  This program 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 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library 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 <config.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <libxarchiver/libxarchiver.h>
+#include "main_window_menu_bar.h"
+#include "main_window.h"
+
+static void
+xa_main_window_menu_bar_class_init(XAMainWindowMenuBarClass *);
+
+static void
+xa_main_window_menu_bar_init(XAMainWindowMenuBar *);
+
+GType
+xa_main_window_menu_bar_get_type ()
+{
+	static GType xa_main_window_menu_bar_type = 0;
+
+ 	if (!xa_main_window_menu_bar_type)
+	{
+ 		static const GTypeInfo xa_main_window_menu_bar_info = 
+		{
+			sizeof (XAMainWindowMenuBarClass),
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) xa_main_window_menu_bar_class_init,
+			(GClassFinalizeFunc) NULL,
+			NULL,
+			sizeof (XAMainWindowMenuBar),
+			0,
+			(GInstanceInitFunc) xa_main_window_menu_bar_init,
+			NULL
+		};
+
+		xa_main_window_menu_bar_type = g_type_register_static (GTK_TYPE_MENU_BAR, "XAMainWindowMenuBar", &xa_main_window_menu_bar_info, 0);
+	}
+	return xa_main_window_menu_bar_type;
+}
+
+static void
+xa_main_window_menu_bar_class_init(XAMainWindowMenuBarClass *menubar_class)
+{
+}
+
+static void
+xa_main_window_menu_bar_init(XAMainWindowMenuBar *menubar)
+{
+	GtkAccelGroup *accel_group = gtk_accel_group_new();
+
+	GtkWidget *tmp_image;
+
+	menubar->menu_item_archive = gtk_menu_item_new_with_mnemonic(_("_Archive"));
+	menubar->menu_item_action = gtk_menu_item_new_with_mnemonic(_("A_ction"));
+	menubar->menu_item_help = gtk_menu_item_new_with_mnemonic(_("_Help"));
+
+	gtk_container_add(GTK_CONTAINER(menubar), menubar->menu_item_archive);
+	gtk_container_add(GTK_CONTAINER(menubar), menubar->menu_item_action);
+	gtk_container_add(GTK_CONTAINER(menubar), menubar->menu_item_help);
+
+	menubar->menu_archive = gtk_menu_new();
+	menubar->menu_action = gtk_menu_new();
+	menubar->menu_help = gtk_menu_new();
+
+	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->menu_item_archive), menubar->menu_archive);
+	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->menu_item_action), menubar->menu_action);
+	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->menu_item_help), menubar->menu_help);
+
+/* Archive menu */
+	menubar->menu_item_new = gtk_image_menu_item_new_from_stock("gtk-new", accel_group);
+	menubar->menu_item_open = gtk_image_menu_item_new_from_stock("gtk-open", accel_group);
+	menubar->menu_item_quit = gtk_image_menu_item_new_from_stock("gtk-quit", accel_group);
+
+	gtk_container_add(GTK_CONTAINER(menubar->menu_archive), menubar->menu_item_new);
+	gtk_container_add(GTK_CONTAINER(menubar->menu_archive), menubar->menu_item_open);
+	gtk_container_add(GTK_CONTAINER(menubar->menu_archive), menubar->menu_item_quit);
+
+/* Action menu */
+	tmp_image = xa_main_window_find_image("add_button.png", GTK_ICON_SIZE_MENU);
+	menubar->menu_item_add = gtk_image_menu_item_new_with_mnemonic(_("Add"));
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->menu_item_add), tmp_image);
+
+	tmp_image = xa_main_window_find_image("extract_button.png", GTK_ICON_SIZE_MENU);
+	menubar->menu_item_extract = gtk_image_menu_item_new_with_mnemonic(_("Extract"));
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->menu_item_extract), tmp_image);
+
+	menubar->menu_item_remove = gtk_image_menu_item_new_from_stock("gtk-delete", accel_group);
+
+	gtk_container_add(GTK_CONTAINER(menubar->menu_action), menubar->menu_item_add);
+	gtk_container_add(GTK_CONTAINER(menubar->menu_action), menubar->menu_item_extract);
+	gtk_container_add(GTK_CONTAINER(menubar->menu_action), menubar->menu_item_remove);
+
+/* Help menu */
+	menubar->menu_item_about = gtk_image_menu_item_new_from_stock("gtk-about", accel_group);
+	gtk_container_add(GTK_CONTAINER(menubar->menu_help), menubar->menu_item_about);
+}
+
+GtkWidget *
+xa_main_window_menu_bar_new()
+{
+	GtkWidget *menubar;
+
+	menubar = g_object_new(xa_main_window_menu_bar_get_type(), NULL);
+
+	return menubar;
+}

Added: xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.h	                        (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window_menu_bar.h	2006-08-18 23:22:24 UTC (rev 22827)
@@ -0,0 +1,78 @@
+/*
+ *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ *  This program 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 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library 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.
+ */
+
+#ifndef __XARCHIVER_MAIN_WINDOW_MENU_BAR_H__
+#define __XARCHIVER_MAIN_WINDOW_MENU_BAR_H__
+G_BEGIN_DECLS
+
+#define XA_MAIN_WINDOW_MENU_BAR(obj)         ( \
+		G_TYPE_CHECK_INSTANCE_CAST ((obj),    \
+			xa_main_window_menu_bar_get_type(),      \
+			XAMainWindowMenuBar))
+
+#define XA_IS_MAIN_WINDOW_MENU_BAR(obj)      ( \
+		G_TYPE_CHECK_INSTANCE_TYPE ((obj),    \
+			xa_main_window_menu_bar_get_type()))
+
+#define XA_MAIN_WINDOW_MENU_BAR_CLASS(class) ( \
+		G_TYPE_CHECK_CLASS_CAST ((class),     \
+			xa_main_window_menu_bar_get_type(),      \
+			XAMainWindowMenuBarClass))
+
+#define XA_IS_MAIN_WINDOW_MENU_BAR_CLASS(class) ( \
+		G_TYPE_CHECK_CLASS_TYPE ((class),        \
+			xa_main_window_menu_bar_get_type()))
+
+typedef struct _XAMainWindowMenuBar XAMainWindowMenuBar;
+
+struct _XAMainWindowMenuBar
+{
+	GtkMenuBar parent;
+	GtkWidget *menu_item_archive;
+	GtkWidget *menu_archive;
+	/* contents of 'archive' menu */
+	GtkWidget *menu_item_new;
+	GtkWidget *menu_item_open;
+	GtkWidget *menu_item_quit;
+
+	GtkWidget *menu_item_action;
+	GtkWidget *menu_action;
+
+	/* contents of 'action' menu */
+	GtkWidget *menu_item_add;
+	GtkWidget *menu_item_extract;
+	GtkWidget *menu_item_remove;
+
+	GtkWidget *menu_item_help;
+	GtkWidget *menu_help;
+	/* contents of 'help' menu */
+	GtkWidget *menu_item_about;
+
+};
+
+typedef struct _XAMainWindowMenuBarClass XAMainWindowMenuBarClass;
+
+struct _XAMainWindowMenuBarClass
+{
+	GtkMenuBarClass parent;
+};
+
+GtkWidget *xa_main_window_menu_bar_new();
+
+G_END_DECLS
+#endif /* __XARCHIVER_MAIN_WINDOW_MENU_BAR_H__ */

Added: xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.c	                        (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.c	2006-08-18 23:22:24 UTC (rev 22827)
@@ -0,0 +1,104 @@
+/*
+ *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ *  This program 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 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library 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 <config.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <libxarchiver/libxarchiver.h>
+#include "main_window_tool_bar.h"
+#include "main_window.h"
+
+static void
+xa_main_window_tool_bar_class_init(XAMainWindowToolBarClass *);
+
+static void
+xa_main_window_tool_bar_init(XAMainWindowToolBar *);
+
+GType
+xa_main_window_tool_bar_get_type ()
+{
+	static GType xa_main_window_tool_bar_type = 0;
+
+ 	if (!xa_main_window_tool_bar_type)
+	{
+ 		static const GTypeInfo xa_main_window_tool_bar_info = 
+		{
+			sizeof (XAMainWindowToolBarClass),
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) xa_main_window_tool_bar_class_init,
+			(GClassFinalizeFunc) NULL,
+			NULL,
+			sizeof (XAMainWindowToolBar),
+			0,
+			(GInstanceInitFunc) xa_main_window_tool_bar_init,
+			NULL
+		};
+
+		xa_main_window_tool_bar_type = g_type_register_static (GTK_TYPE_TOOLBAR, "XAMainWindowToolBar", &xa_main_window_tool_bar_info, 0);
+	}
+	return xa_main_window_tool_bar_type;
+}
+
+static void
+xa_main_window_tool_bar_class_init(XAMainWindowToolBarClass *toolbar_class)
+{
+}
+
+static void
+xa_main_window_tool_bar_init(XAMainWindowToolBar *toolbar)
+{
+	GtkToolItem *separator;
+	GtkWidget *tmp_image;
+	
+	/* contents of 'archive' pane */
+	toolbar->tool_item_new = gtk_tool_button_new_from_stock("gtk-new");
+	toolbar->tool_item_open = gtk_tool_button_new_from_stock("gtk-open");
+	separator = gtk_separator_tool_item_new ();
+
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbar->tool_item_new));
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbar->tool_item_open));
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(separator));
+
+	/* contents of 'action' pane */
+	tmp_image = xa_main_window_find_image("add.png", GTK_ICON_SIZE_LARGE_TOOLBAR);
+	toolbar->tool_item_add = gtk_tool_button_new(tmp_image, _("Add"));
+
+	tmp_image = xa_main_window_find_image("extract.png", GTK_ICON_SIZE_LARGE_TOOLBAR);
+	toolbar->tool_item_extract = gtk_tool_button_new(tmp_image, _("Extract"));
+
+	tmp_image = gtk_image_new_from_stock("gtk-delete", GTK_ICON_SIZE_LARGE_TOOLBAR);
+	toolbar->tool_item_remove = gtk_tool_button_new(tmp_image, _("Delete"));
+
+	separator = gtk_separator_tool_item_new ();
+
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbar->tool_item_add));
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbar->tool_item_extract));
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbar->tool_item_remove));
+	gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(separator));
+}
+
+GtkWidget *
+xa_main_window_tool_bar_new()
+{
+	GtkWidget *toolbar;
+
+	toolbar = g_object_new(xa_main_window_tool_bar_get_type(), NULL);
+
+	return toolbar;
+}

Added: xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.h	                        (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window_tool_bar.h	2006-08-18 23:22:24 UTC (rev 22827)
@@ -0,0 +1,67 @@
+/*
+ *  Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ *  This program 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 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Library 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.
+ */
+
+#ifndef __XARCHIVER_MAIN_WINDOW_TOOLBAR_H__
+#define __XARCHIVER_MAIN_WINDOW_TOOLBAR_H__
+G_BEGIN_DECLS
+
+#define XA_MAIN_WINDOW_TOOLBAR(obj)         ( \
+		G_TYPE_CHECK_INSTANCE_CAST ((obj),    \
+			xa_main_window_toolbar_get_type(),      \
+			XAMainWindowToolBar))
+
+#define XA_IS_MAIN_WINDOW_TOOLBAR(obj)      ( \
+		G_TYPE_CHECK_INSTANCE_TYPE ((obj),    \
+			xa_main_window_toolbar_get_type()))
+
+#define XA_MAIN_WINDOW_TOOLBAR_CLASS(class) ( \
+		G_TYPE_CHECK_CLASS_CAST ((class),     \
+			xa_main_window_toolbar_get_type(),      \
+			XAMainWindowToolBarClass))
+
+#define XA_IS_MAIN_WINDOW_TOOLBAR_CLASS(class) ( \
+		G_TYPE_CHECK_CLASS_TYPE ((class),        \
+			xa_main_window_toolbar_get_type()))
+
+typedef struct _XAMainWindowToolBar XAMainWindowToolBar;
+
+struct _XAMainWindowToolBar
+{
+	GtkToolbar parent;
+	/* contents of 'archive' pane */
+	GtkToolItem *tool_item_new;
+	GtkToolItem *tool_item_open;
+
+	/* contents of 'action' pane */
+	GtkToolItem *tool_item_add;
+	GtkToolItem *tool_item_extract;
+	GtkToolItem *tool_item_remove;
+
+};
+
+typedef struct _XAMainWindowToolBarClass XAMainWindowToolBarClass;
+
+struct _XAMainWindowToolBarClass
+{
+	GtkToolbarClass parent;
+};
+
+GtkWidget *xa_main_window_tool_bar_new();
+
+G_END_DECLS
+#endif /* __XARCHIVER_MAIN_WINDOW_TOOLBAR_H__ */

Modified: xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in	2006-08-18 22:16:04 UTC (rev 22826)
+++ xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in	2006-08-18 23:22:24 UTC (rev 22827)
@@ -9,6 +9,6 @@
 Terminal=false
 Type=Application
 X-MultipleArgs=false
-Categories=GTK;Application;Utility;
+Categories=GTK;Archiving;Utility;
 StartupNotify=true
 MimeType=application/x-bzip-compressed-tar;application/x-tar;application/x-compressed-tar;application/x-zip;application/zip;



More information about the Xfce4-commits mailing list