Beispiel #1
0
/**
 * Resizes the Edje to the size of our Ecore Evas
 *
 * @param ee
 */
static void cb_ee_resize(Ecore_Evas *ee) {
	Evas *evas = ecore_evas_get(ee);
	Evas_Object *edje = evas_object_name_find(evas, "main_edje");
	Evas_Object *dragger = evas_object_name_find(evas, "dragger");
	int w = 0, h = 0;

	ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
	evas_object_resize(edje, (Evas_Coord) w, (Evas_Coord) h);
	evas_object_resize(dragger, (Evas_Coord) w, (Evas_Coord) h);
}
Beispiel #2
0
/**
 * @param ee: The Ecore_Evas the event occurred on.
 * @brief: Ecore callback for the resising of the window.  This function
 *         resises the edje and esmart dragger according to the new
 *         window size.
 */
void
cc_resize(Ecore_Evas * ee)
{
	int             x, y, w, h;

	ecore_evas_geometry_get(ee, &x, &y, &w, &h);
	evas_object_resize(evas_object_name_find
			   (ecore_evas_get(ee), "edje"), w, h);
	evas_object_resize(evas_object_name_find(ecore_evas_get(ee), "dragger"),
			   w, h);
	return;
}
Beispiel #3
0
static void on_ecore_evas_resize(Ecore_Evas *ee)
{
    Evas_Object *webview;
    Evas_Object *bg;
    int w, h;

    ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);

    bg = evas_object_name_find(ecore_evas_get(ee), "bg");
    evas_object_move(bg, 0, 0);
    evas_object_resize(bg, w, h);

    webview = evas_object_name_find(ecore_evas_get(ee), "browser");
    evas_object_move(webview, 0, 0);
    evas_object_resize(webview, w, h);
}
static void destroyInspectorWindow(Ecore_Evas* inspectorWindow)
{
    Evas_Object* inspectorView = evas_object_name_find(ecore_evas_get(inspectorWindow), "inspector");
    if (inspectorView)
        evas_object_smart_callback_call(inspectorView, "inspector,view,close", 0);

    ecore_evas_free(inspectorWindow);
    inspectorWindow = nullptr;
}
Beispiel #5
0
static void
main_win_resize_handler(Ecore_Evas * main_win)
{
    Evas *canvas = ecore_evas_get(main_win);
    int w, h;
    evas_output_size_get(canvas, &w, &h);

    Evas_Object *main_edje = evas_object_name_find(canvas, "main-window");
    evas_object_resize(main_edje, w, h);
}
Beispiel #6
0
static void erss_window_move_tooltip (Ecore_Evas * ee)
{
	int x, y, w, h;
	Evas_Object *o = NULL;
	
	ecore_evas_geometry_get (ee, &x, &y, &w, &h);

	if((o = evas_object_name_find(ecore_evas_get(ee), "root_background")))
			esmart_trans_x11_freshen(o, x, y, w, h);
}
Beispiel #7
0
static void
window_resize_cb (Ecore_Evas * ee)
{
  int x, y, w, h;
  Evas_Object *o = NULL;

  ecore_evas_geometry_get (ee, &x, &y, &w, &h);
  if (refresh_timer)
    ecore_timer_del (refresh_timer);
  refresh_timer = ecore_timer_add (RESIZE_REFRESH, fix_bg, ee);

  if ((o = evas_object_name_find (ecore_evas_get (ee), "background")))
    evas_object_resize (o, w, h);
  if ((o = evas_object_name_find (ecore_evas_get (ee), "container")))
    evas_object_resize (o, w, h);
  if ((o = evas_object_name_find (ecore_evas_get (ee), "dragger")))
    evas_object_resize (o, w, h);
  if ((o = evas_object_name_find (ecore_evas_get (ee), "xpixmap")))
    evas_object_resize (o, w, h);
}
Beispiel #8
0
static void _init_gui(const madshelf_state_t* state)
{
    Evas_Object* choicebox = evas_object_name_find(state->canvas, "contents");

    _loc_t* _loc = (_loc_t*)state->loc;
    choicebox_set_size(choicebox, eina_array_count_get(_loc->files));
    choicebox_set_selection(choicebox, -1);

    choicebox_scroll_to(choicebox, _loc->old_pos == -1 ? 0 : _loc->old_pos);

    _loc->watcher = positions_update_subscribe(_positions_updated, (void*)state);
}
Beispiel #9
0
static void _update_gui(const madshelf_state_t* state)
{
    Evas_Object* choicebox = evas_object_name_find(state->canvas, "contents");
    Evas_Object* header = evas_object_name_find(state->canvas, "main_edje");

    _loc_t* _loc = (_loc_t*)state->loc;

    choicebox_set_size(choicebox, eina_array_count_get(_loc->files));
    choicebox_invalidate_interval(choicebox, 0, eina_array_count_get(_loc->files));

    madshelf_disk_t* d = find_disk(state->disks, _loc->dir);

    char *text = xasprintf("<fixed>%s:</fixed>%s",
                          d->short_name, _loc->dir + strlen(d->path));

    edje_object_part_text_set(header, "title", text);

    free(text);

    set_sort_icon(state, state->sort);
}
Beispiel #10
0
static void resizeInspectorWindow(Ecore_Evas* inspectorWindow)
{
    Evas_Object* inspectorView = evas_object_name_find(ecore_evas_get(inspectorWindow), "inspector");
    if (!inspectorView)
        return;

    int width, height;
    ecore_evas_geometry_get(inspectorWindow, 0, 0, &width, &height);

    evas_object_move(inspectorView, 0, 0);
    evas_object_resize(inspectorView, width, height);
}
Beispiel #11
0
static void
key_down(void *param, Evas * e, Evas_Object * o, void *event_info)
{
    Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *) event_info;
    Evas *canvas = evas_object_evas_get(o);
    Evas_Object *rr = evas_object_name_find(canvas, "main-window");

    if (!strcmp(ev->keyname, "Escape"))
        ecore_main_loop_quit();

    if (!strcmp(ev->keyname, "KP_0")) {
        battery_info_t info = {.status = FULL_CHARGE };
        eoi_draw_given_battery_info(&info, rr);
    } else if (!strcmp(ev->keyname, "KP_1")) {
Beispiel #12
0
static void _free(madshelf_state_t* state)
{
    _loc_t* _loc = (_loc_t*)state->loc;

    positions_update_unsubscribe(_loc->watcher);

    if(_loc->dir)
    {
        Evas_Object* choicebox = evas_object_name_find(state->canvas, "contents");
        if(choicebox)
        {
            int sel = choicebox_get_scroll_pos(choicebox);
            if(sel == -1 || sel >= eina_array_count_get(_loc->files))
                curdir_set(_loc->dir, NULL);
            else
            {
                char* filename = eina_array_data_get(_loc->files, sel);
                if(filename)
                {
                    char* c = strdup(filename);
                    if(c)
                    {
                        char* base = basename(c);
                        curdir_set(_loc->dir, base);
                        free(c);
                    }
                    else
                        curdir_set(_loc->dir, NULL);
                }
                else
                    curdir_set(_loc->dir, NULL);
            }
        }
        else
            curdir_set(_loc->dir, NULL);
    }

    close_file_context_menu(state->canvas, false);
    close_screen_context_menu(state->canvas);

    _free_files(_loc->files);

    free(_loc->dir);
    free(_loc);
}
Beispiel #13
0
static int
fix_bg (void *data)
{
  int x, y, w, h;
  Ecore_Evas *ee = NULL;
  Evas_Object *o = NULL;

  if ((ee = (Ecore_Evas *) data))
    {
      ecore_evas_geometry_get (ee, &x, &y, &w, &h);
      if ((o =
	   evas_object_name_find (ecore_evas_get (ee), "root_background")))
	{
	  evas_object_resize (o, w, h);
	  esmart_trans_x11_freshen (o, x, y, w, h);
	}
    }
  refresh_timer = NULL;
  return (0);
}
Beispiel #14
0
static void handle_screen_context_action(madshelf_state_t* state,
                                         int item_num,
                                         bool is_alt)
{
    _loc_t* _loc = (_loc_t*)state->loc;

    if (item_num == 4) {
        clipboard_paste(state, _loc->dir);
    }
    if(item_num == 3)
    {
        set_show_hidden(state, !state->show_hidden);
    }
    else
    {
        set_sort(state, (madshelf_sort_t)item_num);
    }

    Evas_Object* choicebox = evas_object_name_find(state->canvas, "contents");
    choicebox_scroll_to(choicebox, 0);
    _update_filelist_gui(state);
    close_screen_context_menu(state->canvas);
}
Beispiel #15
0
static Eina_Bool
_anim_cb(void *data)
{
   App_Data *ad = data;
   Evas_Map *m;
   Evas_Object *o;
   int r, g, b, a;
   int win_w, win_h, img_w, img_h;
   Evas_Coord x, y, w, h;

   evas_output_size_get(ad->canvas, &win_w, &win_h);

   m = evas_map_new(4);
   evas_map_smooth_set(m, ad->smooth);
   evas_map_alpha_set(m, ad->alpha);

   r = ad->colors[ad->colors_index].r;
   g = ad->colors[ad->colors_index].g;
   b = ad->colors[ad->colors_index].b;
   a = ad->colors[ad->colors_index].a;
   evas_map_util_points_color_set(m, r, g, b, a);

   o = evas_object_name_find(ad->canvas, "obj1");
   evas_object_geometry_get(o, &x, &y, &w, &h);

   evas_map_util_points_populate_from_object(m, o);
   evas_map_util_rotate(m, 3 * ad->frame, x + (w / 2), y + (h / 2));
   evas_object_map_set(o, m);
   evas_object_map_enable_set(o, EINA_TRUE);

   o = evas_object_name_find(ad->canvas, "obj2");
   evas_object_geometry_get(o, &x, &y, &w, &h);
   evas_object_image_size_get(o, &img_w, &img_h);

   evas_map_util_points_populate_from_object_full(m, o, 100);
   evas_map_point_image_uv_set(m, 0, 0, 0);
   evas_map_point_image_uv_set(m, 1, img_w, 0);
   evas_map_point_image_uv_set(m, 2, img_w, img_h);
   evas_map_point_image_uv_set(m, 3, 0, img_h);
   evas_map_util_3d_rotate(m, ad->frame * 6, ad->frame * 6, ad->frame * 6,
                           x + (w / 3), y + 10, 0);
   if (ad->apply_lighting)
     evas_map_util_3d_lighting(m, win_w / 2, win_h / 2, -100,
                               255, 255, 255, 0, 0, 0);
   evas_object_map_set(o, m);
   evas_object_map_enable_set(o, EINA_TRUE);

   o = evas_object_name_find(ad->canvas, "obj3");
   evas_object_geometry_get(o, &x, &y, &w, &h);
   evas_object_image_size_get(o, &img_w, &img_h);

   evas_map_util_points_populate_from_geometry(m, x, y + (h / 2), w, h, -20);
   evas_map_point_image_uv_set(m, 0, 0, 0);
   evas_map_point_image_uv_set(m, 1, img_w, 0);
   evas_map_point_image_uv_set(m, 2, img_w, img_h);
   evas_map_point_image_uv_set(m, 3, 0, img_h);
   evas_map_util_3d_rotate(m, 20, ad->frame * 6, 0,
                           x + (w / 2), y + (w / 2), w / 2);

   if (ad->apply_perspective)
     evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 256);
   if (ad->apply_lighting)
     {
        Evas_Coord mx, my;
        evas_pointer_canvas_xy_get(ad->canvas, &mx, &my);
        evas_map_util_3d_lighting(m, mx, my, -256,
                                  255, 255, 255, 0, 0, 0);
     }
   if (ad->backface_culling)
     {
        if (evas_map_util_clockwise_get(m))
          evas_object_show(o);
        else
          evas_object_hide(o);
     }
   else
     evas_object_show(o);
   evas_object_map_set(o, m);
   evas_object_map_enable_set(o, EINA_TRUE);

   evas_map_free(m);

   o = evas_object_name_find(ad->canvas, "obj4");
   evas_object_geometry_get(o, &x, &y, &w, &h);
   evas_object_image_size_get(o, &img_w, &img_h);

   m = evas_map_new(4);
   evas_map_point_coord_set(m, 0, x, y + h, 0);
   evas_map_point_coord_set(m, 1, x + w, y + h, 0);
   evas_map_point_coord_set(m, 2, win_w - 10, win_h - 30, 0);
   evas_map_point_coord_set(m, 3, (win_w / 2) + 10, win_h - 30, 0);
   evas_map_point_image_uv_set(m, 0, 0, img_h);
   evas_map_point_image_uv_set(m, 1, img_w, img_h);
   evas_map_point_image_uv_set(m, 2, img_w, 2 * (img_h / 3));
   evas_map_point_image_uv_set(m, 3, 0, 2 * (img_h / 3));
   evas_map_point_color_set(m, 0, 200, 200, 200, 150);
   evas_map_point_color_set(m, 1, 200, 200, 200, 150);
   evas_map_point_color_set(m, 2, 0, 0, 0, 0);
   evas_map_point_color_set(m, 3, 0, 0, 0, 0);
   evas_object_map_set(o, m);
   evas_object_map_enable_set(o, EINA_TRUE);

   evas_map_free(m);

   ad->frame = (ad->frame + 1) % 60;

   return EINA_TRUE;
}
Beispiel #16
0
static Eina_Bool
_anim_cb(void *data)
{
   App_Data *ad = data;
   Evas_Object *o;
   int r, g, b, a, x, y, w, h, f;
   int win_w, win_h, mx, my;

   f = ad->frame;
   r = ad->colors[ad->colors_index].r;
   g = ad->colors[ad->colors_index].g;
   b = ad->colors[ad->colors_index].b;
   a = ad->colors[ad->colors_index].a;
   evas_output_size_get(ad->canvas, &win_w, &win_h);

   o = evas_object_name_find(ad->canvas, "obj1");
   efl_gfx_map_reset(o);
   efl_gfx_map_rotate(o, 3 * f, NULL, 0.5, 0.5);
   efl_gfx_map_smooth_set(o, ad->smooth);
   efl_gfx_map_alpha_set(o, ad->alpha);
   efl_gfx_map_color_set(o, -1, r, g, b, a);


   o = evas_object_name_find(ad->canvas, "obj2");
   efl_gfx_size_get(o, NULL, &h);
   efl_gfx_map_reset(o);
   efl_gfx_map_smooth_set(o, ad->smooth);
   efl_gfx_map_alpha_set(o, ad->alpha);
   efl_gfx_map_color_set(o, -1, r, g, b, a);
   efl_gfx_map_translate(o, 0, 0, 100);
   efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / h, 0);
   if (ad->apply_lighting)
     {
        efl_gfx_map_lightning_3d(o, ad->canvas, 0.5, 0.5, -100.,
                                 255, 255, 255, 0, 0, 0);
     }


   o = evas_object_name_find(ad->canvas, "obj3");
   efl_gfx_size_get(o, &w, &h);
   efl_gfx_map_reset(o);
   efl_gfx_map_smooth_set(o, ad->smooth);
   efl_gfx_map_alpha_set(o, ad->alpha);
   efl_gfx_map_color_set(o, -1, r, g, b, a);
   efl_gfx_map_translate(o, 0, h/2, -20);
   efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, w / 2);
   if (ad->apply_perspective)
     efl_gfx_map_perspective_3d(o, NULL, 0.5, 0.5, 0, 256);
   if (ad->apply_lighting)
     {
        evas_pointer_canvas_xy_get(ad->canvas, &mx, &my);
        efl_gfx_map_lightning_3d(o, ad->canvas,
                                 (double) mx / win_w, (double) my / win_h,
                                 -256, 255, 255, 255, 0, 0, 0);
     }
   if (ad->backface_culling)
     efl_gfx_visible_set(o, efl_gfx_map_clockwise_get(o));
   else
     efl_gfx_visible_set(o, 1);


   o = evas_object_name_find(ad->canvas, "obj4");
   efl_gfx_geometry_get(o, &x, &y, &w, &h);
   efl_gfx_map_reset(o);
   efl_gfx_map_smooth_set(o, ad->smooth);
   efl_gfx_map_alpha_set(o, ad->alpha);
   efl_gfx_map_coord_absolute_set(o, 0, x, y + h, 0);
   efl_gfx_map_coord_absolute_set(o, 1, x + w, y + h, 0);
   efl_gfx_map_coord_absolute_set(o, 2, win_w - 10, win_h - 30, 0);
   efl_gfx_map_coord_absolute_set(o, 3, (win_w / 2) + 10, win_h - 30, 0);
   efl_gfx_map_uv_set(o, 0, 0, 1);
   efl_gfx_map_uv_set(o, 1, 1, 1);
   efl_gfx_map_uv_set(o, 2, 1, 2. / 3.);
   efl_gfx_map_uv_set(o, 3, 0, 2. / 3.);
   efl_gfx_map_color_set(o, 0, 200, 200, 200, 150);
   efl_gfx_map_color_set(o, 1, 200, 200, 200, 150);
   efl_gfx_map_color_set(o, 2, 0, 0, 0, 0);
   efl_gfx_map_color_set(o, 3, 0, 0, 0, 0);


   ad->frame = (ad->frame + 1) % 60;

   return EINA_TRUE;
}
Beispiel #17
0
             eoi_help_page_updated_t page_handler,
             eoi_help_closed_t closed)
{
    return _eoi_help_new(canvas, application, page_handler, closed,
                         NULL, NULL, NULL);
}

static void
_default_page_updated_handler(Evas_Object * help,
                              int cur_page,
                              int total_pages,
                              const char *header __attribute__ ((unused)),
                              void *param __attribute__ ((unused)))
{
    Evas *evas = evas_object_evas_get(help);
    Evas_Object *helpwin = evas_object_name_find(evas, HELP_WINDOW_ID);
    choicebox_aux_edje_footer_handler(helpwin, "footer", cur_page,
                                      total_pages);
}

static void
_help_resized(Ecore_Evas *win, Evas_Object *object, int w, int h, void *param)
{
    evas_object_resize(object, w, h);
    evas_object_raise(object); /* ? */
}

static void
_default_help_closed(Evas_Object * help)
{
    Evas *evas = evas_object_evas_get(help);