Inkscape Namespace Reference

Note: We must limit Java or JVM-specific code to this file and to dobinding.cpp. More...

Namespaces

namespace  Algorithms
 

Some STL-style algorithms.


namespace  Bind
namespace  Debug
 

Debugging utilities.


namespace  Display
 

Rendering-related code.


namespace  Extension
 

Extension support.


namespace  Filters
namespace  GC
 

Boehm-GC based garbage collector.


namespace  IO
 

Low-level IO code.


namespace  LivePathEffect
 

Live Path Effects code.


namespace  NodePath
namespace  NSApplication
namespace  SVG
namespace  Text
namespace  Trace
 

Tracing backend.


namespace  Traits
namespace  UI
 

User interface code.


namespace  Util
 

Miscellaneous supporting code.


namespace  Whiteboard
namespace  Widgets
namespace  XML
 

Inkscape XML tree


Classes

class  BadURIException
class  UnsupportedURIException
class  MalformedURIException
struct  ColorProfileClass
 The SPColorProfile vtable. More...
struct  ColorProfile
 Color Profile. More...
class  CompositeUndoStackObserver
 Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo system. More...
class  ConnectionPool
class  ConsoleOutputUndoObserver
class  InputDeviceImpl
class  IdMatcher
class  LinkMatcher
class  DeviceManagerImpl
class  InputDevice
class  DeviceManager
class  CanvasAxonomGrid
class  CanvasAxonomGridSnapper
struct  GridCanvasItem
 All the variables that are tracked for a grid specific canvas item. More...
struct  GridCanvasItemClass
class  CanvasGrid
class  CanvasXYGrid
class  CanvasXYGridSnapper
class  DocumentSubset
class  EventLog
struct  Event
class  GuideSnapper
 Snap to guides. More...
class  UnitTracker
struct  Application
struct  ApplicationClass
class  LayerManager
class  FontLister
 This class enumerates fonts using libnrtype into reusable data stores and allows for random access to the font list. More...
class  LineSnapper
class  CmdLineAction
class  MessageContext
 A convenience class for working with MessageStacks. More...
class  MessageStack
 A class which holds a stack of displayed messages. More...
class  ObjectHierarchy
 An Inkscape::ObjectHierarchy is useful for situations where one wishes to keep a reference to an SPObject, but fall back on one of its ancestors when that object is removed. More...
class  ObjectSnapper
class  ErrorReporter
class  Preferences
 Preference storage class. More...
class  ProfileManager
class  Rubberband
class  SelCue
class  SelectionHelper
class  SelectionDescriber
class  Selection
 The set of selected SPObjects for a given desktop. More...
class  SelTrans
class  SnapCandidatePoint
 Class to store data for points which are snap candidates, either as a source or as a target. More...
class  SnapCandidateItem
class  SnapCandidatePath
class  SnapPreferences
class  SnappedCurve
 Class describing the result of an attempt to snap to a curve. More...
class  SnappedLineSegment
 Class describing the result of an attempt to snap to a line segment. More...
class  SnappedLine
 Class describing the result of an attempt to snap to a line. More...
class  SnappedPoint
 Class describing the result of an attempt to snap. More...
class  Snapper
 Parent for classes that can snap points to something. More...
class  CSSOStringStream
 A thin wrapper around std::ostringstream, but writing floating point numbers in the format required by CSS: `. More...
class  SVGOStringStream
class  SVGIStringStream
class  SvgProfile
 A class that contains information on which SVG profiles are marked for the object. More...
class  UndoStackObserver
 Observes changes made to the undo and redo stacks. More...
class  URIReference
 A class encapsulating a reference to a particular URI; observers can be notified when the URI comes to reference a different SPObject. More...
class  URI
 Represents an URI as per RFC 2396. More...
class  FileVerb
 A class to encompass all of the verbs which deal with file operations. More...
class  EditVerb
 A class to encompass all of the verbs which deal with edit operations. More...
class  SelectionVerb
 A class to encompass all of the verbs which deal with selection operations. More...
class  LayerVerb
 A class to encompass all of the verbs which deal with layer operations. More...
class  ObjectVerb
 A class to encompass all of the verbs which deal with operations related to objects. More...
class  ContextVerb
 A class to encompass all of the verbs which deal with operations relative to context. More...
class  ZoomVerb
 A class to encompass all of the verbs which deal with zoom operations. More...
class  DialogVerb
 A class to encompass all of the verbs which deal with dialog operations. More...
class  HelpVerb
 A class to encompass all of the verbs which deal with help operations. More...
class  TutorialVerb
 A class to encompass all of the verbs which deal with tutorial operations. More...
class  TextVerb
 A class to encompass all of the verbs which deal with text operations. More...
class  EffectLastVerb
 A class to represent the last effect issued. More...
class  FitCanvasVerb
 A class to represent the canvas fitting verbs. More...
class  LockAndHideVerb
 A class to represent the object unlocking and unhiding verbs. More...
class  Verb
 A class to represent things the user can do. More...
struct  Version
struct  compare_quark_ids

Typedefs

typedef unsigned long MessageId
 An integer ID which identifies a displayed message in a particular Inkscape::MessageStack.
typedef std::ios_base &(* std_oct_type )(std::ios_base &)

Enumerations

enum  {
  RENDERING_INTENT_UNKNOWN = 0, RENDERING_INTENT_AUTO = 1, RENDERING_INTENT_PERCEPTUAL = 2, RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3,
  RENDERING_INTENT_SATURATION = 4, RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5
}
enum  GridType { GRID_RECTANGULAR = 0, GRID_AXONOMETRIC = 1 }
enum  RenderMode { RENDERMODE_NORMAL, RENDERMODE_NO_FILTERS, RENDERMODE_OUTLINE, RENDERMODE_PRINT_COLORS_PREVIEW }
enum  { COLUMN_STRING, COLUMN_SPUNIT, N_COLUMNS }
enum  IconSize {
  ICON_SIZE_INVALID = ::GTK_ICON_SIZE_INVALID, ICON_SIZE_MENU = ::GTK_ICON_SIZE_MENU, ICON_SIZE_SMALL_TOOLBAR = ::GTK_ICON_SIZE_SMALL_TOOLBAR, ICON_SIZE_LARGE_TOOLBAR = ::GTK_ICON_SIZE_LARGE_TOOLBAR,
  ICON_SIZE_BUTTON = ::GTK_ICON_SIZE_BUTTON, ICON_SIZE_DND = ::GTK_ICON_SIZE_DND, ICON_SIZE_DIALOG = ::GTK_ICON_SIZE_DIALOG, ICON_SIZE_DECORATION
}
enum  LayerRelativePosition { LPOS_ABOVE, LPOS_BELOW, LPOS_CHILD }
enum  MessageType {
  NORMAL_MESSAGE, IMMEDIATE_MESSAGE, WARNING_MESSAGE, ERROR_MESSAGE,
  INFORMATION_MESSAGE
}
 

A hint about the meaning of a message; is it an ordinary message, a message advising the user of some significant or unexpected condition, or a message indicating an unambiguous error.

More...
enum  SnapTargetType {
  SNAPTARGET_UNDEFINED = 0, SNAPTARGET_GRID, SNAPTARGET_GRID_INTERSECTION, SNAPTARGET_GUIDE,
  SNAPTARGET_GUIDE_INTERSECTION, SNAPTARGET_GUIDE_ORIGIN, SNAPTARGET_GRID_GUIDE_INTERSECTION, SNAPTARGET_NODE_SMOOTH,
  SNAPTARGET_NODE_CUSP, SNAPTARGET_LINE_MIDPOINT, SNAPTARGET_OBJECT_MIDPOINT, SNAPTARGET_ROTATION_CENTER,
  SNAPTARGET_HANDLE, SNAPTARGET_PATH, SNAPTARGET_PATH_INTERSECTION, SNAPTARGET_BBOX_CORNER,
  SNAPTARGET_BBOX_EDGE, SNAPTARGET_BBOX_EDGE_MIDPOINT, SNAPTARGET_BBOX_MIDPOINT, SNAPTARGET_PAGE_BORDER,
  SNAPTARGET_PAGE_CORNER, SNAPTARGET_CONVEX_HULL_CORNER, SNAPTARGET_ELLIPSE_QUADRANT_POINT, SNAPTARGET_CENTER,
  SNAPTARGET_CORNER, SNAPTARGET_TEXT_BASELINE, SNAPTARGET_CONSTRAINED_ANGLE, SNAPTARGET_CONSTRAINT
}
enum  SnapSourceType {
  SNAPSOURCE_UNDEFINED = 0, SNAPSOURCE_BBOX_CATEGORY = 256, SNAPSOURCE_BBOX_CORNER, SNAPSOURCE_BBOX_MIDPOINT,
  SNAPSOURCE_BBOX_EDGE_MIDPOINT, SNAPSOURCE_NODE_CATEGORY = 512, SNAPSOURCE_NODE_SMOOTH, SNAPSOURCE_NODE_CUSP,
  SNAPSOURCE_LINE_MIDPOINT, SNAPSOURCE_PATH_INTERSECTION, SNAPSOURCE_CORNER, SNAPSOURCE_CONVEX_HULL_CORNER,
  SNAPSOURCE_ELLIPSE_QUADRANT_POINT, SNAPSOURCE_NODE_HANDLE, SNAPSOURCE_OTHER_CATEGORY = 1024, SNAPSOURCE_OBJECT_MIDPOINT,
  SNAPSOURCE_ROTATION_CENTER, SNAPSOURCE_CENTER, SNAPSOURCE_GUIDE, SNAPSOURCE_GUIDE_ORIGIN,
  SNAPSOURCE_TEXT_BASELINE, SNAPSOURCE_OTHER_HANDLE, SNAPSOURCE_GRID_PITCH
}

Functions

GType colorprofile_get_type ()
 Register ColorProfile class and return its type.
SVGIStringStreamoperator>> (SVGIStringStream &istr, ConnectionPoint &cp)
SVGOStringStreamoperator<< (SVGOStringStream &ostr, const ConnectionPoint &cp)
bool have_viable_layer (SPDesktop *desktop, MessageContext *message)
 Check to see if the current layer is both unhidden and unlocked.
bool have_viable_layer (SPDesktop *desktop, MessageStack *message)
 Check to see if the current layer is both unhidden and unlocked.
Geom::Rect snap_rectangular_box (SPDesktop const *desktop, SPItem *item, Geom::Point const &pt, Geom::Point const &center, int state)
Geom::Point setup_for_drag_start (SPDesktop *desktop, SPEventContext *ec, GdkEvent *ev)
double decimal_round (double const x, int const nplaces)
 Returns x rounded to the nearest nplaces decimal places.
static std::map< gint, gint > bitVals (vals,&vals[G_N_ELEMENTS(vals)])
static void attach_all (Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int start=0)
static gboolean sp_nv_read_length (gchar const *str, guint base, gdouble *val, SPUnit const **unit)
static gboolean sp_nv_read_opacity (gchar const *str, guint32 *color)
static void grid_canvasitem_class_init (GridCanvasItemClass *klass)
static void grid_canvasitem_init (GridCanvasItem *grid)
static void grid_canvasitem_destroy (GtkObject *object)
static void grid_canvasitem_update (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags)
static void grid_canvasitem_render (SPCanvasItem *item, SPCanvasBuf *buf)
GtkType grid_canvasitem_get_type (void)
static void validateScalar (double oldVal, double *pTarget)
 If the passed scalar is invalid (<=0), then set the widget and the scalar to use the given old value.
static void validateInt (gint oldVal, gint *pTarget)
 If the passed int is invalid (<=0), then set the widget and the int to use the given old value.
static void grid_hline (SPCanvasBuf *buf, gint y, gint xs, gint xe, guint32 rgba)
static void grid_vline (SPCanvasBuf *buf, gint x, gint ys, gint ye, guint32 rgba)
static void grid_dot (SPCanvasBuf *buf, gint x, gint y, guint32 rgba)
GtkIconSize getRegisteredIconSize (IconSize size)
SPObjectnext_layer (SPObject *root, SPObject *layer)
 Finds the next layer under root, relative to layer in depth-first order.
SPObjectprevious_layer (SPObject *root, SPObject *layer)
 Finds the previous layer under root, relative to layer in depth-first order.
SPObjectcreate_layer (SPObject *root, SPObject *layer, LayerRelativePosition position)
 Creates a new layer.
void getBBoxPoints (Geom::OptRect const bbox, std::vector< SnapCandidatePoint > *points, bool const isTarget, bool const includeCorners, bool const includeLineMidpoints, bool const includeObjectMidpoints)
static Inkscape::XML::DocumentloadImpl (std::string const &prefsFilename, Glib::ustring &errMsg)
static void migrateDetails (Inkscape::XML::Document *from, Inkscape::XML::Document *to)
static void file_add_recent (gchar const *uri)
double round (double const x)
 Returns x rounded to the nearest integer.
Geom::Scale calcScaleFactors (Geom::Point const &initial_point, Geom::Point const &new_point, Geom::Point const &origin, bool const skew=false)
template<class T >
T * createSuiteAndDocument (void(*fun)(T *&))
void queueIconPrerender (Glib::ustring const &oid, Inkscape::IconSize size=Inkscape::ICON_SIZE_BUTTON)

Variables

static pair< gint, gint > vals []
static DeviceManagerImpltheInstance = 0
static gchar const *const grid_name []
static gchar const *const grid_svgname []
static SPCanvasItemClassparent_class
static
Inkscape::XML::NodeEventVector
const 
_repr_events
gchar const * version_string
 Full version string.
static Inkscape::XML::DocumentmigrateFromDoc = 0

Detailed Description

Note: We must limit Java or JVM-specific code to this file and to dobinding.cpp.

Main toolbox.

Simplified management of enumerations of svg items with UI labels.

Undo stack observer interface.

Unit Menu Widget - A drop down menu for choosing unit types.

Toolbox Widget - A detachable toolbar for buttons and other widgets.

Text Widget - A labelled text box, with optional icon or suffix, for entering arbitrary number values.

Text Widget - A labelled text box, with spin buttons and optional icon or suffix, for entering arbitrary number values.

Abstraction for different style widget operands.

Groups an HScale and a SpinButton together using the same Adjustment.

Scalar Unit Widget - A labelled text box, with spin buttons and optional icon or suffix, for entering the values of various unit types.

widget adjustable by dragging it to rotate away from a zero-change axis

Rendering Options Widget - A container for selecting rendering options.

Rendering options widget.

Random Scalar Widget - A labelled text box, with spin buttons and optional icon or suffix, for entering arbitrary number values and generating a random number from it.

Scalar Widget - A labelled text box, with spin buttons and optional icon or suffix, for entering arbitrary number values.

Inkscape Preferences dialog.

Point Widget - A labelled text box, with spin buttons and optional icon or suffix, for entering arbitrary coordinate values.

Generic Panel widget - A generic dockable container.

Panel widget.

Notebook Page Widget - A tabbed notebook page for dialogs.

Notebook page widget.

Labelled Widget - Adds a label with optional icon or suffix to another widget.

Icon Widget - General image widget (including SVG icons).

Icon Widget.

HandleBox Widget - Adds a detachment handle to another widget.

A custom wrapper around gdl-dock-item.

A custom Inkscape wrapper around gdl_dock_item.

Simplified management of enumerations in the UI as combobox.

Button and CheckButton widgets.

Very basic interface for classes that control attributes.

empty file left in repo for current desktop.h

Empty file left in repo for current desktop.cpp.

Dialog for modifying guidelines.

Find dialog.

A generic interface for plugging different autotracers into Inkscape.

Inkscape::SVG::PathString - builder for SVG path strings.

Whiteboard session manager.

Session file selector widget.

Whiteboard session manager XML node manipulation / retrieval utilities.

Whiteboard session manager XML node tracking facility.

Inkscape::Whiteboard::MessageVerifier -- performs basic XMPP-related validity checks on incoming messages.

Message generation utilities.

Whiteboard session manager Message tags.

Whiteboard message queue.

Whiteboard message queue and queue handler functions Node for storing messages in message queues.

Aggregates individual serialized XML::Events into larger packages for more efficient delivery.

Inkscape::Whiteboard::KeyNodeTable - structure for lookup of values from keys and vice versa.

Whiteboard invitation confirmation dialog -- quick subclass of Gtk::MessageDialog.

Inkscape::Whiteboard::InkboardDocument - Inkboard document implementation.

Choose Desktop dialog.

Whiteboard session manager Definitions.

Xslt-enabled input and output streams.

XSL Transforming input and output classes.

This should be the only way that we provide sources/sinks to any input/output stream.

Our base String stream classes.

Our base basic stream classes.

Our base input/output stream classes.

Zlib-enabled input and output streams.

Base64-enabled input and output streams.

Inkscape Scripting container.

This is a simple mechanism to bind Inkscape to Java, and thence to all of the nice things that can be layered upon that.

OpenDocument <drawing> input and output.

Inkscape::EventLog.

Main Inkscape namespace.

Inkscape::ConsoleOutputUndoObserver - observer for tracing calls to sp_document_undo, sp_document_redo, sp_document_maybe_done.

Aggregates undo stack observers for management and triggering in SPDocument.

Aggregates undo stack observers for convenient management and triggering in SPDocument.

It should be hidden from javabind.h

This file is mostly about getting things up and running, and providing the basic C-to-Java hooks.

dobinding.cpp will have the rote and repetitious class-by-class binding

Heavily inspired by Inkscape::XML::CompositeNodeObserver.

Authors: David Yip <yipdw@rose-hulman.edu>

Copyright (c) 2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: David Yip <yipdw@alumni.rose-hulman.edu>

Copyright (c) 2006 Authors

Released under GNU GPL, see the file 'COPYING' for more information

This namespace contains all code internal to Inkscape.

A simple log for maintaining a history of commited, undone and redone events along with their type. It implements the UndoStackObserver and should be registered with a CompositeUndoStackObserver for each document. The event log is then notified on all commit, undo and redo events and will store a representation of them in an internal Gtk::TreeStore.

Consecutive events of the same type are grouped with the first event as a parent and following as its children.

If a Gtk::TreeView is connected to the event log, the TreeView's selection and its nodes expanded/collapsed state will be updated as events are commited, undone and redone. Whenever this happens, the event log will block the TreeView's callbacks to prevent circular updates.

Author: Gustav Broberg <broberg@kth.se>

Copyright (c) 2006, 2007 Authors

Released under GNU GPL, read the file 'COPYING' for more information

This is an an entry in the extensions mechanism to begin to enable the inputting and outputting of OpenDocument Format (ODF) files from within Inkscape. Although the initial implementations will be very lossy do to the differences in the models of SVG and ODF, they will hopefully improve greatly with time. People should consider this to be a framework that can be continously upgraded for ever improving fidelity. Potential developers should especially look in preprocess() and writeTree() to see how the SVG tree is scanned, read, translated, and then written to ODF.

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html

Authors: Bob Jamison

Copyright (C) 2006, 2007 Bob Jamison

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

This is an an entry in the extensions mechanism to begin to enable the inputting and outputting of OpenDocument Format (ODF) files from within Inkscape. Although the initial implementations will be very lossy do to the differences in the models of SVG and ODF, they will hopefully improve greatly with time.

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html

Authors: Bob Jamison

Copyright (C) 2006 Bob Jamison

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Authors: Bob Jamison

Copyright (C) 2007-2008 Bob Jamison

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004-2008 Bob Jamison

Released under GNU GPL, read the file 'COPYING' for more information

This class allows easy encoding and decoding of Base64 data with a stream interface, hiding the implementation from the user.

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

This is a thin wrapper of libz calls, in order to provide a simple interface to our developers for gzip input and output.

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

These are is directly inherited from iostreams, and includes any extra functionality that we might need.

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

We implement these to be based on Glib::ustring

Authors: Bob Jamison <rjamison@titan.com>

Copyright (C) 2004 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Bob Jamison <ishmalius@gmail.com>

Copyright (C) 2004-2008 Inkscape.org

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Dale Harvey <harveyd@gmail.com>

Copyright (c) 2006 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Dale Harvey <harveyd@gmail.com>

Copyright (C) 2006 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: David Yip <yipdw@rose-hulman.edu>

Copyright (c) 2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Dale Harvey <harveyd@gmail.com>

Copyright (c) 2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Bob Jamison

Copyright (c) 2005 Authors

Authors: David Yip <yipdw@rose-hulman.edu> Jonas Collaros, Stephen Montgomery

Copyright (c) 2004-2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: David Yip <yipdw@alumni.rose-hulman.edu>

Copyright (c) 2006 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: David Yip <yipdw@rose-hulman.edu>

Released under GNU GPL, read the file 'COPYING' for more information

Authors: David Yip <yipdw@rose-hulman.edu> Bob Jamison (Pedro port)

Copyright (c) 2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Copyright 2007 MenTaLguY <mental@rydia.net> Copyright 2008 Jasper van de Gronde <th.v.d.gronde@hccnet.nl>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

See the file COPYING for details.

Authors: Bob Jamison <rjamison@earthlink.net>

Copyright (C) 2004-2006 Bob Jamison

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Bryce W. Harrington <bryce@bryceharrington.org> Johan Engelen <goejendaagh@zonnet.nl>

Copyright (C) 2004-2006 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Andrius R. <knutux@gmail.com> Johan Engelen

Copyright (C) 2006-2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information

Authors: Nicholas Bishop <nicholasbishop@gmail.com> Rodrigo Kumpera <kumpera@gmail.com>

Copyright (C) 2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: buliabyak@gmail.com

Copyright (C) 2005 author

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Nicholas Bishop <nicholasbishop@gmail.com> Johan Engelen <j.b.c.engelen@ewi.utwente.nl>

Copyright (C) 2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Gustav Broberg <broberg@kth.se>

Copyright (C) 2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

This work really doesn't amount to much more than a convenience constructor for Gtk::HandleBox. Maybe this could be contributed back to Gtkmm, as Gtkmm provides several convenience constructors for other widgets as well.

Author: Derek P. Moore <derekm@hackunix.org>

Copyright (C) 2004 Derek P. Moore

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2004 Bryce Harrington based on work by Lauris Kaplinski in 2002 released under GPL

Released under GNU GPL. Read the file 'COPYING' for more information

Author: Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2004 Bryce Harrington

Released under GNU GPL. Read the file 'COPYING' for more information

Authors: Carl Hetherington <inkscape@carlh.net> Derek P. Moore <derekm@hackunix.org>

Copyright (C) 2004 Carl Hetherington

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2004 Bryce Harrington

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Bryce Harrington <bryce@bryceharrington.org> Jon A. Cruz <jon@joncruz.org> Gustav Broberg <broberg@kth.se>

Copyright (C) 2004 Bryce Harrington Copyright (C) 2005 Jon A. Cruz Copyright (C) 2007 Gustav Broberg

Released under GNU GPL. Read the file 'COPYING' for more information

Authors: Bryce Harrington <bryce@bryceharrington.org> Jon A. Cruz <jon@joncruz.org>

Copyright (C) 2004 Bryce Harrington Copyright (C) 2005 Jon A. Cruz

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Johan Engelen <j.b.c.engelen@utwente.nl> Carl Hetherington <inkscape@carlh.net> Derek P. Moore <derekm@hackunix.org> Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2007 Authors Copyright (C) 2004 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Marco Scholten Bruno Dilly <bruno.dilly@gmail.com>

Copyright (C) 2004, 2006, 2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

It adds an extra number called "startseed", that is not UI edittable, but should be put in SVG. This does NOT generate a random number, but provides merely the saving of the startseed value.

Authors: Carl Hetherington <inkscape@carlh.net> Derek P. Moore <derekm@hackunix.org> Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2004 Carl Hetherington

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Johan Engelen <j.b.c.engelen@ewi.utwente.nl>

Copyright (C) 2007 Author

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Johan Engelen <j.b.c.engelen@ewi.utwente.nl>

Copyright (C) 2007 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Kees Cook <kees@outflux.net>

Copyright (C) 2007 Kees Cook Copyright (C) 2004 Bryce Harrington

Released under GNU GPL. Read the file 'COPYING' for more information

Author: Kees Cook <kees@outflux.net>

Copyright (C) 2007 Kees Cook Copyright (C) 2004 Bryce Harrington

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: buliabyak@gmail.com

Copyright (C) 2007 authors

Released under GNU GPL. Read the file 'COPYING' for more information.

A ScalarUnit is a control for entering, viewing, or manipulating numbers with units. This differs from ordinary numbers like 2 or 3.14 because the number portion of a scalar *only* has meaning when considered with its unit type. For instance, 12 m and 12 in have very different actual values, but 1 m and 100 cm have the same value. The ScalarUnit allows us to abstract the presentation of the scalar to the user from the internal representations used by the program.

Authors: Bryce Harrington <bryce@bryceharrington.org> Derek P. Moore <derekm@hackunix.org> buliabyak@gmail.com

Copyright (C) 2004-2005 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Bryce Harrington <bryce@bryceharrington.org> Derek P. Moore <derekm@hackunix.org> buliabyak@gmail.com

Copyright (C) 2004-2005 Authors

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Carl Hetherington <inkscape@carlh.net> Derek P. Moore <derekm@hackunix.org> Bryce Harrington <bryce@bryceharrington.org>

Copyright (C) 2004 Carl Hetherington

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Nicholas Bishop <nicholasbishop@gmail.com> Felipe C. da S. Sanches <juca@members.fsf.org>

Copyright (C) 2007 Author

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Nicholas Bishop <nicholasbishop@gmail.com>

Copyright (C) 2007 Author

Released under GNU GPL. Read the file 'COPYING' for more information.

Copyright (C) 2007 MenTaLguY <mental@rydia.net>

Released under GNU GPL. Read the file 'COPYING' for more information.

Authors: Carl Hetherington <inkscape@carlh.net> Maximilian Albert <maximilian.albert@gmail.com>

Copyright (C) 2004 Carl Hetherington

Released under GNU GPL. Read the file 'COPYING' for more information.

Author: Derek P. Moore <derekm@hackunix.org>

Copyright (C) 2004 Derek P. Moore

Released under GNU GPL. Read the file 'COPYING' for more information.

Observes undo, redo, and undo log commit events.

Authors: David Yip <yipdw@rose-hulman.edu>

Copyright (c) 2005 Authors

Released under GNU GPL, read the file 'COPYING' for more information

Authors: Lauris Kaplinski <lauris@kaplinski.com> Frank Felfe <innerspace@iname.com> Jon A. Cruz <jon@joncruz.org>

Copyright (C) 1999-2002 Authors Copyright (C) 2001-2002 Ximian, Inc.

Released under GNU GPL, read the file 'COPYING' for more information


Typedef Documentation

typedef unsigned long Inkscape::MessageId

An integer ID which identifies a displayed message in a particular Inkscape::MessageStack.

See also:
Inkscape::MessageStack

Definition at line 36 of file message.h.

typedef std::ios_base &(* Inkscape::std_oct_type)(std::ios_base &)

Definition at line 9 of file css-ostringstream.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
COLUMN_STRING 
COLUMN_SPUNIT 
N_COLUMNS 

Definition at line 20 of file unit-tracker.cpp.

00020      {
00021     COLUMN_STRING,
00022     COLUMN_SPUNIT,
00023     N_COLUMNS
00024 };

anonymous enum
Enumerator:
RENDERING_INTENT_UNKNOWN 
RENDERING_INTENT_AUTO 
RENDERING_INTENT_PERCEPTUAL 
RENDERING_INTENT_RELATIVE_COLORIMETRIC 
RENDERING_INTENT_SATURATION 
RENDERING_INTENT_ABSOLUTE_COLORIMETRIC 

Definition at line 17 of file color-profile.h.

Enumerator:
GRID_RECTANGULAR 
GRID_AXONOMETRIC 

Definition at line 34 of file canvas-grid.h.

00034               {
00035     GRID_RECTANGULAR = 0,
00036     GRID_AXONOMETRIC = 1
00037 };

Enumerator:
ICON_SIZE_INVALID 
ICON_SIZE_MENU 
ICON_SIZE_SMALL_TOOLBAR 
ICON_SIZE_LARGE_TOOLBAR 
ICON_SIZE_BUTTON 
ICON_SIZE_DND 
ICON_SIZE_DIALOG 
ICON_SIZE_DECORATION 

Definition at line 21 of file icon-size.h.

00021                   {
00022         ICON_SIZE_INVALID = ::GTK_ICON_SIZE_INVALID,
00023         ICON_SIZE_MENU = ::GTK_ICON_SIZE_MENU,
00024         ICON_SIZE_SMALL_TOOLBAR = ::GTK_ICON_SIZE_SMALL_TOOLBAR,
00025         ICON_SIZE_LARGE_TOOLBAR = ::GTK_ICON_SIZE_LARGE_TOOLBAR,
00026         ICON_SIZE_BUTTON = ::GTK_ICON_SIZE_BUTTON,
00027         ICON_SIZE_DND = ::GTK_ICON_SIZE_DND,
00028         ICON_SIZE_DIALOG = ::GTK_ICON_SIZE_DIALOG,
00029         ICON_SIZE_DECORATION
00030     };

Enumerator:
LPOS_ABOVE 
LPOS_BELOW 
LPOS_CHILD 

Definition at line 19 of file layer-fns.h.

00019                            {
00020     LPOS_ABOVE,
00021     LPOS_BELOW,
00022     LPOS_CHILD,
00023 };

A hint about the meaning of a message; is it an ordinary message, a message advising the user of some significant or unexpected condition, or a message indicating an unambiguous error.

Enumerator:
NORMAL_MESSAGE 
IMMEDIATE_MESSAGE 
WARNING_MESSAGE 
ERROR_MESSAGE 
INFORMATION_MESSAGE 

Definition at line 22 of file message.h.

00022                  {
00023     NORMAL_MESSAGE,
00024     IMMEDIATE_MESSAGE,
00025     WARNING_MESSAGE,
00026     ERROR_MESSAGE,
00027     INFORMATION_MESSAGE
00028 };

Enumerator:
RENDERMODE_NORMAL 
RENDERMODE_NO_FILTERS 
RENDERMODE_OUTLINE 
RENDERMODE_PRINT_COLORS_PREVIEW 

Definition at line 12 of file rendermode.h.

Enumerator:
SNAPSOURCE_UNDEFINED 
SNAPSOURCE_BBOX_CATEGORY 
SNAPSOURCE_BBOX_CORNER 
SNAPSOURCE_BBOX_MIDPOINT 
SNAPSOURCE_BBOX_EDGE_MIDPOINT 
SNAPSOURCE_NODE_CATEGORY 
SNAPSOURCE_NODE_SMOOTH 
SNAPSOURCE_NODE_CUSP 
SNAPSOURCE_LINE_MIDPOINT 
SNAPSOURCE_PATH_INTERSECTION 
SNAPSOURCE_CORNER 
SNAPSOURCE_CONVEX_HULL_CORNER 
SNAPSOURCE_ELLIPSE_QUADRANT_POINT 
SNAPSOURCE_NODE_HANDLE 
SNAPSOURCE_OTHER_CATEGORY 
SNAPSOURCE_OBJECT_MIDPOINT 
SNAPSOURCE_ROTATION_CENTER 
SNAPSOURCE_CENTER 
SNAPSOURCE_GUIDE 
SNAPSOURCE_GUIDE_ORIGIN 
SNAPSOURCE_TEXT_BASELINE 
SNAPSOURCE_OTHER_HANDLE 
SNAPSOURCE_GRID_PITCH 

Definition at line 49 of file snap-enums.h.

00049                     {
00050     SNAPSOURCE_UNDEFINED = 0,
00051     //-------------------------------------------------------------------
00052     // Bbox points can be located at the edge of the stroke (for visual bboxes); they will therefore not snap
00053     // to nodes because these are always located at the center of the stroke
00054     SNAPSOURCE_BBOX_CATEGORY = 256, // will be used as a flag and must therefore be a power of two
00055     SNAPSOURCE_BBOX_CORNER,
00056     SNAPSOURCE_BBOX_MIDPOINT,
00057     SNAPSOURCE_BBOX_EDGE_MIDPOINT,
00058     //-------------------------------------------------------------------
00059     // For the same reason, nodes will not snap to bbox points
00060     SNAPSOURCE_NODE_CATEGORY = 512, // will be used as a flag and must therefore be a power of two
00061     SNAPSOURCE_NODE_SMOOTH,
00062     SNAPSOURCE_NODE_CUSP,
00063     SNAPSOURCE_LINE_MIDPOINT,
00064     SNAPSOURCE_PATH_INTERSECTION,
00065     SNAPSOURCE_CORNER, // of image or of rectangle
00066     SNAPSOURCE_CONVEX_HULL_CORNER,
00067     SNAPSOURCE_ELLIPSE_QUADRANT_POINT,
00068     SNAPSOURCE_NODE_HANDLE, // eg. nodes in the path editor, handles of stars or rectangles, etc. (tied to a stroke)
00069     //-------------------------------------------------------------------
00070     // Other points (e.g. guides, gradient knots) will snap to both bounding boxes and nodes
00071     SNAPSOURCE_OTHER_CATEGORY = 1024, // will be used as a flag and must therefore be a power of two
00072     SNAPSOURCE_OBJECT_MIDPOINT,
00073     SNAPSOURCE_ROTATION_CENTER,
00074     SNAPSOURCE_CENTER, // of ellipse
00075     SNAPSOURCE_GUIDE,
00076     SNAPSOURCE_GUIDE_ORIGIN,
00077     SNAPSOURCE_TEXT_BASELINE,
00078     SNAPSOURCE_OTHER_HANDLE, // eg. the handle of a gradient of a connector (ie not being tied to a stroke)
00079     SNAPSOURCE_GRID_PITCH, // eg. when pasting or alt-dragging in the selector tool; not realy a snap source
00080 };

Enumerator:
SNAPTARGET_UNDEFINED 
SNAPTARGET_GRID 
SNAPTARGET_GRID_INTERSECTION 
SNAPTARGET_GUIDE 
SNAPTARGET_GUIDE_INTERSECTION 
SNAPTARGET_GUIDE_ORIGIN 
SNAPTARGET_GRID_GUIDE_INTERSECTION 
SNAPTARGET_NODE_SMOOTH 
SNAPTARGET_NODE_CUSP 
SNAPTARGET_LINE_MIDPOINT 
SNAPTARGET_OBJECT_MIDPOINT 
SNAPTARGET_ROTATION_CENTER 
SNAPTARGET_HANDLE 
SNAPTARGET_PATH 
SNAPTARGET_PATH_INTERSECTION 
SNAPTARGET_BBOX_CORNER 
SNAPTARGET_BBOX_EDGE 
SNAPTARGET_BBOX_EDGE_MIDPOINT 
SNAPTARGET_BBOX_MIDPOINT 
SNAPTARGET_PAGE_BORDER 
SNAPTARGET_PAGE_CORNER 
SNAPTARGET_CONVEX_HULL_CORNER 
SNAPTARGET_ELLIPSE_QUADRANT_POINT 
SNAPTARGET_CENTER 
SNAPTARGET_CORNER 
SNAPTARGET_TEXT_BASELINE 
SNAPTARGET_CONSTRAINED_ANGLE 
SNAPTARGET_CONSTRAINT 

Definition at line 18 of file snap-enums.h.


Function Documentation

static void Inkscape::attach_all ( Gtk::Table &  table,
Gtk::Widget const *const   arr[],
unsigned  size,
int  start = 0 
) [inline, static]

Definition at line 395 of file canvas-grid.cpp.

References FILL, Barcode::Code39Ext::i, i18n::label, polyhedron_3d::r, render_alphabetsoup_config::space, SPACE_SIZE_X, SPACE_SIZE_Y, and scour::start.

Referenced by Inkscape::CanvasXYGrid::newSpecificWidget(), and Inkscape::CanvasAxonomGrid::newSpecificWidget().

00396 {
00397     for (unsigned i=0, r=start; i<size/sizeof(Gtk::Widget*); i+=2) {
00398         if (arr[i] && arr[i+1]) {
00399             table.attach (const_cast<Gtk::Widget&>(*arr[i]),   1, 2, r, r+1,
00400                           Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
00401             table.attach (const_cast<Gtk::Widget&>(*arr[i+1]), 2, 3, r, r+1,
00402                           Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
00403         } else {
00404             if (arr[i+1]) {
00405                 table.attach (const_cast<Gtk::Widget&>(*arr[i+1]), 1, 3, r, r+1,
00406                               Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
00407             } else if (arr[i]) {
00408                 Gtk::Label& label = reinterpret_cast<Gtk::Label&> (const_cast<Gtk::Widget&>(*arr[i]));
00409                 label.set_alignment (0.0);
00410                 table.attach (label, 0, 3, r, r+1,
00411                               Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
00412             } else {
00413                 Gtk::HBox *space = manage (new Gtk::HBox);
00414                 space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y);
00415                 table.attach (*space, 0, 1, r, r+1,
00416                               (Gtk::AttachOptions)0, (Gtk::AttachOptions)0,0,0);
00417             }
00418         }
00419         ++r;
00420     }
00421 }

static std::map<gint, gint> Inkscape::bitVals ( vals  ,
vals[G_N_ELEMENTS(vals)] 
) [static]
Geom::Scale Inkscape::calcScaleFactors ( Geom::Point const &  initial_point,
Geom::Point const &  new_point,
Geom::Point const &  origin,
bool const   skew = false 
)

Definition at line 1583 of file seltrans.cpp.

References addnodes::e, Barcode::Code39Ext::i, pathalongpath::offset(), and dxf_input::scale.

Referenced by Inkscape::SelTrans::scaleRequest(), Inkscape::SelTrans::skewRequest(), and Inkscape::SelTrans::stretchRequest().

01584 {
01585     // Work out the new scale factors for the bbox
01586 
01587     Geom::Point const initial_delta = initial_point - origin;
01588     Geom::Point const new_delta = new_point - origin;
01589     Geom::Point const offset = new_point - initial_point;
01590     Geom::Scale scale(1, 1);
01591 
01592     for ( unsigned int i = 0 ; i < 2 ; i++ ) {
01593         if ( fabs(initial_delta[i]) > 1e-6 ) {
01594             if (skew) {
01595                 scale[i] = offset[1-i] / initial_delta[i];
01596             } else {
01597                 scale[i] = new_delta[i] / initial_delta[i];
01598             }
01599         }
01600     }
01601 
01602     return scale;
01603 }

GType Inkscape::colorprofile_get_type (  ) 

Register ColorProfile class and return its type.

Definition at line 116 of file color-profile.cpp.

References Inkscape::ColorProfile::getType().

00117 {
00118     return ColorProfile::getType();
00119 }

SPObject * Inkscape::create_layer ( SPObject root,
SPObject layer,
LayerRelativePosition  position 
)

Creates a new layer.

Advances to the next layer id indicated by the string "layerNN", then creates a new group object of that id with attribute inkscape:groupmode='layer', and finally appends the new group object to root after object layer.

Precondition:
root should be either layer or an ancestor of it

Referenced by Inkscape::LayerVerb::perform(), and Inkscape::UI::Dialogs::LayerPropertiesDialog::Create::perform().

template<class T >
T* Inkscape::createSuiteAndDocument ( void(*)(T *&)  fun  )  [inline]

Definition at line 23 of file test-helpers.h.

References Inkscape::Extension::init(), inkscape_get_instance(), inkscape_get_type(), NULL, sp_document_new(), sp_document_unref(), cxxtestgen::suite, and TRUE.

00024 {
00025     T* suite = 0;
00026 
00027     g_type_init();
00028     Inkscape::GC::init();
00029     if ( !inkscape_get_instance() )
00030     {
00031         // Create the global inkscape object.
00032         static_cast<void>(g_object_new(inkscape_get_type(), NULL));
00033     }
00034 
00035     SPDocument* tmp = sp_document_new( NULL, TRUE, true );
00036     if ( tmp ) {
00037         fun( suite );
00038         if ( suite )
00039         {
00040             suite->_doc = tmp;
00041         }
00042         else
00043         {
00044             sp_document_unref( tmp );
00045         }
00046     }
00047 
00048     return suite;
00049 }

double Inkscape::decimal_round ( double const   x,
int const   nplaces 
) [inline]

Returns x rounded to the nearest nplaces decimal places.

Implemented in terms of Inkscape::round, i.e. we make no guarantees as to what happens if x is half way between two rounded numbers. Add a note to the documentation if you care which candidate is chosen for such case (round towards -infinity, +infinity, 0, or "even").

Note: nplaces is the number of decimal places without using scientific (e) notation, not the number of significant figures. This function may not be suitable for values of x whose magnitude is so far from 1 that one would want to use scientific (e) notation.

The current implementation happens to allow nplaces to be negative: e.g. nplaces=-2 means rounding to a multiple of 100. May or may not be useful.

Definition at line 25 of file decimal-round.h.

References Geom::pow(), and round().

Referenced by ColorRGBA::getIntValue(), and NR::Point::round().

00026 {
00027     double const multiplier = std::pow(10.0, nplaces);
00028     return Inkscape::round( x * multiplier ) / multiplier;
00029 }

static void Inkscape::file_add_recent ( gchar const *  uri  )  [static]

Definition at line 38 of file preferences.cpp.

References NULL.

Referenced by Inkscape::Preferences::migrate().

00039 {
00040     if (!uri) {
00041         g_warning("file_add_recent: uri == NULL");
00042     } else {
00043         GtkRecentManager *recent = gtk_recent_manager_get_default();
00044         gchar *fn = g_filename_from_utf8(uri, -1, NULL, NULL, NULL);
00045         if (fn) {
00046             if (g_file_test(fn, G_FILE_TEST_EXISTS)) {
00047                 gchar *uriToAdd = g_filename_to_uri(fn, NULL, NULL);
00048                 if (uriToAdd) {
00049                     gtk_recent_manager_add_item(recent, uriToAdd);
00050                     g_free(uriToAdd);
00051                 }
00052             }
00053             g_free(fn);
00054         }
00055     }
00056 }

void Inkscape::getBBoxPoints ( Geom::OptRect const   bbox,
std::vector< SnapCandidatePoint > *  points,
bool const  isTarget,
bool const   includeCorners,
bool const   includeLineMidpoints,
bool const   includeObjectMidpoints 
)

Definition at line 755 of file object-snapper.cpp.

References SNAPSOURCE_BBOX_CORNER, SNAPSOURCE_BBOX_EDGE_MIDPOINT, SNAPSOURCE_BBOX_MIDPOINT, SNAPTARGET_BBOX_CORNER, SNAPTARGET_BBOX_EDGE_MIDPOINT, and SNAPTARGET_BBOX_MIDPOINT.

Referenced by Inkscape::ObjectSnapper::_collectNodes(), and Inkscape::SelTrans::grab().

00761 {
00762     if (bbox) {
00763         // collect the corners of the bounding box
00764         for ( unsigned k = 0 ; k < 4 ; k++ ) {
00765             if (includeCorners) {
00766                 points->push_back(Inkscape::SnapCandidatePoint(bbox->corner(k), Inkscape::SNAPSOURCE_BBOX_CORNER, 0, Inkscape::SNAPTARGET_BBOX_CORNER, *bbox));
00767             }
00768             // optionally, collect the midpoints of the bounding box's edges too
00769             if (includeLineMidpoints) {
00770                 points->push_back(Inkscape::SnapCandidatePoint((bbox->corner(k) + bbox->corner((k+1) % 4))/2, Inkscape::SNAPSOURCE_BBOX_EDGE_MIDPOINT, 0, Inkscape::SNAPTARGET_BBOX_EDGE_MIDPOINT, *bbox));
00771             }
00772         }
00773         if (includeObjectMidpoints) {
00774             points->push_back(Inkscape::SnapCandidatePoint(bbox->midpoint(), Inkscape::SNAPSOURCE_BBOX_MIDPOINT, 0, Inkscape::SNAPTARGET_BBOX_MIDPOINT, *bbox));
00775         }
00776     }
00777 }

GtkIconSize Inkscape::getRegisteredIconSize ( Inkscape::IconSize  size  ) 

Definition at line 695 of file icon.cpp.

References CLAMP, ICON_SIZE_DECORATION, ICON_SIZE_MENU, and injectCustomSize().

Referenced by Inkscape::UI::Widget::Panel::_init(), ink_radio_action_new(), ink_toggle_action_new(), Inkscape::UI::Widget::Panel::prep(), renderup(), and sp_icon_get_icon().

00696 {
00697     GtkIconSize other = GTK_ICON_SIZE_MENU;
00698     injectCustomSize();
00699     size = CLAMP( size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION );
00700     if ( size == Inkscape::ICON_SIZE_DECORATION ) {
00701         other = gtk_icon_size_from_name("inkscape-decoration");
00702     } else {
00703         other = static_cast<GtkIconSize>(size);
00704     }
00705 
00706     return other;
00707 }

static void Inkscape::grid_canvasitem_class_init ( GridCanvasItemClass *  klass  )  [static]

Definition at line 80 of file canvas-grid.cpp.

References grid_canvasitem_destroy(), grid_canvasitem_render(), grid_canvasitem_update(), parent_class, _SPCanvasItemClass::render, sp_canvas_item_get_type(), and _SPCanvasItemClass::update.

00081 {
00082     GtkObjectClass *object_class;
00083     SPCanvasItemClass *item_class;
00084 
00085     object_class = (GtkObjectClass *) klass;
00086     item_class = (SPCanvasItemClass *) klass;
00087 
00088     parent_class = (SPCanvasItemClass*)gtk_type_class (sp_canvas_item_get_type ());
00089 
00090     object_class->destroy = grid_canvasitem_destroy;
00091 
00092     item_class->update = grid_canvasitem_update;
00093     item_class->render = grid_canvasitem_render;
00094 }

static void Inkscape::grid_canvasitem_destroy ( GtkObject *  object  )  [static]

Definition at line 103 of file canvas-grid.cpp.

References INKSCAPE_IS_GRID_CANVASITEM, NULL, and parent_class.

Referenced by grid_canvasitem_class_init().

00104 {
00105     g_return_if_fail (object != NULL);
00106     g_return_if_fail (INKSCAPE_IS_GRID_CANVASITEM (object));
00107 
00108     if (GTK_OBJECT_CLASS (parent_class)->destroy)
00109         (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
00110 }

GtkType Inkscape::grid_canvasitem_get_type ( void   ) 
static void Inkscape::grid_canvasitem_init ( GridCanvasItem *  grid  )  [static]

Definition at line 97 of file canvas-grid.cpp.

References Inkscape::GridCanvasItem::grid, and NULL.

00098 {
00099     griditem->grid = NULL;
00100 }

static void Inkscape::grid_canvasitem_render ( SPCanvasItem item,
SPCanvasBuf buf 
) [static]

Definition at line 115 of file canvas-grid.cpp.

References Inkscape::GridCanvasItem::grid, INKSCAPE_GRID_CANVASITEM, Inkscape::CanvasGrid::isVisible(), Inkscape::CanvasGrid::Render(), and sp_canvas_prepare_buffer().

Referenced by grid_canvasitem_class_init().

00116 {
00117     GridCanvasItem *gridcanvasitem = INKSCAPE_GRID_CANVASITEM (item);
00118 
00119     if ( gridcanvasitem->grid && gridcanvasitem->grid->isVisible() ) {
00120         sp_canvas_prepare_buffer (buf);
00121         gridcanvasitem->grid->Render(buf);
00122     }
00123 }

static void Inkscape::grid_canvasitem_update ( SPCanvasItem item,
Geom::Matrix const &  affine,
unsigned int  flags 
) [static]

Definition at line 126 of file canvas-grid.cpp.

References SPCanvasItem::canvas, Inkscape::GridCanvasItem::grid, INKSCAPE_GRID_CANVASITEM, parent_class, sp_canvas_request_redraw(), Inkscape::CanvasGrid::Update(), _SPCanvasItemClass::update, SPCanvasItem::x1, SPCanvasItem::x2, SPCanvasItem::y1, and SPCanvasItem::y2.

Referenced by grid_canvasitem_class_init().

00127 {
00128     GridCanvasItem *gridcanvasitem = INKSCAPE_GRID_CANVASITEM (item);
00129 
00130     if (parent_class->update)
00131         (* parent_class->update) (item, affine, flags);
00132 
00133     if (gridcanvasitem->grid) {
00134         gridcanvasitem->grid->Update(affine, flags);
00135 
00136         sp_canvas_request_redraw (item->canvas,
00137                          -1000000, -1000000,
00138                          1000000, 1000000);
00139 
00140         item->x1 = item->y1 = -1000000;
00141         item->x2 = item->y2 = 1000000;
00142     }
00143 }

static void Inkscape::grid_dot ( SPCanvasBuf buf,
gint  x,
gint  y,
guint32  rgba 
) [static]

Definition at line 877 of file canvas-grid.cpp.

References org::w3c::dom::svg::a, b, SPCanvasBuf::buf, SPCanvasBuf::buf_rowstride, NR_COMPOSEN11_1111, NR_RGBA32_A, NR_RGBA32_B, NR_RGBA32_G, NR_RGBA32_R, uniconv-ext::p, polyhedron_3d::r, SPCanvasBuf::rect, NRRectL::x0, and NRRectL::y0.

Referenced by Inkscape::CanvasXYGrid::Render().

00878 {
00879     if ( (y >= buf->rect.y0) && (y < buf->rect.y1)
00880          && (x >= buf->rect.x0) && (x < buf->rect.x1) ) {
00881         guint r, g, b, a;
00882         guchar *p;
00883         r = NR_RGBA32_R (rgba);
00884         g = NR_RGBA32_G (rgba);
00885         b = NR_RGBA32_B (rgba);
00886         a = NR_RGBA32_A (rgba);
00887         p = buf->buf + (y - buf->rect.y0) * buf->buf_rowstride + (x - buf->rect.x0) * 4;
00888         p[0] = NR_COMPOSEN11_1111 (r, a, p[0]);
00889         p[1] = NR_COMPOSEN11_1111 (g, a, p[1]);
00890         p[2] = NR_COMPOSEN11_1111 (b, a, p[2]);
00891     }
00892 }

static void Inkscape::grid_hline ( SPCanvasBuf buf,
gint  y,
gint  xs,
gint  xe,
guint32  rgba 
) [static]

Definition at line 831 of file canvas-grid.cpp.

References org::w3c::dom::svg::a, b, SPCanvasBuf::buf, SPCanvasBuf::buf_rowstride, MAX, MIN, NR_COMPOSEN11_1111, NR_RGBA32_A, NR_RGBA32_B, NR_RGBA32_G, NR_RGBA32_R, uniconv-ext::p, polyhedron_3d::r, SPCanvasBuf::rect, voronoi::x, NRRectL::x0, NRRectL::x1, and NRRectL::y0.

Referenced by Inkscape::CanvasXYGrid::Render().

00832 {
00833     if ((y >= buf->rect.y0) && (y < buf->rect.y1)) {
00834         guint r, g, b, a;
00835         gint x0, x1, x;
00836         guchar *p;
00837         r = NR_RGBA32_R (rgba);
00838         g = NR_RGBA32_G (rgba);
00839         b = NR_RGBA32_B (rgba);
00840         a = NR_RGBA32_A (rgba);
00841         x0 = MAX (buf->rect.x0, xs);
00842         x1 = MIN (buf->rect.x1, xe + 1);
00843         p = buf->buf + (y - buf->rect.y0) * buf->buf_rowstride + (x0 - buf->rect.x0) * 4;
00844         for (x = x0; x < x1; x++) {
00845             p[0] = NR_COMPOSEN11_1111 (r, a, p[0]);
00846             p[1] = NR_COMPOSEN11_1111 (g, a, p[1]);
00847             p[2] = NR_COMPOSEN11_1111 (b, a, p[2]);
00848             p += 4;
00849         }
00850     }
00851 }

static void Inkscape::grid_vline ( SPCanvasBuf buf,
gint  x,
gint  ys,
gint  ye,
guint32  rgba 
) [static]

Definition at line 854 of file canvas-grid.cpp.

References org::w3c::dom::svg::a, b, SPCanvasBuf::buf, SPCanvasBuf::buf_rowstride, MAX, MIN, NR_COMPOSEN11_1111, NR_RGBA32_A, NR_RGBA32_B, NR_RGBA32_G, NR_RGBA32_R, uniconv-ext::p, polyhedron_3d::r, SPCanvasBuf::rect, NRRectL::x0, voronoi::y, NRRectL::y0, and NRRectL::y1.

Referenced by Inkscape::CanvasXYGrid::Render().

00855 {
00856     if ((x >= buf->rect.x0) && (x < buf->rect.x1)) {
00857         guint r, g, b, a;
00858         gint y0, y1, y;
00859         guchar *p;
00860         r = NR_RGBA32_R(rgba);
00861         g = NR_RGBA32_G (rgba);
00862         b = NR_RGBA32_B (rgba);
00863         a = NR_RGBA32_A (rgba);
00864         y0 = MAX (buf->rect.y0, ys);
00865         y1 = MIN (buf->rect.y1, ye + 1);
00866         p = buf->buf + (y0 - buf->rect.y0) * buf->buf_rowstride + (x - buf->rect.x0) * 4;
00867         for (y = y0; y < y1; y++) {
00868             p[0] = NR_COMPOSEN11_1111 (r, a, p[0]);
00869             p[1] = NR_COMPOSEN11_1111 (g, a, p[1]);
00870             p[2] = NR_COMPOSEN11_1111 (b, a, p[2]);
00871             p += buf->buf_rowstride;
00872         }
00873     }
00874 }

bool Inkscape::have_viable_layer ( SPDesktop desktop,
MessageStack *  message 
)

Check to see if the current layer is both unhidden and unlocked.

If not, set a message about it on the given context.

Parameters:
desktop Desktop.
message Message context to put messages on.
Returns:
true if the current layer is both unhidden and unlocked, otherwise false.

Definition at line 59 of file context-fns.cpp.

References _, SPDesktop::currentLayer(), Inkscape::MessageStack::flash(), SPItem::isLocked(), SPDesktop::itemIsHidden(), SP_ITEM, and WARNING_MESSAGE.

00060 {
00061     SPItem const *layer = SP_ITEM(desktop->currentLayer());
00062 
00063     if ( !layer || desktop->itemIsHidden(layer) ) {
00064             message->flash(Inkscape::WARNING_MESSAGE,
00065                          _("<b>Current layer is hidden</b>. Unhide it to be able to draw on it."));
00066             return false;
00067     }
00068 
00069     if ( !layer || layer->isLocked() ) {
00070             message->flash(Inkscape::WARNING_MESSAGE,
00071                          _("<b>Current layer is locked</b>. Unlock it to be able to draw on it."));
00072             return false;
00073     }
00074 
00075     return true;
00076 }

bool Inkscape::have_viable_layer ( SPDesktop desktop,
MessageContext *  message 
)

Check to see if the current layer is both unhidden and unlocked.

If not, set a message about it on the given context.

Parameters:
desktop Desktop.
message Message context to put messages on.
Returns:
true if the current layer is both unhidden and unlocked, otherwise false.

Definition at line 30 of file context-fns.cpp.

References _, SPDesktop::currentLayer(), ERROR_MESSAGE, Inkscape::MessageContext::flash(), SPItem::isLocked(), SPDesktop::itemIsHidden(), and SP_ITEM.

Referenced by connector_handle_button_press(), Inkscape::UI::ClipboardManagerImpl::paste(), pen_handle_button_press(), pencil_handle_button_press(), sp_arc_drag(), sp_box3d_drag(), sp_dyna_draw_context_root_handler(), sp_eraser_context_root_handler(), sp_flood_context_root_handler(), sp_rect_drag(), sp_spiral_drag(), sp_spray_context_root_handler(), sp_star_drag(), sp_text_context_root_handler(), and sp_tweak_context_root_handler().

00031 {
00032     SPItem const *layer = SP_ITEM(desktop->currentLayer());
00033 
00034     if ( !layer || desktop->itemIsHidden(layer) ) {
00035             message->flash(Inkscape::ERROR_MESSAGE,
00036                          _("<b>Current layer is hidden</b>. Unhide it to be able to draw on it."));
00037             return false;
00038     }
00039 
00040     if ( !layer || layer->isLocked() ) {
00041             message->flash(Inkscape::ERROR_MESSAGE,
00042                          _("<b>Current layer is locked</b>. Unlock it to be able to draw on it."));
00043             return false;
00044     }
00045 
00046     return true;
00047 }

static Inkscape::XML::Document * Inkscape::loadImpl ( std::string const &  prefsFilename,
Glib::ustring &  errMsg 
) [static]

Definition at line 206 of file preferences.cpp.

References _, Inkscape::Bind::msg(), Inkscape::XML::Node::name(), NULL, Inkscape::GC::release(), Inkscape::XML::Node::root(), and sp_repr_read_mem().

Referenced by Inkscape::Preferences::_load(), and Inkscape::Preferences::migrate().

00207 {
00208     // 2. Is it a regular file?
00209     if (!g_file_test(prefsFilename.c_str(), G_FILE_TEST_IS_REGULAR)) {
00210         gchar *msg = g_strdup_printf(_("The preferences file %s is not a regular file."),
00211             Glib::filename_to_utf8(prefsFilename).c_str());
00212         errMsg = msg;
00213         g_free(msg);
00214         return 0;
00215     }
00216 
00217     // 3. Is the file readable?
00218     gchar *prefs_xml = NULL; gsize len = 0;
00219     if (!g_file_get_contents(prefsFilename.c_str(), &prefs_xml, &len, NULL)) {
00220         gchar *msg = g_strdup_printf(_("The preferences file %s could not be read."),
00221             Glib::filename_to_utf8(prefsFilename).c_str());
00222         errMsg = msg;
00223         g_free(msg);
00224         return 0;
00225     }
00226 
00227     // 4. Is it valid XML?
00228     Inkscape::XML::Document *prefs_read = sp_repr_read_mem(prefs_xml, len, NULL);
00229     g_free(prefs_xml);
00230     if (!prefs_read) {
00231         gchar *msg = g_strdup_printf(_("The preferences file %s is not a valid XML document."),
00232             Glib::filename_to_utf8(prefsFilename).c_str());
00233         errMsg = msg;
00234         g_free(msg);
00235         return 0;
00236     }
00237 
00238     // 5. Basic sanity check: does the root element have a correct name?
00239     if (strcmp(prefs_read->root()->name(), "inkscape")) {
00240         gchar *msg = g_strdup_printf(_("The file %s is not a valid Inkscape preferences file."),
00241             Glib::filename_to_utf8(prefsFilename).c_str());
00242         errMsg = msg;
00243         g_free(msg);
00244         Inkscape::GC::release(prefs_read);
00245         return 0;
00246     }
00247 
00248     return prefs_read;
00249 }

static void Inkscape::migrateDetails ( Inkscape::XML::Document from,
Inkscape::XML::Document to 
) [static]

Definition at line 251 of file preferences.cpp.

References Inkscape::XML::Node::mergeFrom(), and Inkscape::XML::Node::root().

Referenced by Inkscape::Preferences::_load().

00252 {
00253     // TODO pull in additional prefs with more granularity
00254     to->root()->mergeFrom(from->root(), "id");
00255 }

SPObject * Inkscape::next_layer ( SPObject root,
SPObject layer 
)

Finds the next layer under root, relative to layer in depth-first order.

Returns:
NULL if there are no further layers under root

Referenced by Inkscape::UI::Dialogs::LayersPanel::_checkTreeSelection(), Inkscape::LayerVerb::perform(), sp_selection_to_next_layer(), and SPDesktop::toggleLayerSolo().

SVGOStringStream & Inkscape::operator<< ( SVGOStringStream &  ostr,
const ConnectionPoint cp 
)
SVGIStringStream & Inkscape::operator>> ( SVGIStringStream &  istr,
ConnectionPoint cp 
)
SPObject * Inkscape::previous_layer ( SPObject root,
SPObject layer 
)

Finds the previous layer under root, relative to layer in depth-first order.

Returns:
NULL if there are no prior layers under root.

Referenced by Inkscape::UI::Dialogs::LayersPanel::_checkTreeSelection(), Inkscape::LayerVerb::perform(), sp_selection_to_prev_layer(), and SPDesktop::toggleLayerSolo().

void Inkscape::queueIconPrerender ( Glib::ustring const &  oid,
Inkscape::IconSize  size = Inkscape::ICON_SIZE_BUTTON 
)

Definition at line 1183 of file icon.cpp.

References CLAMP, iconSizeLookup, injectCustomSize(), prerender_icon(), sizeMapDone, and sp_icon_get_phys_size().

Referenced by create_action_for_verb().

01184 {
01185     GtkStockItem stock;
01186     gboolean stockFound = gtk_stock_lookup( name.c_str(), &stock );
01187     if (!stockFound && !gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), name.c_str()) ) {
01188         gint trySize = CLAMP( static_cast<gint>(lsize), 0, static_cast<gint>(G_N_ELEMENTS(iconSizeLookup) - 1) );
01189         if ( !sizeMapDone ) {
01190             injectCustomSize();
01191         }
01192         GtkIconSize mappedSize = iconSizeLookup[trySize];
01193 
01194         int psize = sp_icon_get_phys_size(lsize);
01195         // TODO place in a queue that is triggered by other map events
01196         prerender_icon(name.c_str(), mappedSize, psize);
01197     }
01198 }

Geom::Point Inkscape::setup_for_drag_start ( SPDesktop desktop,
SPEventContext ec,
GdkEvent *  ev 
)

Definition at line 218 of file context-fns.cpp.

References SPEventContext::desktop, SPEventContext::item_to_select, uniconv-ext::p, sp_event_context_find_item(), TRUE, SPDesktop::w2d(), SPEventContext::within_tolerance, SPEventContext::xp, and SPEventContext::yp.

Referenced by sp_arc_context_item_handler(), sp_arc_context_root_handler(), sp_box3d_context_item_handler(), sp_rect_context_item_handler(), sp_spiral_context_root_handler(), and sp_star_context_root_handler().

00219 {
00220     ec->xp = static_cast<gint>(ev->button.x);
00221     ec->yp = static_cast<gint>(ev->button.y);
00222     ec->within_tolerance = true;
00223 
00224     Geom::Point const p(ev->button.x, ev->button.y);
00225     ec->item_to_select = sp_event_context_find_item(desktop, p, ev->button.state & GDK_MOD1_MASK, TRUE);
00226     return ec->desktop->w2d(p);
00227 }

Geom::Rect Inkscape::snap_rectangular_box ( SPDesktop const *  desktop,
SPItem item,
Geom::Point const &  pt,
Geom::Point const &  center,
int  state 
)

Definition at line 79 of file context-fns.cpp.

References SnapManager::constrainedSnap(), CxxTest::delta(), SPDesktop::dt2doc(), SnapManager::freeSnap(), Inkscape::SnappedPoint::getPoint(), Inkscape::SnappedPoint::getSnapped(), goldenratio, MAX, midpt_1_goldenratio, midpt_goldenratio_2, MIN, SPDesktop::namedview, uniconv-ext::p, Inkscape::Display::SnapIndicator::set_new_snaptarget(), SnapManager::setup(), Geom::shift(), sign, SPNamedView::snap_manager, SPDesktop::snapindicator, SNAPSOURCE_NODE_HANDLE, Geom::X, and Geom::Y.

Referenced by sp_arc_drag(), and sp_rect_drag().

00081 {
00082     Geom::Point p[2];
00083 
00084     bool const shift = state & GDK_SHIFT_MASK;
00085     bool const control = state & GDK_CONTROL_MASK;
00086 
00087     SnapManager &m = desktop->namedview->snap_manager;
00088     m.setup(desktop, false, item);
00089     Inkscape::SnappedPoint snappoint;
00090 
00091     if (control) {
00092 
00093         /* Control is down: we are constrained to producing integer-ratio rectangles */
00094 
00095         /* Vector from the centre of the box to the point we are dragging to */
00096         Geom::Point delta = pt - center;
00097 
00098         /* Round it so that we have an integer-ratio (or golden ratio) box */
00099         if (fabs(delta[Geom::X]) > fabs(delta[Geom::Y]) && (delta[Geom::Y] != 0.0)) {
00100             double ratio = delta[Geom::X] / delta[Geom::Y];
00101             double ratioabs = fabs (ratio);
00102             double sign = (ratio < 0 ? -1 : 1);
00103             if (midpt_1_goldenratio < ratioabs && ratioabs < midpt_goldenratio_2) {
00104                 delta[Geom::X] = sign * goldenratio * delta[Geom::Y];
00105             } else {
00106                 delta[Geom::X] = floor(ratio + 0.5) * delta[Geom::Y];
00107             }
00108         } else if (delta[Geom::X] != 0.0) {
00109             double ratio = delta[Geom::Y] / delta[Geom::X];
00110             double ratioabs = fabs (ratio);
00111             double sign = (ratio < 0 ? -1 : 1);
00112             if (midpt_1_goldenratio < ratioabs && ratioabs < midpt_goldenratio_2) {
00113                 delta[Geom::Y] = sign * goldenratio * delta[Geom::X];
00114             } else {
00115                 delta[Geom::Y] = floor(delta[Geom::Y] / delta[Geom::X] + 0.5) * delta[Geom::X];
00116             }
00117         }
00118 
00119         /* p[1] is the dragged point with the integer-ratio constraint */
00120         p[1] = center + delta;
00121 
00122         if (shift) {
00123 
00124             /* Shift is down, so our origin is the centre point rather than the corner
00125             ** point; this means that corner-point movements are bound to each other.
00126             */
00127 
00128             /* p[0] is the opposite corner of our box */
00129             p[0] = center - delta;
00130 
00131             Inkscape::SnappedPoint s[2];
00132 
00133             /* Try to snap p[0] (the opposite corner) along the constraint vector */
00134             s[0] = m.constrainedSnap(Inkscape::SnapCandidatePoint(p[0], Inkscape::SNAPSOURCE_NODE_HANDLE),
00135                                      Inkscape::Snapper::ConstraintLine(p[0] - p[1]));
00136 
00137             /* Try to snap p[1] (the dragged corner) along the constraint vector */
00138             s[1] = m.constrainedSnap(Inkscape::SnapCandidatePoint(p[1], Inkscape::SNAPSOURCE_NODE_HANDLE),
00139                                      Inkscape::Snapper::ConstraintLine(p[1] - p[0]));
00140 
00141             /* Choose the best snap and update points accordingly */
00142             if (s[0].getSnapDistance() < s[1].getSnapDistance()) {
00143                 if (s[0].getSnapped()) {
00144                     p[0] = s[0].getPoint();
00145                     p[1] = 2 * center - s[0].getPoint();
00146                     snappoint = s[0];
00147                 }
00148             } else {
00149                 if (s[1].getSnapped()) {
00150                     p[0] = 2 * center - s[1].getPoint();
00151                     p[1] = s[1].getPoint();
00152                     snappoint = s[1];
00153                 }
00154             }
00155         } else {
00156 
00157             /* Our origin is the opposite corner.  Snap the drag point along the constraint vector */
00158             p[0] = center;
00159             snappoint = m.constrainedSnap(Inkscape::SnapCandidatePoint(p[1], Inkscape::SNAPSOURCE_NODE_HANDLE),
00160                                           Inkscape::Snapper::ConstraintLine(p[1] - p[0]));
00161             if (snappoint.getSnapped()) {
00162                 p[1] = snappoint.getPoint();
00163             }
00164         }
00165 
00166     } else if (shift) {
00167 
00168         /* Shift is down, so our origin is the centre point rather than the corner point;
00169         ** this means that corner-point movements are bound to each other.
00170         */
00171 
00172         p[1] = pt;
00173         p[0] = 2 * center - p[1];
00174 
00175         Inkscape::SnappedPoint s[2];
00176 
00177         s[0] = m.freeSnap(Inkscape::SnapCandidatePoint(p[0], Inkscape::SNAPSOURCE_NODE_HANDLE));
00178         s[1] = m.freeSnap(Inkscape::SnapCandidatePoint(p[1], Inkscape::SNAPSOURCE_NODE_HANDLE));
00179 
00180         if (s[0].getSnapDistance() < s[1].getSnapDistance()) {
00181             if (s[0].getSnapped()) {
00182                 p[0] = s[0].getPoint();
00183                 p[1] = 2 * center - s[0].getPoint();
00184                 snappoint = s[0];
00185             }
00186         } else {
00187             if (s[1].getSnapped()) {
00188                 p[0] = 2 * center - s[1].getPoint();
00189                 p[1] = s[1].getPoint();
00190                 snappoint = s[1];
00191             }
00192         }
00193 
00194     } else {
00195 
00196         /* There's no constraint on the corner point, so just snap it to anything */
00197         p[0] = center;
00198         p[1] = pt;
00199         snappoint = m.freeSnap(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_NODE_HANDLE));
00200         if (snappoint.getSnapped()) {
00201             p[1] = snappoint.getPoint();
00202         }
00203     }
00204 
00205     if (snappoint.getSnapped()) {
00206         desktop->snapindicator->set_new_snaptarget(snappoint);
00207     }
00208 
00209     p[0] *= desktop->dt2doc();
00210     p[1] *= desktop->dt2doc();
00211 
00212     return Geom::Rect(Geom::Point(MIN(p[0][Geom::X], p[1][Geom::X]), MIN(p[0][Geom::Y], p[1][Geom::Y])),
00213                     Geom::Point(MAX(p[0][Geom::X], p[1][Geom::X]), MAX(p[0][Geom::Y], p[1][Geom::Y])));
00214 }

static gboolean Inkscape::sp_nv_read_length ( gchar const *  str,
guint  base,
gdouble *  val,
SPUnit const **  unit 
) [static]

Definition at line 453 of file canvas-grid.cpp.

References FALSE, SP_UNIT_ABSOLUTE, SP_UNIT_CM, SP_UNIT_DEVICE, sp_unit_get_by_id(), SP_UNIT_IN, SP_UNIT_M, SP_UNIT_MM, SP_UNIT_PT, SP_UNIT_PX, and TRUE.

Referenced by Inkscape::CanvasXYGrid::readRepr(), and Inkscape::CanvasAxonomGrid::readRepr().

00454 {
00455     if (!str) {
00456         return FALSE;
00457     }
00458 
00459     gchar *u;
00460     gdouble v = g_ascii_strtod(str, &u);
00461     if (!u) {
00462         return FALSE;
00463     }
00464     while (isspace(*u)) {
00465         u += 1;
00466     }
00467 
00468     if (!*u) {
00469         /* No unit specified - keep default */
00470         *val = v;
00471         return TRUE;
00472     }
00473 
00474     if (base & SP_UNIT_DEVICE) {
00475         if (u[0] && u[1] && !isalnum(u[2]) && !strncmp(u, "px", 2)) {
00476             *unit = &sp_unit_get_by_id(SP_UNIT_PX);
00477             *val = v;
00478             return TRUE;
00479         }
00480     }
00481 
00482     if (base & SP_UNIT_ABSOLUTE) {
00483         if (!strncmp(u, "pt", 2)) {
00484             *unit = &sp_unit_get_by_id(SP_UNIT_PT);
00485         } else if (!strncmp(u, "mm", 2)) {
00486             *unit = &sp_unit_get_by_id(SP_UNIT_MM);
00487         } else if (!strncmp(u, "cm", 2)) {
00488             *unit = &sp_unit_get_by_id(SP_UNIT_CM);
00489         } else if (!strncmp(u, "m", 1)) {
00490             *unit = &sp_unit_get_by_id(SP_UNIT_M);
00491         } else if (!strncmp(u, "in", 2)) {
00492             *unit = &sp_unit_get_by_id(SP_UNIT_IN);
00493         } else {
00494             return FALSE;
00495         }
00496         *val = v;
00497         return TRUE;
00498     }
00499 
00500     return FALSE;
00501 }

static gboolean Inkscape::sp_nv_read_opacity ( gchar const *  str,
guint32 *  color 
) [static]

Definition at line 503 of file canvas-grid.cpp.

References CLAMP, FALSE, and TRUE.

Referenced by Inkscape::CanvasXYGrid::readRepr(), and Inkscape::CanvasAxonomGrid::readRepr().

00504 {
00505     if (!str) {
00506         return FALSE;
00507     }
00508 
00509     gchar *u;
00510     gdouble v = g_ascii_strtod(str, &u);
00511     if (!u) {
00512         return FALSE;
00513     }
00514     v = CLAMP(v, 0.0, 1.0);
00515 
00516     *color = (*color & 0xffffff00) | (guint32) floor(v * 255.9999);
00517 
00518     return TRUE;
00519 }

static void Inkscape::validateInt ( gint  oldVal,
gint *  pTarget 
) [static]

If the passed int is invalid (<=0), then set the widget and the int to use the given old value.

Parameters:
oldVal Old value to use if the new one is invalid.
pTarget The int to validate.
widget Widget associated with the int.

Definition at line 555 of file canvas-grid.cpp.

References NULL.

Referenced by Inkscape::CanvasXYGrid::readRepr().

00557 {
00558     // Avoid nullness.
00559     if ( pTarget == NULL )
00560         return;
00561 
00562     // Invalid new value?
00563     if ( *pTarget <= 0 ) {
00564         // If the old value is somehow invalid as well, then default to 1.
00565         if ( oldVal <= 0 )
00566             oldVal = 1;
00567 
00568         // Reset the int and associated widget to the old value.
00569         *pTarget = oldVal;
00570     } //if
00571 
00572 } //validateInt

static void Inkscape::validateScalar ( double  oldVal,
double pTarget 
) [static]

If the passed scalar is invalid (<=0), then set the widget and the scalar to use the given old value.

Parameters:
oldVal Old value to use if the new one is invalid.
pTarget The scalar to validate.
widget Widget associated with the scalar.

Definition at line 528 of file canvas-grid.cpp.

References NULL.

Referenced by Inkscape::CanvasXYGrid::readRepr().

00530 {
00531     // Avoid nullness.
00532     if ( pTarget == NULL )
00533         return;
00534 
00535     // Invalid new value?
00536     if ( *pTarget <= 0 ) {
00537         // If the old value is somehow invalid as well, then default to 1.
00538         if ( oldVal <= 0 )
00539             oldVal = 1;
00540 
00541         // Reset the scalar and associated widget to the old value.
00542         *pTarget = oldVal;
00543     } //if
00544 
00545 } //validateScalar


Variable Documentation

Initial value:

Definition at line 150 of file canvas-grid.cpp.

Referenced by Inkscape::CanvasGrid::CanvasGrid().

gchar const* const Inkscape::grid_name[] [static]
Initial value:
 {
    N_("Rectangular grid"),

}

Definition at line 38 of file canvas-grid.cpp.

Referenced by Inkscape::CanvasGrid::getGridTypeFromName(), and Inkscape::CanvasGrid::getName().

gchar const* const Inkscape::grid_svgname[] [static]
Initial value:
 {
    "xygrid",
    "axonomgrid"
}

Definition at line 42 of file canvas-grid.cpp.

Referenced by Inkscape::CanvasGrid::getGridTypeFromSVGName(), and Inkscape::CanvasGrid::getSVGName().

pair<gint, gint> Inkscape::vals[] [static]
Initial value:
 {
    pair<gint, gint>(0, 1), pair<gint, gint>(1, 1 << 1), pair<gint, gint>(2, 1 << 2), pair<gint, gint>(3, 1 << 3),
    pair<gint, gint>(4, 1 << 4), pair<gint, gint>(5, 1 << 5), pair<gint, gint>(6, 1 << 6), pair<gint, gint>(7, 1 << 7),
    pair<gint, gint>(8, 1 << 8), pair<gint, gint>(9, 1 << 9), pair<gint, gint>(10, 1 << 10), pair<gint, gint>(11, 1 << 11),
    pair<gint, gint>(12, 1 << 12), pair<gint, gint>(13, 1 << 13), pair<gint, gint>(14, 1 << 14), pair<gint, gint>(15, 1 << 15),
    pair<gint, gint>(16, 1 << 16), pair<gint, gint>(17, 1 << 17), pair<gint, gint>(18, 1 << 18), pair<gint, gint>(19, 1 << 19),
    pair<gint, gint>(20, 1 << 20), pair<gint, gint>(21, 1 << 21), pair<gint, gint>(22, 1 << 22), pair<gint, gint>(23, 1 << 23)
}

Definition at line 25 of file device-manager.cpp.