Page 1 of 1

dereferencing pointer to incomplete type

Posted: 05 Jul 2006 13:14
by Blaine
Hello again
I added a new function to video.c file in vlc_tree/src/control/video.c to move the vlc video window by other application (Linux).

void libvlc_setWindow_Position( libvlc_input_t *p_input, int iPosition_x, int iPosition_y, libvlc_exception_t *p_e )
{
vout_thread_t *p_vout1 = GetVout( p_input, p_e );
if( !p_vout1 )
return;
XMoveWindow(p_vout1->p_sys->p_display, p_vout1->p_sys->p_win->base_window, iPosition_x, iPosition_y);
}

When I compile with make, it shows these errors:
control/video.c: (XMovewindow line number):error: dereferencing pointer to incomplete type
control/video.c: (XMovewindow line number):error: dereferencing pointer to incomplete type

I made these changes (I copied the x11_window_t definition to video.c file to recognise it):

XMoveWindow( (Display *)(vout_sys_t *)(p_vout1->p_sys)->p_display , (x11_window_t *)((vout_sys_t *)(p_vout1->p_sys)->p_win)->base_window, iPosition_x, iPosition_y);

And it shows the same errors:
control/video.c: (XMovewindow line number):error: dereferencing pointer to incomplete type
control/video.c: (XMovewindow line number):error: dereferencing pointer to incomplete type

I tried to do this too but with the same results:
vout_sys_t *p_my_sys = p_vout1->p_sys;
Display * p_my_display = (Display *)(vout_sys_t*)(p_my_sys)->p_display; // IF I COMMENT THIS LINE IT COMPILES WELL., IF IT IS UNCOMMENTED NOT

// COMMENTED LINE XMoveWindow( (Display *)(vout_sys_t *)(p_vout1->p_sys)->p_display , (x11_window_t *)((vout_sys_t *)(p_vout1->p_sys)->p_win)->base_window, iPosition_x, iPosition_y);

What I need to do to compile it well?

Posted: 05 Jul 2006 23:57
by xtophe
You can't put X11 specific function in src/

that should be in modules/x11

Posted: 06 Jul 2006 15:36
by Blaine
But what file or files must I modify to implement a function to move the vlc window with my application?

Thanks for your help.
Blaine