00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGWin32VirtualXProxy
00013 #define ROOT_TGWin32VirtualXProxy
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ROOT_TVirtualX
00024 #include "TVirtualX.h"
00025 #endif
00026
00027 #ifndef ROOT_TGWin32ProxyBase
00028 #include "TGWin32ProxyBase.h"
00029 #endif
00030
00031 class TGWin32;
00032
00033
00034 class TGWin32VirtualXProxy: public TVirtualX , public TGWin32ProxyBase {
00035
00036 friend class TGWin32;
00037
00038 protected:
00039 static TVirtualX *fgRealObject;
00040
00041 public:
00042 TGWin32VirtualXProxy() { fMaxResponseTime = 1000; fIsVirtualX = kTRUE; }
00043 TGWin32VirtualXProxy(const char *name, const char *title) {}
00044 virtual ~TGWin32VirtualXProxy() {}
00045
00046 Bool_t Init(void *display=0);
00047 void ClearWindow();
00048 void ClosePixmap();
00049 void CloseWindow();
00050 void CopyPixmap(Int_t wid, Int_t xpos, Int_t ypos);
00051 void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode);
00052 void DrawCellArray(Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, Int_t *ic);
00053 void DrawFillArea(Int_t n, TPoint *xy);
00054 void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2);
00055 void DrawPolyLine(Int_t n, TPoint *xy);
00056 void DrawPolyMarker(Int_t n, TPoint *xy);
00057 void DrawText(Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode);
00058 void GetCharacterUp(Float_t &chupx, Float_t &chupy);
00059 EDrawMode GetDrawMode();
00060 Int_t GetDoubleBuffer(Int_t wid);
00061 void GetGeometry(Int_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
00062 const char *DisplayName(const char * = 0);
00063 Handle_t GetNativeEvent() const;
00064 ULong_t GetPixel(Color_t cindex);
00065 void GetPlanes(Int_t &nplanes);
00066 void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b);
00067 void GetTextExtent(UInt_t &w, UInt_t &h, char *mess);
00068 Float_t GetTextMagnitude();
00069 Window_t GetWindowID(Int_t wid);
00070 Bool_t HasTTFonts() const;
00071 Int_t InitWindow(ULong_t window);
00072 void MoveWindow(Int_t wid, Int_t x, Int_t y);
00073 Int_t OpenPixmap(UInt_t w, UInt_t h);
00074 void QueryPointer(Int_t &ix, Int_t &iy);
00075 void ReadGIF(Int_t x0, Int_t y0, const char *file);
00076 Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y);
00077 Int_t RequestString(Int_t x, Int_t y, char *text);
00078 void RescaleWindow(Int_t wid, UInt_t w, UInt_t h);
00079 Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h);
00080 void ResizeWindow(Int_t wid);
00081 void SelectWindow(Int_t wid);
00082 void SetCharacterUp(Float_t chupx, Float_t chupy);
00083 void SetClipOFF(Int_t wid);
00084 void SetClipRegion(Int_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);
00085 void SetCursor(Int_t win, ECursor cursor);
00086 void SetDoubleBuffer(Int_t wid, Int_t mode);
00087 void SetDoubleBufferOFF();
00088 void SetDoubleBufferON();
00089 void SetDrawMode(EDrawMode mode);
00090 void SetFillColor(Color_t cindex);
00091 void SetFillStyle(Style_t style);
00092 void SetFillAttributes();
00093 void ResetAttFill(Option_t *option="");
00094 Color_t GetFillColor() const;
00095 Style_t GetFillStyle() const;
00096 Bool_t IsTransparent() const;
00097 void SetLineColor(Color_t cindex);
00098 void SetLineType(Int_t n, Int_t *dash);
00099 void SetLineStyle(Style_t linestyle);
00100 void SetLineWidth(Width_t width);
00101 void SetLineAttributes();
00102 void ResetAttLine(Option_t *option="");
00103 Color_t GetLineColor() const;
00104 Style_t GetLineStyle() const;
00105 Width_t GetLineWidth() const;
00106 void SetMarkerColor(Color_t cindex);
00107 void SetMarkerSize(Float_t markersize);
00108 void SetMarkerStyle(Style_t markerstyle);
00109 void ResetAttMarker(Option_t *toption="");
00110 void SetMarkerAttributes();
00111 Color_t GetMarkerColor() const;
00112 Style_t GetMarkerStyle() const;
00113 Size_t GetMarkerSize() const;
00114 void SetOpacity(Int_t percent);
00115 void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b);
00116 void SetTextAlign(Short_t talign=11);
00117 void SetTextColor(Color_t cindex=1);
00118 void SetTextAngle(Float_t tangle=0);
00119 Int_t SetTextFont(char *fontname, ETextSetMode mode);
00120 void SetTextFont(Font_t fontnumber=62);
00121 void SetTextMagnitude(Float_t mgn);
00122 void SetTextSize(Float_t textsize=1);
00123 void SetTextSizePixels(Int_t npixels);
00124 void SetTextAttributes();
00125 void ResetAttText(Option_t *toption="");
00126 Short_t GetTextAlign() const;
00127 Float_t GetTextAngle() const;
00128 Color_t GetTextColor() const;
00129 Font_t GetTextFont() const;
00130 Float_t GetTextSize() const;
00131 void UpdateWindow(Int_t mode);
00132 void Warp(Int_t ix, Int_t iy, Window_t id = 0);
00133 Int_t WriteGIF(char *name);
00134 void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname);
00135 void GetWindowAttributes(Window_t id, WindowAttributes_t &attr);
00136 void MapWindow(Window_t id);
00137 void MapSubwindows(Window_t id);
00138 void MapRaised(Window_t id);
00139 void UnmapWindow(Window_t id);
00140 void DestroyWindow(Window_t id);
00141 void DestroySubwindows(Window_t id);
00142 void RaiseWindow(Window_t id);
00143 void LowerWindow(Window_t id);
00144 void MoveWindow(Window_t id, Int_t x, Int_t y);
00145 void MoveResizeWindow(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h);
00146 void ResizeWindow(Window_t id, UInt_t w, UInt_t h);
00147 void IconifyWindow(Window_t id);
00148 void ReparentWindow(Window_t id, Window_t pid, Int_t x, Int_t y);
00149 void SetWindowBackground(Window_t id, ULong_t color);
00150 void SetWindowBackgroundPixmap(Window_t id, Pixmap_t pxm);
00151 Window_t CreateWindow(Window_t parent, Int_t x, Int_t y,
00152 UInt_t w, UInt_t h, UInt_t border, Int_t depth, UInt_t clss,
00153 void *visual, SetWindowAttributes_t *attr, UInt_t wtype);
00154 Int_t OpenDisplay(const char *dpyName=0);
00155 void CloseDisplay();
00156 Display_t GetDisplay() const;
00157 Visual_t GetVisual() const;
00158 Int_t GetScreen() const;
00159 Int_t GetDepth() const;
00160 Colormap_t GetColormap() const;
00161 Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist);
00162 Window_t GetDefaultRootWindow() const;
00163 Window_t GetParent(Window_t id) const;
00164 FontStruct_t LoadQueryFont(const char *font_name);
00165 FontH_t GetFontHandle(FontStruct_t fs);
00166 void DeleteFont(FontStruct_t fs);
00167 GContext_t CreateGC(Drawable_t id, GCValues_t *gval);
00168 void ChangeGC(GContext_t gc, GCValues_t *gval);
00169 void CopyGC(GContext_t org, GContext_t dest, Mask_t mask);
00170 void DeleteGC(GContext_t gc);
00171 Cursor_t CreateCursor(ECursor cursor);
00172 void SetCursor(Window_t id, Cursor_t curid);
00173 Pixmap_t CreatePixmap(Drawable_t id, UInt_t w, UInt_t h);
00174 Pixmap_t CreatePixmap(Drawable_t id, const char *bitmap, UInt_t width,
00175 UInt_t height, ULong_t forecolor, ULong_t backcolor, Int_t depth);
00176 Pixmap_t CreateBitmap(Drawable_t id, const char *bitmap, UInt_t width, UInt_t height);
00177 void DeletePixmap(Pixmap_t pmap);
00178 Bool_t CreatePictureFromFile(Drawable_t id, const char *filename,
00179 Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr);
00180 Bool_t CreatePictureFromData(Drawable_t id, char **data,
00181 Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr);
00182 Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data);
00183 void DeletePictureData(void *data);
00184 void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n);
00185 Bool_t ParseColor(Colormap_t cmap, const char *cname, ColorStruct_t &color);
00186 Bool_t AllocColor(Colormap_t cmap, ColorStruct_t &color);
00187 void QueryColor(Colormap_t cmap, ColorStruct_t &color);
00188 void FreeColor(Colormap_t cmap, ULong_t pixel);
00189 void Bell(Int_t percent);
00190 void CopyArea(Drawable_t src, Drawable_t dest, GContext_t gc, Int_t src_x,
00191 Int_t src_y, UInt_t width, UInt_t height, Int_t dest_x, Int_t dest_y);
00192 void ChangeWindowAttributes(Window_t id, SetWindowAttributes_t *attr);
00193 void ChangeProperty(Window_t id, Atom_t property, Atom_t type, UChar_t *data, Int_t len);
00194 void DrawLine(Drawable_t id, GContext_t gc, Int_t x1, Int_t y1, Int_t x2, Int_t y2);
00195 void ClearArea(Window_t id, Int_t x, Int_t y, UInt_t w, UInt_t h);
00196 void WMDeleteNotify(Window_t id);
00197 void SetKeyAutoRepeat(Bool_t on = kTRUE);
00198 void GrabKey(Window_t id, Int_t keycode, UInt_t modifier, Bool_t grab = kTRUE);
00199 void GrabButton(Window_t id, EMouseButton button, UInt_t modifier,
00200 UInt_t evmask, Window_t confine, Cursor_t cursor, Bool_t grab = kTRUE);
00201 void GrabPointer(Window_t id, UInt_t evmask, Window_t confine,
00202 Cursor_t cursor, Bool_t grab = kTRUE, Bool_t owner_events = kTRUE);
00203 void SetWindowName(Window_t id, char *name);
00204 void SetIconName(Window_t id, char *name);
00205 void SetIconPixmap(Window_t id, Pixmap_t pix);
00206 void SetClassHints(Window_t id, char *className, char *resourceName);
00207 void SetMWMHints(Window_t id, UInt_t value, UInt_t funcs, UInt_t input);
00208 void SetWMPosition(Window_t id, Int_t x, Int_t y);
00209 void SetWMSize(Window_t id, UInt_t w, UInt_t h);
00210 void SetWMSizeHints(Window_t id, UInt_t wmin, UInt_t hmin,
00211 UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc);
00212 void SetWMState(Window_t id, EInitialState state);
00213 void SetWMTransientHint(Window_t id, Window_t main_id);
00214 void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len);
00215 Int_t TextWidth(FontStruct_t font, const char *s, Int_t len);
00216 void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent);
00217 void GetGCValues(GContext_t gc, GCValues_t &gval);
00218 FontStruct_t GetFontStruct(FontH_t fh);
00219 void FreeFontStruct(FontStruct_t fs);
00220 void ClearWindow(Window_t id);
00221 Int_t KeysymToKeycode(UInt_t keysym);
00222 void FillRectangle(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h);
00223 void DrawRectangle(Drawable_t id, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h);
00224 void DrawSegments(Drawable_t id, GContext_t gc, Segment_t *seg, Int_t nseg);
00225 void SelectInput(Window_t id, UInt_t evmask);
00226 Window_t GetInputFocus();
00227 void SetInputFocus(Window_t id);
00228 Window_t GetPrimarySelectionOwner();
00229 void SetPrimarySelectionOwner(Window_t id);
00230 void ConvertPrimarySelection(Window_t id, Atom_t clipboard, Time_t when);
00231 void LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym);
00232 void GetPasteBuffer(Window_t id, Atom_t atom, TString &text, Int_t &nchar, Bool_t del);
00233 void TranslateCoordinates(Window_t src, Window_t dest, Int_t src_x,
00234 Int_t src_y, Int_t &dest_x, Int_t &dest_y, Window_t &child);
00235 void GetWindowSize(Drawable_t id, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
00236 void FillPolygon(Window_t id, GContext_t gc, Point_t *points, Int_t npnt);
00237 void QueryPointer(Window_t id, Window_t &rootw, Window_t &childw,
00238 Int_t &root_x, Int_t &root_y, Int_t &win_x, Int_t &win_y, UInt_t &mask);
00239 void SetForeground(GContext_t gc, ULong_t foreground);
00240 void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n);
00241 void Update(Int_t mode = 0);
00242 Region_t CreateRegion();
00243 void DestroyRegion(Region_t reg);
00244 void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest);
00245 Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding);
00246 void UnionRegion(Region_t rega, Region_t regb, Region_t result);
00247 void IntersectRegion(Region_t rega, Region_t regb, Region_t result);
00248 void SubtractRegion(Region_t rega, Region_t regb, Region_t result);
00249 void XorRegion(Region_t rega, Region_t regb, Region_t result);
00250 Bool_t EmptyRegion(Region_t reg);
00251 Bool_t PointInRegion(Int_t x, Int_t y, Region_t reg);
00252 Bool_t EqualRegion(Region_t rega, Region_t regb);
00253 void GetRegionBox(Region_t reg, Rectangle_t *rect);
00254 char **ListFonts(const char *fontname, Int_t max, Int_t &count);
00255 void FreeFontNames(char **fontlist);
00256 Drawable_t CreateImage(UInt_t width, UInt_t height);
00257 void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &height);
00258 void PutPixel(Drawable_t id, Int_t x, Int_t y, ULong_t pixel);
00259 void PutImage(Drawable_t id, GContext_t gc, Drawable_t img,
00260 Int_t dx, Int_t dy, Int_t x, Int_t y, UInt_t w, UInt_t h);
00261 void DeleteImage(Drawable_t img);
00262 unsigned char *GetColorBits(Drawable_t wid, Int_t x, Int_t y, UInt_t width, UInt_t height);
00263 Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height);
00264 Int_t AddWindow(ULong_t qwid, UInt_t w, UInt_t h);
00265 void RemoveWindow(ULong_t qwid);
00266 void ShapeCombineMask(Window_t id, Int_t x, Int_t y, Pixmap_t mask);
00267
00268 void DeleteProperty(Window_t, Atom_t&);
00269 Int_t GetProperty(Window_t, Atom_t, Long_t, Long_t, Bool_t, Atom_t,
00270 Atom_t*, Int_t*, ULong_t*, ULong_t*, unsigned char**);
00271 void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t);
00272 void ConvertSelection(Window_t, Atom_t&, Atom_t&, Atom_t&, Time_t&);
00273 Bool_t SetSelectionOwner(Window_t, Atom_t&);
00274 void ChangeProperties(Window_t id, Atom_t property, Atom_t type,
00275 Int_t format, UChar_t *data, Int_t len);
00276 void SetDNDAware(Window_t win, Atom_t *typelist);
00277 void SetTypeList(Window_t win, Atom_t prop, Atom_t *typelist);
00278 Window_t FindRWindow(Window_t win, Window_t dragwin, Window_t input, int x, int y, int maxd);
00279 Bool_t IsDNDAware(Window_t win, Atom_t *typelist);
00280
00281 Int_t EventsPending();
00282 void NextEvent(Event_t & event);
00283 Bool_t CheckEvent(Window_t id, EGEventType type, Event_t &ev);
00284 void SendEvent(Window_t id, Event_t *ev);
00285 Bool_t IsCmdThread() const;
00286 Window_t GetCurrentWindow() const;
00287
00288 static TVirtualX *RealObject();
00289 static TVirtualX *ProxyObject();
00290 };
00291
00292 #endif