aboutsummaryrefslogtreecommitdiff
path: root/0.8.0/src/gtkpaludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-11 20:56:59 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-11 20:56:59 +0000
commite3b86134db7baada7b3a1e779e7d6d046ab53a1a (patch)
tree6acb3c0de68e1b95dbba8f0e00f770b8f31e4bac /0.8.0/src/gtkpaludis
parentab9cdb1150d97449e857cd55fe706377c9ab2422 (diff)
downloadpaludis-0.8.0.tar.gz
paludis-0.8.0.tar.xz
Tag release 0.8.00.8.0
Diffstat (limited to '0.8.0/src/gtkpaludis')
-rw-r--r--0.8.0/src/gtkpaludis/Makefile.am44
-rw-r--r--0.8.0/src/gtkpaludis/browse_tree.cc450
-rw-r--r--0.8.0/src/gtkpaludis/browse_tree.hh47
-rw-r--r--0.8.0/src/gtkpaludis/command_line.cc68
-rw-r--r--0.8.0/src/gtkpaludis/command_line.hh98
-rw-r--r--0.8.0/src/gtkpaludis/gtkpaludis.cc292
-rw-r--r--0.8.0/src/gtkpaludis/information_tree.cc161
-rw-r--r--0.8.0/src/gtkpaludis/information_tree.hh58
-rw-r--r--0.8.0/src/gtkpaludis/main_window.cc139
-rw-r--r--0.8.0/src/gtkpaludis/main_window.hh45
-rw-r--r--0.8.0/src/gtkpaludis/message_window.cc0
-rw-r--r--0.8.0/src/gtkpaludis/message_window.hh0
-rw-r--r--0.8.0/src/gtkpaludis/sync.cc100
-rw-r--r--0.8.0/src/gtkpaludis/sync.hh50
-rw-r--r--0.8.0/src/gtkpaludis/vte_message_window.cc136
-rw-r--r--0.8.0/src/gtkpaludis/vte_message_window.hh82
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/Makefile.am73
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/converts/Makefile.am6
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/converts/convert.m430
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/converts/convert_base.m469
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/defs/Makefile.am51
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/defs/enum.pl230
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/defs/generate_defs_vte.cc36
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/reaper.ccg65
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/reaper.hg50
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/terminal_widget.ccg159
-rw-r--r--0.8.0/src/gtkpaludis/vtemm/terminal_widget.hg181
27 files changed, 2720 insertions, 0 deletions
diff --git a/0.8.0/src/gtkpaludis/Makefile.am b/0.8.0/src/gtkpaludis/Makefile.am
new file mode 100644
index 0000000..e64e956
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/Makefile.am
@@ -0,0 +1,44 @@
+AM_CXXFLAGS = -I$(top_srcdir) \
+ @PALUDIS_CXXFLAGS@ \
+ @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
+ @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
+ @PALUDIS_CXXFLAGS_NO_WSHADOW@
+
+DEFS = \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DGLIBMM_EXCEPTIONS_ENABLED=1
+
+SUBDIRS = vtemm .
+
+INCLUDES = $(GTKDEPS_CFLAGS)
+
+if ENABLE_GTK
+
+bin_PROGRAMS = gtkpaludis
+
+gtkpaludis_SOURCES = \
+ command_line.cc command_line.hh \
+ browse_tree.cc browse_tree.hh \
+ information_tree.cc information_tree.hh \
+ vte_message_window.hh vte_message_window.cc \
+ main_window.cc main_window.hh \
+ sync.cc sync.hh \
+ gtkpaludis.cc
+
+gtkpaludis_LDADD = \
+ $(top_builddir)/src/gtkpaludis/vtemm/libvtemm.a \
+ $(top_builddir)/paludis/tasks/libpaludistasks.a \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/environment/default/libpaludisdefaultenvironment.la \
+ $(GTKDEPS_LIBS) \
+ $(DYNAMIC_LD_LIBS)
+
+endif
+
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in
+
+
diff --git a/0.8.0/src/gtkpaludis/browse_tree.cc b/0.8.0/src/gtkpaludis/browse_tree.cc
new file mode 100644
index 0000000..fda7a3c
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/browse_tree.cc
@@ -0,0 +1,450 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "browse_tree.hh"
+#include "information_tree.hh"
+#include "main_window.hh"
+#include "sync.hh"
+#include "vtemm/reaper.hh"
+
+#include <gtkmm/treestore.h>
+#include <gtkmm/menu.h>
+#include <gtkmm/messagedialog.h>
+
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/util/log.hh>
+#include <paludis/syncer.hh>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <iostream>
+
+using namespace paludis;
+
+namespace
+{
+ class BrowseTreeColumns;
+
+ class BrowseTreeDisplayData :
+ public InternalCounted<BrowseTreeDisplayData>
+ {
+ private:
+ bool _has_children;
+
+ protected:
+ BrowseTreeDisplayData();
+
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator) const = 0;
+
+ public:
+ virtual ~BrowseTreeDisplayData();
+
+ virtual void display(InformationTree * const information_tree) const = 0;
+
+ virtual void sync() const
+ {
+ }
+
+ virtual void need_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us)
+ {
+ if (! _has_children)
+ {
+ load_children(model, columns, us);
+ _has_children = true;
+ }
+ }
+
+ class DefaultablePointer :
+ public Pointer
+ {
+ public:
+ DefaultablePointer() :
+ Pointer(0)
+ {
+ }
+
+ template <typename T_>
+ DefaultablePointer(T_ v) :
+ Pointer(v)
+ {
+ }
+ };
+ };
+
+ class BrowseTreeColumns :
+ public Gtk::TreeModel::ColumnRecord
+ {
+ public:
+ BrowseTreeColumns();
+ ~BrowseTreeColumns();
+
+ Gtk::TreeModelColumn<Glib::ustring> col_item;
+ Gtk::TreeModelColumn<BrowseTreeDisplayData::DefaultablePointer> col_data;
+ };
+
+ class BrowseTreeDisplayTopData :
+ public BrowseTreeDisplayData
+ {
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns &,
+ Gtk::TreeModel::iterator) const
+ {
+ }
+
+ public:
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_top();
+ }
+ };
+
+ class BrowseTreeDisplayVersionData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ QualifiedPackageName _q;
+ VersionSpec _v;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns &,
+ Gtk::TreeModel::iterator) const
+ {
+ }
+
+ public:
+ BrowseTreeDisplayVersionData(const RepositoryName & r,
+ const QualifiedPackageName q, const VersionSpec & v) :
+ _r(r),
+ _q(q),
+ _v(v)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_version(_r, _q, _v);
+ }
+ };
+
+ class BrowseTreeDisplayPackageData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ QualifiedPackageName _q;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ VersionSpecCollection::ConstPointer vers(repo->version_specs(_q));
+ for (VersionSpecCollection::Iterator ver(vers->begin()), ver_end(vers->end()) ;
+ ver != ver_end ; ++ver)
+ {
+ Gtk::TreeModel::Row ver_row = *(model->append(us->children()));
+ ver_row[columns.col_item] = stringify(*ver);
+ ver_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayVersionData(_r, _q, *ver));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayPackageData(const RepositoryName & r,
+ const QualifiedPackageName q) :
+ _r(r),
+ _q(q)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_package(_r, _q);
+ }
+ };
+
+ class BrowseTreeDisplayCategoryData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ CategoryNamePart _c;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ QualifiedPackageNameCollection::ConstPointer pkgs(repo->package_names(_c));
+ for (QualifiedPackageNameCollection::Iterator pkg(pkgs->begin()), pkg_end(pkgs->end()) ;
+ pkg != pkg_end ; ++pkg)
+ {
+ Gtk::TreeModel::Row pkg_row = *(model->append(us->children()));
+ pkg_row[columns.col_item] = stringify(pkg->package);
+ pkg_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayPackageData(_r, *pkg));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayCategoryData(const RepositoryName & r,
+ const CategoryNamePart c) :
+ _r(r),
+ _c(c)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_category(_r, _c);
+ }
+ };
+
+ class BrowseTreeDisplayRepositoryData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ CategoryNamePartCollection::ConstPointer cats(repo->category_names());
+ for (CategoryNamePartCollection::Iterator cat(cats->begin()), cat_end(cats->end()) ;
+ cat != cat_end ; ++cat)
+ {
+ Gtk::TreeModel::Row cat_row = *(model->append(us->children()));
+ cat_row[columns.col_item] = stringify(*cat);
+ cat_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayCategoryData(_r, *cat));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayRepositoryData(const RepositoryName & r) :
+ _r(r)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_repository(_r);
+ }
+
+ virtual void sync() const
+ {
+ OurSyncTask task;
+ task.add_target(stringify(_r));
+ task.execute();
+ }
+
+ };
+}
+
+BrowseTreeDisplayData::BrowseTreeDisplayData() :
+ _has_children(false)
+{
+}
+
+BrowseTreeDisplayData::~BrowseTreeDisplayData()
+{
+}
+
+
+BrowseTreeColumns::BrowseTreeColumns()
+{
+ add(col_item);
+ add(col_data);
+}
+
+BrowseTreeColumns::~BrowseTreeColumns()
+{
+}
+
+namespace paludis
+{
+ template<>
+ struct Implementation<BrowseTree> :
+ InternalCounted<Implementation<BrowseTree> >
+ {
+ MainWindow * const main_window;
+ InformationTree * const information_tree;
+
+ BrowseTreeColumns columns;
+ Glib::RefPtr<Gtk::TreeStore> model;
+
+ Gtk::Menu popup_menu;
+
+ pid_t paludis_child;
+
+ Implementation(MainWindow * const m, InformationTree * const i) :
+ main_window(m),
+ information_tree(i),
+ paludis_child(-1)
+ {
+ }
+
+ virtual ~Implementation()
+ {
+ }
+ };
+}
+
+BrowseTree::BrowseTree(MainWindow * const main_window,
+ InformationTree * const information_tree) :
+ PrivateImplementationPattern<BrowseTree>(new Implementation<BrowseTree>(
+ main_window, information_tree))
+{
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+ set_model(_imp->model);
+
+ Gtk::TreeModel::Row repositories_row = *(_imp->model->append());
+ repositories_row[_imp->columns.col_item] = "Repositories";
+ repositories_row[_imp->columns.col_data] = BrowseTreeDisplayData::DefaultablePointer(
+ new BrowseTreeDisplayTopData);
+
+ for (PackageDatabase::RepositoryIterator
+ r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
+ r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ;
+ r != r_end ; ++r)
+ {
+ Gtk::TreeModel::Row repository_row = *(_imp->model->append(repositories_row.children()));
+ repository_row[_imp->columns.col_item] = stringify((*r)->name());
+ repository_row[_imp->columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayRepositoryData((*r)->name()));
+ }
+
+ append_column("Item", _imp->columns.col_item);
+ get_selection()->signal_changed().connect(sigc::mem_fun(*this, &BrowseTree::on_changed));
+ Vte::Reaper::get_instance()->signal_child_exited().connect(sigc::mem_fun(*this, &BrowseTree::on_child_process_exited));
+
+ /* popup menu */
+ _imp->popup_menu.items().push_back(Gtk::Menu_Helpers::MenuElem("_Sync",
+ sigc::mem_fun(*this, &BrowseTree::on_menu_sync)));
+ _imp->popup_menu.accelerate(*this);
+}
+
+BrowseTree::~BrowseTree()
+{
+}
+
+void
+BrowseTree::on_changed()
+{
+ Gtk::TreeModel::iterator i(get_selection()->get_selected());
+ if (i)
+ {
+ Gtk::TreeModel::Row row(*i);
+ BrowseTreeDisplayData::Pointer(row[_imp->columns.col_data])->need_children(_imp->model,
+ _imp->columns, i);
+ BrowseTreeDisplayData::Pointer(row[_imp->columns.col_data])->display(
+ _imp->information_tree);
+ }
+}
+
+void
+BrowseTree::on_menu_sync()
+{
+ Glib::RefPtr<Gtk::TreeView::Selection> selection(get_selection());
+ if (selection)
+ {
+ Gtk::TreeModel::iterator i(selection->get_selected());
+ if (i)
+ {
+ _imp->main_window->set_children_sensitive(false);
+
+ pid_t child(fork());
+ if (0 == child)
+ {
+ try
+ {
+ BrowseTreeDisplayData::Pointer((*i)[_imp->columns.col_data])->sync();
+ _exit(0);
+ }
+ catch (const SyncFailedError & e)
+ {
+ _exit(1);
+ }
+ }
+ else if (-1 == child)
+ throw InternalError(PALUDIS_HERE, "fork failed");
+ else
+ {
+ Log::get_instance()->message(ll_debug, lc_no_context,
+ "Forked child process " + stringify(child));
+ _imp->paludis_child = child;
+ Vte::Reaper::get_instance()->add_child(child);
+ }
+ }
+ }
+}
+
+bool
+BrowseTree::on_button_press_event(GdkEventButton * our_event)
+{
+ bool result(TreeView::on_button_press_event(our_event));
+
+ if (our_event->type == GDK_BUTTON_PRESS && our_event->button == 3)
+ _imp->popup_menu.popup(our_event->button, our_event->time);
+
+ return result;
+}
+
+void
+BrowseTree::on_child_process_exited(int, int status)
+{
+ if (-1 == _imp->paludis_child)
+ return;
+
+ if (0 == status)
+ Log::get_instance()->message(ll_debug, lc_no_context, "child " + stringify(_imp->paludis_child)
+ + " exited with success");
+ else
+ Log::get_instance()->message(ll_debug, lc_no_context, "child " + stringify(_imp->paludis_child)
+ + " exited with failure code " + stringify(status));
+
+ _imp->paludis_child = -1;
+ _imp->main_window->set_children_sensitive(true);
+}
+
diff --git a/0.8.0/src/gtkpaludis/browse_tree.hh b/0.8.0/src/gtkpaludis/browse_tree.hh
new file mode 100644
index 0000000..e671792
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/browse_tree.hh
@@ -0,0 +1,47 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_BROWSE_TREE_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_BROWSE_TREE_HH 1
+
+#include <gtkmm/treeview.h>
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+ class InformationTree;
+ class MainWindow;
+
+ class BrowseTree :
+ public Gtk::TreeView,
+ private PrivateImplementationPattern<BrowseTree>
+ {
+ public:
+ BrowseTree(MainWindow * const, InformationTree * const);
+ ~BrowseTree();
+
+ virtual void on_changed();
+ virtual void on_menu_sync();
+
+ virtual bool on_button_press_event(GdkEventButton *);
+ virtual void on_child_process_exited(int, int);
+ };
+}
+
+#endif
diff --git a/0.8.0/src/gtkpaludis/command_line.cc b/0.8.0/src/gtkpaludis/command_line.cc
new file mode 100644
index 0000000..61ae1b4
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/command_line.cc
@@ -0,0 +1,68 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "command_line.hh"
+
+CommandLine::CommandLine() :
+ ArgsHandler(),
+
+ action_args(this, "Actions",
+ "Selects which basic action to perform. Up to one action should "
+ "be specified."),
+ a_version(&action_args, "version", 'V', "Display program version"),
+ a_help(&action_args, "help", 'h', "Display program help"),
+
+ general_args(this, "General options",
+ "Options which are relevant for most or all actions."),
+ a_log_level(&general_args, "log-level", '\0', "Specify the log level",
+ paludis::args::EnumArg::EnumArgOptions("debug", "Show debug output (noisy)")
+ ("qa", "Show QA messages and warnings only")
+ ("warning", "Show warnings only")
+ ("silent", "Suppress all log messages"),
+ "qa"),
+ a_config_suffix(&general_args, "config-suffix", 'c', "Config directory suffix")
+{
+ add_usage_line("[ general options ]");
+ add_usage_line("--version");
+ add_usage_line("--help");
+}
+
+std::string
+CommandLine::app_name() const
+{
+ return "gtkpaludis";
+}
+
+std::string
+CommandLine::app_synopsis() const
+{
+ return "A graphical interface for the other package mangler";
+}
+
+std::string
+CommandLine::app_description() const
+{
+ return
+ "A graphical interface for the paludis package manager.";
+}
+
+CommandLine::~CommandLine()
+{
+}
+
diff --git a/0.8.0/src/gtkpaludis/command_line.hh b/0.8.0/src/gtkpaludis/command_line.hh
new file mode 100644
index 0000000..399eb64
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/command_line.hh
@@ -0,0 +1,98 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_COMMAND_LINE_HH
+#define PALUDIS_GUARD_SRC_COMMAND_LINE_HH 1
+
+#include <paludis/args/args.hh>
+#include <paludis/util/instantiation_policy.hh>
+
+/** \file
+ * Declarations for the CommandLine class.
+ */
+
+/**
+ * Our command line.
+ */
+class CommandLine :
+ public paludis::args::ArgsHandler,
+ public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonAsNeededTag>
+{
+ friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonAsNeededTag>;
+
+ private:
+ /// Constructor.
+ CommandLine();
+
+ /// Destructor.
+ ~CommandLine();
+
+ public:
+ ///\name Program information
+ ///\{
+
+ virtual std::string app_name() const;
+ virtual std::string app_synopsis() const;
+ virtual std::string app_description() const;
+
+ ///\}
+
+ /// \name Action arguments
+ ///\{
+
+ /// Action arguments.
+ paludis::args::ArgsGroup action_args;
+
+ /// --version
+ paludis::args::SwitchArg a_version;
+
+ /// --help
+ paludis::args::SwitchArg a_help;
+
+ ///\}
+
+ /// \name General arguments
+ ///\{
+
+ /// General arguments.
+ paludis::args::ArgsGroup general_args;
+
+ /// --log-level
+ paludis::args::EnumArg a_log_level;
+
+ /// --config-suffix
+ paludis::args::StringArg a_config_suffix;
+
+ ///\}
+};
+
+/**
+ * Show the help message.
+ */
+struct DoHelp
+{
+ const std::string message;
+
+ DoHelp(const std::string & m = "") :
+ message(m)
+ {
+ }
+};
+
+#endif
diff --git a/0.8.0/src/gtkpaludis/gtkpaludis.cc b/0.8.0/src/gtkpaludis/gtkpaludis.cc
new file mode 100644
index 0000000..f5e1f93
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/gtkpaludis.cc
@@ -0,0 +1,292 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/environment/default/default_config.hh>
+#include <paludis/util/log.hh>
+
+#include <libebt/libebt_version.hh>
+
+#include <libwrapiter/libwrapiter_version.hh>
+
+#include <gtkmm/main.h>
+#include <gtkmm/messagedialog.h>
+
+#include <iostream>
+
+#include "command_line.hh"
+#include "main_window.hh"
+
+using namespace paludis;
+using std::cout;
+using std::cerr;
+using std::endl;
+
+namespace
+{
+ struct DoVersion
+ {
+ };
+
+ struct GtkInitFailed : Exception
+ {
+ GtkInitFailed() :
+ Exception ("Couldn't initialize gtk")
+ {
+ }
+ };
+
+ class TryMain : public Gtk::Main
+ {
+ static bool _gtkmm_initialized;
+
+ public:
+ TryMain(int& argc, char**& argv) :
+ Gtk::Main()
+ {
+ _gtkmm_initialized = gtk_init_check(&argc, &argv);
+ }
+
+ bool initialized() const
+ {
+ return _gtkmm_initialized;
+ }
+
+ static void run(Gtk::Window& window)
+ {
+ if (! _gtkmm_initialized)
+ throw GtkInitFailed();
+
+ Gtk::Main::run(window);
+ }
+
+ static void run()
+ {
+ if (! _gtkmm_initialized)
+ throw GtkInitFailed();
+
+ Gtk::Main::run();
+ }
+ };
+
+
+ bool TryMain::_gtkmm_initialized;
+
+ void display_version()
+ {
+ cout << "gtkpaludis " << PALUDIS_VERSION_MAJOR << "."
+ << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO;
+ if (! std::string(PALUDIS_SUBVERSION_REVISION).empty())
+ cout << " svn " << PALUDIS_SUBVERSION_REVISION;
+ cout << endl << endl;
+ cout << "Built by " << PALUDIS_BUILD_USER << "@" << PALUDIS_BUILD_HOST
+ << " on " << PALUDIS_BUILD_DATE << endl;
+ cout << "CXX: " << PALUDIS_BUILD_CXX
+#if defined(__ICC)
+ << " " << __ICC
+#elif defined(__VERSION__)
+ << " " << __VERSION__
+#endif
+ << endl;
+ cout << "CXXFLAGS: " << PALUDIS_BUILD_CXXFLAGS << endl;
+ cout << "LDFLAGS: " << PALUDIS_BUILD_LDFLAGS << endl;
+ cout << "SYSCONFDIR: " << SYSCONFDIR << endl;
+ cout << "LIBEXECDIR: " << LIBEXECDIR << endl;
+ cout << "stdlib: "
+#if defined(__GLIBCXX__)
+# define XSTRINGIFY(x) #x
+# define STRINGIFY(x) XSTRINGIFY(x)
+ << "GNU libstdc++ " << STRINGIFY(__GLIBCXX__)
+#endif
+ << endl;
+
+ cout << "libebt: " << LIBEBT_VERSION_MAJOR << "." << LIBEBT_VERSION_MINOR
+ << "." << LIBEBT_VERSION_MICRO << endl;
+ cout << "libwrapiter: " << LIBWRAPITER_VERSION_MAJOR << "." << LIBWRAPITER_VERSION_MINOR
+ << "." << LIBWRAPITER_VERSION_MICRO << endl;
+#if HAVE_SANDBOX
+ cout << "sandbox: enabled" << endl;
+#else
+ cout << "sandbox: disabled" << endl;
+#endif
+ }
+}
+
+int
+main(int argc, char * argv[])
+{
+
+ Context context("In main program:");
+
+ TryMain gui_kit(argc, argv);
+
+ try
+ {
+ {
+ Context context_local("When handling command line:");
+ CommandLine::get_instance()->run(argc, argv);
+
+ if (CommandLine::get_instance()->a_help.specified())
+ throw DoHelp();
+
+ if (CommandLine::get_instance()->a_version.specified())
+ throw DoVersion();
+
+ if (! CommandLine::get_instance()->a_log_level.specified())
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "debug")
+ Log::get_instance()->set_log_level(ll_debug);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "qa")
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "warning")
+ Log::get_instance()->set_log_level(ll_warning);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "silent")
+ Log::get_instance()->set_log_level(ll_silent);
+ else
+ throw DoHelp("bad value for --log-level");
+ }
+
+ {
+ Context context_local("When loading configuration:");
+
+ std::string paludis_command(argv[0]);
+ std::string::size_type last_slash(paludis_command.rfind('/'));
+ if (std::string::npos == last_slash)
+ last_slash = 0;
+ if (0 == paludis_command.compare(last_slash, 3, "gtk"))
+ paludis_command.erase(last_slash, 3);
+
+ if (CommandLine::get_instance()->a_config_suffix.specified())
+ {
+ DefaultConfig::set_config_suffix(CommandLine::get_instance()->a_config_suffix.argument());
+ paludis_command.append(" --config-suffix " +
+ CommandLine::get_instance()->a_config_suffix.argument());
+ }
+
+ paludis_command.append(" --log-level " + CommandLine::get_instance()->a_log_level.argument());
+ DefaultConfig::get_instance()->set_paludis_command(paludis_command);
+ }
+
+ {
+ Context context_local("When displaying main window:");
+
+ if (! gui_kit.initialized())
+ throw GtkInitFailed();
+
+ TryMain::run(*MainWindow::get_instance());
+ }
+ }
+ catch (const DoVersion &)
+ {
+ display_version();
+ cout << endl;
+ cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
+ cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
+ cout << "License, version 2." << endl;
+
+ return EXIT_SUCCESS;
+ }
+ catch (const paludis::args::ArgsError & e)
+ {
+ cerr << "Usage error: " << e.message() << endl;
+ cerr << "Try " << argv[0] << " --help" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const DoHelp & h)
+ {
+ if (h.message.empty())
+ {
+ cout << "Usage: " << argv[0] << " [options]" << endl;
+ cout << endl;
+ cout << *CommandLine::get_instance();
+ return EXIT_SUCCESS;
+ }
+ else
+ {
+ cerr << "Usage error: " << h.message << endl;
+ cerr << "Try " << argv[0] << " --help" << endl;
+ return EXIT_FAILURE;
+ }
+ }
+ catch (GtkInitFailed & e)
+ {
+ cout << endl;
+ cerr << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")\n" << endl;
+
+ cerr << "Try adjust DISPLAY environment variable or pass --display option\n" << endl;
+
+ return EXIT_FAILURE;
+ }
+ catch (const Exception & e)
+ {
+ if (gui_kit.initialized())
+ {
+ Gtk::Main::init_gtkmm_internals();
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text(
+ "- " + e.backtrace("\n- ") + e.message() + " (" + e.what() + ")");
+ dialog.run();
+ }
+ else
+ {
+ cout << endl;
+ cerr << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ }
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ if (gui_kit.initialized())
+ {
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text("Unhandled exception (" + stringify(e.what()) + ")");
+ dialog.run();
+ }
+ else
+ {
+ cout << endl;
+ cerr << "Unhandled exception:" << endl
+ << " * " << e.what() << endl;
+ }
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
+ if (gui_kit.initialized())
+ {
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text("Unhandled exception (unknown type)");
+ dialog.run();
+ }
+ else
+ { cout << endl;
+ cerr << "Unhandled exception:" << endl
+ << " * Unknown exception type. Ouch..." << endl;
+ }
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/0.8.0/src/gtkpaludis/information_tree.cc b/0.8.0/src/gtkpaludis/information_tree.cc
new file mode 100644
index 0000000..022be1c
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/information_tree.cc
@@ -0,0 +1,161 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "information_tree.hh"
+#include <gtkmm/treestore.h>
+#include <paludis/environment/default/default_environment.hh>
+
+using namespace paludis;
+
+InformationTreeColumns::InformationTreeColumns()
+{
+ add(col_key);
+ add(col_value);
+}
+
+InformationTreeColumns::~InformationTreeColumns()
+{
+}
+
+namespace paludis
+{
+ template<>
+ struct Implementation<InformationTree> :
+ InternalCounted<Implementation<InformationTree> >
+ {
+ InformationTreeColumns columns;
+ Glib::RefPtr<Gtk::TreeStore> model;
+ };
+}
+
+InformationTree::InformationTree() :
+ PrivateImplementationPattern<InformationTree>(new Implementation<InformationTree>)
+{
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+ set_model(_imp->model);
+
+ append_column("Key", _imp->columns.col_key);
+ append_column("Value", _imp->columns.col_value);
+}
+
+InformationTree::~InformationTree()
+{
+}
+
+void
+InformationTree::show_top()
+{
+ set_model(Glib::RefPtr<Gtk::TreeStore>(0));
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+
+ set_model(_imp->model);
+}
+
+void
+InformationTree::show_repository(const RepositoryName & r)
+{
+ Repository::ConstPointer repo(DefaultEnvironment::get_instance()->package_database()->fetch_repository(r));
+
+ set_model(Glib::RefPtr<Gtk::TreeStore>(0));
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+
+ Gtk::TreeModel::Row name_row(*(_imp->model->append()));
+ name_row[_imp->columns.col_key] = "name";
+ name_row[_imp->columns.col_value] = stringify(repo->name());
+
+ RepositoryInfo::ConstPointer info(repo->info(false));
+ for (RepositoryInfo::SectionIterator section(info->begin_sections()),
+ section_end(info->end_sections()) ; section != section_end ; ++section)
+ {
+ Gtk::TreeModel::Row section_row(*(_imp->model->append()));
+ section_row[_imp->columns.col_key] = (*section)->heading();
+
+ for (RepositoryInfoSection::KeyValueIterator kv((*section)->begin_kvs()),
+ kv_end((*section)->end_kvs()) ; kv != kv_end ; ++kv)
+ {
+ Gtk::TreeModel::Row kv_row(*(_imp->model->append(section_row.children())));
+ kv_row[_imp->columns.col_key] = kv->first;
+ kv_row[_imp->columns.col_value] = kv->second;
+ }
+ }
+
+ set_model(_imp->model);
+}
+
+void
+InformationTree::show_category(const RepositoryName & r, const CategoryNamePart & c)
+{
+ Repository::ConstPointer repo(DefaultEnvironment::get_instance()->package_database()->fetch_repository(r));
+
+ set_model(Glib::RefPtr<Gtk::TreeStore>(0));
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+
+ Gtk::TreeModel::Row name_row(*(_imp->model->append()));
+ name_row[_imp->columns.col_key] = "name";
+ name_row[_imp->columns.col_value] = stringify(c);
+
+ set_model(_imp->model);
+}
+
+void
+InformationTree::show_package(const RepositoryName & r, const QualifiedPackageName & q)
+{
+ Repository::ConstPointer repo(DefaultEnvironment::get_instance()->package_database()->fetch_repository(r));
+
+ set_model(Glib::RefPtr<Gtk::TreeStore>(0));
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+
+ Gtk::TreeModel::Row name_row(*(_imp->model->append()));
+ name_row[_imp->columns.col_key] = "name";
+ name_row[_imp->columns.col_value] = stringify(q);
+
+ set_model(_imp->model);
+}
+
+
+void
+InformationTree::show_version(const RepositoryName & r, const QualifiedPackageName & q,
+ const VersionSpec & v)
+{
+ Repository::ConstPointer repo(DefaultEnvironment::get_instance()->package_database()->fetch_repository(r));
+
+ set_model(Glib::RefPtr<Gtk::TreeStore>(0));
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+
+ Gtk::TreeModel::Row name_row(*(_imp->model->append()));
+ name_row[_imp->columns.col_key] = "name";
+ name_row[_imp->columns.col_value] = stringify(q);
+
+ Gtk::TreeModel::Row version_row(*(_imp->model->append()));
+ version_row[_imp->columns.col_key] = "version";
+ version_row[_imp->columns.col_value] = stringify(v);
+
+ VersionMetadata::ConstPointer metadata(repo->version_metadata(q, v));
+
+ Gtk::TreeModel::Row description_row(*(_imp->model->append()));
+ description_row[_imp->columns.col_key] = "description";
+ description_row[_imp->columns.col_value] = metadata->description;
+
+ Gtk::TreeModel::Row homepage_row(*(_imp->model->append()));
+ description_row[_imp->columns.col_key] = "homepage";
+ description_row[_imp->columns.col_value] = metadata->homepage;
+
+ set_model(_imp->model);
+}
+
diff --git a/0.8.0/src/gtkpaludis/information_tree.hh b/0.8.0/src/gtkpaludis/information_tree.hh
new file mode 100644
index 0000000..224c24e
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/information_tree.hh
@@ -0,0 +1,58 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_INFORMATION_TREE_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_INFORMATION_TREE_HH 1
+
+#include <gtkmm/treeview.h>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
+
+namespace paludis
+{
+ class InformationTreeColumns :
+ public Gtk::TreeModel::ColumnRecord
+ {
+ public:
+ InformationTreeColumns();
+ ~InformationTreeColumns();
+
+ Gtk::TreeModelColumn<Glib::ustring> col_key;
+ Gtk::TreeModelColumn<Glib::ustring> col_value;
+ };
+
+ class InformationTree :
+ public Gtk::TreeView,
+ private PrivateImplementationPattern<InformationTree>
+ {
+ public:
+ InformationTree();
+ ~InformationTree();
+
+ void show_top();
+ void show_repository(const RepositoryName &);
+ void show_category(const RepositoryName &, const CategoryNamePart &);
+ void show_package(const RepositoryName &, const QualifiedPackageName &);
+ void show_version(const RepositoryName &, const QualifiedPackageName &,
+ const VersionSpec &);
+ };
+}
+
+#endif
diff --git a/0.8.0/src/gtkpaludis/main_window.cc b/0.8.0/src/gtkpaludis/main_window.cc
new file mode 100644
index 0000000..1506650
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/main_window.cc
@@ -0,0 +1,139 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "main_window.hh"
+#include "browse_tree.hh"
+#include "information_tree.hh"
+#include "vte_message_window.hh"
+
+#include <paludis/about.hh>
+#include <paludis/util/stringify.hh>
+
+#include <gtkmm/box.h>
+#include <gtkmm/button.h>
+#include <gtkmm/entry.h>
+#include <gtkmm/frame.h>
+#include <gtkmm/label.h>
+#include <gtkmm/paned.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/stock.h>
+#include <gtkmm/textview.h>
+
+using namespace paludis;
+
+namespace paludis
+{
+ template<>
+ struct Implementation<MainWindow> :
+ InternalCounted<MainWindow>
+ {
+ Gtk::VBox main_container;
+
+ Gtk::HBox search_container;
+ Gtk::Label search_label;
+ Gtk::Entry search_box;
+ Gtk::Button search_button;
+
+ Gtk::VPaned browse_information_messages_pane;
+ Gtk::HPaned browse_information_pane;
+
+ Gtk::Frame information_frame;
+ Gtk::ScrolledWindow information_window;
+ InformationTree information_tree;
+
+ Gtk::Frame browse_frame;
+ Gtk::ScrolledWindow browse_window;
+ BrowseTree browse_tree;
+
+ Gtk::Frame messages_frame;
+ Gtk::ScrolledWindow messages_window;
+ VteMessageWindow vte_messages;
+
+ Implementation(MainWindow * const main_window);
+ };
+}
+
+Implementation<MainWindow>::Implementation(MainWindow * const main_window) :
+ main_container(false, 5),
+ search_container(false, 5),
+ search_label(" Search: "),
+ search_button(Gtk::Stock::FIND),
+ information_frame(" Information: "),
+ browse_frame(" Browse: "),
+ browse_tree(main_window, &information_tree),
+ messages_frame(" Messages: ")
+{
+}
+
+MainWindow::MainWindow() :
+ PrivateImplementationPattern<MainWindow>(new Implementation<MainWindow>(this))
+{
+ set_title("gtkPaludis " + stringify(PALUDIS_VERSION_MAJOR) + "." +
+ stringify(PALUDIS_VERSION_MINOR) + "." +
+ stringify(PALUDIS_VERSION_MICRO));
+
+ set_default_size(600, 400);
+ set_border_width(5);
+
+ add(_imp->main_container);
+
+ _imp->main_container.pack_start(_imp->search_container, Gtk::PACK_SHRINK);
+ _imp->main_container.pack_end(_imp->browse_information_messages_pane, Gtk::PACK_EXPAND_WIDGET);
+
+ _imp->search_container.pack_start(_imp->search_label, Gtk::PACK_SHRINK);
+ _imp->search_container.pack_start(_imp->search_box);
+ _imp->search_container.pack_end(_imp->search_button, Gtk::PACK_SHRINK);
+
+ _imp->browse_information_messages_pane.pack1(_imp->browse_information_pane);
+ _imp->browse_information_messages_pane.pack2(_imp->messages_frame);
+
+ _imp->browse_information_pane.pack1(_imp->browse_frame);
+ _imp->browse_information_pane.pack2(_imp->information_frame);
+
+ _imp->browse_frame.add(_imp->browse_window);
+ _imp->browse_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+ _imp->browse_window.set_border_width(5);
+ _imp->browse_window.add(_imp->browse_tree);
+
+ _imp->information_frame.add(_imp->information_window);
+ _imp->information_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+ _imp->information_window.set_border_width(5);
+ _imp->information_window.add(_imp->information_tree);
+
+ _imp->messages_frame.add(_imp->messages_window);
+ _imp->messages_window.set_border_width(5);
+ _imp->messages_window.add(_imp->vte_messages);
+ _imp->messages_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+
+ show_all_children();
+}
+
+MainWindow::~MainWindow()
+{
+}
+
+void
+MainWindow::set_children_sensitive(bool value)
+{
+ _imp->browse_tree.set_sensitive(value);
+ _imp->information_tree.set_sensitive(value);
+ _imp->search_box.set_sensitive(value);
+ _imp->search_button.set_sensitive(value);
+}
+
diff --git a/0.8.0/src/gtkpaludis/main_window.hh b/0.8.0/src/gtkpaludis/main_window.hh
new file mode 100644
index 0000000..6024075
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/main_window.hh
@@ -0,0 +1,45 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_MAIN_WINDOW_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_MAIN_WINDOW_HH 1
+
+#include <gtkmm/window.h>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/instantiation_policy.hh>
+
+namespace paludis
+{
+ class MainWindow :
+ public Gtk::Window,
+ private PrivateImplementationPattern<MainWindow>,
+ public InstantiationPolicy<MainWindow, instantiation_method::SingletonAsNeededTag>
+ {
+ friend class InstantiationPolicy<MainWindow, instantiation_method::SingletonAsNeededTag>;
+
+ private:
+ MainWindow();
+ virtual ~MainWindow();
+
+ public:
+ void set_children_sensitive(bool value);
+ };
+}
+
+#endif
diff --git a/0.8.0/src/gtkpaludis/message_window.cc b/0.8.0/src/gtkpaludis/message_window.cc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/message_window.cc
diff --git a/0.8.0/src/gtkpaludis/message_window.hh b/0.8.0/src/gtkpaludis/message_window.hh
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/message_window.hh
diff --git a/0.8.0/src/gtkpaludis/sync.cc b/0.8.0/src/gtkpaludis/sync.cc
new file mode 100644
index 0000000..ef2a133
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/sync.cc
@@ -0,0 +1,100 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "sync.hh"
+#include "main_window.hh"
+
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/util/log.hh>
+#include <paludis/syncer.hh>
+
+#include <list>
+
+using namespace paludis;
+
+namespace paludis
+{
+ template<>
+ struct Implementation<OurSyncTask> :
+ InternalCounted<Implementation<OurSyncTask> >
+ {
+ std::list<std::string> failed_repositories;
+ };
+}
+
+OurSyncTask::OurSyncTask() :
+ SyncTask(DefaultEnvironment::get_instance()),
+ PrivateImplementationPattern<OurSyncTask>(new Implementation<OurSyncTask>)
+{
+}
+
+OurSyncTask::~OurSyncTask()
+{
+}
+
+void
+OurSyncTask::on_sync_all_pre()
+{
+}
+
+void
+OurSyncTask::on_sync_pre(const RepositoryName &)
+{
+}
+
+void
+OurSyncTask::on_sync_post(const RepositoryName &)
+{
+}
+
+void
+OurSyncTask::on_sync_skip(const RepositoryName &)
+{
+}
+
+void
+OurSyncTask::on_sync_succeed(const RepositoryName &)
+{
+}
+
+void
+OurSyncTask::on_sync_fail(const RepositoryName & r, const SyncFailedError &)
+{
+ Log::get_instance()->message(ll_warning, lc_no_context, "Sync of repository '"
+ + stringify(r) + "' failed");
+ PrivateImplementationPattern<OurSyncTask>::_imp->failed_repositories.push_back(stringify(r));
+}
+
+void
+OurSyncTask::on_sync_all_post()
+{
+}
+
+OurSyncTask::FailedIterator
+OurSyncTask::begin_failed() const
+{
+ return FailedIterator(PrivateImplementationPattern<OurSyncTask>::_imp->failed_repositories.begin());
+}
+
+OurSyncTask::FailedIterator
+OurSyncTask::end_failed() const
+{
+ return FailedIterator(PrivateImplementationPattern<OurSyncTask>::_imp->failed_repositories.end());
+}
+
diff --git a/0.8.0/src/gtkpaludis/sync.hh b/0.8.0/src/gtkpaludis/sync.hh
new file mode 100644
index 0000000..600b662
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/sync.hh
@@ -0,0 +1,50 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_SYNC_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_SYNC_HH 1
+
+#include <paludis/tasks/sync_task.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+ class OurSyncTask :
+ public SyncTask,
+ private PrivateImplementationPattern<OurSyncTask>
+ {
+ public:
+ OurSyncTask();
+ ~OurSyncTask();
+
+ virtual void on_sync_all_pre();
+ virtual void on_sync_pre(const RepositoryName &);
+ virtual void on_sync_post(const RepositoryName &);
+ virtual void on_sync_skip(const RepositoryName &);
+ virtual void on_sync_fail(const RepositoryName &, const SyncFailedError &);
+ virtual void on_sync_succeed(const RepositoryName &);
+ virtual void on_sync_all_post();
+
+ typedef libwrapiter::ForwardIterator<OurSyncTask, const std::string> FailedIterator;
+ FailedIterator begin_failed() const;
+ FailedIterator end_failed() const;
+ };
+}
+
+#endif
diff --git a/0.8.0/src/gtkpaludis/vte_message_window.cc b/0.8.0/src/gtkpaludis/vte_message_window.cc
new file mode 100644
index 0000000..e6f8a52
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vte_message_window.cc
@@ -0,0 +1,136 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 "vte_message_window.hh"
+#include <paludis/util/fd_output_stream.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/exception.hh>
+
+//#ifndef _XOPEN_SOURCE
+//#define _XOPEN_SOURCE don't know why vte.h has this defined
+//#endif
+
+#include <cstdlib>
+#include <fcntl.h>
+#include <iostream>
+
+namespace
+{
+ class Pty /* this one should propably go to libpaludisutil */
+ {
+ int _master_fd;
+ int _slave_fd;
+ public:
+ Pty(bool controlling_terminal);
+ ~Pty();
+
+ int master_fd() const;
+ int slave_fd() const;
+ };
+
+ Pty::Pty(bool controlling_terminal) :
+ _master_fd(posix_openpt(O_RDWR | (controlling_terminal ? 0 : O_NOCTTY)))
+ {
+ if (0 > _master_fd)
+ throw paludis::InternalError(PALUDIS_HERE, "posix_openpt failed");
+
+ char *slave_name(ptsname(_master_fd));
+
+ try
+ {
+ if (0 == slave_name)
+ throw paludis::InternalError(PALUDIS_HERE, "ptsname failed");
+
+ if (0 > grantpt(_master_fd)) /* TODO: this one needs something special from user co */
+ throw paludis::InternalError(PALUDIS_HERE, "grantpt failed");
+
+ if (0 > unlockpt(_master_fd))
+ throw paludis::InternalError(PALUDIS_HERE, "unlockpt failed");
+
+ if (-1 == (_slave_fd = open(slave_name, O_RDWR)))
+ throw paludis::InternalError(PALUDIS_HERE, "open slave terminal failed");
+ }
+ catch (...)
+ {
+ close(_master_fd);
+ throw;
+ }
+ }
+
+ Pty::~Pty()
+ {
+ close(_master_fd);
+ close(_slave_fd);
+ }
+
+ int Pty::master_fd() const
+ {
+ return _master_fd;
+ }
+
+ int Pty::slave_fd() const
+ {
+ return _slave_fd;
+ }
+
+} /* anonymous namespace */
+
+namespace paludis
+{
+ template <>
+ struct Implementation<VteMessageWindow> :
+ public InternalCounted<Implementation<VteMessageWindow> >
+ {
+ VteMessageWindow * const owner;
+ Pty pty;
+ FDOutputStream stream;
+
+ Implementation(VteMessageWindow *o);
+
+ };
+
+ Implementation<VteMessageWindow>::Implementation(VteMessageWindow* o) :
+ InternalCounted<Implementation<VteMessageWindow> >(),
+ owner(o),
+ pty(false),
+ stream(pty.slave_fd())
+ {
+ set_run_command_stdout_fds(pty.slave_fd(), pty.master_fd());
+ set_run_command_stderr_fds(pty.slave_fd(), pty.master_fd());
+
+ Log::get_instance()->set_log_stream(&stream);
+ Log::get_instance()->message(ll_debug, lc_no_context, "Message window initialized");
+ }
+
+
+ VteMessageWindow::VteMessageWindow() :
+ Vte::Terminal(),
+ PrivateImplementationPattern<VteMessageWindow>(new Implementation<VteMessageWindow>(this))
+ {
+ set_pty(dup(_imp->pty.master_fd()));
+ }
+
+ VteMessageWindow::~VteMessageWindow()
+ {
+ Log::get_instance()->set_log_stream(&std::cerr);
+ }
+
+} /* namespace paludis */
+
diff --git a/0.8.0/src/gtkpaludis/vte_message_window.hh b/0.8.0/src/gtkpaludis/vte_message_window.hh
new file mode 100644
index 0000000..35ee725
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vte_message_window.hh
@@ -0,0 +1,82 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW 1
+
+#include "vtemm/terminal_widget.hh"
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+
+ class VteMessageWindow :
+ public Vte::Terminal,
+ public paludis::PrivateImplementationPattern<VteMessageWindow>
+ {
+ public:
+ VteMessageWindow();
+ ~VteMessageWindow();
+ };
+}
+
+#endif /* PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW */
+
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW 1
+
+#include "terminal_widget.hh"
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+
+ class VteMessageWindow :
+ public Vte::Terminal,
+ public paludis::PrivateImplementationPattern<VteMessageWindow>
+ {
+ public:
+ VteMessageWindow();
+ ~VteMessageWindow();
+ };
+}
+
+#endif /* PALUDIS_GUARD_SRC_GTKPALUDIS_VTE_MESSAGE_WINDOW */
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/Makefile.am b/0.8.0/src/gtkpaludis/vtemm/Makefile.am
new file mode 100644
index 0000000..f516398
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/Makefile.am
@@ -0,0 +1,73 @@
+EXTRA_DIST = \
+ terminal_widget.hg terminal_widget.ccg \
+ reaper.hg reaper.ccg
+
+AM_CXXFLAGS = -I$(top_srcdir) \
+ @PALUDIS_CXXFLAGS@ \
+ @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
+ @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
+ @PALUDIS_CXXFLAGS_NO_WSHADOW@
+
+DEFS = \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DGLIBMM_EXCEPTIONS_ENABLED=1
+
+vte_generated_sources = \
+ terminal_widget.cc terminal_widget.hh private/terminal_widget_p.hh \
+ reaper.cc reaper.hh private/reaper_p.hh
+
+SUBDIRS = defs converts .
+
+if ENABLE_GTK
+
+BUILT_SOURCES = terminal_widget.hh reaper.hh $(vte_generated_sources)
+
+# automake is rather weird on this one...
+automake-deps-hack.tmp :
+ $(MAKE) -C defs
+ touch $@
+
+terminal_widget.hh terminal_widget.cc : terminal_widget.hg terminal_widget.ccg automake-deps-hack.tmp
+ mkdir -p private
+ @GMMPROC@ --unwrapped -I converts --defs defs terminal_widget . .
+ sed -e 's@/\* vim: set @/* vim: set ro @' < ./terminal_widget.h > ./terminal_widget.hh
+ rm terminal_widget.h
+ mv ./terminal_widget.cc ./terminal_widget.cc.tmp
+ sed \
+ -e 's@#include <vtemm/terminal_widget.h>@#include "terminal_widget.hh"@' \
+ -e 's@#include <vtemm/private/terminal_widget_p.h>@#include "private/terminal_widget_p.hh"@' \
+ -e 's@/\* vim: set @/* vim: set ro @' \
+ < ./terminal_widget.cc.tmp > ./terminal_widget.cc
+ rm ./terminal_widget.cc.tmp
+ mv ./private/terminal_widget_p.h ./private/terminal_widget_p.hh
+
+reaper.hh reaper.cc : reaper.hg reaper.ccg automake-deps-hack.tmp
+ mkdir -p private
+ @GMMPROC@ --unwrapped -I converts --defs defs reaper . .
+ sed -e 's@/\* vim: set @/* vim: set ro @' < ./reaper.h > ./reaper.hh
+ rm reaper.h
+ mv ./reaper.cc ./reaper.cc.tmp
+ sed \
+ -e 's@#include <vtemm/reaper.h>@#include "reaper.hh"@' \
+ -e 's@#include <vtemm/private/reaper_p.h>@#include "private/reaper_p.hh"@' \
+ -e 's@/\* vim: set @/* vim: set ro @' \
+ < ./reaper.cc.tmp > ./reaper.cc
+ rm ./reaper.cc.tmp
+ mv ./private/reaper_p.h ./private/reaper_p.hh
+
+noinst_LIBRARIES = libvtemm.a
+
+nodist_libvtemm_a_SOURCES = \
+ $(vte_generated_sources)
+
+INCLUDES = $(GTKDEPS_CFLAGS)
+
+clean-local :
+ rm -fr private || true
+
+endif
+
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda $(vte_generated_sources) automake-deps-hack.tmp
+MAINTAINERCLEANFILES = Makefile.in
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/converts/Makefile.am b/0.8.0/src/gtkpaludis/vtemm/converts/Makefile.am
new file mode 100644
index 0000000..d9fa379
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/converts/Makefile.am
@@ -0,0 +1,6 @@
+noinst_DATA = convert.m4 convert_base.m4
+CLEANFILES = *~
+MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = $(noinst_DATA)
+
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/converts/convert.m4 b/0.8.0/src/gtkpaludis/vtemm/converts/convert.m4
new file mode 100644
index 0000000..319807e
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/converts/convert.m4
@@ -0,0 +1,30 @@
+dnl $Id: convert.m4,v 1.1.1.1 2003/01/21 13:41:24 murrayc Exp $
+
+# Other libraries, such as libgnomeuimm, can provide their own convert.m4 files,
+# Maybe choosing to include the same files as this one.
+
+include(convert_gtkmm.m4)
+
+_CONV_ENUM(Vte,TerminalEraseBinding)
+_CONV_ENUM(Vte,TerminalAntiAlias)
+
+_EQUAL(glong, long)
+_EQUAL(guint, unsigned)
+
+_CONVERSION(int&, int*, &($3))
+_CONVERSION(long&, glong*, &($3))
+_CONVERSION(return-char*, char*, ($3))
+
+# Gtk conversions
+_CONVERSION(const Gtk::MenuShell&, GtkMenuShell*, (const_cast<Gtk::MenuShell&>($3)).gobj())
+
+# Gdk conversions
+_CONVERSION(const Gdk::Color&, const GdkColor*, ($3).gobj())
+_CONVERSION(Gdk::Color&, GdkColor*, ($3).gobj())
+_CONVERSION(Gdk::Cursor&, GdkCursor*, ($3).gobj())
+
+# Pango conversions
+_CONVERSION(const Pango::FontDescription&, const PangoFontDescription*, ($3).gobj())
+_CONVERSION(const PangoFontDescription*, const Pango::FontDescription, Glib::wrap(const_cast<PangoFontDescription*>(($3)), true))
+
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/converts/convert_base.m4 b/0.8.0/src/gtkpaludis/vtemm/converts/convert_base.m4
new file mode 100644
index 0000000..feaf583
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/converts/convert_base.m4
@@ -0,0 +1,69 @@
+dnl $Id: convert_base.m4,v 1.1.1.1 2003/01/21 13:41:24 murrayc Exp $
+
+#
+# Define a hashing for names
+#
+define(`__HASH',`__`'m4_translit(`$*',`ABCDEFGHIJKLMNOPQRSTUVWXYZ<>[]&*, ',`abcdefghijklmnopqrstuvwxyzVBNMRSC_')`'')
+define(`__EQUIV',`m4_ifdef(EV`'__HASH(`$1'),EV`'__HASH(`$1'),`$1')')
+
+define(`__HASH2',`dnl
+pushdef(`__E1',__EQUIV(`$1'))pushdef(`__E2',__EQUIV(`$2'))dnl
+m4_ifelse(__E1,__E2,`__EQ',__HASH(__E1)`'__HASH(__E2))`'dnl
+popdef(`__E1')popdef(`__E2')`'')
+
+define(`CF__EQ',`$3')
+
+#
+# _CONVERT(ctype, cpptype, name, wrap_line)
+# Print the conversion from ctype to cpptype
+define(`_CONVERT',`dnl
+pushdef(`__COV',`CF`'__HASH2(`$1',`$2')')dnl
+m4_ifdef(__COV,`m4_indir(__COV,`$1',`$2',`$3')',`
+m4_errprint(`No conversion from $1 to $2 defined (line: $4, parameter name: $3)
+')
+m4_m4exit(1)
+')`'dnl
+')
+
+
+#
+# Functions for populating the tables.
+#
+define(`_CONVERSION',`
+m4_ifelse(`$3',,,`define(CF`'__HASH2(`$1',`$2'),`$3')')
+')
+
+define(`_EQUAL',`define(EV`'__HASH(`$1'),`$2')')
+
+/*******************************************************************/
+
+
+define(`__ARG3__',`$`'3')
+define(`_CONV_ENUM',`dnl
+_CONVERSION(`$1$2', `$2', (($2)(__ARG3__)))
+_CONVERSION(`$1$2', `$1::$2', (($1::$2)(__ARG3__)))
+_CONVERSION(`$2', `$1$2', (($1$2)(__ARG3__)))
+_CONVERSION(`$1::$2', `$1$2', (($1$2)(__ARG3__)))
+')dnl
+
+# e.g. Glib::RefPtr<Gdk::Something> to GdkSomething*
+define(`__CONVERT_REFPTR_TO_P',`Glib::unwrap($`'3)')
+
+# e.g. Glib::RefPtr<const Gdk::Something> to GdkSomething*
+#define(`__CONVERT_CONST_REFPTR_TO_P',`const_cast<$`'2>($`'3->gobj())')
+define(`__CONVERT_CONST_REFPTR_TO_P',`const_cast<$`'2>(Glib::unwrap($`'3))')
+
+# The Sun Forte compiler doesn't seem to be able to handle these, so we are using the altlernative, __CONVERT_CONST_REFPTR_TO_P_SUN.
+# The Sun compiler gives this error, for instance:
+#  "widget.cc", line 4463: Error: Overloading ambiguity between "Glib::unwrap<Gdk::Window>(const Glib::RefPtr<const Gdk::Window>&)" and
+# "Glib::unwrap<const Gdk::Window>(const Glib::RefPtr<const Gdk::Window>&)".
+#
+define(`__CONVERT_CONST_REFPTR_TO_P_SUN',`const_cast<$`'2>(Glib::unwrap<$1>($`'3))')
+
+
+include(convert_gtk.m4)
+include(convert_pango.m4)
+include(convert_gdk.m4)
+include(convert_atk.m4)
+include(convert_glib.m4)
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/defs/Makefile.am b/0.8.0/src/gtkpaludis/vtemm/defs/Makefile.am
new file mode 100644
index 0000000..7fa3843
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/defs/Makefile.am
@@ -0,0 +1,51 @@
+vte_defs_included = \
+ vte_methods.defs \
+ vte_vfuncs.defs \
+ vte_enums.defs \
+ vte_signals.defs
+
+vte_defs = \
+ $(vte_defs_included) \
+ vte.defs
+
+if ENABLE_GTK
+
+noinst_DATA = $(vte_defs)
+noinst_PROGRAMS = force_automake_to_include_cxxcompile
+
+endif
+
+INCLUDES = $(GTKDEPS_CFLAGS)
+
+force_automake_to_include_cxxcompile_SOURCES = force_automake_to_include_cxxcompile.cc
+
+force_automake_to_include_cxxcompile.cc :
+ echo 'int main(int, char *[]) { }' > $@
+
+generate_defs_vte : generate_defs_vte.cc
+ $(CXXCOMPILE) $(GTKDEPS_LIBS) -lglibmm_generate_extra_defs-2.4 -o $@ $<
+
+CLEANFILES = *~ force_automake_to_include_cxxcompile.cc generate_defs_vte
+MAINTAINERCLEANFILES = Makefile.in $(vte_defs)
+
+vte_methods.defs :
+ if ! python `pkg-config --variable=datadir pygtk-2.0`/pygtk/2.0/codegen/h2def.py \
+ `pkg-config --variable=includedir vte`/vte/*.h \
+ > $@ ; then rm $@ ; false ; fi
+
+vte_enums.defs :
+ if ! perl $(srcdir)/enum.pl `pkg-config --variable=includedir vte`/vte/*.h > $@ ; \
+ then rm $@ ; false ; fi
+
+vte_signals.defs : generate_defs_vte
+ ./generate_defs_vte | sed -e 's~const-gchar\*~gchar*~' > $@
+
+vte.defs :
+ echo > $@
+ for a in $(vte_defs_included) ; do echo "(include $${a})" >> $@ ; done
+
+vte_vfuncs.defs :
+ touch $@
+
+EXTRA_DIST = enum.pl generate_defs_vte.cc
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/defs/enum.pl b/0.8.0/src/gtkpaludis/vtemm/defs/enum.pl
new file mode 100644
index 0000000..df41545
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/defs/enum.pl
@@ -0,0 +1,230 @@
+#! /usr/bin/perl
+
+# The lisp definitions for flags does not include order.
+# thus we must extract it ourselves.
+# Usage: ./enum.pl /gnome/head/cvs/gconf/gconf/*.h > gconf_enums.defs
+
+
+my %token;
+$module="none";
+
+while ($ARGV[0] =~ /^--(\S+)/)
+{
+ shift @ARGV;
+ $module=shift @ARGV if ($1 eq "module");
+ if ($1 eq "help")
+ {
+ print "enum.pl [--module modname] header_files ....\n";
+ exit 0;
+ }
+}
+
+foreach $file (@ARGV)
+{
+ &parse($file);
+}
+
+exit;
+
+
+
+# parse enums from C
+sub parse
+{
+ my ($file)=@_;
+
+ $from=0;
+ open(FILE,$file);
+
+ $enum=0;
+ $deprecated=0;
+ $comment=0;
+
+ while(<FILE>)
+ {
+ if($comment)
+ {
+ # end of multiline comment
+ $comment = 0 if(/\*\//);
+ next;
+ }
+
+ $deprecated = 1 if(s/^#ifndef [A-Z_]+_DISABLE_DEPRECATED//);
+
+ ++$deprecated if($deprecated > 0 && /^#\s*if/);
+ --$deprecated if($deprecated > 0 && /^#\s*endif/);
+
+ next if($deprecated > 0);
+
+ # filter single-line comments
+ s/\/\*.*\*\///g;
+
+ # begin of multiline comment
+ if(/\/\*/)
+ {
+ $comment = 1;
+ next;
+ }
+
+ s/','/\%\%COMMA\%\%/;
+ s/'}'/\%\%RBRACE\%\%/;
+ if (/^typedef enum/ )
+ {
+ print ";; From $file\n\n" if (!$from);
+ $from=1;
+ $enum=1;
+ next;
+ }
+
+ if ($enum && /\}/)
+ {
+ $enum=0;
+ &process($line,$_);
+ $line="";
+ }
+ $line.=$_ if ($enum);
+ }
+}
+
+
+# convert enums to lisp
+sub process
+{
+ my ($line,$def)=@_;
+
+ $def=~s/\s*\}\s*//g;
+ $def=~s/\s*;\s*$//;
+ my $c_name=$def;
+
+ $line=~s/\s+/ /g;
+ $line=~s/\/\*.*\*\///g;
+ $line=~s/\s*{\s*//;
+
+ my $entity = "enum";
+ $c_name =~ /^([A-Z][a-z]*)/;
+ $module = $1;
+ $def =~ s/$module//;
+
+ @c_name=();
+ @name=();
+ @number=();
+
+ $val=0;
+ foreach $i (split(/,/,$line))
+ {
+ $i=~s/^\s+//;
+ $i=~s/\s+$//;
+ if ($i =~ /^\S+$/)
+ {
+ push(@c_name,$i);
+ push(@number,sprintf("%d",$val));
+ $token{$i}=$val;
+ }
+ elsif ($i =~ /^(\S+)\s*=\s*(0x[0-9a-fA-F]+)$/ ||
+ $i =~ /^(\S+)\s*=\s*(-?[0-9]+)$/ ||
+ $i =~ /^(\S+)\s*=\s*(1\s*<<\s*[0-9]+)$/
+ )
+ {
+ my ($tmp1, $tmp2) = ($1, $2);
+ push(@c_name, $tmp1);
+ eval("\$val = $tmp2;");
+ $entity = "flags" if($tmp2 =~ /^1\s*<</ || $tmp2 =~ /^0x/);
+ push(@number, $tmp2);
+ $token{$tmp1} = $tmp2;
+ }
+ elsif ($i =~ /^(\S+)\s*=\s*([ _x0-9a-fA-Z|()~]+)$/)
+ {
+ my ($tmp1, $tmp2) = ($1, $2);
+ push(@c_name, $tmp1);
+ $tmp2 =~ s/([A-Z_]+)/($token{$1})/;
+ eval("\$val = $tmp2;");
+ $val = "#error" if(!$val);
+ $val = sprintf("0x%X", $val) if($entity eq "flags");
+ push(@number, $val);
+ $token{$tmp1} = $val;
+ }
+ elsif ($i =~ /^(\S+)\s*=\s*'(.)'$/)
+ {
+ push(@c_name,$1);
+ push(@number,"\'$2\'");
+ $val=ord($2);
+ $token{$1}=$val;
+ }
+ elsif ($i =~ /^(\S+)\s*=\s*(\%\%[A-Z]+\%\%)$/)
+ {
+ $tmp=$1;
+ $_=$2;
+ s/\%\%COMMA\%\%/,/;
+ s/\%\%RBRACE\%\%/]/;
+ push(@c_name,$tmp);
+ push(@number,"\'$_\'");
+ $val=ord($_);
+ $token{$tmp}=$val;
+ }
+ else
+ {
+ #print STDERR "$i\n";
+ }
+ $val++;
+ }
+
+ # remove the prefix to form names
+ &form_names(\@name,\@c_name);
+
+ my $format = "%d";
+ $format = "0x%X" if($entity eq "flags");
+
+ # evaluate any unevaluated values
+ my $j;
+ for ($j=0;$j<$#number+1;$j++)
+ {
+ if ($number[$j]=~/\$/)
+ {
+ $number[$j]=sprintf($format, eval($number[$j]));
+ }
+ }
+
+ #print ";; Enum $def\n\n";
+ print "(define-$entity-extended $def\n";
+ print " (in-module \"$module\")\n";
+ print " (c-name \"$c_name\")\n";
+
+ print " (values\n";
+ for ($j=0;$j<$#c_name+1;$j++)
+ {
+ print " \'(\"$name[$j]\" \"$c_name[$j]\"";
+ print " \"$number[$j]\"" if ($number[$j] ne "");
+ print ")\n";
+ }
+ print " )\n";
+ print ")\n\n";
+}
+
+
+sub form_names
+{
+ my ($name,$c_name)=@_;
+
+ my $len=length($$c_name[0]) - 1;
+ my $j;
+ for ($j=0;$j<$#c_name;$j++)
+ {
+ while (substr($$c_name[$j],$len-1,1) ne "_" ||
+ substr($$c_name[$j],0,$len) ne substr($$c_name[$j+1],0,$len))
+ {
+ $len--;
+ }
+ #print substr($$c_name[$j],0,$len),"\n";
+ }
+
+ my $prefix=substr($$c_name[0],0,$len);
+
+ for ($j=0;$j<$#c_name+1;$j++)
+ {
+ $_=$$c_name[$j];
+ s/^$prefix//;
+ tr/A-Z_/a-z-/;
+ push(@$name,$_);
+ }
+
+}
diff --git a/0.8.0/src/gtkpaludis/vtemm/defs/generate_defs_vte.cc b/0.8.0/src/gtkpaludis/vtemm/defs/generate_defs_vte.cc
new file mode 100644
index 0000000..20c9b5c
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/defs/generate_defs_vte.cc
@@ -0,0 +1,36 @@
+/* $Id: generate_defs_gtk.cc,v 1.22 2006/05/16 18:03:21 murrayc Exp $ */
+
+/* generate_defs_gtk.cc
+ *
+ * Copyright (C) 2001 The Free Software Foundation
+ *
+ * This library 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 library 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 Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "glibmm_generate_extra_defs/generate_extra_defs.h"
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <vte/vte.h>
+#include <vte/reaper.h>
+
+int main (int argc, char *argv[])
+{
+ gtk_init(&argc, &argv);
+
+std::cout << get_defs(VTE_TYPE_TERMINAL)
+ << get_defs(VTE_TYPE_REAPER);
+
+ return 0;
+}
diff --git a/0.8.0/src/gtkpaludis/vtemm/reaper.ccg b/0.8.0/src/gtkpaludis/vtemm/reaper.ccg
new file mode 100644
index 0000000..e2f1164
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/reaper.ccg
@@ -0,0 +1,65 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 <vte/reaper.h>
+#include <paludis/util/exception.hh>
+
+namespace
+{
+
+ void Reaper_proxy_signal_child_exited(GObject*, int pid, int status, gpointer data)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try
+ {
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ if (Vte::Reaper::get_instance() == data) //ignore signals connected using c api
+ Vte::Reaper::get_instance()->signal_child_exited().emit(pid, status);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
+} /* anonymous namspace */
+
+namespace Vte
+{
+
+ Reaper::Reaper() :
+ Glib::Object(reinterpret_cast<GObject*>(::vte_reaper_get()))
+ {
+ //TODO: looks like vte-0.13.3 has child-exited renamed abi/api breakage??
+ //propably shoud be also unregistred if Reaper will stop be singleton
+ g_signal_connect(G_OBJECT(gobj()), "child-exited", G_CALLBACK(Reaper_proxy_signal_child_exited) , this);
+ }
+
+ int Reaper::add_child(GPid pid)
+ {
+ return vte_reaper_add_child(pid);
+ }
+
+ sigc::signal<void, int, int>& Reaper::signal_child_exited()
+ {
+ return _signal_child_exited;
+ }
+}
+
diff --git a/0.8.0/src/gtkpaludis/vtemm/reaper.hg b/0.8.0/src/gtkpaludis/vtemm/reaper.hg
new file mode 100644
index 0000000..3447636
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/reaper.hg
@@ -0,0 +1,50 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 <sys/types.h>
+#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <glibmm/object.h>
+#include <sigc++/sigc++.h>
+
+_DEFS(vtemm,vte)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Vte
+{
+ class Reaper :
+ public Glib::Object,
+ public paludis::InstantiationPolicy<Reaper, paludis::instantiation_method::SingletonAsNeededTag>
+
+ {
+ friend class paludis::InstantiationPolicy<Reaper, paludis::instantiation_method::SingletonAsNeededTag>;
+
+ sigc::signal<void, int, int> _signal_child_exited;
+
+ _CLASS_GOBJECT(Reaper,VteReaper,VTE_REAPER,Glib::Object,GObject)
+
+ Reaper();
+
+ public:
+
+ int add_child(GPid pid);
+ sigc::signal<void, int, int>& signal_child_exited();
+
+ };
+}
diff --git a/0.8.0/src/gtkpaludis/vtemm/terminal_widget.ccg b/0.8.0/src/gtkpaludis/vtemm/terminal_widget.ccg
new file mode 100644
index 0000000..74ff4a9
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/terminal_widget.ccg
@@ -0,0 +1,159 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 <vte/vte.h>
+
+namespace
+{
+
+gboolean proxy_slot_selected_callback(VteTerminal * /* term */ , glong column, glong row, gpointer data)
+{
+ typedef Vte::Terminal::SlotIsSelected SlotType;
+ SlotType& slot(*static_cast<SlotType*>(data));
+
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try
+ {
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ return slot(column, row);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return 0;
+}
+
+} /* anonymous namespace */
+
+
+namespace Vte
+{
+
+CharAttributes::CharAttributes(VteCharAttributes* obj) :
+ _gobject(new VteCharAttributes(*obj))
+{
+}
+
+CharAttributes::~CharAttributes()
+{
+ delete _gobject;
+}
+
+CharAttributes::CharAttributes(const CharAttributes& rhs) :
+ _gobject(new VteCharAttributes(*rhs._gobject))
+{
+}
+
+CharAttributes& CharAttributes::operator= (const CharAttributes& rhs)
+{
+ if (this != &rhs)
+ {
+ delete _gobject;
+ _gobject = new VteCharAttributes(*rhs._gobject);
+ }
+ return *this;
+}
+
+int CharAttributes::row() const
+{
+ return _gobject->row;
+}
+
+int CharAttributes::column() const
+{
+ return _gobject->column;
+}
+
+Gdk::Color CharAttributes::foreground() const
+{
+ return Gdk::Color(&_gobject->fore, true);
+}
+
+Gdk::Color CharAttributes::background() const
+{
+ return Gdk::Color(&_gobject->back, true);
+}
+
+bool CharAttributes::underline() const
+{
+ return _gobject->underline;
+}
+
+bool CharAttributes::strikethrough() const
+{
+ return _gobject->strikethrough;
+}
+
+char* Terminal::get_text(const Terminal::SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
+{
+ GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
+ Terminal::SlotIsSelected slot_copy(slot);
+
+ char * result(vte_terminal_get_text(gobj(), &proxy_slot_selected_callback, &slot_copy, garray));
+
+ for (size_t i=0; i< garray->len; ++i)
+ {
+ attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
+ }
+
+ g_array_free(garray, false);
+
+ return result;
+}
+
+char* Terminal::get_text_include_trailing_spaces(const Terminal::SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
+{
+ GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
+ Terminal::SlotIsSelected slot_copy(slot);
+
+ char * result(vte_terminal_get_text_include_trailing_spaces(gobj(),
+ &proxy_slot_selected_callback, &slot_copy, garray));
+
+ for (size_t i=0; i< garray->len; ++i)
+ {
+ attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
+ }
+
+ g_array_free(garray, true);
+
+ return result;
+}
+
+char* Terminal::get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
+{
+ GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
+ Terminal::SlotIsSelected slot_copy(slot);
+
+ char * result(vte_terminal_get_text_range(gobj(),start_row, start_col, end_row, end_col,
+ &proxy_slot_selected_callback, &slot_copy, garray));
+
+ for (size_t i=0; i< garray->len; ++i)
+ {
+ attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
+ }
+
+ g_array_free(garray, true);
+
+ return result;
+}
+
+} /* namespace Vte */
diff --git a/0.8.0/src/gtkpaludis/vtemm/terminal_widget.hg b/0.8.0/src/gtkpaludis/vtemm/terminal_widget.hg
new file mode 100644
index 0000000..956a293
--- /dev/null
+++ b/0.8.0/src/gtkpaludis/vtemm/terminal_widget.hg
@@ -0,0 +1,181 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis 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 <gtkmm/widget.h>
+#include <gtkmm/menushell.h>
+#include <gtkmm/adjustment.h>
+#include <gdkmm/cursor.h>
+#include <pangomm/fontdescription.h>
+
+#include <vector>
+
+_DEFS(vtemm,vte)
+_PINCLUDE(gtkmm/private/widget_p.h)
+
+/* we don't want whole vte.h in this file */
+typedef struct _VteCharAttributes VteCharAttributes;
+
+namespace Vte
+{
+
+
+class CharAttributes
+{
+private:
+ VteCharAttributes * _gobject;
+
+public:
+ CharAttributes(VteCharAttributes *obj);
+ CharAttributes(const CharAttributes&);
+
+ ~CharAttributes();
+
+ CharAttributes& operator= (const CharAttributes&);
+
+ int row() const;
+ int column() const;
+ Gdk::Color foreground() const;
+ Gdk::Color background() const;
+ bool underline() const;
+ bool strikethrough() const;
+};
+
+_WRAP_ENUM(TerminalEraseBinding, VteTerminalEraseBinding)
+_WRAP_ENUM(TerminalAntiAlias, VteTerminalAntiAlias)
+
+class Terminal :
+ public Gtk::Widget
+{
+
+_CLASS_GTKOBJECT(Terminal,VteTerminal,VTE_TERMINAL,Gtk::Widget,GtkWidget)
+public:
+
+typedef sigc::slot<bool, long, long> SlotIsSelected;
+
+_CTOR_DEFAULT
+
+_WRAP_METHOD(void im_append_menuitems(const Gtk::MenuShell& menushell), vte_terminal_im_append_menuitems)
+_WRAP_METHOD(pid_t fork_command(const char* command, char** argv, char** envv, const char* directory, bool lastlog, bool utmp, bool wtmp), vte_terminal_fork_command)
+_WRAP_METHOD(pid_t forkpty(char** env, const char* directory, bool lastlog, bool utmp, bool wtmp), vte_terminal_forkpty)
+_WRAP_METHOD(void set_pty(int pty_master), vte_terminal_set_pty)
+_WRAP_METHOD(void feed(const char* data, glong length), vte_terminal_feed)
+_WRAP_METHOD(void feed_child(const char* text, glong length), vte_terminal_feed_child)
+_WRAP_METHOD(void feed_child_binary(const char* data, glong length), vte_terminal_feed_child_binary)
+_WRAP_METHOD(void copy_clipboard(), vte_terminal_copy_clipboard)
+_WRAP_METHOD(void paste_clipboard(), vte_terminal_paste_clipboard)
+_WRAP_METHOD(void copy_primary(), vte_terminal_copy_primary)
+_WRAP_METHOD(void paste_primary(), vte_terminal_paste_primary)
+_WRAP_METHOD(void set_size(glong columns, glong rows), vte_terminal_set_size)
+_WRAP_METHOD(void set_audible_bell(bool is_audible), vte_terminal_set_audible_bell)
+_WRAP_METHOD(bool get_audible_bell(), vte_terminal_get_audible_bell)
+_WRAP_METHOD(void set_visible_bell(bool is_visible), vte_terminal_set_visible_bell)
+_WRAP_METHOD(bool get_visible_bell(), vte_terminal_get_visible_bell)
+_WRAP_METHOD(void set_allow_bold(bool allow_bold), vte_terminal_set_allow_bold)
+_WRAP_METHOD(bool get_allow_bold(), vte_terminal_get_allow_bold)
+_WRAP_METHOD(void set_scroll_on_output(bool scroll), vte_terminal_set_scroll_on_output)
+_WRAP_METHOD(void set_scroll_on_keystroke(bool scroll), vte_terminal_set_scroll_on_keystroke)
+_WRAP_METHOD(void set_color_bold(const Gdk::Color& bold), vte_terminal_set_color_bold )
+_WRAP_METHOD(void set_color_foreground(const Gdk::Color& foreground), vte_terminal_set_color_foreground)
+_WRAP_METHOD(void set_color_background(const Gdk::Color& background), vte_terminal_set_color_background)
+_WRAP_METHOD(void set_color_dim(const Gdk::Color& dim), vte_terminal_set_color_dim)
+_WRAP_METHOD(void set_color_cursor(const Gdk::Color& cursor), vte_terminal_set_color_cursor)
+_WRAP_METHOD(void set_color_highlight(const Gdk::Color& highlight), vte_terminal_set_color_highlight)
+_WRAP_METHOD(void set_colors(const Gdk::Color& foreground, const Gdk::Color& background, const Gdk::Color& palete_size, glong palette_size), vte_terminal_set_colors)
+_WRAP_METHOD(void set_default_colors(), vte_terminal_set_default_colors)
+_WRAP_METHOD(void set_background_image(Glib::RefPtr<Gdk::Pixbuf> pixbuf), vte_terminal_set_background_image)
+_WRAP_METHOD(void set_background_image_file(const char* path), vte_terminal_set_background_image_file)
+_WRAP_METHOD(void set_background_saturation(double saturation), vte_terminal_set_background_saturation)
+_WRAP_METHOD(void set_background_transparent(bool transparent), vte_terminal_set_background_transparent)
+_WRAP_METHOD(void set_background_tint_color(const Gdk::Color& color), vte_terminal_set_background_tint_color)
+_WRAP_METHOD(void set_scroll_background(bool scroll), vte_terminal_set_scroll_background)
+_WRAP_METHOD(void set_cursor_blinks(bool blink), vte_terminal_set_cursor_blinks)
+_WRAP_METHOD(void set_scrollback_lines(long lines), vte_terminal_set_scrollback_lines)
+_WRAP_METHOD(void set_font(const Pango::FontDescription& font_desc), vte_terminal_set_font)
+_WRAP_METHOD(void set_font_from_string(const char* name), vte_terminal_set_font_from_string)
+_WRAP_METHOD(void set_font_from_string_full(const char* name, TerminalAntiAlias antialas), vte_terminal_set_font_from_string_full)
+_WRAP_METHOD(void set_font_full(const Pango::FontDescription& font_desc, TerminalAntiAlias antialas), vte_terminal_set_font_full)
+_WRAP_METHOD(const Pango::FontDescription get_font(), vte_terminal_get_font)
+_WRAP_METHOD(bool get_using_xft(), vte_terminal_get_using_xft)
+_WRAP_METHOD(bool get_has_selection(), vte_terminal_get_has_selection)
+_WRAP_METHOD(void set_word_chars(const char* spec), vte_terminal_set_word_chars)
+_WRAP_METHOD(bool is_word_char(gunichar), vte_terminal_is_word_char)
+_WRAP_METHOD(void set_backspace_binding(TerminalEraseBinding binding), vte_terminal_set_backspace_binding)
+_WRAP_METHOD(void set_delete_binding(TerminalEraseBinding binding), vte_terminal_set_delete_binding)
+_WRAP_METHOD(void set_mouse_autohide(bool setting), vte_terminal_set_mouse_autohide)
+_WRAP_METHOD(bool get_mouse_autohide(), vte_terminal_get_mouse_autohide)
+_WRAP_METHOD(void reset(bool full, bool clear_history), vte_terminal_reset)
+//_WRAP_METHOD(char* get_text(bool (*is_selected) (glong column,glong row,gpointer data), gpointer data, GArray *attributes), vte_terminal_get_text) //Manualy wrapped below
+//_WRAP_METHOD(char* get_text_range(glong start_row, glong start_col, glong end_row, glong end_col, gboolean (*is_selected) (glong column,glong row,gpointer data), gpointer data, GArray *attributes), vte_terminal_get_text_range) //Manualy wrapped bellow
+_WRAP_METHOD(void get_cursor_position(long& column, long& row), vte_terminal_get_cursor_position)
+_WRAP_METHOD(void match_clear_all(), vte_terminal_match_clear_all)
+_WRAP_METHOD(int match_add(const char* match), vte_terminal_match_add)
+_WRAP_METHOD(void match_remove(int tag), vte_terminal_match_remove)
+_WRAP_METHOD(char* match_check(glong column, glong row, int& tag), vte_terminal_match_check)
+_WRAP_METHOD(void match_set_cursor(int tag, Gdk::Cursor& ), vte_terminal_match_set_cursor)
+_WRAP_METHOD(void match_set_cursor_type(int tag, Gdk::CursorType), vte_terminal_match_set_cursor_type)
+_WRAP_METHOD(void set_emulation(const char* emulation), vte_terminal_set_emulation)
+_WRAP_METHOD(const char* get_emulation(), vte_terminal_get_emulation)
+_WRAP_METHOD(const char* get_default_emulation(), vte_terminal_get_default_emulation)
+_WRAP_METHOD(void set_encoding(const char* codeset), vte_terminal_set_encoding)
+_WRAP_METHOD(const char* get_encoding(), vte_terminal_get_encoding)
+_WRAP_METHOD(const char* get_status_line(), vte_terminal_get_status_line)
+_WRAP_METHOD(void get_padding(int& xpad, int& ypad), vte_terminal_get_padding)
+_WRAP_METHOD(Gtk::Adjustment* get_adjustment(), vte_terminal_get_adjustment)
+_WRAP_METHOD(glong get_char_ascent(), vte_terminal_get_char_ascent)
+_WRAP_METHOD(glong get_char_descent(), vte_terminal_get_char_descent)
+_WRAP_METHOD(glong get_char_height(), vte_terminal_get_char_height)
+_WRAP_METHOD(glong get_char_width(), vte_terminal_get_char_width)
+_WRAP_METHOD(glong get_column_count(), vte_terminal_get_column_count)
+_WRAP_METHOD(const char* get_icon_title(), vte_terminal_get_icon_title)
+_WRAP_METHOD(glong get_row_count(), vte_terminal_get_row_count)
+_WRAP_METHOD(const char* get_window_title(), vte_terminal_get_window_title)
+
+_WRAP_SIGNAL(void char_size_changed(unsigned w, unsigned h), "char-size-changed")
+_WRAP_SIGNAL(void child_exited(), "child-exited")
+_WRAP_SIGNAL(void commit(gchar* text, unsigned length), "commit")
+_WRAP_SIGNAL(void contents_changed(), "contents-changed")
+_WRAP_SIGNAL(void cursor_moved(), "cursor-moved")
+_WRAP_SIGNAL(void decrease_font_size(), "decrease-font-size")
+_WRAP_SIGNAL(void deiconify_window(), "deiconify-window")
+_WRAP_SIGNAL(void emulation_changed(), "emulation-changed")
+_WRAP_SIGNAL(void encoding_changed(), "encoding-changed")
+_WRAP_SIGNAL(void eof(), "eof")
+_WRAP_SIGNAL(void icon_title_changed(), "icon-title-changed")
+_WRAP_SIGNAL(void iconify_window(), "iconify-window")
+_WRAP_SIGNAL(void increase_font_size(), "increase-font-size")
+_WRAP_SIGNAL(void lower_window(), "lower-window")
+_WRAP_SIGNAL(void maximize_window(), "maximize-window")
+_WRAP_SIGNAL(void move_window(unsigned x, unsigned y), "move-window")
+_WRAP_SIGNAL(void raise_window(), "raise-window")
+_WRAP_SIGNAL(void refresh_window(), "refresh-window")
+_WRAP_SIGNAL(void resize_window(unsigned w, unsigned h), "resize-window")
+_WRAP_SIGNAL(void restore_window(), "restore-window")
+_WRAP_SIGNAL(void selection_changed(), "selection-changed")
+_WRAP_SIGNAL(void status_line_changed(), "status-line-changed")
+_WRAP_SIGNAL(void text_deleted(), "text-deleted")
+_WRAP_SIGNAL(void text_inserted(), "text-inserted")
+_WRAP_SIGNAL(void text_modified(), "text-modified")
+_WRAP_SIGNAL(void text_scrolled(int arg), "text-scrolled")
+_WRAP_SIGNAL(void window_title_changed(), "window-title-changed")
+ char* get_text(const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
+ char* get_text_include_trailing_spaces(const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
+ char* get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
+};
+
+} /* namespace Vte */