nux-1.14.0
|
00001 /* 00002 * Copyright 2010 Inalogic® Inc. 00003 * 00004 * This program is free software: you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License, as 00006 * published by the Free Software Foundation; either version 2.1 or 3.0 00007 * of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranties of 00011 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 00012 * PURPOSE. See the applicable version of the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of both the GNU Lesser General Public 00016 * License along with this program. If not, see <http://www.gnu.org/licenses/> 00017 * 00018 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com> 00019 * 00020 */ 00021 00022 #ifndef XINPUTWINDOW_H 00023 #define XINPUTWINDOW_H 00024 00025 /* Xlib.h is the default header that is included and has the core functionallity */ 00026 #include <X11/Xlib.h> 00027 /* Xatom.h includes functionallity for creating new protocol messages */ 00028 #include <X11/Xatom.h> 00029 /* keysym.h contains keysymbols which we use to resolv what keys that are being pressed */ 00030 #include <X11/keysym.h> 00031 #include <X11/Xregion.h> 00032 00033 #include <X11/extensions/xf86vmode.h> 00034 00035 #include "NuxCore/NuxCore.h" 00036 #include "NuxCore/Rect.h" 00037 00038 namespace nux 00039 { 00040 00041 class XInputWindow 00042 { 00043 public: 00044 XInputWindow(const char* title, 00045 bool take_focus = False, 00046 int override_redirect = 0); 00047 ~XInputWindow(); 00048 00049 static std::vector<Window> const& NativeHandleList(); 00050 00051 void EnableStruts(bool enable); 00052 bool StrutsEnabled(); 00053 00054 void EnsureInputs(); 00055 00056 void EnableTakeFocus (); 00057 00059 void SetGeometry(const Rect& geo); 00060 00062 void SetGeometry(int x, int y, int width, int height); 00063 00065 Rect const& GetGeometry() const; 00066 00068 Window GetWindow (); 00069 00070 void SetInputFocus (); 00071 00072 void Hide (); 00073 void Show (); 00074 00075 private: 00076 00077 void SetStruts (); 00078 void UnsetStruts (); 00079 00080 void EnableDnd (); 00081 void DisableDnd (); 00082 00083 static std::vector<Window> native_windows_; 00084 00085 bool strutsEnabled_; 00086 Window window_; 00087 Display *display_; 00088 Rect geometry_; 00089 bool shown_; 00090 bool mapped_; 00091 }; 00092 } 00093 00094 #endif // XINPUTWINDOW_H 00095