windstille-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Windstille-devel] rev 345 - trunk/src


From: Ingo Ruhnke
Subject: [Windstille-devel] rev 345 - trunk/src
Date: Sat, 22 May 2004 14:23:02 +0200

Author: grumbel
Date: 2004-05-22 14:23:01 +0200 (Sat, 22 May 2004)
New Revision: 345

Added:
   trunk/src/box.cxx
   trunk/src/box.hxx
   trunk/src/directory_view.cxx
   trunk/src/directory_view.hxx
   trunk/src/fonts.cxx
   trunk/src/fonts.hxx
   trunk/src/menu.hxx
   trunk/src/meta_data.cxx
   trunk/src/meta_data.hxx
   trunk/src/meta_data_impl.hxx
   trunk/src/panel.cxx
   trunk/src/panel.hxx
   trunk/src/python_meta_data.cxx
   trunk/src/python_meta_data.hxx
   trunk/src/window.cxx
   trunk/src/window.hxx
Modified:
   trunk/src/SConstruct
   trunk/src/blitter.cxx
   trunk/src/blitter.hxx
   trunk/src/clanlib.i
   trunk/src/editor.cxx
   trunk/src/editor.py
   trunk/src/editor_main.cxx
   trunk/src/editor_map.cxx
   trunk/src/editor_map.hxx
   trunk/src/flexlay.cxx
   trunk/src/flexlay.hxx
   trunk/src/flexlay.i
   trunk/src/icon.cxx
   trunk/src/icon.hxx
   trunk/src/layer.cxx
   trunk/src/layer.hxx
   trunk/src/layer_impl.hxx
   trunk/src/minimap.cxx
   trunk/src/minimap.hxx
   trunk/src/object_brush.cxx
   trunk/src/object_brush.hxx
   trunk/src/object_layer.cxx
   trunk/src/object_layer.hxx
   trunk/src/object_selector.cxx
   trunk/src/objmap_object.cxx
   trunk/src/objmap_object.hxx
   trunk/src/objmap_select_tool.cxx
   trunk/src/objmap_sprite_object.cxx
   trunk/src/objmap_sprite_object.hxx
   trunk/src/python_functor.cxx
   trunk/src/python_functor.hxx
   trunk/src/python_object.cxx
   trunk/src/python_object.hxx
   trunk/src/scm_functor.cxx
   trunk/src/scm_helper.hxx
   trunk/src/scm_obj.hxx
   trunk/src/sexpr_parser.cxx
   trunk/src/sexpr_parser.hxx
   trunk/src/shared_ptr.hxx
   trunk/src/shared_ptr_comp.hxx
   trunk/src/sharedptrtest.cxx
   trunk/src/sharedptrtest.hxx
   trunk/src/simpleed.cxx
   trunk/src/simpleed.hxx
   trunk/src/supertux.py
   trunk/src/tile_selector.cxx
   trunk/src/tile_selector.hxx
   trunk/src/tilemap_layer.cxx
   trunk/src/tilemap_layer.hxx
Log:
- added window
- added icon
- added boxdrawing helper class
- added abstract metadata

Modified: trunk/src/SConstruct
===================================================================
--- trunk/src/SConstruct        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/SConstruct        2004-05-22 12:23:01 UTC (rev 345)
@@ -1,5 +1,24 @@
 ## -*- mode: python -*-
+##  $Id$
+##
+##  Flexlay - A Generic 2D Game Editor
+##  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+##
+##  This program is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU General Public License
+##  as published by the Free Software Foundation; either version 2
+##  of the License, or (at your option) any later version.
+##
+##  This program is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+##  GNU 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.
 
+
 env = Environment(CXX = 'g++-3.3',
                   CXXFLAGS = '-g -O0 -Wall',
                   SWIGFLAGS='-c++ -python',
@@ -33,7 +52,7 @@
 env.Command('flexlay_wrap.cxx', 'flexlay.i', "swig -python -c++ $SOURCE")
 
 env.Program('sharedptrtest', 'sharedptrtest.cxx',
-            
CPPPATH=['/home/ingo/run/ClanLib-0.7-current//include/ClanLib-0.7/'])
+            
CPPPATH=['/home/ingo/run/ClanLib-0.7-current/include/ClanLib-0.7/'])
 
 env.Program('simpleed',
             ['simpleed.cxx'],
@@ -46,6 +65,7 @@
     target = 'libflexlay.so',
     source = [
     'blitter.cxx',
+    'box.cxx',
     'command_group.cxx',
     'editor.cxx',
     'editor_map.cxx',
@@ -56,7 +76,10 @@
     'graphic_context_state.cxx',
     'gui_manager.cxx',
     'icon.cxx',
+    'directory_view.cxx',
+    'fonts.cxx',
     'minimap.cxx',
+    'meta_data.cxx', 
     'object_layer.cxx',
     'object_add_command.cxx',
     'object_brush.cxx',
@@ -68,6 +91,7 @@
     'objmap_select_tool.cxx',
     'objmap_sprite_object.cxx',
     'paint_command.cxx',
+    'panel.cxx', 
     'popup_menu.cxx',
     'lispreader.cxx',
     'tile.cxx',
@@ -82,6 +106,7 @@
     'tileset.cxx',
     'tool_manager.cxx',
     'workspace.cxx',
+    'window.cxx',
     'zoom_tool.cxx'],
     CPPPATH=['/home/ingo/run/ClanLib-0.7-current//include/ClanLib-0.7/',
              '..'],
@@ -101,6 +126,7 @@
     'scripting/editor.cxx',
     'python_functor.cxx',
     'python_object.cxx',
+    'python_meta_data.cxx',
     'sexpr_parser.cxx'],
     CPPPATH=['/home/ingo/run/ClanLib-0.7-current//include/ClanLib-0.7/',
              '/usr/include/python2.2/',

Modified: trunk/src/blitter.cxx
===================================================================
--- trunk/src/blitter.cxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/blitter.cxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/blitter.hxx
===================================================================
--- trunk/src/blitter.hxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/blitter.hxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Added: trunk/src/box.cxx
===================================================================
--- trunk/src/box.cxx   2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/box.cxx   2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,98 @@
+//  $Id$
+//
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 <ClanLib/Display/color.h>
+#include <ClanLib/Display/display.h>
+#include "box.hxx"
+
+CL_Color background   (220, 220, 220);
+CL_Color background_hl(240, 240, 240);
+CL_Color background_sw(200, 200, 200);
+CL_Color highlight    (255, 255, 255);
+CL_Color midtone      (150, 150, 150);
+CL_Color shadow       (100, 100, 100);
+
+void
+Box::draw_button_up(const CL_Rect& rect)
+{
+  CL_Display::fill_rect(rect, background_hl);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.right, rect.top, highlight);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.left, rect.bottom, highlight);
+
+  CL_Display::draw_line(rect.left, rect.bottom, 
+                        rect.right, rect.bottom, shadow);
+  CL_Display::draw_line(rect.right, rect.top, 
+                        rect.right, rect.bottom, shadow);
+}
+
+void
+Box::draw_button_down(const CL_Rect& rect)
+{
+  CL_Display::fill_rect(rect, background_sw);
+
+  CL_Display::draw_line(rect.left, rect.bottom, 
+                        rect.right, rect.bottom, highlight);
+  CL_Display::draw_line(rect.right, rect.top, 
+                        rect.right, rect.bottom, highlight);
+
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.right, rect.top, shadow);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.left, rect.bottom, shadow);
+}
+
+void
+Box::draw_button_neutral(const CL_Rect& rect)
+{
+  CL_Display::fill_rect(rect, background);
+}
+
+void
+Box::draw_panel(const CL_Rect& rect)
+{
+  CL_Display::fill_rect(rect, background);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.right, rect.top, highlight);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.left, rect.bottom, highlight);
+
+  CL_Display::draw_line(rect.left, rect.bottom, 
+                        rect.right, rect.bottom, shadow);
+  CL_Display::draw_line(rect.right, rect.top, 
+                        rect.right, rect.bottom, shadow);
+}
+
+void
+Box::draw_panel_down(const CL_Rect& rect)
+{
+  CL_Display::fill_rect(rect, background);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.right, rect.top, shadow);
+  CL_Display::draw_line(rect.left, rect.top, 
+                        rect.left, rect.bottom, shadow);
+
+  CL_Display::draw_line(rect.left, rect.bottom, 
+                        rect.right, rect.bottom, highlight);
+  CL_Display::draw_line(rect.right, rect.top, 
+                        rect.right, rect.bottom, highlight);
+}
+
+/* EOF */

Added: trunk/src/box.hxx
===================================================================
--- trunk/src/box.hxx   2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/box.hxx   2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,38 @@
+//  $Id$
+// 
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_BOX_HXX
+#define HEADER_BOX_HXX
+
+#include <ClanLib/Core/Math/rect.h>
+
+/** Little helper class to draw boxes and stuff in the GUI */
+class Box
+{
+public:
+  static void draw_button_up(const CL_Rect& rect);
+  static void draw_button_down(const CL_Rect& rect);
+  static void draw_button_neutral(const CL_Rect& rect);
+  static void draw_panel(const CL_Rect& rect);
+  static void draw_panel_down(const CL_Rect& rect);
+};
+
+#endif
+
+/* EOF */

Modified: trunk/src/clanlib.i
===================================================================
--- trunk/src/clanlib.i 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/clanlib.i 2004-05-22 12:23:01 UTC (rev 345)
@@ -115,5 +115,28 @@
        CL_Signal_v0 &sig_clicked();
 };
 
+class CL_InputBox : public CL_Component
+{
+public:
+       CL_InputBox(
+               const CL_Rect &pos,
+               CL_Component *parent,
+               CL_StyleManager *style = NULL);
+
+       void set_text(const std::string &text);
+       const std::string &get_text() const;        
+};
+
+class CL_Label : public CL_Component
+{
+public:
+               //: Label Constructor
+       CL_Label(
+               const CL_Point &pos,
+               const std::string &text,
+               CL_Component *parent,
+               CL_StyleManager *style = NULL);
+};
+
 /* EOF */
 

Added: trunk/src/directory_view.cxx
===================================================================
--- trunk/src/directory_view.cxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/directory_view.cxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,207 @@
+//  $Id$
+//
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 <assert.h>
+#include <ClanLib/Core/Math/rect.h>
+#include <ClanLib/Core/IOData/directory_scanner.h>
+#include <ClanLib/Display/font.h>
+#include <ClanLib/Display/display.h>
+#include "fonts.hxx"
+#include "directory_view.hxx"
+
+class DirectoryViewEntry
+{
+public:
+  std::string name;
+  bool directory;
+  bool hidden;
+};
+
+struct DirectoryViewSorter
+{
+  bool operator()(const DirectoryViewEntry& lhs, const DirectoryViewEntry& rhs)
+  {
+    if (lhs.directory > rhs.directory)
+      return true;
+    else if (lhs.directory < rhs.directory)
+      return false;
+    else
+      return lhs.name < rhs.name;
+  }
+};
+
+class DirectoryViewImpl
+{
+public:
+  DirectoryView* parent;
+
+  std::vector<CL_Slot> slots;
+
+  std::string path;
+  CL_Signal_v1<std::string> sig_on_click;
+  typedef std::vector<DirectoryViewEntry> Items;
+  Items items;
+  int current_item;
+  int column_width;
+
+  void update_items();
+  void draw();
+  int get_item(const CL_Point& pos);
+  void on_mouse_move(const CL_InputEvent& event);
+  void on_mouse_down(const CL_InputEvent& event);
+};
+
+DirectoryView::DirectoryView(const CL_Rect& rect, CL_Component* parent)
+  : CL_Component(rect, parent),
+    impl(new DirectoryViewImpl())
+{ 
+  impl->parent = this;
+
+  //  impl->slots.push_back(sig_mouse_down().connect(impl.get(), 
&DirectoryViewImpl::draw));
+  impl->slots.push_back(sig_paint().connect(impl.get(), 
&DirectoryViewImpl::draw));
+  impl->slots.push_back(sig_mouse_move().connect(impl.get(), 
&DirectoryViewImpl::on_mouse_move));
+  impl->slots.push_back(sig_mouse_down().connect(impl.get(), 
&DirectoryViewImpl::on_mouse_down));
+
+  impl->current_item = -1;
+}
+
+DirectoryView::~DirectoryView()
+{
+}
+
+void
+DirectoryView::set_directory(const std::string& path_)
+{
+  impl->path = path_;
+  impl->update_items();
+}
+
+CL_Signal_v1<std::string>&
+DirectoryView::sig_on_click()
+{
+  return impl->sig_on_click;
+}
+
+void 
+DirectoryViewImpl::draw()
+{
+  CL_Font font = Fonts::verdana11; 
+
+  int horizontal_spacing = 10;
+  int vertical_spacing   = 5;
+  int num_columns = 4;
+  int x_pos = 0;
+  int y_pos = 0;
+
+  int j = 0;
+  for(Items::iterator i = items.begin(); i != items.begin()+50 && i != 
items.end(); ++i)
+    {
+      if (current_item && current_item < int(items.size()) && j == 
current_item)
+        {
+          CL_Rect rect = font.bounding_rect(x_pos * (column_width + 
horizontal_spacing) + 1, 
+                                            y_pos * (font.get_height() + 
vertical_spacing) + 1,
+                                            i->name);
+          CL_Display::fill_rect(CL_Rect(rect.left-5, rect.top-3,
+                                        rect.left+5+column_width, 
rect.bottom+3),
+                                CL_Color(250, 200, 0));
+        }
+
+      // draw item
+      if (!i->directory)
+        {
+          font.draw(x_pos * (column_width + horizontal_spacing), 
+                    y_pos * (font.get_height() + vertical_spacing),
+                    i->name);
+        }
+      else
+        {
+          font.draw(x_pos * (column_width + horizontal_spacing), 
+                    y_pos * (font.get_height() + vertical_spacing),
+                    "[" + i->name + "]");
+        }
+
+      x_pos += 1;
+      if (x_pos >= num_columns)
+        {
+          x_pos = 0;
+          y_pos += 1;
+        }
+      ++j;
+    }
+}
+
+int
+DirectoryViewImpl::get_item(const CL_Point& pos)
+{
+  CL_Font font = Fonts::verdana11; 
+
+  int horizontal_spacing = 10;
+  int vertical_spacing   = 5;
+  int num_columns = 4;
+
+  return (pos.x / (column_width + horizontal_spacing))
+    + num_columns * (pos.y / (font.get_height() + vertical_spacing));    
+}
+
+void 
+DirectoryViewImpl::on_mouse_down(const CL_InputEvent& event)
+{
+  current_item = get_item(event.mouse_pos);
+  if (current_item >= 0 && current_item < int(items.size()))
+    {
+      if (items[current_item].directory)
+      parent->set_directory(path + "/" + items[current_item].name);
+    }
+}
+
+void 
+DirectoryViewImpl::on_mouse_move(const CL_InputEvent& event)
+{
+  current_item = get_item(event.mouse_pos);
+}
+
+void
+DirectoryViewImpl::update_items()
+{
+  items.clear();
+  CL_DirectoryScanner scanner;
+
+  scanner.scan(path);
+  while(scanner.next())
+    {
+      DirectoryViewEntry entry;
+      entry.name = scanner.get_name();
+      entry.hidden = (scanner.get_name()[0] == '.');
+      entry.directory = scanner.is_directory();
+      items.push_back(entry);
+    }
+
+  std::sort(items.begin(), items.end(), DirectoryViewSorter());
+
+  CL_Font font = Fonts::verdana11; 
+
+  column_width = 0;
+  for(Items::iterator i = items.begin(); i != items.end(); ++i)
+    {
+      CL_Rect rect = font.bounding_rect(0, 0, i->name + "[]");
+      column_width = std::max(column_width, rect.get_width());
+    }
+}
+
+/* EOF */

Added: trunk/src/directory_view.hxx
===================================================================
--- trunk/src/directory_view.hxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/directory_view.hxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,48 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_DIRECTORY_VIEW_HXX
+#define HEADER_DIRECTORY_VIEW_HXX
+
+#include <ClanLib/GUI/component.h>
+#include "shared_ptr.hxx"
+
+class DirectoryViewImpl;
+
+/** */
+class DirectoryView : public CL_Component
+{
+private:
+public:
+  DirectoryView(const CL_Rect& rect, CL_Component* parent);
+  ~DirectoryView();
+
+  /** Set the directory which should be shown */
+  void set_directory(const std::string& path_);
+
+  /** Call the callback on click on a directory item */
+  CL_Signal_v1<std::string>& sig_on_click();
+
+private:
+  SharedPtr<DirectoryViewImpl> impl;
+};
+
+#endif
+
+/* EOF */

Modified: trunk/src/editor.cxx
===================================================================
--- trunk/src/editor.cxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/editor.cxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -22,9 +22,6 @@
 #include <ClanLib/display.h>
 #include <ClanLib/gui.h>
 #include <ClanLib/guistylesilver.h>
-#ifdef SWIGGUILE
-#include <guile/gh.h>
-#endif
 
 #include "gui_manager.hxx"
 #include "command.hxx"

Modified: trunk/src/editor.py
===================================================================
--- trunk/src/editor.py 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/editor.py 2004-05-22 12:23:01 UTC (rev 345)
@@ -34,12 +34,12 @@
 workspace.set_current_map(m)
 
 tileset = load_supertux_tiles()
-tilemap = TilemapLayer(tileset, 20, 10)
+tilemap = TilemapLayer(tileset, 200, 15)
 m.add_layer(tilemap.to_layer())
     
 TilemapLayer_set_current(tilemap)
 
-def foo():
+def do_quit():
     print "---My Callback---"
     gui.quit()
 
@@ -58,31 +58,44 @@
     g = _
     print "Draw something done"
 
-window = CL_Window(CL_Rect(50, 50, 350, 300), "My Window", gui.get_component())
+window = Window(CL_Rect(50, 50, 450, 400), "My Window", gui.get_component())
     
 gui.push_component(window.get_client_area())
-button1 = CL_Button(CL_Rect(50, 50, 200, 75), "Quit", gui.get_component())
-connect(button1.sig_clicked(), foo)
+dirview = DirectoryView(CL_Rect(CL_Point(3, 40), CL_Size(300, 200)), 
gui.get_component())
+dirview.set_directory("/");
 
-button2 = CL_Button(CL_Rect(CL_Point(50, 100), CL_Size(150, 25)), "Draw", 
gui.get_component())
-connect(button2.sig_clicked(), draw_something)
+load_icon    = Icon(CL_Point(34*0+2, 2), 
make_sprite("../data/images/icons/stock_open.png"), "Some tooltip", 
gui.get_component());
+save_icon    = Icon(CL_Point(34*1+2, 2), 
make_sprite("../data/images/icons/stock_save.png"), "Some tooltip", 
gui.get_component());
+save_as_icon = Icon(CL_Point(34*2+2, 2), 
make_sprite("../data/images/icons/stock_save_as.png"), "Some tooltip", 
gui.get_component());
 
-load_icon    = Icon(CL_Point(34*0, 0), 
make_sprite("../data/images/icons/stock_open.png"), "Some tooltip", 
gui.get_component());
-save_icon    = Icon(CL_Point(34*1, 0), 
make_sprite("../data/images/icons/stock_save.png"), "Some tooltip", 
gui.get_component());
-save_as_icon = Icon(CL_Point(34*2, 0), 
make_sprite("../data/images/icons/stock_save_as.png"), "Some tooltip", 
gui.get_component());
+copy_icon    = Icon(CL_Point(34*3.1+2, 2), 
make_sprite("../data/images/icons/stock_copy.png"), "Some tooltip", 
gui.get_component());
+paste_icon   = Icon(CL_Point(34*4.1+2, 2), 
make_sprite("../data/images/icons/stock_paste.png"), "Some tooltip", 
gui.get_component());
 
-copy_icon    = Icon(CL_Point(34*3.1, 0), 
make_sprite("../data/images/icons/stock_copy.png"), "Some tooltip", 
gui.get_component());
-paste_icon   = Icon(CL_Point(34*4.1, 0), 
make_sprite("../data/images/icons/stock_paste.png"), "Some tooltip", 
gui.get_component());
 
 def foo():
     print "Button pressed"
 
 connect(load_icon.sig_clicked(), foo)
 
-gui.get_component()
-
 gui.pop_component()
 
+willow = Panel(CL_Rect(CL_Point(0, 23), CL_Size(800, 33)), gui.get_component())
+
+load_icon    = Icon(CL_Point(32*0+2, 2), 
make_sprite("../data/images/icons/stock_open.png"), "Some tooltip", willow);
+save_icon    = Icon(CL_Point(32*1+2, 2), 
make_sprite("../data/images/icons/stock_save.png"), "Some tooltip", willow);
+save_as_icon = Icon(CL_Point(32*2+2, 2), 
make_sprite("../data/images/icons/stock_save_as.png"), "Some tooltip", willow);
+
+copy_icon    = Icon(CL_Point(32*3.1+2, 2), 
make_sprite("../data/images/icons/stock_copy.png"), "Some tooltip", willow);
+paste_icon   = Icon(CL_Point(32*4.1+2, 2), 
make_sprite("../data/images/icons/stock_paste.png"), "Some tooltip", willow);
+
+
+toolbar = Panel(CL_Rect(CL_Point(0, 23+33), CL_Size(33, 256)), 
gui.get_component())
+
+select = Icon(CL_Point(2, 32*0+2), 
make_sprite("../data/images/tools/stock-tool-rect-select-22.png"), "Some 
tooltip", toolbar);
+erase  = Icon(CL_Point(2, 32+1+2), 
make_sprite("../data/images/tools/stock-tool-eraser-22.png"), "Some tooltip", 
toolbar);
+move   = Icon(CL_Point(2, 32*2+2), 
make_sprite("../data/images/tools/stock-tool-move-22.png"), "Some tooltip", 
toolbar);
+paint  = Icon(CL_Point(2, 32*3+2), 
make_sprite("../data/images/tools/stock-tool-pencil-22.png"), "Some tooltip", 
toolbar);
+
 supertux = SuperTuxGUI(tileset, gui)
 
 class Menu(CL_Menu):
@@ -111,7 +124,11 @@
 a = menu.add_item("File/Open...", menu_file_open)
 a = menu.add_item("File/Save...", menu_file_save)
 a = menu.add_item("File/Save As...", menu_file_save_as)
+a = menu.add_item("File/Quit",  do_quit)
 
+minimap_panel = Panel(CL_Rect(CL_Point(0, 600-56), CL_Size(800-134, 56)), 
gui.get_component())
+minimap = Minimap(editor_map, CL_Rect(CL_Point(3, 3), CL_Size(794-134, 50)), 
minimap_panel)
+
 gui.run()
 
 flexlay.deinit()

Modified: trunk/src/editor_main.cxx
===================================================================
--- trunk/src/editor_main.cxx   2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/editor_main.cxx   2004-05-22 12:23:01 UTC (rev 345)
@@ -23,9 +23,6 @@
 #include <ClanLib/gl.h>
 #include <ClanLib/sdl.h>
 #include <ClanLib/display.h>
-#ifdef SWIGGUILE
-#  include <guile/gh.h>
-#endif
 #include "editor.hxx"
 #include "globals.hxx"
 #include "tileset.hxx"

Modified: trunk/src/editor_map.cxx
===================================================================
--- trunk/src/editor_map.cxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/editor_map.cxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -43,9 +43,7 @@
   CL_Color foreground_color;
 
   /** Metadata attached to this map (ie. mapname, description, scripts, etc.) 
*/
-#ifdef SWIGGUILE
-  SCMObj metadata;
-#endif
+  MetaData metadata;
 };
 
 EditorMap::EditorMap()
@@ -112,19 +110,17 @@
     return Layer();
 }
 
-#ifdef SWIGGUILE
 void
-EditorMap::set_metadata(const SCMObj& obj)
+EditorMap::set_metadata(const MetaData& obj)
 {
   impl->metadata = obj; 
 }
 
-SCMObj
+MetaData
 EditorMap::get_metadata() const
 {
   return impl->metadata; 
 }
-#endif
 
 CL_Rect
 EditorMap::get_bounding_rect()

Modified: trunk/src/editor_map.hxx
===================================================================
--- trunk/src/editor_map.hxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/editor_map.hxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -52,10 +52,8 @@
 
   Layer get_layer(int i);
 
-#ifdef SWIGGUILE
-  void   set_metadata(const SCMObj& obj);
-  SCMObj get_metadata() const;
-#endif
+  void   set_metadata(const MetaData& obj);
+  MetaData get_metadata() const;
 
   bool has_bounding_rect() const { return true; }
   CL_Rect get_bounding_rect();

Modified: trunk/src/flexlay.cxx
===================================================================
--- trunk/src/flexlay.cxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/flexlay.cxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
 #include <ClanLib/guistylesilver.h>
 #include <ClanLib/gl.h>
 #include "globals.hxx"
+#include "fonts.hxx"
 #include "flexlay.hxx"
 
 Flexlay::Flexlay()
@@ -39,23 +40,30 @@
 Flexlay::init()
 {
   std::cout << "Flexlay::init()" << std::endl;
+  try {
 
-  CL_SetupCore::init();
+    CL_SetupCore::init();
 #ifdef HAVE_LIBSDL
-  if (use_opengl)
+    if (use_opengl)
+      CL_SetupGL::init();
+    else
+      CL_SetupSDL::init();
+#else
     CL_SetupGL::init();
-  else
-    CL_SetupSDL::init();
-#else
-  CL_SetupGL::init();
 #endif
-  CL_SetupDisplay::init();
-  CL_SetupGUI::init();
+    CL_SetupDisplay::init();
+    CL_SetupGUI::init();
   
-  datadir = "../data/";
+    datadir = "../data/";
 
-  window = new CL_DisplayWindow(PACKAGE_STRING,
-                                screen_width, screen_height, fullscreen, 
allow_resize);
+    window = new CL_DisplayWindow(PACKAGE_STRING,
+                                  screen_width, screen_height, fullscreen, 
allow_resize);
+
+    resources = CL_ResourceManager(datadir + "flexlay.xml");
+    Fonts::verdana11 = CL_Font("verdana11_black", &resources);
+  } catch (CL_Error& err) {
+    std::cout << "CL_Error: " << err.message << std::endl;
+  }
 }
 
 void

Modified: trunk/src/flexlay.hxx
===================================================================
--- trunk/src/flexlay.hxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/flexlay.hxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
 #define HEADER_FLEXLAY_HXX
 
 #include <ClanLib/Display/display_window.h>
+#include <ClanLib/Core/Resources/resource_manager.h>
 
 /*! \mainpage Flexlay - A Flexible Layered 2D Editor
   
@@ -86,6 +87,7 @@
   bool allow_resize;
   bool use_opengl;
 
+  CL_ResourceManager resources;
 public:
   Flexlay();
 

Modified: trunk/src/flexlay.i
===================================================================
--- trunk/src/flexlay.i 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/flexlay.i 2004-05-22 12:23:01 UTC (rev 345)
@@ -20,6 +20,7 @@
 #include "layer.hxx"
 #include "tilemap_layer.hxx"
 
+#include "minimap.hxx"
 #include "editor_map.hxx"
 #include "workspace.hxx"
 #include "tileset.hxx"
@@ -33,6 +34,9 @@
 #include "object_selector.hxx"
 #include "sexpr_parser.hxx"
 #include "icon.hxx"
+#include "window.hxx"
+#include "panel.hxx"
+#include "directory_view.hxx"
 %}
 
 %include "std_string.i"
@@ -65,6 +69,9 @@
 %include "object_selector.hxx"
 %include "sexpr_parser.hxx"
 %include "icon.hxx"
+%include "window.hxx"
+%include "panel.hxx"
+%include "minimap.hxx"
+%include "directory_view.hxx"
 
-
 /* EOF */

Added: trunk/src/fonts.cxx
===================================================================
--- trunk/src/fonts.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/fonts.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,24 @@
+//  $Id$
+//
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 "fonts.hxx"
+
+CL_Font Fonts::verdana11;
+
+/* EOF */

Added: trunk/src/fonts.hxx
===================================================================
--- trunk/src/fonts.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/fonts.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,34 @@
+//  $Id$
+// 
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_FONTS_HXX
+#define HEADER_FONTS_HXX
+
+#include <ClanLib/Display/font.h>
+
+/** */
+class Fonts
+{
+public:
+  static CL_Font verdana11;
+};
+
+#endif
+
+/* EOF */

Modified: trunk/src/icon.cxx
===================================================================
--- trunk/src/icon.cxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/icon.cxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or
@@ -17,7 +17,11 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include <iostream>
 #include <ClanLib/Display/display.h>
+#include <ClanLib/Display/display_iostream.h>
+#include "box.hxx"
+#include "fonts.hxx"
 #include "icon.hxx"
 
 class IconImpl
@@ -43,7 +47,7 @@
 
 Icon::Icon(const CL_Point& pos, const CL_Sprite& sprite, const std::string& 
tooltip, 
            CL_Component* parent)
-  : CL_Component(CL_Rect(pos, CL_Size(34, 34)), parent),
+  : CL_Component(CL_Rect(pos, CL_Size(32, 32)), parent),
     impl(new IconImpl(this))
 {
   impl->sprite       = sprite;
@@ -56,6 +60,21 @@
   impl->slots.push_back(sig_mouse_up().connect(impl.get(),   
&IconImpl::mouse_up));
 }
 
+Icon::Icon(const CL_Rect& rect, const CL_Sprite& sprite, const std::string& 
tooltip, 
+           CL_Component* parent)
+  : CL_Component(rect, parent),
+    impl(new IconImpl(this))
+{
+  impl->sprite       = sprite;
+  impl->tooltip      = tooltip;
+  impl->draw_tooltip = true;
+  impl->down         = false;
+
+  impl->slots.push_back(sig_paint().connect(impl.get(), &IconImpl::draw));
+  impl->slots.push_back(sig_mouse_down().connect(impl.get(), 
&IconImpl::mouse_down));
+  impl->slots.push_back(sig_mouse_up().connect(impl.get(),   
&IconImpl::mouse_up));
+}
+
 CL_Signal_v0&
 Icon::sig_clicked()
 {
@@ -65,34 +84,20 @@
 void
 IconImpl::draw()
 {
-  CL_Color background(220, 220, 220);
-  CL_Color background_hl(235, 235, 235);
-  CL_Color background_sw(200, 200, 200);
-  CL_Color highlight(255, 255, 255);
-  CL_Color shadow(0, 0, 0);
+  CL_Rect rect(CL_Point(0, 0), CL_Size(parent->get_width()-4, 
parent->get_height()-4));
 
   if (parent->has_mouse_over())
-    if (!down)
-      CL_Display::fill_rect(CL_Rect(CL_Point(0, 0), CL_Size(34, 34)), 
background_hl);
-    else
-      CL_Display::fill_rect(CL_Rect(CL_Point(0, 0), CL_Size(34, 34)), 
background_sw);
+    {
+      if (down)
+        Box::draw_button_down(rect);
+      else
+        Box::draw_button_up(rect);
+    }
   else
-    CL_Display::fill_rect(CL_Rect(CL_Point(0, 0), CL_Size(34, 34)), 
background);
+    Box::draw_button_neutral(rect);
 
-  if (parent->has_mouse_over() && down)
-    std::swap(highlight, shadow);
-
-  if (parent->has_mouse_over())
-    { 
-      CL_Display::draw_line(0, 0,  0, 33, highlight);
-      CL_Display::draw_line(0, 0, 33,  0, highlight);
-      
-      CL_Display::draw_line(33,  0, 33, 33, shadow);
-      CL_Display::draw_line( 0, 33, 33, 33, shadow);
-    }
-
   sprite.set_alignment(origin_center);
-  sprite.draw(17, 17);
+  sprite.draw((rect.get_width()+1)/2, (rect.get_height()+1)/2);
 }
 
 void
@@ -117,7 +122,7 @@
 void 
 IconImpl::mouse_move(const CL_InputEvent& event)
 {
-  
+  std::cout << "icon: mouse_move: " << event << std::endl;
 }
 
 /* EOF */

Modified: trunk/src/icon.hxx
===================================================================
--- trunk/src/icon.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/icon.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or
@@ -33,6 +33,7 @@
 private:
 public:
   Icon(const CL_Point& pos, const CL_Sprite& sprite, const std::string& 
tooltip, CL_Component* parent);
+  Icon(const CL_Rect& rect, const CL_Sprite& sprite, const std::string& 
tooltip, CL_Component* parent);
   
   CL_Signal_v0& sig_clicked();
 

Modified: trunk/src/layer.cxx
===================================================================
--- trunk/src/layer.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/layer.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/layer.hxx
===================================================================
--- trunk/src/layer.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/layer.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/layer_impl.hxx
===================================================================
--- trunk/src/layer_impl.hxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/layer_impl.hxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Added: trunk/src/menu.hxx
===================================================================
--- trunk/src/menu.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/menu.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,35 @@
+//  $Id$
+// 
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_MENU_HXX
+#define HEADER_MENU_HXX
+
+/** */
+class Menu
+{
+private:
+public:
+  Menu(CL_Component* parent);
+
+  MenuItem add_item(const std::string& );
+};
+
+#endif
+
+/* EOF */

Added: trunk/src/meta_data.cxx
===================================================================
--- trunk/src/meta_data.cxx     2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/meta_data.cxx     2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,41 @@
+//  $Id$
+//
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 "meta_data.hxx"
+
+MetaData::MetaData()
+{
+}
+
+MetaData::MetaData(SharedPtr<MetaDataImpl> impl_)
+  : impl(impl_)
+{
+}
+
+MetaData::~MetaData()
+{
+}
+
+SharedPtr<MetaDataImpl>
+MetaData::get_impl() const
+{
+  return impl;
+}
+
+/* EOF */

Added: trunk/src/meta_data.hxx
===================================================================
--- trunk/src/meta_data.hxx     2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/meta_data.hxx     2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,43 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_META_DATA_HXX
+#define HEADER_META_DATA_HXX
+
+#include "shared_ptr.hxx"
+
+class MetaDataImpl;
+
+/** */
+class MetaData
+{
+private:
+public:
+  MetaData();
+  MetaData(SharedPtr<MetaDataImpl> impl_);
+  ~MetaData();
+  
+  SharedPtr<MetaDataImpl> get_impl() const;
+private:
+  SharedPtr<MetaDataImpl> impl;
+};
+
+#endif
+
+/* EOF */

Added: trunk/src/meta_data_impl.hxx
===================================================================
--- trunk/src/meta_data_impl.hxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/meta_data_impl.hxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,44 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_META_DATA_IMPL_HXX
+#define HEADER_META_DATA_IMPL_HXX
+
+/** */
+class MetaDataImpl
+{
+private:
+public:
+  MetaDataImpl() {}
+  virtual ~MetaDataImpl() {}
+};
+
+template<class T> 
+class MetaDataGeneric : public MetaDataImpl
+{
+public:
+  T data;
+
+  MetaDataGeneric(const T& d)
+    : data(d) {}
+};
+
+#endif
+
+/* EOF */

Modified: trunk/src/minimap.cxx
===================================================================
--- trunk/src/minimap.cxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/minimap.cxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -30,32 +30,49 @@
 #include "workspace.hxx"
 #include "minimap.hxx"
 
-Minimap::Minimap(EditorMapComponent* p, const CL_Point& pos, const CL_Size& 
size, CL_Component* parent)
-  : CL_Component(CL_Rect(pos, size), parent), 
-    parent(p)
+class MinimapImpl
 {
-  slots.push_back(sig_paint().connect(this, &Minimap::draw));
-  slots.push_back(sig_mouse_move().connect(this, &Minimap::mouse_move));
-  slots.push_back(sig_mouse_down().connect(this, &Minimap::mouse_down));
-  slots.push_back(sig_mouse_up().connect(this, &Minimap::mouse_up));
+public:
+  std::vector<CL_Slot> slots;
+  bool drag_active;
+  
+  int last_serial;
+  EditorMap editor_map;
 
-  drag_active = false;
-  last_serial = -1;
+  EditorMapComponent* parent;
+  CL_Surface minimap_surface;
+
+  void update_minimap_surface();
+};
+
+Minimap::Minimap(EditorMapComponent* p, const CL_Rect& rect,
+                 CL_Component* parent)
+  : CL_Component(rect, parent), 
+    impl(new MinimapImpl())
+{
+  impl->slots.push_back(sig_paint().connect(this, &Minimap::draw));
+  impl->slots.push_back(sig_mouse_move().connect(this, &Minimap::mouse_move));
+  impl->slots.push_back(sig_mouse_down().connect(this, &Minimap::mouse_down));
+  impl->slots.push_back(sig_mouse_up().connect(this, &Minimap::mouse_up));
+
+  impl->parent = p;
+  impl->drag_active = false;
+  impl->last_serial = -1;
 }
 
 void
 Minimap::draw()
 {
   // FIXME: Do this only on map changes
-  if (last_serial != 
EditorMapComponent::current()->get_workspace().get_current_map().get_serial())
-    //      || editor_map != 
EditorMapComponent::current()->get_workspace().get_current_map())
+  if (impl->last_serial != 
impl->parent->get_workspace().get_current_map().get_serial())
+    //      || editor_map != parent->get_workspace().get_current_map())
     {
-      update_minimap_surface();
-      last_serial = 
EditorMapComponent::current()->get_workspace().get_current_map().get_serial();
-      editor_map  = 
EditorMapComponent::current()->get_workspace().get_current_map();
+      impl->update_minimap_surface();
+      impl->last_serial = 
impl->parent->get_workspace().get_current_map().get_serial();
+      impl->editor_map  = impl->parent->get_workspace().get_current_map();
     }
 
-  if (1)
+  if (0)
     { // Draw background color
       CL_Display::fill_rect(CL_Rect(CL_Point(0, 0),
                                     CL_Size(get_width(),
@@ -63,7 +80,6 @@
                             CL_Color(200, 200, 200, 225));
     }
 
-#if 0
   // FIXME: This doesn't work all that well
   TilemapLayer tilemap = TilemapLayer::current();
   int tile_size = tilemap.get_tileset().get_tile_size();
@@ -84,7 +100,7 @@
           for(int y = 0; y < field->get_height(); ++y)
             for(int x = 0; x < field->get_width(); ++x)
               {
-                Tile* tile = Tileset::current().create(field->at(x, y));
+                Tile* tile = tilemap.get_tileset().create(field->at(x, y));
                 if (tile)
                   CL_Display::fill_rect(CL_Rect(CL_Point((x * tile_size) * 
get_width() / map_width,
                                                          (y * tile_size) * 
get_height() / map_height),
@@ -93,11 +109,11 @@
                 CL_Display::flush();
               }
         }
-      minimap_surface.draw(CL_Rect(CL_Point(0, 0),
+      impl->minimap_surface.draw(CL_Rect(CL_Point(0, 0),
                                    CL_Size(get_width(), get_height())));
 
       // Draw cursor
-      CL_Rect rect = parent->get_clip_rect();
+      CL_Rect rect = impl->parent->get_clip_rect();
       CL_Rect screen_rect(CL_Point(rect.left  * get_width()  / map_width,
                                    rect.top   * get_height() / map_height),
                           CL_Size(rect.get_width() * get_width() /map_width,
@@ -107,13 +123,11 @@
       CL_Display::draw_rect(screen_rect,
                             CL_Color(0, 0, 0));
     }
-#endif
 }
 
 void
-Minimap::update_minimap_surface()
+MinimapImpl::update_minimap_surface()
 {
-#if 0
   // FIXME: This doesn't work all that well
   TilemapLayer tilemap = TilemapLayer::current();
   
@@ -132,7 +146,7 @@
       for(int y = 0; y < map_height; ++y)
         for(int x = 0; x < map_width; ++x)
           {
-            Tile* tile = Tileset::current().create(field->at(x, y));
+            Tile* tile = tilemap.get_tileset().create(field->at(x, y));
             if (tile)
               {
                 buf[4*(x + y * map_width) + 3] = tile->get_color().get_red();
@@ -151,7 +165,6 @@
 
       minimap_surface = CL_Surface(&buffer);
     }
-#endif
 }
 
 void
@@ -163,9 +176,9 @@
   int map_width  = tilemap.get_width()  * tile_size;
   int map_height = tilemap.get_height() * tile_size;
 
-  if (drag_active)
-    parent->move_to(event.mouse_pos.x * map_width / get_width(),
-                    event.mouse_pos.y * map_height / get_height());
+  if (impl->drag_active)
+    impl->parent->move_to(event.mouse_pos.x * map_width / get_width(),
+                          event.mouse_pos.y * map_height / get_height());
 }
 
 void
@@ -177,23 +190,23 @@
   int map_width  = tilemap.get_width()  * tile_size;
   int map_height = tilemap.get_height() * tile_size;
 
-  parent->move_to(event.mouse_pos.x * map_width / get_width(),
-                  event.mouse_pos.y * map_height / get_height());
-  drag_active = true;
+  impl->parent->move_to(event.mouse_pos.x * map_width / get_width(),
+                        event.mouse_pos.y * map_height / get_height());
+  impl->drag_active = true;
   capture_mouse();
 }
 
 void
 Minimap::mouse_up  (const CL_InputEvent& event)
 {
-  drag_active = false;
+  impl->drag_active = false;
   release_mouse();
 }
 
 void
 Minimap::update_minimap()
 {
-  update_minimap_surface();
+  impl->update_minimap_surface();
 }
 
 /* EOF */

Modified: trunk/src/minimap.hxx
===================================================================
--- trunk/src/minimap.hxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/minimap.hxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -22,22 +22,13 @@
 
 #include <ClanLib/GUI/component.h>
 
+class MinimapImpl;
+
 /** */
 class Minimap : public CL_Component
 {
-private:
-  std::vector<CL_Slot> slots;
-  bool drag_active;
-  
-  int last_serial;
-  EditorMap editor_map;
-
-  EditorMapComponent* parent;
-  CL_Surface minimap_surface;
-
-  void update_minimap_surface();
 public:
-  Minimap(EditorMapComponent* p, const CL_Point& pos, const CL_Size& size, 
CL_Component* parent);
+  Minimap(EditorMapComponent* p, const CL_Rect& rect, CL_Component* parent);
   
   void draw();
   void update_minimap();
@@ -45,6 +36,9 @@
   void mouse_move(const CL_InputEvent& event);
   void mouse_down(const CL_InputEvent& event);
   void mouse_up  (const CL_InputEvent& event);
+  
+private:
+  SharedPtr<MinimapImpl> impl;
 };
 
 #endif

Modified: trunk/src/object_brush.cxx
===================================================================
--- trunk/src/object_brush.cxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/object_brush.cxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -24,17 +24,10 @@
   
 }
 
-ObjectBrush::ObjectBrush(const CL_Sprite& sprite_
-#ifdef SWIGGUILE
-                         ,  const SCMObj& data_
-#endif
-)
-  : sprite(sprite_)
-#ifdef SWIGGUILE
-  ,data(data_)
-#endif
+ObjectBrush::ObjectBrush(const CL_Sprite& sprite_,
+                         const MetaData& data_)
+  : sprite(sprite_), data(data_)
 {
-
 }
 
 /* EOF */

Modified: trunk/src/object_brush.hxx
===================================================================
--- trunk/src/object_brush.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/object_brush.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -20,25 +20,18 @@
 #ifndef HEADER_OBJECT_BRUSH_HXX
 #define HEADER_OBJECT_BRUSH_HXX
 
-#ifdef SWIGGUILE
-#include "scm_obj.hxx"
-#endif
 #include <ClanLib/Display/sprite.h>
+#include "meta_data.hxx"
 
 class ObjectBrush
 {
 public:
   CL_Sprite sprite;
-#ifdef SWIGGUILE
-  SCMObj    data;
-#endif
+  MetaData  data;
 
   ObjectBrush();
-  ObjectBrush(const CL_Sprite& sprite_
-#ifdef SWIGGUILE
-              ,  const SCMObj& data_
-#endif
-);
+  ObjectBrush(const CL_Sprite& sprite_,
+              const MetaData& data_);
 };
 
 #endif

Modified: trunk/src/object_layer.cxx
===================================================================
--- trunk/src/object_layer.cxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/object_layer.cxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -28,9 +28,18 @@
 extern CL_ResourceManager* resources;
 ObjectLayer* ObjectLayer::current_ = 0;
 
+class ObjectLayerImpl
+{
+public:
+  ObjectLayer::Objs objects;
+  int handle_count;
+  CL_SlotContainer slots;
+};
+
 ObjectLayer::ObjectLayer()
+  : impl(new ObjectLayerImpl())
 {
-  handle_count = 0;
+  impl->handle_count = 0;
 }
 
 ObjectLayer::~ObjectLayer()
@@ -40,7 +49,7 @@
 void
 ObjectLayer::draw(EditorMapComponent* parent)
 {
-  for(Objs::iterator i = objects.begin(); i != objects.end(); ++i)
+  for(Objs::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
     {
       (*i)->draw();
     }
@@ -50,8 +59,8 @@
 ObjectLayer::duplicate_object(int id)
 {
   ObjMapObject* obj    = get_object(id);
-  ObjMapObject* newobj = obj->duplicate(++handle_count);
-  objects.push_back(newobj);  
+  ObjMapObject* newobj = obj->duplicate(++impl->handle_count);
+  impl->objects.push_back(newobj);  
 
   // FIXME: Move to scripting level
   newobj->set_pos(newobj->get_pos() + CL_Point(16, 16));
@@ -59,22 +68,20 @@
   return newobj->get_handle();
 }
 
-#ifdef SWIGGUILE
 int
-ObjectLayer::add_object(const CL_Sprite& sprite, const CL_Point& pos, const 
SCMObj& data)
+ObjectLayer::add_object(const CL_Sprite& sprite, const CL_Point& pos, const 
MetaData& data)
 {
-  ObjMapObject* obj = new ObjMapSpriteObject(++handle_count, pos, data, 
sprite);
+  ObjMapObject* obj = new ObjMapSpriteObject(++impl->handle_count, pos, data, 
sprite);
 
-  objects.push_back(obj);  
+  impl->objects.push_back(obj);  
 
   return obj->get_handle();
 }
-#endif
 
 ObjMapObject*
 ObjectLayer::find_object(const CL_Point& click_pos)
 {
-  for(Objs::reverse_iterator i = objects.rbegin(); i != objects.rend(); ++i)
+  for(Objs::reverse_iterator i = impl->objects.rbegin(); i != 
impl->objects.rend(); ++i)
     {
       CL_Rect rect = (*i)->get_bound_rect();
      
@@ -87,12 +94,12 @@
 void
 ObjectLayer::delete_object(int id)
 {
-  for(Objs::iterator i = objects.begin(); i != objects.end(); ++i)
+  for(Objs::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
     {
       if ((*i)->get_handle() == id)
         {
           //delete *i;
-          objects.erase(i);
+          impl->objects.erase(i);
           break;
         }
     }
@@ -103,7 +110,7 @@
 {
   std::vector<ObjectLayer::Obj*> selection;
 
-  for(Objs::iterator i = objects.begin(); i != objects.end(); ++i)
+  for(Objs::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
     {
       // FIXME:
       if (rect.is_inside((*i)->get_pos()))
@@ -118,7 +125,7 @@
 ObjectLayer::Obj*
 ObjectLayer::get_object(int id)
 {
-  for(Objs::iterator i = objects.begin(); i != objects.end(); ++i)
+  for(Objs::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
     if ((*i)->get_handle() == id)
       return *i;
   return 0;
@@ -127,15 +134,21 @@
 ObjectLayer::Objs*
 ObjectLayer::get_objects()
 {
-  return &objects;
+  return &impl->objects;
 }
 
 void
 ObjectLayer::add_object(ObjMapObject* obj)
 {
-  objects.push_back(obj);
+  impl->objects.push_back(obj);
 }
 
+int
+ObjectLayer::get_next_object_handle()
+{
+  return ++impl->handle_count; 
+}
+
 Layer
 ObjectLayer::to_layer()
 {

Modified: trunk/src/object_layer.hxx
===================================================================
--- trunk/src/object_layer.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/object_layer.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -24,6 +24,7 @@
 #include <ClanLib/Display/sprite.h>
 #include <ClanLib/GUI/component.h>
 #include <ClanLib/Core/Math/point.h>
+#include "meta_data.hxx"
 #include "layer.hxx"
 
 class ObjMapObject;
@@ -34,17 +35,12 @@
     accessible from scripting languages */
 class ObjectLayer
 {
-private:
-  CL_SlotContainer slots;
-
 public:
   typedef ObjMapObject Obj;
   typedef std::vector<ObjMapObject*> Objs;
-  Objs objects;
 
-  int handle_count;
   static ObjectLayer* current_;
-public:
+
   static ObjectLayer* current() { return current_; }
   static void set_current(ObjectLayer* c) { current_ = c; }
 
@@ -54,9 +50,8 @@
   void draw(EditorMapComponent* parent);
 
   /** Add an object to the map and return a handle to it */
-#ifdef SWIGGUILE
-  int  add_object(const CL_Sprite& sprite, const CL_Point& pos, const SCMObj& 
data);
-#endif
+  int  add_object(const CL_Sprite& sprite, const CL_Point& pos, const 
MetaData& data);
+
   void add_object(ObjMapObject* obj);
   void delete_object(int id);
   int  duplicate_object(int id);
@@ -65,9 +60,10 @@
   std::vector<ObjMapObject*> get_selection(const CL_Rect& rect);
   Objs* get_objects();
   ObjectLayer::Obj* get_object(int id);
-  int get_next_object_handle() { return ++handle_count; }
+  int get_next_object_handle();
 
   Layer to_layer();
+
 private:
   CL_SharedPtr<ObjectLayerImpl> impl;
 };

Modified: trunk/src/object_selector.cxx
===================================================================
--- trunk/src/object_selector.cxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/object_selector.cxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -85,9 +85,7 @@
                     ObjMapObject* obj 
                       = new 
ObjMapSpriteObject(objmap->get_next_object_handle(), 
                                                
EditorMapComponent::current()->screen2world(target),
-#ifdef SWIGGUILE
-                                               SCMObj(drag_obj.data), 
-#endif
+                                               drag_obj.data, 
                                                drag_obj.sprite);
                     ObjectAddCommand* command = new ObjectAddCommand(objmap, 
obj);
                     Editor::current()->execute(command);

Modified: trunk/src/objmap_object.cxx
===================================================================
--- trunk/src/objmap_object.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/objmap_object.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -19,23 +19,14 @@
 
 #include "objmap_object.hxx"
 
-ObjMapObject::ObjMapObject(int handle_, const CL_Point& pos_
-#ifdef SWIGGUILE
-                           , const SCMObj& data_
-#endif
-                           )
-  : handle(handle_), pos(pos_)
-#ifdef SWIGGUILE
-  , data(data_)
-#endif
+ObjMapObject::ObjMapObject(int handle_, const CL_Point& pos_,
+                           const MetaData& data_)
+  : handle(handle_), pos(pos_), data(data_)
 {  
 }
 
 ObjMapObject::ObjMapObject(int handle_, const ObjMapObject& obj)
-  : handle(handle_), pos(obj.pos)
-#ifdef SWIGGUILE
-, data(obj.data)
-#endif
+  : handle(handle_), pos(obj.pos), data(obj.data)
 {  
 }
 

Modified: trunk/src/objmap_object.hxx
===================================================================
--- trunk/src/objmap_object.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/objmap_object.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -22,9 +22,7 @@
 
 #include <ClanLib/Core/Math/point.h>
 #include <ClanLib/Core/Math/rect.h>
-#ifdef SWIGGUILE
-#include "scm_obj.hxx"
-#endif
+#include "meta_data.hxx"
 
 /** */
 class ObjMapObject
@@ -34,24 +32,16 @@
 
 protected:
   CL_Point  pos;
-#ifdef SWIGGUILE
-  SCMObj    data;
-#endif
+  MetaData  data;
 public:
-  ObjMapObject(int handle_, const CL_Point& pos
-#ifdef SWIGGUILE
-               , const SCMObj& data
-#endif
-               );
+  ObjMapObject(int handle_, const CL_Point& pos, const MetaData& data);
   ObjMapObject(int handle_, const ObjMapObject& obj);
   virtual ~ObjMapObject() {}
 
   CL_Point get_pos() const { return pos; }
   void     set_pos(const CL_Point& p) { pos = p; }
 
-#ifdef SWIGGUILE
-  SCMObj get_data() const { return data; }
-#endif
+  MetaData get_data() const { return data; }
 
   virtual void draw() =0;
   virtual CL_Rect get_bound_rect() const  =0;

Modified: trunk/src/objmap_select_tool.cxx
===================================================================
--- trunk/src/objmap_select_tool.cxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/objmap_select_tool.cxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -25,9 +25,6 @@
 #include "editor_map.hxx"
 #include "editor_map_component.hxx"
 #include "gui_manager.hxx"
-#ifdef SWIGGUILE
-#include "scm_obj.hxx"
-#endif
 #include "editor_names.hxx"
 #include "popup_menu.hxx"
 #include "editor.hxx"

Modified: trunk/src/objmap_sprite_object.cxx
===================================================================
--- trunk/src/objmap_sprite_object.cxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/objmap_sprite_object.cxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -21,15 +21,10 @@
 #include "objmap_sprite_object.hxx"
 
 ObjMapSpriteObject::ObjMapSpriteObject(int handle_, const CL_Point& pos_, 
-#ifdef SWIGGUILE
-                                       const SCMObj& data_, 
-#endif
+                                       const MetaData& data_, 
                                        const CL_Sprite& sprite_)
-  : ObjMapObject(handle_, pos_
-#ifdef SWIGGUILE
-                 ,data_
-#endif
-                 ), sprite(sprite_)
+  : ObjMapObject(handle_, pos_,data_), 
+    sprite(sprite_)
 {
   
 }

Modified: trunk/src/objmap_sprite_object.hxx
===================================================================
--- trunk/src/objmap_sprite_object.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/objmap_sprite_object.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -32,9 +32,7 @@
 public:
   ObjMapSpriteObject(int handle_, 
                      const CL_Point& pos_, 
-#ifdef SWIGGUILE
-                     const SCMObj& data_, 
-#endif
+                     const MetaData& data_, 
                      const CL_Sprite& s);
   ObjMapSpriteObject(int handle_, const ObjMapSpriteObject& obj);
 

Added: trunk/src/panel.cxx
===================================================================
--- trunk/src/panel.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/panel.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,48 @@
+//  $Id$
+//
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 <vector>
+#include <ClanLib/Signals/slot.h>
+#include "box.hxx"
+#include "panel.hxx"
+
+class PanelImpl
+{
+public:
+  std::vector<CL_Slot> slots;
+  CL_Component* parent;
+
+  void draw();
+};
+
+Panel::Panel(const CL_Rect& rect, CL_Component* parent)
+  : CL_Component(rect, parent), impl(new PanelImpl())
+{
+  impl->parent = this;
+  impl->slots.push_back(sig_paint().connect(impl.get(), &PanelImpl::draw));
+}
+
+void
+PanelImpl::draw()
+{
+  CL_Rect rect = parent->get_position();
+  Box::draw_panel(CL_Rect(CL_Point(0, 0), CL_Size(rect.get_width()-1, 
rect.get_height()-1)));
+}
+
+/* EOF */

Added: trunk/src/panel.hxx
===================================================================
--- trunk/src/panel.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/panel.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,40 @@
+//  $Id$
+// 
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_PANEL_HXX
+#define HEADER_PANEL_HXX
+
+#include <ClanLib/GUI/component.h>
+#include <ClanLib/Core/Math/rect.h>
+#include "shared_ptr.hxx"
+
+class PanelImpl;
+
+/** */
+class Panel : public CL_Component
+{
+public:
+  Panel(const CL_Rect& rect, CL_Component* parent);
+private:
+  SharedPtr<PanelImpl> impl;
+};
+
+#endif
+
+/* EOF */

Modified: trunk/src/python_functor.cxx
===================================================================
--- trunk/src/python_functor.cxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_functor.cxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/python_functor.hxx
===================================================================
--- trunk/src/python_functor.hxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_functor.hxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Added: trunk/src/python_meta_data.cxx
===================================================================
--- trunk/src/python_meta_data.cxx      2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_meta_data.cxx      2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,50 @@
+//  $Id$
+//
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 <iostream>
+#include "python_meta_data.hxx"
+
+PythonObject get_python_object(const MetaData& data_obj)
+{
+  MetaDataImpl*    data = data_obj.get_impl().get();
+  if (data)
+    {
+      PythonMetaData* pyobj = dynamic_cast<PythonMetaData*>(data);
+      if (pyobj)
+        {
+          return pyobj->data;
+        }
+      else
+        {
+          std::cout << "Warning: MetaData isn't a python object" << std::endl;
+          PyObject* p = Py_None;
+          Py_XINCREF(p);
+          return p;
+        }
+    }
+  else
+    {
+      std::cout << "Warning: no MetaData associated with this object" << 
std::endl;
+      PyObject* p = Py_None;
+      Py_XINCREF(p);
+      return p;
+    }
+}
+
+/* EOF */

Added: trunk/src/python_meta_data.hxx
===================================================================
--- trunk/src/python_meta_data.hxx      2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_meta_data.hxx      2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,33 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_PYTHON_META_DATA_HXX
+#define HEADER_PYTHON_META_DATA_HXX
+
+#include "python_object.hxx"
+#include "meta_data.hxx"
+#include "meta_data_impl.hxx"
+
+typedef MetaDataGeneric<PythonObject> PythonMetaData;
+
+PythonObject get_python_object(const MetaData& data);
+
+#endif
+
+/* EOF */

Modified: trunk/src/python_object.cxx
===================================================================
--- trunk/src/python_object.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_object.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/python_object.hxx
===================================================================
--- trunk/src/python_object.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/python_object.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/scm_functor.cxx
===================================================================
--- trunk/src/scm_functor.cxx   2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/scm_functor.cxx   2004-05-22 12:23:01 UTC (rev 345)
@@ -18,9 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <iostream>
-#ifdef SWIGGUILE
 #include <libguile.h>
-#endif
 #include "scm_functor.hxx"
 
 SCMFunctor::SCMFunctor(SCM arg_func)

Modified: trunk/src/scm_helper.hxx
===================================================================
--- trunk/src/scm_helper.hxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/scm_helper.hxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -20,14 +20,10 @@
 #ifndef HEADER_SCM_HELPER_HXX
 #define HEADER_SCM_HELPER_HXX
 
-#ifdef SWIGGUILE
-# include <guile/gh.h>
-#endif
+#include <guile/gh.h>
 #include <string>
 
-#ifdef SWIGGUILE
 std::string scm2string(SCM str);
-#endif
 
 #endif
 

Modified: trunk/src/scm_obj.hxx
===================================================================
--- trunk/src/scm_obj.hxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/scm_obj.hxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -20,9 +20,7 @@
 #ifndef SCMOBJ_HXX
 #define SCMOBJ_HXX
 
-#ifdef SWIGGUILE
 #include <guile/gh.h>
-#endif
 
 /** SCM Wrapper class which handles protect/unprotect operations. Use
     this for SCM which are on the heap and not for SCM's on the

Modified: trunk/src/sexpr_parser.cxx
===================================================================
--- trunk/src/sexpr_parser.cxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/sexpr_parser.cxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/sexpr_parser.hxx
===================================================================
--- trunk/src/sexpr_parser.hxx  2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/sexpr_parser.hxx  2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/shared_ptr.hxx
===================================================================
--- trunk/src/shared_ptr.hxx    2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/shared_ptr.hxx    2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/shared_ptr_comp.hxx
===================================================================
--- trunk/src/shared_ptr_comp.hxx       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/shared_ptr_comp.hxx       2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/sharedptrtest.cxx
===================================================================
--- trunk/src/sharedptrtest.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/sharedptrtest.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/sharedptrtest.hxx
===================================================================
--- trunk/src/sharedptrtest.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/sharedptrtest.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/simpleed.cxx
===================================================================
--- trunk/src/simpleed.cxx      2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/simpleed.cxx      2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/simpleed.hxx
===================================================================
--- trunk/src/simpleed.hxx      2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/simpleed.hxx      2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/supertux.py
===================================================================
--- trunk/src/supertux.py       2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/supertux.py       2004-05-22 12:23:01 UTC (rev 345)
@@ -52,6 +52,8 @@
     interactive = None
     background  = None
 
+    objects = None
+
     editormap = None
 
     def __init__(self, filename):
@@ -76,10 +78,13 @@
         self.background  = TilemapLayer(tileset, self.width, self.height)
         self.background.set_data(get_value_from_tree(["background-tm"], data, 
[]))
 
+        self.objects = ObjectLayer()
+
         self.editormap = EditorMap()
         self.editormap.add_layer(self.foreground.to_layer())
         self.editormap.add_layer(self.interactive.to_layer())
         self.editormap.add_layer(self.background.to_layer())
+        self.editormap.add_layer(self.objects.to_layer())
 
     def __del__(self):
         print "SuperTuxLevel:__del__"
@@ -90,14 +95,15 @@
 
 class SuperTuxGUI:
     quit_button = None
-    menu = None
+    menu        = None
     tileselector_window = None
     tileselector = None
 
     def __init__(self, tileset, gui):
-        self.tileselector_window = CL_Window(CL_Rect(CL_Point(580, 30), 
CL_Size(210, 560)),
-                                             "Tile Selector", 
gui.get_component())
-        self.tileselector = TileSelector(6, 3, 
self.tileselector_window.get_client_area())
+        self.tileselector_window = Panel(CL_Rect(CL_Point(800-134, 23+33), 
CL_Size(128 + 6, 558)),
+                                         gui.get_component())
+        self.tileselector = TileSelector(CL_Rect(CL_Point(3, 3), CL_Size(128, 
552)),
+                                         6, 3, self.tileselector_window)
         self.tileselector.set_tileset(tileset)
         self.tileselector.set_tiles(range(1,100))
 

Modified: trunk/src/tile_selector.cxx
===================================================================
--- trunk/src/tile_selector.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/tile_selector.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -24,11 +24,8 @@
 #include "tile_selector.hxx"
 #include "tilemap_paint_tool.hxx"
 
-TileSelector::TileSelector(int width, int height, CL_Component* parent)
-  : CL_Component(CL_Rect(CL_Point(0,0), 
-                         // FIXME: Dirty hack, replace with a resizeable window
-                         CL_Size(parent->get_width(),  
-                                 parent->get_height())), 
+TileSelector::TileSelector(const CL_Rect& rect, int width, int height, 
CL_Component* parent)
+  : CL_Component(rect,
                  parent),
     width(width), height(height)
 {

Modified: trunk/src/tile_selector.hxx
===================================================================
--- trunk/src/tile_selector.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/tile_selector.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -50,7 +50,7 @@
 
 public:
   /** width and height in number of tiles */
-  TileSelector(int width, int height, CL_Component* parent);
+  TileSelector(const CL_Rect& rect, int width, int height, CL_Component* 
parent);
   
   ~TileSelector();
 

Modified: trunk/src/tilemap_layer.cxx
===================================================================
--- trunk/src/tilemap_layer.cxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/tilemap_layer.cxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Modified: trunk/src/tilemap_layer.hxx
===================================================================
--- trunk/src/tilemap_layer.hxx 2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/tilemap_layer.hxx 2004-05-22 12:23:01 UTC (rev 345)
@@ -1,6 +1,6 @@
 //  $Id$
 // 
-//  Pingus - A free Lemmings clone
+//  Flexlay - A Generic 2D Game Editor
 //  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
 //
 //  This program is free software; you can redistribute it and/or

Added: trunk/src/window.cxx
===================================================================
--- trunk/src/window.cxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/window.cxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,171 @@
+//  $Id$
+//
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 <iostream>
+#include <ClanLib/Core/core_iostream.h>
+#include <ClanLib/Display/display.h>
+#include <ClanLib/Display/keys.h>
+#include <ClanLib/Display/sprite_description.h>
+#include <ClanLib/Display/Providers/provider_factory.h>
+#include <ClanLib/GUI/gui_manager.h>
+#include "box.hxx"
+#include "fonts.hxx"
+#include "icon.hxx"
+#include "window.hxx"
+
+CL_Sprite
+make_sprite(const std::string& filename)
+{
+  CL_SpriteDescription desc;
+  desc.add_frame(CL_ProviderFactory::load(filename), true);
+  return CL_Sprite(desc);
+}
+
+class WindowImpl
+{
+public:
+  CL_Component* client_area;
+  CL_Component* parent;
+
+  CL_Component* close;
+  CL_Component* minimize;
+  CL_Component* maximize;
+
+  std::vector<CL_Slot> slots;
+  CL_Point click_pos;
+  CL_Rect  old_pos;
+  bool pressed;
+  std::string title;
+
+  void draw();
+  void mouse_down(const CL_InputEvent& event);
+  void mouse_up(const CL_InputEvent& event);
+  void mouse_move(const CL_InputEvent& event);
+};
+
+Window::Window(const CL_Rect& rect, const std::string& title, CL_Component* 
parent)
+  : CL_Component(rect, parent), impl(new WindowImpl())
+{
+  impl->close = new Icon(CL_Rect(CL_Point(3, 3), CL_Size(18,18)), 
+                        make_sprite("../data/images/window/close.png"),
+                        "", this);
+  impl->minimize = new Icon(CL_Rect(CL_Point(get_width()-3-18-18, 3), 
CL_Size(18,18)), 
+                            make_sprite("../data/images/window/minimize.png"),
+                            "", this);
+  impl->maximize = new Icon(CL_Rect(CL_Point(get_width()-3-18, 3), 
CL_Size(18,18)), 
+                            make_sprite("../data/images/window/maximize.png"),
+                            "", this);
+
+  impl->client_area = new CL_Component(CL_Rect(CL_Point(3, 3+12+6), 
+                                               CL_Size(rect.get_width()-8,
+                                                       rect.get_height()-25)), 
this);
+  impl->parent = this;
+  impl->pressed = false;
+  impl->title = title;
+ 
+  impl->slots.push_back(sig_paint().connect(impl.get(),      
&WindowImpl::draw));
+  impl->slots.push_back(sig_mouse_down().connect(impl.get(), 
&WindowImpl::mouse_down));
+  impl->slots.push_back(sig_mouse_up().connect(impl.get(),   
&WindowImpl::mouse_up));
+  impl->slots.push_back(sig_mouse_move().connect(impl.get(),   
&WindowImpl::mouse_move));
+}
+
+Window::~Window()
+{
+  delete impl->client_area;
+}
+
+void
+WindowImpl::draw()
+{
+  CL_Color highlight(255, 255, 255);
+  CL_Color midtone(150, 150, 150);
+
+  CL_Rect rect = parent->get_position() ;
+
+  Box::draw_panel(CL_Rect(CL_Point(0, 0), CL_Size(rect.get_width()-1, 
rect.get_height()-1)));
+
+  CL_Display::fill_rect(CL_Rect(CL_Point(3+16,3), 
CL_Size(parent->get_width()-6-18-18-18, 12+3)), CL_Color(250, 250, 250));
+  Fonts::verdana11.draw(8+15, 3, title);
+
+  Box::draw_panel_down(client_area->get_position());
+
+  /*
+    CL_Display::fill_rect(CL_Rect(CL_Point(0, 0), rect.get_size()), 
CL_Color(220, 220, 220));
+    CL_Display::draw_rect(CL_Rect(CL_Point(0, 0), rect.get_size()), 
CL_Color(0, 0, 0));
+ 
+    CL_Display::draw_line(1, rect.get_height()-2,
+    rect.get_width()-2, rect.get_height()-2, midtone);
+    CL_Display::draw_line(rect.get_width()-2, 1,
+    rect.get_width()-2, rect.get_height()-2, midtone);
+
+    CL_Display::draw_line(1, 1,
+    rect.get_width()-2, 1, highlight);
+    CL_Display::draw_line(1, 1,
+    1, rect.get_height()-2, highlight);
+  */
+}
+
+void
+WindowImpl::mouse_down(const CL_InputEvent& event)
+{
+  if (event.id == CL_MOUSE_MIDDLE)
+    {
+      pressed = true;
+      click_pos = event.mouse_pos;
+      parent->capture_mouse();
+
+      old_pos = parent->get_position();
+      click_pos.x += old_pos.left;
+      click_pos.y += old_pos.top;
+    }
+}
+
+void
+WindowImpl::mouse_up(const CL_InputEvent& event)
+{
+  if (event.id == CL_MOUSE_MIDDLE)
+    {
+      pressed = false;
+      parent->release_mouse();
+
+      parent->raise();
+    }
+}
+
+void
+WindowImpl::mouse_move(const CL_InputEvent& event)
+{
+  if(pressed)
+    {
+      CL_Rect rect = parent->get_position();
+
+      CL_Point move(old_pos.left - (click_pos.x - (rect.left + 
event.mouse_pos.x)), 
+                    old_pos.top  - (click_pos.y - (rect.top  + 
event.mouse_pos.y)));
+
+      parent->set_position(move.x, move.y);
+    }
+}
+
+CL_Component*
+Window::get_client_area()
+{
+  return impl->client_area;
+}
+
+/* EOF */

Added: trunk/src/window.hxx
===================================================================
--- trunk/src/window.hxx        2004-05-18 23:26:29 UTC (rev 344)
+++ trunk/src/window.hxx        2004-05-22 12:23:01 UTC (rev 345)
@@ -0,0 +1,47 @@
+//  $Id$
+// 
+//  Flexlay - A Generic 2D Game Editor
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU 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 HEADER_WINDOW_HXX
+#define HEADER_WINDOW_HXX
+
+#include <ClanLib/GUI/component.h>
+#include <ClanLib/Core/Math/rect.h>
+#include "shared_ptr.hxx"
+
+class WindowImpl;
+
+/** */
+class Window : public CL_Component
+{
+private:
+public:
+  Window(const CL_Rect& rect, const std::string& title, CL_Component* parent);
+  virtual ~Window();
+
+  CL_Component* get_client_area();
+private:
+  Window (const Window&);
+  Window& operator= (const Window&);
+
+  SharedPtr<WindowImpl> impl;
+};
+
+#endif
+
+/* EOF */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]