diff options
| author | root <root@jtx.marker.es> | 2013-03-16 20:28:39 +0000 |
|---|---|---|
| committer | root <root@jtx.marker.es> | 2013-03-16 20:28:39 +0000 |
| commit | dc88806b0778f65a3f16071c9782d607cc735dda (patch) | |
| tree | ac560318c8a3bb2ac244edba6511082bb06cac34 /src/ui | |
| parent | Updating original path (diff) | |
| parent | Fix another tonne of forward declaration tags (diff) | |
| download | inkscape-dc88806b0778f65a3f16071c9782d607cc735dda.tar.gz inkscape-dc88806b0778f65a3f16071c9782d607cc735dda.zip | |
widget working not compile
(bzr r11950.1.54)
Diffstat (limited to 'src/ui')
25 files changed, 809 insertions, 153 deletions
diff --git a/src/ui/dialog/desktop-tracker.h b/src/ui/dialog/desktop-tracker.h index 0c8af66bf..c219e8d98 100644 --- a/src/ui/dialog/desktop-tracker.h +++ b/src/ui/dialog/desktop-tracker.h @@ -16,7 +16,7 @@ class SPDesktop; namespace Inkscape { -class Application; +struct Application; namespace UI { namespace Dialog { diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h index 025e9eb58..ec5d203bc 100644 --- a/src/ui/dialog/dialog.h +++ b/src/ui/dialog/dialog.h @@ -21,7 +21,7 @@ class SPDesktop; namespace Inkscape { class Selection; -class Application; +struct Application; } namespace Inkscape { diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 460e223a3..045b34814 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -22,6 +22,7 @@ # include <config.h> #endif +#include "ui/widget/notebook-page.h" #include "document-properties.h" #include "display/canvas-grid.h" #include "document.h" @@ -50,8 +51,9 @@ #include "color-profile.h" #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) -#include <gtkmm/stock.h> #include <gtkmm/imagemenuitem.h> +#include <gtkmm/stock.h> +#include <gtkmm/table.h> using std::pair; @@ -90,15 +92,15 @@ DocumentProperties& DocumentProperties::getInstance() DocumentProperties::DocumentProperties() : UI::Widget::Panel ("", "/dialogs/documentoptions", SP_VERB_DIALOG_NAMEDVIEW), - _page_page(1, 1, true, true), - _page_guides(1, 1), - _page_snap(1, 1), - _page_cms(1, 1), - _page_scripting(1, 1), - _page_external_scripts(1, 1), - _page_embedded_scripts(1, 1), - _page_metadata1(1, 1), - _page_metadata2(1, 1), + _page_page(Gtk::manage(new UI::Widget::NotebookPage(1, 1, true, true))), + _page_guides(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_snap(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_cms(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_scripting(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_external_scripts(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_embedded_scripts(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_metadata1(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), + _page_metadata2(Gtk::manage(new UI::Widget::NotebookPage(1, 1))), //--------------------------------------------------------------- _rcb_canb(_("Show page _border"), _("If set, rectangular page border is shown"), "showborder", _wr, false), _rcb_bord(_("Border on _top of drawing"), _("If set, border is always on top of the drawing"), "borderlayer", _wr, false), @@ -141,14 +143,14 @@ DocumentProperties::DocumentProperties() _getContents()->set_spacing (4); _getContents()->pack_start(_notebook, true, true); - _notebook.append_page(_page_page, _("Page")); - _notebook.append_page(_page_guides, _("Guides")); + _notebook.append_page(*_page_page, _("Page")); + _notebook.append_page(*_page_guides, _("Guides")); _notebook.append_page(_grids_vbox, _("Grids")); - _notebook.append_page(_page_snap, _("Snap")); - _notebook.append_page(_page_cms, _("Color")); - _notebook.append_page(_page_scripting, _("Scripting")); - _notebook.append_page(_page_metadata1, _("Metadata")); - _notebook.append_page(_page_metadata2, _("License")); + _notebook.append_page(*_page_snap, _("Snap")); + _notebook.append_page(*_page_cms, _("Color")); + _notebook.append_page(*_page_scripting, _("Scripting")); + _notebook.append_page(*_page_metadata1, _("Metadata")); + _notebook.append_page(*_page_metadata2, _("License")); _wr.setUpdating (true); build_page(); @@ -203,12 +205,25 @@ DocumentProperties::~DocumentProperties() * widget in columns 2-3; (non-0, 0) means label in columns 1-3; and * (non-0, non-0) means two widgets in columns 2 and 3. */ +#if WITH_GTKMM_3_0 +inline void attach_all(Gtk::Grid &table, Gtk::Widget *const arr[], unsigned const n, int start = 0, int docum_prop_flag = 0) +#else inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned const n, int start = 0, int docum_prop_flag = 0) +#endif { for (unsigned i = 0, r = start; i < n; i += 2) { if (arr[i] && arr[i+1]) { +#if WITH_GTKMM_3_0 + arr[i]->set_hexpand(); + arr[i+1]->set_hexpand(); + arr[i]->set_valign(Gtk::ALIGN_CENTER); + arr[i+1]->set_valign(Gtk::ALIGN_CENTER); + table.attach(*arr[i], 1, r, 1, 1); + table.attach(*arr[i+1], 2, r, 1, 1); +#else table.attach(*arr[i], 1, 2, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); table.attach(*arr[i+1], 2, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); +#endif } else { if (arr[i+1]) { Gtk::AttachOptions yoptions = (Gtk::AttachOptions)0; @@ -218,21 +233,70 @@ inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned con } if (docum_prop_flag) { if( i==(n-4) || i==(n-6) ) { +#if WITH_GTKMM_3_0 + arr[i+1]->set_hexpand(); + arr[i+1]->set_margin_left(20); + arr[i+1]->set_margin_right(20); + + if (yoptions & Gtk::EXPAND) + arr[i+1]->set_vexpand(); + else + arr[i+1]->set_valign(Gtk::ALIGN_CENTER); + + table.attach(*arr[i+1], 1, r, 2, 1); +#else table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 20,0); +#endif } else { +#if WITH_GTKMM_3_0 + arr[i+1]->set_hexpand(); + + if (yoptions & Gtk::EXPAND) + arr[i+1]->set_vexpand(); + else + arr[i+1]->set_valign(Gtk::ALIGN_CENTER); + + table.attach(*arr[i+1], 1, r, 2, 1); +#else table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 0,0); +#endif } } else { +#if WITH_GTKMM_3_0 + arr[i+1]->set_hexpand(); + + if (yoptions & Gtk::EXPAND) + arr[i+1]->set_vexpand(); + else + arr[i+1]->set_valign(Gtk::ALIGN_CENTER); + + table.attach(*arr[i+1], 1, r, 2, 1); +#else table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 0,0); +#endif } } else if (arr[i]) { Gtk::Label& label = reinterpret_cast<Gtk::Label&>(*arr[i]); label.set_alignment (0.0); + +#if WITH_GTKMM_3_0 + label.set_hexpand(); + label.set_valign(Gtk::ALIGN_CENTER); + table.attach(label, 0, r, 3, 1); +#else table.attach (label, 0, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); +#endif } else { Gtk::HBox *space = manage (new Gtk::HBox); space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y); + +#if WITH_GTKMM_3_0 + space->set_halign(Gtk::ALIGN_CENTER); + space->set_valign(Gtk::ALIGN_CENTER); + table.attach(*space, 0, r, 1, 1); +#else table.attach (*space, 0, 1, r, r+1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0,0,0); +#endif } } ++r; @@ -241,7 +305,7 @@ inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned con void DocumentProperties::build_page() { - _page_page.show(); + _page_page->show(); Gtk::Label* label_gen = manage (new Gtk::Label); label_gen->set_markup (_("<b>General</b>")); @@ -275,12 +339,12 @@ void DocumentProperties::build_page() _slaveList.push_back(&_rcb_shad); _rcb_canb.setSlaveWidgets(_slaveList); - attach_all(_page_page.table(), widget_array, G_N_ELEMENTS(widget_array),0,1); + attach_all(_page_page->table(), widget_array, G_N_ELEMENTS(widget_array),0,1); } void DocumentProperties::build_guides() { - _page_guides.show(); + _page_guides->show(); Gtk::Label *label_gui = manage (new Gtk::Label); label_gui->set_markup (_("<b>Guides</b>")); @@ -293,12 +357,12 @@ void DocumentProperties::build_guides() _rcp_hgui._label, &_rcp_hgui }; - attach_all(_page_guides.table(), widget_array, G_N_ELEMENTS(widget_array)); + attach_all(_page_guides->table(), widget_array, G_N_ELEMENTS(widget_array)); } void DocumentProperties::build_snap() { - _page_snap.show(); + _page_snap->show(); Gtk::Label *label_o = manage (new Gtk::Label); label_o->set_markup (_("<b>Snap to objects</b>")); @@ -327,7 +391,7 @@ void DocumentProperties::build_snap() 0, &_rcb_tang }; - attach_all(_page_snap.table(), array, G_N_ELEMENTS(array)); + attach_all(_page_snap->table(), array, G_N_ELEMENTS(array)); } #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -532,7 +596,7 @@ void DocumentProperties::removeSelectedProfile(){ void DocumentProperties::build_cms() { - _page_cms.show(); + _page_cms->show(); Gtk::Label *label_link= manage (new Gtk::Label("", Gtk::ALIGN_START)); label_link->set_markup (_("<b>Linked Color Profiles:</b>")); Gtk::Label *label_avail = manage (new Gtk::Label("", Gtk::ALIGN_START)); @@ -544,26 +608,75 @@ void DocumentProperties::build_cms() _unlink_btn.set_tooltip_text(_("Unlink Profile")); _unlink_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) ))); - _page_cms.set_spacing(4); + _page_cms->set_spacing(4); gint row = 0; label_link->set_alignment(0.0); - _page_cms.table().attach(*label_link, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + label_link->set_hexpand(); + label_link->set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(*label_link, 0, row, 3, 1); +#else + _page_cms->table().attach(*label_link, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_cms.table().attach(_LinkedProfilesListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + _LinkedProfilesListScroller.set_hexpand(); + _LinkedProfilesListScroller.set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(_LinkedProfilesListScroller, 0, row, 3, 1); +#else + _page_cms->table().attach(_LinkedProfilesListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; Gtk::HBox* spacer = Gtk::manage(new Gtk::HBox()); spacer->set_size_request(SPACE_SIZE_X, SPACE_SIZE_Y); - _page_cms.table().attach(*spacer, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + spacer->set_hexpand(); + spacer->set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(*spacer, 0, row, 3, 1); +#else + _page_cms->table().attach(*spacer, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; label_avail->set_alignment(0.0); - _page_cms.table().attach(*label_avail, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + label_avail->set_hexpand(); + label_avail->set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(*label_avail, 0, row, 3, 1); +#else + _page_cms->table().attach(*label_avail, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_cms.table().attach(_combo_avail, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); - _page_cms.table().attach(_link_btn, 1, 2, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 2, 0); - _page_cms.table().attach(_unlink_btn, 2, 3, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + _combo_avail.set_hexpand(); + _combo_avail.set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(_combo_avail, 0, row, 1, 1); + + _link_btn.set_halign(Gtk::ALIGN_CENTER); + _link_btn.set_valign(Gtk::ALIGN_CENTER); + _link_btn.set_margin_left(2); + _link_btn.set_margin_right(2); + _page_cms->table().attach(_link_btn, 1, row, 1, 1); + + _unlink_btn.set_halign(Gtk::ALIGN_CENTER); + _unlink_btn.set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(_unlink_btn, 2, row, 1, 1); +#else + _page_cms->table().attach(_combo_avail, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + _page_cms->table().attach(_link_btn, 1, 2, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 2, 0); + _page_cms->table().attach(_unlink_btn, 2, 3, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 0, 0); +#endif populate_available_profiles(); @@ -601,16 +714,16 @@ void DocumentProperties::build_cms() void DocumentProperties::build_scripting() { - _page_scripting.show(); + _page_scripting->show(); - _page_scripting.set_spacing (4); - _page_scripting.pack_start(_scripting_notebook, true, true); + _page_scripting->set_spacing (4); + _page_scripting->pack_start(_scripting_notebook, true, true); - _scripting_notebook.append_page(_page_external_scripts, _("External scripts")); - _scripting_notebook.append_page(_page_embedded_scripts, _("Embedded scripts")); + _scripting_notebook.append_page(*_page_external_scripts, _("External scripts")); + _scripting_notebook.append_page(*_page_embedded_scripts, _("Embedded scripts")); //# External scripts tab - _page_external_scripts.show(); + _page_external_scripts->show(); Gtk::Label *label_external= manage (new Gtk::Label("", Gtk::ALIGN_START)); label_external->set_markup (_("<b>External script files:</b>")); @@ -621,23 +734,64 @@ void DocumentProperties::build_scripting() _external_remove_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) ))); - _page_external_scripts.set_spacing(4); + _page_external_scripts->set_spacing(4); gint row = 0; label_external->set_alignment(0.0); - _page_external_scripts.table().attach(*label_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + label_external->set_hexpand(); + label_external->set_valign(Gtk::ALIGN_CENTER); + _page_external_scripts->table().attach(*label_external, 0, row, 3, 1); +#else + _page_external_scripts->table().attach(*label_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_external_scripts.table().attach(_ExternalScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + _ExternalScriptsListScroller.set_hexpand(); + _ExternalScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); + _page_external_scripts->table().attach(_ExternalScriptsListScroller, 0, row, 3, 1); +#else + _page_external_scripts->table().attach(_ExternalScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; Gtk::HBox* spacer_external = Gtk::manage(new Gtk::HBox()); spacer_external->set_size_request(SPACE_SIZE_X, SPACE_SIZE_Y); - _page_external_scripts.table().attach(*spacer_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + spacer_external->set_hexpand(); + spacer_external->set_valign(Gtk::ALIGN_CENTER); + _page_external_scripts->table().attach(*spacer_external, 0, row, 3, 1); +#else + _page_external_scripts->table().attach(*spacer_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_external_scripts.table().attach(_script_entry, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); - _page_external_scripts.table().attach(_external_add_btn, 1, 2, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 2, 0); - _page_external_scripts.table().attach(_external_remove_btn, 2, 3, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 0, 0); +#if WITH_GTKMM_3_0 + _script_entry.set_hexpand(); + _script_entry.set_valign(Gtk::ALIGN_CENTER); + _page_external_scripts->table().attach(_script_entry, 0, row, 1, 1); + + _external_add_btn.set_halign(Gtk::ALIGN_CENTER); + _external_add_btn.set_valign(Gtk::ALIGN_CENTER); + _external_add_btn.set_margin_left(2); + _external_add_btn.set_margin_right(2); + _page_external_scripts->table().attach(_external_add_btn, 1, row, 1, 1); + + _external_remove_btn.set_halign(Gtk::ALIGN_CENTER); + _external_remove_btn.set_valign(Gtk::ALIGN_CENTER); + _page_external_scripts->table().attach(_external_remove_btn, 2, row, 1, 1); +#else + _page_external_scripts->table().attach(_script_entry, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + _page_external_scripts->table().attach(_external_add_btn, 1, 2, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 2, 0); + _page_external_scripts->table().attach(_external_remove_btn, 2, 3, row, row + 1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; //# Set up the External Scripts box @@ -649,7 +803,7 @@ void DocumentProperties::build_scripting() //# Embedded scripts tab - _page_embedded_scripts.show(); + _page_embedded_scripts->show(); Gtk::Label *label_embedded= manage (new Gtk::Label("", Gtk::ALIGN_START)); label_embedded->set_markup (_("<b>Embedded script files:</b>")); @@ -669,21 +823,52 @@ void DocumentProperties::build_scripting() _embed_button_box.add(_embed_new_btn); _embed_button_box.add(_embed_remove_btn); - _page_embedded_scripts.set_spacing(4); + _page_embedded_scripts->set_spacing(4); row = 0; label_embedded->set_alignment(0.0); - _page_embedded_scripts.table().attach(*label_embedded, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + label_embedded->set_hexpand(); + label_embedded->set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(*label_embedded, 0, row, 3, 1); +#else + _page_embedded_scripts->table().attach(*label_embedded, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_embedded_scripts.table().attach(_EmbeddedScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + _EmbeddedScriptsListScroller.set_hexpand(); + _EmbeddedScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(_EmbeddedScriptsListScroller, 0, row, 3, 1); +#else + _page_embedded_scripts->table().attach(_EmbeddedScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_embedded_scripts.table().attach(_embed_button_box, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#if WITH_GTKMM_3_0 + _embed_button_box.set_hexpand(); + _embed_button_box.set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(_embed_button_box, 0, row, 1, 1); +#else + _page_embedded_scripts->table().attach(_embed_button_box, 0, 1, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; Gtk::HBox* spacer_embedded = Gtk::manage(new Gtk::HBox()); spacer_embedded->set_size_request(SPACE_SIZE_X, SPACE_SIZE_Y); - _page_embedded_scripts.table().attach(*spacer_embedded, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + spacer_embedded->set_hexpand(); + spacer_embedded->set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(*spacer_embedded, 0, row, 3, 1); +#else + _page_embedded_scripts->table().attach(*spacer_embedded, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; //# Set up the Embedded Scripts box @@ -698,10 +883,24 @@ void DocumentProperties::build_scripting() label_embedded_content->set_markup (_("<b>Content:</b>")); label_embedded_content->set_alignment(0.0); - _page_embedded_scripts.table().attach(*label_embedded_content, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); + +#if WITH_GTKMM_3_0 + label_embedded_content->set_hexpand(); + label_embedded_content->set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(*label_embedded_content, 0, row, 3, 1); +#else + _page_embedded_scripts->table().attach(*label_embedded_content, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif + row++; - _page_embedded_scripts.table().attach(_EmbeddedContentScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#if WITH_GTKMM_3_0 + _EmbeddedContentScroller.set_hexpand(); + _EmbeddedContentScroller.set_valign(Gtk::ALIGN_CENTER); + _page_embedded_scripts->table().attach(_EmbeddedContentScroller, 0, row, 3, 1); +#else + _page_embedded_scripts->table().attach(_EmbeddedContentScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0); +#endif _EmbeddedContentScroller.add(_EmbeddedContent); _EmbeddedContentScroller.set_shadow_type(Gtk::SHADOW_IN); @@ -757,12 +956,19 @@ void DocumentProperties::build_metadata() { using Inkscape::UI::Widget::EntityEntry; - _page_metadata1.show(); + _page_metadata1->show(); Gtk::Label *label = manage (new Gtk::Label); label->set_markup (_("<b>Dublin Core Entities</b>")); label->set_alignment (0.0); - _page_metadata1.table().attach (*label, 0,3,0,1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + +#if WITH_GTKMM_3_0 + label->set_valign(Gtk::ALIGN_CENTER); + _page_metadata1->table().attach (*label, 0,0,3,1); +#else + _page_metadata1->table().attach (*label, 0,3,0,1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); +#endif + /* add generic metadata entry areas */ struct rdf_work_entity_t * entity; int row = 1; @@ -772,9 +978,22 @@ void DocumentProperties::build_metadata() _rdflist.push_back (w); Gtk::HBox *space = manage (new Gtk::HBox); space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y); - _page_metadata1.table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); - _page_metadata1.table().attach (w->_label, 1,2, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); - _page_metadata1.table().attach (*w->_packable, 2,3, row, row+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); + +#if WITH_GTKMM_3_0 + space->set_valign(Gtk::ALIGN_CENTER); + _page_metadata1->table().attach(*space, 0, row, 1, 1); + + w->_label.set_valign(Gtk::ALIGN_CENTER); + _page_metadata1->table().attach(w->_label, 1, row, 1, 1); + + w->_packable->set_hexpand(); + w->_packable->set_valign(Gtk::ALIGN_CENTER); + _page_metadata1->table().attach(*w->_packable, 2, row, 1, 1); +#else + _page_metadata1->table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata1->table().attach (w->_label, 1,2, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata1->table().attach (*w->_packable, 2,3, row, row+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); +#endif } } @@ -782,30 +1001,53 @@ void DocumentProperties::build_metadata() button_save->set_tooltip_text(_("Save this metadata as the default metadata")); Gtk::Button *button_load = manage (new Gtk::Button(_("Use _default"),1)); button_load->set_tooltip_text(_("Use the previously saved default metadata here")); + +#if WITH_GTKMM_3_0 + Gtk::ButtonBox *box_buttons = manage (new Gtk::ButtonBox); +#else Gtk::HButtonBox *box_buttons = manage (new Gtk::HButtonBox); +#endif + box_buttons->set_layout(Gtk::BUTTONBOX_END); box_buttons->set_spacing(4); box_buttons->pack_start(*button_save, true, true, 6); box_buttons->pack_start(*button_load, true, true, 6); - _page_metadata1.pack_end(*box_buttons, false, false, 0); + _page_metadata1->pack_end(*box_buttons, false, false, 0); button_save->signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::save_default_metadata)); button_load->signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::load_default_metadata)); - _page_metadata2.show(); + _page_metadata2->show(); row = 0; Gtk::Label *llabel = manage (new Gtk::Label); llabel->set_markup (_("<b>License</b>")); llabel->set_alignment (0.0); - _page_metadata2.table().attach (*llabel, 0,3, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + +#if WITH_GTKMM_3_0 + llabel->set_valign(Gtk::ALIGN_CENTER); + _page_metadata2->table().attach(*llabel, 0, row, 3, 1); +#else + _page_metadata2->table().attach (*llabel, 0,3, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); +#endif + /* add license selector pull-down and URI */ ++row; _licensor.init (_wr); Gtk::HBox *space = manage (new Gtk::HBox); space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y); - _page_metadata2.table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); - _page_metadata2.table().attach (_licensor, 1,3, row, row+1, Gtk::EXPAND|Gtk::FILL, (Gtk::AttachOptions)0,0,0); + +#if WITH_GTKMM_3_0 + space->set_valign(Gtk::ALIGN_CENTER); + _page_metadata2->table().attach(*space, 0, row, 1, 1); + + _licensor.set_hexpand(); + _licensor.set_valign(Gtk::ALIGN_CENTER); + _page_metadata2->table().attach(_licensor, 1, row, 3, 1); +#else + _page_metadata2->table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata2->table().attach (_licensor, 1,3, row, row+1, Gtk::EXPAND|Gtk::FILL, (Gtk::AttachOptions)0,0,0); +#endif } void DocumentProperties::addExternalScript(){ diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index 5bafddc32..56fed30c4 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -15,8 +15,7 @@ #define INKSCAPE_UI_DIALOG_DOCUMENT_PREFERENCES_H #include <stddef.h> -#include <sigc++/sigc++.h>// -#include "ui/widget/notebook-page.h" +#include <sigc++/sigc++.h> #include <gtkmm/comboboxtext.h> #include <gtkmm/liststore.h> #include <gtkmm/notebook.h> @@ -39,6 +38,7 @@ namespace Inkscape { namespace UI { namespace Widget { class EntityEntry; + class NotebookPage; } namespace Dialog { @@ -100,18 +100,18 @@ protected: Inkscape::XML::SignalObserver _emb_profiles_observer, _scripts_observer; Gtk::Notebook _notebook; - UI::Widget::NotebookPage _page_page; - UI::Widget::NotebookPage _page_guides; - UI::Widget::NotebookPage _page_snap; - UI::Widget::NotebookPage _page_cms; - UI::Widget::NotebookPage _page_scripting; + UI::Widget::NotebookPage *_page_page; + UI::Widget::NotebookPage *_page_guides; + UI::Widget::NotebookPage *_page_snap; + UI::Widget::NotebookPage *_page_cms; + UI::Widget::NotebookPage *_page_scripting; Gtk::Notebook _scripting_notebook; - UI::Widget::NotebookPage _page_external_scripts; - UI::Widget::NotebookPage _page_embedded_scripts; + UI::Widget::NotebookPage *_page_external_scripts; + UI::Widget::NotebookPage *_page_embedded_scripts; - UI::Widget::NotebookPage _page_metadata1; - UI::Widget::NotebookPage _page_metadata2; + UI::Widget::NotebookPage *_page_metadata1; + UI::Widget::NotebookPage *_page_metadata2; Gtk::VBox _grids_vbox; diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index ecdfd3346..603786742 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -193,9 +193,15 @@ Export::Export (void) : selectiontype_buttons[i]->signal_clicked().connect(sigc::mem_fun(*this, &Export::onAreaToggled)); } +#if WITH_GTKMM_3_0 + Gtk::Grid* t = new Gtk::Grid(); + t->set_row_spacing(4); + t->set_column_spacing(4); +#else Gtk::Table* t = new Gtk::Table(3, 4, false); t->set_row_spacings (4); t->set_col_spacings (4); +#endif x0_adj = createSpinbutton ( "x0", 0.0, -1000000.0, 1000000.0, 0.1, 1.0, unit_selector->gobj(), t, 0, 0, _("_x0:"), "", EXPORT_COORD_PRECISION, 1, @@ -236,9 +242,17 @@ Export::Export (void) : bm_label = new Gtk::Label(_("<b>Image size</b>"), Gtk::ALIGN_START); bm_label->set_use_markup(true); size_box.pack_start(*bm_label, false, false, 0); + +#if WITH_GTKMM_3_0 + Gtk::Grid *t = new Gtk::Grid(); + t->set_row_spacing(4); + t->set_column_spacing(4); +#else Gtk::Table *t = new Gtk::Table(2, 5, false); t->set_row_spacings (4); t->set_col_spacings (4); +#endif + size_box.pack_start(*t); bmwidth_adj = createSpinbutton ( "bmwidth", 16.0, 1.0, 1000000.0, 1.0, 10.0, @@ -442,7 +456,7 @@ void Export::set_default_filename () { #if WITH_GTKMM_3_0 Glib::RefPtr<Gtk::Adjustment> Export::createSpinbutton( gchar const * /*key*/, float val, float min, float max, float step, float page, GtkWidget *us, - Gtk::Table *t, int x, int y, + Gtk::Grid *t, int x, int y, const Glib::ustring ll, const Glib::ustring lr, int digits, unsigned int sensitive, void (Export::*cb)() ) @@ -470,17 +484,29 @@ Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, fl if (!ll.empty()) { l = new Gtk::Label(ll,true); l->set_alignment (1.0, 0.5); + +#if WITH_GTKMM_3_0 + l->set_hexpand(); + l->set_vexpand(); + t->attach(*l, x + pos, y, 1, 1); +#else t->attach (*l, x + pos, x + pos + 1, y, y + 1, Gtk::EXPAND, Gtk::EXPAND, 0, 0 ); +#endif + l->set_sensitive(sensitive); pos++; } #if WITH_GTKMM_3_0 Gtk::SpinButton *sb = new Gtk::SpinButton(adj, 1.0, digits); + sb->set_hexpand(); + sb->set_vexpand(); + t->attach(*sb, x + pos, y, 1, 1); #else Gtk::SpinButton *sb = new Gtk::SpinButton(*adj, 1.0, digits); -#endif t->attach (*sb, x + pos, x + pos + 1, y, y + 1, Gtk::EXPAND, Gtk::EXPAND, 0, 0 ); +#endif + sb->set_width_chars(7); sb->set_sensitive (sensitive); pos++; @@ -490,7 +516,15 @@ Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, fl if (!lr.empty()) { l = new Gtk::Label(lr,true); l->set_alignment (0.0, 0.5); + +#if WITH_GTKMM_3_0 + l->set_hexpand(); + l->set_vexpand(); + t->attach(*l, x + pos, y, 1, 1); +#else t->attach (*l, x + pos, x + pos + 1, y, y + 1, Gtk::EXPAND, Gtk::EXPAND, 0, 0 ); +#endif + l->set_sensitive (sensitive); pos++; l->set_mnemonic_widget (*sb); diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h index c5782fabc..5dca9cfa5 100644 --- a/src/ui/dialog/export.h +++ b/src/ui/dialog/export.h @@ -126,7 +126,7 @@ private: #if WITH_GTKMM_3_0 Glib::RefPtr<Gtk::Adjustment> createSpinbutton( gchar const *key, float val, float min, float max, float step, float page, GtkWidget *us, - Gtk::Table *t, int x, int y, + Gtk::Grid *t, int x, int y, const Glib::ustring ll, const Glib::ustring lr, int digits, unsigned int sensitive, void (Export::*cb)() ); diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index 5ba4e7e39..8de2da18b 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -15,6 +15,7 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#include "ui/widget/notebook-page.h" #include "desktop-handles.h" #include "desktop-style.h" #include "document.h" @@ -35,15 +36,17 @@ #include "ui/view/view-widget.h" +#include <gtkmm/table.h> + namespace Inkscape { namespace UI { namespace Dialog { FillAndStroke::FillAndStroke() : UI::Widget::Panel ("", "/dialogs/fillstroke", SP_VERB_DIALOG_FILL_STROKE), - _page_fill(1, 1, true, true), - _page_stroke_paint(1, 1, true, true), - _page_stroke_style(1, 1, true, true), + _page_fill(Gtk::manage(new UI::Widget::NotebookPage(1, 1, true, true))), + _page_stroke_paint(Gtk::manage(new UI::Widget::NotebookPage(1, 1, true, true))), + _page_stroke_style(Gtk::manage(new UI::Widget::NotebookPage(1, 1, true, true))), _composite_settings(SP_VERB_DIALOG_FILL_STROKE, "fillstroke", UI::Widget::SimpleFilterModifier::BLUR), deskTrack(), targetDesktop(0), @@ -56,9 +59,9 @@ FillAndStroke::FillAndStroke() contents->pack_start(_notebook, true, true); - _notebook.append_page(_page_fill, _createPageTabLabel(_("_Fill"), INKSCAPE_ICON("object-fill"))); - _notebook.append_page(_page_stroke_paint, _createPageTabLabel(_("Stroke _paint"), INKSCAPE_ICON("object-stroke"))); - _notebook.append_page(_page_stroke_style, _createPageTabLabel(_("Stroke st_yle"), INKSCAPE_ICON("object-stroke-style"))); + _notebook.append_page(*_page_fill, _createPageTabLabel(_("_Fill"), INKSCAPE_ICON("object-fill"))); + _notebook.append_page(*_page_stroke_paint, _createPageTabLabel(_("Stroke _paint"), INKSCAPE_ICON("object-stroke"))); + _notebook.append_page(*_page_stroke_style, _createPageTabLabel(_("Stroke st_yle"), INKSCAPE_ICON("object-stroke-style"))); _notebook.signal_switch_page().connect(sigc::mem_fun(this, &FillAndStroke::_onSwitchPage)); @@ -129,14 +132,14 @@ void FillAndStroke::_layoutPageFill() { fillWdgt = manage(sp_fill_style_widget_new()); - _page_fill.table().attach(*fillWdgt, 0, 1, 0, 1); + _page_fill->table().attach(*fillWdgt, 0, 0, 1, 1); } void FillAndStroke::_layoutPageStrokePaint() { strokeWdgt = manage(sp_stroke_style_paint_widget_new()); - _page_stroke_paint.table().attach(*strokeWdgt, 0, 1, 0, 1); + _page_stroke_paint->table().attach(*strokeWdgt, 0, 0, 1, 1); } void @@ -145,7 +148,7 @@ FillAndStroke::_layoutPageStrokeStyle() //Gtk::Widget *strokeStyleWdgt = manage(Glib::wrap(sp_stroke_style_line_widget_new())); //Gtk::Widget *strokeStyleWdgt = static_cast<Gtk::Widget *>(sp_stroke_style_line_widget_new()); strokeStyleWdgt = sp_stroke_style_line_widget_new(); - _page_stroke_style.table().attach(*strokeStyleWdgt, 0, 1, 0, 1); + _page_stroke_style->table().attach(*strokeStyleWdgt, 0, 0, 1, 1); } void diff --git a/src/ui/dialog/fill-and-stroke.h b/src/ui/dialog/fill-and-stroke.h index 255cea89a..340cb860f 100644 --- a/src/ui/dialog/fill-and-stroke.h +++ b/src/ui/dialog/fill-and-stroke.h @@ -16,7 +16,6 @@ #define INKSCAPE_UI_DIALOG_FILL_AND_STROKE_H #include "ui/widget/panel.h" -#include "ui/widget/notebook-page.h" #include "ui/widget/object-composite-settings.h" #include "ui/dialog/desktop-tracker.h" @@ -25,6 +24,11 @@ namespace Inkscape { namespace UI { + +namespace Widget { +class NotebookPage; +} + namespace Dialog { class FillAndStroke : public UI::Widget::Panel { @@ -47,9 +51,9 @@ public: protected: Gtk::Notebook _notebook; - UI::Widget::NotebookPage _page_fill; - UI::Widget::NotebookPage _page_stroke_paint; - UI::Widget::NotebookPage _page_stroke_style; + UI::Widget::NotebookPage *_page_fill; + UI::Widget::NotebookPage *_page_stroke_paint; + UI::Widget::NotebookPage *_page_stroke_style; UI::Widget::StyleSubject::Selection _subject; UI::Widget::ObjectCompositeSettings _composite_settings; diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index be44794d0..9bad90e7c 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -19,7 +19,13 @@ #include <gtkmm/label.h> #include <gtkmm/liststore.h> #include <gtkmm/scrolledwindow.h> -#include <gtkmm/table.h> + +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + #include <gtkmm/treemodelcolumn.h> #include <gtkmm/widget.h> @@ -336,7 +342,12 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : instanceConns(), desktopConns() { +#if WITH_GTKMM_3_0 + Gtk::Grid *table = new Gtk::Grid(); +#else Gtk::Table *table = new Gtk::Table(3, 1, false); +#endif + _getContents()->pack_start(*Gtk::manage(table), Gtk::PACK_EXPAND_WIDGET); guint row = 0; @@ -349,9 +360,14 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : gtk_widget_set_size_request (fontsel, 0, 150); g_signal_connect( G_OBJECT(fontsel), "font_set", G_CALLBACK(fontChangeCB), this ); +#if WITH_GTKMM_3_0 + table->attach(*Gtk::manage(Glib::wrap(fontsel)), 0, row, 3, 1); +#else table->attach(*Gtk::manage(Glib::wrap(fontsel)), 0, 3, row, row + 1, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL); +#endif + row++; @@ -359,9 +375,14 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : { Gtk::Label *label = new Gtk::Label(_("Script: ")); + +#if WITH_GTKMM_3_0 + table->attach( *Gtk::manage(label), 0, row, 1, 1); +#else table->attach( *Gtk::manage(label), 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK); +#endif scriptCombo = new Gtk::ComboBoxText(); for (std::map<GUnicodeScript, Glib::ustring>::iterator it = getScriptToName().begin(); it != getScriptToName().end(); ++it) @@ -372,11 +393,17 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : scriptCombo->set_active_text(getScriptToName()[G_UNICODE_SCRIPT_INVALID_CODE]); sigc::connection conn = scriptCombo->signal_changed().connect(sigc::mem_fun(*this, &GlyphsPanel::rebuild)); instanceConns.push_back(conn); - Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0); + Gtk::Alignment *align = Gtk::manage(new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0)); align->add(*Gtk::manage(scriptCombo)); - table->attach( *Gtk::manage(align), + +#if WITH_GTKMM_3_0 + align->set_hexpand(); + table->attach( *align, 1, row, 1, 1); +#else + table->attach( *align, 1, 2, row, row + 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); +#endif } row++; @@ -385,9 +412,14 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : { Gtk::Label *label = new Gtk::Label(_("Range: ")); + +#if WITH_GTKMM_3_0 + table->attach( *Gtk::manage(label), 0, row, 1, 1); +#else table->attach( *Gtk::manage(label), 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK); +#endif rangeCombo = new Gtk::ComboBoxText(); for ( std::vector<NamedRange>::iterator it = getRanges().begin(); it != getRanges().end(); ++it ) { @@ -399,9 +431,15 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : instanceConns.push_back(conn); Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0); align->add(*Gtk::manage(rangeCombo)); + +#if WITH_GTKMM_3_0 + align->set_hexpand(); + table->attach( *Gtk::manage(align), 1, row, 1, 1); +#else table->attach( *Gtk::manage(align), 1, 2, row, row + 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK); +#endif } row++; @@ -424,9 +462,17 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : Gtk::ScrolledWindow *scroller = new Gtk::ScrolledWindow(); scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scroller->add(*Gtk::manage(iconView)); + +#if WITH_GTKMM_3_0 + scroller->set_hexpand(); + scroller->set_vexpand(); + table->attach(*Gtk::manage(scroller), 0, row, 3, 1); +#else table->attach(*Gtk::manage(scroller), 0, 3, row, row + 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL); +#endif + row++; // ------------------------------- @@ -456,9 +502,15 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : box->pack_end(*Gtk::manage(insertBtn), Gtk::PACK_SHRINK); +#if WITH_GTKMM_3_0 + box->set_hexpand(); + table->attach( *Gtk::manage(box), 0, row, 3, 1); +#else table->attach( *Gtk::manage(box), 0, 3, row, row + 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); +#endif + row++; // ------------------------------- diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 1df0d606e..9c9f7faa3 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -31,7 +31,13 @@ #include <gtkmm/paned.h> #include <gtkmm/progressbar.h> #include <gtkmm/scrolledwindow.h> -#include <gtkmm/table.h> + +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + #include <gtkmm/treemodel.h> #include <gtkmm/treemodelcolumn.h> #include <gtkmm/treestore.h> @@ -504,7 +510,12 @@ private: Gtk::Label devAxesCount; Gtk::ComboBoxText axesCombo; Gtk::ProgressBar axesValues[6]; + +#if WITH_GTKMM_3_0 + Gtk::Grid axisTable; +#else Gtk::Table axisTable; +#endif Gtk::ComboBoxText buttonCombo; Gtk::ComboBoxText linkCombo; @@ -515,7 +526,13 @@ private: Gtk::Image testThumb; Gtk::Image testButtons[24]; Gtk::Image testAxes[8]; + +#if WITH_GTKMM_3_0 + Gtk::Grid imageTable; +#else Gtk::Table imageTable; +#endif + Gtk::EventBox testDetector; ConfPanel cfgPanel; @@ -603,13 +620,18 @@ InputDialogImpl::InputDialogImpl() : splitter(), #if WITH_GTKMM_3_0 split2(Gtk::ORIENTATION_VERTICAL), + axisTable(), #else split2(), -#endif axisTable(11, 2), +#endif linkCombo(), topHolder(), +#if WITH_GTKMM_3_0 + imageTable(), +#else imageTable(8, 7), +#endif testDetector(), cfgPanel() { @@ -631,13 +653,27 @@ InputDialogImpl::InputDialogImpl() : testFrame.add(testDetector); testThumb.set(getPix(PIX_TABLET)); testThumb.set_padding(24, 24); + +#if WITH_GTKMM_3_0 + testThumb.set_hexpand(); + testThumb.set_vexpand(); + imageTable.attach(testThumb, 0, 0, 8, 1); +#else imageTable.attach(testThumb, 0, 8, 0, 1, ::Gtk::EXPAND, ::Gtk::EXPAND); +#endif + { guint col = 0; guint row = 1; for ( guint num = 0; num < G_N_ELEMENTS(testButtons); num++ ) { testButtons[num].set(getPix(PIX_BUTTONS_NONE)); + +#if WITH_GTKMM_3_0 + imageTable.attach(testButtons[num], col, row, 1, 1); +#else imageTable.attach(testButtons[num], col, col + 1, row, row + 1, ::Gtk::FILL, ::Gtk::FILL); +#endif + col++; if (col > 7) { col = 0; @@ -648,7 +684,13 @@ InputDialogImpl::InputDialogImpl() : col = 0; for ( guint num = 0; num < G_N_ELEMENTS(testAxes); num++ ) { testAxes[num].set(getPix(PIX_AXIS_NONE)); + +#if WITH_GTKMM_3_0 + imageTable.attach(testAxes[num], col * 2, row, 2, 1); +#else imageTable.attach(testAxes[num], col * 2, (col + 1) * 2, row, row + 1, ::Gtk::FILL, ::Gtk::FILL); +#endif + col++; if (col > 3) { col = 0; @@ -686,28 +728,44 @@ InputDialogImpl::InputDialogImpl() : axisFrame.add(axisTable); Gtk::Label *lbl = Gtk::manage(new Gtk::Label(_("Link:"))); + +#if WITH_GTKMM_3_0 + axisTable.attach(*lbl, 0, rowNum, 1, 1); +#else axisTable.attach(*lbl, 0, 1, rowNum, rowNum+ 1, ::Gtk::FILL, ::Gtk::SHRINK); +#endif linkCombo.append(_("None")); linkCombo.set_active_text(_("None")); linkCombo.set_sensitive(false); linkConnection = linkCombo.signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::linkComboChanged)); +#if WITH_GTKMM_3_0 + axisTable.attach(linkCombo, 1, rowNum, 1, 1); +#else axisTable.attach(linkCombo, 1, 2, rowNum, rowNum + 1, ::Gtk::FILL, ::Gtk::SHRINK); +#endif + rowNum++; lbl = Gtk::manage(new Gtk::Label(_("Axes count:"))); + +#if WITH_GTKMM_3_0 + axisTable.attach(*lbl, 0, rowNum, 1, 1); + axisTable.attach(devAxesCount, 1, rowNum, 1, 1); +#else axisTable.attach(*lbl, 0, 1, rowNum, rowNum+ 1, ::Gtk::FILL, ::Gtk::SHRINK); axisTable.attach(devAxesCount, 1, 2, rowNum, rowNum + 1, ::Gtk::SHRINK, ::Gtk::SHRINK); +#endif rowNum++; @@ -726,12 +784,22 @@ InputDialogImpl::InputDialogImpl() : for ( guint barNum = 0; barNum < static_cast<guint>(G_N_ELEMENTS(axesValues)); barNum++ ) { lbl = Gtk::manage(new Gtk::Label(_("axis:"))); + +#if WITH_GTKMM_3_0 + lbl->set_hexpand(); + axisTable.attach(*lbl, 0, rowNum, 1, 1); + + axesValues[barNum].set_hexpand(); + axisTable.attach(axesValues[barNum], 1, rowNum, 1, 1); +#else axisTable.attach(*lbl, 0, 1, rowNum, rowNum+ 1, ::Gtk::EXPAND, ::Gtk::SHRINK); axisTable.attach(axesValues[barNum], 1, 2, rowNum, rowNum + 1, ::Gtk::EXPAND, ::Gtk::SHRINK); +#endif + axesValues[barNum].set_sensitive(false); rowNum++; @@ -740,12 +808,18 @@ InputDialogImpl::InputDialogImpl() : } lbl = Gtk::manage(new Gtk::Label(_("Button count:"))); + +#if WITH_GTKMM_3_0 + axisTable.attach(*lbl, 0, rowNum, 1, 1); + axisTable.attach(devKeyCount, 1, rowNum, 1, 1); +#else axisTable.attach(*lbl, 0, 1, rowNum, rowNum+ 1, ::Gtk::FILL, ::Gtk::SHRINK); axisTable.attach(devKeyCount, 1, 2, rowNum, rowNum + 1, ::Gtk::SHRINK, ::Gtk::SHRINK); +#endif rowNum++; @@ -761,9 +835,14 @@ InputDialogImpl::InputDialogImpl() : rowNum++; */ +#if WITH_GTKMM_3_0 + axisTable.attach(keyVal, 0, rowNum, 2, 1); +#else axisTable.attach(keyVal, 0, 2, rowNum, rowNum + 1, ::Gtk::FILL, ::Gtk::SHRINK); +#endif + rowNum++; @@ -781,9 +860,14 @@ InputDialogImpl::InputDialogImpl() : #endif testDetector.add_events(Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK |Gdk::PROXIMITY_IN_MASK|Gdk::PROXIMITY_OUT_MASK|Gdk::SCROLL_MASK); +#if WITH_GTKMM_3_0 + axisTable.attach(keyEntry, 0, rowNum, 2, 1); +#else axisTable.attach(keyEntry, 0, 2, rowNum, rowNum + 1, ::Gtk::FILL, ::Gtk::SHRINK); +#endif + rowNum++; diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 7ecb6d5cd..e6bb9b43d 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -48,8 +48,6 @@ #include "livepatheffect-add.h" namespace Inkscape { -class Application; - namespace UI { namespace Dialog { diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 97d8b0523..cc6ddd7de 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -22,7 +22,13 @@ #include <gtkmm/buttonbox.h> #include <gtkmm/label.h> -#include <gtkmm/table.h> + +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + #include <gtkmm/scrolledwindow.h> #include <gtkmm/comboboxtext.h> #include <gtkmm/iconview.h> @@ -100,20 +106,35 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : { /******************** Table *************************/ - // Replace by Grid for GTK 3.0 +#if WITH_GTKMM_3_0 + Gtk::Grid *table = new Gtk::Grid(); +#else Gtk::Table *table = new Gtk::Table(2, 4, false); +#endif + // panel is a cloked Gtk::VBox _getContents()->pack_start(*Gtk::manage(table), Gtk::PACK_EXPAND_WIDGET); guint row = 0; /******************** Symbol Sets *************************/ Gtk::Label* labelSet = new Gtk::Label(_("Symbol set: ")); + +#if WITH_GTKMM_3_0 + table->attach(*Gtk::manage(labelSet),0,row,1,1); +#else table->attach(*Gtk::manage(labelSet),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK); +#endif symbolSet = new Gtk::ComboBoxText(); // Fill in later symbolSet->append(_("Current Document")); symbolSet->set_active_text(_("Current Document")); + +#if WITH_GTKMM_3_0 + symbolSet->set_hexpand(); + table->attach(*Gtk::manage(symbolSet),1,row,1,1); +#else table->attach(*Gtk::manage(symbolSet),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); +#endif sigc::connection connSet = symbolSet->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); @@ -143,13 +164,25 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : Gtk::ScrolledWindow *scroller = new Gtk::ScrolledWindow(); scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scroller->add(*Gtk::manage(iconView)); + +#if WITH_GTKMM_3_0 + scroller->set_hexpand(); + scroller->set_vexpand(); + table->attach(*Gtk::manage(scroller),0,row,2,1); +#else table->attach(*Gtk::manage(scroller),0,2,row,row+1,Gtk::EXPAND|Gtk::FILL,Gtk::EXPAND|Gtk::FILL); +#endif ++row; /******************** Preview Scale ***********************/ Gtk::Label* labelScale = new Gtk::Label(_("Preview scale: ")); + +#if WITH_GTKMM_3_0 + table->attach(*Gtk::manage(labelScale),0,row,1,1); +#else table->attach(*Gtk::manage(labelScale),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK); +#endif previewScale = new Gtk::ComboBoxText(); const gchar *scales[] = @@ -158,7 +191,13 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : previewScale->append(scales[i]); } previewScale->set_active_text(scales[0]); + +#if WITH_GTKMM_3_0 + previewScale->set_hexpand(); + table->attach(*Gtk::manage(previewScale),1,row,1,1); +#else table->attach(*Gtk::manage(previewScale),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); +#endif sigc::connection connScale = previewScale->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); @@ -168,7 +207,12 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : /******************** Preview Size ************************/ Gtk::Label* labelSize = new Gtk::Label(_("Preview size: ")); + +#if WITH_GTKMM_3_0 + table->attach(*Gtk::manage(labelSize),0,row,1,1); +#else table->attach(*Gtk::manage(labelSize),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK); +#endif previewSize = new Gtk::ComboBoxText(); const gchar *sizes[] = {"16", "24", "32", "48", "64", NULL}; @@ -176,7 +220,13 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : previewSize->append(sizes[i]); } previewSize->set_active_text(sizes[2]); + +#if WITH_GTKMM_3_0 + previewSize->set_hexpand(); + table->attach(*Gtk::manage(previewSize),1,row,1,1); +#else table->attach(*Gtk::manage(previewSize),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); +#endif sigc::connection connSize = previewSize->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp index 410cdbda9..c35d3b554 100644 --- a/src/ui/dialog/tile.cpp +++ b/src/ui/dialog/tile.cpp @@ -14,14 +14,17 @@ */ //#define DEBUG_GRID_ARRANGE 1 -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - #include "tile.h" #include <gtk/gtk.h> //for GTK_RESPONSE* types #include <glibmm/i18n.h> #include <gtkmm/stock.h> + +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + #include <2geom/transforms.h> #include "verbs.h" @@ -614,7 +617,11 @@ TileDialog::TileDialog() : UI::Widget::Panel("", "/dialogs/gridtiler", SP_VERB_SELECTION_GRIDTILE), XPadding(_("X:"), _("Horizontal spacing between columns."), UNIT_TYPE_LINEAR, "", "object-columns", &PaddingUnitMenu), YPadding(_("Y:"), _("Vertical spacing between rows."), UNIT_TYPE_LINEAR, "", "object-rows", &PaddingUnitMenu), - PaddingTable(2, 2, false) +#if WITH_GTKMM_3_0 + PaddingTable(Gtk::manage(new Gtk::Grid())) +#else + PaddingTable(Gtk::manage(new Gtk::Table(2, 2, false))) +#endif { // bool used by spin button callbacks to stop loops where they change each other. updating = false; @@ -834,13 +841,23 @@ TileDialog::TileDialog() XPadding.signal_value_changed().connect(sigc::mem_fun(*this, &TileDialog::on_xpad_spinbutton_changed)); } - PaddingTable.set_border_width(MARGIN); - PaddingTable.set_row_spacings(MARGIN); - PaddingTable.set_col_spacings(MARGIN); - PaddingTable.attach(XPadding, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK); - PaddingTable.attach(PaddingUnitMenu, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK); - PaddingTable.attach(YPadding, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK); - TileBox.pack_start(PaddingTable, false, false, MARGIN); + PaddingTable->set_border_width(MARGIN); + +#if WITH_GTKMM_3_0 + PaddingTable->set_row_spacing(MARGIN); + PaddingTable->set_column_spacing(MARGIN); + PaddingTable->attach(XPadding, 0, 0, 1, 1); + PaddingTable->attach(PaddingUnitMenu, 1, 0, 1, 1); + PaddingTable->attach(YPadding, 0, 1, 1, 1); +#else + PaddingTable->set_row_spacings(MARGIN); + PaddingTable->set_col_spacings(MARGIN); + PaddingTable->attach(XPadding, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK); + PaddingTable->attach(PaddingUnitMenu, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK); + PaddingTable->attach(YPadding, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK); +#endif + + TileBox.pack_start(*PaddingTable, false, false, MARGIN); contents->pack_start(TileBox); diff --git a/src/ui/dialog/tile.h b/src/ui/dialog/tile.h index 884cd3bae..86dbd25a9 100644 --- a/src/ui/dialog/tile.h +++ b/src/ui/dialog/tile.h @@ -15,11 +15,14 @@ #ifndef SEEN_UI_DIALOG_TILE_H #define SEEN_UI_DIALOG_TILE_H +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include <gtkmm/box.h> #include <gtkmm/notebook.h> #include <gtkmm/checkbutton.h> #include <gtkmm/radiobutton.h> -#include <gtkmm/table.h> #include "ui/widget/panel.h" #include "ui/widget/spinbutton.h" @@ -27,6 +30,12 @@ namespace Gtk { class Button; + +#if WITH_GTKMM_3_0 +class Grid; +#else +class Table; +#endif } namespace Inkscape { @@ -133,7 +142,12 @@ private: Inkscape::UI::Widget::UnitMenu PaddingUnitMenu; Inkscape::UI::Widget::ScalarUnit XPadding; Inkscape::UI::Widget::ScalarUnit YPadding; - Gtk::Table PaddingTable; + +#if WITH_GTKMM_3_0 + Gtk::Grid *PaddingTable; +#else + Gtk::Table *PaddingTable; +#endif // BBox or manual spacing Gtk::VBox SpacingVBox; diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 329450b52..c071fcf95 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -216,25 +216,40 @@ void Transformation::layoutPageMove() _scalar_move_vertical.setIncrements(0.1, 1.0); //_scalar_move_vertical.set_label_image( INKSCAPE_STOCK_ARROWS_HOR ); + +#if WITH_GTKMM_3_0 + _page_move.table().attach(_scalar_move_horizontal, 0, 0, 2, 1); + _page_move.table().attach(_units_move, 2, 0, 1, 1); +#else _page_move.table() .attach(_scalar_move_horizontal, 0, 2, 0, 1, Gtk::FILL, Gtk::SHRINK); _page_move.table() .attach(_units_move, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); +#endif _scalar_move_horizontal.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onMoveValueChanged)); //_scalar_move_vertical.set_label_image( INKSCAPE_STOCK_ARROWS_VER ); +#if WITH_GTKMM_3_0 + _page_move.table().attach(_scalar_move_vertical, 0, 1, 2, 1); +#else _page_move.table() .attach(_scalar_move_vertical, 0, 2, 1, 2, Gtk::FILL, Gtk::SHRINK); +#endif _scalar_move_vertical.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onMoveValueChanged)); // Relative moves +#if WITH_GTKMM_3_0 + _page_move.table().attach(_check_move_relative, 0, 2, 2, 1); +#else _page_move.table() .attach(_check_move_relative, 0, 2, 2, 3, Gtk::FILL, Gtk::SHRINK); +#endif + _check_move_relative.set_active(true); _check_move_relative.signal_toggled() .connect(sigc::mem_fun(*this, &Transformation::onMoveRelativeToggled)); @@ -259,21 +274,37 @@ void Transformation::layoutPageScale() _scalar_scale_vertical.setAbsoluteIsIncrement(true); _scalar_scale_vertical.setPercentageIsIncrement(true); +#if WITH_GTKMM_3_0 + _page_scale.table().attach(_scalar_scale_horizontal, 0, 0, 2, 1); +#else _page_scale.table() .attach(_scalar_scale_horizontal, 0, 2, 0, 1, Gtk::FILL, Gtk::SHRINK); +#endif + _scalar_scale_horizontal.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onScaleXValueChanged)); +#if WITH_GTKMM_3_0 + _page_scale.table().attach(_units_scale, 2, 0, 1, 1); + _page_scale.table().attach(_scalar_scale_vertical, 0, 1, 2, 1); +#else _page_scale.table() .attach(_units_scale, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); _page_scale.table() .attach(_scalar_scale_vertical, 0, 2, 1, 2, Gtk::FILL, Gtk::SHRINK); +#endif + _scalar_scale_vertical.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onScaleYValueChanged)); +#if WITH_GTKMM_3_0 + _page_scale.table().attach(_check_scale_proportional, 0, 2, 2, 1); +#else _page_scale.table() .attach(_check_scale_proportional, 0, 2, 2, 3, Gtk::FILL, Gtk::SHRINK); +#endif + _check_scale_proportional.set_active(false); _check_scale_proportional.signal_toggled() .connect(sigc::mem_fun(*this, &Transformation::onScaleProportionalToggled)); @@ -304,6 +335,12 @@ void Transformation::layoutPageRotate() Gtk::RadioButton::Group group = _counterclockwise_rotate.get_group(); _clockwise_rotate.set_group(group); +#if WITH_GTKMM_3_0 + _page_rotate.table().attach(_scalar_rotate, 0, 0, 2, 1); + _page_rotate.table().attach(_units_rotate, 2, 0, 1, 1); + _page_rotate.table().attach(_counterclockwise_rotate, 3, 0, 1, 1); + _page_rotate.table().attach(_clockwise_rotate, 4, 0, 1, 1); +#else _page_rotate.table() .attach(_scalar_rotate, 0, 2, 0, 1, Gtk::FILL, Gtk::SHRINK); @@ -315,6 +352,7 @@ void Transformation::layoutPageRotate() _page_rotate.table() .attach(_clockwise_rotate, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK); +#endif Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/dialogs/transformation/rotateCounterClockwise", TRUE)) { @@ -348,16 +386,27 @@ void Transformation::layoutPageSkew() _scalar_skew_vertical.setDigits(3); _scalar_skew_vertical.setIncrements(0.1, 1.0); +#if WITH_GTKMM_3_0 + _page_skew.table().attach(_scalar_skew_horizontal, 0, 0, 2, 1); +#else _page_skew.table() .attach(_scalar_skew_horizontal, 0, 2, 0, 1, Gtk::FILL, Gtk::SHRINK); +#endif + _scalar_skew_horizontal.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onSkewValueChanged)); +#if WITH_GTKMM_3_0 + _page_skew.table().attach(_units_skew, 2, 0, 1, 1); + _page_skew.table().attach(_scalar_skew_vertical, 0, 1, 2, 1); +#else _page_skew.table() .attach(_units_skew, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); _page_skew.table() .attach(_scalar_skew_vertical, 0, 2, 1, 2, Gtk::FILL, Gtk::SHRINK); +#endif + _scalar_skew_vertical.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onSkewValueChanged)); @@ -373,30 +422,46 @@ void Transformation::layoutPageTransform() _scalar_transform_a.setDigits(3); _scalar_transform_a.setIncrements(0.1, 1.0); _scalar_transform_a.setValue(1.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_a, 0, 0, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_a, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_a.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); - _scalar_transform_b.setWidgetSizeRequest(65, -1); _scalar_transform_b.setRange(-1e10, 1e10); _scalar_transform_b.setDigits(3); _scalar_transform_b.setIncrements(0.1, 1.0); _scalar_transform_b.setValue(0.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_b, 0, 1, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_b, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_b.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); - _scalar_transform_c.setWidgetSizeRequest(65, -1); _scalar_transform_c.setRange(-1e10, 1e10); _scalar_transform_c.setDigits(3); _scalar_transform_c.setIncrements(0.1, 1.0); _scalar_transform_c.setValue(0.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_c, 1, 0, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_c, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_c.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); @@ -406,8 +471,14 @@ void Transformation::layoutPageTransform() _scalar_transform_d.setDigits(3); _scalar_transform_d.setIncrements(0.1, 1.0); _scalar_transform_d.setValue(1.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_d, 1, 1, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_d, 1, 2, 1, 2, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_d.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); @@ -417,8 +488,14 @@ void Transformation::layoutPageTransform() _scalar_transform_e.setDigits(3); _scalar_transform_e.setIncrements(0.1, 1.0); _scalar_transform_e.setValue(0.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_e, 2, 0, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_e, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_e.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); @@ -428,14 +505,25 @@ void Transformation::layoutPageTransform() _scalar_transform_f.setDigits(3); _scalar_transform_f.setIncrements(0.1, 1.0); _scalar_transform_f.setValue(0.0); + +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_scalar_transform_f, 2, 1, 1, 1); +#else _page_transform.table() .attach(_scalar_transform_f, 2, 3, 1, 2, Gtk::SHRINK, Gtk::SHRINK); +#endif + _scalar_transform_f.signal_value_changed() .connect(sigc::mem_fun(*this, &Transformation::onTransformValueChanged)); // Edit existing matrix +#if WITH_GTKMM_3_0 + _page_transform.table().attach(_check_replace_matrix, 0, 2, 2, 1); +#else _page_transform.table() .attach(_check_replace_matrix, 0, 2, 2, 3, Gtk::FILL, Gtk::SHRINK); +#endif + _check_replace_matrix.set_active(false); _check_replace_matrix.signal_toggled() .connect(sigc::mem_fun(*this, &Transformation::onReplaceMatrixToggled)); diff --git a/src/ui/dialog/xml-tree.h b/src/ui/dialog/xml-tree.h index 9d2fac71f..0a6e3a786 100644 --- a/src/ui/dialog/xml-tree.h +++ b/src/ui/dialog/xml-tree.h @@ -28,7 +28,7 @@ #include "ui/dialog/desktop-tracker.h" #include "message.h" -struct SPDesktop; +class SPDesktop; struct SPObject; struct SPXMLViewAttrList; struct SPXMLViewContent; diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h index 30efe8a27..27a0f8074 100644 --- a/src/ui/tool/control-point.h +++ b/src/ui/tool/control-point.h @@ -23,7 +23,7 @@ #include "enums.h" class SPDesktop; -class SPEventContext; +struct SPEventContext; namespace Inkscape { namespace UI { diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 55958530d..a235a3b05 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -21,7 +21,7 @@ #include "ui/tool/manipulator.h" struct SPCanvasItem; -struct SPCurve; +class SPCurve; struct SPPath; namespace Inkscape { diff --git a/src/ui/view/view-widget.h b/src/ui/view/view-widget.h index 668f9d19a..295e7932b 100644 --- a/src/ui/view/view-widget.h +++ b/src/ui/view/view-widget.h @@ -23,7 +23,7 @@ class View; } // namespace Inkscape class SPViewWidget; -class SPNamedView; +struct SPNamedView; #define SP_TYPE_VIEW_WIDGET (sp_view_widget_get_type ()) #define SP_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_VIEW_WIDGET, SPViewWidget)) diff --git a/src/ui/widget/notebook-page.cpp b/src/ui/widget/notebook-page.cpp index 92bcb6937..6653499b8 100644 --- a/src/ui/widget/notebook-page.cpp +++ b/src/ui/widget/notebook-page.cpp @@ -9,22 +9,35 @@ * Released under GNU GPL. Read the file 'COPYING' for more information */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - #include "notebook-page.h" +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + namespace Inkscape { namespace UI { namespace Widget { NotebookPage::NotebookPage(int n_rows, int n_columns, bool expand, bool fill, guint padding) - :_table(n_rows, n_columns) +#if WITH_GTKMM_3_0 + :_table(Gtk::manage(new Gtk::Grid())) +#else + :_table(Gtk::manage(new Gtk::Table(n_rows, n_columns))) +#endif { set_border_width(2); - _table.set_spacings(2); - pack_start(_table, expand, fill, padding); + +#if WITH_GTKMM_3_0 + _table->set_row_spacing(2); + _table->set_column_spacing(2); +#else + _table->set_spacings(2); +#endif + + pack_start(*_table, expand, fill, padding); } } // namespace Widget diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h index 140b7cb33..d8b8fb0c4 100644 --- a/src/ui/widget/notebook-page.h +++ b/src/ui/widget/notebook-page.h @@ -10,8 +10,19 @@ #ifndef INKSCAPE_UI_WIDGET_NOTEBOOK_PAGE_H #define INKSCAPE_UI_WIDGET_NOTEBOOK_PAGE_H +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include <gtkmm/box.h> -#include <gtkmm/table.h> + +namespace Gtk { +#if WITH_GTKMM_3_0 +class Grid; +#else +class Table; +#endif +} namespace Inkscape { namespace UI { @@ -31,10 +42,19 @@ public: */ NotebookPage(int n_rows, int n_columns, bool expand=false, bool fill=false, guint padding=0); - Gtk::Table& table() { return _table; } +#if WITH_GTKMM_3_0 + Gtk::Grid& table() { return *_table; } +#else + Gtk::Table& table() { return *_table; } +#endif protected: - Gtk::Table _table; + +#if WITH_GTKMM_3_0 + Gtk::Grid *_table; +#else + Gtk::Table *_table; +#endif }; } // namespace Widget diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index d3a208525..bee9f09b9 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -21,8 +21,10 @@ #include "ui/widget/filter-effect-chooser.h" #include "ui/widget/spinbutton.h" +class SPDesktop; + namespace Inkscape { -class Application; +struct Application; namespace UI { namespace Widget { diff --git a/src/ui/widget/style-subject.h b/src/ui/widget/style-subject.h index 47da91732..c2941d995 100644 --- a/src/ui/widget/style-subject.h +++ b/src/ui/widget/style-subject.h @@ -20,7 +20,7 @@ class SPDesktop; class SPObject; class SPCSSAttr; -class SPStyle; +struct SPStyle; namespace Inkscape { class Selection; diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp index 44bceb826..a89f42575 100644 --- a/src/ui/widget/style-swatch.cpp +++ b/src/ui/widget/style-swatch.cpp @@ -11,15 +11,11 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif +#include "style-swatch.h" #include <cstring> #include <string> -#include "style-swatch.h" - #include "widgets/spw-utilities.h" #include "ui/widget/color-preview.h" @@ -37,6 +33,12 @@ #include "verbs.h" #include <glibmm/i18n.h> +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + enum { SS_FILL, SS_STROKE @@ -114,7 +116,11 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip) _css(NULL), _tool_obs(NULL), _style_obs(NULL), - _table(2, 6), +#if WITH_GTKMM_3_0 + _table(Gtk::manage(new Gtk::Grid())), +#else + _table(Gtk::manage(new Gtk::Table(2, 6))), +#endif _sw_unit(NULL) { _label[SS_FILL].set_markup(_("Fill:")); @@ -130,23 +136,35 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip) _opacity_value.set_alignment(0.0, 0.5); _opacity_value.set_padding(0, 0); - _table.set_col_spacings (2); - _table.set_row_spacings (0); +#if WITH_GTKMM_3_0 + _table->set_column_spacing(2); + _table->set_row_spacing(0); +#else + _table->set_col_spacings(2); + _table->set_row_spacings(0); +#endif _stroke.pack_start(_place[SS_STROKE]); _stroke_width_place.add(_stroke_width); _stroke.pack_start(_stroke_width_place, Gtk::PACK_SHRINK); - - _table.attach(_label[SS_FILL], 0,1, 0,1, Gtk::FILL, Gtk::SHRINK); - _table.attach(_label[SS_STROKE], 0,1, 1,2, Gtk::FILL, Gtk::SHRINK); - - _table.attach(_place[SS_FILL], 1,2, 0,1); - _table.attach(_stroke, 1,2, 1,2); - + _opacity_place.add(_opacity_value); - _table.attach(_opacity_place, 2,3, 0,2, Gtk::SHRINK, Gtk::SHRINK); - _swatch.add(_table); +#if WITH_GTKMM_3_0 + _table->attach(_label[SS_FILL], 0, 0, 1, 1); + _table->attach(_label[SS_STROKE], 0, 1, 1, 1); + _table->attach(_place[SS_FILL], 1, 0, 1, 1); + _table->attach(_stroke, 1, 1, 1, 1); + _table->attach(_opacity_place, 2, 0, 1, 2); +#else + _table->attach(_label[SS_FILL], 0,1, 0,1, Gtk::FILL, Gtk::SHRINK); + _table->attach(_label[SS_STROKE], 0,1, 1,2, Gtk::FILL, Gtk::SHRINK); + _table->attach(_place[SS_FILL], 1,2, 0,1); + _table->attach(_stroke, 1,2, 1,2); + _table->attach(_opacity_place, 2,3, 0,2, Gtk::SHRINK, Gtk::SHRINK); +#endif + + _swatch.add(*_table); pack_start(_swatch, true, true, 0); set_size_request (STYLE_SWATCH_WIDTH, -1); diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index 999bbd4ca..2b9c32b2e 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -13,8 +13,11 @@ #ifndef INKSCAPE_UI_CURRENT_STYLE_H #define INKSCAPE_UI_CURRENT_STYLE_H +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include <gtkmm/box.h> -#include <gtkmm/table.h> #include <gtkmm/label.h> #include <gtkmm/eventbox.h> #include <gtkmm/enums.h> @@ -24,9 +27,17 @@ #include "preferences.h" class SPUnit; -class SPStyle; +struct SPStyle; class SPCSSAttr; +namespace Gtk { +#if WITH_GTKMM_3_0 +class Grid; +#else +class Table; +#endif +} + namespace Inkscape { namespace UI { namespace Widget { @@ -60,7 +71,13 @@ private: Glib::ustring _tool_path; Gtk::EventBox _swatch; - Gtk::Table _table; + +#if WITH_GTKMM_3_0 + Gtk::Grid *_table; +#else + Gtk::Table *_table; +#endif + Gtk::Label _label[2]; Gtk::EventBox _place[2]; Gtk::EventBox _opacity_place; |
