diff options
Diffstat (limited to 'Linux_C_12/cpicture_121.c')
-rw-r--r-- | Linux_C_12/cpicture_121.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Linux_C_12/cpicture_121.c b/Linux_C_12/cpicture_121.c index 68f19e5..c430d46 100644 --- a/Linux_C_12/cpicture_121.c +++ b/Linux_C_12/cpicture_121.c @@ -14,6 +14,7 @@ #include "cpicture_121.h"
#include "cCrossCall_121.h"
#include "cCrossCallWindows_121.h"
+#include "Clean.h"
extern void InitGTK();
@@ -1115,12 +1116,12 @@ void WinCreateScreenHDC(OS ios, GdkDrawable **outDraw, OS *oos) *oos = ios;
*outDraw = GDK_DRAWABLE(theWindow);
- printf("WinCreateScreenHDC - %d\n",theWindow);
+ printf("WinCreateScreenHDC - %p\n",theWindow);
} /* WinCreateScreenHDC */
OS WinDestroyScreenHDC (GdkDrawable *drawable, OS os)
{
- printf("WinDestroyScreenHDC - %d\n",drawable);
+ printf("WinDestroyScreenHDC - %p\n",drawable);
/* g_object_unref(drawable); */
return os;
} /* WinDestroyScreenHDC */
@@ -1184,19 +1185,27 @@ void WinDrawBitmap (gint w, gint h, gint destx, gint desty, GdkPixbuf *pixbuf, *oos = ios;
} /* WinDrawBitmap */
-void WinCreateBitmap (gint width, gchar *filename, GdkDrawable *inDraw,OS ios,
+void WinCreateBitmap (CLEAN_STRING data, GdkDrawable *inDraw,OS ios,
GdkPixbuf **bitmap, OS* oos)
{
GError *err = NULL;
+ char* cdata = cstring(data);
printf("WinCreateBitmap\n");
+
+ char* tempfile = "/tmp/bitmapXXXXXX";
+ int tempfh = mkstemp(tempfile);
+ if (tempfh == -1) {
+ printf("Couldn't create temporary file.\n");
+ exit(1);
+ }
+ write(tempfh, cdata, CleanStringLength(data));
+
InitGTK();
- *bitmap = gdk_pixbuf_new_from_file(filename, &err);
+ *bitmap = gdk_pixbuf_new_from_file(tempfile, &err);
- /*
- *pWidth = gdk_pixbuf_get_width(pixbuf);
- *pHeight = gdk_pixbuf_get_height(pixbuf);
- */
+ unlink(tempfile);
+ close(tempfh);
*oos = ios;
} /* WinCreateBitmap */
|