Debian Codegraph @

editor/SelManager.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef SELMANAGER_H
20 #define SELMANAGER_H
21
22 #include "pstypes.h"
23
24 class CWnd;
25 class editorSelectorManager;
26
27 class editorSelectorManager {
28 int m_l, m_t, m_r, m_b; // selection rectangle in owner window coords
29 int m_DragX, m_DragY; // dragging x,y in desktop coords
30 int m_DragState; // 0 if not dragging, 1 if dragging. 2 if no drag, but sel.
31
32 void (*m_EndFunc)(editorSelectorManager *);
33
34 public:
35 CWnd *m_OwnerWnd; // owner window of selection box
36
37 editorSelectorManager();
38
39 // sets the owner window of selection
40 // starts a selection at x,y
41 void StartSelection(CWnd *wnd, void (*func)(editorSelectorManager *), int x, int y);
42
43 // removes currently drawn rectangle
44 void EndSelection();
45
46 // returns the selected rectangle.
47 void GetSelectedRect(int *l, int *t, int *r, int *b);
48
49 // defers control to the selector manager
50 void Defer();
51
52 // tell whether we are drawing a selection box (if drag state == 1)
53 bool IsSelecting() const { return (m_DragState == 1); };
54 };
55
56 extern editorSelectorManager SelManager;
57
58 #endif