Debian Codegraph @

libs/gtkutil/window.h

raw symbols SCIP
1 /*
2 Copyright (C) 2001-2006, William Joseph.
3 All Rights Reserved.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #if !defined( INCLUDED_GTKUTIL_WINDOW_H )
23 #define INCLUDED_GTKUTIL_WINDOW_H
24
25 #include <uilib/uilib.h>
26
27 #include "debugging/debugging.h"
28 #include "generic/callback.h"
29 #include "widget.h"
30
31 gboolean window_focus_in_clear_focus_widget(ui::Window widget, GdkEventKey *event, gpointer data);
32
33 guint window_connect_focus_in_clear_focus_widget(ui::Window window);
34
35 unsigned int connect_floating(ui::Window main_window, ui::Window floating);
36
37 ui::Window create_floating_window(const char *title, ui::Window parent);
38
39 void destroy_floating_window(ui::Window window);
40
41 ui::Window create_persistent_floating_window(const char *title, ui::Window main_window);
42
43 gboolean persistent_floating_window_delete(ui::Window floating, GdkEvent *event, ui::Window main_window);
44
45 void window_remove_minmax(ui::Window window);
46
47 ui::ScrolledWindow create_scrolled_window(ui::Policy hscrollbar_policy, ui::Policy vscrollbar_policy, int border = 0);
48
49
50 struct WindowPosition {
51 int x, y, w, h;
52
53 WindowPosition()
54 {
55 }
56
57 WindowPosition(int _x, int _y, int _w, int _h)
58 : x(_x), y(_y), w(_w), h(_h)
59 {
60 }
61 };
62
63 const WindowPosition c_default_window_pos(50, 25, 400, 300);
64
65 void window_get_position(ui::Window window, WindowPosition &position);
66
67 void window_set_position(ui::Window window, const WindowPosition &position);
68
69 struct WindowPosition_String {
70
71 static void Export(const WindowPosition &self, const Callback<void(const char *)> &returnz);
72
73 static void Import(WindowPosition &self, const char *value);
74
75 };
76
77 class WindowPositionTracker {
78 WindowPosition m_position;
79
80 static gboolean configure(ui::Widget widget, GdkEventConfigure *event, WindowPositionTracker *self);
81
82 public:
83 WindowPositionTracker()
84 : m_position(c_default_window_pos)
85 {
86 }
87
88 void sync(ui::Window window);
89
90 void connect(ui::Window window);
91
92 const WindowPosition &getPosition() const;
93
94 //hack
95 void setPosition(const WindowPosition &position);
96 };
97
98
99 struct WindowPositionTracker_String {
100 static void Export(const WindowPositionTracker &self, const Callback<void(const char *)> &returnz);
101
102 static void Import(WindowPositionTracker &self, const char *value);
103 };
104
105 #endif