path-chemistry.cpp revision 39119552b53c1385923e1e8a4d78297e8abe68d2
#define __SP_PATH_CHEMISTRY_C__
/*
* Here are handlers for modifying selections, specific to paths
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 1999-2004 Authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "sp-path.h"
#include "sp-text.h"
#include "sp-flowtext.h"
#include "text-editing.h"
#include "style.h"
#include "inkscape.h"
#include "document.h"
#include "message-stack.h"
#include "selection.h"
#include "desktop-handles.h"
/* Helper functions for sp_selected_path_to_curves */
static Inkscape::XML::Node * sp_selected_item_to_curved_repr(SPItem * item, guint32 text_grouping_policy);
enum {
/* Not used yet. This is the placeholder of Lauris's idea. */
SP_TOCURVE_INTERACTIVE = 1 << 0,
};
void
sp_selected_path_combine (void)
{
SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>at least two objects</b> to combine."));
return;
}
SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("At least one of the objects is <b>not a path</b>, cannot combine."));
return;
}
}
SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot combine objects from <b>different groups</b> or <b>layers</b>."));
return;
}
}
// remember the position of the topmost object
// remember the id of the bottomost object
// FIXME: merge styles of combined objects instead of using the first one's style
sp_curve_unref (c);
// if this is the bottommost object,
// delete it so that its clones don't get alerted; this object will be restored shortly, with the same id
} else {
// delete the object for real, so that its clones can take appropriate action
}
topmost --;
}
// restore id
// add the new group to the group members' common parent
// move to the position of the topmost, reduced by the number of deleted items
}
void
sp_selected_path_break_apart (void)
{
SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>path(s)</b> to break apart."));
return;
}
bool did = false;
if (!SP_IS_PATH (item))
continue;
continue;
did = true;
// it's going to resurrect as one of the pieces, so we delete without advertisement
// add the new repr to the parent
// move to the saved position
// if it's the first one, restore id
if (l == list)
}
g_slist_free (list);
}
if (did) {
} else {
SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No path(s)</b> to break apart in the selection."));
return;
}
}
/* This function is an entry point from GUI */
void
sp_selected_path_to_curves (void)
{
}
static void
{
if (interactive)
SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to convert to path."));
return;
}
bool did = false;
if (!repr)
continue;
did = true;
// remember the position of the item
// remember parent
// remember id
// it's going to resurrect, so we delete without advertisement
// restore id
// add the new repr to the parent
// move to the saved position
}
if (interactive) {
if (did) {
} else {
SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No objects</b> to convert to path in the selection."));
return;
}
}
}
{
if (!item)
return NULL;
if (SP_IS_SHAPE (item)) {
}
if (!curve)
return NULL;
/* Transformation */
/* Style */
/* Definition */
return repr;
}
void
{
if (g_slist_length (items) == 0) {
return;
}
bool did = false;
continue;
did = true;
}
if (did) {
} else {
SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No paths</b> to reverse in the selection."));
}
}