Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / guicast / bctheme.h
blob8bc5d42d2e8b428dd7631bc1a273ddeb7ee3f897
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 // Compose widgets using standard images.
26 // The arguments are copied into new VFrames for a new image set.
27 // The image set is put in the image table only if the title is nonzero.
28 VFrame** new_button(char *overlay_path,
29 char *up_path,
30 char *hi_path,
31 char *dn_path,
32 char *title = 0);
33 VFrame** new_button4(char *overlay_path,
34 char *up_path,
35 char *hi_path,
36 char *dn_path,
37 char *disabled_path,
38 char *title = 0);
39 VFrame** new_button(char *overlay_path,
40 VFrame *up,
41 VFrame *hi,
42 VFrame *dn,
43 char *title = 0);
44 VFrame** new_toggle(char *overlay_path,
45 char *up_path,
46 char *hi_path,
47 char *checked_path,
48 char *dn_path,
49 char *checkedhi_path,
50 char *title = 0);
51 VFrame** new_toggle(char *overlay_path,
52 VFrame *up,
53 VFrame *hi,
54 VFrame *checked,
55 VFrame *dn,
56 VFrame *checkedhi,
57 char *title = 0);
60 // The two main routines for creating images are new_image_set and new_image.
61 // If the title already exists in the table, the existing entry is returned.
62 // These create image sets which are stored in the set table.
63 // Takes comma delimited char* pointers to filenames.
64 VFrame** new_image_set(char *title, int total, va_list *args);
65 VFrame** new_image_set(char *title, int total, ...);
66 VFrame** new_image_set(int total, ...);
67 // Creates an image set from VFrame pointers.
68 // The images are considered not references and deleted with the image set.
69 // If the title already exists, the existing entry is deleted and overridden.
70 VFrame** new_image_set_images(char *title, int total, ...);
72 // Decompresses image and puts on images table before returning it.
73 VFrame* new_image(char *title, char *path);
74 VFrame* new_image(char *path);
77 // These retrieve images based on case sensitive title
78 VFrame* get_image(char *title, int use_default = 1);
79 VFrame** get_image_set(char *title, int use_default = 1);
80 BC_ThemeSet* get_image_set_object(char *title);
82 // Loads compressed data into temporary
83 unsigned char* get_image_data(char *title);
85 // Verify all images have been used after initialization.
86 void check_used();
88 void dump();
89 BC_Resources* get_resources();
91 private:
92 void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1, int shift = 0);
93 void init_contents();
97 // Decompressed image storage.
98 // Sets of images.
99 ArrayList<BC_ThemeSet*> image_sets;
101 // Compressed images are loaded in here.
102 char *data_ptr;
103 char *contents_ptr;
104 ArrayList<char*> contents;
105 ArrayList<unsigned char*> pointers;
106 ArrayList<int> used;
107 char *last_image;
108 unsigned char *last_pointer;
111 class BC_ThemeSet
113 public:
114 // Set is_reference if the images are going to be created by new_image
115 BC_ThemeSet(int total, int is_reference, char *title);
116 ~BC_ThemeSet();
118 VFrame **data;
119 char *title;
120 int total;
121 int is_reference;
126 #endif
128 // Local Variables:
129 // mode: C++
130 // c-file-style: "linux"
131 // End: