00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _udisp_hpp_
00021 #define _udisp_hpp_
00022
00023 #include <ubit/ubrick.hpp>
00024 #include <ubit/ustr.hpp>
00025 #include <ubit/ugroup.hpp>
00026 namespace ubit {
00027
00028
00036 class UDisp {
00037 public:
00038 UDisp(const UStr& display_name);
00039 UDisp(UConf&);
00051 virtual ~UDisp();
00052
00053 const UConf& getConf() const {return conf;}
00055
00056 int getID() const {return id;}
00061 bool isOpened() const;
00063
00064
00065
00066 virtual void add(UWin&);
00075 virtual void remove(UWin&, bool auto_delete);
00080
00081
00082 int getDepth() const;
00084
00085 const UStr& getDisplayName() const;
00087
00088 int getScreenWidth() const;
00089 int getScreenHeight() const;
00091
00092 int getScreenNumber() const;
00094
00095 int getScreenCount() const;
00096
00097
00098 void flush();
00100
00101 bool isRealized() const;
00103
00104
00105
00106 void setPointerPos(const UPoint& screen_pos, int channel = 0) const;
00108
00109 UPoint getPointerPos(int channel = 0) const;
00111
00112 int getPointerState(int channel = 0) const;
00114
00115 bool grabPointer(const UCursor* = null);
00124 void ungrabPointer();
00129 bool pickWindow(UNatWin& picked_win, int& x_in_win, int& y_in_win,
00130 UCursor* = null);
00131 bool pickWindow(UNatWin& picked_win, int& x_in_win, int& y_in_win,
00132 UCall& callback, UCursor* = null);
00144
00145
00146 UEventFlow* getDispFlow(int channel) const;
00156 UEventFlow* obtainDispFlow(int channel);
00162 USelection* getDispSelection(int channel);
00167
00168
00169 #ifndef WITH_GDK
00170 int setTrueColors(int depth_hint);
00171 int setPseudoColors(int depth_hint);
00185 #endif
00186
00187 virtual void realize();
00194 UNatDisp* getNatDisp() const {return natdisp;}
00196
00197 void copySelection(UEvent&, USelection&);
00202 void pasteSelection(UEvent& e, UStr* _paste_to_str, int _paste_to_pos);
00208 void addHardWin(UWin*);
00209 void removeHardWin(UWin*);
00211
00212 void realizeFont(const UFont&);
00213 bool realizeColor(UColor&);
00214 bool realizeCursor(UCursor&);
00216
00217
00218 #ifndef NO_DOC
00219 protected:
00220 friend class UConf;
00221 friend class UWin;
00222 friend class UHardWinImpl;
00223 friend class UView;
00224 friend class UGraph;
00225 friend class UNatDisp;
00226 friend class UEvent;
00227 friend class UFontMetrics;
00228
00229
00230
00231
00232
00233 int id;
00234 UConf& conf;
00235 UStr display_name;
00236 UNatDisp* natdisp;
00237 UChildren hardwin_list;
00238
00239
00240
00241 UStr copy_buffer;
00242
00243
00244
00245 uptr<UStr> paste_to_str;
00246 int paste_to_pos;
00247
00248
00249 UGroup winlist;
00250
00251 bool pickWindow(UNatWin& w, int& x, int& y, UCall* call, UCursor* curs);
00252 #endif
00253 };
00254
00255 }
00256 #endif
00257