mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(dispserv_win32.c) General cleanups
This commit is contained in:
parent
71a3c24d52
commit
e53a623f4a
@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#include "../video_display_server.h"
|
#include "../video_display_server.h"
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
#include "../../retroarch.h"
|
|
||||||
#include "../../verbosity.h"
|
|
||||||
|
|
||||||
#ifdef __ITaskbarList3_INTERFACE_DEFINED__
|
#ifdef __ITaskbarList3_INTERFACE_DEFINED__
|
||||||
#define HAS_TASKBAR_EXT
|
#define HAS_TASKBAR_EXT
|
||||||
@ -54,6 +52,17 @@
|
|||||||
#define ITaskbarList3_SetProgressValue(a, b, c, d) (a)->SetProgressValue(b, c, d)
|
#define ITaskbarList3_SetProgressValue(a, b, c, d) (a)->SetProgressValue(b, c, d)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
NOTE: When an application displays a window,
|
||||||
|
its taskbar button is created by the system.
|
||||||
|
When the button is in place, the taskbar sends a
|
||||||
|
TaskbarButtonCreated message to the window.
|
||||||
|
|
||||||
|
Its value is computed by calling RegisterWindowMessage(
|
||||||
|
L("TaskbarButtonCreated")).
|
||||||
|
That message must be received by your application before
|
||||||
|
it calls any ITaskbarList3 method.
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -68,13 +77,6 @@ typedef struct
|
|||||||
#endif
|
#endif
|
||||||
} dispserv_win32_t;
|
} dispserv_win32_t;
|
||||||
|
|
||||||
/*
|
|
||||||
NOTE: When an application displays a window, its taskbar button is created
|
|
||||||
by the system. When the button is in place, the taskbar sends a
|
|
||||||
TaskbarButtonCreated message to the window. Its value is computed by
|
|
||||||
calling RegisterWindowMessage(L("TaskbarButtonCreated")). That message must
|
|
||||||
be received by your application before it calls any ITaskbarList3 method.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void *win32_display_server_init(void)
|
static void *win32_display_server_init(void)
|
||||||
{
|
{
|
||||||
@ -85,27 +87,25 @@ static void *win32_display_server_init(void)
|
|||||||
|
|
||||||
#ifdef HAS_TASKBAR_EXT
|
#ifdef HAS_TASKBAR_EXT
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/* When compiling in C++ mode, GUIDs are references instead of pointers */
|
/* When compiling in C++ mode, GUIDs
|
||||||
|
are references instead of pointers */
|
||||||
if (FAILED(CoCreateInstance(CLSID_TaskbarList, NULL,
|
if (FAILED(CoCreateInstance(CLSID_TaskbarList, NULL,
|
||||||
CLSCTX_INPROC_SERVER, IID_ITaskbarList3,
|
CLSCTX_INPROC_SERVER, IID_ITaskbarList3,
|
||||||
(void**)&dispserv->taskbar_list)))
|
(void**)&dispserv->taskbar_list)))
|
||||||
#else
|
#else
|
||||||
/* Mingw GUIDs are pointers instead of references since we're in C mode */
|
/* Mingw GUIDs are pointers
|
||||||
|
instead of references since we're in C mode */
|
||||||
if (FAILED(CoCreateInstance(&CLSID_TaskbarList, NULL,
|
if (FAILED(CoCreateInstance(&CLSID_TaskbarList, NULL,
|
||||||
CLSCTX_INPROC_SERVER, &IID_ITaskbarList3,
|
CLSCTX_INPROC_SERVER, &IID_ITaskbarList3,
|
||||||
(void**)&dispserv->taskbar_list)))
|
(void**)&dispserv->taskbar_list)))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
dispserv->taskbar_list = NULL;
|
dispserv->taskbar_list = NULL;
|
||||||
RARCH_ERR("[dispserv]: CoCreateInstance of ITaskbarList3 failed.\n");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (FAILED(ITaskbarList3_HrInit(dispserv->taskbar_list)))
|
if (FAILED(ITaskbarList3_HrInit(dispserv->taskbar_list)))
|
||||||
{
|
|
||||||
RARCH_ERR("[dispserv]: HrInit of ITaskbarList3 failed.\n");
|
|
||||||
dispserv->taskbar_list = NULL;
|
dispserv->taskbar_list = NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -290,7 +290,6 @@ static bool win32_display_server_set_resolution(void *data,
|
|||||||
switch (res)
|
switch (res)
|
||||||
{
|
{
|
||||||
case DISP_CHANGE_SUCCESSFUL:
|
case DISP_CHANGE_SUCCESSFUL:
|
||||||
return true;
|
|
||||||
case DISP_CHANGE_NOTUPDATED:
|
case DISP_CHANGE_NOTUPDATED:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@ -421,28 +420,22 @@ static void *win32_display_server_get_resolution_list(
|
|||||||
enum rotation win32_display_server_get_screen_orientation(void *data)
|
enum rotation win32_display_server_get_screen_orientation(void *data)
|
||||||
{
|
{
|
||||||
DEVMODE dm = {0};
|
DEVMODE dm = {0};
|
||||||
enum rotation rotation;
|
|
||||||
|
|
||||||
win32_get_video_output(&dm, -1, sizeof(dm));
|
win32_get_video_output(&dm, -1, sizeof(dm));
|
||||||
|
|
||||||
switch (dm.dmDisplayOrientation)
|
switch (dm.dmDisplayOrientation)
|
||||||
{
|
{
|
||||||
|
case DMDO_90:
|
||||||
|
return ORIENTATION_FLIPPED_ROTATED;
|
||||||
|
case DMDO_180:
|
||||||
|
return ORIENTATION_FLIPPED;
|
||||||
|
case DMDO_270:
|
||||||
|
return ORIENTATION_VERTICAL;
|
||||||
case DMDO_DEFAULT:
|
case DMDO_DEFAULT:
|
||||||
default:
|
default:
|
||||||
rotation = ORIENTATION_NORMAL;
|
|
||||||
break;
|
|
||||||
case DMDO_90:
|
|
||||||
rotation = ORIENTATION_FLIPPED_ROTATED;
|
|
||||||
break;
|
|
||||||
case DMDO_180:
|
|
||||||
rotation = ORIENTATION_FLIPPED;
|
|
||||||
break;
|
|
||||||
case DMDO_270:
|
|
||||||
rotation = ORIENTATION_VERTICAL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rotation;
|
return ORIENTATION_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void win32_display_server_set_screen_orientation(void *data,
|
void win32_display_server_set_screen_orientation(void *data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user