2012-09-26 15:52:25 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2016-01-10 04:41:52 +01:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2012-09-26 15:52:25 +02:00
|
|
|
*
|
|
|
|
* RetroArch 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 Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch 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 RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef X11_COMMON_H__
|
|
|
|
#define X11_COMMON_H__
|
|
|
|
|
2012-10-12 19:05:29 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2015-11-19 09:49:37 +01:00
|
|
|
#include <signal.h>
|
2015-04-09 05:05:29 +02:00
|
|
|
|
2012-09-26 15:52:25 +02:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
2012-09-29 10:47:55 +02:00
|
|
|
#include <X11/extensions/xf86vmode.h>
|
2012-10-12 19:05:29 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_XINERAMA
|
|
|
|
#include <X11/extensions/Xinerama.h>
|
|
|
|
#endif
|
|
|
|
|
2014-10-21 05:05:52 +02:00
|
|
|
#include <boolean.h>
|
2012-09-26 15:52:25 +02:00
|
|
|
|
2015-11-19 09:49:37 +01:00
|
|
|
#include "../video_context_driver.h"
|
|
|
|
|
2015-11-19 10:00:25 +01:00
|
|
|
extern Window g_x11_win;
|
|
|
|
extern Display *g_x11_dpy;
|
2015-11-19 11:55:05 +01:00
|
|
|
extern Colormap g_x11_cmap;
|
2015-12-01 08:42:33 +01:00
|
|
|
extern unsigned g_x11_screen;
|
2015-11-19 09:49:37 +01:00
|
|
|
|
2015-12-01 08:49:35 +01:00
|
|
|
void x11_save_last_used_monitor(Window win);
|
2013-03-29 13:46:11 +01:00
|
|
|
void x11_show_mouse(Display *dpy, Window win, bool state);
|
2012-09-26 15:52:25 +02:00
|
|
|
void x11_windowed_fullscreen(Display *dpy, Window win);
|
2016-05-08 19:19:31 +02:00
|
|
|
void x11_suspend_screensaver(Window win, bool enable);
|
2016-02-05 13:36:18 +01:00
|
|
|
bool x11_enter_fullscreen(Display *dpy, unsigned width,
|
|
|
|
unsigned height, XF86VidModeModeInfo *desktop_mode);
|
|
|
|
|
2012-09-29 10:47:55 +02:00
|
|
|
void x11_exit_fullscreen(Display *dpy, XF86VidModeModeInfo *desktop_mode);
|
2016-02-05 13:36:18 +01:00
|
|
|
void x11_move_window(Display *dpy, Window win,
|
|
|
|
int x, int y, unsigned width, unsigned height);
|
2012-10-12 19:05:29 +02:00
|
|
|
|
2015-01-07 18:06:50 +01:00
|
|
|
/* Set icon, class, default stuff. */
|
2012-10-26 23:01:32 +02:00
|
|
|
void x11_set_window_attr(Display *dpy, Window win);
|
2012-10-13 12:51:37 +02:00
|
|
|
|
2012-10-12 19:05:29 +02:00
|
|
|
#ifdef HAVE_XINERAMA
|
|
|
|
bool x11_get_xinerama_coord(Display *dpy, int screen,
|
|
|
|
int *x, int *y, unsigned *w, unsigned *h);
|
|
|
|
|
|
|
|
unsigned x11_get_xinerama_monitor(Display *dpy,
|
|
|
|
int x, int y, int w, int h);
|
|
|
|
#endif
|
2012-09-26 15:52:25 +02:00
|
|
|
|
2013-12-08 14:20:05 +01:00
|
|
|
bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic);
|
|
|
|
void x11_destroy_input_context(XIM *xim, XIC *xic);
|
|
|
|
void x11_handle_key_event(XEvent *event, XIC ic, bool filter);
|
2012-12-08 13:35:07 +01:00
|
|
|
|
2015-04-09 05:05:29 +02:00
|
|
|
bool x11_get_metrics(void *data,
|
|
|
|
enum display_metric_types type, float *value);
|
|
|
|
|
2015-11-19 10:35:15 +01:00
|
|
|
void x11_check_window(void *data, bool *quit,
|
|
|
|
bool *resize, unsigned *width, unsigned *height, unsigned frame_count);
|
2015-11-19 10:02:53 +01:00
|
|
|
|
2015-11-19 10:29:26 +01:00
|
|
|
void x11_get_video_size(void *data, unsigned *width, unsigned *height);
|
2015-11-19 10:09:19 +01:00
|
|
|
|
2015-11-19 10:25:07 +01:00
|
|
|
bool x11_has_focus(void *data);
|
2015-11-19 10:13:09 +01:00
|
|
|
|
2015-11-19 12:23:01 +01:00
|
|
|
bool x11_has_focus_internal(void *data);
|
|
|
|
|
2015-11-19 10:46:16 +01:00
|
|
|
bool x11_alive(void *data);
|
|
|
|
|
2015-11-19 11:04:17 +01:00
|
|
|
void x11_install_sighandlers(void);
|
|
|
|
|
2015-11-19 11:07:52 +01:00
|
|
|
bool x11_connect(void);
|
|
|
|
|
2015-11-19 11:18:57 +01:00
|
|
|
void x11_update_window_title(void *data);
|
|
|
|
|
2015-11-19 12:05:32 +01:00
|
|
|
bool x11_input_ctx_new(bool true_full);
|
2015-11-19 11:27:41 +01:00
|
|
|
|
|
|
|
void x11_input_ctx_destroy(void);
|
|
|
|
|
2015-11-19 11:49:09 +01:00
|
|
|
void x11_window_destroy(bool fullscreen);
|
|
|
|
|
2015-11-19 11:55:05 +01:00
|
|
|
void x11_colormap_destroy(void);
|
|
|
|
|
2015-11-19 12:18:35 +01:00
|
|
|
void x11_install_quit_atom(void);
|
|
|
|
|
2015-11-19 15:05:17 +01:00
|
|
|
void x11_event_queue_check(XEvent *event);
|
|
|
|
|
2012-09-26 15:52:25 +02:00
|
|
|
#endif
|
|
|
|
|