OpendTect  6.3
uimain.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Lammertink
8  Date: 03/12/1999
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "uibasemod.h"
14 #include "uigeom.h"
15 #include "color.h"
16 
17 mFDQtclass(QApplication)
18 mFDQtclass(QDesktopWidget)
19 mFDQtclass(QWidget)
20 mFDQtclass(QtTabletEventFilter)
21 
22 class uiMainWin;
23 class uiFont;
24 class BufferStringSet;
26 class KeyboardEventFilter;
27 
28 
30 {
31 public:
32  uiMain(int& argc,char** argv);
33 private:
34  uiMain(mQtclass(QApplication*));
35  void init(mQtclass(QApplication*),int& argc,char **argv);
36 
37 public:
38 
39  virtual ~uiMain();
40 
41  virtual int exec();
42  void exit(int retcode=0);
43  void* thread();
44 
45  void getCmdLineArgs(BufferStringSet&) const;
46  void setTopLevel(uiMainWin*);
47  uiMainWin* topLevel() { return mainobj_; }
48  void setFont(const uiFont&,bool passtochildren);
49  const uiFont* font();
50  Color windowColor() const;
51  static void setIconFileName(const char* full_path);
52  static const char* iconFileName();
53 
54  int nrScreens() const;
55  const char* getScreenName(int screennr) const;
56  uiSize getScreenSize(int screennr,bool availablesz) const;
57  uiSize desktopSize() const;
59 
60  static uiMain& theMain();
61  static void cleanQtOSEnv();
62 
63  static void flushX();
64 
69  static void processEvents(int msec=3000);
70 
71  static KeyboardEventHandler& keyboardEventHandler();
72  static int getDPI();
73 
74  static void useNameToolTip(bool);
75  static bool isNameToolTipUsed();
76  static void formatNameToolTipString(BufferString&);
77  static void setXpmIconData(const char**);
78 
79 protected:
80 
81  static uiMain* themain_;
82  uiMainWin* mainobj_;
83 
84  static mQtclass(QApplication*) app_;
85  static const uiFont* font_;
86 
87  static mQtclass(QtTabletEventFilter*) tabletfilter_;
88  static KeyboardEventHandler* keyhandler_;
89  static KeyboardEventFilter* keyfilter_;
90  mQtclass(QDesktopWidget*) qdesktop_;
91 
93  virtual void init( mQtclass(QWidget*) mainwidget ) {}
94 };
95 
96 
98 mGlobal(uiBase) bool isMainThreadCurrent();
#define mExpClass(module)
Definition: commondefs.h:157
User interface main window.
Definition: uimainwin.h:34
#define mQtclass(cls)
Definition: commondefs.h:232
#define mGlobal(module)
Definition: commondefs.h:160
bool init()
Definition: uifont.h:38
bool isMainThreadCurrent()
mFDQtclass(QApplication) mFDQtclass(QDesktopWidget) mFDQtclass(QWidget) mFDQtclass(QtTabletEventFilter) class uiMainWin
Set of BufferString objects.
Definition: bufstringset.h:25
Definition: uigeom.h:23
void * ThreadID
Definition: thread.h:33
const uiFont * font() const
Definition: uiparent.h:74
uiMainWin * topLevel()
Definition: uimain.h:47
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
Definition: uimain.h:29
virtual void setFont(const QFont &)
override Qt
Definition: i_uiobjqtbody.h:31
Handles KeyboardEvent.
Definition: keyboardevent.h:44
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
uiMainWin * mainobj_
Definition: uimain.h:82
bool isMainThread(Threads::ThreadID)
static uiMain * themain_
Definition: uimain.h:81

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017