1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

remove libwmfun package.

This commit is contained in:
id
2000-12-03 20:05:28 +00:00
parent 7aadc1ef00
commit d361ee2cc0
2 changed files with 11 additions and 7 deletions

Binary file not shown.

View File

@@ -1,13 +1,14 @@
#include <proplist.h> #include <proplist.h>
#include <WINGs.h> #include <WINGs.h>
#include <WINGsP.h> #include <WINGsP.h>
#ifdef USE_FREETYPE
#include <freetype/freetype.h> #include <freetype/freetype.h>
#endif
#include "generic.h" #include "generic.h"
#define MAX_GLYPHS 256 #define MAX_GLYPHS 256
#define _debug(f...) {fprintf(stderr, "debug: ");fprintf(stderr, ##f);fflush(stderr);} #define _debug(f...) {fprintf(stderr, "debug: ");fprintf(stderr, ##f);fflush(stderr);}
#define _showerr(f...) {fprintf(stderr, ##f);fflush(stderr);}
/* #define _debug(s) printf(s);*/ /* #define _debug(s) printf(s);*/
@@ -16,11 +17,12 @@ static Display *ds_dpy = 0;
static Colormap ds_cmap; static Colormap ds_cmap;
static RContext *rc = 0; static RContext *rc = 0;
RColor black_color = {0, 0, 0, 0};
#ifdef USE_FREETYPE
FT_Library ft_library; FT_Library ft_library;
static int inst_ft_library = 0; static int inst_ft_library = 0;
RColor black_color = {0, 0, 0, 0};
typedef struct __FreeTypeRImage{ typedef struct __FreeTypeRImage{
RImage *image; RImage *image;
int advance_x; int advance_x;
@@ -36,6 +38,7 @@ typedef struct __FreeTypeData{
/* will use this when we have frame window plugin */ /* will use this when we have frame window plugin */
/* char *last_titlestr; */ /* char *last_titlestr; */
} WMFreeTypeData; } WMFreeTypeData;
#endif /* USE_FREETYPE */
int getColor (const char *string, Colormap cmap, XColor *xcolor) { int getColor (const char *string, Colormap cmap, XColor *xcolor) {
if (!XParseColor (ds_dpy, cmap, string, xcolor)) { if (!XParseColor (ds_dpy, cmap, string, xcolor)) {
@@ -138,6 +141,8 @@ drawPlainString (proplist_t pl, Drawable d,
XFreePixmap(ds_dpy, drawbuffer); XFreePixmap(ds_dpy, drawbuffer);
} }
#ifdef USE_FREETYPE
WMFreeTypeRImage *renderChar(FT_Face face, FT_ULong char_index, RColor *color) { WMFreeTypeRImage *renderChar(FT_Face face, FT_ULong char_index, RColor *color) {
FT_GlyphSlot slot; FT_GlyphSlot slot;
FT_Bitmap* bitmap; FT_Bitmap* bitmap;
@@ -328,10 +333,7 @@ drawFreeTypeString (proplist_t pl, Drawable d,
} }
} }
/* flicker!, using buffer should fix. #endif /* USE_FREETYPE */
* parsing color is slow, pl is faster,
* should cache color -- ]d */
/* core */ /* core */
@@ -348,8 +350,10 @@ initDrawString (proplist_t pl, void **init_data) {
_debug("invoke initDrawString: %s\n", PLGetString(PLGetArrayElement(pl, 2))); _debug("invoke initDrawString: %s\n", PLGetString(PLGetArrayElement(pl, 2)));
if (strcmp(PLGetString(PLGetArrayElement(pl, 2)), "drawPlainString") == 0) if (strcmp(PLGetString(PLGetArrayElement(pl, 2)), "drawPlainString") == 0)
initDrawPlainString((Display *)init_data[0], (Colormap)init_data[1]); initDrawPlainString((Display *)init_data[0], (Colormap)init_data[1]);
#ifdef USE_FREETYPE
else if (strcmp(PLGetString(PLGetArrayElement(pl, 2)), "drawFreeTypeString") == 0) else if (strcmp(PLGetString(PLGetArrayElement(pl, 2)), "drawFreeTypeString") == 0)
initDrawFreeTypeString(pl, init_data); initDrawFreeTypeString(pl, init_data);
#endif
_debug("finish initDrawString\n"); _debug("finish initDrawString\n");
} }