X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Frender.h;h=706843e33d3aaca4730651619fb2e7cb9547ef35;hb=91a9000d166606fc322186b24f4f105fa9a53394;hp=5d1d15522cc1fce3c2084bb1bb20c6fe01a59b8d;hpb=ea435b99a804b755312bcbb9371faa4c0111d43e;p=chaz%2Fopenbox diff --git a/render/render.h b/render/render.h index 5d1d1552..706843e3 100644 --- a/render/render.h +++ b/render/render.h @@ -142,12 +142,12 @@ struct _RrTextureText { gint shadow_offset_x; gint shadow_offset_y; RrColor *shadow_color; - guchar shadow_alpha; gboolean shortcut; /*!< Underline a character */ guint shortcut_pos; /*!< Position in bytes of the character to underline */ RrEllipsizeMode ellipsize; gboolean flow; /* allow multiple lines. must set maxwidth below */ gint maxwidth; + guchar shadow_alpha; /* at the bottom to improve alignment */ }; struct _RrPixmapMask { @@ -227,6 +227,9 @@ struct _RrAppearance { struct _RrImagePic { gint width, height; RrPixel32 *data; + /* The sum of all the pixels. This is used to compare pictures if their + hashes match. */ + gint sum; }; /*! An RrImage is a sort of meta-image. It can contain multiple versions of @@ -234,11 +237,18 @@ struct _RrImagePic { pictures */ struct _RrImage { gint ref; - struct _RrImageCache *cache; + RrImageCache *cache; - struct _RrImagePic **original; + /*! An array of "originals", that is of RrPictures that have been added + to the image in various sizes, and that have not been resized. These + are explicitly added to the RrImage. */ + RrImagePic **original; gint n_original; - struct _RrImagePic **resized; + /*! An array of "resized" pictures. When an "original" RrPicture + needs to be resized for drawing, it is saved in here so that it doesn't + need to be resized again. These are automatically added to the + RrImage. */ + RrImagePic **resized; gint n_resized; }; @@ -317,7 +327,10 @@ gboolean RrPixmapToRGBA(const RrInstance *inst, Pixmap pmap, Pixmap mask, gint *w, gint *h, RrPixel32 **data); -RrImageCache* RrImageCacheNew(); +/*! Create a new image cache for RrImages. + @param max_resized_saved The number of resized copies of an image to save +*/ +RrImageCache* RrImageCacheNew(gint max_resized_saved); void RrImageCacheRef(RrImageCache *self); void RrImageCacheUnref(RrImageCache *self);