Code

Color Matrix Filter:
[inkscape.git] / src / ui / previewholder.h
2 #ifndef SEEN_PREVIEW_HOLDER_H
3 #define SEEN_PREVIEW_HOLDER_H
4 /*
5  * A simple interface for previewing representations.
6  *
7  * Authors:
8  *   Jon A. Cruz
9  *
10  * Copyright (C) 2005 Jon A. Cruz
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
16 #include <gtkmm/box.h>
17 #include <gtkmm/bin.h>
18 #include <gtkmm/table.h>
19 #include "previewfillable.h"
20 #include "../icon-size.h"
22 namespace Inkscape {
23 namespace UI {
25 class PreviewHolder : public Gtk::VBox, public PreviewFillable
26 {
27 public:
28     PreviewHolder();
29     virtual ~PreviewHolder();
31     virtual void clear();
32     virtual void addPreview( Previewable* preview );
33     virtual void freezeUpdates();
34     virtual void thawUpdates();
35     virtual void setStyle( Inkscape::IconSize size, ViewType view );
36     virtual void setOrientation( Gtk::AnchorType how );
37     virtual int getColumnPref() const { return _prefCols; }
38     virtual void setColumnPref( int cols );
39     virtual Inkscape::IconSize getPreviewSize() const { return _baseSize; }
40     virtual ViewType getPreviewType() const { return _view; }
41     virtual void setWrap( bool b );
42     virtual bool getWrap() const { return _wrap; }
44 protected:
45     virtual void on_size_allocate( Gtk::Allocation& allocation );
46     virtual void on_size_request( Gtk::Requisition* requisition );
49 private:
50     void rebuildUI();
51     void calcGridSize( const Gtk::Widget* thing, int itemCount, int& width, int& height );
53     std::vector<Previewable*> items;
54     Gtk::Bin *_scroller;
55     Gtk::Table *_insides;
56     int _prefCols;
57     bool _updatesFrozen;
58     Gtk::AnchorType _anchor;
59     Inkscape::IconSize _baseSize;
60     ViewType _view;
61     bool _wrap;
62 };
64 } //namespace UI
65 } //namespace Inkscape
67 #endif // SEEN_PREVIEW_HOLDER_H
69 /*
70   Local Variables:
71   mode:c++
72   c-file-style:"stroustrup"
73   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
74   indent-tabs-mode:nil
75   fill-column:99
76   End:
77 */
78 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :