summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-05 10:04:39 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-05 10:04:39 +0000
commitf7b03ac74d5d8309d26cc8ead2423d6c4d53bb45 (patch)
tree543b090ce25831acf6ab25d52a32212c3b27c30a /src/bin
parent5adb2747b8b9d24962be7d6a260582adc65edccb (diff)
add a bunch of options for title, name, role, override, borderless,
iconic, etc. on cmdline. SVN revision: 73337
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.c88
-rw-r--r--src/bin/win.c17
-rw-r--r--src/bin/win.h3
3 files changed, 81 insertions, 27 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index ca71d9b..e1d5bdc 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -199,22 +199,37 @@ static const Ecore_Getopt options = {
199 "Terminal emulator written with Enlightenment Foundation Libraries.", 199 "Terminal emulator written with Enlightenment Foundation Libraries.",
200 EINA_TRUE, 200 EINA_TRUE,
201 { 201 {
202 ECORE_GETOPT_STORE_STR('e', "exec", 202 ECORE_GETOPT_STORE_STR ('e', "exec",
203 "command to execute. " 203 "command to execute. "
204 "Defaults to $SHELL (or passwd shel or /bin/sh)"), 204 "Defaults to $SHELL (or passwd shel or /bin/sh)"),
205 ECORE_GETOPT_STORE_STR('t', "theme", 205 ECORE_GETOPT_STORE_STR ('t', "theme",
206 "Use the named edje theme or path to theme file."), 206 "Use the named edje theme or path to theme file."),
207 ECORE_GETOPT_STORE_STR('b', "background", 207 ECORE_GETOPT_STORE_STR ('b', "background",
208 "Use the named file as a background wallpaper."), 208 "Use the named file as a background wallpaper."),
209 ECORE_GETOPT_STORE_STR('g', "geometry", 209 ECORE_GETOPT_STORE_STR ('g', "geometry",
210 "Terminal geometry to use (eg 80x24 or 80x24+50+20 etc.)."), 210 "Terminal geometry to use (eg 80x24 or 80x24+50+20 etc.)."),
211 ECORE_GETOPT_CHOICE('v', "video-module", 211 ECORE_GETOPT_STORE_STR ('n', "name",
212 "Set emotion module to use.", 212 "Set window name."),
213 emotion_choices), 213 ECORE_GETOPT_STORE_STR ('r', "role",
214 "Set window role."),
215 ECORE_GETOPT_STORE_STR ('T', "title",
216 "Set window title."),
217 ECORE_GETOPT_STORE_STR ('i', "icon-name",
218 "Set icon name."),
219 ECORE_GETOPT_CHOICE ('v', "video-module",
220 "Set emotion module to use.", emotion_choices),
214 ECORE_GETOPT_STORE_BOOL('m', "video-mute", 221 ECORE_GETOPT_STORE_BOOL('m', "video-mute",
215 "Set mute mode for video playback."), 222 "Set mute mode for video playback."),
216 ECORE_GETOPT_STORE_BOOL('F', "fullscreen", 223 ECORE_GETOPT_STORE_BOOL('F', "fullscreen",
217 "Go into fullscreen mode from start."), 224 "Go into the fullscreen mode from start."),
225 ECORE_GETOPT_STORE_BOOL('I', "iconic",
226 "Go into an iconic state from the start."),
227 ECORE_GETOPT_STORE_BOOL('B', "borderless",
228 "Become a borderless managed window."),
229 ECORE_GETOPT_STORE_BOOL('O', "override",
230 "Become an override-redirect window."),
231 ECORE_GETOPT_STORE_BOOL('M', "maximized",
232 "Become maximized from the start."),
218 ECORE_GETOPT_VERSION('V', "version"), 233 ECORE_GETOPT_VERSION('V', "version"),
219 ECORE_GETOPT_COPYRIGHT('C', "copyright"), 234 ECORE_GETOPT_COPYRIGHT('C', "copyright"),
220 ECORE_GETOPT_LICENSE('L', "license"), 235 ECORE_GETOPT_LICENSE('L', "license"),
@@ -230,18 +245,35 @@ elm_main(int argc, char **argv)
230 char *theme = NULL; 245 char *theme = NULL;
231 char *background = NULL; 246 char *background = NULL;
232 char *geometry = NULL; 247 char *geometry = NULL;
248 char *name = NULL;
249 char *role = NULL;
250 char *title = NULL;
251 char *icon_name = NULL;
233 char *video_module = NULL; 252 char *video_module = NULL;
234 Eina_Bool video_mute = 0xff; /* unset */ 253 Eina_Bool video_mute = 0xff; /* unset */
235 Eina_Bool fullscreen = 0xff; /* unset */ 254 Eina_Bool fullscreen = 0xff; /* unset */
255 Eina_Bool iconic = 0xff; /* unset */
256 Eina_Bool borderless = 0xff; /* unset */
257 Eina_Bool override = 0xff; /* unset */
258 Eina_Bool maximized = 0xff; /* unset */
236 Eina_Bool quit_option = EINA_FALSE; 259 Eina_Bool quit_option = EINA_FALSE;
237 Ecore_Getopt_Value values[] = { 260 Ecore_Getopt_Value values[] = {
238 ECORE_GETOPT_VALUE_STR(cmd), 261 ECORE_GETOPT_VALUE_STR(cmd),
239 ECORE_GETOPT_VALUE_STR(theme), 262 ECORE_GETOPT_VALUE_STR(theme),
240 ECORE_GETOPT_VALUE_STR(background), 263 ECORE_GETOPT_VALUE_STR(background),
241 ECORE_GETOPT_VALUE_STR(geometry), 264 ECORE_GETOPT_VALUE_STR(geometry),
265 ECORE_GETOPT_VALUE_STR(name),
266 ECORE_GETOPT_VALUE_STR(role),
267 ECORE_GETOPT_VALUE_STR(title),
268 ECORE_GETOPT_VALUE_STR(icon_name),
242 ECORE_GETOPT_VALUE_STR(video_module), 269 ECORE_GETOPT_VALUE_STR(video_module),
243 ECORE_GETOPT_VALUE_BOOL(video_mute), 270 ECORE_GETOPT_VALUE_BOOL(video_mute),
244 ECORE_GETOPT_VALUE_BOOL(fullscreen), 271 ECORE_GETOPT_VALUE_BOOL(fullscreen),
272 ECORE_GETOPT_VALUE_BOOL(iconic),
273 ECORE_GETOPT_VALUE_BOOL(borderless),
274 ECORE_GETOPT_VALUE_BOOL(override),
275 ECORE_GETOPT_VALUE_BOOL(maximized),
276
245 ECORE_GETOPT_VALUE_BOOL(quit_option), 277 ECORE_GETOPT_VALUE_BOOL(quit_option),
246 ECORE_GETOPT_VALUE_BOOL(quit_option), 278 ECORE_GETOPT_VALUE_BOOL(quit_option),
247 ECORE_GETOPT_VALUE_BOOL(quit_option), 279 ECORE_GETOPT_VALUE_BOOL(quit_option),
@@ -285,18 +317,18 @@ elm_main(int argc, char **argv)
285 if (theme) 317 if (theme)
286 { 318 {
287 char path[PATH_MAX]; 319 char path[PATH_MAX];
288 char name[PATH_MAX]; 320 char nom[PATH_MAX];
289 321
290 if (eina_str_has_suffix(theme, ".edj")) 322 if (eina_str_has_suffix(theme, ".edj"))
291 eina_strlcpy(name, theme, sizeof(name)); 323 eina_strlcpy(nom, theme, sizeof(nom));
292 else 324 else
293 snprintf(name, sizeof(name), "%s.edj", theme); 325 snprintf(nom, sizeof(nom), "%s.edj", theme);
294 326
295 if (strchr(name, '/')) 327 if (strchr(nom, '/'))
296 eina_strlcpy(path, name, sizeof(path)); 328 eina_strlcpy(path, nom, sizeof(path));
297 else 329 else
298 snprintf(path, sizeof(path), "%s/themes/%s", 330 snprintf(path, sizeof(path), "%s/themes/%s",
299 elm_app_data_dir_get(), name); 331 elm_app_data_dir_get(), nom);
300 332
301 eina_stringshare_replace(&(config->theme), path); 333 eina_stringshare_replace(&(config->theme), path);
302 config->temporary = EINA_TRUE; 334 config->temporary = EINA_TRUE;
@@ -389,7 +421,7 @@ elm_main(int argc, char **argv)
389 // set an env so terminal apps can detect they are in terminology :) 421 // set an env so terminal apps can detect they are in terminology :)
390 putenv("TERMINOLOGY=1"); 422 putenv("TERMINOLOGY=1");
391 423
392 win = tg_win_add(); 424 win = tg_win_add(name, role, title, icon_name);
393 425
394 elm_win_conformant_set(win, EINA_TRUE); 426 elm_win_conformant_set(win, EINA_TRUE);
395 427
@@ -397,6 +429,22 @@ elm_main(int argc, char **argv)
397 { 429 {
398 if (fullscreen) elm_win_fullscreen_set(win, EINA_TRUE); 430 if (fullscreen) elm_win_fullscreen_set(win, EINA_TRUE);
399 } 431 }
432 if (iconic != 0xff)
433 {
434 if (iconic) elm_win_iconified_set(win, EINA_TRUE);
435 }
436 if (borderless != 0xff)
437 {
438 if (borderless) elm_win_borderless_set(win, EINA_TRUE);
439 }
440 if (override != 0xff)
441 {
442 if (override) elm_win_override_set(win, EINA_TRUE);
443 }
444 if (maximized != 0xff)
445 {
446 if (maximized) elm_win_maximized_set(win, EINA_TRUE);
447 }
400 448
401 conform = o = elm_conformant_add(win); 449 conform = o = elm_conformant_add(win);
402 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 450 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/bin/win.c b/src/bin/win.c
index d61887f..f5ca624 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -3,17 +3,22 @@
3#include "config.h" 3#include "config.h"
4 4
5Evas_Object * 5Evas_Object *
6tg_win_add(void) 6tg_win_add(const char *name, const char *role, const char *title, const char *icon_name)
7{ 7{
8 Evas_Object *win, *o; 8 Evas_Object *win, *o;
9 char buf[4096]; 9 char buf[4096];
10 10
11 win = elm_win_add(NULL, "main", ELM_WIN_BASIC); 11 if (!name) name = "main";
12 if (!title) title = "Terminology";
13 if (!icon_name) icon_name = "Terminology";
14
15 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
16 elm_win_title_set(win, title);
17 elm_win_icon_name_set(win, icon_name);
18 if (role) elm_win_role_set(win, role);
19
12 elm_win_autodel_set(win, EINA_TRUE); 20 elm_win_autodel_set(win, EINA_TRUE);
13 21
14 elm_win_title_set(win, "Terminology");
15 elm_win_icon_name_set(win, "Terminology");
16
17 o = evas_object_image_add(evas_object_evas_get(win)); 22 o = evas_object_image_add(evas_object_evas_get(win));
18 snprintf(buf, sizeof(buf), "%s/images/terminology.png", 23 snprintf(buf, sizeof(buf), "%s/images/terminology.png",
19 elm_app_data_dir_get()); 24 elm_app_data_dir_get());
diff --git a/src/bin/win.h b/src/bin/win.h
index 0009ed6..5e15555 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -1 +1,2 @@
1Evas_Object *tg_win_add(void); 1Evas_Object *tg_win_add(const char *name, const char *role, const char *title, const char *icon_name);
2