diff options
Diffstat (limited to 'platform/x11/os_x11.h')
-rw-r--r-- | platform/x11/os_x11.h | 93 |
1 files changed, 44 insertions, 49 deletions
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index ce2e2df6e9..cbda18c0bc 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -29,29 +29,28 @@ #ifndef OS_X11_H #define OS_X11_H - -#include "os/input.h" -#include "drivers/unix/os_unix.h" #include "context_gl_x11.h" +#include "drivers/unix/os_unix.h" +#include "os/input.h" #include "servers/visual_server.h" //#include "servers/visual/visual_server_wrap_mt.h" -#include "servers/visual/rasterizer.h" -#include "servers/physics_server.h" -#include "servers/audio_server.h" -#include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/alsa/audio_driver_alsa.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" +#include "drivers/rtaudio/audio_driver_rtaudio.h" +#include "joypad_linux.h" +#include "main/input_default.h" +#include "power_x11.h" #include "servers/audio/audio_driver_dummy.h" +#include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_2d/physics_2d_server_wrap_mt.h" -#include "main/input_default.h" -#include "joypad_linux.h" -#include "power_x11.h" +#include "servers/physics_server.h" +#include "servers/visual/rasterizer.h" -#include <X11/keysym.h> -#include <X11/Xlib.h> #include <X11/Xcursor/Xcursor.h> +#include <X11/Xlib.h> #include <X11/extensions/Xrandr.h> +#include <X11/keysym.h> // Hints for X11 fullscreen typedef struct { @@ -63,17 +62,17 @@ typedef struct { } Hints; typedef struct _xrr_monitor_info { - Atom name; - Bool primary; - Bool automatic; - int noutput; - int x; - int y; - int width; - int height; - int mwidth; - int mheight; - RROutput *outputs; + Atom name; + Bool primary; + Bool automatic; + int noutput; + int x; + int y; + int width; + int height; + int mwidth; + int mheight; + RROutput *outputs; } xrr_monitor_info; #undef CursorShape @@ -93,7 +92,7 @@ class OS_X11 : public OS_Unix { Atom xdnd_selection; Atom requested; - int xdnd_version; + int xdnd_version; #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) ContextGL_X11 *context_gl; @@ -105,7 +104,7 @@ class OS_X11 : public OS_Unix { Window x11_window; Window xdnd_source_window; MainLoop *main_loop; - ::Display* x11_display; + ::Display *x11_display; char *xmbstring; int xmblen; unsigned long last_timestamp; @@ -128,7 +127,7 @@ class OS_X11 : public OS_Unix { MouseMode mouse_mode; Point2i center; - void handle_key_event(XKeyEvent *p_event,bool p_echo=false); + void handle_key_event(XKeyEvent *p_event, bool p_echo = false); void process_xevents(); virtual void delete_main_loop(); IP_Unix *ip_unix; @@ -165,7 +164,7 @@ class OS_X11 : public OS_Unix { AudioDriverDummy driver_dummy; Atom net_wm_icon; - + PowerX11 *power_manager; int audio_driver_index; @@ -174,30 +173,27 @@ class OS_X11 : public OS_Unix { //void set_wm_border(bool p_enabled); void set_wm_fullscreen(bool p_enabled); - typedef xrr_monitor_info* (*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors); - typedef void (*xrr_free_monitors_t)(xrr_monitor_info* monitors); + typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors); + typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors); xrr_get_monitors_t xrr_get_monitors; xrr_free_monitors_t xrr_free_monitors; void *xrandr_handle; Bool xrandr_ext_ok; protected: - virtual int get_video_driver_count() const; - virtual const char * get_video_driver_name(int p_driver) const; + virtual const char *get_video_driver_name(int p_driver) const; virtual VideoMode get_default_video_mode() const; virtual int get_audio_driver_count() const; - virtual const char * get_audio_driver_name(int p_driver) const; + virtual const char *get_audio_driver_name(int p_driver) const; - virtual void initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver); + virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver); virtual void finalize(); - virtual void set_main_loop( MainLoop * p_main_loop ); - + virtual void set_main_loop(MainLoop *p_main_loop); public: - virtual String get_name(); virtual void set_cursor_shape(CursorShape p_shape); @@ -205,18 +201,18 @@ public: void set_mouse_mode(MouseMode p_mode); MouseMode get_mouse_mode() const; - virtual void warp_mouse_pos(const Point2& p_to); + virtual void warp_mouse_pos(const Point2 &p_to); virtual Point2 get_mouse_pos() const; virtual int get_mouse_button_state() const; - virtual void set_window_title(const String& p_title); + virtual void set_window_title(const String &p_title); - virtual void set_icon(const Image& p_icon); + virtual void set_icon(const Image &p_icon); virtual MainLoop *get_main_loop() const; virtual bool can_draw() const; - virtual void set_clipboard(const String& p_text); + virtual void set_clipboard(const String &p_text); virtual String get_clipboard() const; virtual void release_rendering_thread(); @@ -227,19 +223,18 @@ public: virtual Error shell_open(String p_uri); - virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen=0); - virtual VideoMode get_video_mode(int p_screen=0) const; - virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const; - + virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0); + virtual VideoMode get_video_mode(int p_screen = 0) const; + virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const; virtual int get_screen_count() const; virtual int get_current_screen() const; virtual void set_current_screen(int p_screen); - virtual Point2 get_screen_position(int p_screen=0) const; - virtual Size2 get_screen_size(int p_screen=0) const; - virtual int get_screen_dpi(int p_screen=0) const; + virtual Point2 get_screen_position(int p_screen = 0) const; + virtual Size2 get_screen_size(int p_screen = 0) const; + virtual int get_screen_dpi(int p_screen = 0) const; virtual Point2 get_window_position() const; - virtual void set_window_position(const Point2& p_position); + virtual void set_window_position(const Point2 &p_position); virtual Size2 get_window_size() const; virtual void set_window_size(const Size2 p_size); virtual void set_window_fullscreen(bool p_enabled); @@ -253,7 +248,7 @@ public: virtual void request_attention(); virtual void move_window_to_foreground(); - virtual void alert(const String& p_alert,const String& p_title="ALERT!"); + virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device) const; |