00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _uviewImpl_hh
00027 #define _uviewImpl_hh
00028 #include <ubit/uevent.hpp>
00029 #include <ubit/uborder.hpp>
00030
00031
00032
00033 struct UMultiList {
00034 public:
00035 static const int MAXCOUNT = 2;
00036 private:
00037 ULink *list_tab[MAXCOUNT];
00038 int count;
00039 bool is_softwin_list;
00040 public:
00041
00042
00043
00044 UMultiList(class UContext& curp, UGroup* grp, bool rescale);
00045
00046 bool isSoftwinList() {return is_softwin_list;}
00047
00048
00049 void addList(ULink *l);
00050 void addSoftwinList(UGroup *grp);
00051
00052
00053 ULink* first() {return list_tab[count = 0];}
00054
00055 ULink* next(ULink *ch) {
00056 if (ch->getNext()) return ch->getNext();
00057 else if (++count < MAXCOUNT) return list_tab[count];
00058 else return null;
00059 }
00060 };
00061
00062
00063
00064
00065
00066 struct UViewExt {
00067
00068
00069 URegion* old_region;
00070
00071 u_dim kept_width, kept_height;
00072
00073 UViewExt();
00074 ~UViewExt();
00075 };
00076
00077
00078
00079
00080 struct UViewLayout {
00081 enum {NORMAL=0, GET_HINTS, IMPOSE_WIDTH, NESTED} strategy;
00082 u_dim spec_w, spec_h, cmin_w, cmax_w, cmin_h, cmax_h, line_h, line_w;
00083 UViewLayout() : strategy(NORMAL) {}
00084 };
00085
00086
00087
00088 struct UViewLayoutImpl {
00089 UView *view;
00090 int visibleElemCount;
00091 int children_w, children_h;
00092 unsigned char orient;
00093 bool mustLayoutAgain;
00094
00095 UViewLayoutImpl(UView*);
00096 void computeWidth(const UContext& curp, const UMargins&,
00097 class UViewLayout&, bool minmax_defined = false);
00098 void computeHeight(const UContext& curp, const UMargins&,
00099 class UViewLayout&, bool minmax_defined = false);
00100 };
00101
00102
00103
00104
00105 struct UViewUpdate {
00106
00107 enum Mode {
00108 PAINT_ALL,
00109 PAINT_DAMAGED,
00110
00111
00112
00113 UPDATE_DATA,
00114 LOCATE_ELEM_POS,
00115 LOCATE_ELEM_PTR
00116 } mode;
00117 UEvent *e;
00118 class UElemProps* elem_props;
00119
00120
00121
00122 int damaged_level;
00123
00124 bool after_damaged;
00125
00126 int above_damaged_count;
00127
00128 UViewUpdate(Mode _mode) {
00129 mode = _mode;
00130 e = null;
00131 elem_props = null;
00132
00133 damaged_level = 0;
00134 after_damaged = false;
00135 above_damaged_count = 0;
00136 }
00137
00138 void setMode(Mode _mode) {mode = _mode;}
00139 Mode getMode() {return mode;}
00140 };
00141
00142
00143
00144 struct UViewUpdateImpl : public URegion {
00145 UView* view;
00146 UMargins margins;
00147 URegion chr, chclip;
00148 u_dim vflex_space, hflex_space;
00149 bool can_paint;
00150 unsigned char orient;
00151 UViewUpdate& upmode;
00152 class UTableView* tabview;
00153 class UEdit* edit;
00154
00155 UViewUpdateImpl(UView*, const URegion& r, UViewUpdate&);
00156 virtual ~UViewUpdateImpl();
00157
00158 virtual void updateBackground(class UWinGraph&, UContext &curp,
00159 const URegion &r, const URegion& clip);
00160 virtual void setMargins(class UWinGraph&, const UContext &curp,
00161 const URegion &r, bool add_frame_and_paddind);
00162 virtual void setFloating(UContext& curp, UGroup* grp, URegion& r);
00163 virtual void callbacks(UGroup*, UView* winview);
00164 };
00165
00166
00167 #endif
00168
00169
00170