4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "arraylist.h"
26 #include "bcresources.inc"
27 #include "bcwindowbase.inc"
42 // Set pointer to binary object containing images and contents.
43 // Immediately loads the contents from the object.
44 void set_data(unsigned char *ptr);
46 // Compose widgets using standard images.
47 // The arguments are copied into new VFrames for a new image set.
48 // The image set is put in the image table only if the title is nonzero.
49 VFrame** new_button(const char *overlay_path,
53 const char *title = 0);
54 VFrame** new_button4(const char *overlay_path,
58 const char *disabled_path,
59 const char *title = 0);
60 VFrame** new_button(const char *overlay_path,
64 const char *title = 0);
65 VFrame** new_toggle(const char *overlay_path,
68 const char *checked_path,
70 const char *checkedhi_path,
71 const char *title = 0);
72 VFrame** new_toggle(const char *overlay_path,
78 const char *title = 0);
81 // The two main routines for creating images are new_image_set and new_image.
82 // If the title already exists in the table, the existing entry is returned.
83 // These create image sets which are stored in the set table.
84 // Takes comma delimited char* pointers to filenames.
85 VFrame** new_image_set(const char *title, int total, va_list *args);
86 VFrame** new_image_set(const char *title, int total, ...);
87 VFrame** new_image_set(int total, ...);
88 // Creates an image set from VFrame pointers.
89 // The images are considered not references and deleted with the image set.
90 // If the title already exists, the existing entry is deleted and overridden.
91 VFrame** new_image_set_images(const char *title, int total, ...);
93 // Decompresses image and puts on images table before returning it.
94 VFrame* new_image(const char *title, const char *path);
95 VFrame* new_image(const char *path);
98 // These retrieve images based on case sensitive title
99 VFrame* get_image(const char *title, int use_default = 1);
100 VFrame** get_image_set(const char *title, int use_default = 1);
101 BC_ThemeSet* get_image_set_object(const char *title);
103 // Loads compressed data into temporary
104 unsigned char* get_image_data(const char *title);
106 // Verify all images have been used after initialization.
113 BC_Resources* get_resources();
116 void overlay(VFrame *dst, VFrame *src, int in_x1 = -1, int in_x2 = -1, int shift = 0);
117 void init_contents();
121 // Decompressed image storage.
123 ArrayList<BC_ThemeSet*> image_sets;
125 // Compressed images are loaded in here.
128 ArrayList<char*> contents;
129 ArrayList<unsigned char*> pointers;
132 unsigned char *last_pointer;
138 // Set is_reference if the images are going to be created by new_image
139 BC_ThemeSet(int total, int is_reference, const char *title);