Exemple #1
0
//Popup the menu at the position (x, y)
void eclair_menu_popup_at_xy(Eclair_Menu *menu, int x, int y)
{
   if (!menu)
      return;

   if (!_eclair_menu_input_window)
   {
      Ecore_X_Window root, parent;
      int root_x, root_y, root_w, root_h;

      root = menu->x_window;
      while ((parent = ecore_x_window_parent_get(root)) != 0)
         root = parent;
 
      ecore_x_window_geometry_get(root, &root_x, &root_y, &root_w, &root_h);
      _eclair_menu_input_window = ecore_x_window_input_new(root, root_x, root_y, root_w, root_h);
   }
   if (!_eclair_menu_root)
   {
      _eclair_menu_mouse_up_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _eclair_menu_mouse_up_cb, menu);
      _eclair_menu_mouse_move_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _eclair_menu_mouse_move_cb, menu);
      ecore_x_window_show(_eclair_menu_input_window);
      ecore_x_keyboard_grab(_eclair_menu_input_window);
      ecore_x_pointer_confine_grab(_eclair_menu_input_window);

      _eclair_menu_root = menu;
   }
   ecore_evas_move(menu->window, x, y);
   ecore_evas_show(menu->window);
   evas_event_feed_mouse_move(menu->evas, -100000, -100000, ecore_x_current_time_get(), NULL);
   evas_event_feed_mouse_in(menu->evas, ecore_x_current_time_get(), NULL);
   _eclair_menu_popped_menus = eina_list_append(_eclair_menu_popped_menus, menu);

   _eclair_menu_update_slide_timer(menu);
}
Exemple #2
0
int64_t ui_wiondow_frame_create(struct ui_object *frame){
  ecore_evas_init();
  
  // create your canvas
   // NOTE: consider using ecore_evas_buffer_new() instead!
  
  struct _frame_window *fwin = (struct _frame_window*) malloc(sizeof(struct _frame_window));
  
  char *data;

  Eina_List *l, *engines = ecore_evas_engines_get();
  printf("Available engines:\n");
  EINA_LIST_FOREACH(engines, l, data)
    printf("%s\n", data);
  ecore_evas_engines_free(engines);
  
  fwin->canvas = ecore_evas_new("opengl_x11", 0, 0, frame->w, frame->h, NULL);
  if (!fwin->canvas)
    return -1;

  ecore_evas_show(fwin->canvas);  
  
  struct ui_frame *frame_obj = (struct _ui_window*) malloc(sizeof(struct ui_frame));
  frame_obj->data = fwin;
  frame_obj->ui = *frame;
  frame_obj->canvas = ecore_evas_get(fwin->canvas);
  
  return id_keeper_gen(id_keeper, frame_obj);
}
Exemple #3
0
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;
}
Exemple #4
0
int main(int argc, char **argv) {

    init_efl();

    char *theme = find_theme();
    if (!theme)
		fatal("Could not find theme");

    Ecore_Evas *ee = ecore_evas_software_x11_new(NULL, 0,  0, 0, 400, 400);
    if (!ee) {
		fprintf(stderr, "FATAL: Could not get an ee...\n");
		exit(1);
	}
    Ecore_X_Screen_Size sz = get_screen_size(ee);
    ecore_evas_resize(ee, sz.width, sz.height);
    ecore_evas_title_set(ee, "Launcher");
    ecore_evas_borderless_set(ee, 1);
    ecore_evas_fullscreen_set(ee, 1);

    Evas *evas = ecore_evas_get(ee);
    Evas_Object *edje = edje_object_add(evas);
    edje_object_file_set(edje, theme, "main");
    evas_object_move(edje, 0, 0);
    evas_object_resize(edje, sz.width, sz.height);
    evas_object_show(edje);

    ecore_evas_show(ee);
    ecore_main_loop_begin();

	shutdown_efl();

    return 0;

}
int main(void) {
    Evas_Object *o;
    Ecore_Evas *ee;
    int r;

    evas_init();
    ecore_init();
    ecore_evas_init();
    edje_init();

    ee = ecore_evas_new(NULL, 0, 0, 320, 240, NULL);
    if (!ee)
        return -1;

    o = edje_object_add(ecore_evas_get(ee));
    if (!edje_object_file_set(o, "test.edj", "main")) {
        fprintf(stderr, "could not load edje: %d\n",
                edje_object_load_error_get(o));
        return -2;
    }
    evas_object_resize(o, 320, 240);
    evas_object_show(o);

    ecore_evas_alpha_set(ee, 1);
    ecore_evas_borderless_set(ee, 1);
    ecore_evas_show(ee);
    ecore_main_loop_begin();

    return 0;
}
Exemple #6
0
static MiniBrowser *browserCreate(const char *url)
{
    MiniBrowser *app = malloc(sizeof(MiniBrowser));

    app->ee = ecore_evas_new(0, 0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);

    ecore_evas_title_set(app->ee, "EFL MiniBrowser");
    ecore_evas_callback_resize_set(app->ee, on_ecore_evas_resize);
    ecore_evas_borderless_set(app->ee, 0);
    ecore_evas_show(app->ee);

    app->evas = ecore_evas_get(app->ee);

    app->bg = evas_object_rectangle_add(app->evas);
    evas_object_name_set(app->bg, "bg");
    evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

    evas_object_move(app->bg, 0, 0);
    evas_object_resize(app->bg, DEFAULT_WIDTH, DEFAULT_HEIGHT);
    evas_object_color_set(app->bg, 255, 150, 150, 255);
    evas_object_show(app->bg);

    /* Create webview */
    app->browser = ewk_view_add(app->evas);
    evas_object_name_set(app->browser, "browser");
    evas_object_size_hint_weight_set(app->browser, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

    evas_object_resize(app->browser, DEFAULT_WIDTH, DEFAULT_HEIGHT);
    evas_object_show(app->browser);
    evas_object_focus_set(app->browser, EINA_TRUE);

    ewk_view_uri_set(app->browser, url);

    return app;
}
void EWK2UnitTestBase::SetUp()
{
    unsigned int width = environment->defaultWidth();
    unsigned int height = environment->defaultHeight();

#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X)
    const char* engine = "opengl_x11";
    m_ecoreEvas = ecore_evas_new(engine, 0, 0, width, height, 0);
#else
    m_ecoreEvas = ecore_evas_new(0, 0, 0, width, height, 0);
#endif

    ecore_evas_show(m_ecoreEvas);
    Evas* evas = ecore_evas_get(m_ecoreEvas);

    Evas_Smart* smart = evas_smart_class_new(&m_ewkViewClass.sc);

    Ewk_Context* newContext = ewk_context_new();
    Ewk_Page_Group* newPageGroup = ewk_page_group_create("UnitTest");
    m_webView = ewk_view_smart_add(evas, smart, newContext, newPageGroup);

    // Clear HTTP cache files before running the unit tests, which prevents 
    // performance degradation due to so many cache files.
    ewk_context_resource_cache_clear(newContext);
    ewk_object_unref(newContext);
    ewk_object_unref(newPageGroup);

    ewk_view_theme_set(m_webView, environment->defaultTheme());

    evas_object_resize(m_webView, width, height);
    evas_object_show(m_webView);
    evas_object_focus_set(m_webView, true);
}
Exemple #8
0
//Play a new file
void eclair_play_file(Eclair *eclair, const char *path)
{
   if (!eclair)
      return;

   if (!eclair->video.video_object)
   {
      eclair->start_playing = 1;
      return;
   }

   if (path)
   {
      emotion_object_file_set(eclair->video.video_object, path);
      emotion_object_play_set(eclair->video.video_object, 0);
      eclair_progress_rate_set(eclair, 0.0);
      eclair->state = ECLAIR_PAUSE;
      eclair_play(eclair);
   
      eclair_subtitles_load_from_media_file(&eclair->subtitles, path);
      
      if (eclair->video.video_window)
      {
         if (emotion_object_video_handled_get(eclair->video.video_object))
            ecore_evas_show(eclair->video.video_window);
         else
            ecore_evas_hide(eclair->video.video_window);
      }
   }
   else
      eclair_stop(eclair);
}
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;
}
Exemple #10
0
static void erss_tooltip_show (Erss_Tooltip *tt)
{
	tt->timer = NULL;

	ecore_evas_move (tt->ee, world_x + tt->x - 10, world_y + tt->y - 10);
	ecore_evas_show (tt->ee);
}
Exemple #11
0
void WebInspectorProxy::createInspectorWindow()
{
    ecore_evas_title_set(m_inspectorWindow, "Web Inspector");
    ecore_evas_callback_resize_set(m_inspectorWindow, resizeInspectorWindow);
    ecore_evas_callback_delete_request_set(m_inspectorWindow, destroyInspectorWindow);
    ecore_evas_show(m_inspectorWindow);

    evas_object_name_set(m_inspectorView, "inspector");
    evas_object_move(m_inspectorView, 0, 0);
    evas_object_resize(m_inspectorView, initialWindowWidth, initialWindowHeight);
    evas_object_show(m_inspectorView);

    evas_object_focus_set(m_inspectorView, true);
}
Exemple #12
0
EAPI void
e_popup_show(E_Popup *pop)
{
   E_OBJECT_CHECK(pop);
   E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE);
   if (pop->visible) return;
   pop->visible = 1;
   if ((pop->shaped) && (!e_config->use_composite))
     {
        ecore_evas_move(pop->ecore_evas,
                        pop->zone->container->manager->w,
                        pop->zone->container->manager->h);
        ecore_evas_show(pop->ecore_evas);
        if (pop->idle_enterer) ecore_idle_enterer_del(pop->idle_enterer);
        pop->idle_enterer = ecore_idle_enterer_add(_e_popup_idle_enterer, pop);
     }
   else
     {
        ecore_evas_show(pop->ecore_evas);
	if (!(pop->shaped && e_config->use_composite))
	  e_container_shape_show(pop->shape);
     }
}
Exemple #13
0
int main(int argc, const char **argv)
{
	Ecore_X_Window win;

	ecore_init();
	ecore_app_args_set(argc, argv);

	if (!ecore_evas_init())
		return -1;

	ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, win_w, win_h);
	if (!ee)
		return 1;
	win = ecore_evas_software_x11_window_get(ee);
	ecore_evas_title_set(ee, "Etox Selection Test");
	ecore_evas_show(ee);

	/* setup callbacks for events */
	ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, e_mouse_move, NULL);
	ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, e_mouse_down,
			NULL);
	ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, e_mouse_up,
			NULL);
	ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, sig_exit, NULL);

	evas = ecore_evas_get(ee);
	evas_font_path_append(evas, FONT_DIRECTORY);

	/* program does its data setup here */
	setup();

	ecore_evas_callback_resize_set(ee, window_resize);

	/* and now loop forever handling events */
	ecore_main_loop_begin();

	evas_object_del(e_msg);
	evas_object_del(e_test);

	while (pbuttons) {
		panel_button_free(pbuttons->data);
		pbuttons = eina_list_remove(pbuttons, pbuttons->data);
	}

	evas_free(evas);

	return 0;
	argc = 0;
	argv = NULL;
}
Exemple #14
0
static MiniBrowser *browserCreate(const char *url, const char *engine)
{
    MiniBrowser *app = malloc(sizeof(MiniBrowser));

    app->ee = ecore_evas_new(engine, 0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0);
    if (!app->ee)
        return 0;

    ecore_evas_title_set(app->ee, APP_NAME);
    ecore_evas_callback_resize_set(app->ee, on_ecore_evas_resize);
    ecore_evas_borderless_set(app->ee, 0);
    ecore_evas_show(app->ee);
    ecore_evas_callback_delete_request_set(app->ee, closeWindow);

    app->evas = ecore_evas_get(app->ee);

    app->bg = evas_object_rectangle_add(app->evas);
    evas_object_name_set(app->bg, "bg");
    evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

    evas_object_move(app->bg, 0, 0);
    evas_object_resize(app->bg, DEFAULT_WIDTH, DEFAULT_HEIGHT);
    evas_object_color_set(app->bg, 255, 150, 150, 255);
    evas_object_show(app->bg);

    /* Create webview */
    app->browser = ewk_view_add(app->evas);
    ewk_view_theme_set(app->browser, THEME_DIR"/default.edj");
    evas_object_name_set(app->browser, "browser");

    evas_object_smart_callback_add(app->browser, "load,error", on_error, app);
    evas_object_smart_callback_add(app->browser, "load,progress", on_progress, app);
    evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app);
    evas_object_smart_callback_add(app->browser, "uri,changed", on_url_changed, app);

    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);

    evas_object_size_hint_weight_set(app->browser, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_move(app->browser, 0, URL_BAR_HEIGHT);
    evas_object_resize(app->browser, DEFAULT_WIDTH, DEFAULT_HEIGHT - URL_BAR_HEIGHT);
    evas_object_show(app->browser);
    evas_object_focus_set(app->browser, EINA_TRUE);

    app->url_bar = url_bar_add(app->browser, DEFAULT_WIDTH);

    ewk_view_uri_set(app->browser, url);

    return app;
}
Exemple #15
0
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;
}
static Ecore_Evas* createEcoreEvas()
{
    Ecore_Evas* ecoreEvas;
#if defined(HAVE_ECORE_X)
    ecoreEvas = ecore_evas_new("opengl_x11", 0, 0, 800, 600, 0);
    // Graceful fallback to software rendering if evas_gl engine is not available.
    if (!ecoreEvas)
#endif
    ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);

    ASSERT(ecoreEvas);

    ecore_evas_show(ecoreEvas);

    return ecoreEvas;
}
Exemple #17
0
static Eina_Bool
_stdin_cb(void *data, Ecore_Fd_Handler *handler)
{
   Eina_List *l;
   Ecore_Evas *ee;
   char c;

   scanf("%c", &c);
   if (c == 'h')
     EINA_LIST_FOREACH(ecore_evas_ecore_evas_list_get(), l, ee)
       ecore_evas_hide(ee);
   else if (c == 's')
     EINA_LIST_FOREACH(ecore_evas_ecore_evas_list_get(), l, ee)
       ecore_evas_show(ee);

   return ECORE_CALLBACK_RENEW;
}
static Ecore_Evas* initEcoreEvas()
{
    if (!ecore_evas_init())
        return 0;

    const char* engine = 0;
#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X)
    engine = "opengl_x11";
#endif
    Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0);

    ASSERT(ecoreEvas);

    ecore_evas_show(ecoreEvas);

    return ecoreEvas;
}
Exemple #19
0
static Ecore_Evas* initEcoreEvas()
{
    Ecore_Evas* ecoreEvas = 0;
#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X)
    const char* engine = "opengl_x11";
    ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0);
    // Graceful fallback to software rendering if evas_gl engine is not available.
    if (!ecoreEvas)
#endif
    ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);

    if (!ecoreEvas)
        return 0;

    ecore_evas_title_set(ecoreEvas, "EFL WebKitTestRunner");
    ecore_evas_show(ecoreEvas);

    return ecoreEvas;
}
Exemple #20
0
void EWK2UnitTestBase::SetUp()
{
    ewk_init();

    unsigned int width = environment->defaultWidth();
    unsigned int height = environment->defaultHeight();

    m_ecoreEvas = ecore_evas_new(0, 0, 0, width, height, 0);

    ecore_evas_show(m_ecoreEvas);
    Evas* evas = ecore_evas_get(m_ecoreEvas);

    Evas_Smart* smart = evas_smart_class_new(&m_ewkViewClass.sc);
    m_webView = ewk_view_smart_add(evas, smart, ewk_context_default_get());
    ewk_view_theme_set(m_webView, environment->defaultTheme());

    evas_object_resize(m_webView, width, height);
    evas_object_show(m_webView);
    evas_object_focus_set(m_webView, true);
}
static Eina_Bool
_stdin_cb(void *data, Ecore_Fd_Handler *handler)
{
   const Eina_List *l;
   Ecore_Evas *ee;
   char c = getchar();

   if (c == EOF)
     {
        ecore_main_loop_quit();
        return EINA_FALSE;
     }

   switch (c) {
    case 'h':
       printf("hide all windows\n");
       EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
         ecore_evas_hide(ee);
       break;
    case 's':
       printf("show all windows\n");
       EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
         ecore_evas_show(ee);
       break;
    case 'l':
       printf("move all windows left\n");
       EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
         {
            int x, y;
            ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
            ecore_evas_move(ee, x - 10, y);
         }
       break;
    case 'r':
       printf("move all windows right\n");
       EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
         {
            int x, y;
            ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
            ecore_evas_move(ee, x + 10, y);
         }
Exemple #22
0
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;
}
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;
}
void EWK2UnitTestBase::SetUp()
{
    unsigned int width = environment->defaultWidth();
    unsigned int height = environment->defaultHeight();

#if defined(HAVE_ECORE_X)
    const char* engine = "opengl_x11";
    m_ecoreEvas = ecore_evas_new(engine, 0, 0, width, height, 0);
    // Graceful fallback to software rendering if evas_gl engine is not available.
    if (!m_ecoreEvas)
#endif
    m_ecoreEvas = ecore_evas_new(0, 0, 0, width, height, 0);

    ecore_evas_show(m_ecoreEvas);
    Evas* evas = ecore_evas_get(m_ecoreEvas);

    Evas_Smart* smart = evas_smart_class_new(&m_ewkViewClass.sc);

    Ewk_Context* newContext = ewk_context_new();
    if (m_multipleProcesses)
        ewk_context_process_model_set(newContext, EWK_PROCESS_MODEL_MULTIPLE_SECONDARY);

    Ewk_Page_Group* newPageGroup = ewk_page_group_create("UnitTest");
    m_webView = ewk_view_smart_add(evas, smart, newContext, newPageGroup);

    // Clear HTTP cache files before running the unit tests, which prevents 
    // performance degradation due to so many cache files.
    ewk_context_resource_cache_clear(newContext);
    ewk_object_unref(newContext);
    ewk_object_unref(newPageGroup);

    ewk_view_theme_set(m_webView, environment->defaultTheme());

    evas_object_resize(m_webView, width, height);
    evas_object_show(m_webView);
    evas_object_focus_set(m_webView, true);
}
Exemple #25
0
int
main (int argc, char * argv[])
{
  Edvi_Device   *device;
  Edvi_Property *property;
  Edvi_Document *document;
  Edvi_Page     *page;
  Ecore_Evas    *ee;
  Evas          *evas;
  Evas_Object   *o;
  char          *param_kpathsea_mode  = "cx";
  int            page_number;
  int            width;
  int            height;

  if (argc < 3) {
    printf ("\nUsage: %s file.dvi page_number\n\n", argv[0]);
    return EXIT_FAILURE;
  }

  printf ("[DVI] version : %s\n", edvi_version_get ());

  if (!edvi_init (300, param_kpathsea_mode, 4,
                  1.0, 1.0,
                  0, 255, 255, 255, 0, 0, 0)) {
    return EXIT_FAILURE;
  }

  device = edvi_device_new (edvi_dpi_get (), edvi_dpi_get ());
  if (!device) {
    goto shutdown;
  }

  property = edvi_property_new ();
  if (!property) {
    goto free_device;
  }
  edvi_property_property_set (property, EDVI_PROPERTY_DELAYED_FONT_OPEN);

  document = edvi_document_new (argv[1], device, property);
  if (!document) {
    goto free_property;
  }

  sscanf (argv[2], "%d", &page_number);
  page = edvi_page_new (document);
  if (!page) {
    goto free_document;
  }
  edvi_page_page_set (page, page_number);
  edvi_page_size_get (page, &width, &height);

  if (!ecore_init()) {
    goto free_page;
  }

  if (!ecore_evas_init()) {
    goto shutdown_ecore;
  }

  ee = ecore_evas_software_x11_new (NULL, 0,  0, 0, width, height);
  /* these tests can be improved... */
  if (!ee) {
    printf ("Can not find Software X11 engine. Trying DirectDraw engine...\n");
    ee = ecore_evas_software_ddraw_new (NULL,  0, 0, width, height);
    if (!ee) {
      goto shutdown_ecore_evas;
    }
  }
  ecore_event_handler_add (ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, NULL);
  ecore_evas_callback_delete_request_set (ee, app_delete_request);
  ecore_evas_title_set (ee, "Evas Dvi Test");
  ecore_evas_name_class_set (ee, "evas_dvi_test", "test_evas_dvi");
  ecore_evas_callback_resize_set (ee, app_resize);
  ecore_evas_show (ee);

  evas = ecore_evas_get (ee);

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

  ecore_main_loop_begin ();

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

  return EXIT_SUCCESS;

 shutdown_ecore_evas:
  ecore_evas_shutdown ();
 shutdown_ecore:
  ecore_shutdown ();
 free_page:
  edvi_page_delete (page);
 free_document:
  edvi_document_delete (document);
 free_property:
  edvi_property_delete (property);
 free_device:
  edvi_device_delete (device);
 shutdown:
  edvi_shutdown ();

  return EXIT_FAILURE;
}
Exemple #26
0
int
main (int argc, char *argv[])
{
  Evas *evas = NULL;
  Ecore_Evas *ee = NULL;
  Ecore_X_Window win = 0;
  Evas_Object *o = NULL;
  Evas_Object *cont = NULL;
  Evas_Object *image = NULL;
  int iw, ih;

  ecore_init ();
  ecore_app_args_set (argc, (const char **) argv);

  ecore_event_handler_add (ECORE_EVENT_SIGNAL_EXIT, exit_cb, NULL);

  if (ecore_evas_init ())
    {
      ee = ecore_evas_software_x11_new (NULL, 0, 0, 0, 300, 120);
      win = ecore_evas_software_x11_window_get(ee);
      ecore_evas_title_set (ee, "Enlightenment Thumbnail Test");
      ecore_evas_callback_delete_request_set (ee, window_del_cb);
      ecore_evas_callback_resize_set (ee, window_resize_cb);
      ecore_evas_callback_move_set (ee, window_move_cb);

      evas = ecore_evas_get (ee);
      o = esmart_trans_x11_new (evas);
      esmart_trans_x11_type_set(o, Esmart_Trans_X11_Type_Background);
      esmart_trans_x11_window_set(o, win);
      evas_object_move (o, 0, 0);
      evas_object_resize (o, 300, 120);
      evas_object_layer_set (o, -5);
      evas_object_name_set (o, "root_background");
      evas_object_show (o);

      o = evas_object_rectangle_add (evas);
      evas_object_move (o, 0, 0);
      evas_object_resize (o, 300, 120);
      evas_object_layer_set (o, -6);
      evas_object_color_set (o, 255, 255, 255, 0);
      evas_object_name_set (o, "background");
      evas_object_show (o);

      o = esmart_draggies_new (ee);
      evas_object_move (o, 0, 0);
      evas_object_resize (o, 300, 120);
      evas_object_layer_set (o, 255);
      evas_object_color_set (o, 255, 255, 255, 0);
      evas_object_name_set (o, "dragger");
      esmart_draggies_button_set (o, 1);
      evas_object_show (o);


      if (argc < 2)
	{
	  image = evas_object_image_add (evas);
	  evas_object_image_file_set (image, PACKAGE_DATA_DIR "/esmart.png",
				      NULL);
	  evas_object_image_size_get (image, &iw, &ih);
	  evas_object_resize (image, iw, ih);
	  evas_object_image_fill_set (image, 0.0, 0.0, (Evas_Coord) iw,
				      (Evas_Coord) ih);
	  evas_object_layer_set (image, 1000);
	  evas_object_pass_events_set (image, 1);
	  evas_object_show (image);
	}


      cont = esmart_container_new (evas);
      evas_object_move (cont, 0, 0);
      evas_object_resize (cont, 300, 120);
      evas_object_layer_set (cont, 0);
      evas_object_name_set (cont, "container");
      evas_object_show (cont);
      esmart_container_padding_set (cont, 10, 10, 10, 10);
      esmart_container_spacing_set (cont, 5);
      esmart_container_fill_policy_set (cont,
				   CONTAINER_FILL_POLICY_FILL_Y |
				   CONTAINER_FILL_POLICY_KEEP_ASPECT);

      evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN, bg_down_cb,
				      cont);
      evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_UP, bg_up_cb,
				      cont);


      while (--argc)
	{
	  if ((o = esmart_thumb_new (ecore_evas_get (ee), argv[argc])))
	    {
	      evas_object_layer_set (o, 2);
	      evas_object_show (o);
	      esmart_container_element_append (cont, o);
	    }
	}
      evas_object_resize (cont, 300, 120);
      ecore_evas_show (ee);

      if (ecore_x_composite_query())
        {
           ee = ecore_evas_software_x11_new (NULL, 0, 0, 0, 320, 120);
           ecore_evas_title_set (ee, "Enlightenment Pixmap Test");
           ecore_evas_callback_delete_request_set (ee, window_del_cb);
           ecore_evas_callback_resize_set (ee, window_resize_cb);
           ecore_evas_callback_move_set (ee, window_move_cb);

           evas = ecore_evas_get (ee);
           o = esmart_xpixmap_new (evas, 0, win);
           evas_object_move (o, 0, 0);
           evas_object_resize (o, 320, 120);
           evas_object_layer_set (o, -5);
           evas_object_name_set (o, "xpixmap");
           evas_object_show (o);

           o = evas_object_rectangle_add (evas);
           evas_object_move (o, 0, 0);
           evas_object_resize (o, 150, 30);
           evas_object_layer_set (o, -3);
           evas_object_color_set (o, 50, 50, 50, 50);
           evas_object_name_set (o, "white_transparent_rect");
           evas_object_show (o);

           ecore_evas_show (ee);
        }

      ecore_main_loop_begin ();
    }
  return (0);
}
Exemple #27
0
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;
}
Exemple #28
0
int
main (int argc, char *argv[])
{
  Ecore_Evas    *ee;
  Evas          *evas;
  Evas_Object   *o;
  Epdf_Document *document;
  Epdf_Page     *page;
  int            page_number;
  int            width;
  int            height;

  if (argc < 3) {
    printf ("\nUsage: %s filename page_number\n\n", argv[0]);
    return EXIT_FAILURE;
  }

  if (!epdf_init ()) {
    printf ("Epdf can't be initialized\n");
    return EXIT_FAILURE;
  }

  document = epdf_document_new (argv[1]);
  if (!document) {
    printf ("Bad pdf file\n");
    goto epdf_shutdown;
  }

  sscanf (argv[2], "%d", &page_number);
  if (page_number >= epdf_document_page_count_get (document)) {
    printf ("Page number exceeds the page count of the PDF document\n");
    goto document_delete;
  }

  page = epdf_page_new (document);
  if (!page) {
    printf ("Bad page\n");
    goto document_delete;
  }
  epdf_page_page_set (page, page_number);
  epdf_page_size_get (page, &width, &height);

  document_info_print (document, page);

  if (!ecore_evas_init())
    goto page_delete;

  ee = ecore_evas_new ("software_x11",  0, 0, width, height, NULL);
  /* these tests can be improved... */
  if (!ee) {
    printf ("Can not find Software X11 engine. Trying DirectDraw engine...\n");
    ee = ecore_evas_software_ddraw_new (NULL,  0, 0, width, height);
    if (!ee) {
      printf ("Can not find DirectDraw engine...\n");
      printf ("Exiting...\n");
      goto ecore_evas_shutdown;
    }
  }
  ecore_event_handler_add (ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, NULL);
  ecore_evas_callback_delete_request_set (ee, app_delete_request);
  ecore_evas_title_set (ee, "Evas Pdf Test");
  ecore_evas_name_class_set (ee, "evas_pdf_test", "test_evas_pdf");
  ecore_evas_callback_resize_set (ee, app_resize);
  ecore_evas_show (ee);

  evas = ecore_evas_get (ee);

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

  ecore_main_loop_begin ();

  epdf_page_delete (page);
  epdf_document_delete (document);

  ecore_evas_shutdown ();
  epdf_shutdown ();

  return EXIT_SUCCESS;

 ecore_evas_shutdown:
  ecore_evas_shutdown ();
 page_delete:
  epdf_page_delete (page);
 document_delete:
  epdf_document_delete (document);
 epdf_shutdown:
  epdf_shutdown ();

  return EXIT_FAILURE;
}
Exemple #29
0
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;
}
Exemple #30
0
void EWKTestEcoreEvas::show()
{
    if (m_ecoreEvas.get())
        ecore_evas_show(m_ecoreEvas.get());
}