mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
The thread safety stuff is only needed for GTK
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@419 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -65,7 +65,7 @@ class LinearBlendImage : public GeneratedImage {
|
|||||||
virtual ImageCombine combine() const;
|
virtual ImageCombine combine() const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
GeneratedImageP image1, image2;
|
GeneratedImageP image1, image2;
|
||||||
double x1, y1, x2, y2;
|
double x1, y1, x2, y2;
|
||||||
@@ -83,7 +83,7 @@ class MaskedBlendImage : public GeneratedImage {
|
|||||||
virtual ImageCombine combine() const;
|
virtual ImageCombine combine() const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
GeneratedImageP light, dark, mask;
|
GeneratedImageP light, dark, mask;
|
||||||
};
|
};
|
||||||
@@ -100,7 +100,7 @@ class CombineBlendImage : public GeneratedImage {
|
|||||||
virtual ImageCombine combine() const;
|
virtual ImageCombine combine() const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
GeneratedImageP image1, image2;
|
GeneratedImageP image1, image2;
|
||||||
ImageCombine image_combine;
|
ImageCombine image_combine;
|
||||||
@@ -118,7 +118,7 @@ class SetMaskImage : public GeneratedImage {
|
|||||||
virtual ImageCombine combine() const;
|
virtual ImageCombine combine() const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
GeneratedImageP image, mask;
|
GeneratedImageP image, mask;
|
||||||
};
|
};
|
||||||
@@ -152,7 +152,7 @@ class PackagedImage : public GeneratedImage {
|
|||||||
virtual Image generate(const Options& opt) const;
|
virtual Image generate(const Options& opt) const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
String filename;
|
String filename;
|
||||||
};
|
};
|
||||||
@@ -168,7 +168,7 @@ class BuiltInImage : public GeneratedImage {
|
|||||||
virtual Image generate(const Options& opt) const;
|
virtual Image generate(const Options& opt) const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return true;}
|
virtual bool threadSafe() const { return true; }
|
||||||
private:
|
private:
|
||||||
String name;
|
String name;
|
||||||
};
|
};
|
||||||
@@ -183,7 +183,11 @@ class SymbolToImage : public GeneratedImage {
|
|||||||
virtual Image generate(const Options& opt) const;
|
virtual Image generate(const Options& opt) const;
|
||||||
virtual bool operator == (const GeneratedImage& that) const;
|
virtual bool operator == (const GeneratedImage& that) const;
|
||||||
|
|
||||||
virtual bool threadSafe() const {return false;}
|
#ifdef __WXGTK__
|
||||||
|
virtual bool threadSafe() const { return false; }
|
||||||
|
#else
|
||||||
|
virtual bool threadSafe() const { return true; }
|
||||||
|
#endif
|
||||||
private:
|
private:
|
||||||
SymbolToImage(const SymbolToImage&); // copy ctor
|
SymbolToImage(const SymbolToImage&); // copy ctor
|
||||||
String filename;
|
String filename;
|
||||||
|
|||||||
@@ -92,13 +92,13 @@ void NewSetWindow::OnOK(wxCommandEvent&) {
|
|||||||
|
|
||||||
void NewSetWindow::done() {
|
void NewSetWindow::done() {
|
||||||
try {
|
try {
|
||||||
StyleSheetP stylesheet = stylesheet_list->getSelection<StyleSheet>();
|
StyleSheetP stylesheet = stylesheet_list->getSelection<StyleSheet>();
|
||||||
set = new_intrusive1<Set>(stylesheet);
|
set = new_intrusive1<Set>(stylesheet);
|
||||||
set->validate();
|
set->validate();
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
} catch (Error& e) {
|
} catch (const Error& e) {
|
||||||
handle_error(e);
|
handle_error(e);
|
||||||
throw; // We want to crash.
|
EndModal(wxID_CANCEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,8 +173,6 @@ SetWindow::~SetWindow() {
|
|||||||
delete find_dialog;
|
delete find_dialog;
|
||||||
// remove from list of set windows
|
// remove from list of set windows
|
||||||
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
||||||
// stop updating
|
|
||||||
onBeforeChangeSet();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Panel managment
|
// ----------------------------------------------------------------------------- : Panel managment
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class ScriptableImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Can this be safely generated from another thread?
|
/// Can this be safely generated from another thread?
|
||||||
bool threadSafe() const {return value != nullptr ? value->threadSafe() : false; }
|
inline bool threadSafe() const { return !value || value->threadSafe(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OptionalScript script; ///< The script, not really optional
|
OptionalScript script; ///< The script, not really optional
|
||||||
|
|||||||
Reference in New Issue
Block a user