Logo ROOT   6.16/01
Reference Guide
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
17typedef void (*TGWin32CallBack)(void*);
18class TList;
19class TGWin32ProxyBasePrivate;
20
21////////////////////////////////////////////////////////////////////////////////
23friend class TGWin32;
24friend class TGWin32GL;
25
26protected:
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
40public: // 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
53public:
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
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
void(* TGWin32CallBack)(void *)
typedef void((*Func_t)())
Proxy classes provide thread-safe interface to global objects.
friend class TGWin32GL
virtual ~TGWin32ProxyBase()
dtor
static Bool_t IsGloballyLocked()
Check the status of the lock.
static ULong_t fgPingMessageId
ping message ID
static void Lock()
enter critical section
static void GlobalUnlock()
unlock any proxy (client thread)
TList * fListOfCallBacks
list of callbacks (used for batch processing)
Int_t fBatchLimit
batch limit
virtual Double_t GetMilliSeconds()
returns elapsed time in milliseconds with microseconds precision
static UInt_t fMaxResponseTime
max period for waiting response from server thread
ULong_t GetId() const
static Long_t fgLock
fgLock=1 - all client threads locked
virtual void SendExitMessage()
send exit message to server thread
static Bool_t Ping()
send ping messsage to server thread
static void Unlock()
leave critical section
static void GlobalLock()
lock any proxy (client thread)
virtual Bool_t ForwardCallBack(Bool_t sync)
if sync is kTRUE:
static ULong_t fgUserThreadId
user (e.g. python) thread ID
TGWin32ProxyBasePrivate * fPimpl
very private data
static ULong_t fgPostMessageId
post message ID
ULong_t fId
thread id. There is one proxy per client thread
static ULong_t fgMainThreadId
main thread ID
void * fParam
arguments passed to/from callback function
virtual void ExecuteCallBack(Bool_t sync)
Executes all batched callbacks and the latest callback This method is executed by server thread.
Bool_t fIsVirtualX
true if actual TVirtualX implementation
TGWin32CallBack fCallBack
callback function (executed by "main" thread)
This class is the basic interface to the Win32 graphics system.
Definition: TGWin32.h:67
A doubly linked list.
Definition: TList.h:44