1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-26 02:21:27 +02:00

- s/sprintf/snprintf

- updated some po's
- fixed crash bug when removing WINDOWS_MENU or WORKSPACE_MENU from rootmenu
- some other stuff i forgot
This commit is contained in:
kojima
2001-07-23 20:31:32 +00:00
parent 0931e14a5a
commit 882b9a8e1c
61 changed files with 3188 additions and 2346 deletions
+19 -3
View File
@@ -1,13 +1,29 @@
Changes since version 0.65.0:
.............................
- removed FocusFollowMouse from wmaker and WPrefs - removed FocusFollowMouse from wmaker and WPrefs
- fixed problem with alpha images showing a blue tint on big endian machines - fixed problem with alpha images showing a blue tint on big endian machines
- fixed problem with WINGs based apps exiting with a "X_RotateProperties" - fixed problem with WINGs based apps exiting with a "X_RotateProperties"
related error when text was selected in a textfiled (including WPrefs.app related error when text was selected in a textfiled (including WPrefs.app
and Window Maker itself). and Window Maker itself).
- fixed bug with maximization of windows with fixed resize increments
- added None geometry display type
- fixed window enumeration bug
- removed GNUisms from wsetfont (Marcelo E. Magallon <marcelo.magallon@bigfoot.com>, Masahide -mac- NODA <mac@clave.gr.jp>)
- added slovakian translations from (tomka@oalevice.sk)
- added WINGs i18n patch from tomka@oalevice.sk
- fixed wmsetbg.c to work in servers capable of multiple depths (overlay)
- added HMaximizeKey (Ruda Moura <ruda@conectiva.com.br>)
- fixed bad SIGPIPE handling setup across forks (Philippe Troin <phil@fifi.org>)
- added workaround for bug in locale handling on font set creation (Seiichi SATO <sato@cvs-net.co.jp>)
- Fixed some non-portable shell constructs used in installed scripts - Fixed some non-portable shell constructs used in installed scripts
(Johnny C. Lam <lamj@stat.cmu.edu>) (Johnny C. Lam <lamj@stat.cmu.edu>)
- Fixed crash with long titles in the window list menu - Fixed crash with long titles in the window list menu (buffer overflow)
(Alban Hertroys <dalroi@wit401310.student.utwente.nl>) (Alban Hertroys <dalroi@wit401310.student.utwente.nl>, reported by
Robert Marshall <robert@chezmarshall.freeserve.co.uk>)
- Replaced almost all sprintf() calls with snprintf()
- fixed crash when removing menu entry for Window List or Workspace submenu
Changes since version 0.64.0: Changes since version 0.64.0:
............................. .............................
+3
View File
@@ -39,6 +39,9 @@ SUPPORTED PLATFORMS
- IBM S/390 running Linux - IBM S/390 running Linux
- iBook running Darwin - iBook running Darwin
- Windows NT with Cygwin/XFree86 - Windows NT with Cygwin/XFree86
- Sony PlayStation2 running Linux
All registered trademarks are registered by their owners. (duh)
Patches to make it work on other platforms are welcome. Patches to make it work on other platforms are welcome.
+2 -1
View File
@@ -6,7 +6,8 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \ EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \
Install acconfig.h INSTALL.pt README.pt\ Install acconfig.h INSTALL.pt README.pt\
mkpatch README.KDE README.GNOME WindowMaker.lsm.in\ mkpatch README.KDE README.GNOME WindowMaker.lsm.in\
README.definable-cursor README.definable-cursor \
FAQ.I18N.sk INSTALL.sk
# libwmfun-0.0.3.tar.gz # libwmfun-0.0.3.tar.gz
WindowMaker.lsm: WindowMaker.lsm.in WindowMaker.lsm: WindowMaker.lsm.in
+1
View File
@@ -5,6 +5,7 @@ NEWS for veteran Window Maker users
Removed FocusFollowMouse option, only SloppyFocus present now. Removed FocusFollowMouse option, only SloppyFocus present now.
Added None option to MoveDisplay and ResizeDisplay
--- 0.65.0 --- 0.65.0
+1 -1
View File
@@ -1195,7 +1195,7 @@ static void handleResize(W_ViewDelegate *self, WMView *view)
vh = WMIN(size.height, height); vh = WMIN(size.height, height);
W_MoveView(table->tableView, 21, 1+table->headerHeight+1); W_MoveView(table->tableView, 21, 1+table->headerHeight+1);
W_ResizeView(table->tableView, WMAX(vw, 1), WMAX(vh, 1)); W_ResizeView(table->tableView, WMAX(vw, 1), WMAX(vh, 1)+1);
adjustScrollers(table); adjustScrollers(table);
+5 -2
View File
@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = no-dependencies AUTOMAKE_OPTIONS = no-dependencies
SUBDIRS = WINGs . Documentation Resources Examples Extras Tests SUBDIRS = WINGs . po Documentation Resources Examples Extras Tests
@@ -13,7 +13,7 @@ bin_SCRIPTS = get-wings-flags get-wutil-flags
lib_LIBRARIES = libWINGs.a libWUtil.a lib_LIBRARIES = libWINGs.a libWUtil.a
LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@ LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@ @INTLIBS@
EXTRA_DIST = BUGS EXTRA_DIST = BUGS
@@ -50,6 +50,7 @@ libWINGs_a_SOURCES = \
wcolor.c \ wcolor.c \
wcolorpanel.c \ wcolorpanel.c \
wcolorwell.c \ wcolorwell.c \
wconfig.h \
wevent.c \ wevent.c \
wfilepanel.c \ wfilepanel.c \
wframe.c \ wframe.c \
@@ -95,8 +96,10 @@ libWUtil_a_SOURCES = \
userdefaults.c \ userdefaults.c \
usleep.c \ usleep.c \
wapplication.c \ wapplication.c \
wconfig.h \
wutil.c wutil.c
CPPFLAGS = @CPPFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\"
INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
+16 -4
View File
@@ -29,6 +29,7 @@
#include "../src/config.h" #include "../src/config.h"
#include "wconfig.h"
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@@ -351,6 +352,12 @@ getSocketAddress(char* name, char* service, char* protocol) /*FOLD00*/
return &socketaddr; return &socketaddr;
} }
static void
handle_sigpipe(int signum)
{
if (0) signum=0; /* To avoid a gcc warning */
return;
}
static WMConnection* static WMConnection*
createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/ createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
@@ -377,7 +384,12 @@ createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
/* ignore dead pipe */ /* ignore dead pipe */
if (!SigInitialized) { if (!SigInitialized) {
sig_action.sa_handler = SIG_IGN; sig_action.sa_handler = &handle_sigpipe;
/* Because POSIX mandates that only signal with handlers are reset
accross an exec*(), we do not want to propagate ignoring SIGPIPEs
to children. Hence the dummy handler.
Philippe Troin <phil@fifi.org>
*/
sig_action.sa_flags = SA_RESTART; sig_action.sa_flags = SA_RESTART;
sigaction(SIGPIPE, &sig_action, NULL); sigaction(SIGPIPE, &sig_action, NULL);
SigInitialized = True; SigInitialized = True;
@@ -448,7 +460,7 @@ WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /
WCErrorCode = 0; WCErrorCode = 0;
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) { if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination"); wwarning(_("Bad address-service-protocol combination"));
return NULL; return NULL;
} }
@@ -513,7 +525,7 @@ WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*
host = "localhost"; host = "localhost";
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) { if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination"); wwarning(_("Bad address-service-protocol combination"));
return NULL; return NULL;
} }
@@ -556,7 +568,7 @@ WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
host = "localhost"; host = "localhost";
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) { if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination"); wwarning(_("Bad address-service-protocol combination"));
return NULL; return NULL;
} }
+8 -6
View File
@@ -21,6 +21,8 @@
#include "../src/config.h" #include "../src/config.h"
#include "wconfig.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@@ -51,12 +53,12 @@ wstrerror(int errnum)
if (errno < sys_nerr) if (errno < sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
sprintf (buf, "Unknown error %d", errnum); sprintf (buf, _("Unknown error %d"), errnum);
return buf; return buf;
#else /* no strerror() and no sys_errlist[] */ #else /* no strerror() and no sys_errlist[] */
static char buf[] = "Error 12345678901234567890"; static char buf[] = "Error 12345678901234567890";
sprintf(buf, "Error %d", errnum); sprintf(buf, _("Error %d"), errnum);
return buf; return buf;
#endif #endif
} }
@@ -107,7 +109,7 @@ wwarning(const char *msg, ...)
strcat(buf,"\n"); strcat(buf,"\n");
fflush(stdout); fflush(stdout);
fputs(_WINGS_progname, stderr); fputs(_WINGS_progname, stderr);
fputs(" warning: ",stderr); fputs(_(" warning: "),stderr);
fputs(buf, stderr); fputs(buf, stderr);
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
@@ -134,7 +136,7 @@ wfatal(const char *msg, ...)
strcat(buf,"\n"); strcat(buf,"\n");
fflush(stdout); fflush(stdout);
fputs(_WINGS_progname, stderr); fputs(_WINGS_progname, stderr);
fputs(" fatal error: ",stderr); fputs(_(" fatal error: "),stderr);
fputs(buf, stderr); fputs(buf, stderr);
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
@@ -160,7 +162,7 @@ wsyserror(const char *msg, ...)
vsnprintf(buf, MAXLINE-3, msg, args); vsnprintf(buf, MAXLINE-3, msg, args);
fflush(stdout); fflush(stdout);
fputs(_WINGS_progname, stderr); fputs(_WINGS_progname, stderr);
fputs(" error: ", stderr); fputs(_(" error: "), stderr);
fputs(buf, stderr); fputs(buf, stderr);
fputs(": ", stderr); fputs(": ", stderr);
fputs(wstrerror(error), stderr); fputs(wstrerror(error), stderr);
@@ -189,7 +191,7 @@ wsyserrorwithcode(int error, const char *msg, ...)
vsnprintf(buf, MAXLINE-3, msg, args); vsnprintf(buf, MAXLINE-3, msg, args);
fflush(stdout); fflush(stdout);
fputs(_WINGS_progname, stderr); fputs(_WINGS_progname, stderr);
fputs(" error: ", stderr); fputs(_(" error: "), stderr);
fputs(buf, stderr); fputs(buf, stderr);
fputs(": ", stderr); fputs(": ", stderr);
fputs(wstrerror(error), stderr); fputs(wstrerror(error), stderr);
+4 -2
View File
@@ -21,6 +21,8 @@
#include "../src/config.h" #include "../src/config.h"
#include "wconfig.h"
#include "WUtil.h" #include "WUtil.h"
#include <stdlib.h> #include <stdlib.h>
@@ -45,7 +47,7 @@ wgethomedir()
user = getpwuid(getuid()); user = getpwuid(getuid());
if (!user) { if (!user) {
wsyserror("could not get password entry for UID %i", getuid()); wsyserror(_("could not get password entry for UID %i"), getuid());
return "/"; return "/";
} }
if (!user->pw_dir) { if (!user->pw_dir) {
@@ -63,7 +65,7 @@ getuserhomedir(char *username)
user = getpwnam(username); user = getpwnam(username);
if (!user) { if (!user) {
wsyserror("could not get password entry for user %s", username); wsyserror(_("could not get password entry for user %s"), username);
return NULL; return NULL;
} }
if (!user->pw_dir) { if (!user->pw_dir) {
+3 -1
View File
@@ -21,6 +21,8 @@
#include "../src/config.h" #include "../src/config.h"
#include "wconfig.h"
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <netdb.h> #include <netdb.h>
@@ -111,7 +113,7 @@ WMGetCurrentHost()
char name[W_MAXHOSTNAMELEN+1]; char name[W_MAXHOSTNAMELEN+1];
if (gethostname(name, W_MAXHOSTNAMELEN) < 0) { if (gethostname(name, W_MAXHOSTNAMELEN) < 0) {
wsyserror("Cannot get current host name"); wsyserror(_("Cannot get current host name"));
return NULL; return NULL;
} }
+14
View File
@@ -4,6 +4,10 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include "X11/Xlocale.h"
extern void W_InitNotificationCenter(void); extern void W_InitNotificationCenter(void);
@@ -31,6 +35,16 @@ WMInitializeApplication(char *applicationName, int *argc, char **argv)
assert(argv!=NULL); assert(argv!=NULL);
assert(applicationName!=NULL); assert(applicationName!=NULL);
setlocale(LC_ALL, "");
#ifdef I18N
if (getenv("NLSPATH"))
bindtextdomain("WINGs", getenv("NLSPATH"));
else
bindtextdomain("WINGs", LOCALEDIR);
#endif
_WINGS_progname = argv[0]; _WINGS_progname = argv[0];
WMApplication.applicationName = wstrdup(applicationName); WMApplication.applicationName = wstrdup(applicationName);
+6 -4
View File
@@ -1,6 +1,8 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <wraster.h> #include <wraster.h>
#define LIGHT_STIPPLE_WIDTH 4 #define LIGHT_STIPPLE_WIDTH 4
@@ -193,7 +195,7 @@ WMWhiteColor(WMScreen *scr)
if (!scr->white) { if (!scr->white) {
scr->white = WMCreateRGBColor(scr, 0xffff, 0xffff, 0xffff, True); scr->white = WMCreateRGBColor(scr, 0xffff, 0xffff, 0xffff, True);
if (!scr->white->flags.exact) if (!scr->white->flags.exact)
wwarning("could not allocate %s color", "white"); wwarning(_("could not allocate %s color"), _("white"));
} }
return WMRetainColor(scr->white); return WMRetainColor(scr->white);
} }
@@ -206,7 +208,7 @@ WMBlackColor(WMScreen *scr)
if (!scr->black) { if (!scr->black) {
scr->black = WMCreateRGBColor(scr, 0, 0, 0, True); scr->black = WMCreateRGBColor(scr, 0, 0, 0, True);
if (!scr->black->flags.exact) if (!scr->black->flags.exact)
wwarning("could not allocate %s color", "black"); wwarning(_("could not allocate %s color"), _("black"));
} }
return WMRetainColor(scr->black); return WMRetainColor(scr->black);
} }
@@ -245,7 +247,7 @@ WMGrayColor(WMScreen *scr)
} else { } else {
color = WMCreateRGBColor(scr, 0xaeba, 0xaaaa, 0xaeba, True); color = WMCreateRGBColor(scr, 0xaeba, 0xaaaa, 0xaeba, True);
if (!color->flags.exact) if (!color->flags.exact)
wwarning("could not allocate %s color", "gray"); wwarning(_("could not allocate %s color"), _("gray"));
} }
scr->gray = color; scr->gray = color;
} }
@@ -286,7 +288,7 @@ WMDarkGrayColor(WMScreen *scr)
} else { } else {
color = WMCreateRGBColor(scr, 0x5144, 0x5555, 0x5144, True); color = WMCreateRGBColor(scr, 0x5144, 0x5555, 0x5144, True);
if (!color->flags.exact) if (!color->flags.exact)
wwarning("could not allocate %s color", "dark gray"); wwarning(_("could not allocate %s color"), _("dark gray"));
} }
scr->darkGray = color; scr->darkGray = color;
} }
+80 -86
View File
@@ -25,6 +25,7 @@
*/ */
#include "../src/config.h" #include "../src/config.h"
#include "wconfig.h"
#include "WINGsP.h" #include "WINGsP.h"
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
@@ -56,13 +57,6 @@
char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification"; char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification";
/*
* Error Messages
*/
#define NO_MEMORY_ERR "Color Panel: Could not allocate memory"
#define NO_FILE_ERR "Color Panel: Could not find file"
#define X_ERR "Color Panel: X failed request"
/* /*
* Bitmaps for magnifying glass cursor * Bitmaps for magnifying glass cursor
@@ -419,7 +413,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->win = WMCreateWindowWithStyle(scrPtr, name, panel->win = WMCreateWindowWithStyle(scrPtr, name,
WMTitledWindowMask | WMClosableWindowMask | WMResizableWindowMask); WMTitledWindowMask | WMClosableWindowMask | WMResizableWindowMask);
WMResizeWidget(panel->win, PWIDTH, PHEIGHT); WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
WMSetWindowTitle(panel->win, "Colors"); WMSetWindowTitle(panel->win, _("Colors"));
WMSetWindowCloseAction(panel->win, closeWindowCallback, panel); WMSetWindowCloseAction(panel->win, closeWindowCallback, panel);
@@ -609,9 +603,9 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap, W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white),
False, "Brightness", strlen("Brightness")); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->grayBrightnessS, pixmap); WMSetSliderImage(panel->grayBrightnessS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -684,10 +678,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Red", 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Red"),
strlen("Red")); strlen(_("Red")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbRedS, pixmap); WMSetSliderImage(panel->rgbRedS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -717,10 +711,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Green", 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Green"),
strlen("Green")); strlen(_("Green")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbGreenS, pixmap); WMSetSliderImage(panel->rgbGreenS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -751,10 +745,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Blue", 2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Blue"),
strlen("Blue")); strlen(_("Blue")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbBlueS, pixmap); WMSetSliderImage(panel->rgbBlueS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -811,10 +805,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Cyan", 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Cyan"),
strlen("Cyan")); strlen(_("Cyan")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykCyanS, pixmap); WMSetSliderImage(panel->cmykCyanS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -845,10 +839,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Magenta", 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Magenta"),
strlen("Magenta")); strlen(_("Magenta")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykMagentaS, pixmap); WMSetSliderImage(panel->cmykMagentaS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -879,10 +873,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Yellow", 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Yellow"),
strlen("Yellow")); strlen(_("Yellow")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykYellowS, pixmap); WMSetSliderImage(panel->cmykYellowS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -914,10 +908,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Black", 2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Black"),
strlen("Black")); strlen(_("Black")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykBlackS, pixmap); WMSetSliderImage(panel->cmykBlackS, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
@@ -995,7 +989,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->customPaletteHistoryBtn = WMCreatePopUpButton( panel->customPaletteHistoryBtn = WMCreatePopUpButton(
panel->customPaletteFrm); panel->customPaletteFrm);
WMAddPopUpButtonItem(panel->customPaletteHistoryBtn, "Spectrum"); WMAddPopUpButtonItem(panel->customPaletteHistoryBtn, _("Spectrum"));
WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn, WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn,
WMGetPopUpButtonNumberOfItems(panel->customPaletteHistoryBtn)-1); WMGetPopUpButtonNumberOfItems(panel->customPaletteHistoryBtn)-1);
WMSetPopUpButtonAction(panel->customPaletteHistoryBtn, WMSetPopUpButtonAction(panel->customPaletteHistoryBtn,
@@ -1025,17 +1019,17 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->customPaletteMenuBtn = WMCreatePopUpButton(panel->customPaletteFrm); panel->customPaletteMenuBtn = WMCreatePopUpButton(panel->customPaletteFrm);
WMSetPopUpButtonPullsDown(panel->customPaletteMenuBtn, 1); WMSetPopUpButtonPullsDown(panel->customPaletteMenuBtn, 1);
WMSetPopUpButtonText(panel->customPaletteMenuBtn, "Palette"); WMSetPopUpButtonText(panel->customPaletteMenuBtn, _("Palette"));
WMSetPopUpButtonAction(panel->customPaletteMenuBtn, WMSetPopUpButtonAction(panel->customPaletteMenuBtn,
customPaletteMenuCallback, panel); customPaletteMenuCallback, panel);
WMResizeWidget(panel->customPaletteMenuBtn, PWIDTH - 8, 20); WMResizeWidget(panel->customPaletteMenuBtn, PWIDTH - 8, 20);
WMMoveWidget(panel->customPaletteMenuBtn, 0, PHEIGHT - 130); WMMoveWidget(panel->customPaletteMenuBtn, 0, PHEIGHT - 130);
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "New from File..."); WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("New from File..."));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Rename..."); WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Remove"); WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Remove"));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Copy"); WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Copy"));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "New from Clipboard"); WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("New from Clipboard"));
WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRename, 0); WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRename, 0);
WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRemove, 0); WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRemove, 0);
@@ -1056,7 +1050,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
WMMoveWidget(panel->colorListFrm, 5, 80); WMMoveWidget(panel->colorListFrm, 5, 80);
panel->colorListHistoryBtn = WMCreatePopUpButton(panel->colorListFrm); panel->colorListHistoryBtn = WMCreatePopUpButton(panel->colorListFrm);
WMAddPopUpButtonItem(panel->colorListHistoryBtn, "X11-Colors"); WMAddPopUpButtonItem(panel->colorListHistoryBtn, _("X11-Colors"));
WMSetPopUpButtonSelectedItem(panel->colorListHistoryBtn, WMSetPopUpButtonSelectedItem(panel->colorListHistoryBtn,
WMGetPopUpButtonNumberOfItems(panel->colorListHistoryBtn)-1); WMGetPopUpButtonNumberOfItems(panel->colorListHistoryBtn)-1);
/* WMSetPopUpButtonAction(panel->colorListHistoryBtn, /* WMSetPopUpButtonAction(panel->colorListHistoryBtn,
@@ -1073,15 +1067,15 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->colorListColorMenuBtn = WMCreatePopUpButton(panel->colorListFrm); panel->colorListColorMenuBtn = WMCreatePopUpButton(panel->colorListFrm);
WMSetPopUpButtonPullsDown(panel->colorListColorMenuBtn, 1); WMSetPopUpButtonPullsDown(panel->colorListColorMenuBtn, 1);
WMSetPopUpButtonText(panel->colorListColorMenuBtn, "Color"); WMSetPopUpButtonText(panel->colorListColorMenuBtn, _("Color"));
WMSetPopUpButtonAction(panel->colorListColorMenuBtn, WMSetPopUpButtonAction(panel->colorListColorMenuBtn,
colorListColorMenuCallback, panel); colorListColorMenuCallback, panel);
WMResizeWidget(panel->colorListColorMenuBtn, (PWIDTH - 16)/2, 20); WMResizeWidget(panel->colorListColorMenuBtn, (PWIDTH - 16)/2, 20);
WMMoveWidget(panel->colorListColorMenuBtn, 0, PHEIGHT - 130); WMMoveWidget(panel->colorListColorMenuBtn, 0, PHEIGHT - 130);
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Add..."); WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Add..."));
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Rename..."); WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Remove"); WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Remove"));
WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuAdd, 0); WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuAdd, 0);
WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuRename, 0); WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuRename, 0);
@@ -1089,16 +1083,16 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->colorListListMenuBtn = WMCreatePopUpButton(panel->colorListFrm); panel->colorListListMenuBtn = WMCreatePopUpButton(panel->colorListFrm);
WMSetPopUpButtonPullsDown(panel->colorListListMenuBtn, 1); WMSetPopUpButtonPullsDown(panel->colorListListMenuBtn, 1);
WMSetPopUpButtonText(panel->colorListListMenuBtn, "List"); WMSetPopUpButtonText(panel->colorListListMenuBtn, _("List"));
WMSetPopUpButtonAction(panel->colorListListMenuBtn, WMSetPopUpButtonAction(panel->colorListListMenuBtn,
colorListListMenuCallback, panel); colorListListMenuCallback, panel);
WMResizeWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2, 20); WMResizeWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2, 20);
WMMoveWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2 + 8, WMMoveWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2 + 8,
PHEIGHT - 130); PHEIGHT - 130);
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "New..."); WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("New..."));
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "Rename..."); WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "Remove"); WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("Remove"));
WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuAdd, 0); WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuAdd, 0);
WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuRename, 0); WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuRename, 0);
@@ -1235,21 +1229,21 @@ readConfiguration(W_ColorPanel *panel)
if (stat(panel->configurationPath, &stat_buf)!=0) { if (stat(panel->configurationPath, &stat_buf)!=0) {
if (mkdir(panel->configurationPath, if (mkdir(panel->configurationPath,
S_IRWXU|S_IRGRP|S_IROTH|S_IXGRP|S_IXOTH)!=0) { S_IRWXU|S_IRGRP|S_IROTH|S_IXGRP|S_IXOTH)!=0) {
wsyserror("Color Panel: Could not create directory %s needed" wsyserror(_("Color Panel: Could not create directory %s needed"
" to store configurations", panel->configurationPath); " to store configurations"), panel->configurationPath);
WMSetPopUpButtonEnabled(panel->customPaletteMenuBtn, False); WMSetPopUpButtonEnabled(panel->customPaletteMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListColorMenuBtn, False); WMSetPopUpButtonEnabled(panel->colorListColorMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListListMenuBtn, False); WMSetPopUpButtonEnabled(panel->colorListListMenuBtn, False);
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win, WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"File Error", _("File Error"),
"Could not create ColorPanel configuration directory", _("Could not create ColorPanel configuration directory"),
"OK", NULL, NULL); _("OK"), NULL, NULL);
} }
return; return;
} }
if (!(dPtr = opendir(panel->configurationPath))) { if (!(dPtr = opendir(panel->configurationPath))) {
wwarning(NO_FILE_ERR, "%s", panel->configurationPath); wwarning(_("Color Panel: Could not find file"), "%s", panel->configurationPath);
return; return;
} }
@@ -1285,7 +1279,7 @@ readXColors(W_ColorPanel *panel)
WMListItem *item; WMListItem *item;
if (stat(RGBTXT, &stat_buf) != 0) { if (stat(RGBTXT, &stat_buf) != 0) {
wsyserror(NO_FILE_ERR, " %s", RGBTXT); wsyserror(_("Color Panel: Could not find file"), " %s", RGBTXT);
return; return;
} }
else { else {
@@ -1303,7 +1297,7 @@ readXColors(W_ColorPanel *panel)
fclose(rgbtxt); fclose(rgbtxt);
} }
else { else {
wsyserror(NO_FILE_ERR, "%s", RGBTXT); wsyserror(_("Color Panel: Could not find file"), "%s", RGBTXT);
} }
} }
} }
@@ -1490,7 +1484,7 @@ magnifyGetImage(WMScreen *scr, XImage *image, int x, int y, int w, int h)
x - Cursor_x_hot, x - Cursor_x_hot,
y - Cursor_y_hot, y - Cursor_y_hot,
w, h, AllPlanes, ZPixmap))) w, h, AllPlanes, ZPixmap)))
wwarning(X_ERR); wwarning(_("Color Panel: X failed request"));
return image; return image;
} }
@@ -1555,7 +1549,7 @@ magnifyGetImage(WMScreen *scr, XImage *image, int x, int y, int w, int h)
y - Cursor_y_hot + y0, y - Cursor_y_hot + y0,
w0, h0, AllPlanes, ZPixmap, w0, h0, AllPlanes, ZPixmap,
image, x0, y0)) image, x0, y0))
wwarning(X_ERR); wwarning(_("Color Panel: X failed request"));
return NULL; return NULL;
} }
@@ -1619,7 +1613,7 @@ magnifyGetImageStored(WMColorPanel *panel, int x1, int y1, int x2, int y2)
panel->magnifyGlass->dirtyRect = panel->magnifyGlass->dirtyRect =
XSubImage(panel->magnifyGlass->image, xa, ya, width, height); XSubImage(panel->magnifyGlass->image, xa, ya, width, height);
if (!panel->magnifyGlass->dirtyRect) { if (!panel->magnifyGlass->dirtyRect) {
wwarning(X_ERR); wwarning(_("Color Panel: X failed request"));
return; /* X returned a NULL from XSubImage */ return; /* X returned a NULL from XSubImage */
} }
} }
@@ -2168,7 +2162,7 @@ wheelRender(W_ColorPanel *panel)
image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True); image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True);
if (!image) { if (!image) {
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
return; return;
} }
@@ -2828,9 +2822,9 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white),
False, "Brightness", strlen("Brightness")); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbBrightnessS, sliderPxmp); WMSetSliderImage(panel->hsbBrightnessS, sliderPxmp);
WMReleasePixmap(sliderPxmp); WMReleasePixmap(sliderPxmp);
@@ -2864,9 +2858,9 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False, WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False,
"Saturation", strlen("Saturation")); _("Saturation"), strlen(_("Saturation")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbSaturationS, sliderPxmp); WMSetSliderImage(panel->hsbSaturationS, sliderPxmp);
WMReleasePixmap(sliderPxmp); WMReleasePixmap(sliderPxmp);
@@ -2900,9 +2894,9 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False, WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False,
"Hue", strlen("Hue")); _("Hue"), strlen(_("Hue")));
else else
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbHueS, sliderPxmp); WMSetSliderImage(panel->hsbHueS, sliderPxmp);
WMReleasePixmap(sliderPxmp); WMReleasePixmap(sliderPxmp);
@@ -3150,7 +3144,7 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
/* Get a filename */ /* Get a filename */
if (WMRunModalFilePanelForDirectory(browseP, panel->win, spath, if (WMRunModalFilePanelForDirectory(browseP, panel->win, spath,
"Open Palette", RSupportedFileFormats()) ) { _("Open Palette"), RSupportedFileFormats()) ) {
filepath = WMGetFilePanelFileName(browseP); filepath = WMGetFilePanelFileName(browseP);
/* Get seperation position between path and filename */ /* Get seperation position between path and filename */
@@ -3211,13 +3205,13 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
tmp = wstrconcat(panel->configurationPath, filename); tmp = wstrconcat(panel->configurationPath, filename);
i = remove(tmp); /* Delete the file, it doesn't belong here */ i = remove(tmp); /* Delete the file, it doesn't belong here */
WMRunAlertPanel(scr, panel->win, "File Error", WMRunAlertPanel(scr, panel->win, _("File Error"),
"Invalid file format !", "OK", NULL, NULL); _("Invalid file format !"), _("OK"), NULL, NULL);
if (i != 0) { if (i != 0) {
wsyserror("can't remove file %s", tmp); wsyserror(_("can't remove file %s"), tmp);
WMRunAlertPanel(scr, panel->win, "File Error", WMRunAlertPanel(scr, panel->win, _("File Error"),
"Couldn't remove file from Configuration Directory !", _("Couldn't remove file from Configuration Directory !"),
"OK", NULL, NULL); _("OK"), NULL, NULL);
} }
wfree(tmp); wfree(tmp);
} }
@@ -3243,8 +3237,8 @@ customPaletteMenuRename(W_ColorPanel *panel)
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn); item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
fromName = WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item); fromName = WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item);
toName = WMRunInputPanel(scr, panel->win, "Rename", "Rename palette to:", toName = WMRunInputPanel(scr, panel->win, _("Rename"), _("Rename palette to:"),
fromName, "OK", "Cancel"); fromName, _("OK"), _("Cancel"));
if (toName) { if (toName) {
@@ -3260,8 +3254,8 @@ customPaletteMenuRename(W_ColorPanel *panel)
if (access (toPath, F_OK) == 0) { if (access (toPath, F_OK) == 0) {
/* Careful, this palette exists already */ /* Careful, this palette exists already */
if (WMRunAlertPanel(scr, panel->win, "Warning", if (WMRunAlertPanel(scr, panel->win, _("Warning"),
"Palette already exists !\n\nOverwrite ?", "No", "Yes", _("Palette already exists !\n\nOverwrite ?"), _("No"), _("Yes"),
NULL) == 1) { NULL) == 1) {
/* "No" = 0, "Yes" = 1 */ /* "No" = 0, "Yes" = 1 */
int items = WMGetPopUpButtonNumberOfItems( int items = WMGetPopUpButtonNumberOfItems(
@@ -3293,7 +3287,7 @@ customPaletteMenuRename(W_ColorPanel *panel)
} }
if ( rename(fromPath, toPath) != 0) if ( rename(fromPath, toPath) != 0)
wsyserror("Couldn't rename palette %s to %s\n", fromName, toName); wsyserror(_("Couldn't rename palette %s to %s\n"), fromName, toName);
else { else {
WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item); WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);
WMInsertPopUpButtonItem(panel->customPaletteHistoryBtn, item, WMInsertPopUpButtonItem(panel->customPaletteHistoryBtn, item,
@@ -3319,13 +3313,13 @@ customPaletteMenuRemove(W_ColorPanel *panel)
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn); item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
tmp = wstrconcat( "This will permanently remove the palette ", tmp = wstrconcat( _("This will permanently remove the palette "),
WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item )); WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));
text = wstrconcat( tmp, text = wstrconcat( tmp,
".\n\nAre you sure you want to remove this palette ?"); _(".\n\nAre you sure you want to remove this palette ?"));
wfree(tmp); wfree(tmp);
choice = WMRunAlertPanel(scr, panel->win, "Remove", text, "Yes", "No", choice = WMRunAlertPanel(scr, panel->win, _("Remove"), text, _("Yes"), _("No"),
NULL); NULL);
/* returns 0 (= "Yes") or 1 (="No") */ /* returns 0 (= "Yes") or 1 (="No") */
wfree(text); wfree(text);
@@ -3347,7 +3341,7 @@ customPaletteMenuRemove(W_ColorPanel *panel)
WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item); WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);
} else { } else {
wsyserror("Couldn't remove palette %s\n", tmp); wsyserror(_("Couldn't remove palette %s\n"), tmp);
} }
wfree(tmp); wfree(tmp);
@@ -3652,14 +3646,14 @@ fetchFile(char *toPath, char *srcFile, char *destFile)
char buf[BUFSIZE]; char buf[BUFSIZE];
if ((src = open(srcFile, O_RDONLY)) == 0) { if ((src = open(srcFile, O_RDONLY)) == 0) {
wsyserror("Could not open %s", srcFile); wsyserror(_("Could not open %s"), srcFile);
return -1; return -1;
} }
tmp = wstrconcat(toPath, destFile); tmp = wstrconcat(toPath, destFile);
if ((dest = open( tmp, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) if ((dest = open( tmp, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH))
== 0) { == 0) {
wsyserror("Could not create %s", tmp); wsyserror(_("Could not create %s"), tmp);
wfree(tmp); wfree(tmp);
return -1; return -1;
} }
@@ -3670,7 +3664,7 @@ fetchFile(char *toPath, char *srcFile, char *destFile)
while ((n = read(src, buf, BUFSIZE)) > 0) while ((n = read(src, buf, BUFSIZE)) > 0)
{ {
if (write (dest, buf, n) != n) { if (write (dest, buf, n) != n) {
wsyserror("Write error on file %s", destFile); wsyserror(_("Write error on file %s"), destFile);
return -1; return -1;
} }
} }
@@ -3715,7 +3709,7 @@ convertCPColor(CPColor *color)
switch (color->set) { switch (color->set) {
case cpNone: case cpNone:
wwarning("Color Panel: Color unspecified"); wwarning(_("Color Panel: Color unspecified"));
return; return;
case cpRGB: case cpRGB:
old_hue = color->hsv.hue; old_hue = color->hsv.hue;
@@ -3750,7 +3744,7 @@ ulongToRColor(WMScreen *scr, unsigned long value)
XColor *xcolor = NULL; XColor *xcolor = NULL;
if (!(xcolor = wmalloc(sizeof(XColor)) )) { if (!(xcolor = wmalloc(sizeof(XColor)) )) {
wwarning(NO_MEMORY_ERR); wwarning(_("Color Panel: Could not allocate memory"));
color.red = 0; color.red = 0;
color.green = 0; color.green = 0;
color.blue = 0; color.blue = 0;
+44 -41
View File
@@ -1,5 +1,6 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -231,7 +232,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->nameLabel = WMCreateLabel(fPtr->win); fPtr->nameLabel = WMCreateLabel(fPtr->win);
WMMoveWidget(fPtr->nameLabel, 7, 282); WMMoveWidget(fPtr->nameLabel, 7, 282);
WMResizeWidget(fPtr->nameLabel, 55, 14); WMResizeWidget(fPtr->nameLabel, 55, 14);
WMSetLabelText(fPtr->nameLabel, "Name:"); WMSetLabelText(fPtr->nameLabel, _("Name:"));
fPtr->fileField = WMCreateTextField(fPtr->win); fPtr->fileField = WMCreateTextField(fPtr->win);
WMMoveWidget(fPtr->fileField, 60, 278); WMMoveWidget(fPtr->fileField, 60, 278);
@@ -246,7 +247,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->okButton = WMCreateCommandButton(fPtr->win); fPtr->okButton = WMCreateCommandButton(fPtr->win);
WMMoveWidget(fPtr->okButton, 245, 325); WMMoveWidget(fPtr->okButton, 245, 325);
WMResizeWidget(fPtr->okButton, 75, 28); WMResizeWidget(fPtr->okButton, 75, 28);
WMSetButtonText(fPtr->okButton, "OK"); WMSetButtonText(fPtr->okButton, _("OK"));
WMSetButtonImage(fPtr->okButton, scrPtr->buttonArrow); WMSetButtonImage(fPtr->okButton, scrPtr->buttonArrow);
WMSetButtonAltImage(fPtr->okButton, scrPtr->pushedButtonArrow); WMSetButtonAltImage(fPtr->okButton, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(fPtr->okButton, WIPRight); WMSetButtonImagePosition(fPtr->okButton, WIPRight);
@@ -255,7 +256,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->cancelButton = WMCreateCommandButton(fPtr->win); fPtr->cancelButton = WMCreateCommandButton(fPtr->win);
WMMoveWidget(fPtr->cancelButton, 165, 325); WMMoveWidget(fPtr->cancelButton, 165, 325);
WMResizeWidget(fPtr->cancelButton, 75, 28); WMResizeWidget(fPtr->cancelButton, 75, 28);
WMSetButtonText(fPtr->cancelButton, "Cancel"); WMSetButtonText(fPtr->cancelButton, _("Cancel"));
WMSetButtonAction(fPtr->cancelButton, buttonClick, fPtr); WMSetButtonAction(fPtr->cancelButton, buttonClick, fPtr);
fPtr->trashcanButton = WMCreateCommandButton(fPtr->win); fPtr->trashcanButton = WMCreateCommandButton(fPtr->win);
@@ -328,7 +329,7 @@ WMGetOpenPanel(WMScreen *scrPtr)
if (scrPtr->sharedOpenPanel) if (scrPtr->sharedOpenPanel)
return scrPtr->sharedOpenPanel; return scrPtr->sharedOpenPanel;
panel = makeFilePanel(scrPtr, "openFilePanel", "Open"); panel = makeFilePanel(scrPtr, "openFilePanel", _("Open"));
panel->flags.fileMustExist = 1; panel->flags.fileMustExist = 1;
panel->flags.panelType = WP_OPEN; panel->flags.panelType = WP_OPEN;
@@ -346,7 +347,7 @@ WMGetSavePanel(WMScreen *scrPtr)
if (scrPtr->sharedSavePanel) if (scrPtr->sharedSavePanel)
return scrPtr->sharedSavePanel; return scrPtr->sharedSavePanel;
panel = makeFilePanel(scrPtr, "saveFilePanel", "Save"); panel = makeFilePanel(scrPtr, "saveFilePanel", _("Save"));
panel->flags.fileMustExist = 0; panel->flags.fileMustExist = 0;
panel->flags.panelType = WP_SAVE; panel->flags.panelType = WP_SAVE;
@@ -392,13 +393,13 @@ WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
panel->flags.filtered = 1; panel->flags.filtered = 1;
panel->fileTypes = fileTypes; panel->fileTypes = fileTypes;
if (name == NULL) if (name == NULL)
name = "Open"; name = _("Open");
break; break;
case WP_SAVE: case WP_SAVE:
panel->fileTypes = NULL; panel->fileTypes = NULL;
panel->flags.filtered = 0; panel->flags.filtered = 0;
if (name == NULL) if (name == NULL)
name = "Save"; name = _("Save");
break; break;
default: default:
break; break;
@@ -558,7 +559,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
if (!dir) { if (!dir) {
#ifdef VERBOSE #ifdef VERBOSE
printf("WINGs: could not open directory %s\n", path); printf(_("WINGs: could not open directory %s\n"), path);
#endif #endif
return; return;
} }
@@ -576,7 +577,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
if (stat(pbuf, &stat_buf)!=0) { if (stat(pbuf, &stat_buf)!=0) {
#ifdef VERBOSE #ifdef VERBOSE
printf("WINGs: could not stat %s\n", pbuf); printf(_("WINGs: could not stat %s\n"), pbuf);
#endif #endif
continue; continue;
} else { } else {
@@ -643,7 +644,7 @@ showError(WMScreen *scr, WMWindow *owner, char *s, char *file)
} else { } else {
errStr = wstrdup(s); errStr = wstrdup(s);
} }
WMRunAlertPanel(scr, owner, "Error", errStr, "OK", NULL, NULL); WMRunAlertPanel(scr, owner, _("Error"), errStr, _("OK"), NULL, NULL);
wfree(errStr); wfree(errStr);
} }
@@ -654,8 +655,8 @@ createDir(WMButton *bPre, WMFilePanel *panel)
char *dirName, *directory, *file, *s; char *dirName, *directory, *file, *s;
WMScreen *scr = WMWidgetScreen(panel->win); WMScreen *scr = WMWidgetScreen(panel->win);
dirName = WMRunInputPanel(scr, panel->win, "Create Directory", dirName = WMRunInputPanel(scr, panel->win, _("Create Directory"),
"Enter directory name", "", "OK", "Cancel"); _("Enter directory name"), "", _("OK"), _("Cancel"));
if (!dirName) if (!dirName)
return; return;
@@ -680,7 +681,7 @@ createDir(WMButton *bPre, WMFilePanel *panel)
} }
if ((s = strrchr(dirName, '/')) && !s[1]) s[0] = 0; if ((s = strrchr(dirName, '/')) && !s[1]) s[0] = 0;
file = wmalloc(strlen(dirName)+strlen(directory)+1); file = wmalloc(strlen(dirName)+strlen(directory)+4);
sprintf(file, "%s/%s", directory, dirName); sprintf(file, "%s/%s", directory, dirName);
while ((s = strstr(file,"//"))) { while ((s = strstr(file,"//"))) {
int i; int i;
@@ -691,13 +692,13 @@ createDir(WMButton *bPre, WMFilePanel *panel)
if (mkdir(file,0xfff) != 0) { if (mkdir(file,0xfff) != 0) {
switch (errno) { switch (errno) {
case EACCES: case EACCES:
showError(scr, panel->win, "Permission denied.", NULL); showError(scr, panel->win, _("Permission denied."), NULL);
break; break;
case EEXIST: case EEXIST:
showError(scr, panel->win, "'%s' already existes.", file); showError(scr, panel->win, _("'%s' already exists."), file);
break; break;
case ENOENT: case ENOENT:
showError(scr, panel->win, "Path does not exist.", NULL); showError(scr, panel->win, _("Path does not exist."), NULL);
} }
} }
else WMSetFilePanelDirectory(panel, file); else WMSetFilePanelDirectory(panel, file);
@@ -727,51 +728,53 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
if (stat(file,&filestat)) { if (stat(file,&filestat)) {
switch (errno) { switch (errno) {
case ENOENT: case ENOENT:
showError(scr, panel->win, "'%s' does not exist.", file); showError(scr, panel->win, _("'%s' does not exist."), file);
break; break;
case EACCES: case EACCES:
showError(scr, panel->win, "Permission denied.", NULL); showError(scr, panel->win, _("Permission denied."), NULL);
break; break;
case ENOMEM: case ENOMEM:
showError(scr, panel->win, showError(scr, panel->win,
"Insufficient memory available.", NULL); _("Insufficient memory available."), NULL);
break; break;
case EROFS: case EROFS:
showError(scr, panel->win, showError(scr, panel->win,
"'%s' is on a read-only filesystem.", file); _("'%s' is on a read-only filesystem."), file);
break; break;
default: default:
showError(scr, panel->win, "Can not delete '%s'.", file); showError(scr, panel->win, _("Can not delete '%s'."), file);
} }
wfree(file); wfree(file);
return; return;
} else if (S_ISDIR(filestat.st_mode)) { } else if (S_ISDIR(filestat.st_mode)) {
buffer = wmalloc(strlen(file)+20); int len = strlen(file)+20;
sprintf(buffer,"Delete directory %s ?",file); buffer = wmalloc(len);
snprintf(buffer,len,_("Delete directory %s ?"),file);
} else { } else {
buffer = wmalloc(strlen(file)+15); int len = strlen(file)+15;
sprintf(buffer,"Delete file %s ?",file); buffer = wmalloc(len);
snprintf(buffer,len,_("Delete file %s ?"),file);
} }
if (!WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win, if (!WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"Warning", buffer, "OK", "Cancel", NULL)) { _("Warning"), buffer, _("OK"), _("Cancel"), NULL)) {
if (S_ISDIR(filestat.st_mode)) { if (S_ISDIR(filestat.st_mode)) {
if (rmdir(file) != 0) { if (rmdir(file) != 0) {
switch (errno) { switch (errno) {
case EACCES: case EACCES:
showError(scr, panel->win, "Permission denied.", NULL); showError(scr, panel->win, _("Permission denied."), NULL);
break; break;
case ENOENT: case ENOENT:
showError(scr, panel->win, "Directory '%s' does not exist.", file); showError(scr, panel->win, _("Directory '%s' does not exist."), file);
break; break;
case ENOTEMPTY: case ENOTEMPTY:
showError(scr, panel->win, "Directory '%s' is not empty.", file); showError(scr, panel->win, _("Directory '%s' is not empty."), file);
break; break;
case EBUSY: case EBUSY:
showError(scr, panel->win, "Directory '%s' is busy.", file); showError(scr, panel->win, _("Directory '%s' is busy."), file);
break; break;
default: default:
showError(scr, panel->win, "Can not delete '%s'.", file); showError(scr, panel->win, _("Can not delete '%s'."), file);
} }
} else { } else {
char *s = strrchr(file,'/'); char *s = strrchr(file,'/');
@@ -781,24 +784,24 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
} else if (remove(file) != 0) { } else if (remove(file) != 0) {
switch (errno) { switch (errno) {
case EISDIR: case EISDIR:
showError(scr, panel->win, "'%s' is a directory.", file); showError(scr, panel->win, _("'%s' is a directory."), file);
break; break;
case ENOENT: case ENOENT:
showError(scr, panel->win, "'%s' does not exist.", file); showError(scr, panel->win, _("'%s' does not exist."), file);
break; break;
case EACCES: case EACCES:
showError(scr, panel->win, "Permission denied.", NULL); showError(scr, panel->win, _("Permission denied."), NULL);
break; break;
case ENOMEM: case ENOMEM:
showError(scr, panel->win, showError(scr, panel->win,
"Insufficient memory available.", NULL); _("Insufficient memory available."), NULL);
break; break;
case EROFS: case EROFS:
showError(scr, panel->win, showError(scr, panel->win,
"'%s' is on a read-only filesystem.", file); _("'%s' is on a read-only filesystem."), file);
break; break;
default: default:
showError(scr, panel->win, "Can not delete '%s'.", file); showError(scr, panel->win, _("Can not delete '%s'."), file);
} }
} else { } else {
char *s = strrchr(file,'/'); char *s = strrchr(file,'/');
@@ -823,11 +826,11 @@ goFloppy(WMButton *bPtr, WMFilePanel *panel)
WMScreen *scr = WMWidgetScreen(panel->win); WMScreen *scr = WMWidgetScreen(panel->win);
if (stat(WINGsConfiguration.floppyPath, &filestat)) { if (stat(WINGsConfiguration.floppyPath, &filestat)) {
showError(scr, panel->win, "An error occured browsing '%s'.", showError(scr, panel->win, _("An error occured browsing '%s'."),
WINGsConfiguration.floppyPath); WINGsConfiguration.floppyPath);
return; return;
} else if (!S_ISDIR(filestat.st_mode)) { } else if (!S_ISDIR(filestat.st_mode)) {
showError(scr, panel->win, "'%s' is not a directory.", showError(scr, panel->win, _("'%s' is not a directory."),
WINGsConfiguration.floppyPath); WINGsConfiguration.floppyPath);
return; return;
} }
@@ -964,8 +967,8 @@ buttonClick(WMButton *bPtr, WMFilePanel *panel)
file = getCurrentFileName(panel); file = getCurrentFileName(panel);
if (access(file, F_OK)!=0) { if (access(file, F_OK)!=0) {
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win, WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"Error", "File does not exist.", _("Error"), _("File does not exist."),
"Ok", NULL, NULL); _("OK"), NULL, NULL);
wfree(file); wfree(file);
return; return;
} }
+12 -12
View File
@@ -1,5 +1,6 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <wraster.h> #include <wraster.h>
@@ -70,11 +71,10 @@ W_CreateFontSetWithGuess(Display *dpy, char *xlfd, char ***missing,
/* for non-iso8859-1 language and iso8859-1 specification /* for non-iso8859-1 language and iso8859-1 specification
(this fontset is only for pattern analysis) */ (this fontset is only for pattern analysis) */
if (fs == NULL) { if (fs == NULL) {
char *old_locale = setlocale(LC_CTYPE, NULL);
if (*nmissing != 0) XFreeStringList(*missing); if (*nmissing != 0) XFreeStringList(*missing);
setlocale(LC_CTYPE, "C"); setlocale(LC_CTYPE, "C");
fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string); fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string);
setlocale(LC_CTYPE, old_locale); setlocale(LC_CTYPE, "");
} }
/* make XLFD font name for pattern analysis */ /* make XLFD font name for pattern analysis */
@@ -88,7 +88,7 @@ W_CreateFontSetWithGuess(Display *dpy, char *xlfd, char ***missing,
xlfd = generalize_xlfd (xlfd); xlfd = generalize_xlfd (xlfd);
if (*nmissing != 0) XFreeStringList(*missing); if (*nmissing != 0) XFreeStringList(*missing);
if (fs != 0) XFreeFontSet(dpy, fs); if (fs != NULL) XFreeFontSet(dpy, fs);
fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string); fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string);
@@ -126,14 +126,14 @@ WMCreateFontSet(WMScreen *scrPtr, char *fontName)
if (nmissing > 0 && font->font.set) { if (nmissing > 0 && font->font.set) {
int i; int i;
wwarning("the following character sets are missing in %s:", wwarning(_("the following character sets are missing in %s:"),
fontName); fontName);
for (i = 0; i < nmissing; i++) { for (i = 0; i < nmissing; i++) {
wwarning(missing[i]); wwarning(missing[i]);
} }
XFreeStringList(missing); XFreeStringList(missing);
if (defaultString) if (defaultString)
wwarning("the string \"%s\" will be used in place of any characters from those sets.", wwarning(_("the string \"%s\" will be used in place of any characters from those sets."),
defaultString); defaultString);
} }
if (!font->font.set) { if (!font->font.set) {
@@ -279,17 +279,17 @@ WMSystemFontOfSize(WMScreen *scrPtr, int size)
if (!font) { if (!font) {
if (scrPtr->useMultiByte) { if (scrPtr->useMultiByte) {
wwarning("could not load font set %s. Trying fixed.", fontSpec); wwarning(_("could not load font set %s. Trying fixed."), fontSpec);
font = WMCreateFontSet(scrPtr, "fixed"); font = WMCreateFontSet(scrPtr, "fixed");
if (!font) { if (!font) {
font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
} }
} else { } else {
wwarning("could not load font %s. Trying fixed.", fontSpec); wwarning(_("could not load font %s. Trying fixed."), fontSpec);
font = WMCreateNormalFont(scrPtr, "fixed"); font = WMCreateNormalFont(scrPtr, "fixed");
} }
if (!font) { if (!font) {
wwarning("could not load fixed font!"); wwarning(_("could not load fixed font!"));
wfree(fontSpec); wfree(fontSpec);
return NULL; return NULL;
} }
@@ -315,17 +315,17 @@ WMBoldSystemFontOfSize(WMScreen *scrPtr, int size)
if (!font) { if (!font) {
if (scrPtr->useMultiByte) { if (scrPtr->useMultiByte) {
wwarning("could not load font set %s. Trying fixed.", fontSpec); wwarning(_("could not load font set %s. Trying fixed."), fontSpec);
font = WMCreateFontSet(scrPtr, "fixed"); font = WMCreateFontSet(scrPtr, "fixed");
if (!font) { if (!font) {
font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
} }
} else { } else {
wwarning("could not load font %s. Trying fixed.", fontSpec); wwarning(_("could not load font %s. Trying fixed."), fontSpec);
font = WMCreateNormalFont(scrPtr, "fixed"); font = WMCreateNormalFont(scrPtr, "fixed");
} }
if (!font) { if (!font) {
wwarning("could not load fixed font!"); wwarning(_("could not load fixed font!"));
wfree(fontSpec); wfree(fontSpec);
return NULL; return NULL;
} }
@@ -420,7 +420,7 @@ makeFontSetOfSize(char *fontset, int size)
int count = ptr-fontset; int count = ptr-fontset;
if (count > 255) { if (count > 255) {
wwarning("font description %s is too large.", fontset); wwarning(_("font description %s is too large."), fontset);
} else { } else {
memcpy(font, fontset, count); memcpy(font, fontset, count);
font[count] = 0; font[count] = 0;
+23 -22
View File
@@ -4,6 +4,7 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "WUtil.h" #include "WUtil.h"
#include "wconfig.h"
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
@@ -70,7 +71,7 @@ static int scalableFontSizes[] = {
static void getSelectedFont(FontPanel *panel, char buffer[]); static void getSelectedFont(FontPanel *panel, char buffer[], int bufsize);
static void arrangeLowerFrame(FontPanel *panel); static void arrangeLowerFrame(FontPanel *panel);
@@ -201,13 +202,13 @@ WMGetFontPanel(WMScreen *scr)
panel->sampleT = WMCreateTextField(panel->upperF); panel->sampleT = WMCreateTextField(panel->upperF);
WMResizeWidget(panel->sampleT, DEF_WIDTH - 20, 50); WMResizeWidget(panel->sampleT, DEF_WIDTH - 20, 50);
WMMoveWidget(panel->sampleT, 10, 10); WMMoveWidget(panel->sampleT, 10, 10);
WMSetTextFieldText(panel->sampleT, "Test!!!"); WMSetTextFieldText(panel->sampleT, _("Test!!!"));
font = WMBoldSystemFontOfSize(scr, 12); font = WMBoldSystemFontOfSize(scr, 12);
panel->famL = WMCreateLabel(panel->lowerF); panel->famL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->famL, dark); WMSetWidgetBackgroundColor(panel->famL, dark);
WMSetLabelText(panel->famL, "Family"); WMSetLabelText(panel->famL, _("Family"));
WMSetLabelFont(panel->famL, font); WMSetLabelFont(panel->famL, font);
WMSetLabelTextColor(panel->famL, white); WMSetLabelTextColor(panel->famL, white);
WMSetLabelRelief(panel->famL, WRSunken); WMSetLabelRelief(panel->famL, WRSunken);
@@ -218,7 +219,7 @@ WMGetFontPanel(WMScreen *scr)
panel->typL = WMCreateLabel(panel->lowerF); panel->typL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->typL, dark); WMSetWidgetBackgroundColor(panel->typL, dark);
WMSetLabelText(panel->typL, "Typeface"); WMSetLabelText(panel->typL, _("Typeface"));
WMSetLabelFont(panel->typL, font); WMSetLabelFont(panel->typL, font);
WMSetLabelTextColor(panel->typL, white); WMSetLabelTextColor(panel->typL, white);
WMSetLabelRelief(panel->typL, WRSunken); WMSetLabelRelief(panel->typL, WRSunken);
@@ -229,7 +230,7 @@ WMGetFontPanel(WMScreen *scr)
panel->sizL = WMCreateLabel(panel->lowerF); panel->sizL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->sizL, dark); WMSetWidgetBackgroundColor(panel->sizL, dark);
WMSetLabelText(panel->sizL, "Size"); WMSetLabelText(panel->sizL, _("Size"));
WMSetLabelFont(panel->sizL, font); WMSetLabelFont(panel->sizL, font);
WMSetLabelTextColor(panel->sizL, white); WMSetLabelTextColor(panel->sizL, white);
WMSetLabelRelief(panel->sizL, WRSunken); WMSetLabelRelief(panel->sizL, WRSunken);
@@ -248,12 +249,12 @@ WMGetFontPanel(WMScreen *scr)
panel->setB = WMCreateCommandButton(panel->win); panel->setB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->setB, 70, 24); WMResizeWidget(panel->setB, 70, 24);
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5)); WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->setB, "Set"); WMSetButtonText(panel->setB, _("Set"));
panel->revertB = WMCreateCommandButton(panel->win); panel->revertB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->revertB, 70, 24); WMResizeWidget(panel->revertB, 70, 24);
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5)); WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->revertB, "Revert"); WMSetButtonText(panel->revertB, _("Revert"));
WMRealizeWidget(panel->win); WMRealizeWidget(panel->win);
@@ -340,9 +341,9 @@ WMGetFontPanelFont(WMFontPanel *panel)
char* char*
WMGetFontPanelFontName(WMFontPanel *panel) WMGetFontPanelFontName(WMFontPanel *panel)
{ {
char name[256]; char name[512];
getSelectedFont(panel, name); getSelectedFont(panel, name, sizeof(name));
return wstrdup(name); return wstrdup(name);
} }
@@ -704,8 +705,8 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE, fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE,
&count); &count);
if (!fontList) { if (!fontList) {
WMRunAlertPanel(scr, panel->win, "Error", WMRunAlertPanel(scr, panel->win, _("Error"),
"Could not retrieve font list", "OK", NULL, NULL); _("Could not retrieve font list"), _("OK"), NULL, NULL);
return; return;
} }
@@ -717,7 +718,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
continue; continue;
} }
if (fname_len > 255) { if (fname_len > 255) {
wwarning("font name %s is longer than 256, which is invalid.", wwarning(_("font name %s is longer than 256, which is invalid."),
fontList[i]); fontList[i]);
*fontList[i] = '\0'; *fontList[i] = '\0';
continue; continue;
@@ -766,7 +767,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
static void static void
getSelectedFont(FontPanel *panel, char buffer[]) getSelectedFont(FontPanel *panel, char buffer[], int bufsize)
{ {
WMListItem *item; WMListItem *item;
Family *family; Family *family;
@@ -786,7 +787,7 @@ getSelectedFont(FontPanel *panel, char buffer[])
size = WMGetTextFieldText(panel->sizT); size = WMGetTextFieldText(panel->sizT);
sprintf(buffer, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s", snprintf(buffer, bufsize, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s",
family->foundry, family->foundry,
family->name, family->name,
face->weight, face->weight,
@@ -803,10 +804,10 @@ getSelectedFont(FontPanel *panel, char buffer[])
static void static void
preview(FontPanel *panel) preview(FontPanel *panel)
{ {
char buffer[256]; char buffer[512];
WMFont *font; WMFont *font;
getSelectedFont(panel, buffer); getSelectedFont(panel, buffer, sizeof(buffer));
font = WMCreateFont(WMWidgetScreen(panel->win), buffer); font = WMCreateFont(WMWidgetScreen(panel->win), buffer);
if (font) { if (font) {
@@ -864,22 +865,22 @@ familyClick(WMWidget *w, void *data)
} }
if (strcmp(face->slant, "r") == 0) { if (strcmp(face->slant, "r") == 0) {
strcat(buffer, "Roman"); strcat(buffer, _("Roman"));
top = 1; top = 1;
} else if (strcmp(face->slant, "i") == 0) { } else if (strcmp(face->slant, "i") == 0) {
strcat(buffer, "Italic"); strcat(buffer, _("Italic"));
} else if (strcmp(face->slant, "o") == 0) { } else if (strcmp(face->slant, "o") == 0) {
strcat(buffer, "Oblique"); strcat(buffer, _("Oblique"));
} else if (strcmp(face->slant, "ri") == 0) { } else if (strcmp(face->slant, "ri") == 0) {
strcat(buffer, "Rev Italic"); strcat(buffer, _("Rev Italic"));
} else if (strcmp(face->slant, "ro") == 0) { } else if (strcmp(face->slant, "ro") == 0) {
strcat(buffer, "Rev Oblique"); strcat(buffer, _("Rev Oblique"));
} else { } else {
strcat(buffer, face->slant); strcat(buffer, face->slant);
} }
if (buffer[0] == 0) { if (buffer[0] == 0) {
strcpy(buffer, "Normal"); strcpy(buffer, _("Normal"));
} }
if (top) if (top)
+4 -3
View File
@@ -1,6 +1,7 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@@ -411,7 +412,7 @@ loadPixmaps(WMScreen *scr)
if (!image) if (!image)
image = RLoadImage(scr->rcontext, X_WINGS_IMAGES_FILE, 0); image = RLoadImage(scr->rcontext, X_WINGS_IMAGES_FILE, 0);
if (!image) { if (!image) {
wwarning("WINGs: could not load widget images file: %s", wwarning(_("WINGs: could not load widget images file: %s"),
RMessageForError(RErrorCode)); RMessageForError(RErrorCode));
return False; return False;
} }
@@ -753,8 +754,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->boldFont = scrPtr->normalFont; scrPtr->boldFont = scrPtr->normalFont;
if (!scrPtr->normalFont) { if (!scrPtr->normalFont) {
wwarning("could not load any fonts. Make sure your font installation" wwarning(_("could not load any fonts. Make sure your font installation"
"and locale settings are correct."); "and locale settings are correct."));
return NULL; return NULL;
} }
+4 -4
View File
@@ -231,10 +231,10 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
w = view->size.width; w = view->size.width;
h = view->size.height; h = view->size.height;
} else { } else {
x = 2; x = 1;
y = 2; y = 1;
w = view->size.width - 4; w = view->size.width - 3;
h = view->size.height - 4; h = view->size.height - 3;
} }
/* calc. image alignment */ /* calc. image alignment */
+2 -1
View File
@@ -20,6 +20,7 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#define MIN_DOC_WIDTH 10 #define MIN_DOC_WIDTH 10
@@ -185,7 +186,7 @@ static void drawRulerOnPixmap(Ruler * rPtr)
rPtr->bg, 0, 0, rPtr->view->size.width, 40); rPtr->bg, 0, 0, rPtr->view->size.width, 40);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg, WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2, 26, "0 inches", 10); rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10);
/* marker ticks */ /* marker ticks */
i = j = m = 0; i = j = m = 0;
+28 -12
View File
@@ -3,6 +3,7 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@@ -1002,15 +1003,13 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
Bool relay = True; Bool relay = True;
WMScreen *scr = tPtr->view->screen; WMScreen *scr = tPtr->view->screen;
event->xkey.state &= ~scr->ignoredModifierMask;
/*printf("(%d,%d) -> ", tPtr->selection.position, tPtr->selection.count);*/ /*printf("(%d,%d) -> ", tPtr->selection.position, tPtr->selection.count);*/
if (((XKeyEvent *) event)->state & WM_EMACSKEYMASK) if (((XKeyEvent *) event)->state & WM_EMACSKEYMASK)
control_pressed = 1; control_pressed = 1;
shifted = event->xkey.state & ShiftMask; shifted = event->xkey.state & ShiftMask;
controled = event->xkey.state & ControlMask; controled = event->xkey.state & ControlMask;
if ((event->xkey.state & ~(ShiftMask|ControlMask)) != 0) { if ((event->xkey.state & (ShiftMask|ControlMask)) != 0) {
modified = True; modified = True;
} else { } else {
modified = False; modified = False;
@@ -1065,9 +1064,10 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_LEFT: case WM_EMACSKEY_LEFT:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
} else
modified = False;
#ifdef XK_KP_Left #ifdef XK_KP_Left
case XK_KP_Left: case XK_KP_Left:
#endif #endif
@@ -1099,9 +1099,11 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_RIGHT: case WM_EMACSKEY_RIGHT:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
} else
modified = False;
#ifdef XK_KP_Right #ifdef XK_KP_Right
case XK_KP_Right: case XK_KP_Right:
#endif #endif
@@ -1137,8 +1139,11 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_HOME: case WM_EMACSKEY_HOME:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
else {
modified = False;
controled = False;
} }
#ifdef XK_KP_Home #ifdef XK_KP_Home
case XK_KP_Home: case XK_KP_Home:
@@ -1162,8 +1167,11 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_END: case WM_EMACSKEY_END:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
else {
modified = False;
controled = False;
} }
#ifdef XK_KP_End #ifdef XK_KP_End
case XK_KP_End: case XK_KP_End:
@@ -1192,8 +1200,12 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_BS: case WM_EMACSKEY_BS:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
else {
modified = False;
controled = False;
shifted = False;
} }
case XK_BackSpace: case XK_BackSpace:
if (!modified && !shifted && !controled) { if (!modified && !shifted && !controled) {
@@ -1215,8 +1227,12 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break; break;
case WM_EMACSKEY_DEL: case WM_EMACSKEY_DEL:
if (!control_pressed) { if (!control_pressed)
goto normal_key; goto normal_key;
else {
modified = False;
controled = False;
shifted = False;
} }
#ifdef XK_KP_Delete #ifdef XK_KP_Delete
case XK_KP_Delete: case XK_KP_Delete:
@@ -1242,7 +1258,7 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
normal_key: normal_key:
default: default:
if (!controled && !modified) { if (!controled) {
if (count > 0 && isprint(buffer[0])) { if (count > 0 && isprint(buffer[0])) {
if (tPtr->selection.count) if (tPtr->selection.count)
WMDeleteTextFieldRange(tPtr, tPtr->selection); WMDeleteTextFieldRange(tPtr, tPtr->selection);
+2
View File
@@ -73,6 +73,7 @@ static char *keyOptions[] = {
"CloseKey", "CloseKey",
"MaximizeKey", "MaximizeKey",
"VMaximizeKey", "VMaximizeKey",
"HMaximizeKey",
"RaiseKey", "RaiseKey",
"LowerKey", "LowerKey",
"RaiseLowerKey", "RaiseLowerKey",
@@ -383,6 +384,7 @@ createPanel(Panel *p)
WMAddListItem(panel->actLs, _("Close active window")); WMAddListItem(panel->actLs, _("Close active window"));
WMAddListItem(panel->actLs, _("Maximize active window")); WMAddListItem(panel->actLs, _("Maximize active window"));
WMAddListItem(panel->actLs, _("Maximize active window vertically")); WMAddListItem(panel->actLs, _("Maximize active window vertically"));
WMAddListItem(panel->actLs, _("Maximize active window horizontally"));
WMAddListItem(panel->actLs, _("Raise active window")); WMAddListItem(panel->actLs, _("Raise active window"));
WMAddListItem(panel->actLs, _("Lower active window")); WMAddListItem(panel->actLs, _("Lower active window"));
WMAddListItem(panel->actLs, _("Raise/Lower window under mouse pointer")); WMAddListItem(panel->actLs, _("Raise/Lower window under mouse pointer"));
+13 -6
View File
@@ -301,6 +301,7 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
WMScreen *scr = WMWidgetScreen(sPtr); WMScreen *scr = WMWidgetScreen(sPtr);
RColor from, to; RColor from, to;
RHSVColor tmp; RHSVColor tmp;
char *buffer;
tmp = *hsv; tmp = *hsv;
if (saturation) { if (saturation) {
@@ -318,21 +319,25 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
pixmap = WMCreatePixmapFromRImage(scr, image, 128); pixmap = WMCreatePixmapFromRImage(scr, image, 128);
RReleaseImage(image); RReleaseImage(image);
if (saturation)
buffer = wstrdup(_("Saturation"));
else
buffer = wstrdup(_("Brightness"));
if (hsv->value < 128 || !saturation) { if (hsv->value < 128 || !saturation) {
WMColor *col = WMWhiteColor(scr); WMColor *col = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1, (16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
saturation ? "Saturation" : "Brightness", 10);
WMReleaseColor(col); WMReleaseColor(col);
} else { } else {
WMColor *col = WMBlackColor(scr); WMColor *col = WMBlackColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1, (16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
saturation ? "Saturation" : "Brightness", 10);
WMReleaseColor(col); WMReleaseColor(col);
} }
wfree(buffer);
WMSetSliderImage(sPtr, pixmap); WMSetSliderImage(sPtr, pixmap);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
} }
@@ -364,13 +369,15 @@ updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
WMColor *col = WMWhiteColor(scr); WMColor *col = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1, "Hue", 3); (16 - WMFontHeight(font))/2 - 1,
_("Hue"), strlen(_("Hue")));
WMReleaseColor(col); WMReleaseColor(col);
} else { } else {
WMColor *col = WMBlackColor(scr); WMColor *col = WMBlackColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1, "Hue", 3); (16 - WMFontHeight(font))/2 - 1,
_("Hue"), strlen(_("Hue")));
WMReleaseColor(col); WMReleaseColor(col);
} }
WMSetSliderImage(sPtr, pixmap); WMSetSliderImage(sPtr, pixmap);
+2 -2
View File
@@ -9,7 +9,7 @@ hr.po Croatian Toni Bili
fr.po French Bastien NOCERA <hadess@writeme.com> fr.po French Bastien NOCERA <hadess@writeme.com>
Hadess <hadess@infonie.fr> Hadess <hadess@infonie.fr>
ko.po Korean Byeong-Chan Kim <redhands@linux.sarang.net> ko.po Korean Byeong-Chan Kim <redhands@linux.sarang.net>
cs.po Czech David ©auer <xsauer@hwlab.felk.cvut.cz> cs.po Czech Jiri Hnidek <Jiri.Hnidek@vslib.cz>
ja.po Japanese Kazuhide Takahashi <kazu@dgra.ne.jp> ja.po Japanese Kazuhide Takahashi <kazu@dgra.ne.jp>
zh_TW.Big5.po Chinese Li Wei Jih <lwj83@cs.ccu.edu.tw> zh_TW.Big5.po Chinese Li Wei Jih <lwj83@cs.ccu.edu.tw>
zh_CN.po Chinese Wang Jian <larkw@263.net> zh_CN.po Chinese Wang Jian <larkw@263.net>
@@ -20,5 +20,5 @@ ru.po Russian Igor P. Roboul <igor@srcso.sochi.su>
de.po German Bernd Eggert <Bernd.Eggert@t-online.de> de.po German Bernd Eggert <Bernd.Eggert@t-online.de>
hu.po Hungarian Horvath Szabolcs <horvathsz@penguinpowered.com> hu.po Hungarian Horvath Szabolcs <horvathsz@penguinpowered.com>
bg.po Bulgarian Slavei Karadjov <slaff@exco.net> bg.po Bulgarian Slavei Karadjov <slaff@exco.net>
sk.po Slovak judas@hell <tomka@oalevice.sk> sk.po Slovak Jan "judas" Tomka <tomka@oalevice.sk>
+1307 -890
View File
File diff suppressed because it is too large Load Diff
+504 -462
View File
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -1,12 +1,13 @@
/* Slovak root menu for WindowMaker /* Slovak root menu for WindowMaker
* (C) 2001 judas@hell * (C) 2001 Jan "judas" Tomka
* *
* Original translation by judas@hell on Jan 22 2001 * Original translation by Jan "judas" Tomka on Jan 22 2001
* Currently maintained by judas@hell <tomka@oalevice.sk> * Currently maintained by Jan "judas" Tomka <tomka@oalevice.sk>
* *
* Version history: * Version history:
* mnu-ver WM-ver author email date * WM-ver author email date
* 0.10 0.63.1 judas@hell <tomka@oalevice.sk> Jan 22 2001 * 0.63.1 Jan "judas" Tomka <tomka@oalevice.sk> Jan 28 2001
* 0.64.0 Jan "judas" Tomka <tomka@oalevice.sk> Feb 25 2001
* *
*/ */
@@ -16,24 +17,24 @@
* <Názov> [SHORTCUT <Klávesová skratka>] <Príkaz> <Parametre> * <Názov> [SHORTCUT <Klávesová skratka>] <Príkaz> <Parametre>
* *
* <Názov> je ľubovoľný reťazec, ktorý sa použije ako názov položky. Ak obsahuje * <Názov> je ľubovoľný reťazec, ktorý sa použije ako názov položky. Ak obsahuje
* medzery, musí by» uzavretý v zátvorkách. * medzery, musí by» uzavretý v úvodzovkách.
* *
* SHORTCUT udáva klávesovú skratku pre danú položku. <Klávesová skratka> má * SHORTCUT udáva klávesovú skratku pre danú položku. <Klávesová skratka> má
* rovnakú syntax ako v súbore $HOME/GNUstep/Defaults/WindowMaker, napr. * rovnakú syntax ako v súbore $HOME/GNUstep/Defaults/WindowMaker, napr.
* RootMenuKey alebo MiniaturizeKey. * RootMenuKey alebo MiniaturizeKey.
* *
* Nemô¾ete uda» klávesovú skratku pre polo¾ky typu MENU A OPEN_MENU. * Nemô¾ete zada» klávesovú skratku pre polo¾ky typu MENU a OPEN_MENU.
* *
* <Príkaz> je jeden z nasledujúcich: * <Príkaz> je jeden z nasledujúcich:
* MENU - začína definíciu (sub)menu * MENU - začína definíciu (sub)menu
* END - ukončuje definíciu (sub)menu * END - ukončuje definíciu (sub)menu
* OPEN_MENU - vlo¾í menu zo súboru, rúry alebo adresáru(ov), * OPEN_MENU - vlo¾í menu zo súboru, rúry alebo adresára(ov),
* eventuálne pred každú položku vloží príkaz * eventuálne pred každú položku vloží príkaz
* WORKSPACE_MENU - vlo¾í submenu operácií pracovnej plochy. Len jedno * WORKSPACE_MENU - vlo¾í submenu operácií pracovnej plochy. Je povolené
* takéto menu je povolené * len jedno takéto menu
* EXEC <príkaz> - vykoná externý príkaz * EXEC <príkaz> - vykoná externý príkaz
* SHEXEC <príkaz> - vykoná príkaz shelu (napr. gimp > /dev/null) * SHEXEC <príkaz> - vykoná príkaz shelu (napr. gimp > /dev/null)
* EXIT - ukonèí mana¾éra okien * EXIT - ukonèí mana¾ér okien
* RESTART [<manažér okien>] - reštartuje WindowMaker alebo spustí iný * RESTART [<manažér okien>] - reštartuje WindowMaker alebo spustí iný
* manažér okien * manažér okien
* REFRESH - obnoví obrazovku * REFRESH - obnoví obrazovku
@@ -45,7 +46,7 @@
* SAVE_SESSION - uloží aktuálny stav pracovnej plochy, čo zahŕňa všetky * SAVE_SESSION - uloží aktuálny stav pracovnej plochy, čo zahŕňa všetky
* spustené aplikácie, ich nastavenia (geometria, * spustené aplikácie, ich nastavenia (geometria,
* umiestnenie na obrazovke, pracovná plocha, na ktorej sa * umiestnenie na obrazovke, pracovná plocha, na ktorej sa
* nachádzajú, Dok alebo sponka, odkiaµ boli spustené, èi * nachádzajú, Dok alebo Sponka, odkiaµ boli spustené, èi
* sú minimalizované, zrolované alebo skryté. Tiež sa uloží * sú minimalizované, zrolované alebo skryté. Tiež sa uloží
* plocha, na ktorej sa užívateľ nachádza. Pri každom štarte * plocha, na ktorej sa užívateľ nachádza. Pri každom štarte
* WindowMakeru sa tieto nastavenia obnovia až kým sa nepou- * WindowMakeru sa tieto nastavenia obnovia až kým sa nepou-
@@ -81,7 +82,7 @@
* // poradí, pričom pred každý vloží príkaz. * // poradí, pričom pred každý vloží príkaz.
* OPEN_MENU [voľby] /nejaký/adr [/ďalší/adr ...] WITH príkaz -voľby * OPEN_MENU [voľby] /nejaký/adr [/ďalší/adr ...] WITH príkaz -voľby
* Voľby: * Voľby:
* -noext odstráni» zvy¹ok mena súboru za powslednou * -noext odstráni» zvy¹ok mena súboru za poslednou
* bodkou (príponu) * bodkou (príponu)
* *
* <Parametre> sú odovzdané aplikácii, ktorá sa má vykonať. * <Parametre> sú odovzdané aplikácii, ktorá sa má vykonať.
@@ -227,4 +228,3 @@
"Koniec" END "Koniec" END
"Aplikácie" END "Aplikácie" END
+15 -2
View File
@@ -15,7 +15,7 @@ AC_INIT(src/WindowMaker.h)
AM_INIT_AUTOMAKE(WindowMaker, 0.65.0) AM_INIT_AUTOMAKE(WindowMaker, 0.65.1)
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
@@ -222,6 +222,7 @@ dnl List of supported locales
dnl ------------------------- dnl -------------------------
supported_locales="cs de es et fr gl it ja ko nl no pt ru sv tr fi hr el pl ro da zh_TW.Big5 zh_CN sk bg hu" supported_locales="cs de es et fr gl it ja ko nl no pt ru sv tr fi hr el pl ro da zh_TW.Big5 zh_CN sk bg hu"
supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de bg hu sk" supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de bg hu sk"
supported_wings_locales="sk"
for lang in $LINGUAS; do for lang in $LINGUAS; do
ok=0 ok=0
@@ -246,6 +247,16 @@ for lang in $LINGUAS; do
if test "$ok" = 1; then if test "$ok" = 1; then
WPMOFILES="$WPMOFILES $lang.mo" WPMOFILES="$WPMOFILES $lang.mo"
fi fi
ok=0
for l in $supported_wings_locales; do
if test "$l" = "$lang"; then
ok=1
break
fi
done
if test "$ok" = 1; then
WINGSMOFILES="$WINGSMOFILES $lang.mo"
fi
done done
@@ -282,6 +293,7 @@ AC_SUBST(INTLIBS)
AC_SUBST(NLSDIR) AC_SUBST(NLSDIR)
AC_SUBST(MOFILES) AC_SUBST(MOFILES)
AC_SUBST(WPMOFILES) AC_SUBST(WPMOFILES)
AC_SUBST(WINGSMOFILES)
AC_SUBST(supported_locales) AC_SUBST(supported_locales)
@@ -821,8 +833,9 @@ dnl AC_SUBST(DOCTYPES)
AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile \ AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile \
WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \ WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \ WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
WINGs/Extras/Makefile \ WINGs/Extras/Makefile WINGs/po/Makefile \
wmlib/Makefile wrlib/Makefile src/Makefile src/wconfig.h doc/Makefile \ wmlib/Makefile wrlib/Makefile src/Makefile src/wconfig.h doc/Makefile \
doc/sk/Makefile \
WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \ WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \ WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \ WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
+6 -4
View File
@@ -13,7 +13,7 @@ Group: User Interface/Desktops
Vendor: The Window Maker Team Vendor: The Window Maker Team
Url: http://www.windowmaker.org Url: http://www.windowmaker.org
Source: %{name}-%{version}.tar.gz Source: %{name}-%{version}.tar.gz
Requires: wmconfig, libPropList >= 0.9.5 Requires: wmconfig, libPropList >= 0.10.1
Obsoletes: windowmaker, windowmaker-devel, windowmaker-libs, WindowMaker-devel Obsoletes: windowmaker, windowmaker-devel, windowmaker-libs, WindowMaker-devel
Provides: windowmaker Provides: windowmaker
BuildRoot: /var/tmp/%{name}-%{version} BuildRoot: /var/tmp/%{name}-%{version}
@@ -49,9 +49,9 @@ GNUSTEP_LOCAL_ROOT='$(prefix)/X11R6/lib/GNUstep';
export CFLAGS LINGUAS NLSDIR GNUSTEP_LOCAL_ROOT; export CFLAGS LINGUAS NLSDIR GNUSTEP_LOCAL_ROOT;
./configure --prefix=/usr --exec-prefix=/usr/X11R6 \ ./configure --prefix=/usr --exec-prefix=/usr/X11R6 \
--sysconfdir=/etc/X11 \ --sysconfdir=/etc/X11 --enable-modelock \
--enable-newstyle --enable-superfluous \ --enable-kde --enable-gnome --enable-openlook \
--enable-kde --enable-gnome --enable-usermenu
make make
%install %install
@@ -73,6 +73,7 @@ if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS BUGFORM BUGS ChangeLog NEWS FAQ* README %doc AUTHORS BUGFORM BUGS ChangeLog NEWS FAQ* README
%doc TODO MIRRORS README.* %doc TODO MIRRORS README.*
%doc AUTHORS.sk
%config /etc/X11/WindowMaker %config /etc/X11/WindowMaker
/usr/X11R6/bin/* /usr/X11R6/bin/*
/usr/X11R6/lib/lib* /usr/X11R6/lib/lib*
@@ -82,5 +83,6 @@ if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
/usr/share/locale/*/LC_MESSAGES/* /usr/share/locale/*/LC_MESSAGES/*
/usr/share/WINGs /usr/share/WINGs
/usr/man/*/* /usr/man/*/*
/usr/man/*/*/*
%changelog %changelog
+2
View File
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
SUBDIRS = sk
man_MANS = \ man_MANS = \
geticonset.1x \ geticonset.1x \
setstyle.1x \ setstyle.1x \
+646 -524
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -320,7 +320,7 @@ updateDockNumbers(WScreen *scr)
my_v_mask, &my_gc_values); my_v_mask, &my_gc_values);
ws_numbers = wmalloc(20); ws_numbers = wmalloc(20);
sprintf(ws_numbers, "%i [ %i ]", scr->current_workspace+1, snprintf(ws_numbers, 20, "%i [ %i ]", scr->current_workspace+1,
((scr->current_workspace/10)+1)); ((scr->current_workspace/10)+1));
length = strlen(ws_numbers); length = strlen(ws_numbers);
@@ -457,11 +457,11 @@ wAppIconPaint(WAppIcon *aicon)
if (index > 0) { if (index > 0) {
char buf[16]; char buf[16];
sprintf(buf, "%i", index); snprintf(buf, sizeof(buf), "%i", index);
WMDrawString(scr->wmscreen, aicon->icon->core->window, WMDrawString(scr->wmscreen, aicon->icon->core->window,
scr->clip_title_gc, scr->title_font, scr->clip_title_gc, scr->title_font,
1, 1, buf, strlen(buf)); 3, 3, buf, strlen(buf));
} }
+3 -2
View File
@@ -360,8 +360,9 @@ appiconBalloon(WObjDescriptor *object)
char *tmp; char *tmp;
if (aicon->command && aicon->wm_class) { if (aicon->command && aicon->wm_class) {
tmp = wmalloc(strlen(aicon->command)+strlen(aicon->wm_class)+8); int len = strlen(aicon->command)+strlen(aicon->wm_class)+8;
sprintf(tmp, "%s (%s)", aicon->wm_class, aicon->command); tmp = wmalloc(len);
snprintf(tmp, len, "%s (%s)", aicon->wm_class, aicon->command);
scr->balloon->text = tmp; scr->balloon->text = tmp;
} else if (aicon->command) { } else if (aicon->command) {
scr->balloon->text = wstrdup(aicon->command); scr->balloon->text = wstrdup(aicon->command);
+10 -5
View File
@@ -702,6 +702,9 @@ WDefaultEntry optionList[] = {
{"VMaximizeKey", "None", (void*)WKBD_VMAXIMIZE, {"VMaximizeKey", "None", (void*)WKBD_VMAXIMIZE,
NULL, getKeybind, setKeyGrab NULL, getKeybind, setKeyGrab
}, },
{"HMaximizeKey", "None", (void*)WKBD_HMAXIMIZE,
NULL, getKeybind, setKeyGrab
},
{"RaiseKey", "\"Meta+Up\"", (void*)WKBD_RAISE, {"RaiseKey", "\"Meta+Up\"", (void*)WKBD_RAISE,
NULL, getKeybind, setKeyGrab NULL, getKeybind, setKeyGrab
}, },
@@ -968,7 +971,7 @@ wDefaultsInitDomain(char *domain, Bool requireDictionary)
} }
/* global system dictionary */ /* global system dictionary */
sprintf(path, "%s/WindowMaker/%s", SYSCONFDIR, domain); snprintf(path, sizeof(path), "%s/WindowMaker/%s", SYSCONFDIR, domain);
if (stat(path, &stbuf)>=0) { if (stat(path, &stbuf)>=0) {
shared_dict = ReadProplistFromFile(path); shared_dict = ReadProplistFromFile(path);
if (shared_dict) { if (shared_dict) {
@@ -1063,7 +1066,7 @@ wDefaultsCheckDomains(void *foo)
WDWindowMaker->timestamp = stbuf.st_mtime; WDWindowMaker->timestamp = stbuf.st_mtime;
/* global dictionary */ /* global dictionary */
sprintf(path, "%s/WindowMaker/WindowMaker", SYSCONFDIR); snprintf(path, sizeof(path), "%s/WindowMaker/WindowMaker", SYSCONFDIR);
if (stat(path, &stbuf)>=0) { if (stat(path, &stbuf)>=0) {
shared_dict = ReadProplistFromFile(path); shared_dict = ReadProplistFromFile(path);
if (shared_dict && !PLIsDictionary(shared_dict)) { if (shared_dict && !PLIsDictionary(shared_dict)) {
@@ -3240,15 +3243,17 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
char *command; char *command;
char *text; char *text;
char *dither; char *dither;
int len;
SetupEnvironment(scr); SetupEnvironment(scr);
text = PLGetDescription(value); text = PLGetDescription(value);
command = wmalloc(strlen(text)+40); len = strlen(text)+40;
command = wmalloc(len);
dither = wPreferences.no_dithering ? "-m" : "-d"; dither = wPreferences.no_dithering ? "-m" : "-d";
if (wPreferences.smooth_workspace_back) if (wPreferences.smooth_workspace_back)
sprintf(command, "wmsetbg %s -S -p '%s' &", dither, text); snprintf(command, len, "wmsetbg %s -S -p '%s' &", dither, text);
else else
sprintf(command, "wmsetbg %s -p '%s' &", dither, text); snprintf(command, len, "wmsetbg %s -p '%s' &", dither, text);
wfree(text); wfree(text);
system(command); system(command);
wfree(command); wfree(command);
+39 -28
View File
@@ -381,8 +381,11 @@ drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
whitecolor = WMWhiteColor(wmscr); whitecolor = WMWhiteColor(wmscr);
dirfile = wexpandpath(WMGetListSelectedItem(panel->dirList)->text); dirfile = wexpandpath(WMGetListSelectedItem(panel->dirList)->text);
file = wmalloc(strlen(dirfile)+strlen(text)+4); {
sprintf(file, "%s/%s", dirfile, text); int len = strlen(dirfile)+strlen(text)+4;
file = wmalloc(len);
snprintf(file, len, "%s/%s", dirfile, text);
}
wfree(dirfile); wfree(dirfile);
if ((state & WLDSSelected) != 0) { if ((state & WLDSSelected) != 0) {
@@ -691,12 +694,13 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
{ {
char *tmp; char *tmp;
int len = (instance ? strlen(instance) : 0)
+ (class ? strlen(class) : 0) + 32;
tmp = wmalloc((instance ? strlen(instance) : 0) tmp = wmalloc(len);
+ (class ? strlen(class) : 0) + 32);
if (tmp && (instance || class)) if (tmp && (instance || class))
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class); snprintf(tmp, len, "%s [%s.%s]", _("Icon Chooser"), instance, class);
else else
strcpy(tmp, _("Icon Chooser")); strcpy(tmp, _("Icon Chooser"));
@@ -1155,7 +1159,7 @@ handleLogoPush(XEvent *event, void *data)
WMReleaseFont(panel->oldFont); WMReleaseFont(panel->oldFont);
panel->oldFont = NULL; panel->oldFont = NULL;
} }
sprintf(version, _("Version %s"), VERSION); snprintf(version, sizeof(version), _("Version %s"), VERSION);
WMSetLabelText(panel->versionL, version); WMSetLabelText(panel->versionL, version);
XFlush(WMScreenDisplay(WMWidgetScreen(panel->versionL))); XFlush(WMScreenDisplay(WMWidgetScreen(panel->versionL)));
} }
@@ -1176,8 +1180,8 @@ wShowInfoPanel(WScreen *scr)
WMPixmap *logo; WMPixmap *logo;
WMSize size; WMSize size;
WMFont *font; WMFont *font;
char version[32]; char *strbuf = NULL;
char buffer[512]; char buffer[256];
Window parent; Window parent;
WWindow *wwin; WWindow *wwin;
RColor color1, color2; RColor color1, color2;
@@ -1265,12 +1269,12 @@ wShowInfoPanel(WScreen *scr)
WMSetLabelText(panel->name2L, _("Window Manager for X")); WMSetLabelText(panel->name2L, _("Window Manager for X"));
sprintf(version, _("Version %s"), VERSION); snprintf(buffer, sizeof(buffer), _("Version %s"), VERSION);
panel->versionL = WMCreateLabel(panel->win); panel->versionL = WMCreateLabel(panel->win);
WMResizeWidget(panel->versionL, 310, 16); WMResizeWidget(panel->versionL, 310, 16);
WMMoveWidget(panel->versionL, 30, 95); WMMoveWidget(panel->versionL, 30, 95);
WMSetLabelTextAlignment(panel->versionL, WARight); WMSetLabelTextAlignment(panel->versionL, WARight);
WMSetLabelText(panel->versionL, version); WMSetLabelText(panel->versionL, buffer);
WMSetLabelWraps(panel->versionL, False); WMSetLabelWraps(panel->versionL, False);
panel->copyrL = WMCreateLabel(panel->win); panel->copyrL = WMCreateLabel(panel->win);
@@ -1284,44 +1288,50 @@ wShowInfoPanel(WScreen *scr)
WMSetLabelFont(panel->copyrL, font); WMSetLabelFont(panel->copyrL, font);
} }
strbuf = NULL;
snprintf(buffer, sizeof(buffer), _("Using visual 0x%x: %s %ibpp "),
(unsigned)scr->w_visual->visualid,
visuals[scr->w_visual->class], scr->w_depth);
strbuf = wstrappend(strbuf, buffer);
switch (scr->w_depth) { switch (scr->w_depth) {
case 15: case 15:
strcpy(version, _("32 thousand")); strbuf = wstrappend(strbuf, _("(32 thousand colors)\n"));
break; break;
case 16: case 16:
strcpy(version, _("64 thousand")); strbuf = wstrappend(strbuf, _("(64 thousand colors)\n"));
break; break;
case 24: case 24:
case 32: case 32:
strcpy(version, _("16 million")); strbuf = wstrappend(strbuf, _("(16 million colors)\n"));
break; break;
default: default:
sprintf(version, "%d", 1<<scr->w_depth); snprintf(buffer, sizeof(buffer), _("(%d colors)\n"), 1<<scr->w_depth);
strbuf = wstrappend(strbuf, buffer);
break; break;
} }
sprintf(buffer, _("Using visual 0x%x: %s %ibpp (%s colors)\n"),
(unsigned)scr->w_visual->visualid,
visuals[scr->w_visual->class], scr->w_depth, version);
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) #if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
{ {
struct mallinfo ma = mallinfo(); struct mallinfo ma = mallinfo();
sprintf(buffer+strlen(buffer), snprintf(buffer, sizeof(buffer),
_("Total allocated memory: %i kB. Total memory in use: %i kB.\n"), _("Total allocated memory: %i kB. Total memory in use: %i kB.\n"),
(ma.arena+ma.hblkhd)/1024, (ma.uordblks+ma.hblkhd)/1024); (ma.arena+ma.hblkhd)/1024, (ma.uordblks+ma.hblkhd)/1024);
strbuf = wstrappend(strbuf, buffer);
} }
#endif #endif
strcat(buffer, _("Supported image formats: ")); strbuf = wstrappend(strbuf, _("Supported image formats: "));
strl = RSupportedFileFormats(); strl = RSupportedFileFormats();
for (i=0; strl[i]!=NULL; i++) { for (i=0; strl[i]!=NULL; i++) {
strcat(buffer, strl[i]); strbuf = wstrappend(strbuf, strl[i]);
strcat(buffer, " "); strbuf = wstrappend(strbuf, " ");
} }
strcat(buffer, _("\nAdditional support for: ")); strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
{ {
char *list[8]; char *list[8];
char buf[80]; char buf[80];
@@ -1350,24 +1360,25 @@ wShowInfoPanel(WScreen *scr)
} }
strcat(buf, list[i]); strcat(buf, list[i]);
} }
strcat(buffer, buf); strbuf = wstrappend(strbuf, buf);
} }
if (wPreferences.no_sound) { if (wPreferences.no_sound) {
strcat(buffer, _("\nSound disabled")); strbuf = wstrappend(strbuf, _("\nSound disabled"));
} else { } else {
strcat(buffer, _("\nSound enabled")); strbuf = wstrappend(strbuf, _("\nSound enabled"));
} }
panel->infoL = WMCreateLabel(panel->win); panel->infoL = WMCreateLabel(panel->win);
WMResizeWidget(panel->infoL, 350, 75); WMResizeWidget(panel->infoL, 350, 75);
WMMoveWidget(panel->infoL, 15, 115); WMMoveWidget(panel->infoL, 15, 115);
WMSetLabelText(panel->infoL, buffer); WMSetLabelText(panel->infoL, strbuf);
if (font) { if (font) {
WMSetLabelFont(panel->infoL, font); WMSetLabelFont(panel->infoL, font);
WMReleaseFont(font); WMReleaseFont(font);
} }
wfree(strbuf);
WMRealizeWidget(panel->win); WMRealizeWidget(panel->win);
@@ -1681,10 +1692,10 @@ wShowCrashingDialogPanel(int whatSig)
WMMoveWidget(panel->noteL, 10, 90); WMMoveWidget(panel->noteL, 10, 90);
WMSetLabelTextAlignment(panel->noteL, WAJustified); WMSetLabelTextAlignment(panel->noteL, WAJustified);
#ifdef SYS_SIGLIST_DECLARED #ifdef SYS_SIGLIST_DECLARED
sprintf(buf, _("Window Maker received signal %i\n(%s)."), snprintf(buf, sizeof(buf), _("Window Maker received signal %i\n(%s)."),
whatSig, sys_siglist[whatSig]); whatSig, sys_siglist[whatSig]);
#else #else
sprintf(buf, _("Window Maker received signal %i."), whatSig); snprintf(buf, sizeof(buf), _("Window Maker received signal %i."), whatSig);
#endif #endif
WMSetLabelText(panel->noteL, buf); WMSetLabelText(panel->noteL, buf);
+13 -12
View File
@@ -210,7 +210,7 @@ renameCallback(WMenu *menu, WMenuEntry *entry)
name = wstrdup(dock->screen_ptr->workspaces[wspace]->name); name = wstrdup(dock->screen_ptr->workspaces[wspace]->name);
sprintf(buffer, _("Type the name for workspace %i:"), wspace+1); snprintf(buffer, sizeof(buffer), _("Type the name for workspace %i:"), wspace+1);
if (wInputDialog(dock->screen_ptr, _("Rename Workspace"), buffer, if (wInputDialog(dock->screen_ptr, _("Rename Workspace"), buffer,
&name)) { &name)) {
wWorkspaceRename(dock->screen_ptr, wspace, name); wWorkspaceRename(dock->screen_ptr, wspace, name);
@@ -1250,8 +1250,8 @@ wClipIconPaint(WAppIcon *aicon)
length = strlen(workspace->name); length = strlen(workspace->name);
ws_name = wmalloc(length + 1); ws_name = wmalloc(length + 1);
sprintf(ws_name, "%s", workspace->name); snprintf(ws_name, length+1, "%s", workspace->name);
sprintf(ws_number, "%i", scr->current_workspace + 1); snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
nlength = strlen(ws_number); nlength = strlen(ws_number);
gc = scr->clip_title_gc; gc = scr->clip_title_gc;
@@ -1332,9 +1332,9 @@ make_icon_state(WAppIcon *btn)
buggy = btn->buggy_app ? dYes : dNo; buggy = btn->buggy_app ? dYes : dNo;
if (btn == btn->icon->core->screen_ptr->clip_icon) if (btn == btn->icon->core->screen_ptr->clip_icon)
sprintf(buffer, "%i,%i", btn->x_pos, btn->y_pos); snprintf(buffer, sizeof(buffer), "%i,%i", btn->x_pos, btn->y_pos);
else else
sprintf(buffer, "%hi,%hi", btn->xindex, btn->yindex); snprintf(buffer, sizeof(buffer), "%hi,%hi", btn->xindex, btn->yindex);
position = PLMakeString(buffer); position = PLMakeString(buffer);
node = PLMakeDictionaryFromEntries(dCommand, command, node = PLMakeDictionaryFromEntries(dCommand, command,
@@ -1400,13 +1400,13 @@ dockSaveState(WDock *dock)
NULL); NULL);
if (dock->type == WM_DOCK) { if (dock->type == WM_DOCK) {
sprintf(buffer, "Applications%i", dock->screen_ptr->scr_height); snprintf(buffer, sizeof(buffer), "Applications%i", dock->screen_ptr->scr_height);
key = PLMakeString(buffer); key = PLMakeString(buffer);
PLInsertDictionaryEntry(dock_state, key, list); PLInsertDictionaryEntry(dock_state, key, list);
PLRelease(key); PLRelease(key);
sprintf(buffer, "%i,%i", (dock->on_right_side ? -ICON_SIZE : 0), snprintf(buffer, sizeof(buffer), "%i,%i", (dock->on_right_side ? -ICON_SIZE : 0),
dock->y_pos); dock->y_pos);
value = PLMakeString(buffer); value = PLMakeString(buffer);
PLInsertDictionaryEntry(dock_state, dPosition, value); PLInsertDictionaryEntry(dock_state, dPosition, value);
@@ -1833,7 +1833,7 @@ wDockRestoreState(WScreen *scr, proplist_t dock_state, int type)
* If it does not exist, use Applications as default. * If it does not exist, use Applications as default.
*/ */
sprintf(buffer, "Applications%i", scr->scr_height); snprintf(buffer, sizeof(buffer), "Applications%i", scr->scr_height);
tmp = PLMakeString(buffer); tmp = PLMakeString(buffer);
apps = PLGetDictionaryEntry(dock_state, tmp); apps = PLGetDictionaryEntry(dock_state, tmp);
@@ -2153,8 +2153,9 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
#ifdef OFFIX_DND #ifdef OFFIX_DND
if (icon->command && !icon->dnd_command) { if (icon->command && !icon->dnd_command) {
icon->dnd_command = wmalloc(strlen(icon->command)+8); int len = strlen(icon->command)+8;
sprintf(icon->dnd_command, "%s %%d", icon->command); icon->dnd_command = wmalloc(len);
snprintf(icon->dnd_command, len, "%s %%d", icon->command);
} }
#endif #endif
@@ -3233,11 +3234,11 @@ trackDeadProcess(pid_t pid, unsigned char status, WDock *dock)
if (status==111) { if (status==111) {
char msg[PATH_MAX]; char msg[PATH_MAX];
#ifdef OFFIX_DND #ifdef OFFIX_DND
sprintf(msg, _("Could not execute command \"%s\""), snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""),
icon->drop_launch && icon->dnd_command icon->drop_launch && icon->dnd_command
? icon->dnd_command : icon->command); ? icon->dnd_command : icon->command);
#else #else
sprintf(msg, _("Could not execute command \"%s\""), snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""),
icon->command); icon->command);
#endif #endif
wMessageDialog(dock->screen_ptr, _("Error"), msg, wMessageDialog(dock->screen_ptr, _("Error"), msg,
+3 -2
View File
@@ -205,9 +205,10 @@ panelBtnCallback(WMWidget *self, void *data)
} }
if (!wIconChangeImageFile(panel->editedIcon->icon, text)) { if (!wIconChangeImageFile(panel->editedIcon->icon, text)) {
char *buf; char *buf;
int len = strlen(text) + 64;
buf = wmalloc(strlen(text) + 64); buf = wmalloc(len);
sprintf(buf, _("Could not open specified icon file: %s"), text); snprintf(buf, len, _("Could not open specified icon file: %s"), text);
if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf, if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf,
_("OK"), _("Ignore"), NULL) == WAPRDefault) { _("OK"), _("Ignore"), NULL) == WAPRDefault) {
if (text) if (text)
+11
View File
@@ -1433,6 +1433,17 @@ handleKeyPress(XEvent *event)
} }
} }
break; break;
case WKBD_HMAXIMIZE:
if (ISMAPPED(wwin) && ISFOCUSED(wwin) && !WFLAGP(wwin, no_resizable)) {
CloseWindowMenu(scr);
if (wwin->flags.maximized) {
wUnmaximizeWindow(wwin);
} else {
wMaximizeWindow(wwin, MAX_HORIZONTAL);
}
}
break;
case WKBD_RAISE: case WKBD_RAISE:
if (ISMAPPED(wwin) && ISFOCUSED(wwin)) { if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
CloseWindowMenu(scr); CloseWindowMenu(scr);
+15
View File
@@ -32,6 +32,21 @@ static char *PRED_XKBGROUP2_XPM[] = {
"##..####..", "##..####..",
"##.#####.#" "##.#####.#"
}; };
#elif defined LANGUAGE_SK
static char *PRED_XKBGROUP2_XPM[] = {
" 10 10 2 1",
". c #000000",
"# c None",
"####..####",
"####..####",
"##......##",
"##......##",
"####..####",
"#........#",
"#........#",
"####..####",
"###....###",
"##......##"};
#else #else
static char *PRED_XKBGROUP2_XPM[] = { static char *PRED_XKBGROUP2_XPM[] = {
" 10 10 2 1", " 10 10 2 1",
+5 -3
View File
@@ -84,7 +84,7 @@ WCreateGeometryView(WMScreen *scr)
WMCreateEventHandler(gview->view, ExposureMask, handleEvents, gview); WMCreateEventHandler(gview->view, ExposureMask, handleEvents, gview);
sprintf(buffer, "%+05i, %+05i", 0, 0); snprintf(buffer, sizeof(buffer), "%+05i, %+05i", 0, 0);
gview->textSize.width = WMWidthOfString(gview->font, buffer, gview->textSize.width = WMWidthOfString(gview->font, buffer,
strlen(buffer)); strlen(buffer));
@@ -127,9 +127,11 @@ paint(WGeometryView *gview)
char buffer[64]; char buffer[64];
if (gview->showPosition) { if (gview->showPosition) {
sprintf(buffer, "%+5i , %+5i ", gview->data.pos.x, gview->data.pos.y); snprintf(buffer, sizeof(buffer), "%+5i , %+5i ",
gview->data.pos.x, gview->data.pos.y);
} else { } else {
sprintf(buffer, "%+5i x %+5i ", gview->data.size.width, gview->data.size.height); snprintf(buffer, sizeof(buffer), "%+5i x %+5i ",
gview->data.size.width, gview->data.size.height);
} }
WMDrawImageString(W_VIEW_SCREEN(gview->view), WMDrawImageString(W_VIEW_SCREEN(gview->view),
+10 -7
View File
@@ -466,14 +466,17 @@ getnameforicon(WWindow *wwin)
int len; int len;
if (wwin->wm_class && wwin->wm_instance) { if (wwin->wm_class && wwin->wm_instance) {
suffix = wmalloc(strlen(wwin->wm_class)+strlen(wwin->wm_instance)+2); int len = strlen(wwin->wm_class)+strlen(wwin->wm_instance)+2;
sprintf(suffix, "%s.%s", wwin->wm_instance, wwin->wm_class); suffix = wmalloc(len);
snprintf(suffix, len, "%s.%s", wwin->wm_instance, wwin->wm_class);
} else if (wwin->wm_class) { } else if (wwin->wm_class) {
suffix = wmalloc(strlen(wwin->wm_class)+1); int len = strlen(wwin->wm_class)+1;
strcpy(suffix, wwin->wm_class); suffix = wmalloc(len);
snprintf(suffix, len, "%s", wwin->wm_class);
} else if (wwin->wm_instance) { } else if (wwin->wm_instance) {
suffix = wmalloc(strlen(wwin->wm_instance)+1); int len = strlen(wwin->wm_instance)+1;
strcpy(suffix, wwin->wm_instance); suffix = wmalloc(len);
snprintf(suffix, len, "%s", wwin->wm_instance);
} else { } else {
return NULL; return NULL;
} }
@@ -481,7 +484,7 @@ getnameforicon(WWindow *wwin)
prefix = wusergnusteppath(); prefix = wusergnusteppath();
len = strlen(prefix)+64+strlen(suffix); len = strlen(prefix)+64+strlen(suffix);
path = wmalloc(len+1); path = wmalloc(len+1);
sprintf(path, "%s/.AppInfo", prefix); snprintf(path, len, "%s/.AppInfo", prefix);
if (access(path, F_OK)!=0) { if (access(path, F_OK)!=0) {
if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)) { if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)) {
+41 -40
View File
@@ -30,57 +30,58 @@
#define WKBD_HIDE 4 #define WKBD_HIDE 4
#define WKBD_MAXIMIZE 5 #define WKBD_MAXIMIZE 5
#define WKBD_VMAXIMIZE 6 #define WKBD_VMAXIMIZE 6
#define WKBD_SELECT 7 #define WKBD_HMAXIMIZE 7
#define WKBD_SELECT 8
/* Clip */ /* Clip */
#define WKBD_CLIPLOWER 8 #define WKBD_CLIPLOWER 9
#define WKBD_CLIPRAISE 9 #define WKBD_CLIPRAISE 10
#define WKBD_CLIPRAISELOWER 10 #define WKBD_CLIPRAISELOWER 11
/* window */ /* window */
#define WKBD_RAISE 11 #define WKBD_RAISE 12
#define WKBD_LOWER 12 #define WKBD_LOWER 13
#define WKBD_RAISELOWER 13 #define WKBD_RAISELOWER 14
#define WKBD_MOVERESIZE 14 #define WKBD_MOVERESIZE 15
#define WKBD_SHADE 15 #define WKBD_SHADE 16
/* window, menu */ /* window, menu */
#define WKBD_CLOSE 16 #define WKBD_CLOSE 17
/* window */ /* window */
#define WKBD_FOCUSNEXT 17 #define WKBD_FOCUSNEXT 18
#define WKBD_FOCUSPREV 18 #define WKBD_FOCUSPREV 19
#define WKBD_WORKSPACE1 20 #define WKBD_WORKSPACE1 21
#define WKBD_WORKSPACE2 21 #define WKBD_WORKSPACE2 22
#define WKBD_WORKSPACE3 22 #define WKBD_WORKSPACE3 23
#define WKBD_WORKSPACE4 23 #define WKBD_WORKSPACE4 24
#define WKBD_WORKSPACE5 24 #define WKBD_WORKSPACE5 25
#define WKBD_WORKSPACE6 25 #define WKBD_WORKSPACE6 26
#define WKBD_WORKSPACE7 26 #define WKBD_WORKSPACE7 27
#define WKBD_WORKSPACE8 27 #define WKBD_WORKSPACE8 28
#define WKBD_WORKSPACE9 28 #define WKBD_WORKSPACE9 29
#define WKBD_WORKSPACE10 29 #define WKBD_WORKSPACE10 30
#define WKBD_NEXTWORKSPACE 30 #define WKBD_NEXTWORKSPACE 31
#define WKBD_PREVWORKSPACE 31 #define WKBD_PREVWORKSPACE 32
#define WKBD_NEXTWSLAYER 32 #define WKBD_NEXTWSLAYER 33
#define WKBD_PREVWSLAYER 33 #define WKBD_PREVWSLAYER 34
/* window shortcuts */ /* window shortcuts */
#define WKBD_WINDOW1 34 #define WKBD_WINDOW1 35
#define WKBD_WINDOW2 35 #define WKBD_WINDOW2 36
#define WKBD_WINDOW3 36 #define WKBD_WINDOW3 37
#define WKBD_WINDOW4 37 #define WKBD_WINDOW4 38
#define WKBD_WINDOW5 38 #define WKBD_WINDOW5 39
#define WKBD_WINDOW6 39 #define WKBD_WINDOW6 40
#define WKBD_WINDOW7 40 #define WKBD_WINDOW7 41
#define WKBD_WINDOW8 41 #define WKBD_WINDOW8 42
#define WKBD_WINDOW9 42 #define WKBD_WINDOW9 43
#define WKBD_WINDOW10 43 #define WKBD_WINDOW10 44
#define WKBD_SWITCH_SCREEN 44 #define WKBD_SWITCH_SCREEN 45
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
# define WKBD_TOGGLE 45 # define WKBD_TOGGLE 46
# define WKBD_LAST 46 # define WKBD_LAST 47
#else #else
# define WKBD_LAST 45 # define WKBD_LAST 46
#endif /* KEEP_XKB_LOCK_STATUS */ #endif /* KEEP_XKB_LOCK_STATUS */
+24 -20
View File
@@ -685,7 +685,7 @@ wKWMGetWorkspaceName(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES); assert(workspace >= 0 && workspace < MAX_WORKSPACES);
if (_XA_KWM_DESKTOP_NAME_[workspace]==0) { if (_XA_KWM_DESKTOP_NAME_[workspace]==0) {
sprintf(buffer, "KWM_DESKTOP_NAME_%d", workspace + 1); snprintf(buffer, sizeof(buffer), "KWM_DESKTOP_NAME_%d", workspace + 1);
_XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False); _XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False);
} }
@@ -1511,7 +1511,7 @@ wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES); assert(workspace >= 0 && workspace < MAX_WORKSPACES);
if (_XA_KWM_DESKTOP_NAME_[workspace]==0) { if (_XA_KWM_DESKTOP_NAME_[workspace]==0) {
sprintf(buffer, "KWM_DESKTOP_NAME_%d", workspace + 1); snprintf(buffer, sizeof(buffer), "KWM_DESKTOP_NAME_%d", workspace + 1);
_XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False); _XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False);
} }
@@ -1583,7 +1583,7 @@ wKWMGetUsableArea(WScreen *scr, WArea *area)
char buffer[64]; char buffer[64];
if (_XA_KWM_WINDOW_REGION_[0]==0) { if (_XA_KWM_WINDOW_REGION_[0]==0) {
sprintf(buffer, "KWM_WINDOW_REGION_%d", 1); snprintf(buffer, sizeof(buffer), "KWM_WINDOW_REGION_%d", 1);
_XA_KWM_WINDOW_REGION_[0] = XInternAtom(dpy, buffer, False); _XA_KWM_WINDOW_REGION_[0] = XInternAtom(dpy, buffer, False);
} }
@@ -1625,7 +1625,7 @@ wKWMSetUsableAreaHint(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES); assert(workspace >= 0 && workspace < MAX_WORKSPACES);
if (_XA_KWM_WINDOW_REGION_[workspace]==0) { if (_XA_KWM_WINDOW_REGION_[workspace]==0) {
sprintf(buffer, "KWM_WINDOW_REGION_%d", workspace+1); snprintf(buffer, sizeof(buffer), "KWM_WINDOW_REGION_%d", workspace+1);
_XA_KWM_WINDOW_REGION_[workspace] = XInternAtom(dpy, buffer, False); _XA_KWM_WINDOW_REGION_[workspace] = XInternAtom(dpy, buffer, False);
} }
@@ -1682,7 +1682,7 @@ writeSocket(int sock, char *data)
{ {
char buffer[128]; char buffer[128];
sprintf(buffer, "%i ", strlen(data)); snprintf(buffer, sizeof(buffer), "%i ", strlen(data));
write(sock, buffer, strlen(buffer)); write(sock, buffer, strlen(buffer));
write(sock, data, strlen(data)); write(sock, data, strlen(data));
} }
@@ -1692,15 +1692,16 @@ static int
connectKFM(WScreen *scr) connectKFM(WScreen *scr)
{ {
char *path; char *path;
char buffer[128]; char *buffer;
char *ptr; char *ptr;
FILE *f; FILE *f;
int pid; int pid;
int sock = 0; int sock = 0;
struct sockaddr_un addr; struct sockaddr_un addr;
char buf[256];
path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/pid"); path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/pid");
strcpy(buffer, getenv("DISPLAY")); buffer = wstrdup(getenv("DISPLAY"));
ptr = strchr(buffer, ':'); ptr = strchr(buffer, ':');
if (ptr) if (ptr)
@@ -1712,12 +1713,12 @@ connectKFM(WScreen *scr)
{ {
char b[32]; char b[32];
sprintf(b, ".%i", scr->screen); snprintf(b, sizeof(b), ".%i", scr->screen);
strcat(buffer, b);
buffer = wstrappend(buffer, b);
} }
ptr = path; path = wstrappend(path, buffer);
path = wstrconcat(ptr, buffer); wfree(buffer);
wfree(ptr);
/* pid file */ /* pid file */
f = fopen(path, "r"); f = fopen(path, "r");
@@ -1725,24 +1726,26 @@ connectKFM(WScreen *scr)
if (!f) if (!f)
return -1; return -1;
buffer[0] = 0; *buf = 0;
fgets(buffer, 123, f); fgets(buf, sizeof(buf), f);
pid = atoi(buffer); buf[sizeof(buf)] = 0;
pid = atoi(buf);
if (pid <= 0) if (pid <= 0)
return -1; return -1;
if (kill(pid, 0) != 0) if (kill(pid, 0) != 0)
return -1; return -1;
buffer[0] = 0; *buf = 0;
fscanf(f, "%s", buffer); fgets(buf, sizeof(buf), f);
buf[sizeof(buf)] = 0;
fclose(f); fclose(f);
sock = socket(AF_UNIX, SOCK_STREAM, 0); sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0) if (sock < 0)
return -1; return -1;
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, buffer); strcpy(addr.sun_path, buf);
if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) { if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
close(sock); close(sock);
@@ -1751,17 +1754,18 @@ connectKFM(WScreen *scr)
path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/magic"); path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/magic");
f = fopen(path, "r"); f = fopen(path, "r");
wfree(path);
if (!f) { if (!f) {
return -1; return -1;
} }
ptr = fgets(buffer, 123, f); ptr = fgets(buf, sizeof(buf), f);
fclose(f); fclose(f);
if (!ptr) { if (!ptr) {
return -1; return -1;
} }
puts(buffer); puts(buffer);
ptr = wstrconcat("auth", buffer); ptr = wstrconcat("auth", buf);
writeSocket(sock, ptr); writeSocket(sock, ptr);
wfree(ptr); wfree(ptr);
+10 -6
View File
@@ -220,17 +220,18 @@ SetupEnvironment(WScreen *scr)
char buf[16]; char buf[16];
if (multiHead) { if (multiHead) {
tmp = wmalloc(strlen(DisplayName)+64); int len = strlen(DisplayName)+64;
sprintf(tmp, "DISPLAY=%s", XDisplayName(DisplayName)); tmp = wmalloc(len);
snprintf(tmp, len, "DISPLAY=%s", XDisplayName(DisplayName));
ptr = strchr(strchr(tmp, ':'), '.'); ptr = strchr(strchr(tmp, ':'), '.');
if (ptr) if (ptr)
*ptr = 0; *ptr = 0;
sprintf(buf, ".%i", scr->screen); snprintf(buf, sizeof(buf), ".%i", scr->screen);
strcat(tmp, buf); strcat(tmp, buf);
putenv(tmp); putenv(tmp);
} }
tmp = wmalloc(60); tmp = wmalloc(60);
sprintf(tmp, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen, snprintf(tmp, 60, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen,
scr->rcontext->attribs->colors_per_channel); scr->rcontext->attribs->colors_per_channel);
putenv(tmp); putenv(tmp);
} }
@@ -735,8 +736,11 @@ main(int argc, char **argv)
multiHead = False; multiHead = False;
DisplayName = XDisplayName(DisplayName); DisplayName = XDisplayName(DisplayName);
str = wmalloc(strlen(DisplayName)+64); {
sprintf(str, "DISPLAY=%s", DisplayName); int len = strlen(DisplayName)+64;
str = wmalloc(len);
snprintf(str, len, "DISPLAY=%s", DisplayName);
}
putenv(str); putenv(str);
#ifdef DEBUG #ifdef DEBUG
+2 -2
View File
@@ -2455,7 +2455,7 @@ saveMenuInfo(proplist_t dict, WMenu *menu, proplist_t key)
proplist_t value, list; proplist_t value, list;
char buffer[256]; char buffer[256];
sprintf(buffer, "%i,%i", menu->frame_x, menu->frame_y); snprintf(buffer, sizeof(buffer), "%i,%i", menu->frame_x, menu->frame_y);
value = PLMakeString(buffer); value = PLMakeString(buffer);
list = PLMakeArrayFromElements(value, NULL); list = PLMakeArrayFromElements(value, NULL);
if (menu->flags.lowered) if (menu->flags.lowered)
@@ -2654,7 +2654,7 @@ restoreMenuRecurs(WScreen *scr, proplist_t menus, WMenu *menu, char *path)
if (strlen(path) + strlen(menu->frame->title) > 510) if (strlen(path) + strlen(menu->frame->title) > 510)
return False; return False;
sprintf(buffer, "%s\\%s", path, menu->frame->title); snprintf(buffer, sizeof(buffer), "%s\\%s", path, menu->frame->title);
key = PLMakeString(buffer); key = PLMakeString(buffer);
entry = PLGetDictionaryEntry(menus, key); entry = PLGetDictionaryEntry(menus, key);
res = False; res = False;
+8 -7
View File
@@ -81,7 +81,7 @@ static void
putidef(char *line, char *name, int value) putidef(char *line, char *name, int value)
{ {
char tmp[64]; char tmp[64];
sprintf(tmp, "%i", value); snprintf(tmp, sizeof(tmp), "%i", value);
strcat(line, name); strcat(line, name);
strcat(line, tmp); strcat(line, tmp);
} }
@@ -824,7 +824,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
case 'w': case 'w':
if (scr->focused_window if (scr->focused_window
&& scr->focused_window->flags.focused) { && scr->focused_window->flags.focused) {
sprintf(tmpbuf, "0x%x", snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
(unsigned int)scr->focused_window->client_win); (unsigned int)scr->focused_window->client_win);
slen = strlen(tmpbuf); slen = strlen(tmpbuf);
olen += slen; olen += slen;
@@ -842,7 +842,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
break; break;
case 'W': case 'W':
sprintf(tmpbuf, "0x%x", snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
(unsigned int)scr->current_workspace + 1); (unsigned int)scr->current_workspace + 1);
slen = strlen(tmpbuf); slen = strlen(tmpbuf);
olen += slen; olen += slen;
@@ -1128,8 +1128,9 @@ EscapeWM_CLASS(char *name, char *class)
} }
if (ename && eclass) { if (ename && eclass) {
ret = wmalloc(strlen(ename)+strlen(eclass)+4); int len = strlen(ename)+strlen(eclass)+4;
sprintf(ret, "%s.%s", ename, eclass); ret = wmalloc(len);
snprintf(ret, len, "%s.%s", ename, eclass);
wfree(ename); wfree(ename);
wfree(eclass); wfree(eclass);
} else if (ename) { } else if (ename) {
@@ -1230,12 +1231,12 @@ SendHelperMessage(WScreen *scr, char type, int workspace, char *msg)
len = (msg ? strlen(msg) : 0) + (workspace >=0 ? 4 : 0) + 1 ; len = (msg ? strlen(msg) : 0) + (workspace >=0 ? 4 : 0) + 1 ;
buffer = wmalloc(len+5); buffer = wmalloc(len+5);
sprintf(buf, "%4i", len); snprintf(buf, len, "%4i", len);
memcpy(buffer, buf, 4); memcpy(buffer, buf, 4);
buffer[4] = type; buffer[4] = type;
i = 5; i = 5;
if (workspace >= 0) { if (workspace >= 0) {
sprintf(buf, "%4i", workspace); snprintf(buf, sizeof(buf), "%4i", workspace);
memcpy(&buffer[i], buf, 4); memcpy(&buffer[i], buf, 4);
i += 4; i += 4;
buffer[i] = 0; buffer[i] = 0;
+2 -2
View File
@@ -270,7 +270,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
XDrawSegments(dpy, root, gc, segment, 4); XDrawSegments(dpy, root, gc, segment, 4);
sprintf(num, "%i", (by - ty - wwin->normal_hints->base_height) / snprintf(num, sizeof(num), "%i", (by - ty - wwin->normal_hints->base_height) /
wwin->normal_hints->height_inc); wwin->normal_hints->height_inc);
fw = WMWidthOfString(scr->info_text_font, num, strlen(num)); fw = WMWidthOfString(scr->info_text_font, num, strlen(num));
@@ -289,7 +289,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
s = 15; s = 15;
} }
mx = x1 + (x2 - x1)/2; mx = x1 + (x2 - x1)/2;
sprintf(num, "%i", (x2 - x1 - wwin->normal_hints->base_width) / snprintf(num, sizeof(num), "%i", (x2 - x1 - wwin->normal_hints->base_width) /
wwin->normal_hints->width_inc); wwin->normal_hints->width_inc);
fw = WMWidthOfString(scr->info_text_font, num, strlen(num)); fw = WMWidthOfString(scr->info_text_font, num, strlen(num));
+32 -5
View File
@@ -331,14 +331,16 @@ getLocalizedMenuFile(char *menu)
{ {
char *buffer; char *buffer;
char *ptr; char *ptr;
int len;
if (!Locale) if (!Locale)
return NULL; return NULL;
buffer = wmalloc(strlen(menu)+32); len = strlen(menu)+32;
buffer = wmalloc(len);
/* try menu.locale_name */ /* try menu.locale_name */
sprintf(buffer, "%s.%s", menu, Locale); snprintf(buffer, len, "%s.%s", menu, Locale);
if (access(buffer, F_OK)==0) { if (access(buffer, F_OK)==0) {
return buffer; return buffer;
} }
@@ -745,6 +747,14 @@ finish:
} }
static void
cleanupWorkspaceMenu(WMenu *menu)
{
if (menu->frame->screen_ptr->workspace_menu == menu)
menu->frame->screen_ptr->workspace_menu = NULL;
}
static WMenuEntry* static WMenuEntry*
addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title) addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
{ {
@@ -758,6 +768,8 @@ addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
scr->flags.added_workspace_menu = 1; scr->flags.added_workspace_menu = 1;
wsmenu = wWorkspaceMenuMake(scr, True); wsmenu = wWorkspaceMenuMake(scr, True);
wsmenu->on_destroy = cleanupWorkspaceMenu;
scr->workspace_menu = wsmenu; scr->workspace_menu = wsmenu;
entry = wMenuAddCallback(menu, title, NULL, NULL); entry = wMenuAddCallback(menu, title, NULL, NULL);
wMenuEntrySetCascade(menu, entry, wsmenu); wMenuEntrySetCascade(menu, entry, wsmenu);
@@ -767,6 +779,15 @@ addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
return entry; return entry;
} }
static void
cleanupWindowsMenu(WMenu *menu)
{
if (menu->frame->screen_ptr->switch_menu == menu)
menu->frame->screen_ptr->switch_menu = NULL;
}
static WMenuEntry* static WMenuEntry*
addWindowsMenu(WScreen *scr, WMenu *menu, char *title) addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
{ {
@@ -781,6 +802,7 @@ addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
scr->flags.added_windows_menu = 1; scr->flags.added_windows_menu = 1;
wwmenu = wMenuCreate(scr, _("Window List"), False); wwmenu = wMenuCreate(scr, _("Window List"), False);
wwmenu->on_destroy = cleanupWindowsMenu;
scr->switch_menu = wwmenu; scr->switch_menu = wwmenu;
wwin = scr->focused_window; wwin = scr->focused_window;
while (wwin) { while (wwin) {
@@ -794,6 +816,7 @@ addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
return entry; return entry;
} }
static WMenuEntry* static WMenuEntry*
addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command, addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command,
char *params, char *file_name) char *params, char *file_name)
@@ -1131,7 +1154,8 @@ readMenuFile(WScreen *scr, char *file_name)
if (!args) { if (!args) {
wwarning(_("could not make arguments for menu file preprocessor")); wwarning(_("could not make arguments for menu file preprocessor"));
} else { } else {
sprintf(command, "%s %s %s", CPP_PATH, args, file_name); snprintf(command, sizeof(command), "%s %s %s",
CPP_PATH, args, file_name);
wfree(args); wfree(args);
file = popen(command, "r"); file = popen(command, "r");
if (!file) { if (!file) {
@@ -1230,7 +1254,8 @@ readMenuPipe(WScreen *scr, char **file_name)
if (!args) { if (!args) {
wwarning(_("could not make arguments for menu file preprocessor")); wwarning(_("could not make arguments for menu file preprocessor"));
} else { } else {
sprintf(command, "%s | %s %s", filename, CPP_PATH, args); snprintf(command, sizeof(command), "%s | %s %s",
filename, CPP_PATH, args);
wfree(args); wfree(args);
file = popen(command, "r"); file = popen(command, "r");
@@ -1746,6 +1771,7 @@ OpenRootMenu(WScreen *scr, int x, int y, int keyboard)
scr->flags.root_menu_changed_shortcuts = 0; scr->flags.root_menu_changed_shortcuts = 0;
scr->flags.added_workspace_menu = 0; scr->flags.added_workspace_menu = 0;
scr->flags.added_windows_menu = 0;
if (scr->root_menu && scr->root_menu->flags.mapped) { if (scr->root_menu && scr->root_menu->flags.mapped) {
menu = scr->root_menu; menu = scr->root_menu;
@@ -1798,8 +1824,9 @@ OpenRootMenu(WScreen *scr, int x, int y, int keyboard)
menu = scr->root_menu; menu = scr->root_menu;
} else { } else {
/* new root menu */ /* new root menu */
if (scr->root_menu) if (scr->root_menu) {
wMenuDestroy(scr->root_menu, True); wMenuDestroy(scr->root_menu, True);
}
scr->root_menu = menu; scr->root_menu = menu;
} }
if (menu) { if (menu) {
+4 -4
View File
@@ -557,7 +557,7 @@ aquireManagerSelection(WScreen *scr)
XEvent ev; XEvent ev;
Time timestamp; Time timestamp;
sprintf(buffer, "WM_S%i", scr->screen); snprintf(buffer, sizeof(buffer), "WM_S%i", scr->screen);
scr->managerAtom = XInternAtom(dpy, buffer, False); scr->managerAtom = XInternAtom(dpy, buffer, False);
/* for race-conditions... */ /* for race-conditions... */
@@ -1015,14 +1015,14 @@ wScreenRestoreState(WScreen *scr)
path = wdefaultspathfordomain("WMState"); path = wdefaultspathfordomain("WMState");
else { else {
char buf[16]; char buf[16];
sprintf(buf, "WMState.%i", scr->screen); snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf); path = wdefaultspathfordomain(buf);
} }
scr->session_state = PLGetProplistWithPath(path); scr->session_state = PLGetProplistWithPath(path);
wfree(path); wfree(path);
if (!scr->session_state && wScreenCount>1) { if (!scr->session_state && wScreenCount>1) {
char buf[16]; char buf[16];
sprintf(buf, "WMState.%i", scr->screen); snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf); path = wdefaultspathfordomain(buf);
scr->session_state = PLGetProplistWithPath(path); scr->session_state = PLGetProplistWithPath(path);
wfree(path); wfree(path);
@@ -1125,7 +1125,7 @@ wScreenSaveState(WScreen *scr)
str = wdefaultspathfordomain("WMState"); str = wdefaultspathfordomain("WMState");
else { else {
char buf[16]; char buf[16];
sprintf(buf, "WMState.%i", scr->screen); snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
str = wdefaultspathfordomain(buf); str = wdefaultspathfordomain(buf);
} }
path = PLMakeString(str); path = PLMakeString(str);
+28 -21
View File
@@ -215,7 +215,7 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
char **argv; char **argv;
int i; int i;
unsigned mask; unsigned mask;
char *class, *instance, *command=NULL, buffer[256]; char *class, *instance, *command=NULL, buffer[512];
proplist_t win_state, cmd, name, workspace; proplist_t win_state, cmd, name, workspace;
proplist_t shaded, miniaturized, hidden, geometry; proplist_t shaded, miniaturized, hidden, geometry;
proplist_t dock, shortcut; proplist_t dock, shortcut;
@@ -234,13 +234,13 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
if (PropGetWMClass(win, &class, &instance)) { if (PropGetWMClass(win, &class, &instance)) {
if (class && instance) if (class && instance)
sprintf(buffer, "%s.%s", instance, class); snprintf(buffer, sizeof(buffer), "%s.%s", instance, class);
else if (instance) else if (instance)
sprintf(buffer, "%s", instance); snprintf(buffer, sizeof(buffer), "%s", instance);
else if (class) else if (class)
sprintf(buffer, ".%s", class); snprintf(buffer, sizeof(buffer), ".%s", class);
else else
sprintf(buffer, "."); snprintf(buffer, sizeof(buffer), ".");
name = PLMakeString(buffer); name = PLMakeString(buffer);
cmd = PLMakeString(command); cmd = PLMakeString(command);
@@ -250,7 +250,8 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
shaded = wwin->flags.shaded ? sYes : sNo; shaded = wwin->flags.shaded ? sYes : sNo;
miniaturized = wwin->flags.miniaturized ? sYes : sNo; miniaturized = wwin->flags.miniaturized ? sYes : sNo;
hidden = wwin->flags.hidden ? sYes : sNo; hidden = wwin->flags.hidden ? sYes : sNo;
sprintf(buffer, "%ix%i+%i+%i", wwin->client.width, wwin->client.height, snprintf(buffer, sizeof(buffer), "%ix%i+%i+%i",
wwin->client.width, wwin->client.height,
wwin->frame_x, wwin->frame_y); wwin->frame_x, wwin->frame_y);
geometry = PLMakeString(buffer); geometry = PLMakeString(buffer);
@@ -261,7 +262,7 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
} }
} }
sprintf(buffer, "%u", mask); snprintf(buffer, sizeof(buffer), "%u", mask);
shortcut = PLMakeString(buffer); shortcut = PLMakeString(buffer);
win_state = PLMakeDictionaryFromEntries(sName, name, win_state = PLMakeDictionaryFromEntries(sName, name,
@@ -860,7 +861,7 @@ makeAttributeState(WWindow *wwin)
#define W_FLAG(wwin, FLAG) ((wwin)->defined_user_flags.FLAG \ #define W_FLAG(wwin, FLAG) ((wwin)->defined_user_flags.FLAG \
? (wwin)->user_flags.FLAG : -1) ? (wwin)->user_flags.FLAG : -1)
sprintf(buffer, snprintf(buffer, sizeof(buffer),
"%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", "%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
W_FLAG(no_titlebar), W_FLAG(no_titlebar),
W_FLAG(no_resizable), W_FLAG(no_resizable),
@@ -912,7 +913,7 @@ makeClientState(WWindow *wwin)
proplist_t state; proplist_t state;
proplist_t tmp; proplist_t tmp;
char *str; char *str;
char buffer[256]; char buffer[512];
int i; int i;
unsigned shortcuts; unsigned shortcuts;
@@ -940,13 +941,13 @@ makeClientState(WWindow *wwin)
appendStringInArray(state, wwin->frame->name); appendStringInArray(state, wwin->frame->name);
/* geometry */ /* geometry */
sprintf(buffer, "%i %i %i %i %i %i", wwin->frame_x, wwin->frame_y, snprintf(buffer, sizeof(buffer), "%i %i %i %i %i %i", wwin->frame_x, wwin->frame_y,
wwin->client.width, wwin->client.height, wwin->client.width, wwin->client.height,
wwin->flags.user_changed_width, wwin->flags.user_changed_height); wwin->flags.user_changed_width, wwin->flags.user_changed_height);
appendStringInArray(state, buffer); appendStringInArray(state, buffer);
/* state */ /* state */
sprintf(buffer, "%i %i %i", wwin->flags.miniaturized, snprintf(buffer, sizeof(buffer), "%i %i %i", wwin->flags.miniaturized,
wwin->flags.shaded, wwin->flags.maximized); wwin->flags.shaded, wwin->flags.maximized);
appendStringInArray(state, buffer); appendStringInArray(state, buffer);
@@ -956,7 +957,7 @@ makeClientState(WWindow *wwin)
PLRelease(tmp); PLRelease(tmp);
/* workspace */ /* workspace */
sprintf(buffer, "%i", wwin->frame->workspace); snprintf(buffer, sizeof(buffer), "%i", wwin->frame->workspace);
appendStringInArray(state, buffer); appendStringInArray(state, buffer);
/* app state (repeated for all windows of the app) */ /* app state (repeated for all windows of the app) */
@@ -971,7 +972,7 @@ makeClientState(WWindow *wwin)
shortcuts |= 1 << i; shortcuts |= 1 << i;
} }
} }
sprintf(buffer, "%ui", shortcuts); snprintf(buffer, sizeof(buffer), "%ui", shortcuts);
appendStringInArray(tmp, buffer); appendStringInArray(tmp, buffer);
return state; return state;
@@ -993,6 +994,7 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
char *discardCmd = NULL; char *discardCmd = NULL;
time_t t; time_t t;
proplist_t state; proplist_t state;
int len;
#ifdef DEBUG1 #ifdef DEBUG1
puts("received SaveYourselfPhase2 SM message"); puts("received SaveYourselfPhase2 SM message");
@@ -1013,7 +1015,8 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
if (!prefix) if (!prefix)
prefix = "."; prefix = ".";
statefile = malloc(strlen(prefix)+64); len = strlen(prefix)+64;
statefile = malloc(len);
if (!statefile) { if (!statefile) {
wwarning(_("out of memory while saving session state")); wwarning(_("out of memory while saving session state"));
goto fail; goto fail;
@@ -1023,10 +1026,10 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
i = 0; i = 0;
do { do {
if (gsPrefix) if (gsPrefix)
sprintf(statefile, "%s/.AppInfo/WindowMaker/wmaker.%l%i.state", snprintf(statefile, len, "%s/.AppInfo/WindowMaker/wmaker.%l%i.state",
prefix, t, i); prefix, t, i);
else else
sprintf(statefile, "%s/wmaker.%l%i.state", prefix, t, i); snprintf(statefile, len, "%s/wmaker.%l%i.state", prefix, t, i);
i++; i++;
} while (access(F_OK, statefile)!=-1); } while (access(F_OK, statefile)!=-1);
@@ -1050,7 +1053,7 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
scr = wScreenWithNumber(i); scr = wScreenWithNumber(i);
sprintf(buf, "%i", scr->screen); snprintf(buf, sizeof(buf), "%i", scr->screen);
pscreen = PLMakeArrayFromElements(PLMakeString(buf), NULL); pscreen = PLMakeArrayFromElements(PLMakeString(buf), NULL);
wwin = scr->focused_window; wwin = scr->focused_window;
@@ -1134,10 +1137,14 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
prop[0].vals[j].value = statefile; prop[0].vals[j].value = statefile;
prop[0].vals[j].length = strlen(statefile); prop[0].vals[j].length = strlen(statefile);
discardCmd = malloc(strlen(statefile)+8); {
int len = strlen(statefile)+8;
discardCmd = malloc(len);
if (!discardCmd) if (!discardCmd)
goto fail; goto fail;
sprintf(discardCmd, "rm %s", statefile); snprintf(discardCmd, len, "rm %s", statefile);
}
prop[2].name = SmDiscardCommand; prop[2].name = SmDiscardCommand;
prop[2].type = SmARRAY8; prop[2].type = SmARRAY8;
prop[2].vals[0] = discardCmd; prop[2].vals[0] = discardCmd;
@@ -1317,7 +1324,7 @@ wSessionConnectManager(char **argv, int argc)
/* The XSMP doc from X11R6.1 says it contains the user name, /* The XSMP doc from X11R6.1 says it contains the user name,
* but every client implementation I saw places the uid # */ * but every client implementation I saw places the uid # */
sprintf(uid, "%i", getuid()); snprintf(uid, sizeof(uid), "%i", getuid());
prop2val.value = uid; prop2val.value = uid;
prop2val.length = strlen(uid); prop2val.length = strlen(uid);
prop[1].name = SmUserID; prop[1].name = SmUserID;
@@ -1336,7 +1343,7 @@ wSessionConnectManager(char **argv, int argc)
prop[2].vals = &prop3val; prop[2].vals = &prop3val;
/* Our PID. Not required but might be usefull */ /* Our PID. Not required but might be usefull */
sprintf(pid, "%i", getpid()); snprintf(pid, sizeof(pid), "%i", getpid());
prop4val.value = pid; prop4val.value = pid;
prop4val.length = strlen(pid); prop4val.length = strlen(pid);
prop[3].name = SmProcessID; prop[3].name = SmProcessID;
+12 -1
View File
@@ -715,6 +715,12 @@ static char *atomNames[] = {
GNUSTEP_TITLEBAR_STATE GNUSTEP_TITLEBAR_STATE
}; };
static void
handle_sigpipe(int signum)
{
if (0) signum=0; /* To avoid a gcc warning */
return;
}
/* /*
*---------------------------------------------------------- *----------------------------------------------------------
@@ -847,7 +853,12 @@ StartUp(Bool defaultScreenOnly)
sigaction(SIGUSR2, &sig_action, NULL); sigaction(SIGUSR2, &sig_action, NULL);
/* ignore dead pipe */ /* ignore dead pipe */
sig_action.sa_handler = SIG_IGN; sig_action.sa_handler = &handle_sigpipe;
/* Because POSIX mandates that only signal with handlers are reset
accross an exec*(), we do not want to propagate ignoring SIGPIPEs
to children. Hence the dummy handler.
Philippe Troin <phil@fifi.org>
*/
sig_action.sa_flags = SA_RESTART; sig_action.sa_flags = SA_RESTART;
sigaction(SIGPIPE, &sig_action, NULL); sigaction(SIGPIPE, &sig_action, NULL);
+13 -10
View File
@@ -181,6 +181,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
WMenu *switchmenu = scr->switch_menu; WMenu *switchmenu = scr->switch_menu;
WMenuEntry *entry; WMenuEntry *entry;
char title[MAX_MENU_TEXT_LENGTH+6]; char title[MAX_MENU_TEXT_LENGTH+6];
int len = MAX_MENU_TEXT_LENGTH+6;
int i; int i;
int checkVisibility = 0; int checkVisibility = 0;
@@ -203,9 +204,9 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
return; return;
if (wwin->frame->title) if (wwin->frame->title)
sprintf(title, "%s", wwin->frame->title); snprintf(title, len, "%s", wwin->frame->title);
else else
sprintf(title, "%s", DEF_WINDOW_TITLE); snprintf(title, len, "%s", DEF_WINDOW_TITLE);
t = ShrinkString(scr->menu_entry_font, title, MAX_WINDOWLIST_WIDTH); t = ShrinkString(scr->menu_entry_font, title, MAX_WINDOWLIST_WIDTH);
if (IS_OMNIPRESENT(wwin)) if (IS_OMNIPRESENT(wwin))
@@ -220,9 +221,9 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
entry->flags.indicator = 1; entry->flags.indicator = 1;
entry->rtext = wmalloc(MAX_WORKSPACENAME_WIDTH+8); entry->rtext = wmalloc(MAX_WORKSPACENAME_WIDTH+8);
if (IS_OMNIPRESENT(wwin)) if (IS_OMNIPRESENT(wwin))
sprintf(entry->rtext, "[*]"); snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH, "[*]");
else else
sprintf(entry->rtext, "[%s]", snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH, "[%s]",
scr->workspaces[wwin->frame->workspace]->name); scr->workspaces[wwin->frame->workspace]->name);
if (wwin->flags.hidden) { if (wwin->flags.hidden) {
@@ -262,7 +263,8 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
snprintf(title, MAX_MENU_TEXT_LENGTH, "%s", snprintf(title, MAX_MENU_TEXT_LENGTH, "%s",
wwin->frame->title); wwin->frame->title);
else else
sprintf(title, "%s", DEF_WINDOW_TITLE); snprintf(title, MAX_MENU_TEXT_LENGTH, "%s",
DEF_WINDOW_TITLE);
t = ShrinkString(scr->menu_entry_font, title, MAX_WINDOWLIST_WIDTH); t = ShrinkString(scr->menu_entry_font, title, MAX_WINDOWLIST_WIDTH);
entry->text = t; entry->text = t;
@@ -278,10 +280,11 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
int it, ion; int it, ion;
if (IS_OMNIPRESENT(wwin)) { if (IS_OMNIPRESENT(wwin)) {
sprintf(entry->rtext, "[*]"); snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
"[*]");
} else { } else {
sprintf(entry->rtext, "[%s]", snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
scr->workspaces[wwin->frame->workspace]->name); "[%s]", scr->workspaces[wwin->frame->workspace]->name);
} }
rt = entry->rtext; rt = entry->rtext;
@@ -362,9 +365,9 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
if (wwin->frame->workspace==workspace if (wwin->frame->workspace==workspace
&& !IS_OMNIPRESENT(wwin)) { && !IS_OMNIPRESENT(wwin)) {
if (IS_OMNIPRESENT(wwin)) if (IS_OMNIPRESENT(wwin))
sprintf(menu->entries[i]->rtext, "[*]"); snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[*]");
else else
sprintf(menu->entries[i]->rtext, "[%s]", snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[%s]",
scr->workspaces[wwin->frame->workspace]->name); scr->workspaces[wwin->frame->workspace]->name);
menu->flags.realized = 0; menu->flags.realized = 0;
} }
+3 -2
View File
@@ -357,8 +357,9 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
char *path = NULL; char *path = NULL;
char *tmp; char *tmp;
if ( wwin->wm_instance && wwin->wm_class ) { if ( wwin->wm_instance && wwin->wm_class ) {
tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7); int len = strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7;
sprintf(tmp,"%s.%s.menu",wwin->wm_instance,wwin->wm_class); tmp=wmalloc(len);
snprintf(tmp,len,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
path = wfindfile(DEF_USER_MENU_PATHS,tmp); path = wfindfile(DEF_USER_MENU_PATHS,tmp);
wfree(tmp); wfree(tmp);
+1 -1
View File
@@ -1792,7 +1792,7 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
#ifndef NO_WINDOW_ENUMERATOR #ifndef NO_WINDOW_ENUMERATOR
if (instIndex > 0) { if (instIndex > 0) {
sprintf(prefix, " [%i]", instIndex); snprintf(prefix, sizeof(prefix), " [%i]", instIndex);
title = wstrconcat(title, prefix); title = wstrconcat(title, prefix);
} }
+4 -2
View File
@@ -262,12 +262,14 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
WMenu *smenu = menu->cascades[menu->entries[MC_SHORTCUT]->cascade]; WMenu *smenu = menu->cascades[menu->entries[MC_SHORTCUT]->cascade];
int i; int i;
char *buffer; char *buffer;
int buflen;
KeyCode kcode; KeyCode kcode;
if (!smenu) if (!smenu)
return; return;
buffer = wmalloc(strlen(_("Set Shortcut"))+16); buflen = strlen(_("Set Shortcut"))+16;
buffer = wmalloc(buflen);
for (i=WO_ENTRIES; i<smenu->entry_no; i++) { for (i=WO_ENTRIES; i<smenu->entry_no; i++) {
char *tmp; char *tmp;
@@ -275,7 +277,7 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
WMenuEntry *entry = smenu->entries[i]; WMenuEntry *entry = smenu->entries[i];
WMArray *shortSelWindows = wwin->screen_ptr->shortcutWindows[shortcutNo]; WMArray *shortSelWindows = wwin->screen_ptr->shortcutWindows[shortcutNo];
sprintf(buffer, "%s %i", _("Set Shortcut"), shortcutNo+1); snprintf(buffer, buflen, "%s %i", _("Set Shortcut"), shortcutNo+1);
if (!shortSelWindows) { if (!shortSelWindows) {
entry->flags.indicator_on = 0; entry->flags.indicator_on = 0;
+12 -8
View File
@@ -380,9 +380,10 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
if (!path) { if (!path) {
char *buf; char *buf;
int len = strlen(file)+80;
buf = wmalloc(strlen(file)+80); buf = wmalloc(len);
sprintf(buf, _("Could not find icon \"%s\" specified for this window"), snprintf(buf, len, _("Could not find icon \"%s\" specified for this window"),
file); file);
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf, wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL); _("OK"), NULL, NULL);
@@ -396,9 +397,10 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
if (!pixmap) { if (!pixmap) {
char *buf; char *buf;
int len = strlen(file)+80;
buf = wmalloc(strlen(file)+80); buf = wmalloc(len);
sprintf(buf, _("Could not open specified icon \"%s\":%s"), snprintf(buf, len, _("Could not open specified icon \"%s\":%s"),
file, RMessageForError(RErrorCode)); file, RMessageForError(RErrorCode));
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf, wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL); _("OK"), NULL, NULL);
@@ -1123,7 +1125,7 @@ selectSpecification(WMWidget *bPtr, void *data)
InspectorPanel *panel = (InspectorPanel*)data; InspectorPanel *panel = (InspectorPanel*)data;
char *str; char *str;
WWindow *wwin = panel->inspected; WWindow *wwin = panel->inspected;
int len;
if (bPtr == panel->defaultRb && (wwin->wm_instance || wwin->wm_class)) { if (bPtr == panel->defaultRb && (wwin->wm_instance || wwin->wm_class)) {
WMSetButtonEnabled(panel->applyBtn, False); WMSetButtonEnabled(panel->applyBtn, False);
@@ -1131,10 +1133,12 @@ selectSpecification(WMWidget *bPtr, void *data)
WMSetButtonEnabled(panel->applyBtn, True); WMSetButtonEnabled(panel->applyBtn, True);
} }
str = wmalloc(16 + strlen(wwin->wm_instance ? wwin->wm_instance : "?") len = 16 + strlen(wwin->wm_instance ? wwin->wm_instance : "?")
+ strlen(wwin->wm_class ? wwin->wm_class : "?")); + strlen(wwin->wm_class ? wwin->wm_class : "?");
sprintf(str, _("Inspecting %s.%s"), str = wmalloc(len);
snprintf(str, len, _("Inspecting %s.%s"),
wwin->wm_instance ? wwin->wm_instance : "?", wwin->wm_instance ? wwin->wm_instance : "?",
wwin->wm_class ? wwin->wm_class : "?"); wwin->wm_class ? wwin->wm_class : "?");
+4 -3
View File
@@ -10,6 +10,7 @@
echo gathering information for bug tracking... echo gathering information for bug tracking...
uname -a > sysinfo.txt uname -a > sysinfo.txt
wmaker --version >> sysinfo.txt
echo "=============== xdpyinfo ================" >> sysinfo.txt echo "=============== xdpyinfo ================" >> sysinfo.txt
xdpyinfo >> sysinfo.txt xdpyinfo >> sysinfo.txt
echo "=============== env ================" >> sysinfo.txt echo "=============== env ================" >> sysinfo.txt
@@ -25,9 +26,9 @@ cat ../config.cache ../Version >> sysinfo.txt 2> /dev/null
cat config.cache Version >> sysinfo.txt 2> /dev/null cat config.cache Version >> sysinfo.txt 2> /dev/null
echo "=============== configuration dir ===========" >> sysinfo.txt echo "=============== configuration dir ===========" >> sysinfo.txt
WDIR=$HOME/gnustep/Library/WindowMaker WDIR=$HOME/GNUstep/Defaults
if [ -d $WDIR ]; then if [ -d $WDIR ]; then
for i in preferences menu app_options winitrc shortcuts; do for i in WMGLOBAL WMRootMenu WMState WMWindowAttributes WindowMaker; do
if [ -f $WDIR/$i ]; then if [ -f $WDIR/$i ]; then
echo "============== $i ========" >> sysinfo.txt echo "============== $i ========" >> sysinfo.txt
cat $WDIR/$i >> sysinfo.txt cat $WDIR/$i >> sysinfo.txt
@@ -37,6 +38,6 @@ else
echo "No config directory found" >> sysinfo.txt echo "No config directory found" >> sysinfo.txt
fi fi
gzip -9 sysinfo.txt bzip2 -9f sysinfo.txt || gzip -9f sysinfo.txt
echo done. echo done.
+23 -7
View File
@@ -61,7 +61,7 @@ static BufferData *newWindow(int magfactor);
int windowCount = 0; int windowCount = 0;
int rectBufferSize = 32; int rectBufferSize = 32;
Display *dpy; Display *dpy, *vdpy;
WMScreen *scr; WMScreen *scr;
unsigned int black; unsigned int black;
WMColor *cursorColor1; WMColor *cursorColor1;
@@ -212,19 +212,19 @@ updateImage(BufferData *data, int rx, int ry)
gw += gx; gw += gx;
gx = 0; gx = 0;
} }
if (gx + gw >= WidthOfScreen(DefaultScreenOfDisplay(dpy))) { if (gx + gw >= WidthOfScreen(DefaultScreenOfDisplay(vdpy))) {
gw = WidthOfScreen(DefaultScreenOfDisplay(dpy)) - gx; gw = WidthOfScreen(DefaultScreenOfDisplay(vdpy)) - gx;
} }
if (gy < 0) { if (gy < 0) {
yoffs = abs(gy); yoffs = abs(gy);
gh += gy; gh += gy;
gy = 0; gy = 0;
} }
if (gy + gh >= HeightOfScreen(DefaultScreenOfDisplay(dpy))) { if (gy + gh >= HeightOfScreen(DefaultScreenOfDisplay(vdpy))) {
gh = HeightOfScreen(DefaultScreenOfDisplay(dpy)) - gy; gh = HeightOfScreen(DefaultScreenOfDisplay(vdpy)) - gy;
} }
image = XGetImage(dpy, DefaultRootWindow(dpy), gx, gy, gw, gh, image = XGetImage(vdpy, DefaultRootWindow(vdpy), gx, gy, gw, gh,
AllPlanes, ZPixmap); AllPlanes, ZPixmap);
@@ -453,6 +453,7 @@ int main(int argc, char **argv)
BufferData *data; BufferData *data;
int i; int i;
char *display = ""; char *display = "";
char *vdisplay = NULL;
int magfactor = 2; int magfactor = 2;
#if 0 #if 0
WMButton *radio, *tradio; WMButton *radio, *tradio;
@@ -466,6 +467,11 @@ int main(int argc, char **argv)
if (i >= argc) if (i >= argc)
goto help; goto help;
display = argv[i]; display = argv[i];
} else if (strcmp(argv[i], "-vdisplay")==0) {
i++;
if (i >= argc)
goto help;
vdisplay = argv[i];
} else if (strcmp(argv[i], "-m")==0) { } else if (strcmp(argv[i], "-m")==0) {
i++; i++;
if (i >= argc) if (i >= argc)
@@ -505,12 +511,22 @@ int main(int argc, char **argv)
} }
} }
dpy = XOpenDisplay(""); dpy = XOpenDisplay(display);
if (!dpy) { if (!dpy) {
puts("couldnt open display"); puts("couldnt open display");
exit(1); exit(1);
} }
if (vdisplay) {
vdpy = XOpenDisplay(vdisplay);
if (!vdpy) {
puts("couldnt open display to be viewed");
exit(1);
}
} else {
vdpy = dpy;
}
/* calculate how many rectangles we can send in a trip to the server */ /* calculate how many rectangles we can send in a trip to the server */
rectBufferSize = XMaxRequestSize(dpy) - 128; rectBufferSize = XMaxRequestSize(dpy) - 128;
rectBufferSize /= sizeof(XRectangle); rectBufferSize /= sizeof(XRectangle);
+3
View File
@@ -68,6 +68,8 @@ copy() {
if [ "$LOCALE" ]; then if [ "$LOCALE" ]; then
if [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then if [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then
source=$GLOBALDIR/plmenu.${LOCALE%_*} source=$GLOBALDIR/plmenu.${LOCALE%_*}
elif [ -f $GLOBALDIR/menu.${LOCALE%_*} ]; then
source=$GLOBALDIR/menu.${LOCALE%_*}
else else
source=$GLOBALDIR/plmenu source=$GLOBALDIR/plmenu
fi fi
@@ -266,6 +268,7 @@ test -f ~$GSDIR/Library/WindowMaker/exitscript || \
cp $GLOBALDIR/exitscript.sh $GSDIR/Library/WindowMaker/exitscript cp $GLOBALDIR/exitscript.sh $GSDIR/Library/WindowMaker/exitscript
chmod +rx $GSDIR/Library/WindowMaker/exitscript chmod +rx $GSDIR/Library/WindowMaker/exitscript
# no need to call wmchlocale --auto, since national menu is already copied
wsetfont --auto wsetfont --auto
# xx herbert # xx herbert
+30 -9
View File
@@ -2,12 +2,19 @@
# #
# Change locale-dependent settings of WindowMaker. # Change locale-dependent settings of WindowMaker.
# #
# v0.1 by judas@hell <tomka@oalevice.sk> on Jan 28 2001 # v0.1 by Jan "judas" Tomka <tomka@oalevice.sk> on Jan 28 2001
# #
# v0.2 by Jan "judas" Tomka <tomka@oalevice.sk> on Feb 22 2001
# - removed --nodef option
# - better error recognizing
# - added --test switch like in wsetfont
#
# v0.3 by Jan "judas" Tomka <tomka@oalevice.sk> on May 04 2001
# - bad bugs with --test found and corrected
# #
PROGRAM=`basename $0` PROGRAM=`basename $0`
VERSION="0.1" VERSION="0.3"
if [ "x$GNUSTEP_USER_ROOT" = "x" ]; then if [ "x$GNUSTEP_USER_ROOT" = "x" ]; then
GSDIR="$HOME/GNUstep" GSDIR="$HOME/GNUstep"
@@ -23,13 +30,13 @@ LOCALDIR="$GSDIR/Library/WindowMaker"
help_msg() { help_msg() {
echo -e "\n"\ echo -e "\n"\
"$PROGRAM, v$VERSION by judas@hell\n"\ "$PROGRAM, v$VERSION by Jan \"judas\" Tomka\n"\
"Syntax:\n"\ "Syntax:\n"\
" $PROGRAM [--auto] [--nodef] [<new-locale> | default]\n"\ " $PROGRAM [--auto] [--test] [<new-locale> | default]\n"\
"\n"\ "\n"\
"<new-locale> locale you want WindowMaker to move to (e.g. ja or default)\n"\ "<new-locale> locale you want WindowMaker to move to (e.g. ja or default)\n"\
"--auto use current locale\n"\ "--auto use current locale\n"\
"--nodef try to change only codings of fonts\n" "--test don't write anything\n"
exit 0 exit 0
} }
@@ -41,8 +48,8 @@ for i in $*; do
case $i in case $i in
--auto) --auto)
auto="YES";; auto="YES";;
--nodef) --test)
nodef="--nodef";; test="--test";;
*) *)
if [ -z "$new_locale" ]; then if [ -z "$new_locale" ]; then
new_locale="$i" new_locale="$i"
@@ -54,6 +61,7 @@ for i in $*; do
done done
if [ "$new_locale" = "default" ]; then if [ "$new_locale" = "default" ]; then
new_locale="" new_locale=""
default="YES"
fi fi
if [ -n "$auto" ] && [ -z "$new_locale" ]; then if [ -n "$auto" ] && [ -z "$new_locale" ]; then
@@ -64,12 +72,20 @@ if [ -n "$auto" ] && [ -z "$new_locale" ]; then
fi fi
if [ -z "$new_locale" ]; then if [ -z "$new_locale" ]; then
if [ -z "$default" ]; then
echo -e "\nNo locale is set, using default...\n" >/dev/stderr echo -e "\nNo locale is set, using default...\n" >/dev/stderr
fi
elif ! (locale -a |grep "^$new_locale$" &>/dev/null); then elif ! (locale -a |grep "^$new_locale$" &>/dev/null); then
if [ -z "$auto" ]; then
echo -e "\n"\
"Locale $new_locale is not supported on your system..."\
"\n" >/dev/stderr
else
echo -e "\n"\ echo -e "\n"\
"Locale $new_locale currently set is not supported on your system...\n"\ "Locale $new_locale currently set is not supported on your system...\n"\
"Check your LANG and LC_ALL variables or install your locale support\n"\ "Check your LANG and LC_ALL variables or install your locale support\n"\
"\n" >/dev/stderr "\n" >/dev/stderr
fi
exit 1 exit 1
fi fi
@@ -77,13 +93,18 @@ echo -n "Setting Window Maker root menu... "
if [ -z "$new_locale" ] || [ "$new_locale" = "en" ]; then if [ -z "$new_locale" ] || [ "$new_locale" = "en" ]; then
menu_list="plmenu menu" menu_list="plmenu menu"
args="default"
else else
menu_list="plmenu.$new_locale menu.$new_locale plmenu menu" menu_list="plmenu.$new_locale menu.$new_locale plmenu menu"
args="--locale=$new_locale"
fi fi
echo -n "Setting Window Maker root menu... "
for new_menu in $menu_list; do for new_menu in $menu_list; do
for wm_dir in $LOCALDIR $GLOBALDIR; do for wm_dir in $LOCALDIR $GLOBALDIR; do
if [ -f "$wm_dir/$new_menu" ]; then if [ -f "$wm_dir/$new_menu" ]; then
if [ -n "$new_locale" ] && echo "$new_menu" |grep "menu.$new_locale" &>/dev/null; then if [ -z "$new_locale" ] || ( [ -n "$new_locale" ] && echo "$new_menu" |grep "menu.$new_locale" &>/dev/null ); then
echo "success" echo "success"
else else
echo "fail (copying default)" echo "fail (copying default)"
@@ -118,7 +139,7 @@ if wsetfont "$args" &>/dev/null; then
echo "success" echo "success"
else else
echo -n "fail" echo -n "fail"
if wsetfont default &>/dev/null; then if wsetfont default "$test" &>/dev/null; then
echo " (setting default)" echo " (setting default)"
else else
echo " (totally)" echo " (totally)"
+1 -1
View File
@@ -1423,7 +1423,7 @@ main(int argc, char **argv)
render_mode = RDitheredRendering; render_mode = RDitheredRendering;
rattr.flags = RC_RenderMode | RC_ColorsPerChannel rattr.flags = RC_RenderMode | RC_ColorsPerChannel
| RC_StandardColormap; | RC_StandardColormap | RC_DefaultVisual;
rattr.render_mode = render_mode; rattr.render_mode = render_mode;
rattr.colors_per_channel = cpc; rattr.colors_per_channel = cpc;
rattr.standard_colormap_mode = RCreateStdColormap; rattr.standard_colormap_mode = RCreateStdColormap;
+7 -2
View File
@@ -77,8 +77,8 @@ for i in $*; do
"--auto") "--auto")
auto="YES";; auto="YES";;
*) *)
if echo $i |grep "^--locale=" &>/dev/null; then if echo $i |grep "^--locale=" >/dev/null 2>&1; then
new_locale=$(echo $i |sed -e "s|--locale=||" -) new_locale=$(echo $i |sed -e "s|--locale=||")
elif [ -z $family ]; then elif [ -z $family ]; then
family=$i family=$i
else else
@@ -333,6 +333,11 @@ for i in $DomainNames; do
fi fi
fi fi
fi fi
tmp1="$j=\"`eval echo '${'$j'}'`\"" # cosmetic length workaround
echo '<<<<'
if [ ${#tmp1} -lt 80 ]; then
tmp1=`echo $tmp1 | sed -e 's/^\(.\{1,76\}\).*/\1/'`
fi
eval _j="\$$j" eval _j="\$$j"
echo $j="${_j}" echo $j="${_j}"
$WDWRITE $i $j \"${_j}\" $WDWRITE $i $j \"${_j}\"