summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-11-21 05:24:08 +0000
committerTed Gould <ted@canonical.com>2008-11-21 05:24:08 +0000
commit44a3a78fb6a3863c0c7f3c1193837337e68a67e4 (patch)
tree1722ee5ec6f88c881cd4124923354b3c1311501b /src/dialogs
parentMerge from trunk (diff)
downloadinkscape-44a3a78fb6a3863c0c7f3c1193837337e68a67e4.tar.gz
inkscape-44a3a78fb6a3863c0c7f3c1193837337e68a67e4.zip
Merge from fe-moved
(bzr r6891)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/CMakeLists.txt2
-rw-r--r--src/dialogs/Makefile_insert66
-rw-r--r--src/dialogs/clonetiler.cpp12
-rw-r--r--src/dialogs/clonetiler.h17
-rw-r--r--src/dialogs/debugdialog.cpp348
-rw-r--r--src/dialogs/debugdialog.h104
-rw-r--r--src/dialogs/dialog-events.cpp16
-rw-r--r--src/dialogs/dialog-events.h18
-rw-r--r--src/dialogs/eek-color-def.cpp16
-rw-r--r--src/dialogs/eek-color-def.h21
-rw-r--r--src/dialogs/eek-preview.cpp56
-rw-r--r--src/dialogs/eek-preview.h21
-rw-r--r--src/dialogs/export.cpp73
-rw-r--r--src/dialogs/export.h20
-rw-r--r--src/dialogs/extensions.cpp24
-rw-r--r--src/dialogs/extensions.h23
-rw-r--r--src/dialogs/fill-style.cpp10
-rw-r--r--src/dialogs/fill-style.h16
-rw-r--r--src/dialogs/find.cpp19
-rw-r--r--src/dialogs/find.h14
-rw-r--r--src/dialogs/guidelinedialog.cpp11
-rw-r--r--src/dialogs/iconpreview.cpp8
-rw-r--r--src/dialogs/iconpreview.h13
-rw-r--r--src/dialogs/in-dt-coordsys.h1
-rw-r--r--src/dialogs/input.cpp5
-rw-r--r--src/dialogs/input.h13
-rw-r--r--src/dialogs/item-properties.cpp10
-rw-r--r--src/dialogs/item-properties.h19
-rw-r--r--src/dialogs/layer-properties.cpp14
-rw-r--r--src/dialogs/layer-properties.h9
-rw-r--r--src/dialogs/layers-panel.h5
-rw-r--r--src/dialogs/object-attributes.cpp17
-rw-r--r--src/dialogs/object-attributes.h19
-rw-r--r--src/dialogs/rdf.cpp23
-rw-r--r--src/dialogs/rdf.h16
-rw-r--r--src/dialogs/sp-attribute-widget.cpp18
-rw-r--r--src/dialogs/sp-attribute-widget.h18
-rw-r--r--src/dialogs/stroke-style.cpp21
-rw-r--r--src/dialogs/stroke-style.h16
-rw-r--r--src/dialogs/swatches.cpp11
-rw-r--r--src/dialogs/swatches.h14
-rw-r--r--src/dialogs/text-edit.cpp11
-rw-r--r--src/dialogs/text-edit.h18
-rw-r--r--src/dialogs/tiledialog.cpp887
-rw-r--r--src/dialogs/tiledialog.h189
-rw-r--r--src/dialogs/unclump.cpp28
-rw-r--r--src/dialogs/unclump.h27
-rw-r--r--src/dialogs/xml-tree.cpp30
-rw-r--r--src/dialogs/xml-tree.h14
49 files changed, 404 insertions, 1977 deletions
diff --git a/src/dialogs/CMakeLists.txt b/src/dialogs/CMakeLists.txt
index 4087fbfe9..e9fa7c6fc 100644
--- a/src/dialogs/CMakeLists.txt
+++ b/src/dialogs/CMakeLists.txt
@@ -1,6 +1,5 @@
SET(dialogs_SRC
clonetiler.cpp
-debugdialog.cpp
dialog-events.cpp
eek-color-def.cpp
eek-preview.cpp
@@ -21,7 +20,6 @@ sp-attribute-widget.cpp
stroke-style.cpp
swatches.cpp
text-edit.cpp
-tiledialog.cpp
unclump.cpp
xml-tree.cpp
)
diff --git a/src/dialogs/Makefile_insert b/src/dialogs/Makefile_insert
index 4b1d42abb..5d5614668 100644
--- a/src/dialogs/Makefile_insert
+++ b/src/dialogs/Makefile_insert
@@ -13,57 +13,53 @@ dialogs/all: dialogs/libspdialogs.a
dialogs/clean:
rm -f dialogs/libspdialogs.a $(dialogs_libspdialogs_a_OBJECTS)
-dialogs_libspdialogs_a_SOURCES = \
- dialogs/debugdialog.cpp \
- dialogs/debugdialog.h \
+dialogs_libspdialogs_a_SOURCES = \
+ dialogs/clonetiler.cpp \
+ dialogs/clonetiler.h \
dialogs/dialog-events.cpp \
- dialogs/dialog-events.h \
- dialogs/eek-color-def.h \
+ dialogs/dialog-events.h \
dialogs/eek-color-def.cpp \
- dialogs/eek-preview.h \
- dialogs/eek-preview.cpp \
- dialogs/export.cpp \
- dialogs/export.h \
- dialogs/extensions.cpp \
- dialogs/extensions.h \
- dialogs/fill-style.cpp \
- dialogs/fill-style.h \
+ dialogs/eek-color-def.h \
+ dialogs/eek-preview.cpp \
+ dialogs/eek-preview.h \
+ dialogs/export.cpp \
+ dialogs/export.h \
+ dialogs/extensions.cpp \
+ dialogs/extensions.h \
+ dialogs/fill-style.cpp \
+ dialogs/fill-style.h \
+ dialogs/find.cpp \
+ dialogs/find.h \
dialogs/guidelinedialog.cpp \
dialogs/guidelinedialog.h \
+ dialogs/iconpreview.cpp \
+ dialogs/iconpreview.h \
dialogs/in-dt-coordsys.cpp \
dialogs/in-dt-coordsys.h \
- dialogs/input.cpp \
- dialogs/input.h \
+ dialogs/input.cpp \
+ dialogs/input.h \
dialogs/item-properties.cpp \
dialogs/item-properties.h \
dialogs/layer-properties.cpp \
dialogs/layer-properties.h \
dialogs/layers-panel.cpp \
- dialogs/layers-panel.h \
+ dialogs/layers-panel.h \
dialogs/object-attributes.cpp \
dialogs/object-attributes.h \
+ dialogs/rdf.cpp \
+ dialogs/rdf.h \
dialogs/sp-attribute-widget.cpp \
dialogs/sp-attribute-widget.h \
dialogs/stroke-style.cpp \
- dialogs/stroke-style.h \
- dialogs/swatches.cpp \
- dialogs/swatches.h \
- dialogs/text-edit.cpp \
- dialogs/text-edit.h \
- dialogs/tiledialog.cpp \
- dialogs/tiledialog.h \
- dialogs/xml-tree.cpp \
- dialogs/xml-tree.h \
- dialogs/rdf.cpp \
- dialogs/rdf.h \
- dialogs/find.cpp \
- dialogs/find.h \
- dialogs/clonetiler.cpp \
- dialogs/clonetiler.h \
- dialogs/unclump.cpp \
- dialogs/unclump.h \
- dialogs/iconpreview.cpp \
- dialogs/iconpreview.h
+ dialogs/stroke-style.h \
+ dialogs/swatches.cpp \
+ dialogs/swatches.h \
+ dialogs/text-edit.cpp \
+ dialogs/text-edit.h \
+ dialogs/unclump.cpp \
+ dialogs/unclump.h \
+ dialogs/xml-tree.cpp \
+ dialogs/xml-tree.h
# dialogs/sp-widget.c \
# dialogs/sp-widget.h \
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp
index ce0fc15df..d1074ef73 100644
--- a/src/dialogs/clonetiler.cpp
+++ b/src/dialogs/clonetiler.cpp
@@ -1,14 +1,12 @@
-#define __SP_CLONE_TILER_C__
-
-/*
+/** @file
* Clone tiling dialog
- *
- * Authors:
+ */
+/* Authors:
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
*
* Copyright (C) 2004-2006 Authors
- * Released under GNU GPL
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
@@ -1246,7 +1244,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * )
bool prefs_bbox = prefs->getBool("/tools/bounding_box", false);
SPItem::BBoxType bbox_type = ( prefs_bbox ?
SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX );
- boost::optional<Geom::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)),
+ Geom::OptRect r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)),
bbox_type);
if (r) {
w = r->dimensions()[Geom::X];
diff --git a/src/dialogs/clonetiler.h b/src/dialogs/clonetiler.h
index 82206818c..6bfb257a4 100644
--- a/src/dialogs/clonetiler.h
+++ b/src/dialogs/clonetiler.h
@@ -1,15 +1,14 @@
-#ifndef __SP_CLONE_TILER_H__
-#define __SP_CLONE_TILER_H__
-
-/**
- * \brief Clone tiling dialog
- *
- * Authors:
- * bulia byak
+/** @file
+ * @brief Clone tiling dialog
+ */
+/* Authors:
+ * bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2004 Authors
- *
+ * Released under the GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef __SP_CLONE_TILER_H__
+#define __SP_CLONE_TILER_H__
#include <glib.h>
diff --git a/src/dialogs/debugdialog.cpp b/src/dialogs/debugdialog.cpp
deleted file mode 100644
index 42bf96050..000000000
--- a/src/dialogs/debugdialog.cpp
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * A very simple dialog for displaying Inkscape messages. Messages
- * sent to g_log(), g_warning(), g_message(), ets, are routed here,
- * in order to avoid messing with the startup console.
- *
- * Authors:
- * Bob Jamison
- * Other dudes from The Inkscape Organization
- *
- * Copyright (C) 2004 The Inkscape Organization
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glibmm/i18n.h>
-#include <gtkmm/box.h>
-#include <gtkmm/dialog.h>
-#include <gtkmm/textview.h>
-#include <gtkmm/button.h>
-#include <gtkmm/menubar.h>
-#include <gtkmm/scrolledwindow.h>
-
-#include "debugdialog.h"
-
-namespace Inkscape {
-namespace UI {
-namespace Dialogs {
-
-
-//#########################################################################
-//## I M P L E M E N T A T I O N
-//#########################################################################
-
-/**
- * A dialog that displays log messages
- */
-class DebugDialogImpl : public DebugDialog, public Gtk::Dialog
-{
-
- public:
-
-
- /**
- * Constructor
- */
- DebugDialogImpl();
-
- /**
- * Destructor
- */
- ~DebugDialogImpl();
-
-
- /**
- * Show the dialog
- */
- void show();
-
- /**
- * Do not show the dialog
- */
- void hide();
-
- /**
- * Clear all information from the dialog
- */
- void clear();
-
- /**
- * Display a message
- */
- void message(char const *msg);
-
- /**
- * Redirect g_log() messages to this widget
- */
- void captureLogMessages();
-
- /**
- * Return g_log() messages to normal handling
- */
- void releaseLogMessages();
-
-
-
- private:
-
-
- Gtk::MenuBar menuBar;
-
- Gtk::Menu fileMenu;
-
- Gtk::ScrolledWindow textScroll;
-
- Gtk::TextView messageText;
-
- //Handler ID's
- guint handlerDefault;
- guint handlerGlibmm;
- guint handlerAtkmm;
- guint handlerPangomm;
- guint handlerGdkmm;
- guint handlerGtkmm;
-
-};
-
-
-
-
-//#########################################################################
-//## E V E N T S
-//#########################################################################
-
-/**
- * Also a public method. Remove all text from the dialog
- */
-void DebugDialogImpl::clear()
-{
- Glib::RefPtr<Gtk::TextBuffer> buffer = messageText.get_buffer();
- buffer->erase(buffer->begin(), buffer->end());
-}
-
-
-//#########################################################################
-//## C O N S T R U C T O R / D E S T R U C T O R
-//#########################################################################
-/**
- * Constructor
- */
-DebugDialogImpl::DebugDialogImpl()
-{
- set_title(_("Messages"));
- set_size_request(300, 400);
-
- Gtk::VBox *mainVBox = get_vbox();
-
- //## Add a menu for clear()
- menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) );
- fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Clear"),
- sigc::mem_fun(*this, &DebugDialogImpl::clear) ) );
- fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("Capture log messages"),
- sigc::mem_fun(*this, &DebugDialogImpl::captureLogMessages) ) );
- fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("Release log messages"),
- sigc::mem_fun(*this, &DebugDialogImpl::releaseLogMessages) ) );
- mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK);
-
-
- //### Set up the text widget
- messageText.set_editable(false);
- textScroll.add(messageText);
- textScroll.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS);
- mainVBox->pack_start(textScroll);
-
- show_all_children();
-
- message("ready.");
- message("enable log display by setting ");
- message("dialogs.debug 'redirect' attribute to 1 in preferences.xml");
-
- handlerDefault = 0;
- handlerGlibmm = 0;
- handlerAtkmm = 0;
- handlerPangomm = 0;
- handlerGdkmm = 0;
- handlerGtkmm = 0;
-}
-
-/**
- * Factory method. Use this to create a new DebugDialog
- */
-DebugDialog *DebugDialog::create()
-{
- DebugDialog *dialog = new DebugDialogImpl();
- return dialog;
-}
-
-
-/**
- * Constructor
- */
-DebugDialogImpl::~DebugDialogImpl()
-{
-
-
-}
-
-
-//#########################################################################
-//## M E T H O D S
-//#########################################################################
-
-void DebugDialogImpl::show()
-{
- //call super()
- Gtk::Dialog::show();
- //sp_transientize((GtkWidget *)gobj()); //Make transient
- raise();
- Gtk::Dialog::present();
-}
-
-
-
-void DebugDialogImpl::hide()
-{
- //call super()
- Gtk::Dialog::hide();
-}
-
-
-
-void DebugDialogImpl::message(char const *msg)
-{
- Glib::RefPtr<Gtk::TextBuffer> buffer = messageText.get_buffer();
- Glib::ustring uMsg = msg;
- if (uMsg[uMsg.length()-1] != '\n')
- uMsg += '\n';
- buffer->insert (buffer->end(), uMsg);
-}
-
-
-/* static instance, to reduce dependencies */
-static DebugDialog *debugDialogInstance = NULL;
-
-DebugDialog *DebugDialog::getInstance()
-{
- if ( !debugDialogInstance )
- {
- debugDialogInstance = new DebugDialogImpl();
- }
- return debugDialogInstance;
-}
-
-
-
-void DebugDialog::showInstance()
-{
- DebugDialog *debugDialog = getInstance();
- debugDialog->show();
-}
-
-
-
-
-/*##### THIS IS THE IMPORTANT PART ##### */
-void dialogLoggingFunction(const gchar */*log_domain*/,
- GLogLevelFlags /*log_level*/,
- const gchar *messageText,
- gpointer user_data)
-{
- DebugDialogImpl *dlg = (DebugDialogImpl *)user_data;
-
- dlg->message(messageText);
-
-}
-
-
-void DebugDialogImpl::captureLogMessages()
-{
- /*
- This might likely need more code, to capture Gtkmm
- and Glibmm warnings, or maybe just simply grab stdout/stderr
- */
- GLogLevelFlags flags = (GLogLevelFlags) (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL |
- G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE |
- G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG);
- if ( !handlerDefault )
- {
- handlerDefault = g_log_set_handler(NULL, flags,
- dialogLoggingFunction, (gpointer)this);
- }
- if ( !handlerGlibmm )
- {
- handlerGlibmm = g_log_set_handler("glibmm", flags,
- dialogLoggingFunction, (gpointer)this);
- }
- if ( !handlerAtkmm )
- {
- handlerAtkmm = g_log_set_handler("atkmm", flags,
- dialogLoggingFunction, (gpointer)this);
- }
- if ( !handlerPangomm )
- {
- handlerPangomm = g_log_set_handler("pangomm", flags,
- dialogLoggingFunction, (gpointer)this);
- }
- if ( !handlerGdkmm )
- {
- handlerGdkmm = g_log_set_handler("gdkmm", flags,
- dialogLoggingFunction, (gpointer)this);
- }
- if ( !handlerGtkmm )
- {
- handlerGtkmm = g_log_set_handler("gtkmm", flags,
- dialogLoggingFunction, (gpointer)this);
- }
- message("log capture started");
-}
-
-void DebugDialogImpl::releaseLogMessages()
-{
- if ( handlerDefault )
- {
- g_log_remove_handler(NULL, handlerDefault);
- handlerDefault = 0;
- }
- if ( handlerGlibmm )
- {
- g_log_remove_handler("glibmm", handlerGlibmm);
- handlerGlibmm = 0;
- }
- if ( handlerAtkmm )
- {
- g_log_remove_handler("atkmm", handlerAtkmm);
- handlerAtkmm = 0;
- }
- if ( handlerPangomm )
- {
- g_log_remove_handler("pangomm", handlerPangomm);
- handlerPangomm = 0;
- }
- if ( handlerGdkmm )
- {
- g_log_remove_handler("gdkmm", handlerGdkmm);
- handlerGdkmm = 0;
- }
- if ( handlerGtkmm )
- {
- g_log_remove_handler("gtkmm", handlerGtkmm);
- handlerGtkmm = 0;
- }
- message("log capture discontinued");
-}
-
-
-
-} //namespace Dialogs
-} //namespace UI
-} //namespace Inkscape
-
-//#########################################################################
-//## E N D O F F I L E
-//#########################################################################
-
-
-
diff --git a/src/dialogs/debugdialog.h b/src/dialogs/debugdialog.h
deleted file mode 100644
index 1a4a036fd..000000000
--- a/src/dialogs/debugdialog.h
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef __DEBUGDIALOG_H__
-#define __DEBUGDIALOG_H__
-/*
- * A very simple dialog for displaying Inkscape messages. Messages
- * sent to g_log(), g_warning(), g_message(), ets, are routed here,
- * in order to avoid messing with the startup console.
- *
- * Authors:
- * Bob Jamison
- * Other dudes from The Inkscape Organization
- *
- * Copyright (C) 2004 The Inkscape Organization
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-
-
-namespace Inkscape {
-namespace UI {
-namespace Dialogs {
-
-
-/**
- * A dialog that displays log messages
- */
-class DebugDialog
-{
-
- public:
-
-
- /**
- * Constructor
- */
- DebugDialog() {};
-
-
- /**
- * Factory method
- */
- static DebugDialog *create();
-
- /**
- * Destructor
- */
- virtual ~DebugDialog() {};
-
-
- /**
- * Show the dialog
- */
- virtual void show() = 0;
-
- /**
- * Do not show the dialog
- */
- virtual void hide() = 0;
-
- /**
- * Clear all information from the dialog
- */
- virtual void clear() = 0;
-
- /**
- * Display a message
- */
- virtual void message(char const *msg) = 0;
-
- /**
- * Redirect g_log() messages to this widget
- */
- virtual void captureLogMessages() = 0;
-
- /**
- * Return g_log() messages to normal handling
- */
- virtual void releaseLogMessages() = 0;
-
- /**
- * Get a shared singleton instance
- */
- static DebugDialog *getInstance();
-
- /**
- * Show the instance above
- */
- static void showInstance();
-
-
-
-
-};
-
-
-} //namespace Dialogs
-} //namespace UI
-} //namespace Inkscape
-
-
-
-
-#endif /* __DEBUGDIALOG_H__ */
-
diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp
index b306e42d6..da55936ce 100644
--- a/src/dialogs/dialog-events.cpp
+++ b/src/dialogs/dialog-events.cpp
@@ -1,9 +1,7 @@
-#define __DIALOG_EVENTS_C__
-
-/**
- * \brief Event handler for dialog windows
- *
- * Authors:
+/** @file
+ * @brief Event handler for dialog windows
+ */
+/* Authors:
* bulia byak <bulia@dr.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
@@ -31,9 +29,9 @@
/**
-* \brief This function is called to zero the transientize semaphore by a
-* timeout.
-*/
+ * \brief This function is called to zero the transientize semaphore by a
+ * timeout.
+ */
gboolean
sp_allow_again (gpointer *wd)
{
diff --git a/src/dialogs/dialog-events.h b/src/dialogs/dialog-events.h
index 46cbc7a67..2fca84ad2 100644
--- a/src/dialogs/dialog-events.h
+++ b/src/dialogs/dialog-events.h
@@ -1,10 +1,7 @@
-#ifndef __DIALOG_EVENTS_H__
-#define __DIALOG_EVENTS_H__
-
-/**
- * \brief Event handler for dialog windows
- *
- * Authors:
+/** @file
+ * @brief Event handler for dialog windows
+ */
+/* Authors:
* bulia byak <bulia@dr.com>
*
* Copyright (C) 2003 authors
@@ -12,6 +9,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef __DIALOG_EVENTS_H__
+#define __DIALOG_EVENTS_H__
+
#include <gtk/gtkstyle.h>
#include <gtk/gtkwindow.h>
#include <forward.h>
@@ -31,8 +31,8 @@ class Entry;
}
typedef struct {
- GtkWidget *win;
- guint stop;
+ GtkWidget *win;
+ guint stop;
} win_data;
diff --git a/src/dialogs/eek-color-def.cpp b/src/dialogs/eek-color-def.cpp
index 9a079b68f..85b00b251 100644
--- a/src/dialogs/eek-color-def.cpp
+++ b/src/dialogs/eek-color-def.cpp
@@ -1,5 +1,5 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/** @file
+ * @brief EEK color definition
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -133,5 +133,15 @@ void ColorDef::removeCallback( ColorCallback cb, void* data )
(void)data;
}
-
} // namespace eek
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/eek-color-def.h b/src/dialogs/eek-color-def.h
index e17e8a596..63cd096be 100644
--- a/src/dialogs/eek-color-def.h
+++ b/src/dialogs/eek-color-def.h
@@ -1,7 +1,5 @@
-#ifndef SEEN_EEK_COLOR_DEF_H
-#define SEEN_EEK_COLOR_DEF_H
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/** @file
+ * @brief EEK color definition
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -39,6 +37,9 @@
*
* ***** END LICENSE BLOCK ***** */
+#ifndef SEEN_EEK_COLOR_DEF_H
+#define SEEN_EEK_COLOR_DEF_H
+
#include <string>
#include <vector>
@@ -87,5 +88,15 @@ private:
} // namespace eek
-
#endif // SEEN_EEK_COLOR_DEF_H
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/eek-preview.cpp b/src/dialogs/eek-preview.cpp
index 145346af3..f9aadc561 100644
--- a/src/dialogs/eek-preview.cpp
+++ b/src/dialogs/eek-preview.cpp
@@ -1,5 +1,5 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/** @file
+ * @brief EEK preview stuff
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -655,27 +655,27 @@ static void eek_preview_init( EekPreview *preview )
/* GTK_STATE_SELECTED, */
/* GTK_STATE_INSENSITIVE */
- if ( 0 ) {
- GdkColor color = {0,0,0,0};
-
- color.red = 0xffff;
- color.green = 0;
- color.blue = 0xffff;
- gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
- gtk_widget_modify_bg(widg, GTK_STATE_ACTIVE, &color);
-
- color.red = 0;
- color.green = 0xffff;
- color.blue = 0;
- gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
- gtk_widget_modify_bg(widg, GTK_STATE_SELECTED, &color);
-
- color.red = 0xffff;
- color.green = 0;
- color.blue = 0;
- gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
- gtk_widget_modify_bg( widg, GTK_STATE_PRELIGHT, &color );
- }
+ if ( 0 ) {
+ GdkColor color = {0,0,0,0};
+
+ color.red = 0xffff;
+ color.green = 0;
+ color.blue = 0xffff;
+ gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
+ gtk_widget_modify_bg(widg, GTK_STATE_ACTIVE, &color);
+
+ color.red = 0;
+ color.green = 0xffff;
+ color.blue = 0;
+ gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
+ gtk_widget_modify_bg(widg, GTK_STATE_SELECTED, &color);
+
+ color.red = 0xffff;
+ color.green = 0;
+ color.blue = 0;
+ gdk_colormap_alloc_color( gdk_colormap_get_system(), &color, FALSE, TRUE );
+ gtk_widget_modify_bg( widg, GTK_STATE_PRELIGHT, &color );
+ }
}
@@ -684,3 +684,13 @@ GtkWidget* eek_preview_new(void)
return GTK_WIDGET( g_object_new( EEK_PREVIEW_TYPE, NULL ) );
}
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/eek-preview.h b/src/dialogs/eek-preview.h
index ee99125af..40597eb48 100644
--- a/src/dialogs/eek-preview.h
+++ b/src/dialogs/eek-preview.h
@@ -1,7 +1,5 @@
-#ifndef SEEN_EEK_PREVIEW_H
-#define SEEN_EEK_PREVIEW_H
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/** @file
+ * @brief EEK preview stuff
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -39,6 +37,9 @@
*
* ***** END LICENSE BLOCK ***** */
+#ifndef SEEN_EEK_PREVIEW_H
+#define SEEN_EEK_PREVIEW_H
+
#include <gtk/gtkdrawingarea.h>
G_BEGIN_DECLS
@@ -131,5 +132,15 @@ void eek_preview_set_size_mappings( guint count, GtkIconSize const* sizes );
G_END_DECLS
-
#endif /* SEEN_EEK_PREVIEW_H */
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index dc337ef8e..f1a68c999 100644
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
@@ -1,11 +1,7 @@
-#define __SP_EXPORT_C__
-
-/** \file
- * \brief PNG export dialog
+/** @file
+ * @brief PNG export dialog
*/
-
-/*
- * Authors:
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
@@ -317,7 +313,7 @@ sp_export_dialog_area_box (GtkWidget * dlg)
dlg );
sp_export_spinbutton_new ( "width", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0,
- us->gobj(), GTK_WIDGET(t->gobj()), 4, 0, _("Width:"), NULL, EXPORT_COORD_PRECISION, 1,
+ us->gobj(), GTK_WIDGET(t->gobj()), 4, 0, _("Wid_th:"), NULL, EXPORT_COORD_PRECISION, 1,
G_CALLBACK
(sp_export_area_width_value_changed),
dlg );
@@ -333,7 +329,7 @@ sp_export_dialog_area_box (GtkWidget * dlg)
dlg );
sp_export_spinbutton_new ( "height", 0.0, 0.0, PNG_UINT_31_MAX, 0.1, 1.0,
- us->gobj(), GTK_WIDGET(t->gobj()), 4, 1, _("Height:"), NULL, EXPORT_COORD_PRECISION, 1,
+ us->gobj(), GTK_WIDGET(t->gobj()), 4, 1, _("Hei_ght:"), NULL, EXPORT_COORD_PRECISION, 1,
G_CALLBACK (sp_export_area_height_value_changed),
dlg );
@@ -492,7 +488,7 @@ sp_export_dialog (void)
sp_export_spinbutton_new ( "bmheight", 16.0, 1.0, 1000000.0, 1.0, 10.0,
NULL, GTK_WIDGET(t->gobj()), 0, 1,
- _("Height:"), _("pixels at"), 0, 1,
+ _("_Height:"), _("pixels at"), 0, 1,
G_CALLBACK
(sp_export_bitmap_height_value_changed),
dlg );
@@ -626,7 +622,7 @@ sp_export_dialog (void)
{
Gtk::HBox* hide_box = new Gtk::HBox(FALSE, 5);
- GtkWidget *he = gtk_check_button_new_with_label(_("Hide all except selected"));
+ GtkWidget *he = gtk_check_button_new_with_label(_("Hide _all except selected"));
gtk_widget_set_sensitive(GTK_WIDGET(he), TRUE);
gtk_object_set_data(GTK_OBJECT(dlg), "hide_checkbox", he);
hide_box->pack_start(*Glib::wrap(he), false, false);
@@ -778,7 +774,7 @@ sp_export_selection_modified ( Inkscape::Application */*inkscape*/,
if ( SP_ACTIVE_DESKTOP ) {
SPDocument *doc;
doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
- boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
+ Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
if (bbox) {
sp_export_set_area (base, bbox->min()[Geom::X],
bbox->min()[Geom::Y],
@@ -837,7 +833,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base)
if ( SP_ACTIVE_DESKTOP )
{
SPDocument *doc;
- boost::optional<Geom::Rect> bbox;
+ Geom::OptRect bbox;
doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
/* Notice how the switch is used to 'fall through' here to get
@@ -1102,26 +1098,27 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
dpi = DPI_BASE;
}
- NRRect area;
- sp_item_invoke_bbox(item, &area, sp_item_i2r_affine((SPItem *) item), TRUE);
-
- gint width = (gint) ((area.x1 - area.x0) * dpi / PX_PER_IN + 0.5);
- gint height = (gint) ((area.y1 - area.y0) * dpi / PX_PER_IN + 0.5);
-
- if (width > 1 && height > 1) {
- /* Do export */
- if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), fn,
- area.x0, area.y0, area.x1, area.y1, width, height, dpi, dpi,
- nv->pagecolor,
- NULL, NULL, TRUE, // overwrite without asking
- hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
- )) {
- gchar * error;
- gchar * safeFile = Inkscape::IO::sanitizeString(fn);
- error = g_strdup_printf(_("Could not export to filename %s.\n"), safeFile);
- sp_ui_error_dialog(error);
- g_free(safeFile);
- g_free(error);
+ Geom::OptRect area;
+ sp_item_invoke_bbox(item, area, sp_item_i2r_affine((SPItem *) item), TRUE);
+ if (area) {
+ gint width = (gint) (area->width() * dpi / PX_PER_IN + 0.5);
+ gint height = (gint) (area->height() * dpi / PX_PER_IN + 0.5);
+
+ if (width > 1 && height > 1) {
+ /* Do export */
+ if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), fn,
+ *area, width, height, dpi, dpi,
+ nv->pagecolor,
+ NULL, NULL, TRUE, // overwrite without asking
+ hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
+ )) {
+ gchar * error;
+ gchar * safeFile = Inkscape::IO::sanitizeString(fn);
+ error = g_strdup_printf(_("Could not export to filename %s.\n"), safeFile);
+ sp_ui_error_dialog(error);
+ g_free(safeFile);
+ g_free(error);
+ }
}
}
n++;
@@ -1183,7 +1180,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
/* Do export */
if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), filename_ext,
- x0, y0, x1, y1, width, height, xdpi, ydpi,
+ Geom::Rect(Geom::Point(x0, y0), Geom::Point(x1, y1)), width, height, xdpi, ydpi,
nv->pagecolor,
sp_export_progress_callback, base, FALSE,
hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
@@ -1407,7 +1404,7 @@ sp_export_detect_size(GtkObject * base) {
switch (this_test[i]) {
case SELECTION_SELECTION:
if ((sp_desktop_selection(SP_ACTIVE_DESKTOP))->isEmpty() == false) {
- boost::optional<Geom::Rect> bbox = (sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds();
+ Geom::OptRect bbox = (sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds();
//std::cout << "Selection " << bbox;
if ( bbox && sp_export_bbox_equal(*bbox,current_bbox)) {
@@ -1418,7 +1415,7 @@ sp_export_detect_size(GtkObject * base) {
case SELECTION_DRAWING: {
SPDocument *doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
- boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
+ Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
// std::cout << "Drawing " << bbox2;
if ( bbox && sp_export_bbox_equal(*bbox,current_bbox) ) {
@@ -1969,9 +1966,9 @@ sp_export_filename_modified (GtkObject * object, gpointer data)
Local Variables:
mode:c++
c-file-style:"stroustrup"
- c-file-offsets:((innamespace . 0)(inline-open . 0))
+ 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 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/export.h b/src/dialogs/export.h
index 3bb0a1375..801ddc91a 100644
--- a/src/dialogs/export.h
+++ b/src/dialogs/export.h
@@ -1,14 +1,24 @@
+/** @file
+ * @brief export to bitmap dialog
+ */
+/* Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * bulia byak <buliabyak@users.sf.net>
+ * Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
+ *
+ * Copyright (C) 1999-2007 Authors
+ * Copyright (C) 2001-2002 Ximian, Inc.
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
#ifndef SP_EXPORT_H
#define SP_EXPORT_H
/**
- * \brief export to bitmap dialog
- *
* Creates a dialog window for exporting an image to a bitmap if one doesn't already exist and
- * shows it to the user. If the dialog has already been created, it simply shows the window.
- *
+ * shows it to the user. If the dialog has already been created, it simply shows the window.
*/
-
void sp_export_dialog (void);
#endif
diff --git a/src/dialogs/extensions.cpp b/src/dialogs/extensions.cpp
index e363df607..f168da33a 100644
--- a/src/dialogs/extensions.cpp
+++ b/src/dialogs/extensions.cpp
@@ -1,16 +1,13 @@
-/*
- * A simple dialog for previewing icon representation.
- *
- * Authors:
+/** @file
+ * @brief A simple dialog with information about extensions
+ */
+/* Authors:
* Jon A. Cruz
*
* Copyright (C) 2005 Jon A. Cruz
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
#include <gtk/gtkdialog.h> //for GTK_RESPONSE* types
#include <gtkmm/scrolledwindow.h>
@@ -116,8 +113,17 @@ void ExtensionsPanel::rescan()
// g_message("\\------------------");
}
-
-
} //namespace Dialogs
} //namespace UI
} //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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/extensions.h b/src/dialogs/extensions.h
index e253ab849..8b0fc2780 100644
--- a/src/dialogs/extensions.h
+++ b/src/dialogs/extensions.h
@@ -1,24 +1,23 @@
-
-#ifndef SEEN_EXTENSIONS_H
-#define SEEN_EXTENSIONS_H
-/*
- * A simple dialog for previewing icon representation.
- *
- * Authors:
+/** @file
+ * A simple dialog with information about extensions
+ */
+/* Authors:
* Jon A. Cruz
*
* Copyright (C) 2005 The Inkscape Organization
- *
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+
+#ifndef SEEN_EXTENSIONS_H
+#define SEEN_EXTENSIONS_H
#include <gtkmm/textview.h>
#include "ui/widget/panel.h"
namespace Inkscape {
- namespace Extension {
- class Extension;
- }
+namespace Extension {
+class Extension;
+}
}
namespace Inkscape {
@@ -54,6 +53,4 @@ private:
} //namespace UI
} //namespace Inkscape
-
-
#endif // SEEN_EXTENSIONS_H
diff --git a/src/dialogs/fill-style.cpp b/src/dialogs/fill-style.cpp
index e095425a9..e1c30e7ae 100644
--- a/src/dialogs/fill-style.cpp
+++ b/src/dialogs/fill-style.cpp
@@ -1,9 +1,7 @@
-#define __SP_FILL_STYLE_C__
-
-/**
- * \brief Fill style widget
- *
- * Authors:
+/** @file
+ * @brief Fill style widget
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
* bulia byak <buliabyak@users.sf.net>
diff --git a/src/dialogs/fill-style.h b/src/dialogs/fill-style.h
index 96cb06987..3924412ec 100644
--- a/src/dialogs/fill-style.h
+++ b/src/dialogs/fill-style.h
@@ -1,10 +1,7 @@
-#ifndef __SP_FILL_STYLE_H__
-#define __SP_FILL_STYLE_H__
-
-/**
- * \brief Fill style configuration
- *
- * Authors:
+/** @file
+ * @brief Fill style configuration
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2002 Lauris Kaplinski
@@ -12,10 +9,11 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glib.h>
+#ifndef SEEN_DIALOGS_SP_FILL_STYLE_H
+#define SEEN_DIALOGS_SP_FILL_STYLE_H
+#include <glib.h>
#include <gtk/gtkwidget.h>
-
#include "forward.h"
diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index 96a630553..29a0fe7e8 100644
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
@@ -1,9 +1,7 @@
-#define __SP_TRANSFORMATION_C__
-
-/**
- * \brief Find dialog
- *
- * Authors:
+/** @file
+ * @brief Find dialog
+ */
+/* Authors:
* bulia byak <bulia@users.sf.net>
*
* Copyright (C) 2004 Authors
@@ -11,13 +9,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-
#include "widgets/icon.h"
-
#include "message-stack.h"
//TODO : delete this
@@ -69,9 +61,6 @@ sp_find_dialog(){
#define MIN_ONSCREEN_DISTANCE 50
-using NR::X;
-using NR::Y;
-
static GtkWidget *dlg = NULL;
static win_data wd;
diff --git a/src/dialogs/find.h b/src/dialogs/find.h
index 38200d532..fe5861a73 100644
--- a/src/dialogs/find.h
+++ b/src/dialogs/find.h
@@ -1,10 +1,7 @@
-#ifndef SEEN_FIND_H
-#define SEEN_FIND_H
-
-/**
- * \brief Find dialog
- *
- * Authors:
+/** @file
+ * @brief Find dialog
+ */
+/* Authors:
* bulia byak <bulia@users.sf.net>
*
* Copyright (C) 2004 Authors
@@ -12,6 +9,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_FIND_H
+#define SEEN_FIND_H
+
#include <gtk/gtkstyle.h>
void sp_find_dialog();
diff --git a/src/dialogs/guidelinedialog.cpp b/src/dialogs/guidelinedialog.cpp
index 1dc23cb2b..f0115ee91 100644
--- a/src/dialogs/guidelinedialog.cpp
+++ b/src/dialogs/guidelinedialog.cpp
@@ -1,9 +1,7 @@
-#define __GUIDELINE_CPP__
-
-/*
- * simple guideline dialog
- *
- * Authors:
+/** @file
+ * @brief Simple guideline dialog
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Andrius R. <knutux@gmail.com>
* Johan Engelen
@@ -285,4 +283,3 @@ void GuidelinePropertiesDialog::_setup() {
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
-
diff --git a/src/dialogs/iconpreview.cpp b/src/dialogs/iconpreview.cpp
index f31914e3e..4d402d235 100644
--- a/src/dialogs/iconpreview.cpp
+++ b/src/dialogs/iconpreview.cpp
@@ -1,7 +1,7 @@
-/*
- * A simple dialog for previewing icon representation.
- *
- * Authors:
+/** @file
+ * @brief A simple dialog for previewing icon representation.
+ */
+/* Authors:
* Jon A. Cruz
* Bob Jamison
* Other dudes from The Inkscape Organization
diff --git a/src/dialogs/iconpreview.h b/src/dialogs/iconpreview.h
index 3a3652334..8f143725d 100644
--- a/src/dialogs/iconpreview.h
+++ b/src/dialogs/iconpreview.h
@@ -1,9 +1,7 @@
-#ifndef SEEN_ICON_PREVIEW_H
-#define SEEN_ICON_PREVIEW_H
-/*
- * A simple dialog for previewing icon representation.
- *
- * Authors:
+/** @file
+ * @brief A simple dialog for previewing icon representation.
+ */
+/* Authors:
* Jon A. Cruz
* Bob Jamison
* Other dudes from The Inkscape Organization
@@ -13,6 +11,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_ICON_PREVIEW_H
+#define SEEN_ICON_PREVIEW_H
+
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/label.h>
diff --git a/src/dialogs/in-dt-coordsys.h b/src/dialogs/in-dt-coordsys.h
index 6078f9b41..c2ec96d8e 100644
--- a/src/dialogs/in-dt-coordsys.h
+++ b/src/dialogs/in-dt-coordsys.h
@@ -4,7 +4,6 @@
bool in_dt_coordsys(SPObject const &item);
-
#endif /* !SEEN_IN_DT_COORDSYS */
/*
diff --git a/src/dialogs/input.cpp b/src/dialogs/input.cpp
index e23fcc848..0b4587f55 100644
--- a/src/dialogs/input.cpp
+++ b/src/dialogs/input.cpp
@@ -1,5 +1,3 @@
-#define __SP_INPUT_C__
-
/** @file
* @brief Extended input devices dialog
*/
@@ -13,8 +11,9 @@
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
+
#include <gtk/gtksignal.h>
#include <gtk/gtkinputdialog.h>
#include <glibmm/ustring.h>
diff --git a/src/dialogs/input.h b/src/dialogs/input.h
index 70e68774e..0996d06ca 100644
--- a/src/dialogs/input.h
+++ b/src/dialogs/input.h
@@ -1,10 +1,7 @@
-#ifndef __SP_INPUT_H__
-#define __SP_INPUT_H__
-
-/**
- * \brief Extended input device dialog
- *
- * Author:
+/** @file
+ * @brief Extended input device dialog
+ */
+/* Author:
* Nicklas Lindgren <nili@lysator.liu.se>
*
* Copyright (C) 2005 Authors
@@ -12,6 +9,8 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_DIALOGS_INPUT_H
+#define SEEN_DIALOGS_INPUT_H
void sp_input_load_from_preferences (void);
void sp_input_save_to_preferences (void);
diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp
index 808775786..d1992b158 100644
--- a/src/dialogs/item-properties.cpp
+++ b/src/dialogs/item-properties.cpp
@@ -1,9 +1,7 @@
-#define __SP_ITEM_PROPERTIES_C__
-
-/*
- * Object properties dialog
- *
- * Authors:
+/** @file
+ * @brief Object properties dialog
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
diff --git a/src/dialogs/item-properties.h b/src/dialogs/item-properties.h
index a81034aae..9815a1fc5 100644
--- a/src/dialogs/item-properties.h
+++ b/src/dialogs/item-properties.h
@@ -1,20 +1,17 @@
-#ifndef __SP_ITEM_PROPERTIES_H__
-#define __SP_ITEM_PROPERTIES_H__
-
-/**
+/** @file
* \brief Display settings dialog
- *
- * Author:
+ */
+/* Author:
* Lauris Kaplinski <lauris@ximian.com>
*
* Copyright (C) 2001 Ximian, Inc.
- *
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glib.h>
-
-
+#ifndef SEEN_DIALOGS_ITEM_PROPERTIES_H
+#define SEEN_DIALOGS_ITEM_PROPERTIES_H
+#include <glib.h>
#include <gtk/gtkwidget.h>
#include "../forward.h"
@@ -22,8 +19,6 @@ GtkWidget *sp_item_widget_new (void);
void sp_item_dialog (void);
-
-
#endif
/*
diff --git a/src/dialogs/layer-properties.cpp b/src/dialogs/layer-properties.cpp
index bd95fbc71..ccd91fa2e 100644
--- a/src/dialogs/layer-properties.cpp
+++ b/src/dialogs/layer-properties.cpp
@@ -1,8 +1,7 @@
-/**
- *
- * \brief Dialog for renaming layers
- *
- * Author:
+/** @file
+ * @brief Dialog for renaming layers
+ */
+/* Author:
* Bryce W. Harrington <bryce@bryceharrington.com>
* Andrius R. <knutux@gmail.com>
*
@@ -12,12 +11,7 @@
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <gtkmm/stock.h>
-
#include <glibmm/i18n.h>
#include "inkscape.h"
#include "desktop.h"
diff --git a/src/dialogs/layer-properties.h b/src/dialogs/layer-properties.h
index 58bed141d..807967e8d 100644
--- a/src/dialogs/layer-properties.h
+++ b/src/dialogs/layer-properties.h
@@ -1,8 +1,7 @@
-/**
- *
- * \brief Dialog for renaming layers
- *
- * Author:
+/** @file
+ * @brief Dialog for renaming layers
+ */
+/* Author:
* Bryce W. Harrington <bryce@bryceharrington.com>
*
* Copyright (C) 2004 Bryce Harrington
diff --git a/src/dialogs/layers-panel.h b/src/dialogs/layers-panel.h
index 62596e407..1f593b9c6 100644
--- a/src/dialogs/layers-panel.h
+++ b/src/dialogs/layers-panel.h
@@ -1,5 +1,3 @@
-#ifndef SEEN_LAYERS_PANEL_H
-#define SEEN_LAYERS_PANEL_H
/*
* A simple dialog for layer UI.
*
@@ -11,6 +9,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_LAYERS_PANEL_H
+#define SEEN_LAYERS_PANEL_H
+
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
#include <gtkmm/tooltips.h>
diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp
index e0c891ea1..d9bcf1489 100644
--- a/src/dialogs/object-attributes.cpp
+++ b/src/dialogs/object-attributes.cpp
@@ -1,9 +1,7 @@
-#define __SP_OBJECT_ATTRIBUTES_C__
-
-/**
- * \brief Generic properties editor
- *
- * Authors:
+/** @file
+ * @brief Generic properties editor
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
*
@@ -12,10 +10,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
#include <glibmm/i18n.h>
#include <string>
#include <cstring>
@@ -149,11 +143,8 @@ sp_object_attributes_dialog (SPObject *object, const gchar *tag)
sp_object_attr_show_dialog (object, image_desc, tag);
}
}
-
} // end of sp_object_attributes_dialog()
-
-
/*
Local Variables:
mode:c++
diff --git a/src/dialogs/object-attributes.h b/src/dialogs/object-attributes.h
index 2fc562e16..726d8e43b 100644
--- a/src/dialogs/object-attributes.h
+++ b/src/dialogs/object-attributes.h
@@ -1,10 +1,7 @@
-#ifndef __SP_OBJECT_ATTRIBUTES_H__
-#define __SP_OBJECT_ATTRIBUTES_H__
-
-/**
- * \brief Generic object attribute editor
- *
- * Author:
+/** @file
+ * @brief Generic object attribute editor
+ */
+/* Author:
* Lauris Kaplinski <lauris@ximian.com>
*
* Copyright (C) 2001 Ximian, Inc.
@@ -12,17 +9,15 @@
* Licensed under GNU GPL
*/
-#include <glib.h>
-
-
+#ifndef SEEN_DIALOGS_OBJECT_ATTRIBUTES_H
+#define SEEN_DIALOGS_OBJECT_ATTRIBUTES_H
+#include <glib.h>
#include <gtk/gtkwidget.h>
#include "../forward.h"
void sp_object_attributes_dialog (SPObject *object, const gchar *tag);
-
-
#endif
/*
diff --git a/src/dialogs/rdf.cpp b/src/dialogs/rdf.cpp
index 70cac4e1f..f0b174922 100644
--- a/src/dialogs/rdf.cpp
+++ b/src/dialogs/rdf.cpp
@@ -1,9 +1,9 @@
-/**
- * \brief RDF manipulation functions
- *
- * FIXME: move these to xml/ instead of dialogs/
+/** @file
+ * @brief RDF manipulation functions
*
- * Authors:
+ * @todo move these to xml/ instead of dialogs/
+ */
+/* Authors:
* Kees Cook <kees@outflux.net>
* Jon Phillips <jon@rejon.org>
*
@@ -11,22 +11,14 @@
* Copyright (C) 2006 Jon Phillips <jon@rejon.org>
*
* Released under GNU GPL, read the file 'COPYING' for more information
- *
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-
#include "xml/repr.h"
#include "rdf.h"
#include "sp-item-group.h"
#include "inkscape.h"
/*
-
Example RDF XML from various places...
<rdf:RDF xmlns="http://creativecommons.org/ns#"
@@ -83,8 +75,6 @@ Bag example:
<rdf:li>filetype</rdf:li>
</rdf:Bag>
</dc:subject>
-
-
*/
struct rdf_double_t rdf_license_empty [] = {
@@ -1021,7 +1011,6 @@ rdf_set_defaults ( SPDocument * doc )
}
}
-
/*
Local Variables:
mode:c++
@@ -1031,4 +1020,4 @@ rdf_set_defaults ( SPDocument * doc )
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/rdf.h b/src/dialogs/rdf.h
index 4c907e7aa..a98f5a1e4 100644
--- a/src/dialogs/rdf.h
+++ b/src/dialogs/rdf.h
@@ -1,20 +1,16 @@
-/**
- *
- * \brief headers for RDF types
- *
- * Authors:
+/** @file
+ * @brief headers for RDF types
+ */
+/* Authors:
* Kees Cook <kees@outflux.net>
*
- * Copyright (C) 2004 Kees Cook <kees@outflux.net>
- *
+ * Copyright (C) 2004 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
- *
*/
#ifndef _RDF_H_
#define _RDF_H_
#include <glib.h>
-
#include <glibmm/i18n.h>
#include "document.h"
@@ -121,4 +117,4 @@ void rdf_set_defaults ( SPDocument * doc );
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/sp-attribute-widget.cpp b/src/dialogs/sp-attribute-widget.cpp
index 9848d9f26..de14fc173 100644
--- a/src/dialogs/sp-attribute-widget.cpp
+++ b/src/dialogs/sp-attribute-widget.cpp
@@ -1,20 +1,12 @@
-#define __SP_ATTRIBUTE_WIDGET_C__
-
-/**
- * \brief SPAttributeWidget
- *
- * Widget, that listens and modifies repr attributes
- *
- * Authors:
+/** @file
+ * @brief Widget that listens and modifies repr attributes
+ */
+/* Authors:
* Lauris Kaplinski <lauris@ximian.com>
*
* Copyright (C) 2001 Ximian, Inc.
- *
- * Licensed under GNU GPL
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
#include <gtk/gtktable.h>
#include <gtk/gtklabel.h>
diff --git a/src/dialogs/sp-attribute-widget.h b/src/dialogs/sp-attribute-widget.h
index dc27c5a24..01da29bed 100644
--- a/src/dialogs/sp-attribute-widget.h
+++ b/src/dialogs/sp-attribute-widget.h
@@ -1,12 +1,7 @@
-#ifndef __SP_ATTRIBUTE_WIDGET_H__
-#define __SP_ATTRIBUTE_WIDGET_H__
-
-/**
- * \brief SPAttributeWidget
- *
- * Widget, that listens and modifies repr attributes
- *
- * Authors:
+/** @file
+ * @brief Widget that listens and modifies repr attributes
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2002 authors
@@ -15,8 +10,10 @@
* Licensed under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glib.h>
+#ifndef SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_H
+#define SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_H
+#include <glib.h>
#include <sigc++/connection.h>
#define SP_TYPE_ATTRIBUTE_WIDGET (sp_attribute_widget_get_type ())
@@ -119,7 +116,6 @@ void sp_attribute_table_set_repr ( SPAttributeTable *spw,
const gchar **labels,
const gchar **attrs );
-
#endif
/*
diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp
index c7173ad1e..b0375f755 100644
--- a/src/dialogs/stroke-style.cpp
+++ b/src/dialogs/stroke-style.cpp
@@ -1,9 +1,7 @@
-#define __SP_STROKE_STYLE_C__
-
-/**
- * \brief Stroke style dialog
- *
- * Authors:
+/** @file
+ * @brief Stroke style dialog
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Bryce Harrington <brycehar@bryceharrington.org>
* bulia byak <buliabyak@users.sf.net>
@@ -20,12 +18,6 @@
#define noSP_SS_VERBOSE
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-
-
#include <glib/gmem.h>
#include <gtk/gtk.h>
@@ -594,7 +586,7 @@ sp_marker_prev_new(unsigned psize, gchar const *mname,
// Find object's bbox in document
Geom::Matrix const i2doc(sp_item_i2doc_affine(SP_ITEM(object)));
- boost::optional<Geom::Rect> dbox = SP_ITEM(object)->getBounds(i2doc);
+ Geom::OptRect dbox = SP_ITEM(object)->getBounds(i2doc);
if (!dbox) {
return NULL;
@@ -1834,7 +1826,6 @@ ink_extract_marker_name(gchar const *n, SPDocument *doc)
return marker;
}
-
/*
Local Variables:
mode:c++
@@ -1844,4 +1835,4 @@ ink_extract_marker_name(gchar const *n, SPDocument *doc)
fill-column:99
End:
*/
-// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/stroke-style.h b/src/dialogs/stroke-style.h
index 475a2d388..b947209e3 100644
--- a/src/dialogs/stroke-style.h
+++ b/src/dialogs/stroke-style.h
@@ -1,16 +1,16 @@
-#ifndef __SP_STROKE_STYLE_H__
-#define __SP_STROKE_STYLE_H__
-
-/**
- * \brief Stroke style dialog
- *
- * Author:
+/** @file
+ * @brief Stroke style dialog
+ */
+/* Author:
* Lauris Kaplinski <lauris@ximian.com>
*
* Copyright (C) 2001 Ximian, Inc.
- *
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_DIALOGS_STROKE_STYLE_H
+#define SEEN_DIALOGS_STROKE_STYLE_H
+
#include <glib.h>
#include <gtk/gtkwidget.h>
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp
index 71c16d87a..2eb30f27c 100644
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
@@ -1,7 +1,7 @@
-/*
- * A simple panel for color swatches
- *
- * Authors:
+/** @file
+ * @brief Color swatches dialog
+ */
+/* Authors:
* Jon A. Cruz
* John Bintz
*
@@ -10,9 +10,6 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
#include <errno.h>
diff --git a/src/dialogs/swatches.h b/src/dialogs/swatches.h
index 630fada7c..fc3c772b8 100644
--- a/src/dialogs/swatches.h
+++ b/src/dialogs/swatches.h
@@ -1,16 +1,14 @@
-
-#ifndef SEEN_SWATCHES_H
-#define SEEN_SWATCHES_H
-/*
- * A simple dialog for previewing icon representation.
- *
- * Authors:
+/** @file
+ * @brief Color swatches dialog
+ */
+/* Authors:
* Jon A. Cruz
*
* Copyright (C) 2005 Jon A. Cruz
- *
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_DIALOGS_SWATCHES_H
+#define SEEN_DIALOGS_SWATCHES_H
#include <gtkmm/textview.h>
#include <gtkmm/tooltips.h>
diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp
index 1f8395c95..e213a8aba 100644
--- a/src/dialogs/text-edit.cpp
+++ b/src/dialogs/text-edit.cpp
@@ -1,9 +1,7 @@
-#define __SP_TEXT_EDIT_C__
-
-/**
- * \brief Text editing dialog
- *
- * Authors:
+/** @file
+ * @brief Text editing dialog
+ */
+/* Authors:
* Lauris Kaplinski <lauris@ximian.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
@@ -19,7 +17,6 @@
#endif
#include <libnrtype/font-instance.h>
-
#include <gtk/gtk.h>
#ifdef WITH_GTKSPELL
diff --git a/src/dialogs/text-edit.h b/src/dialogs/text-edit.h
index 1fa60c457..1e5cdc77d 100644
--- a/src/dialogs/text-edit.h
+++ b/src/dialogs/text-edit.h
@@ -1,12 +1,18 @@
-#ifndef SP_TEXT_EDIT_H
-#define SP_TEXT_EDIT_H
-
-/**
- * \brief text-edit
+/** @file
+ * @brief Text-edit
+ */
+/* Authors:
+ * Lauris Kaplinski <lauris@ximian.com>
+ * bulia byak <buliabyak@users.sf.net>
+ * Johan Engelen <goejendaagh@zonnet.nl>
*
- * Text editing and font changes
+ * Copyright (C) 1999-2007 Authors
+ * Copyright (C) 2000-2001 Ximian, Inc.
*
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_DIALOGS_TEXT_EDIT_H
+#define SEEN_DIALOGS_TEXT_EDIT_H
void sp_text_edit_dialog (void);
void sp_text_edit_dialog_default_set_insensitive (); //FIXME: Replace trough a verb
diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp
deleted file mode 100644
index f597c601b..000000000
--- a/src/dialogs/tiledialog.cpp
+++ /dev/null
@@ -1,887 +0,0 @@
-/*
- * A simple dialog for creating grid type arrangements of selected objects
- *
- * Authors:
- * Bob Jamison ( based off trace dialog)
- * John Cliff
- * Other dudes from The Inkscape Organization
- *
- * Copyright (C) 2004 Bob Jamison
- * Copyright (C) 2004 John Cliff
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-//#define DEBUG_GRID_ARRANGE 1
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-#include <gtk/gtkdialog.h> //for GTK_RESPONSE* types
-#include <gtk/gtksizegroup.h>
-#include <glibmm/i18n.h>
-#include <gtkmm/stock.h>
-
-#include "verbs.h"
-#include "preferences.h"
-#include "inkscape.h"
-#include "desktop-handles.h"
-#include "selection.h"
-#include "document.h"
-#include "sp-item.h"
-#include "widgets/icon.h"
-#include "tiledialog.h"
-
-
-
-/*
- * Sort items by their x co-ordinates, taking account of y (keeps rows intact)
- *
- * <0 *elem1 goes before *elem2
- * 0 *elem1 == *elem2
- * >0 *elem1 goes after *elem2
- */
-int
-sp_compare_x_position(SPItem *first, SPItem *second)
-{
- using Geom::X;
- using Geom::Y;
-
- boost::optional<Geom::Rect> a = first->getBounds(sp_item_i2doc_affine(first));
- boost::optional<Geom::Rect> b = second->getBounds(sp_item_i2doc_affine(second));
-
- if ( !a || !b ) {
- // FIXME?
- return 0;
- }
-
- double const a_height = a->dimensions()[Y];
- double const b_height = b->dimensions()[Y];
-
- bool a_in_b_vert = false;
- if ((a->min()[Y] < b->min()[Y] + 0.1) && (a->min()[Y] > b->min()[Y] - b_height)) {
- a_in_b_vert = true;
- } else if ((b->min()[Y] < a->min()[Y] + 0.1) && (b->min()[Y] > a->min()[Y] - a_height)) {
- a_in_b_vert = true;
- } else if (b->min()[Y] == a->min()[Y]) {
- a_in_b_vert = true;
- } else {
- a_in_b_vert = false;
- }
-
- if (!a_in_b_vert) {
- return -1;
- }
- if (a_in_b_vert && a->min()[X] > b->min()[X]) {
- return 1;
- }
- if (a_in_b_vert && a->min()[X] < b->min()[X]) {
- return -1;
- }
- return 0;
-}
-
-/*
- * Sort items by their y co-ordinates.
- */
-int
-sp_compare_y_position(SPItem *first, SPItem *second)
-{
- boost::optional<Geom::Rect> a = first->getBounds(sp_item_i2doc_affine(first));
- boost::optional<Geom::Rect> b = second->getBounds(sp_item_i2doc_affine(second));
-
- if ( !a || !b ) {
- // FIXME?
- return 0;
- }
-
- if (a->min()[Geom::Y] > b->min()[Geom::Y]) {
- return 1;
- }
- if (a->min()[Geom::Y] < b->min()[Geom::Y]) {
- return -1;
- }
-
- return 0;
-}
-
-namespace Inkscape {
-namespace UI {
-namespace Dialog {
-
-
-//#########################################################################
-//## E V E N T S
-//#########################################################################
-
-/*
- *
- * This arranges the selection in a grid pattern.
- *
- */
-
-void TileDialog::Grid_Arrange ()
-{
-
- int cnt,row_cnt,col_cnt,a,row,col;
- double grid_left,grid_top,col_width,row_height,paddingx,paddingy,width, height, new_x, new_y,cx,cy;
- double total_col_width,total_row_height;
- col_width = 0;
- row_height = 0;
- total_col_width=0;
- total_row_height=0;
-
- // check for correct numbers in the row- and col-spinners
- on_col_spinbutton_changed();
- on_row_spinbutton_changed();
-
- // set padding to manual values
- paddingx = XPadSpinner.get_value();
- paddingy = YPadSpinner.get_value();
-
- std::vector<double> row_heights;
- std::vector<double> col_widths;
- std::vector<double> row_ys;
- std::vector<double> col_xs;
-
- int NoOfCols = NoOfColsSpinner.get_value_as_int();
- int NoOfRows = NoOfRowsSpinner.get_value_as_int();
-
- width = 0;
- for (a=0;a<NoOfCols; a++){
- col_widths.push_back(width);
- }
-
- height = 0;
- for (a=0;a<NoOfRows; a++){
- row_heights.push_back(height);
- }
- grid_left = 99999;
- grid_top = 99999;
-
- SPDesktop *desktop = getDesktop();
- sp_document_ensure_up_to_date(sp_desktop_document(desktop));
-
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
- const GSList *items = selection->itemList();
- cnt=0;
- for (; items != NULL; items = items->next) {
- SPItem *item = SP_ITEM(items->data);
- boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item));
- if (!b) {
- continue;
- }
-
- width = b->dimensions()[Geom::X];
- height = b->dimensions()[Geom::Y];
-
- cx = b->midpoint()[Geom::X];
- cy = b->midpoint()[Geom::Y];
-
- if (b->min()[Geom::X] < grid_left) {
- grid_left = b->min()[Geom::X];
- }
- if (b->min()[Geom::Y] < grid_top) {
- grid_top = b->min()[Geom::Y];
- }
- if (width > col_width) {
- col_width = width;
- }
- if (height > row_height) {
- row_height = height;
- }
- }
-
-
- // require the sorting done before we can calculate row heights etc.
-
- const GSList *items2 = selection->itemList();
- GSList *rev = g_slist_copy((GSList *) items2);
- GSList *sorted = NULL;
- rev = g_slist_sort(rev, (GCompareFunc) sp_compare_y_position);
- sorted = g_slist_sort(rev, (GCompareFunc) sp_compare_x_position);
-
-
- // Calculate individual Row and Column sizes if necessary
-
-
- cnt=0;
- const GSList *sizes = sorted;
- for (; sizes != NULL; sizes = sizes->next) {
- SPItem *item = SP_ITEM(sizes->data);
- boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item));
- if (b) {
- width = b->dimensions()[Geom::X];
- height = b->dimensions()[Geom::Y];
- if (width > col_widths[(cnt % NoOfCols)]) {
- col_widths[(cnt % NoOfCols)] = width;
- }
- if (height > row_heights[(cnt / NoOfCols)]) {
- row_heights[(cnt / NoOfCols)] = height;
- }
- }
-
- cnt++;
- }
-
-
- /// Make sure the top and left of the grid dont move by compensating for align values.
- if (RowHeightButton.get_active()){
- grid_top = grid_top - (((row_height - row_heights[0]) / 2)*(VertAlign));
- }
- if (ColumnWidthButton.get_active()){
- grid_left = grid_left - (((col_width - col_widths[0]) /2)*(HorizAlign));
- }
-
- #ifdef DEBUG_GRID_ARRANGE
- g_print("\n cx = %f cy= %f gridleft=%f",cx,cy,grid_left);
- #endif
-
- // Calculate total widths and heights, allowing for columns and rows non uniformly sized.
-
- if (ColumnWidthButton.get_active()){
- total_col_width = col_width * NoOfCols;
- col_widths.clear();
- for (a=0;a<NoOfCols; a++){
- col_widths.push_back(col_width);
- }
- } else {
- for (a = 0; a < (int)col_widths.size(); a++)
- {
- total_col_width += col_widths[a] ;
- }
- }
-
- if (RowHeightButton.get_active()){
- total_row_height = row_height * NoOfRows;
- row_heights.clear();
- for (a=0;a<NoOfRows; a++){
- row_heights.push_back(row_height);
- }
- } else {
- for (a = 0; a < (int)row_heights.size(); a++)
- {
- total_row_height += row_heights[a] ;
- }
- }
-
-
- boost::optional<Geom::Rect> sel_bbox = selection->bounds();
- // Fit to bbox, calculate padding between rows accordingly.
- if ( sel_bbox && !SpaceManualRadioButton.get_active() ){
-#ifdef DEBUG_GRID_ARRANGE
-g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_height,total_col_width, b.extent(Geom::X), b.extent(Geom::Y));
-#endif
- paddingx = (sel_bbox->width() - total_col_width) / (NoOfCols -1);
- paddingy = (sel_bbox->height() - total_row_height) / (NoOfRows -1);
- }
-
-/*
- Horizontal align - Left = 0
- Centre = 1
- Right = 2
-
- Vertical align - Top = 0
- Middle = 1
- Bottom = 2
-
- X position is calculated by taking the grids left co-ord, adding the distance to the column,
- then adding 1/2 the spacing multiplied by the align variable above,
- Y position likewise, takes the top of the grid, adds the y to the current row then adds the padding in to align it.
-
-*/
-
- // Calculate row and column x and y coords required to allow for columns and rows which are non uniformly sized.
-
- for (a=0;a<NoOfCols; a++){
- if (a<1) col_xs.push_back(0);
- else col_xs.push_back(col_widths[a-1]+paddingx+col_xs[a-1]);
- }
-
-
- for (a=0;a<NoOfRows; a++){
- if (a<1) row_ys.push_back(0);
- else row_ys.push_back(row_heights[a-1]+paddingy+row_ys[a-1]);
- }
-
- cnt=0;
- for (row_cnt=0; ((sorted != NULL) && (row_cnt<NoOfRows)); row_cnt++) {
-
- GSList *current_row = NULL;
- for (col_cnt = 0; ((sorted != NULL) && (col_cnt<NoOfCols)); col_cnt++) {
- current_row = g_slist_append (current_row, sorted->data);
- sorted = sorted->next;
- }
-
- for (; current_row != NULL; current_row = current_row->next) {
- SPItem *item=SP_ITEM(current_row->data);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(item);
- boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item));
- Geom::Point min;
- if (b) {
- width = b->dimensions()[Geom::X];
- height = b->dimensions()[Geom::Y];
- min = b->min();
- } else {
- width = height = 0;
- min = Geom::Point(0, 0);
- }
-
- row = cnt / NoOfCols;
- col = cnt % NoOfCols;
-
- new_x = grid_left + (((col_widths[col] - width)/2)*HorizAlign) + col_xs[col];
- new_y = grid_top + (((row_heights[row] - height)/2)*VertAlign) + row_ys[row];
-
- // signs are inverted between x and y due to y inversion
- Geom::Point move = Geom::Point(new_x - min[Geom::X], min[Geom::Y] - new_y);
- Geom::Matrix const affine = Geom::Matrix(Geom::Translate(move));
- sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * affine);
- sp_item_write_transform(item, repr, item->transform, NULL);
- SP_OBJECT (current_row->data)->updateRepr();
- cnt +=1;
- }
- g_slist_free (current_row);
- }
-
- sp_document_done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE,
- _("Arrange in a grid"));
-
-}
-
-
-//#########################################################################
-//## E V E N T S
-//#########################################################################
-
-
-void TileDialog::_apply()
-{
- Grid_Arrange();
-}
-
-
-/**
- * changed value in # of columns spinbox.
- */
-void TileDialog::on_row_spinbutton_changed()
-{
- // quit if run by the attr_changed listener
- if (updating) {
- return;
- }
-
- // in turn, prevent listener from responding
- updating = true;
- SPDesktop *desktop = getDesktop();
-
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
-
- GSList const *items = selection->itemList();
- int selcount = g_slist_length((GSList *)items);
-
- double PerCol = ceil(selcount / NoOfColsSpinner.get_value());
- NoOfRowsSpinner.set_value(PerCol);
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/NoOfCols", NoOfColsSpinner.get_value());
- updating=false;
-}
-
-/**
- * changed value in # of rows spinbox.
- */
-void TileDialog::on_col_spinbutton_changed()
-{
- // quit if run by the attr_changed listener
- if (updating) {
- return;
- }
-
- // in turn, prevent listener from responding
- updating = true;
- SPDesktop *desktop = getDesktop();
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
-
- GSList const *items = selection->itemList();
- int selcount = g_slist_length((GSList *)items);
-
- double PerRow = ceil(selcount / NoOfRowsSpinner.get_value());
- NoOfColsSpinner.set_value(PerRow);
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/NoOfCols", PerRow);
-
- updating=false;
-}
-
-/**
- * changed value in x padding spinbox.
- */
-void TileDialog::on_xpad_spinbutton_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/XPad", XPadSpinner.get_value());
-
-}
-
-/**
- * changed value in y padding spinbox.
- */
-void TileDialog::on_ypad_spinbutton_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/YPad", YPadSpinner.get_value());
-}
-
-
-/**
- * checked/unchecked autosize Rows button.
- */
-void TileDialog::on_RowSize_checkbutton_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (RowHeightButton.get_active()) {
- prefs->setDouble("/dialogs/gridtiler/AutoRowSize", 20);
- } else {
- prefs->setDouble("/dialogs/gridtiler/AutoRowSize", -20);
- }
- RowHeightBox.set_sensitive ( !RowHeightButton.get_active());
-}
-
-/**
- * checked/unchecked autosize Rows button.
- */
-void TileDialog::on_ColSize_checkbutton_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (ColumnWidthButton.get_active()) {
- prefs->setDouble("/dialogs/gridtiler/AutoColSize", 20);
- } else {
- prefs->setDouble("/dialogs/gridtiler/AutoColSize", -20);
- }
- ColumnWidthBox.set_sensitive ( !ColumnWidthButton.get_active());
-}
-
-/**
- * changed value in columns spinbox.
- */
-void TileDialog::on_rowSize_spinbutton_changed()
-{
- // quit if run by the attr_changed listener
- if (updating) {
- return;
- }
-
- // in turn, prevent listener from responding
- updating = true;
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/RowHeight", RowHeightSpinner.get_value());
- updating=false;
-
-}
-
-/**
- * changed value in rows spinbox.
- */
-void TileDialog::on_colSize_spinbutton_changed()
-{
- // quit if run by the attr_changed listener
- if (updating) {
- return;
- }
-
- // in turn, prevent listener from responding
- updating = true;
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/dialogs/gridtiler/ColWidth", ColumnWidthSpinner.get_value());
- updating=false;
-
-}
-
-/**
- * changed Radio button in Spacing group.
- */
-void TileDialog::Spacing_button_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (SpaceManualRadioButton.get_active()) {
- prefs->setDouble("/dialogs/gridtiler/SpacingType", 20);
- } else {
- prefs->setDouble("/dialogs/gridtiler/SpacingType", -20);
- }
-
- SizesHBox.set_sensitive ( SpaceManualRadioButton.get_active());
-}
-
-/**
- * changed Radio button in Vertical Align group.
- */
-void TileDialog::VertAlign_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (VertTopRadioButton.get_active()) {
- VertAlign = 0;
- prefs->setInt("/dialogs/gridtiler/VertAlign", 0);
- } else if (VertCentreRadioButton.get_active()){
- VertAlign = 1;
- prefs->setInt("/dialogs/gridtiler/VertAlign", 1);
- } else if (VertBotRadioButton.get_active()){
- VertAlign = 2;
- prefs->setInt("/dialogs/gridtiler/VertAlign", 2);
- }
-}
-
-/**
- * changed Radio button in Vertical Align group.
- */
-void TileDialog::HorizAlign_changed()
-{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (HorizLeftRadioButton.get_active()) {
- HorizAlign = 0;
- prefs->setInt("/dialogs/gridtiler/HorizAlign", 0);
- } else if (HorizCentreRadioButton.get_active()){
- HorizAlign = 1;
- prefs->setInt("/dialogs/gridtiler/HorizAlign", 1);
- } else if (HorizRightRadioButton.get_active()){
- HorizAlign = 2;
- prefs->setInt("/dialogs/gridtiler/HorizAlign", 2);
- }
-}
-
-/**
- * Desktop selection changed
- */
-void TileDialog::updateSelection()
-{
- // quit if run by the attr_changed listener
- if (updating) {
- return;
- }
-
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- double col_width = 0;
- double row_height = 0;
- // in turn, prevent listener from responding
- updating = true;
- SPDesktop *desktop = getDesktop();
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
- const GSList *items = selection->itemList();
- int selcount = g_slist_length((GSList *)items);
-
- if (NoOfColsSpinner.get_value()>1 && NoOfRowsSpinner.get_value()>1){
- // Update the number of rows assuming number of columns wanted remains same.
- double NoOfRows = ceil(selcount / NoOfColsSpinner.get_value());
- NoOfRowsSpinner.set_value(NoOfRows);
-
- // if the selection has less than the number set for one row, reduce it appropriately
- if (selcount<NoOfColsSpinner.get_value()) {
- double NoOfCols = ceil(selcount / NoOfRowsSpinner.get_value());
- NoOfColsSpinner.set_value(NoOfCols);
- prefs->setInt("/dialogs/gridtiler/NoOfCols", NoOfCols);
- }
- } else {
- double PerRow = ceil(sqrt(selcount));
- double PerCol = ceil(sqrt(selcount));
- NoOfRowsSpinner.set_value(PerRow);
- NoOfColsSpinner.set_value(PerCol);
- prefs->setInt("/dialogs/gridtiler/NoOfCols", static_cast<int>(PerCol));
-
- }
-
- updating=false;
-
-}
-
-
-
-/*##########################
-## Experimental
-##########################*/
-
-static void updateSelectionCallback(Inkscape::Application */*inkscape*/, Inkscape::Selection */*selection*/, TileDialog *dlg)
-{
- TileDialog *tledlg = (TileDialog *) dlg;
- tledlg->updateSelection();
-}
-
-
-//#########################################################################
-//## C O N S T R U C T O R / D E S T R U C T O R
-//#########################################################################
-/**
- * Constructor
- */
-TileDialog::TileDialog()
- : UI::Widget::Panel("", "/dialogs/gridtiler", SP_VERB_SELECTION_GRIDTILE)
-{
- // bool used by spin button callbacks to stop loops where they change each other.
- updating = false;
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
-
- // could not do this in gtkmm - there's no Gtk::SizeGroup public constructor (!)
- GtkSizeGroup *_col1 = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- GtkSizeGroup *_col2 = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- GtkSizeGroup *_col3 = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
- {
- // Selection Change signal
- g_signal_connect ( G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (updateSelectionCallback), this);
- }
-
- Gtk::Box *contents = _getContents();
-
-#define MARGIN 2
-
- //##Set up the panel
-
- SPDesktop *desktop = getDesktop();
-
- Inkscape::Selection *selection = sp_desktop_selection (desktop);
- int selcount = 1;
- if (!selection->isEmpty()) {
- GSList const *items = selection->itemList();
- selcount = g_slist_length((GSList *)items);
- }
-
-
- /*#### Number of Rows ####*/
-
- double PerRow = ceil(sqrt(selcount));
- double PerCol = ceil(sqrt(selcount));
-
- #ifdef DEBUG_GRID_ARRANGE
- g_print("/n PerRox = %f PerCol = %f selcount = %d",PerRow,PerCol,selcount);
- #endif
-
- NoOfRowsLabel.set_label(_("Rows:"));
- NoOfRowsBox.pack_start(NoOfRowsLabel, false, false, MARGIN);
-
- NoOfRowsSpinner.set_digits(0);
- NoOfRowsSpinner.set_increments(1, 5);
- NoOfRowsSpinner.set_range(1.0, 100.0);
- NoOfRowsSpinner.set_value(PerCol);
- NoOfRowsSpinner.signal_changed().connect(sigc::mem_fun(*this, &TileDialog::on_col_spinbutton_changed));
- tips.set_tip(NoOfRowsSpinner, _("Number of rows"));
- NoOfRowsBox.pack_start(NoOfRowsSpinner, false, false, MARGIN);
- gtk_size_group_add_widget(_col1, (GtkWidget *) NoOfRowsBox.gobj());
-
- RowHeightButton.set_label(_("Equal height"));
- double AutoRow = prefs->getDouble("/dialogs/gridtiler/AutoRowSize", 15);
- if (AutoRow>0)
- AutoRowSize=true;
- else
- AutoRowSize=false;
- RowHeightButton.set_active(AutoRowSize);
-
- NoOfRowsBox.pack_start(RowHeightButton, false, false, MARGIN);
-
- tips.set_tip(RowHeightButton, _("If not set, each row has the height of the tallest object in it"));
- RowHeightButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::on_RowSize_checkbutton_changed));
-
- {
- /*#### Radio buttons to control vertical alignment ####*/
-
- VertAlignLabel.set_label(_("Align:"));
- VertAlignHBox.pack_start(VertAlignLabel, false, false, MARGIN);
-
- VertTopRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::VertAlign_changed));
- VertAlignGroup = VertTopRadioButton.get_group();
- VertAlignVBox.pack_start(VertTopRadioButton, false, false, 0);
-
- VertCentreRadioButton.set_group(VertAlignGroup);
- VertCentreRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::VertAlign_changed));
- VertAlignVBox.pack_start(VertCentreRadioButton, false, false, 0);
-
- VertBotRadioButton.set_group(VertAlignGroup);
- VertBotRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::VertAlign_changed));
- VertAlignVBox.pack_start(VertBotRadioButton, false, false, 0);
-
- VertAlign = prefs->getInt("/dialogs/gridtiler/VertAlign", 1);
- if (VertAlign == 0) {
- VertTopRadioButton.set_active(TRUE);
- }
- else if (VertAlign == 1) {
- VertCentreRadioButton.set_active(TRUE);
- }
- else if (VertAlign == 2){
- VertBotRadioButton.set_active(TRUE);
- }
- VertAlignHBox.pack_start(VertAlignVBox, false, false, MARGIN);
- NoOfRowsBox.pack_start(VertAlignHBox, false, false, MARGIN);
- }
-
- SpinsHBox.pack_start(NoOfRowsBox, false, false, MARGIN);
-
-
- /*#### Label for X ####*/
- padXByYLabel.set_label(" ");
- XByYLabelVBox.pack_start(padXByYLabel, false, false, MARGIN);
- XByYLabel.set_markup(" &#215; ");
- XByYLabelVBox.pack_start(XByYLabel, false, false, MARGIN);
- SpinsHBox.pack_start(XByYLabelVBox, false, false, MARGIN);
- gtk_size_group_add_widget(_col2, (GtkWidget *) XByYLabelVBox.gobj());
-
- /*#### Number of columns ####*/
-
- NoOfColsLabel.set_label(_("Columns:"));
- NoOfColsBox.pack_start(NoOfColsLabel, false, false, MARGIN);
-
- NoOfColsSpinner.set_digits(0);
- NoOfColsSpinner.set_increments(1, 5);
- NoOfColsSpinner.set_range(1.0, 100.0);
- NoOfColsSpinner.set_value(PerRow);
- NoOfColsSpinner.signal_changed().connect(sigc::mem_fun(*this, &TileDialog::on_row_spinbutton_changed));
- tips.set_tip(NoOfColsSpinner, _("Number of columns"));
- NoOfColsBox.pack_start(NoOfColsSpinner, false, false, MARGIN);
- gtk_size_group_add_widget(_col3, (GtkWidget *) NoOfColsBox.gobj());
-
- ColumnWidthButton.set_label(_("Equal width"));
- double AutoCol = prefs->getDouble("/dialogs/gridtiler/AutoColSize", 15);
- if (AutoCol>0)
- AutoColSize=true;
- else
- AutoColSize=false;
- ColumnWidthButton.set_active(AutoColSize);
- NoOfColsBox.pack_start(ColumnWidthButton, false, false, MARGIN);
-
- tips.set_tip(ColumnWidthButton, _("If not set, each column has the width of the widest object in it"));
- ColumnWidthButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::on_ColSize_checkbutton_changed));
-
-
- {
- /*#### Radio buttons to control horizontal alignment ####*/
-
- HorizAlignLabel.set_label(_("Align:"));
- HorizAlignVBox.pack_start(HorizAlignLabel, false, false, MARGIN);
-
- HorizAlignHBox.pack_start(*(new Gtk::HBox()), true, true, 0); // centering strut
-
- HorizLeftRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::HorizAlign_changed));
- HorizAlignGroup = HorizLeftRadioButton.get_group();
- HorizAlignHBox.pack_start(HorizLeftRadioButton, false, false, 0);
-
- HorizCentreRadioButton.set_group(HorizAlignGroup);
- HorizCentreRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::HorizAlign_changed));
- HorizAlignHBox.pack_start(HorizCentreRadioButton, false, false, 0);
-
- HorizRightRadioButton.set_group(HorizAlignGroup);
- HorizRightRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::HorizAlign_changed));
- HorizAlignHBox.pack_start(HorizRightRadioButton, false, false, 0);
-
- HorizAlignHBox.pack_start(*(new Gtk::HBox()), true, true, 0); // centering strut
-
- HorizAlign = prefs->getInt("/dialogs/gridtiler/HorizAlign", 1);
- if (HorizAlign == 0) {
- HorizLeftRadioButton.set_active(TRUE);
- }
- else if (HorizAlign == 1) {
- HorizCentreRadioButton.set_active(TRUE);
- }
- else if (HorizAlign == 2) {
- HorizRightRadioButton.set_active(TRUE);
- }
- HorizAlignVBox.pack_start(HorizAlignHBox, false, false, MARGIN);
- NoOfColsBox.pack_start(HorizAlignVBox, false, false, MARGIN);
- }
-
- SpinsHBox.pack_start(NoOfColsBox, false, false, MARGIN);
-
- TileBox.pack_start(SpinsHBox, false, false, MARGIN);
-
- {
- /*#### Radio buttons to control spacing manually or to fit selection bbox ####*/
- SpaceByBBoxRadioButton.set_label(_("Fit into selection box"));
- SpaceByBBoxRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::Spacing_button_changed));
- SpacingGroup = SpaceByBBoxRadioButton.get_group();
-
- SpacingVBox.pack_start(SpaceByBBoxRadioButton, false, false, MARGIN);
-
- SpaceManualRadioButton.set_label(_("Set spacing:"));
- SpaceManualRadioButton.set_group(SpacingGroup);
- SpaceManualRadioButton.signal_toggled().connect(sigc::mem_fun(*this, &TileDialog::Spacing_button_changed));
- SpacingVBox.pack_start(SpaceManualRadioButton, false, false, MARGIN);
-
- TileBox.pack_start(SpacingVBox, false, false, MARGIN);
- }
-
- {
- /*#### Y Padding ####*/
-
- GtkWidget *i = sp_icon_new (Inkscape::ICON_SIZE_MENU, "clonetiler_per_row");
- YPadBox.pack_start (*(Glib::wrap(i)), false, false, MARGIN);
-
- YPadSpinner.set_digits(1);
- YPadSpinner.set_increments(0.2, 2);
- YPadSpinner.set_range(-10000, 10000);
- double YPad = prefs->getDouble("/dialogs/gridtiler/YPad", 15);
- YPadSpinner.set_value(YPad);
- YPadBox.pack_start(YPadSpinner, true, true, MARGIN);
- tips.set_tip(YPadSpinner, _("Vertical spacing between rows (px units)"));
- YPadSpinner.signal_changed().connect(sigc::mem_fun(*this, &TileDialog::on_ypad_spinbutton_changed));
- gtk_size_group_add_widget(_col1, (GtkWidget *) YPadBox.gobj());
-
- SizesHBox.pack_start(YPadBox, false, false, MARGIN);
- }
-
- {
- Gtk::HBox *spacer = new Gtk::HBox;
- SizesHBox.pack_start(*spacer, false, false, 0);
- gtk_size_group_add_widget(_col2, (GtkWidget *) spacer->gobj());
- }
-
- {
- /*#### X padding ####*/
-
- GtkWidget *i = sp_icon_new (Inkscape::ICON_SIZE_MENU, "clonetiler_per_column");
- XPadBox.pack_start (*(Glib::wrap(i)), false, false, MARGIN);
-
- XPadSpinner.set_digits(1);
- XPadSpinner.set_increments(0.2, 2);
- XPadSpinner.set_range(-10000, 10000);
- double XPad = prefs->getDouble("/dialogs/gridtiler/XPad", 15);
- XPadSpinner.set_value(XPad);
- XPadBox.pack_start(XPadSpinner, true, true, MARGIN);
- tips.set_tip(XPadSpinner, _("Horizontal spacing between columns (px units)"));
- XPadSpinner.signal_changed().connect(sigc::mem_fun(*this, &TileDialog::on_xpad_spinbutton_changed));
- gtk_size_group_add_widget(_col3, (GtkWidget *) XPadBox.gobj());
-
- SizesHBox.pack_start(XPadBox, false, false, MARGIN);
- }
-
-
- TileBox.pack_start(SizesHBox, false, false, MARGIN);
-
- contents->pack_start(TileBox);
-
- double SpacingType = prefs->getDouble("/dialogs/gridtiler/SpacingType", 15);
- if (SpacingType>0) {
- ManualSpacing=true;
- } else {
- ManualSpacing=false;
- }
- SpaceManualRadioButton.set_active(ManualSpacing);
- SpaceByBBoxRadioButton.set_active(!ManualSpacing);
- SizesHBox.set_sensitive (ManualSpacing);
-
- //## The OK button
- TileOkButton = addResponseButton(_("Arrange"), GTK_RESPONSE_APPLY);
- tips.set_tip((*TileOkButton), _("Arrange selected objects"));
-
- show_all_children();
-}
-
-} //namespace Dialog
-} //namespace UI
-} //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:encoding=utf-8:textwidth=99 ::
diff --git a/src/dialogs/tiledialog.h b/src/dialogs/tiledialog.h
deleted file mode 100644
index a1201956a..000000000
--- a/src/dialogs/tiledialog.h
+++ /dev/null
@@ -1,189 +0,0 @@
-#ifndef __TILEDIALOG_H__
-#define __TILEDIALOG_H__
-/*
- * A simple dialog for creating grid type arrangements of selected objects
- *
- * Authors:
- * Bob Jamison ( based off trace dialog)
- * John Cliff
- * Other dudes from The Inkscape Organization
- *
- * Copyright (C) 2004 Bob Jamison
- * Copyright (C) 2004 John Cliff
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-
-#include <gtkmm/box.h>
-#include <gtkmm/notebook.h>
-#include <gtkmm/tooltips.h>
-#include <gtkmm/button.h>
-#include <gtkmm/spinbutton.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/radiobutton.h>
-
-#include "ui/widget/panel.h"
-
-namespace Inkscape {
-namespace UI {
-namespace Dialog {
-
-
-/**
- * A dialog that displays log messages
- */
-class TileDialog : public UI::Widget::Panel {
-
-public:
-
- /**
- * Constructor
- */
- TileDialog() ;
-
- /**
- * Factory method
- */
- static TileDialog& getInstance() { return *new TileDialog(); }
-
- /**
- * Destructor
- */
- virtual ~TileDialog() {};
-
- /**
- * Do the actual work
- */
- void Grid_Arrange();
-
- /**
- * Respond to selection change
- */
- void updateSelection();
-
-
- /**
- * Callback from Apply
- */
- virtual void _apply();
-
- /**
- * Callback from spinbuttons
- */
- void on_row_spinbutton_changed();
- void on_col_spinbutton_changed();
- void on_xpad_spinbutton_changed();
- void on_ypad_spinbutton_changed();
- void on_RowSize_checkbutton_changed();
- void on_ColSize_checkbutton_changed();
- void on_rowSize_spinbutton_changed();
- void on_colSize_spinbutton_changed();
- void Spacing_button_changed();
- void VertAlign_changed();
- void HorizAlign_changed();
-
-
-private:
- TileDialog(TileDialog const &d); // no copy
- void operator=(TileDialog const &d); // no assign
-
- bool userHidden;
- bool updating;
-
-
-
- Gtk::Notebook notebook;
- Gtk::Tooltips tips;
-
- Gtk::VBox TileBox;
- Gtk::Button *TileOkButton;
- Gtk::Button *TileCancelButton;
-
- // Number selected label
- Gtk::Label SelectionContentsLabel;
-
-
- Gtk::HBox AlignHBox;
- Gtk::HBox SpinsHBox;
- Gtk::HBox SizesHBox;
-
- // Number per Row
- Gtk::VBox NoOfColsBox;
- Gtk::Label NoOfColsLabel;
- Gtk::SpinButton NoOfColsSpinner;
- bool AutoRowSize;
- Gtk::CheckButton RowHeightButton;
-
- Gtk::VBox XByYLabelVBox;
- Gtk::Label padXByYLabel;
- Gtk::Label XByYLabel;
-
- // Number per Column
- Gtk::VBox NoOfRowsBox;
- Gtk::Label NoOfRowsLabel;
- Gtk::SpinButton NoOfRowsSpinner;
- bool AutoColSize;
- Gtk::CheckButton ColumnWidthButton;
-
- // Vertical align
- Gtk::Label VertAlignLabel;
- Gtk::HBox VertAlignHBox;
- Gtk::VBox VertAlignVBox;
- Gtk::RadioButtonGroup VertAlignGroup;
- Gtk::RadioButton VertCentreRadioButton;
- Gtk::RadioButton VertTopRadioButton;
- Gtk::RadioButton VertBotRadioButton;
- double VertAlign;
-
- // Horizontal align
- Gtk::Label HorizAlignLabel;
- Gtk::VBox HorizAlignVBox;
- Gtk::HBox HorizAlignHBox;
- Gtk::RadioButtonGroup HorizAlignGroup;
- Gtk::RadioButton HorizCentreRadioButton;
- Gtk::RadioButton HorizLeftRadioButton;
- Gtk::RadioButton HorizRightRadioButton;
- double HorizAlign;
-
- // padding in x
- Gtk::VBox XPadBox;
- Gtk::Label XPadLabel;
- Gtk::SpinButton XPadSpinner;
-
- // padding in y
- Gtk::VBox YPadBox;
- Gtk::Label YPadLabel;
- Gtk::SpinButton YPadSpinner;
-
- // BBox or manual spacing
- Gtk::VBox SpacingVBox;
- Gtk::RadioButtonGroup SpacingGroup;
- Gtk::RadioButton SpaceByBBoxRadioButton;
- Gtk::RadioButton SpaceManualRadioButton;
- bool ManualSpacing;
-
-
-
- // Row height
- Gtk::VBox RowHeightVBox;
- Gtk::HBox RowHeightBox;
- Gtk::Label RowHeightLabel;
- Gtk::SpinButton RowHeightSpinner;
-
- // Column width
- Gtk::VBox ColumnWidthVBox;
- Gtk::HBox ColumnWidthBox;
- Gtk::Label ColumnWidthLabel;
- Gtk::SpinButton ColumnWidthSpinner;
-
-};
-
-
-} //namespace Dialog
-} //namespace UI
-} //namespace Inkscape
-
-
-#endif /* __TILEDIALOG_H__ */
-
diff --git a/src/dialogs/unclump.cpp b/src/dialogs/unclump.cpp
index 1329fdb5f..2190bf77e 100644
--- a/src/dialogs/unclump.cpp
+++ b/src/dialogs/unclump.cpp
@@ -1,16 +1,13 @@
-#define __UNCLUMP_C__
-
-/*
- * Unclumping objects
- *
- * Authors:
+/** @file
+ * @brief Unclumping objects
+ */
+/* Authors:
* bulia byak
*
* Copyright (C) 2005 Authors
- * Released under GNU GPL
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
-
#include <algorithm>
#include <map>
#include "libnr/nr-matrix-ops.h"
@@ -35,7 +32,7 @@ unclump_center (SPItem *item)
return i->second;
}
- boost::optional<Geom::Rect> r = item->getBounds(sp_item_i2d_affine(item));
+ Geom::OptRect r = item->getBounds(sp_item_i2d_affine(item));
if (r) {
Geom::Point const c = r->midpoint();
c_cache[SP_OBJECT_ID(item)] = c;
@@ -54,7 +51,7 @@ unclump_wh (SPItem *item)
if ( i != wh_cache.end() ) {
wh = i->second;
} else {
- boost::optional<Geom::Rect> r = item->getBounds(sp_item_i2d_affine(item));
+ Geom::OptRect r = item->getBounds(sp_item_i2d_affine(item));
if (r) {
wh = r->dimensions();
wh_cache[SP_OBJECT_ID(item)] = wh;
@@ -379,3 +376,14 @@ unclump (GSList *items)
}
}
}
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/unclump.h b/src/dialogs/unclump.h
index 6cebc0caf..c5a8bf7d7 100644
--- a/src/dialogs/unclump.h
+++ b/src/dialogs/unclump.h
@@ -1,20 +1,29 @@
-#ifndef UNCLUMP_H_SEEN
-#define UNCLUMP_H_SEEN
-
-/** \file
- * Unclumping objects
+/** @file
+ * @brief Unclumping objects
*/
-/*
- * Authors:
+/* Authors:
* bulia byak
*
* Copyright (C) 2005 Authors
- * Released under GNU GPL
+ * Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifndef SEEN_DIALOGS_UNCLUMP_H
+#define SEEN_DIALOGS_UNCLUMP_H
+
#include <glib/gslist.h>
void unclump(GSList *items);
-
#endif /* !UNCLUMP_H_SEEN */
+
+/*
+ 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:encoding=utf-8:textwidth=99 :
diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp
index 2c596bc0e..78a5aa3a7 100644
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
@@ -1,36 +1,18 @@
-#define __SP_XMLVIEW_TREE_C__
-
-/**
- * \brief XML View
- *
- * Authors:
+/** @file
+ * @brief XML editor
+ */
+/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
+ * David Turner
*
* Copyright (C) 1999-2006 Authors
- * Copyright (C) 2004 David Turner
- *
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gtk/gtkmain.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkhpaned.h>
-#include <gtk/gtkvpaned.h>
-#include <gtk/gtkhseparator.h>
-#include <gtk/gtkhbbox.h>
-#include <gtk/gtktoolbar.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkarrow.h>
-
+#include <gtk/gtk.h>
#include <glibmm/i18n.h>
#include "helper/window.h"
#include "macros.h"
diff --git a/src/dialogs/xml-tree.h b/src/dialogs/xml-tree.h
index 6d0d44a7d..0edea8f4d 100644
--- a/src/dialogs/xml-tree.h
+++ b/src/dialogs/xml-tree.h
@@ -1,10 +1,7 @@
-#ifndef SP_XML_TREE_H
-#define SP_XML_TREE_H
-
-/**
- * \brief XML tree editing dialog for Inkscape
- *
- * Copyright Lauris Kaplinski, 2000
+/** @file
+ * @brief XML tree editing dialog for Inkscape
+ */
+/* Copyright Lauris Kaplinski, 2000
*
* Released under GNU General Public License.
*
@@ -13,6 +10,9 @@
*
*/
+#ifndef SEEN_DIALOGS_XML_TREE_H
+#define SEEN_DIALOGS_XML_TREE_H
+
void sp_xml_tree_dialog (void);
#endif