Commit 5d29b7b3 authored by Davis King's avatar Davis King

Changed the gui core code around so that it should be safe to make window

objects at the global scope

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402526
parent 82be8506
This diff is collapsed.
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
namespace dlib namespace dlib
{ {
scoped_ptr<default_font> default_font::f;
mutex default_font::m;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
const std::string get_decoded_string_with_default_font_data() const std::string get_decoded_string_with_default_font_data()
......
...@@ -491,13 +491,14 @@ namespace dlib ...@@ -491,13 +491,14 @@ namespace dlib
default_font(default_font&); // copy constructor default_font(default_font&); // copy constructor
default_font& operator=(default_font&); // assignment operator default_font& operator=(default_font&); // assignment operator
static scoped_ptr<default_font> f;
static mutex m;
public: public:
static const font* get_font ( static const font* get_font (
) )
{ {
static mutex m;
static scoped_ptr<default_font> f;
auto_mutex M(m); auto_mutex M(m);
if (f.get() == 0) if (f.get() == 0)
f.reset(new default_font); f.reset(new default_font);
......
...@@ -771,13 +771,13 @@ private: ...@@ -771,13 +771,13 @@ private:
}; };
win w;
int main() int main()
{ {
try try
{ {
win w;
w.set_pos (100,200); w.set_pos (100,200);
w.set_title("test window"); w.set_title("test window");
w.show(); w.show();
......
...@@ -15,7 +15,7 @@ namespace dlib ...@@ -15,7 +15,7 @@ namespace dlib
static const unichar SURROGATE_FIRST_TOP = 0xD800; static const unichar SURROGATE_FIRST_TOP = 0xD800;
static const unichar SURROGATE_SECOND_TOP = 0xDC00; static const unichar SURROGATE_SECOND_TOP = 0xDC00;
static const unichar SURROGATE_CLEARING_MASK = 0x03FF; static const unichar SURROGATE_CLEARING_MASK = 0x03FF;
static const unichar &SURROGATE_TOP = SURROGATE_FIRST_TOP; static const unichar SURROGATE_TOP = SURROGATE_FIRST_TOP;
static const unichar SURROGATE_END = 0xE000; static const unichar SURROGATE_END = 0xE000;
static const unichar SMP_TOP = 0x10000; static const unichar SMP_TOP = 0x10000;
static const int VALID_BITS = 10; static const int VALID_BITS = 10;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment