diff options
Diffstat (limited to 'src/Container.hh')
-rw-r--r-- | src/Container.hh | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Container.hh b/src/Container.hh index ffa7d93..5f2ca4b 100644 --- a/src/Container.hh +++ b/src/Container.hh | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: Container.hh,v 1.2 2003/08/13 09:39:16 fluxgen Exp $ | 23 | // $Id: Container.hh,v 1.3 2003/09/08 16:28:32 fluxgen Exp $ |
24 | 24 | ||
25 | #ifndef CONTAINER_HH | 25 | #ifndef CONTAINER_HH |
26 | #define CONTAINER_HH | 26 | #define CONTAINER_HH |
@@ -51,21 +51,28 @@ public: | |||
51 | void removeAll(); | 51 | void removeAll(); |
52 | int find(Item item); | 52 | int find(Item item); |
53 | void setSelected(int index); | 53 | void setSelected(int index); |
54 | /// force update | ||
55 | inline void update() { repositionItems(); } | ||
56 | /// so we can add items without having an graphic update for each item | ||
57 | inline void setUpdateLock(bool value) { m_update_lock = value; } | ||
54 | 58 | ||
55 | // event handler | 59 | /// event handler |
56 | void exposeEvent(XExposeEvent &event); | 60 | void exposeEvent(XExposeEvent &event); |
57 | 61 | ||
58 | // accessors | 62 | /// accessors |
59 | int size() const { return m_item_list.size(); } | 63 | inline int size() const { return m_item_list.size(); } |
60 | const Item selected() const { return m_selected; } | 64 | inline const Item selected() const { return m_selected; } |
61 | Item selected() { return m_selected; } | 65 | inline Item selected() { return m_selected; } |
62 | unsigned int maxWidthPerClient() const; | 66 | unsigned int maxWidthPerClient() const; |
63 | unsigned int maxHeightPerClient() const { return (size() == 0 ? height() : height()/size()); } | 67 | inline unsigned int maxHeightPerClient() const { return (size() == 0 ? height() : height()/size()); } |
68 | inline bool updateLock() const { return m_update_lock; } | ||
69 | |||
64 | private: | 70 | private: |
65 | void repositionItems(); | 71 | void repositionItems(); |
66 | 72 | ||
67 | ItemList m_item_list; | 73 | ItemList m_item_list; |
68 | Item m_selected; | 74 | Item m_selected; |
75 | bool m_update_lock; | ||
69 | }; | 76 | }; |
70 | 77 | ||
71 | #endif // CONTAINER_HH | 78 | #endif // CONTAINER_HH |