ubit
zoomImpl.hpp
1 /* **********************************************************************
2 *
3 * zoomImpl.hpp: semantic zooming
4  * Ubit Demos - Version 6
5  * (C) 2009 Eric Lecolinet | TELECOM ParisTech | http://www.enst.fr/~elc/ubit
6 *
7 * ***********************************************************************
8 * COPYRIGHT NOTICE :
9 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15 * ************************************************************************/
16 
17 #ifndef _zoomImpl_hpp_
18 #define _zoomImpl_hpp_ 1
19 #include <ubit/ubit.hpp>
20 #include <ubit/uhtml.hpp>
21 using namespace ubit;
22 
23 
24 struct ZBox : public UBox {
25 public:
26  UCLASS(ZBox)
27  ZBox();
28  static UStyle* createStyle();
29  virtual void initNode(UDoc*);
30  void setGeom(float _x, float _y, float _w, float _h);
31  void pack(ZBox* parent_cell);
32  static void packImpl(UElem* obj, ZBox* parent_cell);
33 protected:
34  UPos pos;
35  USize size;
36 };
37 
38 struct ZMore : public UElem {
39  UCLASS(ZMore)
40  virtual void initNode(UDoc*);
41  UInscale inscale;
42 };
43 
44 struct ZLess : public UElem {
45  UCLASS(ZLess)
46  virtual void initNode(UDoc*);
47  UInscale inscale;
48 };
49 
50 struct ZLeaf : public UElem {
51  UCLASS(ZLeaf)
52  virtual void initNode(UDoc*);
53  UInscale inscale;
54 };
55 
56 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
57 
58 struct Val : public UHtmlAttribute {
59  UCLASS(Val)
60 };
61 
62 struct Geom : public UHtmlAttribute {
63  UCLASS(Geom)
64  virtual void initNode(UDoc*, UElem* parent);
65 };
66 
67 struct Shape: public UBorder {
68  UCLASS(Shape)
69  virtual void initNode(UDoc*, UElem* parent);
70  void setValue(const UStr& val) {UHtmlAttribute::setValueImpl(pvalue, val);}
71  const UStr* getValue() const {return pvalue;}
72 private:
73  uptr<UStr> pvalue;
74  std::vector<UPoint> points;
75  virtual void paint(UGraph&, const UUpdateContext&, const URect&) const;
76 };
77 
78 #endif
Widget position.
Definition: uboxgeom.hpp:91
Definition: zoomImpl.hpp:58
Zooming conditions (for semantic zooming).
Definition: uzoom.hpp:110
Box container.
Definition: ubox.hpp:64
Definition: zoomImpl.hpp:44
class for drawing on widgets.
Definition: ugraph.hpp:44
2D Rectangle.
Definition: ugeom.hpp:165
Definition: zoomImpl.hpp:67
Definition: zoomImpl.hpp:50
Generic Document.
Definition: udoc.hpp:122
lightweight general purpose container.
Definition: uelem.hpp:44
Definition: zoomImpl.hpp:62
UBox Border.
Definition: uborder.hpp:27
void setValue(const UStr &val)
changes the value of this attribute does nothing if not applicable for a given subclass.
Definition: zoomImpl.hpp:70
Definition: zoomImpl.hpp:38
Definition: uupdatecontext.hpp:32
Definition: uhardfont.hpp:31
Definition: zoomImpl.hpp:24
Widget Size.
Definition: uboxgeom.hpp:228
Compiled Object Style.
Definition: ustyle.hpp:44
HTML Attribute.
Definition: uhtml.hpp:48
Ubit String.
Definition: ustr.hpp:72