Commit 90b0c4d1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB: use var_Inherit*()

parent 6bbabbb5
...@@ -132,7 +132,7 @@ static int Open (vlc_object_t *obj) ...@@ -132,7 +132,7 @@ static int Open (vlc_object_t *obj)
demux->p_sys = p_sys; demux->p_sys = p_sys;
/* Connect to X server */ /* Connect to X server */
char *display = var_CreateGetNonEmptyString (obj, "x11-display"); char *display = var_InheritString (obj, "x11-display");
int snum; int snum;
xcb_connection_t *conn = xcb_connect (display, &snum); xcb_connection_t *conn = xcb_connect (display, &snum);
free (display); free (display);
...@@ -182,14 +182,14 @@ static int Open (vlc_object_t *obj) ...@@ -182,14 +182,14 @@ static int Open (vlc_object_t *obj)
goto error; goto error;
/* Window properties */ /* Window properties */
p_sys->x = var_CreateGetInteger (obj, "screen-left"); p_sys->x = var_InheritInteger (obj, "screen-left");
p_sys->y = var_CreateGetInteger (obj, "screen-top"); p_sys->y = var_InheritInteger (obj, "screen-top");
p_sys->w = var_CreateGetInteger (obj, "screen-width"); p_sys->w = var_InheritInteger (obj, "screen-width");
p_sys->h = var_CreateGetInteger (obj, "screen-height"); p_sys->h = var_InheritInteger (obj, "screen-height");
p_sys->follow_mouse = var_CreateGetBool (obj, "screen-follow-mouse"); p_sys->follow_mouse = var_InheritBool (obj, "screen-follow-mouse");
/* Initializes format */ /* Initializes format */
p_sys->rate = var_CreateGetFloat (obj, "screen-fps"); p_sys->rate = var_InheritFloat (obj, "screen-fps");
if (!p_sys->rate) if (!p_sys->rate)
goto error; goto error;
p_sys->interval = (float)CLOCK_FREQ / p_sys->rate; p_sys->interval = (float)CLOCK_FREQ / p_sys->rate;
......
...@@ -74,7 +74,7 @@ static int vlc_sd_probe_Open (vlc_object_t *obj) ...@@ -74,7 +74,7 @@ static int vlc_sd_probe_Open (vlc_object_t *obj)
{ {
vlc_probe_t *probe = (vlc_probe_t *)obj; vlc_probe_t *probe = (vlc_probe_t *)obj;
char *display = var_CreateGetNonEmptyString (obj, "x11-display"); char *display = var_InheritString (obj, "x11-display");
xcb_connection_t *conn = xcb_connect (display, NULL); xcb_connection_t *conn = xcb_connect (display, NULL);
free (display); free (display);
if (xcb_connection_has_error (conn)) if (xcb_connection_has_error (conn))
...@@ -97,7 +97,7 @@ static int Open (vlc_object_t *obj) ...@@ -97,7 +97,7 @@ static int Open (vlc_object_t *obj)
sd->p_sys = p_sys; sd->p_sys = p_sys;
/* Connect to X server */ /* Connect to X server */
char *display = var_CreateGetNonEmptyString (obj, "x11-display"); char *display = var_InheritString (obj, "x11-display");
int snum; int snum;
xcb_connection_t *conn = xcb_connect (display, &snum); xcb_connection_t *conn = xcb_connect (display, &snum);
free (display); free (display);
......
...@@ -160,7 +160,7 @@ error: ...@@ -160,7 +160,7 @@ error:
/** Check MIT-SHM shared memory support */ /** Check MIT-SHM shared memory support */
void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm) void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm)
{ {
bool shm = var_CreateGetBool (obj, "x11-shm") > 0; bool shm = var_InheritBool (obj, "x11-shm") > 0;
if (shm) if (shm)
{ {
xcb_shm_query_version_cookie_t ck; xcb_shm_query_version_cookie_t ck;
......
...@@ -100,7 +100,7 @@ void RegisterMouseEvents (vlc_object_t *obj, xcb_connection_t *conn, ...@@ -100,7 +100,7 @@ void RegisterMouseEvents (vlc_object_t *obj, xcb_connection_t *conn,
xcb_change_window_attributes (conn, wnd, XCB_CW_EVENT_MASK, &value); xcb_change_window_attributes (conn, wnd, XCB_CW_EVENT_MASK, &value);
/* Try to subscribe to click events */ /* Try to subscribe to click events */
/* (only one X11 client can get them, so might not work) */ /* (only one X11 client can get them, so might not work) */
if (var_CreateGetBool (obj, "mouse-events")) if (var_InheritBool (obj, "mouse-events"))
{ {
value |= XCB_EVENT_MASK_BUTTON_PRESS value |= XCB_EVENT_MASK_BUTTON_PRESS
| XCB_EVENT_MASK_BUTTON_RELEASE; | XCB_EVENT_MASK_BUTTON_RELEASE;
......
...@@ -217,7 +217,7 @@ static int Open (vlc_object_t *obj) ...@@ -217,7 +217,7 @@ static int Open (vlc_object_t *obj)
return VLC_ENOMEM; return VLC_ENOMEM;
/* Connect to X */ /* Connect to X */
char *display = var_CreateGetNonEmptyString (wnd, "x11-display"); char *display = var_InheritString (wnd, "x11-display");
int snum; int snum;
xcb_connection_t *conn = xcb_connect (display, &snum); xcb_connection_t *conn = xcb_connect (display, &snum);
...@@ -272,7 +272,7 @@ static int Open (vlc_object_t *obj) ...@@ -272,7 +272,7 @@ static int Open (vlc_object_t *obj)
wnd->sys = p_sys; wnd->sys = p_sys;
p_sys->conn = conn; p_sys->conn = conn;
if (var_CreateGetBool (obj, "keyboard-events")) if (var_InheritBool (obj, "keyboard-events"))
p_sys->keys = CreateKeyHandler (obj, conn); p_sys->keys = CreateKeyHandler (obj, conn);
else else
p_sys->keys = NULL; p_sys->keys = NULL;
...@@ -310,7 +310,7 @@ static int Open (vlc_object_t *obj) ...@@ -310,7 +310,7 @@ static int Open (vlc_object_t *obj)
xcb_atom_t utf8 = get_atom (conn, utf8_string_ck); xcb_atom_t utf8 = get_atom (conn, utf8_string_ck);
xcb_atom_t net_wm_name = get_atom (conn, net_wm_name_ck); xcb_atom_t net_wm_name = get_atom (conn, net_wm_name_ck);
char *title = var_CreateGetNonEmptyString (wnd, "video-title"); char *title = var_InheritString (wnd, "video-title");
if (title) if (title)
{ {
set_string (conn, window, utf8, net_wm_name, title); set_string (conn, window, utf8, net_wm_name, title);
...@@ -339,7 +339,7 @@ static int Open (vlc_object_t *obj) ...@@ -339,7 +339,7 @@ static int Open (vlc_object_t *obj)
/* Make the window visible */ /* Make the window visible */
xcb_map_window (conn, window); xcb_map_window (conn, window);
if (var_CreateGetBool (obj, "video-wallpaper")) if (var_InheritBool (obj, "video-wallpaper"))
{ {
vout_window_SetState (wnd, VOUT_WINDOW_STATE_BELOW); vout_window_SetState (wnd, VOUT_WINDOW_STATE_BELOW);
vout_window_SetFullScreen (wnd, true); vout_window_SetFullScreen (wnd, true);
...@@ -605,7 +605,7 @@ static int EmOpen (vlc_object_t *obj) ...@@ -605,7 +605,7 @@ static int EmOpen (vlc_object_t *obj)
{ {
vout_window_t *wnd = (vout_window_t *)obj; vout_window_t *wnd = (vout_window_t *)obj;
xcb_window_t window = var_CreateGetInteger (obj, "drawable-xid"); xcb_window_t window = var_InheritInteger (obj, "drawable-xid");
if (window == 0) if (window == 0)
return VLC_EGENERIC; return VLC_EGENERIC;
var_Destroy (obj, "drawable-xid"); var_Destroy (obj, "drawable-xid");
...@@ -635,7 +635,7 @@ static int EmOpen (vlc_object_t *obj) ...@@ -635,7 +635,7 @@ static int EmOpen (vlc_object_t *obj)
p_sys->root = geo->root; p_sys->root = geo->root;
free (geo); free (geo);
if (var_CreateGetBool (obj, "keyboard-events")) if (var_InheritBool (obj, "keyboard-events"))
{ {
p_sys->keys = CreateKeyHandler (obj, conn); p_sys->keys = CreateKeyHandler (obj, conn);
if (p_sys->keys != NULL) if (p_sys->keys != NULL)
......
...@@ -297,7 +297,7 @@ static int Open (vlc_object_t *obj) ...@@ -297,7 +297,7 @@ static int Open (vlc_object_t *obj)
vout_display_t *vd = (vout_display_t *)obj; vout_display_t *vd = (vout_display_t *)obj;
vout_display_sys_t *p_sys = malloc (sizeof (*p_sys)); vout_display_sys_t *p_sys = malloc (sizeof (*p_sys));
if (!var_CreateGetBool (obj, "overlay")) if (!var_InheritBool (obj, "overlay"))
return VLC_EGENERIC; return VLC_EGENERIC;
if (p_sys == NULL) if (p_sys == NULL)
return VLC_ENOMEM; return VLC_ENOMEM;
...@@ -336,7 +336,7 @@ static int Open (vlc_object_t *obj) ...@@ -336,7 +336,7 @@ static int Open (vlc_object_t *obj)
if (adaptors == NULL) if (adaptors == NULL)
goto error; goto error;
int forced_adaptor = var_CreateGetInteger (obj, "xvideo-adaptor"); int forced_adaptor = var_InheritInteger (obj, "xvideo-adaptor");
/* */ /* */
video_format_t fmt = vd->fmt; video_format_t fmt = vd->fmt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment