On Sun, 23 Jun 2013 03:21:38 +0300 Galatsanos Panagiotis <[email protected]> said:
missing scrolio.h in patch! :( > Ignore the previous patch, use this attachment instead. > > > On Sun, Jun 23, 2013 at 2:44 AM, Galatsanos Panagiotis < > [email protected]> wrote: > > > After spending some time on the miniview feature and with the help of > > raster I finally reached the point where it is somehow usable. > > > > I have some issues where i need some guidance/help/feedback. > > First, I want to bring miniview image below controls menu but i don't know > > how. Currently when miniview is enabled and we have some history lines > > drawn, when you press right click the controls menu is below miniview but > > we don't want this... > > > > My second issue is that i want to use an animation when miniview > > appears/dissapears. Actually what I want for default behaviour is this: > > When the user enables miniview it'll slide in from the right and it will > > show up just for couple of seconds (lets say 5), then it will slide back > > and only one small part of the miniview will be visible only to indicate to > > the user that it's enabled and when the user mouses over it will re-slide > > in... > > > > Also i'm having an issue when resizing the window, some "garbage" pixels > > are drawn inside the miniview image and I can't find where are coming from. > > If someone has a clue it'll be very helpfull! :D > > > > Please try my patch and tell me what you think > > Cheers, Panos. > > > > From 5c334290e9aa1d6aa2a02ae6bde8ff7a3d6dece6 Mon Sep 17 00:00:00 2001 > > From: Godfath3r <[email protected]> > > Date: Sun, 23 Jun 2013 03:07:27 +0300 > > Subject: [PATCH 1/1] add miniview feature to terminology. Pressing > > ctrl+shift+f toggles miniview on the side of each > > terminal/split/tab > > > > --- > > data/themes/default.edc | 24 +++ > > src/bin/Makefile.am | 1 + > > src/bin/config.c | 5 + > > src/bin/config.h | 1 + > > src/bin/main.c | 61 +++++++- > > src/bin/scrolio.c | 397 > > ++++++++++++++++++++++++++++++++++++++++++++++++ > > src/bin/termio.c | 101 +++++++++++- > > src/bin/termio.h | 3 + > > 8 files changed, 582 insertions(+), 11 deletions(-) > > create mode 100644 src/bin/scrolio.c > > create mode 100644 src/bin/scrolio.h > > > > diff --git a/data/themes/default.edc b/data/themes/default.edc > > index 42e3f2a..dfeea2d 100644 > > --- a/data/themes/default.edc > > +++ b/data/themes/default.edc > > @@ -3597,4 +3597,28 @@ target: "4.bottom" > > } > > } > > } > > + > > + group { name: "terminology/miniview"; > > + parts { > > + part { name: "miniview"; type: SWALLOW; > > + mouse_events: 0; > > + description { state: "default" 0.0; > > + color: 25 50 30 100; > > + rel1.relative: 0.85 0.0; > > + } > > + } > > + part { name: "miniview_screen"; type: RECT; > > + mouse_events: 1; > > + dragable { > > + confine: "miniview"; > > + x: 0 0 0; > > + y: 1 1 0; > > + } > > + description { state: "default" 0.0; > > + color: 255 255 255 30; > > + fixed:1 1; > > + } > > + } > > + } > > + } > > } > > diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am > > index e95dae7..3be4322 100644 > > --- a/src/bin/Makefile.am > > +++ b/src/bin/Makefile.am > > @@ -27,6 +27,7 @@ options_video.c options_video.h \ > > options_theme.c options_theme.h \ > > options_wallpaper.c options_wallpaper.h \ > > sel.c sel.h \ > > +scrolio.c scrolio.h \ > > termio.c termio.h \ > > termcmd.c termcmd.h \ > > termiolink.c termiolink.h \ > > diff --git a/src/bin/config.c b/src/bin/config.c > > index eafa3da..f03e041 100644 > > --- a/src/bin/config.c > > +++ b/src/bin/config.c > > @@ -89,6 +89,8 @@ config_init(void) > > (edd_base, Config, "cg_width", cg_width, EET_T_INT); > > EET_DATA_DESCRIPTOR_ADD_BASIC > > (edd_base, Config, "cg_height", cg_height, EET_T_INT); > > + EET_DATA_DESCRIPTOR_ADD_BASIC > > + (edd_base, Config, "miniview", miniview, EET_T_UCHAR); > > } > > > > void > > @@ -171,6 +173,7 @@ config_sync(const Config *config_src, Config *config) > > config->custom_geometry = config_src->custom_geometry; > > config->cg_width = config_src->cg_width; > > config->cg_height = config_src->cg_height; > > + config->miniview = config_src->miniview; > > } > > > > Config * > > @@ -426,6 +429,7 @@ config_load(const char *key) > > config->custom_geometry = EINA_FALSE; > > config->cg_width = 80; > > config->cg_height = 24; > > + config->miniview = EINA_FALSE; > > } > > } > > > > @@ -474,6 +478,7 @@ config_fork(Config *config) > > CPY(custom_geometry); > > CPY(cg_width); > > CPY(cg_height); > > + CPY(miniview); > > > > CPY(temporary); > > SCPY(config_key); > > diff --git a/src/bin/config.h b/src/bin/config.h > > index cda50ff..79cc1c3 100644 > > --- a/src/bin/config.h > > +++ b/src/bin/config.h > > @@ -43,6 +43,7 @@ struct _Config > > Eina_Bool custom_geometry; > > int cg_width; > > int cg_height; > > + Eina_Bool miniview; > > > > Eina_Bool temporary; /* not in EET */ > > const char *config_key; /* not in EET, the key that config was > > loaded */ > > diff --git a/src/bin/main.c b/src/bin/main.c > > index 5bbf3dc..77ea8ae 100644 > > --- a/src/bin/main.c > > +++ b/src/bin/main.c > > @@ -4,6 +4,7 @@ > > #include <Elementary.h> > > #include "main.h" > > #include "win.h" > > +#include "scrolio.h" > > #include "termio.h" > > #include "termpty.h" > > #include "termcmd.h" > > @@ -23,9 +24,9 @@ > > #define PANES_BOTTOM "bottom" > > #endif > > > > -typedef struct _Win Win; > > -typedef struct _Term Term; > > -typedef struct _Split Split; > > +typedef struct _Win Win; > > +typedef struct _Term Term; > > +typedef struct _Split Split; > > > > struct _Win > > { > > @@ -53,6 +54,7 @@ struct _Term > > Evas_Object *term; > > Evas_Object *media; > > Evas_Object *popmedia; > > + Evas_Object *miniview; > > Evas_Object *sel; > > Evas_Object *tabcount_spacer; > > Eina_List *popmedia_queue; > > @@ -1036,6 +1038,36 @@ _popmedia_show(Term *term, const char *src) > > } > > > > static void > > +_cb_scrolio_toggle(void *data, Evas_Object *obj __UNUSED__, void *event > > __UNUSED__) > > +{ > > + Term *term = data; > > + Config *config = termio_config_get(term->term); > > + if (!config->miniview) > > + { > > + config->miniview = EINA_TRUE; > > + config_save(config, NULL); > > + > > + Evas_Object *o; > > + Evas_Coord ox, oy, ow, oh; > > + evas_object_geometry_get(term->term, &ox, &oy, &ow, &oh); > > + > > + term->miniview = (Evas_Object *) termio_miniview_show(term->term, > > ox, oy, ow, oh); > > + //edje_object_part_swallow(term->term, "terminology.content", > > term->miniview); > > + evas_object_show(term->miniview); > > + } > > + else > > + { > > + evas_object_hide(term->miniview); > > + //edje_object_part_unswallow(term->term, term->miniview); > > + termio_miniview_hide(term->term); > > + term->miniview = NULL; > > + > > + config->miniview = EINA_FALSE; > > + config_save(config, NULL); > > + } > > +} > > + > > +static void > > _popmedia_queue_process(Term *term) > > { > > const char *src; > > @@ -1964,6 +1996,13 @@ main_term_free(Term *term) > > } > > term->media = NULL; > > if (term->popmedia) evas_object_del(term->popmedia); > > + if (term->miniview) > > + { > > + evas_object_hide(term->miniview); > > + //edje_object_part_unswallow(term->term, term->miniview); > > + termio_miniview_hide(term->term); > > + term->miniview = NULL; > > + } > > term->popmedia = NULL; > > evas_object_del(term->term); > > term->term = NULL; > > @@ -2167,6 +2206,7 @@ main_term_new(Win *wn, Config *config, const char > > *cmd, > > evas_object_smart_callback_add(o, "tab,8", _cb_tab_8, term); > > evas_object_smart_callback_add(o, "tab,9", _cb_tab_9, term); > > evas_object_smart_callback_add(o, "tab,0", _cb_tab_0, term); > > + evas_object_smart_callback_add(o, "miniview,toggle", > > _cb_scrolio_toggle, term); > > evas_object_show(o); > > > > evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, > > @@ -2181,7 +2221,20 @@ main_term_new(Win *wn, Config *config, const char > > *cmd, > > // edje_object_signal_emit(term->base, "focus,in", "terminology"); > > } > > wn->terms = eina_list_append(wn->terms, term); > > - > > + > > + if (term->config->miniview && !term->miniview) > > + { > > + Evas_Object *o; > > + Evas_Coord ox, oy, ow, oh; > > + evas_object_geometry_get(term->term, &ox, &oy, &ow, &oh); > > + > > + //term->miniview = (Evas_Object *) > > termio_miniview_show(term->term, > > + // ox, > > oy, ow, oh); > > + edje_object_part_swallow(term->term, "terminology.content", > > + term->miniview); > > + evas_object_show(term->miniview); > > + } > > + > > return term; > > } > > > > diff --git a/src/bin/scrolio.c b/src/bin/scrolio.c > > new file mode 100644 > > index 0000000..76b8db3 > > --- /dev/null > > +++ b/src/bin/scrolio.c > > @@ -0,0 +1,397 @@ > > +#include <Elementary.h> > > +#include <stdio.h> > > +#include "col.h" > > +#include "termpty.h" > > +#include "termio.h" > > + > > +// Scrolio is the smart object responsible for miniview > > +// feature. (this scroll thing at your right) > > + > > +typedef struct _Scrolio Scrolio; > > + > > +struct _Scrolio > > +{ > > + Evas_Object_Smart_Clipped_Data __clipped_data; > > + Evas_Object *obj, *image_obj, *edje_obj, *screen_obj; > > + struct { > > + int size; > > + const char *name; > > + int chw, chh; > > + } font; > > + struct { > > + int w, h; > > + Evas_Object *obj; > > + } grid; > > + Evas_Object *termio; > > + Termpty *pty; > > + int parent_x, parent_y, parent_w, parent_h; > > + int scroll; > > + int scrollback; > > + double miniview_screen_size, miniview_screen_step, > > miniview_screen_default_pos, > > + lines_drawn, screen_obj_scroll_val, screen_obj_custom_pos; > > +}; > > + > > +static Evas_Smart *_smart = NULL; > > +static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; > > + > > +static void > > +_smart_add(Evas_Object *obj) > > +{ > > + Scrolio *sd; > > + Evas_Object *o; > > + Evas_Load_Error err; > > + > > + sd = calloc(1, sizeof(Scrolio)); > > + EINA_SAFETY_ON_NULL_RETURN(sd); > > + evas_object_smart_data_set(obj, sd); > > + > > + _parent_sc.add(obj); > > + > > + /* miniview output widget */ > > + o = evas_object_image_add(evas_object_evas_get(obj)); > > + //evas_object_image_file_set(o, > > "data/themes/images/miniview_white_bg.png", NULL); > > + //err = evas_object_image_load_error_get(o); > > + //if (err != EVAS_LOAD_ERROR_NONE) > > + // printf("error\n"); > > + evas_object_image_alpha_set(o, EINA_TRUE); > > + evas_object_smart_member_add(o, obj); > > + sd->image_obj = o; > > +} > > + > > +static void > > +_smart_del() > > +{ > > + > > +} > > + > > +static void > > +_smart_move() > > +{ > > + > > +} > > + > > +static void > > +_smart_calculate(Evas_Object *obj) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + //evas_object_geometry_get(sd->obj, &ox, &oy, &ow, &oh); > > + //evas_object_move(sd->grid.obj, ox+(sd->grid.w*0.8), oy); > > + //evas_object_resize(sd->grid.obj, > > + // sd->grid.w * sd->font.chw, > > + // sd->grid.h * sd->font.chh); > > + evas_object_image_size_set(sd->image_obj, sd->parent_w / sd->font.chw, > > + (sd->parent_h / sd->font.chh) + > > sd->scrollback); > > + evas_object_image_fill_set(sd->image_obj, 0, 0, sd->parent_w * 0.15, > > + sd->parent_h); > > + evas_object_resize(sd->image_obj, sd->parent_w * 0.15, sd->parent_h); > > + evas_object_move(sd->image_obj, sd->parent_x + (sd->parent_w * 0.85), > > + sd->parent_y); > > + > > +} > > + > > +static void > > +_smart_apply(Evas_Object *obj) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + > > + evas_object_show(sd->image_obj); > > + evas_object_show(sd->edje_obj); > > + evas_object_show(sd->screen_obj); > > +} > > + > > +static void > > +_smart_size(Evas_Object *obj) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + > > + if (!sd) return; > > + sd->miniview_screen_size = (double) sd->parent_h / > > + (double) (sd->scrollback * sd->font.chh); > > + sd->miniview_screen_step = (double) sd->parent_h / (double) > > sd->scrollback; > > + sd->miniview_screen_default_pos = (((double) sd->parent_h/(double) > > sd->scrollback) > > + * (sd->lines_drawn - sd->scroll)) > > + / (double) sd->parent_h > > + - sd->miniview_screen_size; > > + > > + evas_object_image_size_set(sd->image_obj, (sd->parent_w / > > sd->font.chw), > > + sd->parent_h); > > + evas_object_move(sd->edje_obj, sd->parent_x, sd->parent_y); > > + evas_object_resize(sd->edje_obj, sd->parent_w, sd->parent_h); > > + > > + edje_object_part_drag_size_set(sd->screen_obj, "miniview_screen", 1.0, > > + sd->miniview_screen_size); > > + if (!edje_object_part_drag_step_set(sd->screen_obj, "miniview_screen", > > 0.0, > > + sd->miniview_screen_step)) > > + printf("error when setting drag step size.\n"); > > + evas_object_move(sd->screen_obj, sd->parent_x, sd->parent_y); > > + evas_object_resize(sd->screen_obj, sd->parent_w, sd->parent_h); > > + > > + _smart_calculate(obj); > > + _smart_apply(obj); > > +} > > + > > +static void > > +_smart_resize() > > +{ > > +/* > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + _smart_size(obj); > > + _scrolio_draw(obj, sd->grid.obj, sd->parent_w, sd->parent_h); > > +*/ > > +} > > + > > + > > +static void > > +_smart_init(void) > > +{ > > + static Evas_Smart_Class sc; > > + > > + evas_object_smart_clipped_smart_set(&_parent_sc); > > + sc = _parent_sc; > > + sc.name = "scrolio"; > > + sc.version = EVAS_SMART_CLASS_VERSION; > > + sc.add = _smart_add; > > + sc.del = _smart_del; > > + sc.resize = _smart_resize; > > + sc.move = _smart_move; > > + sc.calculate = _smart_calculate; > > + _smart = evas_smart_class_new(&sc); > > +} > > + > > +static void > > +_on_knob_moved(void *data, Evas_Object *o, const char *emission > > EINA_UNUSED, const char *source EINA_UNUSED) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(data); > > + double val; > > + > > + edje_object_part_drag_value_get(o, "miniview_screen", NULL, &val); > > + sd->scroll = sd->lines_drawn - > > + ((sd->lines_drawn - (sd->parent_h / sd->font.chh)) * > > + (val + sd->miniview_screen_size)); > > + > > + // if miniview lines are less than scrollback lines > > + // (miniview obj isn't fully drawn from top to bottom) > > + if (sd->lines_drawn < sd->scrollback + (sd->parent_h / sd->font.chh) - > > 1) > > + { > > + if (val > sd->miniview_screen_default_pos) > > + { > > + val = sd->miniview_screen_default_pos; > > + sd->scroll = 0; > > + } > > + else > > + { > > + sd->scroll = sd->lines_drawn - > > + ((sd->lines_drawn - (sd->parent_h / > > sd->font.chh)) * > > + ((val / sd->miniview_screen_default_pos))) - > > + sd->parent_h / sd->font.chh; > > + > > + } > > + } > > + if (sd->scroll < 0) sd->scroll = 0; > > + printf("sd->scroll is:: %d and lines are: %f\n", sd->scroll, > > sd->lines_drawn); > > + termio_scroll_set(sd->termio, sd->scroll); > > +} > > + > > +void > > +_scrolio_draw(Evas_Object *obj) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + Termcell *cells; > > + > > + unsigned int *pixels, *p; > > + int x=0, y=0, r, g, b, i; > > + int wret=0; > > + int pty_scan_width = 0; > > + Eina_Bool pty_compact_w = EINA_FALSE; > > + > > + sd->lines_drawn = 0; > > + pixels = evas_object_image_data_get(sd->image_obj, EINA_TRUE); > > + p = pixels; > > + for (y = 0 - sd->pty->backscroll_num; y < sd->parent_h / sd->font.chh; > > y++) > > + { > > + cells = termpty_cellrow_get(sd->pty, y, &wret); > > + if (wret < sd->parent_w / sd->font.chw) > > + { > > + pty_scan_width = wret; > > + pty_compact_w = EINA_TRUE; > > + } > > + else > > + { > > + pty_scan_width = sd->parent_w / sd->font.chw; > > + pty_compact_w = EINA_FALSE; > > + } > > + for (x=0; x < pty_scan_width; x++) > > + { > > + if (cells[x].codepoint == 0 || cells[x].codepoint == ' ' || > > + cells[x].att.newline || cells[x].att.tab || > > + cells[x].codepoint == '\0' || cells[x].codepoint <= 0) > > + { > > + r=0; g = 0; b = 0; > > + *p = (r << 16) | (g << 8) | (b); > > + p++; > > + } > > + else > > + { > > + switch (cells[x].att.fg) > > + { > > + // TODO: get pixel colors from current themee... > > + case 0: > > + r = 180; g = 180; b = 180; > > + break; > > + case 2: > > + r = 204; g = 51; b = 51; > > + break; > > + case 3: > > + r = 51; g = 204; b = 51; > > + break; > > + case 4: > > + r = 204; g = 136; b = 51; > > + break; > > + case 5: > > + r = 51; g = 51; b = 204; > > + break; > > + case 6: > > + r = 204; g = 51; b = 204; > > + break; > > + case 7: > > + r = 51; g = 204; b = 204; > > + break; > > + default: > > + r = 180; g = 180; b = 180; > > + } > > + *p = (r << 16) | (g << 8) | (b); > > + p++; > > + } > > + } > > + if (pty_compact_w) > > + for (i=0; i < (sd->parent_w / sd->font.chw) - wret; i++) > > + { > > + r=0; g = 0; b = 0; > > + *p = (r << 16) | (g << 8) | (b); > > + p++; > > + } > > + sd->lines_drawn++; > > + } > > + evas_object_image_data_set(sd->image_obj, pixels); > > + evas_object_image_data_update_add(sd->image_obj, 0, 0, sd->parent_w * > > 0.85, sd->parent_h * sd->parent_h); > > +} > > + > > +void > > +scrolio_miniview_resize(Evas_Object *obj, Termpty *pty, int w, int h) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + sd->parent_w = w; > > + sd->parent_h = h; > > + sd->pty = pty; > > + _smart_size(obj); > > +} > > + > > +void > > +scrolio_miniview_move(Evas_Object *obj, int x, int y) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + sd->parent_x = x; > > + sd->parent_y = y; > > + _smart_size(obj); > > +} > > + > > +void > > +scrolio_miniview_update_scroll(Evas_Object *obj, int scroll_position) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + sd->scroll = scroll_position; > > + _smart_size(obj); > > + edje_object_part_drag_value_set(sd->screen_obj, "miniview_screen", > > 0.0, sd->miniview_screen_default_pos); > > + > > + _scrolio_draw(obj); > > +} > > + > > +Evas_Object * > > +scrolio_miniview_add(Evas_Object *parent, int fontw, int fonth, Termpty > > *pty, > > + int scroll, int scroll_position, int x, int y, int > > w, int h) > > +{ > > + Evas *e; > > + Evas_Object *obj, *edje_obj; > > + Config *config = termio_config_get(parent); > > + Scrolio *sd; > > + > > + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); > > + e = evas_object_evas_get(parent); > > + if (!e) return NULL; > > + > > + if (!_smart) _smart_init(); > > + obj = evas_object_smart_add(e, _smart); > > + sd = evas_object_smart_data_get(obj); > > + if (!sd) return obj; > > + > > + sd->parent_x = x; > > + sd->parent_y = y; > > + sd->parent_w = w; > > + sd->parent_h = h; > > + sd->font.chw = fontw; > > + sd->font.chh = fonth; > > + sd->pty = pty; > > + sd->scrollback = config->scrollback; > > + sd->scroll = scroll_position; > > + sd->miniview_screen_size = (double) sd->parent_h / sd->font.chh * > > sd->scrollback; > > + (double) (sd->scrollback * sd->font.chh); > > + (double) (sd->scrollback * sd->font.chh); > > + sd->miniview_screen_step = (double) sd->parent_h / (double) > > sd->scrollback; > > + sd->miniview_screen_default_pos = (((double) sd->parent_h/(double) > > sd->scrollback)// How many pixels we need for each line drawn > > + * (sd->lines_drawn - sd->scroll)) > > // Multiplied by how many lines are drawn > > + / (double) sd->parent_h // Divided by > > height to find the percentage > > + - sd->miniview_screen_size; > > + sd->termio = parent; > > + edje_obj = edje_object_add(e); > > + edje_object_file_set(edje_obj, config_theme_path_get(config), > > + "terminology/miniview"); > > + edje_object_part_swallow(edje_obj, "miniview", obj); > > + evas_object_move(edje_obj, x, y); > > + evas_object_resize(edje_obj, w, h); > > + sd->edje_obj = edje_obj; > > + > > + edje_obj = edje_object_add(e); > > + edje_object_file_set(edje_obj, config_theme_path_get(config), > > + "terminology/miniview"); > > + edje_object_part_drag_size_set(edje_obj, "miniview_screen", 1.0, > > + sd->miniview_screen_size); > > + if (!edje_object_part_drag_step_set(edje_obj, "miniview_screen", 0.0, > > sd->miniview_screen_step)) > > + printf("error when setting drag step size.\n"); > > + edje_object_signal_callback_add(edje_obj, "drag", "miniview_screen", > > _on_knob_moved, obj); > > + > > + evas_object_move(edje_obj, x, y); > > + evas_object_resize(edje_obj, w, h); > > + sd->screen_obj = edje_obj; > > + > > + _smart_size(obj); > > + _scrolio_draw(obj); > > + > > + scrolio_miniview_update_scroll(obj, sd->scroll); > > + > > + return obj; > > +} > > + > > +void > > +scrolio_miniview_hide(Evas_Object *obj) > > +{ > > + Scrolio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + evas_object_hide(sd->image_obj); > > + evas_object_hide(sd->edje_obj); > > + evas_object_hide(sd->screen_obj); > > + > > + sd->image_obj = NULL; > > + sd->edje_obj = NULL; > > + sd->screen_obj = NULL; > > +} > > diff --git a/src/bin/scrolio.h b/src/bin/scrolio.h > > new file mode 100644 > > index 0000000..e69de29 > > diff --git a/src/bin/termio.c b/src/bin/termio.c > > index f685929..0f1aa0f 100644 > > --- a/src/bin/termio.c > > +++ b/src/bin/termio.c > > @@ -3,6 +3,7 @@ > > #include <Ecore_IMF_Evas.h> > > #include <Elementary.h> > > #include <Ecore_Input.h> > > +#include "scrolio.h" > > #include "termio.h" > > #include "termiolink.h" > > #include "termpty.h" > > @@ -61,6 +62,7 @@ struct _Termio > > Eina_Bool dndobjdel : 1; > > } down; > > } link; > > + Evas_Object *scrolio; > > int zoom_fontsize_start; > > int scroll; > > unsigned int last_keyup; > > @@ -1127,7 +1129,11 @@ _block_edje_activate(Evas_Object *obj, Termblock > > *blk) > > evas_object_show(blk->obj); > > evas_object_data_set(blk->obj, "blk", blk); > > > > - if (ok) _block_edje_cmds(sd->pty, blk, blk->cmds, EINA_TRUE); > > + if (ok) > > + { > > + _block_edje_cmds(sd->pty, blk, blk->cmds, EINA_TRUE); > > + //scrolio_pty_update(sd->scrolio, sd->pty); > > + } > > } > > > > static void > > @@ -1180,7 +1186,7 @@ _smart_apply(Evas_Object *obj) > > Evas_Coord ox, oy, ow, oh; > > Eina_List *l, *ln; > > Termblock *blk; > > - int j, x, y, w, ch1 = 0, ch2 = 0, inv = 0; > > + int j, x, y, w, ch1 = 0, ch2 = 0, inv = 0, jinx=0; > > > > if (!sd) return; > > evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); > > @@ -1392,6 +1398,7 @@ _smart_apply(Evas_Object *obj) > > if (ch1 >= 0) > > evas_object_textgrid_update_add(sd->grid.obj, ch1, y, > > ch2 - ch1 + 1, 1); > > + //printf("I'm fine thanx\n"); > > } > > termpty_cellcomp_thaw(sd->pty); > > > > @@ -1414,7 +1421,6 @@ _smart_apply(Evas_Object *obj) > > (sd->pty->block.active, l); > > } > > } > > - > > if ((sd->scroll != 0) || (sd->pty->state.hidecursor)) > > evas_object_hide(sd->cur.obj); > > else > > @@ -1537,6 +1543,7 @@ _smart_apply(Evas_Object *obj) > > evas_object_hide(sd->cur.selo_theme); > > if (sd->mouseover_delay) ecore_timer_del(sd->mouseover_delay); > > sd->mouseover_delay = ecore_timer_add(0.05, _smart_mouseover_delay, > > obj); > > + //printf("How are you today?\n?"); > > } > > > > static void > > @@ -1551,11 +1558,12 @@ _smart_size(Evas_Object *obj, int w, int h, > > Eina_Bool force) > > { > > if ((w == sd->grid.w) && (h == sd->grid.h)) return; > > } > > - > > - evas_event_freeze(evas_object_evas_get(obj)); > > - evas_object_textgrid_size_set(sd->grid.obj, w, h); > > sd->grid.w = w; > > sd->grid.h = h; > > + > > + evas_event_freeze(evas_object_evas_get(obj)); > > + evas_object_textgrid_size_set(sd->grid.obj, sd->grid.w, sd->grid.h); > > + > > evas_object_resize(sd->cur.obj, sd->font.chw, sd->font.chh); > > evas_object_size_hint_min_set(obj, sd->font.chw, sd->font.chh); > > if (!sd->noreqsize) > > @@ -1563,8 +1571,14 @@ _smart_size(Evas_Object *obj, int w, int h, > > Eina_Bool force) > > sd->font.chw * sd->grid.w, > > sd->font.chh * sd->grid.h); > > termpty_resize(sd->pty, w, h); > > + > > _smart_calculate(obj); > > _smart_apply(obj); > > + if (sd->scrolio) > > + { > > + scrolio_miniview_resize(sd->scrolio, sd->pty, w * sd->font.chw, h > > * sd->font.chh); > > + evas_object_smart_callback_call(obj, "miniview,show", NULL); > > + } > > evas_event_thaw(evas_object_evas_get(obj)); > > } > > > > @@ -1597,6 +1611,8 @@ _smart_cb_change(void *data) > > sd->anim = NULL; > > _smart_apply(obj); > > evas_object_smart_callback_call(obj, "changed", NULL); > > + if (sd->scrolio) > > + scrolio_miniview_update_scroll(sd->scrolio, termio_scroll_get(obj)); > > return EINA_FALSE; > > } > > > > @@ -1605,6 +1621,8 @@ _smart_update_queue(Evas_Object *obj, Termio *sd) > > { > > if (sd->anim) return; > > sd->anim = ecore_animator_add(_smart_cb_change, obj); > > + if (sd->scrolio) > > + scrolio_miniview_update_scroll(sd->scrolio, termio_scroll_get(obj)); > > } > > > > static void > > @@ -1929,6 +1947,28 @@ _handle_shift(Evas_Event_Key_Down *ev, int by, > > Evas_Object *term, Termio *sd) > > } > > > > void > > +termio_miniview_hide(Evas_Object *obj) > > +{ > > + Termio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + scrolio_miniview_hide(sd->scrolio); > > + sd->scrolio = NULL; > > +} > > + > > +Evas_Object * > > +termio_miniview_show(Evas_Object *obj, int x, int y, int w, int h) > > +{ > > + Termio *sd = evas_object_smart_data_get(obj); > > + if (!sd) return; > > + > > + sd->scrolio = (Evas_Object *) scrolio_miniview_add(obj, sd->font.chw, > > sd->font.chh, > > + sd->pty, sd->pty->backscroll_num, > > + termio_scroll_get(obj), x, y, w, h); > > + return sd->scrolio; > > +} > > + > > +void > > _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj > > __UNUSED__, void *event) > > { > > Evas_Event_Key_Down *ev = event; > > @@ -1988,7 +2028,21 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, > > Evas_Object *obj __UNUSED__, > > evas_object_smart_callback_call(data, "tab,6", NULL); > > goto end; > > } > > +<<<<<<< HEAD > > else if (!strcmp(ev->keyname, "7")) > > +======= > > + else if (!strcmp(ev->keyname, "f")) > > + { > > + evas_object_smart_callback_call(data, "miniview,toggle", > > NULL); > > + goto end; > > + } > > + } > > + if ((evas_key_modifier_is_set(ev->modifiers, "Alt")) && > > + (!evas_key_modifier_is_set(ev->modifiers, "Shift")) && > > + (!evas_key_modifier_is_set(ev->modifiers, "Control"))) > > + { > > + if (!strcmp(ev->keyname, "Home")) > > +>>>>>>> add miniview feature to terminology. Pressing ctrl+shift+f > > toggles miniview on the side of each terminal/split/tab > > { > > _compose_seq_reset(sd); > > evas_object_smart_callback_call(data, "tab,7", NULL); > > @@ -3166,6 +3220,8 @@ _smart_cb_mouse_wheel(void *data, Evas *e > > __UNUSED__, Evas_Object *obj __UNUSED_ > > default: > > break; > > } > > + if (sd->scrolio) > > + scrolio_miniview_update_scroll(sd->scrolio, > > termio_scroll_get(obj)); > > } > > } > > > > @@ -3210,6 +3266,7 @@ _termio_config_set(Evas_Object *obj, Config *config) > > evas_object_textgrid_font_set(sd->grid.obj, sd->font.name, > > sd->font.size); > > evas_object_textgrid_size_set(sd->grid.obj, 1, 1); > > evas_object_textgrid_cell_size_get(sd->grid.obj, &w, &h); > > + > > if (w < 1) w = 1; > > if (h < 1) h = 1; > > sd->font.chw = w; > > @@ -3549,6 +3606,7 @@ static void > > _smart_calculate(Evas_Object *obj) > > { > > Termio *sd = evas_object_smart_data_get(obj); > > + Evas_Object *scr_obj; > > Evas_Coord ox, oy, ow, oh; > > > > if (!sd) return; > > @@ -3558,6 +3616,18 @@ _smart_calculate(Evas_Object *obj) > > evas_object_resize(sd->grid.obj, > > sd->grid.w * sd->font.chw, > > sd->grid.h * sd->font.chh); > > + > > + //evas_object_move(sd->scrolio.grid.obj, ox, oy); > > + //evas_object_resize(sd->scrolio.grid.obj, > > + // sd->grid.w * sd->font.chw, > > + // sd->grid.h * sd->font.chh); > > + > > + //scr_obj = scrolio_grid_object_get(sd->scrolio); > > + //evas_object_move(scr_obj, ox, oy); > > + //evas_object_resize(scr_obj, > > + // sd->grid.w * sd->font.chw, > > + // sd->grid.h * sd->font.chh); > > + > > evas_object_move(sd->cur.obj, > > ox + (sd->cur.x * sd->font.chw), > > oy + (sd->cur.y * sd->font.chh)); > > @@ -3571,6 +3641,8 @@ _smart_move(Evas_Object *obj, Evas_Coord x > > __UNUSED__, Evas_Coord y __UNUSED__) > > Termio *sd = evas_object_smart_data_get(obj); > > if (!sd) return; > > evas_object_smart_changed(obj); > > + if (sd->scrolio) > > + scrolio_miniview_move(sd->scrolio, x, y); > > } > > > > static void > > @@ -3617,6 +3689,7 @@ _smart_pty_scroll(void *data) > > { > > // adjust scroll position for added scrollback > > sd->scroll++; > > + ERR("scroll: %d", sd->scroll); > > if (sd->scroll > sd->pty->backscroll_num) > > sd->scroll = sd->pty->backscroll_num; > > changed = 1; > > @@ -3869,7 +3942,9 @@ _smart_pty_command(void *data) > > char *chid = strs->data; > > blk = termpty_block_chid_get(sd->pty, chid); > > if (blk) > > - _block_edje_cmds(sd->pty, blk, strs->next, > > EINA_FALSE); > > + { > > + _block_edje_cmds(sd->pty, blk, strs->next, > > EINA_FALSE); > > + } > > } > > EINA_LIST_FREE(strs, pp) free(pp); > > } > > @@ -4302,6 +4377,10 @@ termio_config_update(Evas_Object *obj) > > evas_object_scale_set(sd->grid.obj, elm_config_scale_get()); > > evas_object_textgrid_font_set(sd->grid.obj, sd->font.name, > > sd->font.size); > > evas_object_textgrid_cell_size_get(sd->grid.obj, &w, &h); > > + > > + //evas_object_scale_set(sd->scrolio.grid.obj, elm_config_scale_get()); > > + //evas_object_textgrid_font_set(sd->scrolio.grid.obj, sd->font.name, > > sd->font.size); > > + //evas_object_textgrid_cell_size_get(sd->scrolio.grid.obj, &w, &h); > > if (w < 1) w = 1; > > if (h < 1) h = 1; > > sd->font.chw = w; > > @@ -4380,6 +4459,14 @@ termio_scroll_get(Evas_Object *obj) > > return sd->scroll; > > } > > > > +void > > +termio_scroll_set(Evas_Object *obj, int scroll) > > +{ > > + Termio *sd = evas_object_smart_data_get(obj); > > + sd->scroll = scroll; > > + _smart_apply(obj); > > +} > > + > > pid_t > > termio_pid_get(const Evas_Object *obj) > > { > > diff --git a/src/bin/termio.h b/src/bin/termio.h > > index 485a311..4266dcb 100644 > > --- a/src/bin/termio.h > > +++ b/src/bin/termio.h > > @@ -29,6 +29,9 @@ Evas_Object *termio_win_get(Evas_Object *obj); > > Evas_Object *termio_mirror_add(Evas_Object *obj); > > const char *termio_title_get(Evas_Object *obj); > > const char *termio_icon_name_get(Evas_Object *obj); > > +<<<<<<< HEAD > > void termio_debugwhite_set(Evas_Object *obj, Eina_Bool dbg); > > > > +======= > > +>>>>>>> add miniview feature to terminology. Pressing ctrl+shift+f > > toggles miniview on the side of each terminal/split/tab > > #endif > > -- > > 1.7.12.4 > > > > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
