コード例 #1
0
PlatformWebView::~PlatformWebView()
{
    evas_object_del(m_view);

    ecore_evas_free(m_window);
    ecore_evas_shutdown();
}
コード例 #2
0
int
main(void)
{
   Ecore_Evas *ee;

   ecore_evas_init();

   ee = ecore_evas_new(NULL, 0, 0, 200, 100, NULL);
   ecore_evas_title_set(ee, "Ecore Evas Callbacks Example");
   ecore_evas_show(ee);

   //callbacks
   ecore_evas_callback_delete_request_set(ee, _delete);
   ecore_evas_callback_destroy_set(ee, _destroy);
   ecore_evas_callback_focus_in_set(ee, _focus_in);
   ecore_evas_callback_focus_out_set(ee, _focus_out);
   ecore_evas_callback_hide_set(ee, _hide);
   ecore_evas_callback_mouse_in_set(ee, _mouse_in);
   ecore_evas_callback_mouse_out_set(ee, _mouse_out);
   ecore_evas_callback_move_set(ee, _move);
   ecore_evas_callback_post_render_set(ee, _post_render);
   ecore_evas_callback_pre_free_set(ee, _pre_free);
   ecore_evas_callback_pre_render_set(ee, _pre_render);
   ecore_evas_callback_resize_set(ee, _resize);
   ecore_evas_callback_show_set (ee, _show);

   ecore_main_loop_begin();

   ecore_evas_free(ee);
   ecore_evas_shutdown();

   return 0;
}
コード例 #3
0
ファイル: edje_example.c プロジェクト: RomainNaour/efl
int main(int argc, char *argv[])
{
   Ecore_Evas *window;
   Evas *canvas;
   Evas_Object *edje;
   const char *text;

   ecore_evas_init();
   edje_init();

   window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   if (!window)
     {
        EINA_LOG_CRIT("could not create window.");
        return -1;
     }
   canvas = ecore_evas_get(window);

   text = (argc > 1) ? argv[1] : NULL;

   edje = create_my_group(canvas, text);
   if (!edje)
     return -2;

   ecore_evas_show(window);
   ecore_main_loop_begin();

   evas_object_del(edje);
   ecore_evas_free(window);

   edje_shutdown();
   ecore_evas_shutdown();

   return 0;
}
コード例 #4
0
ファイル: main.c プロジェクト: yang-bo/webkit
int main(int argc, char *argv[])
{
    const char *url;
    int args = 1;

    if (!ecore_evas_init())
        return EXIT_FAILURE;

    if (args < argc)
        url = argv[args];
    else
        url = DEFAULT_URL;

    MiniBrowser *browser = browserCreate(url);

    Ecore_Event_Handler *handle = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, 0);

    ecore_main_loop_begin();

    ecore_event_handler_del(handle);
    ecore_evas_free(browser->ee);
    free(browser);

    ecore_evas_shutdown();

    return 0;
}
コード例 #5
0
ファイル: elicit.c プロジェクト: rephorm/elicit
void
elicit_free(Elicit *el)
{
  elicit_magnify_stop(el);

  if (el->color)
    color_unref(el->color);

  if (el->obj.main)
    evas_object_del(el->obj.main);

  if (el->obj.shot)
    evas_object_del(el->obj.shot);

  if (el->obj.swatch)
    evas_object_del(el->obj.swatch);

  if (el->ee)
    ecore_evas_free(el->ee);

  if (el->band)
    elicit_band_free(el->band);

  if (el->palette)
    palette_free(el->palette);

  IF_FREE(el->conf.theme);
  IF_FREE(el->path.theme);
  IF_FREE(el->path.datadir);
  IF_FREE(el->path.confdir);
  IF_FREE(el->path.palette);
  IF_FREE(el->path.conffile);

  free(el);
}
コード例 #6
0
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;
}
コード例 #7
0
ファイル: tsuite_evas_hook.c プロジェクト: Limsik/e17
/**
 * @internal
 *
 * This function takes actual shot and saves it in PNG
 * @param data Tsuite_Data pointer initiated by user
 * @param obj  Window pointer
 * @param obj  name file name. Will use name_+serial if NULL
 *
 * @ingroup Tsuite
 */
void
tsuite_shot_do(char *name, Evas *e)
{
   if (!e)
     return;

   Ecore_Evas *ee, *ee_orig;
   Evas_Object *o;
   unsigned int *pixels;
   int w, h,dir_name_len = 0;
   char *filename;
   if (_hook_setting->dest_dir)
     dir_name_len = strlen(_hook_setting->dest_dir) + 1; /* includes space of a '/' */

   if (name)
     {
        filename = malloc(strlen(name) + strlen(IMAGE_FILENAME_EXT) +
              dir_name_len + 4);

        if (_hook_setting->dest_dir)
          sprintf(filename, "%s/", _hook_setting->dest_dir);

        sprintf(filename + dir_name_len, "%s%s", name, IMAGE_FILENAME_EXT);
     }
   else
     {
        filename = malloc(strlen(_hook_setting->test_name) + strlen(IMAGE_FILENAME_EXT) +
              dir_name_len + 8); /* also space for serial */

        ts.serial++;
        if (_hook_setting->dest_dir)
          sprintf(filename, "%s/", _hook_setting->dest_dir);

        sprintf(filename + dir_name_len, "%s_%d%s", _hook_setting->test_name,
              ts.serial, IMAGE_FILENAME_EXT);
     }

   ee_orig = ecore_evas_ecore_evas_get(e);

   ecore_evas_manual_render(ee_orig);
   pixels = (void *)ecore_evas_buffer_pixels_get(ee_orig);
   if (!pixels) return;
   ecore_evas_geometry_get(ee_orig, NULL, NULL, &w, &h);
   if ((w < 1) || (h < 1)) return;
   ee = ecore_evas_buffer_new(1, 1);
   o = evas_object_image_add(ecore_evas_get(ee));
   evas_object_image_alpha_set(o, ecore_evas_alpha_get(ee_orig));
   evas_object_image_size_set(o, w, h);
   evas_object_image_data_set(o, pixels);

   if (!evas_object_image_save(o, filename, NULL, NULL))
     {
        printf("Cannot save widget to <%s>\n", filename);
     }
   ecore_evas_free(ee);
   free(filename);
}
コード例 #8
0
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
   Evas_Object *o, *of, *ob;
   Ecore_Evas *ee;

#ifndef HAVE_WAYLAND_ONLY
   Ecore_X_Window_Attributes att;

   if (!ecore_x_composite_query()) return 0;
   if (!ecore_x_damage_query()) return 0;

   memset((&att), 0, sizeof(Ecore_X_Window_Attributes));
   ecore_x_window_attributes_get(ecore_x_window_root_first_get(), &att);
   if ((att.depth <= 8)) return 0;

   gl_avail = ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11);
#endif

   o = e_widget_list_add(pg->evas, 1, 0);
   e_wizard_title_set(_("Compositing"));


   of = e_widget_framelist_add(pg->evas, _("Settings"), 0);
   if (gl_avail)
     {
        ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 320, 240);
        if (ee)
          {
             ecore_evas_free(ee);
             if (
               (match_xorg_log("*(II)*NVIDIA*: Creating default Display*")) ||
               (match_xorg_log("*(II)*intel*: Creating default Display*")) ||
               (match_xorg_log("*(II)*NOUVEAU*: Creating default Display*")) ||
               (match_xorg_log("*(II)*RADEON*: Creating default Display*"))
               )
               {
                  do_gl = 1;
                  do_vsync = 1;
               }
          }
        ob = e_widget_check_add(pg->evas, _("Hardware Accelerated (OpenGL)"), &(do_gl));
        e_widget_framelist_object_append(of, ob);

        ob = e_widget_check_add(pg->evas, _("Tear-free Rendering (OpenGL only)"), &(do_vsync));
        e_widget_framelist_object_append(of, ob);
     }
   ob = e_widget_check_add(pg->evas, _("Disable composite effects"), &(disable_effects));
   e_widget_framelist_object_append(of, ob);

   e_widget_list_object_append(o, of, 0, 0, 0.5);
   evas_object_show(of);
   e_wizard_page_show(o);

   return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
コード例 #9
0
ファイル: band.c プロジェクト: Elive/elicit
void
elicit_band_free(Elicit_Band *band)
{
  if (band->obj)
    evas_object_del(band->obj);

  if (band->ee)
    ecore_evas_free(band->ee);

  free(band);
}
コード例 #10
0
void WebInspectorProxy::platformDidClose()
{
    if (m_inspectorView) {
        evas_object_del(m_inspectorView);
        m_inspectorView = 0;
    }

    if (m_inspectorWindow) {
        ecore_evas_free(m_inspectorWindow);
        m_inspectorWindow = 0;
    }
}
コード例 #11
0
int
main(void)
{
   Evas *canvas;
   Evas_Object *bg, *r1, *r2, *r3;

   ecore_evas_init();

   ee = ecore_evas_buffer_new(WIDTH, HEIGHT);
   if (!ee) goto error;

   canvas = ecore_evas_get(ee);

   bg = evas_object_rectangle_add(canvas);
   evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
   evas_object_move(bg, 0, 0); /* at origin */
   evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
   evas_object_show(bg);

   r1 = evas_object_rectangle_add(canvas);
   evas_object_color_set(r1, 255, 0, 0, 255); /* 100% opaque red */
   evas_object_move(r1, 10, 10);
   evas_object_resize(r1, 100, 100);
   evas_object_show(r1);

   r2 = evas_object_rectangle_add(canvas);
   evas_object_color_set(r2, 0, 128, 0, 128); /* 50% opaque green */
   evas_object_move(r2, 10, 10);
   evas_object_resize(r2, 50, 50);
   evas_object_show(r2);

   r3 = evas_object_rectangle_add(canvas);
   evas_object_color_set(r3, 0, 128, 0, 255); /* 100% opaque dark green */
   evas_object_move(r3, 60, 60);
   evas_object_resize(r3, 50, 50);
   evas_object_show(r3);

   ecore_evas_manual_render(ee);
   _scene_save(canvas, "/tmp/evas-buffer-simple-render.ppm");

   ecore_evas_free(ee);
   ecore_evas_shutdown();

   return 0;

error:
   fprintf(stderr, "error: Requires at least one Evas engine built"
                   " and linked to ecore-evas for this example to run"
                   " properly.\n");
   ecore_evas_shutdown();
   return -1;
}
コード例 #12
0
ファイル: test.c プロジェクト: ixdu/caravan
static void destroy_canvas(Ecore_Evas *canvas)
{
   Evas_Engine_Info_Buffer *einfo;

   //einfo = (Evas_Engine_Info_Buffer *)ecore_evas_engine_info_get(canvas);
   //if (!einfo)
   //  {
   //     fputs("ERROR: could not get evas engine info!\n", stderr);
   //     ecore_evas_free(canvas);
   //     return;
   //  }

   free(einfo->info.dest_buffer);
   ecore_evas_free(canvas);
}
コード例 #13
0
ファイル: ecore_evas_basics_example.c プロジェクト: jigpu/efl
int
main(void)
{
   Ecore_Evas *ee;
   Evas *canvas;
   Evas_Object *bg;
   Eina_List *engines, *l;
   char *data;

   if (ecore_evas_init() <= 0)
     return 1;

   engines = ecore_evas_engines_get();
   printf("Available engines:\n");
   EINA_LIST_FOREACH(engines, l, data)
     printf("%s\n", data);
   ecore_evas_engines_free(engines);

   ee = ecore_evas_new(NULL, 0, 0, 200, 200, NULL);
   ecore_evas_title_set(ee, "Ecore Evas basics Example");
   ecore_evas_show(ee);

   data = malloc(sizeof(char) * 6);
   sprintf(data, "%s", "hello");
   ecore_evas_data_set(ee, "key", data);
   ecore_evas_callback_delete_request_set(ee, _on_delete);

   printf("Using %s engine!\n", ecore_evas_engine_name_get(ee));

   canvas = ecore_evas_get(ee);
   if (ecore_evas_ecore_evas_get(canvas) == ee)
     printf("Everything is sane!\n");

   bg = evas_object_rectangle_add(canvas);
   evas_object_color_set(bg, 0, 0, 255, 255);
   evas_object_resize(bg, 200, 200);
   evas_object_show(bg);
   ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);

   ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _stdin_cb, NULL, NULL, NULL);

   ecore_main_loop_begin();

   ecore_evas_free(ee);
   ecore_evas_shutdown();

   return 0;
}
コード例 #14
0
int main(int argc, char *argv[])
{
    const char *url;
    int args = 1;
    char *engine = NULL;
    unsigned char quitOption = 0;

    Ecore_Getopt_Value values[] = {
        ECORE_GETOPT_VALUE_STR(engine),
        ECORE_GETOPT_VALUE_BOOL(quitOption),
        ECORE_GETOPT_VALUE_BOOL(quitOption),
        ECORE_GETOPT_VALUE_BOOL(quitOption),
        ECORE_GETOPT_VALUE_BOOL(quitOption),
        ECORE_GETOPT_VALUE_NONE
    };

    if (!ewk_init())
        return EXIT_FAILURE;

    ecore_app_args_set(argc, (const char **) argv);
    args = ecore_getopt_parse(&options, values, argc, argv);

    if (args < 0)
        return quit(EINA_FALSE, "ERROR: could not parse options.\n");

    if (quitOption)
        return quit(EINA_TRUE, NULL);

    if (args < argc)
        url = argv[args];
    else
        url = DEFAULT_URL;

    MiniBrowser *browser = browserCreate(url, engine);
    if (!browser)
        return quit(EINA_FALSE, "ERROR: could not create browser.\n");

    Ecore_Event_Handler *handle = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, 0);

    ecore_main_loop_begin();

    ecore_event_handler_del(handle);
    ecore_evas_free(browser->ee);
    free(browser);

    return quit(EINA_TRUE, NULL);
}
コード例 #15
0
ファイル: e_popup.c プロジェクト: tizenorg/framework.uifw.e17
static void
_e_popup_free(E_Popup *pop)
{
   if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
   pop->idle_enterer = NULL;
   E_FREE(pop->shape_rects);
   pop->shape_rects_num = 0;
   e_container_shape_hide(pop->shape);
   e_object_del(E_OBJECT(pop->shape));
   e_canvas_del(pop->ecore_evas);
   ecore_evas_free(pop->ecore_evas);
   e_object_unref(E_OBJECT(pop->zone));
   pop->zone->popups = eina_list_remove(pop->zone->popups, pop);
   _e_popup_list = eina_list_remove(_e_popup_list, pop);
   eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop);
   if (pop->name) eina_stringshare_del(pop->name);
   free(pop);
}
コード例 #16
0
ファイル: eclair_menu.c プロジェクト: playya/Enlightenment
//Create a new menu
//The parent menu will have to be destroyed by eclair_menu_free
//Return NULL if failed
Eclair_Menu *eclair_menu_new(Eclair_Engine menu_engine)
{
   Eclair_Menu *menu;
   Ecore_X_Window_State window_states[2];

   menu = calloc(1, sizeof(Eclair_Menu));
   menu->engine = menu_engine;

   if (menu_engine == ECLAIR_GL)
   {
      menu->window = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
      menu->x_window = ecore_evas_gl_x11_window_get(menu->window);
   }
   else
   {
      menu->window = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
      menu->x_window = ecore_evas_software_x11_window_get(menu->window);
   }
   
   ecore_evas_title_set(menu->window, "eclair menu");
   ecore_evas_name_class_set(menu->window, "eclair", "Eclair");
   window_states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
   window_states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
   ecore_x_netwm_window_state_set(menu->x_window, window_states, 2);
   ecore_evas_borderless_set(menu->window, 1);

   menu->evas = ecore_evas_get(menu->window);
   menu->edje_object = edje_object_add(menu->evas);
   if (!edje_object_file_set(menu->edje_object, ECLAIR_WIDGETS_THEME, "eclair_menu"))
   {
      evas_object_del(menu->edje_object);
      ecore_evas_free(menu->window);
      free(menu);
      return NULL;
   }
   evas_object_move(menu->edje_object, 0, 0);
   evas_object_show(menu->edje_object);
   ecore_evas_data_set(menu->window, "eclair_menu", menu);
   ecore_evas_callback_resize_set(menu->window, _eclair_menu_resize_cb);
   ecore_evas_hide(menu->window);

   return menu;
}
コード例 #17
0
ファイル: teste_2.c プロジェクト: lucinama/Enlightenment
int main(int argv)
{
  Ecore_Evas *ee;
  Evas *canvas;
  Evas_Object *edje;
  ecore_evas_init();
  edje_init();
  ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);

  canvas = ecore_evas_get(ee);
  edje = teste(canvas);

  if (!edje)
    return -2;
  ecore_evas_show(ee);
  ecore_main_loop_begin();
  evas_object_del(edje);
  ecore_evas_free(ee);
  edje_shutdown();
  ecore_evas_shutdown();
  return 0;
}
コード例 #18
0
int
main(void)
{
   Ecore_Evas *ee;
   Evas_Object *bg, *cursor, *obj;
   int layer, x, y;

   ecore_evas_init();

   ee = ecore_evas_new(NULL, 0, 0, 200, 200, NULL);
   ecore_evas_title_set(ee, "Ecore Evas Object Example");
   ecore_evas_show(ee);

   bg = evas_object_rectangle_add(ecore_evas_get(ee));
   evas_object_color_set(bg, 0, 0, 255, 255);
   evas_object_resize(bg, 200, 200);
   evas_object_show(bg);
   ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);

   if (bg == ecore_evas_object_associate_get(ee))
     printf("Association worked!\n");

   cursor = evas_object_rectangle_add(ecore_evas_get(ee));
   evas_object_color_set(cursor, 0, 255, 0, 255);
   evas_object_resize(cursor, 5, 10);
   ecore_evas_object_cursor_set(ee, cursor, 0, 1, 1);

   ecore_evas_cursor_get(ee, &obj, &layer, &x, &y);
   if (obj == cursor && layer == 0 && x == 1 && y == 1)
     printf("Set cursor worked!\n");

   ecore_main_loop_begin();

   ecore_evas_free(ee);
   ecore_evas_shutdown();

   return 0;
}
コード例 #19
0
ファイル: tooltip.c プロジェクト: playya/Enlightenment
void erss_tooltip_free(Erss_Article *item) {
    Erss_Tooltip *tt;

    /* get rid of our callbacks */
    evas_object_event_callback_del (item->obj,
				    EVAS_CALLBACK_MOUSE_IN, erss_tooltip_mouse_in);
    tt = evas_object_event_callback_del (item->obj,
				    EVAS_CALLBACK_MOUSE_OUT, erss_tooltip_mouse_out);
    if (tt==NULL) {
	return;
    }
    evas_object_event_callback_del (tt->etox,
				    EVAS_CALLBACK_MOUSE_UP, erss_tooltip_mouse_clicked);
    evas_object_event_callback_del (tt->bg,
				    EVAS_CALLBACK_MOUSE_UP, erss_tooltip_mouse_clicked);

    /* then lose the ecore_evas */
    ecore_evas_free(tt->ee);
    ecore_x_window_free(tt->win);
    /* finally free the damn thing */
    memset(tt,0,sizeof(Erss_Tooltip));
    free(tt);
}
コード例 #20
0
ファイル: eclair_menu.c プロジェクト: playya/Enlightenment
//Free the menu and its children
void eclair_menu_free(Eclair_Menu *menu)
{
   Eina_List *l;
   Eclair_Menu_Item *item;

   if (!menu)
      return;

   eclair_menu_pop_down(menu);
   for (l = menu->items; l; l = l->next)
   {
      if ((item = l->data))
      {
         item->parent = NULL;
         eclair_menu_item_free(item);
      }
   }
   eina_list_free(menu->items);

   evas_object_del(menu->edje_object);
   ecore_evas_free(menu->window);
   free(menu);
}
コード例 #21
0
ファイル: shell.c プロジェクト: playya/Enlightenment
void
shell_shutdown(void)
{
	E_DB_FLUSH;

	serv_put_string(DUP("__exit"));
	usleep(10000);
	gui_apply();
	alias_shutdown();
	cl_shutdown();
	menu_shutdown();
	panel_shutdown();
	drawing_free();

	if((long)shell->title_dcd != -1L)
		iconv_close(shell->title_dcd);

	if((long)shell->dcd != -1L)
		iconv_close(shell->dcd);


	ecore_evas_free(shell->ee);

	IF_FREE(shell->title);
	IF_FREE(shell->rcfile);
	IF_FREE(shell->menu_file);
	IF_FREE(shell->icons_file);
	IF_FREE(shell->dim_styles_file);
	IF_FREE(shell->text_styles_file);
	IF_FREE(shell->line_styles_file);
	IF_FREE(shell->point_styles_file);
	IF_FREE(shell->hatch_styles_file);
	IF_FREE(shell->home);
	IF_FREE(shell->aliases);

}
コード例 #22
0
ファイル: epsilon_thumbnailer.c プロジェクト: Limsik/e17
Epsilon_Image *
epsilon_generate_thumb (Epsilon * e)
{
   Epsilon_Image *dst = NULL;
   Ecore_Evas    *ee;
   Evas          *evas;
   Evas_Object   *o;
   Edvi_Device   *device;
   Edvi_Property *property;
   Edvi_Document *document;
   Edvi_Page     *page;
   int            width;
   int            height;
   const int     *pixels;
   char          *param_kpathsea_mode  = "cx";

   if (!edvi_init (300, param_kpathsea_mode, 4,
                   1.0, 1.0,
                   0, 255, 255, 255, 0, 0, 0))
    return NULL;

   device = edvi_device_new (edvi_dpi_get (), edvi_dpi_get ());
   if (!device)
     goto no_device;

   property = edvi_property_new ();
   if (!property)
     goto no_property;

   edvi_property_property_set (property, EDVI_PROPERTY_DELAYED_FONT_OPEN);

   document = edvi_document_new (e->src, device, property);
   if (!document)
     goto no_document;
   page = edvi_page_new (document);
   if (!page)
     goto no_page;
   edvi_page_page_set (page, 0);
   edvi_page_size_get (page, &width, &height);

   ee = ecore_evas_buffer_new(width, height);
   evas = ecore_evas_get(ee);

   o = evas_object_image_add (evas);
   evas_object_move (o, 0, 0);
   edvi_page_render (page, device, o);
   evas_object_show (o);

   dst = calloc(1, sizeof(Epsilon_Image));
   if (!dst)
     goto no_dst;

   dst->w = width;
   dst->h = height;
   dst->alpha = 1;
   dst->data = malloc(dst->w * dst->h * sizeof(int));
   if (!dst->data)
     goto no_dst_data;

   pixels = ecore_evas_buffer_pixels_get (ee);
   memcpy(dst->data, pixels, dst->w * dst->h * sizeof(int));

   edvi_page_delete (page);
   edvi_document_delete (document);
   edvi_property_delete (property);
   edvi_device_delete (device);
   edvi_shutdown ();

   ecore_evas_free(ee);
   edvi_page_delete (page);
   edvi_document_delete (document);
   edvi_property_delete (property);
   edvi_device_delete (device);
   edvi_shutdown ();

   return dst;

 no_dst_data:
   free(dst);
 no_dst:
   edvi_page_delete (page);
 no_page:
   edvi_document_delete (document);
 no_document:
   edvi_property_delete (property);
 no_property:
   edvi_device_delete (device);
 no_device:
   edvi_shutdown ();
   return NULL;
}
コード例 #23
0
void EWK2UnitTestBase::TearDown()
{
    evas_object_del(m_webView);
    ecore_evas_free(m_ecoreEvas);
}
コード例 #24
0
ファイル: edje-codegen-example.c プロジェクト: Limsik/e17
int
main(int argc, char *argv[])
{
   char         edje_file_path[PATH_MAX];
   const char  *edje_file = "codegen.edj";
   Ecore_Evas  *ee;
   Evas        *evas;
   Evas_Object *bg;
   Evas_Object *edje_obj;
   Evas_Object *red_rect;
   Eina_Prefix *pfx;

   if (!ecore_evas_init())
     return EXIT_FAILURE;

   if (!edje_init())
     goto shutdown_ecore_evas;

   pfx = eina_prefix_new(argv[0], main,
                         "EDJE_EXAMPLES",
                         "edje/examples",
                         edje_file,
                         PACKAGE_BIN_DIR,
                         PACKAGE_LIB_DIR,
                         PACKAGE_DATA_DIR,
                         PACKAGE_DATA_DIR);
   if (!pfx)
     goto shutdown_edje;

   /* this will give you a window with an Evas canvas under the first
    * engine available */
   ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   if (!ee)
     goto free_prefix;

   ecore_evas_callback_delete_request_set(ee, _on_delete);
   ecore_evas_title_set(ee, "Edje text Example");

   evas = ecore_evas_get(ee);

   bg = evas_object_rectangle_add(evas);
   evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
   evas_object_move(bg, 0, 0); /* at canvas' origin */
   evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
   evas_object_show(bg);
   ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);

   edje_obj = codegen_example_object_add(evas, NULL);
   evas_object_move(edje_obj, 20, 20);
   evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
   evas_object_show(edje_obj);

   codegen_example_part_one_set(edje_obj, "CODEGEN_EXAMPLE");
   codegen_example_part_below_over_callback_add(edje_obj, _on_mouse_over, NULL);

   red_rect = evas_object_rectangle_add(evas);
   evas_object_color_set(red_rect, 255, 0, 0, 255); /* white bg */
   codegen_example_part_two_set(edje_obj, red_rect);
   evas_object_show(red_rect);

   ecore_evas_show(ee);

   ecore_main_loop_begin();

   eina_prefix_free(pfx);
   ecore_evas_free(ee);
   ecore_evas_shutdown();
   edje_shutdown();

   return EXIT_SUCCESS;

 free_prefix:
   eina_prefix_free(pfx);
 shutdown_edje:
   edje_shutdown();
 shutdown_ecore_evas:
   ecore_evas_shutdown();

   return EXIT_FAILURE;
}
コード例 #25
0
ファイル: main.c プロジェクト: Naruto/play_emotion
int main(int argc, char** argv) {
  Eina_Bool ret;
  Ecore_Evas *ecore_evas;
  Evas *evas;
  Evas_Object *bg, *video;
  Evas_Map *m;

  if(argc != 2) {
    fprintf(stderr, "Usage: %s moviefile\n", argv[0]);
    return 1;
  }

  ecore_init();
  ecore_evas_init();
  emotion_init();

  ecore_evas = ecore_evas_new
    ("software_x11", 300, 200, WINDOW_WIDTH, WINDOW_HEIGHT, NULL);
   if (!ecore_evas)
     goto end;

  ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
  // ecore_evas_callback_resize_set(ecore_evas, main_resize);
  ecore_evas_title_set(ecore_evas, "Evas Media Test Program");
  // ecore_evas_name_class_set(ecore_evas, "evas_media_test", "main");
  ecore_evas_show(ecore_evas);

  evas = ecore_evas_get(ecore_evas);

  bg = evas_object_rectangle_add(evas);
  evas_object_color_set(bg, 0x00, 0x00, 0x00, 0xff);
  evas_object_move(bg, 0, 0);
  evas_object_resize(bg, WINDOW_WIDTH, WINDOW_HEIGHT);
  evas_object_show(bg);

  video = emotion_object_add(evas);
  evas_object_move(video, 0, 0);
  evas_object_resize(video, WINDOW_WIDTH, WINDOW_HEIGHT);

  ret = emotion_object_init(video, "gstreamer");
  if(ret != EINA_TRUE) {
    fprintf(stderr, "faild to emotion_object_init\n");
    goto end;
  }
  ret = emotion_object_file_set(video, argv[1]);
  if(ret != EINA_TRUE) {
    fprintf(stderr, "emotion_object_file_set\n");
    goto end;
  }
  emotion_object_play_set(video, EINA_TRUE);
  evas_object_show(video);

  m = evas_map_new(4);
  evas_map_util_points_populate_from_object(m, video);
  // 2d rotate
  // evas_map_util_rotate(m, 90, 0 + (WINDOW_WIDTH/2), 0 + (WINDOW_HEIGHT/2));
  // 3d rotate
  //evas_map_util_3d_rotate(m, 10.0, 10.0, 0.0, 0, 0, 0);
  evas_object_map_set(video, m);
  evas_object_map_enable_set(video, EINA_TRUE);

  ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_cb, video);

  ecore_main_loop_begin();

 end:
  if(ecore_evas)
    ecore_evas_free(ecore_evas);

  evas_map_free(m);
  emotion_shutdown();
  ecore_evas_shutdown();
  ecore_shutdown();

  return 0;
}
コード例 #26
0
void deleteOwnedPtr(Ecore_Evas* ptr)
{
    if (ptr)
        ecore_evas_free(ptr);
}
コード例 #27
0
/* external functions */
EAPI Ecore_Evas *
ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
                                    int x, int y, int w, int h, Eina_Bool frame)
{
    Ecore_Wl_Window *p = NULL;
    Evas_Engine_Info_Wayland_Egl *einfo;
    Ecore_Evas_Interface_Wayland *iface;
    Ecore_Evas_Engine_Wl_Data *wdata;
    Ecore_Evas *ee;
    int method = 0, count = 0;

    LOGFN(__FILE__, __LINE__, __FUNCTION__);

    if (!(method = evas_render_method_lookup("wayland_egl")))
    {
        ERR("Render method lookup failed for Wayland_Egl");
        return NULL;
    }

    count = ecore_wl_init(disp_name);
    if (!count)
    {
        ERR("Failed to initialize Ecore_Wayland");
        return NULL;
    }
    else if (count == 1)
        ecore_wl_display_iterate();

    if (!(ee = calloc(1, sizeof(Ecore_Evas))))
    {
        ERR("Failed to allocate Ecore_Evas");
        goto ee_err;
    }

    if (!(wdata = calloc(1, sizeof(Ecore_Evas_Engine_Wl_Data))))
    {
        ERR("Failed to allocate Ecore_Evas_Engine_Wl_Data");
        free(ee);
        goto ee_err;
    }

    ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);

    _ecore_evas_wl_common_init();

    ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
    ee->engine.data = wdata;

    iface = _ecore_evas_wl_interface_new();
    ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);

    ee->driver = "wayland_egl";
    if (disp_name) ee->name = strdup(disp_name);

    if (w < 1) w = 1;
    if (h < 1) h = 1;

    ee->x = x;
    ee->y = y;
    ee->w = w;
    ee->h = h;
    ee->req.x = ee->x;
    ee->req.y = ee->y;
    ee->req.w = ee->w;
    ee->req.h = ee->h;
    ee->rotation = 0;
    ee->prop.max.w = 32767;
    ee->prop.max.h = 32767;
    ee->prop.layer = 4;
    ee->prop.request_pos = 0;
    ee->prop.sticky = 0;
    ee->prop.draw_frame = frame;
    ee->alpha = EINA_FALSE;

    ee->evas = evas_new();
    evas_data_attach_set(ee->evas, ee);
    evas_output_method_set(ee->evas, method);
    evas_output_size_set(ee->evas, ee->w, ee->h);
    evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);

    /* FIXME: This needs to be set based on theme & scale */
    if (ee->prop.draw_frame)
        evas_output_framespace_set(ee->evas, 4, 18, 8, 22);

    if (parent)
        p = ecore_wl_window_find(parent);

    /* FIXME: Get if parent is alpha, and set */

    wdata->parent = p;
    wdata->win =
        ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
    ee->prop.window = wdata->win->id;

    if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
    {
        einfo->info.display = ecore_wl_display_get();
        einfo->info.destination_alpha = ee->alpha;
        einfo->info.rotation = ee->rotation;
        einfo->info.depth = 32;
        if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
        {
            ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
            goto err;
        }
    }
    else
    {
        ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
        goto err;
    }

    ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_common_pre_free);

    if (ee->prop.draw_frame)
    {
        wdata->frame = _ecore_evas_wl_common_frame_add(ee->evas);
        evas_object_is_frame_object_set(wdata->frame, EINA_TRUE);
        evas_object_move(wdata->frame, 0, 0);
    }

    _ecore_evas_register(ee);
    ecore_evas_input_event_register(ee);

    ecore_event_window_register(ee->prop.window, ee, ee->evas,
                                (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
                                (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
                                (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
                                (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);

    return ee;

err:
    ecore_evas_free(ee);
    _ecore_evas_wl_common_shutdown();

ee_err:
    ecore_wl_shutdown();
    return NULL;
}
コード例 #28
0
ファイル: evas_image_3.c プロジェクト: lucinama/Enlightenment
int main(void)
{
  if(!ecore_evas_init())
    return EXIT_FAILURE;

  Ecore_Evas *e_e;
  Evas *e_evas;
  Evas_Object *e_ret, *img_1, *img_clip, *cute_1, *cute_2, *cute_mini_1, *cute_mini_2, *cute_mini_clip_1, *cute_mini_clip_2;

  e_e = ecore_evas_new(NULL,0,0,1600,1000,NULL);
  if (!e_e) return EXIT_FAILURE;

  ecore_evas_show(e_e);
  e_evas = ecore_evas_get(e_e);
  if (!e_evas) return EXIT_FAILURE;

  e_ret = evas_object_rectangle_add(e_evas);
  if (!e_ret) return EXIT_FAILURE;
  evas_object_color_set(e_ret,0,155,255,255);
  evas_object_move(e_ret,0,0);
  evas_object_resize(e_ret,1600,1000);
  evas_object_show(e_ret);

  cute_1 = evas_object_image_add(e_evas);
  evas_object_image_file_set(cute_1,"/home/luciana/Public/Enlightenment/cute_cat.jpeg",NULL);
  evas_object_move(cute_1,0,0);
  evas_object_resize(cute_1,640,400);
  evas_object_image_fill_set(cute_1,0,0,640,400);
  evas_object_show(cute_1);
 
  cute_2 = evas_object_image_add(e_evas);
  evas_object_image_file_set(cute_2,"/home/luciana/Public/Enlightenment/cute_cat.jpeg",NULL);
  evas_object_move(cute_2,960,600);
  evas_object_resize(cute_2,640,400);
  evas_object_image_fill_set(cute_2,0,0,640,400);
  evas_object_show(cute_2); 
  

  cute_mini_1 = evas_object_image_add(e_evas);
  evas_object_image_file_set(cute_mini_1,"/home/luciana/Public/Enlightenment/cute_cat.jpeg",NULL);
  evas_object_move(cute_mini_1,640,400);
  evas_object_resize(cute_mini_1,640,400);
  evas_object_image_fill_set(cute_mini_1,0,0,320,200);
  evas_object_resize(cute_mini_1,320,200);
  evas_object_show(cute_mini_1);

  cute_mini_2 = evas_object_image_add(e_evas);
  evas_object_image_file_set(cute_mini_2,"/home/luciana/Public/Enlightenment/cute_cat.jpeg",NULL);
  evas_object_move(cute_mini_2,640,400);
  evas_object_resize(cute_mini_2,640,400);
  evas_object_image_fill_set(cute_mini_2,0,0,320,200);
  evas_object_resize(cute_mini_2,320,200);
  evas_object_show(cute_mini_2);
    
  Evas_Load_Error err;
  if( (err = evas_object_image_load_error_get(img_1)) != EVAS_LOAD_ERROR_NONE)
    {
      fprintf(stderr, "error: %s\n", evas_load_error_str(err));
      exit(EXIT_FAILURE);
    }

  /* cute_mini_alpha = evas_object_rectangle_add(e_evas); */
  /* evas_object_color_set(cute_mini_alpha,255,255,255,155); */
  /* evas_object_move(cute_mini_alpha,6400,400); */
  /* evas_object_resize(cute_mini_alpha,320,200); */
  /* evas_object_clip_set(cute_mini,cute_mini_alpha); */
  /* evas_object_show(cute_mini_alpha); */
  
  cute_mini_clip_1 = evas_object_rectangle_add(e_evas);
  evas_object_color_set(cute_mini_clip_1,255,255,255,255);
  evas_object_move(cute_mini_clip_1,640,400);
  evas_object_resize(cute_mini_clip_1,160,100);
  evas_object_clip_set(cute_mini_1,cute_mini_clip_1);
  evas_object_show(cute_mini_clip_1);

  cute_mini_clip_2 = evas_object_rectangle_add(e_evas);
  evas_object_color_set(cute_mini_clip_2,255,255,255,255);
  evas_object_move(cute_mini_clip_2,800,500);
  evas_object_resize(cute_mini_clip_2,160,100);
  evas_object_clip_set(cute_mini_2,cute_mini_clip_2);
  evas_object_show(cute_mini_clip_2);

  ecore_main_loop_begin();

  ecore_evas_free(e_e);
  ecore_evas_shutdown();
  return 0;
}
コード例 #29
0
ファイル: emotion_signals_example.c プロジェクト: Limsik/e17
int
main(int argc, const char *argv[])
{
   Ecore_Evas *ee;
   Evas *e;
   Evas_Object *bg, *em;
   const char *filename = NULL;
   const char *module = NULL;

   if (argc < 2)
     {
	printf("At least one argument is necessary. Usage:\n");
	printf("\t%s <filename> [module_name]\n", argv[0]);
	goto error;
     }

   filename = argv[1];

   if (argc >= 3)
     module = argv[2];

   if (!ecore_evas_init())
     return EXIT_FAILURE;

   /* this will give you a window with an Evas canvas under the first
    * engine available */
   ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
   if (!ee)
     goto error;

   ecore_evas_show(ee);

   /* the canvas pointer, de facto */
   e = ecore_evas_get(ee);

   /* adding a background to this example */
   bg = evas_object_rectangle_add(e);
   evas_object_name_set(bg, "our dear rectangle");
   evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
   evas_object_move(bg, 0, 0); /* at canvas' origin */
   evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
   evas_object_show(bg);

   /* Creating the emotion object */
   em = emotion_object_add(e);

   /* Try to load the specified module - NULL for auto-discover */
   if (!emotion_object_init(em, module))
     fprintf(stderr, "Emotion: \"%s\" module could not be initialized.\n", module);

   _display_info(em);
   _setup_emotion_callbacks(em);

   if (!emotion_object_file_set(em, filename))
     fprintf(stderr, "Emotion: Could not load the file \"%s\"\n", filename);

   evas_object_move(em, 0, 0);
   evas_object_resize(em, WIDTH, HEIGHT);
   evas_object_show(em);

   emotion_object_play_set(em, EINA_TRUE);

   ecore_main_loop_begin();

   ecore_evas_free(ee);
   ecore_evas_shutdown();
   return 0;

   ecore_evas_free(ee);

error:
   ecore_evas_shutdown();
   return -1;
}
コード例 #30
0
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
   return 1;
}

EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
   return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
    Evas_Object *o, *of, *ob;
    Ecore_Evas *ee;
    Ecore_X_Window_Attributes att;

    if (!ecore_x_composite_query()) return 0;
    if (!ecore_x_damage_query()) return 0;

    memset((&att), 0, sizeof(Ecore_X_Window_Attributes));
    ecore_x_window_attributes_get(ecore_x_window_root_first_get(), &att);
    if ((att.depth <= 8)) return 0;

    ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 320, 240);
    if (ee)
    {
        ecore_evas_free(ee);
        if (
            (match_xorg_log("*(II)*NVIDIA*: Creating default Display*")) ||
            (match_xorg_log("*(II)*intel*: Creating default Display*")) ||
            (match_xorg_log("*(II)*NOUVEAU*: Creating default Display*")) ||
            (match_xorg_log("*(II)*RADEON*: Creating default Display*"))
        )
        {
            do_gl = 1;
            do_vsync = 1;
        }
    }

    o = e_widget_list_add(pg->evas, 1, 0);
    e_wizard_title_set(_("Compositing"));

    of = e_widget_framelist_add(pg->evas, _("Transparent windows and effects"), 0);

    ob = e_widget_textblock_add(pg->evas);
    e_widget_size_min_set(ob, 260 * e_scale, 200 * e_scale);
    e_widget_textblock_markup_set
    (ob,
     _("Compositing provides translucency<br>"
       "for windows, window effects like<br>"
       "fading in and out and zooming<br>"
       "when they appear and dissapear.<br>"
       "It is highly recommended to<br>"
       "enable this for a better<br>"
       "experience, but it comes at a<br>"
       "cost. It requires extra CPU<br>"
       "or a GLSL Shader capable GPU<br>"
       "with well written drivers.<br>"
       "It also will add between 10 to<br>"
       "100 MB to the memory needed<br>"
       "for Enlightenment."
      )
    );
    e_widget_framelist_object_append(of, ob);

    ob = e_widget_check_add(pg->evas, _("Enable Compositing"), &(do_comp));
    e_widget_framelist_object_append(of, ob);

    if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
    {
        ob = e_widget_check_add(pg->evas, _("Hardware Accelerated (OpenGL)"), &(do_gl));
        e_widget_framelist_object_append(of, ob);

        ob = e_widget_check_add(pg->evas, _("Tear-free Rendering (OpenGL only)"), &(do_vsync));
        e_widget_framelist_object_append(of, ob);
    }

    e_widget_list_object_append(o, of, 0, 0, 0.5);

    evas_object_show(of);

    e_wizard_page_show(o);
//   pg->data = o;
    return 1; /* 1 == show ui, and wait for user, 0 == just continue */
}