Enlightenment CVS committal Author : titan Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_enums.h ewl_image.h ewl_image.c Log Message: Add Ewl_Thumbnail_Size with the options of EWL_THUMBNAIL_SIZE_LARGE and EWL_THUMBNAIL_SIZE_NORMAL to specify the size of ewl_image_thumbnails. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v retrieving revision 1.78 retrieving revision 1.79 diff -u -3 -r1.78 -r1.79 --- ewl_enums.h 20 May 2007 20:02:59 -0000 1.78 +++ ewl_enums.h 9 Jul 2007 20:54:37 -0000 1.79 @@ -845,6 +845,21 @@ typedef enum Ewl_Image_Type Ewl_Image_Type; /** + * @enum Ewl_Thumbnail_Size + * The size of thumbnails + */ +enum Ewl_Thumbnail_Size +{ + EWL_THUMBNAIL_SIZE_NORMAL, /**< Normal size thumbnail */ + EWL_THUMBNAIL_SIZE_LARGE, /**< A large thumbnail*/ +}; + +/** + * The Ewl_Thumbnail_Size + */ +typedef enum Ewl_Thumbnail_Size Ewl_Thumbnail_Size; + +/** * @} */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_image.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_image.h 23 Mar 2007 22:06:30 -0000 1.36 +++ ewl_image.h 9 Jul 2007 20:54:37 -0000 1.37 @@ -82,6 +82,7 @@ { Ewl_Image image; /**< Inherit from Ewl_Image */ void *thumb; /**< Outstanding request to thumbnail image */ + Ewl_Thumbnail_Size size; /**< Size of the thumbnails>*/ Ewl_Widget *orig; /**< Reference to image used to create thumb */ }; @@ -117,7 +118,7 @@ void ewl_image_tile_set(Ewl_Image *i, int x, int y, int w, int h); void ewl_image_constrain_set(Ewl_Image *i, unsigned int size); -unsigned int ewl_image_constrain_get(Ewl_Image *i); +Ewl_Thumbnail_Size ewl_image_constrain_get(Ewl_Image *i); void ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient); void ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate); @@ -126,6 +127,9 @@ Ewl_Widget *ewl_image_thumbnail_new(void); int ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image); +void ewl_image_thumbnail_size_set(Ewl_Image_Thumbnail *thumb, + unsigned int s); +unsigned int ewl_image_thumbnail_size_get(Ewl_Image_Thumbnail *thumb); void ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb, const char *path); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_image.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -3 -r1.61 -r1.62 --- ewl_image.c 4 Jul 2007 17:09:29 -0000 1.61 +++ ewl_image.c 9 Jul 2007 20:54:37 -0000 1.62 @@ -679,6 +679,7 @@ ewl_callback_prepend(EWL_WIDGET(image), EWL_CALLBACK_DESTROY, ewl_image_thumbnail_cb_destroy, NULL); + image->size = EWL_THUMBNAIL_SIZE_NORMAL; #ifdef BUILD_EPSILON_SUPPORT if (!ewl_image_epsilon_handler) { @@ -693,6 +694,38 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } +/** + * @param thumb: The image thumbnail to set the size on + * @param s: The Ewl_Thumbnail_Size to set for the image + * @return Returns no value. + * @brief This will set the size of the thumbnails + */ +void +ewl_image_thumbnail_size_set(Ewl_Image_Thumbnail *thumb, Ewl_Thumbnail_Size s) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("thumb", thumb); + DCHECK_TYPE("thumb", thumb, EWL_IMAGE_THUMBNAIL_TYPE); + + thumb->size = s; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param thumb: The image thumbnail to get the size from + * @return Returns the size of the thumbnail. + * @brief This will return the current size of thumbnails + */ +Ewl_Thumbnail_Size +ewl_image_thumbnail_size_get(Ewl_Image_Thumbnail *thumb) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("thumb", thumb, EWL_THUMBNAIL_SIZE_NORMAL); + + DRETURN_INT(thumb->size, DLEVEL_STABLE); +} + /** * @param thumb: The thumbnail to request * @param path: The path to the image @@ -703,13 +736,19 @@ void ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb, const char *path) { + Ewl_Thumbnail_Size size; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("thumb", thumb); DCHECK_TYPE("thumb", thumb, EWL_IMAGE_THUMBNAIL_TYPE); DCHECK_PARAM_PTR("path", path); #ifdef BUILD_EPSILON_SUPPORT - thumb->thumb = epsilon_add((char *)path, NULL, EPSILON_THUMB_NORMAL, thumb); + if (thumb->size == EWL_THUMBNAIL_SIZE_NORMAL) + size = EPSILON_THUMB_NORMAL; + else size = EPSILON_THUMB_LARGE; + + thumb->thumb = epsilon_add((char *)path, NULL, size, thumb); #else thumb->thumb = NULL; #endif ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs