Browse Source

Giving an explicit search path to all Persistent types (except for FlexValue), so that loading of resources is more reliable.

David Piuva 3 years ago
parent
commit
3c1b79a3c3

+ 10 - 4
Source/DFPSR/api/guiAPI.cpp

@@ -27,6 +27,7 @@
 #include "guiAPI.h"
 #include "guiAPI.h"
 #include "timeAPI.h"
 #include "timeAPI.h"
 #include "../gui/DsrWindow.h"
 #include "../gui/DsrWindow.h"
+#include "fileAPI.h"
 
 
 using namespace dsr;
 using namespace dsr;
 
 
@@ -58,14 +59,19 @@ bool dsr::component_exists(const Component& component) {
 	return component.get() != nullptr;
 	return component.get() != nullptr;
 }
 }
 
 
+void dsr::window_loadInterfaceFromString(const Window& window, const String& content, const ReadableString &fromPath) {
+	MUST_EXIST(window, window_loadInterfaceFromString);
+	window->loadInterfaceFromString(content, fromPath);
+}
+
 void dsr::window_loadInterfaceFromString(const Window& window, const String& content) {
 void dsr::window_loadInterfaceFromString(const Window& window, const String& content) {
 	MUST_EXIST(window, window_loadInterfaceFromString);
 	MUST_EXIST(window, window_loadInterfaceFromString);
-	window->loadInterfaceFromString(content);
+	window->loadInterfaceFromString(content, file_getCurrentPath());
 }
 }
 
 
 void dsr::window_loadInterfaceFromFile(const Window& window, const ReadableString& filename) {
 void dsr::window_loadInterfaceFromFile(const Window& window, const ReadableString& filename) {
 	MUST_EXIST(window, window_loadInterfaceFromFile);
 	MUST_EXIST(window, window_loadInterfaceFromFile);
-	window->loadInterfaceFromString(string_load(filename));
+	window->loadInterfaceFromString(string_load(filename), file_getRelativeParentFolder(filename));
 }
 }
 
 
 String dsr::window_saveInterfaceToString(const Window& window) {
 String dsr::window_saveInterfaceToString(const Window& window) {
@@ -243,7 +249,7 @@ bool dsr::component_hasProperty(const Component& component, const ReadableString
 	return target != nullptr;
 	return target != nullptr;
 }
 }
 
 
-ReturnCode dsr::component_setProperty(const Component& component, const ReadableString& propertyName, const ReadableString& value, bool mustAssign) {
+ReturnCode dsr::component_setProperty(const Component& component, const ReadableString& propertyName, const ReadableString& value, const ReadableString& fromPath, bool mustAssign) {
 	MUST_EXIST(component, component_setProperty);
 	MUST_EXIST(component, component_setProperty);
 	Persistent* target = component->findAttribute(propertyName);
 	Persistent* target = component->findAttribute(propertyName);
 	if (target == nullptr) {
 	if (target == nullptr) {
@@ -252,7 +258,7 @@ ReturnCode dsr::component_setProperty(const Component& component, const Readable
 		}
 		}
 		return ReturnCode::KeyNotFound;
 		return ReturnCode::KeyNotFound;
 	} else {
 	} else {
-		if (target->assignValue(value)) {
+		if (target->assignValue(value, fromPath)) {
 			component->changedAttribute(propertyName);
 			component->changedAttribute(propertyName);
 			return ReturnCode::Good;
 			return ReturnCode::Good;
 		} else {
 		} else {

+ 10 - 5
Source/DFPSR/api/guiAPI.h

@@ -50,14 +50,19 @@ namespace dsr {
 	bool window_exists(const Window& window);
 	bool window_exists(const Window& window);
 
 
 // Layout files
 // Layout files
-	// Loading an interface by parsing a layout file's content.
-	//   Raises an exception if window doesn't exist.
+	// Loading an interface by parsing a layout file's content, with any external resources loaded relative to fromPath.
+	//   Embedded images do not count as external resources, but file paths need fromPath in order to know from where they will be loaded.
+	// Raises an exception if window doesn't exist.
+	void window_loadInterfaceFromString(const Window& window, const dsr::String& content, const ReadableString &fromPath);
+	// Loading an interface by parsing a layout file's content, with any external resources loaded relative to the current directory.
+	//   Useful when your application has already assigned the current directory, or when all resources are embedded into the layout.
+	// Raises an exception if window doesn't exist.
 	void window_loadInterfaceFromString(const Window& window, const dsr::String& content);
 	void window_loadInterfaceFromString(const Window& window, const dsr::String& content);
 	// Loading an interface by parsing a layout file loaded by filename.
 	// Loading an interface by parsing a layout file loaded by filename.
-	//   Raises an exception if window doesn't exist.
+	// Raises an exception if window doesn't exist.
 	void window_loadInterfaceFromFile(const Window& window, const dsr::ReadableString& filename);
 	void window_loadInterfaceFromFile(const Window& window, const dsr::ReadableString& filename);
 	// Store the interface back into a layout file.
 	// Store the interface back into a layout file.
-	//   Raises an exception if window doesn't exist.
+	// Raises an exception if window doesn't exist.
 	String window_saveInterfaceToString(const Window& window);
 	String window_saveInterfaceToString(const Window& window);
 
 
 // Find a component
 // Find a component
@@ -203,7 +208,7 @@ namespace dsr {
 	//     Returns ReturnCode::KeyNotFound if propertyName wasn't found in component.
 	//     Returns ReturnCode::KeyNotFound if propertyName wasn't found in component.
 	//   Unless mustAssign forces an exception.
 	//   Unless mustAssign forces an exception.
 	//     Returns ReturnCode::ParsingFailure if propertyName was found but value couldn't be converted to its type.
 	//     Returns ReturnCode::ParsingFailure if propertyName was found but value couldn't be converted to its type.
-	ReturnCode component_setProperty(const Component& component, const ReadableString& propertyName, const ReadableString& value, bool mustAssign = true);
+	ReturnCode component_setProperty(const Component& component, const ReadableString& propertyName, const ReadableString& value, const ReadableString& fromPath, bool mustAssign = true);
 	// A version for setting integers and booleans.
 	// A version for setting integers and booleans.
 	//   For integers:
 	//   For integers:
 	//     Just set value to whatever you want assigned directly.
 	//     Just set value to whatever you want assigned directly.

+ 2 - 2
Source/DFPSR/gui/DsrWindow.cpp

@@ -120,9 +120,9 @@ void DsrWindow::resetInterface() {
 	this->applyLayout();
 	this->applyLayout();
 }
 }
 
 
-void DsrWindow::loadInterfaceFromString(String layout) {
+void DsrWindow::loadInterfaceFromString(String layout, const ReadableString &fromPath) {
 	// Load a tree structure of visual components from text
 	// Load a tree structure of visual components from text
-	this->mainPanel = std::dynamic_pointer_cast<VisualComponent>(createPersistentClassFromText(layout));
+	this->mainPanel = std::dynamic_pointer_cast<VisualComponent>(createPersistentClassFromText(layout, fromPath));
 	if (this->mainPanel.get() == nullptr) {
 	if (this->mainPanel.get() == nullptr) {
 		throwError(U"DsrWindow::loadInterfaceFromString: The window's root component could not be created!\n\nLayout:\n", layout, "\n");
 		throwError(U"DsrWindow::loadInterfaceFromString: The window's root component could not be created!\n\nLayout:\n", layout, "\n");
 	}
 	}

+ 1 - 1
Source/DFPSR/gui/DsrWindow.h

@@ -76,7 +76,7 @@ public:
 		// Get the root component that contains all other components in the window
 		// Get the root component that contains all other components in the window
 		std::shared_ptr<VisualComponent> getRootComponent() const;
 		std::shared_ptr<VisualComponent> getRootComponent() const;
 		void resetInterface();
 		void resetInterface();
-		void loadInterfaceFromString(String layout);
+		void loadInterfaceFromString(String layout, const ReadableString &fromPath);
 		String saveInterfaceToString();
 		String saveInterfaceToString();
 
 
 public:
 public:

+ 1 - 1
Source/DFPSR/gui/FlexRegion.cpp

@@ -27,7 +27,7 @@ using namespace dsr;
 
 
 PERSISTENT_DEFINITION(FlexValue)
 PERSISTENT_DEFINITION(FlexValue)
 
 
-bool FlexValue::assignValue(const ReadableString &text) {
+bool FlexValue::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	int perCentIndex = string_findFirst(text, U'%');
 	int perCentIndex = string_findFirst(text, U'%');
 	if (perCentIndex > -1) {
 	if (perCentIndex > -1) {
 		// Explicit %
 		// Explicit %

+ 5 - 5
Source/DFPSR/gui/FlexRegion.h

@@ -41,7 +41,7 @@ public:
 	FlexValue() {}
 	FlexValue() {}
 	FlexValue(int ratio, int offset) : ratio(std::min(std::max(0, ratio), 100)), offset(offset) {}
 	FlexValue(int ratio, int offset) : ratio(std::min(std::max(0, ratio), 100)), offset(offset) {}
 public:
 public:
-	bool assignValue(const ReadableString &text) override;
+	bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 public:
 public:
 	int32_t getRatio() const { return this->ratio; }
 	int32_t getRatio() const { return this->ratio; }
@@ -64,10 +64,10 @@ public:
 	void setTop(const FlexValue &top) { this->sides[1] = top; }
 	void setTop(const FlexValue &top) { this->sides[1] = top; }
 	void setRight(const FlexValue &right) { this->sides[2] = right; }
 	void setRight(const FlexValue &right) { this->sides[2] = right; }
 	void setBottom(const FlexValue &bottom) { this->sides[3] = bottom; }
 	void setBottom(const FlexValue &bottom) { this->sides[3] = bottom; }
-	void setLeft(const ReadableString &left) { this->sides[0] = FlexValue(left); }
-	void setTop(const ReadableString &top) { this->sides[1] = FlexValue(top); }
-	void setRight(const ReadableString &right) { this->sides[2] = FlexValue(right); }
-	void setBottom(const ReadableString &bottom) { this->sides[3] = FlexValue(bottom); }
+	void setLeft(const ReadableString &left) { this->sides[0] = FlexValue(left, U""); }
+	void setTop(const ReadableString &top) { this->sides[1] = FlexValue(top, U""); }
+	void setRight(const ReadableString &right) { this->sides[2] = FlexValue(right, U""); }
+	void setBottom(const ReadableString &bottom) { this->sides[3] = FlexValue(bottom, U""); }
 public:
 public:
 	// Full region
 	// Full region
 	FlexRegion() {
 	FlexRegion() {

+ 1 - 1
Source/DFPSR/gui/VisualTheme.h

@@ -33,7 +33,7 @@ namespace dsr {
 // Create a theme using a virtual machine with functions to call, style settings telling which functions to call with what arguments, and a path to load any non-embedded images from.
 // Create a theme using a virtual machine with functions to call, style settings telling which functions to call with what arguments, and a path to load any non-embedded images from.
 VisualTheme theme_createFromText(const MediaMachine &machine, const ReadableString &styleSettings, const ReadableString &fromPath);
 VisualTheme theme_createFromText(const MediaMachine &machine, const ReadableString &styleSettings, const ReadableString &fromPath);
 // Create a theme using a virtual machine with functions to call, and a path to the style settings to load.
 // Create a theme using a virtual machine with functions to call, and a path to the style settings to load.
-//   Any non-embedded images will be loaded using paths relative to the parent folder of styleFilename;
+//   Any non-embedded images will be loaded relative to styleFilename's folder;
 VisualTheme theme_createFromFile(const MediaMachine &machine, const ReadableString &styleFilename);
 VisualTheme theme_createFromFile(const MediaMachine &machine, const ReadableString &styleFilename);
 // Get a handle to the default theme.
 // Get a handle to the default theme.
 VisualTheme theme_getDefault();
 VisualTheme theme_getDefault();

+ 6 - 6
Source/DFPSR/persistent/ClassFactory.cpp

@@ -73,12 +73,12 @@ std::shared_ptr<Persistent> Persistent::getChild(int index) const {
 	return std::shared_ptr<Persistent>();
 	return std::shared_ptr<Persistent>();
 }
 }
 
 
-void Persistent::setProperty(const ReadableString &key, const ReadableString &value) {
+void Persistent::setProperty(const ReadableString &key, const ReadableString &value, const ReadableString &fromPath) {
 	Persistent* target = this->findAttribute(key);
 	Persistent* target = this->findAttribute(key);
 	if (target == nullptr) {
 	if (target == nullptr) {
 		printText("setProperty: ", key, " in ", this->getClassName(), " could not be found.\n");
 		printText("setProperty: ", key, " in ", this->getClassName(), " could not be found.\n");
 	} else {
 	} else {
-		if (!target->assignValue(value)) {
+		if (!target->assignValue(value, fromPath)) {
 			printText("setProperty: The input ", value, " could not be assigned to property ", key, " because of incorrect format.\n");
 			printText("setProperty: The input ", value, " could not be assigned to property ", key, " because of incorrect format.\n");
 		}
 		}
 	}
 	}
@@ -90,7 +90,7 @@ Persistent* Persistent::findAttribute(const ReadableString &name) {
 
 
 void Persistent::declareAttributes(StructureDefinition &target) const {}
 void Persistent::declareAttributes(StructureDefinition &target) const {}
 
 
-bool Persistent::assignValue(const ReadableString &content) {
+bool Persistent::assignValue(const ReadableString &content, const ReadableString &fromPath) {
 	printText("Warning! assignValue is not implemented for ", this->getClassName(), ".\n");
 	printText("Warning! assignValue is not implemented for ", this->getClassName(), ".\n");
 	return false;
 	return false;
 }
 }
@@ -135,16 +135,16 @@ std::shared_ptr<Persistent> dsr::createPersistentClass(const String &type, bool
 	return std::shared_ptr<Persistent>(); // Null
 	return std::shared_ptr<Persistent>(); // Null
 }
 }
 
 
-std::shared_ptr<Persistent> dsr::createPersistentClassFromText(const ReadableString &text) {
+std::shared_ptr<Persistent> dsr::createPersistentClassFromText(const ReadableString &text, const ReadableString &fromPath) {
 	std::shared_ptr<Persistent> rootObject, newObject;
 	std::shared_ptr<Persistent> rootObject, newObject;
 	List<std::shared_ptr<Persistent>> stack;
 	List<std::shared_ptr<Persistent>> stack;
-	string_split_callback([&rootObject, &newObject, &stack](ReadableString line) {
+	string_split_callback([&rootObject, &newObject, &stack, &fromPath](ReadableString line) {
 		int equalityIndex = string_findFirst(line, '=');
 		int equalityIndex = string_findFirst(line, '=');
 		if (equalityIndex > -1) {
 		if (equalityIndex > -1) {
 			// Assignment
 			// Assignment
 			String key = string_removeOuterWhiteSpace(string_before(line, equalityIndex));
 			String key = string_removeOuterWhiteSpace(string_before(line, equalityIndex));
 			String value = string_removeOuterWhiteSpace(string_after(line, equalityIndex));
 			String value = string_removeOuterWhiteSpace(string_after(line, equalityIndex));
-			stack.last()->setProperty(key, value);
+			stack.last()->setProperty(key, value, fromPath);
 		} else {
 		} else {
 			int colonIndex = string_findFirst(line, ':');
 			int colonIndex = string_findFirst(line, ':');
 			if (colonIndex > -1) {
 			if (colonIndex > -1) {

+ 8 - 6
Source/DFPSR/persistent/ClassFactory.h

@@ -25,6 +25,7 @@
 #define DFPSR_PERSISTENT_CLASSFACTORY
 #define DFPSR_PERSISTENT_CLASSFACTORY
 
 
 #include "../api/stringAPI.h"
 #include "../api/stringAPI.h"
+#include "../api/fileAPI.h"
 #include "../collection/List.h"
 #include "../collection/List.h"
 #include <memory>
 #include <memory>
 
 
@@ -41,7 +42,7 @@ inline std::shared_ptr<Persistent> classConstructor() {
 #define PERSISTENT_DECLARATION(CLASS) \
 #define PERSISTENT_DECLARATION(CLASS) \
 	std::shared_ptr<StructureDefinition> getStructure() const override; \
 	std::shared_ptr<StructureDefinition> getStructure() const override; \
 	decltype(&classConstructor) getConstructor() const override; \
 	decltype(&classConstructor) getConstructor() const override; \
-	explicit CLASS(const ReadableString &content);
+	explicit CLASS(const ReadableString &content, const ReadableString &fromPath);
 
 
 // Must be used in the implementation of each class inheriting from Persistent
 // Must be used in the implementation of each class inheriting from Persistent
 #define PERSISTENT_DEFINITION(CLASS) \
 #define PERSISTENT_DEFINITION(CLASS) \
@@ -53,8 +54,8 @@ inline std::shared_ptr<Persistent> classConstructor() {
 		} \
 		} \
 		return CLASS##Type; \
 		return CLASS##Type; \
 	} \
 	} \
-	CLASS::CLASS(const ReadableString &content) { \
-		this->assignValue(content); \
+	CLASS::CLASS(const ReadableString &content, const ReadableString &fromPath) { \
+		this->assignValue(content, fromPath); \
 	} \
 	} \
 	std::shared_ptr<Persistent> CLASS##Constructor() { \
 	std::shared_ptr<Persistent> CLASS##Constructor() { \
 		return std::dynamic_pointer_cast<Persistent>(std::make_shared<CLASS>()); \
 		return std::dynamic_pointer_cast<Persistent>(std::make_shared<CLASS>()); \
@@ -97,7 +98,7 @@ public:
 	virtual decltype(&classConstructor) getConstructor() const = 0;
 	virtual decltype(&classConstructor) getConstructor() const = 0;
 	// Call from the start of main, to allow constructing the class by name
 	// Call from the start of main, to allow constructing the class by name
 	void registerPersistentClass();
 	void registerPersistentClass();
-	void setProperty(const ReadableString &key, const ReadableString &value);
+	void setProperty(const ReadableString &key, const ReadableString &value, const ReadableString &fromPath);
 	String getClassName() const;
 	String getClassName() const;
 public:
 public:
 	// Override for non-atomic collection types
 	// Override for non-atomic collection types
@@ -122,7 +123,8 @@ public:
 
 
 	// Assign content from a string
 	// Assign content from a string
 	//   Returns true on success and false if no assigment was made
 	//   Returns true on success and false if no assigment was made
-	virtual bool assignValue(const ReadableString &content);
+	virtual bool assignValue(const ReadableString &content, const ReadableString &fromPath);
+	
 	// Save to a stream using any indentation
 	// Save to a stream using any indentation
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
@@ -140,7 +142,7 @@ inline std::ostream& operator<< (std::ostream& out, const Persistent& p) {
 std::shared_ptr<Persistent> createPersistentClass(const String &type, bool mustExist = true);
 std::shared_ptr<Persistent> createPersistentClass(const String &type, bool mustExist = true);
 
 
 // Create a class instance from text
 // Create a class instance from text
-std::shared_ptr<Persistent> createPersistentClassFromText(const ReadableString &text);
+std::shared_ptr<Persistent> createPersistentClassFromText(const ReadableString &text, const ReadableString &fromPath);
 
 
 }
 }
 
 

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentBoolean.cpp

@@ -27,7 +27,7 @@ using namespace dsr;
 
 
 PERSISTENT_DEFINITION(PersistentBoolean)
 PERSISTENT_DEFINITION(PersistentBoolean)
 
 
-bool PersistentBoolean::assignValue(const ReadableString &text) {
+bool PersistentBoolean::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	if (string_match(text, U"1") ) {
 	if (string_match(text, U"1") ) {
 		this->value = true;
 		this->value = true;
 		return true;
 		return true;

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentBoolean.h

@@ -36,7 +36,7 @@ public:
 	PersistentBoolean() : value(0) {}
 	PersistentBoolean() : value(0) {}
 	explicit PersistentBoolean(bool value) : value(value) {}
 	explicit PersistentBoolean(bool value) : value(value) {}
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentColor.cpp

@@ -27,7 +27,7 @@ using namespace dsr;
 
 
 PERSISTENT_DEFINITION(PersistentColor)
 PERSISTENT_DEFINITION(PersistentColor)
 
 
-bool PersistentColor::assignValue(const ReadableString &text) {
+bool PersistentColor::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	this->value = ColorRgbI32(text);
 	this->value = ColorRgbI32(text);
 	return true; // TODO: Discriminate bad input
 	return true; // TODO: Discriminate bad input
 }
 }

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentColor.h

@@ -37,7 +37,7 @@ public:
 	PersistentColor() : value(0, 0, 0) {}
 	PersistentColor() : value(0, 0, 0) {}
 	explicit PersistentColor(ColorRgbI32 color) : value(color) {}
 	explicit PersistentColor(ColorRgbI32 color) : value(color) {}
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 0 - 4
Source/DFPSR/persistent/atomic/PersistentImage.cpp

@@ -91,10 +91,6 @@ bool PersistentImage::assignValue(const ReadableString &text, const ReadableStri
 	return true;
 	return true;
 }
 }
 
 
-bool PersistentImage::assignValue(const ReadableString &text) {
-	return this->assignValue(text, file_getCurrentPath());
-}
-
 static const String hexadecimals = U"0123456789ABCDEF";
 static const String hexadecimals = U"0123456789ABCDEF";
 static void writeHexaDecimal(String &out, uint8_t value) {
 static void writeHexaDecimal(String &out, uint8_t value) {
 	string_appendChar(out, hexadecimals[(value & 0b11110000) >> 4]);
 	string_appendChar(out, hexadecimals[(value & 0b11110000) >> 4]);

+ 1 - 3
Source/DFPSR/persistent/atomic/PersistentImage.h

@@ -38,9 +38,7 @@ public:
 public:
 public:
 	PersistentImage() {}
 	PersistentImage() {}
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
-	// TODO: Let all persistent types know which directory is being used to load resources.
-	bool assignValue(const ReadableString &text, const ReadableString &fromPath);
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentInteger.cpp

@@ -27,7 +27,7 @@ using namespace dsr;
 
 
 PERSISTENT_DEFINITION(PersistentInteger)
 PERSISTENT_DEFINITION(PersistentInteger)
 
 
-bool PersistentInteger::assignValue(const ReadableString &text) {
+bool PersistentInteger::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	if (string_isInteger(text)) {
 	if (string_isInteger(text)) {
 		this->value = string_toInteger(text);
 		this->value = string_toInteger(text);
 		return true;
 		return true;

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentInteger.h

@@ -36,7 +36,7 @@ public:
 	PersistentInteger() : value(0) {}
 	PersistentInteger() : value(0) {}
 	explicit PersistentInteger(int64_t value) : value(value) {}
 	explicit PersistentInteger(int64_t value) : value(value) {}
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentString.cpp

@@ -33,7 +33,7 @@ PersistentString PersistentString::unmangled(const ReadableString &text) {
 	return result;
 	return result;
 }
 }
 
 
-bool PersistentString::assignValue(const ReadableString &text) {
+bool PersistentString::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	this->value = string_unmangleQuote(text);
 	this->value = string_unmangleQuote(text);
 	return true;
 	return true;
 }
 }

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentString.h

@@ -37,7 +37,7 @@ public:
 	// Because the constructor from text is used for serialization, an explicit constructor must be used to avoid mangling
 	// Because the constructor from text is used for serialization, an explicit constructor must be used to avoid mangling
 	static PersistentString unmangled(const ReadableString &text);
 	static PersistentString unmangled(const ReadableString &text);
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentStringList.cpp

@@ -28,7 +28,7 @@ using namespace dsr;
 
 
 PERSISTENT_DEFINITION(PersistentStringList)
 PERSISTENT_DEFINITION(PersistentStringList)
 
 
-bool PersistentStringList::assignValue(const ReadableString &text) {
+bool PersistentStringList::assignValue(const ReadableString &text, const ReadableString &fromPath) {
 	bool quoted = false;
 	bool quoted = false;
 	bool first = true;
 	bool first = true;
 	bool hadComma = false;
 	bool hadComma = false;

+ 1 - 1
Source/DFPSR/persistent/atomic/PersistentStringList.h

@@ -35,7 +35,7 @@ public:
 public:
 public:
 	PersistentStringList() : value() {}
 	PersistentStringList() : value() {}
 public:
 public:
-	virtual bool assignValue(const ReadableString &text) override;
+	virtual bool assignValue(const ReadableString &text, const ReadableString &fromPath) override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 	virtual String& toStreamIndented(String& out, const ReadableString& indentation) const override;
 };
 };
 
 

+ 1 - 1
Source/SDK/guiExample/build_linux.sh

@@ -49,7 +49,7 @@
 		End
 		End
 		Begin : Picture
 		Begin : Picture
 			Name = "linkedPicture"
 			Name = "linkedPicture"
-			Image = File:media/Alien.png
+			Image = File:Alien.png
 			Interpolation = 0
 			Interpolation = 0
 			Left = 10%+200
 			Left = 10%+200
 			Top = 100%-410
 			Top = 100%-410

+ 1 - 1
Source/templates/basicGUI/build_linux.sh

@@ -330,7 +330,7 @@ void dsrMain(List<String> args) {
 	window = window_create(U"DFPSR wizard application", 800, 600);
 	window = window_create(U"DFPSR wizard application", 800, 600);
 
 
 	// Create components using the layout.
 	// Create components using the layout.
-	window_loadInterfaceFromString(window, interfaceContent);
+	window_loadInterfaceFromString(window, interfaceContent, applicationFolder);
 
 
 	// Create a virtual machine with reusable image generating functions.
 	// Create a virtual machine with reusable image generating functions.
 	MediaMachine machine = machine_create(mediaMachineCode);
 	MediaMachine machine = machine_create(mediaMachineCode);