예제 #1
0
/* setup */
static void _setup(void)
{
    int i;
    Evas_Object *o;

    o = evas_object_image_add(evas);
    o_mask = o;
    evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL);
    evas_object_image_fill_set(o, 0, 0, 720, 420);
    evas_object_resize(o, 720, 420);
    evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2);
    evas_object_show(o);

    for (i = 0; i < OBNUM; i++)
    {
        o = evas_object_image_add(evas);
        o_images[i] = o;
        evas_object_image_file_set(o, build_path("logo.png"), NULL);
        evas_object_image_fill_set(o, 0, 0, 120, 160);
        evas_object_resize(o, 120, 160);
        evas_object_image_smooth_scale_set(o, 1);
        evas_object_clip_set(o, o_mask);
        evas_object_show(o);
    }
    done = 0;
}
예제 #2
0
void create_image_obj(EFL_Core *core, EFL_Image *img, const char* path_image, int img_width, int img_height){
	img->obj = evas_object_image_add(get_main_object(core));
	evas_object_image_file_set(img->obj, path_image, NULL);
	evas_object_image_preload(img->obj, EINA_TRUE);
	img->width  = img_width;
	img->height = img_height;
}
예제 #3
0
void EflResources::initCb__( void*         _this
                           , Ecore_Thread* _th )
{
    ASSERT( _this && _th
          , "NULL pointers passed to thread function." );
    EflResources* rh( static_cast< EflResources* >( _this ) );

    std::for_each( init_images__.begin()
                 , init_images__.end()
                 , [&]( std::string const _path )
    {
        Evas_Object* object = evas_object_image_add( rh->window__ );
        evas_object_image_load_size_set( object
                                       , rh->max_width__
                                       , rh->max_height__ );
        evas_object_image_file_set( object
                                  , _path.c_str()
                                  , nullptr );
        CCallbackHandler::evasEventCallback( object
                                           , CALLBACK_IMAGE_PRELOADED
                                           , [=](){ ++( rh->resources_loaded__ );
                                                    rh->signals__[LOADING]->emit(); } );
        rh->preloaded_images__[_path] = object;
        evas_object_image_preload( object
                                 , 0 );
    } );
}
예제 #4
0
void _eyelight_viewer_slideshow_slides_load(Eyelight_Viewer* pres)
{
    int i;
    Evas_Object *o_image;
    char buf[EYELIGHT_BUFLEN];

    int nb_slides = pres->slideshow_nb_slides;

    int first_slide = pres->slideshow_current - (nb_slides/2);
    if(!pres->slideshow_image_thumbnails)
        pres->slideshow_image_thumbnails = calloc(nb_slides,sizeof(Evas_Object*));

    for(i=0;i<nb_slides; i++)
    {
        if(first_slide+i<0 || i+first_slide>=pres->size)
        {
            snprintf(buf,EYELIGHT_BUFLEN,"slideshow,slide,hide,%d",i+1);
            edje_object_signal_emit(pres->slideshow_background,
                buf,"eyelight");
        }
        else
        {
            snprintf(buf,EYELIGHT_BUFLEN,"slideshow,slide,show,%d",i+1);
            edje_object_signal_emit(pres->slideshow_background,
                    buf,"eyelight");


            if(!pres->slideshow_image_thumbnails[i])
            {
                const Eyelight_Thumb* thumb = eyelight_viewer_thumbnails_get(pres,first_slide+i);

                o_image = evas_object_image_add(pres->evas);
                pres->slideshow_image_thumbnails[i] = o_image;

		if (thumb->thumb)
		  {
		     evas_object_image_size_set(o_image, thumb->w, thumb->h);
		     evas_object_image_data_set(o_image,thumb->thumb);
		     evas_object_image_filled_set(o_image,1);
		  }
		else
		  {
		     char key[256];
		     int w;
		     int h;

		     snprintf(key, sizeof (key), "eyelight/thumb/%i", thumb->pos);
		     evas_object_image_file_set(o_image, pres->dump_in, key);
		     evas_object_image_size_get(o_image, &w, &h);
		     evas_object_image_fill_set(o_image, 0, 0, w, h);
		  }

		evas_object_show(o_image);
                snprintf(buf,EYELIGHT_BUFLEN,"object.swallow_%d",i+1);
                edje_object_part_swallow(pres->slideshow_background,buf,o_image);
            }
        }
    }
    eyelight_viewer_thumbnails_clean(pres,first_slide,first_slide+nb_slides);
}
예제 #5
0
파일: e_icon.c 프로젝트: haxworx/Enform
static void
_e_icon_obj_prepare(Evas_Object *obj, E_Smart_Data *sd)
{
   if (!sd->obj) return;

   if (sd->edje)
     {
        Evas_Object *pclip;

        pclip = evas_object_clip_get(sd->obj);
        evas_object_del(sd->obj);
#ifdef USE_ICON_CACHE
        sd->ci = NULL;
        eina_stringshare_replace(&sd->file, NULL);
#endif
        sd->obj = evas_object_image_add(evas_object_evas_get(obj));
        if (!sd->animated)
          evas_object_image_scale_hint_set(sd->obj,
                                           EVAS_IMAGE_SCALE_HINT_STATIC);
        evas_object_smart_member_add(sd->obj, obj);
        evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_IMAGE_PRELOADED,
                                       _e_icon_preloaded, obj);
        evas_object_clip_set(sd->obj, pclip);
     }
}
예제 #6
0
static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd)
{
    Evas_Object *bs = evas_object_image_add(sd->base.evas);
    evas_object_image_alpha_set(bs, EINA_FALSE);
    evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale);

    return bs;
}
예제 #7
0
/**
 * @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
static Cube *
_cube_new(Evas *evas, Evas_Coord w, Evas_Coord h, Evas_Coord d)
{
   Cube *c;
   int i;

   w -= (w / 2);
   h -= (h / 2);
   d -= (d / 2);
   c = calloc(1, sizeof(Cube));
   for (i = 0; i < 6; i++)
     {
        Evas_Object *o;
        char buf[PATH_MAX];
        o = evas_object_image_add(evas);
        c->side[i].o = o;
        snprintf(buf, sizeof(buf), "%s/images/%s",
                 elm_app_data_dir_get(), "twofish.jpg");
        evas_object_image_file_set(o, buf, NULL);
        evas_object_image_fill_set(o, 0, 0, 256, 256);
        evas_object_resize(o, 256, 256);
        evas_object_image_smooth_scale_set(o, 0);
        evas_object_show(o);
     }
   POINT(0, 0, -w, -h, -d,   0,   0);
   POINT(0, 1,  w, -h, -d, 256,   0);
   POINT(0, 2,  w,  h, -d, 256, 256);
   POINT(0, 3, -w,  h, -d,   0, 256);

   POINT(1, 0,  w, -h, -d,   0,   0);
   POINT(1, 1,  w, -h,  d, 256,   0);
   POINT(1, 2,  w,  h,  d, 256, 256);
   POINT(1, 3,  w,  h, -d,   0, 256);

   POINT(2, 0,  w, -h,  d,   0,   0);
   POINT(2, 1, -w, -h,  d, 256,   0);
   POINT(2, 2, -w,  h,  d, 256, 256);
   POINT(2, 3,  w,  h,  d,   0, 256);

   POINT(3, 0, -w, -h,  d,   0,   0);
   POINT(3, 1, -w, -h, -d, 256,   0);
   POINT(3, 2, -w,  h, -d, 256, 256);
   POINT(3, 3, -w,  h,  d,   0, 256);

   POINT(4, 0, -w, -h,  d,   0,   0);
   POINT(4, 1,  w, -h,  d, 256,   0);
   POINT(4, 2,  w, -h, -d, 256, 256);
   POINT(4, 3, -w, -h, -d,   0, 256);

   POINT(5, 0, -w,  h, -d,   0,   0);
   POINT(5, 1,  w,  h, -d, 256,   0);
   POINT(5, 2,  w,  h,  d, 256, 256);
   POINT(5, 3, -w,  h,  d,   0, 256);

   return c;
}
예제 #9
0
파일: image_map_3d_5.c 프로젝트: Limsik/e17
static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{
   Cube *c;
   int i;

   w -= (w / 2);
   h -= (h / 2);
   d -= (d / 2);
   c = calloc(1, sizeof(Cube));
   for (i = 0; i < 6; i++)
     {
        Evas_Object *o;
        char buf[256];
        o = evas_object_image_add(evas);
        c->side[i].o = o;
        snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1);
        evas_object_image_file_set(o, build_path(buf), NULL);
        evas_object_image_fill_set(o, 0, 0, 720, 420);
        evas_object_resize(o, 720, 420);
        evas_object_image_smooth_scale_set(o, 0);
        evas_object_show(o);
     }
   POINT(0, 0, -w, -h, -d,   0,   0);
   POINT(0, 1,  w, -h, -d, 720,   0);
   POINT(0, 2,  w,  h, -d, 720, 420);
   POINT(0, 3, -w,  h, -d,   0, 420);

   POINT(1, 0,  w, -h, -d,   0,   0);
   POINT(1, 1,  w, -h,  d, 720,   0);
   POINT(1, 2,  w,  h,  d, 720, 420);
   POINT(1, 3,  w,  h, -d,   0, 420);
   
   POINT(2, 0,  w, -h,  d,   0,   0);
   POINT(2, 1, -w, -h,  d, 720,   0);
   POINT(2, 2, -w,  h,  d, 720, 420);
   POINT(2, 3,  w,  h,  d,   0, 420);

   POINT(3, 0, -w, -h,  d,   0,   0);
   POINT(3, 1, -w, -h, -d, 720,   0);
   POINT(3, 2, -w,  h, -d, 720, 420);
   POINT(3, 3, -w,  h,  d,   0, 420);
   
   POINT(4, 0, -w, -h,  d,   0,   0);
   POINT(4, 1,  w, -h,  d, 720,   0);
   POINT(4, 2,  w, -h, -d, 720, 420);
   POINT(4, 3, -w, -h, -d,   0, 420);
   
   POINT(5, 0, -w,  h, -d,   0,   0);
   POINT(5, 1,  w,  h, -d, 720,   0);
   POINT(5, 2,  w,  h,  d, 720, 420);
   POINT(5, 3, -w,  h,  d,   0, 420);
   
   return c;
}
예제 #10
0
static void
_generate_thumb(Ethumb *e)
{
    Epdf_Document *document;
    Epdf_Page *page;
    Evas_Object *o;
    const char *src_path;
    int w, h, ww, hh;
    int fx, fy, fw, fh;
    unsigned int npages, pagenum;

    ethumb_file_get(e, &src_path, NULL);
    document = epdf_document_new(src_path);
    if (!document)
    {
        fprintf(stderr, "ERROR: could not read document: %s\n", src_path);
        ethumb_finished_callback_call(e, 0);
        return;
    }

    page = epdf_page_new(document);
    if (!page)
    {
        fprintf(stderr, "ERROR: could not read document: %s\n", src_path);
        epdf_document_delete(document);
        ethumb_finished_callback_call(e, 0);
        return;
    }

    npages = epdf_document_page_count_get(document);
    pagenum = ethumb_document_page_get(e);
    if (pagenum < npages)
        epdf_page_page_set(page, pagenum);
    epdf_page_size_get(page, &w, &h);
    ethumb_calculate_aspect(e, w, h, &ww, &hh);
    ethumb_plugin_image_resize(e, ww, hh);

    o = evas_object_image_add(ethumb_evas_get(e));
    epdf_page_render(page, o);
    evas_object_resize(o, ww, hh);
    evas_object_move(o, 0, 0);

    ethumb_calculate_fill(e, w, h, &fx, &fy, &fw, &fh);
    evas_object_image_fill_set(o, fx, fy, fw, fh);

    evas_object_show(o);
    ethumb_image_save(e);

    evas_object_del(o);
    epdf_page_delete(page);
    epdf_document_delete(document);

    ethumb_finished_callback_call(e, 1);
}
예제 #11
0
Panel_Button *panel_button(Evas *_e, char *_label, Eina_List *tests)
{
	Evas_Object *o;
	static int y = 200;

	/*
	 * Create the new panel button's information
	 */
	pbutton = malloc(sizeof(Panel_Button));
	pbutton->box = NULL;
	pbutton->label = NULL;

	/*
	 * Now initialize it's fields, create the appearance, and add it to
	 * the evas.
	 */
	o = evas_object_image_add(evas);
	evas_object_image_file_set(o, IM "panel_button1.png",
			IM "panel_button1.png");
	evas_object_image_border_set(o, 3, 3, 3, 3);
	evas_object_resize(o, 85, 30);
	evas_object_image_fill_set(o, 0, 0, 85, 30);
	evas_object_move(o, 10, y);
	evas_object_layer_set(o, 250);
	evas_object_show(o);
	pbutton->box = o;

	o = evas_object_text_add(_e);
	evas_object_text_font_set(o, "andover", 24);
	evas_object_text_text_set(o, _label);
	evas_object_color_set(o, 0, 0, 0, 160);
	evas_object_layer_set(o, 251);
	evas_object_move(o, 15, y + 5);
	evas_object_show(o);
	pbutton->label = o;

	/*
	 * Attach the buttons callbacks
	 */
	evas_object_event_callback_add(pbutton->label, EVAS_CALLBACK_MOUSE_IN,
			  button_mouse_in, NULL);
	evas_object_event_callback_add(pbutton->label, EVAS_CALLBACK_MOUSE_OUT,
			  button_mouse_out, NULL);

	evas_object_event_callback_add(pbutton->label, EVAS_CALLBACK_MOUSE_DOWN,
			  button_mouse_down, tests);

	y += 60;

	return pbutton;
}
예제 #12
0
unsigned int read_texture(Evas_Object *parent, const char *filename) {

    unsigned int gltex_object;
    int w, h;
    int surface_w, surface_h;
    evas_object_geometry_get(parent, NULL, NULL, &surface_w, &surface_h);

    Evas_Object* inline_buffer = elm_win_add(parent,"Img Read",ELM_WIN_INLINED_IMAGE);
    evas_object_move(inline_buffer, 0, 0);
    evas_object_resize(inline_buffer, surface_w, surface_h);
    evas_object_show(inline_buffer);

    Evas* canvas = evas_object_evas_get(inline_buffer);
    Evas_Object* image = evas_object_image_add(canvas);

    char path[200];
    sprintf(path, "%s%s", app_get_resource_path(), filename);
    evas_object_image_file_set(image, path, NULL);
    evas_object_image_size_get(image, &w, &h);
    evas_object_image_fill_set(image, 0, 0, w, h);
    evas_object_image_filled_set(image, EINA_TRUE);
    evas_object_resize(image, w, h);
    evas_object_show(image);

    elm_win_render(inline_buffer);

    GLubyte* pixels;
    pixels = (GLubyte*) evas_object_image_data_get(image, EINA_FALSE);

    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glGenTextures(1, &gltex_object);

    glBindTexture(GL_TEXTURE_2D, gltex_object);

    glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, w, h, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pixels);

    glGenerateMipmap(GL_TEXTURE_2D);

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

    glBindTexture(GL_TEXTURE_2D, 0);

    evas_object_del(inline_buffer);

    return gltex_object;

}
예제 #13
0
/* Adds a rectangle object to the canvas */
static void _etk_test_canvas_object_add(void *data)
{
   Etk_Canvas *canvas;
   Evas *evas;
   Evas_Object *object;
   Etk_Widget *etk_evas_object;
   int x, y;
   int cw, ch;

   if (!(canvas = ETK_CANVAS(data)) || !(evas = etk_widget_toplevel_evas_get(ETK_WIDGET(canvas))))
      return;

   etk_widget_geometry_get(ETK_WIDGET(canvas), NULL, NULL, &cw, &ch);
   x = rand() % cw;
   y = rand() % ch;

   /* Add a rectangle */
   if (rand() % 4 != 0)
   {
      int w, h;
      int r, g, b, a;

      object = evas_object_rectangle_add(evas);
      w = ETK_MAX(abs(rand() % (cw - x)), 10);
      h = ETK_MAX(abs(rand() % (ch - y)), 10);
      evas_object_resize(object, w, h);

      r = rand() % 255;
      g = rand() % 255;
      b = rand() % 255;
      a = ETK_MAX(rand() % 255, 40);
      evas_color_argb_premul(a, &r, &g, &b);

      evas_object_color_set(object, r, g, b, a);
      etk_evas_object = etk_evas_object_new();
			etk_evas_object_set_object(ETK_EVAS_OBJECT(etk_evas_object), object);
   }
   /* Or add an image */
   else
   {
      object = evas_object_image_add(evas);
      evas_object_image_file_set(object, PACKAGE_DATA_DIR "/images/test.png", NULL);
      evas_object_image_fill_set(object, 0, 0, 48, 48);
      evas_object_resize(object, 48, 48);
      etk_evas_object = etk_evas_object_new();
      etk_evas_object_set_object(ETK_EVAS_OBJECT(etk_evas_object), object);
   }

   etk_canvas_put(canvas, etk_evas_object, x, y);
   etk_widget_show_all(etk_evas_object);
}
예제 #14
0
CalaosCameraView::CalaosCameraView(Evas *evas):
    EvasSmart(evas, "PageContentView")
{
    clip = evas_object_rectangle_add(evas);
    evas_object_color_set(clip, 255, 255, 255, 255);
    AddMemberObject(clip);

    camImage = evas_object_image_add(evas);
    evas_object_clip_set(camImage, clip);
    AddMemberObject(camImage);

    handler_data = ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, _url_data_cb, this);
    handler_complete = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, this);
}
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
        evas_object_image_file_set(o, build_path("image.png"), NULL);
	evas_object_image_smooth_scale_set(o, 0);
	evas_object_show(o);
     }
   done = 0;
}
예제 #16
0
static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd)
{
    Evas_Object *bs = evas_object_image_add(sd->base.evas);
    Evas_Object *clip = evas_object_rectangle_add(sd->base.evas);
    evas_object_image_alpha_set(bs, EINA_FALSE);
    evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale);
    evas_object_clip_set(bs, clip);
    evas_object_show(clip);

    evas_object_event_callback_add
        (bs, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip);

    return bs;
}
예제 #17
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
	evas_object_image_file_set(o, build_path("bar.png"), NULL);
	evas_object_image_border_set(o, 6, 6, 6, 6);
	evas_object_show(o);
     }
   done = 0;
}
예제 #18
0
static Evas_Object* _ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data* smartData)
{
    Evas_Object* bs = evas_object_image_add(smartData->base.evas);
    EINA_SAFETY_ON_NULL_RETURN_VAL(bs, 0);
    const Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(smartData->base.evas);
    const char* engine = ecore_evas_engine_name_get(ecoreEvas);
    if (!strncmp(engine, "opengl_x11", strlen("opengl_x11")))
        evas_object_image_content_hint_set(bs, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);

    evas_object_image_alpha_set(bs, false);
    evas_object_image_smooth_scale_set(bs, smartData->zoom_weak_smooth_scale);

    return bs;
}
예제 #19
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o,*src;

   o = evas_object_image_add(evas);
   evas_object_image_file_set(o, build_path("logo.png"), NULL);
   evas_object_image_fill_set(o, 0, 0, 120, 160);
   evas_object_resize(o, 120, 160);
   evas_object_move(o, -400, -300);
   src = o;

   for (i = 0; i < OBNUM / 2; i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
	evas_object_image_source_set(o, src);
	evas_object_resize(o, 120, 160);
	evas_object_image_fill_set(o, 0,0,120,160);
	evas_object_show(o);
     }
   done = 0;
}
예제 #20
0
static void _smart_add(Evas_Object * obj)
{
    Smart_Data *sd;

    sd = calloc(1, sizeof(Smart_Data));
    if (!sd)
        return;
    sd->obj = evas_object_image_add(evas_object_evas_get(obj));
    sd->x = 0;
    sd->y = 0;
    sd->w = 0;
    sd->h = 0;
    evas_object_smart_member_add(sd->obj, obj);
    evas_object_smart_data_set(obj, sd);
}
예제 #21
0
//Create the cover object and swallow it into the window
//Return 0 if failed
static Evas_Bool _eclair_create_cover_object(Eclair *eclair, Eclair_Window *window)
{
   Evas_Coord cover_width, cover_height;

   if (!eclair || !window)
      return 0;

   if (edje_object_part_exists(window->edje_object, "cover"))
   {
      if (eclair->cover)
         evas_object_del(eclair->cover);
      if (eclair->previous_cover)
      {
         evas_object_del(eclair->previous_cover);
         eclair->previous_cover = NULL;
      }
      eclair->cover = evas_object_image_add(window->evas);
      evas_object_repeat_events_set(eclair->cover, 1);
      edje_object_part_swallow(window->edje_object, "cover", eclair->cover);
      edje_object_part_geometry_get(window->edje_object, "cover", NULL, NULL, &cover_width, &cover_height);
      evas_object_image_fill_set(eclair->cover, 0, 0, cover_width, cover_height);
      evas_object_hide(eclair->cover);
      if (edje_object_part_exists(window->edje_object, "previous_cover"))
      {
         eclair->previous_cover = evas_object_image_add(window->evas);
         evas_object_repeat_events_set(eclair->previous_cover, 1);
         edje_object_part_swallow(window->edje_object, "previous_cover", eclair->previous_cover);
         edje_object_part_geometry_get(window->edje_object, "previous_cover", NULL, NULL, &cover_width, &cover_height);
         evas_object_image_fill_set(eclair->previous_cover, 0, 0, cover_width, cover_height);
         evas_object_show(eclair->previous_cover);
      }
      eclair->cover_owner = window;
      return 1;
   }
   return 0;
}
예제 #22
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   for (i = 0; i < (OBNUM / 2); i++)
     {
	o = evas_object_image_add(evas);
	o_images[i] = o;
        evas_object_image_file_set(o, build_path("logo.png"), NULL);
	evas_object_image_fill_set(o, 0, 0, 120, 160);
	evas_object_resize(o, 120, 160);
	evas_object_show(o);
     }
   done = 0;
}
예제 #23
0
파일: esmart_dvi.c 프로젝트: Limsik/e17
static void
_smart_add (Evas_Object *obj)
{
  Smart_Dvi *sp;

  sp = calloc (1, sizeof (Smart_Dvi));
  if (!sp) return;

  sp->obj = evas_object_image_add (evas_object_evas_get (obj));
/*   evas_object_event_callback_add (sp->obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, sp); */
/*   evas_object_event_callback_add (sp->obj, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, sp); */
/*   evas_object_image_pixels_get_callback_set (sp->obj, _pixels_get, sp); */
  evas_object_smart_member_add (sp->obj, obj);

  evas_object_image_alpha_set (sp->obj, 0);
  evas_object_smart_data_set (obj, sp);
}
예제 #24
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o,*src;

   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	evas_object_image_file_set(o, build_path("logo.png"), NULL);
	evas_object_image_fill_set(o, 0, 0, 120, 160);
	evas_object_resize(o, 120, 160);
	evas_object_filter_set(o, EVAS_FILTER_SEPIA);
	evas_object_show(o);
	src = o;
	o_images[i] = src;
     }

   done = 0;
}
예제 #25
0
파일: main.c 프로젝트: playya/Enlightenment
Etheme_Object * etheme_new(const char * t) {

	Etheme_Object * o;
	o = (Etheme_Object *) malloc(sizeof(Etheme_Object));

	o->theme = (char *) strdup(t);
	o->thumbpath = e_preview_thumb_file_get(t);


	int size = strlen(t) - 4; /* without .edj */

	o->label = malloc(sizeof(char) * size);
	o->label = strncpy(o->label, t, size);
	o->label[size] = 0;
		
	o->button = edje_object_add(evas);

	edje_object_file_set(o->button, default_theme, "fileman/icon_normal");
	evas_object_resize(o->button, 100, 120);
	edje_object_part_text_set(o->button, "icon_title" , o->label);
		
	esmart_container_element_append(container, o->button);
	
	if (e_preview_thumb_check(t))
		e_preview_thumb_generate(t);
		
	o->thumb = evas_object_image_add(evas);
	evas_object_image_size_set(o->thumb, 640, 480);
	evas_object_image_fill_set(o->thumb, 0, 0, 85, 85);
	e_preview_thumb_image(o->thumbpath, o->thumb);

	edje_object_part_swallow(o->button, "icon_swallow", o->thumb);

	evas_object_show(o->button);

	edje_object_signal_callback_add(o->button, "mouse,up,1", "icon_event",
				_preview_theme, o);
		
	
	return o;

}
예제 #26
0
파일: map_example_02.c 프로젝트: Limsik/e17
static Evas_Object *
_box_get(Evas_Object *obj, Overlay_Data *data)
{
   Evas_Object *bx, *img, *label;
   bx = elm_box_add(obj);
   evas_object_show(bx);

   img = evas_object_image_add(evas_object_evas_get(obj));
   evas_object_image_file_set(img, data->file, NULL);
   evas_object_image_filled_set(img, EINA_TRUE);
   evas_object_size_hint_min_set(img, 64, 64);
   evas_object_show(img);
   elm_box_pack_end(bx, img);

   label = elm_label_add(obj);
   elm_object_text_set(label, data->name);
   evas_object_show(label);
   elm_box_pack_end(bx, label);
   return bx;
}
예제 #27
0
void EflResources::preloadImage( std::string const& _path
                               , bool const         _force )
{
    if( 0 == preloaded_images__.count( _path ) || _force )
    {
        Evas_Object* object = evas_object_image_add( window__ );

        std::ostringstream size;
        size << max_width__ << " " << max_height__;
        std::string cmd( APPNAME "_ic \"" + _path + "\" \"" + cache_dir
                       + _path + "\" " + size.str() );

        CCallbackHandler::spawnProc( cmd
                                   , [=](){ preloadCachedImageCb__( _path ); } );

        preloaded_images__[_path] = object;
    }
    else
        signals__[PRELOAD_SUCCESS]->emit();
}
예제 #28
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o,*src;

   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	evas_object_image_file_set(o, build_path("logo.png"), NULL);
	evas_object_image_fill_set(o, 0, 0, 120, 160);
	evas_object_resize(o, 120, 160);
	evas_object_filter_set(o, EVAS_FILTER_BRIGHTNESS);
	evas_object_filter_param_float_set(o, "adjust", i / (double)OBNUM);
	evas_object_show(o);
	src = o;
	o_images[i] = src;
     }

   done = 0;
}
예제 #29
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o,*src;

   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	evas_object_image_file_set(o, build_path("image.png"), NULL);
	evas_object_image_fill_set(o, 0, 0, 120, 160);
	evas_object_resize(o, 120, 160);
	evas_object_filter_set(o, EVAS_FILTER_BLUR);
	evas_object_filter_param_int_set(o, "radius", 5);
	evas_object_layer_set(o,1);
	evas_object_show(o);
	src = o;
	o_images[i] = src;
     }

   done = 0;
}
예제 #30
0
static Evas_Object *
engage_element_icon_new(Evas * evas, const char *file, const char *group)
{
  int             iw, ih;
  Evas_Object    *result = NULL;

  /* edje */
  if (group) {
    if (file && file[0] == '/') {
      result = edje_object_add(evas);
      if (edje_object_file_set(result, file, group) > 0) {
        evas_object_move(result, -9999, -9999);
        evas_object_resize(result, 4, 4);
      }
    } else {
      evas_object_del(result);
      result = NULL;
    }
  }
  /* image */
  else {
    if (file && file[0] == '/') {
      result = evas_object_image_add(evas);
      evas_object_image_file_set(result, file, NULL);
      switch (evas_object_image_load_error_get(result)) {
      case EVAS_LOAD_ERROR_NONE:
        evas_object_move(result, -9999, -9999);
        evas_object_resize(result, 4, 4);
        break;
      default:
        evas_object_del(result);
        result = NULL;
      }
    } else {
      evas_object_del(result);
      result = NULL;
    }
  }
  return (result);
}