]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/drawcontext.cpp
Exception changes
[libs/gui.git] / source / gbase / drawcontext.cpp
index 0f8d44b25539196f69f428ac8497c6fce9a57eb6..03965671306f5f7224f920e9a414abb4a06f126a 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdexcept>
 #ifndef WIN32
 #include <sys/ipc.h>
 #include <sys/shm.h>
@@ -5,12 +6,13 @@
 #include <X11/extensions/XShm.h>
 #include <X11/Xutil.h>
 #endif
-#include <msp/core/except.h>
 #include "display.h"
 #include "drawcontext.h"
 #include "window.h"
 #include "display_priv.h"
 
+using namespace std;
+
 namespace Msp {
 namespace Graphics {
 
@@ -28,7 +30,7 @@ DrawContext::DrawContext(Window &w):
        window(w)
 {
 #ifdef WIN32
-       throw Exception("DrawContext not supported on win32 yet");
+       throw runtime_error("no DrawContext support on windows");
 #else
        priv = new Private;
 
@@ -43,7 +45,7 @@ DrawContext::DrawContext(Window &w):
        {
                priv->image = XShmCreateImage(dpy, wa.visual, wa.depth, ZPixmap, 0, &priv->shminfo, wa.width, wa.height);
                if(!priv->image)
-                       throw Exception("Could not create shared memory XImage");
+                       throw runtime_error("XShmCreateImage");
 
                priv->shminfo.shmid = shmget(IPC_PRIVATE, priv->image->bytes_per_line*priv->image->height, IPC_CREAT|0666);
                priv->shminfo.shmaddr=priv->image->data = reinterpret_cast<char *>(shmat(priv->shminfo.shmid, 0, 0));
@@ -58,7 +60,7 @@ DrawContext::DrawContext(Window &w):
        {
                priv->image = XCreateImage(dpy, wa.visual, wa.depth, ZPixmap, 0, 0, wa.width, wa.height, 8, 0);
                if(!priv->image)
-                       throw Exception("Could not create XImage");
+                       throw runtime_error("XCreateImage");
                priv->image->data = new char[priv->image->bytes_per_line*priv->image->height];
        }
 #endif