summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkBitmap.c57
-rw-r--r--generic/tkImgBmap.c8
2 files changed, 6 insertions, 59 deletions
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index c081d24..4658e80 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -235,7 +235,7 @@ Tk_GetBitmap(interp, tkwin, string)
panic("native bitmap creation failed");
}
} else {
- bitmap = TkCreateBitmapFromData(Tk_Display(tkwin),
+ bitmap = XCreateBitmapFromData(Tk_Display(tkwin),
RootWindowOfScreen(nameKey.screen), predefPtr->source,
(unsigned) width, (unsigned) height);
}
@@ -587,59 +587,6 @@ BitmapInit()
/*
*----------------------------------------------------------------------
*
- * TkCreateBitmapFromData --
- *
- * Construct a single plane pixmap from bitmap data. This function
- * is equivelent to the XCreateBitmapFromData funtion - except that
- * it is cross platform.
- *
- * Results:
- * Returns a new Pixmap.
- *
- * Side effects:
- * Allocates a new bitmap and drawable.
- *
- *----------------------------------------------------------------------
- */
-
-Pixmap
-TkCreateBitmapFromData(display, d, data, width, height)
- Display* display;
- Drawable d;
- CONST char* data;
- unsigned int width;
- unsigned int height;
-{
- XImage ximage;
- GC gc;
- Pixmap pix;
-
- pix = Tk_GetPixmap(display, d, width, height, 1);
- gc = XCreateGC(display, pix, 0, NULL);
- if (gc == NULL) {
- return None;
- }
- ximage.height = height;
- ximage.width = width;
- ximage.depth = 1;
- ximage.bits_per_pixel = 1;
- ximage.xoffset = 0;
- ximage.format = XYBitmap;
- ximage.data = (char *)data;
- ximage.byte_order = LSBFirst;
- ximage.bitmap_unit = 8;
- ximage.bitmap_bit_order = LSBFirst;
- ximage.bitmap_pad = 8;
- ximage.bytes_per_line = (width+7)/8;
-
- TkPutImage(NULL, 0, display, pix, gc, &ximage, 0, 0, 0, 0, width, height);
- XFreeGC(display, gc);
- return pix;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkReadBitmapFile --
*
* Loads a bitmap image in X bitmap format into the specified
@@ -675,7 +622,7 @@ TkReadBitmapFile(display, d, filename, width_return, height_return,
return BitmapFileInvalid;
}
- *bitmap_return = TkCreateBitmapFromData(display, d, data, *width_return,
+ *bitmap_return = XCreateBitmapFromData(display, d, data, *width_return,
*height_return);
ckfree(data);
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 03ebd1d..fd14424 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -31,10 +31,10 @@ typedef struct BitmapMaster {
* deleted. */
int width, height; /* Dimensions of image. */
char *data; /* Data comprising bitmap (suitable for
- * input to TkCreateBitmapFromData). May
+ * input to XCreateBitmapFromData). May
* be NULL if no data. Malloc'ed. */
char *maskData; /* Data for bitmap's mask (suitable for
- * input to TkCreateBitmapFromData).
+ * input to XCreateBitmapFromData).
* Malloc'ed. */
Tk_Uid fgUid; /* Value of -foreground option (malloc'ed). */
Tk_Uid bgUid; /* Value of -background option (malloc'ed). */
@@ -375,7 +375,7 @@ ImgBmapConfigureInstance(instancePtr)
instancePtr->bitmap = None;
}
if (masterPtr->data != NULL) {
- instancePtr->bitmap = TkCreateBitmapFromData(
+ instancePtr->bitmap = XCreateBitmapFromData(
Tk_Display(instancePtr->tkwin),
RootWindowOfScreen(Tk_Screen(instancePtr->tkwin)),
masterPtr->data, (unsigned) masterPtr->width,
@@ -387,7 +387,7 @@ ImgBmapConfigureInstance(instancePtr)
instancePtr->mask = None;
}
if (masterPtr->maskData != NULL) {
- instancePtr->mask = TkCreateBitmapFromData(
+ instancePtr->mask = XCreateBitmapFromData(
Tk_Display(instancePtr->tkwin),
RootWindowOfScreen(Tk_Screen(instancePtr->tkwin)),
masterPtr->maskData, (unsigned) masterPtr->width,