summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-11-30 16:04:01 +0100
committerneoraider <devnull@localhost>2007-11-30 16:04:01 +0100
commitdd27a62566f9f0c42d9eebe6ad8023b69a741ca6 (patch)
tree741e79bb8958551529ff3b760db74a4ce557607f
parent16377d108420614231ac82bda3a9340b9c5ec665 (diff)
downloadzoomedit-dd27a62566f9f0c42d9eebe6ad8023b69a741ca6.tar
zoomedit-dd27a62566f9f0c42d9eebe6ad8023b69a741ca6.zip
zoomedit: Began toolbox.
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in35
-rw-r--r--SidebarToolbox.cpp31
-rw-r--r--SidebarToolbox.h36
4 files changed, 101 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 72e9e31..1537f4c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,6 @@ zoomedit_SOURCES = zoomedit.cpp UIManager.cpp Renderer.cpp Vertex.cpp \
Line.cpp Polygon.cpp Rectangle.cpp Room.cpp Triangle.cpp \
IdManager.cpp WindowManager.cpp SidebarManager.cpp \
Window.cpp SidebarView.cpp SidebarAdd.cpp Drawer.cpp \
- EditManager.cpp FileManager.cpp
+ EditManager.cpp FileManager.cpp SidebarToolbox.cpp Tool.cpp
zoomedit_CPPFLAGS = @GTK_CFLAGS@ @GTKGLEXT_CFLAGS@ @libxml2_CFLAGS@
zoomedit_LDADD = @GTK_LIBS@ @GTKGLEXT_LIBS@ @libxml2_LIBS@ \ No newline at end of file
diff --git a/Makefile.in b/Makefile.in
index 44dea16..65c7d58 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -57,7 +57,8 @@ am_zoomedit_OBJECTS = zoomedit-zoomedit.$(OBJEXT) \
zoomedit-SidebarManager.$(OBJEXT) zoomedit-Window.$(OBJEXT) \
zoomedit-SidebarView.$(OBJEXT) zoomedit-SidebarAdd.$(OBJEXT) \
zoomedit-Drawer.$(OBJEXT) zoomedit-EditManager.$(OBJEXT) \
- zoomedit-FileManager.$(OBJEXT)
+ zoomedit-FileManager.$(OBJEXT) \
+ zoomedit-SidebarToolbox.$(OBJEXT) zoomedit-Tool.$(OBJEXT)
zoomedit_OBJECTS = $(am_zoomedit_OBJECTS)
zoomedit_DEPENDENCIES =
DEFAULT_INCLUDES = -I.@am__isrc@
@@ -183,7 +184,7 @@ zoomedit_SOURCES = zoomedit.cpp UIManager.cpp Renderer.cpp Vertex.cpp \
Line.cpp Polygon.cpp Rectangle.cpp Room.cpp Triangle.cpp \
IdManager.cpp WindowManager.cpp SidebarManager.cpp \
Window.cpp SidebarView.cpp SidebarAdd.cpp Drawer.cpp \
- EditManager.cpp FileManager.cpp
+ EditManager.cpp FileManager.cpp SidebarToolbox.cpp Tool.cpp
zoomedit_CPPFLAGS = @GTK_CFLAGS@ @GTKGLEXT_CFLAGS@ @libxml2_CFLAGS@
zoomedit_LDADD = @GTK_LIBS@ @GTKGLEXT_LIBS@ @libxml2_LIBS@
@@ -286,7 +287,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-Room.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-SidebarAdd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-SidebarManager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-SidebarToolbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-SidebarView.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-Tool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-Triangle.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-UIManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zoomedit-Vertex.Po@am__quote@
@@ -560,6 +563,34 @@ zoomedit-FileManager.obj: FileManager.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o zoomedit-FileManager.obj `if test -f 'FileManager.cpp'; then $(CYGPATH_W) 'FileManager.cpp'; else $(CYGPATH_W) '$(srcdir)/FileManager.cpp'; fi`
+zoomedit-SidebarToolbox.o: SidebarToolbox.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT zoomedit-SidebarToolbox.o -MD -MP -MF $(DEPDIR)/zoomedit-SidebarToolbox.Tpo -c -o zoomedit-SidebarToolbox.o `test -f 'SidebarToolbox.cpp' || echo '$(srcdir)/'`SidebarToolbox.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/zoomedit-SidebarToolbox.Tpo $(DEPDIR)/zoomedit-SidebarToolbox.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SidebarToolbox.cpp' object='zoomedit-SidebarToolbox.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o zoomedit-SidebarToolbox.o `test -f 'SidebarToolbox.cpp' || echo '$(srcdir)/'`SidebarToolbox.cpp
+
+zoomedit-SidebarToolbox.obj: SidebarToolbox.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT zoomedit-SidebarToolbox.obj -MD -MP -MF $(DEPDIR)/zoomedit-SidebarToolbox.Tpo -c -o zoomedit-SidebarToolbox.obj `if test -f 'SidebarToolbox.cpp'; then $(CYGPATH_W) 'SidebarToolbox.cpp'; else $(CYGPATH_W) '$(srcdir)/SidebarToolbox.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/zoomedit-SidebarToolbox.Tpo $(DEPDIR)/zoomedit-SidebarToolbox.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SidebarToolbox.cpp' object='zoomedit-SidebarToolbox.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o zoomedit-SidebarToolbox.obj `if test -f 'SidebarToolbox.cpp'; then $(CYGPATH_W) 'SidebarToolbox.cpp'; else $(CYGPATH_W) '$(srcdir)/SidebarToolbox.cpp'; fi`
+
+zoomedit-Tool.o: Tool.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT zoomedit-Tool.o -MD -MP -MF $(DEPDIR)/zoomedit-Tool.Tpo -c -o zoomedit-Tool.o `test -f 'Tool.cpp' || echo '$(srcdir)/'`Tool.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/zoomedit-Tool.Tpo $(DEPDIR)/zoomedit-Tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Tool.cpp' object='zoomedit-Tool.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o zoomedit-Tool.o `test -f 'Tool.cpp' || echo '$(srcdir)/'`Tool.cpp
+
+zoomedit-Tool.obj: Tool.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT zoomedit-Tool.obj -MD -MP -MF $(DEPDIR)/zoomedit-Tool.Tpo -c -o zoomedit-Tool.obj `if test -f 'Tool.cpp'; then $(CYGPATH_W) 'Tool.cpp'; else $(CYGPATH_W) '$(srcdir)/Tool.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/zoomedit-Tool.Tpo $(DEPDIR)/zoomedit-Tool.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Tool.cpp' object='zoomedit-Tool.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zoomedit_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o zoomedit-Tool.obj `if test -f 'Tool.cpp'; then $(CYGPATH_W) 'Tool.cpp'; else $(CYGPATH_W) '$(srcdir)/Tool.cpp'; fi`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
diff --git a/SidebarToolbox.cpp b/SidebarToolbox.cpp
new file mode 100644
index 0000000..ed5e5da
--- /dev/null
+++ b/SidebarToolbox.cpp
@@ -0,0 +1,31 @@
+#include "SidebarToolbox.h"
+
+SidebarToolbox::SidebarToolbox()
+{
+ widget = gtk_vbox_new(FALSE, 0);
+ g_object_ref_sink(G_OBJECT(widget));
+}
+
+SidebarToolbox::~SidebarToolbox()
+{
+ g_object_unref(G_OBJECT(widget));
+}
+
+bool SidebarToolbox::addTool(Tool *tool) {
+ bool ret = tools.insert(tool).second;
+
+ update();
+
+ return ret;
+}
+
+bool SidebarToolbox::removeTool(Tool *tool) {
+ bool ret = (tools.erase(tool) > 0);
+
+ update();
+
+ return ret;
+}
+
+void SidebarToolbox::update() {
+}
diff --git a/SidebarToolbox.h b/SidebarToolbox.h
new file mode 100644
index 0000000..4982502
--- /dev/null
+++ b/SidebarToolbox.h
@@ -0,0 +1,36 @@
+#ifndef SIDEBARTOOLBOX_H_
+#define SIDEBARTOOLBOX_H_
+
+#include <gtk/gtk.h>
+#include <list>
+#include <set>
+#include "Sidebar.h"
+#include "Tool.h"
+
+class SidebarToolbox : Sidebar
+{
+ private:
+ GtkWidget *widget;
+ std::list<GtkWidget*> buttonBoxes;
+
+ std::set<Tool*> tools;
+
+ // prevent shallow copy
+ SidebarToolbox(const SidebarToolbox &w);
+ const SidebarToolbox& operator=(const SidebarToolbox &w);
+
+ public:
+ SidebarToolbox();
+ virtual ~SidebarToolbox();
+
+ GtkWidget* getWidget() {
+ return widget;
+ }
+
+ void update();
+
+ bool addTool(Tool *tool);
+ bool removeTool(Tool *tool);
+};
+
+#endif /*SIDEBARTOOLBOX_H_*/