[gthumb: 5/57] esthetic changes



commit fc25b3f3308486de7ad5f50c9f7060ba3754dd05
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Jun 4 10:34:44 2010 +0200

    esthetic changes

 extensions/webalbums/albumtheme-private.c |   34 +++++-----
 extensions/webalbums/albumtheme-private.h |   92 ++++++++++------------------
 2 files changed, 50 insertions(+), 76 deletions(-)
---
diff --git a/extensions/webalbums/albumtheme-private.c b/extensions/webalbums/albumtheme-private.c
index 66a7f2f..743cae1 100644
--- a/extensions/webalbums/albumtheme-private.c
+++ b/extensions/webalbums/albumtheme-private.c
@@ -67,7 +67,7 @@ gth_mem_is_empty (GthMem *mem)
 
 
 void
-gth_mem_push (GthMem *mem, 
+gth_mem_push (GthMem *mem,
 	      int     val)
 {
 	mem->data[mem->top++] = val;
@@ -87,7 +87,7 @@ gth_mem_pop (GthMem *mem)
 
 
 int
-gth_mem_get_pos (GthMem *mem, 
+gth_mem_get_pos (GthMem *mem,
 		 int     pos)
 {
 	if ((pos <= 0) || (pos > mem->top))
@@ -192,7 +192,7 @@ gth_expr_unref (GthExpr *e)
 	if (e->ref == 0) {
 		int i;
 
-		for (i = 0; i < MAX_EXPR_SIZE; i++) 
+		for (i = 0; i < MAX_EXPR_SIZE; i++)
 			gth_cell_unref (e->data[i]);
 		g_free (e->data);
 		g_free (e);
@@ -200,7 +200,7 @@ gth_expr_unref (GthExpr *e)
 }
 
 
-void      
+void
 gth_expr_set_empty (GthExpr *e)
 {
 	e->top = 0;
@@ -338,13 +338,13 @@ void
 gth_expr_print (GthExpr *e)
 {
 	int i;
-	
+
 	for (i = 0; i < gth_expr_get_top (e); i++) {
 		GthCell *cell = gth_expr_get_pos (e, i + 1);
 
 		switch (cell->type) {
 		case GTH_CELL_TYPE_VAR:
-			printf ("VAR: %s (%d)\n", 
+			printf ("VAR: %s (%d)\n",
 				cell->value.var,
 				e->get_var_value_func (cell->value.var,
 						       e->get_var_value_data));
@@ -377,7 +377,7 @@ gth_expr_eval (GthExpr *e)
 
 		switch (cell->type) {
 		case GTH_CELL_TYPE_VAR:
-			gth_mem_push (mem, 
+			gth_mem_push (mem,
 				      e->get_var_value_func (cell->value.var,
 							     e->get_var_value_data));
 			break;
@@ -513,7 +513,7 @@ gth_var_new_constant (int value)
 
 
 GthVar *
-gth_var_new_expression (const char *name, 
+gth_var_new_expression (const char *name,
 			GthExpr    *e)
 {
 	GthVar *var;
@@ -531,7 +531,7 @@ gth_var_new_expression (const char *name,
 
 GthVar*
 gth_var_new_string (const char *name,
-		    const char *string)
+                   const char *string)
 {
 	GthVar *var;
 
@@ -599,7 +599,7 @@ gth_condition_add_document  (GthCondition *cond,
 
 
 GthTag *
-gth_tag_new (GthTagType  type, 
+gth_tag_new (GthTagType  type,
 	     GList      *arg_list)
 {
 	GthTag *tag;
@@ -621,12 +621,12 @@ gth_tag_new_html (const char *html)
 	tag->type = GTH_TAG_HTML;
 	tag->value.html = g_strdup (html);
 
-	return tag;	
+	return tag;
 }
 
 
 GthTag *
-gth_tag_new_condition (GList *cond_list) 
+gth_tag_new_condition (GList *cond_list)
 {
 	GthTag *tag;
 
@@ -634,7 +634,7 @@ gth_tag_new_condition (GList *cond_list)
 	tag->type = GTH_TAG_IF;
 	tag->value.cond_list = cond_list;
 
-	return tag;	
+	return tag;
 }
 
 
@@ -651,18 +651,18 @@ gth_tag_add_document (GthTag *tag,
 void
 gth_tag_free (GthTag *tag)
 {
-	if (tag->type == GTH_TAG_HTML) 
+	if (tag->type == GTH_TAG_HTML)
 		g_free (tag->value.html);
 
 	else if (tag->type == GTH_TAG_IF) {
-		g_list_foreach (tag->value.cond_list, 
+		g_list_foreach (tag->value.cond_list,
 				(GFunc) gth_condition_free,
 				NULL);
 		g_list_free (tag->value.cond_list);
 
 	} else {
-		g_list_foreach (tag->value.arg_list, 
-				(GFunc) gth_var_free, 
+		g_list_foreach (tag->value.arg_list,
+				(GFunc) gth_var_free,
 				NULL);
 		g_list_free (tag->value.arg_list);
 	}
diff --git a/extensions/webalbums/albumtheme-private.h b/extensions/webalbums/albumtheme-private.h
index 8dad66b..e5c1606 100644
--- a/extensions/webalbums/albumtheme-private.h
+++ b/extensions/webalbums/albumtheme-private.h
@@ -3,7 +3,7 @@
 /*
  *  GThumb
  *
- *  Copyright (C) 2003 Free Software Foundation, Inc.
+ *  Copyright (C) 2003, 2010 Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -35,23 +35,15 @@ typedef struct {
 } GthMem;
 
 GthMem*   gth_mem_new        (int     size);
-
 void      gth_mem_free       (GthMem *mem);
-
 void      gth_mem_set_empty  (GthMem *mem);
-
 gboolean  gth_mem_is_empty   (GthMem *mem);
-
-void      gth_mem_push       (GthMem *mem, 
+void      gth_mem_push       (GthMem *mem,
 			      int     val);
-
 int       gth_mem_pop        (GthMem *mem);
-
-int       gth_mem_get_pos    (GthMem *mem, 
+int       gth_mem_get_pos    (GthMem *mem,
 			      int     pos);
-
 int       gth_mem_get        (GthMem *mem);
-
 int       gth_mem_get_top    (GthMem *mem);
 
 /* GthCell */
@@ -90,9 +82,7 @@ typedef struct {
 } GthCell;
 
 GthCell*   gth_cell_new   (void);
-
 GthCell*   gth_cell_ref   (GthCell *cell);
-
 void       gth_cell_unref (GthCell *cell);
 
 /* GthExpr */
@@ -107,37 +97,28 @@ typedef struct {
 	gpointer             get_var_value_data;
 } GthExpr;
 
-GthExpr*  gth_expr_new               (void);
-
-GthExpr*  gth_expr_ref               (GthExpr *e);
-
-void      gth_expr_unref             (GthExpr *e);
-
-void      gth_expr_set_empty         (GthExpr *e);
-
-gboolean  gth_expr_is_empty          (GthExpr *e);
-
-void      gth_expr_push_expr         (GthExpr *e, GthExpr *e2);
-
-void      gth_expr_push_op           (GthExpr *e, GthOp op);
-
-void      gth_expr_push_var          (GthExpr *e, const char *name);
-
-void      gth_expr_push_constant     (GthExpr *e, int value);
-
-void      gth_expr_pop               (GthExpr *e);
-
-GthCell*  gth_expr_get_pos           (GthExpr *e, int pos);
-
-GthCell*  gth_expr_get               (GthExpr *e);
-
-int       gth_expr_get_top           (GthExpr *e);
-
-void      gth_expr_set_get_var_value_func (GthExpr *e,
-					   GthGetVarValueFunc f,
-					   gpointer data);
-
-int       gth_expr_eval              (GthExpr *e);
+GthExpr*  gth_expr_new                    (void);
+GthExpr*  gth_expr_ref                    (GthExpr            *e);
+void      gth_expr_unref                  (GthExpr            *e);
+void      gth_expr_set_empty              (GthExpr            *e);
+gboolean  gth_expr_is_empty               (GthExpr            *e);
+void      gth_expr_push_expr              (GthExpr            *e,
+					   GthExpr            *e2);
+void      gth_expr_push_op                (GthExpr            *e,
+					   GthOp               op);
+void      gth_expr_push_var               (GthExpr            *e,
+					   const char         *name);
+void      gth_expr_push_constant          (GthExpr            *e,
+					   int                 value);
+void      gth_expr_pop                    (GthExpr            *e);
+GthCell*  gth_expr_get_pos                (GthExpr            *e,
+					   int                 pos);
+GthCell*  gth_expr_get                    (GthExpr            *e);
+int       gth_expr_get_top                (GthExpr            *e);
+void      gth_expr_set_get_var_value_func (GthExpr            *e,
+					   GthGetVarValueFunc  f,
+					   gpointer            data);
+int       gth_expr_eval                   (GthExpr            *e);
 
 /* GthVar */
 
@@ -156,12 +137,11 @@ typedef struct {
 } GthVar;
 
 GthVar*  gth_var_new_constant   (int value);
-
-GthVar*  gth_var_new_expression (const char *name, GthExpr *e);
-
-GthVar*  gth_var_new_string     (const char *name, const char *string);
-
-void     gth_var_free           (GthVar *var);
+GthVar*  gth_var_new_expression (const char *name,
+				 GthExpr    *e);
+GthVar*  gth_var_new_string     (const char *name,
+				 const char *string);
+void     gth_var_free           (GthVar     *var);
 
 /* GthCondition */
 
@@ -171,9 +151,7 @@ typedef struct {
 } GthCondition;
 
 GthCondition * gth_condition_new           (GthExpr      *expr);
-
 void           gth_condition_free          (GthCondition *cond);
-
 void           gth_condition_add_document  (GthCondition *cond,
 					    GList        *document);
 
@@ -221,26 +199,22 @@ typedef enum {
 typedef struct {
 	GthTagType type;
 	union {
-		GList *arg_list;    /* GthVar list */ 
+		GList *arg_list;    /* GthVar list */
 		char  *html;        /* html */
 		GList *cond_list;   /* GthCondition list */
 	} value;
 	GList *document; /* GthTag list */
 } GthTag;
 
-GthTag * gth_tag_new                 (GthTagType    type, 
+GthTag * gth_tag_new                 (GthTagType    type,
 				      GList        *arg_list);
-
 GthTag * gth_tag_new_html            (const char   *html);
-
 GthTag * gth_tag_new_condition       (GList        *cond_list);
-
 void     gth_tag_add_document        (GthTag       *tag,
 				      GList        *document);
-
 void     gth_tag_free                (GthTag       *tag);
 
-/**/
+/* Utils */
 
 void     gth_parsed_doc_free         (GList *parsed_doc);
 



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