diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 6f01a060d..3533f9ea5 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,25 @@ +Wed Mar 4 22:43:00 1998 Miguel de Icaza + + * gtools.c (query_dialog): Rewritten to use the MC dialog/widget code. + + * gutil.c (my_system), acconfig.h: By default gnome will not have + a subshell (at least for now) and will now exec everything + asyncronously by default. + + * gscreen.c: Exactly what was I thinking when I used the + g_panel_contents structure will remain a mistery for future + programming psycologists. It was a huge mistake. + + * gdesktop.c: Use the new icon/text display routine from + Federico. + +Tue Mar 3 21:03:52 1998 Miguel de Icaza + + * gmain.c (x_destroy_dlg): Call gtk_grab_remove when destroying + the dialog. + + * gmain.c (x_focus_widget): Handle special case of toplevels. + 1998-03-04 Federico Mena Quintero * gscreen.c: Some hackish changes to work around idempotence bugs diff --git a/gnome/directory-ok.xpm b/gnome/directory-ok.xpm new file mode 100644 index 000000000..6b23a7d06 --- /dev/null +++ b/gnome/directory-ok.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char * directory_xpm[] = { +"16 13 5 1", +" c None", +". c #000000000000", +"X c #FFFFFFFFFFFF", +"o c blue", +"O c #C71BC30B0000", +" ..... ", +".XXXXo. ", +".XoooOo.........", +".XooooOXXXXXXXo.", +".XooooooooooooO.", +".XooooooooooooO.", +".XooooooooooooO.", +".XooooooooooooO.", +".XooooooooooooO.", +".XooooooooooooO.", +".XooooooooooooO.", +".oOOOOOOOOOOOOO.", +"................"}; diff --git a/gnome/gdesktop.h b/gnome/gdesktop.h index 09e077898..3563f7463 100644 --- a/gnome/gdesktop.h +++ b/gnome/gdesktop.h @@ -1,2 +1,3 @@ #define MC_LIB_DESKTOP "mc.desktop" GtkWidget *create_transparent_text_window (char *file, char *text, int extra_events); +GtkWidget *make_transparent_window (char *file); diff --git a/gnome/gscreen.c b/gnome/gscreen.c index 093302649..cdf0f6ecc 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -28,6 +28,7 @@ #include "gscreen.h" #include "dir.h" #include "dialog.h" +#include "gdesktop.h" #include "directory.xpm" @@ -42,6 +43,8 @@ static char *drop_types [] = { "url:ALL" }; #define ELEMENTS(x) (sizeof (x) / sizeof (x[0])) +GtkWidget *drag_directory = NULL; +GtkWidget *drag_directory_ok = NULL; void repaint_file (WPanel *panel, int file_index, int move, int attr, int isstatus) @@ -692,15 +695,39 @@ fixed_gtk_widget_dnd_drag_set (GtkCList *clist, int drag_enable, gchar **type_ac gtk_widget_dnd_drag_set (GTK_WIDGET (clist), drag_enable, type_accept_list, numtypes); gdk_window_dnd_drag_set (clist->clist_window, drag_enable, type_accept_list, numtypes); } - + +static void +panel_drag_begin (GtkWidget *widget, GdkEvent *event, WPanel *panel) +{ + printf ("Drag starting\n"); + +} + static void panel_realized (GtkWidget *file_list, WPanel *panel) { + GdkPoint hotspot = { 5, 5 }; GtkObject *obj = GTK_OBJECT (file_list); + + if (!drag_directory) + drag_directory = make_transparent_window ("directory-ok.xpm"); + + if (!drag_directory_ok) + drag_directory_ok = make_transparent_window ("directory.xpm"); + + if (drag_directory && drag_directory_ok){ + gtk_widget_show (drag_directory_ok); + gtk_widget_show (drag_directory); + gdk_dnd_set_drag_shape (drag_directory->window, &hotspot, + drag_directory_ok->window, &hotspot); + } /* DND: Drag setup */ gtk_signal_connect (obj, "drag_request_event", GTK_SIGNAL_FUNC (panel_drag_request), panel); + gtk_signal_connect (obj, "drag_begin_event", + GTK_SIGNAL_FUNC (panel_drag_begin), panel); + fixed_gtk_widget_dnd_drag_set (GTK_CLIST (file_list), TRUE, drag_types, ELEMENTS (drag_types)); /* DND: Drop setup */ @@ -782,7 +809,7 @@ void x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) { GtkWidget *status_line, *filter_w, *statusbar, *vbox; - + panel->table = gtk_table_new (2, 1, 0); gtk_widget_show (panel->table); diff --git a/gnome/gtrans.c b/gnome/gtrans.c index 7c8ea9426..fe7ccaa1c 100644 --- a/gnome/gtrans.c +++ b/gnome/gtrans.c @@ -274,3 +274,37 @@ create_transparent_text_window (char *file, char *text, int extra_events) return window; } + +GtkWidget * +make_transparent_window (char *file) +{ + GdkImlibImage *im; + GtkWidget *window; + + if (!g_file_exists (file)) + return NULL; + + im = gdk_imlib_load_image (file); + if (!im) + return NULL; + + printf ("Lo cargo\n"); + gtk_widget_push_visual (gdk_imlib_get_visual ()); + gtk_widget_push_colormap (gdk_imlib_get_colormap ()); + + window = gtk_window_new (GTK_WINDOW_POPUP); + gtk_widget_pop_colormap (); + gtk_widget_pop_visual (); + + gtk_widget_realize (window); + gtk_widget_set_usize (window, im->rgb_width, im->rgb_height); + + /* All of the following 3 lines should not be required, only + * gdk_imlib_apply_image, but is is buggy. + */ + 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_shape_combine_mask (window->window, gdk_imlib_move_mask (im), 0, 0); + + return window; +}