Create FUNDING.yml
[wdl/wdl-ol.git] / WDL / wingui / virtwnd-skin.h
blob6038745e4dbcca4eee74b375967d4a7d144ff60c
1 #ifndef _WDL_VIRTWND_SKIN_H_
2 #define _WDL_VIRTWND_SKIN_H_
4 class LICE_IBitmap;
6 #include "../ptrlist.h"
8 typedef struct // if set these override the default virtualwnd styles for this object
10 LICE_IBitmap *bgimage;
11 int bgimage_lt[2],bgimage_rb[2]; // size of
12 int bgimage_lt_out[2],bgimage_rb_out[2]; // size of outside area (like shadows)
13 int bgimage_noalphaflags; // 4x4 flags of "no alpha", so 65535 is image has no alpha whatsoever
14 } WDL_VirtualWnd_BGCfg;
18 class WDL_VirtualWnd_BGCfgCache_ar;
20 class WDL_VirtualWnd_BGCfgCache
22 public:
23 WDL_VirtualWnd_BGCfgCache(int want_size=15, int max_size=30);
24 ~WDL_VirtualWnd_BGCfgCache();
26 void Invalidate();
28 LICE_IBitmap *GetCachedBG(int w, int h, void *owner_hint, const LICE_IBitmap *bgbmp);
29 LICE_IBitmap *SetCachedBG(int w, int h, LICE_IBitmap *bm, void *owner_hint, const LICE_IBitmap *bgbmp);
31 private:
32 WDL_VirtualWnd_BGCfgCache_ar *m_ar;
35 int m_want_size, m_max_size;
38 void WDL_VirtualWnd_PreprocessBGConfig(WDL_VirtualWnd_BGCfg *a);
40 // used by elements to draw a WDL_VirtualWnd_BGCfg
41 #define WDL_VWND_SCALEDBLITBG_IGNORE_LR 0x40000000
42 #define WDL_VWND_SCALEDBLITBG_IGNORE_INSIDE 0x20000000
43 #define WDL_VWND_SCALEDBLITBG_IGNORE_OUTSIDE 0x10000000
44 void WDL_VirtualWnd_ScaledBlitBG(LICE_IBitmap *dest,
45 WDL_VirtualWnd_BGCfg *src,
46 int destx, int desty, int destw, int desth,
47 int clipx, int clipy, int clipw, int cliph,
48 float alpha, int mode);
49 int WDL_VirtualWnd_ScaledBG_GetPix(WDL_VirtualWnd_BGCfg *src,
50 int ww, int wh,
51 int x, int y);
53 void WDL_VirtualWnd_ScaledBlitSubBG(LICE_IBitmap *dest,
54 WDL_VirtualWnd_BGCfg *src,
55 int destx, int desty, int destw, int desth,
56 int clipx, int clipy, int clipw, int cliph,
57 int srcx, int srcy, int srcw, int srch, // these coordinates are not including pink lines (i.e. if pink lines are present, use src->bgimage->getWidth()-2, etc)
58 float alpha, int mode);
61 typedef struct // if set these override the default virtualwnd styles for this object
63 WDL_VirtualWnd_BGCfg bgimagecfg[2];
64 LICE_IBitmap *thumbimage[2]; // h,v
65 int thumbimage_lt[2],thumbimage_rb[2];
66 unsigned int zeroline_color; // needs alpha channel set!
67 } WDL_VirtualSlider_SkinConfig;
69 void WDL_VirtualSlider_PreprocessSkinConfig(WDL_VirtualSlider_SkinConfig *a);
71 typedef struct
73 LICE_IBitmap *image; // 3x width, second third is "mouseover" image. then mousedown, or straight image if image_issingle set
74 LICE_IBitmap *olimage; // drawn in second pass
76 union
78 char flags; // &1 = overlay, &2=main
79 bool asBool; // on PPC this is 4 bytes, need to preserve it
81 image_ltrb_used;
82 bool image_issingle;
83 short image_ltrb_ol[4]; // extents outside the rect
84 short image_ltrb_main[4]; // unscaled areas of main image (not used if single)
85 } WDL_VirtualIconButton_SkinConfig;
87 void WDL_VirtualIconButton_PreprocessSkinConfig(WDL_VirtualIconButton_SkinConfig *a);
91 #endif