mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Sync up so that Elliot can fix shaped-windows dnd -mig
This commit is contained in:
parent
158aeb9c72
commit
d80470500b
@ -1,3 +1,25 @@
|
|||||||
|
Wed Mar 4 22:43:00 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* 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 <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* 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 <federico@nuclecu.unam.mx>
|
1998-03-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gscreen.c: Some hackish changes to work around idempotence bugs
|
* gscreen.c: Some hackish changes to work around idempotence bugs
|
||||||
|
21
gnome/directory-ok.xpm
Normal file
21
gnome/directory-ok.xpm
Normal file
@ -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.",
|
||||||
|
"................"};
|
@ -1,2 +1,3 @@
|
|||||||
#define MC_LIB_DESKTOP "mc.desktop"
|
#define MC_LIB_DESKTOP "mc.desktop"
|
||||||
GtkWidget *create_transparent_text_window (char *file, char *text, int extra_events);
|
GtkWidget *create_transparent_text_window (char *file, char *text, int extra_events);
|
||||||
|
GtkWidget *make_transparent_window (char *file);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "gscreen.h"
|
#include "gscreen.h"
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
|
#include "gdesktop.h"
|
||||||
|
|
||||||
#include "directory.xpm"
|
#include "directory.xpm"
|
||||||
|
|
||||||
@ -42,6 +43,8 @@ static char *drop_types [] = { "url:ALL" };
|
|||||||
|
|
||||||
#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
|
#define ELEMENTS(x) (sizeof (x) / sizeof (x[0]))
|
||||||
|
|
||||||
|
GtkWidget *drag_directory = NULL;
|
||||||
|
GtkWidget *drag_directory_ok = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
repaint_file (WPanel *panel, int file_index, int move, int attr, int isstatus)
|
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);
|
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);
|
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
|
static void
|
||||||
panel_realized (GtkWidget *file_list, WPanel *panel)
|
panel_realized (GtkWidget *file_list, WPanel *panel)
|
||||||
{
|
{
|
||||||
|
GdkPoint hotspot = { 5, 5 };
|
||||||
GtkObject *obj = GTK_OBJECT (file_list);
|
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 */
|
/* DND: Drag setup */
|
||||||
gtk_signal_connect (obj, "drag_request_event",
|
gtk_signal_connect (obj, "drag_request_event",
|
||||||
GTK_SIGNAL_FUNC (panel_drag_request), panel);
|
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));
|
fixed_gtk_widget_dnd_drag_set (GTK_CLIST (file_list), TRUE, drag_types, ELEMENTS (drag_types));
|
||||||
|
|
||||||
/* DND: Drop setup */
|
/* DND: Drop setup */
|
||||||
@ -782,7 +809,7 @@ void
|
|||||||
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||||
{
|
{
|
||||||
GtkWidget *status_line, *filter_w, *statusbar, *vbox;
|
GtkWidget *status_line, *filter_w, *statusbar, *vbox;
|
||||||
|
|
||||||
panel->table = gtk_table_new (2, 1, 0);
|
panel->table = gtk_table_new (2, 1, 0);
|
||||||
gtk_widget_show (panel->table);
|
gtk_widget_show (panel->table);
|
||||||
|
|
||||||
|
@ -274,3 +274,37 @@ create_transparent_text_window (char *file, char *text, int extra_events)
|
|||||||
|
|
||||||
return window;
|
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;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user