Wed Aug 19 19:45:16 EDT 1998 The Rasterman <raster@redhat.com>

* gdesktop.c - changed dnd setting routine for desktop icon to set
	events on child window...
	* gtrans.c - chnaged routines to make window with
	child rawing area and set shape on parent window
This commit is contained in:
The Rasterman 1998-08-19 23:39:57 +00:00
parent 12b563f15e
commit 5240be11ae
3 changed files with 41 additions and 16 deletions

View File

@ -1,3 +1,9 @@
Wed Aug 19 19:45:16 EDT 1998 The Rasterman <raster@redhat.com>
* gdesktop.c - changed dnd setting routine for desktop icon to set
events on child window...
* gtrans.c - chnaged routines to make window with child rawing area
and set shape on parent window
1998-08-14 Miguel de Icaza <miguel@nuclecu.unam.mx> 1998-08-14 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gscreen.c (panel_make_local_copies_and_transfer): Fix. * gscreen.c (panel_make_local_copies_and_transfer): Fix.

View File

@ -912,12 +912,15 @@ desktop_icon_drag_end (GtkWidget *widget, GdkEvent *event, desktop_icon_t *di)
static void static void
desktop_icon_make_draggable (desktop_icon_t *di) desktop_icon_make_draggable (desktop_icon_t *di)
{ {
GtkObject *obj = GTK_OBJECT (di->widget); GtkObject *obj;
GList *child;
char *drag_types [] = { "icon/root", "url:ALL" }; char *drag_types [] = { "icon/root", "url:ALL" };
child = gtk_container_children(GTK_CONTAINER(di->widget));
obj = GTK_OBJECT (child->data);
/* To artificially start up drag and drop */ /* To artificially start up drag and drop */
/* gtk_signal_connect (obj, "motion_notify_event", GTK_SIGNAL_FUNC (start_icon_drag), di); */ /* gtk_signal_connect (obj, "motion_notify_event", GTK_SIGNAL_FUNC (start_icon_drag), di); */
gtk_widget_dnd_drag_set (di->widget, TRUE, drag_types, ELEMENTS (drag_types)); gtk_widget_dnd_drag_set (GTK_WIDGET(child->data), TRUE, drag_types, ELEMENTS (drag_types));
gtk_signal_connect (obj, "drag_request_event", GTK_SIGNAL_FUNC (desktop_icon_drag_request), di); gtk_signal_connect (obj, "drag_request_event", GTK_SIGNAL_FUNC (desktop_icon_drag_request), di);
gtk_signal_connect (obj, "drag_begin_event", GTK_SIGNAL_FUNC (desktop_icon_drag_start), di); gtk_signal_connect (obj, "drag_begin_event", GTK_SIGNAL_FUNC (desktop_icon_drag_start), di);
@ -1036,16 +1039,19 @@ char *drop_types [] = {
static void static void
post_setup_desktop_icon (desktop_icon_t *di, int show) post_setup_desktop_icon (desktop_icon_t *di, int show)
{ {
GList *child;
desktop_icon_make_draggable (di); desktop_icon_make_draggable (di);
/* Setup the widget to make it useful: */ /* Setup the widget to make it useful: */
/* 1. Drag and drop functionality */ /* 1. Drag and drop functionality */
connect_drop_signals (di->widget, di);
gtk_widget_dnd_drop_set (di->widget, TRUE, drop_types, ELEMENTS (drop_types), FALSE); child = gtk_container_children(GTK_CONTAINER(di->widget));
connect_drop_signals (GTK_WIDGET(child->data), di);
gtk_widget_dnd_drop_set (GTK_WIDGET(child->data), TRUE, drop_types, ELEMENTS (drop_types), FALSE);
/* 2. Double clicking executes the command */ /* 2. Double clicking executes the command */
gtk_signal_connect (GTK_OBJECT (di->widget), "button_press_event", GTK_SIGNAL_FUNC (dentry_button_click), di); gtk_signal_connect (GTK_OBJECT (child->data), "button_press_event", GTK_SIGNAL_FUNC (dentry_button_click), di);
if (show) if (show)
gtk_widget_show (di->widget); gtk_widget_show (di->widget);

View File

@ -159,7 +159,7 @@ set_window_text (GtkWidget *window, GdkImlibImage *im, char *text)
gtk_widget_set_usize (window, width, height); gtk_widget_set_usize (window, width, height);
gdk_window_set_back_pixmap (window->window, pixmap, FALSE); gdk_window_set_back_pixmap (window->window, pixmap, FALSE);
gdk_window_shape_combine_mask (window->window, mask, 0, 0); gdk_window_shape_combine_mask (window->parent->window, mask, 0, 0);
gdk_gc_destroy (p_gc); gdk_gc_destroy (p_gc);
gdk_gc_destroy (m_gc); gdk_gc_destroy (m_gc);
@ -179,7 +179,7 @@ lower_icon_window(GtkWidget *widget, GdkEventExpose *event)
GtkWidget * GtkWidget *
create_transparent_text_window (char *file, char *text, int extra_events) create_transparent_text_window (char *file, char *text, int extra_events)
{ {
GtkWidget *window; GtkWidget *window, *win;
GdkImlibImage *im; GdkImlibImage *im;
GdkCursor *cursor; GdkCursor *cursor;
@ -190,10 +190,17 @@ create_transparent_text_window (char *file, char *text, int extra_events)
if (!im) if (!im)
return NULL; return NULL;
win = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_events (win, gtk_widget_get_events (win) | extra_events);
gtk_widget_push_visual (gdk_imlib_get_visual ()); gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ()); gtk_widget_push_colormap (gdk_imlib_get_colormap ());
window = gtk_window_new (GTK_WINDOW_POPUP); window = gtk_drawing_area_new ();
gtk_container_add(GTK_CONTAINER(win), window);
gtk_widget_show(window);
gtk_widget_set_events (window, gtk_widget_get_events (window) | extra_events); gtk_widget_set_events (window, gtk_widget_get_events (window) | extra_events);
gtk_widget_pop_colormap (); gtk_widget_pop_colormap ();
@ -219,14 +226,14 @@ create_transparent_text_window (char *file, char *text, int extra_events)
*/ */
gtk_signal_connect(window, "expose_event", GTK_SIGNAL_FUNC(lower_icon_window), NULL); gtk_signal_connect(window, "expose_event", GTK_SIGNAL_FUNC(lower_icon_window), NULL);
#endif #endif
return window; return win;
} }
GtkWidget * GtkWidget *
make_transparent_window (char *file) make_transparent_window (char *file)
{ {
GdkImlibImage *im; GdkImlibImage *im;
GtkWidget *window; GtkWidget *window, *win;
XSetWindowAttributes xwa; XSetWindowAttributes xwa;
if (!g_file_exists (file)) if (!g_file_exists (file))
@ -236,18 +243,24 @@ make_transparent_window (char *file)
if (!im) if (!im)
return NULL; return NULL;
win = gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_push_visual (gdk_imlib_get_visual ()); gtk_widget_push_visual (gdk_imlib_get_visual ());
gtk_widget_push_colormap (gdk_imlib_get_colormap ()); gtk_widget_push_colormap (gdk_imlib_get_colormap ());
window = gtk_window_new (GTK_WINDOW_POPUP); window = gtk_drawing_area_new ();
gtk_container_add(GTK_CONTAINER(win), window);
gtk_widget_show(window);
gtk_widget_pop_colormap (); gtk_widget_pop_colormap ();
gtk_widget_pop_visual (); gtk_widget_pop_visual ();
gtk_widget_realize (window); gtk_widget_realize (window);
xwa.save_under = True; xwa.save_under = True;
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window->window), XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (win->window),
GDK_WINDOW_XWINDOW (window->window), GDK_WINDOW_XWINDOW (win->window),
CWSaveUnder, &xwa); CWSaveUnder, &xwa);
gtk_widget_set_usize (window, im->rgb_width, im->rgb_height); gtk_widget_set_usize (window, im->rgb_width, im->rgb_height);
@ -258,8 +271,8 @@ make_transparent_window (char *file)
*/ */
gdk_imlib_render (im, im->rgb_width, im->rgb_height); gdk_imlib_render (im, im->rgb_width, im->rgb_height);
gdk_window_set_back_pixmap (window->window, gdk_imlib_move_image (im), FALSE); gdk_window_set_back_pixmap (window->window, gdk_imlib_move_image (im), FALSE);
gdk_window_shape_combine_mask (window->window, gdk_imlib_move_mask (im), 0, 0); gdk_window_shape_combine_mask (win->window, gdk_imlib_move_mask (im), 0, 0);
return window; return win;
} }