confirm prefs update, fix bg_pixmap sz, plugin layout tweaks
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / loadmode.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef LOADMODE_H
23 #define LOADMODE_H
24
25 #include "guicast.h"
26 #include "loadmode.inc"
27 #include "mwindow.inc"
28 #include "theme.inc"
29
30 class LoadModeItem : public BC_ListBoxItem
31 {
32 public:
33         LoadModeItem(const char *text, int value);
34         int value;
35 };
36
37 class LoadModeToggle : public BC_Toggle
38 {
39 public:
40         LoadModeToggle(int x, int y, LoadMode *window,
41                 int value, const char *images, const char *tooltip);
42         int handle_event();
43         LoadMode *window;
44         int value;
45 };
46
47 class LoadMode
48 {
49 public:
50         LoadMode(MWindow *mwindow,
51                 BC_WindowBase *window, int x, int y, int *output,
52                 int use_nothing=1, int use_nested=0, int line_wrap=0);
53         ~LoadMode();
54         void create_objects();
55         int reposition_window(int x, int y);
56         static void load_mode_geometry(BC_WindowBase *gui, Theme *theme,
57                 int use_nothing, int use_nested, int line_wrap,
58                 int *pw, int *ph);
59         static int calculate_w(BC_WindowBase *gui, Theme *theme,
60                 int use_nothing=1, int use_nested=0, int line_wrap=0);
61         static int calculate_h(BC_WindowBase *gui, Theme *theme,
62                 int use_nothing=1, int use_nested=0, int line_wrap=0);
63         int get_h();
64         int get_x();
65         int get_y();
66
67         const char *mode_to_text();
68         void update();
69         int set_line_wrap(int v);
70
71         BC_Title *title;
72         BC_TextBox *textbox;
73         LoadModeListBox *listbox;
74         MWindow *mwindow;
75         BC_WindowBase *window;
76         int x, y, *output;
77         int use_nothing, use_nested, line_wrap;
78         LoadModeToggle *mode[TOTAL_LOADMODES];
79         ArrayList<LoadModeItem*> load_modes;
80 };
81
82 class LoadModeListBox : public BC_ListBox
83 {
84 public:
85         LoadModeListBox(BC_WindowBase *window, LoadMode *loadmode, int x, int y);
86         ~LoadModeListBox();
87
88         int handle_event();
89
90         BC_WindowBase *window;
91         LoadMode *loadmode;
92 };
93
94 #endif