Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

G4Win32 Class Reference

#include <G4Win32.hh>

Inheritance diagram for G4Win32:

Inheritance graph
[legend]
Collaboration diagram for G4Win32:

Collaboration graph
[legend]
List of all members.

Public Member Functions

G4bool Inited ()
void * GetEvent ()
void FlushAndWaitExecution ()
virtual ~G4Win32 ()

Static Public Member Functions

G4Win32getInstance ()
G4bool dispatchWin32Event (void *)

Private Member Functions

 G4Win32 ()

Static Private Attributes

G4Win32instance = NULL

Constructor & Destructor Documentation

G4Win32::~G4Win32  )  [virtual]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 95 of file G4Win32.cc.

References instance.

00099 {
00100   if(this==instance) {
00101     instance = NULL;
00102   }
00103 }

G4Win32::G4Win32  )  [private]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 57 of file G4Win32.cc.

References G4VInteractorManager::AddDispatcher(), className, dispatchWin32Event(), G4DispatchFunction, G4VInteractorManager::SetMainInteractor(), topWindow, and Win32Inited.

Referenced by getInstance().

00061 {
00062   if(Win32Inited==FALSE) { // Should be Done once.
00063 
00064     WNDCLASS         wc;
00065     wc.style         = CS_HREDRAW | CS_VREDRAW;
00066     wc.lpfnWndProc   = (WNDPROC)DefWindowProc;
00067     wc.cbClsExtra    = 0;
00068     wc.cbWndExtra    = 0;
00069     wc.hInstance     = ::GetModuleHandle(NULL);
00070     wc.hIcon         = LoadIcon  (NULL,IDI_APPLICATION);
00071     wc.hCursor       = LoadCursor(NULL,IDC_ARROW);
00072     wc.hbrBackground = GetStockBrush(BLACK_BRUSH);
00073     wc.lpszMenuName  = className;
00074     wc.lpszClassName = className;
00075     ::RegisterClass  (&wc);
00076     
00077     topWindow   = ::CreateWindow(className,className, 
00078                                  WS_OVERLAPPEDWINDOW,
00079                                  CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 
00080                                  NULL, NULL, 
00081                                  ::GetModuleHandle(NULL),
00082                                  NULL);
00083     
00084     if(topWindow==NULL) {
00085       G4cout << "G4Win32 : Unable to create Win32 window." << G4endl;
00086     }
00087 
00088     Win32Inited = TRUE;
00089   }
00090 
00091   AddDispatcher((G4DispatchFunction)G4Win32::dispatchWin32Event);
00092   SetMainInteractor(topWindow);
00093 }

Here is the call graph for this function:


Member Function Documentation

G4bool G4Win32::dispatchWin32Event void *  a_event  )  [static]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 136 of file G4Win32.cc.

Referenced by G4Win32().

00141 {
00142   ::TranslateMessage((MSG*)a_event);
00143   ::DispatchMessage ((MSG*)a_event);
00144   return TRUE;
00145 }

void G4Win32::FlushAndWaitExecution  )  [virtual]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Implements G4VInteractorManager.

Definition at line 124 of file G4Win32.cc.

00128 {
00129   MSG event;
00130   while ( ::PeekMessage(&event, NULL, 0, 0, PM_REMOVE) ) {
00131     ::TranslateMessage(&event);
00132     ::DispatchMessage (&event);
00133   }
00134 }

void * G4Win32::GetEvent  )  [virtual]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Implements G4VInteractorManager.

Definition at line 113 of file G4Win32.cc.

00117 {
00118   static MSG event;
00119   BOOL status = ::GetMessage(&event, NULL, 0, 0);
00120   if(status==FALSE) return NULL;
00121   return &event;
00122 }

G4Win32 * G4Win32::getInstance  )  [static]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 46 of file G4Win32.cc.

References G4Win32(), and instance.

Referenced by G4UIWin32::G4UIWin32().

00050 {
00051   if (instance==NULL) {
00052     instance = new G4Win32();
00053   }
00054   return instance;
00055 }

Here is the call graph for this function:

G4bool G4Win32::Inited  )  [virtual]
 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Implements G4VInteractorManager.

Definition at line 105 of file G4Win32.cc.

References Win32Inited.

00109 {
00110   return Win32Inited;
00111 }


Member Data Documentation

G4Win32 * G4Win32::instance = NULL [static, private]
 

Definition at line 41 of file G4Win32.cc.

Referenced by getInstance(), and ~G4Win32().


The documentation for this class was generated from the following files:
Generated on Fri Jun 22 11:08:06 2007 by doxygen 1.3.4