[cheese] reindent cheese source code



commit 28463b8274fd622e0f2ad2ec1c3e8a4d61edfa09
Author: daniel g. siegel <dgsiegel gnome org>
Date:   Tue Jul 28 00:56:26 2009 +0200

    reindent cheese source code
    
    the last patches did not match our style, now they do

 src/cheese-gconf.c     |    2 +-
 src/cheese-no-camera.c |   14 ++++----
 src/cheese-webcam.c    |   17 +++++----
 src/cheese-window.c    |   88 ++++++++++++++++++++++++-----------------------
 4 files changed, 63 insertions(+), 58 deletions(-)
---
diff --git a/src/cheese-gconf.c b/src/cheese-gconf.c
index 242320b..db8439a 100644
--- a/src/cheese-gconf.c
+++ b/src/cheese-gconf.c
@@ -447,7 +447,7 @@ cheese_gconf_class_init (CheeseGConfClass *klass)
                                    g_param_spec_int ("gconf_prop_burst_delay",
                                                      NULL,
                                                      NULL,
-                                                     200,  // based on some experiments
+                                                     200,  /* based on some experiments */
                                                      G_MAXINT,
                                                      1000,
                                                      G_PARAM_READWRITE));
diff --git a/src/cheese-no-camera.c b/src/cheese-no-camera.c
index 2ddb18f..e1a8e42 100644
--- a/src/cheese-no-camera.c
+++ b/src/cheese-no-camera.c
@@ -29,10 +29,10 @@
 #include "cheese-no-camera.h"
 
 static void
-cheese_no_camera_set_info_bar_text_and_icon (GtkInfoBar       *info_bar,
-                                                 const gchar      *icon_stock_id,
-                                                 const gchar      *primary_text,
-                                                 const gchar      *secondary_text)
+cheese_no_camera_set_info_bar_text_and_icon (GtkInfoBar  *info_bar,
+                                             const gchar *icon_stock_id,
+                                             const gchar *primary_text,
+                                             const gchar *secondary_text)
 {
   GtkWidget *content_area;
   GtkWidget *image;
@@ -89,9 +89,9 @@ cheese_no_camera_info_bar_new ()
   gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
                                  GTK_MESSAGE_ERROR);
   cheese_no_camera_set_info_bar_text_and_icon (GTK_INFO_BAR (info_bar),
-                                                   "gtk-dialog-error",
-                                                   _("No camera found!"),
-                                                   _("Please refer to the help for further information."));
+                                               "gtk-dialog-error",
+                                               _("No camera found!"),
+                                               _("Please refer to the help for further information."));
 
   return info_bar;
 }
diff --git a/src/cheese-webcam.c b/src/cheese-webcam.c
index 0b55092..4fc7d2f 100644
--- a/src/cheese-webcam.c
+++ b/src/cheese-webcam.c
@@ -154,10 +154,10 @@ cheese_webcam_error_quark (void)
 }
 
 static GstBusSyncReply
-cheese_webcam_bus_sync_handler (GstBus * bus, GstMessage * message, CheeseWebcam *webcam)
+cheese_webcam_bus_sync_handler (GstBus *bus, GstMessage *message, CheeseWebcam *webcam)
 {
   CheeseWebcamPrivate *priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);
-  GstXOverlay *overlay;
+  GstXOverlay         *overlay;
 
   if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
     return GST_BUS_PASS;
@@ -203,16 +203,19 @@ static gboolean
 cheese_webcam_expose_cb (GtkWidget *widget, GdkEventExpose *event, CheeseWebcam *webcam)
 {
   CheeseWebcamPrivate *priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);
-  GstState state;
-  GstXOverlay *overlay = GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (priv->pipeline),
-                                                                  GST_TYPE_X_OVERLAY));
+  GstState             state;
+  GstXOverlay         *overlay = GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (priv->pipeline),
+                                                                          GST_TYPE_X_OVERLAY));
 
   gst_element_get_state (priv->pipeline, &state, NULL, 0);
 
-  if ((state < GST_STATE_PLAYING) || (overlay == NULL)) {
+  if ((state < GST_STATE_PLAYING) || (overlay == NULL))
+  {
     gdk_draw_rectangle (widget->window, widget->style->black_gc, TRUE,
                         0, 0, widget->allocation.width, widget->allocation.height);
-  } else {
+  }
+  else
+  {
     gst_x_overlay_expose (overlay);
   }
 
diff --git a/src/cheese-window.c b/src/cheese-window.c
index 72c056c..a2e48db 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -1295,49 +1295,50 @@ cheese_window_escape_key_cb (CheeseWindow *cheese_window,
 static gboolean
 cheese_window_take_burst_photo (gpointer data)
 {
-    gboolean countdown;
-    CheeseWindow *cheese_window = (CheeseWindow *) data;
-    g_object_get (cheese_window->gconf, "gconf_prop_countdown", &countdown, NULL);
-    if (countdown)
+  gboolean      countdown;
+  CheeseWindow *cheese_window = (CheeseWindow *) data;
+
+  g_object_get (cheese_window->gconf, "gconf_prop_countdown", &countdown, NULL);
+  if (countdown)
+  {
+    if (cheese_window->isFullscreen)
     {
-      if (cheese_window->isFullscreen)
-      {
-        cheese_countdown_start ((CheeseCountdown *) cheese_window->countdown_fullscreen,
-                                cheese_window_countdown_picture_cb,
-                                cheese_window_countdown_hide_cb,
-                                (gpointer) cheese_window);
-        gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->fullscreen_bar), 1);
-
-        /* show bar, start timeout
-         * ATTENTION: if the countdown is longer than FULLSCREEN_TIMEOUT,
-         * the bar will disapear before the countdown ends
-         */
-        cheese_window_fullscreen_show_bar (cheese_window);
-        cheese_window_fullscreen_set_timeout (cheese_window);
-      }
-      else
-      {
-        cheese_countdown_start ((CheeseCountdown *) cheese_window->countdown,
-                                cheese_window_countdown_picture_cb,
-                                cheese_window_countdown_hide_cb,
-                                (gpointer) cheese_window);
-        gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook_bar), 1);
-      }
+      cheese_countdown_start ((CheeseCountdown *) cheese_window->countdown_fullscreen,
+                              cheese_window_countdown_picture_cb,
+                              cheese_window_countdown_hide_cb,
+                              (gpointer) cheese_window);
+      gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->fullscreen_bar), 1);
+
+      /* show bar, start timeout
+       * ATTENTION: if the countdown is longer than FULLSCREEN_TIMEOUT,
+       * the bar will disapear before the countdown ends
+       */
+      cheese_window_fullscreen_show_bar (cheese_window);
+      cheese_window_fullscreen_set_timeout (cheese_window);
     }
     else
     {
-      cheese_window_countdown_picture_cb (cheese_window);
+      cheese_countdown_start ((CheeseCountdown *) cheese_window->countdown,
+                              cheese_window_countdown_picture_cb,
+                              cheese_window_countdown_hide_cb,
+                              (gpointer) cheese_window);
+      gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook_bar), 1);
     }
+  }
+  else
+  {
+    cheese_window_countdown_picture_cb (cheese_window);
+  }
 
-    gtk_widget_set_sensitive (cheese_window->take_picture, FALSE);
-    gtk_widget_set_sensitive (cheese_window->take_picture_fullscreen, FALSE);
+  gtk_widget_set_sensitive (cheese_window->take_picture, FALSE);
+  gtk_widget_set_sensitive (cheese_window->take_picture_fullscreen, FALSE);
 
-    cheese_window->repeat_count--;
-    if (cheese_window->repeat_count <= 0)
-    {
-      return FALSE;
-    }
-    return TRUE;
+  cheese_window->repeat_count--;
+  if (cheese_window->repeat_count <= 0)
+  {
+    return FALSE;
+  }
+  return TRUE;
 }
 
 static void
@@ -1348,13 +1349,13 @@ cheese_window_action_button_clicked_cb (GtkWidget *widget, CheeseWindow *cheese_
   if (cheese_window->webcam_mode == WEBCAM_MODE_PHOTO)
   {
     cheese_window->repeat_count = 1;
-    cheese_window_take_burst_photo(cheese_window);
+    cheese_window_take_burst_photo (cheese_window);
 
     /* FIXME: set menu inactive */
   }
   else if (cheese_window->webcam_mode == WEBCAM_MODE_BURST)
   {
-    guint repeat_delay = 1000;
+    guint    repeat_delay = 1000;
     gboolean countdown;
 
     g_object_get (cheese_window->gconf, "gconf_prop_burst_delay", &repeat_delay, NULL);
@@ -1363,13 +1364,12 @@ cheese_window_action_button_clicked_cb (GtkWidget *widget, CheeseWindow *cheese_
 
     if (countdown && repeat_delay < 5000)
     {
-      // A countdown takes 4 seconds, leave some headroom before repeating it.
-      // Magic number chosen via expiriment on Netbook
+      /* A countdown takes 4 seconds, leave some headroom before repeating it.
+       * Magic number chosen via expiriment on Netbook */
       repeat_delay = 5000;
     }
 
     g_timeout_add (repeat_delay, &cheese_window_take_burst_photo, cheese_window);
-
   }
   else if (cheese_window->webcam_mode == WEBCAM_MODE_VIDEO)
   {
@@ -1583,7 +1583,7 @@ cheese_window_radio_action_group_new (CheeseWindow *cheese_window, char *name,
 
 static void
 cheese_window_set_info_bar (CheeseWindow *cheese_window,
-                                GtkWidget    *info_bar)
+                            GtkWidget    *info_bar)
 {
   if (cheese_window->info_bar == info_bar)
     return;
@@ -1742,9 +1742,11 @@ cheese_window_create_window (CheeseWindow *cheese_window)
 
   gtk_widget_realize (cheese_window->screen);
   GdkWindow *win = gtk_widget_get_window (cheese_window->screen);
-  if (!gdk_window_ensure_native (win)) {
+  if (!gdk_window_ensure_native (win))
+  {
     /* FIXME: this breaks offscreen stuff, we should really find
      * another way to embed video that doesn't require an XID */
+
     /* abort: no native window, no xoverlay, no cheese. */
     g_error ("Could not create a native X11 window for the drawing area");
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]