fix opengl transform translate (again), update shell btns, tweak lv2-blacklist, Makef...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bcscrollbar.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 BCSCROLLBAR_H
23 #define BCSCROLLBAR_H
24
25 #include "bclistbox.inc"
26 #include "bctextbox.inc"
27 #include "bcsubwindow.h"
28
29 // Orientations
30 #define SCROLL_HORIZ   0
31 #define SCROLL_VERT    1
32 #define SCROLL_STRETCH 2
33
34 // Selection identifiers
35 #define SCROLL_HANDLE 1
36 #define SCROLL_BACKPAGE 2
37 #define SCROLL_FWDPAGE 3
38 #define SCROLL_BACKARROW 4
39 #define SCROLL_FWDARROW 5
40
41 // Image identifiers
42 #define SCROLL_HANDLE_UP        0
43 #define SCROLL_HANDLE_HI        1
44 #define SCROLL_HANDLE_DN        2
45 #define SCROLL_HANDLE_BG        3
46 #define SCROLL_BACKARROW_UP 4
47 #define SCROLL_BACKARROW_HI 5
48 #define SCROLL_BACKARROW_DN 6
49 #define SCROLL_FWDARROW_UP  7
50 #define SCROLL_FWDARROW_HI  8
51 #define SCROLL_FWDARROW_DN  9
52 #define SCROLL_IMAGES           10
53
54
55
56
57
58
59
60
61
62 class BC_ScrollBar : public BC_SubWindow
63 {
64 public:
65         BC_ScrollBar(int x, int y, int orientation, int pixels, int64_t length,
66                 int64_t position, int64_t handlelength, VFrame **data = 0);
67         virtual ~BC_ScrollBar();
68
69         friend class BC_ListBox;
70         friend class BC_ScrollTextBox;
71
72         virtual int handle_event() { return 0; };
73         int initialize();
74         int cursor_motion_event();
75         int cursor_leave_event();
76         int cursor_enter_event();
77         int button_press_event();
78         int button_release_event();
79         int repeat_event(int64_t repeat_id);
80         int64_t get_value();
81         int64_t get_position();
82         int64_t get_length();
83         int64_t get_handlelength();
84         int get_pixels();
85         void set_images(VFrame **data);
86         int in_use();
87         int update_value(int64_t value);
88         int update_length(int64_t length, int64_t position, int64_t handlelength, int flush);
89         int reposition_window(int x, int y, int pixels);
90         int get_span();
91         static int get_span(int orientation);
92         int get_arrow_pixels();
93 private:
94         void calculate_dimensions(int &w, int &h);
95         int activate();
96         void draw(int flush);
97         void get_handle_dimensions();
98         int get_cursor_zone(int cursor_x, int cursor_y);
99
100         int64_t length, position, handlelength;   // handle position and size
101         int selection_status, highlight_status;
102         int orientation, pixels, stretch;
103         int handle_pixel, handle_pixels;
104         int min_pixel, max_pixel;
105         int64_t repeat_count;
106 // Don't deactivate if bound to another tool
107         BC_WindowBase *bound_to;
108         VFrame **data;
109         BC_Pixmap *images[SCROLL_IMAGES];
110 };
111
112
113
114
115
116
117
118
119
120 #endif