RetroArch
Classes | Macros | Typedefs | Functions | Variables
win32_common.c File Reference
#include <windows.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include "win32_common.h"
#include "gdi_common.h"
#include "../../frontend/frontend_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
#include "../../driver.h"
#include "../../paths.h"
#include "../../retroarch.h"
#include "../../tasks/tasks_internal.h"
#include "../../core_info.h"
#include <commdlg.h>
#include <dbt.h>
#include "../../input/input_driver.h"
#include "../../input/input_keymaps.h"
#include "../video_thread_wrapper.h"
#include "../video_display_server.h"
#include "../../gfx/video_driver.h"
#include <shellapi.h>
#include <encodings/utf.h>
Include dependency graph for win32_common.c:

Classes

struct  DISPLAYCONFIG_RATIONAL_CUSTOM
 
struct  DISPLAYCONFIG_2DREGION_CUSTOM
 
struct  DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM
 
struct  DISPLAYCONFIG_TARGET_MODE_CUSTOM
 
struct  DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM
 
struct  DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM
 
struct  DISPLAYCONFIG_SOURCE_MODE_CUSTOM
 
struct  DISPLAYCONFIG_MODE_INFO_CUSTOM
 
struct  DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM
 
struct  DISPLAYCONFIG_PATH_INFO_CUSTOM
 

Macros

#define _WIN32_WINNT   0x0601 /* Windows 7 */
 
#define WINVER   0x0601
 
#define IDI_ICON   1
 
#define DragQueryFileR   DragQueryFileW
 
#define MAX_MONITORS   9
 
#define INT_PTR_COMPAT   INT_PTR
 

Typedefs

typedef struct DISPLAYCONFIG_RATIONAL_CUSTOM DISPLAYCONFIG_RATIONAL_CUSTOM
 
typedef struct DISPLAYCONFIG_2DREGION_CUSTOM DISPLAYCONFIG_2DREGION_CUSTOM
 
typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM
 
typedef struct DISPLAYCONFIG_TARGET_MODE_CUSTOM DISPLAYCONFIG_TARGET_MODE_CUSTOM
 
typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM
 
typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM
 
typedef struct DISPLAYCONFIG_SOURCE_MODE_CUSTOM DISPLAYCONFIG_SOURCE_MODE_CUSTOM
 
typedef struct DISPLAYCONFIG_MODE_INFO_CUSTOM DISPLAYCONFIG_MODE_INFO_CUSTOM
 
typedef struct DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM
 
typedef struct DISPLAYCONFIG_PATH_INFO_CUSTOM DISPLAYCONFIG_PATH_INFO_CUSTOM
 
typedef LONG(WINAPI * QUERYDISPLAYCONFIG) (UINT32, UINT32 *, DISPLAYCONFIG_PATH_INFO_CUSTOM *, UINT32 *, DISPLAYCONFIG_MODE_INFO_CUSTOM *, UINT32 *)
 
typedef LONG(WINAPI * GETDISPLAYCONFIGBUFFERSIZES) (UINT32, UINT32 *, UINT32 *)
 

Functions

bool win32_taskbar_is_created (void)
 
void win32_set_taskbar_created (bool created)
 
bool doubleclick_on_titlebar_pressed (void)
 
void unset_doubleclick_on_titlebar (void)
 
INT_PTR_COMPAT CALLBACK PickCoreProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL CALLBACK win32_monitor_enum_proc (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
 
void win32_monitor_from_window (void)
 
int win32_change_display_settings (const char *str, void *devmode_data, unsigned flags)
 
void win32_monitor_get_info (void)
 
void win32_monitor_info (void *data, void *hm_data, unsigned *mon_id)
 
bool win32_load_content_from_gui (const char *szFilename)
 
static bool win32_drag_query_file (HWND hwnd, WPARAM wparam)
 
static LRESULT win32_handle_keyboard_event (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
static void win32_set_position_from_config (void)
 
static void win32_save_position (void)
 
static LRESULT CALLBACK WndProcCommon (bool *quit, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
static void win32_set_droppable (ui_window_win32_t *window, bool droppable)
 
LRESULT CALLBACK WndProcGDI (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
bool win32_window_create (void *data, unsigned style, RECT *mon_rect, unsigned width, unsigned height, bool fullscreen)
 
bool win32_get_metrics (void *data, enum display_metric_types type, float *value)
 
void win32_monitor_init (void)
 
static bool win32_monitor_set_fullscreen (unsigned width, unsigned height, unsigned refresh, char *dev_name)
 
void win32_show_cursor (bool state)
 
void win32_check_window (bool *quit, bool *resize, unsigned *width, unsigned *height)
 
bool win32_suppress_screensaver (void *data, bool enable)
 
void win32_set_style (MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style)
 
void win32_set_window (unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, void *rect_data)
 
bool win32_set_video_mode (void *data, unsigned width, unsigned height, bool fullscreen)
 
bool win32_has_focus (void)
 
HWND win32_get_window (void)
 
void win32_window_reset (void)
 
void win32_destroy_window (void)
 
void win32_get_video_output_prev (unsigned *width, unsigned *height)
 
float win32_get_refresh_rate (void *data)
 
void win32_get_video_output_next (unsigned *width, unsigned *height)
 
bool win32_get_video_output (DEVMODE *dm, int mode, size_t len)
 
void win32_get_video_output_size (unsigned *width, unsigned *height)
 

Variables

const GUID GUID_DEVINTERFACE_HID = { 0x4d1e55b2, 0xf16f, 0x11Cf, { 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 } }
 
static HDEVNOTIFY notification_handler
 
static bool g_win32_resized = false
 
bool g_win32_restore_desktop = false
 
static bool doubleclick_on_titlebar = false
 
static bool g_taskbar_is_created = false
 
bool g_win32_inited = false
 
static bool g_win32_quit = false
 
static int g_win32_pos_x = CW_USEDEFAULT
 
static int g_win32_pos_y = CW_USEDEFAULT
 
static unsigned g_win32_pos_width = 0
 
static unsigned g_win32_pos_height = 0
 
unsigned g_win32_resize_width = 0
 
unsigned g_win32_resize_height = 0
 
static unsigned g_taskbar_message = 0
 
static unsigned win32_monitor_count = 0
 
static voidcurD3D = NULL
 
ui_window_win32_t main_window
 
static HMONITOR win32_monitor_last
 
static HMONITOR win32_monitor_all [MAX_MONITORS]
 

Macro Definition Documentation

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0601 /* Windows 7 */

◆ DragQueryFileR

#define DragQueryFileR   DragQueryFileW

◆ IDI_ICON

#define IDI_ICON   1

◆ INT_PTR_COMPAT

#define INT_PTR_COMPAT   INT_PTR

◆ MAX_MONITORS

#define MAX_MONITORS   9

◆ WINVER

#define WINVER   0x0601

Typedef Documentation

◆ DISPLAYCONFIG_2DREGION_CUSTOM

◆ DISPLAYCONFIG_DESKTOP_IMAGE_INFO_CUSTOM

◆ DISPLAYCONFIG_MODE_INFO_CUSTOM

◆ DISPLAYCONFIG_PATH_INFO_CUSTOM

◆ DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM

◆ DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM

◆ DISPLAYCONFIG_RATIONAL_CUSTOM

◆ DISPLAYCONFIG_SOURCE_MODE_CUSTOM

◆ DISPLAYCONFIG_TARGET_MODE_CUSTOM

◆ DISPLAYCONFIG_VIDEO_SIGNAL_INFO_CUSTOM

◆ GETDISPLAYCONFIGBUFFERSIZES

typedef LONG(WINAPI * GETDISPLAYCONFIGBUFFERSIZES) (UINT32, UINT32 *, UINT32 *)

◆ QUERYDISPLAYCONFIG

typedef LONG(WINAPI * QUERYDISPLAYCONFIG) (UINT32, UINT32 *, DISPLAYCONFIG_PATH_INFO_CUSTOM *, UINT32 *, DISPLAYCONFIG_MODE_INFO_CUSTOM *, UINT32 *)

Function Documentation

◆ doubleclick_on_titlebar_pressed()

bool doubleclick_on_titlebar_pressed ( void  )
Here is the caller graph for this function:

◆ PickCoreProc()

INT_PTR_COMPAT CALLBACK PickCoreProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unset_doubleclick_on_titlebar()

void unset_doubleclick_on_titlebar ( void  )
Here is the caller graph for this function:

◆ win32_change_display_settings()

int win32_change_display_settings ( const char *  str,
void devmode_data,
unsigned  flags 
)
Here is the caller graph for this function:

◆ win32_check_window()

void win32_check_window ( bool quit,
bool resize,
unsigned *  width,
unsigned *  height 
)
Here is the caller graph for this function:

◆ win32_destroy_window()

void win32_destroy_window ( void  )
Here is the caller graph for this function:

◆ win32_drag_query_file()

static bool win32_drag_query_file ( HWND  hwnd,
WPARAM  wparam 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_get_metrics()

bool win32_get_metrics ( void data,
enum display_metric_types  type,
float *  value 
)
Here is the caller graph for this function:

◆ win32_get_refresh_rate()

float win32_get_refresh_rate ( void data)
Here is the call graph for this function:

◆ win32_get_video_output()

bool win32_get_video_output ( DEVMODE *  dm,
int  mode,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_get_video_output_next()

void win32_get_video_output_next ( unsigned *  width,
unsigned *  height 
)
Here is the call graph for this function:

◆ win32_get_video_output_prev()

void win32_get_video_output_prev ( unsigned *  width,
unsigned *  height 
)
Here is the call graph for this function:

◆ win32_get_video_output_size()

void win32_get_video_output_size ( unsigned *  width,
unsigned *  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_get_window()

HWND win32_get_window ( void  )
Here is the caller graph for this function:

◆ win32_handle_keyboard_event()

static LRESULT win32_handle_keyboard_event ( HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_has_focus()

bool win32_has_focus ( void  )
Here is the caller graph for this function:

◆ win32_load_content_from_gui()

bool win32_load_content_from_gui ( const char *  szFilename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_monitor_enum_proc()

static BOOL CALLBACK win32_monitor_enum_proc ( HMONITOR  hMonitor,
HDC  hdcMonitor,
LPRECT  lprcMonitor,
LPARAM  dwData 
)
static
Here is the caller graph for this function:

◆ win32_monitor_from_window()

void win32_monitor_from_window ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_monitor_get_info()

void win32_monitor_get_info ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_monitor_info()

void win32_monitor_info ( void data,
void hm_data,
unsigned *  mon_id 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_monitor_init()

void win32_monitor_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_monitor_set_fullscreen()

static bool win32_monitor_set_fullscreen ( unsigned  width,
unsigned  height,
unsigned  refresh,
char *  dev_name 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_save_position()

static void win32_save_position ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_set_droppable()

static void win32_set_droppable ( ui_window_win32_t window,
bool  droppable 
)
static
Here is the caller graph for this function:

◆ win32_set_position_from_config()

static void win32_set_position_from_config ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_set_style()

void win32_set_style ( MONITORINFOEX *  current_mon,
HMONITOR *  hm_to_use,
unsigned *  width,
unsigned *  height,
bool  fullscreen,
bool  windowed_full,
RECT *  rect,
RECT *  mon_rect,
DWORD *  style 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_set_taskbar_created()

void win32_set_taskbar_created ( bool  created)
Here is the caller graph for this function:

◆ win32_set_video_mode()

bool win32_set_video_mode ( void data,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
Here is the caller graph for this function:

◆ win32_set_window()

void win32_set_window ( unsigned *  width,
unsigned *  height,
bool  fullscreen,
bool  windowed_full,
void rect_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_show_cursor()

void win32_show_cursor ( bool  state)
Here is the caller graph for this function:

◆ win32_suppress_screensaver()

bool win32_suppress_screensaver ( void data,
bool  enable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_taskbar_is_created()

bool win32_taskbar_is_created ( void  )
Here is the caller graph for this function:

◆ win32_window_create()

bool win32_window_create ( void data,
unsigned  style,
RECT *  mon_rect,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ win32_window_reset()

void win32_window_reset ( void  )
Here is the caller graph for this function:

◆ WndProcCommon()

static LRESULT CALLBACK WndProcCommon ( bool quit,
HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WndProcGDI()

LRESULT CALLBACK WndProcGDI ( HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ curD3D

void* curD3D = NULL
static

◆ doubleclick_on_titlebar

bool doubleclick_on_titlebar = false
static

◆ g_taskbar_is_created

bool g_taskbar_is_created = false
static

◆ g_taskbar_message

unsigned g_taskbar_message = 0
static

◆ g_win32_inited

bool g_win32_inited = false

◆ g_win32_pos_height

unsigned g_win32_pos_height = 0
static

◆ g_win32_pos_width

unsigned g_win32_pos_width = 0
static

◆ g_win32_pos_x

int g_win32_pos_x = CW_USEDEFAULT
static

◆ g_win32_pos_y

int g_win32_pos_y = CW_USEDEFAULT
static

◆ g_win32_quit

bool g_win32_quit = false
static

◆ g_win32_resize_height

unsigned g_win32_resize_height = 0

◆ g_win32_resize_width

unsigned g_win32_resize_width = 0

◆ g_win32_resized

bool g_win32_resized = false
static

◆ g_win32_restore_desktop

bool g_win32_restore_desktop = false

◆ GUID_DEVINTERFACE_HID

const GUID GUID_DEVINTERFACE_HID = { 0x4d1e55b2, 0xf16f, 0x11Cf, { 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 } }

◆ main_window

ui_window_win32_t main_window

◆ notification_handler

HDEVNOTIFY notification_handler
static

◆ win32_monitor_all

HMONITOR win32_monitor_all[MAX_MONITORS]
static

◆ win32_monitor_count

unsigned win32_monitor_count = 0
static

◆ win32_monitor_last

HMONITOR win32_monitor_last
static