00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _uviewImpl_hpp_
00022 #define _uviewImpl_hpp_
00023 #include <ubit/uevent.hpp>
00024 #include <ubit/uborder.hpp>
00025 namespace ubit {
00026
00027
00028
00029 struct UViewLayout {
00030 enum Strategy {BOXVIEW, GET_HINTS, IMPOSE_WIDTH, NESTED} strategy;
00031 int w, spec_w, min_w, max_w;
00032 int h, spec_h, min_h, max_h;
00033 UViewLayout() : strategy(BOXVIEW) {}
00034 };
00035
00036
00037
00038 struct UViewLayoutImpl {
00039 UViewLayoutImpl(UView*);
00040 void computeWidth(const UContext& curp, const UMargins&,
00041 UViewLayout&, bool minmax_defined);
00042 void computeHeight(const UContext& curp, const UMargins&,
00043 UViewLayout&, bool minmax_defined);
00044
00045 UView* view;
00046 int visibleElemCount;
00047 int chwidth, pos_chwidth, chheight, pos_chheight;
00048 unsigned char orient;
00049 bool mustLayoutAgain;
00050 };
00051
00052
00053
00054 struct UViewUpdate {
00055
00056 enum Mode {
00057 PAINT_ALL,
00058 PAINT_DAMAGED,
00059
00060
00061
00062 UPDATE_DATA,
00063 FIND_DATA_POS,
00064 FIND_DATA_PTR
00065 };
00066
00067 UViewUpdate(Mode _mode) {
00068 mode = _mode;
00069 e = null;
00070 data_props = null;
00071
00072 damaged_level = 0;
00073 after_damaged = false;
00074 above_damaged_count = 0;
00075 }
00076
00077 void setMode(Mode _mode) {mode = _mode;}
00078 Mode getMode() {return mode;}
00079
00080 Mode mode;
00081 UMouseEvent* e;
00082 UDataProps* data_props;
00083
00084
00085
00086 int damaged_level;
00087
00088 bool after_damaged;
00089
00090 int above_damaged_count;
00091 };
00092
00093
00094
00095 struct UViewUpdateImpl : public URegion {
00096
00097 UViewUpdateImpl(UView*, const URegion& r, UViewUpdate&);
00098 virtual ~UViewUpdateImpl();
00099
00100 virtual void updateBackground(UGraph&, UContext&,
00101 const URegion &r, const URegion& clip);
00102 virtual void setMargins(UGraph&, const UContext&,
00103 const URegion &r, bool add_frame_and_paddind);
00104 virtual void callResizeCallbacks(UGroup*, UContext&);
00105 virtual void callPaintCallbacks(UGroup*, UContext&);
00106
00107 UView* view;
00108 UMargins margins;
00109 URegion chr, chclip;
00110 int vflex_space, hflex_space;
00111 bool can_paint;
00112 unsigned char orient;
00113 UViewUpdate& upmode;
00114 class UTableView* tabview;
00115 class UEdit* edit;
00116 };
00117
00118
00119
00120 struct UMultiList {
00121 static const int MAXCOUNT = 2;
00122
00123
00124
00125
00126 UMultiList(UContext& curp, UGroup* grp);
00127
00128 UChildIter begin() {return sublists[current = 0].begin;}
00129 UChildIter end() {return sublists[current].end;}
00130
00131
00132 void next(UChildIter& c);
00133 void addChildList(UChildIter begin, UChildIter end);
00134 UChildren* getSoftwinList(UGroup*);
00135
00136
00137 struct SubList {UChildIter begin, end;};
00138 SubList sublists[MAXCOUNT];
00139 int card, current;
00140 bool in_softwin_list;
00141 };
00142
00143 }
00144 #endif
00145
00146
00147