mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
added a runtime disabling of multibyte text support
This commit is contained in:
@@ -39,6 +39,8 @@ changes since wmaker 0.53.0:
|
|||||||
- added WMGetColorPanelColor(WMColorPanel *panel)
|
- added WMGetColorPanelColor(WMColorPanel *panel)
|
||||||
- made WMGetUDStringForKey() to only return a reference to the string, not a
|
- made WMGetUDStringForKey() to only return a reference to the string, not a
|
||||||
wstrdup()'ed copy. DO NOT FREE IT ANYMORE!
|
wstrdup()'ed copy. DO NOT FREE IT ANYMORE!
|
||||||
|
- added MultiByteText option to userdefaults file to control use of multibyte
|
||||||
|
string drawing functions
|
||||||
|
|
||||||
|
|
||||||
changes since wmaker 0.52.0:
|
changes since wmaker 0.52.0:
|
||||||
|
|||||||
@@ -155,13 +155,14 @@ typedef struct W_Screen {
|
|||||||
GC ixorGC; /* IncludeInferiors XOR */
|
GC ixorGC; /* IncludeInferiors XOR */
|
||||||
|
|
||||||
GC textFieldGC;
|
GC textFieldGC;
|
||||||
|
|
||||||
W_Font *normalFont;
|
W_Font *normalFont;
|
||||||
|
|
||||||
W_Font *boldFont;
|
W_Font *boldFont;
|
||||||
|
|
||||||
WMHashTable *fontCache;
|
WMHashTable *fontCache;
|
||||||
|
|
||||||
|
Bool useMultiByte;
|
||||||
|
|
||||||
struct W_Balloon *balloon;
|
struct W_Balloon *balloon;
|
||||||
|
|
||||||
@@ -317,11 +318,11 @@ typedef struct W_View {
|
|||||||
|
|
||||||
typedef struct W_EventHandler {
|
typedef struct W_EventHandler {
|
||||||
unsigned long eventMask;
|
unsigned long eventMask;
|
||||||
|
|
||||||
WMEventProc *proc;
|
WMEventProc *proc;
|
||||||
|
|
||||||
void *clientData;
|
void *clientData;
|
||||||
|
|
||||||
struct W_EventHandler *nextHandler;
|
struct W_EventHandler *nextHandler;
|
||||||
} W_EventHandler;
|
} W_EventHandler;
|
||||||
|
|
||||||
@@ -331,6 +332,7 @@ typedef struct W_EventHandler {
|
|||||||
typedef struct _WINGsConfiguration {
|
typedef struct _WINGsConfiguration {
|
||||||
char *systemFont;
|
char *systemFont;
|
||||||
char *boldSystemFont;
|
char *boldSystemFont;
|
||||||
|
Bool useMultiByte;
|
||||||
unsigned doubleClickDelay;
|
unsigned doubleClickDelay;
|
||||||
} _WINGsConfiguration;
|
} _WINGsConfiguration;
|
||||||
|
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ W_ReadConfigurations(void)
|
|||||||
|
|
||||||
WINGsConfiguration.boldSystemFont =
|
WINGsConfiguration.boldSystemFont =
|
||||||
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
||||||
|
|
||||||
|
WINGsConfiguration.useMultiByte =
|
||||||
|
WMGetUDStringForKey(defaults, "MultiByteText");
|
||||||
|
|
||||||
WINGsConfiguration.doubleClickDelay =
|
WINGsConfiguration.doubleClickDelay =
|
||||||
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WINGsConfiguration.systemFont) {
|
if (!WINGsConfiguration.systemFont) {
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ WMCreateFontInDefaultEncoding(WMScreen *scrPtr, char *fontName)
|
|||||||
|
|
||||||
font->refCount = 1;
|
font->refCount = 1;
|
||||||
|
|
||||||
|
font->name = wstrdup(fontName);
|
||||||
|
|
||||||
assert(WMHashInsert(scrPtr->fontCache, font->name, font)==NULL);
|
assert(WMHashInsert(scrPtr->fontCache, font->name, font)==NULL);
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
@@ -159,13 +161,21 @@ WMSystemFontOfSize(WMScreen *scrPtr, int size)
|
|||||||
|
|
||||||
fontSpec = makeFontSetOfSize(WINGsConfiguration.systemFont, size);
|
fontSpec = makeFontSetOfSize(WINGsConfiguration.systemFont, size);
|
||||||
|
|
||||||
font = WMCreateFont(scrPtr, fontSpec);
|
if (WINGsConfiguration.useMultiByte)
|
||||||
|
font = WMCreateFont(scrPtr, fontSpec);
|
||||||
|
else
|
||||||
|
font = WMCreateFontInDefaultEncoding(scrPtr, fontSpec);
|
||||||
|
|
||||||
if (!font) {
|
if (!font) {
|
||||||
wwarning("could not load font set %s. Trying fixed.", fontSpec);
|
if (WINGsConfiguration.useMultiByte) {
|
||||||
font = WMCreateFont(scrPtr, "fixed");
|
wwarning("could not load font set %s. Trying fixed.", fontSpec);
|
||||||
if (!font) {
|
font = WMCreateFont(scrPtr, "fixed");
|
||||||
font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
|
if (!font) {
|
||||||
|
font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wwarning("could not load font %s. Trying fixed.", fontSpec);
|
||||||
|
font = WMCreateFontInDefaultEncoding(scrPtr, "fixed");
|
||||||
}
|
}
|
||||||
if (!font) {
|
if (!font) {
|
||||||
wwarning("could not load fixed font!");
|
wwarning("could not load fixed font!");
|
||||||
@@ -187,13 +197,21 @@ WMBoldSystemFontOfSize(WMScreen *scrPtr, int size)
|
|||||||
|
|
||||||
fontSpec = makeFontSetOfSize(WINGsConfiguration.boldSystemFont, size);
|
fontSpec = makeFontSetOfSize(WINGsConfiguration.boldSystemFont, size);
|
||||||
|
|
||||||
font = WMCreateFont(scrPtr, fontSpec);
|
if (WINGsConfiguration.useMultiByte)
|
||||||
|
font = WMCreateFont(scrPtr, fontSpec);
|
||||||
|
else
|
||||||
|
font = WMCreateFontInDefaultEncoding(scrPtr, fontSpec);
|
||||||
|
|
||||||
if (!font) {
|
if (!font) {
|
||||||
wwarning("could not load font set %s. Trying fixed.", fontSpec);
|
if (WINGsConfiguration.useMultiByte) {
|
||||||
font = WMCreateFont(scrPtr, "fixed");
|
wwarning("could not load font set %s. Trying fixed.", fontSpec);
|
||||||
if (!font) {
|
font = WMCreateFont(scrPtr, "fixed");
|
||||||
font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
|
if (!font) {
|
||||||
|
font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wwarning("could not load font %s. Trying fixed.", fontSpec);
|
||||||
|
font = WMCreateFontInDefaultEncoding(scrPtr, "fixed");
|
||||||
}
|
}
|
||||||
if (!font) {
|
if (!font) {
|
||||||
wwarning("could not load fixed font!");
|
wwarning("could not load fixed font!");
|
||||||
|
|||||||
@@ -596,6 +596,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
|||||||
|
|
||||||
scrPtr->stipple = stipple;
|
scrPtr->stipple = stipple;
|
||||||
|
|
||||||
|
scrPtr->useMultiByte = WINGsConfiguration.useMultiByte;
|
||||||
|
|
||||||
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
|
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
|
||||||
|
|
||||||
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12);
|
scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ testGradientButtons(WMScreen *scr)
|
|||||||
WMSetButtonAltImage(btn, pix2);
|
WMSetButtonAltImage(btn, pix2);
|
||||||
WMSetButtonText(btn, "Button");
|
WMSetButtonText(btn, "Button");
|
||||||
|
|
||||||
WMSetBalloonTextForView("This is another button", WMWidgetView(btn));
|
WMSetBalloonTextForView("Este é outro balão.", WMWidgetView(btn));
|
||||||
|
|
||||||
btn = WMCreateButton(win, WBTMomentaryChange);
|
btn = WMCreateButton(win, WBTMomentaryChange);
|
||||||
WMResizeWidget(btn, 60, 24);
|
WMResizeWidget(btn, 60, 24);
|
||||||
@@ -486,14 +486,14 @@ int main(int argc, char **argv)
|
|||||||
* Put the testSomething() function you want to test here.
|
* Put the testSomething() function you want to test here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
testGradientButtons(scr);
|
||||||
|
|
||||||
|
|
||||||
testColorWell(scr);
|
|
||||||
#if 0
|
#if 0
|
||||||
|
testColorWell(scr);
|
||||||
|
|
||||||
testTabView(scr);
|
testTabView(scr);
|
||||||
testTextField(scr);
|
testTextField(scr);
|
||||||
testGradientButtons(scr);
|
|
||||||
|
|
||||||
testOpenFilePanel(scr);
|
testOpenFilePanel(scr);
|
||||||
testFontPanel(scr);
|
testFontPanel(scr);
|
||||||
|
|||||||
Reference in New Issue
Block a user