summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 937d0a0)
raw | patch | inline | side by side (parent: 937d0a0)
author | tweenk <tweenk@users.sourceforge.net> | |
Tue, 13 Jan 2009 02:27:04 +0000 (02:27 +0000) | ||
committer | tweenk <tweenk@users.sourceforge.net> | |
Tue, 13 Jan 2009 02:27:04 +0000 (02:27 +0000) |
version string on Linux.
24 files changed:
diff --git a/build.xml b/build.xml
index f16c1486c5a672d82be5df2ee4dac10b0b4c1f69..486b771d4b367930f23f66d96adb8b6f7595b00a 100644 (file)
--- a/build.xml
+++ b/build.xml
<copy file="${src}/helper/sp-marshal.cpp.mingw"
tofile="${src}/helper/sp-marshal.cpp"/>
- <makefile file="inkscape_version.h">
- #define INKSCAPE_VERSION "${version}, revision ${svn.revision}"
+ <makefile file="inkscape-version.cpp">
+ namespace Inkscape {
+ gchar const *version_string = "${version} r${svn.revision}"
+ }
</makefile>
<makefile file="config.h">
#ifndef _CONFIG_H_
</makefile>
</target>
-
-
- <!--
- ########################################################################
- ## T A R G E T : T O U C H A B O U T
- ########################################################################
- -->
- <target name="touchabout"
- description="update the modification time of aboutbox.cpp">
- <!-- not good <touch file="${src}/ui/dialog/aboutbox.cpp"/> -->
- <!-- better -->
- <delete file="${build}/obj/ui/dialog/aboutbox.o"/>
- <delete file="inkscape_version.h"/>
- </target>
-
-
<!--
########################################################################
## T A R G E T : C X X T E S T
<delete dir="${dist}"/>
<delete file="build.dep"/>
<delete file="config.h"/>
- <delete file="inkscape_version.h"/>
+ <delete file="inkscape-version.cpp"/>
<delete file="${src}/test-main.cpp"/>
<delete file="${src}/test-src.cpp"/>
diff --git a/src/Makefile.am b/src/Makefile.am
index 82a6f65a0c65bad83fa4aa0ec837ec72b1d5e539..44b885ab0e428bd2ba4d45819c462cbcfc637a4e 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
inkjar_libs = inkjar/libinkjar.a
endif
+# Extra files to remove when doing "make distclean"
+DISTCLEANFILES = \
+ helper/sp-marshal.cpp \
+ helper/sp-marshal.h \
+ inkscape-version.cpp
+
inkscape_private_libs = \
libinkpre.a \
application/libinkapp.a \
io/libio.a \
$(inkjar_libs) \
libinkpost.a \
- debug/libinkdebug.a
+ debug/libinkdebug.a \
+ libinkversion.a
all_libs = \
$(inkscape_private_libs) \
# Currently we use one library per source directory.
noinst_LIBRARIES = $(inkscape_private_libs)
-# Extra files to remove when doing "make distclean"
-DISTCLEANFILES = \
- helper/sp-marshal.cpp \
- helper/sp-marshal.h \
- inkscape_version.h
-
# Extra files not mentioned as sources to include in the source tarball
EXTRA_DIST = \
$(top_srcdir)/Doxyfile \
diff --git a/src/Makefile_insert b/src/Makefile_insert
index 6668600d38955448dbb9171b4f317a4f5eab397e..6eba8897d81c53319af5c3e00030fbf549b30d73 100644 (file)
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
# Additional dependencies
desktop.$(OBJEXT): helper/sp-marshal.h
-document.$(OBJEXT): helper/sp-marshal.h inkscape_version.h
-extension/internal/latex-pstricks.$(OBJEXT): inkscape_version.h
-extension/internal/ps.$(OBJEXT): inkscape_version.h
-inkscape.$(OBJEXT): helper/sp-marshal.h inkscape_version.h
+document.$(OBJEXT): helper/sp-marshal.h
+inkscape.$(OBJEXT): helper/sp-marshal.h
knot.$(OBJEXT): helper/sp-marshal.h
-main.$(OBJEXT): inkscape_version.h
selection.$(OBJEXT): helper/sp-marshal.h
sp-object.$(OBJEXT): helper/sp-marshal.h
-sp-root.$(OBJEXT): inkscape_version.h
view.$(OBJEXT): helper/sp-marshal.h
-help.$(OBJEXT): inkscape_version.h
# ################################################
inkview_SOURCES = inkview.cpp $(win32_sources)
inkview_LDADD = $(all_libs)
-inkscape_version.h: ../configure.ac
- echo '#define INKSCAPE_VERSION "$(VERSION)"' > inkscape_version.h
+libinkversion_a_SOURCES = inkscape-version.cpp
+
+# Hack: make inkscape-version.cpp a phony target.
+# Create the version file every time "make" is invoked. Overwrite it only
+# if it changes. Watch the backslashes!
+inkscape-version.cpp:
+ VER_PREFIX="$(VERSION)"; \
+ if test -x "$(srcdir)/.svn"; then \
+ VER_SVNREV=" r`svn info $(srcdir) | sed -n -e '/^Revision:/s/Revision: \(.*\)/\1/p'`"; \
+ if test ! -z "`svn status -q $(srcdir)`"; then \
+ VER_CUSTOM=" custom"; \
+ fi; \
+ fi; \
+ VERSION="$$VER_PREFIX$$VER_SVNREV$$VER_CUSTOM"; \
+ echo "namespace Inkscape { " \
+ "char const *version_string = \"$$VERSION\"; " \
+ "}" > inkscape-version.new.cpp; \
+ if cmp -s inkscape-version.new.cpp inkscape-version.cpp; then \
+ rm inkscape-version.new.cpp; \
+ else \
+ mv inkscape-version.new.cpp inkscape-version.cpp; \
+ fi; \
+ echo $$VERSION
+.PHONY: inkscape-version.cpp
# ######################
# ### CxxTest stuff ####
diff --git a/src/debug/logger.cpp b/src/debug/logger.cpp
index 2956e068e14d41de9ab238c77246407efa64edad..f28d2750bdd7f00d051a40ecef722928dc57a200 100644 (file)
--- a/src/debug/logger.cpp
+++ b/src/debug/logger.cpp
#include <fstream>
#include <vector>
#include <glib/gmessages.h>
-#include "inkscape_version.h"
+#include "inkscape-version.h"
#include "debug/logger.h"
#include "debug/simple-event.h"
#include "gc-alloc.h"
class SessionEvent : public CoreEvent {
public:
SessionEvent() : CoreEvent(Util::share_static_string("session")) {
- _addProperty("inkscape-version", INKSCAPE_VERSION);
+ _addProperty("inkscape-version", Inkscape::version_string);
}
};
index 7e00a380458ad2910eed2bf64c59219cb25680ab..733f9a51305264be1067c8eff10a96192347c08b 100644 (file)
#include <display/display-forward.h>
#include <display/sp-canvas-util.h>
-#include "../helper/sp-marshal.h"
+#include "helper/sp-marshal.h"
#include <display/nr-arena.h>
#include <display/nr-arena-group.h>
#include <display/canvas-arena.h>
index 419b726ca7287cd27a103aa2f6b1d5c9f1f82736..e5ef2c80d5bc92c4b9a92784cb69e6e4890ac271 100644 (file)
#include <gtkmm.h>
-#include "../helper/sp-marshal.h"
+#include "helper/sp-marshal.h"
#include <helper/recthull.h>
#include <display/sp-canvas.h>
#include "display-forward.h"
diff --git a/src/document.cpp b/src/document.cpp
index 733dadb699c4de17df071134e7af5f4d204f556d..5b27272c6ea4e9a034e4743a766b2d6698c45beb 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
#include "xml/repr.h"
#include "helper/units.h"
#include "inkscape-private.h"
-#include "inkscape_version.h"
+#include "inkscape-version.h"
#include "sp-object-repr.h"
#include "sp-namedview.h"
#include "desktop.h"
/* fixme: Not sure about this, but lets assume ::build updates */
rroot->setAttribute("sodipodi:version", SODIPODI_VERSION);
- rroot->setAttribute("inkscape:version", INKSCAPE_VERSION);
+ rroot->setAttribute("inkscape:version", Inkscape::version_string);
/* fixme: Again, I moved these here to allow version determining in ::build (Lauris) */
/* Quick hack 2 - get default image size into document */
diff --git a/src/extension/db.h b/src/extension/db.h
index 9505ac779c51229ed91cac9056e49d3779dc6c02..9d4fc77d3da8c8582cc4e3bab3c5f803e672f8cd 100644 (file)
--- a/src/extension/db.h
+++ b/src/extension/db.h
#include <map>
#include <list>
+#include <cstring>
#include "extension/extension.h"
index 0129f4d742584e2fcec9c23bf63f0db726425321..48ca86cf780871c77fdaef8206aabecb21206ff0 100644 (file)
#include <gtkmm/table.h>
#include <glibmm/ustring.h>
#include "xml/repr.h"
-#include "document.h"
#include "extension/extension-forward.h"
/** The key that is used to identify that the I/O should be autodetected */
#define INKSCAPE_EXTENSION_NS_NC "extension"
#define INKSCAPE_EXTENSION_NS "extension:"
+struct SPDocument;
+
namespace Inkscape {
namespace Extension {
index 9540b08e5de3d9860873519435ba985d940c3a35..c331cac6069a4ab7aa0e356e0998412ce15f0b89 100644 (file)
#include "io/sys.h"
#include "file.h"
#include <unistd.h>
+#include <cstring>
+#include "document.h"
#include <libxml/parser.h>
#include <libxslt/transform.h>
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index 1de9bbfe0d4a981d8cb6b539cdce05f259bf5153..f69186c71343485565727da9333bcccc6ee94b02 100644 (file)
//#include "document.h"
#include "style.h"
//#include "sp-paint-server.h"
-#include "inkscape_version.h"
+#include "inkscape-version.h"
//#include "libnrtype/FontFactory.h"
//#include "libnrtype/font-instance.h"
CHAR buff[1024];
ZeroMemory(buff, sizeof(buff));
- snprintf(buff, sizeof(buff)-1, "Inkscape %s (%s)", INKSCAPE_VERSION, __DATE__);
+ snprintf(buff, sizeof(buff)-1, "Inkscape %s (%s)", Inkscape::version_string, __DATE__);
INT len = strlen(buff);
CHAR *p1 = strrchr(ansi_uri, '\\');
CHAR *p2 = strrchr(ansi_uri, '/');
index 69ee296e58a0a73c80cdb8833d236b6bf42d5cc9..1c3ae9c2a1c3eb69349a56880ca38eccefa17b2d 100644 (file)
#endif\r
#include "javafx-out.h"\r
#include <inkscape.h>\r
-#include <inkscape_version.h>\r
+#include <inkscape-version.h>\r
#include <sp-path.h>\r
#include <sp-linear-gradient.h>\r
#include <sp-radial-gradient.h>\r
out("### This JavaFX document was generated by Inkscape\n");\r
out("### http://www.inkscape.org\n");\r
out("### Created: %s", ctime(&tim));\r
- out("### Version: %s\n", INKSCAPE_VERSION);\r
+ out("### Version: %s\n", Inkscape::version_string);\r
out("#####################################################################\n");\r
out("### NOTES:\n");\r
out("### ============\n");\r
index 6b8a5ce070744cb441d3da50119fc146cd632710..7dd9dcf5e8f0cff19362e7cb3dd7a5d78e120b2d 100644 (file)
#endif
#include "pov-out.h"
#include <inkscape.h>
-#include <inkscape_version.h>
+#include <inkscape-version.h>
#include <sp-path.h>
#include <style.h>
#include <display/curve.h>
out("### This PovRay document was generated by Inkscape\n");
out("### http://www.inkscape.org\n");
out("### Created: %s", ctime(&tim));
- out("### Version: %s\n", INKSCAPE_VERSION);
+ out("### Version: %s\n", Inkscape::version_string);
out("#####################################################################\n");
out("### NOTES:\n");
out("### ============\n");
index 19139979ef6e6b41f2b389ba2335a04bd0447c3d..66fee95de61aa85f4cf4fde4ff467ea7f9278016 100644 (file)
--- a/src/helper/unit-menu.cpp
+++ b/src/helper/unit-menu.cpp
#include <gtk/gtkhbox.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkmenuitem.h>
-#include "sp-marshal.h"
+#include "helper/sp-marshal.h"
#include "helper/units.h"
-#include "unit-menu.h"
+#include "helper/unit-menu.h"
#include "widgets/spw-utilities.h"
struct SPUnitSelector {
index e9d6b778af74a065f901f0c91e8606e4f4085cc5..2d433f5ca4075abcff54bb1197bad81d73a135c0 100644 (file)
-#define INKSCAPE_VERSION "0.45+devel"
+#define INKSCAPE_VERSION "0.46+devel"
diff --git a/src/main.cpp b/src/main.cpp
index 89590a5f4a2abfbb9f36318b419d78760e378c78..7bbe691d70f9abc871efc78a27d6141453db6be3 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#include "inkscape-private.h"
#include "inkscape-stock.h"
-#include "inkscape_version.h"
+#include "inkscape-version.h"
#include "sp-namedview.h"
#include "sp-guide.h"
gsize sizeLeft = buffer_size - offset;
gchar *useme = command_line + offset;
- fprintf(stdout, "Inkscape %s interactive shell mode. Type 'quit' to quit.\n", INKSCAPE_VERSION);
+ fprintf(stdout, "Inkscape %s interactive shell mode. Type 'quit' to quit.\n", Inkscape::version_string);
fflush(stdout);
char* linedata = 0;
do {
break;
}
case SP_ARG_VERSION: {
- printf("Inkscape %s (%s)\n", INKSCAPE_VERSION, __DATE__);
+ printf("Inkscape %s (%s)\n", Inkscape::version_string, __DATE__);
exit(0);
break;
}
index 1d17613c67ab191e43816efef916348cdb2ce692..9a40c6bb1cc81de22239d2c2d87624046534300f 100644 (file)
#ifndef SEEN_PREFERENCES_SKELETON_H
#define SEEN_PREFERENCES_SKELETON_H
-#include <inkscape_version.h>
+#include <inkscape-version.h>
+/* The root's "version" attribute describes the preferences file format version.
+ * It should only increase when a backwards-incompatible change is made,
+ * and special handling has to be added to the preferences class to update
+ * obsolete versions the user might have. */
static char const preferences_skeleton[] =
-"<inkscape version=\"" INKSCAPE_VERSION "\"\n"
+"<inkscape version=\"1\"\n"
" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n"
" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\">\n"
" <group id=\"window\">\n"
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index 81d71044d9a8830afb05dbee053826e275069ace..4b584e97b23409d2dbbc0466e5b239b9bd4bb0ac 100644 (file)
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
#include <libnr/nr-translate-scale-ops.h>
#include <xml/repr.h>
#include "svg/stringstream.h"
-#include "inkscape_version.h"
+#include "inkscape-version.h"
class SPDesktop;
@@ -589,7 +589,7 @@ sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML:
if (flags & SP_OBJECT_WRITE_EXT) {
repr->setAttribute("sodipodi:version", SODIPODI_VERSION);
- repr->setAttribute("inkscape:version", INKSCAPE_VERSION);
+ repr->setAttribute("inkscape:version", Inkscape::version_string);
}
repr->setAttribute("version", SVG_VERSION);
index 36b3a5f944367f0c43de731cd037c76d369e947d..c9e9a71259c2091bf53d4aba8edbc7c50ac5f1d1 100644 (file)
#include <stdlib.h>
#include <string.h>
+#include <glib/gprintf.h>
#include "potracelib.h"
-#include <inkscape_version.h>
+#include "inkscape-version.h"
#include "curve.h"
#include "decompose.h"
#include "trace.h"
/* Return a fresh copy of the set of default parameters, or NULL on
failure with errno set. */
potrace_param_t *potrace_param_default(void) {
- potrace_param_t *p;
-
- p = (potrace_param_t *) malloc(sizeof(potrace_param_t));
- if (!p) {
- return NULL;
- }
- memcpy(p, ¶m_default, sizeof(potrace_param_t));
- return p;
+ potrace_param_t *p;
+
+ p = (potrace_param_t *) malloc(sizeof(potrace_param_t));
+ if (!p) {
+ return NULL;
+ }
+ memcpy(p, ¶m_default, sizeof(potrace_param_t));
+ return p;
}
/* On success, returns a Potrace state st with st->status ==
state (with st->status == POTRACE_STATUS_INCOMPLETE). Complete or
incomplete Potrace state can be freed with potrace_state_free(). */
potrace_state_t *potrace_trace(const potrace_param_t *param, const potrace_bitmap_t *bm) {
- int r;
- path_t *plist = NULL;
- potrace_state_t *st;
- progress_t prog;
- progress_t subprog;
-
- /* prepare private progress bar state */
- prog.callback = param->progress.callback;
- prog.data = param->progress.data;
- prog.min = param->progress.min;
- prog.max = param->progress.max;
- prog.epsilon = param->progress.epsilon;
- prog.d_prev = param->progress.min;
-
- /* allocate state object */
- st = (potrace_state_t *)malloc(sizeof(potrace_state_t));
- if (!st) {
- return NULL;
- }
-
- progress_subrange_start(0.0, 0.1, &prog, &subprog);
-
- /* process the image */
- r = bm_to_pathlist(bm, &plist, param, &subprog);
- if (r) {
- free(st);
- return NULL;
- }
-
- st->status = POTRACE_STATUS_OK;
- st->plist = plist;
- st->priv = NULL; /* private state currently unused */
-
- progress_subrange_end(&prog, &subprog);
-
- progress_subrange_start(0.1, 1.0, &prog, &subprog);
-
- /* partial success. */
- r = process_path(plist, param, &subprog);
- if (r) {
- st->status = POTRACE_STATUS_INCOMPLETE;
- }
-
- progress_subrange_end(&prog, &subprog);
-
- return st;
+ int r;
+ path_t *plist = NULL;
+ potrace_state_t *st;
+ progress_t prog;
+ progress_t subprog;
+
+ /* prepare private progress bar state */
+ prog.callback = param->progress.callback;
+ prog.data = param->progress.data;
+ prog.min = param->progress.min;
+ prog.max = param->progress.max;
+ prog.epsilon = param->progress.epsilon;
+ prog.d_prev = param->progress.min;
+
+ /* allocate state object */
+ st = (potrace_state_t *)malloc(sizeof(potrace_state_t));
+ if (!st) {
+ return NULL;
+ }
+
+ progress_subrange_start(0.0, 0.1, &prog, &subprog);
+
+ /* process the image */
+ r = bm_to_pathlist(bm, &plist, param, &subprog);
+ if (r) {
+ free(st);
+ return NULL;
+ }
+
+ st->status = POTRACE_STATUS_OK;
+ st->plist = plist;
+ st->priv = NULL; /* private state currently unused */
+
+ progress_subrange_end(&prog, &subprog);
+
+ progress_subrange_start(0.1, 1.0, &prog, &subprog);
+
+ /* partial success. */
+ r = process_path(plist, param, &subprog);
+ if (r) {
+ st->status = POTRACE_STATUS_INCOMPLETE;
+ }
+
+ progress_subrange_end(&prog, &subprog);
+
+ return st;
}
/* free a Potrace state, without disturbing errno. */
void potrace_state_free(potrace_state_t *st) {
- pathlist_free(st->plist);
- free(st);
+ pathlist_free(st->plist);
+ free(st);
}
/* free a parameter list, without disturbing errno. */
void potrace_param_free(potrace_param_t *p) {
- free(p);
+ free(p);
}
char *potrace_version(void) {
- return "potracelib "INKSCAPE_VERSION"";
+ static char *ver = g_strdup_printf("potracelib %s", Inkscape::version_string);
+ return ver;
}
+
+/*
+ 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 :
index 6c301ef407fce700c032b12438be211f2194076d..1901189464ba8f7aacbcddca20f92d45a8735b01 100644 (file)
ui/dialog/undo-history.cpp \
ui/dialog/undo-history.h \
$(inkboard_dialogs)
-
-ui/dialog/aboutbox.$(OBJEXT): inkscape_version.h
index 261a586b4012422fa76c0a47a468842cb6cffdd9..c418b577143dd176e9fe4b446ec537795582f509 100644 (file)
#include "text-editing.h"
#include "ui/dialog/aboutbox.h"
-#include "inkscape_version.h"
+#include "inkscape-version.h"
Gtk::Label *label=new Gtk::Label();
gchar *label_text =
g_strdup_printf("<small><i>Inkscape %s, built %s</i></small>",
- INKSCAPE_VERSION, __DATE__);
+ Inkscape::version_string, __DATE__);
label->set_markup(label_text);
label->set_alignment(Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER);
g_free(label_text);
SPObject *version = doc->getObjectById("version");
if ( version && SP_IS_TEXT(version) ) {
- sp_te_set_repr_text_multiline (SP_TEXT (version), INKSCAPE_VERSION);
+ sp_te_set_repr_text_multiline (SP_TEXT (version), Inkscape::version_string);
}
sp_document_ensure_up_to_date(doc);
index b2094f540b78589f24008ccb0b5d10a91792f0da..bb2b5d68dd886e8cd9cafd31765a859709d1368d 100644 (file)
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
#include "extension/internal/cairo-render-context.h"
#include "extension/internal/cairo-renderer.h"
#include "ui/widget/rendering-options.h"
+#include "document.h"
#include "unit-constants.h"
#include "helper/png-write.h"
index 9ee9fcdd00573fb0be1715ac1380ceab7b889c6c..008ad4970e72e56333c375f3a54f812396c86275 100644 (file)
#include <cstring>
#include <glibmm/i18n.h>
-#include "../helper/sp-marshal.h"
+#include "helper/sp-marshal.h"
#include "../xml/node-event-vector.h"
#include "sp-xmlview-attr-list.h"
index fbbb049938957ad41e98a9548b37090393cdb3eb..ca787c269f982e34e74cce457dcab88d35b59749 100644 (file)
--- a/src/xml/node-observer.h
+++ b/src/xml/node-observer.h
* no dangling references.
*/
class NodeObserver {
-public:
+protected:
+ /* the constructor is protected to prevent instantiation */
NodeObserver() {}
+public:
virtual ~NodeObserver() {}
/**