]> Pileus Git - ~andy/gtk/commitdiff
quartz: fix coding style in quartz-version of gtk_drag_begin_internal
authorKristian Rietveld <kris@loopnest.org>
Sun, 20 Nov 2011 17:27:28 +0000 (18:27 +0100)
committerKristian Rietveld <kris@loopnest.org>
Sun, 20 Nov 2011 19:15:32 +0000 (20:15 +0100)
gtk/gtkdnd-quartz.c

index 96af88f0080116d55c5132571dae3d2e0fc38131..6b3d123b18e2cdbcca5888344fac3c3b2c52bec9 100644 (file)
@@ -1141,22 +1141,23 @@ gtk_drag_begin_internal (GtkWidget         *widget,
         }
       time = (double)gdk_event_get_time (event);
     }
+
   nstime = [[NSDate dateWithTimeIntervalSince1970: time / 1000] timeIntervalSinceReferenceDate];
   nsevent = [NSEvent mouseEventWithType: NSLeftMouseDown
-                     location: point
-                     modifierFlags: 0
-                     timestamp: nstime
-                     windowNumber: [nswindow windowNumber]
-                     context: [nswindow graphicsContext]
-                     eventNumber: 0
-                     clickCount: 1
-                     pressure: 0.0 ];
+                      location: point
+                      modifierFlags: 0
+                      timestamp: nstime
+                      windowNumber: [nswindow windowNumber]
+                      context: [nswindow graphicsContext]
+                      eventNumber: 0
+                      clickCount: 1
+                      pressure: 0.0 ];
 
   window = [(id<GdkNSView>)[nswindow contentView] gdkWindow];
-  g_return_val_if_fail(nsevent != NULL, NULL);
+  g_return_val_if_fail (nsevent != NULL, NULL);
 
   context = gdk_drag_begin (window, NULL);
-  g_return_val_if_failcontext != NULL, NULL);
+  g_return_val_if_fail (context != NULL, NULL);
 
   info = gtk_drag_get_source_info (context, TRUE);
   info->nsevent = nsevent;
@@ -1168,7 +1169,7 @@ gtk_drag_begin_internal (GtkWidget         *widget,
   gtk_target_list_ref (target_list);
 
   info->possible_actions = actions;
-  
+
   g_signal_emit_by_name (widget, "drag-begin", info->context);
 
   /* Ensure that we have an icon before we start the drag; the
@@ -1178,30 +1179,32 @@ gtk_drag_begin_internal (GtkWidget         *widget,
   if (!info->icon_pixbuf)
     {
       if (!site || site->icon_type == GTK_IMAGE_EMPTY)
-       gtk_drag_set_icon_default (context);
+        gtk_drag_set_icon_default (context);
       else
-       switch (site->icon_type)
-         {
-         case GTK_IMAGE_PIXBUF:
-           gtk_drag_set_icon_pixbuf (context,
-                                     site->icon_data.pixbuf.pixbuf,
-                                     -2, -2);
-           break;
-         case GTK_IMAGE_STOCK:
-           gtk_drag_set_icon_stock (context,
-                                    site->icon_data.stock.stock_id,
-                                    -2, -2);
-           break;
-         case GTK_IMAGE_ICON_NAME:
-           gtk_drag_set_icon_name (context,
-                                   site->icon_data.name.icon_name,
-                                   -2, -2);
-           break;
-         case GTK_IMAGE_EMPTY:
-         default:
-           g_assert_not_reached();
-           break;
-         }
+        {
+          switch (site->icon_type)
+            {
+              case GTK_IMAGE_PIXBUF:
+                  gtk_drag_set_icon_pixbuf (context,
+                                            site->icon_data.pixbuf.pixbuf,
+                                            -2, -2);
+                  break;
+              case GTK_IMAGE_STOCK:
+                  gtk_drag_set_icon_stock (context,
+                                           site->icon_data.stock.stock_id,
+                                           -2, -2);
+                  break;
+              case GTK_IMAGE_ICON_NAME:
+                  gtk_drag_set_icon_name (context,
+                                          site->icon_data.name.icon_name,
+                                          -2, -2);
+                  break;
+              case GTK_IMAGE_EMPTY:
+              default:
+                  g_assert_not_reached();
+                  break;
+            }
+        }
     }
 
   /* drag will begin in an idle handler to avoid nested run loops */