2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
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.
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.
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
22 #if !defined( INCLUDED_GTKUTIL_WINDOW_H )
23 #define INCLUDED_GTKUTIL_WINDOW_H
25 #include <uilib/uilib.h>
27 #include "debugging/debugging.h"
28 #include "generic/callback.h"
31 gboolean window_focus_in_clear_focus_widget(ui::Window widget, GdkEventKey *event, gpointer data);
33 guint window_connect_focus_in_clear_focus_widget(ui::Window window);
35 unsigned int connect_floating(ui::Window main_window, ui::Window floating);
37 ui::Window create_floating_window(const char *title, ui::Window parent);
39 void destroy_floating_window(ui::Window window);
41 ui::Window create_persistent_floating_window(const char *title, ui::Window main_window);
43 gboolean persistent_floating_window_delete(ui::Window floating, GdkEvent *event, ui::Window main_window);
45 void window_remove_minmax(ui::Window window);
47 ui::ScrolledWindow create_scrolled_window(ui::Policy hscrollbar_policy, ui::Policy vscrollbar_policy, int border = 0);
50 struct WindowPosition {
57 WindowPosition(int _x, int _y, int _w, int _h)
58 : x(_x), y(_y), w(_w), h(_h)
63 const WindowPosition c_default_window_pos(50, 25, 400, 300);
65 void window_get_position(ui::Window window, WindowPosition &position);
67 void window_set_position(ui::Window window, const WindowPosition &position);
69 struct WindowPosition_String {
71 static void Export(const WindowPosition &self, const Callback<void(const char *)> &returnz);
73 static void Import(WindowPosition &self, const char *value);
77 class WindowPositionTracker {
78 WindowPosition m_position;
80 static gboolean configure(ui::Widget widget, GdkEventConfigure *event, WindowPositionTracker *self);
83 WindowPositionTracker()
84 : m_position(c_default_window_pos)
88 void sync(ui::Window window);
90 void connect(ui::Window window);
92 const WindowPosition &getPosition() const;
95 void setPosition(const WindowPosition &position);
99 struct WindowPositionTracker_String {
100 static void Export(const WindowPositionTracker &self, const Callback<void(const char *)> &returnz);
102 static void Import(WindowPositionTracker &self, const char *value);