sp-guide.cpp revision 7114757ca3ac2d2dc7e821c1034321031619de83
#define __SP_GUIDE_C__
/*
* Inkscape guideline implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Peter Moulder <pmoulder@mail.csse.monash.edu.au>
* Johan Engelen
*
* Copyright (C) 2000-2002 authors
* Copyright (C) 2004 Monash University
* Copyright (C) 2007 Johan Engelen
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <algorithm>
#include <cstring>
#include <string>
#include "desktop-handles.h"
#include "display/guideline.h"
#include "svg/stringstream.h"
#include "attributes.h"
#include "sp-guide.h"
#include <sp-item-notify-moveto.h>
#include <sp-item.h>
#include <sp-guide-constraint.h>
#include <remove-last.h>
#include "sp-metrics.h"
#include "inkscape.h"
#include "desktop.h"
#include "sp-namedview.h"
#include "document.h"
enum {
};
static void sp_guide_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static SPObjectClass *parent_class;
GType sp_guide_get_type(void)
{
static GType guide_type = 0;
if (!guide_type) {
GTypeInfo guide_info = {
sizeof(SPGuideClass),
sizeof(SPGuide),
16,
NULL, /* value_table */
};
}
return guide_type;
}
{
0,
0xffffffff,
0xff000000,
0,
0xffffffff,
0xff000000,
}
{
}
static void sp_guide_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec */*pspec*/)
{
switch (prop_id) {
case PROP_COLOR:
}
break;
case PROP_HICOLOR:
break;
}
}
static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec */*pspec*/)
{
switch (prop_id) {
case PROP_COLOR:
break;
case PROP_HICOLOR:
break;
}
}
{
}
}
{
}
}
}
{
switch (key) {
case SP_ATTR_ORIENTATION:
{
/* Visual representation of a horizontal line, constrain vertically (y coordinate). */
} else if (value) {
} else {
// default to vertical line for bad arguments
}
} else {
// default to vertical line for bad arguments
}
}
break;
case SP_ATTR_POSITION:
{
if (success == 2) {
// Desktop coords fix
} else if (success == 1) {
// before 0.46 style guideline definition.
// Desktop coords fix
} else {
}
}
// update position in non-committing way
// fixme: perhaps we need to add an update method instead, and request_update here
}
break;
default:
}
break;
}
}
SPGuide *
return guide;
}
void
for (std::list<std::pair<Geom::Point, Geom::Point> >::iterator i = pts.begin(); i != pts.end(); ++i) {
}
}
void
}
{
}
{
return;
}
}
}
{
return;
}
}
}
{
}
{
}
/**
* \arg commit False indicates temporary moveto in response to motion event while dragging,
* true indicates a "committing" version: in response to button release event after
* dragging a guideline, or clicking OK in guide editing dialog.
*/
{
}
/* Calling sp_repr_set_point must precede calling sp_item_notify_moveto in the commit
case, so that the guide's new position is available for sp_item_rm_unsatisfied_cns. */
if (commit) {
}
/* DISABLED CODE BECAUSE SPGuideAttachment IS NOT USE AT THE MOMENT (johan)
for (vector<SPGuideAttachment>::const_iterator i(guide.attached_items.begin()),
iEnd(guide.attached_items.end());
i != iEnd; ++i)
{
SPGuideAttachment const &att = *i;
sp_item_notify_moveto(*att.item, guide, att.snappoint_ix, position, commit);
}
*/
}
/**
* \arg commit False indicates temporary moveto in response to motion event while dragging,
* true indicates a "committing" version: in response to button release event after
* dragging a guideline, or clicking OK in guide editing dialog.
*/
{
}
/* Calling sp_repr_set_svg_point must precede calling sp_item_notify_moveto in the commit
case, so that the guide's new position is available for sp_item_rm_unsatisfied_cns. */
if (commit) {
}
/* DISABLED CODE BECAUSE SPGuideAttachment IS NOT USE AT THE MOMENT (johan)
for (vector<SPGuideAttachment>::const_iterator i(guide.attached_items.begin()),
iEnd(guide.attached_items.end());
i != iEnd; ++i)
{
SPGuideAttachment const &att = *i;
sp_item_notify_moveto(*att.item, guide, att.snappoint_ix, position, commit);
}
*/
}
/**
* Returns a human-readable description of the guideline for use in dialog boxes and status bar.
* If verbose is false, only positioning information is included (useful for dialogs).
*
* The caller is responsible for freeing the string.
*/
{
using Geom::X;
using Geom::Y;
gchar *shortcuts = g_strdup_printf("; %s", _("<b>Shift+drag</b> to rotate, <b>Ctrl+drag</b> to move origin, <b>Del</b> to delete"));
} else {
}
if (verbose) {
}
return descr;
}
{
i != iEnd; ++i)
{
SPGuideAttachment const &att = *i;
}
}
/*
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 :