1 /*
2 * Authors:
3 * Ted Gould <ted@gould.cx>
4 *
5 * Copyright (C) 2005 Authors
6 *
7 * Released under GNU GPL, read the file 'COPYING' for more information
8 */
10 #ifndef INKSCAPE_EXTENSION_DIALOG_H__
11 #define INKSCAPE_EXTENSION_DIALOG_H__
13 #include <glibmm/ustring.h>
15 #include <gdkmm/types.h>
17 #include <gtkmm/dialog.h>
18 #include <gtkmm/checkbutton.h>
19 #include <gtkmm/socket.h>
21 #include "execution-env.h"
22 #include "parameter.h"
24 namespace Inkscape {
25 namespace Extension {
27 /** \brief A class to represent the preferences for an extension */
28 class PrefDialog : public Gtk::Dialog {
29 /** \brief Help string if it exists */
30 gchar const * _help;
31 /** \brief Name of the extension */
32 Glib::ustring _name;
33 /** \brief An execution environment if there is one */
34 ExecutionEnv * _exEnv;
35 /** \brief Whether we created the \a _exEnv variable */
36 bool _createdExEnv;
38 /** \brief A pointer to the OK button */
39 Gtk::Button * _button_ok;
40 /** \brief A pointer to the CANCEL button */
41 Gtk::Button * _button_cancel;
43 /** \brief Button to control live preview */
44 Gtk::Widget * _button_preview;
45 /** \brief Button to control whether the dialog is pinned */
46 Gtk::Widget * _button_pinned;
48 /** \brief Parameter to control live preview */
49 Parameter * _param_preview;
50 /** \brief Parameter to control pinning the dialog */
51 Parameter * _param_pinned;
53 /** \brief XML to define the pinned parameter on the dialog */
54 static const char * pinned_param_xml;
55 /** \brief XML to define the live effects parameter on the dialog */
56 static const char * live_param_xml;
58 /** \brief Signal that the user is changing the live effect state */
59 sigc::signal<void> _signal_preview;
60 /** \brief Signal that the user is changing the pinned state */
61 sigc::signal<void> _signal_pinned;
63 Effect * _effect;
65 void preview_toggle(void);
66 void pinned_toggle(void);
68 void on_response (int signal);
70 public:
71 PrefDialog (Glib::ustring name,
72 gchar const * help,
73 Gtk::Widget * controls,
74 ExecutionEnv * exEnv = NULL,
75 Effect * effect = NULL);
76 ~PrefDialog ();
77 int run (void);
79 void setPreviewState (Glib::ustring state);
80 };
83 };}; /* namespace Inkscape, Extension */
85 #endif /* INKSCAPE_EXTENSION_DIALOG_H__ */
87 /*
88 Local Variables:
89 mode:c++
90 c-file-style:"stroustrup"
91 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
92 indent-tabs-mode:nil
93 fill-column:99
94 End:
95 */
96 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :