mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
- Added wstrndup() and WMGetFontName()
This commit is contained in:
@@ -49,6 +49,8 @@ Changes since wmaker 0.80.1:
|
||||
most once for each font in a fontset (eliminates a possible security exploit)
|
||||
- Fixed WMGetTextDefaultColor() not to retain the returned color. It returns
|
||||
only a reference to the internal color, which you shouldn't release
|
||||
- Added wstrndup()
|
||||
- Added WMGetFontName()
|
||||
|
||||
|
||||
Changes since wmaker 0.80.0:
|
||||
|
||||
@@ -764,6 +764,8 @@ WMFont* WMRetainFont(WMFont *font);
|
||||
|
||||
void WMReleaseFont(WMFont *font);
|
||||
|
||||
char* WMGetFontName(WMFont *font);
|
||||
|
||||
unsigned int WMFontHeight(WMFont *font);
|
||||
|
||||
Bool WMIsAntialiasedFont(WMFont *font);
|
||||
|
||||
@@ -242,6 +242,7 @@ void wrelease(void *ptr);
|
||||
void* wretain(void *ptr);
|
||||
|
||||
char* wstrdup(char *str);
|
||||
char* wstrndup(char *str, size_t len);
|
||||
|
||||
/* Concatenate str1 with str2 and return that in a newly malloc'ed string.
|
||||
* str1 and str2 can be any strings including static and constant strings.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
build
|
||||
WINGs.c
|
||||
wings.so
|
||||
build
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
1374
WINGs/snprintf.c
1374
WINGs/snprintf.c
File diff suppressed because it is too large
Load Diff
@@ -186,6 +186,21 @@ wstrdup(char *str)
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
wstrndup(char *str, size_t len)
|
||||
{
|
||||
char *copy;
|
||||
|
||||
assert(str!=NULL);
|
||||
|
||||
len = WMIN(len, strlen(str));
|
||||
copy = strncpy(wmalloc(len+1), str, len);
|
||||
copy[len] = 0;
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
wstrconcat(char *str1, char *str2)
|
||||
{
|
||||
|
||||
@@ -529,6 +529,8 @@ WMIsAntialiasingEnabled(WMScreen *scrPtr)
|
||||
Bool
|
||||
WMIsAntialiasedFont(WMFont *font)
|
||||
{
|
||||
wassertrv(font!=NULL, False);
|
||||
|
||||
return font->antialiased;
|
||||
}
|
||||
|
||||
@@ -542,6 +544,15 @@ WMFontHeight(WMFont *font)
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
WMGetFontName(WMFont *font)
|
||||
{
|
||||
wassertrv(font!=NULL, NULL);
|
||||
|
||||
return font->name;
|
||||
}
|
||||
|
||||
|
||||
WMFont*
|
||||
WMDefaultSystemFont(WMScreen *scrPtr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user