(Display server) Add get_output
This commit is contained in:
parent
9c88c6e3c5
commit
2c959d8ff1
|
@ -28,14 +28,14 @@ static void null_display_server_destroy(void *data)
|
|||
(void)data;
|
||||
}
|
||||
|
||||
static bool null_set_window_opacity(void *data, unsigned opacity)
|
||||
static bool null_display_server_set_window_opacity(void *data, unsigned opacity)
|
||||
{
|
||||
(void)data;
|
||||
(void)opacity;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool null_set_window_progress(void *data, int progress, bool finished)
|
||||
static bool null_display_server_set_window_progress(void *data, int progress, bool finished)
|
||||
{
|
||||
(void)data;
|
||||
(void)progress;
|
||||
|
@ -46,8 +46,9 @@ static bool null_set_window_progress(void *data, int progress, bool finished)
|
|||
const video_display_server_t dispserv_null = {
|
||||
null_display_server_init,
|
||||
null_display_server_destroy,
|
||||
null_set_window_opacity,
|
||||
null_set_window_progress,
|
||||
null_display_server_set_window_opacity,
|
||||
null_display_server_set_window_progress,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"null"
|
||||
|
|
|
@ -121,7 +121,7 @@ static void win32_display_server_destroy(void *data)
|
|||
free(dispserv);
|
||||
}
|
||||
|
||||
static bool win32_set_window_opacity(void *data, unsigned opacity)
|
||||
static bool win32_display_server_set_window_opacity(void *data, unsigned opacity)
|
||||
{
|
||||
HWND hwnd = win32_get_window();
|
||||
dispserv_win32_t *serv = (dispserv_win32_t*)data;
|
||||
|
@ -148,7 +148,7 @@ static bool win32_set_window_opacity(void *data, unsigned opacity)
|
|||
#endif
|
||||
}
|
||||
|
||||
static bool win32_set_window_progress(void *data, int progress, bool finished)
|
||||
static bool win32_display_server_set_window_progress(void *data, int progress, bool finished)
|
||||
{
|
||||
HWND hwnd = win32_get_window();
|
||||
dispserv_win32_t *serv = (dispserv_win32_t*)data;
|
||||
|
@ -187,7 +187,7 @@ static bool win32_set_window_progress(void *data, int progress, bool finished)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool win32_set_window_decorations(void *data, bool on)
|
||||
static bool win32_display_server_set_window_decorations(void *data, bool on)
|
||||
{
|
||||
dispserv_win32_t *serv = (dispserv_win32_t*)data;
|
||||
|
||||
|
@ -286,10 +286,11 @@ static bool win32_display_server_set_resolution(void *data,
|
|||
const video_display_server_t dispserv_win32 = {
|
||||
win32_display_server_init,
|
||||
win32_display_server_destroy,
|
||||
win32_set_window_opacity,
|
||||
win32_set_window_progress,
|
||||
win32_set_window_decorations,
|
||||
win32_display_server_set_window_opacity,
|
||||
win32_display_server_set_window_progress,
|
||||
win32_display_server_set_window_decorations,
|
||||
win32_display_server_set_resolution,
|
||||
NULL, /* get_output_options */
|
||||
"win32"
|
||||
};
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ static void x11_display_server_destroy(void *data)
|
|||
free(dispserv);
|
||||
}
|
||||
|
||||
static bool x11_set_window_opacity(void *data, unsigned opacity)
|
||||
static bool x11_display_server_set_window_opacity(void *data, unsigned opacity)
|
||||
{
|
||||
dispserv_x11_t *serv = (dispserv_x11_t*)data;
|
||||
Atom net_wm_opacity = XInternAtom(g_x11_dpy, "_NET_WM_WINDOW_OPACITY", False);
|
||||
|
@ -96,7 +96,7 @@ static bool x11_set_window_opacity(void *data, unsigned opacity)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool x11_set_window_decorations(void *data, bool on)
|
||||
static bool x11_display_server_set_window_decorations(void *data, bool on)
|
||||
{
|
||||
dispserv_x11_t *serv = (dispserv_x11_t*)data;
|
||||
|
||||
|
@ -107,7 +107,7 @@ static bool x11_set_window_decorations(void *data, bool on)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool x11_set_resolution(void *data,
|
||||
static bool x11_display_server_set_resolution(void *data,
|
||||
unsigned width, unsigned height, int int_hz, float hz)
|
||||
{
|
||||
int i = 0;
|
||||
|
@ -293,13 +293,20 @@ static bool x11_set_resolution(void *data,
|
|||
return true;
|
||||
}
|
||||
|
||||
const char *x11_display_server_get_output_options(void)
|
||||
{
|
||||
/* TODO/FIXME - hardcoded for now; list should be built up dynamically later */
|
||||
return "HDMI-0|HDMI-1|HDMI-2|HDMI-3|DVI-0|DVI-1|DVI-2|DVI-3|VGA-0|VGA-1|VGA-2|VGA-3|Config";
|
||||
}
|
||||
|
||||
const video_display_server_t dispserv_x11 = {
|
||||
x11_display_server_init,
|
||||
x11_display_server_destroy,
|
||||
x11_set_window_opacity,
|
||||
x11_display_server_set_window_opacity,
|
||||
NULL,
|
||||
x11_set_window_decorations,
|
||||
x11_set_resolution, /* set_resolution */
|
||||
x11_display_server_set_window_decorations,
|
||||
x11_display_server_set_resolution,
|
||||
x11_display_server_get_output_options,
|
||||
"x11"
|
||||
};
|
||||
|
||||
|
|
|
@ -90,3 +90,10 @@ bool video_display_server_switch_resolution(unsigned width, unsigned height,
|
|||
return current_display_server->switch_resolution(current_display_server_data, width, height, int_hz, hz);
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *video_display_server_get_output_options(void)
|
||||
{
|
||||
if (current_display_server && current_display_server->get_output_options)
|
||||
return current_display_server->get_output_options(current_display_server_data);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ typedef struct video_display_server
|
|||
bool (*set_window_decorations)(void *data, bool on);
|
||||
bool (*switch_resolution)(void *data, unsigned width,
|
||||
unsigned height, int int_hz, float hz);
|
||||
const char *(*get_output_options)(void *data);
|
||||
const char *ident;
|
||||
} video_display_server_t;
|
||||
|
||||
|
@ -49,6 +50,8 @@ bool video_display_server_switch_resolution(
|
|||
unsigned width, unsigned height,
|
||||
int int_hz, float hz);
|
||||
|
||||
const char *video_display_server_get_output_options(void);
|
||||
|
||||
extern const video_display_server_t dispserv_win32;
|
||||
extern const video_display_server_t dispserv_x11;
|
||||
extern const video_display_server_t dispserv_null;
|
||||
|
|
Loading…
Reference in New Issue