Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGWin32ProxyBase.h
Go to the documentation of this file.
1 // @(#)root/win32gdk:$Id$
2 // Author: Valeriy Onuchin 08/08/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGWin32ProxyBase
13 #define ROOT_TGWin32ProxyBase
14 
15 #include "Rtypes.h"
16 
17 typedef void (*TGWin32CallBack)(void*);
18 class TList;
19 class TGWin32ProxyBasePrivate;
20 
21 ////////////////////////////////////////////////////////////////////////////////
22 class TGWin32ProxyBase {
23 friend class TGWin32;
24 friend class TGWin32GL;
25 
26 protected:
27  TGWin32ProxyBasePrivate *fPimpl; ///< very private data
28  Int_t fBatchLimit; ///< batch limit
29  TList *fListOfCallBacks; ///< list of callbacks (used for batch processing)
30  TGWin32CallBack fCallBack; ///< callback function (executed by "main" thread)
31  void *fParam; ///< arguments passed to/from callback function
32  ULong_t fId; ///< thread id. There is one proxy per client thread
33  Bool_t fIsVirtualX; ///< true if actual TVirtualX implementation
34  static UInt_t fMaxResponseTime; ///< max period for waiting response from server thread
35  static Long_t fgLock; ///< fgLock=1 - all client threads locked
36 
37  virtual Bool_t ForwardCallBack(Bool_t sync);
38  virtual void SendExitMessage();
39 
40 public: // private:
41  static ULong_t fgPostMessageId; ///< post message ID
42  static ULong_t fgPingMessageId; ///< ping message ID
43  static ULong_t fgMainThreadId; ///< main thread ID
44  static ULong_t fgUserThreadId; ///< user (e.g. python) thread ID
45 
46  static void Lock();
47  static void Unlock();
48  static void GlobalLock();
49  static void GlobalUnlock();
50  static Bool_t IsGloballyLocked();
51  static Bool_t Ping();
52 
53 public:
54  TGWin32ProxyBase();
55  virtual ~TGWin32ProxyBase();
56  virtual void ExecuteCallBack(Bool_t sync);
57  virtual Double_t GetMilliSeconds();
58  ULong_t GetId() const { return fId; }
59 };
60 
61 #endif