node-toolbar.cpp revision 5c45bb188ab729e501e48732842cb9de6a9813be
/**
* @file
* Node aux toolbar
*/
/* Authors:
* MenTaLguY <mental@rydia.net>
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Frank Felfe <innerspace@iname.com>
* John Cliff <simarilius@yahoo.com>
* David Turner <novalis@gnu.org>
* Josh Andler <scislac@scislac.com>
* Jon A. Cruz <jon@joncruz.org>
* Maximilian Albert <maximilian.albert@gmail.com>
* Tavmjong Bah <tavmjong@free.fr>
* Abhishek Sharma
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2011 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 "ui/widget/spinbutton.h"
#include "toolbox.h"
#include "node-toolbar.h"
#include "../desktop.h"
#include "../desktop-handles.h"
#include "document-undo.h"
#include "../verbs.h"
#include "../inkscape.h"
#include "../connection-pool.h"
#include "../selection-chemistry.h"
#include "../selection.h"
#include "../ege-adjustment-action.h"
#include "../ege-output-action.h"
#include "../ege-select-one-action.h"
#include "../ink-action.h"
#include "../ink-comboboxentry-action.h"
#include "../widgets/spinbutton-events.h"
#include "../widgets/spw-utilities.h"
#include "../widgets/widget-sizes.h"
#include "../xml/attribute-record.h"
#include "../xml/node-event-vector.h"
#include "ui/uxmanager.h"
#include "../ui/tool/control-point-selection.h"
#include "../ui/tool/node-tool.h"
#include "../ui/tool/multi-path-manipulator.h"
#include "../ui/icon-names.h"
#include "../helper/unit-menu.h"
#include "../helper/unit-tracker.h"
#include "../lpe-tool-context.h"
#include "../sp-namedview.h"
using Inkscape::UnitTracker;
using Inkscape::DocumentUndo;
//####################################
//# node editing callbacks
//####################################
/** Temporary hack: Returns the node tool in the active desktop.
* Will go away during tool refactoring. */
static InkNodeTool *get_node_tool()
{
InkNodeTool *tool = 0;
if (SP_ACTIVE_DESKTOP ) {
if (INK_IS_NODE_TOOL(ec)) {
}
}
return tool;
}
static void sp_node_path_edit_add(void)
{
if (nt) {
}
}
static void sp_node_path_edit_add_min_x(void)
{
if (nt) {
}
}
static void sp_node_path_edit_add_max_x(void)
{
if (nt) {
}
}
static void sp_node_path_edit_add_min_y(void)
{
if (nt) {
}
}
static void sp_node_path_edit_add_max_y(void)
{
if (nt) {
}
}
static void sp_node_path_edit_delete(void)
{
if (nt) {
}
}
static void sp_node_path_edit_delete_segment(void)
{
if (nt) {
}
}
static void sp_node_path_edit_break(void)
{
if (nt) {
}
}
static void sp_node_path_edit_join(void)
{
if (nt) {
}
}
static void sp_node_path_edit_join_segment(void)
{
if (nt) {
}
}
static void sp_node_path_edit_toline(void)
{
if (nt) {
}
}
static void sp_node_path_edit_tocurve(void)
{
if (nt) {
}
}
static void sp_node_path_edit_cusp(void)
{
if (nt) {
}
}
static void sp_node_path_edit_smooth(void)
{
if (nt) {
}
}
static void sp_node_path_edit_symmetrical(void)
{
if (nt) {
}
}
static void sp_node_path_edit_auto(void)
{
if (nt) {
}
}
}
/* is called when the node selection is modified */
{
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
if (!tracker) {
return;
}
// no path selected
} else {
}
}
}
}
{
if (!tracker) {
return;
}
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
}
}
{
}
{
}
{
{
} else {
}
} else {
}
}
}
static void sp_node_toolbox_sel_modified(Inkscape::Selection *selection, guint /*flags*/, GObject *tbl)
{
}
//################################
//## Node Editing Toolbox ##
//################################
{
{
_("Insert node"),
_("Insert new nodes into selected segments"),
INKSCAPE_ICON("node-add"),
// also create dummy menu action:
gtk_action_group_add_action( mainActions, gtk_action_new("NodeInsertActionMenu", NULL, NULL, NULL) );
}
{
_("Insert node at min X"),
_("Insert new nodes at min X into selected segments"),
INKSCAPE_ICON("node_insert_min_x"),
}
{
_("Insert node at max X"),
_("Insert new nodes at max X into selected segments"),
INKSCAPE_ICON("node_insert_max_x"),
}
{
_("Insert node at min Y"),
_("Insert new nodes at min Y into selected segments"),
INKSCAPE_ICON("node_insert_min_y"),
}
{
_("Insert node at max Y"),
_("Insert new nodes at max Y into selected segments"),
INKSCAPE_ICON("node_insert_max_y"),
}
{
_("Delete node"),
_("Delete selected nodes"),
INKSCAPE_ICON("node-delete"),
}
{
_("Join nodes"),
_("Join selected nodes"),
INKSCAPE_ICON("node-join"),
}
{
_("Break nodes"),
_("Break path at selected nodes"),
INKSCAPE_ICON("node-break"),
}
{
_("Join with segment"),
_("Join selected endnodes with a new segment"),
INKSCAPE_ICON("node-join-segment"),
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_join_segment), 0 );
}
{
_("Delete segment"),
_("Delete segment between two non-endpoint nodes"),
INKSCAPE_ICON("node-delete-segment"),
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_delete_segment), 0 );
}
{
_("Node Cusp"),
_("Make selected nodes corner"),
INKSCAPE_ICON("node-type-cusp"),
}
{
_("Node Smooth"),
_("Make selected nodes smooth"),
INKSCAPE_ICON("node-type-smooth"),
}
{
_("Node Symmetric"),
_("Make selected nodes symmetric"),
INKSCAPE_ICON("node-type-symmetric"),
}
{
_("Node Auto"),
_("Make selected nodes auto-smooth"),
INKSCAPE_ICON("node-type-auto-smooth"),
}
{
_("Node Line"),
_("Make selected segments lines"),
INKSCAPE_ICON("node-segment-line"),
}
{
_("Node Curve"),
_("Make selected segments curves"),
INKSCAPE_ICON("node-segment-curve"),
}
{
_("Show Transform Handles"),
_("Show transformation handles for selected nodes"),
"node-transform",
}
{
_("Show Handles"),
_("Show Bezier handles of selected nodes"),
INKSCAPE_ICON("show-node-handles"),
}
{
_("Show Outline"),
_("Show path outline (without path effects)"),
INKSCAPE_ICON("show-path-outline"),
}
{
INKSCAPE_ICON("path-effect-parameter-next"),
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_nextLPEparam), desktop );
}
{
_("Edit clipping paths"),
_("Show clipping path(s) of selected object(s)"),
INKSCAPE_ICON("path-clip-edit"),
}
{
_("Edit masks"),
_("Show mask(s) of selected object(s)"),
INKSCAPE_ICON("path-mask-edit"),
}
/* X coord of selected node(s) */
{
EgeAdjustmentAction* eact = 0;
_("X coordinate:"), _("X:"), _("X coordinate of selected node(s)"),
}
/* Y coord of selected node(s) */
{
EgeAdjustmentAction* eact = 0;
_("Y coordinate:"), _("Y:"), _("Y coordinate of selected node(s)"),
}
// add the units menu
{
}
//watch selection
} // end of sp_node_toolbox_prep()
/*
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 :