]> git.sesse.net Git - vlc/commitdiff
Revert "vout_window_t: simplify via anynomous union"
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 30 Jan 2010 15:22:25 +0000 (17:22 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 30 Jan 2010 15:26:10 +0000 (17:26 +0200)
This reverts commit ec4682128ada4047b20763dd94a7ed63c9de3d55.

Conflicts:

modules/gui/qt4/qt4.cpp
modules/video_output/msw/events_vo.c
modules/video_output/x11/xcommon.c
modules/video_output/xcb/common.c
modules/video_output/xcb/window.c
src/video_output/window.c

14 files changed:
include/vlc_vout_window.h
modules/gui/hildon/maemo.c
modules/gui/qt4/qt4.cpp
modules/gui/skins2/src/skin_main.cpp
modules/video_output/drawable.c
modules/video_output/msw/events.c
modules/video_output/omapfb.c
modules/video_output/xcb/common.c
modules/video_output/xcb/events.c
modules/video_output/xcb/glx.c
modules/video_output/xcb/window.c
modules/video_output/xcb/x11.c
modules/video_output/xcb/xvideo.c
src/video_output/window.c

index 14e6db7c669aaad6bef36e6e74b739624b743881..53e3665c004dbf3ddd90bc5b93530663e42d841c 100644 (file)
@@ -90,7 +90,7 @@ struct vout_window_t {
     union {
         void     *hwnd;   /* Win32 window handle */
         uint32_t xid;     /* X11 windows ID */
-    };
+    } handle;
 
     /* display server (mandatory) */
     union {
index f6d74655ee00c4a88257affa6845b88012b4b95f..bcb0f404afc1482aa8573e0948e7f73043fe8a46 100644 (file)
@@ -289,15 +289,15 @@ static int OpenWindow (vlc_object_t *obj)
     while ((intf = wnd_req.intf) == NULL)
         vlc_cond_wait (&wnd_req.wait, &wnd_req.lock);
 
-    wnd->xid = request_video( intf, vout );
+    wnd->handle.xid = request_video( intf, vout );
     vlc_mutex_unlock (&wnd_req.lock);
 
     vlc_object_release( vout );
 
-    if (!wnd->xid)
+    if (!wnd->handle.xid)
         return VLC_EGENERIC;
 
-    msg_Dbg( intf, "Using handle %"PRIu32, wnd->xid );
+    msg_Dbg( intf, "Using handle %"PRIu32, wnd->handle.xid );
 
     wnd->control = ControlWindow;
     wnd->sys = (vout_window_sys_t*)intf;
index e238dbd826224a7e88957734489c0ebd662a07c8..904c363d6d39263600474ec178bd00f58b2595e4 100644 (file)
@@ -537,14 +537,14 @@ static int WindowOpen( vlc_object_t *p_obj )
     unsigned i_height = p_wnd->cfg->height;
 
 #if defined (Q_WS_X11)
-    p_wnd->xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
-    if( !p_wnd->xid )
+    p_wnd->handle.xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
+    if( !p_wnd->handle.xid )
         return VLC_EGENERIC;
     p_wnd->x11_display = x11_display;
 
 #elif defined (Q_WS_WIN)
-    p_wnd->hwnd = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
-    if( !p_wnd->hwnd )
+    p_wnd->handle.hwnd = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
+    if( !p_wnd->handle.hwnd )
         return VLC_EGENERIC;
 #else
 # error FIXME
index 2f27e170809821bed8ca61692f6804344c8e28f4..2a077f7cfba7392321b5fdaca3bab3c80c8ea183 100644 (file)
@@ -356,9 +356,9 @@ static int WindowOpen( vlc_object_t *p_this )
 
     vlc_mutex_lock( &serializer );
 
-    pWnd->hwnd = VoutManager::getWindow( pIntf, pWnd );
+    pWnd->handle.hwnd = VoutManager::getWindow( pIntf, pWnd );
 
-    if( pWnd->hwnd )
+    if( pWnd->handle.hwnd )
     {
         pWnd->control = &VoutManager::controlWindow;
         pWnd->sys = (vout_window_sys_t*)pIntf;
index 54f689cb8913da1b813066c05cd1aef38e23d720..35125fba26c424e1c399c673fb502f43c2f889a8 100644 (file)
@@ -101,7 +101,7 @@ skip:
     if (val == NULL)
         return VLC_EGENERIC;
 
-    wnd->hwnd = val;
+    wnd->handle.hwnd = val;
     wnd->control = Control;
     wnd->sys = val;
     return VLC_SUCCESS;
index 815cf2890a422c42b9c56d45494a3adacabeb83b..81822418e04de633d51890d125d7c0fcf7895934 100644 (file)
@@ -432,7 +432,7 @@ static int DirectXCreateWindow( event_thread_t *p_event )
         /* If an external window was specified, we'll draw in it. */
         p_event->parent_window = vout_display_NewWindow(vd, &p_event->wnd_cfg );
         if( p_event->parent_window )
-            p_event->hparent = p_event->parent_window->hwnd;
+            p_event->hparent = p_event->parent_window->handle.hwnd;
         else
             p_event->hparent = NULL;
     #ifdef MODULE_NAME_IS_direct3d
index bd530a4e2da7c8be0475b29cd8706324003d830b..b29de5d7f76c6221a127636bf1142a68d4cd291e 100644 (file)
@@ -611,7 +611,7 @@ static void CreateWindow( vout_sys_t *p_sys )
     xwindow_attributes.event_mask = ExposureMask | StructureNotifyMask
                                   | VisibilityChangeMask;
     p_sys->window = XCreateWindow( p_sys->p_display,
-                                   p_sys->owner_window->xid,
+                                   p_sys->owner_window->handle.xid,
                                    0, 0,
                                    p_sys->main_window.i_width,
                                    p_sys->main_window.i_height,
@@ -621,7 +621,7 @@ static void CreateWindow( vout_sys_t *p_sys )
                                    &xwindow_attributes );
 
     XMapWindow( p_sys->p_display, p_sys->window );
-    XSelectInput( p_sys->p_display, p_sys->owner_window->xid,
+    XSelectInput( p_sys->p_display, p_sys->owner_window->handle.xid,
                   StructureNotifyMask );
 }
 
index d1ce9bec10e1222b2154b7423d459fc0000e1c5d..4ebc26da555c21048dd5435c79f020b98db9eaaa 100644 (file)
@@ -140,14 +140,14 @@ vout_window_t *GetWindow (vout_display_t *vd,
         goto error;
     *pconn = conn;
 
-    *pscreen = FindWindow (VLC_OBJECT(vd), conn, wnd->xid, pdepth);
+    *pscreen = FindWindow (VLC_OBJECT(vd), conn, wnd->handle.xid, pdepth);
     if (*pscreen == NULL)
     {
         xcb_disconnect (conn);
         goto error;
     }
 
-    RegisterMouseEvents (VLC_OBJECT(vd), conn, wnd->xid);
+    RegisterMouseEvents (VLC_OBJECT(vd), conn, wnd->handle.xid);
     return wnd;
 
 error:
index b12c013dd259426d3505ef87106fbfd4e68a6d80..e0245b9f941339198d5e487f654dac6b8bbd3877 100644 (file)
@@ -61,7 +61,7 @@ int CheckError (vout_display_t *vd, xcb_connection_t *conn,
 int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
                    unsigned *restrict width, unsigned *restrict height)
 {
-    xcb_get_geometry_cookie_t ck = xcb_get_geometry (conn, wnd->xid);
+    xcb_get_geometry_cookie_t ck = xcb_get_geometry (conn, wnd->handle.xid);
     xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply (conn, ck, NULL);
 
     if (!geo)
index 49b45b3db6d43ee55f91592bd944dadc1a419341..e018a0f34a3d0a5da039645993eabab5360e6ad4 100644 (file)
@@ -108,7 +108,7 @@ FindWindow (vout_display_t *vd, xcb_connection_t *conn,
 
     xcb_get_geometry_reply_t *geo =
         xcb_get_geometry_reply (conn,
-            xcb_get_geometry (conn, sys->embed->xid), NULL);
+            xcb_get_geometry (conn, sys->embed->handle.xid), NULL);
     if (geo == NULL)
     {
         msg_Err (vd, "parent window not valid");
@@ -183,7 +183,7 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
     xcb_void_cookie_t cc, cm;
 
     cc = xcb_create_window_checked (conn, depth, sys->window,
-                                    sys->embed->xid, 0, 0,
+                                    sys->embed->handle.xid, 0, 0,
                                     width, height, 0,
                                     XCB_WINDOW_CLASS_INPUT_OUTPUT,
                                     vid, mask, values);
@@ -236,7 +236,7 @@ static int Open (vlc_object_t *obj)
 
     xcb_connection_t *conn = XGetXCBConnection (dpy);
     assert (conn);
-    RegisterMouseEvents (obj, conn, sys->embed->xid);
+    RegisterMouseEvents (obj, conn, sys->embed->handle.xid);
 
     /* Find window parameters */
     unsigned snum;
@@ -263,7 +263,8 @@ static int Open (vlc_object_t *obj)
 
         xcb_get_window_attributes_reply_t *wa =
             xcb_get_window_attributes_reply (conn,
-                xcb_get_window_attributes (conn, sys->embed->xid), NULL);
+                xcb_get_window_attributes (conn, sys->embed->handle.xid),
+                NULL);
         if (wa == NULL)
             goto error;
         xcb_visualid_t visual = wa->visual;
@@ -530,7 +531,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
      * vout_display_t::info.b_hide_mouse is false */
     case VOUT_DISPLAY_HIDE_MOUSE:
         xcb_change_window_attributes (XGetXCBConnection (sys->display),
-                                      sys->embed->xid,
+                                      sys->embed->handle.xid,
                                     XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
         return VLC_SUCCESS;
 
index 05591ea3f29dc4576886065dfa4ddac2f852d424..4bf2dce6b2841e8f115f0274682e6231f5d89e6f 100644 (file)
@@ -264,7 +264,7 @@ static int Open (vlc_object_t *obj)
         goto error;
     }
 
-    wnd->xid = window;
+    wnd->handle.xid = window;
     wnd->x11_display = display;
     wnd->control = Control;
     wnd->sys = p_sys;
@@ -345,7 +345,7 @@ static int Open (vlc_object_t *obj)
 #ifdef MATCHBOX_HACK
     if (p_sys->mb_current_app_window)
         xcb_set_input_focus (p_sys->conn, XCB_INPUT_FOCUS_POINTER_ROOT,
-                             wnd->xid, XCB_CURRENT_TIME);
+                             wnd->handle.xid, XCB_CURRENT_TIME);
 #endif
     xcb_flush (conn); /* Make sure map_window is sent (should be useless) */
     return VLC_SUCCESS;
@@ -416,13 +416,13 @@ static void *Thread (void *data)
                             xcb_get_property (conn, 0, pne->window, pne->atom,
                                               XA_WINDOW, 0, 4), NULL);
                     if (r != NULL
-                     && !memcmp (xcb_get_property_value (r), &wnd->xid,
+                     && !memcmp (xcb_get_property_value (r), &wnd->handle.xid,
                                  4))
                     {
                         msg_Dbg (wnd, "asking Matchbox for input focus");
                         xcb_set_input_focus (conn,
                                              XCB_INPUT_FOCUS_POINTER_ROOT,
-                                             wnd->xid, pne->time);
+                                             wnd->handle.xid, pne->time);
                         xcb_flush (conn);
                     }
                     free (r);
@@ -452,7 +452,7 @@ static void set_wm_state (vout_window_t *wnd, bool on, xcb_atom_t state)
     xcb_client_message_event_t ev = {
          .response_type = XCB_CLIENT_MESSAGE,
          .format = 32,
-         .window = wnd->xid,
+         .window = wnd->handle.xid,
          .type = sys->wm_state,
     };
 
@@ -482,7 +482,7 @@ static int Control (vout_window_t *wnd, int cmd, va_list ap)
             unsigned height = va_arg (ap, unsigned);
             const uint32_t values[] = { width, height, };
 
-            xcb_configure_window (conn, wnd->xid,
+            xcb_configure_window (conn, wnd->handle.xid,
                                   XCB_CONFIG_WINDOW_WIDTH |
                                   XCB_CONFIG_WINDOW_HEIGHT, values);
             break;
@@ -609,7 +609,7 @@ static int EmOpen (vlc_object_t *obj)
     if (p_sys == NULL || xcb_connection_has_error (conn))
         goto error;
 
-    wnd->xid = window;
+    wnd->handle.xid = window;
     wnd->control = Control;
     wnd->sys = p_sys;
 
@@ -657,7 +657,7 @@ error:
 static void EmClose (vlc_object_t *obj)
 {
     vout_window_t *wnd = (vout_window_t *)obj;
-    xcb_window_t window = wnd->xid;
+    xcb_window_t window = wnd->handle.xid;
 
     Close (obj);
     ReleaseDrawable (obj, window);
index 75c31eb15b975c6f5e43fa14c13dc58da2e7a8fe..b4641f426774164426a6c53360d19e3a072c180e 100644 (file)
@@ -256,7 +256,7 @@ static int Open (vlc_object_t *obj)
 
         c = xcb_create_window_checked (p_sys->conn, p_sys->depth,
                                        p_sys->window,
-                                       p_sys->embed->xid, 0, 0,
+                                       p_sys->embed->handle.xid, 0, 0,
                                        width, height, 0,
                                        XCB_WINDOW_CLASS_INPUT_OUTPUT,
                                        vid, mask, values);
@@ -502,7 +502,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
     /* Hide the mouse. It will be send when
      * vout_display_t::info.b_hide_mouse is false */
     case VOUT_DISPLAY_HIDE_MOUSE:
-        xcb_change_window_attributes (p_sys->conn, p_sys->embed->xid,
+        xcb_change_window_attributes (p_sys->conn, p_sys->embed->handle.xid,
                                   XCB_CW_CURSOR, &(uint32_t){ p_sys->cursor });
         return VLC_SUCCESS;
 
index c02cc85177218103f9bad225b2f49abb932a1023..0c479bb8c0675e96390d89f0d9a42df2932dde2a 100644 (file)
@@ -331,7 +331,7 @@ static int Open (vlc_object_t *obj)
     /* Cache adaptors infos */
     xcb_xv_query_adaptors_reply_t *adaptors =
         xcb_xv_query_adaptors_reply (conn,
-            xcb_xv_query_adaptors (conn, p_sys->embed->xid), NULL);
+            xcb_xv_query_adaptors (conn, p_sys->embed->handle.xid), NULL);
     if (adaptors == NULL)
         goto error;
 
@@ -455,7 +455,7 @@ static int Open (vlc_object_t *obj)
             xcb_void_cookie_t c;
 
             c = xcb_create_window_checked (conn, f->depth, p_sys->window,
-                 p_sys->embed->xid, 0, 0, 1, 1, 0,
+                 p_sys->embed->handle.xid, 0, 0, 1, 1, 0,
                  XCB_WINDOW_CLASS_INPUT_OUTPUT, f->visual,
                  XCB_CW_EVENT_MASK, &mask);
 
@@ -748,7 +748,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
     /* Hide the mouse. It will be send when
      * vout_display_t::info.b_hide_mouse is false */
     case VOUT_DISPLAY_HIDE_MOUSE:
-        xcb_change_window_attributes (p_sys->conn, p_sys->embed->xid,
+        xcb_change_window_attributes (p_sys->conn, p_sys->embed->handle.xid,
                                   XCB_CW_CURSOR, &(uint32_t){ p_sys->cursor });
         return VLC_SUCCESS;
     case VOUT_DISPLAY_RESET_PICTURES:
index 7a6338d216dd323310b1c09d93345090fa91fc7a..c7d099341a5f9a47b0b2acb825b98ca5d21bf892 100644 (file)
@@ -50,6 +50,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
     vout_window_t *window = &w->wnd;
 
     window->cfg = cfg;
+    memset(&window->handle, 0, sizeof(window->handle));
     window->control = NULL;
     window->sys = NULL;
 
@@ -60,12 +61,11 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
 #ifdef WIN32
     case VOUT_WINDOW_TYPE_HWND:
         type = "vout window hwnd";
-        window->hwnd = NULL;
         break;
 #endif
     case VOUT_WINDOW_TYPE_XID:
         type = "vout window xid";
-        window->xid = 0;
+        window->handle.xid = 0;
         window->x11_display = NULL;
         break;
     default:
@@ -81,7 +81,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
     /* Hook for screensaver inhibition */
     if (cfg->type == VOUT_WINDOW_TYPE_XID) {
         w->inhibit = vlc_inhibit_Create (VLC_OBJECT (window),
-                                         window->xid);
+                                         window->handle.xid);
         if (w->inhibit != NULL)
             vlc_inhibit_Set (w->inhibit, true);
             /* FIXME: ^ wait for vout activation, pause */