summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-23 02:41:57 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-23 02:41:57 +0000
commit8524aae983c76c84b4b33ae6c8af6a2d3351517a (patch)
treec27fb8f7309177b17b9f80c03d4d9597c72c65fa /src
parent3aa2288a07d0922c5c7f3c1a0b53c6f097d670ef (diff)
termcmd: allow setting the background.
SVN revision: 75584
Diffstat (limited to 'src')
-rw-r--r--src/bin/termcmd.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index fb64014..05acbb7 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -119,6 +119,31 @@ _termcmd_grid_size(Evas_Object *obj, Evas_Object *win __UNUSED__, Evas_Object *b
119 return EINA_TRUE; 119 return EINA_TRUE;
120} 120}
121 121
122static Eina_Bool
123_termcmd_background(Evas_Object *obj, Evas_Object *win __UNUSED__, Evas_Object *bg __UNUSED__, const char *cmd)
124{
125 Config *config = termio_config_get(obj);
126
127 if (!config) return EINA_TRUE;
128
129 if (cmd[0] == 0)
130 {
131 config->temporary = EINA_TRUE;
132 eina_stringshare_replace(&(config->background), NULL);
133 main_media_update(config);
134 }
135 else if (ecore_file_can_read(cmd))
136 {
137 config->temporary = EINA_TRUE;
138 eina_stringshare_replace(&(config->background), cmd);
139 main_media_update(config);
140 }
141 else
142 ERR("Background file cannot be read: %s", cmd);
143
144 return EINA_TRUE;
145}
146
122// called as u type 147// called as u type
123Eina_Bool 148Eina_Bool
124termcmd_watch(Evas_Object *obj, Evas_Object *win, Evas_Object *bg, const char *cmd) 149termcmd_watch(Evas_Object *obj, Evas_Object *win, Evas_Object *bg, const char *cmd)
@@ -141,6 +166,8 @@ termcmd_do(Evas_Object *obj, Evas_Object *win, Evas_Object *bg, const char *cmd)
141 return _termcmd_font_size(obj, win, bg, cmd + 1); 166 return _termcmd_font_size(obj, win, bg, cmd + 1);
142 if ((cmd[0] == 'g') || (cmd[0] == 'G')) 167 if ((cmd[0] == 'g') || (cmd[0] == 'G'))
143 return _termcmd_grid_size(obj, win, bg, cmd + 1); 168 return _termcmd_grid_size(obj, win, bg, cmd + 1);
169 if ((cmd[0] == 'b') || (cmd[0] == 'B'))
170 return _termcmd_background(obj, win, bg, cmd + 1);
144 171
145 return EINA_FALSE; 172 return EINA_FALSE;
146 obj = win = bg = NULL; 173 obj = win = bg = NULL;