diff options
-rw-r--r-- | gdk/gdk.c | 4 | ||||
-rw-r--r-- | gdk/gdktypes.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 4 | ||||
-rw-r--r-- | gtk/gtkhandlebox.c | 85 | ||||
-rw-r--r-- | gtk/gtkhandlebox.h | 4 | ||||
-rwxr-xr-x | ltconfig | 5 |
6 files changed, 82 insertions, 22 deletions
@@ -1755,6 +1755,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; + event->button.x_root = xevent->xbutton.x_root; + event->button.y_root = xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1826,6 +1828,8 @@ gdk_event_translate (GdkEvent *event, event->motion.time = xevent->xmotion.time; event->motion.x = xevent->xmotion.x; event->motion.y = xevent->xmotion.y; + event->motion.x_root = xevent->xmotion.x_root; + event->motion.y_root = xevent->xmotion.y_root; event->motion.pressure = 0.5; event->motion.xtilt = 0; event->motion.ytilt = 0; diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index be2a60dedd..aa0cbebf84 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -807,6 +807,7 @@ struct _GdkEventMotion gint16 is_hint; GdkInputSource source; guint32 deviceid; + gdouble x_root, y_root; }; struct _GdkEventButton @@ -823,6 +824,7 @@ struct _GdkEventButton guint button; GdkInputSource source; guint32 deviceid; + gdouble x_root, y_root; }; struct _GdkEventKey diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index d8b41cb71b..a01fe4b043 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -1755,6 +1755,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; + event->button.x_root = xevent->xbutton.x_root; + event->button.y_root = xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1826,6 +1828,8 @@ gdk_event_translate (GdkEvent *event, event->motion.time = xevent->xmotion.time; event->motion.x = xevent->xmotion.x; event->motion.y = xevent->xmotion.y; + event->motion.x_root = xevent->xmotion.x_root; + event->motion.y_root = xevent->xmotion.y_root; event->motion.pressure = 0.5; event->motion.xtilt = 0; event->motion.ytilt = 0; diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index e612e79e78..91861d0b9d 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -19,23 +19,27 @@ #include "gtkhandlebox.h" -static void gtk_handle_box_class_init (GtkHandleBoxClass *klass); -static void gtk_handle_box_init (GtkHandleBox *event_box); -static void gtk_handle_box_realize (GtkWidget *widget); -static void gtk_handle_box_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_handle_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_handle_box_draw (GtkWidget *widget, - GdkRectangle *area); -static gint gtk_handle_box_expose (GtkWidget *widget, - GdkEventExpose *event); +static void gtk_handle_box_class_init (GtkHandleBoxClass *klass); +static void gtk_handle_box_init (GtkHandleBox *handle_box); +static void gtk_handle_box_realize (GtkWidget *widget); +static void gtk_handle_box_size_request (GtkWidget *widget, + GtkRequisition *requisition); +static void gtk_handle_box_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); +static void gtk_handle_box_draw (GtkWidget *widget, + GdkRectangle *area); +static gint gtk_handle_box_expose (GtkWidget *widget, + GdkEventExpose *event); +static gint gtk_handle_box_button_changed(GtkWidget *widget, + GdkEventButton *event); +static gint gtk_handle_box_motion (GtkWidget *widget, + GdkEventMotion *event); guint gtk_handle_box_get_type () { - static guint event_box_type = 0; + static guint handle_box_type = 0; if (!event_box_type) { @@ -49,10 +53,10 @@ gtk_handle_box_get_type () (GtkArgFunc) NULL, }; - event_box_type = gtk_type_unique (gtk_event_box_get_type (), &handle_box_info); + handle_box_type = gtk_type_unique (gtk_event_box_get_type (), &handle_box_info); } - return event_box_type; + return handle_box_type; } static void @@ -67,15 +71,18 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class) widget_class->size_allocate = gtk_handle_box_size_allocate; widget_class->draw = gtk_handle_box_draw; widget_class->expose_event = gtk_handle_box_expose; + widget_class->button_press_event = gtk_handle_box_button_change; + widget_class->button_release_event = gtk_handle_box_button_change; + widget_class->motion_notify_event = gtk_handle_box_motion; } static void -gtk_handle_box_init (GtkHandleBox *event_box) +gtk_handle_box_init (GtkHandleBox *handle_box) { - GTK_WIDGET_UNSET_FLAGS (event_box, GTK_NO_WINDOW); - GTK_WIDGET_SET_FLAGS (event_box, GTK_BASIC); - event_box->show_handle = TRUE; - event_box->real_parent = NULL; + GTK_WIDGET_UNSET_FLAGS (handle_box, GTK_NO_WINDOW); + GTK_WIDGET_SET_FLAGS (handle_box, GTK_BASIC); + handle_box->is_being_dragged = FALSE; + handle_box->real_parent = NULL; } GtkWidget* @@ -226,3 +233,43 @@ gtk_handle_box_expose (GtkWidget *widget, return FALSE; } +static gint gtk_handle_box_button_changed(GtkWidget *widget, + GdkEventButton *event) +{ + GtkHandleBox *hb; + g_return_val_if_fail(widget != NULL, FALSE); + g_return_val_if_fail(GTK_IS_HANDLE_BOX(widget), FALSE); + g_return_val_if_fail(event != NULL, FALSE); + + hb = GTK_HANDLE_BOX(widget); + + if(event->button == 0) + { + if(event->type == GDK_BUTTON_PRESS) + { + hb->is_being_dragged = TRUE; + real_parent = widget->parent; + gdk_window_set_override_redirect(hb->window, TRUE); + gdk_window_reparent(hb->window, GDK_ROOT_PARENT(), + event->x, event->y); + } + else if(event->type == GDK_BUTTON_RELEASE) + { + hb->is_being_dragged = FALSE; + } + } +} + +static gint gtk_handle_box_motion (GtkWidget *widget, + GdkEventMotion *event) +{ + GtkHandleBox *hb; + g_return_val_if_fail(widget != NULL, FALSE); + g_return_val_if_fail(GTK_IS_HANDLE_BOX(widget), FALSE); + g_return_val_if_fail(event != NULL, FALSE); + + hb = GTK_HANDLE_BOX(widget); + if(hb->is_being_dragged) { + + } +} diff --git a/gtk/gtkhandlebox.h b/gtk/gtkhandlebox.h index ad57d46446..7e69bb642c 100644 --- a/gtk/gtkhandlebox.h +++ b/gtk/gtkhandlebox.h @@ -15,6 +15,7 @@ * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* The GtkHandleBox is to allow #ifndef __GTK_HANDLE_BOX_H__ #define __GTK_HANDLE_BOX_H__ @@ -38,8 +39,9 @@ typedef struct _GtkHandleBoxClass GtkHandleBoxClass; struct _GtkHandleBox { - GtkEventBox bin; + GtkEventBox event_box; GtkWidget *real_parent; + gboolean is_being_dragged; }; struct _GtkHandleBoxClass @@ -776,7 +776,8 @@ else hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;echo DATA >> $objdir/$libname.def;echo " SINGLE NONSHARED" >> $objdir/$libname.def;echo EXPORTS >> $objdir/$libname.def;emxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def' + archive_cmds='echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;echo DATA >> $objdir/$libname.def;echo " SINGLE NONSHARED" >> $objdir/$libname.def;echo EXPORTS >> $objdir/$libname.def;e +mxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; @@ -1351,7 +1352,7 @@ hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec" +#hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec" # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator="$hardcode_libdir_separator" |