r499: This commit was manufactured by cvs2svn to create tag 'r1_2_1-last'.
[cinelerra_cv/mob.git] / hvirtual / guicast / bctheme.h
blob3d24b13483f3cb1dd743980c69833ee955a2016f
1 #ifndef BCTHEME_H
2 #define BCTHEME_H
4 #include "arraylist.h"
5 #include "bcresources.inc"
6 #include "bcwindowbase.inc"
7 #include "vframe.inc"
8 #include <stdarg.h>
10 class BC_ThemeSet;
15 class BC_Theme
17 public:
18 BC_Theme();
19 virtual ~BC_Theme();
21 // Set pointer to binary object containing images and contents.
22 // Immediately loads the contents from the object.
23 void set_data(unsigned char *ptr);
25 VFrame** new_button(char *overlay_path,
26 char *up_path,
27 char *hi_path,
28 char *dn_path);
29 VFrame** new_button(char *overlay_path,
30 VFrame *up,
31 VFrame *hi,
32 VFrame *dn);
33 VFrame** new_toggle(char *overlay_path,
34 char *up_path,
35 char *hi_path,
36 char *checked_path,
37 char *dn_path,
38 char *checkedhi_path);
39 VFrame** new_toggle(char *overlay_path,
40 VFrame *up,
41 VFrame *hi,
42 VFrame *checked,
43 VFrame *dn,
44 VFrame *checkedhi);
47 // The two main routines for creating images are new_image_set and new_image.
48 // If the title already exists in the table, the existing entry is returned.
49 // These create image sets which are stored in the set table.
50 // Takes comma delimited char* pointers to filenames.
51 VFrame** new_image_set(char *title, int total, va_list *args);
52 VFrame** new_image_set(char *title, int total, ...);
53 VFrame** new_image_set(int total, ...);
56 // Decompresses image and puts on images table before returning it.
57 VFrame* new_image(char *title, char *path);
58 VFrame* new_image(char *path);
61 // These retrieve images based on case sensitive title
62 VFrame* get_image(char *title);
63 VFrame** get_image_set(char *title);
65 // Loads compressed data into temporary
66 unsigned char* get_image_data(char *title);
68 // Verify all images have been used after initialization.
69 void check_used();
71 void dump();
72 BC_Resources* get_resources();
74 private:
75 void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1);
76 void init_contents();
80 // Decompressed image storage.
81 // Sets of images.
82 ArrayList<BC_ThemeSet*> image_sets;
84 // Compressed images are loaded in here.
85 char *data_ptr;
86 char *contents_ptr;
87 ArrayList<char*> contents;
88 ArrayList<unsigned char*> pointers;
89 ArrayList<int> used;
90 char *last_image;
91 unsigned char *last_pointer;
94 class BC_ThemeSet
96 public:
97 // Set is_reference if the images are going to be created by new_image
98 BC_ThemeSet(int total, int is_reference, char *title);
99 ~BC_ThemeSet();
101 VFrame **data;
102 char *title;
103 int total;
104 int is_reference;
109 #endif