/**
\file grid.cpp
A plug-in to add a grid creation effect into Inkscape.
*/
/*
* Copyright (C) 2004-2005 Ted Gould <ted@gould.cx>
* Copyright (C) 2007 MenTaLguY <mental@rydia.net>
* Abhishek Sharma
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtkmm/adjustment.h>
#include <gtkmm/spinbutton.h>
#include "desktop.h"
#include "document.h"
#include "selection.h"
#include "sp-object.h"
#include "svg/path-string.h"
#include "grid.h"
namespace Inkscape {
namespace Extension {
namespace Internal {
/**
\brief A function to allocated anything -- just an example here
\param module Unused
\return Whether the load was sucessful
*/
bool
{
// std::cout << "Hey, I'm Grid, I'm loading!" << std::endl;
return TRUE;
}
namespace {
{
}
}
// std::cout << "Path data:" << path_data.c_str() << std::endl;
return path_data;
}
} // namespace
/**
\brief This actually draws the grid.
\param module The effect that was called (unused)
\param document What should be edited.
*/
void
Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/)
{
/* get page size */
} else {
if (bounds) {
bounding_area = *bounds;
}
Geom::Rect temprec = Geom::Rect(Geom::Point(bounding_area.min()[Geom::X], doc_height - bounding_area.min()[Geom::Y]),
}
//XML Tree being used directly here while it shouldn't be.
Inkscape::XML::Node * current_layer = static_cast<SPDesktop *>(document)->currentLayer()->getRepr();
Glib::ustring style("fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000");
style += ";stroke-width:";
style += floatstring;
style += "pt";
}
/** \brief A class to make an adjustment that uses Extension params */
/** Extension that this relates to */
/** The string which represents the parameter */
char * _pref;
public:
/** \brief Make the adjustment using an extension and the string
describing the parameter. */
return;
};
void val_changed (void);
}; /* class PrefAdjustment */
/** \brief A function to respond to the value_changed signal from the
adjustment.
This function just grabs the value from the adjustment and writes
it to the parameter. Very simple, but yet beautiful.
*/
void
{
// std::cout << "Value Changed to: " << this->get_value() << std::endl;
return;
}
/** \brief A function to get the prefences for the grid
\param moudule Module which holds the params
\param view Unused today - may get style information in the future.
Uses AutoGUI for creating the GUI.
*/
Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/)
{
}
}
#include "clear-n_.h"
void
{
"<id>org.inkscape.effect.grid</id>\n"
"<param name=\"xspacing\" gui-text=\"" N_("Horizontal Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"
"<param name=\"yspacing\" gui-text=\"" N_("Vertical Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"
"<param name=\"xoffset\" gui-text=\"" N_("Horizontal Offset:") "\" type=\"float\" min=\"0.0\" max=\"1000\">0.0</param>\n"
"<param name=\"yoffset\" gui-text=\"" N_("Vertical Offset:") "\" type=\"float\" min=\"0.0\" max=\"1000\">0.0</param>\n"
"<effect>\n"
"<object-type>all</object-type>\n"
"<effects-menu>\n"
"</submenu>\n"
"</effects-menu>\n"
"</effect>\n"
"</inkscape-extension>\n", new Grid());
return;
}
}; /* namespace Internal */
}; /* namespace Extension */
}; /* 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 :