2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #ifndef _GD_EDITOR_AUTOWIDGETS
17 #define _GD_EDITOR_AUTOWIDGETS
21 #include <gtk/gtkwidget.h>
24 class PropertyDescription
;
26 class EditorAutoUpdate
{
28 EditorAutoUpdate(EditorAutoUpdate
const&); // deliberately not implemented
29 void operator=(EditorAutoUpdate
const&); // deliberately not implemented
31 Reflective
*r
; ///< A reflective object to work on
32 Reflective
*def
; ///< A reflective object, if any, which stores default value
33 PropertyDescription
const *descr
; ///< A pointer to the description of the property this is working on
34 GtkWidget
*widget
; ///< A widget to show on the screen. May not be the widget which stores data!
35 bool expand_vertically
; ///< For longstrings - fill window with widget.
37 void update_cave() const;
39 EditorAutoUpdate(Reflective
*r
, Reflective
*def
, PropertyDescription
const *descr
, void (*cave_update_cb
)());
42 void (*cave_update_cb
)(); ///< A function to call when update happens
43 void (*reload_cb
)(GtkWidget
*); ///< A function to call for the widget when values have to be reloaded from the Reflective object