Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests/progressbar


Modified Files:
        ewl_progressbar_test.c 


Log Message:
- tabs are a tricky beast. looks like I missed some.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/progressbar/ewl_progressbar_test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_progressbar_test.c      6 May 2008 20:18:56 -0000       1.2
+++ ewl_progressbar_test.c      7 May 2008 13:38:19 -0000       1.3
@@ -11,7 +11,7 @@
 static void cb_rerun_progressbars(Ewl_Widget *w, void *ev, void *data);
 static void cb_set_new_range(Ewl_Widget *w, void *ev, void *data);
 static void cb_destroy_progressbar_test(Ewl_Widget *w, void *ev,
-                                                       void *data);
+                                                        void *data);
 static int cb_increment_progress(void *data);
 
 static Ecore_Timer *progress_timer[3];
@@ -37,13 +37,13 @@
         ewl_container_child_append(EWL_CONTAINER(box), progressbar_vbox);
         ewl_box_spacing_set(EWL_BOX(progressbar_vbox), 0);
         ewl_callback_prepend(EWL_WIDGET(progressbar_vbox), 
EWL_CALLBACK_DESTROY,
-                                       cb_destroy_progressbar_test, NULL);
+                                        cb_destroy_progressbar_test, NULL);
         ewl_widget_show(progressbar_vbox);
 
 
         progressbar_box = ewl_hbox_new();
         ewl_container_child_append(EWL_CONTAINER(progressbar_vbox),
-                                                       progressbar_box);
+                                                        progressbar_box);
         ewl_box_spacing_set(EWL_BOX(progressbar_box), 0);
         ewl_widget_show(progressbar_box);
 
@@ -51,17 +51,17 @@
          * First and second progressbar
          */
         for (i = 0; i < 2; i++) {
-               progressbar[i] = ewl_progressbar_new();
-               if (i == 0)
-                       ewl_range_invert_set(EWL_RANGE(progressbar[0]), TRUE);
-               ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
-               ewl_widget_show(progressbar[i]);
+                progressbar[i] = ewl_progressbar_new();
+                if (i == 0)
+                        ewl_range_invert_set(EWL_RANGE(progressbar[0]), TRUE);
+                ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
+                ewl_widget_show(progressbar[i]);
 
-               progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
-                               (Ewl_Progressbar *) progressbar[i]);
+                progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
+                                (Ewl_Progressbar *) progressbar[i]);
 
-               ewl_container_child_append(EWL_CONTAINER(progressbar_box),
-                                                       progressbar[i]);
+                ewl_container_child_append(EWL_CONTAINER(progressbar_box),
+                                                        progressbar[i]);
         }
 
         /*
@@ -72,7 +72,7 @@
         ewl_widget_show(progressbar[2]);
 
         progress_timer[2] = ecore_timer_add(0.1, cb_increment_progress,
-                       (Ewl_Progressbar *) progressbar[2]);
+                        (Ewl_Progressbar *) progressbar[2]);
 
         ewl_container_child_append(EWL_CONTAINER(progressbar_vbox), 
progressbar[2]);
 
@@ -89,7 +89,7 @@
          */
         progressbar_box = ewl_hbox_new();
         ewl_container_child_append(EWL_CONTAINER(progressbar_vbox),
-                                               progressbar_box);
+                                                progressbar_box);
         ewl_box_spacing_set(EWL_BOX(progressbar_box), 0);
         ewl_widget_show(progressbar_box);
 
@@ -97,7 +97,7 @@
         ewl_button_label_set(EWL_BUTTON(button), "Rerun");
         ewl_container_child_append(EWL_CONTAINER(progressbar_box), button);
         ewl_callback_prepend(button, EWL_CALLBACK_CLICKED,
-                       cb_rerun_progressbars, NULL);
+                        cb_rerun_progressbars, NULL);
 
         ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
         ewl_widget_show (button);
@@ -106,7 +106,7 @@
         ewl_button_label_set(EWL_BUTTON(button), "Set a random range from 
0-500");
         ewl_container_child_append(EWL_CONTAINER(progressbar_box), button);
         ewl_callback_prepend(button, EWL_CALLBACK_CLICKED,
-                       cb_set_new_range, NULL);
+                        cb_set_new_range, NULL);
         ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
         ewl_widget_show (button);
 
@@ -125,57 +125,57 @@
         val = ewl_range_value_get(r);
 
         if (val >= r->max_val) {
-               for (i = 0; i < 3; i++) {
-                       if (progress_timer[i]) {
-                               ecore_timer_del(progress_timer[i]);
-                               progress_timer[i] = NULL;
-                       }
-               }
-               return 0;
+                for (i = 0; i < 3; i++) {
+                        if (progress_timer[i]) {
+                                ecore_timer_del(progress_timer[i]);
+                                progress_timer[i] = NULL;
+                        }
+                }
+                return 0;
         }
 
         val += 1;
         ewl_range_value_set(r, val);
 
         if (val >= 20 && val < 35 ) {
-               ewl_progressbar_custom_label_set(EWL_PROGRESSBAR(r),
-                               "%.0lf / %.0lf kbytes");
+                ewl_progressbar_custom_label_set(EWL_PROGRESSBAR(r),
+                                "%.0lf / %.0lf kbytes");
         }
 
         if (val >= 35 && val < 60) {
-               value = ewl_range_value_get(r);
-               range = ewl_range_maximum_value_get(r);
+                value = ewl_range_value_get(r);
+                range = ewl_range_maximum_value_get(r);
 
-               snprintf(c, sizeof (c), "%.0lf of %.0lf beers", value, range);
-               ewl_progressbar_label_set(EWL_PROGRESSBAR(r), c);
+                snprintf(c, sizeof (c), "%.0lf of %.0lf beers", value, range);
+                ewl_progressbar_label_set(EWL_PROGRESSBAR(r), c);
         }
 
         if (val == 60)
-               ewl_progressbar_label_hide(EWL_PROGRESSBAR(r));
+                ewl_progressbar_label_hide(EWL_PROGRESSBAR(r));
 
         if (val == 70)
-               ewl_progressbar_label_show(EWL_PROGRESSBAR(r));
+                ewl_progressbar_label_show(EWL_PROGRESSBAR(r));
 
         return 1;
 }
 
 static void
 cb_destroy_progressbar_test(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                               void *data __UNUSED__)
+                                                void *data __UNUSED__)
 {
         int i;
 
         for (i = 0; i < 3; i++) {
-               if (progress_timer[i]) {
-                       ecore_timer_del(progress_timer[i]);
-                       progress_timer[i] = NULL;
-               }
+                if (progress_timer[i]) {
+                        ecore_timer_del(progress_timer[i]);
+                        progress_timer[i] = NULL;
+                }
         }
 }
 
 static void
 cb_set_new_range(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                               void *data __UNUSED__)
+                                                void *data __UNUSED__)
 {
         int i, j;
 
@@ -183,36 +183,36 @@
         printf ("New random value: %d\n", j);
 
         for (i = 0; i < 3; i++) {
-               ewl_range_maximum_value_set(EWL_RANGE(progressbar[i]), j);
+                ewl_range_maximum_value_set(EWL_RANGE(progressbar[i]), j);
 
-               if (ewl_range_value_get(EWL_RANGE(progressbar[i])) >= j)
-                       cb_rerun_progressbars(EWL_WIDGET (progressbar[i]),
-                                                               NULL, NULL);
+                if (ewl_range_value_get(EWL_RANGE(progressbar[i])) >= j)
+                        cb_rerun_progressbars(EWL_WIDGET (progressbar[i]),
+                                                                NULL, NULL);
         }
 }
 
 static void
 cb_rerun_progressbars (Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                               void *data __UNUSED__)
+                                                void *data __UNUSED__)
 {
         int i;
 
         for (i = 0; i < 3; i++) {
-               /*
-                * Make sure to autolabel the bar on start again,
-                * if we stop a place where it labels manually.
-                * (since the auto label is turned off when you label manually)
-                */
-               ewl_progressbar_label_show (EWL_PROGRESSBAR (progressbar[i]));
-               ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
-
-               if (progress_timer[i]) {
-                       ecore_timer_del(progress_timer[i]);
-                       progress_timer[i] = NULL;
-               }
+                /*
+                 * Make sure to autolabel the bar on start again,
+                 * if we stop a place where it labels manually.
+                 * (since the auto label is turned off when you label manually)
+                 */
+                ewl_progressbar_label_show (EWL_PROGRESSBAR (progressbar[i]));
+                ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
+
+                if (progress_timer[i]) {
+                        ecore_timer_del(progress_timer[i]);
+                        progress_timer[i] = NULL;
+                }
 
-               progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
-                                                               progressbar[i]);
+                progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
+                                                                
progressbar[i]);
         }
 }
 



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to