summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4b0ee0)
raw | patch | inline | side by side (parent: c4b0ee0)
| author | joncruz <joncruz@users.sourceforge.net> | |
| Sat, 1 Mar 2008 09:09:39 +0000 (09:09 +0000) | ||
| committer | joncruz <joncruz@users.sourceforge.net> | |
| Sat, 1 Mar 2008 09:09:39 +0000 (09:09 +0000) |
index 99dfcc316eacb20d6c2f5e04e2f0e666f0955fb1..3b279f72429e63c50d2735ec5c1d81adf6c669df 100644 (file)
} else {
// render angled line, once intersection has been detected, draw from there.
Geom::Point parallel_to_line( gl->normal_to_line[Geom::Y],
- /*should be minus, but inverted y axis*/ gl->normal_to_line[Geom::X]);
+ /*should be minus, but inverted y axis*/ gl->normal_to_line[Geom::X]);
//try to intersect with left vertical of rect
double y_intersect_left = (buf->rect.x0 - gl->point_on_line[Geom::X]) * parallel_to_line[Geom::Y] / parallel_to_line[Geom::X] + gl->point_on_line[Geom::Y];
if ( (y_intersect_left >= buf->rect.y0) && (y_intersect_left <= buf->rect.y1) ) {
// intersects with left vertical!
double y_intersect_right = (buf->rect.x1 - gl->point_on_line[Geom::X]) * parallel_to_line[Geom::Y] / parallel_to_line[Geom::X] + gl->point_on_line[Geom::Y];
- sp_guideline_drawline (buf, buf->rect.x0, round(y_intersect_left), buf->rect.x1, round(y_intersect_right), gl->rgba);
+ sp_guideline_drawline (buf, buf->rect.x0, static_cast<gint>(round(y_intersect_left)), buf->rect.x1, static_cast<gint>(round(y_intersect_right)), gl->rgba);
return;
}
double y_intersect_right = (buf->rect.x1 - gl->point_on_line[Geom::X]) * parallel_to_line[Geom::Y] / parallel_to_line[Geom::X] + gl->point_on_line[Geom::Y];
if ( (y_intersect_right >= buf->rect.y0) && (y_intersect_right <= buf->rect.y1) ) {
// intersects with right vertical!
- sp_guideline_drawline (buf, buf->rect.x1, round(y_intersect_right), buf->rect.x0, round(y_intersect_left), gl->rgba);
+ sp_guideline_drawline (buf, buf->rect.x1, static_cast<gint>(round(y_intersect_right)), buf->rect.x0, static_cast<gint>(round(y_intersect_left)), gl->rgba);
return;
}
if ( (x_intersect_top >= buf->rect.x0) && (x_intersect_top <= buf->rect.x1) ) {
// intersects with top horizontal!
double x_intersect_bottom = (buf->rect.y1 - gl->point_on_line[Geom::Y]) * parallel_to_line[Geom::X] / parallel_to_line[Geom::Y] + gl->point_on_line[Geom::X];
- sp_guideline_drawline (buf, round(x_intersect_top), buf->rect.y0, round(x_intersect_bottom), buf->rect.y1, gl->rgba);
+ sp_guideline_drawline (buf, static_cast<gint>(round(x_intersect_top)), buf->rect.y0, static_cast<gint>(round(x_intersect_bottom)), buf->rect.y1, gl->rgba);
return;
}
double x_intersect_bottom = (buf->rect.y1 - gl->point_on_line[Geom::Y]) * parallel_to_line[Geom::X] / parallel_to_line[Geom::Y] + gl->point_on_line[Geom::X];
if ( (x_intersect_top >= buf->rect.x0) && (x_intersect_top <= buf->rect.x1) ) {
// intersects with bottom horizontal!
- sp_guideline_drawline (buf, round(x_intersect_bottom), buf->rect.y1, round(x_intersect_top), buf->rect.y0, gl->rgba);
+ sp_guideline_drawline (buf, static_cast<gint>(round(x_intersect_bottom)), buf->rect.y1, static_cast<gint>(round(x_intersect_top)), buf->rect.y0, gl->rgba);
return;
}
}
index b01a1534424888ad3284bce51ef390c17b095070..5ea4a0196c5d184c32b10d5faa3c8dc4e7fbff74 100644 (file)
-#ifndef __INK_EXTENSION_PARAMENUM_H__
-#define __INK_EXTENSION_PARAMENUM_H__
+#ifndef INK_EXTENSION_PARAMENUM_H_SEEN
+#define INK_EXTENSION_PARAMENUM_H_SEEN
/** \file
* Enumeration parameter for extensions.
class ParamComboBox : public Parameter {
private:
/** \brief Internal value. This should point to a string that has
- been allocated in memory. And should be free'd.
+ been allocated in memory. And should be free'd.
It is the value of the current selected string */
gchar * _value;
-
+
GSList * choices; /**< A table to store the choice strings */
-
+
public:
ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
virtual ~ParamComboBox(void);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
void string (std::string &string);
-
- const gchar * get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; }
+
+ const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; }
const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node);
-
+
void changed (void);
}; /* class ParamComboBox */
} /* namespace Extension */
} /* namespace Inkscape */
-#endif /* __INK_EXTENSION_PARAMENUM_H__ */
+#endif /* INK_EXTENSION_PARAMENUM_H_SEEN */
/*
Local Variables:
index 9a7535a257721c75405ff963553baa06fa951e36..dd80cf59cb1d189732644ba95aef7f8dccfe6c8f 100644 (file)
ParamEnum(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
~ParamEnum(void);
/** \brief Returns \c _value, with a \i const to protect it. */
- const gchar * get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _current_choice != NULL ? _current_choice->_value : NULL; }
+ const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _current_choice != NULL ? _current_choice->_value : NULL; }
const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
Glib::ustring * string (void);
}; /* class ParamEnum */
-
+
/**
\return None
\brief This function creates a parameter that can be used later. This
@@ -169,7 +169,7 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension *
bool
Parameter::get_bool (const SPDocument * doc, const Inkscape::XML::Node * node)
{
- ParamBool * boolpntr = dynamic_cast<ParamBool *>(this);
+ ParamBool * boolpntr = dynamic_cast<ParamBool *>(this);
if (boolpntr == NULL)
throw Extension::param_not_bool_param();
return boolpntr->get(doc, node);
int
Parameter::get_int (const SPDocument * doc, const Inkscape::XML::Node * node)
{
- ParamInt * intpntr = dynamic_cast<ParamInt *>(this);
+ ParamInt * intpntr = dynamic_cast<ParamInt *>(this);
if (intpntr == NULL)
throw Extension::param_not_int_param();
return intpntr->get(doc, node);
float
Parameter::get_float (const SPDocument * doc, const Inkscape::XML::Node * node)
{
- ParamFloat * floatpntr = dynamic_cast<ParamFloat *>(this);
+ ParamFloat * floatpntr = dynamic_cast<ParamFloat *>(this);
if (floatpntr == NULL)
throw Extension::param_not_float_param();
return floatpntr->get(doc, node);
int
Parameter::set_int (int in, SPDocument * doc, Inkscape::XML::Node * node)
{
- ParamInt * intpntr = dynamic_cast<ParamInt *>(this);
+ ParamInt * intpntr = dynamic_cast<ParamInt *>(this);
if (intpntr == NULL)
throw Extension::param_not_int_param();
return intpntr->set(in, doc, node);
const gchar *
Parameter::set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node)
{
- ParamString * stringpntr = dynamic_cast<ParamString *>(this);
+ ParamString * stringpntr = dynamic_cast<ParamString *>(this);
if (stringpntr == NULL)
throw Extension::param_not_string_param();
return stringpntr->set(in, doc, node);
/** \brief Basically, if there is no widget pass a NULL. */
Gtk::Widget *
-Parameter::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
+Parameter::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal<void> * /*changeSignal*/)
{
return NULL;
}
/** \brief If I'm not sure which it is, just don't return a value. */
-void
-Parameter::string (std::string &string)
+void
+Parameter::string (std::string &/*string*/)
{
return;
}
-ParamEnum::ParamEnum (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) :
+ParamEnum::ParamEnum (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * /*xml*/) :
Parameter(name, guitext, desc, scope, ext), _current_choice(NULL)
{
return;
}
Gtk::Widget *
-ParamEnum::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
+ParamEnum::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal<void> * /*changeSignal*/)
{
return NULL;
}
const gchar *
-ParamEnum::set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node)
+ParamEnum::set (const gchar * /*in*/, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/)
{
return NULL;
}
index ea74f10b4b8842678a85a62323df36cf768bd0fb..7862edeb16aad49d4250a4f9ccafca2edec4dcd1 100644 (file)
This only gets created if there are parameters on this
page */
Gtk::Tooltips * _tooltips;
-
+
public:
static ParamNotebookPage * makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
void paramString (std::list <std::string> &list);
gchar * get_guitext (void) {return _text;};
-
+
}; /* class ParamNotebookPage */
Parameter(name, guitext, desc, scope, ext)
{
parameters = NULL;
-
+
// Read XML to build page
if (xml != NULL) {
Inkscape::XML::Node *child_repr = sp_repr_children(xml);
child_repr = sp_repr_next(child_repr);
}
}
-
+
return;
}
@@ -166,7 +166,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension:
}
ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, in_ext, in_repr);
-
+
/* Note: page could equal NULL */
return page;
}
@@ -180,26 +180,26 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension:
*/
Gtk::Widget *
ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
-{
+{
if (!_tooltips) _tooltips = new Gtk::Tooltips();
-
+
Gtk::VBox * vbox = Gtk::manage(new Gtk::VBox);
- vbox->set_border_width(5);
-
- // add parameters onto page (if any)
+ vbox->set_border_width(5);
+
+ // add parameters onto page (if any)
for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) {
Parameter * param = reinterpret_cast<Parameter *>(list->data);
Gtk::Widget * widg = param->get_widget(doc, node, changeSignal);
gchar const * tip = param->get_tooltip();
-
+
vbox->pack_start(*widg, true, true, 2);
if (tip != NULL) {
_tooltips->set_tip(*widg, Glib::ustring(tip));
}
}
-
+
vbox->show();
-
+
return dynamic_cast<Gtk::Widget *>(vbox);
}
@@ -215,7 +215,7 @@ ParamNotebook::ParamNotebook (const gchar * name, const gchar * guitext, const g
Parameter(name, guitext, desc, scope, ext)
{
pages = NULL;
-
+
// Read XML tree to add pages:
if (xml != NULL) {
Inkscape::XML::Node *child_repr = sp_repr_children(xml);
@@ -231,7 +231,7 @@ ParamNotebook::ParamNotebook (const gchar * name, const gchar * guitext, const g
child_repr = sp_repr_next(child_repr);
}
}
-
+
// Initialize _value with the current page
const char * defaultval = NULL;
// set first page as default
@@ -248,7 +248,7 @@ ParamNotebook::ParamNotebook (const gchar * name, const gchar * guitext, const g
defaultval = paramval;
if (defaultval != NULL)
_value = g_strdup(defaultval); // allocate space for _value
-
+
return;
}
the passed in value is duplicated using \c g_strdup().
*/
const gchar *
-ParamNotebook::set (const int in, SPDocument * doc, Inkscape::XML::Node * node)
+ParamNotebook::set (const int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/)
{
ParamNotebookPage * page = NULL;
int i = 0;
page = reinterpret_cast<ParamNotebookPage *>(list->data);
i++;
}
-
+
if (page == NULL) return _value;
-
+
if (_value != NULL) g_free(_value);
_value = g_strdup(page->name());
This is really a hack. The function is called by Extension::paramString() to build
the commandline string like: '--param1name=\"param1value\" --param2name=\"param2value\" ...'
- Extension::paramString expects this function to return '\"param1value\"'; but instead,
+ Extension::paramString expects this function to return '\"param1value\"'; but instead,
this function returns: '\"param1value\" --page1param1name=\"page1param1value\" ...'
\TODO Do this better. For example, make Parameter::paramString() that returns '--name=\"value\"'
notebookpages are added or removed.
*/
void
-ParamNotebookWdg::changed_page(GtkNotebookPage *page,
+ParamNotebookWdg::changed_page(GtkNotebookPage */*page*/,
guint pagenum)
{
if (is_visible()) {
@@ -384,11 +384,11 @@ ParamNotebook::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::s
{
ParamNotebookWdg * nb = Gtk::manage(new ParamNotebookWdg(this, doc, node));
- // add pages (if any)
+ // add pages (if any)
int i = -1;
int pagenr = i;
for (GSList * list = pages; list != NULL; list = g_slist_next(list)) {
- i++;
+ i++;
ParamNotebookPage * page = reinterpret_cast<ParamNotebookPage *>(list->data);
Gtk::Widget * widg = page->get_widget(doc, node, changeSignal);
nb->append_page(*widg, _(page->get_guitext()));
@@ -398,7 +398,7 @@ ParamNotebook::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::s
}
nb->show();
-
+
if (pagenr >= 0) nb->set_current_page(pagenr);
return dynamic_cast<Gtk::Widget *>(nb);
index 4b98ea967f1d4070734d3097906094b99a42a915..7f976113aba30598d1c2aa2c76f45c0828185739 100644 (file)
-#ifndef __INK_EXTENSION_PARAMNOTEBOOK_H__
-#define __INK_EXTENSION_PARAMNOTEBOOK_H__
+#ifndef INK_EXTENSION_PARAMNOTEBOOK_H_SEEN
+#define INK_EXTENSION_PARAMNOTEBOOK_H_SEEN
/** \file
* Notebook parameter for extensions.
class ParamNotebook : public Parameter {
private:
/** \brief Internal value. This should point to a string that has
- been allocated in memory. And should be free'd.
+ been allocated in memory. And should be free'd.
It is the name of the current page. */
gchar * _value;
-
+
GSList * pages; /**< A table to store the pages with parameters for this notebook.
This only gets created if there are pages in this
notebook */
virtual ~ParamNotebook(void);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
void string (std::list <std::string> &list);
-
- const gchar * get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; }
+
+ const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; }
const gchar * set (const int in, SPDocument * doc, Inkscape::XML::Node * node);
}; /* class ParamNotebook */
} /* namespace Extension */
} /* namespace Inkscape */
-#endif /* __INK_EXTENSION_PARAMNOTEBOOK_H__ */
+#endif /* INK_EXTENSION_PARAMNOTEBOOK_H_SEEN */
/*
Local Variables:
index 584e45219b5f95ff29057721130bfde13ebe1fe1..d7d034d604f9ca0c037270d4fbe2d6dee74386e6 100644 (file)
-#ifndef __INK_EXTENSION_PARAMRADIOBUTTON_H__
-#define __INK_EXTENSION_PARAMRADIOBUTTON_H__
+#ifndef INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN
+#define INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN
/** \file
* Radiobutton parameter for extensions.
class ParamRadioButton : public Parameter {
private:
/** \brief Internal value. This should point to a string that has
- been allocated in memory. And should be free'd.
+ been allocated in memory. And should be free'd.
It is the value of the current selected string */
gchar * _value;
-
+
GSList * choices; /**< A table to store the choice strings */
-
+
public:
ParamRadioButton(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
virtual ~ParamRadioButton(void);
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
void string (std::string &string);
-
- const gchar * get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; }
+
+ const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; }
const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node);
}; /* class ParamRadioButton */
} /* namespace Extension */
} /* namespace Inkscape */
-#endif /* __INK_EXTENSION_PARAMRADIOBUTTON_H__ */
+#endif /* INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN */
index e45d0b25504950b68e4f52e8373ee7945c174c8d..8e3fc13f19486998fc2636ba1dfbf6586fc05cb8 100644 (file)
}
void
-PathEffect::processPath (SPDocument * doc, Inkscape::XML::Node * path, Inkscape::XML::Node * def)
+PathEffect::processPath (SPDocument * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/)
{
index 9213a6a6bc926e3ed984589dad67277e31a6cb1a..a5aa014a2759ecd41ae01fb121cb923f8d553a50 100644 (file)
if (success == 1) {
success += sp_svg_number_read_d(stringarray[1], &newstartseed);
if (success == 2) {
- param_set_value(newval, newstartseed);
+ param_set_value(newval, static_cast<long>(newstartseed));
} else {
param_set_value(newval, defseed);
}
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index 0a2e215a0c41a657235921aca96b79ecad2b6721..afa0ca2ef36a8b439443cc36a8f58886eca162f0 100644 (file)
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
NodeType type() const { return Inkscape::XML::ELEMENT_NODE; }
protected:
- SimpleNode *_duplicate(Document* doc) const { return new SPCSSAttrImpl(*this); }
+ SimpleNode *_duplicate(Document* /*doc*/) const { return new SPCSSAttrImpl(*this); }
};
static void sp_repr_css_add_components(SPCSSAttr *css, Node *repr, gchar const *attr);
buffer.append(g_quark_to_string(iter->key));
buffer.push_back(':');
if (!strcmp(g_quark_to_string(iter->key), "font-family")
- || !strcmp(g_quark_to_string(iter->key), "-inkscape-font-specification")) {
+ || !strcmp(g_quark_to_string(iter->key), "-inkscape-font-specification")) {
// we only quote font-family/font-specification, as SPStyle does
gchar *t = g_strdup (iter->value);
g_free (t);