Code

Fix [ 1835591 ] Reproducible crash on opening the attached file
[inkscape.git] / src / ui / widget / preferences-widget.h
index a5a59411405daba5fb4cbdb94caf9d11065915ab..72f010f13e8a48d893b8da07ae6e5c96f8f2de25 100644 (file)
@@ -3,8 +3,9 @@
  *
  * Authors:
  *   Marco Scholten
+ *   Bruno Dilly <bruno.dilly@gmail.com>
  *
- * Copyright (C) 2004, 2006 Authors
+ * Copyright (C) 2004, 2006, 2007  Authors
  *
  * Released under GNU GPL.  Read the file 'COPYING' for more information.
  */
@@ -20,7 +21,9 @@
 #include <gtkmm/tooltips.h>
 #include <gtkmm/treeview.h>
 #include <gtkmm/radiobutton.h>
+#include <gtkmm/box.h>
 #include <gtkmm/frame.h>
+#include <gtkmm/filechooserbutton.h>
 #include <sigc++/sigc++.h>
 //#include <glibmm/i18n.h>
 
@@ -31,7 +34,7 @@ namespace Widget {
 class PrefCheckButton : public Gtk::CheckButton
 {
 public:
-    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
+    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
               bool default_value);
 protected:
     std::string _prefs_path;
@@ -43,9 +46,9 @@ protected:
 class PrefRadioButton : public Gtk::RadioButton
 {
 public:
-    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
+    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
               int int_value, bool default_value, PrefRadioButton* group_member);
-    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, 
+    void init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr,
               const std::string& string_value, bool default_value, PrefRadioButton* group_member);
     sigc::signal<void, bool> changed_signal;
 protected:
@@ -66,7 +69,7 @@ class PrefSpinButton : public Gtk::SpinButton
 {
 public:
     void init(const std::string& prefs_path, const std::string& attr,
-              double lower, double upper, double step_increment, double page_increment, 
+              double lower, double upper, double step_increment, double page_increment,
               double default_value, bool is_int, bool is_percent);
 protected:
     std::string _prefs_path;
@@ -88,12 +91,50 @@ protected:
     void on_changed();
 };
 
+class PrefEntry : public Gtk::Entry
+{
+public:
+    void init(const std::string& prefs_path, const std::string& attr,
+            bool mask);
+protected:
+    std::string _prefs_path;
+    std::string _attr;
+    void on_changed();
+};
+
+class PrefEntryButtonHBox : public Gtk::HBox
+{
+public:
+    void init(const std::string& prefs_path, const std::string& attr,
+            bool mask, gchar* default_string);
+protected:
+    std::string _prefs_path;
+    std::string _attr;
+    gchar* _default_string;
+    Gtk::Button *relatedButton;
+    Gtk::Entry *relatedEntry;
+    void onRelatedEntryChangedCallback();
+    void onRelatedButtonClickedCallback();
+};
+
+class PrefFileButton : public Gtk::FileChooserButton
+{
+public:
+    void init(const std::string& prefs_path, const std::string& attr);
+
+protected:
+    std::string _prefs_path;
+    std::string _attr;
+    void onFileChanged();
+};
+
 class DialogPage : public Gtk::Table
 {
 public:
     DialogPage();
     void add_line(bool indent, const Glib::ustring label, Gtk::Widget& widget, const Glib::ustring suffix, const Glib::ustring& tip, bool expand = true);
     void add_group_header(Glib::ustring name);
+    void set_tip(Gtk::Widget& widget, const Glib::ustring& tip);
 protected:
     Gtk::Tooltips _tooltips;
 };
@@ -105,7 +146,7 @@ protected:
 
 #endif //INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
 
-/* 
+/*
   Local Variables:
   mode:c++
   c-file-style:"stroustrup"