summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-22 10:34:28 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-22 10:34:28 +0000
commit141119f0d2a162f8d6747ed4e1d23e94515a0035 (patch)
tree772ccdeca0927fbde877fe6cdd11db954eec437b /src
parent93dd23541c4509d0134cfbefb056b436f6d572ce (diff)
good idea from gustavo - a g command for terminology's cmdbox.
g20x20 = make term 20x20 chars. SVN revision: 75537
Diffstat (limited to 'src')
-rw-r--r--src/bin/termcmd.c13
-rw-r--r--src/bin/termio.c15
-rw-r--r--src/bin/termio.h1
3 files changed, 28 insertions, 1 deletions
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index ab538c5..4489a5b 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -86,6 +86,19 @@ termcmd_do(Evas_Object *obj, Evas_Object *win, Evas_Object *bg, const char *cmd)
86 } 86 }
87 return EINA_TRUE; 87 return EINA_TRUE;
88 } 88 }
89 if ((cmd[0] == 'g') || (cmd[0] == 'G')) // font size
90 {
91 int w = -1, h = -1;
92
93 if (sscanf(cmd, "g%ix%i", &w, &h) == 2)
94 {
95 if ((w > 0) && (h > 0))
96 {
97 termio_grid_size_set(obj, w, h);
98 }
99 }
100 return EINA_TRUE;
101 }
89 return EINA_FALSE; 102 return EINA_FALSE;
90 obj = win = bg = NULL; 103 obj = win = bg = NULL;
91} 104}
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 76281e0..58ce35d 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -770,7 +770,6 @@ _font_size_set(Evas_Object *obj, int size)
770 config->font.size = size; 770 config->font.size = size;
771 gw = sd->grid.w; 771 gw = sd->grid.w;
772 gh = sd->grid.h; 772 gh = sd->grid.h;
773 evas_object_size_hint_min_get(obj, &mw, &mh);
774 sd->noreqsize = 1; 773 sd->noreqsize = 1;
775 termio_config_update(obj); 774 termio_config_update(obj);
776 sd->noreqsize = 0; 775 sd->noreqsize = 0;
@@ -786,6 +785,20 @@ termio_font_size_set(Evas_Object *obj, int size)
786 _font_size_set(obj, size); 785 _font_size_set(obj, size);
787} 786}
788 787
788void
789termio_grid_size_set(Evas_Object *obj, int w, int h)
790{
791 Termio *sd = evas_object_smart_data_get(obj);
792 Evas_Coord mw = 1, mh = 1;
793
794 if (w < 1) w = 1;
795 if (h < 1) h = 1;
796 if (!sd) return;
797 evas_object_size_hint_min_get(obj, &mw, &mh);
798 evas_object_data_del(obj, "sizedone");
799 evas_object_size_hint_request_set(obj, mw * w, mh * h);
800}
801
789static void 802static void
790_smart_cb_key_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event) 803_smart_cb_key_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
791{ 804{
diff --git a/src/bin/termio.h b/src/bin/termio.h
index d1a39aa..0e449b6 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -15,5 +15,6 @@ void termio_mouseover_suspend_pushpop(Evas_Object *obj, int dir);
15void termio_size_get(Evas_Object *obj, int *w, int *h); 15void termio_size_get(Evas_Object *obj, int *w, int *h);
16int termio_scroll_get(Evas_Object *obj); 16int termio_scroll_get(Evas_Object *obj);
17void termio_font_size_set(Evas_Object *obj, int size); 17void termio_font_size_set(Evas_Object *obj, int size);
18void termio_grid_size_set(Evas_Object *obj, int w, int h);
18 19
19#endif 20#endif