[cheese] reindent cheese source code



commit 70e679bf1cb955efa8a9b69b351b99f375a4fea6
Author: daniel g. siegel <dgsiegel gnome org>
Date:   Sun Sep 13 18:39:44 2009 +0200

    reindent cheese source code

 src/cheese-prefs-dialog.c |    4 +-
 src/cheese-thumb-view.c   |   22 ++++++++--------
 src/cheese-window.c       |   59 +++++++++++++++++++++++++++++---------------
 src/cheese.c              |    6 ++--
 4 files changed, 55 insertions(+), 36 deletions(-)
---
diff --git a/src/cheese-prefs-dialog.c b/src/cheese-prefs-dialog.c
index a099abb..bea44a3 100644
--- a/src/cheese-prefs-dialog.c
+++ b/src/cheese-prefs-dialog.c
@@ -172,12 +172,12 @@ cheese_prefs_dialog_setup_widgets (CheesePrefsDialog *prefs_dialog)
   cheese_prefs_dialog_widgets_add (prefs_dialog->widgets, hue_widget);
 
   burst_repeat_widget = CHEESE_PREFS_WIDGET (cheese_prefs_burst_spinbox_new (prefs_dialog->burst_repeat,
-                                                                    "gconf_prop_burst_repeat"));
+                                                                             "gconf_prop_burst_repeat"));
 
   cheese_prefs_dialog_widgets_add (prefs_dialog->widgets, burst_repeat_widget);
 
   burst_delay_widget = CHEESE_PREFS_WIDGET (cheese_prefs_burst_spinbox_new (prefs_dialog->burst_delay,
-                                                                    "gconf_prop_burst_delay"));
+                                                                            "gconf_prop_burst_delay"));
 
   cheese_prefs_dialog_widgets_add (prefs_dialog->widgets, burst_delay_widget);
 
diff --git a/src/cheese-thumb-view.c b/src/cheese-thumb-view.c
index 11f8be0..18c1fb7 100644
--- a/src/cheese-thumb-view.c
+++ b/src/cheese-thumb-view.c
@@ -33,7 +33,7 @@
 
 #include "cheese-thumb-view.h"
 
-#define THUMB_VIEW_MINIMUM_WIDTH 140
+#define THUMB_VIEW_MINIMUM_WIDTH  140
 #define THUMB_VIEW_MINIMUM_HEIGHT 100
 
 #define CHEESE_THUMB_VIEW_GET_PRIVATE(o) \
@@ -538,8 +538,8 @@ cheese_thumb_view_fill (CheeseThumbView *thumb_view)
 static void
 cheese_thumb_view_finalize (GObject *object)
 {
-  CheeseThumbView *thumb_view = CHEESE_THUMB_VIEW (object);
-  CheeseThumbViewPrivate *priv = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
+  CheeseThumbView        *thumb_view = CHEESE_THUMB_VIEW (object);
+  CheeseThumbViewPrivate *priv       = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
 
   g_object_unref (priv->store);
   g_object_unref (priv->fileutil);
@@ -561,9 +561,9 @@ cheese_thumb_view_class_init (CheeseThumbViewClass *klass)
 }
 
 static void
-cheese_thumb_view_row_inserted_cb (GtkTreeModel *tree_model,
-                                   GtkTreePath  *path,
-                                   GtkTreeIter  *iter,
+cheese_thumb_view_row_inserted_cb (GtkTreeModel    *tree_model,
+                                   GtkTreePath     *path,
+                                   GtkTreeIter     *iter,
                                    CheeseThumbView *thumb_view)
 {
   CheeseThumbViewPrivate *priv = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
@@ -573,9 +573,9 @@ cheese_thumb_view_row_inserted_cb (GtkTreeModel *tree_model,
 }
 
 static void
-cheese_thumb_view_row_deleted_cb (GtkTreeModel *tree_model,
-                                   GtkTreePath  *path,
-                                   CheeseThumbView *thumb_view)
+cheese_thumb_view_row_deleted_cb (GtkTreeModel    *tree_model,
+                                  GtkTreePath     *path,
+                                  CheeseThumbView *thumb_view)
 {
   CheeseThumbViewPrivate *priv = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
 
@@ -593,11 +593,11 @@ cheese_thumb_view_init (CheeseThumbView *thumb_view)
 
   char *path_videos = NULL, *path_photos = NULL;
 
-  GFile    *file;
+  GFile *file;
 
   eog_thumbnail_init ();
 
-  priv->store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
+  priv->store   = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
   priv->n_items = 0;
 
   g_signal_connect (G_OBJECT (priv->store),
diff --git a/src/cheese-window.c b/src/cheese-window.c
index f753b02..f8e3b8e 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -334,16 +334,20 @@ cheese_window_toggle_wide_mode (GtkWidget *widget, CheeseWindow *cheese_window)
 
   /* set a single column in wide mode */
   gtk_icon_view_set_columns (GTK_ICON_VIEW (cheese_window->thumb_view), toggled ? 1 : G_MAXINT);
+
   /* switch thumb_nav mode */
   eog_thumb_nav_set_vertical (EOG_THUMB_NAV (cheese_window->thumb_nav), toggled);
 
   /* reparent thumb_view */
   g_object_ref (cheese_window->thumb_scrollwindow);
-  if (toggled) {
+  if (toggled)
+  {
     gtk_container_remove (GTK_CONTAINER (cheese_window->video_vbox), cheese_window->thumb_scrollwindow);
     gtk_container_add (GTK_CONTAINER (cheese_window->netbook_alignment), cheese_window->thumb_scrollwindow);
     g_object_unref (cheese_window->thumb_scrollwindow);
-  } else {
+  }
+  else
+  {
     gtk_container_remove (GTK_CONTAINER (cheese_window->netbook_alignment), cheese_window->thumb_scrollwindow);
     gtk_box_pack_end (GTK_BOX (cheese_window->video_vbox), cheese_window->thumb_scrollwindow, FALSE, FALSE, 0);
     g_object_unref (cheese_window->thumb_scrollwindow);
@@ -353,9 +357,11 @@ cheese_window_toggle_wide_mode (GtkWidget *widget, CheeseWindow *cheese_window)
   }
 
   /* update spacing */
+
   /* NOTE: be really carefull when changing the ui file to update spacing
    * values here too! */
-  if (toggled) {
+  if (toggled)
+  {
     g_object_set (G_OBJECT (cheese_window->toolbar_alignment),
                   "bottom-padding", 10, NULL);
     g_object_set (G_OBJECT (cheese_window->togglegroup_alignment),
@@ -364,7 +370,9 @@ cheese_window_toggle_wide_mode (GtkWidget *widget, CheeseWindow *cheese_window)
                   "right-padding", 0, NULL);
     g_object_set (G_OBJECT (cheese_window->netbook_alignment),
                   "left-padding", 6, NULL);
-  } else {
+  }
+  else
+  {
     g_object_set (G_OBJECT (cheese_window->toolbar_alignment),
                   "bottom-padding", 6, NULL);
     g_object_set (G_OBJECT (cheese_window->togglegroup_alignment),
@@ -462,7 +470,8 @@ static void
 cheese_window_photo_saved_cb (CheeseWebcam *webcam, CheeseWindow *cheese_window)
 {
   gdk_threads_enter ();
-  if (!cheese_window->is_bursting) {
+  if (!cheese_window->is_bursting)
+  {
     gtk_action_group_set_sensitive (cheese_window->actions_effects, TRUE);
     gtk_action_group_set_sensitive (cheese_window->actions_toggle, TRUE);
     gtk_widget_set_sensitive (cheese_window->take_picture, TRUE);
@@ -1353,10 +1362,10 @@ cheese_window_escape_key_cb (CheeseWindow *cheese_window,
     gtk_widget_set_sensitive (cheese_window->take_picture, TRUE);
     gtk_widget_set_sensitive (cheese_window->take_picture_fullscreen, TRUE);
   }
-  else  if (cheese_window->webcam_mode == WEBCAM_MODE_BURST)
+  else if (cheese_window->webcam_mode == WEBCAM_MODE_BURST)
   {
     cheese_window->repeat_count = 0;
-    cheese_window->is_bursting = FALSE;
+    cheese_window->is_bursting  = FALSE;
 
     gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->notebook_bar), 0);
     gtk_notebook_set_current_page (GTK_NOTEBOOK (cheese_window->fullscreen_bar), 0);
@@ -1380,8 +1389,10 @@ cheese_window_take_photo (gpointer data)
   gboolean      countdown;
   CheeseWindow *cheese_window = (CheeseWindow *) data;
 
-  // return if burst mode was cancelled
-  if (cheese_window->webcam_mode == WEBCAM_MODE_BURST && !cheese_window->is_bursting && cheese_window->repeat_count <= 0) {
+  /* return if burst mode was cancelled */
+  if (cheese_window->webcam_mode == WEBCAM_MODE_BURST &&
+      !cheese_window->is_bursting && cheese_window->repeat_count <= 0)
+  {
     return FALSE;
   }
 
@@ -1420,9 +1431,10 @@ cheese_window_take_photo (gpointer data)
   gtk_widget_set_sensitive (cheese_window->take_picture, FALSE);
   gtk_widget_set_sensitive (cheese_window->take_picture_fullscreen, FALSE);
 
-  if (cheese_window->webcam_mode == WEBCAM_MODE_BURST) {
-    guint repeat_delay = 1000;
-    gboolean countdown = FALSE;
+  if (cheese_window->webcam_mode == WEBCAM_MODE_BURST)
+  {
+    guint    repeat_delay = 1000;
+    gboolean countdown    = FALSE;
 
     g_object_get (cheese_window->gconf, "gconf_prop_burst_delay", &repeat_delay, NULL);
     g_object_get (cheese_window->gconf, "gconf_prop_countdown", &countdown, NULL);
@@ -1433,8 +1445,10 @@ cheese_window_take_photo (gpointer data)
        * Magic number chosen via expiriment on Netbook */
       repeat_delay = 5000;
     }
+
     /* start burst mode phot series */
-    if (!cheese_window->is_bursting) {
+    if (!cheese_window->is_bursting)
+    {
       g_timeout_add (repeat_delay, cheese_window_take_photo, cheese_window);
       cheese_window->is_bursting = TRUE;
     }
@@ -1454,10 +1468,13 @@ cheese_window_action_button_clicked_cb (GtkWidget *widget, CheeseWindow *cheese_
 {
   char *str;
 
-  switch (cheese_window->webcam_mode) {
+  switch (cheese_window->webcam_mode)
+  {
     case WEBCAM_MODE_BURST:
-      // ignore keybindings and other while bursting
-      if (cheese_window->is_bursting) {
+
+      /* ignore keybindings and other while bursting */
+      if (cheese_window->is_bursting)
+      {
         break;
       }
       gtk_action_group_set_sensitive (cheese_window->actions_effects, FALSE);
@@ -1476,7 +1493,8 @@ cheese_window_action_button_clicked_cb (GtkWidget *widget, CheeseWindow *cheese_
         gtk_label_set_text_with_mnemonic (GTK_LABEL (cheese_window->label_take_photo_fullscreen), str);
         g_free (str);
         gtk_label_set_use_markup (GTK_LABEL (cheese_window->label_take_photo), TRUE);
-        gtk_image_set_from_stock (GTK_IMAGE (cheese_window->image_take_photo), GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_BUTTON);
+        gtk_image_set_from_stock (GTK_IMAGE (
+                                    cheese_window->image_take_photo), GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_BUTTON);
         gtk_label_set_use_markup (GTK_LABEL (cheese_window->label_take_photo_fullscreen), TRUE);
         gtk_image_set_from_stock (GTK_IMAGE (cheese_window->image_take_photo_fullscreen),
                                   GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_BUTTON);
@@ -1708,7 +1726,7 @@ cheese_window_create_window (CheeseWindow *cheese_window)
   GError     *error = NULL;
   char       *path;
   GtkBuilder *builder;
-  GtkWidget *menubar;
+  GtkWidget  *menubar;
 
   cheese_window->info_bar = NULL;
 
@@ -2107,7 +2125,7 @@ void
 cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server, gboolean startup_in_wide_mode)
 {
   CheeseWindow *cheese_window;
-  gboolean startup_in_wide_mode_saved;
+  gboolean      startup_in_wide_mode_saved;
 
   cheese_window = g_new0 (CheeseWindow, 1);
 
@@ -2143,7 +2161,8 @@ cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server, gboolean startup
 
   startup_in_wide_mode = startup_in_wide_mode_saved ? TRUE : startup_in_wide_mode;
 
-  if (startup_in_wide_mode) {
+  if (startup_in_wide_mode)
+  {
     GtkAction *action = gtk_ui_manager_get_action (cheese_window->ui_manager, "/MainMenu/Cheese/WideMode");
     gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
   }
diff --git a/src/cheese.c b/src/cheese.c
index 6b7c105..db85aab 100644
--- a/src/cheese.c
+++ b/src/cheese.c
@@ -159,13 +159,13 @@ main (int argc, char **argv)
   GError         *error = NULL;
 
   GOptionEntry options[] = {
-    {"verbose",    'v', 0, G_OPTION_ARG_NONE, &CheeseOptions.verbose,
+    {"verbose",    'v', 0,                    G_OPTION_ARG_NONE,   &CheeseOptions.verbose,
      _("Be verbose"), NULL},
-    {"wide",       'w', 0, G_OPTION_ARG_NONE, &CheeseOptions.wide_mode,
+    {"wide",       'w', 0,                    G_OPTION_ARG_NONE,   &CheeseOptions.wide_mode,
      _("Enable wide mode"), NULL},
     {"hal-device", 'd', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &CheeseOptions.hal_device_id,
      NULL, NULL},
-    {"version", 0, 0, G_OPTION_ARG_NONE,   &CheeseOptions.version,
+    {"version",    0,   0,                    G_OPTION_ARG_NONE,   &CheeseOptions.version,
      _("output version information and exit"), NULL},
     {NULL}
   };



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