summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-12-20 09:40:55 +0000
committerJon A. Cruz <jon@joncruz.org>2009-12-20 09:40:55 +0000
commite29cecc01b6fa0a8984ef780819e8e812b5505fc (patch)
tree98683cbf5950202016d242044c27612da0e653d0 /src/ui
parentmodify exit message if non-Ascii characters (diff)
downloadinkscape-e29cecc01b6fa0a8984ef780819e8e812b5505fc.tar.gz
inkscape-e29cecc01b6fa0a8984ef780819e8e812b5505fc.zip
Warning cleanup
(bzr r8895)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/print.cpp14
-rw-r--r--src/ui/dialog/spray-option.cpp110
-rw-r--r--src/ui/dialog/spray-option.h41
3 files changed, 100 insertions, 65 deletions
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index f9db265d6..60cab06a2 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -31,11 +31,15 @@
-static void
-draw_page (GtkPrintOperation *operation,
- GtkPrintContext *context,
- gint /*page_nr*/,
- gpointer user_data)
+static void draw_page(
+#ifdef WIN32
+ GtkPrintOperation *operation,
+#else
+ GtkPrintOperation *,
+#endif
+ GtkPrintContext *context,
+ gint /*page_nr*/,
+ gpointer user_data)
{
struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data;
//printf("%s %d\n",__FUNCTION__, page_nr);
diff --git a/src/ui/dialog/spray-option.cpp b/src/ui/dialog/spray-option.cpp
index ec83b07cd..a9e037381 100644
--- a/src/ui/dialog/spray-option.cpp
+++ b/src/ui/dialog/spray-option.cpp
@@ -14,11 +14,11 @@
#include "graphlayout/graphlayout.h"
#include "inkscape.h"
#include "macros.h"
-#include "node-context.h"
+#include "node-context.h"
#include "preferences.h"
#include "removeoverlap/removeoverlap.h"
#include "selection.h"
-#include "shape-editor.h"
+#include "shape-editor.h"
#include "sp-flowtext.h"
#include "sp-item-transform.h"
#include "sp-text.h"
@@ -43,21 +43,22 @@ namespace Dialog {
class Action {
public:
Action(const Glib::ustring &id,
- const Glib::ustring &tiptext,
- guint row, guint column,
+ const Glib::ustring &/*tiptext*/,
+ guint /*row*/,
+ guint /*column*/,
Gtk::Table &parent,
- Gtk::Tooltips &tooltips,
+ Gtk::Tooltips &/*tooltips*/,
SprayOptionClass &dialog):
_dialog(dialog),
_id(id),
_parent(parent) {}
-
+
virtual ~Action(){}
virtual void on_button_click(){}
SprayOptionClass &_dialog;
-
+
private :
-
+
Glib::ustring _id;
Gtk::Table &_parent;
};
@@ -85,7 +86,7 @@ public:
dialog._Table().set_col_spacings(3);
double increm = ((double)_max - (double)_min)/10;
- double val_ini = ((double)_max + (double)_min)/2;
+ double val_ini = ((double)_max + (double)_min)/2;
_Gap.set_digits(1);
_Gap.set_size_request(60, -1);
_Gap.set_increments(increm , 0);
@@ -102,14 +103,14 @@ public:
virtual void on_button_click(){
if (!_dialog.getDesktop()) return;
-
+
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
-
+
prefs->setDouble(_pref_path, SP_VERB_CONTEXT_SPRAY);
-
+
double const Gap = _Gap.get_value();
-
-
+
+
prefs->setDouble(_pref_path, Gap);
sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_CONTEXT_SPRAY,
@@ -117,7 +118,7 @@ public:
}
-};
+};
class ActionF : public Action {
private:
@@ -143,7 +144,7 @@ public:
{
dialog.F_Table().set_col_spacings(3);
- _Label.set_label(id);
+ _Label.set_label(id);
_Gap1.set_digits(1);
_Gap1.set_size_request(60, -1);
@@ -152,7 +153,7 @@ public:
_Gap1.set_value(1);
dialog.tooltips().set_tip(_Gap1,
_("Minimum"));
-
+
_Label1.set_label(Q_("Min"));
_Gap2.set_digits(1);
@@ -162,11 +163,11 @@ public:
_Gap2.set_value(1);
dialog.tooltips().set_tip(_Gap2,
_("Maximum"));
-
+
_Label2.set_label(_("Max:"));
-
+
_Gap1.signal_changed().connect(sigc::mem_fun(*this, &ActionF::on_button_click));
- _Gap2.signal_changed().connect(sigc::mem_fun(*this, &ActionF::on_button_click));
+ _Gap2.signal_changed().connect(sigc::mem_fun(*this, &ActionF::on_button_click));
dialog.F_Table().attach(_Label, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL);
dialog.F_Table().attach(_Label1, column+1, column+2, row, row+1, Gtk::FILL, Gtk::FILL);
@@ -178,15 +179,15 @@ public:
virtual void on_button_click(){
if (!_dialog.getDesktop()) return;
-
+
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
-
+
prefs->setDouble(_pref1_path, SP_VERB_CONTEXT_SPRAY);
prefs->setDouble(_pref2_path, SP_VERB_CONTEXT_SPRAY);
-
+
double const Gap1 = _Gap1.get_value();
double const Gap2 = _Gap2.get_value();
-
+
prefs->setDouble(_pref1_path, Gap1);
prefs->setDouble(_pref2_path, Gap2);
@@ -195,21 +196,21 @@ public:
}
-};
+};
void SprayOptionClass::combo_action() {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
cout<<"combo.get_active_row_number = "<<_combo.get_active_row_number()<<endl;
-
+
int const distrib = _combo.get_active_row_number();
-
+
prefs->setInt("/tools/spray/distribution", distrib);
-
+
sp_document_done(sp_desktop_document(this->getDesktop()), SP_VERB_CONTEXT_SPRAY,
- _("Remove overlaps"));
+ _("Remove overlaps"));
}
@@ -217,11 +218,9 @@ void SprayOptionClass::combo_action() {
void SprayOptionClass::action() {
- int r=1;
- for (list<Action *>::iterator it = _actionList.begin();
- it != _actionList.end();
- it ++)
+ for (list<Action *>::iterator it = _actionList.begin(); it != _actionList.end(); ++it) {
(*it)->on_button_click();
+ }
combo_action();
}
@@ -242,16 +241,33 @@ void on_selection_changed(Inkscape::Application */*inkscape*/, Inkscape::Selecti
SprayOptionClass::SprayOptionClass()
: UI::Widget::Panel ("", "/dialogs/spray", SP_VERB_DIALOG_SPRAY_OPTION),
+ _actionList(),
_distributionFrame(Q_("sprayOptions|Distribution")),
_Frame(Q_("sprayOptions|Cursor Options")),
_FFrame(Q_("sprayOptions|Random Options")),
+ _distributionTable(),
_gaussianTable(1, 5, false),
_ETable(3,2,false),
_FTable(2,5,false),
+ _anchorBox(),
+ _unifBox(),
+ _gaussianBox(),
+ _HBox(),
+ _FHBox(),
+ _BoutonBox(),
+ _distributionBox(),
+ _VBox(),
+ _FVBox(),
+ _ActionBox(),
+ _anchorLabel(Q_("sprayOptions|Distribution:")),
_unifLabel(Q_("sprayOptions|Uniform")),
_gaussLabel(Q_("sprayOptions|Gaussian")),
- _anchorLabel(Q_("sprayOptions|Distribution:"))
-
+ _Label(),
+ _FLabel(),
+ _unif(),
+ _gauss(),
+ _combo(),
+ _tooltips()
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -259,7 +275,7 @@ SprayOptionClass::SprayOptionClass()
_combo.append_text(Q_("sprayOptions|Uniform"));
_combo.append_text(Q_("sprayOptions|Gaussian"));
-
+
_combo.set_active(prefs->getInt("/tools/spray/distribution", 1));
_combo.signal_changed().connect(sigc::mem_fun(*this, &SprayOptionClass::combo_action));
@@ -281,7 +297,7 @@ SprayOptionClass::SprayOptionClass()
//Implementation dans la Vbox Cursor
_FVBox.pack_start(_FHBox);
- _FFrame.add(_FVBox);
+ _FFrame.add(_FVBox);
//Hbox Cursor
addEButton(Q_("sprayOptions|Ratio:") ,_("Eccentricity of the ellipse"), 0, 0, 0, 1,"/tools/spray/ratio");
@@ -297,26 +313,26 @@ SprayOptionClass::SprayOptionClass()
Gtk::Box *contents = _getContents();
contents->set_spacing(4);
-
-
-
+
+
+
// Crée dans l'ordre suivant les différentes Frames (cadres de réglages)
contents->pack_start(_distributionFrame, true, true);
- contents->pack_start(_FFrame, true, true);
+ contents->pack_start(_FFrame, true, true);
contents->pack_start(_Frame, true, true);
-
-
+
+
// Connect to the global selection change, to invalidate cached randomize_bbox
g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (on_selection_changed), this);
randomize_bbox = Geom::OptRect();
show_all_children();
-
-
+
+
}
@@ -342,7 +358,7 @@ void SprayOptionClass::addEButton(const Glib::ustring &id,
const Glib::ustring &tiptext,
guint row, guint column,
guint min, guint max,
- Glib::ustring const &pref_path)
+ Glib::ustring const &pref_path)
{
_actionList.push_back( new ActionE(id, tiptext,row, column,*this,min ,max, pref_path ));
}
@@ -351,7 +367,7 @@ void SprayOptionClass::addFButton(const Glib::ustring &id,
const Glib::ustring &tiptext,
guint row, guint column,
Glib::ustring const &pref1_path,
- Glib::ustring const &pref2_path)
+ Glib::ustring const &pref2_path)
{
_actionList.push_back( new ActionF(id, tiptext,row, column,*this,pref1_path, pref2_path ));
}
diff --git a/src/ui/dialog/spray-option.h b/src/ui/dialog/spray-option.h
index 75dfe1e35..42090a120 100644
--- a/src/ui/dialog/spray-option.h
+++ b/src/ui/dialog/spray-option.h
@@ -33,11 +33,11 @@
#include "graphlayout/graphlayout.h"
#include "inkscape.h"
#include "macros.h"
-#include "node-context.h"
+#include "node-context.h"
#include "preferences.h"
#include "removeoverlap/removeoverlap.h"
#include "selection.h"
-#include "shape-editor.h"
+#include "shape-editor.h"
#include "sp-flowtext.h"
#include "sp-item-transform.h"
#include "sp-text.h"
@@ -71,19 +71,19 @@ private:
SprayOptionClass(SprayOptionClass const &d);
SprayOptionClass& operator=(SprayOptionClass const &d);
-
+
public:
SprayOptionClass();
- virtual ~SprayOptionClass();
+ virtual ~SprayOptionClass();
void test() { cout<<"appel de test !!"<<endl; }
static SprayOptionClass &getInstance() { return *new SprayOptionClass(); }
-
+
Gtk::Table &_Table(){return _ETable;}
Gtk::Table &F_Table(){return _FTable;}
Gtk::Tooltips &tooltips(){return _tooltips;}
void action();
- void combo_action();
+ void combo_action();
Geom::OptRect randomize_bbox;
SprayOptionClass &get_SprayOptionClass();
@@ -97,17 +97,32 @@ protected:
const Glib::ustring &pref1_path, const Glib::ustring &pref2_path);
std::list<Action *> _actionList;
- Gtk::Frame _distributionFrame, _Frame, _FFrame ;
- Gtk::Table _distributionTable, _gaussianTable, _ETable, _FTable;
+ Gtk::Frame _distributionFrame;
+ Gtk::Frame _Frame;
+ Gtk::Frame _FFrame;
+ Gtk::Table _distributionTable;
+ Gtk::Table _gaussianTable;
+ Gtk::Table _ETable;
+ Gtk::Table _FTable;
Gtk::HBox _anchorBox;
- Gtk::HBox _unifBox, _gaussianBox, _HBox, _FHBox, _BoutonBox;
- Gtk::VBox _distributionBox, _VBox, _FVBox, _ActionBox;
+ Gtk::HBox _unifBox;
+ Gtk::HBox _gaussianBox;
+ Gtk::HBox _HBox;
+ Gtk::HBox _FHBox;
+ Gtk::HBox _BoutonBox;
+ Gtk::VBox _distributionBox;
+ Gtk::VBox _VBox;
+ Gtk::VBox _FVBox;
+ Gtk::VBox _ActionBox;
Gtk::Label _anchorLabel;
- Gtk::Label _unifLabel, _gaussLabel, _Label, _FLabel;
- Gtk::CheckButton _unif, _gauss;
+ Gtk::Label _unifLabel;
+ Gtk::Label _gaussLabel;
+ Gtk::Label _Label;
+ Gtk::Label _FLabel;
+ Gtk::CheckButton _unif;
+ Gtk::CheckButton _gauss;
Gtk::ComboBoxText _combo;
Gtk::Tooltips _tooltips;
-
};