Code

Fix node tool crash on path where the last subpath is a lone moveto
[inkscape.git] / src / ui / previewholder.h
index 532aa771f91966bb0b77a8969c23b9fb93f50a1d..3c1a161955e9c5ef2a9916fbb12965a8a48d75dd 100644 (file)
@@ -17,6 +17,7 @@
 #include <gtkmm/bin.h>
 #include <gtkmm/table.h>
 #include "previewfillable.h"
+#include "../widgets/eek-preview.h"
 
 namespace Inkscape {
 namespace UI {
@@ -29,20 +30,37 @@ public:
 
     virtual void clear();
     virtual void addPreview( Previewable* preview );
-    virtual void setStyle(Gtk::BuiltinIconSize size, ViewType view);
+    virtual void freezeUpdates();
+    virtual void thawUpdates();
+    virtual void setStyle( ::PreviewSize size, ViewType view, guint ratio );
     virtual void setOrientation( Gtk::AnchorType how );
-    virtual Gtk::BuiltinIconSize getPreviewSize() const { return _baseSize; }
+    virtual int getColumnPref() const { return _prefCols; }
+    virtual void setColumnPref( int cols );
+    virtual ::PreviewSize getPreviewSize() const { return _baseSize; }
     virtual ViewType getPreviewType() const { return _view; }
+    virtual guint getPreviewRatio() const { return _ratio; }
+    virtual void setWrap( bool b );
+    virtual bool getWrap() const { return _wrap; }
+
+protected:
+    virtual void on_size_allocate( Gtk::Allocation& allocation );
+    virtual void on_size_request( Gtk::Requisition* requisition );
+
 
 private:
     void rebuildUI();
+    void calcGridSize( const Gtk::Widget* thing, int itemCount, int& width, int& height );
 
     std::vector<Previewable*> items;
     Gtk::Bin *_scroller;
     Gtk::Table *_insides;
+    int _prefCols;
+    bool _updatesFrozen;
     Gtk::AnchorType _anchor;
-    Gtk::BuiltinIconSize _baseSize;
+    ::PreviewSize _baseSize;
+    guint _ratio;
     ViewType _view;
+    bool _wrap;
 };
 
 } //namespace UI