Commit f777cfb5 authored by Pierre Baillet's avatar Pierre Baillet

.nicer drop

parent 01d9ce67
......@@ -47,10 +47,10 @@
#include "intf_plst.h"
#include "intf_msg.h"
#include "gtk_sys.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_sys.h"
#include "main.h"
......@@ -62,15 +62,6 @@ void on_generic_drop_data_received( intf_thread_t * p_intf,
/*****************************************************************************
* Inline function to retrieve the interface structure
*****************************************************************************/
static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
{
return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
"p_intf" ) );
}
/*****************************************************************************
* Callbacks
******************************************************************************/
......@@ -759,3 +750,57 @@ on_main_window_toggle (GtkMenuItem *menuitem,
}
}
gboolean
on_playlist_clist_drag_motion (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
guint time,
gpointer user_data)
{
GtkCList * clist;
gint row,col;
int dummy;
gchar * text[2];
GdkColor color;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" );
clist = GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist,"playlist_clist"
));
if(!GTK_WIDGET_TOPLEVEL(widget))
{
gdk_window_raise( p_intf->p_sys->p_playlist->window );
}
color.red = 0xffff;
color.green = 0xffff;
color.blue = 0xffff;
gtk_clist_freeze( clist );
for(dummy=0; dummy<clist->rows; dummy++)
{
gtk_clist_set_background ( clist, dummy , &color);
}
color.red = 0xffff;
color.green = 0;
color.blue = 0;
gtk_clist_set_background ( clist, p_main->p_playlist->i_index , &color);
if( gtk_clist_get_selection_info( clist,x,y ,&row,&col )== 1)
{
color.red = 0;
color.green = 0x9000;
color.blue = 0xf000;
gtk_clist_set_background ( clist, row-1 , &color);
gtk_clist_set_background ( clist, row , &color);
}
gtk_clist_thaw( clist );
return TRUE;
}
......@@ -276,3 +276,11 @@ on_crop_activate (GtkMenuItem *menuitem,
void
on_invertselection_clicked (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_playlist_clist_drag_motion (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
guint time,
gpointer user_data);
......@@ -1316,6 +1316,9 @@ create_intf_playlist (void)
gtk_signal_connect (GTK_OBJECT (playlist_clist), "drag_data_received",
GTK_SIGNAL_FUNC (on_intf_playlist_drag_data_received),
NULL);
gtk_signal_connect (GTK_OBJECT (playlist_clist), "drag_motion",
GTK_SIGNAL_FUNC (on_playlist_clist_drag_motion),
NULL);
return intf_playlist;
}
......
......@@ -52,10 +52,10 @@
#include "intf_msg.h"
#include "intf_urldecode.h"
#include "gtk_sys.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_sys.h"
#include "main.h"
......@@ -69,15 +69,6 @@ void GtkPlayListManage( gpointer p_data );
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
{
return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
"p_intf" ) );
}
void
on_menubar_playlist_activate (GtkMenuItem *menuitem,
gpointer user_data)
......@@ -314,7 +305,7 @@ on_intf_playlist_drag_data_received (GtkWidget *widget,
&row,
&col )== 1)
{
on_generic_drop_data_received( p_intf, data, info, row -1 /*TRICK ! */);
on_generic_drop_data_received( p_intf, data, info, row );
} else {
on_generic_drop_data_received( p_intf, data, info, PLAYLIST_END);
}
......
......@@ -2,7 +2,7 @@
* gtk_sys.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_sys.h,v 1.4 2001/03/08 13:32:55 octplane Exp $
* $Id: gtk_sys.h,v 1.5 2001/03/09 19:38:47 octplane Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -27,6 +27,18 @@
#define DROP_ACCEPT_TEXT_URI_LIST 0
#define DROP_ACCEPT_TEXT_PLAIN 1
/*****************************************************************************
* useful inline function
****************************************************************************/
static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
{
return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
"p_intf" ) );
}
/*****************************************************************************
* intf_sys_t: description and status of Gtk+ interface
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.8 2001/03/08 21:47:02 octplane Exp $
* $Id: intf_gtk.c,v 1.9 2001/03/09 19:38:47 octplane Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -50,10 +50,10 @@
#include "intf_msg.h"
#include "interface.h"
#include "gtk_sys.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_sys.h"
#include "main.h"
......
......@@ -1399,6 +1399,11 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<handler>on_intf_playlist_drag_data_received</handler>
<last_modification_time>Thu, 08 Mar 2001 12:00:13 GMT</last_modification_time>
</signal>
<signal>
<name>drag_motion</name>
<handler>on_playlist_clist_drag_motion</handler>
<last_modification_time>Fri, 09 Mar 2001 18:32:47 GMT</last_modification_time>
</signal>
<columns>2</columns>
<column_widths>257,80</column_widths>
<selection_mode>GTK_SELECTION_EXTENDED</selection_mode>
......
......@@ -217,8 +217,10 @@ static int vout_Init( vout_thread_t *p_vout )
/* This hack is hugly, but hey, you are, too. */
SDL_Overlay * p_overlay;
p_overlay = SDL_CreateYUVOverlay( VOUT_WIDTH_DEFAULT, VOUT_HEIGHT_DEFAULT,
p_overlay = SDL_CreateYUVOverlay(
main_GetIntVariable( VOUT_WIDTH_VAR,VOUT_WIDTH_DEFAULT ),
main_GetIntVariable( VOUT_HEIGHT_VAR,VOUT_HEIGHT_DEFAULT ),
SDL_YV12_OVERLAY,
p_vout->p_sys->p_display );
intf_Msg( "vout: YUV acceleration %s",
......@@ -470,7 +472,6 @@ static void vout_Display( vout_thread_t *p_vout )
}
else
{
/*
* p_vout->p_rendered_pic->p_y/u/v contains the YUV buffers to
* render
......
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