[niepce] Initial map module.
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce] Initial map module.
- Date: Sat, 12 Jul 2014 17:01:47 +0000 (UTC)
commit 78ec0d9ed11e35797b9209e4f6ccc9a83821587b
Author: Hubert Figuière <hub figuiere net>
Date: Sat Jul 5 08:33:05 2014 -0400
Initial map module.
README | 1 +
configure.ac | 3 +-
src/fwk/toolkit/Makefile.am | 1 +
src/fwk/toolkit/mapcontroller.cpp | 44 +++++++++++++++++++
src/fwk/toolkit/mapcontroller.hpp | 50 ++++++++++++++++++++++
src/niepce/Makefile.am | 1 +
src/niepce/modules/Makefile.am | 2 +-
src/niepce/modules/map/Makefile.am | 14 ++++++
src/niepce/modules/map/mapmodule.cpp | 77 ++++++++++++++++++++++++++++++++++
src/niepce/modules/map/mapmodule.hpp | 77 ++++++++++++++++++++++++++++++++++
src/niepce/ui/moduleshell.cpp | 8 ++--
src/niepce/ui/moduleshell.hpp | 4 +-
12 files changed, 275 insertions(+), 7 deletions(-)
---
diff --git a/README b/README
index 30e5483..f523f2b 100644
--- a/README
+++ b/README
@@ -26,6 +26,7 @@ gtkmm 3.2
giomm
cairomm
cluttermm 1.0
+champlain-gtk 0.12
sqlite3
libxml2 > 2.5.0
boost 1.34
diff --git a/configure.ac b/configure.ac
index aed4710..ef4c8c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,7 +98,7 @@ AC_LANG_CPLUSPLUS
AC_LANG_COMPILER_REQUIRE
dnl Framework requirements.
-PKG_CHECK_MODULES(FRAMEWORK, [glibmm-2.4 >= $LIBGLIBMM_VERSION giomm-2.4 >= $LIBGIOMM_VERSION gthread-2.0
gtkmm-3.0 >= $LIBGTKMM_VERSION sqlite3 >= $SQLITE_VERSION exempi-2.0 >= $EXEMPI_VERSION libxml-2.0 >=
$LIBXML2_VERSION cluttermm-1.0])
+PKG_CHECK_MODULES(FRAMEWORK, [glibmm-2.4 >= $LIBGLIBMM_VERSION giomm-2.4 >= $LIBGIOMM_VERSION gthread-2.0
gtkmm-3.0 >= $LIBGTKMM_VERSION sqlite3 >= $SQLITE_VERSION exempi-2.0 >= $EXEMPI_VERSION libxml-2.0 >=
$LIBXML2_VERSION cluttermm-1.0 champlain-gtk-0.12])
dnl optional framework
PKG_CHECK_MODULES(GPHOTO, [libgphoto2 >= $LIBGPHOTO_VERSION libgphoto2_port])
@@ -199,6 +199,7 @@ src/niepce/ui/thumb-view/Makefile
src/niepce/modules/Makefile
src/niepce/modules/darkroom/Makefile
src/niepce/modules/interfaces/Makefile
+src/niepce/modules/map/Makefile
src/niepce/Makefile
])
diff --git a/src/fwk/toolkit/Makefile.am b/src/fwk/toolkit/Makefile.am
index e653a75..fc3ac6e 100644
--- a/src/fwk/toolkit/Makefile.am
+++ b/src/fwk/toolkit/Makefile.am
@@ -29,6 +29,7 @@ libniepceframework_a_SOURCES = configuration.hpp configuration.cpp \
frame.hpp frame.cpp \
controller.hpp controller.cpp \
uicontroller.hpp uicontroller.cpp \
+ mapcontroller.hpp mapcontroller.cpp \
notification.hpp \
mimetype.hpp mimetype.cpp \
movieutils.hpp movieutils.cpp \
diff --git a/src/fwk/toolkit/mapcontroller.cpp b/src/fwk/toolkit/mapcontroller.cpp
new file mode 100644
index 0000000..ecd80d7
--- /dev/null
+++ b/src/fwk/toolkit/mapcontroller.cpp
@@ -0,0 +1,44 @@
+/*
+ * niepce - fwk/toolkit/mapcontroller.cpp
+ *
+ * Copyright (C) 2014 Hubert Figuiere
+ *
+ * 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 3 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "mapcontroller.hpp"
+
+#include <champlain-gtk/champlain-gtk.h>
+
+namespace fwk {
+
+Gtk::Widget *
+MapController::buildWidget(const Glib::RefPtr<Gtk::UIManager> &)
+{
+ if(m_widget) {
+ return m_widget;
+ }
+
+ GtkWidget * embed = gtk_champlain_embed_new();
+ m_widget = Gtk::manage(Glib::wrap(embed));
+
+ ChamplainView* clutter_map =
+ gtk_champlain_embed_get_view(GTK_CHAMPLAIN_EMBED(embed));
+ m_clutter_map = Glib::wrap(CLUTTER_ACTOR(clutter_map), true);
+
+ return m_widget;
+}
+
+
+}
diff --git a/src/fwk/toolkit/mapcontroller.hpp b/src/fwk/toolkit/mapcontroller.hpp
new file mode 100644
index 0000000..6bd5839
--- /dev/null
+++ b/src/fwk/toolkit/mapcontroller.hpp
@@ -0,0 +1,50 @@
+/*
+ * niepce - fwk/toolkit/mapcontroller.hpp
+ *
+ * Copyright (C) 2014 Hubert Figuiere
+ *
+ * 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 3 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <cluttermm/actor.h>
+
+#include "fwk/toolkit/uicontroller.hpp"
+
+namespace fwk {
+
+class MapController
+ : public UiController
+{
+public:
+ typedef std::shared_ptr<MapController> Ptr;
+
+ virtual Gtk::Widget * buildWidget(const Glib::RefPtr<Gtk::UIManager> &);
+
+private:
+ Glib::RefPtr<Clutter::Actor> m_clutter_map;
+};
+
+
+}
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
diff --git a/src/niepce/Makefile.am b/src/niepce/Makefile.am
index 34d69ec..d66b3bb 100644
--- a/src/niepce/Makefile.am
+++ b/src/niepce/Makefile.am
@@ -17,6 +17,7 @@ niepce_LDADD = \
$(top_builddir)/src/engine/library/libniepcelibrary.a \
$(top_builddir)/src/engine/db/libniepcedb.a \
$(top_builddir)/src/niepce/modules/darkroom/libmoduledarkroom.a \
+ $(top_builddir)/src/niepce/modules/map/libmodulemap.a \
$(top_builddir)/src/niepce/modules/interfaces/libinterfaces.a \
$(top_builddir)/src/fwk/toolkit/libniepceframework.a \
$(top_builddir)/src/fwk/utils/libniepceutils.a \
diff --git a/src/niepce/modules/Makefile.am b/src/niepce/modules/Makefile.am
index ef95e63..773f830 100644
--- a/src/niepce/modules/Makefile.am
+++ b/src/niepce/modules/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = darkroom interfaces
\ No newline at end of file
+SUBDIRS = darkroom interfaces map
diff --git a/src/niepce/modules/map/Makefile.am b/src/niepce/modules/map/Makefile.am
new file mode 100644
index 0000000..6dd3a98
--- /dev/null
+++ b/src/niepce/modules/map/Makefile.am
@@ -0,0 +1,14 @@
+
+
+AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/niepce \
+ -I$(top_srcdir)/src/ext \
+ -DGLADEDIR=\"$(gladedir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ @FRAMEWORK_CFLAGS@
+
+noinst_LIBRARIES=libmodulemap.a
+
+
+libmodulemap_a_SOURCES = \
+ mapmodule.hpp mapmodule.cpp \
+ $(NULL)
diff --git a/src/niepce/modules/map/mapmodule.cpp b/src/niepce/modules/map/mapmodule.cpp
new file mode 100644
index 0000000..860843c
--- /dev/null
+++ b/src/niepce/modules/map/mapmodule.cpp
@@ -0,0 +1,77 @@
+/*
+ * niepce - modules/map/mapmodule.cpp
+ *
+ * Copyright (C) 2014 Hubert Figuiere
+ *
+ * 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 3 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/box.h>
+
+#include "fwk/base/debug.hpp"
+#include "fwk/toolkit/application.hpp"
+#include "mapmodule.hpp"
+
+namespace mapm {
+
+MapModule::MapModule(const ui::IModuleShell & shell,
+ const Glib::RefPtr<Gtk::ActionGroup> & action_group)
+ : m_shell(shell)
+ , m_actionGroup(action_group)
+ , m_box(nullptr)
+ , m_active(false)
+{
+}
+
+void MapModule::dispatch_action(const std::string & /*action_name*/)
+{
+}
+
+
+void MapModule::set_active(bool active)
+{
+ m_active = active;
+}
+
+
+Gtk::Widget * MapModule::buildWidget(const Glib::RefPtr<Gtk::UIManager> & manager)
+{
+ if(m_widget) {
+ return m_widget;
+ }
+
+ m_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
+ m_widget = m_box;
+
+ m_map = fwk::MapController::Ptr(new fwk::MapController());
+ add(m_map);
+ Gtk::Widget* w = m_map->buildWidget(manager);
+ if (w) {
+ m_box->pack_start(*w);
+ }
+
+ return m_widget;
+}
+
+}
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:80
+ End:
+*/
diff --git a/src/niepce/modules/map/mapmodule.hpp b/src/niepce/modules/map/mapmodule.hpp
new file mode 100644
index 0000000..f258c74
--- /dev/null
+++ b/src/niepce/modules/map/mapmodule.hpp
@@ -0,0 +1,77 @@
+/*
+ * niepce - modules/map/mapmodule.hpp
+ *
+ * Copyright (C) 2014 Hubert Figuiere
+ *
+ * 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 3 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _MAP_MODULE_H__
+#define _MAP_MODULE_H__
+
+#include <gtkmm/widget.h>
+#include <gtkmm/box.h>
+#include <gtkmm/actiongroup.h>
+
+#include "fwk/toolkit/controller.hpp"
+#include "fwk/toolkit/mapcontroller.hpp"
+#include "engine/db/libfile.hpp"
+#include "libraryclient/libraryclient.hpp"
+#include "niepce/ui/ilibrarymodule.hpp"
+#include "niepce/ui/imoduleshell.hpp"
+
+namespace mapm {
+
+class MapModule
+ : public ui::ILibraryModule
+{
+public:
+ typedef std::shared_ptr<MapModule> Ptr;
+
+ MapModule(const ui::IModuleShell & shell,
+ const Glib::RefPtr<Gtk::ActionGroup> & action_group);
+
+ virtual void dispatch_action(const std::string & action_name);
+
+ virtual void set_active(bool active);
+
+protected:
+ virtual Gtk::Widget * buildWidget(const Glib::RefPtr<Gtk::UIManager> &);
+
+private:
+ void on_selected(eng::library_id_t id);
+
+ const ui::IModuleShell & m_shell;
+ Glib::RefPtr<Gtk::ActionGroup> m_actionGroup;
+ Gtk::Box* m_box;
+ fwk::MapController::Ptr m_map;
+
+ // state
+ bool m_active;
+};
+
+
+}
+
+#endif
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:80
+ End:
+*/
diff --git a/src/niepce/ui/moduleshell.cpp b/src/niepce/ui/moduleshell.cpp
index aed6862..3ad68c2 100644
--- a/src/niepce/ui/moduleshell.cpp
+++ b/src/niepce/ui/moduleshell.cpp
@@ -1,7 +1,7 @@
/*
* niepce - niepce/ui/moduleshell.cpp
*
- * Copyright (C) 2007-2013 Hubert Figuiere
+ * Copyright (C) 2007-2014 Hubert Figuiere
*
* 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
@@ -37,9 +37,6 @@
namespace ui {
-
-
-
Gtk::Widget * ModuleShell::buildWidget(const Glib::RefPtr<Gtk::UIManager> & manager)
{
if(m_widget) {
@@ -213,6 +210,9 @@ Gtk::Widget * ModuleShell::buildWidget(const Glib::RefPtr<Gtk::UIManager> & mana
m_darkroom = dr::DarkroomModule::Ptr(new dr::DarkroomModule(*this, m_actionGroup));
add_library_module(m_darkroom, _("Darkroom"));
+ m_mapm = mapm::MapModule::Ptr(new mapm::MapModule(*this, m_actionGroup));
+ add_library_module(m_mapm, _("Map"));
+
m_shell.signal_activated.connect(sigc::mem_fun(*this, &ModuleShell::on_module_activated));
m_shell.signal_deactivated.connect(sigc::mem_fun(*this, &ModuleShell::on_module_deactivated));
diff --git a/src/niepce/ui/moduleshell.hpp b/src/niepce/ui/moduleshell.hpp
index cf5c2b2..82388c6 100644
--- a/src/niepce/ui/moduleshell.hpp
+++ b/src/niepce/ui/moduleshell.hpp
@@ -1,7 +1,7 @@
/*
* niepce - ui/moduleshell.hpp
*
- * Copyright (C) 2007-2013 Hubert Figuiere
+ * Copyright (C) 2007-2014 Hubert Figuiere
*
* 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
@@ -29,6 +29,7 @@
#include "fwk/toolkit/notification.hpp"
#include "niepce/ui/gridviewmodule.hpp"
#include "modules/darkroom/darkroommodule.hpp"
+#include "modules/map/mapmodule.hpp"
#include "imageliststore.hpp"
#include "imoduleshell.hpp"
@@ -96,6 +97,7 @@ private:
// these should be dynamic
GridViewModule::Ptr m_gridview;
dr::DarkroomModule::Ptr m_darkroom;
+ mapm::MapModule::Ptr m_mapm;
};
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]