Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

qapplication.h

00001 
00002 #ifndef __QApplication_h
00003 #define __QApplication_h
00004 
00005 #include "qwidget.h"
00006 #include "LgiOsDefs.h"
00007 #include "GContainers.h"
00008 #include "GSemaphore.h"
00009 
00010 #define XA_WmDeleteWindow   XAtom[0]
00011 #define XA_WmProtocols      XAtom[1]
00012 #define XA_Clipboard        XAtom[2]
00013 #define XA_XdndEnter        XAtom[3]
00014 #define XA_XdndPosition     XAtom[4]
00015 #define XA_XdndStatus       XAtom[5]
00016 #define XA_XdndLeave        XAtom[6]
00017 #define XA_XdndDrop         XAtom[7]
00018 #define XA_XdndFinished     XAtom[8]
00019 #define XA_XdndSelection    XAtom[9]
00020 #define XA_NetWmIcon        XAtom[10]
00021 #define XA_Cardinal         XAtom[11]
00022 #define XA_Max              20      // leave room for growth
00023 
00024 class QApplication : public QEventSink, public GSemaphore
00025 {
00026     friend class QObject;
00027     friend class QPopup;
00028     friend class QWidgetPrivate;
00029     friend class QEvent;
00030     friend class QWidget;
00031     friend class QWindow;
00032 
00033     static QApplication *_App;
00034     static QWidget *WantsFocus;
00035     class QApplicationPrivate *d;
00036 
00037     Display *Dsp;
00038     QList<QWidget> Delete;
00039 
00040     // Atoms
00041     Atom XAtom[XA_Max];
00042     
00043     // Clipboard data..
00044     char *ClipText;
00045     Pixmap ClipImage;
00046     QEventSink *SelectionSink;
00047     
00048     // Dnd
00049     List<char> DndTypes, DndAccepted;
00050     class GDragDropTarget *DndTarget;
00051     
00052     // Methods  
00053     void OnDeleteWidget(QWidget *w);
00054     void OnEvent(XEvent *Event);
00055     QWidget *GetKeyTarget();
00056 
00057 public:
00058     QApplication(int args, char **arg);
00059     virtual ~QApplication();
00060 
00061     // Api
00062     bool IsOk();
00063     QWidget *desktop();
00064     int exec();
00065     void onEvent(XEvent &Event);
00066     void processEvents();
00067     void exit(int code);
00068     void enter_loop();
00069     void exit_loop();
00070     void OnTabKey(QWidget *w, int Dir);
00071     uint64 GetLastButtonPressTime(int Button, int x, int y);
00072     OsThreadId GetGuiThread();
00073 
00074     // Focus
00075     QWidget *GetFocus();
00076     QWidget *GetFocusWindow();
00077     void SetFocus(QWidget *q);
00078 
00079     // Clipboard
00080     Atom GetClipboard() { return XA_Clipboard; }
00081     void EmptyClip();
00082     void SetClipText(QWidget *w, char *s);
00083     void SetClipImage(QWidget *w, class GSurface *pDC);
00084     void SetSelectionSink(QEventSink *s);
00085     bool GetSelection(Window w, Atom Selection, Atom Format, uchar *&Data, ulong &Len);
00086     
00087     // Static members
00088     static void postEvent(QWidget *o, QEvent *e);
00089     static int wheelScrollLines();
00090     static QApplication *GetApp() { return _App; }
00091 };
00092 
00093 #endif

Generated on Tue May 2 10:24:44 2006 for Lgi by  doxygen 1.4.1