File indexing completed on 2024-05-19 16:31:48

0001 /*
0002  *  SPDX-License-Identifier: GPL-2.0-or-later
0003  *
0004  *  SPDX-FileCopyrightText: 2002 Michael v.Ostheim <MvOstheim@web.de>
0005  */
0006 
0007 #ifndef XVIDEXTWRAP_H
0008 #define XVIDEXTWRAP_H
0009 
0010 #include <X11/Xutil.h>
0011 
0012 /**A wrapper for XF86VidMode Extension
0013  *@author Michael v.Ostheim
0014  */
0015 
0016 class XVidExtWrap
0017 {
0018 public:
0019     enum GammaChannel { Value = 0, Red = 1, Green = 2, Blue = 3 };
0020     explicit XVidExtWrap(bool *OK, const char *displayname = nullptr);
0021     ~XVidExtWrap();
0022 
0023     /** Returns the default screen */
0024     int _DefaultScreen();
0025     /** Returns the number of screens (extracted from XF86Config) */
0026     int _ScreenCount();
0027     /** Returns the displayname */
0028     const char *DisplayName();
0029     /** Sets the screen actions are take effect */
0030     void setScreen(int scrn)
0031     {
0032         screen = scrn;
0033     }
0034     /** Returns the current screen */
0035     int getScreen()
0036     {
0037         return screen;
0038     }
0039     /** Sets the gamma value on the current screen */
0040     void setGamma(int channel, float gam, bool *OK = nullptr);
0041     /** Gets the gamma value of the current screen */
0042     float getGamma(int channel, bool *OK = nullptr);
0043     /** Limits the possible gamma values (default 0.1-10.0) */
0044     void setGammaLimits(float min, float max);
0045 
0046 private:
0047     float mingamma, maxgamma;
0048     int screen;
0049     Display *dpy;
0050 };
0051 
0052 #endif