From dd27a62566f9f0c42d9eebe6ad8023b69a741ca6 Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 30 Nov 2007 15:04:01 +0000 Subject: zoomedit: Began toolbox. --- Makefile.am | 2 +- Makefile.in | 35 +++++++++++++++++++++++++++++++++-- SidebarToolbox.cpp | 31 +++++++++++++++++++++++++++++++ SidebarToolbox.h | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 SidebarToolbox.cpp create mode 100644 SidebarToolbox.h 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 +#include +#include +#include "Sidebar.h" +#include "Tool.h" + +class SidebarToolbox : Sidebar +{ + private: + GtkWidget *widget; + std::list buttonBoxes; + + std::set 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_*/ -- cgit v1.2.3