mask xy scale, mask boundary only overlay, fix 8 char mask nm bug, rework maskgui...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bcmenupopup.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 BCMENUPOPUP_H
23 #define BCMENUPOPUP_H
24
25
26
27 #include "arraylist.h"
28 #include "bcmenu.inc"
29 #include "bcmenubar.inc"
30 #include "bcmenuitem.inc"
31 #include "bcpopup.inc"
32 #include "bcpopupmenu.inc"
33 #include "bcwindowbase.inc"
34
35
36 // A window that contains a menu.
37
38
39 class BC_MenuPopup
40 {
41 public:
42         BC_MenuPopup();
43         virtual ~BC_MenuPopup();
44
45         friend class BC_MenuItem;
46         friend class BC_PopupMenu;
47
48         int initialize(BC_WindowBase *top_level,
49                 BC_MenuBar *menu_bar,
50                 BC_Menu *menu,
51                 BC_MenuItem *menu_item,
52                 BC_PopupMenu *popup_menu);
53         int add_item(BC_MenuItem *item);
54         int del_item(BC_MenuItem* item);
55         BC_MenuItem *get_item(int i);
56         int total_items();
57         int remove_item(BC_MenuItem* item);
58
59 // Deactivates all submenus in a downward progression except for the exclude
60         int deactivate_submenus(BC_MenuPopup *exclude = 0);
61         int dispatch_button_press();
62         int dispatch_button_release();
63         int dispatch_key_press();
64         int dispatch_motion_event();
65         int dispatch_cursor_leave();
66         int dispatch_translation_event();
67         int deactivate_menu();
68         int activate_menu(int x, int y, int w, int h, int top_window_coords, int vertical_justify);
69         int get_key_x();
70         int get_w();
71         int draw_items();
72         BC_Popup* get_popup();
73         int cursor_inside();
74 private:
75         int get_dimensions();
76
77         ArrayList<BC_MenuItem *> menu_items;
78         BC_WindowBase *top_level;
79         BC_MenuItem *menu_item;
80         BC_MenuBar *menu_bar;
81         BC_PopupMenu *popup_menu;
82         BC_Menu *menu;
83 // Dimensions relative to root window
84         int x, y, w, h;
85 // Horizontal position of hotkey text
86         int key_x;
87 // Popup window that only exists when menu is down.
88         BC_Popup *popup;
89         int active;
90         int type;
91 // Images for backgrounds
92         BC_Pixmap *window_bg;
93         BC_Pixmap *item_bg[3];
94         BC_Pixmap *check;
95 };
96
97 class BC_SubMenu : public BC_MenuPopup
98 {
99 public:
100         BC_SubMenu();
101         virtual ~BC_SubMenu();
102
103         int add_submenuitem(BC_MenuItem *item);
104 };
105
106
107
108
109 #endif