mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +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 "../common/win32_common.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#ifdef __ITaskbarList3_INTERFACE_DEFINED__
|
||||
#define HAS_TASKBAR_EXT
|
||||
@ -54,6 +52,17 @@
|
||||
#define ITaskbarList3_SetProgressValue(a, b, c, d) (a)->SetProgressValue(b, c, d)
|
||||
#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
|
||||
|
||||
typedef struct
|
||||
@ -68,13 +77,6 @@ typedef struct
|
||||
#endif
|
||||
} 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)
|
||||
{
|
||||
@ -85,28 +87,26 @@ static void *win32_display_server_init(void)
|
||||
|
||||
#ifdef HAS_TASKBAR_EXT
|
||||
#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,
|
||||
CLSCTX_INPROC_SERVER, IID_ITaskbarList3,
|
||||
(void**)&dispserv->taskbar_list)))
|
||||
#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,
|
||||
CLSCTX_INPROC_SERVER, &IID_ITaskbarList3,
|
||||
(void**)&dispserv->taskbar_list)))
|
||||
#endif
|
||||
{
|
||||
dispserv->taskbar_list = NULL;
|
||||
RARCH_ERR("[dispserv]: CoCreateInstance of ITaskbarList3 failed.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(ITaskbarList3_HrInit(dispserv->taskbar_list)))
|
||||
{
|
||||
RARCH_ERR("[dispserv]: HrInit of ITaskbarList3 failed.\n");
|
||||
dispserv->taskbar_list = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return dispserv;
|
||||
@ -290,7 +290,6 @@ static bool win32_display_server_set_resolution(void *data,
|
||||
switch (res)
|
||||
{
|
||||
case DISP_CHANGE_SUCCESSFUL:
|
||||
return true;
|
||||
case DISP_CHANGE_NOTUPDATED:
|
||||
return true;
|
||||
default:
|
||||
@ -421,28 +420,22 @@ static void *win32_display_server_get_resolution_list(
|
||||
enum rotation win32_display_server_get_screen_orientation(void *data)
|
||||
{
|
||||
DEVMODE dm = {0};
|
||||
enum rotation rotation;
|
||||
|
||||
win32_get_video_output(&dm, -1, sizeof(dm));
|
||||
|
||||
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:
|
||||
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;
|
||||
}
|
||||
|
||||
return rotation;
|
||||
return ORIENTATION_NORMAL;
|
||||
}
|
||||
|
||||
void win32_display_server_set_screen_orientation(void *data,
|
||||
|
Loading…
x
Reference in New Issue
Block a user