![]() |
IOT
0.5
I Only Think
|
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 /* IOT Copyright (C) 2010 CEG development team 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 00007 * as published by the Free Software Foundation. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Authors: CEG <ceg@ionlythink.com>, http://www.ionlythink.com 00019 */ 00020 00021 #ifndef WINDOW_H_ 00022 #define WINDOW_H_ 00023 00024 #include <QRect> 00025 #include <QString> 00026 00027 #if defined(__MINGW32__) 00028 // do stuff... 00029 #elif defined(Q_WS_WIN) 00030 #include <windows.h> 00031 #include <psapi.h> // NT only! 00032 //#pragma comment(lib, "psapi") // NT only! 00033 #elif defined(Q_WS_X11) || defined(Q_WS_MAC) 00034 #include <X11/Xlib.h> 00035 #endif 00036 00037 namespace Ceg 00038 { 00039 typedef 00040 #if defined(__MINGW32__) 00041 void* 00042 #elif defined(Q_WS_WIN) 00043 ::HWND 00044 #elif defined(Q_WS_X11) || defined(Q_WS_MAC) 00045 ::Window 00046 #else 00047 void* 00048 #endif 00049 00050 WindowId; 00051 00052 class Window 00053 { 00054 public: 00055 Window(); 00056 Window(WindowId, QRect const &, QString const & = ""); 00057 00058 QRect const & getGeometry() const; 00059 WindowId getId() const; 00060 QString const & getProgramName() const; 00061 00062 void setGeometry(QRect const &); 00063 void setId(WindowId); 00064 00065 private: 00066 QString _programName; // le nom du programme de la fenetre espionnee 00067 WindowId _id; 00068 QRect _geometry; // La taille de la fenetre 00069 }; 00070 } 00071 00072 #endif // WINDOW_H_