r136: This commit was manufactured by cvs2svn to create tag 'hv_1_1_8'.
[cinelerra_cv/ct.git] / hvirtual / guicast / bctheme.h
blob376e19a57fad8f34ecaabaa63a086148932dd831
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 // Must set path of resource file before loading first image.
22 // Path defaults to executable path.
23 void set_path(char *path);
25 // Reverts the path to the executable path. Useful for base classes
26 // which need to fill unset images with defaults after they've been created.
27 void unset_path();
29 VFrame** new_button(char *overlay_path,
30 char *up_path,
31 char *hi_path,
32 char *dn_path);
33 VFrame** new_button(char *overlay_path,
34 VFrame *up,
35 VFrame *hi,
36 VFrame *dn);
37 VFrame** new_toggle(char *overlay_path,
38 char *up_path,
39 char *hi_path,
40 char *checked_path,
41 char *dn_path,
42 char *checkedhi_path);
43 VFrame** new_toggle(char *overlay_path,
44 VFrame *up,
45 VFrame *hi,
46 VFrame *checked,
47 VFrame *dn,
48 VFrame *checkedhi);
51 // The two main routines for creating images are new_image_set and new_image.
52 // If the title already exists in the table, the existing entry is returned.
53 // These create image sets which are stored in the set table.
54 // Takes comma delimited char* pointers to filenames.
55 VFrame** new_image_set(char *title, int total, va_list *args);
56 VFrame** new_image_set(char *title, int total, ...);
57 VFrame** new_image_set(int total, ...);
60 // Decompresses image and puts on images table before returning it.
61 VFrame* new_image(char *title, char *path);
62 VFrame* new_image(char *path);
65 // These retrieve images based on case sensitive title
66 VFrame* get_image(char *title);
67 VFrame** get_image_set(char *title);
69 // Loads compressed data into temporary
70 unsigned char* get_image_data(char *title);
72 // Verify all images have been used after initialization.
73 void check_used();
75 void dump();
76 BC_Resources* get_resources();
78 private:
79 void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1);
80 void init_contents();
84 // Decompressed image storage.
85 // Sets of images.
86 ArrayList<BC_ThemeSet*> image_sets;
87 char path[BCTEXTLEN];
88 char default_path[BCTEXTLEN];
90 // Compressed images are loaded in here.
91 char *data_buffer;
92 char *contents_buffer;
93 ArrayList<char*> contents;
94 ArrayList<int> offsets;
95 ArrayList<int> used;
96 char *last_image;
97 int last_offset;
100 class BC_ThemeSet
102 public:
103 // Set is_reference if the images are going to be created by new_image
104 BC_ThemeSet(int total, int is_reference, char *title);
105 ~BC_ThemeSet();
107 VFrame **data;
108 char *title;
109 int total;
110 int is_reference;
115 #endif