[rygel-gst-0-10-fullscreen-renderer] Use 2 spaces for indentation.



commit a404f68909417ac79921d1a3df26cc4cc43f1b59
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 25 10:33:24 2013 +0100

    Use 2 spaces for indentation.

 src/fullscreen-renderer.c |  170 ++++++++++++++++++++++----------------------
 1 files changed, 85 insertions(+), 85 deletions(-)
---
diff --git a/src/fullscreen-renderer.c b/src/fullscreen-renderer.c
index 7baa2cb..2dd6794 100644
--- a/src/fullscreen-renderer.c
+++ b/src/fullscreen-renderer.c
@@ -45,112 +45,112 @@
 #include "rygel-core.h"
 
 struct _MainData {
-    GtkWindow *window;
-    GtkWidget *video;
-    GstElement *playbin;
+  GtkWindow *window;
+  GtkWidget *video;
+  GstElement *playbin;
 };
 typedef struct _MainData MainData;
 
 static void on_realize (GtkWidget *widget, gpointer user_data)
 {
-    GdkWindow *window;
-    guintptr window_handle;
-    MainData *data = (MainData *) user_data;
+  GdkWindow *window;
+  guintptr window_handle;
+  MainData *data = (MainData *) user_data;
 
-    window = gtk_widget_get_window (widget);
-    if (!gdk_window_ensure_native (window))
-        g_error ("Could not create native window for overlay");
+  window = gtk_widget_get_window (widget);
+  if (!gdk_window_ensure_native (window))
+    g_error ("Could not create native window for overlay");
 
-    window_handle = GDK_WINDOW_XID (window);
-    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->playbin),
-                                         window_handle);
+  window_handle = GDK_WINDOW_XID (window);
+  gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->playbin),
+                     window_handle);
 }
 
 static gboolean on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
-    MainData *data = (MainData *) user_data;
-    GstState state;
+  MainData *data = (MainData *) user_data;
+  GstState state;
 
-    gst_element_get_state (data->playbin, &state, NULL, GST_CLOCK_TIME_NONE);
+  gst_element_get_state (data->playbin, &state, NULL, GST_CLOCK_TIME_NONE);
 
-    if (state < GST_STATE_PAUSED) {
-        gint width, height;
+  if (state < GST_STATE_PAUSED) {
+    gint width, height;
 
-        width = gtk_widget_get_allocated_width (widget);
-        height = gtk_widget_get_allocated_height (widget);
+    width = gtk_widget_get_allocated_width (widget);
+    height = gtk_widget_get_allocated_height (widget);
 
-        cairo_set_source_rgb (cr, 0, 0, 0);
-        cairo_rectangle (cr, 0, 0, width, height);
-        cairo_fill (cr);
-    }
+    cairo_set_source_rgb (cr, 0, 0, 0);
+    cairo_rectangle (cr, 0, 0, width, height);
+    cairo_fill (cr);
+  }
 }
 
 static gboolean on_key_released (GtkWidget *widget,
-                             GdkEvent *event,
-                             gpointer user_data)
+               GdkEvent *event,
+               gpointer user_data)
 {
-    GdkEventKey *key_event = (GdkEventKey *) event;
-
-    switch (key_event->keyval) {
-        case GDK_KEY_Escape:
-        case GDK_KEY_q:
-        case GDK_KEY_Q:
-            gtk_main_quit ();
-
-            return TRUE;
-        default:
-            return FALSE;
-    }
+  GdkEventKey *key_event = (GdkEventKey *) event;
+
+  switch (key_event->keyval) {
+    case GDK_KEY_Escape:
+    case GDK_KEY_q:
+    case GDK_KEY_Q:
+      gtk_main_quit ();
+
+      return TRUE;
+    default:
+      return FALSE;
+  }
 }
 
 int main (int argc, char *argv[])
 {
-    RygelPlaybinRenderer *renderer;
-    GError *error = NULL;
-    GMainLoop *loop;
-    MainData data;
-    GdkCursor *cursor;
-
-    gtk_init (&argc, &argv);
-    gst_init (&argc, &argv);
-
-    g_set_application_name ("Rygel-Fullscreen-Renderer");
-
-    renderer = rygel_playbin_renderer_new ("LibRygel renderer demo");
-    data.playbin = rygel_playbin_renderer_get_playbin (renderer);
-
-    data.window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
-    data.video = gtk_drawing_area_new ();
-    gtk_widget_set_double_buffered (data.video, FALSE);
-    gtk_container_add (GTK_CONTAINER (data.window), data.video);
-    g_signal_connect (data.video, "realize", G_CALLBACK (on_realize), &data);
-    gtk_widget_add_events (data.video,
-                           GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
-    gtk_widget_set_can_focus (data.video, TRUE);
-    gtk_widget_grab_focus (data.video);
-    g_signal_connect (data.video,
-                      "draw",
-                      G_CALLBACK (on_draw),
-                      &data);
-    g_signal_connect (data.video,
-                      "key-release-event",
-                      G_CALLBACK (on_key_released),
-                      &data);
-    gtk_window_fullscreen (data.window);
-    gtk_widget_show_all (GTK_WIDGET (data.window));
-    cursor = gdk_cursor_new_for_display (gtk_widget_get_display (data.video),
-                                         GDK_BLANK_CURSOR);
-    gdk_window_set_cursor (gtk_widget_get_window (data.video), cursor);
-
-    if (argc >= 2) {
-        rygel_media_device_add_interface (RYGEL_MEDIA_DEVICE (renderer), argv[1]);
-    } else {
-        rygel_media_device_add_interface (RYGEL_MEDIA_DEVICE (renderer), "eth0");
-    }
-
-    gtk_main ();
-    gtk_widget_hide (GTK_WIDGET (data.window));
-    g_object_unref (renderer);
-
-    return 0;
+  RygelPlaybinRenderer *renderer;
+  GError *error = NULL;
+  GMainLoop *loop;
+  MainData data;
+  GdkCursor *cursor;
+
+  gtk_init (&argc, &argv);
+  gst_init (&argc, &argv);
+
+  g_set_application_name ("Rygel-Fullscreen-Renderer");
+
+  renderer = rygel_playbin_renderer_new ("LibRygel renderer demo");
+  data.playbin = rygel_playbin_renderer_get_playbin (renderer);
+
+  data.window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
+  data.video = gtk_drawing_area_new ();
+  gtk_widget_set_double_buffered (data.video, FALSE);
+  gtk_container_add (GTK_CONTAINER (data.window), data.video);
+  g_signal_connect (data.video, "realize", G_CALLBACK (on_realize), &data);
+  gtk_widget_add_events (data.video,
+               GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
+  gtk_widget_set_can_focus (data.video, TRUE);
+  gtk_widget_grab_focus (data.video);
+  g_signal_connect (data.video,
+            "draw",
+            G_CALLBACK (on_draw),
+            &data);
+  g_signal_connect (data.video,
+            "key-release-event",
+            G_CALLBACK (on_key_released),
+            &data);
+  gtk_window_fullscreen (data.window);
+  gtk_widget_show_all (GTK_WIDGET (data.window));
+  cursor = gdk_cursor_new_for_display (gtk_widget_get_display (data.video),
+                     GDK_BLANK_CURSOR);
+  gdk_window_set_cursor (gtk_widget_get_window (data.video), cursor);
+
+  if (argc >= 2) {
+    rygel_media_device_add_interface (RYGEL_MEDIA_DEVICE (renderer), argv[1]);
+  } else {
+    rygel_media_device_add_interface (RYGEL_MEDIA_DEVICE (renderer), "eth0");
+  }
+
+  gtk_main ();
+  gtk_widget_hide (GTK_WIDGET (data.window));
+  g_object_unref (renderer);
+
+  return 0;
 }



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