document-properties.cpp revision aafecd12c7391755190b087fd72cb27be0a382ab
/**
* @file
* Document properties dialog, Gtkmm-style.
*/
/* Authors:
* bulia byak <buliabyak@users.sf.net>
* Bryce W. Harrington <bryce@bryceharrington.org>
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon Phillips <jon@rejon.org>
* Ralf Stephan <ralf@ark.in-berlin.de> (Gtkmm)
* Diederik van Lierop <mail@diedenrezi.nl>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2000 - 2008 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ui/widget/notebook-page.h"
#include "document-properties.h"
#include "display/canvas-grid.h"
#include "document.h"
#include "desktop.h"
#include "inkscape.h"
#include "preferences.h"
#include "ui/shape-editor.h"
#include "sp-namedview.h"
#include "sp-root.h"
#include "sp-script.h"
#include "style.h"
#include "svg/stringstream.h"
#include "ui/tools-switch.h"
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
#include "ui/dialog/filedialog.h"
#include "verbs.h"
#include "xml/node-event-vector.h"
#include <algorithm> // std::min
#include "rdf.h"
#include "ui/widget/entity-entry.h"
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#include "color-profile.h"
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#include <gtkmm/imagemenuitem.h>
#include "ui/icon-names.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
#define SPACE_SIZE_X 15
#define SPACE_SIZE_Y 10
//===================================================
//---------------------------------------------------
static void on_child_added(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void * data);
static void on_child_removed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void * data);
static void on_repr_attr_changed (Inkscape::XML::Node *, gchar const *, gchar const *, gchar const *, bool, gpointer);
on_child_added, // child_added
on_child_removed, // child_removed
NULL, // content_changed
NULL // order_changed
};
{
gtk_widget_show( child );
}
{
return instance;
}
//---------------------------------------------------------------
_rcb_antialias(_("Use antialiasing"), _("If unset, no antialiasing will be done on the drawing"), "shape-rendering", _wr, false, NULL, NULL, NULL, "crispEdges"),
_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),
_rcb_shad(_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false),
_rcp_bg(_("Back_ground color:"), _("Background color"), _("Color of the page background. Note: transparency setting ignored while editing but used when exporting to bitmap."), "pagecolor", "inkscape:pageopacity", _wr),
_rcp_bord(_("Border _color:"), _("Page border color"), _("Color of the page border"), "bordercolor", "borderopacity", _wr),
//---------------------------------------------------------------
//General snap options
_rcp_gui(_("Guide co_lor:"), _("Guideline color"), _("Color of guidelines"), "guidecolor", "guideopacity", _wr),
_rcp_hgui(_("_Highlight color:"), _("Highlighted guideline color"), _("Color of a guideline when it is under mouse"), "guidehicolor", "guidehiopacity", _wr),
//---------------------------------------------------------------
_("Snapping distance, in screen pixels, for snapping to objects"), _("Always snap to objects, regardless of their distance"),
_("If set, objects only snap to another object when it's within the range specified below"),
"objecttolerance", _wr),
//Options for snapping to grids
_("Snapping distance, in screen pixels, for snapping to grid"), _("Always snap to grids, regardless of the distance"),
_("If set, objects only snap to a grid line when it's within the range specified below"),
"gridtolerance", _wr),
//Options for snapping to guides
_("Snapping distance, in screen pixels, for snapping to guides"), _("Always snap to guides, regardless of the distance"),
_("If set, objects only snap to a guide when it's within the range specified below"),
"guidetolerance", _wr),
//---------------------------------------------------------------
_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),
_rcb_perp(_("Snap perpendicularly"), _("When snapping to paths or guides, then also try snapping perpendicularly"), "inkscape:snap-perpendicular", _wr),
_rcb_tang(_("Snap tangentially"), _("When snapping to paths or guides, then also try snapping tangentially"), "inkscape:snap-tangential", _wr),
//---------------------------------------------------------------
{
_wr.setUpdating (true);
build_page();
build_guides();
build_snap();
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
build_cms();
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_wr.setUpdating (false);
_grids_button_remove.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onRemoveGrid));
signalDocumentReplaced().connect(sigc::mem_fun(*this, &DocumentProperties::_handleDocumentReplaced));
signalDeactiveDesktop().connect(sigc::mem_fun(*this, &DocumentProperties::_handleDeactivateDesktop));
_rum_deflt.getUnitMenu()->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::onDocUnitChange));
}
void DocumentProperties::init()
{
update();
}
{
repr->removeListenerByData (this);
root->removeListenerByData (this);
delete (*it);
}
//========================================================================
/**
* Helper function that attaches widgets in a 3xn table. The widgets come in an
* array that has two entries per table row. The two entries code for four
* possible cases: (0,0) means insert space in first column; (0, non-0) means
* 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 WITH_GTKMM_3_0
arr[i]->set_hexpand();
#else
#endif
} else {
if (arr[i+1]) {
// only the PageSizer in Document Properties|Page should be stretched vertically
}
if (docum_prop_flag) {
// this sets the padding for subordinate widgets on the "Page" page
if( i==(n-8) || i==(n-10) ) {
#if WITH_GTKMM_3_0
else
#else
#endif
} else {
#if WITH_GTKMM_3_0
else
#else
#endif
}
} else {
#if WITH_GTKMM_3_0
else
#else
#endif
}
} else if (arr[i]) {
#if WITH_GTKMM_3_0
label.set_hexpand();
#else
#endif
} else {
#if WITH_GTKMM_3_0
#else
#endif
}
}
++r;
}
}
void DocumentProperties::build_page()
{
_page_page->show();
_page_sizer.init();
{
label_gen, 0,
0, &_rum_deflt,
//label_col, 0,
//_rcp_bg._label, &_rcp_bg,
0, 0,
label_for, 0,
0, &_page_sizer,
0, 0,
label_dsp, 0,
0, &_rcb_canb,
0, &_rcb_bord,
0, &_rcb_shad,
0, &_rcb_antialias,
};
}
void DocumentProperties::build_guides()
{
_page_guides->show();
{
label_gui, 0,
0, &_rcb_sgui,
};
}
void DocumentProperties::build_snap()
{
_page_snap->show();
{
label_o, 0,
0, &_rcb_snclp,
0, &_rcb_snmsk,
0, 0,
label_gr, 0,
0, 0,
label_gu, 0,
0, 0,
label_m, 0,
0, &_rcb_perp,
0, &_rcb_tang
};
}
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/// Populates the available color profiles combo box
// Iterate through the list of profiles and add the name to the combo box.
std::vector<std::pair<Glib::ustring, Glib::ustring> > pairs = ColorProfile::getProfileFilesWithNames();
for ( std::vector<std::pair<Glib::ustring, Glib::ustring> >::const_iterator it = pairs.begin(); it != pairs.end(); ++it ) {
}
}
/**
* Cleans up name to remove disallowed characters.
* Some discussion at http://markmail.org/message/bhfvdfptt25kgtmj
* Allowed ASCII first characters: ':', 'A'-'Z', '_', 'a'-'z'
* Allowed ASCII remaining chars add: '-', '.', '0'-'9',
*
* @param str the string to clean up.
*/
{
&& (val != '_')
&& (val != ':')) {
}
&& (val != '_')
&& (val != ':')
&& (val != '-')
&& (val != '.')) {
}
}
}
}
/// Links the selected color profile in the combo box to the document
{
//store this profile in the SVG document (create <color-profile> element in the XML)
// TODO remove use of 'active' desktop
if (!desktop){
g_warning("No active desktop");
} else {
// Find the index of the currently-selected row in the color profiles combobox
if (row == -1){
g_warning("No color profile available.");
return;
}
// Read the filename and description from the list of available profiles
std::vector<std::pair<Glib::ustring, Glib::ustring> > pairs = ColorProfile::getProfileFilesWithNames();
return;
}
// Checks whether there is a defs element. Creates it when needed
if (!defsRepr){
}
// TODO check if this next line was sometimes needed. It being there caused an assertion.
//Inkscape::GC::release(defsRepr);
// inform the document, so we can undo
}
}
{
}
// row[_LinkedProfilesListColumns.previewColumn] = "Color Preview";
}
}
{
}
}
{
}
}
{
}
}
{
}
{
}
{
}
{
if (sel) {
}
}
void DocumentProperties::removeSelectedProfile(){
if(_LinkedProfilesList.get_selection()) {
if(i){
} else {
return;
}
}
prof->deleteObject(true, false);
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile"));
break; // removing the color profile likely invalidates part of the traversed list, stop traversing here.
}
}
}
void DocumentProperties::build_cms()
{
#if WITH_GTKMM_3_0
#else
_page_cms->table().attach(*label_link, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#else
_page_cms->table().attach(_LinkedProfilesListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
spacer->set_hexpand();
#else
_page_cms->table().attach(*spacer, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#else
_page_cms->table().attach(*label_avail, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#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
//# Set up the Linked Profiles combo box
// _LinkedProfilesList.append_column(_("Color Preview"), _LinkedProfilesListColumns.previewColumn);
// TODO restore? _LinkedProfilesList.set_fixed_height_mode(true);
_unlink_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile));
_LinkedProfilesList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onColorProfileSelectRow) );
_LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release));
cms_create_popup_menu(_LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile));
}
_emb_profiles_observer.signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::populate_linked_profiles_box));
}
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void DocumentProperties::build_scripting()
{
_page_scripting->show();
//# External scripts tab
#if WITH_GTKMM_3_0
#else
_page_external_scripts->table().attach(*label_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#else
_page_external_scripts->table().attach(_ExternalScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#else
_page_external_scripts->table().attach(*spacer_external, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#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
//# Set up the External Scripts box
// TODO restore? _ExternalScriptsList.set_fixed_height_mode(true);
//# Embedded scripts tab
#if !WITH_GTKMM_3_0
// TODO: This has been removed from Gtkmm 3.0. Check that
// everything still looks OK!
#endif
row = 0;
#if WITH_GTKMM_3_0
#else
_page_embedded_scripts->table().attach(*label_embedded, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#else
_page_embedded_scripts->table().attach(_EmbeddedScriptsListScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
row++;
#if WITH_GTKMM_3_0
#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++;
#if WITH_GTKMM_3_0
#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
// TODO restore? _EmbeddedScriptsList.set_fixed_height_mode(true);
//# Set up the Embedded Scripts content box
#if WITH_GTKMM_3_0
#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++;
#if WITH_GTKMM_3_0
#else
_page_embedded_scripts->table().attach(_EmbeddedContentScroller, 0, 3, row, row + 1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0, 0, 0);
#endif
_EmbeddedScriptsList.signal_cursor_changed().connect(sigc::mem_fun(*this, &DocumentProperties::changeEmbeddedScript));
_EmbeddedScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onEmbeddedScriptSelectRow) );
_ExternalScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onExternalScriptSelectRow) );
_EmbeddedContent.get_buffer()->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::editEmbeddedScript));
_external_add_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::addExternalScript));
_embed_new_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::addEmbeddedScript));
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
_external_remove_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeExternalScript));
_embed_remove_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeEmbeddedScript));
_ExternalScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::external_scripts_list_button_release));
external_create_popup_menu(_ExternalScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeExternalScript));
_EmbeddedScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::embedded_scripts_list_button_release));
embedded_create_popup_menu(_EmbeddedScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeEmbeddedScript));
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
//TODO: review this observers code:
}
_scripts_observer.signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::populate_script_lists));
}
void DocumentProperties::build_metadata()
{
_page_metadata1->show();
#if WITH_GTKMM_3_0
#else
#endif
/* add generic metadata entry areas */
struct rdf_work_entity_t * entity;
int row = 1;
#if WITH_GTKMM_3_0
w->_packable->set_hexpand();
#else
_page_metadata1->table().attach (*w->_packable, 2,3, row, row+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
#endif
}
}
#if WITH_GTKMM_3_0
#else
#endif
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();
row = 0;
#if WITH_GTKMM_3_0
#else
#endif
/* add license selector pull-down and URI */
++row;
#if WITH_GTKMM_3_0
#else
_page_metadata2->table().attach (_licensor, 1,3, row, row+1, Gtk::EXPAND|Gtk::FILL, (Gtk::AttachOptions)0,0,0);
#endif
}
void DocumentProperties::addExternalScript(){
if (!desktop) {
g_warning("No active desktop");
return;
}
// Click Add button with no filename, show a Browse dialog
}
// inform the document, so we can undo
}
}
void DocumentProperties::browseExternalScript() {
//# Get the current directory for finding files
//# Test if the open_path directory exists
open_path = "";
//# If no open path, default to our home directory
{
open_path = g_get_home_dir();
}
//# Create a dialog
if (!selectPrefsFileInstance) {
*desktop->getToplevel(),
_("Select a script to load"));
}
//# Show the dialog
if (!success) {
return;
}
//# User selected something. Get name and type
}
void DocumentProperties::addEmbeddedScript(){
if (!desktop){
g_warning("No active desktop");
} else {
// inform the document, so we can undo
}
}
void DocumentProperties::removeExternalScript(){
if(_ExternalScriptsList.get_selection()) {
if(i){
} else {
return;
}
}
if (obj) {
//XML Tree being used directly here while it shouldn't be.
if (repr){
// inform the document, so we can undo
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script"));
}
}
}
}
}
void DocumentProperties::removeEmbeddedScript(){
if(_EmbeddedScriptsList.get_selection()) {
if(i){
} else {
return;
}
}
if (obj) {
//XML Tree being used directly here while it shouldn't be.
if (repr){
// inform the document, so we can undo
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, _("Remove embedded script"));
}
}
}
{
if (sel) {
}
}
{
if (sel) {
}
}
void DocumentProperties::changeEmbeddedScript(){
if(_EmbeddedScriptsList.get_selection()) {
if(i){
} else {
return;
}
}
bool voidscript=true;
int count=0;
{
count++;
}
if (count>1)
g_warning("TODO: Found a script element with multiple (%d) child nodes! We must implement support for that!", count);
//XML Tree being used directly here while it shouldn't be.
//TODO: shouldnt we get all children instead of simply the first child?
if (content){
voidscript=false;
}
}
}
}
if (voidscript)
}
void DocumentProperties::editEmbeddedScript(){
if(_EmbeddedScriptsList.get_selection()) {
if(i){
} else {
return;
}
}
//XML Tree being used directly here while it shouldn't be.
if (repr){
//TODO repr->set_content(_EmbeddedContent.get_buffer()->get_text());
// inform the document, so we can undo
}
}
}
}
void DocumentProperties::populate_script_lists(){
}
{
}
else // Embedded scripts
{
}
}
}
/**
* Called for _updating_ the dialog (e.g. when a new grid was manually added in XML)
*/
void DocumentProperties::update_gridspage()
{
//remove all tabs
while (_grids_notebook.get_n_pages() != 0) {
}
//add tabs
bool grids_present = false;
for(std::vector<Inkscape::CanvasGrid *>::const_iterator it = nv->grids.begin(); it != nv->grids.end(); ++it) {
switch ((*it)->getGridType()) {
case GRID_RECTANGULAR:
icon = "grid-rectangular";
break;
case GRID_AXONOMETRIC:
icon = "grid-axonometric";
break;
default:
break;
}
grids_present = true;
}
if (grids_present)
else
_grids_button_remove.set_sensitive(false);
}
/**
* Build grid page of dialog.
*/
void DocumentProperties::build_gridspage()
{
/// \todo FIXME: gray out snapping when grid is off.
/// Dissenting view: you want snapping without grid.
(void)nv;
for (gint t = 0; t <= GRID_MAXTYPENR; t++) {
}
}
/**
* Update dialog widgets from desktop. Also call updateWidget routines of the grids.
*/
void DocumentProperties::update()
{
if (_wr.isUpdating()) return;
_wr.setUpdating (true);
set_sensitive (true);
//-----------------------------------------------------------page page
_rcb_antialias.setActive(root->style->shape_rendering.computed != SP_CSS_SHAPE_RENDERING_CRISPEDGES);
if (nv->display_units) {
}
if (doc_w_unit == "") {
doc_w_unit = "px";
doc_w_unit = "px";
}
if (doc_h_unit == "") {
doc_h_unit = "px";
doc_h_unit = "px";
}
_page_sizer.setDim(Inkscape::Util::Quantity(doc_w, doc_w_unit), Inkscape::Util::Quantity(doc_h, doc_h_unit));
//-----------------------------------------------------------guide page
//-----------------------------------------------------------snap page
_rcb_snclp.setActive (nv->snap_manager.snapprefs.isSnapButtonEnabled(Inkscape::SNAPTARGET_PATH_CLIP));
_rcb_snmsk.setActive (nv->snap_manager.snapprefs.isSnapButtonEnabled(Inkscape::SNAPTARGET_PATH_MASK));
//-----------------------------------------------------------grids page
//------------------------------------------------Color Management page
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
//-----------------------------------------------------------meta pages
/* update the RDF entities */
_wr.setUpdating (false);
}
// TODO: copied from fill-and-stroke.cpp factor out into new ui/widget file?
{
label_image)));
return *_tab_label_box;
}
//--------------------------------------------------------------------
{
{
}
hide();
}
{
/* Get the data RDF entities data from preferences*/
(*it)->load_from_preferences ();
}
}
{
/* Save these RDF entities to preferences*/
}
}
{
update();
}
{
update();
}
{
repr->removeListenerByData(this);
root->removeListenerByData(this);
}
static void on_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node */*child*/, Inkscape::XML::Node */*ref*/, void *data)
{
}
static void on_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node */*child*/, Inkscape::XML::Node */*ref*/, void *data)
{
}
/**
* Called when XML node attribute changed; updates dialog widgets.
*/
static void on_repr_attr_changed(Inkscape::XML::Node *, gchar const *, gchar const *, gchar const *, bool, gpointer data)
{
}
/*########################################################################
# BUTTON CLICK HANDLERS (callbacks)
########################################################################*/
void DocumentProperties::onNewGrid()
{
// toggle grid showing to ON:
}
void DocumentProperties::onRemoveGrid()
{
return;
if (found_grid) {
// delete the grid that corresponds with the selected tab
// when the grid is deleted from SVG, the SPNamedview handler automatically deletes the object, so found_grid becomes an invalid pointer!
}
}
/** Callback for document unit change. */
/* This should not effect anything in the SVG tree (other than "inkscape:document-units").
This should only effect values displayed in the GUI. */
void DocumentProperties::onDocUnitChange()
{
// Don't execute when change is being undone
return;
}
// Don't execute when initializing widgets
if (_wr.isUpdating()) {
return;
}
/*Inkscape::Util::Unit const *old_doc_unit = unit_table.getUnit("px");
if(repr->attribute("inkscape:document-units")) {
old_doc_unit = unit_table.getUnit(repr->attribute("inkscape:document-units"));
}*/
// Set document unit
// Disable changing of SVG Units. The intent here is to change the units in the UI, not the units in SVG.
// This code should be moved (and fixed) once we have an "SVG Units" setting that sets what units are used in SVG data.
#if 0
// Set viewBox
} else {
}
// TODO: Fix bug in nodes tool instead of switching away from it
}
// Scale and translate objects
// set transform options to scale all things with the transform, so all things scale properly after the viewbox change.
// save prefs
{
ShapeEditor::blockSetItem(true);
if ( !vb.hasZeroArea() ) {
}
doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] +
false);
ShapeEditor::blockSetItem(false);
}
#endif
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :