src/video/x11/SDL_x11modes.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 28 Sep 2012 14:22:18 -0700
changeset 6506 305f0fcc0e99
parent 6331 5732e1a80bde
child 6548 fc9e6be24ca9
permissions -rw-r--r--
Get the correct screen bounds from xinerama
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
     2
  Simple DirectMedia Layer
6138
4c64952a58fb Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
     7
  arising from the use of this software.
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    11
  freely, subject to the following restrictions:
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5408
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "SDL_config.h"
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
#ifndef _SDL_x11modes_h
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
#define _SDL_x11modes_h
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
typedef struct
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
{
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
    int screen;
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
    Visual *visual;
1951
7177581dc9fa Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents: 1950
diff changeset
    30
    int depth;
2916
ffdd533f7add Fixed pitch alignment problem causing MITSHM error on 16-bit displays
Sam Lantinga <slouken@libsdl.org>
parents: 2874
diff changeset
    31
    int scanline_pad;
2873
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    32
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    33
    int use_xinerama;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    34
    int use_xrandr;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    35
    int use_vidmode;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    36
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    37
#if SDL_VIDEO_DRIVER_X11_XINERAMA
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    38
    XineramaScreenInfo xinerama_info;
6506
305f0fcc0e99 Get the correct screen bounds from xinerama
Sam Lantinga <slouken@libsdl.org>
parents: 6331
diff changeset
    39
    int xinerama_screen;
2873
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    40
#endif
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    41
#if SDL_VIDEO_DRIVER_X11_XRANDR
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    42
    XRRScreenConfiguration *screen_config;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    43
    int saved_size;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    44
    Rotation saved_rotation;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    45
    short saved_rate;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    46
#endif
5408
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    47
#if SDL_VIDEO_DRIVER_X11_XVIDMODE
35a63789c3f2 Dynamically load the Xinerama and xf86vmode extensions
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    48
    XF86VidModeModeInfo saved_mode;
2874
Sam Lantinga <slouken@libsdl.org>
parents: 2873
diff changeset
    49
    struct
Sam Lantinga <slouken@libsdl.org>
parents: 2873
diff changeset
    50
    {
2873
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    51
        int x, y;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    52
    } saved_view;
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    53
#endif
b33e38aaa027 Progress on fullscreen mode switching on X11
Sam Lantinga <slouken@libsdl.org>
parents: 2870
diff changeset
    54
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
} SDL_DisplayData;
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
3521
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3500
diff changeset
    57
extern int X11_InitModes(_THIS);
3500
4b594623401b Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents: 2916
diff changeset
    58
extern void X11_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
4b594623401b Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents: 2916
diff changeset
    59
extern int X11_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
extern void X11_QuitModes(_THIS);
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
5182
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    62
/* Some utility functions for working with visuals */
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    63
extern int X11_GetVisualInfoFromVisual(Display * display, Visual * visual,
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    64
                                       XVisualInfo * vinfo);
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    65
extern Uint32 X11_GetPixelFormatFromVisualInfo(Display * display,
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    66
                                               XVisualInfo * vinfo);
6331
5732e1a80bde Fixes #1522, improved Xinerama / Twinview support
Gabriel Jacobo <gabomdq@gmail.com>
parents: 6138
diff changeset
    67
extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect);
5182
073b86030262 Added the X11 framebuffer implementation. Simple! :)
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
    68
1950
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
#endif /* _SDL_x11modes_h */
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
a344e42bce3b Started work on the new X11 driver.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
/* vi: set ts=4 sw=4 expandtab: */