Merge with MPC-HC 6d1472b2f18266d92e5bc068667de348c0cd3b3b.
[xy_vsfilter.git] / src / subtitles / draw_item.h
blob21e6b369c11e927158f12fa1be69f4c16d6c32f8
1 #ifndef __DRAW_ITEM_21D18040_C396_4CA5_BFCE_5616A63F2C56_H__
2 #define __DRAW_ITEM_21D18040_C396_4CA5_BFCE_5616A63F2C56_H__
4 #include <WTypes.h>
5 #include "RTS.h"
6 #include <atlcoll.h>
7 #include <boost/shared_ptr.hpp>
8 #include "xy_bitmap.h"
10 class OverlayPaintMachine;
11 typedef ::boost::shared_ptr<OverlayPaintMachine> SharedPtrOverlayPaintMachine;
13 class CClipperPaintMachine;
14 typedef ::boost::shared_ptr<CClipperPaintMachine> SharedPtrCClipperPaintMachine;
16 class DrawItemHashKey;
17 typedef ::boost::shared_ptr<DrawItemHashKey> SharedPtrDrawItemHashKey;
19 struct DrawItem
21 public:
22 SharedPtrOverlayPaintMachine overlay_paint_machine;
23 CRect clip_rect;
24 SharedPtrCClipperPaintMachine clipper;
25 int xsub;
26 int ysub;
27 DWORD switchpts[6];
28 bool fBody;
29 bool fBorder;
31 SharedPtrDrawItemHashKey m_key;
32 public:
33 CRectCoor2 GetDirtyRect();
34 static CRectCoor2 Draw( XyBitmap *bitmap, DrawItem& draw_item, const CRectCoor2& clip_rect );
35 const SharedPtrDrawItemHashKey& GetHashKey();
37 static DrawItem* CreateDrawItem(const SharedPtrOverlayPaintMachine& overlay_paint_machine,
38 const CRect& clipRect,
39 const SharedPtrCClipperPaintMachine &clipper,
40 int xsub, int ysub,
41 const DWORD* switchpts, bool fBody, bool fBorder);
44 typedef ::boost::shared_ptr<DrawItem> SharedPtrDrawItem;
46 typedef CAtlList<DrawItem> DrawItemList;
48 typedef CAtlList<DrawItemList> DrawItemListList;
51 struct CompositeDrawItem;
52 typedef CAtlList<CompositeDrawItem> CompositeDrawItemList;
53 typedef CAtlList<CompositeDrawItemList> CompositeDrawItemListList;
55 struct CompositeDrawItem
57 public:
58 SharedPtrDrawItem shadow;
59 SharedPtrDrawItem outline;
60 SharedPtrDrawItem body;
61 public:
62 static CRectCoor2 GetDirtyRect( CompositeDrawItem& item );
64 static void Draw(XySubRenderFrame**output, CompositeDrawItemListList& compDrawItemListList);
67 struct GroupedDrawItems
69 public:
70 CAtlList<SharedPtrDrawItem> draw_item_list;
71 CRectCoor2 clip_rect;
72 public:
73 void Draw(SharedPtrXyBitmap *bitmap, int *bitmap_identity_num);
75 void CreateHashKey(GroupedDrawItemsHashKey *key);
78 #endif // __DRAW_ITEM_21D18040_C396_4CA5_BFCE_5616A63F2C56_H__