diff options
| author | Joshua L. Blocher <verbalshadow@gmail.com> | 2006-04-28 04:05:36 +0000 |
|---|---|---|
| committer | verbalshadow <verbalshadow@users.sourceforge.net> | 2006-04-28 04:05:36 +0000 |
| commit | b4223676db03ef0c5196ea0e2e9cb42d4dfd686e (patch) | |
| tree | ce04de673440e5ffc1955b48dd42768023c33064 /src | |
| parent | Added CREATE v0.1 support for gradients/swatches/patterns (diff) | |
| download | inkscape-b4223676db03ef0c5196ea0e2e9cb42d4dfd686e.tar.gz inkscape-b4223676db03ef0c5196ea0e2e9cb42d4dfd686e.zip | |
Added CREATE v0.1 support for gradients/swatches/patterns
(bzr r601)
Diffstat (limited to 'src')
| -rw-r--r-- | src/helper/stock-items.cpp | 12 | ||||
| -rw-r--r-- | src/io/resource.cpp | 10 | ||||
| -rw-r--r-- | src/io/resource.h | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/helper/stock-items.cpp b/src/helper/stock-items.cpp index ed6d25b74..b531eef96 100644 --- a/src/helper/stock-items.cpp +++ b/src/helper/stock-items.cpp @@ -95,12 +95,18 @@ sp_pattern_load_from_svg(gchar const *name, SPDocument *current_doc) if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { doc = sp_document_new(patterns, FALSE); } + if (!doc) { + gchar *patterns = g_build_filename(CREATE_PATTERNSDIR, "/patterns.svg", NULL); + if (Inkscape::IO::file_test(patterns, G_FILE_TEST_IS_REGULAR)) { + doc = sp_document_new(patterns, FALSE); + } g_free(patterns); if (doc) { sp_document_ensure_up_to_date(doc); } else { edoc = TRUE; } + } } if (!edoc && doc) { /* Get the pattern we want */ @@ -131,12 +137,18 @@ sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc) if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { doc = sp_document_new(gradients, FALSE); } + if (!doc) { + gchar *gradients = g_build_filename(CREATE_GRADIENTSDIR, "/gradients.svg", NULL); + if (Inkscape::IO::file_test(gradients, G_FILE_TEST_IS_REGULAR)) { + doc = sp_document_new(gradients, FALSE); + } g_free(gradients); if (doc) { sp_document_ensure_up_to_date(doc); } else { edoc = TRUE; } + } } if (!edoc && doc) { /* Get the gradient we want */ diff --git a/src/io/resource.cpp b/src/io/resource.cpp index ae9097868..b4dca3233 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -53,6 +53,16 @@ Util::ptr_shared<char> get_path(Domain domain, Type type, char const *filename) } path = g_strdup(temp); } break; + case CREATE: { + gchar const* temp = 0; + switch (type) { + case GRADIENTS: temp = CREATE_GRADIENTSDIR; break; + case PALETTES: temp = CREATE_PALETTESDIR; break; + case PATTERNS: temp = CREATE_PATTERNSDIR; break; + default: g_assert_not_reached(); + } + path = g_strdup(temp); + } break; case USER: { char const *name=NULL; switch (type) { diff --git a/src/io/resource.h b/src/io/resource.h index 948866f1e..0be8ab8e6 100644 --- a/src/io/resource.h +++ b/src/io/resource.h @@ -41,6 +41,7 @@ enum Type { enum Domain { SYSTEM, + CREATE, USER }; |
