00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _ueventImpl_hpp_
00022 #define _ueventImpl_hpp_
00023
00024 #include <ubit/ugeom.hpp>
00025
00026
00029 #ifdef WITH_GDK
00030 typedef union _GdkEvent* USysEvent;
00031 #else
00032 typedef union _XEvent* USysEvent;
00033 #endif
00034
00035 namespace ubit {
00036
00037
00038
00039
00040 struct UEventProps {
00041 UEventProps(UView* hardwin_view = null, UContext* parent_context = null);
00042 void reset(UView* hardwin_view, UContext* parent_context);
00043 void update(UView* view, UGroup*, const UContext& curp);
00044
00045 enum {
00046 ENABLED = 1<<0,
00047 IN_MENU = 1<<1,
00048 AUTO_CLOSE_MENU = 1<<2,
00049
00050
00051 HAS_REDRAW_CLIP = 1<<5
00052 };
00053 unsigned short modes;
00054
00055 UMask parent_bmodes;
00056
00057 float xyscale;
00059
00060 inline bool hasRedrawClip() {return modes & HAS_REDRAW_CLIP;}
00061 URegion redrawClip;
00066 const UCursor* cursor;
00068
00069 UView* opaqueView;
00071
00072 UView* layoutView;
00074
00075 UView* childwinView;
00076
00077
00078 UGroup *browsingGroup;
00079 UGroup *parentBrowsingGroup;
00081
00082 UContext* parentContext, *childContext;
00084 };
00085
00086
00087
00088
00089 struct UEventImpl {
00090 public:
00091 bool initFromView(UView*);
00092 void setCond(const UCond&);
00093 void setDetail(int);
00094 void setSource(UBrick*);
00095 void setSource(UView*);
00096 void setTarget(UBrick*);
00097 void setWhen(UTime);
00098 void setPosImpl(int xwin, int ywin);
00099 void translatePos(int x, int y);
00100 void setFirstDrag(bool);
00101
00102 UData* searchData(const UData* searched_data, UDataProps&,
00103 int str_pos1, int str_pos2);
00104
00105
00106
00107
00108
00109
00110
00111 bool u3dIsTransformed() const;
00112 void u3dTransformMouse(int x, int y, UView* transformedView);
00113
00114
00115
00116
00117
00118
00119 void u3dRestoreMouse();
00120
00121
00122 void u3dPushMatch();
00123
00124
00125 void u3dPopMatch();
00126
00127
00128 const UEventProps& props() const {return _props;}
00129
00130 protected:
00131 UEventImpl(UEventFlow*, UView* hardwin_view, USysEvent, UTime, const UCond*);
00132 virtual ~UEventImpl();
00133
00134 void actualize(const UCond&, UEvent&);
00135
00136
00137 public:
00138 UEventProps _props;
00139 const UCond* cond;
00140 int detail;
00141 unsigned long misc;
00142 UTime time;
00143 int xmouse, ymouse;
00144 int xdrag_ref, ydrag_ref;
00145 USysEvent sys_event;
00146 UBrick* source;
00147 UBrick* aux;
00148 UView* sourceView;
00149 UView* hardWinView;
00150 UEventFlow* eflow;
00151 std::vector<const UFlagdef*>flagdefs;
00152
00153
00154 UView* transformView;
00155 int xmouse_orig, ymouse_orig;
00156 int xmouse_match, ymouse_match;
00157
00158 unsigned char
00159 coord_changed:1,
00160 is_consumed:1, is_ignored:1, is_browsing:1, is_mdrag:1, is_first_mdrag:1;
00161 };
00162
00163 }
00164 #endif
00165
00166
00167