Download

Support

lib/ewl_image.h

Go to the documentation of this file.
00001 /* vim: set sw=8 ts=8 sts=8 expandtab: */
00002 #ifndef EWL_IMAGE_H
00003 #define EWL_IMAGE_H
00004 
00005 #include "ewl_view.h"
00027 #define EWL_IMAGE_TYPE "image"
00028 
00033 #define EWL_IMAGE_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_IMAGE_TYPE))
00034 
00038 typedef struct Ewl_Image Ewl_Image;
00039 
00044 #define EWL_IMAGE(image) ((Ewl_Image *) image)
00045 
00049 struct Ewl_Image
00050 {
00051         Ewl_Widget widget;      
00052         Ewl_Image_Type type;    
00053         void *image;            
00054         char *path;             
00055         char *key;              
00056         char proportional;      
00057         int ow,                 
00058             oh;                 
00059         double sw,              
00060                sh;              
00061         int cs;                 
00062         int aw,                 
00063             ah;                 
00065         struct {
00066                 int set;        
00067                 int x,          
00068                     y,          
00069                     w,          
00070                     h;          
00071         } tile;                 
00072 };
00073 
00078 #define EWL_IMAGE_THUMBNAIL_TYPE "image_thumbnail"
00079 
00084 #define EWL_IMAGE_THUMBNAIL_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), \
00085                         EWL_IMAGE_THUMBNAIL_TYPE))
00086 
00090 struct Ewl_Image_Thumbnail
00091 {
00092         Ewl_Image image;        
00093         void *thumb; 
00094         Ewl_Thumbnail_Size size; 
00095         Ewl_Widget *orig;  
00096 };
00097 
00101 typedef struct Ewl_Image_Thumbnail Ewl_Image_Thumbnail;
00102 
00107 #define EWL_IMAGE_THUMBNAIL(image) ((Ewl_Image_Thumbnail *) image)
00108 
00109 Ewl_Widget              *ewl_image_new(void);
00110 int                      ewl_image_init(Ewl_Image *i);
00111 Ewl_View                *ewl_image_view_get(void);
00112 
00113 void                     ewl_image_file_set(Ewl_Image *i, const char *im,
00114                                         const char *key);
00115 void                     ewl_image_file_path_set(Ewl_Image *i, const char *im);
00116 const char              *ewl_image_file_path_get(Ewl_Image *i);
00117 
00118 void                     ewl_image_file_key_set(Ewl_Image *i, const char *key);
00119 const char              *ewl_image_file_key_get(Ewl_Image *i);
00120 
00121 void                     ewl_image_proportional_set(Ewl_Image *i, char p);
00122 char                     ewl_image_proportional_get(Ewl_Image *i);
00123 void                     ewl_image_scale_set(Ewl_Image *i, double wp,
00124                                         double hp);
00125 void                     ewl_image_scale_get(Ewl_Image *i, double *wp,
00126                                         double *hp);
00127 void                     ewl_image_size_set(Ewl_Image *i, int w, int h);
00128 void                     ewl_image_size_get(Ewl_Image *i, int *w, int *h);
00129 void                     ewl_image_tile_set(Ewl_Image *i, int x, int y, int w,
00130                                         int h);
00131 void                     ewl_image_constrain_set(Ewl_Image *i,
00132                                         unsigned int size);
00133 unsigned int             ewl_image_constrain_get(Ewl_Image *i);
00134 
00135 void                     ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient);
00136 void                     ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate);
00137 
00138 void                    *ewl_image_data_get(Ewl_Image *i, int *w, int *h,
00139                                                 Ewl_Image_Data_Mode mode);
00140 unsigned int             ewl_image_data_set(Ewl_Image *i, void *data, int w,
00141                                                 int h, Ewl_Colorspace cs);
00142 void                     ewl_image_data_update_add(Ewl_Image *i, int x, int y,
00143                                                 int w, int h);
00144 
00145 Ewl_Widget              *ewl_image_thumbnail_get(Ewl_Image *i);
00146 
00147 Ewl_Widget              *ewl_image_thumbnail_new(void);
00148 int                      ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image);
00149 void                     ewl_image_thumbnail_size_set
00150                                         (Ewl_Image_Thumbnail *thumb,
00151                                         Ewl_Thumbnail_Size s);
00152 Ewl_Thumbnail_Size       ewl_image_thumbnail_size_get
00153                                         (Ewl_Image_Thumbnail *thumb);
00154 void                     ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb,
00155                                         const char *path);
00156 
00157 /*
00158  * Internally used callbacks, override at your own risk.
00159  */
00160 void ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data, void *user_data);
00161 void ewl_image_cb_obscure(Ewl_Widget *w, void *ev_data, void *user_data);
00162 void ewl_image_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
00163 void ewl_image_cb_destroy(Ewl_Widget *w, void *ev_data, void *user_data );
00164 
00169 #endif

Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sun Sep 27 01:48:49 2009