]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2006-02-25 13:36:33 by geronet]
authorgeronet <geronet@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 25 Feb 2006 13:36:33 +0000 (13:36 +0000)
committergeronet <geronet@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 25 Feb 2006 13:36:33 +0000 (13:36 +0000)
updated indent.sh, applied coding style

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@647 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

17 files changed:
drv_Cwlinux.c
drv_Noritake.c
drv_generic_i2c.h
drv_generic_parport.c
drv_generic_text.c
evaluator.c
indent.sh
lcd4linux_i2c.h
plugin_i2c_sensors.c
plugin_mysql.c
plugin_pop3.c
widget_icon.c
widget_image.c
widget_image.h
widget_keypad.h
widget_timer.c
widget_timer.h

index 49803b48e0475beeb35b764637da07ac92fb0584..c476fc63185dd7dc7e35c8e6f6358bff8f911257 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_Cwlinux.c,v 1.25 2006/02/06 06:29:30 reinelt Exp $
+/* $Id: drv_Cwlinux.c,v 1.26 2006/02/25 13:36:33 geronet Exp $
  *
  * new style driver for Cwlinux display modules
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: drv_Cwlinux.c,v $
+ * Revision 1.26  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.25  2006/02/06 06:29:30  reinelt
  * Image driver uses RGBA
  *
@@ -247,7 +250,7 @@ static int drv_CW_GPO(const int num, const int val)
     /* Fixme: GPO's not yet implemented! */
     error("%s: GPO's not yet implemented!", Name);
     /* Fixme: num*val to avoid compiler warning */
-    return num*val;
+    return num * val;
 }
 
 
@@ -422,7 +425,7 @@ int drv_CW_init(const char *section, const int quiet)
     WIDGET_CLASS wc;
     int ret;
 
-    info("%s: %s", Name, "$Revision: 1.25 $");
+    info("%s: %s", Name, "$Revision: 1.26 $");
 
     /* display preferences */
     XRES = 6;                  /* pixel width of one char  */
index 9aec59e492b1d23c394cd261499ee4e378e893ba..3bbc03b9b4597b3bf6389053e15b4d0eb4a7b9b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_Noritake.c,v 1.5 2006/01/30 06:25:53 reinelt Exp $
+/* $Id: drv_Noritake.c,v 1.6 2006/02/25 13:36:33 geronet Exp $
  * 
  * Driver for a Noritake GU128x32-311 graphical display.
  * 
@@ -22,6 +22,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: drv_Noritake.c,v $
+ * Revision 1.6  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.5  2006/01/30 06:25:53  reinelt
  * added CVS Revision
  *
@@ -124,8 +127,8 @@ static unsigned char SIGNAL_CS;     /* Chip select, OUTPUT, negative logic, pport AU
 static unsigned char SIGNAL_WR;        /* Write        OUTPUT, negative logic, pport STOBE */
 static unsigned char SIGNAL_RESET;     /* Reset,       OUTPUT, negative logic, pport INIT */
 static unsigned char SIGNAL_BLANK;     /* Blank,       OUTPUT , negative logic, pport SELECT-IN */
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* static unsigned char SIGNAL_BUSY; *//* Busy,        INPUT , positive logic, pport BUSY, not used */
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          /* static unsigned char SIGNAL_FRP; *//* Frame Pulse, INPUT , positive logic, pport ACK, not used */
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       /* static unsigned char SIGNAL_BUSY; *//* Busy,        INPUT , positive logic, pport BUSY, not used */
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* static unsigned char SIGNAL_FRP; *//* Frame Pulse, INPUT , positive logic, pport ACK, not used */
 void (*drv_Noritake_clear) (void);
 
 /* Data port is positive logic */
@@ -345,7 +348,7 @@ int drv_Noritake_init(const char *section, const int quiet)
     WIDGET_CLASS wc;
     int ret;
 
-    info("%s: %s", Name, "$Revision: 1.5 $");
+    info("%s: %s", Name, "$Revision: 1.6 $");
 
     /* start display */
     if ((ret = drv_Noritake_start(section)) != 0)
index 330410949795cf26e103febe4a8d25f6872e979b..2236267c90421f558a0816f5abb33277bc11a844 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_i2c.h,v 1.4 2005/05/31 21:32:00 lfcorreia Exp $\r
+/* $Id: drv_generic_i2c.h,v 1.5 2006/02/25 13:36:33 geronet Exp $\r
  *\r
  * generic driver helper for i2c displays\r
  *\r
@@ -23,6 +23,9 @@
  *\r
  *\r
  * $Log: drv_generic_i2c.h,v $
+ * Revision 1.5  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.4  2005/05/31 21:32:00  lfcorreia
  * fix my email address
  *\r
@@ -41,8 +44,8 @@
  * HD44780/I2C patch from Luis merged (still does not work for me)\r
  *\r
  *\r
- */\r
-\r
+ */  \r
+    \r
 /* \r
  *\r
  * exported fuctions:\r
  * void drv_generic_i2c_command(unsigned char command, unsigned char *data,unsigned char length)\r
  *   send command and the data to the i2c device\r
  * \r
- */\r
-\r
+ */ \r
+    \r
 #ifndef _DRV_GENERIC_I2C_H_\r
 #define _DRV_GENERIC_I2C_H_\r
-\r
-int drv_generic_i2c_open(const char *section, const char *driver);\r
-int drv_generic_i2c_close(void);\r
-unsigned char drv_generic_i2c_wire(const char *name, const char *deflt);\r
-void drv_generic_i2c_data(const unsigned char data);\r
-void drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length);\r
-\r
-#endif\r
+\rint drv_generic_i2c_open(const char *section, const char *driver);
+\rint drv_generic_i2c_close(void);
+\runsigned char drv_generic_i2c_wire(const char *name, const char *deflt);
+\rvoid drv_generic_i2c_data(const unsigned char data);
+\rvoid drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length);
+\r\r
+#endif /* \r */
index 697634b48d3b8d543ffb45ff3a5935c39b084185..c97fb108f1110f45b915e56f6ece63b1e63b7d53 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_parport.c,v 1.20 2005/12/12 05:52:03 reinelt Exp $
+/* $Id: drv_generic_parport.c,v 1.21 2006/02/25 13:36:33 geronet Exp $
  *
  * generic driver helper for serial and parport access
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: drv_generic_parport.c,v $
+ * Revision 1.21  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.20  2005/12/12 05:52:03  reinelt
  * type of delays is 'unsigned long'
  *
@@ -450,7 +453,9 @@ void drv_generic_parport_direction(const int direction)
 
 unsigned char drv_generic_parport_status(void)
 {
-    unsigned char mask = PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ACK | PARPORT_STATUS_BUSY;
+    unsigned char mask =
+       PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ACK |
+       PARPORT_STATUS_BUSY;
 
     unsigned char data;
 
@@ -592,6 +597,7 @@ void drv_generic_parport_debug(void)
 
     debug("%cSTROBE %cAUTOFD %cINIT %cSLCTIN",
          control & PARPORT_CONTROL_STROBE ? '-' : '+',
-         control & PARPORT_CONTROL_AUTOFD ? '-' : '+', control & PARPORT_CONTROL_INIT ? '+' : '-', control & PARPORT_CONTROL_SELECT ? '-' : '+');
+         control & PARPORT_CONTROL_AUTOFD ? '-' : '+', control & PARPORT_CONTROL_INIT ? '+' : '-',
+         control & PARPORT_CONTROL_SELECT ? '-' : '+');
 
 }
index 5296043f15f745891b434fe41a78b9c92abb8d3e..6816be07bf950b7d758d435d4890bb6cac6788b9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_text.c,v 1.31 2006/01/30 05:47:38 reinelt Exp $
+/* $Id: drv_generic_text.c,v 1.32 2006/02/25 13:36:33 geronet Exp $
  *
  * generic driver helper for text-based displays
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: drv_generic_text.c,v $
+ * Revision 1.32  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.31  2006/01/30 05:47:38  reinelt
  * graphic subsystem changed to full-color RGBA
  *
@@ -764,7 +767,7 @@ static void drv_generic_text_bar_create_segments(void)
                    break;
                /* hollow style, val(1,2) == 1, like '[' */
 /*                        if (l1 == 1 && l2 == 1 && Segment[i].style == STYLE_FIRST && BarFB[n].style == STYLE_HOLLOW)
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             break;
 *//* hollow style, val(1,2) == 1, like ']' */
 /*                        if (l1 == 1 && l2 == 1 && Segment[i].style == STYLE_LAST && BarFB[n].style == STYLE_HOLLOW)
                               break;
index d22bbfa2449c7470119203cd08b8312a40f48753..8b4dbc998db1d61d188b46f587d06046e692a14c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: evaluator.c,v 1.30 2006/01/30 12:53:08 reinelt Exp $
+/* $Id: evaluator.c,v 1.31 2006/02/25 13:36:33 geronet Exp $
  *
  * expression evaluation
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: evaluator.c,v $
+ * Revision 1.31  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.30  2006/01/30 12:53:08  reinelt
  * replaced strncpy with strcpy where possible
  *
@@ -380,7 +383,7 @@ RESULT *SetResult(RESULT ** result, const int type, const void *value)
            if ((*result)->string)
                free((*result)->string);
            /* allocate memory in multiples of CHUNK_SIZE */
-           (*result)->size = CHUNK_SIZE * ((len+1) / CHUNK_SIZE + 1);
+           (*result)->size = CHUNK_SIZE * ((len + 1) / CHUNK_SIZE + 1);
            (*result)->string = malloc((*result)->size);
        }
        strcpy((*result)->string, value);
index 9885e4964ab7a608e04b3247721c58654c63dee7..3cb0e1fb2afd91108da96ecf3a9107aeed91586a 100755 (executable)
--- a/indent.sh
+++ b/indent.sh
@@ -4,5 +4,12 @@
 # -l120  Set maximum line length for non-comment lines to 150.
 # -pmt   Preserve access and modification times on output files.
 
-indent -kr -l120 -pmt *.c *.h
+indent -kr -l120 *.c *.h
 
+for i in *.c *.h; do
+  if !(diff -q $i $i~); then
+    rm $i~
+  else
+    mv $i~ $i
+  fi
+done
index 59780443e6ad9f0762d38aaa38b68007ec9459d6..33505e02c6ec8baff568839b9b423568d6d43e34 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux_i2c.h,v 1.3 2005/07/06 04:40:18 reinelt Exp $
+/* $Id: lcd4linux_i2c.h,v 1.4 2006/02/25 13:36:33 geronet Exp $
  *
  * user space i2c sturctures and defines, taken from the official kernel i2c 
  * includes to solve the problem when compiling user space application
@@ -32,6 +32,9 @@
  *
  *
  * $Log: lcd4linux_i2c.h,v $
+ * Revision 1.4  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.3  2005/07/06 04:40:18  reinelt
  * GCC-4 fixes
  *
@@ -217,7 +220,8 @@ extern int i2c_check_addr(struct i2c_adapter *adapter, int addr);
  * It will only call found_proc if some client is connected at the
  * specific address (unless a 'force' matched);
  */
-extern int i2c_probe(struct i2c_adapter *adapter, struct i2c_client_address_data *address_data, int (*found_proc) (struct i2c_adapter *, int, int));
+extern int i2c_probe(struct i2c_adapter *adapter, struct i2c_client_address_data *address_data,
+                    int (*found_proc) (struct i2c_adapter *, int, int));
 
 /* An ioctl like call to set div. parameters of the adapter.
  */
index 718f1e4b954fd4dab42ce1eebce0add900b68a26..b3bbc2f9e00b73b72ccfebce427e2cd0c0afc81a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: plugin_i2c_sensors.c,v 1.24 2005/05/08 04:32:44 reinelt Exp $
+/* $Id: plugin_i2c_sensors.c,v 1.25 2006/02/25 13:36:33 geronet Exp $
  *
  * I2C sensors plugin
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: plugin_i2c_sensors.c,v $
+ * Revision 1.25  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.24  2005/05/08 04:32:44  reinelt
  * CodingStyle added and applied
  *
@@ -338,7 +341,8 @@ static void my_i2c_sensors_path(const char *method)
 
     while ((dir = readdir(fd1))) {
        /* Skip non-directories and '.' and '..' */
-       if ((dir->d_type != DT_DIR && dir->d_type != DT_LNK) || strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) {
+       if ((dir->d_type != DT_DIR && dir->d_type != DT_LNK) || strcmp(dir->d_name, ".") == 0
+           || strcmp(dir->d_name, "..") == 0) {
            continue;
        }
 
@@ -351,7 +355,8 @@ static void my_i2c_sensors_path(const char *method)
        done = 0;
        while ((file = readdir(fd2))) {
            /* FIXME : do all sensors have a temp_input1 ? */
-           if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1_input") || !strcmp(file->d_name, "temp1")) {
+           if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1_input")
+               || !strcmp(file->d_name, "temp1")) {
                path = realloc(path, strlen(dname) + 1);
                strcpy(path, dname);
                done = 1;
index 1ccdb0ed2af538e6abd548ab23ec83010b695284..f616a39c52c1ae1a7946f075aed85bbf4e98b0bf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: plugin_mysql.c,v 1.10 2006/01/20 15:58:05 reinelt Exp $
+/* $Id: plugin_mysql.c,v 1.11 2006/02/25 13:36:33 geronet Exp $
  *
  * plugin for execute SQL queries into a MySQL DBSM.
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: plugin_mysql.c,v $
+ * Revision 1.11  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.10  2006/01/20 15:58:05  reinelt
  * MySQL::count() added again
  *
@@ -170,7 +173,7 @@ static void my_MySQLcount(RESULT * result, RESULT * query)
     char *q;
     double value;
     MYSQL_RES *res;
-    
+
     if (configure_mysql() < 0) {
        value = -1;
        SetResult(&result, R_NUMBER, &value);
@@ -203,7 +206,7 @@ static void my_MySQLquery(RESULT * result, RESULT * query)
     char *q;
     double value;
     MYSQL_RES *res;
-    MYSQL_ROW row=NULL;
+    MYSQL_ROW row = NULL;
 
     if (configure_mysql() < 0) {
        value = -1;
index f1cb7997846473d330d35adea16230c25d30fb37..9461a5a490a788d6a64c96b68865d6450a081fd9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: plugin_pop3.c,v 1.9 2005/05/08 04:32:44 reinelt Exp $
+/* $Id: plugin_pop3.c,v 1.10 2006/02/25 13:36:33 geronet Exp $
  *
  * Plugin to check POP3 mail accounts
  *
@@ -27,6 +27,9 @@
  *
  *
  * $Log: plugin_pop3.c,v $
+ * Revision 1.10  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.9  2005/05/08 04:32:44  reinelt
  * CodingStyle added and applied
  *
@@ -305,12 +308,14 @@ static int getConfig(void)
                node->username = x;
                x = cfg_get(Section, password, "");
                if (*x == '\0') {
-                   info("[POP3] No '%s.%s' entry from %s, disabling POP3 account #%d", Section, password, cfg_source(), i);
+                   info("[POP3] No '%s.%s' entry from %s, disabling POP3 account #%d", Section, password, cfg_source(),
+                        i);
                    free(x);
                } else {
                    node->password = x;
                    if (cfg_number(Section, port, POP3PORT, 1, 65536, &node->port) < 1) {
-                       info("[POP3] No '%s.%s' entry from %s, %d will be used for account #%d", Section, port, cfg_source(), POP3PORT, i);
+                       info("[POP3] No '%s.%s' entry from %s, %d will be used for account #%d", Section, port,
+                            cfg_source(), POP3PORT, i);
                    }
                    check_node_add(&head, node);
                    n++;
index e677f560ab12bcf4cfd408ed772811317e1ec54f..38af3597a4a877385db2fe4766c32b3ff69c3d2b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_icon.c,v 1.22 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_icon.c,v 1.23 2006/02/25 13:36:33 geronet Exp $
  *
  * icon widget handling
  *
@@ -21,6 +21,9 @@
  *
  *
  * $Log: widget_icon.c,v $
+ * Revision 1.23  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.22  2006/01/23 06:17:18  reinelt
  * timer widget added
  *
@@ -208,17 +211,17 @@ void widget_icon_update(void *Self)
                Icon->visible = 0;
            DelResult(&result);
        }
-       
+
        /* rotate icon bitmap */
        Icon->curmap++;
        if (Icon->curmap >= Icon->maxmap)
            Icon->curmap = 0;
     }
-    
+
     /* finally, draw it! */
     if (W->class->draw)
        W->class->draw(W);
-    
+
     /* add a new one-shot timer */
     if (Icon->speed > 0) {
        timer_add(widget_icon_update, Self, Icon->speed, 1);
index 1cd17f6cf59894d087d0ad9042cb1d1661722743..e0dc3fde462c30bc1f6851d3ef9661be457801b5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_image.c,v 1.4 2006/02/19 07:20:54 reinelt Exp $
+/* $Id: widget_image.c,v 1.5 2006/02/25 13:36:33 geronet Exp $
  *
  * image widget handling
  *
@@ -21,6 +21,9 @@
  *
  *
  * $Log: widget_image.c,v $
+ * Revision 1.5  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.4  2006/02/19 07:20:54  reinelt
  * image support nearly finished
  *
@@ -87,16 +90,16 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
     if (Image->bitmap) {
        int i;
        for (i = 0; i < Image->height * Image->width; i++) {
-           RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+         RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
            Image->bitmap[i] = empty;
        }
     }
-    
+
     if (Image->file == NULL || Image->file[0] == '\0') {
        error("Warning: Image %s has no file", Name);
        return;
     }
-    
+
     fd = fopen(Image->file, "rb");
     if (fd == NULL) {
        error("Warning: Image %s: fopen(%s) failed: %s", Name, Image->file, strerror(errno));
@@ -132,23 +135,23 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
            return;
        }
        for (i = 0; i < Image->height * Image->width; i++) {
-           RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+         RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
            Image->bitmap[i] = empty;
        }
     }
 
     /* finally really render it */
-    for (x=0; x < gdImage->sx; x++) {
-       for (y=0; y < gdImage->sy; y++) {
-           int p = gdImageGetTrueColorPixel (gdImage, x, y);
+    for (x = 0; x < gdImage->sx; x++) {
+       for (y = 0; y < gdImage->sy; y++) {
+           int p = gdImageGetTrueColorPixel(gdImage, x, y);
            int a = gdTrueColorGetAlpha(p);
-           int i = y*Image->width+x;
-           Image->bitmap[i].R = gdTrueColorGetRed(p); 
-           Image->bitmap[i].G = gdTrueColorGetGreen (p);
+           int i = y * Image->width + x;
+           Image->bitmap[i].R = gdTrueColorGetRed(p);
+           Image->bitmap[i].G = gdTrueColorGetGreen(p);
            Image->bitmap[i].B = gdTrueColorGetBlue(p);
            /* GD's alpha is 0 (opaque) to 127 (tranparanet) */
            /* our alpha is 0 (transparent) to 255 (opaque) */
-           Image->bitmap[i].A = (a == 127) ? 0 : 255-2*a;
+           Image->bitmap[i].A = (a == 127) ? 0 : 255 - 2 * a;
        }
     }
 }
@@ -192,7 +195,6 @@ static void widget_image_update(void *Self)
                Image->visible = 0;
            DelResult(&result);
        }
-
 #ifdef WITH_GD
        /* render image into bitmap */
        widget_image_render(W->name, Image);
index c55b19085c9eee4d6bd7151e3e302bc8fc1f7f7a..06927dceda70ba0cefe0776572f2ded2b7ccc963 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_image.h,v 1.2 2006/02/08 04:55:05 reinelt Exp $
+/* $Id: widget_image.h,v 1.3 2006/02/25 13:36:33 geronet Exp $
  *
  * image widget handling
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: widget_image.h,v $
+ * Revision 1.3  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.2  2006/02/08 04:55:05  reinelt
  * moved widget registration to drv_generic_graphic
  *
 #include "rgb.h"
 
 typedef struct WIDGET_IMAGE {
-    RGBA *bitmap;               /* image bitmap */
-    int width, height;          /* size of the image */
+    RGBA *bitmap;              /* image bitmap */
+    int width, height;         /* size of the image */
     char *file_expr;           /* expression for image filename */
     void *file_tree;           /* pre-compiled expression for image filename */
-    char *file;                 /* evaluated filename */
+    char *file;                        /* evaluated filename */
     char *update_expr;         /* expression for update interval */
     void *update_tree;         /* pre-compiled expression for update interval */
     int update;                        /* update interval (msec) */
index e877aeabffc8d5da644656582b22092620aa6003..049cdc31da79907a043eb881e5088d0f27e72664 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_keypad.h,v 1.1 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: widget_keypad.h,v 1.2 2006/02/25 13:36:33 geronet Exp $
  *
  * keypad widget handling
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: widget_keypad.h,v $
+ * Revision 1.2  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.1  2006/02/21 05:50:34  reinelt
  * keypad support from Cris Maj
  *
@@ -34,7 +37,8 @@
 #define _WIDGET_KEYPAD_H_
 
 typedef enum { KEY_UP = 1, KEY_DOWN = 2, KEY_LEFT = 4, KEY_RIGHT = 8, KEY_CONFIRM = 16, KEY_CANCEL = 32, KEY_PRESSED =
-       64, KEY_RELEASED = 128 } KEYPADKEY;
+       64, KEY_RELEASED = 128
+} KEYPADKEY;
 
 typedef struct WIDGET_KEYPAD {
     char *expression;          /* expression that delivers the value */
index 6c9c832be06853d50ca82eda2e08dc8eefb5f681..0190acd4ff3c65d017b9e7e50f30a561cc93227a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_timer.c,v 1.1 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_timer.c,v 1.2 2006/02/25 13:36:33 geronet Exp $
  *
  * timer widget handling
  *
@@ -21,6 +21,9 @@
  *
  *
  * $Log: widget_timer.c,v $
+ * Revision 1.2  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.1  2006/01/23 06:17:18  reinelt
  * timer widget added
  *
@@ -69,7 +72,7 @@ void widget_timer_update(void *Self)
            Timer->update = 10;
        DelResult(&result);
     }
-    
+
     Timer->active = 1;
     if (Timer->active_tree != NULL) {
        Eval(Timer->active_tree, &result);
@@ -78,13 +81,13 @@ void widget_timer_update(void *Self)
            Timer->active = 0;
        DelResult(&result);
     }
-    
+
     /* finally, fire it! */
     if (Timer->active) {
        Eval(Timer->expr_tree, &result);
        DelResult(&result);
     }
-    
+
     /* add a new one-shot timer */
     timer_add(widget_timer_update, Self, Timer->update, 1);
 }
@@ -101,7 +104,7 @@ int widget_timer_init(WIDGET * Self)
     section = malloc(strlen(Self->name) + 8);
     strcpy(section, "Widget:");
     strcat(section, Self->name);
-    
+
     Timer = malloc(sizeof(WIDGET_TIMER));
     memset(Timer, 0, sizeof(WIDGET_TIMER));
 
@@ -109,7 +112,7 @@ int widget_timer_init(WIDGET * Self)
     Timer->expression = cfg_get_raw(section, "axpression", NULL);
     Timer->update_expr = cfg_get_raw(section, "update", "100");
     Timer->active_expr = cfg_get_raw(section, "active", "1");
-    
+
     /* sanity checks */
     if (Timer->expression == NULL || *Timer->expression == '\0') {
        error("Timer %s has no expression, using '1'", Self->name);
@@ -124,11 +127,11 @@ int widget_timer_init(WIDGET * Self)
     Compile(Timer->expression, &Timer->expr_tree);
     Compile(Timer->update_expr, &Timer->update_tree);
     Compile(Timer->active_expr, &Timer->active_tree);
-    
-    
+
+
     free(section);
     Self->data = Timer;
-    
+
     /* just do it! */
     widget_timer_update(Self);
 
index bf122d4e63b0c117e27a0e6a9df777d8a85a2e8d..2d789d7a7660414530cbd60d3462622188534f0f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_timer.h,v 1.1 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_timer.h,v 1.2 2006/02/25 13:36:33 geronet Exp $
  *
  * timer widget handling
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: widget_timer.h,v $
+ * Revision 1.2  2006/02/25 13:36:33  geronet
+ * updated indent.sh, applied coding style
+ *
  * Revision 1.1  2006/01/23 06:17:18  reinelt
  * timer widget added
  *
 #define _WIDGET_TIMER_H_
 
 typedef struct WIDGET_TIMER {
-    char *expression;           /* main timer expression */
-    void *expr_tree;            /* pre-compiled main expression */
+    char *expression;          /* main timer expression */
+    void *expr_tree;           /* pre-compiled main expression */
     char *update_expr;         /* expression for update interval */
     void *update_tree;         /* pre-compiled expression for update interval */
     int update;                        /* update interval (msec) */
     char *active_expr;         /* expression for active */
     void *active_tree;         /* pre-compiled expression for active */
-    int active;                /* timer active? */
+    int active;                        /* timer active? */
 } WIDGET_TIMER;
 
 extern WIDGET_CLASS Widget_Timer;