20 #include <ubit/uelem.hpp> 21 #include <ubit/uevent.hpp> 22 #include <ubit/ugeom.hpp> 31 class UViewLayoutImpl;
32 class UViewUpdateImpl;
67 UCLASSDEF(
"UView",
UView, null)
74 virtual UFlowView* toFlowView() {
return null;}
75 virtual UTableView* toTableView() {
return null;}
76 virtual UPaneView* toPaneView() {
return null;}
81 bool isRealized()
const;
117 UPoint getScreenPos()
const;
126 UPoint getHardwinPos()
const;
138 virtual bool caretPosToXY(
long caret_pos,
int& xcol,
int& yline)
const;
143 virtual bool xyToCaretPos(
int line,
int col,
long& caret_pos)
const;
151 UBox* getBoxParent()
const;
157 UDisp* getDisp()
const;
160 UWin* getWin()
const;
163 UView* getWinView()
const;
169 bool isChildOf(
const std::vector<UView*>& parent_views);
173 virtual bool containsWC(
const UPoint& pos_in_win);
176 virtual void updateLayout(
const UDimension* force_size,
bool upd_paint_data =
true);
179 virtual void updatePaintData(
const URect* region = null);
185 virtual void updatePaint(
const URect* region = null);
196 enum FindMode {FIND_CLIP, FIND_VIEW_CONTEXT, FIND_PARENT_CONTEXT};
202 const UData* searched_data,
int strpos1,
int strpos2);
217 REALIZED_CHILDREN = 1<<6,
218 POS_HAS_CHANGED = 1<<9,
219 SIZE_HAS_CHANGED = 1<<10,
220 NO_DOUBLE_BUFFER = 1<< 11
224 typedef std::list<UViewProp*> UViewProps;
229 void operator delete(
void*);
232 int getVModes()
const {
return vmodes;}
235 bool hasVMode(
int modes)
const {
return (vmodes & modes) != 0;}
238 void addVModes(
long modes) {vmodes |= modes;}
241 void removeVModes(
long modes) {vmodes &= ~modes;}
244 virtual UViewStyle* getViewStyle() {
return &style;}
247 UView* getNext() {
return next;}
250 template <
typename T> T* getProp(T*& p) {
252 for (UViewProps::iterator i = props.begin(); i != props.end(); ++i)
253 {
if (dynamic_cast<T*>(*i)) {p = (T*)*i;
return p;} }
258 template <
typename T> T& obtainProp(T*& p) {
259 getProp(p);
if (!p) {p =
new T(); props.push_back(p);}
return *p;
263 void incrHFlexCount() {++hflex_count;}
264 void incrVFlexCount() {++vflex_count;}
265 void setScale(
float s) {scale = s;}
273 float chwidth, chheight;
275 unsigned short hflex_count, vflex_count;
282 void setParentView(
UView* parent_view);
283 void setNext(
UView* v) {next = v;}
340 virtual UViewStyle* getViewStyle() {
return &style;}
350 virtual bool caretPosToXY(
long caret_pos,
int& xcol,
int& yline)
const;
351 virtual bool xyToCaretPos(
int xcol,
int yline,
long& caret_pos)
const;
356 float getMaxWidth()
const;
364 int line_count, cell_count, lastline_strcell;
365 int alloc_line_count, alloc_cell_count;
information on UData objects that are being retrieved by UEvent::getData() or UEvent::getStr().
Definition: uevent.hpp:524
Base class for attributes.
Definition: uattr.hpp:97
2D Dimension.
Definition: ugeom.hpp:55
Definition: utable.hpp:108
Definition: uviewImpl.hpp:92
Definition: uobject.hpp:282
Box container.
Definition: ubox.hpp:64
2D Point.
Definition: ugeom.hpp:25
UView *(* createView)(UBox *, UView *parview, UHardwinImpl *)
pointer to the corresponding UView::createView static constructor.
Definition: uview.hpp:49
Definition: uappliImpl.hpp:40
Definition: uviewflow.cpp:38
2D Rectangle.
Definition: ugeom.hpp:165
Display Context.
Definition: udisp.hpp:44
float getWidth() const
returns the width of the view.
Definition: uview.hpp:84
Definition: uviewImpl.hpp:141
Definition: uviewflow.cpp:491
float getHeight() const
returns the height of the view.
Definition: uview.hpp:87
Base class for Viewable Objects.
Definition: udata.hpp:31
Definition: uviewflow.cpp:46
lightweight general purpose container.
Definition: uelem.hpp:44
UBox * getBox() const
returns the widget that controls this view.
Definition: uview.hpp:148
Definition: uviewImpl.hpp:178
UView * getParentView() const
returns the parent view (if any, null for window views).
Definition: uview.hpp:154
float getScale() const
returns the scaling factor applied to this view.
Definition: uview.hpp:134
Definition: uviewImpl.hpp:203
Definition: uview.hpp:335
virtual void addingTo(UChild &, UElem &parent)
called when this object is added to a parent.
Definition: uview.cpp:39
UHardwinImpl * getHardwin() const
returns the hard window that contains this view.
Definition: uview.hpp:166
Event Flow.
Definition: ueventflow.hpp:34
virtual void destructs()
unlinks the object from its parents and destroys its children.
Definition: unode.cpp:56
Box View.
Definition: uview.hpp:65
Specifies the View Style of an UBox.
Definition: uview.hpp:42
Definition: uupdatecontext.hpp:32
Definition: uviewflow.cpp:139
Definition: uhardfont.hpp:31
virtual void removingFrom(UChild &, UElem &parent)
NOTE that this function require a specific destructor.
Definition: uview.cpp:47
Definition: uwinImpl.hpp:84
virtual bool isChildOf(const UElem &parent, bool indirect=true) const
returns true if this object a child of 'parent'.
Definition: unode.cpp:249
Definition: uviewImpl.hpp:114
Base class for windows and menus.
Definition: uwin.hpp:47
Definition: uviewImpl.hpp:123
Definition: uviewImpl.hpp:78
Subwindow: a hard window that is embedded inside another window.
Definition: usubwin.hpp:33
[Impl] UPane View.
Definition: uscrollpane.hpp:127
[impl] Internal implementation of a child node.
Definition: uchild.hpp:23
virtual UFlowView * toFlowView()
pseudo dynamic cast: returns this object if it a a UFlowView.
Definition: uview.hpp:347