aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termcmd.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@profusion.mobi>2012-08-23 05:50:20 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-08-23 05:50:20 +0000
commitddae600684bb21c3e5b71a1cdfd7a7affb4ae3d1 (patch)
tree4f325399ba1395e1073387e67e54488d9d2bfd50 /src/bin/termcmd.c
parentterminology: remove c&p error. (diff)
downloadterminology-ddae600684bb21c3e5b71a1cdfd7a7affb4ae3d1.tar.gz
terminology: Use a lookup table for g[0-8] commands
SVN revision: 75589
Diffstat (limited to 'src/bin/termcmd.c')
-rw-r--r--src/bin/termcmd.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index 45850d2..fbdeef5 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -76,44 +76,15 @@ _termcmd_grid_size(Evas_Object *obj, Evas_Object *win __UNUSED__, Evas_Object *b
if (r == 1)
{
- switch (w)
+ static const int size_table[][2] = {
+ { 80, 24 }, { 80, 40 }, { 80, 60 }, { 80, 80 }, { 120, 24 },
+ { 120, 40 }, { 120, 60 }, { 120, 80 }, { 120, 120 }
+ };
+
+ if (w >= 0 && w <= 8)
{
- case 0:
- w = 80;
- h = 24;
- break;
- case 1:
- w = 80;
- h = 40;
- break;
- case 2:
- w = 80;
- h = 60;
- break;
- case 3:
- w = 80;
- h = 80;
- break;
- case 4:
- w = 120;
- h = 24;
- break;
- case 5:
- w = 120;
- h = 40;
- break;
- case 6:
- w = 120;
- h = 60;
- break;
- case 7:
- w = 120;
- h = 80;
- break;
- case 8:
- w = 120;
- h = 120;
- break;
+ h = size_table[w][1];
+ w = size_table[w][0];
}
}
if ((w > 0) && (h > 0))