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 
00083 struct Ewl_Image_Thumbnail
00084 {
00085         Ewl_Image image;        
00086         void *thumb; 
00087         Ewl_Thumbnail_Size size; 
00088         Ewl_Widget *orig;  
00089 };
00090 
00094 typedef struct Ewl_Image_Thumbnail Ewl_Image_Thumbnail;
00095 
00100 #define EWL_IMAGE_THUMBNAIL(image) ((Ewl_Image_Thumbnail *) image)
00101 
00102 Ewl_Widget        *ewl_image_new(void);
00103 int                 ewl_image_init(Ewl_Image *i);
00104 Ewl_View         *ewl_image_view_get(void);
00105 
00106 void                 ewl_image_file_set(Ewl_Image *i, const char *im,
00107                                                 const char *key);
00108 void                 ewl_image_file_path_set(Ewl_Image *i, const char *im);
00109 const char        *ewl_image_file_path_get(Ewl_Image *i);
00110 
00111 void                 ewl_image_file_key_set(Ewl_Image *i, const char *key);
00112 const char         *ewl_image_file_key_get(Ewl_Image *i);
00113 
00114 void                 ewl_image_proportional_set(Ewl_Image *i, char p);
00115 char                  ewl_image_proportional_get(Ewl_Image *i);
00116 void                 ewl_image_scale_set(Ewl_Image *i, double wp, double hp);
00117 void                 ewl_image_scale_get(Ewl_Image *i, double *wp, double *hp);
00118 void                 ewl_image_size_set(Ewl_Image *i, int w, int h);
00119 void                 ewl_image_size_get(Ewl_Image *i, int *w, int *h);
00120 void                 ewl_image_tile_set(Ewl_Image *i, int x, int y,
00121                                                 int w, int h);
00122 void                  ewl_image_constrain_set(Ewl_Image *i, unsigned int size);
00123 unsigned int         ewl_image_constrain_get(Ewl_Image *i);
00124 
00125 void                 ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient);
00126 void                 ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate);
00127 
00128 Ewl_Widget         *ewl_image_thumbnail_get(Ewl_Image *i);
00129 
00130 Ewl_Widget         *ewl_image_thumbnail_new(void);
00131 int                  ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image);
00132 void                 ewl_image_thumbnail_size_set(Ewl_Image_Thumbnail *thumb,
00133                                                         Ewl_Thumbnail_Size s);
00134 Ewl_Thumbnail_Size ewl_image_thumbnail_size_get(Ewl_Image_Thumbnail *thumb);
00135 void                  ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb,
00136                                                 const char *path);
00137 
00138 /*
00139  * Internally used callbacks, override at your own risk.
00140  */
00141 void ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data, void *user_data);
00142 void ewl_image_cb_obscure(Ewl_Widget *w, void *ev_data, void *user_data);
00143 void ewl_image_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
00144 void ewl_image_cb_mouse_down(Ewl_Widget *w, void *ev_data, void *user_data);
00145 void ewl_image_cb_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data);
00146 void ewl_image_cb_mouse_move(Ewl_Widget *w, void *ev_data, void *user_data);
00147 void ewl_image_cb_destroy(Ewl_Widget *w, void *ev_data, void *user_data );
00148 
00153 #endif

Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sat May 17 16:49:05 2008