Trim trailing white spaces on empty lines.
[geeqie.git] / src / lirc.c
index 2f15ec1..cbd09d4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Geeqie
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  */
 
@@ -16,7 +16,7 @@
 
 gint lirc_fd = -1;
 struct lirc_config *config = NULL;
-guint input_tag;
+guint input_tag = 0; /* event source id */
 GIOChannel *gio_chan;
 
 /*
@@ -53,7 +53,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
        gint ret;
        gint x = 0;
        gint y = 0;
-       
+
        /* LIRC code and corresponding geeqie command (and parameters)*/
        gchar *code;
        gchar *cmd;
@@ -71,7 +71,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 4;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                x -= i_parm;
                                }
@@ -80,7 +80,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 5;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                x += i_parm;
                                }
@@ -89,7 +89,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 2;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                y -= i_parm;
                                }
@@ -98,7 +98,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 4;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                y += i_parm;
                                }
@@ -115,7 +115,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 7;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                fl_parm = atoi(ptr) / 10.0;
-                               
+
                                if (fl_parm <= 0.01) fl_parm = get_zoom_increment();
                                layout_image_zoom_adjust(lw, fl_parm, FALSE);
                                }
@@ -124,7 +124,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 8;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                fl_parm = atoi(ptr) / 10.0;
-                               
+
                                if (fl_parm <= 0.01) fl_parm = get_zoom_increment();
                                layout_image_zoom_adjust(lw, -fl_parm, FALSE);
                                }
@@ -132,12 +132,16 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                {
                                layout_image_zoom_set(lw, 0.0, FALSE);
                                }
+                       else if (g_ascii_strcasecmp("FULL_SCREEN", cmd) == 0)
+                               {
+                               layout_image_full_screen_toggle(lw);
+                               }
                        else if (g_ascii_strncasecmp("SET_ZOOM", cmd, 8) == 0)
                                {
                                ptr = cmd + 8;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                layout_image_zoom_set(lw, 1.0, FALSE);
                                }
@@ -146,7 +150,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                ptr = cmd + 12;
                                while (g_ascii_isspace(*ptr)) ptr++;
                                i_parm = atoi(ptr);
-                               
+
                                if (i_parm <= 0) i_parm = 1;
                                layout_image_zoom_set(lw, -i_parm, FALSE);
                                }
@@ -164,11 +168,11 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
                                }
                        else if (g_ascii_strcasecmp("ROTATE_90", cmd) == 0)
                                {
-                               layout_image_alter(lw, ALTER_ROTATE_90);
+                               layout_image_alter_orientation(lw, ALTER_ROTATE_90);
                                }
                        else if (g_ascii_strcasecmp("ROTATE_90_CC", cmd) == 0)
                                {
-                               layout_image_alter(lw, ALTER_ROTATE_90_CC);
+                               layout_image_alter_orientation(lw, ALTER_ROTATE_90_CC);
                                }
                        else if (g_ascii_strcasecmp("INFO", cmd) == 0)
                                {
@@ -200,7 +204,7 @@ static gboolean lirc_input_callback(GIOChannel *source, GIOCondition condition,
 void layout_image_lirc_init(LayoutWindow *lw)
 {
        gint flags;
-       
+
        DEBUG_1("Initializing LIRC...");
        lirc_fd = lirc_init(GQ_APPNAME_LC, get_debug_level() > 0);
        if (lirc_fd == -1)