diff options
Diffstat (limited to 'src/x.hpp')
-rw-r--r-- | src/x.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/x.hpp b/src/x.hpp new file mode 100644 index 0000000..d01e00e --- /dev/null +++ b/src/x.hpp @@ -0,0 +1,56 @@ +/* x.hpp: Handles starting and managing X + * + * Copyright (C) 2014: Dalton Nell, Maim Contributors (https://github.com/naelstrof/maim/graphs/contributors). + * + * This file is part of Maim. + * + * Maim is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Maim is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Maim. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef MAIM_X_H_ +#define MAIM_X_H_ + +#include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> +#include <cstdlib> +#include <vector> +#include <string> +#include <cstdio> + +namespace maim { + +class XEngine { +public: + XEngine(); + ~XEngine(); + int init( std::string display ); + Display* m_display; + Visual* m_visual; + Screen* m_screen; + Colormap m_colormap; + Window m_root; + XRRScreenResources* m_res; + bool m_good; + Window getWindowByID( int id ); + std::vector<XRRCrtcInfo*> getCRTCS(); + void freeCRTCS( std::vector<XRRCrtcInfo*> monitors ); +}; + +int IgnoreErrorHandler( Display* dpy, XErrorEvent* event ); + +} + +extern maim::XEngine* xengine; + +#endif // MAIM_X_H_ |