コード例 #1
0
ファイル: esmart_resize.c プロジェクト: playya/Enlightenment
/*==========================================================================
 * The three external functions, new,  button set and type set
 *========================================================================*/
EAPI Evas_Object *
esmart_resize_new(Ecore_Evas * ee)
{
   Evas_Object *o = NULL;
   Evas_Object *result = NULL;
   Esmart_Resize *data = NULL;

   if (!ee)
     return NULL;
   if ((result = esmart_resize_object_new(ecore_evas_get(ee)))
	 && (data = (Esmart_Resize *) evas_object_smart_data_get(result)))
     {
	data->ee = ee;
	o = evas_object_rectangle_add(ecore_evas_get(ee));
	evas_object_color_set(o, 255, 255, 255, 0);
	evas_object_repeat_events_set(o, 1);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
	      _mouse_down_cb, data);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP,
	      _mouse_up_cb, data);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE,
	      _mouse_move_cb, data);
	data->obj = o;
     }
   return result;
}
コード例 #2
0
/*==========================================================================
 * The two external functions, new and button set
 *========================================================================*/
EAPI Evas_Object *
esmart_draggies_new (Ecore_Evas * ee)
{
  Evas_Object *o = NULL;
  Evas_Object *result = NULL;
  Esmart_Draggies *data = NULL;

  if (!ee)
    return (NULL);
  if ((result = esmart_dragable_object_new (ecore_evas_get (ee))))
    {
       if ((data = evas_object_smart_data_get (result)))
	 {
	    data->ee = ee;
	    o = evas_object_rectangle_add (ecore_evas_get (ee));
	    evas_object_color_set (o, 255, 255, 255, 0);
	    evas_object_repeat_events_set (o, 1);
	    evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN,
		  _mouse_down_cb, data);
	    evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_UP,
		  _mouse_up_cb, data);
	    evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_MOVE,
		  _mouse_move_cb, data);
	    data->obj = o;

	    evas_object_smart_member_add(o, result);
	 }
    }
  return (result);
}
コード例 #3
0
ファイル: controlcentre.c プロジェクト: playya/Enlightenment
/**
 * @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;
}
コード例 #4
0
ファイル: band.c プロジェクト: Elive/elicit
Elicit_Band *
elicit_band_new(const char *theme_file)
{
  Elicit_Band *band;

  band = calloc(1, sizeof(Elicit_Band));

  //XXX allow other engines
  band->ee = ecore_evas_software_x11_new(0,0,0,0,10,10);
  ecore_evas_borderless_set(band->ee, 1);
  if (ecore_x_screen_is_composited(0))
    ecore_evas_alpha_set(band->ee, 1);
  else
    ecore_evas_shaped_set(band->ee, 1);

  band->obj = edje_object_add(ecore_evas_get(band->ee));

  //XXX theme file!
  if (!edje_object_file_set(band->obj, theme_file, "elicit.band"))
  {
    fprintf(stderr, "[Elicit] Error: Can't set band theme\n");
  }
  evas_object_move(band->obj, 0, 0);
  evas_object_show(band->obj);

  return band;
}
コード例 #5
0
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);
}
コード例 #6
0
ファイル: main.c プロジェクト: yang-bo/webkit
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;
}
コード例 #7
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;
}
コード例 #8
0
EcoreEvasWindowXRenderX11::EcoreEvasWindowXRenderX11( int width, int height, const char* display )
                :EcoreEvasWindow()
{    
    Dout( dc::notice, "EcoreEvasWindow::EcoreEvasWindowGL" );
    EcoreApplication::application()->setMainWindow( this );

    if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
    if ( ::getenv( "EFL_WIDTH" ) ) width = atoi( ::getenv( "EFL_WIDTH" ) );
    if ( ::getenv( "EFL_HEIGHT" ) ) height = atoi( ::getenv( "EFL_HEIGHT" ) );
  
    Dout( dc::notice, "- detected display string '" << ( display ? display:"<null>" ) << "' - starting X11 engine" );
    //FIXME: Should we care about positioning? 0, 0 for now
    _ee = ecore_evas_xrender_x11_new( const_cast<char*>( display ), 0, 0, 0, width, height );
    
    ecore_evas_title_set( _ee, eApp->name().c_str() );
    ecore_evas_borderless_set( _ee, 0 );

    _canvas = new EvasCanvas( ecore_evas_get( _ee ) );

    /* Set up magic object back link */
    ecore_evas_data_set( _ee, "obj_c++", this );

    /* Set up default callbacks */
    setEventEnabled( Resize, true );
    setEventEnabled( DeleteRequest, true );
}
コード例 #9
0
ファイル: EvasWindowSoftwareX11.cpp プロジェクト: Limsik/e17
EvasWindowSoftwareX11::EvasWindowSoftwareX11( const Eflxx::Size &size, const char* display ) : 
  EvasWindow(),
  mExwin (NULL)
{
  Dout( dc::notice, "EvasWindow::EvasWindowSoftwareX11" );
  Application::getInstance()->setMainWindow( this );

  /*if ( ::getenv( "EFL_DISPLAY" ) ) display = ::getenv( "EFL_DISPLAY" );
  if ( ::getenv( "EFL_WIDTH" ) ) size.width (atoi( ::getenv( "EFL_WIDTH" ) ));
  if ( ::getenv( "EFL_HEIGHT" ) ) size.height (atoi( ::getenv( "EFL_HEIGHT" ) ));*/

  Dout( dc::notice, "- detected display string '" << ( display ? display:"<null>" ) << "' - starting X11 engine" );
  //FIXME: Should we care about positioning? 0, 0 for now
  _ee = ecore_evas_software_x11_new( const_cast<char*>( display ), 0, 0, 0, size.width (), size.height () );

  ecore_evas_title_set( _ee, Application::getInstance()->getName().c_str() );
  ecore_evas_borderless_set( _ee, 0 );

  _canvas = Evasxx::Canvas::wrap ( ecore_evas_get( _ee ) );

  /* Set up magic object back link */
  ecore_evas_data_set( _ee, "obj_c++", this );

  /* Set up default callbacks */
  setEventEnabled( Resize, true );
  setEventEnabled( DeleteRequest, true );
}
コード例 #10
0
ファイル: nl-launcher.c プロジェクト: derobert/DebianLINK
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;

}
コード例 #11
0
WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
{
    ASSERT(m_page);

#ifdef HAVE_ECORE_X
    const char* engine = "opengl_x11";
    m_inspectorWindow = ecore_evas_new(engine, 0, 0, initialWindowWidth, initialWindowHeight, 0);

    // Gracefully fall back to software if evas_gl engine is not available.
    if (!m_inspectorWindow)
#endif
    m_inspectorWindow = ecore_evas_new(0, 0, 0, initialWindowWidth, initialWindowHeight, 0);
    if (!m_inspectorWindow)
        return 0;

    WKContextRef wkContext = toAPI(page()->process()->context());
    WKPageGroupRef wkPageGroup = toAPI(inspectorPageGroup());

    m_inspectorView = EWKViewCreate(wkContext, wkPageGroup, ecore_evas_get(m_inspectorWindow), /* smart */ 0);
    WKViewRef wkView = EWKViewGetWKView(m_inspectorView);

    WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(TEST_THEME_DIR "/default.edj"));
    WKViewSetThemePath(wkView, wkTheme.get());

    WKPreferencesRef wkPreferences = WKPageGroupGetPreferences(wkPageGroup);
    WKPreferencesSetFileAccessFromFileURLsAllowed(wkPreferences, true);

    return toImpl(WKViewGetPage(wkView));
}
コード例 #12
0
ファイル: test.c プロジェクト: ixdu/caravan
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);
}
コード例 #13
0
ファイル: clouseau_client.c プロジェクト: Limsik/e17
static Eina_List *
_load_list(void)
{
   Eina_List *tree = NULL;
   Eina_List *ees;
   Ecore_Evas *ee;

   ees = ecore_evas_ecore_evas_list_get();

   EINA_LIST_FREE(ees, ee)
     {
        Eina_List *objs;
        Evas_Object *obj;
        Clouseau_Tree_Item *treeit;

        Evas *e;
        int w, h;

        e = ecore_evas_get(ee);
        evas_output_size_get(e, &w, &h);

        treeit = calloc(1, sizeof(Clouseau_Tree_Item));
        if (!treeit) continue ;

        treeit->name = eina_stringshare_add(ecore_evas_title_get(ee));
        treeit->ptr = (uintptr_t) ee;

        tree = eina_list_append(tree, treeit);

        objs = evas_objects_in_rectangle_get(e, SHRT_MIN, SHRT_MIN,
              USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE);

        EINA_LIST_FREE(objs, obj)
          libclouseau_item_add(obj, treeit);
    }
コード例 #14
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);
}
コード例 #15
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;
}
コード例 #16
0
WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
{
    ASSERT(m_inspectedPage);

#ifdef HAVE_ECORE_X
    const char* engine = "opengl_x11";
    m_inspectorWindow = ecore_evas_new(engine, 0, 0, initialWindowWidth, initialWindowHeight, 0);

    // Gracefully fall back to software if evas_gl engine is not available.
    if (!m_inspectorWindow)
#endif
    m_inspectorWindow = ecore_evas_new(0, 0, 0, initialWindowWidth, initialWindowHeight, 0);
    if (!m_inspectorWindow)
        return 0;

    WKContextRef wkContext = toAPI(&inspectorProcessPool());
    WKRetainPtr<WKStringRef> wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifier().utf8().data()));
    WKPageGroupRef wkPageGroup = WKPageGroupCreateWithIdentifier(wkGroupIdentifier.get());

    WKRetainPtr<WKPageConfigurationRef> wkPageConfiguration = adoptWK(WKPageConfigurationCreate());
    WKPageConfigurationSetContext(wkPageConfiguration.get(), wkContext);
    WKPageConfigurationSetPageGroup(wkPageConfiguration.get(), wkPageGroup);

    m_inspectorView = EWKViewCreate(wkContext, wkPageConfiguration.get(), ecore_evas_get(m_inspectorWindow), /* smart */ 0);
    WKViewRef wkView = EWKViewGetWKView(m_inspectorView);

    WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(DEFAULT_THEME_DIR "/default.edj"));
    WKViewSetThemePath(wkView, wkTheme.get());

    WKPreferencesRef wkPreferences = WKPageGroupGetPreferences(wkPageGroup);
    WKPreferencesSetFileAccessFromFileURLsAllowed(wkPreferences, true);
    WKPreferencesSetJavaScriptRuntimeFlags(wkPreferences, 0);

    return toImpl(WKViewGetPage(wkView));
}
コード例 #17
0
ファイル: e_canvas.c プロジェクト: Deepspeed/moksha
/* externally accessible functions */
EAPI void
e_canvas_add(Ecore_Evas *ee)
{
   Evas *e;

   _e_canvases = eina_list_prepend(_e_canvases, ee);
   e = ecore_evas_get(ee);
   evas_image_cache_set(e, e_config->image_cache * 1024);
   evas_font_cache_set(e, e_config->font_cache * 1024);
   e_path_evas_append(path_fonts, e);
   if (e_config->font_hinting == 0)
     {
        if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_BYTECODE))
          evas_font_hinting_set(e, EVAS_FONT_HINTING_BYTECODE);
        else if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
          evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
        else
          evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
     }
   else if (e_config->font_hinting == 1)
     {
        if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
          evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
        else
          evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
     }
   else if (e_config->font_hinting == 2)
     evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
}
コード例 #18
0
static void
main_resize(Ecore_Evas *ee)
{
   Evas_Coord w, h;

   evas_output_viewport_get(ecore_evas_get(ee), NULL, NULL, &w, &h);
   bg_resize(w, h);
}
コード例 #19
0
ファイル: clouseau_client.c プロジェクト: Limsik/e17
static void *
_canvas_bmp_get(Ecore_Evas *ee, Evas_Coord *w_out, Evas_Coord *h_out)
{
   Ecore_X_Image *img;
   Ecore_X_Window_Attributes att;
   unsigned char *src;
   unsigned int *dst;
   int bpl = 0, rows = 0, bpp = 0;
   Evas_Coord w, h;

   /* Check that this window still exists */
   Eina_List *eeitr, *ees = ecore_evas_ecore_evas_list_get();
   Ecore_Evas *eel;
   Eina_Bool found_evas = EINA_FALSE;

   EINA_LIST_FOREACH(ees, eeitr, eel)
      if (eel == ee)
        {
           found_evas = EINA_TRUE;
           break;
        }

   Ecore_X_Window xwin = (found_evas) ?
      (Ecore_X_Window) ecore_evas_window_get(ee) : 0;

   if (!xwin)
     {
        printf("Can't grab X window.\n");
        *w_out = *h_out = 0;
        return NULL;
     }

   Evas *e = ecore_evas_get(ee);
   evas_output_size_get(e, &w, &h);
   memset(&att, 0, sizeof(Ecore_X_Window_Attributes));
   ecore_x_window_attributes_get(xwin, &att);
   img = ecore_x_image_new(w, h, att.visual, att.depth);
   ecore_x_image_get(img, xwin, 0, 0, 0, 0, w, h);
   src = ecore_x_image_data_get(img, &bpl, &rows, &bpp);
   dst = malloc(w * h * sizeof(int));  /* Will be freed by the user */
   if (!ecore_x_image_is_argb32_get(img))
     {  /* Fill dst buffer with image convert */
        ecore_x_image_to_argb_convert(src, bpp, bpl,
              att.colormap, att.visual,
              0, 0, w, h,
              dst, (w * sizeof(int)), 0, 0);
     }
   else
     {  /* Fill dst buffer by copy */
        memcpy(dst, src, (w * h * sizeof(int)));
     }

   /* dst now holds window bitmap */
   ecore_x_image_free(img);
   *w_out = w;
   *h_out = h;
   return (void *) dst;
}
コード例 #20
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;
}
コード例 #21
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);
}
コード例 #22
0
GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
    : m_context(context)
    , m_hostWindow(hostWindow)
    , m_evasGL(0)
    , m_evasGLContext(0)
    , m_evasGLSurface(0)
    , m_glContext(0)
    , m_glSurface(0)
    , m_api(0)
    , m_renderStyle(renderStyle)
{
    if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext)
        return;

    if (m_hostWindow && m_hostWindow->platformPageClient()) {
        // FIXME: Implement this code path for WebKit1.
        // Get Evas object from platformPageClient and set EvasGL related members.
        return;
    }

    // For WebKit2, we need to create a dummy ecoreEvas object for the WebProcess in order to use EvasGL APIs.
#ifdef HAVE_ECORE_X
    ecore_evas_init();
    m_ecoreEvas = adoptPtr(ecore_evas_gl_x11_new(0, 0, 0, 0, 1, 1));
    if (!m_ecoreEvas)
        return;
#else
    return;
#endif

    Evas* evas = ecore_evas_get(m_ecoreEvas.get());
    if (!evas)
        return;

    // Create a new Evas_GL object for gl rendering on efl.
    m_evasGL = evas_gl_new(evas);
    if (!m_evasGL)
        return;

    // Get the API for rendering using OpenGL.
    // This returns a structure that contains all the OpenGL functions we can use to render in Evas
    m_api = evas_gl_api_get(m_evasGL);
    if (!m_api)
        return;

    // Create a context
    m_evasGLContext = evas_gl_context_create(m_evasGL, 0);
    if (!m_evasGLContext)
        return;

    // Create a surface
    if (!createSurface(0, renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow))
        return;

    makeContextCurrent();
}
コード例 #23
0
ファイル: edvi_evas_test.c プロジェクト: Limsik/e17
static void
app_resize(Ecore_Evas *ee)
{
   Evas_Coord w, h;
   Evas *evas;

   evas = ecore_evas_get(ee);
   evas_output_viewport_get(evas, NULL, NULL, &w, &h);
/*    bg_resize(w, h); */
}
コード例 #24
0
ファイル: interface.c プロジェクト: playya/Enlightenment
/**
 * 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);
}
コード例 #25
0
ファイル: tooltip.c プロジェクト: playya/Enlightenment
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);
}
コード例 #26
0
ファイル: eoi_test.c プロジェクト: OpenInkpot/libeoi
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);
}
コード例 #27
0
ファイル: sysefl.c プロジェクト: c4rlo/gargoyle-fedora
static
void winchoosefile(char *prompt, char *buf, int len, int filter, Eina_Bool is_save)
{
    Evas *evas = NULL;
    if ( frame != NULL ){ //simulate a modal dialog by disabling all events to the main window
        ecore_evas_get( frame );
        disable_idlers();
        evas_event_freeze(evas);
    }
    /*TODO: implement file name filtering */
    Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt;

    win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
    elm_win_title_set(win, prompt);

    bg = elm_bg_add(win);
    elm_win_resize_object_add(win, bg);
    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(bg);

    vbox = elm_box_add(win);
    elm_win_resize_object_add(win, vbox);
    evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(vbox);

    fs = elm_fileselector_add(win);
    elm_fileselector_is_save_set(fs, is_save);
    elm_fileselector_expandable_set(fs, EINA_FALSE);
    evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(vbox, fs);
    evas_object_show(fs);
    evas_object_smart_callback_add(fs, "done", my_fileselector_done, win);

    if (strlen(buf))
        elm_fileselector_selected_set( fs, buf );

    if (fileselect)
        elm_fileselector_path_set( fs, filepath );
    else if (getenv("HOME"))
        elm_fileselector_path_set( fs, getenv("HOME") );

    evas_object_resize(win, 400, 350);
    evas_object_show(win);
    
    evas_object_data_set(fs, "buffer", buf);

    elm_run();
    
    if ( evas != NULL ){ //enable events to the main window
        enable_idlers();
        evas_event_thaw(evas);
    }
}
コード例 #28
0
ファイル: esmart_test.c プロジェクト: playya/Enlightenment
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);
}
コード例 #29
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);
}
コード例 #30
0
PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
{
    m_window = initEcoreEvas();

    m_view = EWKViewCreate(contextRef, pageGroupRef, ecore_evas_get(m_window), /* smart */ 0);

    WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(TEST_THEME_DIR "/default.edj"));
    WKViewSetThemePath(EWKViewGetWKView(m_view), wkTheme.get());

    evas_object_smart_callback_add(m_view, "webprocess,crashed", onWebProcessCrashed, 0);
    resizeTo(600, 800);
}