00001
00002
00003 #ifndef __LgiLinux_h
00004 #define __LgiLinux_h
00005
00006 #include <stdio.h>
00007 #include <X11/Xlib.h>
00008 #include <X11/Xutil.h>
00009 #include <X11/Xatom.h>
00010
00011 #include "GMem.h"
00012 #include "GToken.h"
00013
00014 #undef Status
00015 #undef Success
00016 #undef None
00017 #undef Above
00018 #undef Below
00019
00020 #define XStatus int
00021 #define XSuccess 0
00022 #define XAbove 0
00023 #define XBelow 1
00024 #define XNone 0L
00025
00026 extern "C" uint64 LgiCurrentTime();
00027 extern bool _GetKdePaths(GToken &t, char *Type);
00028 extern bool _GetIniField(char *Grp, char *Field, char *In, char *Out, int OutSize);
00029 extern bool _GetKdeFont(char *FontType, char *Font, int FontBufSize, int &PointSize);
00030
00031 XChar2b *ConvertToX(char16 *s, int len = -1);
00032 extern char *XErr(int i);
00033 extern char *XMessage(int i);
00034
00035 class QObject
00036 {
00037 public:
00038 virtual ~QObject() {}
00039
00040 static Display *XDisplay();
00041 static class QApplication *QApp();
00042 };
00043
00044 class QInput : public QObject
00045 {
00046 XIM Method;
00047 XIC Context;
00048
00049 public:
00050 QInput();
00051 ~QInput();
00052 };
00053
00054 class QPoint
00055 {
00056 int _x, _y;
00057
00058 public:
00059 QPoint()
00060 {
00061 _x = _y = 0;
00062 }
00063
00064 QPoint(int X, int Y)
00065 {
00066 _x = X;
00067 _y = Y;
00068 }
00069
00070 int x() { return _x; }
00071 int y() { return _y; }
00072 void set(int x, int y) { _x = x; _y = y; }
00073 };
00074
00075 class QCursor : public QObject
00076 {
00077 public:
00078 QPoint &pos();
00079 };
00080
00081 class QRect
00082 {
00083 int x1, y1, x2, y2;
00084
00085 public:
00086 QRect()
00087 {
00088 x1 = y1 = x2 = y2 = 0;
00089 }
00090
00091 QRect(int l, int t, int r, int b)
00092 {
00093 x1 = l; y1 = t; x2 = r; y2 = b;
00094 }
00095
00096 int set(int x, int y, int w, int h)
00097 {
00098 x1 = x; y1 = y; x2 = x1 + w - 1; y2 = y1 + h - 1;
00099 }
00100
00101 int left() { return x1; }
00102 int top() { return y1; }
00103 int right() { return x2; }
00104 int bottom() { return y2; }
00105 int x() { return x2 - x1 + 1; }
00106 int y() { return y2 - y1 + 1; }
00107 };
00108
00109 class QEventSink : public QObject
00110 {
00111 public:
00112 virtual void OnEvent(XEvent *Event) = 0;
00113 };
00114
00115
00116 #include "qlist.h"
00117
00118 #endif