diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-02-11 13:19:28 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-02-11 13:19:28 +0000 |
| commit | d78865613d0001b7323a9cfbecb75e356e022275 (patch) | |
| tree | 80b63042238d1a198c0412d822b97d3e853d63f6 /src/ui | |
| parent | Backward compat fix for Gtkmm 2.20 (diff) | |
| download | inkscape-d78865613d0001b7323a9cfbecb75e356e022275.tar.gz inkscape-d78865613d0001b7323a9cfbecb75e356e022275.zip | |
Lots of gtkmm deprecation fixes
(bzr r10957)
Diffstat (limited to 'src/ui')
26 files changed, 243 insertions, 72 deletions
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index c8538d1fb..3bcadb251 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -108,7 +108,11 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { g_strdup_printf("<small>Inkscape %s</small>", Inkscape::version_string); label->set_markup(label_text); +#if WITH_GTKMM_2_22 + label->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER); +#else label->set_alignment(Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); +#endif label->set_padding(5,0); g_free(label_text); label->set_selectable(true); diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 2647cd569..714a0d9d5 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -1025,6 +1025,15 @@ AlignAndDistribute::AlignAndDistribute() //Rest of the widgetry +#if WITH_GTKMM_2_24 + _combo.append(_("Last selected")); + _combo.append(_("First selected")); + _combo.append(_("Biggest object")); + _combo.append(_("Smallest object")); + _combo.append(_("Page")); + _combo.append(_("Drawing")); + _combo.append(_("Selection")); +#else _combo.append_text(_("Last selected")); _combo.append_text(_("First selected")); _combo.append_text(_("Biggest object")); @@ -1032,7 +1041,7 @@ AlignAndDistribute::AlignAndDistribute() _combo.append_text(_("Page")); _combo.append_text(_("Drawing")); _combo.append_text(_("Selection")); - +#endif _combo.set_active(prefs->getInt("/dialogs/align/align-to", 6)); _combo.signal_changed().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_ref_change)); @@ -1108,13 +1117,21 @@ void AlignAndDistribute::on_selgrp_toggled(){ void AlignAndDistribute::setMode(bool nodeEdit) { //Act on widgets used in node mode +#if WITH_GTKMM_2_24 + void ( Gtk::Widget::*mNode) () = nodeEdit ? + &Gtk::Widget::show_all : &Gtk::Widget::hide; + + //Act on widgets used in selection mode + void ( Gtk::Widget::*mSel) () = nodeEdit ? + &Gtk::Widget::hide : &Gtk::Widget::show_all; +#else void ( Gtk::Widget::*mNode) () = nodeEdit ? &Gtk::Widget::show_all : &Gtk::Widget::hide_all; //Act on widgets used in selection mode void ( Gtk::Widget::*mSel) () = nodeEdit ? &Gtk::Widget::hide_all : &Gtk::Widget::show_all; - +#endif ((_alignFrame).*(mSel))(); ((_distributeFrame).*(mSel))(); diff --git a/src/ui/dialog/calligraphic-profile-rename.cpp b/src/ui/dialog/calligraphic-profile-rename.cpp index e44b46308..33996161d 100644 --- a/src/ui/dialog/calligraphic-profile-rename.cpp +++ b/src/ui/dialog/calligraphic-profile-rename.cpp @@ -47,11 +47,11 @@ CalligraphicProfileRename::CalligraphicProfileRename() : // Buttons _close_button.set_use_stock(true); _close_button.set_label(Gtk::Stock::CANCEL.id); - _close_button.set_flags(Gtk::CAN_DEFAULT); + _close_button.set_can_default(); _apply_button.set_use_underline(true); _apply_button.set_label(_("Save")); - _apply_button.set_flags(Gtk::CAN_DEFAULT); + _apply_button.set_can_default(); _close_button.signal_clicked() .connect(sigc::mem_fun(*this, &CalligraphicProfileRename::_close)); diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index ccab8c9e1..c63044174 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -549,7 +549,11 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS Gtk::Widget* widget = 0; if ( style == PREVIEW_STYLE_BLURB) { Gtk::Label *lbl = new Gtk::Label(def.descr); +#if WITH_GTKMM_2_22 + lbl->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); +#else lbl->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER); +#endif widget = lbl; } else { // Glib::ustring blank(" "); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 7cd00c319..b52bb4062 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -124,10 +124,18 @@ DocumentProperties::DocumentProperties() _rcb_snclp(_("Snap to clip paths"), _("When snapping to paths, then also try snapping to clip paths"), "inkscape:snap-path-clip", _wr), _rcb_snmsk(_("Snap to mask paths"), _("When snapping to paths, then also try snapping to mask paths"), "inkscape:snap-path-mask", _wr), //--------------------------------------------------------------- +#if WITH_GTKMM_2_22 + _grids_label_crea("", Gtk::ALIGN_START), +#else _grids_label_crea("", Gtk::ALIGN_LEFT), +#endif _grids_button_new(C_("Grid", "_New"), _("Create new grid.")), _grids_button_remove(C_("Grid", "_Remove"), _("Remove selected grid.")), +#if WITH_GTKMM_2_22 + _grids_label_def("", Gtk::ALIGN_START) +#else _grids_label_def("", Gtk::ALIGN_LEFT) +#endif { _getContents()->set_spacing (4); _getContents()->pack_start(_notebook, true, true); @@ -506,9 +514,17 @@ void DocumentProperties::build_cms() { _page_cms.show(); +#if WITH_GTKMM_2_22 + Gtk::Label *label_link= manage (new Gtk::Label("", Gtk::ALIGN_START)); +#else Gtk::Label *label_link= manage (new Gtk::Label("", Gtk::ALIGN_LEFT)); +#endif label_link->set_markup (_("<b>Linked Color Profiles:</b>")); +#if WITH_GTKMM_2_22 + Gtk::Label *label_avail = manage (new Gtk::Label("", Gtk::ALIGN_START)); +#else Gtk::Label *label_avail = manage (new Gtk::Label("", Gtk::ALIGN_LEFT)); +#endif label_avail->set_markup (_("<b>Available Color Profiles:</b>")); _link_btn.set_label(_("Link Profile")); @@ -576,7 +592,11 @@ void DocumentProperties::build_scripting() //# External scripts tab _page_external_scripts.show(); +#if WITH_GTKMM_2_22 + Gtk::Label *label_external= manage (new Gtk::Label("", Gtk::ALIGN_START)); +#else Gtk::Label *label_external= manage (new Gtk::Label("", Gtk::ALIGN_LEFT)); +#endif label_external->set_markup (_("<b>External script files:</b>")); _add_btn.set_label(_("Add")); @@ -610,7 +630,11 @@ void DocumentProperties::build_scripting() //# Embedded scripts tab _page_embedded_scripts.show(); +#if WITH_GTKMM_2_22 + Gtk::Label *label_embedded= manage (new Gtk::Label("", Gtk::ALIGN_START)); +#else Gtk::Label *label_embedded= manage (new Gtk::Label("", Gtk::ALIGN_LEFT)); +#endif label_embedded->set_markup (_("<b>Embedded script files:</b>")); _new_btn.set_label(_("New")); @@ -640,7 +664,11 @@ void DocumentProperties::build_scripting() // TODO restore? _EmbeddedScriptsList.set_fixed_height_mode(true); //# Set up the Embedded Scripts content box +#if WITH_GTKMM_2_22 + Gtk::Label *label_embedded_content= manage (new Gtk::Label("", Gtk::ALIGN_START)); +#else Gtk::Label *label_embedded_content= manage (new Gtk::Label("", Gtk::ALIGN_LEFT)); +#endif label_embedded_content->set_markup (_("<b>Content:</b>")); label_embedded_content->set_alignment(0.0); @@ -955,7 +983,11 @@ void DocumentProperties::build_gridspage() _grids_hbox_crea.pack_start(_grids_button_new, true, true); for (gint t = 0; t <= GRID_MAXTYPENR; t++) { +#if WITH_GTKMM_2_24 + _grids_combo_gridtype.append( CanvasGrid::getName( (GridType) t ) ); +#else _grids_combo_gridtype.append_text( CanvasGrid::getName( (GridType) t ) ); +#endif } _grids_combo_gridtype.set_active_text( CanvasGrid::getName(GRID_RECTANGULAR) ); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 62dc75537..3de84be84 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -1103,7 +1103,11 @@ void FileSaveDialogImplGtk::createFileTypeMenu() knownExtensions.insert( extension.casefold() ); fileDialogExtensionToPattern (type.pattern, extension); type.extension= omod; +#if WITH_GTKMM_2_24 + fileTypeComboBox.append(type.name); +#else fileTypeComboBox.append_text(type.name); +#endif fileTypes.push_back(type); } @@ -1112,7 +1116,11 @@ void FileSaveDialogImplGtk::createFileTypeMenu() guessType.name = _("Guess from extension"); guessType.pattern = "*"; guessType.extension = NULL; +#if WITH_GTKMM_2_24 + fileTypeComboBox.append(guessType.name); +#else fileTypeComboBox.append_text(guessType.name); +#endif fileTypes.push_back(guessType); diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 4e2290f18..874fbce83 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -482,7 +482,11 @@ public: _matrix(SP_ATTR_VALUES, _("This matrix determines a linear transform on color space. Each line affects one of the color components. Each column determines how much of each color component from the input is passed to the output. The last column does not depend on input colors, so can be used to adjust a constant component value.")), _saturation(0, 0, 1, 0.1, 0.01, 2, SP_ATTR_VALUES), _angle(0, 0, 360, 0.1, 0.01, 1, SP_ATTR_VALUES), +#if WITH_GTKMM_2_22 + _label(_("None"), Gtk::ALIGN_START), +#else _label(_("None"), Gtk::ALIGN_LEFT), +#endif _use_stored(false), _saturation_store(0), _angle_store(0) @@ -922,7 +926,11 @@ private: if(label != "") { //lbl = Gtk::manage(new Gtk::Label(label + (label == "" ? "" : ":"), Gtk::ALIGN_LEFT)); colon now in label (LP #358921) - lbl = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_LEFT)); +#if WITH_GTKMM_2_22 + lbl = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_START)); +#else + lbl = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_LEFT)); +#endif hb->pack_start(*lbl, false, false); _size_group->add_widget(*lbl); lbl->show(); @@ -950,7 +958,11 @@ public: : AttrWidget(SP_ATTR_INVALID), _dialog(d), _settings(d, _box, sigc::mem_fun(_dialog, &FilterEffectsDialog::set_child_attr_direct), LIGHT_ENDSOURCE), +#if WITH_GTKMM_2_22 + _light_label(_("Light Source:"), Gtk::ALIGN_START), +#else _light_label(_("Light Source:"), Gtk::ALIGN_LEFT), +#endif _light_source(LightSourceConverter), _locked(false) { @@ -1053,7 +1065,11 @@ private: void update() { - _box.hide_all(); +#if WITH_GTKMM_2_24 + _box.hide(); +#else + _box.hide_all(); +#endif _box.show(); _light_box.show_all(); @@ -1111,8 +1127,13 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d) if(col) col->add_attribute(_cell_toggle.property_active(), _columns.sel); _list.append_column_editable(_("_Filter"), _columns.label); +#if WITH_GTKMM_2_24 + ((Gtk::CellRendererText*)_list.get_column(1)->get_first_cell())-> + signal_edited().connect(sigc::mem_fun(*this, &FilterEffectsDialog::FilterModifier::on_name_edited)); +#else ((Gtk::CellRendererText*)_list.get_column(1)->get_first_cell_renderer())-> signal_edited().connect(sigc::mem_fun(*this, &FilterEffectsDialog::FilterModifier::on_name_edited)); +#endif sw->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); sw->set_shadow_type(Gtk::SHADOW_IN); @@ -1589,7 +1610,7 @@ bool FilterEffectsDialog::PrimitiveList::on_expose_signal(GdkEventExpose* e) get_cell_area(get_model()->get_path(row), *get_column(1), rct); get_visible_rect(vis); int vis_x, vis_y; - tree_to_widget_coords(vis.get_x(), vis.get_y(), vis_x, vis_y); + convert_tree_to_widget_coords(vis.get_x(), vis.get_y(), vis_x, vis_y); text_start_x = rct.get_x() + rct.get_width() - _connection_cell.get_text_width() * (FPInputConverter._length + 1) + 1; for(unsigned int i = 0; i < FPInputConverter._length; ++i) { @@ -1856,7 +1877,7 @@ bool FilterEffectsDialog::PrimitiveList::on_motion_notify_event(GdkEventMotion* Gdk::Rectangle vis; get_visible_rect(vis); int vis_x, vis_y; - tree_to_widget_coords(vis.get_x(), vis.get_y(), vis_x, vis_y); + convert_tree_to_widget_coords(vis.get_x(), vis.get_y(), vis_x, vis_y); const int top = vis_y + vis.get_height(); // When autoscrolling during a connection drag, set the speed based on @@ -2094,8 +2115,13 @@ FilterEffectsDialog::FilterEffectsDialog() : UI::Widget::Panel("", "/dialogs/filtereffects", SP_VERB_DIALOG_FILTER_EFFECTS), _add_primitive_type(FPConverter), _add_primitive(_("Add Effect:")), - _empty_settings(_("No effect selected"), Gtk::ALIGN_LEFT), - _no_filter_selected(_("No filter selected"), Gtk::ALIGN_LEFT), +#if WITH_GTKMM_2_22 + _empty_settings(_("No effect selected"), Gtk::ALIGN_START), + _no_filter_selected(_("No filter selected"), Gtk::ALIGN_START), +#else + _empty_settings(_("No effect selected"), Gtk::ALIGN_LEFT), + _no_filter_selected(_("No filter selected"), Gtk::ALIGN_LEFT), +#endif _settings_initialized(false), _locked(false), _attr_lock(false), @@ -2462,7 +2488,11 @@ void FilterEffectsDialog::update_filter_general_settings_view() } else { std::vector<Gtk::Widget*> vect = _settings_tab2.get_children(); +#if WITH_GTKMM_2_24 + vect[0]->hide(); +#else vect[0]->hide_all(); +#endif _no_filter_selected.show(); } @@ -2480,7 +2510,12 @@ void FilterEffectsDialog::update_settings_view() //First Tab std::vector<Gtk::Widget*> vect1 = _settings_tab1.get_children(); - for(unsigned int i=0; i<vect1.size(); i++) vect1[i]->hide_all(); + for(unsigned int i=0; i<vect1.size(); i++) +#if WITH_GTKMM_2_24 + vect1[i]->hide(); +#else + vect1[i]->hide_all(); +#endif _empty_settings.show(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -2504,7 +2539,11 @@ void FilterEffectsDialog::update_settings_view() //Second Tab std::vector<Gtk::Widget*> vect2 = _settings_tab2.get_children(); +#if WITH_GTKMM_2_24 + vect2[0]->hide(); +#else vect2[0]->hide_all(); +#endif _no_filter_selected.show(); SPFilter* filter = _filter_modifier.get_selected_filter(); diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 49bdc0a30..d134ae1a9 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -120,7 +120,7 @@ Find::Find() _button_clear.signal_clicked().connect(sigc::mem_fun(*this, &Find::onClear)); _button_find.signal_clicked().connect(sigc::mem_fun(*this, &Find::onFind)); - _button_find.set_flags(Gtk::CAN_DEFAULT); + _button_find.set_can_default(); // set_default (_button_find); // activatable by Enter _entry_text.getEntry()->grab_focus(); diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index 5215ec167..6e3bd0b57 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -150,7 +150,7 @@ inline void FloatingBehavior::resize(int width, int height) { _d-> inline void FloatingBehavior::move(int x, int y) { _d->move(x, y); } inline void FloatingBehavior::set_position(Gtk::WindowPosition position) { _d->set_position(position); } inline void FloatingBehavior::set_size_request(int width, int height) { _d->set_size_request(width, height); } -inline void FloatingBehavior::size_request(Gtk::Requisition &requisition) { _d->size_request(requisition); } +inline void FloatingBehavior::size_request(Gtk::Requisition &requisition) {requisition = _d->size_request(); } inline void FloatingBehavior::get_position(int &x, int &y) { _d->get_position(x, y); } inline void FloatingBehavior::get_size(int &width, int &height) { _d->get_size(width, height); } inline void FloatingBehavior::set_title(Glib::ustring title) { _d->set_title(title); } diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index e110c483c..b6182eaff 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -363,14 +363,22 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : scriptCombo = new Gtk::ComboBoxText(); for (std::map<GUnicodeScript, Glib::ustring>::iterator it = getScriptToName().begin(); it != getScriptToName().end(); ++it) { +#if WITH_GTKMM_2_24 + scriptCombo->append(it->second); +#else scriptCombo->append_text(it->second); +#endif } 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); +#if WITH_GTKMM_2_22 + Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0); +#else Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_TOP, 0.0, 0.0); +#endif align->add(*Gtk::manage(scriptCombo)); table->attach( *Gtk::manage(align), 1, 2, row, row + 1, @@ -389,14 +397,22 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) : rangeCombo = new Gtk::ComboBoxText(); for ( std::vector<NamedRange>::iterator it = getRanges().begin(); it != getRanges().end(); ++it ) { +#if WITH_GTKMM_2_24 + rangeCombo->append(it->second); +#else rangeCombo->append_text(it->second); +#endif } rangeCombo->set_active_text(getRanges()[1].second); sigc::connection conn = rangeCombo->signal_changed().connect(sigc::mem_fun(*this, &GlyphsPanel::rebuild)); instanceConns.push_back(conn); +#if WITH_GTKMM_2_22 + Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0); +#else Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_TOP, 0.0, 0.0); +#endif align->add(*Gtk::manage(rangeCombo)); table->attach( *Gtk::manage(align), 1, 2, row, row + 1, diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index cd90ae242..845316f1a 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -77,8 +77,7 @@ InkscapePreferences::InkscapePreferences() sb->set_width_chars(6); _getContents()->add(*sb); show_all_children(); - Gtk::Requisition sreq; - sb->size_request(sreq); + Gtk::Requisition sreq = sb->size_request(); _sb_width = sreq.width; _getContents()->remove(*sb); delete sb; @@ -915,10 +914,18 @@ void InkscapePreferences::initPageIO() Glib::ustring current = prefs->getString( "/options/displayprofile/uri" ); gint index = 0; +#if WITH_GTKMM_2_24 + _cms_display_profile.append(_("<none>")); +#else _cms_display_profile.append_text(_("<none>")); +#endif index++; for ( std::vector<Glib::ustring>::iterator it = names.begin(); it != names.end(); ++it ) { +#if WITH_GTKMM_2_24 + _cms_display_profile.append( *it ); +#else _cms_display_profile.append_text( *it ); +#endif Glib::ustring path = CMSSystem::getPathForProfile(*it); if ( !path.empty() && path == current ) { _cms_display_profile.set_active(index); @@ -933,7 +940,11 @@ void InkscapePreferences::initPageIO() current = prefs->getString("/options/softproof/uri"); index = 0; for ( std::vector<Glib::ustring>::iterator it = names.begin(); it != names.end(); ++it ) { +#if WITH_GTKMM_2_24 + _cms_proof_profile.append( *it ); +#else _cms_proof_profile.append_text( *it ); +#endif Glib::ustring path = CMSSystem::getPathForProfile(*it); if ( !path.empty() && path == current ) { _cms_proof_profile.set_active(index); @@ -1452,8 +1463,7 @@ bool InkscapePreferences::SetMaxDialogSize(const Gtk::TreeModel::iterator& iter) DialogPage* page = row[_page_list_columns._col_page]; _page_frame.add(*page); this->show_all_children(); - Gtk:: Requisition sreq; - this->size_request(sreq); + Gtk:: Requisition sreq = this->size_request(); _max_dialog_width=std::max(_max_dialog_width, sreq.width); _max_dialog_height=std::max(_max_dialog_height, sreq.height); _page_frame.remove(); diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 258655599..171057991 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -606,7 +606,11 @@ InputDialogImpl::InputDialogImpl() : ::Gtk::FILL, ::Gtk::SHRINK); +#if WITH_GTKMM_2_24 + linkCombo.append(_("None")); +#else linkCombo.append_text(_("None")); +#endif linkCombo.set_active_text(_("None")); linkCombo.set_sensitive(false); linkConnection = linkCombo.signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::linkComboChanged)); @@ -950,7 +954,11 @@ InputDialogImpl::ConfPanel::ConfPanel() : pack_start(useExt, Gtk::PACK_SHRINK); save.signal_clicked().connect(sigc::mem_fun(*this, &InputDialogImpl::ConfPanel::saveSettings)); +#if WITH_GTKMM_2_22 + Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_START, 0, 0); +#else Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_RIGHT, Gtk::ALIGN_TOP, 0, 0); +#endif align->add(save); pack_start(*Gtk::manage(align), Gtk::PACK_SHRINK); } @@ -1268,15 +1276,24 @@ void InputDialogImpl::resyncToSelection() { devDetails.set_sensitive(true); linkConnection.block(); +#if WITH_GTKMM_2_24 + linkCombo.remove_all(); + linkCombo.append(_("None")); +#else linkCombo.clear_items(); linkCombo.append_text(_("None")); +#endif linkCombo.set_active(0); if ( dev->getSource() != Gdk::SOURCE_MOUSE ) { Glib::ustring linked = dev->getLink(); std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices(); for ( std::list<Glib::RefPtr<InputDevice const> >::const_iterator it = devList.begin(); it != devList.end(); ++it ) { if ( ((*it)->getSource() != Gdk::SOURCE_MOUSE) && ((*it) != dev) ) { +#if WITH_GTKMM_2_24 + linkCombo.append((*it)->getName().c_str()); +#else linkCombo.append_text((*it)->getName().c_str()); +#endif if ( (linked.length() > 0) && (linked == (*it)->getId()) ) { linkCombo.set_active_text((*it)->getName().c_str()); } @@ -1309,10 +1326,18 @@ void InputDialogImpl::setupValueAndCombo( gint reported, gint actual, Gtk::Label label.set_label(tmp); g_free(tmp); +#if WITH_GTKMM_2_24 + combo.remove_all(); +#else combo.clear_items(); +#endif for ( gint i = 1; i <= reported; ++i ) { tmp = g_strdup_printf("%d", i); +#if WITH_GTKMM_2_24 + combo.append(tmp); +#else combo.append_text(tmp); +#endif g_free(tmp); } diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index eeef12b88..cc9a4fb42 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -52,10 +52,10 @@ LayerPropertiesDialog::LayerPropertiesDialog() // Buttons _close_button.set_use_stock(true); _close_button.set_label(Gtk::Stock::CANCEL.id); - _close_button.set_flags(Gtk::CAN_DEFAULT); + _close_button.set_can_default(); _apply_button.set_use_underline(true); - _apply_button.set_flags(Gtk::CAN_DEFAULT); + _apply_button.set_can_default(); _close_button.signal_clicked() .connect(sigc::mem_fun(*this, &LayerPropertiesDialog::_close)); diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index b5d406bf5..28a1e939c 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -618,8 +618,7 @@ LayersPanel::LayersPanel() : _scroller.add( _tree ); _scroller.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); _scroller.set_shadow_type(Gtk::SHADOW_IN); - Gtk:: Requisition sreq; - _scroller.size_request(sreq); + Gtk:: Requisition sreq = _scroller.size_request(); int minHeight = 70; if (sreq.height < minHeight) { // Set a min height to see the layers when used with Ubuntu liboverlay-scrollbar diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index 6a3632add..5acd67929 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -523,7 +523,11 @@ void FileImportFromOCALDialog::print_xml_element_names(xmlNode * a_node) if (!strcmp((const char*)cur_node->name, "title")) { xmlChar *title = xmlNodeGetContent(cur_node); +#if WITH_GTKMM_2_24 + row_num = filesList->append((const char*)title); +#else row_num = filesList->append_text((const char*)title); +#endif xmlFree(title); } #ifdef WITH_GNOME_VFS diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 64bc47495..1a55b9e00 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -155,12 +155,21 @@ void GlyphComboBox::update(SPFont* spfont){ if (!spfont) return //TODO: figure out why do we need to append_text("") before clearing items properly... +#if WITH_GTKMM_2_24 + this->append(""); //Gtk is refusing to clear the combobox when I comment out this line + this->remove_all(); +#else this->append_text(""); //Gtk is refusing to clear the combobox when I comment out this line this->clear_items(); +#endif for(SPObject* node = spfont->children; node; node=node->next){ if (SP_IS_GLYPH(node)){ +#if WITH_GTKMM_2_24 + this->append(((SPGlyph*)node)->unicode); +#else this->append_text(((SPGlyph*)node)->unicode); +#endif } } } diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp index 7a018d91a..9e69778b7 100644 --- a/src/ui/previewholder.cpp +++ b/src/ui/previewholder.cpp @@ -207,8 +207,7 @@ void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation ) Gtk::VBox::on_size_allocate( allocation ); if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == Gtk::ANCHOR_NORTH || _anchor == Gtk::ANCHOR_SOUTH) ) { - Gtk::Requisition req; - _insides->size_request(req); + Gtk::Requisition req = _insides->size_request(); gint delta = allocation.get_width() - req.width; if ( (delta > 4) && req.height < allocation.get_height() ) { @@ -234,8 +233,7 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int& height = 1; if ( _anchor == Gtk::ANCHOR_SOUTH || _anchor == Gtk::ANCHOR_NORTH ) { - Gtk::Requisition req; - _scroller->size_request(req); + Gtk::Requisition req = _scroller->size_request(); int currW = _scroller->get_width(); if ( currW > req.width ) { req.width = currW; @@ -243,15 +241,13 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int& Gtk::HScrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar(); if ( hs ) { - Gtk::Requisition scrollReq; - hs->size_request(scrollReq); + Gtk::Requisition scrollReq = hs->size_request(); // the +8 is a temporary hack req.height -= scrollReq.height + 8; } - Gtk::Requisition req2; - const_cast<Gtk::Widget*>(thing)->size_request(req2); + Gtk::Requisition req2 = const_cast<Gtk::Widget*>(thing)->size_request(); int h2 = ((req2.height > 0) && (req.height > req2.height)) ? (req.height / req2.height) : 1; int w2 = ((req2.width > 0) && (req.width > req2.width)) ? (req.width / req2.width) : 1; diff --git a/src/ui/widget/color-preview.cpp b/src/ui/widget/color-preview.cpp index 22ca1ebe0..8bb523831 100644 --- a/src/ui/widget/color-preview.cpp +++ b/src/ui/widget/color-preview.cpp @@ -22,7 +22,7 @@ namespace Inkscape { ColorPreview::ColorPreview (guint32 rgba) { _rgba = rgba; - set_flags (Gtk::NO_WINDOW); + set_has_window(false); } void @@ -36,14 +36,14 @@ void ColorPreview::on_size_allocate (Gtk::Allocation &all) { set_allocation (all); - if (is_drawable()) + if (get_is_drawable()) queue_draw(); } bool ColorPreview::on_expose_event (GdkEventExpose *event) { - if (is_drawable()) + if (get_is_drawable()) paint (&event->area); return true; @@ -54,7 +54,7 @@ ColorPreview::setRgba32 (guint32 rgba) { _rgba = rgba; - if (is_drawable()) + if (get_is_drawable()) queue_draw(); } diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index b9467475a..34c68284e 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -161,7 +161,7 @@ DockItem::set_size_request(int width, int height) void DockItem::size_request(Gtk::Requisition& requisition) { - getWidget().size_request(requisition); + requisition = getWidget().size_request(); } void @@ -254,7 +254,7 @@ DockItem::present() // always grab focus, even if we're already present grab_focus(); - if (!isFloating() && getWidget().is_realized()) + if (!isFloating() && getWidget().get_realized()) _dock.scrollToItem(*this); } diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 52ce0b5bc..cdafa529c 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -23,7 +23,11 @@ namespace Widget { SimpleFilterModifier::SimpleFilterModifier(int flags) : _lb_blend(_("Blend mode:")), +#if WITH_GTKMM_2_22 + _lb_blur(_("_Blur:"), Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true), +#else _lb_blur(_("_Blur:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true), +#endif _blend(BlendModeConverter, SP_ATTR_INVALID, false), _blur(0, 0, 100, 1, 0.01, 2) { @@ -48,7 +52,6 @@ SimpleFilterModifier::SimpleFilterModifier(int flags) _lb_blur.set_use_underline(); _lb_blur.set_mnemonic_widget(_blur.get_scale()); _blend.signal_changed().connect(signal_blend_blur_changed()); - _blur.set_update_policy(Gtk::UPDATE_DELAYED); _blur.signal_value_changed().connect(signal_blend_blur_changed()); } diff --git a/src/ui/widget/icon-widget.cpp b/src/ui/widget/icon-widget.cpp index de4548f11..0e0736371 100644 --- a/src/ui/widget/icon-widget.cpp +++ b/src/ui/widget/icon-widget.cpp @@ -73,14 +73,14 @@ void IconWidget::size_allocate(Gtk::Allocation const &allocation) { Gtk::Widget::size_allocate(allocation); - if (this->is_drawable()) { + if (this->get_is_drawable()) { this->queue_draw(); } } int IconWidget::expose(GdkEventExpose *event) { - if (this->is_drawable()) { + if (this->get_is_drawable()) { paint(&(event->area)); } return true; diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index 06d57c4ac..75170971e 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -84,7 +84,6 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co _opacity_hbox.pack_start(_opacity_hscale, true, true, 4); _opacity_hbox.pack_start(_opacity_spin_button, false, false, 0); _opacity_hscale.set_draw_value(false); - _opacity_hscale.set_update_policy(Gtk::UPDATE_DELAYED); _opacity_adjustment.signal_value_changed().connect(sigc::mem_fun(*this, &ObjectCompositeSettings::_opacityValueChanged)); _opacity_label.set_mnemonic_widget(_opacity_hscale); diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index f5c7c8c56..df5bc0e16 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -72,7 +72,11 @@ void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget & if (label != "") { Gtk::Label* label_widget; +#if WITH_GTKMM_2_22 + label_widget = Gtk::manage(new Gtk::Label(label , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else label_widget = Gtk::manage(new Gtk::Label(label , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif label_widget->set_mnemonic_widget(widget); if (indent) { @@ -102,7 +106,11 @@ void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget & if (suffix != "") { +#if WITH_GTKMM_2_22 + Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif if (expand_widget) this->attach(*suffix_widget, 2, 3, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0); else @@ -121,8 +129,13 @@ void DialogPage::add_group_header(Glib::ustring name) int row = this->property_n_rows(); if (name != "") { +#if WITH_GTKMM_2_22 + Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name + + Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name + Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif label_widget->set_use_markup(true); this->attach(*label_widget , 0, 4, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0); if (row != 1) @@ -146,7 +159,7 @@ void PrefCheckButton::init(Glib::ustring const &label, Glib::ustring const &pref void PrefCheckButton::on_toggled() { - if (this->is_visible()) //only take action if the user toggled it + if (this->get_visible()) //only take action if the user toggled it { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setBool(_prefs_path, this->get_active()); @@ -198,7 +211,7 @@ void PrefRadioButton::on_toggled() this->changed_signal.emit(this->get_active()); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (this->is_visible() && this->get_active() ) //only take action if toggled by user (to active) + if (this->get_visible() && this->get_active() ) //only take action if toggled by user (to active) { if ( _value_type == VAL_STRING ) prefs->setString(_prefs_path, _string_value); @@ -242,7 +255,7 @@ void PrefSpinButton::init(Glib::ustring const &prefs_path, void PrefSpinButton::on_value_changed() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { if (_is_int) { if (_is_percent) { @@ -289,7 +302,7 @@ void PrefSpinUnit::init(Glib::ustring const &prefs_path, void PrefSpinUnit::on_my_value_changed() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (getWidget()->is_visible()) //only take action if user changed value + if (getWidget()->get_visible()) //only take action if user changed value { prefs->setDoubleUnit(_prefs_path, getValue(getUnit().abbr), getUnit().abbr); } @@ -421,7 +434,7 @@ ZoomCorrRuler::on_expose_event(GdkEventExpose */*event*/) { void ZoomCorrRulerSlider::on_slider_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -435,7 +448,7 @@ ZoomCorrRulerSlider::on_slider_value_changed() void ZoomCorrRulerSlider::on_spinbutton_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -457,7 +470,7 @@ ZoomCorrRulerSlider::on_unit_changed() { prefs->setString("/options/zoomcorrection/unit", _unit.getUnitAbbr()); double conv = _unit.getConversion(_unit.getUnitAbbr(), "px"); _ruler.set_unit_conversion(conv); - if (_ruler.is_visible()) { + if (_ruler.get_visible()) { _ruler.redraw(); } } @@ -510,7 +523,7 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl void PrefSlider::on_slider_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -523,7 +536,7 @@ PrefSlider::on_slider_value_changed() void PrefSlider::on_spinbutton_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -576,7 +589,11 @@ void PrefCombo::init(Glib::ustring const &prefs_path, for (int i = 0 ; i < num_items; ++i) { +#if WITH_GTKMM_2_24 + this->append(labels[i]); +#else this->append_text(labels[i]); +#endif _values.push_back(values[i]); if (value == values[i]) row = i; @@ -598,7 +615,11 @@ void PrefCombo::init(Glib::ustring const &prefs_path, for (int i = 0 ; i < num_items; ++i) { +#if WITH_GTKMM_2_24 + this->append(labels[i]); +#else this->append_text(labels[i]); +#endif _ustr_values.push_back(values[i]); if (value == values[i]) row = i; @@ -608,7 +629,7 @@ void PrefCombo::init(Glib::ustring const &prefs_path, void PrefCombo::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if(_values.size() > 0) @@ -643,7 +664,7 @@ void PrefEntryButtonHBox::init(Glib::ustring const &prefs_path, void PrefEntryButtonHBox::onRelatedEntryChangedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, relatedEntry->get_text()); @@ -652,7 +673,7 @@ void PrefEntryButtonHBox::onRelatedEntryChangedCallback() void PrefEntryButtonHBox::onRelatedButtonClickedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, _default_string); @@ -692,7 +713,7 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path, void PrefEntryFileButtonHBox::onRelatedEntryChangedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, relatedEntry->get_text()); @@ -703,7 +724,7 @@ static Inkscape::UI::Dialog::FileOpenDialog * selectPrefsFileInstance = NULL; void PrefEntryFileButtonHBox::onRelatedButtonClickedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { //# Get the current directory for finding files static Glib::ustring open_path; @@ -818,7 +839,7 @@ void PrefEntry::init(Glib::ustring const &prefs_path, bool visibility) void PrefEntry::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, this->get_text()); @@ -836,7 +857,7 @@ void PrefColorPicker::init(Glib::ustring const &label, Glib::ustring const &pref void PrefColorPicker::on_changed (guint32 rgba) { - if (this->is_visible()) //only take action if the user toggled it + if (this->get_visible()) //only take action if the user toggled it { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setInt(_prefs_path, (int) rgba); @@ -853,7 +874,7 @@ void PrefUnit::init(Glib::ustring const &prefs_path) void PrefUnit::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, getUnitAbbr()); diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp index 9490ac8d9..688739db3 100644 --- a/src/ui/widget/spin-slider.cpp +++ b/src/ui/widget/spin-slider.cpp @@ -97,11 +97,6 @@ Inkscape::UI::Widget::SpinButton& SpinSlider::get_spin_button() return _spin; } -void SpinSlider::set_update_policy(const Gtk::UpdateType u) -{ - _scale.set_update_policy(u); -} - void SpinSlider::remove_scale() { remove(_scale); @@ -189,12 +184,6 @@ SpinSlider& DualSpinSlider::get_spinslider2() return _s2; } -void DualSpinSlider::set_update_policy(const Gtk::UpdateType u) -{ - _s1.set_update_policy(u); - _s2.set_update_policy(u); -} - void DualSpinSlider::remove_scale() { _s1.remove_scale(); diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h index d2f41603a..c21b819ca 100644 --- a/src/ui/widget/spin-slider.h +++ b/src/ui/widget/spin-slider.h @@ -46,8 +46,6 @@ public: const Inkscape::UI::Widget::SpinButton& get_spin_button() const; Inkscape::UI::Widget::SpinButton& get_spin_button(); - void set_update_policy(const Gtk::UpdateType); - // Change the SpinSlider into a SpinButton with AttrWidget support) void remove_scale(); private: @@ -78,8 +76,6 @@ public: const SpinSlider& get_spinslider2() const; SpinSlider& get_spinslider2(); - void set_update_policy(const Gtk::UpdateType); - void remove_scale(); private: void link_toggled(); diff --git a/src/ui/widget/svg-canvas.cpp b/src/ui/widget/svg-canvas.cpp index a0d5e1215..a00c16f52 100644 --- a/src/ui/widget/svg-canvas.cpp +++ b/src/ui/widget/svg-canvas.cpp @@ -35,7 +35,7 @@ void SVGCanvas::init (SPDesktop *dt) { _dt = dt; - _widget->set_flags(Gtk::CAN_FOCUS); + _widget->set_can_focus(); // Set background to white Glib::RefPtr<Gtk::Style> style = _widget->get_style(); |
