Code

Implement object-snapping for clones (see bug #1511260)
[inkscape.git] / src / dialogs / dialog-events.cpp
index 983024d105659d6184413054c79dfec116757e34..5f4c429fa694c398a4f960888804914eaadfe7a3 100644 (file)
@@ -4,9 +4,10 @@
  * \brief  Event handler for dialog windows
  *
  * Authors:
- *   bulia byak <bulia@dr.com>
+ *   bulia byak <bulia@dr.com>   
+ *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
  *
- * Copyright (C) 2003 authors
+ * Copyright (C) 2003-2007 Authors
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -31,7 +32,7 @@
 * \brief  This function is called to zero the transientize semaphore by a
 *         timeout.
 */
-bool
+gboolean
 sp_allow_again (gpointer *wd)
 {
     ((win_data *) wd)->stop = 0;
@@ -81,7 +82,7 @@ sp_dialog_defocus_on_enter (GtkWidget *w)
 
 
 
-bool
+gboolean
 sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data)
 {
 
@@ -91,7 +92,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data)
         return FALSE;
     }
 
-    bool ret = FALSE;
+    gboolean ret = FALSE;
 
     switch (event->type) {
 
@@ -145,12 +146,24 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data)
 void
 sp_transientize (GtkWidget *dialog)
 {
+#ifndef WIN32  // FIXME: Temporary Win32 special code to enable transient dialogs
+    // _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs
+    // are made transient (_set_transient_for), they are already removed from
+    // the taskbar in Win32.
     if (prefs_get_int_attribute ( "options.dialogsskiptaskbar", "value", 0)) {
         gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
-    }
+    }           
+#endif    
 
     gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2 );
 
+#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+    if (prefs_get_int_attribute ( "options.dialogsontopwin32", "value", 0))
+        transient_policy = 2;
+    else    
+        transient_policy = 0;
+#endif        
+
     if (transient_policy) {
    
     // if there's an active document window, attach dialog to it as a transient:
@@ -171,9 +184,14 @@ void
 sp_transientize_callback ( Inkscape::Application * /*inkscape*/, 
                            SPDesktop *desktop, win_data *wd )
 {
-    gint transient_policy = 
-        prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 
-                                          1, 0, 2);
+    gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2);
+
+#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+    if (prefs_get_int_attribute ( "options.dialogsontopwin32", "value", 0))
+        transient_policy = 2;
+    else    
+        return;
+#endif        
 
     if (!transient_policy) 
         return;
@@ -210,7 +228,7 @@ void on_dialog_unhide (GtkWidget *w)
         gtk_widget_show (w);
 }
 
-bool
+gboolean
 sp_dialog_hide (GtkObject *object, gpointer data)
 {
     GtkWidget *dlg = (GtkWidget *) data;
@@ -223,7 +241,7 @@ sp_dialog_hide (GtkObject *object, gpointer data)
 
 
 
-bool
+gboolean
 sp_dialog_unhide (GtkObject *object, gpointer data)
 {
     GtkWidget *dlg = (GtkWidget *) data;