File indexing completed on 2025-01-18 10:11:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_GuiTypes
0012 #define ROOT_GuiTypes
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "Rtypes.h"
0023 #include <climits>
0024
0025
0026 typedef ULongptr_t Handle_t;
0027 typedef Handle_t Display_t;
0028 typedef Handle_t Visual_t;
0029 typedef Handle_t Window_t;
0030 typedef Handle_t Pixmap_t;
0031 typedef Handle_t Drawable_t;
0032 typedef Handle_t Region_t;
0033 typedef Handle_t Colormap_t;
0034 typedef Handle_t Cursor_t;
0035 typedef Handle_t FontH_t;
0036 typedef Handle_t KeySym_t;
0037 typedef Handle_t Atom_t;
0038 typedef Handle_t GContext_t;
0039 typedef Handle_t FontStruct_t;
0040 typedef ULong_t Pixel_t;
0041 typedef UInt_t Mask_t;
0042 typedef ULong_t Time_t;
0043
0044 enum EGuiConstants {
0045 kNotUseful = 0, kWhenMapped = 1, kAlways = 2,
0046 kIsUnmapped = 0, kIsUnviewable = 1, kIsViewable = 2,
0047 kInputOutput = 1, kInputOnly = 2,
0048 kLineSolid = 0, kLineOnOffDash = 1, kLineDoubleDash = 2,
0049 kCapNotLast = 0, kCapButt = 1, kCapRound = 2, kCapProjecting = 3,
0050 kJoinMiter = 0, kJoinRound = 1, kJoinBevel = 2,
0051 kFillSolid = 0, kFillTiled = 1, kFillStippled = 2, kFillOpaqueStippled = 3,
0052 kEvenOddRule = 0, kWindingRule = 1,
0053 kClipByChildren = 0, kIncludeInferiors = 1,
0054 kArcChord = 0, kArcPieSlice = 1
0055 };
0056
0057
0058
0059 enum EGEventType {
0060 kGKeyPress, kKeyRelease, kButtonPress, kButtonRelease,
0061 kMotionNotify, kEnterNotify, kLeaveNotify, kFocusIn, kFocusOut,
0062 kExpose, kConfigureNotify, kMapNotify, kUnmapNotify, kDestroyNotify,
0063 kClientMessage, kSelectionClear, kSelectionRequest, kSelectionNotify,
0064 kColormapNotify, kButtonDoubleClick, kOtherEvent
0065 };
0066
0067 enum EGraphicsFunction {
0068 kGXclear = 0,
0069 kGXand,
0070 kGXandReverse,
0071 kGXcopy,
0072 kGXandInverted,
0073 kGXnoop,
0074 kGXxor,
0075 kGXor,
0076 kGXnor,
0077 kGXequiv,
0078 kGXinvert,
0079 kGXorReverse,
0080 kGXcopyInverted,
0081 kGXorInverted,
0082 kGXnand,
0083 kGXset
0084 };
0085
0086 enum { kDefaultScrollBarWidth = 16 };
0087
0088 const Handle_t kNone = 0;
0089 const Handle_t kCopyFromParent = 0;
0090 const Handle_t kParentRelative = 1;
0091
0092
0093 struct SetWindowAttributes_t {
0094 Pixmap_t fBackgroundPixmap;
0095 ULong_t fBackgroundPixel;
0096 Pixmap_t fBorderPixmap;
0097 ULong_t fBorderPixel;
0098 UInt_t fBorderWidth;
0099 Int_t fBitGravity;
0100 Int_t fWinGravity;
0101 Int_t fBackingStore;
0102 ULong_t fBackingPlanes;
0103 ULong_t fBackingPixel;
0104 Bool_t fSaveUnder;
0105 Long_t fEventMask;
0106 Long_t fDoNotPropagateMask;
0107 Bool_t fOverrideRedirect;
0108 Colormap_t fColormap;
0109 Cursor_t fCursor;
0110 Mask_t fMask;
0111 };
0112
0113
0114 struct WindowAttributes_t {
0115 Int_t fX, fY;
0116 Int_t fWidth, fHeight;
0117 Int_t fBorderWidth;
0118 Int_t fDepth;
0119 void *fVisual;
0120 Window_t fRoot;
0121 Int_t fClass;
0122 Int_t fBitGravity;
0123 Int_t fWinGravity;
0124 Int_t fBackingStore;
0125 ULong_t fBackingPlanes;
0126 ULong_t fBackingPixel;
0127 Bool_t fSaveUnder;
0128 Colormap_t fColormap;
0129 Bool_t fMapInstalled;
0130 Int_t fMapState;
0131 Long_t fAllEventMasks;
0132 Long_t fYourEventMask;
0133 Long_t fDoNotPropagateMask;
0134 Bool_t fOverrideRedirect;
0135 void *fScreen;
0136 };
0137
0138
0139 const Mask_t kWABackPixmap = BIT(0);
0140 const Mask_t kWABackPixel = BIT(1);
0141 const Mask_t kWABorderPixmap = BIT(2);
0142 const Mask_t kWABorderPixel = BIT(3);
0143 const Mask_t kWABorderWidth = BIT(4);
0144 const Mask_t kWABitGravity = BIT(5);
0145 const Mask_t kWAWinGravity = BIT(6);
0146 const Mask_t kWABackingStore = BIT(7);
0147 const Mask_t kWABackingPlanes = BIT(8);
0148 const Mask_t kWABackingPixel = BIT(9);
0149 const Mask_t kWAOverrideRedirect = BIT(10);
0150 const Mask_t kWASaveUnder = BIT(11);
0151 const Mask_t kWAEventMask = BIT(12);
0152 const Mask_t kWADontPropagate = BIT(13);
0153 const Mask_t kWAColormap = BIT(14);
0154 const Mask_t kWACursor = BIT(15);
0155
0156
0157
0158 const Mask_t kNoEventMask = 0;
0159 const Mask_t kKeyPressMask = BIT(0);
0160 const Mask_t kKeyReleaseMask = BIT(1);
0161 const Mask_t kButtonPressMask = BIT(2);
0162 const Mask_t kButtonReleaseMask = BIT(3);
0163 const Mask_t kPointerMotionMask = BIT(4);
0164 const Mask_t kButtonMotionMask = BIT(5);
0165 const Mask_t kExposureMask = BIT(6);
0166 const Mask_t kStructureNotifyMask = BIT(7);
0167 const Mask_t kEnterWindowMask = BIT(8);
0168 const Mask_t kLeaveWindowMask = BIT(9);
0169 const Mask_t kFocusChangeMask = BIT(10);
0170 const Mask_t kOwnerGrabButtonMask = BIT(11);
0171 const Mask_t kColormapChangeMask = BIT(12);
0172
0173
0174 struct Event_t {
0175 EGEventType fType;
0176 Window_t fWindow;
0177 Time_t fTime;
0178 Int_t fX, fY;
0179 Int_t fXRoot, fYRoot;
0180 UInt_t fCode;
0181 UInt_t fState;
0182 UInt_t fWidth, fHeight;
0183 Int_t fCount;
0184 Bool_t fSendEvent;
0185 Handle_t fHandle;
0186 Int_t fFormat;
0187 Longptr_t fUser[5];
0188
0189
0190
0191 };
0192
0193
0194
0195 const Mask_t kKeyShiftMask = BIT(0);
0196 const Mask_t kKeyLockMask = BIT(1);
0197 const Mask_t kKeyControlMask = BIT(2);
0198 const Mask_t kKeyMod1Mask = BIT(3);
0199 const Mask_t kKeyMod2Mask = BIT(4);
0200 const Mask_t kKeyMod3Mask = BIT(5);
0201 const Mask_t kKeyMod4Mask = BIT(6);
0202 const Mask_t kKeyMod5Mask = BIT(7);
0203 const Mask_t kButton1Mask = BIT(8);
0204 const Mask_t kButton2Mask = BIT(9);
0205 const Mask_t kButton3Mask = BIT(10);
0206 const Mask_t kButton4Mask = BIT(11);
0207 const Mask_t kButton5Mask = BIT(12);
0208 const Mask_t kButton6Mask = BIT(13);
0209 const Mask_t kButton7Mask = BIT(14);
0210 const Mask_t kAnyModifier = BIT(15);
0211
0212
0213
0214 enum EMouseButton { kAnyButton, kButton1, kButton2, kButton3,
0215 kButton4, kButton5, kButton6, kButton7 };
0216
0217
0218
0219 enum EXMagic { kNotifyNormal = 0, kNotifyGrab = 1, kNotifyUngrab = 2,
0220 kNotifyPointer = 5, kColormapUninstalled = 0,
0221 kColormapInstalled = 1 };
0222
0223
0224 struct GCValues_t {
0225 EGraphicsFunction fFunction;
0226 ULong_t fPlaneMask;
0227 ULong_t fForeground;
0228 ULong_t fBackground;
0229 Int_t fLineWidth;
0230 Int_t fLineStyle;
0231 Int_t fCapStyle;
0232
0233 Int_t fJoinStyle;
0234 Int_t fFillStyle;
0235
0236 Int_t fFillRule;
0237 Int_t fArcMode;
0238 Pixmap_t fTile;
0239 Pixmap_t fStipple;
0240 Int_t fTsXOrigin;
0241 Int_t fTsYOrigin;
0242 FontH_t fFont;
0243 Int_t fSubwindowMode;
0244 Bool_t fGraphicsExposures;
0245 Int_t fClipXOrigin;
0246 Int_t fClipYOrigin;
0247 Pixmap_t fClipMask;
0248 Int_t fDashOffset;
0249 Char_t fDashes[8];
0250 Int_t fDashLen;
0251 Mask_t fMask;
0252
0253 GCValues_t() :
0254 fFunction (kGXcopy),
0255 fPlaneMask (0),
0256 fForeground (0),
0257 fBackground (1),
0258 fLineWidth (0),
0259 fLineStyle (kLineSolid),
0260 fCapStyle (kCapButt),
0261 fJoinStyle (kJoinMiter),
0262 fFillStyle (kFillSolid),
0263 fFillRule (kEvenOddRule),
0264 fArcMode (kArcPieSlice),
0265 fTile (0),
0266 fStipple (0),
0267 fTsXOrigin (0),
0268 fTsYOrigin (0),
0269 fFont (0),
0270 fSubwindowMode (kClipByChildren),
0271 fGraphicsExposures (kTRUE),
0272 fClipXOrigin (0),
0273 fClipYOrigin (0),
0274 fClipMask (0),
0275 fDashOffset (0),
0276 fDashLen (2),
0277 fMask (0)
0278 {
0279 for (int i = 2; i < 8; i++) fDashes[i] = 0;
0280 fDashes[0] = 5;
0281 fDashes[1] = 5;
0282 }
0283 };
0284
0285
0286 const Mask_t kGCFunction = BIT(0);
0287 const Mask_t kGCPlaneMask = BIT(1);
0288 const Mask_t kGCForeground = BIT(2);
0289 const Mask_t kGCBackground = BIT(3);
0290 const Mask_t kGCLineWidth = BIT(4);
0291 const Mask_t kGCLineStyle = BIT(5);
0292 const Mask_t kGCCapStyle = BIT(6);
0293 const Mask_t kGCJoinStyle = BIT(7);
0294 const Mask_t kGCFillStyle = BIT(8);
0295 const Mask_t kGCFillRule = BIT(9);
0296 const Mask_t kGCTile = BIT(10);
0297 const Mask_t kGCStipple = BIT(11);
0298 const Mask_t kGCTileStipXOrigin = BIT(12);
0299 const Mask_t kGCTileStipYOrigin = BIT(13);
0300 const Mask_t kGCFont = BIT(14);
0301 const Mask_t kGCSubwindowMode = BIT(15);
0302 const Mask_t kGCGraphicsExposures = BIT(16);
0303 const Mask_t kGCClipXOrigin = BIT(17);
0304 const Mask_t kGCClipYOrigin = BIT(18);
0305 const Mask_t kGCClipMask = BIT(19);
0306 const Mask_t kGCDashOffset = BIT(20);
0307 const Mask_t kGCDashList = BIT(21);
0308 const Mask_t kGCArcMode = BIT(22);
0309
0310 struct ColorStruct_t {
0311 ULong_t fPixel;
0312 UShort_t fRed;
0313 UShort_t fGreen;
0314 UShort_t fBlue;
0315 UShort_t fMask;
0316 };
0317
0318
0319 const Mask_t kDoRed = BIT(0);
0320 const Mask_t kDoGreen = BIT(1);
0321 const Mask_t kDoBlue = BIT(2);
0322
0323 struct PictureAttributes_t {
0324 Colormap_t fColormap;
0325 Int_t fDepth;
0326 UInt_t fWidth;
0327 UInt_t fHeight;
0328 UInt_t fXHotspot;
0329 UInt_t fYHotspot;
0330 ULong_t *fPixels;
0331 UInt_t fNpixels;
0332 UInt_t fCloseness;
0333 Mask_t fMask;
0334 };
0335
0336
0337 const Mask_t kPAColormap = BIT(0);
0338 const Mask_t kPADepth = BIT(1);
0339 const Mask_t kPASize = BIT(2);
0340 const Mask_t kPAHotspot = BIT(3);
0341 const Mask_t kPAReturnPixels = BIT(4);
0342 const Mask_t kPACloseness = BIT(5);
0343
0344
0345 enum EInitialState {
0346 kNormalState = BIT(0),
0347 kIconicState = BIT(1)
0348 };
0349
0350
0351 struct Segment_t {
0352 Short_t fX1, fY1, fX2, fY2;
0353 };
0354
0355
0356 struct Point_t {
0357 Short_t fX, fY;
0358 };
0359
0360
0361 struct Rectangle_t {
0362 Short_t fX, fY;
0363 UShort_t fWidth, fHeight;
0364 };
0365
0366
0367 const Atom_t kPrimarySelection = 1;
0368 const Atom_t kCutBuffer = 9;
0369 const Int_t kMaxPixel = INT_MAX;
0370
0371 const int kNumCursors = 19;
0372 enum ECursor { kBottomLeft, kBottomRight, kTopLeft, kTopRight,
0373 kBottomSide, kLeftSide, kTopSide, kRightSide,
0374 kMove, kCross, kArrowHor, kArrowVer, kHand, kRotate,
0375 kPointer, kArrowRight, kCaret, kWatch, kNoDrop };
0376
0377
0378 enum EFrameType {
0379 kChildFrame = 0,
0380 kMainFrame = BIT(0),
0381 kVerticalFrame = BIT(1),
0382 kHorizontalFrame = BIT(2),
0383 kSunkenFrame = BIT(3),
0384 kRaisedFrame = BIT(4),
0385 kDoubleBorder = BIT(5),
0386 kFitWidth = BIT(6),
0387 kFixedWidth = BIT(7),
0388 kFitHeight = BIT(8),
0389 kFixedHeight = BIT(9),
0390 kFixedSize = (kFixedWidth | kFixedHeight),
0391 kOwnBackground = BIT(10),
0392 kTransientFrame = BIT(11),
0393 kTempFrame = BIT(12),
0394 kMdiMainFrame = BIT(13),
0395 kMdiFrame = BIT(14)
0396 };
0397
0398
0399 #endif