1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-24 09:31: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
- fixed problem with alpha images showing a blue tint on big endian machines
- fixed problem with WINGs based apps exiting with a "X_RotateProperties"
related error when text was selected in a textfiled (including WPrefs.app
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
(Johnny C. Lam <lamj@stat.cmu.edu>)
- Fixed crash with long titles in the window list menu
(Alban Hertroys <dalroi@wit401310.student.utwente.nl>)
- Fixed crash with long titles in the window list menu (buffer overflow)
(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:
.............................
+3
View File
@@ -39,6 +39,9 @@ SUPPORTED PLATFORMS
- IBM S/390 running Linux
- iBook running Darwin
- 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.
+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 \
Install acconfig.h INSTALL.pt README.pt\
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
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.
Added None option to MoveDisplay and ResizeDisplay
--- 0.65.0
+1 -1
View File
@@ -1195,7 +1195,7 @@ static void handleResize(W_ViewDelegate *self, WMView *view)
vh = WMIN(size.height, height);
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);
+5 -2
View File
@@ -2,7 +2,7 @@
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
LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@
LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@ @INTLIBS@
EXTRA_DIST = BUGS
@@ -50,6 +50,7 @@ libWINGs_a_SOURCES = \
wcolor.c \
wcolorpanel.c \
wcolorwell.c \
wconfig.h \
wevent.c \
wfilepanel.c \
wframe.c \
@@ -95,8 +96,10 @@ libWUtil_a_SOURCES = \
userdefaults.c \
usleep.c \
wapplication.c \
wconfig.h \
wutil.c
CPPFLAGS = @CPPFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\"
INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
+16 -4
View File
@@ -29,6 +29,7 @@
#include "../src/config.h"
#include "wconfig.h"
#include <unistd.h>
#include <fcntl.h>
@@ -351,6 +352,12 @@ getSocketAddress(char* name, char* service, char* protocol) /*FOLD00*/
return &socketaddr;
}
static void
handle_sigpipe(int signum)
{
if (0) signum=0; /* To avoid a gcc warning */
return;
}
static WMConnection*
createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
@@ -377,7 +384,12 @@ createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
/* ignore dead pipe */
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;
sigaction(SIGPIPE, &sig_action, NULL);
SigInitialized = True;
@@ -448,7 +460,7 @@ WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /
WCErrorCode = 0;
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination");
wwarning(_("Bad address-service-protocol combination"));
return NULL;
}
@@ -513,7 +525,7 @@ WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*
host = "localhost";
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination");
wwarning(_("Bad address-service-protocol combination"));
return NULL;
}
@@ -556,7 +568,7 @@ WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
host = "localhost";
if ((socketaddr = getSocketAddress(host, service, protocol)) == NULL) {
wwarning("Bad address-service-protocol combination");
wwarning(_("Bad address-service-protocol combination"));
return NULL;
}
+8 -6
View File
@@ -21,6 +21,8 @@
#include "../src/config.h"
#include "wconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -51,12 +53,12 @@ wstrerror(int errnum)
if (errno < sys_nerr)
return sys_errlist[errnum];
sprintf (buf, "Unknown error %d", errnum);
sprintf (buf, _("Unknown error %d"), errnum);
return buf;
#else /* no strerror() and no sys_errlist[] */
static char buf[] = "Error 12345678901234567890";
sprintf(buf, "Error %d", errnum);
sprintf(buf, _("Error %d"), errnum);
return buf;
#endif
}
@@ -107,7 +109,7 @@ wwarning(const char *msg, ...)
strcat(buf,"\n");
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" warning: ",stderr);
fputs(_(" warning: "),stderr);
fputs(buf, stderr);
fflush(stdout);
fflush(stderr);
@@ -134,7 +136,7 @@ wfatal(const char *msg, ...)
strcat(buf,"\n");
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" fatal error: ",stderr);
fputs(_(" fatal error: "),stderr);
fputs(buf, stderr);
fflush(stdout);
fflush(stderr);
@@ -160,7 +162,7 @@ wsyserror(const char *msg, ...)
vsnprintf(buf, MAXLINE-3, msg, args);
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" error: ", stderr);
fputs(_(" error: "), stderr);
fputs(buf, stderr);
fputs(": ", stderr);
fputs(wstrerror(error), stderr);
@@ -189,7 +191,7 @@ wsyserrorwithcode(int error, const char *msg, ...)
vsnprintf(buf, MAXLINE-3, msg, args);
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" error: ", stderr);
fputs(_(" error: "), stderr);
fputs(buf, stderr);
fputs(": ", stderr);
fputs(wstrerror(error), stderr);
+4 -2
View File
@@ -21,6 +21,8 @@
#include "../src/config.h"
#include "wconfig.h"
#include "WUtil.h"
#include <stdlib.h>
@@ -45,7 +47,7 @@ wgethomedir()
user = getpwuid(getuid());
if (!user) {
wsyserror("could not get password entry for UID %i", getuid());
wsyserror(_("could not get password entry for UID %i"), getuid());
return "/";
}
if (!user->pw_dir) {
@@ -63,7 +65,7 @@ getuserhomedir(char *username)
user = getpwnam(username);
if (!user) {
wsyserror("could not get password entry for user %s", username);
wsyserror(_("could not get password entry for user %s"), username);
return NULL;
}
if (!user->pw_dir) {
+3 -1
View File
@@ -21,6 +21,8 @@
#include "../src/config.h"
#include "wconfig.h"
#include <unistd.h>
#include <string.h>
#include <netdb.h>
@@ -111,7 +113,7 @@ WMGetCurrentHost()
char name[W_MAXHOSTNAMELEN+1];
if (gethostname(name, W_MAXHOSTNAMELEN) < 0) {
wsyserror("Cannot get current host name");
wsyserror(_("Cannot get current host name"));
return NULL;
}
+15 -1
View File
@@ -4,6 +4,10 @@
#include "WINGsP.h"
#include "wconfig.h"
#include "X11/Xlocale.h"
extern void W_InitNotificationCenter(void);
@@ -26,11 +30,21 @@ void
WMInitializeApplication(char *applicationName, int *argc, char **argv)
{
int i;
assert(argc!=NULL);
assert(argv!=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];
WMApplication.applicationName = wstrdup(applicationName);
+6 -4
View File
@@ -1,6 +1,8 @@
#include "WINGsP.h"
#include "wconfig.h"
#include <wraster.h>
#define LIGHT_STIPPLE_WIDTH 4
@@ -193,7 +195,7 @@ WMWhiteColor(WMScreen *scr)
if (!scr->white) {
scr->white = WMCreateRGBColor(scr, 0xffff, 0xffff, 0xffff, True);
if (!scr->white->flags.exact)
wwarning("could not allocate %s color", "white");
wwarning(_("could not allocate %s color"), _("white"));
}
return WMRetainColor(scr->white);
}
@@ -206,7 +208,7 @@ WMBlackColor(WMScreen *scr)
if (!scr->black) {
scr->black = WMCreateRGBColor(scr, 0, 0, 0, True);
if (!scr->black->flags.exact)
wwarning("could not allocate %s color", "black");
wwarning(_("could not allocate %s color"), _("black"));
}
return WMRetainColor(scr->black);
}
@@ -245,7 +247,7 @@ WMGrayColor(WMScreen *scr)
} else {
color = WMCreateRGBColor(scr, 0xaeba, 0xaaaa, 0xaeba, True);
if (!color->flags.exact)
wwarning("could not allocate %s color", "gray");
wwarning(_("could not allocate %s color"), _("gray"));
}
scr->gray = color;
}
@@ -286,7 +288,7 @@ WMDarkGrayColor(WMScreen *scr)
} else {
color = WMCreateRGBColor(scr, 0x5144, 0x5555, 0x5144, True);
if (!color->flags.exact)
wwarning("could not allocate %s color", "dark gray");
wwarning(_("could not allocate %s color"), _("dark gray"));
}
scr->darkGray = color;
}
+80 -86
View File
@@ -25,6 +25,7 @@
*/
#include "../src/config.h"
#include "wconfig.h"
#include "WINGsP.h"
#include <math.h>
#include <unistd.h>
@@ -56,13 +57,6 @@
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
@@ -419,7 +413,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->win = WMCreateWindowWithStyle(scrPtr, name,
WMTitledWindowMask | WMClosableWindowMask | WMResizableWindowMask);
WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
WMSetWindowTitle(panel->win, "Colors");
WMSetWindowTitle(panel->win, _("Colors"));
WMSetWindowCloseAction(panel->win, closeWindowCallback, panel);
@@ -609,9 +603,9 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white),
False, "Brightness", strlen("Brightness"));
False, _("Brightness"), strlen(_("Brightness")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->grayBrightnessS, pixmap);
WMReleasePixmap(pixmap);
@@ -684,10 +678,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Red",
strlen("Red"));
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Red"),
strlen(_("Red")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbRedS, pixmap);
WMReleasePixmap(pixmap);
@@ -717,10 +711,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Green",
strlen("Green"));
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Green"),
strlen(_("Green")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbGreenS, pixmap);
WMReleasePixmap(pixmap);
@@ -751,10 +745,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, "Blue",
strlen("Blue"));
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Blue"),
strlen(_("Blue")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->rgbBlueS, pixmap);
WMReleasePixmap(pixmap);
@@ -811,10 +805,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Cyan",
strlen("Cyan"));
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Cyan"),
strlen(_("Cyan")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykCyanS, pixmap);
WMReleasePixmap(pixmap);
@@ -845,10 +839,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Magenta",
strlen("Magenta"));
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Magenta"),
strlen(_("Magenta")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykMagentaS, pixmap);
WMReleasePixmap(pixmap);
@@ -879,10 +873,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Yellow",
strlen("Yellow"));
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Yellow"),
strlen(_("Yellow")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykYellowS, pixmap);
WMReleasePixmap(pixmap);
@@ -914,10 +908,10 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap)
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, "Black",
strlen("Black"));
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Black"),
strlen(_("Black")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->cmykBlackS, pixmap);
WMReleasePixmap(pixmap);
@@ -995,7 +989,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->customPaletteHistoryBtn = WMCreatePopUpButton(
panel->customPaletteFrm);
WMAddPopUpButtonItem(panel->customPaletteHistoryBtn, "Spectrum");
WMAddPopUpButtonItem(panel->customPaletteHistoryBtn, _("Spectrum"));
WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn,
WMGetPopUpButtonNumberOfItems(panel->customPaletteHistoryBtn)-1);
WMSetPopUpButtonAction(panel->customPaletteHistoryBtn,
@@ -1025,17 +1019,17 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->customPaletteMenuBtn = WMCreatePopUpButton(panel->customPaletteFrm);
WMSetPopUpButtonPullsDown(panel->customPaletteMenuBtn, 1);
WMSetPopUpButtonText(panel->customPaletteMenuBtn, "Palette");
WMSetPopUpButtonText(panel->customPaletteMenuBtn, _("Palette"));
WMSetPopUpButtonAction(panel->customPaletteMenuBtn,
customPaletteMenuCallback, panel);
WMResizeWidget(panel->customPaletteMenuBtn, PWIDTH - 8, 20);
WMMoveWidget(panel->customPaletteMenuBtn, 0, PHEIGHT - 130);
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "New from File...");
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Rename...");
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Remove");
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "Copy");
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, "New from Clipboard");
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("New from File..."));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Remove"));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("Copy"));
WMAddPopUpButtonItem(panel->customPaletteMenuBtn, _("New from Clipboard"));
WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRename, 0);
WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRemove, 0);
@@ -1056,7 +1050,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
WMMoveWidget(panel->colorListFrm, 5, 80);
panel->colorListHistoryBtn = WMCreatePopUpButton(panel->colorListFrm);
WMAddPopUpButtonItem(panel->colorListHistoryBtn, "X11-Colors");
WMAddPopUpButtonItem(panel->colorListHistoryBtn, _("X11-Colors"));
WMSetPopUpButtonSelectedItem(panel->colorListHistoryBtn,
WMGetPopUpButtonNumberOfItems(panel->colorListHistoryBtn)-1);
/* WMSetPopUpButtonAction(panel->colorListHistoryBtn,
@@ -1073,15 +1067,15 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->colorListColorMenuBtn = WMCreatePopUpButton(panel->colorListFrm);
WMSetPopUpButtonPullsDown(panel->colorListColorMenuBtn, 1);
WMSetPopUpButtonText(panel->colorListColorMenuBtn, "Color");
WMSetPopUpButtonText(panel->colorListColorMenuBtn, _("Color"));
WMSetPopUpButtonAction(panel->colorListColorMenuBtn,
colorListColorMenuCallback, panel);
WMResizeWidget(panel->colorListColorMenuBtn, (PWIDTH - 16)/2, 20);
WMMoveWidget(panel->colorListColorMenuBtn, 0, PHEIGHT - 130);
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Add...");
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Rename...");
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, "Remove");
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Add..."));
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->colorListColorMenuBtn, _("Remove"));
WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuAdd, 0);
WMSetPopUpButtonItemEnabled(panel->colorListColorMenuBtn, CLmenuRename, 0);
@@ -1089,16 +1083,16 @@ makeColorPanel(WMScreen *scrPtr, char *name)
panel->colorListListMenuBtn = WMCreatePopUpButton(panel->colorListFrm);
WMSetPopUpButtonPullsDown(panel->colorListListMenuBtn, 1);
WMSetPopUpButtonText(panel->colorListListMenuBtn, "List");
WMSetPopUpButtonText(panel->colorListListMenuBtn, _("List"));
WMSetPopUpButtonAction(panel->colorListListMenuBtn,
colorListListMenuCallback, panel);
WMResizeWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2, 20);
WMMoveWidget(panel->colorListListMenuBtn, (PWIDTH - 16)/2 + 8,
PHEIGHT - 130);
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "New...");
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "Rename...");
WMAddPopUpButtonItem(panel->colorListListMenuBtn, "Remove");
WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("New..."));
WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("Rename..."));
WMAddPopUpButtonItem(panel->colorListListMenuBtn, _("Remove"));
WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuAdd, 0);
WMSetPopUpButtonItemEnabled(panel->colorListListMenuBtn, CLmenuRename, 0);
@@ -1235,21 +1229,21 @@ readConfiguration(W_ColorPanel *panel)
if (stat(panel->configurationPath, &stat_buf)!=0) {
if (mkdir(panel->configurationPath,
S_IRWXU|S_IRGRP|S_IROTH|S_IXGRP|S_IXOTH)!=0) {
wsyserror("Color Panel: Could not create directory %s needed"
" to store configurations", panel->configurationPath);
wsyserror(_("Color Panel: Could not create directory %s needed"
" to store configurations"), panel->configurationPath);
WMSetPopUpButtonEnabled(panel->customPaletteMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListColorMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListListMenuBtn, False);
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"File Error",
"Could not create ColorPanel configuration directory",
"OK", NULL, NULL);
_("File Error"),
_("Could not create ColorPanel configuration directory"),
_("OK"), NULL, NULL);
}
return;
}
if (!(dPtr = opendir(panel->configurationPath))) {
wwarning(NO_FILE_ERR, "%s", panel->configurationPath);
wwarning(_("Color Panel: Could not find file"), "%s", panel->configurationPath);
return;
}
@@ -1285,7 +1279,7 @@ readXColors(W_ColorPanel *panel)
WMListItem *item;
if (stat(RGBTXT, &stat_buf) != 0) {
wsyserror(NO_FILE_ERR, " %s", RGBTXT);
wsyserror(_("Color Panel: Could not find file"), " %s", RGBTXT);
return;
}
else {
@@ -1303,7 +1297,7 @@ readXColors(W_ColorPanel *panel)
fclose(rgbtxt);
}
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,
y - Cursor_y_hot,
w, h, AllPlanes, ZPixmap)))
wwarning(X_ERR);
wwarning(_("Color Panel: X failed request"));
return image;
}
@@ -1555,7 +1549,7 @@ magnifyGetImage(WMScreen *scr, XImage *image, int x, int y, int w, int h)
y - Cursor_y_hot + y0,
w0, h0, AllPlanes, ZPixmap,
image, x0, y0))
wwarning(X_ERR);
wwarning(_("Color Panel: X failed request"));
return NULL;
}
@@ -1619,7 +1613,7 @@ magnifyGetImageStored(WMColorPanel *panel, int x1, int y1, int x2, int y2)
panel->magnifyGlass->dirtyRect =
XSubImage(panel->magnifyGlass->image, xa, ya, width, height);
if (!panel->magnifyGlass->dirtyRect) {
wwarning(X_ERR);
wwarning(_("Color Panel: X failed request"));
return; /* X returned a NULL from XSubImage */
}
}
@@ -2168,7 +2162,7 @@ wheelRender(W_ColorPanel *panel)
image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True);
if (!image) {
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
return;
}
@@ -2828,9 +2822,9 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white),
False, "Brightness", strlen("Brightness"));
False, _("Brightness"), strlen(_("Brightness")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbBrightnessS, sliderPxmp);
WMReleasePixmap(sliderPxmp);
@@ -2864,9 +2858,9 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft,
WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False,
"Saturation", strlen("Saturation"));
_("Saturation"), strlen(_("Saturation")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbSaturationS, sliderPxmp);
WMReleasePixmap(sliderPxmp);
@@ -2900,9 +2894,9 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft,
WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False,
"Hue", strlen("Hue"));
_("Hue"), strlen(_("Hue")));
else
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
WMSetSliderImage(panel->hsbHueS, sliderPxmp);
WMReleasePixmap(sliderPxmp);
@@ -3150,7 +3144,7 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
/* Get a filename */
if (WMRunModalFilePanelForDirectory(browseP, panel->win, spath,
"Open Palette", RSupportedFileFormats()) ) {
_("Open Palette"), RSupportedFileFormats()) ) {
filepath = WMGetFilePanelFileName(browseP);
/* Get seperation position between path and filename */
@@ -3211,13 +3205,13 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
tmp = wstrconcat(panel->configurationPath, filename);
i = remove(tmp); /* Delete the file, it doesn't belong here */
WMRunAlertPanel(scr, panel->win, "File Error",
"Invalid file format !", "OK", NULL, NULL);
WMRunAlertPanel(scr, panel->win, _("File Error"),
_("Invalid file format !"), _("OK"), NULL, NULL);
if (i != 0) {
wsyserror("can't remove file %s", tmp);
WMRunAlertPanel(scr, panel->win, "File Error",
"Couldn't remove file from Configuration Directory !",
"OK", NULL, NULL);
wsyserror(_("can't remove file %s"), tmp);
WMRunAlertPanel(scr, panel->win, _("File Error"),
_("Couldn't remove file from Configuration Directory !"),
_("OK"), NULL, NULL);
}
wfree(tmp);
}
@@ -3243,8 +3237,8 @@ customPaletteMenuRename(W_ColorPanel *panel)
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
fromName = WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item);
toName = WMRunInputPanel(scr, panel->win, "Rename", "Rename palette to:",
fromName, "OK", "Cancel");
toName = WMRunInputPanel(scr, panel->win, _("Rename"), _("Rename palette to:"),
fromName, _("OK"), _("Cancel"));
if (toName) {
@@ -3260,8 +3254,8 @@ customPaletteMenuRename(W_ColorPanel *panel)
if (access (toPath, F_OK) == 0) {
/* Careful, this palette exists already */
if (WMRunAlertPanel(scr, panel->win, "Warning",
"Palette already exists !\n\nOverwrite ?", "No", "Yes",
if (WMRunAlertPanel(scr, panel->win, _("Warning"),
_("Palette already exists !\n\nOverwrite ?"), _("No"), _("Yes"),
NULL) == 1) {
/* "No" = 0, "Yes" = 1 */
int items = WMGetPopUpButtonNumberOfItems(
@@ -3293,7 +3287,7 @@ customPaletteMenuRename(W_ColorPanel *panel)
}
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 {
WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);
WMInsertPopUpButtonItem(panel->customPaletteHistoryBtn, item,
@@ -3319,13 +3313,13 @@ customPaletteMenuRemove(W_ColorPanel *panel)
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
tmp = wstrconcat( "This will permanently remove the palette ",
tmp = wstrconcat( _("This will permanently remove the palette "),
WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));
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);
choice = WMRunAlertPanel(scr, panel->win, "Remove", text, "Yes", "No",
choice = WMRunAlertPanel(scr, panel->win, _("Remove"), text, _("Yes"), _("No"),
NULL);
/* returns 0 (= "Yes") or 1 (="No") */
wfree(text);
@@ -3347,7 +3341,7 @@ customPaletteMenuRemove(W_ColorPanel *panel)
WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);
} else {
wsyserror("Couldn't remove palette %s\n", tmp);
wsyserror(_("Couldn't remove palette %s\n"), tmp);
}
wfree(tmp);
@@ -3652,14 +3646,14 @@ fetchFile(char *toPath, char *srcFile, char *destFile)
char buf[BUFSIZE];
if ((src = open(srcFile, O_RDONLY)) == 0) {
wsyserror("Could not open %s", srcFile);
wsyserror(_("Could not open %s"), srcFile);
return -1;
}
tmp = wstrconcat(toPath, destFile);
if ((dest = open( tmp, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH))
== 0) {
wsyserror("Could not create %s", tmp);
wsyserror(_("Could not create %s"), tmp);
wfree(tmp);
return -1;
}
@@ -3670,7 +3664,7 @@ fetchFile(char *toPath, char *srcFile, char *destFile)
while ((n = read(src, buf, BUFSIZE)) > 0)
{
if (write (dest, buf, n) != n) {
wsyserror("Write error on file %s", destFile);
wsyserror(_("Write error on file %s"), destFile);
return -1;
}
}
@@ -3715,7 +3709,7 @@ convertCPColor(CPColor *color)
switch (color->set) {
case cpNone:
wwarning("Color Panel: Color unspecified");
wwarning(_("Color Panel: Color unspecified"));
return;
case cpRGB:
old_hue = color->hsv.hue;
@@ -3750,7 +3744,7 @@ ulongToRColor(WMScreen *scr, unsigned long value)
XColor *xcolor = NULL;
if (!(xcolor = wmalloc(sizeof(XColor)) )) {
wwarning(NO_MEMORY_ERR);
wwarning(_("Color Panel: Could not allocate memory"));
color.red = 0;
color.green = 0;
color.blue = 0;
+44 -41
View File
@@ -1,5 +1,6 @@
#include "WINGsP.h"
#include "wconfig.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -231,7 +232,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->nameLabel = WMCreateLabel(fPtr->win);
WMMoveWidget(fPtr->nameLabel, 7, 282);
WMResizeWidget(fPtr->nameLabel, 55, 14);
WMSetLabelText(fPtr->nameLabel, "Name:");
WMSetLabelText(fPtr->nameLabel, _("Name:"));
fPtr->fileField = WMCreateTextField(fPtr->win);
WMMoveWidget(fPtr->fileField, 60, 278);
@@ -246,7 +247,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->okButton = WMCreateCommandButton(fPtr->win);
WMMoveWidget(fPtr->okButton, 245, 325);
WMResizeWidget(fPtr->okButton, 75, 28);
WMSetButtonText(fPtr->okButton, "OK");
WMSetButtonText(fPtr->okButton, _("OK"));
WMSetButtonImage(fPtr->okButton, scrPtr->buttonArrow);
WMSetButtonAltImage(fPtr->okButton, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(fPtr->okButton, WIPRight);
@@ -255,7 +256,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
fPtr->cancelButton = WMCreateCommandButton(fPtr->win);
WMMoveWidget(fPtr->cancelButton, 165, 325);
WMResizeWidget(fPtr->cancelButton, 75, 28);
WMSetButtonText(fPtr->cancelButton, "Cancel");
WMSetButtonText(fPtr->cancelButton, _("Cancel"));
WMSetButtonAction(fPtr->cancelButton, buttonClick, fPtr);
fPtr->trashcanButton = WMCreateCommandButton(fPtr->win);
@@ -328,7 +329,7 @@ WMGetOpenPanel(WMScreen *scrPtr)
if (scrPtr->sharedOpenPanel)
return scrPtr->sharedOpenPanel;
panel = makeFilePanel(scrPtr, "openFilePanel", "Open");
panel = makeFilePanel(scrPtr, "openFilePanel", _("Open"));
panel->flags.fileMustExist = 1;
panel->flags.panelType = WP_OPEN;
@@ -346,7 +347,7 @@ WMGetSavePanel(WMScreen *scrPtr)
if (scrPtr->sharedSavePanel)
return scrPtr->sharedSavePanel;
panel = makeFilePanel(scrPtr, "saveFilePanel", "Save");
panel = makeFilePanel(scrPtr, "saveFilePanel", _("Save"));
panel->flags.fileMustExist = 0;
panel->flags.panelType = WP_SAVE;
@@ -392,13 +393,13 @@ WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
panel->flags.filtered = 1;
panel->fileTypes = fileTypes;
if (name == NULL)
name = "Open";
name = _("Open");
break;
case WP_SAVE:
panel->fileTypes = NULL;
panel->flags.filtered = 0;
if (name == NULL)
name = "Save";
name = _("Save");
break;
default:
break;
@@ -558,7 +559,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
if (!dir) {
#ifdef VERBOSE
printf("WINGs: could not open directory %s\n", path);
printf(_("WINGs: could not open directory %s\n"), path);
#endif
return;
}
@@ -576,7 +577,7 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
if (stat(pbuf, &stat_buf)!=0) {
#ifdef VERBOSE
printf("WINGs: could not stat %s\n", pbuf);
printf(_("WINGs: could not stat %s\n"), pbuf);
#endif
continue;
} else {
@@ -643,7 +644,7 @@ showError(WMScreen *scr, WMWindow *owner, char *s, char *file)
} else {
errStr = wstrdup(s);
}
WMRunAlertPanel(scr, owner, "Error", errStr, "OK", NULL, NULL);
WMRunAlertPanel(scr, owner, _("Error"), errStr, _("OK"), NULL, NULL);
wfree(errStr);
}
@@ -654,8 +655,8 @@ createDir(WMButton *bPre, WMFilePanel *panel)
char *dirName, *directory, *file, *s;
WMScreen *scr = WMWidgetScreen(panel->win);
dirName = WMRunInputPanel(scr, panel->win, "Create Directory",
"Enter directory name", "", "OK", "Cancel");
dirName = WMRunInputPanel(scr, panel->win, _("Create Directory"),
_("Enter directory name"), "", _("OK"), _("Cancel"));
if (!dirName)
return;
@@ -680,7 +681,7 @@ createDir(WMButton *bPre, WMFilePanel *panel)
}
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);
while ((s = strstr(file,"//"))) {
int i;
@@ -691,13 +692,13 @@ createDir(WMButton *bPre, WMFilePanel *panel)
if (mkdir(file,0xfff) != 0) {
switch (errno) {
case EACCES:
showError(scr, panel->win, "Permission denied.", NULL);
showError(scr, panel->win, _("Permission denied."), NULL);
break;
case EEXIST:
showError(scr, panel->win, "'%s' already existes.", file);
showError(scr, panel->win, _("'%s' already exists."), file);
break;
case ENOENT:
showError(scr, panel->win, "Path does not exist.", NULL);
showError(scr, panel->win, _("Path does not exist."), NULL);
}
}
else WMSetFilePanelDirectory(panel, file);
@@ -727,51 +728,53 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
if (stat(file,&filestat)) {
switch (errno) {
case ENOENT:
showError(scr, panel->win, "'%s' does not exist.", file);
showError(scr, panel->win, _("'%s' does not exist."), file);
break;
case EACCES:
showError(scr, panel->win, "Permission denied.", NULL);
showError(scr, panel->win, _("Permission denied."), NULL);
break;
case ENOMEM:
showError(scr, panel->win,
"Insufficient memory available.", NULL);
_("Insufficient memory available."), NULL);
break;
case EROFS:
showError(scr, panel->win,
"'%s' is on a read-only filesystem.", file);
_("'%s' is on a read-only filesystem."), file);
break;
default:
showError(scr, panel->win, "Can not delete '%s'.", file);
showError(scr, panel->win, _("Can not delete '%s'."), file);
}
wfree(file);
return;
} else if (S_ISDIR(filestat.st_mode)) {
buffer = wmalloc(strlen(file)+20);
sprintf(buffer,"Delete directory %s ?",file);
int len = strlen(file)+20;
buffer = wmalloc(len);
snprintf(buffer,len,_("Delete directory %s ?"),file);
} else {
buffer = wmalloc(strlen(file)+15);
sprintf(buffer,"Delete file %s ?",file);
int len = strlen(file)+15;
buffer = wmalloc(len);
snprintf(buffer,len,_("Delete file %s ?"),file);
}
if (!WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"Warning", buffer, "OK", "Cancel", NULL)) {
_("Warning"), buffer, _("OK"), _("Cancel"), NULL)) {
if (S_ISDIR(filestat.st_mode)) {
if (rmdir(file) != 0) {
switch (errno) {
case EACCES:
showError(scr, panel->win, "Permission denied.", NULL);
showError(scr, panel->win, _("Permission denied."), NULL);
break;
case ENOENT:
showError(scr, panel->win, "Directory '%s' does not exist.", file);
showError(scr, panel->win, _("Directory '%s' does not exist."), file);
break;
case ENOTEMPTY:
showError(scr, panel->win, "Directory '%s' is not empty.", file);
showError(scr, panel->win, _("Directory '%s' is not empty."), file);
break;
case EBUSY:
showError(scr, panel->win, "Directory '%s' is busy.", file);
showError(scr, panel->win, _("Directory '%s' is busy."), file);
break;
default:
showError(scr, panel->win, "Can not delete '%s'.", file);
showError(scr, panel->win, _("Can not delete '%s'."), file);
}
} else {
char *s = strrchr(file,'/');
@@ -781,24 +784,24 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
} else if (remove(file) != 0) {
switch (errno) {
case EISDIR:
showError(scr, panel->win, "'%s' is a directory.", file);
showError(scr, panel->win, _("'%s' is a directory."), file);
break;
case ENOENT:
showError(scr, panel->win, "'%s' does not exist.", file);
showError(scr, panel->win, _("'%s' does not exist."), file);
break;
case EACCES:
showError(scr, panel->win, "Permission denied.", NULL);
showError(scr, panel->win, _("Permission denied."), NULL);
break;
case ENOMEM:
showError(scr, panel->win,
"Insufficient memory available.", NULL);
_("Insufficient memory available."), NULL);
break;
case EROFS:
showError(scr, panel->win,
"'%s' is on a read-only filesystem.", file);
_("'%s' is on a read-only filesystem."), file);
break;
default:
showError(scr, panel->win, "Can not delete '%s'.", file);
showError(scr, panel->win, _("Can not delete '%s'."), file);
}
} else {
char *s = strrchr(file,'/');
@@ -823,11 +826,11 @@ goFloppy(WMButton *bPtr, WMFilePanel *panel)
WMScreen *scr = WMWidgetScreen(panel->win);
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);
return;
} 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);
return;
}
@@ -964,8 +967,8 @@ buttonClick(WMButton *bPtr, WMFilePanel *panel)
file = getCurrentFileName(panel);
if (access(file, F_OK)!=0) {
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
"Error", "File does not exist.",
"Ok", NULL, NULL);
_("Error"), _("File does not exist."),
_("OK"), NULL, NULL);
wfree(file);
return;
}
+12 -12
View File
@@ -1,5 +1,6 @@
#include "WINGsP.h"
#include "wconfig.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
(this fontset is only for pattern analysis) */
if (fs == NULL) {
char *old_locale = setlocale(LC_CTYPE, NULL);
if (*nmissing != 0) XFreeStringList(*missing);
setlocale(LC_CTYPE, "C");
fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string);
setlocale(LC_CTYPE, old_locale);
setlocale(LC_CTYPE, "");
}
/* make XLFD font name for pattern analysis */
@@ -88,7 +88,7 @@ W_CreateFontSetWithGuess(Display *dpy, char *xlfd, char ***missing,
xlfd = generalize_xlfd (xlfd);
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);
@@ -126,14 +126,14 @@ WMCreateFontSet(WMScreen *scrPtr, char *fontName)
if (nmissing > 0 && font->font.set) {
int i;
wwarning("the following character sets are missing in %s:",
wwarning(_("the following character sets are missing in %s:"),
fontName);
for (i = 0; i < nmissing; i++) {
wwarning(missing[i]);
}
XFreeStringList(missing);
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);
}
if (!font->font.set) {
@@ -279,17 +279,17 @@ WMSystemFontOfSize(WMScreen *scrPtr, int size)
if (!font) {
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");
if (!font) {
font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
}
} else {
wwarning("could not load font %s. Trying fixed.", fontSpec);
wwarning(_("could not load font %s. Trying fixed."), fontSpec);
font = WMCreateNormalFont(scrPtr, "fixed");
}
if (!font) {
wwarning("could not load fixed font!");
wwarning(_("could not load fixed font!"));
wfree(fontSpec);
return NULL;
}
@@ -315,17 +315,17 @@ WMBoldSystemFontOfSize(WMScreen *scrPtr, int size)
if (!font) {
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");
if (!font) {
font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
}
} else {
wwarning("could not load font %s. Trying fixed.", fontSpec);
wwarning(_("could not load font %s. Trying fixed."), fontSpec);
font = WMCreateNormalFont(scrPtr, "fixed");
}
if (!font) {
wwarning("could not load fixed font!");
wwarning(_("could not load fixed font!"));
wfree(fontSpec);
return NULL;
}
@@ -420,7 +420,7 @@ makeFontSetOfSize(char *fontset, int size)
int count = ptr-fontset;
if (count > 255) {
wwarning("font description %s is too large.", fontset);
wwarning(_("font description %s is too large."), fontset);
} else {
memcpy(font, fontset, count);
font[count] = 0;
+23 -22
View File
@@ -4,6 +4,7 @@
#include "WINGsP.h"
#include "WUtil.h"
#include "wconfig.h"
#include <ctype.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);
@@ -201,13 +202,13 @@ WMGetFontPanel(WMScreen *scr)
panel->sampleT = WMCreateTextField(panel->upperF);
WMResizeWidget(panel->sampleT, DEF_WIDTH - 20, 50);
WMMoveWidget(panel->sampleT, 10, 10);
WMSetTextFieldText(panel->sampleT, "Test!!!");
WMSetTextFieldText(panel->sampleT, _("Test!!!"));
font = WMBoldSystemFontOfSize(scr, 12);
panel->famL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->famL, dark);
WMSetLabelText(panel->famL, "Family");
WMSetLabelText(panel->famL, _("Family"));
WMSetLabelFont(panel->famL, font);
WMSetLabelTextColor(panel->famL, white);
WMSetLabelRelief(panel->famL, WRSunken);
@@ -218,7 +219,7 @@ WMGetFontPanel(WMScreen *scr)
panel->typL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->typL, dark);
WMSetLabelText(panel->typL, "Typeface");
WMSetLabelText(panel->typL, _("Typeface"));
WMSetLabelFont(panel->typL, font);
WMSetLabelTextColor(panel->typL, white);
WMSetLabelRelief(panel->typL, WRSunken);
@@ -229,7 +230,7 @@ WMGetFontPanel(WMScreen *scr)
panel->sizL = WMCreateLabel(panel->lowerF);
WMSetWidgetBackgroundColor(panel->sizL, dark);
WMSetLabelText(panel->sizL, "Size");
WMSetLabelText(panel->sizL, _("Size"));
WMSetLabelFont(panel->sizL, font);
WMSetLabelTextColor(panel->sizL, white);
WMSetLabelRelief(panel->sizL, WRSunken);
@@ -248,12 +249,12 @@ WMGetFontPanel(WMScreen *scr)
panel->setB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->setB, 70, 24);
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->setB, "Set");
WMSetButtonText(panel->setB, _("Set"));
panel->revertB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->revertB, 70, 24);
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->revertB, "Revert");
WMSetButtonText(panel->revertB, _("Revert"));
WMRealizeWidget(panel->win);
@@ -340,9 +341,9 @@ WMGetFontPanelFont(WMFontPanel *panel)
char*
WMGetFontPanelFontName(WMFontPanel *panel)
{
char name[256];
char name[512];
getSelectedFont(panel, name);
getSelectedFont(panel, name, sizeof(name));
return wstrdup(name);
}
@@ -704,8 +705,8 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE,
&count);
if (!fontList) {
WMRunAlertPanel(scr, panel->win, "Error",
"Could not retrieve font list", "OK", NULL, NULL);
WMRunAlertPanel(scr, panel->win, _("Error"),
_("Could not retrieve font list"), _("OK"), NULL, NULL);
return;
}
@@ -717,7 +718,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
continue;
}
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] = '\0';
continue;
@@ -766,7 +767,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
static void
getSelectedFont(FontPanel *panel, char buffer[])
getSelectedFont(FontPanel *panel, char buffer[], int bufsize)
{
WMListItem *item;
Family *family;
@@ -786,7 +787,7 @@ getSelectedFont(FontPanel *panel, char buffer[])
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->name,
face->weight,
@@ -803,10 +804,10 @@ getSelectedFont(FontPanel *panel, char buffer[])
static void
preview(FontPanel *panel)
{
char buffer[256];
char buffer[512];
WMFont *font;
getSelectedFont(panel, buffer);
getSelectedFont(panel, buffer, sizeof(buffer));
font = WMCreateFont(WMWidgetScreen(panel->win), buffer);
if (font) {
@@ -864,22 +865,22 @@ familyClick(WMWidget *w, void *data)
}
if (strcmp(face->slant, "r") == 0) {
strcat(buffer, "Roman");
strcat(buffer, _("Roman"));
top = 1;
} else if (strcmp(face->slant, "i") == 0) {
strcat(buffer, "Italic");
strcat(buffer, _("Italic"));
} else if (strcmp(face->slant, "o") == 0) {
strcat(buffer, "Oblique");
strcat(buffer, _("Oblique"));
} else if (strcmp(face->slant, "ri") == 0) {
strcat(buffer, "Rev Italic");
strcat(buffer, _("Rev Italic"));
} else if (strcmp(face->slant, "ro") == 0) {
strcat(buffer, "Rev Oblique");
strcat(buffer, _("Rev Oblique"));
} else {
strcat(buffer, face->slant);
}
if (buffer[0] == 0) {
strcpy(buffer, "Normal");
strcpy(buffer, _("Normal"));
}
if (top)
+4 -3
View File
@@ -1,6 +1,7 @@
#include "WINGsP.h"
#include "wconfig.h"
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -411,7 +412,7 @@ loadPixmaps(WMScreen *scr)
if (!image)
image = RLoadImage(scr->rcontext, X_WINGS_IMAGES_FILE, 0);
if (!image) {
wwarning("WINGs: could not load widget images file: %s",
wwarning(_("WINGs: could not load widget images file: %s"),
RMessageForError(RErrorCode));
return False;
}
@@ -753,8 +754,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->boldFont = scrPtr->normalFont;
if (!scrPtr->normalFont) {
wwarning("could not load any fonts. Make sure your font installation"
"and locale settings are correct.");
wwarning(_("could not load any fonts. Make sure your font installation"
"and locale settings are correct."));
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;
h = view->size.height;
} else {
x = 2;
y = 2;
w = view->size.width - 4;
h = view->size.height - 4;
x = 1;
y = 1;
w = view->size.width - 3;
h = view->size.height - 3;
}
/* calc. image alignment */
+2 -1
View File
@@ -20,6 +20,7 @@
#include "WINGsP.h"
#include "wconfig.h"
#define MIN_DOC_WIDTH 10
@@ -185,7 +186,7 @@ static void drawRulerOnPixmap(Ruler * rPtr)
rPtr->bg, 0, 0, rPtr->view->size.width, 40);
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 */
i = j = m = 0;
+32 -16
View File
@@ -3,6 +3,7 @@
#include "WINGsP.h"
#include "wconfig.h"
#include <X11/keysym.h>
#include <X11/Xatom.h>
@@ -1002,15 +1003,13 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
Bool relay = True;
WMScreen *scr = tPtr->view->screen;
event->xkey.state &= ~scr->ignoredModifierMask;
/*printf("(%d,%d) -> ", tPtr->selection.position, tPtr->selection.count);*/
if (((XKeyEvent *) event)->state & WM_EMACSKEYMASK)
control_pressed = 1;
shifted = event->xkey.state & ShiftMask;
controled = event->xkey.state & ControlMask;
if ((event->xkey.state & ~(ShiftMask|ControlMask)) != 0) {
if ((event->xkey.state & (ShiftMask|ControlMask)) != 0) {
modified = True;
} else {
modified = False;
@@ -1065,9 +1064,10 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_LEFT:
if (!control_pressed) {
if (!control_pressed)
goto normal_key;
}
else
modified = False;
#ifdef XK_KP_Left
case XK_KP_Left:
#endif
@@ -1099,9 +1099,11 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_RIGHT:
if (!control_pressed) {
if (!control_pressed)
goto normal_key;
}
else
modified = False;
#ifdef XK_KP_Right
case XK_KP_Right:
#endif
@@ -1137,9 +1139,12 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_HOME:
if (!control_pressed) {
if (!control_pressed)
goto normal_key;
}
else {
modified = False;
controled = False;
}
#ifdef XK_KP_Home
case XK_KP_Home:
#endif
@@ -1162,9 +1167,12 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_END:
if (!control_pressed) {
if (!control_pressed)
goto normal_key;
}
else {
modified = False;
controled = False;
}
#ifdef XK_KP_End
case XK_KP_End:
#endif
@@ -1192,9 +1200,13 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_BS:
if (!control_pressed) {
goto normal_key;
}
if (!control_pressed)
goto normal_key;
else {
modified = False;
controled = False;
shifted = False;
}
case XK_BackSpace:
if (!modified && !shifted && !controled) {
if (tPtr->selection.count) {
@@ -1215,8 +1227,12 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
break;
case WM_EMACSKEY_DEL:
if (!control_pressed) {
if (!control_pressed)
goto normal_key;
else {
modified = False;
controled = False;
shifted = False;
}
#ifdef XK_KP_Delete
case XK_KP_Delete:
@@ -1242,7 +1258,7 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
normal_key:
default:
if (!controled && !modified) {
if (!controled) {
if (count > 0 && isprint(buffer[0])) {
if (tPtr->selection.count)
WMDeleteTextFieldRange(tPtr, tPtr->selection);
+2
View File
@@ -73,6 +73,7 @@ static char *keyOptions[] = {
"CloseKey",
"MaximizeKey",
"VMaximizeKey",
"HMaximizeKey",
"RaiseKey",
"LowerKey",
"RaiseLowerKey",
@@ -383,6 +384,7 @@ createPanel(Panel *p)
WMAddListItem(panel->actLs, _("Close active window"));
WMAddListItem(panel->actLs, _("Maximize active window"));
WMAddListItem(panel->actLs, _("Maximize active window vertically"));
WMAddListItem(panel->actLs, _("Maximize active window horizontally"));
WMAddListItem(panel->actLs, _("Raise active window"));
WMAddListItem(panel->actLs, _("Lower active window"));
WMAddListItem(panel->actLs, _("Raise/Lower window under mouse pointer"));
+14 -7
View File
@@ -301,6 +301,7 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
WMScreen *scr = WMWidgetScreen(sPtr);
RColor from, to;
RHSVColor tmp;
char *buffer;
tmp = *hsv;
if (saturation) {
@@ -318,21 +319,25 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
pixmap = WMCreatePixmapFromRImage(scr, image, 128);
RReleaseImage(image);
if (saturation)
buffer = wstrdup(_("Saturation"));
else
buffer = wstrdup(_("Brightness"));
if (hsv->value < 128 || !saturation) {
WMColor *col = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1,
saturation ? "Saturation" : "Brightness", 10);
(16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
WMReleaseColor(col);
} else {
WMColor *col = WMBlackColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
(16 - WMFontHeight(font))/2 - 1,
saturation ? "Saturation" : "Brightness", 10);
(16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
WMReleaseColor(col);
}
wfree(buffer);
WMSetSliderImage(sPtr, pixmap);
WMReleasePixmap(pixmap);
}
@@ -364,13 +369,15 @@ updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
WMColor *col = WMWhiteColor(scr);
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);
} else {
WMColor *col = WMBlackColor(scr);
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);
}
WMSetSliderImage(sPtr, pixmap);
+2 -2
View File
@@ -9,7 +9,7 @@ hr.po Croatian Toni Bili
fr.po French Bastien NOCERA <hadess@writeme.com>
Hadess <hadess@infonie.fr>
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>
zh_TW.Big5.po Chinese Li Wei Jih <lwj83@cs.ccu.edu.tw>
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>
hu.po Hungarian Horvath Szabolcs <horvathsz@penguinpowered.com>
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>
+1308 -891
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
* (C) 2001 judas@hell
* (C) 2001 Jan "judas" Tomka
*
* Original translation by judas@hell on Jan 22 2001
* Currently maintained by judas@hell <tomka@oalevice.sk>
* Original translation by Jan "judas" Tomka on Jan 22 2001
* Currently maintained by Jan "judas" Tomka <tomka@oalevice.sk>
*
* Version history:
* mnu-ver WM-ver author email date
* 0.10 0.63.1 judas@hell <tomka@oalevice.sk> Jan 22 2001
* WM-ver author email date
* 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> 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á
* rovnakú syntax ako v súbore $HOME/GNUstep/Defaults/WindowMaker, napr.
* 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:
* MENU - začína 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
* WORKSPACE_MENU - vlo¾í submenu operácií pracovnej plochy. Len jedno
* takéto menu je povolené
* WORKSPACE_MENU - vlo¾í submenu operácií pracovnej plochy. Je povolené
* len jedno takéto menu
* EXEC <príkaz> - vykoná externý príkaz
* 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ý
* manažér okien
* REFRESH - obnoví obrazovku
@@ -45,7 +46,7 @@
* SAVE_SESSION - uloží aktuálny stav pracovnej plochy, čo zahŕňa všetky
* spustené aplikácie, ich nastavenia (geometria,
* 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ží
* plocha, na ktorej sa užívateľ nachádza. Pri každom štarte
* WindowMakeru sa tieto nastavenia obnovia až kým sa nepou-
@@ -81,7 +82,7 @@
* // poradí, pričom pred každý vloží príkaz.
* OPEN_MENU [voľby] /nejaký/adr [/ďalší/adr ...] WITH príkaz -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)
*
* <Parametre> sú odovzdané aplikácii, ktorá sa má vykonať.
@@ -227,4 +228,3 @@
"Koniec" 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
@@ -222,6 +222,7 @@ dnl List of supported locales
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_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
ok=0
@@ -246,6 +247,16 @@ for lang in $LINGUAS; do
if test "$ok" = 1; then
WPMOFILES="$WPMOFILES $lang.mo"
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
@@ -282,6 +293,7 @@ AC_SUBST(INTLIBS)
AC_SUBST(NLSDIR)
AC_SUBST(MOFILES)
AC_SUBST(WPMOFILES)
AC_SUBST(WINGSMOFILES)
AC_SUBST(supported_locales)
@@ -821,8 +833,9 @@ dnl AC_SUBST(DOCTYPES)
AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile \
WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/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 \
doc/sk/Makefile \
WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
+6 -4
View File
@@ -13,7 +13,7 @@ Group: User Interface/Desktops
Vendor: The Window Maker Team
Url: http://www.windowmaker.org
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
Provides: windowmaker
BuildRoot: /var/tmp/%{name}-%{version}
@@ -49,9 +49,9 @@ GNUSTEP_LOCAL_ROOT='$(prefix)/X11R6/lib/GNUstep';
export CFLAGS LINGUAS NLSDIR GNUSTEP_LOCAL_ROOT;
./configure --prefix=/usr --exec-prefix=/usr/X11R6 \
--sysconfdir=/etc/X11 \
--enable-newstyle --enable-superfluous \
--enable-kde --enable-gnome
--sysconfdir=/etc/X11 --enable-modelock \
--enable-kde --enable-gnome --enable-openlook \
--enable-usermenu
make
%install
@@ -73,6 +73,7 @@ if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
%defattr(-,root,root)
%doc AUTHORS BUGFORM BUGS ChangeLog NEWS FAQ* README
%doc TODO MIRRORS README.*
%doc AUTHORS.sk
%config /etc/X11/WindowMaker
/usr/X11R6/bin/*
/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/WINGs
/usr/man/*/*
/usr/man/*/*/*
%changelog
+2
View File
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = sk
man_MANS = \
geticonset.1x \
setstyle.1x \
+646 -524
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -320,7 +320,7 @@ updateDockNumbers(WScreen *scr)
my_v_mask, &my_gc_values);
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));
length = strlen(ws_numbers);
@@ -457,14 +457,14 @@ wAppIconPaint(WAppIcon *aicon)
if (index > 0) {
char buf[16];
sprintf(buf, "%i", index);
snprintf(buf, sizeof(buf), "%i", index);
WMDrawString(scr->wmscreen, aicon->icon->core->window,
scr->clip_title_gc, scr->title_font,
1, 1, buf, strlen(buf));
3, 3, buf, strlen(buf));
}
if (aicon->omnipresent)
drawCorner(aicon->icon);
+3 -2
View File
@@ -360,8 +360,9 @@ appiconBalloon(WObjDescriptor *object)
char *tmp;
if (aicon->command && aicon->wm_class) {
tmp = wmalloc(strlen(aicon->command)+strlen(aicon->wm_class)+8);
sprintf(tmp, "%s (%s)", aicon->wm_class, aicon->command);
int len = strlen(aicon->command)+strlen(aicon->wm_class)+8;
tmp = wmalloc(len);
snprintf(tmp, len, "%s (%s)", aicon->wm_class, aicon->command);
scr->balloon->text = tmp;
} else if (aicon->command) {
scr->balloon->text = wstrdup(aicon->command);
+10 -5
View File
@@ -702,6 +702,9 @@ WDefaultEntry optionList[] = {
{"VMaximizeKey", "None", (void*)WKBD_VMAXIMIZE,
NULL, getKeybind, setKeyGrab
},
{"HMaximizeKey", "None", (void*)WKBD_HMAXIMIZE,
NULL, getKeybind, setKeyGrab
},
{"RaiseKey", "\"Meta+Up\"", (void*)WKBD_RAISE,
NULL, getKeybind, setKeyGrab
},
@@ -968,7 +971,7 @@ wDefaultsInitDomain(char *domain, Bool requireDictionary)
}
/* global system dictionary */
sprintf(path, "%s/WindowMaker/%s", SYSCONFDIR, domain);
snprintf(path, sizeof(path), "%s/WindowMaker/%s", SYSCONFDIR, domain);
if (stat(path, &stbuf)>=0) {
shared_dict = ReadProplistFromFile(path);
if (shared_dict) {
@@ -1063,7 +1066,7 @@ wDefaultsCheckDomains(void *foo)
WDWindowMaker->timestamp = stbuf.st_mtime;
/* global dictionary */
sprintf(path, "%s/WindowMaker/WindowMaker", SYSCONFDIR);
snprintf(path, sizeof(path), "%s/WindowMaker/WindowMaker", SYSCONFDIR);
if (stat(path, &stbuf)>=0) {
shared_dict = ReadProplistFromFile(path);
if (shared_dict && !PLIsDictionary(shared_dict)) {
@@ -3240,15 +3243,17 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
char *command;
char *text;
char *dither;
int len;
SetupEnvironment(scr);
text = PLGetDescription(value);
command = wmalloc(strlen(text)+40);
len = strlen(text)+40;
command = wmalloc(len);
dither = wPreferences.no_dithering ? "-m" : "-d";
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
sprintf(command, "wmsetbg %s -p '%s' &", dither, text);
snprintf(command, len, "wmsetbg %s -p '%s' &", dither, text);
wfree(text);
system(command);
wfree(command);
+42 -31
View File
@@ -381,8 +381,11 @@ drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
whitecolor = WMWhiteColor(wmscr);
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);
if ((state & WLDSSelected) != 0) {
@@ -691,12 +694,13 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
{
char *tmp;
int len = (instance ? strlen(instance) : 0)
+ (class ? strlen(class) : 0) + 32;
tmp = wmalloc((instance ? strlen(instance) : 0)
+ (class ? strlen(class) : 0) + 32);
tmp = wmalloc(len);
if (tmp && (instance || class))
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
snprintf(tmp, len, "%s [%s.%s]", _("Icon Chooser"), instance, class);
else
strcpy(tmp, _("Icon Chooser"));
@@ -1155,7 +1159,7 @@ handleLogoPush(XEvent *event, void *data)
WMReleaseFont(panel->oldFont);
panel->oldFont = NULL;
}
sprintf(version, _("Version %s"), VERSION);
snprintf(version, sizeof(version), _("Version %s"), VERSION);
WMSetLabelText(panel->versionL, version);
XFlush(WMScreenDisplay(WMWidgetScreen(panel->versionL)));
}
@@ -1176,8 +1180,8 @@ wShowInfoPanel(WScreen *scr)
WMPixmap *logo;
WMSize size;
WMFont *font;
char version[32];
char buffer[512];
char *strbuf = NULL;
char buffer[256];
Window parent;
WWindow *wwin;
RColor color1, color2;
@@ -1264,13 +1268,13 @@ wShowInfoPanel(WScreen *scr)
WMSetLabelTextAlignment(panel->name2L, WACenter);
WMSetLabelText(panel->name2L, _("Window Manager for X"));
sprintf(version, _("Version %s"), VERSION);
snprintf(buffer, sizeof(buffer), _("Version %s"), VERSION);
panel->versionL = WMCreateLabel(panel->win);
WMResizeWidget(panel->versionL, 310, 16);
WMMoveWidget(panel->versionL, 30, 95);
WMSetLabelTextAlignment(panel->versionL, WARight);
WMSetLabelText(panel->versionL, version);
WMSetLabelText(panel->versionL, buffer);
WMSetLabelWraps(panel->versionL, False);
panel->copyrL = WMCreateLabel(panel->win);
@@ -1284,44 +1288,50 @@ wShowInfoPanel(WScreen *scr)
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) {
case 15:
strcpy(version, _("32 thousand"));
strbuf = wstrappend(strbuf, _("(32 thousand colors)\n"));
break;
case 16:
strcpy(version, _("64 thousand"));
strbuf = wstrappend(strbuf, _("(64 thousand colors)\n"));
break;
case 24:
case 32:
strcpy(version, _("16 million"));
strbuf = wstrappend(strbuf, _("(16 million colors)\n"));
break;
default:
sprintf(version, "%d", 1<<scr->w_depth);
snprintf(buffer, sizeof(buffer), _("(%d colors)\n"), 1<<scr->w_depth);
strbuf = wstrappend(strbuf, buffer);
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)
{
struct mallinfo ma = mallinfo();
sprintf(buffer+strlen(buffer),
snprintf(buffer, sizeof(buffer),
_("Total allocated memory: %i kB. Total memory in use: %i kB.\n"),
(ma.arena+ma.hblkhd)/1024, (ma.uordblks+ma.hblkhd)/1024);
strbuf = wstrappend(strbuf, buffer);
}
#endif
strcat(buffer, _("Supported image formats: "));
strbuf = wstrappend(strbuf, _("Supported image formats: "));
strl = RSupportedFileFormats();
for (i=0; strl[i]!=NULL; i++) {
strcat(buffer, strl[i]);
strcat(buffer, " ");
strbuf = wstrappend(strbuf, strl[i]);
strbuf = wstrappend(strbuf, " ");
}
strcat(buffer, _("\nAdditional support for: "));
strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
{
char *list[8];
char buf[80];
@@ -1350,24 +1360,25 @@ wShowInfoPanel(WScreen *scr)
}
strcat(buf, list[i]);
}
strcat(buffer, buf);
strbuf = wstrappend(strbuf, buf);
}
if (wPreferences.no_sound) {
strcat(buffer, _("\nSound disabled"));
strbuf = wstrappend(strbuf, _("\nSound disabled"));
} else {
strcat(buffer, _("\nSound enabled"));
strbuf = wstrappend(strbuf, _("\nSound enabled"));
}
panel->infoL = WMCreateLabel(panel->win);
WMResizeWidget(panel->infoL, 350, 75);
WMMoveWidget(panel->infoL, 15, 115);
WMSetLabelText(panel->infoL, buffer);
WMSetLabelText(panel->infoL, strbuf);
if (font) {
WMSetLabelFont(panel->infoL, font);
WMReleaseFont(font);
}
wfree(strbuf);
WMRealizeWidget(panel->win);
@@ -1681,10 +1692,10 @@ wShowCrashingDialogPanel(int whatSig)
WMMoveWidget(panel->noteL, 10, 90);
WMSetLabelTextAlignment(panel->noteL, WAJustified);
#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]);
#else
sprintf(buf, _("Window Maker received signal %i."), whatSig);
snprintf(buf, sizeof(buf), _("Window Maker received signal %i."), whatSig);
#endif
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);
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,
&name)) {
wWorkspaceRename(dock->screen_ptr, wspace, name);
@@ -1250,8 +1250,8 @@ wClipIconPaint(WAppIcon *aicon)
length = strlen(workspace->name);
ws_name = wmalloc(length + 1);
sprintf(ws_name, "%s", workspace->name);
sprintf(ws_number, "%i", scr->current_workspace + 1);
snprintf(ws_name, length+1, "%s", workspace->name);
snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
nlength = strlen(ws_number);
gc = scr->clip_title_gc;
@@ -1332,9 +1332,9 @@ make_icon_state(WAppIcon *btn)
buggy = btn->buggy_app ? dYes : dNo;
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
sprintf(buffer, "%hi,%hi", btn->xindex, btn->yindex);
snprintf(buffer, sizeof(buffer), "%hi,%hi", btn->xindex, btn->yindex);
position = PLMakeString(buffer);
node = PLMakeDictionaryFromEntries(dCommand, command,
@@ -1400,13 +1400,13 @@ dockSaveState(WDock *dock)
NULL);
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);
PLInsertDictionaryEntry(dock_state, key, list);
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);
value = PLMakeString(buffer);
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.
*/
sprintf(buffer, "Applications%i", scr->scr_height);
snprintf(buffer, sizeof(buffer), "Applications%i", scr->scr_height);
tmp = PLMakeString(buffer);
apps = PLGetDictionaryEntry(dock_state, tmp);
@@ -2153,8 +2153,9 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
#ifdef OFFIX_DND
if (icon->command && !icon->dnd_command) {
icon->dnd_command = wmalloc(strlen(icon->command)+8);
sprintf(icon->dnd_command, "%s %%d", icon->command);
int len = strlen(icon->command)+8;
icon->dnd_command = wmalloc(len);
snprintf(icon->dnd_command, len, "%s %%d", icon->command);
}
#endif
@@ -3233,11 +3234,11 @@ trackDeadProcess(pid_t pid, unsigned char status, WDock *dock)
if (status==111) {
char msg[PATH_MAX];
#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->dnd_command : icon->command);
#else
sprintf(msg, _("Could not execute command \"%s\""),
snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""),
icon->command);
#endif
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)) {
char *buf;
int len = strlen(text) + 64;
buf = wmalloc(strlen(text) + 64);
sprintf(buf, _("Could not open specified icon file: %s"), text);
buf = wmalloc(len);
snprintf(buf, len, _("Could not open specified icon file: %s"), text);
if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf,
_("OK"), _("Ignore"), NULL) == WAPRDefault) {
if (text)
+11
View File
@@ -1433,6 +1433,17 @@ handleKeyPress(XEvent *event)
}
}
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:
if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
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
static char *PRED_XKBGROUP2_XPM[] = {
" 10 10 2 1",
+5 -3
View File
@@ -84,7 +84,7 @@ WCreateGeometryView(WMScreen *scr)
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,
strlen(buffer));
@@ -127,9 +127,11 @@ paint(WGeometryView *gview)
char buffer[64];
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 {
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),
+10 -7
View File
@@ -466,14 +466,17 @@ getnameforicon(WWindow *wwin)
int len;
if (wwin->wm_class && wwin->wm_instance) {
suffix = wmalloc(strlen(wwin->wm_class)+strlen(wwin->wm_instance)+2);
sprintf(suffix, "%s.%s", wwin->wm_instance, wwin->wm_class);
int len = strlen(wwin->wm_class)+strlen(wwin->wm_instance)+2;
suffix = wmalloc(len);
snprintf(suffix, len, "%s.%s", wwin->wm_instance, wwin->wm_class);
} else if (wwin->wm_class) {
suffix = wmalloc(strlen(wwin->wm_class)+1);
strcpy(suffix, wwin->wm_class);
int len = strlen(wwin->wm_class)+1;
suffix = wmalloc(len);
snprintf(suffix, len, "%s", wwin->wm_class);
} else if (wwin->wm_instance) {
suffix = wmalloc(strlen(wwin->wm_instance)+1);
strcpy(suffix, wwin->wm_instance);
int len = strlen(wwin->wm_instance)+1;
suffix = wmalloc(len);
snprintf(suffix, len, "%s", wwin->wm_instance);
} else {
return NULL;
}
@@ -481,7 +484,7 @@ getnameforicon(WWindow *wwin)
prefix = wusergnusteppath();
len = strlen(prefix)+64+strlen(suffix);
path = wmalloc(len+1);
sprintf(path, "%s/.AppInfo", prefix);
snprintf(path, len, "%s/.AppInfo", prefix);
if (access(path, F_OK)!=0) {
if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)) {
+41 -40
View File
@@ -30,57 +30,58 @@
#define WKBD_HIDE 4
#define WKBD_MAXIMIZE 5
#define WKBD_VMAXIMIZE 6
#define WKBD_SELECT 7
#define WKBD_HMAXIMIZE 7
#define WKBD_SELECT 8
/* Clip */
#define WKBD_CLIPLOWER 8
#define WKBD_CLIPRAISE 9
#define WKBD_CLIPRAISELOWER 10
#define WKBD_CLIPLOWER 9
#define WKBD_CLIPRAISE 10
#define WKBD_CLIPRAISELOWER 11
/* window */
#define WKBD_RAISE 11
#define WKBD_LOWER 12
#define WKBD_RAISELOWER 13
#define WKBD_MOVERESIZE 14
#define WKBD_SHADE 15
#define WKBD_RAISE 12
#define WKBD_LOWER 13
#define WKBD_RAISELOWER 14
#define WKBD_MOVERESIZE 15
#define WKBD_SHADE 16
/* window, menu */
#define WKBD_CLOSE 16
#define WKBD_CLOSE 17
/* window */
#define WKBD_FOCUSNEXT 17
#define WKBD_FOCUSPREV 18
#define WKBD_FOCUSNEXT 18
#define WKBD_FOCUSPREV 19
#define WKBD_WORKSPACE1 20
#define WKBD_WORKSPACE2 21
#define WKBD_WORKSPACE3 22
#define WKBD_WORKSPACE4 23
#define WKBD_WORKSPACE5 24
#define WKBD_WORKSPACE6 25
#define WKBD_WORKSPACE7 26
#define WKBD_WORKSPACE8 27
#define WKBD_WORKSPACE9 28
#define WKBD_WORKSPACE10 29
#define WKBD_NEXTWORKSPACE 30
#define WKBD_PREVWORKSPACE 31
#define WKBD_NEXTWSLAYER 32
#define WKBD_PREVWSLAYER 33
#define WKBD_WORKSPACE1 21
#define WKBD_WORKSPACE2 22
#define WKBD_WORKSPACE3 23
#define WKBD_WORKSPACE4 24
#define WKBD_WORKSPACE5 25
#define WKBD_WORKSPACE6 26
#define WKBD_WORKSPACE7 27
#define WKBD_WORKSPACE8 28
#define WKBD_WORKSPACE9 29
#define WKBD_WORKSPACE10 30
#define WKBD_NEXTWORKSPACE 31
#define WKBD_PREVWORKSPACE 32
#define WKBD_NEXTWSLAYER 33
#define WKBD_PREVWSLAYER 34
/* window shortcuts */
#define WKBD_WINDOW1 34
#define WKBD_WINDOW2 35
#define WKBD_WINDOW3 36
#define WKBD_WINDOW4 37
#define WKBD_WINDOW5 38
#define WKBD_WINDOW6 39
#define WKBD_WINDOW7 40
#define WKBD_WINDOW8 41
#define WKBD_WINDOW9 42
#define WKBD_WINDOW10 43
#define WKBD_WINDOW1 35
#define WKBD_WINDOW2 36
#define WKBD_WINDOW3 37
#define WKBD_WINDOW4 38
#define WKBD_WINDOW5 39
#define WKBD_WINDOW6 40
#define WKBD_WINDOW7 41
#define WKBD_WINDOW8 42
#define WKBD_WINDOW9 43
#define WKBD_WINDOW10 44
#define WKBD_SWITCH_SCREEN 44
#define WKBD_SWITCH_SCREEN 45
#ifdef KEEP_XKB_LOCK_STATUS
# define WKBD_TOGGLE 45
# define WKBD_LAST 46
# define WKBD_TOGGLE 46
# define WKBD_LAST 47
#else
# define WKBD_LAST 45
# define WKBD_LAST 46
#endif /* KEEP_XKB_LOCK_STATUS */
+24 -20
View File
@@ -685,7 +685,7 @@ wKWMGetWorkspaceName(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES);
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);
}
@@ -1511,7 +1511,7 @@ wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES);
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);
}
@@ -1583,7 +1583,7 @@ wKWMGetUsableArea(WScreen *scr, WArea *area)
char buffer[64];
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);
}
@@ -1625,7 +1625,7 @@ wKWMSetUsableAreaHint(WScreen *scr, int workspace)
assert(workspace >= 0 && workspace < MAX_WORKSPACES);
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);
}
@@ -1682,7 +1682,7 @@ writeSocket(int sock, char *data)
{
char buffer[128];
sprintf(buffer, "%i ", strlen(data));
snprintf(buffer, sizeof(buffer), "%i ", strlen(data));
write(sock, buffer, strlen(buffer));
write(sock, data, strlen(data));
}
@@ -1692,15 +1692,16 @@ static int
connectKFM(WScreen *scr)
{
char *path;
char buffer[128];
char *buffer;
char *ptr;
FILE *f;
int pid;
int sock = 0;
struct sockaddr_un addr;
char buf[256];
path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/pid");
strcpy(buffer, getenv("DISPLAY"));
buffer = wstrdup(getenv("DISPLAY"));
ptr = strchr(buffer, ':');
if (ptr)
@@ -1712,12 +1713,12 @@ connectKFM(WScreen *scr)
{
char b[32];
sprintf(b, ".%i", scr->screen);
strcat(buffer, b);
snprintf(b, sizeof(b), ".%i", scr->screen);
buffer = wstrappend(buffer, b);
}
ptr = path;
path = wstrconcat(ptr, buffer);
wfree(ptr);
path = wstrappend(path, buffer);
wfree(buffer);
/* pid file */
f = fopen(path, "r");
@@ -1725,24 +1726,26 @@ connectKFM(WScreen *scr)
if (!f)
return -1;
buffer[0] = 0;
fgets(buffer, 123, f);
pid = atoi(buffer);
*buf = 0;
fgets(buf, sizeof(buf), f);
buf[sizeof(buf)] = 0;
pid = atoi(buf);
if (pid <= 0)
return -1;
if (kill(pid, 0) != 0)
return -1;
buffer[0] = 0;
fscanf(f, "%s", buffer);
*buf = 0;
fgets(buf, sizeof(buf), f);
buf[sizeof(buf)] = 0;
fclose(f);
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
return -1;
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, buffer);
strcpy(addr.sun_path, buf);
if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
close(sock);
@@ -1751,17 +1754,18 @@ connectKFM(WScreen *scr)
path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/magic");
f = fopen(path, "r");
wfree(path);
if (!f) {
return -1;
}
ptr = fgets(buffer, 123, f);
ptr = fgets(buf, sizeof(buf), f);
fclose(f);
if (!ptr) {
return -1;
}
puts(buffer);
ptr = wstrconcat("auth", buffer);
ptr = wstrconcat("auth", buf);
writeSocket(sock, ptr);
wfree(ptr);
+10 -6
View File
@@ -220,17 +220,18 @@ SetupEnvironment(WScreen *scr)
char buf[16];
if (multiHead) {
tmp = wmalloc(strlen(DisplayName)+64);
sprintf(tmp, "DISPLAY=%s", XDisplayName(DisplayName));
int len = strlen(DisplayName)+64;
tmp = wmalloc(len);
snprintf(tmp, len, "DISPLAY=%s", XDisplayName(DisplayName));
ptr = strchr(strchr(tmp, ':'), '.');
if (ptr)
*ptr = 0;
sprintf(buf, ".%i", scr->screen);
snprintf(buf, sizeof(buf), ".%i", scr->screen);
strcat(tmp, buf);
putenv(tmp);
}
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);
putenv(tmp);
}
@@ -735,8 +736,11 @@ main(int argc, char **argv)
multiHead = False;
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);
#ifdef DEBUG
+2 -2
View File
@@ -2455,7 +2455,7 @@ saveMenuInfo(proplist_t dict, WMenu *menu, proplist_t key)
proplist_t value, list;
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);
list = PLMakeArrayFromElements(value, NULL);
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)
return False;
sprintf(buffer, "%s\\%s", path, menu->frame->title);
snprintf(buffer, sizeof(buffer), "%s\\%s", path, menu->frame->title);
key = PLMakeString(buffer);
entry = PLGetDictionaryEntry(menus, key);
res = False;
+8 -7
View File
@@ -81,7 +81,7 @@ static void
putidef(char *line, char *name, int value)
{
char tmp[64];
sprintf(tmp, "%i", value);
snprintf(tmp, sizeof(tmp), "%i", value);
strcat(line, name);
strcat(line, tmp);
}
@@ -824,7 +824,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
case 'w':
if (scr->focused_window
&& scr->focused_window->flags.focused) {
sprintf(tmpbuf, "0x%x",
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
(unsigned int)scr->focused_window->client_win);
slen = strlen(tmpbuf);
olen += slen;
@@ -842,7 +842,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
break;
case 'W':
sprintf(tmpbuf, "0x%x",
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x",
(unsigned int)scr->current_workspace + 1);
slen = strlen(tmpbuf);
olen += slen;
@@ -1128,8 +1128,9 @@ EscapeWM_CLASS(char *name, char *class)
}
if (ename && eclass) {
ret = wmalloc(strlen(ename)+strlen(eclass)+4);
sprintf(ret, "%s.%s", ename, eclass);
int len = strlen(ename)+strlen(eclass)+4;
ret = wmalloc(len);
snprintf(ret, len, "%s.%s", ename, eclass);
wfree(ename);
wfree(eclass);
} 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 ;
buffer = wmalloc(len+5);
sprintf(buf, "%4i", len);
snprintf(buf, len, "%4i", len);
memcpy(buffer, buf, 4);
buffer[4] = type;
i = 5;
if (workspace >= 0) {
sprintf(buf, "%4i", workspace);
snprintf(buf, sizeof(buf), "%4i", workspace);
memcpy(&buffer[i], buf, 4);
i += 4;
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);
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);
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;
}
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);
fw = WMWidthOfString(scr->info_text_font, num, strlen(num));
+33 -6
View File
@@ -331,14 +331,16 @@ getLocalizedMenuFile(char *menu)
{
char *buffer;
char *ptr;
int len;
if (!Locale)
return NULL;
buffer = wmalloc(strlen(menu)+32);
len = strlen(menu)+32;
buffer = wmalloc(len);
/* try menu.locale_name */
sprintf(buffer, "%s.%s", menu, Locale);
snprintf(buffer, len, "%s.%s", menu, Locale);
if (access(buffer, F_OK)==0) {
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*
addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
{
@@ -756,8 +766,10 @@ addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
return NULL;
} else {
scr->flags.added_workspace_menu = 1;
wsmenu = wWorkspaceMenuMake(scr, True);
wsmenu->on_destroy = cleanupWorkspaceMenu;
scr->workspace_menu = wsmenu;
entry = wMenuAddCallback(menu, title, NULL, NULL);
wMenuEntrySetCascade(menu, entry, wsmenu);
@@ -767,6 +779,15 @@ addWorkspaceMenu(WScreen *scr, WMenu *menu, char *title)
return entry;
}
static void
cleanupWindowsMenu(WMenu *menu)
{
if (menu->frame->screen_ptr->switch_menu == menu)
menu->frame->screen_ptr->switch_menu = NULL;
}
static WMenuEntry*
addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
{
@@ -781,6 +802,7 @@ addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
scr->flags.added_windows_menu = 1;
wwmenu = wMenuCreate(scr, _("Window List"), False);
wwmenu->on_destroy = cleanupWindowsMenu;
scr->switch_menu = wwmenu;
wwin = scr->focused_window;
while (wwin) {
@@ -794,6 +816,7 @@ addWindowsMenu(WScreen *scr, WMenu *menu, char *title)
return entry;
}
static WMenuEntry*
addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command,
char *params, char *file_name)
@@ -1131,7 +1154,8 @@ readMenuFile(WScreen *scr, char *file_name)
if (!args) {
wwarning(_("could not make arguments for menu file preprocessor"));
} 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);
file = popen(command, "r");
if (!file) {
@@ -1230,7 +1254,8 @@ readMenuPipe(WScreen *scr, char **file_name)
if (!args) {
wwarning(_("could not make arguments for menu file preprocessor"));
} else {
sprintf(command, "%s | %s %s", filename, CPP_PATH, args);
snprintf(command, sizeof(command), "%s | %s %s",
filename, CPP_PATH, args);
wfree(args);
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.added_workspace_menu = 0;
scr->flags.added_windows_menu = 0;
if (scr->root_menu && scr->root_menu->flags.mapped) {
menu = scr->root_menu;
@@ -1798,8 +1824,9 @@ OpenRootMenu(WScreen *scr, int x, int y, int keyboard)
menu = scr->root_menu;
} else {
/* new root menu */
if (scr->root_menu)
if (scr->root_menu) {
wMenuDestroy(scr->root_menu, True);
}
scr->root_menu = menu;
}
if (menu) {
+4 -4
View File
@@ -557,7 +557,7 @@ aquireManagerSelection(WScreen *scr)
XEvent ev;
Time timestamp;
sprintf(buffer, "WM_S%i", scr->screen);
snprintf(buffer, sizeof(buffer), "WM_S%i", scr->screen);
scr->managerAtom = XInternAtom(dpy, buffer, False);
/* for race-conditions... */
@@ -1015,14 +1015,14 @@ wScreenRestoreState(WScreen *scr)
path = wdefaultspathfordomain("WMState");
else {
char buf[16];
sprintf(buf, "WMState.%i", scr->screen);
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
}
scr->session_state = PLGetProplistWithPath(path);
wfree(path);
if (!scr->session_state && wScreenCount>1) {
char buf[16];
sprintf(buf, "WMState.%i", scr->screen);
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
scr->session_state = PLGetProplistWithPath(path);
wfree(path);
@@ -1125,7 +1125,7 @@ wScreenSaveState(WScreen *scr)
str = wdefaultspathfordomain("WMState");
else {
char buf[16];
sprintf(buf, "WMState.%i", scr->screen);
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
str = wdefaultspathfordomain(buf);
}
path = PLMakeString(str);
+30 -23
View File
@@ -215,7 +215,7 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
char **argv;
int i;
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 shaded, miniaturized, hidden, geometry;
proplist_t dock, shortcut;
@@ -234,13 +234,13 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
if (PropGetWMClass(win, &class, &instance)) {
if (class && instance)
sprintf(buffer, "%s.%s", instance, class);
snprintf(buffer, sizeof(buffer), "%s.%s", instance, class);
else if (instance)
sprintf(buffer, "%s", instance);
snprintf(buffer, sizeof(buffer), "%s", instance);
else if (class)
sprintf(buffer, ".%s", class);
snprintf(buffer, sizeof(buffer), ".%s", class);
else
sprintf(buffer, ".");
snprintf(buffer, sizeof(buffer), ".");
name = PLMakeString(buffer);
cmd = PLMakeString(command);
@@ -250,7 +250,8 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
shaded = wwin->flags.shaded ? sYes : sNo;
miniaturized = wwin->flags.miniaturized ? 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);
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);
win_state = PLMakeDictionaryFromEntries(sName, name,
@@ -860,7 +861,7 @@ makeAttributeState(WWindow *wwin)
#define W_FLAG(wwin, FLAG) ((wwin)->defined_user_flags.FLAG \
? (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",
W_FLAG(no_titlebar),
W_FLAG(no_resizable),
@@ -912,7 +913,7 @@ makeClientState(WWindow *wwin)
proplist_t state;
proplist_t tmp;
char *str;
char buffer[256];
char buffer[512];
int i;
unsigned shortcuts;
@@ -940,13 +941,13 @@ makeClientState(WWindow *wwin)
appendStringInArray(state, wwin->frame->name);
/* 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->flags.user_changed_width, wwin->flags.user_changed_height);
appendStringInArray(state, buffer);
/* 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);
appendStringInArray(state, buffer);
@@ -956,7 +957,7 @@ makeClientState(WWindow *wwin)
PLRelease(tmp);
/* workspace */
sprintf(buffer, "%i", wwin->frame->workspace);
snprintf(buffer, sizeof(buffer), "%i", wwin->frame->workspace);
appendStringInArray(state, buffer);
/* app state (repeated for all windows of the app) */
@@ -971,7 +972,7 @@ makeClientState(WWindow *wwin)
shortcuts |= 1 << i;
}
}
sprintf(buffer, "%ui", shortcuts);
snprintf(buffer, sizeof(buffer), "%ui", shortcuts);
appendStringInArray(tmp, buffer);
return state;
@@ -993,6 +994,7 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
char *discardCmd = NULL;
time_t t;
proplist_t state;
int len;
#ifdef DEBUG1
puts("received SaveYourselfPhase2 SM message");
@@ -1013,7 +1015,8 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
if (!prefix)
prefix = ".";
statefile = malloc(strlen(prefix)+64);
len = strlen(prefix)+64;
statefile = malloc(len);
if (!statefile) {
wwarning(_("out of memory while saving session state"));
goto fail;
@@ -1023,10 +1026,10 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
i = 0;
do {
if (gsPrefix)
sprintf(statefile, "%s/.AppInfo/WindowMaker/wmaker.%l%i.state",
snprintf(statefile, len, "%s/.AppInfo/WindowMaker/wmaker.%l%i.state",
prefix, t, i);
else
sprintf(statefile, "%s/wmaker.%l%i.state", prefix, t, i);
snprintf(statefile, len, "%s/wmaker.%l%i.state", prefix, t, i);
i++;
} while (access(F_OK, statefile)!=-1);
@@ -1050,7 +1053,7 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
scr = wScreenWithNumber(i);
sprintf(buf, "%i", scr->screen);
snprintf(buf, sizeof(buf), "%i", scr->screen);
pscreen = PLMakeArrayFromElements(PLMakeString(buf), NULL);
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].length = strlen(statefile);
discardCmd = malloc(strlen(statefile)+8);
if (!discardCmd)
goto fail;
sprintf(discardCmd, "rm %s", statefile);
{
int len = strlen(statefile)+8;
discardCmd = malloc(len);
if (!discardCmd)
goto fail;
snprintf(discardCmd, len, "rm %s", statefile);
}
prop[2].name = SmDiscardCommand;
prop[2].type = SmARRAY8;
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,
* but every client implementation I saw places the uid # */
sprintf(uid, "%i", getuid());
snprintf(uid, sizeof(uid), "%i", getuid());
prop2val.value = uid;
prop2val.length = strlen(uid);
prop[1].name = SmUserID;
@@ -1336,7 +1343,7 @@ wSessionConnectManager(char **argv, int argc)
prop[2].vals = &prop3val;
/* Our PID. Not required but might be usefull */
sprintf(pid, "%i", getpid());
snprintf(pid, sizeof(pid), "%i", getpid());
prop4val.value = pid;
prop4val.length = strlen(pid);
prop[3].name = SmProcessID;
+12 -1
View File
@@ -715,6 +715,12 @@ static char *atomNames[] = {
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);
/* 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;
sigaction(SIGPIPE, &sig_action, NULL);
+14 -11
View File
@@ -181,6 +181,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
WMenu *switchmenu = scr->switch_menu;
WMenuEntry *entry;
char title[MAX_MENU_TEXT_LENGTH+6];
int len = MAX_MENU_TEXT_LENGTH+6;
int i;
int checkVisibility = 0;
@@ -201,11 +202,11 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
if (wwin->flags.internal_window || WFLAGP(wwin, skip_window_list))
return;
if (wwin->frame->title)
sprintf(title, "%s", wwin->frame->title);
snprintf(title, len, "%s", wwin->frame->title);
else
sprintf(title, "%s", DEF_WINDOW_TITLE);
snprintf(title, len, "%s", DEF_WINDOW_TITLE);
t = ShrinkString(scr->menu_entry_font, title, MAX_WINDOWLIST_WIDTH);
if (IS_OMNIPRESENT(wwin))
@@ -220,9 +221,9 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
entry->flags.indicator = 1;
entry->rtext = wmalloc(MAX_WORKSPACENAME_WIDTH+8);
if (IS_OMNIPRESENT(wwin))
sprintf(entry->rtext, "[*]");
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH, "[*]");
else
sprintf(entry->rtext, "[%s]",
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH, "[%s]",
scr->workspaces[wwin->frame->workspace]->name);
if (wwin->flags.hidden) {
@@ -262,7 +263,8 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
snprintf(title, MAX_MENU_TEXT_LENGTH, "%s",
wwin->frame->title);
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);
entry->text = t;
@@ -278,10 +280,11 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
int it, ion;
if (IS_OMNIPRESENT(wwin)) {
sprintf(entry->rtext, "[*]");
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
"[*]");
} else {
sprintf(entry->rtext, "[%s]",
scr->workspaces[wwin->frame->workspace]->name);
snprintf(entry->rtext, MAX_WORKSPACENAME_WIDTH,
"[%s]", scr->workspaces[wwin->frame->workspace]->name);
}
rt = entry->rtext;
@@ -362,9 +365,9 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
if (wwin->frame->workspace==workspace
&& !IS_OMNIPRESENT(wwin)) {
if (IS_OMNIPRESENT(wwin))
sprintf(menu->entries[i]->rtext, "[*]");
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[*]");
else
sprintf(menu->entries[i]->rtext, "[%s]",
snprintf(menu->entries[i]->rtext, MAX_WORKSPACENAME_WIDTH,"[%s]",
scr->workspaces[wwin->frame->workspace]->name);
menu->flags.realized = 0;
}
+3 -2
View File
@@ -357,8 +357,9 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
char *path = NULL;
char *tmp;
if ( wwin->wm_instance && wwin->wm_class ) {
tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7);
sprintf(tmp,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
int len = strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7;
tmp=wmalloc(len);
snprintf(tmp,len,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
path = wfindfile(DEF_USER_MENU_PATHS,tmp);
wfree(tmp);
+1 -1
View File
@@ -1792,7 +1792,7 @@ wWindowUpdateName(WWindow *wwin, char *newTitle)
#ifndef NO_WINDOW_ENUMERATOR
if (instIndex > 0) {
sprintf(prefix, " [%i]", instIndex);
snprintf(prefix, sizeof(prefix), " [%i]", instIndex);
title = wstrconcat(title, prefix);
}
+5 -3
View File
@@ -262,20 +262,22 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
WMenu *smenu = menu->cascades[menu->entries[MC_SHORTCUT]->cascade];
int i;
char *buffer;
int buflen;
KeyCode kcode;
if (!smenu)
return;
buffer = wmalloc(strlen(_("Set Shortcut"))+16);
buflen = strlen(_("Set Shortcut"))+16;
buffer = wmalloc(buflen);
for (i=WO_ENTRIES; i<smenu->entry_no; i++) {
char *tmp;
int shortcutNo = i-WO_ENTRIES;
WMenuEntry *entry = smenu->entries[i];
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) {
entry->flags.indicator_on = 0;
+12 -8
View File
@@ -380,9 +380,10 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
if (!path) {
char *buf;
int len = strlen(file)+80;
buf = wmalloc(strlen(file)+80);
sprintf(buf, _("Could not find icon \"%s\" specified for this window"),
buf = wmalloc(len);
snprintf(buf, len, _("Could not find icon \"%s\" specified for this window"),
file);
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL);
@@ -396,9 +397,10 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
if (!pixmap) {
char *buf;
int len = strlen(file)+80;
buf = wmalloc(strlen(file)+80);
sprintf(buf, _("Could not open specified icon \"%s\":%s"),
buf = wmalloc(len);
snprintf(buf, len, _("Could not open specified icon \"%s\":%s"),
file, RMessageForError(RErrorCode));
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL);
@@ -1123,18 +1125,20 @@ selectSpecification(WMWidget *bPtr, void *data)
InspectorPanel *panel = (InspectorPanel*)data;
char *str;
WWindow *wwin = panel->inspected;
int len;
if (bPtr == panel->defaultRb && (wwin->wm_instance || wwin->wm_class)) {
WMSetButtonEnabled(panel->applyBtn, False);
} else {
WMSetButtonEnabled(panel->applyBtn, True);
}
len = 16 + strlen(wwin->wm_instance ? wwin->wm_instance : "?")
+ strlen(wwin->wm_class ? wwin->wm_class : "?");
str = wmalloc(16 + strlen(wwin->wm_instance ? wwin->wm_instance : "?")
+ strlen(wwin->wm_class ? wwin->wm_class : "?"));
str = wmalloc(len);
sprintf(str, _("Inspecting %s.%s"),
snprintf(str, len, _("Inspecting %s.%s"),
wwin->wm_instance ? wwin->wm_instance : "?",
wwin->wm_class ? wwin->wm_class : "?");
+4 -3
View File
@@ -10,6 +10,7 @@
echo gathering information for bug tracking...
uname -a > sysinfo.txt
wmaker --version >> sysinfo.txt
echo "=============== xdpyinfo ================" >> sysinfo.txt
xdpyinfo >> 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
echo "=============== configuration dir ===========" >> sysinfo.txt
WDIR=$HOME/gnustep/Library/WindowMaker
WDIR=$HOME/GNUstep/Defaults
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
echo "============== $i ========" >> sysinfo.txt
cat $WDIR/$i >> sysinfo.txt
@@ -37,6 +38,6 @@ else
echo "No config directory found" >> sysinfo.txt
fi
gzip -9 sysinfo.txt
bzip2 -9f sysinfo.txt || gzip -9f sysinfo.txt
echo done.
+23 -7
View File
@@ -61,7 +61,7 @@ static BufferData *newWindow(int magfactor);
int windowCount = 0;
int rectBufferSize = 32;
Display *dpy;
Display *dpy, *vdpy;
WMScreen *scr;
unsigned int black;
WMColor *cursorColor1;
@@ -212,19 +212,19 @@ updateImage(BufferData *data, int rx, int ry)
gw += gx;
gx = 0;
}
if (gx + gw >= WidthOfScreen(DefaultScreenOfDisplay(dpy))) {
gw = WidthOfScreen(DefaultScreenOfDisplay(dpy)) - gx;
if (gx + gw >= WidthOfScreen(DefaultScreenOfDisplay(vdpy))) {
gw = WidthOfScreen(DefaultScreenOfDisplay(vdpy)) - gx;
}
if (gy < 0) {
yoffs = abs(gy);
gh += gy;
gy = 0;
}
if (gy + gh >= HeightOfScreen(DefaultScreenOfDisplay(dpy))) {
gh = HeightOfScreen(DefaultScreenOfDisplay(dpy)) - gy;
if (gy + gh >= HeightOfScreen(DefaultScreenOfDisplay(vdpy))) {
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);
@@ -453,6 +453,7 @@ int main(int argc, char **argv)
BufferData *data;
int i;
char *display = "";
char *vdisplay = NULL;
int magfactor = 2;
#if 0
WMButton *radio, *tradio;
@@ -466,6 +467,11 @@ int main(int argc, char **argv)
if (i >= argc)
goto help;
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) {
i++;
if (i >= argc)
@@ -505,12 +511,22 @@ int main(int argc, char **argv)
}
}
dpy = XOpenDisplay("");
dpy = XOpenDisplay(display);
if (!dpy) {
puts("couldnt open display");
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 */
rectBufferSize = XMaxRequestSize(dpy) - 128;
rectBufferSize /= sizeof(XRectangle);
+3
View File
@@ -68,6 +68,8 @@ copy() {
if [ "$LOCALE" ]; then
if [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then
source=$GLOBALDIR/plmenu.${LOCALE%_*}
elif [ -f $GLOBALDIR/menu.${LOCALE%_*} ]; then
source=$GLOBALDIR/menu.${LOCALE%_*}
else
source=$GLOBALDIR/plmenu
fi
@@ -266,6 +268,7 @@ test -f ~$GSDIR/Library/WindowMaker/exitscript || \
cp $GLOBALDIR/exitscript.sh $GSDIR/Library/WindowMaker/exitscript
chmod +rx $GSDIR/Library/WindowMaker/exitscript
# no need to call wmchlocale --auto, since national menu is already copied
wsetfont --auto
# xx herbert
+35 -14
View File
@@ -2,12 +2,19 @@
#
# 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`
VERSION="0.1"
VERSION="0.3"
if [ "x$GNUSTEP_USER_ROOT" = "x" ]; then
GSDIR="$HOME/GNUstep"
@@ -23,13 +30,13 @@ LOCALDIR="$GSDIR/Library/WindowMaker"
help_msg() {
echo -e "\n"\
"$PROGRAM, v$VERSION by judas@hell\n"\
"$PROGRAM, v$VERSION by Jan \"judas\" Tomka\n"\
"Syntax:\n"\
" $PROGRAM [--auto] [--nodef] [<new-locale> | default]\n"\
" $PROGRAM [--auto] [--test] [<new-locale> | default]\n"\
"\n"\
"<new-locale> locale you want WindowMaker to move to (e.g. ja or default)\n"\
"--auto use current locale\n"\
"--nodef try to change only codings of fonts\n"
"--test don't write anything\n"
exit 0
}
@@ -41,8 +48,8 @@ for i in $*; do
case $i in
--auto)
auto="YES";;
--nodef)
nodef="--nodef";;
--test)
test="--test";;
*)
if [ -z "$new_locale" ]; then
new_locale="$i"
@@ -54,6 +61,7 @@ for i in $*; do
done
if [ "$new_locale" = "default" ]; then
new_locale=""
default="YES"
fi
if [ -n "$auto" ] && [ -z "$new_locale" ]; then
@@ -64,12 +72,20 @@ if [ -n "$auto" ] && [ -z "$new_locale" ]; then
fi
if [ -z "$new_locale" ]; then
echo -e "\nNo locale is set, using default...\n" >/dev/stderr
if [ -z "$default" ]; then
echo -e "\nNo locale is set, using default...\n" >/dev/stderr
fi
elif ! (locale -a |grep "^$new_locale$" &>/dev/null); then
echo -e "\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"\
"\n" >/dev/stderr
if [ -z "$auto" ]; then
echo -e "\n"\
"Locale $new_locale is not supported on your system..."\
"\n" >/dev/stderr
else
echo -e "\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"\
"\n" >/dev/stderr
fi
exit 1
fi
@@ -77,13 +93,18 @@ echo -n "Setting Window Maker root menu... "
if [ -z "$new_locale" ] || [ "$new_locale" = "en" ]; then
menu_list="plmenu menu"
args="default"
else
menu_list="plmenu.$new_locale menu.$new_locale plmenu menu"
args="--locale=$new_locale"
fi
echo -n "Setting Window Maker root menu... "
for new_menu in $menu_list; do
for wm_dir in $LOCALDIR $GLOBALDIR; do
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"
else
echo "fail (copying default)"
@@ -118,7 +139,7 @@ if wsetfont "$args" &>/dev/null; then
echo "success"
else
echo -n "fail"
if wsetfont default &>/dev/null; then
if wsetfont default "$test" &>/dev/null; then
echo " (setting default)"
else
echo " (totally)"
+1 -1
View File
@@ -1423,7 +1423,7 @@ main(int argc, char **argv)
render_mode = RDitheredRendering;
rattr.flags = RC_RenderMode | RC_ColorsPerChannel
| RC_StandardColormap;
| RC_StandardColormap | RC_DefaultVisual;
rattr.render_mode = render_mode;
rattr.colors_per_channel = cpc;
rattr.standard_colormap_mode = RCreateStdColormap;
+7 -2
View File
@@ -77,8 +77,8 @@ for i in $*; do
"--auto")
auto="YES";;
*)
if echo $i |grep "^--locale=" &>/dev/null; then
new_locale=$(echo $i |sed -e "s|--locale=||" -)
if echo $i |grep "^--locale=" >/dev/null 2>&1; then
new_locale=$(echo $i |sed -e "s|--locale=||")
elif [ -z $family ]; then
family=$i
else
@@ -333,6 +333,11 @@ for i in $DomainNames; do
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"
echo $j="${_j}"
$WDWRITE $i $j \"${_j}\"