00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _update_hpp_
00021 #define _update_hpp_
00022
00023 #include <ubit/udefs.hpp>
00024 namespace ubit {
00025
00026
00030 class UUpdate {
00031 public:
00032 enum {
00033 PAINT = 1<<0,
00035
00036 LAYOUT = 1<<1,
00038
00039 LAYOUT_PAINT = (LAYOUT | PAINT),
00040
00041 NO_DELAY = 1<<2,
00047 HIDDEN_OBJECTS = 1<<3,
00052 SOFT_DBF = 1<<4,
00057 NO_SOFT_DBF = 1<<5,
00062 SHOW = 1<<6,
00063 HIDE = 1<<7,
00064 ADJUST_WIN_SIZE = 1<<8
00065 };
00066
00067 static const UUpdate paint;
00069
00070 static const UUpdate layoutAndPaint;
00072
00073 ~UUpdate();
00074
00075 UUpdate(unsigned int mode_mask = LAYOUT|PAINT);
00088 UUpdate(const UUpdate&);
00089 UUpdate& operator=(const UUpdate&);
00090
00091 bool operator==(const UUpdate&);
00092
00093 void noDelay() {modes |= NO_DELAY;}
00095
00096 void hiddenObjects() {modes |= HIDDEN_OBJECTS;}
00098
00099 void softDbf() {modes |= SOFT_DBF;}
00101
00102 UMask getModes() const {return modes;}
00104
00105 void addModes(unsigned int m) {modes |= m;}
00106 int getDbfMode() const;
00107 bool isHiddenObjectsMode() const {return (modes & HIDDEN_OBJECTS) != 0;}
00108
00109 void setPaintData(const UData*);
00111
00112 void setPaintStr(const UStr*, int strpos1, int strpos2);
00114
00115 void setMove(float delta_x, float delta_y, bool is_percent);
00117
00118 void setScroll(float delta_x, float delta_y, bool is_percent);
00120
00121
00122 private:
00123 friend class UGroup;
00124 friend class UBox;
00125 friend class UWin;
00126 friend class UHardWinImpl;
00127 friend class USoftWinImpl;
00128 friend class UAppliImpl;
00129
00130 enum {
00131 PROCESS_REQUESTS = 1<<10,
00132 ADD_REMOVE = 1<<11,
00133 STR_DATA = 1<<12,
00134 SCROLL = 1<<13,
00135 MOVE = 1<<14
00136 };
00137
00138 UMask modes;
00139
00140 public:
00141 struct ScrollMove {
00142 ScrollMove(float dx, float dy, bool pd);
00143 float delta_x, delta_y;
00144 bool percent_delta;
00145 int refcount;
00146 };
00147
00148 struct StrData {
00149 StrData(const UData* d, int p1, int p2);
00150 const UData* data;
00151 const URegion* region;
00152 int pos1, pos2;
00153 int refcount;
00154 };
00155
00156 private:
00157
00158
00159 union UpdateImpl {
00160 StrData* sd;
00161 ScrollMove* sm;
00162 } props;
00163 };
00164
00165 }
00166 #endif
00167
00168