forked from vitrine/wmaker
Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4732296762 | ||
|
|
3846a5017c | ||
|
|
d736af8321 | ||
|
|
506e14cd24 | ||
|
|
ee047b63df | ||
|
|
0b5033a0e4 | ||
|
|
f6c897de95 | ||
|
|
249dee3874 | ||
|
|
0d6f5b6d57 | ||
|
|
e4c619bb14 | ||
|
|
adb601eaa9 | ||
|
|
a07bdb747d | ||
|
|
d7bde34561 | ||
|
|
ceeddfb9da | ||
|
|
5325e2d455 | ||
|
|
82c8b0c9b4 | ||
|
|
a67f7483fd | ||
|
|
cf87f7e83b | ||
|
|
b569889f21 | ||
|
|
383b3a1a7b | ||
|
|
4fd7d1e2c1 | ||
|
|
0131c493c0 | ||
|
|
5f1317b885 | ||
|
|
5817c1f032 | ||
|
|
6d09fbff93 | ||
|
|
b38fa197d7 | ||
|
|
4c617034b4 | ||
|
|
f5daf2a76a | ||
|
|
05895b40a2 | ||
|
|
4f4ef94400 | ||
|
|
023ab177b2 | ||
|
|
279f369256 | ||
|
|
0a2ff4f055 | ||
|
|
108c913c1d | ||
|
|
8c669d57b2 | ||
|
|
83fa8119d9 | ||
|
|
507e69e209 | ||
|
|
70814cc235 | ||
|
|
2ef6720890 | ||
|
|
493d3c9738 | ||
|
|
917cc29160 | ||
|
|
3234e15388 | ||
|
|
394b4d23cb | ||
|
|
274d1459aa | ||
|
|
9a886baef8 | ||
|
|
7ba66fbc00 | ||
|
|
289ceb2991 | ||
|
|
ab7e188334 | ||
|
|
55d34ff0a1 | ||
|
|
0e7f125494 | ||
|
|
9404c21fa8 | ||
|
|
455aa71c19 | ||
|
|
18db22063c | ||
|
|
b4d1dbe953 | ||
|
|
da676c9e9e | ||
|
|
4edf589a5b | ||
|
|
709eec4bce | ||
|
|
b179803c11 | ||
|
|
5cd40deb20 | ||
|
|
9db1ea580d | ||
|
|
9e56f58742 |
@@ -133,8 +133,13 @@ WPrefs.app/WPrefs.desktop
|
||||
/WPrefs.app/po/*.mo
|
||||
/util/po/*.pot
|
||||
/util/po/*.mo
|
||||
/wrlib/po/*.pot
|
||||
/wrlib/po/*.mo
|
||||
|
||||
# Some text editors generate backup files
|
||||
*~
|
||||
|
||||
.pc
|
||||
|
||||
# Rust stuff.
|
||||
/*/target/**
|
||||
|
||||
@@ -21,7 +21,7 @@ Changes since version 0.95.7:
|
||||
- debian: Ignore missing documentation for --runstatedir.
|
||||
- debian: Use dh_autoreconf.
|
||||
- debian: Simplify debian/rules.
|
||||
- debian: Fix typo occured. (Thanks, lintian.)
|
||||
- debian: Fix typo occurred. (Thanks, lintian.)
|
||||
- debian: wmaker manpage moved from 1x to 1.
|
||||
(Andreas Metzler <ametzler@bebt.de>)
|
||||
- debian: Add wmiv to wmaker package.
|
||||
@@ -498,7 +498,7 @@ Changes since version 0.95.6:
|
||||
- doc: Add manpage for wmiv.
|
||||
(Doug Torrance <dtorrance@monmouthcollege.edu>)
|
||||
- wmaker: replaced old email address with the official one
|
||||
- WINGs: Updated news with the API changes that occured between 0.95.6 and
|
||||
- WINGs: Updated news with the API changes that occurred between 0.95.6 and
|
||||
0.95.7
|
||||
- WINGs: ran spell checker on the NEWS file
|
||||
- WINGs: fix non-portable int conversion for printf in font panel size handling
|
||||
@@ -969,7 +969,7 @@ Changes since version 0.95.5:
|
||||
- WMaker: moved XGrab/XUngrabPointer into the conditional code
|
||||
- News: created section dedicated to the changes related to 0.95.3
|
||||
- News: added description of a change that may be interesting to users
|
||||
- News: added section to describe the changes that have occured in 0.95.4
|
||||
- News: added section to describe the changes that have occurred in 0.95.4
|
||||
- News: marked the current changes as part of 0.95.5 and describe the drawers
|
||||
feature
|
||||
- News: described the new features for future 0.95.6 release
|
||||
@@ -1103,7 +1103,7 @@ Changes since version 0.95.5:
|
||||
#50158)
|
||||
- WPrefs: fix NULL pointer handling when getting the Modifiers (Coverity
|
||||
#50200)
|
||||
- WPrefs: add warning when renderTexture encounters some unknow settings
|
||||
- WPrefs: add warning when renderTexture encounters some unknown settings
|
||||
(Christophe CURIS <christophe.curis@free.fr>)
|
||||
- util/wmiv: add image auto orientation detection
|
||||
(David Maciejak <david.maciejak@gmail.com>)
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-silent-rules LINGUAS='*'
|
||||
|
||||
|
||||
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib WPrefs.app doc
|
||||
SUBDIRS = wrlib wutil-rs WINGs wmaker-rs src util po WindowMaker wmlib WPrefs.app doc
|
||||
DIST_SUBDIRS = $(SUBDIRS) test
|
||||
|
||||
EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ Changes since wmaker 0.64.0:
|
||||
- Moved all internal handlers (timer, idle and input) to handlers.c
|
||||
- simplified wevent.c and wutil.c.
|
||||
- fixed handling of input with poll (was broken)
|
||||
- fixed mem leak that occured when input handling was done with poll
|
||||
- fixed mem leak that occurred when input handling was done with poll
|
||||
- simpler and more straightforward event handling for timer, idle, input
|
||||
and X events (also fixed some problems the old handling logic had)
|
||||
- moved timer, idle and input handler definitions and prototypes from
|
||||
|
||||
+5
-6
@@ -10,10 +10,12 @@ libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
|
||||
|
||||
lib_LTLIBRARIES = libWUtil.la libWINGs.la
|
||||
|
||||
wutilrs = $(top_builddir)/wutil-rs/target/debug/libwutil_rs.a
|
||||
wraster = $(top_builddir)/wrlib/libwraster.la
|
||||
|
||||
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
||||
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGO_LIBS@
|
||||
libWUtil_la_LIBADD = @LIBBSD@
|
||||
LDADD= libWUtil.la libWINGs.la $(wraster) $(wutilrs) @INTLIBS@
|
||||
libWINGs_la_LIBADD = libWUtil.la $(wraster) $(wutilrs) @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGO_LIBS@
|
||||
libWUtil_la_LIBADD = @LIBBSD@ $(wutilrs)
|
||||
|
||||
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
|
||||
|
||||
@@ -62,15 +64,12 @@ libWINGs_la_SOURCES = \
|
||||
wwindow.c
|
||||
|
||||
libWUtil_la_SOURCES = \
|
||||
array.c \
|
||||
bagtree.c \
|
||||
data.c \
|
||||
error.c \
|
||||
error.h \
|
||||
findfile.c \
|
||||
handlers.c \
|
||||
hashtable.c \
|
||||
memory.c \
|
||||
menuparser.c \
|
||||
menuparser.h \
|
||||
menuparser_macros.c \
|
||||
|
||||
+9
-50
@@ -213,10 +213,6 @@ void wfree(void *ptr);
|
||||
void wrelease(void *ptr);
|
||||
void* wretain(void *ptr);
|
||||
|
||||
typedef void waborthandler(int);
|
||||
|
||||
waborthandler* wsetabort(waborthandler* handler);
|
||||
|
||||
/* ---[ WINGs/error.c ]--------------------------------------------------- */
|
||||
|
||||
enum {
|
||||
@@ -248,8 +244,8 @@ char* wexpandpath(const char *path);
|
||||
|
||||
int wcopy_file(const char *toPath, const char *srcFile, const char *destFile);
|
||||
|
||||
/* don't free the returned string */
|
||||
const char* wgethomedir(void);
|
||||
/* You must free the returned string! */
|
||||
char* wgethomedir(void);
|
||||
|
||||
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
|
||||
|
||||
@@ -400,7 +396,7 @@ extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
|
||||
/* keys are strings, but they are not copied */
|
||||
|
||||
|
||||
/* ---[ WINGs/array.c ]--------------------------------------------------- */
|
||||
/* ---[ wutil-rs/src/array.rs ]--------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* WMArray use an array to store the elements.
|
||||
@@ -422,29 +418,22 @@ WMArray* WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc *destructor
|
||||
|
||||
WMArray* WMCreateArrayWithArray(WMArray *array);
|
||||
|
||||
#define WMDuplicateArray(array) WMCreateArrayWithArray(array)
|
||||
|
||||
void WMEmptyArray(WMArray *array);
|
||||
|
||||
void WMFreeArray(WMArray *array);
|
||||
|
||||
int WMGetArrayItemCount(WMArray *array);
|
||||
|
||||
/* appends other to array. other remains unchanged */
|
||||
void WMAppendArray(WMArray *array, WMArray *other);
|
||||
|
||||
/* add will place the element at the end of the array */
|
||||
void WMAddToArray(WMArray *array, void *item);
|
||||
|
||||
/* insert will increment the index of elements after it by 1 */
|
||||
void WMInsertInArray(WMArray *array, int index, void *item);
|
||||
|
||||
/* replace and set will return the old item WITHOUT calling the
|
||||
/* set returns the old item WITHOUT calling the
|
||||
* destructor on it even if its available. Free the returned item yourself.
|
||||
*/
|
||||
void* WMReplaceInArray(WMArray *array, int index, void *item);
|
||||
|
||||
#define WMSetInArray(array, index, item) WMReplaceInArray(array, index, item)
|
||||
void* WMSetInArray(WMArray *array, int index, void *item);
|
||||
|
||||
/* delete and remove will remove the elements and cause the elements
|
||||
* after them to decrement their indexes by 1. Also will call the
|
||||
@@ -452,20 +441,21 @@ void* WMReplaceInArray(WMArray *array, int index, void *item);
|
||||
*/
|
||||
int WMDeleteFromArray(WMArray *array, int index);
|
||||
|
||||
#define WMRemoveFromArray(array, item) WMRemoveFromArrayMatching(array, NULL, item)
|
||||
int WMRemoveFromArray(WMArray *array, void *item);
|
||||
|
||||
int WMRemoveFromArrayMatching(WMArray *array, WMMatchDataProc *match, void *cdata);
|
||||
|
||||
void* WMGetFromArray(WMArray *array, int index);
|
||||
|
||||
#define WMGetFirstInArray(array, item) WMFindInArray(array, NULL, item)
|
||||
|
||||
/* pop will return the last element from the array, also removing it
|
||||
* from the array. The destructor is NOT called, even if available.
|
||||
* Free the returned element if needed by yourself
|
||||
*/
|
||||
void* WMPopFromArray(WMArray *array);
|
||||
|
||||
/* Like WMFindInArray(array, NULL, item) */
|
||||
int WMGetFirstInArray(WMArray *array, void *item);
|
||||
|
||||
int WMFindInArray(WMArray *array, WMMatchDataProc *match, void *cdata);
|
||||
|
||||
int WMCountInArray(WMArray *array, void *item);
|
||||
@@ -479,8 +469,6 @@ void WMSortArray(WMArray *array, WMCompareDataProc *comparer);
|
||||
|
||||
void WMMapArray(WMArray *array, void (*function)(void*, void*), void *data);
|
||||
|
||||
WMArray* WMGetSubarrayWithRange(WMArray* array, WMRange aRange);
|
||||
|
||||
void* WMArrayFirst(WMArray *array, WMArrayIterator *iter);
|
||||
|
||||
void* WMArrayLast(WMArray *array, WMArrayIterator *iter);
|
||||
@@ -604,37 +592,16 @@ WMData* WMCreateDataWithLength(unsigned length);
|
||||
|
||||
WMData* WMCreateDataWithBytes(const void *bytes, unsigned length);
|
||||
|
||||
/* destructor is a function called to free the data when releasing the data
|
||||
* object, or NULL if no freeing of data is necesary. */
|
||||
WMData* WMCreateDataWithBytesNoCopy(void *bytes, unsigned length,
|
||||
WMFreeDataProc *destructor);
|
||||
|
||||
WMData* WMCreateDataWithData(WMData *aData);
|
||||
|
||||
WMData* WMRetainData(WMData *aData);
|
||||
|
||||
void WMReleaseData(WMData *aData);
|
||||
|
||||
/* Adjusting capacity */
|
||||
|
||||
void WMSetDataCapacity(WMData *aData, unsigned capacity);
|
||||
|
||||
void WMSetDataLength(WMData *aData, unsigned length);
|
||||
|
||||
void WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength);
|
||||
|
||||
/* Accessing data */
|
||||
|
||||
const void* WMDataBytes(WMData *aData);
|
||||
|
||||
void WMGetDataBytes(WMData *aData, void *buffer);
|
||||
|
||||
void WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length);
|
||||
|
||||
void WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange);
|
||||
|
||||
WMData* WMGetSubdataWithRange(WMData *aData, WMRange aRange);
|
||||
|
||||
/* Testing data */
|
||||
|
||||
Bool WMIsDataEqualToData(WMData *aData, WMData *anotherData);
|
||||
@@ -649,10 +616,6 @@ void WMAppendData(WMData *aData, WMData *anotherData);
|
||||
|
||||
/* Modifying data */
|
||||
|
||||
void WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, const void *bytes);
|
||||
|
||||
void WMResetDataBytesInRange(WMData *aData, WMRange aRange);
|
||||
|
||||
void WMSetData(WMData *aData, WMData *anotherData);
|
||||
|
||||
|
||||
@@ -768,10 +731,6 @@ WMPropList* WMCreatePLData(WMData *data);
|
||||
|
||||
WMPropList* WMCreatePLDataWithBytes(const unsigned char *bytes, unsigned int length);
|
||||
|
||||
WMPropList* WMCreatePLDataWithBytesNoCopy(unsigned char *bytes,
|
||||
unsigned int length,
|
||||
WMFreeDataProc *destructor);
|
||||
|
||||
WMPropList* WMCreatePLArray(WMPropList *elem, ...);
|
||||
|
||||
WMPropList* WMCreatePLDictionary(WMPropList *key, WMPropList *value, ...);
|
||||
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
/*
|
||||
* Dynamically Resized Array
|
||||
*
|
||||
* Authors: Alfredo K. Kojima <kojima@windowmaker.info>
|
||||
* Dan Pascu <dan@windowmaker.info>
|
||||
*
|
||||
* This code is released to the Public Domain, but
|
||||
* proper credit is always appreciated :)
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "WUtil.h"
|
||||
|
||||
#define INITIAL_SIZE 8
|
||||
#define RESIZE_INCREMENT 8
|
||||
|
||||
typedef struct W_Array {
|
||||
void **items; /* the array data */
|
||||
int itemCount; /* # of items in array */
|
||||
int allocSize; /* allocated size of array */
|
||||
WMFreeDataProc *destructor; /* the destructor to free elements */
|
||||
} W_Array;
|
||||
|
||||
WMArray *WMCreateArray(int initialSize)
|
||||
{
|
||||
return WMCreateArrayWithDestructor(initialSize, NULL);
|
||||
}
|
||||
|
||||
WMArray *WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc * destructor)
|
||||
{
|
||||
WMArray *array;
|
||||
|
||||
array = wmalloc(sizeof(WMArray));
|
||||
|
||||
if (initialSize <= 0) {
|
||||
initialSize = INITIAL_SIZE;
|
||||
}
|
||||
|
||||
array->items = wmalloc(sizeof(void *) * initialSize);
|
||||
|
||||
array->itemCount = 0;
|
||||
array->allocSize = initialSize;
|
||||
array->destructor = destructor;
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
WMArray *WMCreateArrayWithArray(WMArray * array)
|
||||
{
|
||||
WMArray *newArray;
|
||||
|
||||
newArray = wmalloc(sizeof(WMArray));
|
||||
|
||||
newArray->items = wmalloc(sizeof(void *) * array->allocSize);
|
||||
memcpy(newArray->items, array->items, sizeof(void *) * array->itemCount);
|
||||
|
||||
newArray->itemCount = array->itemCount;
|
||||
newArray->allocSize = array->allocSize;
|
||||
newArray->destructor = NULL;
|
||||
|
||||
return newArray;
|
||||
}
|
||||
|
||||
void WMEmptyArray(WMArray * array)
|
||||
{
|
||||
if (array->destructor) {
|
||||
while (array->itemCount > 0) {
|
||||
array->itemCount--;
|
||||
array->destructor(array->items[array->itemCount]);
|
||||
}
|
||||
}
|
||||
/*memset(array->items, 0, array->itemCount * sizeof(void*)); */
|
||||
array->itemCount = 0;
|
||||
}
|
||||
|
||||
void WMFreeArray(WMArray * array)
|
||||
{
|
||||
if (array == NULL)
|
||||
return;
|
||||
|
||||
WMEmptyArray(array);
|
||||
wfree(array->items);
|
||||
wfree(array);
|
||||
}
|
||||
|
||||
int WMGetArrayItemCount(WMArray * array)
|
||||
{
|
||||
if (array == NULL)
|
||||
return 0;
|
||||
|
||||
return array->itemCount;
|
||||
}
|
||||
|
||||
void WMAppendArray(WMArray * array, WMArray * other)
|
||||
{
|
||||
if (array == NULL || other == NULL)
|
||||
return;
|
||||
|
||||
if (other->itemCount == 0)
|
||||
return;
|
||||
|
||||
if (array->itemCount + other->itemCount > array->allocSize) {
|
||||
array->allocSize += other->allocSize;
|
||||
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||
}
|
||||
|
||||
memcpy(array->items + array->itemCount, other->items, sizeof(void *) * other->itemCount);
|
||||
array->itemCount += other->itemCount;
|
||||
}
|
||||
|
||||
void WMAddToArray(WMArray * array, void *item)
|
||||
{
|
||||
if (array == NULL)
|
||||
return;
|
||||
|
||||
if (array->itemCount >= array->allocSize) {
|
||||
array->allocSize += RESIZE_INCREMENT;
|
||||
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||
}
|
||||
array->items[array->itemCount] = item;
|
||||
|
||||
array->itemCount++;
|
||||
}
|
||||
|
||||
void WMInsertInArray(WMArray * array, int index, void *item)
|
||||
{
|
||||
if (array == NULL)
|
||||
return;
|
||||
|
||||
wassertr(index >= 0 && index <= array->itemCount);
|
||||
|
||||
if (array->itemCount >= array->allocSize) {
|
||||
array->allocSize += RESIZE_INCREMENT;
|
||||
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
|
||||
}
|
||||
if (index < array->itemCount) {
|
||||
memmove(array->items + index + 1, array->items + index,
|
||||
sizeof(void *) * (array->itemCount - index));
|
||||
}
|
||||
array->items[index] = item;
|
||||
|
||||
array->itemCount++;
|
||||
}
|
||||
|
||||
void *WMReplaceInArray(WMArray * array, int index, void *item)
|
||||
{
|
||||
void *old;
|
||||
|
||||
if (array == NULL)
|
||||
return NULL;
|
||||
|
||||
wassertrv(index >= 0 && index <= array->itemCount, NULL);
|
||||
|
||||
/* is it really useful to perform append if index == array->itemCount ? -Dan */
|
||||
if (index == array->itemCount) {
|
||||
WMAddToArray(array, item);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
old = array->items[index];
|
||||
array->items[index] = item;
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
int WMDeleteFromArray(WMArray * array, int index)
|
||||
{
|
||||
if (array == NULL)
|
||||
return 0;
|
||||
|
||||
wassertrv(index >= 0 && index < array->itemCount, 0);
|
||||
|
||||
if (array->destructor) {
|
||||
array->destructor(array->items[index]);
|
||||
}
|
||||
|
||||
if (index < array->itemCount - 1) {
|
||||
memmove(array->items + index, array->items + index + 1,
|
||||
sizeof(void *) * (array->itemCount - index - 1));
|
||||
}
|
||||
|
||||
array->itemCount--;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int WMRemoveFromArrayMatching(WMArray * array, WMMatchDataProc * match, void *cdata)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (array == NULL)
|
||||
return 1;
|
||||
|
||||
if (match != NULL) {
|
||||
for (i = 0; i < array->itemCount; i++) {
|
||||
if ((*match) (array->items[i], cdata)) {
|
||||
WMDeleteFromArray(array, i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < array->itemCount; i++) {
|
||||
if (array->items[i] == cdata) {
|
||||
WMDeleteFromArray(array, i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *WMGetFromArray(WMArray * array, int index)
|
||||
{
|
||||
if (index < 0 || array == NULL || index >= array->itemCount)
|
||||
return NULL;
|
||||
|
||||
return array->items[index];
|
||||
}
|
||||
|
||||
void *WMPopFromArray(WMArray * array)
|
||||
{
|
||||
if (array == NULL || array->itemCount <= 0)
|
||||
return NULL;
|
||||
|
||||
array->itemCount--;
|
||||
|
||||
return array->items[array->itemCount];
|
||||
}
|
||||
|
||||
int WMFindInArray(WMArray * array, WMMatchDataProc * match, void *cdata)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (array == NULL)
|
||||
return WANotFound;
|
||||
|
||||
if (match != NULL) {
|
||||
for (i = 0; i < array->itemCount; i++) {
|
||||
if ((*match) (array->items[i], cdata))
|
||||
return i;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < array->itemCount; i++) {
|
||||
if (array->items[i] == cdata)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return WANotFound;
|
||||
}
|
||||
|
||||
int WMCountInArray(WMArray * array, void *item)
|
||||
{
|
||||
int i, count;
|
||||
|
||||
if (array == NULL)
|
||||
return 0;
|
||||
|
||||
for (i = 0, count = 0; i < array->itemCount; i++) {
|
||||
if (array->items[i] == item)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void WMSortArray(WMArray * array, WMCompareDataProc * comparer)
|
||||
{
|
||||
if (array == NULL)
|
||||
return;
|
||||
|
||||
if (array->itemCount > 1) { /* Don't sort empty or single element arrays */
|
||||
qsort(array->items, array->itemCount, sizeof(void *), comparer);
|
||||
}
|
||||
}
|
||||
|
||||
void WMMapArray(WMArray * array, void (*function) (void *, void *), void *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (array == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < array->itemCount; i++) {
|
||||
(*function) (array->items[i], data);
|
||||
}
|
||||
}
|
||||
|
||||
WMArray *WMGetSubarrayWithRange(WMArray * array, WMRange aRange)
|
||||
{
|
||||
WMArray *newArray;
|
||||
|
||||
if (aRange.count <= 0 || array == NULL)
|
||||
return WMCreateArray(0);
|
||||
|
||||
if (aRange.position < 0)
|
||||
aRange.position = 0;
|
||||
if (aRange.position >= array->itemCount)
|
||||
aRange.position = array->itemCount - 1;
|
||||
if (aRange.position + aRange.count > array->itemCount)
|
||||
aRange.count = array->itemCount - aRange.position;
|
||||
|
||||
newArray = WMCreateArray(aRange.count);
|
||||
memcpy(newArray->items, array->items + aRange.position, sizeof(void *) * aRange.count);
|
||||
newArray->itemCount = aRange.count;
|
||||
|
||||
return newArray;
|
||||
}
|
||||
|
||||
void *WMArrayFirst(WMArray * array, WMArrayIterator * iter)
|
||||
{
|
||||
if (array == NULL || array->itemCount == 0) {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
} else {
|
||||
*iter = 0;
|
||||
return array->items[0];
|
||||
}
|
||||
}
|
||||
|
||||
void *WMArrayLast(WMArray * array, WMArrayIterator * iter)
|
||||
{
|
||||
if (array == NULL || array->itemCount == 0) {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
} else {
|
||||
*iter = array->itemCount - 1;
|
||||
return array->items[*iter];
|
||||
}
|
||||
}
|
||||
|
||||
void *WMArrayNext(WMArray * array, WMArrayIterator * iter)
|
||||
{
|
||||
if (array == NULL) {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*iter >= 0 && *iter < array->itemCount - 1) {
|
||||
return array->items[++(*iter)];
|
||||
} else {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void *WMArrayPrevious(WMArray * array, WMArrayIterator * iter)
|
||||
{
|
||||
if (array == NULL) {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*iter > 0 && *iter < array->itemCount) {
|
||||
return array->items[--(*iter)];
|
||||
} else {
|
||||
*iter = WANotFound;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
-289
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* WINGs WMData function library
|
||||
*
|
||||
* Copyright (c) 1999-2003 Dan Pascu
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "WUtil.h"
|
||||
|
||||
typedef struct W_Data {
|
||||
unsigned length; /* How many bytes we have */
|
||||
unsigned capacity; /* How many bytes it can hold */
|
||||
unsigned growth; /* How much to grow */
|
||||
void *bytes; /* Actual data */
|
||||
unsigned retainCount;
|
||||
WMFreeDataProc *destructor;
|
||||
int format; /* 0, 8, 16 or 32 */
|
||||
} W_Data;
|
||||
|
||||
/* Creating and destroying data objects */
|
||||
|
||||
WMData *WMCreateDataWithCapacity(unsigned capacity)
|
||||
{
|
||||
WMData *aData;
|
||||
|
||||
aData = (WMData *) wmalloc(sizeof(WMData));
|
||||
|
||||
if (capacity > 0)
|
||||
aData->bytes = wmalloc(capacity);
|
||||
else
|
||||
aData->bytes = NULL;
|
||||
|
||||
aData->capacity = capacity;
|
||||
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
|
||||
aData->length = 0;
|
||||
aData->retainCount = 1;
|
||||
aData->format = 0;
|
||||
aData->destructor = wfree;
|
||||
|
||||
return aData;
|
||||
}
|
||||
|
||||
WMData *WMCreateDataWithLength(unsigned length)
|
||||
{
|
||||
WMData *aData;
|
||||
|
||||
aData = WMCreateDataWithCapacity(length);
|
||||
if (length > 0) {
|
||||
aData->length = length;
|
||||
}
|
||||
|
||||
return aData;
|
||||
}
|
||||
|
||||
WMData *WMCreateDataWithBytes(const void *bytes, unsigned length)
|
||||
{
|
||||
WMData *aData;
|
||||
|
||||
aData = WMCreateDataWithCapacity(length);
|
||||
aData->length = length;
|
||||
memcpy(aData->bytes, bytes, length);
|
||||
|
||||
return aData;
|
||||
}
|
||||
|
||||
WMData *WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, WMFreeDataProc * destructor)
|
||||
{
|
||||
WMData *aData;
|
||||
|
||||
aData = (WMData *) wmalloc(sizeof(WMData));
|
||||
aData->length = length;
|
||||
aData->capacity = length;
|
||||
aData->growth = length / 2 > 0 ? length / 2 : 1;
|
||||
aData->bytes = bytes;
|
||||
aData->retainCount = 1;
|
||||
aData->format = 0;
|
||||
aData->destructor = destructor;
|
||||
|
||||
return aData;
|
||||
}
|
||||
|
||||
WMData *WMCreateDataWithData(WMData * aData)
|
||||
{
|
||||
WMData *newData;
|
||||
|
||||
if (aData->length > 0) {
|
||||
newData = WMCreateDataWithBytes(aData->bytes, aData->length);
|
||||
} else {
|
||||
newData = WMCreateDataWithCapacity(0);
|
||||
}
|
||||
newData->format = aData->format;
|
||||
|
||||
return newData;
|
||||
}
|
||||
|
||||
WMData *WMRetainData(WMData * aData)
|
||||
{
|
||||
aData->retainCount++;
|
||||
return aData;
|
||||
}
|
||||
|
||||
void WMReleaseData(WMData * aData)
|
||||
{
|
||||
aData->retainCount--;
|
||||
if (aData->retainCount > 0)
|
||||
return;
|
||||
if (aData->bytes != NULL && aData->destructor != NULL) {
|
||||
aData->destructor(aData->bytes);
|
||||
}
|
||||
wfree(aData);
|
||||
}
|
||||
|
||||
/* Adjusting capacity */
|
||||
|
||||
void WMSetDataCapacity(WMData * aData, unsigned capacity)
|
||||
{
|
||||
if (aData->capacity != capacity) {
|
||||
aData->bytes = wrealloc(aData->bytes, capacity);
|
||||
aData->capacity = capacity;
|
||||
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
|
||||
}
|
||||
if (aData->length > capacity) {
|
||||
aData->length = capacity;
|
||||
}
|
||||
}
|
||||
|
||||
void WMSetDataLength(WMData * aData, unsigned length)
|
||||
{
|
||||
if (length > aData->capacity) {
|
||||
WMSetDataCapacity(aData, length);
|
||||
}
|
||||
if (length > aData->length) {
|
||||
memset((unsigned char *)aData->bytes + aData->length, 0, length - aData->length);
|
||||
}
|
||||
aData->length = length;
|
||||
}
|
||||
|
||||
void WMSetDataFormat(WMData * aData, unsigned format)
|
||||
{
|
||||
aData->format = format;
|
||||
}
|
||||
|
||||
void WMIncreaseDataLengthBy(WMData * aData, unsigned extraLength)
|
||||
{
|
||||
WMSetDataLength(aData, aData->length + extraLength);
|
||||
}
|
||||
|
||||
/* Accessing data */
|
||||
|
||||
const void *WMDataBytes(WMData * aData)
|
||||
{
|
||||
return aData->bytes;
|
||||
}
|
||||
|
||||
void WMGetDataBytes(WMData * aData, void *buffer)
|
||||
{
|
||||
wassertr(aData->length > 0);
|
||||
|
||||
memcpy(buffer, aData->bytes, aData->length);
|
||||
}
|
||||
|
||||
unsigned WMGetDataFormat(WMData * aData)
|
||||
{
|
||||
return aData->format;
|
||||
}
|
||||
|
||||
void WMGetDataBytesWithLength(WMData * aData, void *buffer, unsigned length)
|
||||
{
|
||||
wassertr(aData->length > 0);
|
||||
wassertr(length <= aData->length);
|
||||
|
||||
memcpy(buffer, aData->bytes, length);
|
||||
}
|
||||
|
||||
void WMGetDataBytesWithRange(WMData * aData, void *buffer, WMRange aRange)
|
||||
{
|
||||
wassertr(aRange.position < aData->length);
|
||||
wassertr(aRange.count <= aData->length - aRange.position);
|
||||
|
||||
memcpy(buffer, (unsigned char *)aData->bytes + aRange.position, aRange.count);
|
||||
}
|
||||
|
||||
WMData *WMGetSubdataWithRange(WMData * aData, WMRange aRange)
|
||||
{
|
||||
void *buffer;
|
||||
WMData *newData;
|
||||
|
||||
if (aRange.count <= 0)
|
||||
return WMCreateDataWithCapacity(0);
|
||||
|
||||
buffer = wmalloc(aRange.count);
|
||||
WMGetDataBytesWithRange(aData, buffer, aRange);
|
||||
newData = WMCreateDataWithBytesNoCopy(buffer, aRange.count, wfree);
|
||||
newData->format = aData->format;
|
||||
|
||||
return newData;
|
||||
}
|
||||
|
||||
/* Testing data */
|
||||
|
||||
Bool WMIsDataEqualToData(WMData * aData, WMData * anotherData)
|
||||
{
|
||||
if (aData->length != anotherData->length)
|
||||
return False;
|
||||
else if (!aData->bytes && !anotherData->bytes) /* both are empty */
|
||||
return True;
|
||||
else if (!aData->bytes || !anotherData->bytes) /* one of them is empty */
|
||||
return False;
|
||||
return (memcmp(aData->bytes, anotherData->bytes, aData->length) == 0);
|
||||
}
|
||||
|
||||
unsigned WMGetDataLength(WMData * aData)
|
||||
{
|
||||
return aData->length;
|
||||
}
|
||||
|
||||
/* Adding data */
|
||||
void WMAppendDataBytes(WMData * aData, const void *bytes, unsigned length)
|
||||
{
|
||||
unsigned oldLength = aData->length;
|
||||
unsigned newLength = oldLength + length;
|
||||
|
||||
if (newLength > aData->capacity) {
|
||||
unsigned nextCapacity = aData->capacity + aData->growth;
|
||||
unsigned nextGrowth = aData->capacity ? aData->capacity : 1;
|
||||
|
||||
while (nextCapacity < newLength) {
|
||||
unsigned tmp = nextCapacity + nextGrowth;
|
||||
|
||||
nextGrowth = nextCapacity;
|
||||
nextCapacity = tmp;
|
||||
}
|
||||
WMSetDataCapacity(aData, nextCapacity);
|
||||
aData->growth = nextGrowth;
|
||||
}
|
||||
memcpy((unsigned char *)aData->bytes + oldLength, bytes, length);
|
||||
aData->length = newLength;
|
||||
}
|
||||
|
||||
void WMAppendData(WMData * aData, WMData * anotherData)
|
||||
{
|
||||
if (anotherData->length > 0)
|
||||
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
|
||||
}
|
||||
|
||||
/* Modifying data */
|
||||
|
||||
void WMReplaceDataBytesInRange(WMData * aData, WMRange aRange, const void *bytes)
|
||||
{
|
||||
wassertr(aRange.position < aData->length);
|
||||
wassertr(aRange.count <= aData->length - aRange.position);
|
||||
|
||||
memcpy((unsigned char *)aData->bytes + aRange.position, bytes, aRange.count);
|
||||
}
|
||||
|
||||
void WMResetDataBytesInRange(WMData * aData, WMRange aRange)
|
||||
{
|
||||
wassertr(aRange.position < aData->length);
|
||||
wassertr(aRange.count <= aData->length - aRange.position);
|
||||
|
||||
memset((unsigned char *)aData->bytes + aRange.position, 0, aRange.count);
|
||||
}
|
||||
|
||||
void WMSetData(WMData * aData, WMData * anotherData)
|
||||
{
|
||||
unsigned length = anotherData->length;
|
||||
|
||||
WMSetDataCapacity(aData, length);
|
||||
if (length > 0)
|
||||
memcpy(aData->bytes, anotherData->bytes, length);
|
||||
aData->length = length;
|
||||
}
|
||||
|
||||
/* Storing data */
|
||||
@@ -34,331 +34,6 @@
|
||||
#include <pwd.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
|
||||
const char *wgethomedir(void)
|
||||
{
|
||||
static char *home = NULL;
|
||||
char *tmp;
|
||||
struct passwd *user;
|
||||
|
||||
if (home)
|
||||
return home;
|
||||
|
||||
tmp = GETENV("HOME");
|
||||
if (tmp) {
|
||||
home = wstrdup(tmp);
|
||||
return home;
|
||||
}
|
||||
|
||||
user = getpwuid(getuid());
|
||||
if (!user) {
|
||||
werror(_("could not get password entry for UID %i"), getuid());
|
||||
home = "/";
|
||||
return home;
|
||||
}
|
||||
|
||||
if (!user->pw_dir)
|
||||
home = "/";
|
||||
else
|
||||
home = wstrdup(user->pw_dir);
|
||||
|
||||
return home;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the home directory for the specified used
|
||||
*
|
||||
* If user not found, returns NULL, otherwise always returns a path that is
|
||||
* statically stored.
|
||||
*
|
||||
* Please note you must use the path before any other call to 'getpw*' or it
|
||||
* may be erased. This is a design choice to avoid duplication considering
|
||||
* the use case for this function.
|
||||
*/
|
||||
static const char *getuserhomedir(const char *username)
|
||||
{
|
||||
static const char default_home[] = "/";
|
||||
struct passwd *user;
|
||||
|
||||
user = getpwnam(username);
|
||||
if (!user) {
|
||||
werror(_("could not get password entry for user %s"), username);
|
||||
return NULL;
|
||||
}
|
||||
if (!user->pw_dir)
|
||||
return default_home;
|
||||
else
|
||||
return user->pw_dir;
|
||||
|
||||
}
|
||||
|
||||
char *wexpandpath(const char *path)
|
||||
{
|
||||
const char *origpath = path;
|
||||
char buffer2[PATH_MAX + 2];
|
||||
char buffer[PATH_MAX + 2];
|
||||
int i;
|
||||
|
||||
memset(buffer, 0, PATH_MAX + 2);
|
||||
|
||||
if (*path == '~') {
|
||||
const char *home;
|
||||
|
||||
path++;
|
||||
if (*path == '/' || *path == 0) {
|
||||
home = wgethomedir();
|
||||
if (strlen(home) > PATH_MAX ||
|
||||
wstrlcpy(buffer, home, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
} else {
|
||||
int j;
|
||||
j = 0;
|
||||
while (*path != 0 && *path != '/') {
|
||||
if (j > PATH_MAX)
|
||||
goto error;
|
||||
buffer2[j++] = *path;
|
||||
buffer2[j] = 0;
|
||||
path++;
|
||||
}
|
||||
home = getuserhomedir(buffer2);
|
||||
if (!home || wstrlcat(buffer, home, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
i = strlen(buffer);
|
||||
|
||||
while (*path != 0 && i <= PATH_MAX) {
|
||||
char *tmp;
|
||||
|
||||
if (*path == '$') {
|
||||
int j;
|
||||
|
||||
path++;
|
||||
/* expand $(HOME) or $HOME style environment variables */
|
||||
if (*path == '(') {
|
||||
path++;
|
||||
j = 0;
|
||||
while (*path != 0 && *path != ')') {
|
||||
if (j > PATH_MAX)
|
||||
goto error;
|
||||
buffer2[j++] = *(path++);
|
||||
}
|
||||
buffer2[j] = 0;
|
||||
if (*path == ')') {
|
||||
path++;
|
||||
tmp = getenv(buffer2);
|
||||
} else {
|
||||
tmp = NULL;
|
||||
}
|
||||
if (!tmp) {
|
||||
if ((i += strlen(buffer2) + 2) > PATH_MAX)
|
||||
goto error;
|
||||
buffer[i] = 0;
|
||||
if (wstrlcat(buffer, "$(", sizeof(buffer)) >= sizeof(buffer) ||
|
||||
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
if (*(path-1)==')') {
|
||||
if (++i > PATH_MAX ||
|
||||
wstrlcat(buffer, ")", sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if ((i += strlen(tmp)) > PATH_MAX ||
|
||||
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
j = 0;
|
||||
while (*path != 0 && *path != '/') {
|
||||
if (j > PATH_MAX)
|
||||
goto error;
|
||||
buffer2[j++] = *(path++);
|
||||
}
|
||||
buffer2[j] = 0;
|
||||
tmp = getenv(buffer2);
|
||||
if (!tmp) {
|
||||
if ((i += strlen(buffer2) + 1) > PATH_MAX ||
|
||||
wstrlcat(buffer, "$", sizeof(buffer)) >= sizeof(buffer) ||
|
||||
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
} else {
|
||||
if ((i += strlen(tmp)) > PATH_MAX ||
|
||||
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer))
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
buffer[i++] = *path;
|
||||
path++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*path!=0)
|
||||
goto error;
|
||||
|
||||
return wstrdup(buffer);
|
||||
|
||||
error:
|
||||
errno = ENAMETOOLONG;
|
||||
werror(_("could not expand %s"), origpath);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return address of next char != tok or end of string whichever comes first */
|
||||
static const char *skipchar(const char *string, char tok)
|
||||
{
|
||||
while (*string != 0 && *string == tok)
|
||||
string++;
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
/* return address of next char == tok or end of string whichever comes first */
|
||||
static const char *nextchar(const char *string, char tok)
|
||||
{
|
||||
while (*string != 0 && *string != tok)
|
||||
string++;
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* findfile--
|
||||
* Finds a file in a : separated list of paths. ~ expansion is also
|
||||
* done.
|
||||
*
|
||||
* Returns:
|
||||
* The complete path for the file (in a newly allocated string) or
|
||||
* NULL if the file was not found.
|
||||
*
|
||||
* Side effects:
|
||||
* A new string is allocated. It must be freed later.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
char *wfindfile(const char *paths, const char *file)
|
||||
{
|
||||
char *path;
|
||||
const char *tmp, *tmp2;
|
||||
int len, flen;
|
||||
char *fullpath;
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
if (*file == '/' || *file == '~' || *file == '$' || !paths || *paths == 0) {
|
||||
if (access(file, F_OK) < 0) {
|
||||
fullpath = wexpandpath(file);
|
||||
if (!fullpath)
|
||||
return NULL;
|
||||
|
||||
if (access(fullpath, F_OK) < 0) {
|
||||
wfree(fullpath);
|
||||
return NULL;
|
||||
} else {
|
||||
return fullpath;
|
||||
}
|
||||
} else {
|
||||
return wstrdup(file);
|
||||
}
|
||||
}
|
||||
|
||||
flen = strlen(file);
|
||||
tmp = paths;
|
||||
while (*tmp) {
|
||||
tmp = skipchar(tmp, ':');
|
||||
if (*tmp == 0)
|
||||
break;
|
||||
tmp2 = nextchar(tmp, ':');
|
||||
len = tmp2 - tmp;
|
||||
path = wmalloc(len + flen + 2);
|
||||
path = memcpy(path, tmp, len);
|
||||
path[len] = 0;
|
||||
if (path[len - 1] != '/' &&
|
||||
wstrlcat(path, "/", len + flen + 2) >= len + flen + 2) {
|
||||
wfree(path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
|
||||
wfree(path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fullpath = wexpandpath(path);
|
||||
wfree(path);
|
||||
|
||||
if (fullpath) {
|
||||
if (access(fullpath, F_OK) == 0) {
|
||||
return fullpath;
|
||||
}
|
||||
wfree(fullpath);
|
||||
}
|
||||
tmp = tmp2;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *wfindfileinlist(char *const *path_list, const char *file)
|
||||
{
|
||||
int i;
|
||||
char *path;
|
||||
int len, flen;
|
||||
char *fullpath;
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
if (*file == '/' || *file == '~' || !path_list) {
|
||||
if (access(file, F_OK) < 0) {
|
||||
fullpath = wexpandpath(file);
|
||||
if (!fullpath)
|
||||
return NULL;
|
||||
|
||||
if (access(fullpath, F_OK) < 0) {
|
||||
wfree(fullpath);
|
||||
return NULL;
|
||||
} else {
|
||||
return fullpath;
|
||||
}
|
||||
} else {
|
||||
return wstrdup(file);
|
||||
}
|
||||
}
|
||||
|
||||
flen = strlen(file);
|
||||
for (i = 0; path_list[i] != NULL; i++) {
|
||||
len = strlen(path_list[i]);
|
||||
path = wmalloc(len + flen + 2);
|
||||
path = memcpy(path, path_list[i], len);
|
||||
path[len] = 0;
|
||||
if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 ||
|
||||
wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
|
||||
wfree(path);
|
||||
return NULL;
|
||||
}
|
||||
/* expand tilde */
|
||||
fullpath = wexpandpath(path);
|
||||
wfree(path);
|
||||
if (fullpath) {
|
||||
/* check if file exists */
|
||||
if (access(fullpath, F_OK) == 0) {
|
||||
return fullpath;
|
||||
}
|
||||
wfree(fullpath);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *wfindfileinarray(WMPropList *array, const char *file)
|
||||
{
|
||||
@@ -419,105 +94,3 @@ char *wfindfileinarray(WMPropList *array, const char *file)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wcopy_file(const char *dest_dir, const char *src_file, const char *dest_file)
|
||||
{
|
||||
char *path_dst;
|
||||
int fd_src, fd_dst;
|
||||
struct stat stat_src;
|
||||
mode_t permission_dst;
|
||||
const size_t buffer_size = 2 * 1024 * 1024; /* 4MB is a decent start choice to allow the OS to take advantage of modern disk's performance */
|
||||
char *buffer; /* The buffer is not created on the stack to avoid possible stack overflow as our buffer is big */
|
||||
|
||||
try_again_src:
|
||||
fd_src = open(src_file, O_RDONLY | O_NOFOLLOW);
|
||||
if (fd_src == -1) {
|
||||
if (errno == EINTR)
|
||||
goto try_again_src;
|
||||
werror(_("Could not open input file \"%s\": %s"), src_file, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Only accept to copy regular files */
|
||||
if (fstat(fd_src, &stat_src) != 0 || !S_ISREG(stat_src.st_mode)) {
|
||||
close(fd_src);
|
||||
return -1;
|
||||
}
|
||||
|
||||
path_dst = wstrconcat(dest_dir, dest_file);
|
||||
try_again_dst:
|
||||
fd_dst = open(path_dst, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
||||
if (fd_dst == -1) {
|
||||
if (errno == EINTR)
|
||||
goto try_again_dst;
|
||||
werror(_("Could not create target file \"%s\": %s"), path_dst, strerror(errno));
|
||||
wfree(path_dst);
|
||||
close(fd_src);
|
||||
return -1;
|
||||
}
|
||||
|
||||
buffer = malloc(buffer_size); /* Don't use wmalloc to avoid the memset(0) we don't need */
|
||||
if (buffer == NULL) {
|
||||
werror(_("could not allocate memory for the copy buffer"));
|
||||
close(fd_dst);
|
||||
goto cleanup_and_return_failure;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
ssize_t size_data;
|
||||
const char *write_ptr;
|
||||
size_t write_remain;
|
||||
|
||||
try_again_read:
|
||||
size_data = read(fd_src, buffer, buffer_size);
|
||||
if (size_data == 0)
|
||||
break; /* End of File have been reached */
|
||||
if (size_data < 0) {
|
||||
if (errno == EINTR)
|
||||
goto try_again_read;
|
||||
werror(_("could not read from file \"%s\": %s"), src_file, strerror(errno));
|
||||
close(fd_dst);
|
||||
goto cleanup_and_return_failure;
|
||||
}
|
||||
|
||||
write_ptr = buffer;
|
||||
write_remain = size_data;
|
||||
while (write_remain > 0) {
|
||||
ssize_t write_done;
|
||||
|
||||
try_again_write:
|
||||
write_done = write(fd_dst, write_ptr, write_remain);
|
||||
if (write_done < 0) {
|
||||
if (errno == EINTR)
|
||||
goto try_again_write;
|
||||
werror(_("could not write data to file \"%s\": %s"), path_dst, strerror(errno));
|
||||
close(fd_dst);
|
||||
goto cleanup_and_return_failure;
|
||||
}
|
||||
write_ptr += write_done;
|
||||
write_remain -= write_done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep only the permission-related part of the field: */
|
||||
permission_dst = stat_src.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
|
||||
if (fchmod(fd_dst, permission_dst) != 0)
|
||||
wwarning(_("could not set permission 0%03o on file \"%s\": %s"),
|
||||
permission_dst, path_dst, strerror(errno));
|
||||
|
||||
if (close(fd_dst) != 0) {
|
||||
werror(_("could not close the file \"%s\": %s"), path_dst, strerror(errno));
|
||||
cleanup_and_return_failure:
|
||||
free(buffer);
|
||||
close(fd_src);
|
||||
unlink(path_dst);
|
||||
wfree(path_dst);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
wfree(path_dst);
|
||||
close(fd_src);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+3
-3
@@ -279,7 +279,7 @@ Bool W_CheckIdleHandlers(void)
|
||||
return (idleHandler != NULL && WMGetArrayItemCount(idleHandler) > 0);
|
||||
}
|
||||
|
||||
handlerCopy = WMDuplicateArray(idleHandler);
|
||||
handlerCopy = WMCreateArrayWithArray(idleHandler);
|
||||
|
||||
WM_ITERATE_ARRAY(handlerCopy, handler, iter) {
|
||||
/* check if the handler still exist or was removed by a callback */
|
||||
@@ -429,7 +429,7 @@ Bool W_HandleInputEvents(Bool waitForInput, int inputfd)
|
||||
count = poll(fds, nfds + extrafd, timeout);
|
||||
|
||||
if (count > 0 && nfds > 0) {
|
||||
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
||||
WMArray *handlerCopy = WMCreateArrayWithArray(inputHandler);
|
||||
int mask;
|
||||
|
||||
/* use WM_ITERATE_ARRAY() here */
|
||||
@@ -527,7 +527,7 @@ Bool W_HandleInputEvents(Bool waitForInput, int inputfd)
|
||||
count = select(1 + maxfd, &rset, &wset, &eset, timeoutPtr);
|
||||
|
||||
if (count > 0 && nfds > 0) {
|
||||
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
|
||||
WMArray *handlerCopy = WMCreateArrayWithArray(inputHandler);
|
||||
int mask;
|
||||
|
||||
/* use WM_ITERATE_ARRAY() here */
|
||||
|
||||
-223
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* Window Maker miscelaneous function library
|
||||
*
|
||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "wconfig.h"
|
||||
#include "WUtil.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_STDNORETURN
|
||||
#include <stdnoreturn.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_BOEHM_GC
|
||||
#ifndef GC_DEBUG
|
||||
#define GC_DEBUG
|
||||
#endif /* !GC_DEBUG */
|
||||
#include <gc/gc.h>
|
||||
#endif /* USE_BOEHM_GC */
|
||||
|
||||
#ifndef False
|
||||
# define False 0
|
||||
#endif
|
||||
#ifndef True
|
||||
# define True 1
|
||||
#endif
|
||||
|
||||
static void defaultHandler(int bla)
|
||||
{
|
||||
if (bla)
|
||||
kill(getpid(), SIGABRT);
|
||||
else
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static waborthandler *aborthandler = defaultHandler;
|
||||
|
||||
static inline noreturn void wAbort(int bla)
|
||||
{
|
||||
(*aborthandler)(bla);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
waborthandler *wsetabort(waborthandler * handler)
|
||||
{
|
||||
waborthandler *old = aborthandler;
|
||||
|
||||
aborthandler = handler;
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
static int Aborting = 0; /* if we're in the middle of an emergency exit */
|
||||
|
||||
static WMHashTable *table = NULL;
|
||||
|
||||
void *wmalloc(size_t size)
|
||||
{
|
||||
void *tmp;
|
||||
|
||||
assert(size > 0);
|
||||
|
||||
#ifdef USE_BOEHM_GC
|
||||
tmp = GC_MALLOC(size);
|
||||
#else
|
||||
tmp = malloc(size);
|
||||
#endif
|
||||
if (tmp == NULL) {
|
||||
wwarning("malloc() failed. Retrying after 2s.");
|
||||
sleep(2);
|
||||
#ifdef USE_BOEHM_GC
|
||||
tmp = GC_MALLOC(size);
|
||||
#else
|
||||
tmp = malloc(size);
|
||||
#endif
|
||||
if (tmp == NULL) {
|
||||
if (Aborting) {
|
||||
fputs("Really Bad Error: recursive malloc() failure.", stderr);
|
||||
exit(-1);
|
||||
} else {
|
||||
wfatal("virtual memory exhausted");
|
||||
Aborting = 1;
|
||||
wAbort(False);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmp != NULL)
|
||||
memset(tmp, 0, size);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void *wrealloc(void *ptr, size_t newsize)
|
||||
{
|
||||
void *nptr;
|
||||
|
||||
if (!ptr) {
|
||||
nptr = wmalloc(newsize);
|
||||
} else if (newsize == 0) {
|
||||
wfree(ptr);
|
||||
nptr = NULL;
|
||||
} else {
|
||||
#ifdef USE_BOEHM_GC
|
||||
nptr = GC_REALLOC(ptr, newsize);
|
||||
#else
|
||||
nptr = realloc(ptr, newsize);
|
||||
#endif
|
||||
if (nptr == NULL) {
|
||||
wwarning("realloc() failed. Retrying after 2s.");
|
||||
sleep(2);
|
||||
#ifdef USE_BOEHM_GC
|
||||
nptr = GC_REALLOC(ptr, newsize);
|
||||
#else
|
||||
nptr = realloc(ptr, newsize);
|
||||
#endif
|
||||
if (nptr == NULL) {
|
||||
if (Aborting) {
|
||||
fputs("Really Bad Error: recursive realloc() failure.", stderr);
|
||||
exit(-1);
|
||||
} else {
|
||||
wfatal("virtual memory exhausted");
|
||||
Aborting = 1;
|
||||
wAbort(False);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nptr;
|
||||
}
|
||||
|
||||
void *wretain(void *ptr)
|
||||
{
|
||||
int *refcount;
|
||||
|
||||
if (!table) {
|
||||
table = WMCreateHashTable(WMIntHashCallbacks);
|
||||
}
|
||||
|
||||
refcount = WMHashGet(table, ptr);
|
||||
if (!refcount) {
|
||||
refcount = wmalloc(sizeof(int));
|
||||
*refcount = 1;
|
||||
WMHashInsert(table, ptr, refcount);
|
||||
#ifdef VERBOSE
|
||||
printf("== %i (%p)\n", *refcount, ptr);
|
||||
#endif
|
||||
} else {
|
||||
(*refcount)++;
|
||||
#ifdef VERBOSE
|
||||
printf("+ %i (%p)\n", *refcount, ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void wfree(void *ptr)
|
||||
{
|
||||
if (ptr)
|
||||
#ifdef USE_BOEHM_GC
|
||||
/* This should eventually be removed, once the criss-cross
|
||||
* of wmalloc()d memory being free()d, malloc()d memory being
|
||||
* wfree()d, various misuses of calling wfree() on objects
|
||||
* allocated by libc malloc() and calling libc free() on
|
||||
* objects allocated by Boehm GC (think external libraries)
|
||||
* is cleaned up.
|
||||
*/
|
||||
if (GC_base(ptr) != 0)
|
||||
GC_FREE(ptr);
|
||||
else
|
||||
free(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
ptr = NULL;
|
||||
}
|
||||
|
||||
void wrelease(void *ptr)
|
||||
{
|
||||
int *refcount;
|
||||
|
||||
refcount = WMHashGet(table, ptr);
|
||||
if (!refcount) {
|
||||
wwarning("trying to release unexisting data %p", ptr);
|
||||
} else {
|
||||
(*refcount)--;
|
||||
if (*refcount < 1) {
|
||||
#ifdef VERBOSE
|
||||
printf("RELEASING %p\n", ptr);
|
||||
#endif
|
||||
WMHashRemove(table, ptr);
|
||||
wfree(refcount);
|
||||
wfree(ptr);
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
else {
|
||||
printf("- %i (%p)\n", *refcount, ptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -536,12 +536,14 @@ found_end_define_fname:
|
||||
while (*src != '\0') {
|
||||
idx = 0;
|
||||
if (*src == '~') {
|
||||
const char *home = wgethomedir();
|
||||
char *home_head = wgethomedir();
|
||||
char *home = home_head;;
|
||||
while (*home != '\0') {
|
||||
if (idx < sizeof(buffer) - 2)
|
||||
buffer[idx++] = *home;
|
||||
home++;
|
||||
}
|
||||
wfree(home_head);
|
||||
src++;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-02-09 12:10+0200\n"
|
||||
"Last-Translator: Anton Zinoviev <zinoviev@debian.org>\n"
|
||||
"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
|
||||
"Language: bg\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -14,6 +14,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-09-16 23:16+0200\n"
|
||||
"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
|
||||
"Language-Team: Catalan <ca@dodds.net>\n"
|
||||
"Language: ca\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-10-11 22:00+0100\n"
|
||||
"Last-Translator: Jiří Hnídek <jiri.hnidek@vslib.cz>\n"
|
||||
"Language-Team: Czech <cz@li.org>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
|
||||
@@ -15,6 +15,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2004-11-05 23:48+0100\n"
|
||||
"Last-Translator: shlomme@gmx.net\n"
|
||||
"Language-Team: German\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -10,6 +10,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-01-09 21:20+0100\n"
|
||||
"Last-Translator: Emmanuel Benoit <tseeker@neptune.fr>\n"
|
||||
"Language-Team: Français <fr@li.org>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2014-02-18 00:25+0100\n"
|
||||
"Last-Translator: BALATON Zoltán <balaton@eik.bme.hu>\n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"Language: \n"
|
||||
"Language: hu\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -843,9 +843,6 @@ msgstr "Kon invoerbestand \"%s\" niet openen"
|
||||
msgid "Could not create target file \"%s\""
|
||||
msgstr "Kon doelbestand \"%s\" niet aanmaken"
|
||||
|
||||
msgid "An error occured browsing '%s'."
|
||||
msgstr "Er trad 'n fout op bij bladeren door '%s'."
|
||||
|
||||
msgid ""
|
||||
"invalid characted '%c' in arg-list for macro \"%s\" while expecting "
|
||||
"parameter name"
|
||||
@@ -860,9 +857,6 @@ msgstr ""
|
||||
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte ',' "
|
||||
"of ')'"
|
||||
|
||||
msgid "unknow directive '#%s'"
|
||||
msgstr "onbekende aanwijzing '#%s'"
|
||||
|
||||
msgid "found #%s but have no matching #if"
|
||||
msgstr "#%s gevonden, maar heeft geen bijbehorende #if"
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-12-20 04:00+0100\n"
|
||||
"Last-Translator: Jan \"judas\" Tomka <judas@linux.sk>\n"
|
||||
"Language-Team: Slovak <sk@li.org>\n"
|
||||
"Language: sk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -942,20 +942,6 @@ WMPropList *WMCreatePLDataWithBytes(const unsigned char *bytes, unsigned int len
|
||||
return plist;
|
||||
}
|
||||
|
||||
WMPropList *WMCreatePLDataWithBytesNoCopy(unsigned char *bytes, unsigned int length, WMFreeDataProc * destructor)
|
||||
{
|
||||
WMPropList *plist;
|
||||
|
||||
wassertrv(bytes != NULL, NULL);
|
||||
|
||||
plist = (WMPropList *) wmalloc(sizeof(W_PropList));
|
||||
plist->type = WPLData;
|
||||
plist->d.data = WMCreateDataWithBytesNoCopy(bytes, length, destructor);
|
||||
plist->retainCount = 1;
|
||||
|
||||
return plist;
|
||||
}
|
||||
|
||||
WMPropList *WMCreatePLArray(WMPropList * elem, ...)
|
||||
{
|
||||
WMPropList *plist, *nelem;
|
||||
|
||||
+4
-3
@@ -237,7 +237,7 @@ static void handleRequestEvent(XEvent * event)
|
||||
}
|
||||
|
||||
/* delete handlers */
|
||||
copy = WMDuplicateArray(selHandlers);
|
||||
copy = WMCreateArrayWithArray(selHandlers);
|
||||
WM_ITERATE_ARRAY(copy, handler, iter) {
|
||||
if (handler && handler->flags.delete_pending) {
|
||||
WMDeleteSelectionHandler(handler->view, handler->selection, handler->timestamp);
|
||||
@@ -261,8 +261,9 @@ static WMData *getSelectionData(Display * dpy, Window win, Atom where)
|
||||
|
||||
bpi = bits / 8;
|
||||
|
||||
wdata = WMCreateDataWithBytesNoCopy(data, len * bpi, (void *) XFree);
|
||||
wdata = WMCreateDataWithBytes(data, len * bpi);
|
||||
WMSetDataFormat(wdata, bits);
|
||||
XFree(data);
|
||||
|
||||
return wdata;
|
||||
}
|
||||
@@ -300,7 +301,7 @@ static void handleNotifyEvent(XEvent * event)
|
||||
}
|
||||
|
||||
/* delete callbacks */
|
||||
copy = WMDuplicateArray(selCallbacks);
|
||||
copy = WMCreateArrayWithArray(selCallbacks);
|
||||
WM_ITERATE_ARRAY(copy, handler, iter) {
|
||||
if (handler && handler->flags.delete_pending) {
|
||||
WMDeleteSelectionCallback(handler->view, handler->selection, handler->timestamp);
|
||||
|
||||
@@ -51,7 +51,7 @@ const char *wusergnusteppath(void)
|
||||
static const char subdir[] = "/" GSUSER_SUBDIR;
|
||||
static char *path = NULL;
|
||||
char *gspath;
|
||||
const char *h;
|
||||
char *h;
|
||||
int pathlen;
|
||||
|
||||
if (path)
|
||||
@@ -69,13 +69,12 @@ const char *wusergnusteppath(void)
|
||||
}
|
||||
|
||||
h = wgethomedir();
|
||||
if (!h)
|
||||
return NULL;
|
||||
|
||||
pathlen = strlen(h);
|
||||
path = wmalloc(pathlen + sizeof(subdir));
|
||||
strcpy(path, h);
|
||||
strcpy(path + pathlen, subdir);
|
||||
wfree(h);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
+6
-3
@@ -2994,10 +2994,13 @@ static void customPaletteMenuNewFromFile(W_ColorPanel * panel)
|
||||
int i;
|
||||
RImage *tmpImg = NULL;
|
||||
|
||||
if ((!panel->lastBrowseDir) || (strcmp(panel->lastBrowseDir, "\0") == 0))
|
||||
spath = wexpandpath(wgethomedir());
|
||||
else
|
||||
if ((!panel->lastBrowseDir) || (strcmp(panel->lastBrowseDir, "\0") == 0)) {
|
||||
char *homedir = wgethomedir();
|
||||
spath = wexpandpath(homedir);
|
||||
wfree(homedir);
|
||||
} else {
|
||||
spath = wexpandpath(panel->lastBrowseDir);
|
||||
}
|
||||
|
||||
browseP = WMGetOpenPanel(scr);
|
||||
WMSetFilePanelCanChooseDirectories(browseP, 0);
|
||||
|
||||
+2
-4
@@ -761,17 +761,15 @@ static void goFloppy(WMWidget *widget, void *p_panel)
|
||||
static void goHome(WMWidget *widget, void *p_panel)
|
||||
{
|
||||
WMFilePanel *panel = p_panel;
|
||||
const char *home;
|
||||
char *home;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) widget;
|
||||
|
||||
/* home is statically allocated. Don't free it! */
|
||||
home = wgethomedir();
|
||||
if (!home)
|
||||
return;
|
||||
|
||||
WMSetFilePanelDirectory(panel, home);
|
||||
wfree(home);
|
||||
}
|
||||
|
||||
static void handleEvents(XEvent * event, void *data)
|
||||
|
||||
+9
-3
@@ -51,12 +51,15 @@ static char *xlfdToFcName(const char *xlfd)
|
||||
{
|
||||
FcPattern *pattern;
|
||||
char *fname;
|
||||
char *result;
|
||||
|
||||
pattern = xlfdToFcPattern(xlfd);
|
||||
fname = (char *)FcNameUnparse(pattern);
|
||||
result = wstrdup(fname);
|
||||
free(fname);
|
||||
FcPatternDestroy(pattern);
|
||||
|
||||
return fname;
|
||||
return result;
|
||||
}
|
||||
|
||||
static Bool hasProperty(FcPattern * pattern, const char *property)
|
||||
@@ -92,6 +95,7 @@ static Bool hasPropertyWithStringValue(FcPattern * pattern, const char *object,
|
||||
static char *makeFontOfSize(const char *font, int size, const char *fallback)
|
||||
{
|
||||
FcPattern *pattern;
|
||||
char *name;
|
||||
char *result;
|
||||
|
||||
if (font[0] == '-') {
|
||||
@@ -115,7 +119,9 @@ static char *makeFontOfSize(const char *font, int size, const char *fallback)
|
||||
|
||||
/*FcPatternPrint(pattern); */
|
||||
|
||||
result = (char *)FcNameUnparse(pattern);
|
||||
name = (char *)FcNameUnparse(pattern);
|
||||
result = wstrdup(name);
|
||||
free(name);
|
||||
FcPatternDestroy(pattern);
|
||||
|
||||
return result;
|
||||
@@ -421,7 +427,7 @@ WMFont *WMCopyFontWithStyle(WMScreen * scrPtr, WMFont * font, WMFontStyle style)
|
||||
name = (char *)FcNameUnparse(pattern);
|
||||
copy = WMCreateFont(scrPtr, name);
|
||||
FcPatternDestroy(pattern);
|
||||
wfree(name);
|
||||
free(name);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -1110,7 +1110,7 @@ static void deleteTexture(WMWidget * w, void *data)
|
||||
static void extractTexture(WMWidget * w, void *data)
|
||||
{
|
||||
_Panel *panel = (_Panel *) data;
|
||||
char *path;
|
||||
char *path, *homedir;
|
||||
WMOpenPanel *opanel;
|
||||
WMScreen *scr = WMWidgetScreen(w);
|
||||
|
||||
@@ -1118,13 +1118,17 @@ static void extractTexture(WMWidget * w, void *data)
|
||||
WMSetFilePanelCanChooseDirectories(opanel, False);
|
||||
WMSetFilePanelCanChooseFiles(opanel, True);
|
||||
|
||||
if (WMRunModalFilePanelForDirectory(opanel, panel->parent, wgethomedir(), _("Select File"), NULL)) {
|
||||
homedir = wgethomedir();
|
||||
if (WMRunModalFilePanelForDirectory(opanel, panel->parent, homedir, _("Select File"), NULL)) {
|
||||
path = WMGetFilePanelFileName(opanel);
|
||||
|
||||
OpenExtractPanelFor(panel);
|
||||
|
||||
wfree(path);
|
||||
}
|
||||
if (homedir) {
|
||||
wfree(homedir);
|
||||
}
|
||||
}
|
||||
|
||||
static void changePage(WMWidget * w, void *data)
|
||||
|
||||
@@ -288,6 +288,7 @@ static char *getSelectedFont(_Panel * panel, FcChar8 * curfont)
|
||||
WMListItem *item;
|
||||
FcPattern *pat;
|
||||
char *name;
|
||||
char *result;
|
||||
|
||||
if (curfont)
|
||||
pat = FcNameParse(curfont);
|
||||
@@ -321,9 +322,12 @@ static char *getSelectedFont(_Panel * panel, FcChar8 * curfont)
|
||||
}
|
||||
|
||||
name = (char *)FcNameUnparse(pat);
|
||||
result = wstrdup(name);
|
||||
free(name);
|
||||
FcPatternDestroy(pat);
|
||||
|
||||
return name;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void updateSampleFont(_Panel * panel)
|
||||
|
||||
@@ -66,6 +66,7 @@ AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdat
|
||||
WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||
|
||||
WPrefs_LDADD = \
|
||||
$(top_builddir)/wutil-rs/target/debug/libwutil_rs.a\
|
||||
$(top_builddir)/WINGs/libWINGs.la\
|
||||
$(top_builddir)/WINGs/libWUtil.la\
|
||||
$(top_builddir)/wrlib/libwraster.la \
|
||||
|
||||
@@ -627,7 +627,7 @@ static void browseImageCallback(WMWidget *w, void *data)
|
||||
WMSetFilePanelCanChooseFiles(opanel, True);
|
||||
|
||||
if (!ipath)
|
||||
ipath = wstrdup(wgethomedir());
|
||||
ipath = wgethomedir();
|
||||
|
||||
if (WMRunModalFilePanelForDirectory(opanel, panel->win, ipath, _("Open Image"), NULL)) {
|
||||
char *path, *fullpath;
|
||||
|
||||
@@ -87,8 +87,6 @@ int main(int argc, char **argv)
|
||||
int i;
|
||||
char *display_name = "";
|
||||
|
||||
wsetabort(wAbort);
|
||||
|
||||
memset(DeadHandlers, 0, sizeof(DeadHandlers));
|
||||
|
||||
WMInitializeApplication("WPrefs", &argc, argv);
|
||||
|
||||
@@ -5,7 +5,8 @@ CATALOGS = @WPREFSMOFILES@
|
||||
CLEANFILES = $(DOMAIN).pot $(CATALOGS)
|
||||
|
||||
EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po fy.po hr.po hu.po \
|
||||
it.po ja.po ko.po nl.po pt.po ru.po sk.po tr.po uk.po zh_CN.po zh_TW.po
|
||||
it.po ja.po ko.po nl.po pt.po ru.po sk.po sr.po tr.po uk.po zh_CN.po \
|
||||
zh_TW.po
|
||||
|
||||
POTFILES = \
|
||||
$(top_srcdir)/WPrefs.app/Appearance.c \
|
||||
|
||||
@@ -8,6 +8,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-04-18 23:22+03:00\n"
|
||||
"Last-Translator: Anton Zinoviev <zinoviev@debian.org>\n"
|
||||
"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
|
||||
"Language: bg\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -14,6 +14,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-09-16 23:15+0200\n"
|
||||
"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
|
||||
"Language-Team: Catalan <ca@dodds.net>\n"
|
||||
"Language: ca\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -16,6 +16,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-10-14 21:07+0000\n"
|
||||
"Last-Translator: Jiří Hnídek <jiri.hnidek@vslib.cz>\n"
|
||||
"Language-Team: czech <cs@li.org>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
|
||||
@@ -18,6 +18,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2010-02-02 10:49+0100\n"
|
||||
"Last-Translator: Carlos R. Mafra <crmafra@gmail.com>\n"
|
||||
"Language-Team: German <>\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -8,6 +8,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-09-19 03:05-0400\n"
|
||||
"Last-Translator: Alberto Giménez <algibe@teleline.es>\n"
|
||||
"Language-Team: Spanish \n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-09-05 09:40+0200\n"
|
||||
"Last-Translator: Ivar Smolin <okul@linux.ee>\n"
|
||||
"Language-Team: Estonian <linux-ee@eenet.ee>\n"
|
||||
"Language: et\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -475,7 +476,7 @@ msgstr "Window Maker vőttis vastu signaali %i."
|
||||
|
||||
#: ../src/dialog.c:1707
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to bugs@windowmaker.info."
|
||||
msgstr ""
|
||||
" See fataalviga on arvatavasti pőhjustatud programmi veast. Palun täitke "
|
||||
@@ -1437,7 +1438,7 @@ msgstr "ei őnnestu käivitada alternatiivset aknahaldurit. Annan alla."
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"aset on leidnud fataalne viga, arvatavasti programmi viga. Palun täida "
|
||||
|
||||
@@ -11,6 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-09-03 22:18+03:00\n"
|
||||
"Last-Translator: Tomi Kajala <tomi@iki.fi>\n"
|
||||
"Language-Team: Finnish <fi@li.org>\n"
|
||||
"Language: fi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1999-07-28 16:31-0100\n"
|
||||
"Last-Translator: Antoine Hulin <antoine.hulin@origan.fdn.org>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1998-08-24 14:36:41-0300\n"
|
||||
"Last-Translator: Toni Bilić tbilic@oliver.efos.hr \n"
|
||||
"Language-Team: Croatian \n"
|
||||
"Language: hr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2014-02-18 00:33+0100\n"
|
||||
"Last-Translator: BALATON Zoltán <balaton@eik.bme.hu>\n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"Language: \n"
|
||||
"Language: hu\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -11,6 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-05-21\n"
|
||||
"Last-Translator: Michele Campeotto <micampe@f2s.com\n"
|
||||
"Language-Team: Italian\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2013-08-13 19:26+0900\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Korean\n"
|
||||
"Language: ko\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2000-01-04 18:25-0300\n"
|
||||
"Last-Translator: Eliphas Levy Theodoro <eliphas@conectiva.com.br>\n"
|
||||
"Language-Team: Portuguese \n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-09-12 17:45+0300\n"
|
||||
"Last-Translator: awn@bcs.zp.ua\n"
|
||||
"Language-Team: Russian\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -18,6 +18,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-10-15 20:40+0100\n"
|
||||
"Last-Translator: Jan \"judas\" Tomka <judas@linux.sk>\n"
|
||||
"Language-Team: Slovak <sk@li.org>\n"
|
||||
"Language: sk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -5,6 +5,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2004-09-06 21:42+4000\n"
|
||||
"Last-Translator: Victor Forsyuk <victor@ksi-linux.com>\n"
|
||||
"Language-Team: KSI Linux Ukrainian <uk@ksi-linux.com>\n"
|
||||
"Language: uk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1999-07-05 23:20+0800\n"
|
||||
"Last-Translator: Wang Jian <larkw@263.net>\n"
|
||||
"Language-Team: chinese <zh@li.org>\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -10,6 +10,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2005-01-11 17:46+0800\n"
|
||||
"Last-Translator: Li Wei Jih <lwj83@cs.ccu.edu.tw>\n"
|
||||
"Language-Team: chinese <zh@li.org>\n"
|
||||
"Language: zh_TW\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
+9
-19
@@ -1,26 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
srcdir=$(dirname $0)
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
# Generate the documentation about compiling Window Maker
|
||||
./script/generate-txt-from-texi.sh "doc/build/Compilation.texi" -o "INSTALL-WMAKER"
|
||||
./script/generate-txt-from-texi.sh "doc/build/Translations.texi" -o "README.i18n"
|
||||
$srcdir/script/generate-txt-from-texi.sh "$srcdir/doc/build/Compilation.texi" \
|
||||
-o "$srcdir/INSTALL-WMAKER"
|
||||
$srcdir/script/generate-txt-from-texi.sh "$srcdir/doc/build/Translations.texi" \
|
||||
-o "$srcdir/README.i18n"
|
||||
|
||||
# Change date of the files to the past so they will be regenerated by 'make'
|
||||
touch -d '2000-01-01' INSTALL-WMAKER README.i18n
|
||||
touch -d '2000-01-01' $srcdir/INSTALL-WMAKER $srcdir/README.i18n
|
||||
|
||||
# Generate the configure script from the 'configure.ac'
|
||||
autoreconf -vfi -I m4
|
||||
|
||||
exit 0
|
||||
|
||||
if [ -x config.status -a -z "$*" ]; then
|
||||
./config.status --recheck
|
||||
else
|
||||
if test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
echo "If you do not wish to run ./configure, press Ctrl-C now."
|
||||
trap 'echo "configure aborted" ; exit 0' 1 2 15
|
||||
sleep 1
|
||||
fi
|
||||
./configure "$@"
|
||||
fi
|
||||
autoreconf -vfi -I m4 $srcdir
|
||||
|
||||
+17
-19
@@ -49,6 +49,17 @@ AC_CONFIG_SRCDIR([src/WindowMaker.h])
|
||||
dnl Include at the end of 'config.h', this file is generated by top-level Makefile
|
||||
AH_BOTTOM([@%:@include "config-paths.h"])
|
||||
|
||||
dnl Rust support
|
||||
AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
|
||||
AS_IF(test x$CARGO = xno,
|
||||
AC_MSG_ERROR([cargo is required. Please set the CARGO environment variable or install the Rust toolchain from https://www.rust-lang.org/])
|
||||
)
|
||||
AC_SUBST(CARGO, [cargo])
|
||||
AC_CHECK_PROG(RUSTC, [rustc], [yes], [no])
|
||||
AS_IF(test x$RUSTC = xno,
|
||||
AC_MSG_ERROR([rustc is required. Please set the RUSTC environment variable or install the Rust toolchain from https://www.rust-lang.org/])
|
||||
)
|
||||
AC_SUBST(RUSTC, [rustc])
|
||||
|
||||
dnl libtool library versioning
|
||||
dnl ==========================
|
||||
@@ -97,7 +108,6 @@ dnl ===================
|
||||
AC_PROG_CC
|
||||
WM_PROG_CC_C11
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
LT_INIT
|
||||
|
||||
|
||||
@@ -343,24 +353,6 @@ AS_IF([test "x$enable_mwm_hints" = "xno"],
|
||||
AM_CONDITIONAL([USE_MWM_HINTS], [test "x$enable_mwm_hints" != "xno"])
|
||||
|
||||
|
||||
dnl Boehm GC
|
||||
dnl ========
|
||||
m4_divert_push([INIT_PREPARE])dnl
|
||||
AC_ARG_ENABLE([boehm-gc],
|
||||
[AS_HELP_STRING([--enable-boehm-gc], [use Boehm GC instead of the default libc malloc() [default=no]])],
|
||||
[AS_CASE(["$enableval"],
|
||||
[yes], [with_boehm_gc=yes],
|
||||
[no], [with_boehm_gc=no],
|
||||
[AC_MSG_ERROR([bad value $enableval for --enable-boehm-gc])] )],
|
||||
[with_boehm_gc=no])
|
||||
m4_divert_pop([INIT_PREPARE])dnl
|
||||
|
||||
AS_IF([test "x$with_boehm_gc" = "xyes"],
|
||||
AC_SEARCH_LIBS([GC_malloc], [gc],
|
||||
[AC_DEFINE(USE_BOEHM_GC, 1, [Define if Boehm GC is to be used])],
|
||||
[AC_MSG_FAILURE([--enable-boehm-gc specified but test for libgc failed])]))
|
||||
|
||||
|
||||
dnl LCOV
|
||||
dnl ====
|
||||
m4_divert_push([INIT_PREPARE])dnl
|
||||
@@ -965,11 +957,17 @@ AC_CONFIG_FILES(
|
||||
wrlib/Makefile wrlib/po/Makefile
|
||||
wrlib/tests/Makefile
|
||||
|
||||
dnl Rust implementation of WINGs libraries
|
||||
wutil-rs/Makefile
|
||||
|
||||
dnl WINGs toolkit
|
||||
WINGs/Makefile WINGs/WINGs/Makefile WINGs/po/Makefile
|
||||
WINGs/Documentation/Makefile WINGs/Resources/Makefile WINGs/Extras/Makefile
|
||||
WINGs/Examples/Makefile WINGs/Tests/Makefile
|
||||
|
||||
dnl Rust implementation of Window Maker core
|
||||
wmaker-rs/Makefile
|
||||
|
||||
dnl Window Maker's core
|
||||
src/Makefile src/wconfig.h po/Makefile
|
||||
doc/Makefile doc/build/Makefile
|
||||
|
||||
Vendored
-10
@@ -253,14 +253,6 @@ If found, then the library @emph{WRaster} can use the @emph{ImageMagick} library
|
||||
@sc{Window Maker} support more image formats, like @emph{SVG}, @emph{BMP}, @emph{TGA}, ...
|
||||
You can get it from @uref{http://www.imagemagick.org/}
|
||||
|
||||
@item @emph{Boehm GC}
|
||||
|
||||
This library can be used by the @emph{WINGs} utility toolkit to use a
|
||||
@cite{Boehm-Demers-Weiser Garbage Collector} instead of the traditional
|
||||
@command{malloc}/@command{free} functions from the @emph{libc}.
|
||||
You have to explicitly ask for its support though (@pxref{Configure Options}).
|
||||
You can get it from @uref{http://www.hboehm.info/gc/}
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@@ -468,8 +460,6 @@ You can find more information about the libraries in the
|
||||
@ref{Optional Dependencies}.
|
||||
|
||||
@table @option
|
||||
@item --enable-boehm-gc
|
||||
Never enabled by default, use Boehm GC instead of the default @emph{libc} @command{malloc()}
|
||||
|
||||
@item --disable-gif
|
||||
Disable GIF support in @emph{WRaster} library; when enabled use @file{libgif} or @file{libungif}.
|
||||
|
||||
@@ -10,6 +10,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-10-17 19:02+0300\n"
|
||||
"Last-Translator: Ihar Viarheichyk <iverg@mail.ru>\n"
|
||||
"Language-Team: Belarusian <be@li.org>\n"
|
||||
"Language: be\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -472,7 +473,7 @@ msgstr "Window Maker атрымаў сігнал %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Гэты крытычны збой магчыма вызваны памылкамі ў WindowMaker."
|
||||
@@ -1433,7 +1434,7 @@ msgstr "не магчыма запусціць іншы ваконны мене
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
" Гэты крытычны збой магчыма вызваны памылкамі ў WindowMaker."
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-02-09 14:21+0200\n"
|
||||
"Last-Translator: Anton Zinoviev <zinoviev@debian.org>\n"
|
||||
"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
|
||||
"Language: bg\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -602,7 +603,7 @@ msgstr "Уиндоу Мейкър получи сигнал %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr "Възникналата критична грешка вероятно се дължи на програмен дефект. Моля попълнете формуляра от файла BUGFORM и го изпратете на адрес %s."
|
||||
|
||||
@@ -1793,7 +1794,7 @@ msgstr ""
|
||||
# ../src/startup.c:352
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr "възникна критична грешка, вероятно дължаща се на програмен дефект. Моля попълнете формуляра от файла BUGFORM и ни уведомете "
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2004-08-30 00:23+0200\n"
|
||||
"Last-Translator: Ahmet Mulalić <am@lugzdk.ba>\n"
|
||||
"Language-Team: Bosanski <lugzdk@lugzdk.ba>\n"
|
||||
"Language: bs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -14,6 +14,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-09-16 23:13+0200\n"
|
||||
"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
|
||||
"Language-Team: Catalan <ca@dodds.net>\n"
|
||||
"Language: ca\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -494,7 +495,7 @@ msgstr "Window Maker ha rebut un senyal %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Aquest error fatal probablement ha estat causat per un \"bug\". Si us plau, "
|
||||
@@ -1471,7 +1472,7 @@ msgstr "no s'ha pogut iniciar cap gestor de finestres alternatiu. S'avorta."
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"s'ha produït un error fatal, probablement a causa d'un \"bug\". Si us plau, "
|
||||
|
||||
@@ -15,6 +15,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-10-14 20:29+53:00\n"
|
||||
"Last-Translator: Jiří Hnídek <jiri.hnidek@vslib.cz>\n"
|
||||
"Language-Team: czech <cs@li.org>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: unknown\n"
|
||||
@@ -477,7 +478,7 @@ msgstr "Window Maker přijal signál %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Tato závažná chyba se vyskytla pravděpodobně v důsledku chyby v kódu Window "
|
||||
@@ -1392,7 +1393,7 @@ msgstr "alternativního správce oken nelze odstartovat. Konec."
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"fatální chyba, pravděpodobně chyba ve Window Makeru. Prosím vyplňte soubor "
|
||||
|
||||
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-02-20 20:56+0100\n"
|
||||
"Last-Translator: Birger Langkjer <birger.langkjer@image.dk>\n"
|
||||
"Language-Team: Danish <sslug-locale@sslug.dk>\n"
|
||||
"Language: da\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -544,7 +545,7 @@ msgstr "Window Maker modtog signal %i"
|
||||
# ../src/dialog.c:1450
|
||||
#: ../src/dialog.c:1790
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"en fatal fejl er opstået, sikkert pga. en bug. Udfyld venligst den vedlagte "
|
||||
@@ -1685,7 +1686,7 @@ msgstr "det lykkedes ikke at starte alternativ vindueshåndtering. Afbryder."
|
||||
# ../src/startup.c:349
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"en fatal fejl er opstået, sikkert pga. en bug. Udfyld venligst den vedlagte "
|
||||
|
||||
@@ -16,6 +16,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2004-11-08 22:58+0100\n"
|
||||
"Last-Translator: shlomme@gmx.net\n"
|
||||
"Language-Team: German\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -471,7 +472,7 @@ msgstr "Window Maker erhielt Signal %i"
|
||||
|
||||
#: ../src/dialog.c:1602
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Dieser fatale Fehler trat möglicherweise wegen eines Bugs auf. Bitte füllen "
|
||||
|
||||
@@ -10,6 +10,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1999-09-04 01:39+0300\n"
|
||||
"Last-Translator: Nikolaos Papagrigoriou <papanikos@freemail.gr>\n"
|
||||
"Language-Team: Greek\n"
|
||||
"Language: el\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -1173,7 +1174,7 @@ msgstr "αποτυχία εκκίνησης εναλλακτικού διαχε
|
||||
|
||||
#: ../src/startup.c:349
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@ msgstr "Window Maker recibió la señal %i."
|
||||
|
||||
#: ../src/dialog.c:1576
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Este error fatal ocurrió probablemente debido a un fallo.\n"
|
||||
|
||||
@@ -487,7 +487,7 @@ msgstr "Window Maker võttis vastu signaali %i."
|
||||
|
||||
#: ../src/dialog.c:1573
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" See fataalviga on arvatavasti põhjustatud programmi enese veast. Palun "
|
||||
|
||||
@@ -13,6 +13,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-09-03 21:56+03:00\n"
|
||||
"Last-Translator: Tomi Kajala <tomi@iki.fi>\n"
|
||||
"Language-Team: Finnish <fi@li.org>\n"
|
||||
"Language: fi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -465,7 +466,7 @@ msgstr "Window Maker vastaanotti signaalin %i."
|
||||
|
||||
#: ../src/dialog.c:1707
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Tämä vakava virhe tapahtui luultavasti bugin johdosta. Ole hyvä ja täytä "
|
||||
@@ -1389,7 +1390,7 @@ msgstr "vaihtoehtoisen ikkunamanagerin käynnistys epäonnistui. Keskeytetään.
|
||||
|
||||
#: ../src/startup.c:412
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"vakava virhe on tapahtunut - luultavasti bugin johdosta. Ole hyvä ja täytä "
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-01-21 07:08+0100\n"
|
||||
"Last-Translator: Antoine Hulin <antoine.hulin@origan.fdn.org>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -481,7 +482,7 @@ msgstr "Window Maker a reçu le signal %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Cette erreur est probablement due à un bogue. Remplissez le formulaire "
|
||||
|
||||
@@ -2086,11 +2086,3 @@ msgstr "toets %s (0x%x) generearret sawol %s as %s, wat ûnsinnich is"
|
||||
#, c-format
|
||||
msgid "Can't convert keymask 0x%04X to a shortcut label"
|
||||
msgstr "Kin 'keymask' 0x%04X net omsette nei fluchtoetsbeneaming"
|
||||
|
||||
# Keep next entry for wmaker-0.95.7
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Dizze ûnwerstelbere flater trede mooglik op troch in bug. Folje a.j.w. "
|
||||
"bygeand BUGFORM yn, en rapportearje it oan %s."
|
||||
|
||||
@@ -14,6 +14,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2000-10-15 17:57+0200\n"
|
||||
"Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
|
||||
"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
|
||||
"Language: gl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -359,7 +360,7 @@ msgstr "O Window Maker recibiu un sinal %i."
|
||||
|
||||
#: ../src/dialog.c:1564
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Este erro grave ocorreu probablemente por mor dun erro do programa. Por "
|
||||
@@ -1240,7 +1241,7 @@ msgstr "fallou o inicio dun xestor de fiestras alternativo. Abortando."
|
||||
|
||||
#: ../src/startup.c:352
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"ocorreu un erro moi grave, probablemente por mor dun erro de programación. "
|
||||
|
||||
@@ -8,6 +8,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1998-08-18 16:28:19+0200\n"
|
||||
"Last-Translator: Toni Bilić <tbilic@oliver.efos.hr>\n"
|
||||
"Language-Team: Croatian\n"
|
||||
"Language: hr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
@@ -11,7 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2014-02-18 00:23+0100\n"
|
||||
"Last-Translator: BALATON Zoltán <balaton@eik.bme.hu>\n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"Language: \n"
|
||||
"Language: hu\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -491,7 +491,7 @@ msgstr "A Window Maker %i jelzést kapott."
|
||||
|
||||
#: ../../wmaker-crm/src/dialog.c:1599
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr " Ezt a végzetes hibát valószínűleg egy programozási hiba okozta. Légy szíves töltsd ki a mellékelt BUGFORM kérdőívet és küldd el a %s e-mail címre!"
|
||||
|
||||
@@ -800,7 +800,7 @@ msgstr "a beállítás adatbázist tartalmazó egységet lecsatolták. \"--stati
|
||||
msgid "Inotify: Reading config files in defaults database."
|
||||
msgstr "Inotify: újraolvasom a konfigurációs fájlokat a beállítás adatbázisból."
|
||||
|
||||
#. an error has occured
|
||||
#. an error has occurred
|
||||
#: ../../wmaker-crm/src/event.c:391
|
||||
msgid ""
|
||||
"select failed. The inotify instance will be closed. Changes to the defaults "
|
||||
|
||||
@@ -11,6 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2005-03-04 16:33+0000\n"
|
||||
"Last-Translator: Marco Colombo <m.colombo@ed.ac.uk>\n"
|
||||
"Language-Team: Italian <tp@lists.linux.it@li.org>\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -526,7 +527,7 @@ msgstr "Window Maker ha ricevuto il segnale %i."
|
||||
|
||||
#: ../src/dialog.c:1768
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Questo errore fatale è probabilmente dovuto ad un bug. Si prega di "
|
||||
|
||||
@@ -460,7 +460,7 @@ msgstr "Window Maker は シグナル %i を受けました."
|
||||
|
||||
#: ../src/dialog.c:1576
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"この致命的なエラーはバグによるものかもしれません. 同梱のバグフォームを使って "
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2013-08-12 23:57+0900\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Korean\n"
|
||||
"Language: ko\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -471,7 +472,7 @@ msgstr "윈도우 메이커가 %i 신호를 받음."
|
||||
|
||||
#: ../src/dialog.c:1596
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"버그로 인해 치명적인 오류가 발생했습니다. BUGFORM을 작성하여 "
|
||||
@@ -1953,7 +1954,7 @@ msgstr "마지막으로 사용됨"
|
||||
#~ msgstr "대체용 창 관리자를 실행 실패. 종료."
|
||||
|
||||
#~ msgid ""
|
||||
#~ "a fatal error has occured, probably due to a bug. Please fill the "
|
||||
#~ "a fatal error has occurred, probably due to a bug. Please fill the "
|
||||
#~ "included BUGFORM and report it."
|
||||
#~ msgstr ""
|
||||
#~ "치명적인 오류 발생, 아마도 버그인 것 같습니다. BUGFORM을 작성해 보내주시"
|
||||
|
||||
@@ -10,6 +10,7 @@ msgstr ""
|
||||
"Last-Translator: Hasbullah Bin Pit <sebol@ikhlas.com>\n"
|
||||
"Language-Team: Projek Gabai (Bahasa Melayu) <gabai-penyumbang@lists."
|
||||
"sourceforge.net>\n"
|
||||
"Language: ms\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -456,7 +457,7 @@ msgstr "Window Maker menerima isyarat %i."
|
||||
|
||||
#: ../src/dialog.c:1786
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Ralat fatal ini berlaku kemungkinan disebabkan pepijat. Sila ini BUGFORM "
|
||||
@@ -1414,7 +1415,7 @@ msgstr "gagl menghidupkan pengurus tetingkap lain. Diabaikan."
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"ralat fatal berlaku, mungkin kerana pepijat. Sila ini BUGFORM yang "
|
||||
|
||||
@@ -2090,11 +2090,3 @@ msgstr "toets %s (0x%x) genereert zowel %s als %s, wat onzinnig is"
|
||||
#, c-format
|
||||
msgid "Can't convert keymask 0x%04X to a shortcut label"
|
||||
msgstr "Kan 'keymask' 0x%04X niet omzetten naar sneltoetsbenaming"
|
||||
|
||||
# Keep next entry for wmaker-0.95.7
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Deze onherstelbare fout trad mogelijk op door 'n bug. Vul a.u.b. "
|
||||
"bijgaand BUGFORM in, en rapporteer 't aan %s."
|
||||
|
||||
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1998-05-23 H12:54+0200\n"
|
||||
"Last-Translator: Marcus Ramberg <draven@mo.himolde.no>\n"
|
||||
"Language-Team: Norwegian \n"
|
||||
"Language: no\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2003-04-15 20:21+0200\n"
|
||||
"Last-Translator: Piotr Dembiński <pdemb@fanthom.math.put.poznan.pl>\n"
|
||||
"Language-Team: Polish <pl@li.org>\n"
|
||||
"Language: pl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -982,7 +983,7 @@ msgid "crashed while trying to do some post-crash cleanup. Aborting immediatelly
|
||||
msgstr "załamanie podczas próby uporządkowania po załamaniu. Wyjście awaryjne."
|
||||
|
||||
#: ../src/startup.c:304
|
||||
msgid "a fatal error has occured, probably due to a bug. Please fill the included BUGFORM and report it."
|
||||
msgid "a fatal error has occurred, probably due to a bug. Please fill the included BUGFORM and report it."
|
||||
msgstr "wystąpił poważny błąd, prawdopodobnie pluskwa. Prosimy o wypełnienie formularza BUGFORM i wysłanie go do nas."
|
||||
|
||||
#. restart another window manager so that the X session doesn't
|
||||
|
||||
@@ -12,6 +12,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2000-06-06 14:11-03:00\n"
|
||||
"Last-Translator: Marcia Norie Nakaza <norie@conectiva.com.br>\n"
|
||||
"Language-Team: Brazilian Portuguese <ldp-br@bazar.conectiva.com.br> \n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -352,7 +353,7 @@ msgstr "O Window Maker recebeu o sinal %i."
|
||||
|
||||
#: ../src/dialog.c:1564
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Este erro fatal ocorreu provavelmente devido a uma falha.\n"
|
||||
@@ -1230,7 +1231,7 @@ msgstr "tentativa de iniciar gerenciador alternativo falhou. Abortando."
|
||||
|
||||
#: ../src/startup.c:352
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"um erro fatal ocorreu, provavelmente devido a uma falha. Por favor preencha "
|
||||
|
||||
@@ -6,6 +6,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1998-09-08 22:00:00-0300\n"
|
||||
"Last-Translator: AndreiVuta(gigi_man@manag.pub.ro)\n"
|
||||
"Language-Team: Romanian \n"
|
||||
"Language: ro\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -16,6 +16,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2002-10-04 08:56+0300\n"
|
||||
"Last-Translator: awn@bcs.zp.ua\n"
|
||||
"Language-Team: Russian\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -487,7 +488,7 @@ msgstr "Window Maker: получен сигнал %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Эта критическая ошибка, возможно, является результатом ошибки в программе. "
|
||||
@@ -1438,7 +1439,7 @@ msgstr "не удалось запустить альтернативный ди
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"возникла критическая ошибка. Возможно, это результат ошибки в программе. "
|
||||
|
||||
@@ -21,6 +21,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2001-12-20 03:53+0100\n"
|
||||
"Last-Translator: Jan \"judas\" Tomka <judas@linux.sk>\n"
|
||||
"Language-Team: Slovak <sk@li.org>\n"
|
||||
"Language: sk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -498,7 +499,7 @@ msgstr "Window Maker prijal signál %i."
|
||||
#: ../src/dialog.c:1632
|
||||
#, c-format
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"Táto fatálna chyba sa vyskytla "
|
||||
@@ -1480,7 +1481,7 @@ msgstr "nepodarilo sa spustiť alternatívny manažér okien. Koniec."
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"fatálna chyba nastala pravdepodobne v dôsledku chyby vo Window Makery. "
|
||||
|
||||
@@ -7,6 +7,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1997-06-02 18:29:09-0300\n"
|
||||
"Last-Translator: John <forgoil@rsn.hk-r.se>\n"
|
||||
"Language-Team: Swedish \n"
|
||||
"Language: sv\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -4,6 +4,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1998-03-12 18:29:09+EET\n"
|
||||
"Last-Translator: KGF <kgf@wpi.edu>\n"
|
||||
"Language-Team: Turkish \n"
|
||||
"Language: tr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
@@ -5,6 +5,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2005-09-06 08:56+0300\n"
|
||||
"Last-Translator: Victor Forsyuk <victor@ksi-linux.com>\n"
|
||||
"Language-Team: KSI Linux Ukrainian <uk@ksi-linux.com>\n"
|
||||
"Language: uk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -479,7 +480,7 @@ msgstr "Window Maker: отримано сигнал %i."
|
||||
|
||||
#: ../src/dialog.c:1790
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
" Ця критична помилка, можливо, є результатом помилки в програмі. Будь ласка, "
|
||||
@@ -1448,7 +1449,7 @@ msgstr "не вдалось запустити альтернативний ме
|
||||
|
||||
#: ../src/startup.c:419
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"виникла критична помилка. Можливо, це результат помилки в програмі. Будь "
|
||||
|
||||
+3
-2
@@ -9,6 +9,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 1999-07-05 21:30+0800\n"
|
||||
"Last-Translator: Wang Jian <larkw@263.net>\n"
|
||||
"Language-Team: chinese <zh@li.org>\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -300,7 +301,7 @@ msgstr "Window Maker收到信号%i."
|
||||
|
||||
#: ../src/dialog.c:1450
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"发生一个致命错误,也许是因为一个 bug.请填写好软件中包含的 BUGFORM 并向"
|
||||
@@ -1163,7 +1164,7 @@ msgstr "无法启动替代的窗口管理器.中止."
|
||||
|
||||
#: ../src/startup.c:349
|
||||
msgid ""
|
||||
"a fatal error has occured, probably due to a bug. Please fill the included "
|
||||
"a fatal error has occurred, probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it."
|
||||
msgstr ""
|
||||
"发生一个致命错误,也许是因为一个 bug.请填写好软件中包含的 BUGFORM 并报告 bug."
|
||||
|
||||
+3
-2
@@ -11,6 +11,7 @@ msgstr ""
|
||||
"PO-Revision-Date: 2005-01-11 17:45+0800\n"
|
||||
"Last-Translator: Li Wei Jih <lwj83@cs.ccu.edu.tw>\n"
|
||||
"Language-Team: chinese <zh@li.org>\n"
|
||||
"Language: zh_TW\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
@@ -512,7 +513,7 @@ msgstr "Window Maker 收到訊號 %i。"
|
||||
|
||||
#: ../src/dialog.c:1768
|
||||
msgid ""
|
||||
" This fatal error occured probably due to a bug. Please fill the included "
|
||||
" This fatal error occurred probably due to a bug. Please fill the included "
|
||||
"BUGFORM and report it to %s."
|
||||
msgstr ""
|
||||
"這個嚴重錯誤可能是因為程式錯誤所致。請填寫附帶的 BUGFORM 並向 "
|
||||
@@ -1927,7 +1928,7 @@ msgstr "刪除最後的工作區"
|
||||
#~ msgstr "另一套視窗管理員啟動失敗。放棄中。"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "a fatal error has occured, probably due to a bug. Please fill the "
|
||||
#~ "a fatal error has occurred, probably due to a bug. Please fill the "
|
||||
#~ "included BUGFORM and report it."
|
||||
#~ msgstr "發生嚴重錯誤,可能因為程式錯誤。請填寫 BUGFORM 並提出報告。"
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
arg_error "argument '$1' is not understood"
|
||||
|
||||
@@ -75,7 +75,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ "x$trans_dir" != "x" ] || arg_error "only 1 directory can be specified for translation"
|
||||
@@ -226,7 +226,7 @@ END {
|
||||
error_count++;
|
||||
}
|
||||
|
||||
# If error(s) occured, use non-zero status to stop 'make'
|
||||
# If error(s) occurred, use non-zero status to stop 'make'
|
||||
# We use 3 to distinguish for awk's possible own problems (status 1 or 2)
|
||||
if (error_count > 0) { exit 3 }
|
||||
}"
|
||||
|
||||
@@ -120,7 +120,7 @@ $1"
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
arg_error "argument '$1' is not understood"
|
||||
|
||||
@@ -119,7 +119,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ -z "$input_file" ] || arg_error "only 1 man page can be specified"
|
||||
|
||||
@@ -83,7 +83,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ -r "$1" ] || arg_error "source file \"$1\" is not readable"
|
||||
|
||||
@@ -90,7 +90,7 @@ while [ $# -gt 0 ]; do
|
||||
project_version="$1"
|
||||
;;
|
||||
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ "x$lang_file" = "x" ] || arg_error "only 1 po file can be specified, not \"$lang_file\" and \"$1\""
|
||||
|
||||
@@ -151,7 +151,7 @@ while [ $# -gt 0 ]; do
|
||||
project_version="$1"
|
||||
;;
|
||||
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ "x$input_file" = "x" ] || arg_error "only 1 input file can be specified, not \"$input_file\" and \"$1\""
|
||||
@@ -903,7 +903,7 @@ function execute_commands(line, replaced_line, command) {
|
||||
# Variable and Conditional commands ########################################
|
||||
} else if (command == "value") {
|
||||
if (variable[cmdargs] == "") {
|
||||
report_error("variable '" cmdargs "' is unknow, for @value at line " NR);
|
||||
report_error("variable '" cmdargs "' is unknown, for @value at line " NR);
|
||||
}
|
||||
line = variable[cmdargs] line;
|
||||
|
||||
@@ -913,7 +913,7 @@ function execute_commands(line, replaced_line, command) {
|
||||
line = "";
|
||||
|
||||
} else {
|
||||
report_error("unknow command @" command " at line " NR);
|
||||
report_error("unknown command @" command " at line " NR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -971,7 +971,7 @@ function process_end(line) {
|
||||
par_indent = 0;
|
||||
|
||||
} else {
|
||||
report_error("unknow command @end " line " at line " NR);
|
||||
report_error("unknown command @end " line " at line " NR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ while [ $# -gt 0 ]; do
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-o) shift ; output_file="$1" ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ "x$input_file" = "x" ] || arg_error "only 1 input file can be specified, not \"$input_file\" and \"$1\""
|
||||
|
||||
@@ -120,7 +120,7 @@ while [ $# -gt 0 ]; do
|
||||
list_replaces="$list_replaces $1"
|
||||
;;
|
||||
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ "x$input_file" = "x" ] || arg_error "only 1 input file can be specified, not \"$input_file\" and \"$1\""
|
||||
|
||||
@@ -93,7 +93,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
|
||||
-h|-help|--help) print_help ;;
|
||||
-*) arg_error "unknow option '$1'" ;;
|
||||
-*) arg_error "unknown option '$1'" ;;
|
||||
|
||||
*)
|
||||
[ -z "$edit_file" ] || arg_error "only 1 file to modify can be specified"
|
||||
|
||||
+2
-1
@@ -134,7 +134,7 @@ else
|
||||
nodist_wmaker_SOURCES = misc.hack_nf.c \
|
||||
xmodifier.hack_nf.c
|
||||
|
||||
CLEANFILES = $(nodist_wmaker_SOURCES)
|
||||
CLEANFILES = $(nodist_wmaker_SOURCES) ../wmaker-rs/target
|
||||
|
||||
misc.hack_nf.c: misc.c $(top_srcdir)/script/nested-func-to-macro.sh
|
||||
$(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh \
|
||||
@@ -160,6 +160,7 @@ wmaker_LDADD = \
|
||||
$(top_builddir)/WINGs/libWINGs.la\
|
||||
$(top_builddir)/WINGs/libWUtil.la\
|
||||
$(top_builddir)/wrlib/libwraster.la\
|
||||
$(top_builddir)/wmaker-rs/target/debug/libwmaker_rs.a\
|
||||
@XLFLAGS@ \
|
||||
@LIBXRANDR@ \
|
||||
@LIBXINERAMA@ \
|
||||
|
||||
+12
-5
@@ -504,6 +504,12 @@ extern struct WPreferences {
|
||||
/****** Global Variables ******/
|
||||
extern Display *dpy;
|
||||
|
||||
struct wmaker_global_variables_context {
|
||||
XContext client_win;
|
||||
XContext app_win;
|
||||
XContext stack;
|
||||
};
|
||||
|
||||
extern struct wmaker_global_variables {
|
||||
/* Tracking of the state of the program */
|
||||
struct {
|
||||
@@ -603,11 +609,7 @@ extern struct wmaker_global_variables {
|
||||
} atom;
|
||||
|
||||
/* X Contexts */
|
||||
struct {
|
||||
XContext client_win;
|
||||
XContext app_win;
|
||||
XContext stack;
|
||||
} context;
|
||||
struct wmaker_global_variables_context context;
|
||||
|
||||
/* X Extensions */
|
||||
struct {
|
||||
@@ -666,4 +668,9 @@ extern const char WMNWorkspaceNameChanged[];
|
||||
|
||||
extern const char WMNResetStacking[];
|
||||
|
||||
|
||||
/****** Accessors/mutators for Rust ******/
|
||||
struct wmaker_global_variables_context *wGlobalGetContext();
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+43
-41
@@ -148,7 +148,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
wWindowUnfocus(old_focused);
|
||||
|
||||
if (oapp) {
|
||||
wAppMenuUnmap(oapp->menu);
|
||||
wAppMenuUnmap(wApplicationGetMenu(oapp));
|
||||
if (wPreferences.highlight_active_app)
|
||||
wApplicationDeactivate(oapp);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
|
||||
/* remember last workspace where the app has been */
|
||||
if (napp)
|
||||
napp->last_workspace = wwin->frame->workspace;
|
||||
wApplicationSetLastWorkspace(napp, wwin->frame->workspace);
|
||||
|
||||
if (wwin->flags.mapped && !WFLAGP(wwin, no_focusable)) {
|
||||
/* install colormap if colormap mode is lock mode */
|
||||
@@ -212,7 +212,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
scr->focused_window = wwin;
|
||||
|
||||
if (oapp && oapp != napp) {
|
||||
wAppMenuUnmap(oapp->menu);
|
||||
wAppMenuUnmap(wApplicationGetMenu(oapp));
|
||||
if (wPreferences.highlight_active_app)
|
||||
wApplicationDeactivate(oapp);
|
||||
}
|
||||
@@ -226,12 +226,12 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
|
||||
if (napp && !wasfocused) {
|
||||
#ifdef USER_MENU
|
||||
wUserMenuRefreshInstances(napp->menu, wwin);
|
||||
wUserMenuRefreshInstances(wApplicationGetMenu(napp), wwin);
|
||||
#endif /* USER_MENU */
|
||||
|
||||
/* kix: Only menu map with mouse, not alt+tab! */
|
||||
if (wwin->flags.mapped)
|
||||
wAppMenuMap(napp->menu, wwin);
|
||||
wAppMenuMap(wApplicationGetMenu(napp), wwin);
|
||||
}
|
||||
if (napp && wPreferences.highlight_active_app)
|
||||
wApplicationActivate(napp);
|
||||
@@ -1783,7 +1783,7 @@ void wHideOtherApplications(WWindow *awin)
|
||||
} else if (wwin->main_window != None && awin->main_window != wwin->main_window) {
|
||||
tapp = wApplicationOf(wwin->main_window);
|
||||
if (tapp) {
|
||||
tapp->flags.skip_next_animation = 1;
|
||||
wApplicationSetSkipNextAnimation(tapp, 1);
|
||||
wHideApplication(tapp);
|
||||
} else {
|
||||
if (!WFLAGP(wwin, no_miniaturizable)) {
|
||||
@@ -1811,37 +1811,39 @@ void wHideApplication(WApplication *wapp)
|
||||
wwarning("trying to hide a non grouped window");
|
||||
return;
|
||||
}
|
||||
if (!wapp->main_window_desc) {
|
||||
if (!wApplicationGetMainWindowDesc(wapp)) {
|
||||
wwarning("group leader not found for window group");
|
||||
return;
|
||||
}
|
||||
scr = wapp->main_window_desc->screen_ptr;
|
||||
scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
hadfocus = 0;
|
||||
wlist = scr->focused_window;
|
||||
if (!wlist)
|
||||
return;
|
||||
|
||||
if (wlist->main_window == wapp->main_window)
|
||||
wapp->last_focused = wlist;
|
||||
if (wlist->main_window == wApplicationGetMainWindow(wapp))
|
||||
wApplicationSetLastFocused(wapp, wlist);
|
||||
else
|
||||
wapp->last_focused = NULL;
|
||||
wApplicationSetLastFocused(wapp, NULL);
|
||||
|
||||
animate = !wapp->flags.skip_next_animation;
|
||||
animate = !wApplicationGetSkipNextAnimation(wapp);
|
||||
|
||||
while (wlist) {
|
||||
if (wlist->main_window == wapp->main_window) {
|
||||
if (wlist->main_window == wApplicationGetMainWindow(wapp)) {
|
||||
if (wlist->flags.focused)
|
||||
hadfocus = 1;
|
||||
if (wapp->app_icon) {
|
||||
hideWindow(wapp->app_icon->icon, wapp->app_icon->x_pos,
|
||||
wapp->app_icon->y_pos, wlist, animate);
|
||||
if (wApplicationGetAppIcon(wapp)) {
|
||||
hideWindow(wAppIconGetIcon(wApplicationGetAppIcon(wapp)),
|
||||
wAppIconGetXPos(wApplicationGetAppIcon(wapp)),
|
||||
wAppIconGetYPos(wApplicationGetAppIcon(wapp)),
|
||||
wlist, animate);
|
||||
animate = False;
|
||||
}
|
||||
}
|
||||
wlist = wlist->prev;
|
||||
}
|
||||
|
||||
wapp->flags.skip_next_animation = 0;
|
||||
wApplicationSetSkipNextAnimation(wapp, 0);
|
||||
|
||||
if (hadfocus) {
|
||||
if (wPreferences.focus_mode == WKF_CLICK) {
|
||||
@@ -1858,14 +1860,14 @@ void wHideApplication(WApplication *wapp)
|
||||
}
|
||||
}
|
||||
|
||||
wapp->flags.hidden = 1;
|
||||
wApplicationSetHidden(wapp, 1);
|
||||
|
||||
if (wPreferences.auto_arrange_icons)
|
||||
wArrangeIcons(scr, True);
|
||||
|
||||
#ifdef HIDDENDOT
|
||||
if (wapp->app_icon)
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
if (wApplicationGetAppIcon(wapp))
|
||||
wAppIconPaint(wApplicationGetAppIcon(wapp));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1914,7 +1916,7 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
||||
if (!wapp)
|
||||
return;
|
||||
|
||||
scr = wapp->main_window_desc->screen_ptr;
|
||||
scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
wlist = scr->focused_window;
|
||||
if (!wlist)
|
||||
return;
|
||||
@@ -1923,12 +1925,12 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
||||
while (wlist->prev)
|
||||
wlist = wlist->prev;
|
||||
|
||||
animate = !wapp->flags.skip_next_animation;
|
||||
animate = !wApplicationGetSkipNextAnimation(wapp);
|
||||
|
||||
while (wlist) {
|
||||
next = wlist->next;
|
||||
|
||||
if (wlist->main_window == wapp->main_window) {
|
||||
if (wlist->main_window == wApplicationGetMainWindow(wapp)) {
|
||||
if (wlist->flags.focused)
|
||||
focused = wlist;
|
||||
else if (!focused || !focused->flags.focused)
|
||||
@@ -1968,8 +1970,8 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
||||
}
|
||||
WMPostNotificationName(WMNChangedState, wlist, "hide");
|
||||
} else if (wlist->flags.hidden) {
|
||||
unhideWindow(wapp->app_icon->icon, wapp->app_icon->x_pos,
|
||||
wapp->app_icon->y_pos, wlist, animate, bringToCurrentWS);
|
||||
unhideWindow(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), wAppIconGetXPos(wApplicationGetAppIcon(wapp)),
|
||||
wAppIconGetYPos(wApplicationGetAppIcon(wapp)), wlist, animate, bringToCurrentWS);
|
||||
animate = False;
|
||||
} else {
|
||||
if (bringToCurrentWS && wlist->frame->workspace != scr->current_workspace)
|
||||
@@ -1981,21 +1983,21 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
||||
wlist = next;
|
||||
}
|
||||
|
||||
wapp->flags.skip_next_animation = 0;
|
||||
wapp->flags.hidden = 0;
|
||||
wApplicationSetSkipNextAnimation(wapp, 0);
|
||||
wApplicationSetHidden(wapp, 0);
|
||||
|
||||
if (wapp->last_focused && wapp->last_focused->flags.mapped) {
|
||||
wRaiseFrame(wapp->last_focused->frame->core);
|
||||
wSetFocusTo(scr, wapp->last_focused);
|
||||
if (wApplicationGetLastWorkspace(wapp) && wApplicationGetLastFocused(wapp)->flags.mapped) {
|
||||
wRaiseFrame(wApplicationGetLastFocused(wapp)->frame->core);
|
||||
wSetFocusTo(scr, wApplicationGetLastFocused(wapp));
|
||||
} else if (focused) {
|
||||
wSetFocusTo(scr, focused);
|
||||
}
|
||||
wapp->last_focused = NULL;
|
||||
wApplicationSetLastFocused(wapp, NULL);
|
||||
if (wPreferences.auto_arrange_icons)
|
||||
wArrangeIcons(scr, True);
|
||||
|
||||
#ifdef HIDDENDOT
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
wAppIconPaint(wApplicationGetAppIcon(wapp));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2073,7 +2075,7 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
if (scr->dock) {
|
||||
int offset = wPreferences.icon_size + DOCK_EXTRA_SPACE;
|
||||
|
||||
if (scr->dock->on_right_side)
|
||||
if (wDockIsOnRightSide(scr->dock))
|
||||
area.x2 -= offset;
|
||||
else
|
||||
area.x1 += offset;
|
||||
@@ -2128,20 +2130,20 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
/* arrange application icons */
|
||||
aicon = scr->app_icon_list;
|
||||
/* reverse them to avoid unnecessarily sliding of icons */
|
||||
while (aicon && aicon->next)
|
||||
aicon = aicon->next;
|
||||
while (aicon && wAppIconGetNext(aicon))
|
||||
aicon = wAppIconGetNext(aicon);
|
||||
|
||||
while (aicon) {
|
||||
if (!aicon->docked) {
|
||||
if (!wAppIconIsDocked(aicon)) {
|
||||
/* CHECK: can icon be NULL here ? */
|
||||
/* The intention here is to place the AppIcon on the head that
|
||||
* contains most of the applications _main_ window. */
|
||||
head = wGetHeadForWindow(aicon->icon->owner);
|
||||
head = wGetHeadForWindow(wAppIconGetIcon(aicon)->owner);
|
||||
|
||||
if (aicon->x_pos != X || aicon->y_pos != Y) {
|
||||
if (wAppIconGetXPos(aicon) != X || wAppIconGetYPos(aicon) != Y) {
|
||||
#ifdef USE_ANIMATIONS
|
||||
if (!wPreferences.no_animations)
|
||||
slide_window(aicon->icon->core->window, aicon->x_pos, aicon->y_pos, X, Y);
|
||||
slide_window(wAppIconGetIcon(aicon)->core->window, wAppIconGetXPos(aicon), wAppIconGetYPos(aicon), X, Y);
|
||||
#endif /* USE_ANIMATIONS */
|
||||
}
|
||||
wAppIconMove(aicon, X, Y);
|
||||
@@ -2151,7 +2153,7 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
vars[head].si++;
|
||||
}
|
||||
}
|
||||
aicon = aicon->prev;
|
||||
aicon = wAppIconGetPrev(aicon);
|
||||
}
|
||||
|
||||
/* arrange miniwindows */
|
||||
@@ -2243,7 +2245,7 @@ void wMakeWindowVisible(WWindow *wwin)
|
||||
app = wApplicationOf(wwin->main_window);
|
||||
if (app) {
|
||||
/* trick to get focus to this window */
|
||||
app->last_focused = wwin;
|
||||
wApplicationSetLastFocused(app, wwin);
|
||||
wUnhideApplication(app, False, False);
|
||||
}
|
||||
}
|
||||
|
||||
+359
-110
@@ -55,6 +55,255 @@
|
||||
#include "xdnd.h"
|
||||
#endif
|
||||
|
||||
struct WAppIcon {
|
||||
short xindex;
|
||||
short yindex;
|
||||
struct WAppIcon *next;
|
||||
struct WAppIcon *prev;
|
||||
WIcon *icon;
|
||||
int x_pos, y_pos; /* absolute screen coordinate */
|
||||
char *command; /* command used to launch app */
|
||||
#ifdef USE_DOCK_XDND
|
||||
char *dnd_command; /* command to use when something is */
|
||||
/* dropped on us */
|
||||
#endif
|
||||
char *paste_command; /* command to run when
|
||||
* something is pasted */
|
||||
char *wm_class;
|
||||
char *wm_instance;
|
||||
pid_t pid; /* for apps launched from the dock */
|
||||
Window main_window;
|
||||
struct WDock *dock; /* In which dock is docked. */
|
||||
struct _AppSettingsPanel *panel; /* Settings Panel */
|
||||
unsigned int docked:1;
|
||||
unsigned int omnipresent:1; /* If omnipresent when
|
||||
* docked in clip */
|
||||
unsigned int attracted:1; /* If it was attracted by the clip */
|
||||
unsigned int launching:1;
|
||||
unsigned int running:1; /* application is already running */
|
||||
unsigned int relaunching:1; /* launching 2nd instance */
|
||||
unsigned int forced_dock:1;
|
||||
unsigned int auto_launch:1; /* launch app on startup */
|
||||
unsigned int remote_start:1;
|
||||
unsigned int updated:1;
|
||||
unsigned int editing:1; /* editing docked icon */
|
||||
unsigned int drop_launch:1; /* launching from drop action */
|
||||
unsigned int paste_launch:1; /* launching from paste action */
|
||||
unsigned int destroyed:1; /* appicon was destroyed */
|
||||
unsigned int buggy_app:1; /* do not make dock rely on hints
|
||||
* set by app */
|
||||
unsigned int lock:1; /* do not allow to be destroyed */
|
||||
};
|
||||
|
||||
/******** Accessors/mutators ********/
|
||||
short wAppIconGetXIndex(WAppIcon *aicon) {
|
||||
return aicon->xindex;
|
||||
}
|
||||
void wAppIconSetXIndex(WAppIcon *aicon, short xindex) {
|
||||
aicon->xindex = xindex;
|
||||
}
|
||||
|
||||
short wAppIconGetYIndex(WAppIcon *aicon) {
|
||||
return aicon->yindex;
|
||||
}
|
||||
void wAppIconSetYIndex(WAppIcon *aicon, short yindex) {
|
||||
aicon->yindex = yindex;
|
||||
}
|
||||
|
||||
struct WAppIcon *wAppIconGetNext(WAppIcon *aicon) {
|
||||
return aicon->next;
|
||||
}
|
||||
|
||||
struct WAppIcon *wAppIconGetPrev(WAppIcon *aicon) {
|
||||
return aicon->prev;
|
||||
}
|
||||
|
||||
int wAppIconGetXPos(WAppIcon *aicon) {
|
||||
return aicon->x_pos;
|
||||
}
|
||||
void wAppIconSetXPos(WAppIcon *aicon, int x_pos) {
|
||||
aicon->x_pos = x_pos;
|
||||
}
|
||||
|
||||
int wAppIconGetYPos(WAppIcon *aicon) {
|
||||
return aicon->y_pos;
|
||||
}
|
||||
void wAppIconSetYPos(WAppIcon *aicon, int y_pos) {
|
||||
aicon->y_pos = y_pos;
|
||||
}
|
||||
|
||||
WIcon *wAppIconGetIcon(WAppIcon *aicon) {
|
||||
return aicon->icon;
|
||||
}
|
||||
|
||||
char *wAppIconGetCommand(WAppIcon *aicon) {
|
||||
return aicon->command;
|
||||
}
|
||||
void wAppIconSetCommand(WAppIcon *aicon, char *command) {
|
||||
if (aicon->command)
|
||||
wfree(aicon->command);
|
||||
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
|
||||
wfree(command);
|
||||
command = NULL;
|
||||
}
|
||||
aicon->command = command;
|
||||
}
|
||||
|
||||
#ifdef USE_DOCK_XDND
|
||||
char *wAppIconGetDnDCommand(WAppIcon *aicon) {
|
||||
return aicon->dnd_command;
|
||||
}
|
||||
void wAppIconSetDnDCommand(WAppIcon *aicon, char *command) {
|
||||
if (aicon->dnd_command)
|
||||
wfree(aicon->dnd_command);
|
||||
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
|
||||
wfree(command);
|
||||
command = NULL;
|
||||
}
|
||||
aicon->dnd_command = command;
|
||||
}
|
||||
#endif // USE_DOCK_XDND
|
||||
|
||||
char *wAppIconGetPasteCommand(WAppIcon *aicon) {
|
||||
return aicon->paste_command;
|
||||
}
|
||||
void wAppIconSetPasteCommand(WAppIcon *aicon, char *command) {
|
||||
if (aicon->paste_command)
|
||||
wfree(aicon->paste_command);
|
||||
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
|
||||
wfree(command);
|
||||
command = NULL;
|
||||
}
|
||||
aicon->paste_command = command;
|
||||
}
|
||||
|
||||
char *wAppIconGetWmClass(WAppIcon *aicon) {
|
||||
return aicon->wm_class;
|
||||
}
|
||||
|
||||
char *wAppIconGetWmInstance(WAppIcon *aicon) {
|
||||
return aicon->wm_instance;
|
||||
}
|
||||
|
||||
pid_t wAppIconGetPid(WAppIcon *aicon) {
|
||||
return aicon->pid;
|
||||
}
|
||||
void wAppIconSetPid(WAppIcon *aicon, pid_t pid) {
|
||||
aicon->pid = pid;
|
||||
}
|
||||
|
||||
Window wAppIconGetMainWindow(WAppIcon *aicon) {
|
||||
return aicon->main_window;
|
||||
}
|
||||
void wAppIconSetMainWindow(WAppIcon *aicon, Window main_window) {
|
||||
aicon->main_window = main_window;
|
||||
}
|
||||
|
||||
struct WDock *wAppIconGetDock(WAppIcon *aicon) {
|
||||
return aicon->dock;
|
||||
}
|
||||
void wAppIconSetDock(WAppIcon *aicon, struct WDock *dock) {
|
||||
aicon->dock = dock;
|
||||
}
|
||||
|
||||
struct _AppSettingsPanel *wAppIconGetPanel(WAppIcon *aicon) {
|
||||
return aicon->panel;
|
||||
}
|
||||
void wAppIconSetPanel(WAppIcon *aicon, struct _AppSettingsPanel *panel) {
|
||||
aicon->panel = panel;
|
||||
}
|
||||
|
||||
int wAppIconIsDocked(WAppIcon *aicon) {
|
||||
return aicon->docked;
|
||||
}
|
||||
void wAppIconSetDocked(WAppIcon *aicon, int docked) {
|
||||
aicon->docked = !!docked;
|
||||
}
|
||||
|
||||
int wAppIconIsOmnipresent(WAppIcon *aicon) {
|
||||
return aicon->omnipresent;
|
||||
}
|
||||
void wAppIconSetOmnipresent(WAppIcon *aicon, int omnipresent) {
|
||||
aicon->omnipresent = !!omnipresent;
|
||||
}
|
||||
|
||||
int wAppIconIsAttracted(WAppIcon *aicon) {
|
||||
return aicon->attracted;
|
||||
}
|
||||
void wAppIconSetAttracted(WAppIcon *aicon, int attracted) {
|
||||
aicon->attracted = !!attracted;
|
||||
}
|
||||
|
||||
int wAppIconIsLaunching(WAppIcon *aicon) {
|
||||
return aicon->launching;
|
||||
}
|
||||
void wAppIconSetLaunching(WAppIcon *aicon, int launching) {
|
||||
aicon->launching = !!launching;
|
||||
}
|
||||
|
||||
int wAppIconIsRunning(WAppIcon *aicon) {
|
||||
return aicon->running;
|
||||
}
|
||||
void wAppIconSetRunning(WAppIcon *aicon, int running) {
|
||||
aicon->running = !!running;
|
||||
}
|
||||
|
||||
int wAppIconIsRelaunching(WAppIcon *aicon) {
|
||||
return aicon->relaunching;
|
||||
}
|
||||
void wAppIconSetRelaunching(WAppIcon *aicon, int relaunching) {
|
||||
aicon->relaunching = !!relaunching;
|
||||
}
|
||||
|
||||
int wAppIconIsForceDocked(WAppIcon *aicon) {
|
||||
return aicon->forced_dock;
|
||||
}
|
||||
void wAppIconSetForceDocked(WAppIcon *aicon, int forced_dock) {
|
||||
aicon->forced_dock = !!forced_dock;
|
||||
}
|
||||
|
||||
int wAppIconIsAutoLaunch(WAppIcon *aicon) {
|
||||
return aicon->auto_launch;
|
||||
}
|
||||
void wAppIconSetAutoLaunch(WAppIcon *aicon, int auto_launch) {
|
||||
aicon->auto_launch = !!auto_launch;
|
||||
}
|
||||
|
||||
int wAppIconIsEditing(WAppIcon *aicon) {
|
||||
return aicon->editing;
|
||||
}
|
||||
void wAppIconSetEditing(WAppIcon *aicon, int editing) {
|
||||
aicon->editing = !!editing;
|
||||
}
|
||||
|
||||
int wAppIconIsDropLaunch(WAppIcon *aicon) {
|
||||
return aicon->drop_launch;
|
||||
}
|
||||
void wAppIconSetDropLaunch(WAppIcon *aicon, int drop_launch) {
|
||||
aicon->drop_launch = !!drop_launch;
|
||||
}
|
||||
|
||||
int wAppIconIsPasteLaunch(WAppIcon *aicon) {
|
||||
return aicon->paste_launch;
|
||||
}
|
||||
void wAppIconSetPasteLaunch(WAppIcon *aicon, int paste_launch) {
|
||||
aicon->paste_launch = !!paste_launch;
|
||||
}
|
||||
|
||||
int wAppIconIsBuggyApp(WAppIcon *aicon) {
|
||||
return aicon->buggy_app;
|
||||
}
|
||||
void wAppIconSetBuggyApp(WAppIcon *aicon, int buggy_app) {
|
||||
aicon->buggy_app = !!buggy_app;
|
||||
}
|
||||
|
||||
int wAppIconIsLocked(WAppIcon *aicon) {
|
||||
return aicon->lock;
|
||||
}
|
||||
void wAppIconSetLocked(WAppIcon *aicon, int lock) {
|
||||
aicon->lock = !!lock;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon_file for the dock is got from the preferences file by
|
||||
* using the classname/instancename
|
||||
@@ -147,16 +396,16 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *w
|
||||
void create_appicon_for_application(WApplication *wapp, WWindow *wwin)
|
||||
{
|
||||
/* Try to create an icon from the dock or clip */
|
||||
create_appicon_from_dock(wwin, wapp, wapp->main_window);
|
||||
create_appicon_from_dock(wwin, wapp, wApplicationGetMainWindow(wapp));
|
||||
|
||||
/* If app_icon was not found, create it */
|
||||
if (!wapp->app_icon) {
|
||||
if (!wApplicationGetAppIcon(wapp)) {
|
||||
/* Create the icon */
|
||||
wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
|
||||
wIconUpdate(wapp->app_icon->icon);
|
||||
wApplicationSetAppIcon(wapp, wAppIconCreate(wApplicationGetMainWindowDesc(wapp)));
|
||||
wIconUpdate(wApplicationGetAppIcon(wapp)->icon);
|
||||
|
||||
/* Now, paint the icon */
|
||||
if (!WFLAGP(wapp->main_window_desc, no_appicon))
|
||||
if (!WFLAGP(wApplicationGetMainWindowDesc(wapp), no_appicon))
|
||||
paint_app_icon(wapp);
|
||||
}
|
||||
|
||||
@@ -164,8 +413,8 @@ void create_appicon_for_application(WApplication *wapp, WWindow *wwin)
|
||||
* window data are known - so try to save the icon file for docked
|
||||
* applications to ensure that the file exists when window maker
|
||||
* starts up next time. */
|
||||
if (wapp->app_icon->docked && !WFLAGP(wapp->main_window_desc, no_appicon))
|
||||
save_appicon(wapp->app_icon);
|
||||
if (wApplicationGetAppIcon(wapp)->docked && !WFLAGP(wApplicationGetMainWindowDesc(wapp), no_appicon))
|
||||
save_appicon(wApplicationGetAppIcon(wapp));
|
||||
}
|
||||
|
||||
void unpaint_app_icon(WApplication *wapp)
|
||||
@@ -174,19 +423,19 @@ void unpaint_app_icon(WApplication *wapp)
|
||||
WScreen *scr;
|
||||
WDock *clip;
|
||||
|
||||
if (!wapp || !wapp->app_icon)
|
||||
if (!wapp || !wApplicationGetAppIcon(wapp))
|
||||
return;
|
||||
|
||||
aicon = wapp->app_icon;
|
||||
aicon = wApplicationGetAppIcon(wapp);
|
||||
|
||||
/* If the icon is docked, don't continue */
|
||||
if (aicon->docked)
|
||||
return;
|
||||
|
||||
scr = wapp->main_window_desc->screen_ptr;
|
||||
scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
clip = scr->workspaces[scr->current_workspace]->clip;
|
||||
|
||||
if (!clip || !aicon->attracted || !clip->collapsed)
|
||||
if (!clip || !aicon->attracted || !wDockIsCollapsed(clip))
|
||||
XUnmapWindow(dpy, aicon->icon->core->window);
|
||||
|
||||
/* We want to avoid having it on the list because otherwise
|
||||
@@ -206,35 +455,35 @@ void paint_app_icon(WApplication *wapp)
|
||||
int x = 0, y = 0;
|
||||
Bool update_icon = False;
|
||||
|
||||
if (!wapp || !wapp->app_icon || !wapp->main_window_desc)
|
||||
if (!wapp || !wApplicationGetAppIcon(wapp) || !wApplicationGetMainWindowDesc(wapp))
|
||||
return;
|
||||
|
||||
icon = wapp->app_icon->icon;
|
||||
scr = wapp->main_window_desc->screen_ptr;
|
||||
wapp->app_icon->main_window = wapp->main_window;
|
||||
icon = wApplicationGetAppIcon(wapp)->icon;
|
||||
scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
wApplicationGetAppIcon(wapp)->main_window = wApplicationGetMainWindow(wapp);
|
||||
|
||||
/* If the icon is docked, don't continue */
|
||||
if (wapp->app_icon->docked)
|
||||
if (wApplicationGetAppIcon(wapp)->docked)
|
||||
return;
|
||||
|
||||
attracting_dock = scr->attracting_drawer != NULL ?
|
||||
scr->attracting_drawer :
|
||||
scr->workspaces[scr->current_workspace]->clip;
|
||||
if (attracting_dock && attracting_dock->attract_icons &&
|
||||
if (attracting_dock && wDockGetAttractIcons(attracting_dock) &&
|
||||
wDockFindFreeSlot(attracting_dock, &x, &y)) {
|
||||
wapp->app_icon->attracted = 1;
|
||||
wApplicationGetAppIcon(wapp)->attracted = 1;
|
||||
if (!icon->shadowed) {
|
||||
icon->shadowed = 1;
|
||||
update_icon = True;
|
||||
}
|
||||
wDockAttachIcon(attracting_dock, wapp->app_icon, x, y, update_icon);
|
||||
wDockAttachIcon(attracting_dock, wApplicationGetAppIcon(wapp), x, y, update_icon);
|
||||
} else {
|
||||
/* We must know if the icon is painted in the screen,
|
||||
* because if painted, then PlaceIcon will return the next
|
||||
* space on the screen, and the icon will move */
|
||||
if (wapp->app_icon->next == NULL && wapp->app_icon->prev == NULL) {
|
||||
PlaceIcon(scr, &x, &y, wGetHeadForWindow(wapp->main_window_desc));
|
||||
wAppIconMove(wapp->app_icon, x, y);
|
||||
if (wApplicationGetAppIcon(wapp)->next == NULL && wApplicationGetAppIcon(wapp)->prev == NULL) {
|
||||
PlaceIcon(scr, &x, &y, wGetHeadForWindow(wApplicationGetMainWindowDesc(wapp)));
|
||||
wAppIconMove(wApplicationGetAppIcon(wapp), x, y);
|
||||
wLowerFrame(icon->core);
|
||||
}
|
||||
}
|
||||
@@ -242,57 +491,57 @@ void paint_app_icon(WApplication *wapp)
|
||||
/* If we want appicon (no_appicon is not set) and the icon is not
|
||||
* in the appicon_list, we must add it. Else, we want to avoid
|
||||
* having it on the list */
|
||||
if (!WFLAGP(wapp->main_window_desc, no_appicon) &&
|
||||
wapp->app_icon->next == NULL && wapp->app_icon->prev == NULL)
|
||||
add_to_appicon_list(scr, wapp->app_icon);
|
||||
if (!WFLAGP(wApplicationGetMainWindowDesc(wapp), no_appicon) &&
|
||||
wApplicationGetAppIcon(wapp)->next == NULL && wApplicationGetAppIcon(wapp)->prev == NULL)
|
||||
add_to_appicon_list(scr, wApplicationGetAppIcon(wapp));
|
||||
|
||||
if (!attracting_dock || !wapp->app_icon->attracted || !attracting_dock->collapsed)
|
||||
if (!attracting_dock || !wApplicationGetAppIcon(wapp)->attracted || !wDockIsCollapsed(attracting_dock))
|
||||
XMapWindow(dpy, icon->core->window);
|
||||
|
||||
if (wPreferences.auto_arrange_icons && !wapp->app_icon->attracted)
|
||||
if (wPreferences.auto_arrange_icons && !wApplicationGetAppIcon(wapp)->attracted)
|
||||
wArrangeIcons(scr, True);
|
||||
}
|
||||
|
||||
void removeAppIconFor(WApplication *wapp)
|
||||
{
|
||||
if (!wapp->app_icon)
|
||||
if (!wApplicationGetAppIcon(wapp))
|
||||
return;
|
||||
|
||||
if (wPreferences.highlight_active_app)
|
||||
wIconSetHighlited(wapp->app_icon->icon, False);
|
||||
if (wapp->app_icon->docked && !wapp->app_icon->attracted) {
|
||||
wapp->app_icon->running = 0;
|
||||
wIconSetHighlited(wApplicationGetAppIcon(wapp)->icon, False);
|
||||
if (wApplicationGetAppIcon(wapp)->docked && !wApplicationGetAppIcon(wapp)->attracted) {
|
||||
wApplicationGetAppIcon(wapp)->running = 0;
|
||||
/* since we keep it, we don't care if it was attracted or not */
|
||||
wapp->app_icon->attracted = 0;
|
||||
wapp->app_icon->icon->shadowed = 0;
|
||||
wapp->app_icon->main_window = None;
|
||||
wapp->app_icon->pid = 0;
|
||||
wapp->app_icon->icon->owner = NULL;
|
||||
wapp->app_icon->icon->icon_win = None;
|
||||
wApplicationGetAppIcon(wapp)->attracted = 0;
|
||||
wApplicationGetAppIcon(wapp)->icon->shadowed = 0;
|
||||
wApplicationGetAppIcon(wapp)->main_window = None;
|
||||
wApplicationGetAppIcon(wapp)->pid = 0;
|
||||
wApplicationGetAppIcon(wapp)->icon->owner = NULL;
|
||||
wApplicationGetAppIcon(wapp)->icon->icon_win = None;
|
||||
|
||||
/* Set the icon image */
|
||||
set_icon_image_from_database(wapp->app_icon->icon, wapp->app_icon->wm_instance,
|
||||
wapp->app_icon->wm_class, wapp->app_icon->command);
|
||||
set_icon_image_from_database(wApplicationGetAppIcon(wapp)->icon, wApplicationGetAppIcon(wapp)->wm_instance,
|
||||
wApplicationGetAppIcon(wapp)->wm_class, wApplicationGetAppIcon(wapp)->command);
|
||||
|
||||
/* Update the icon, because wapp->app_icon->icon could be NULL */
|
||||
wIconUpdate(wapp->app_icon->icon);
|
||||
/* Update the icon, because wApplicationGetAppIcon(wapp)->icon could be NULL */
|
||||
wIconUpdate(wApplicationGetAppIcon(wapp)->icon);
|
||||
|
||||
/* Paint it */
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
} else if (wapp->app_icon->docked) {
|
||||
wapp->app_icon->running = 0;
|
||||
if (wapp->app_icon->dock->type == WM_DRAWER) {
|
||||
wDrawerFillTheGap(wapp->app_icon->dock, wapp->app_icon, True);
|
||||
wAppIconPaint(wApplicationGetAppIcon(wapp));
|
||||
} else if (wApplicationGetAppIcon(wapp)->docked) {
|
||||
wApplicationGetAppIcon(wapp)->running = 0;
|
||||
if (wDockGetType(wApplicationGetAppIcon(wapp)->dock) == WM_DRAWER) {
|
||||
wDrawerFillTheGap(wApplicationGetAppIcon(wapp)->dock, wApplicationGetAppIcon(wapp), True);
|
||||
}
|
||||
wDockDetach(wapp->app_icon->dock, wapp->app_icon);
|
||||
wDockDetach(wApplicationGetAppIcon(wapp)->dock, wApplicationGetAppIcon(wapp));
|
||||
} else {
|
||||
wAppIconDestroy(wapp->app_icon);
|
||||
wAppIconDestroy(wApplicationGetAppIcon(wapp));
|
||||
}
|
||||
|
||||
wapp->app_icon = NULL;
|
||||
wApplicationSetAppIcon(wapp, NULL);
|
||||
|
||||
if (wPreferences.auto_arrange_icons)
|
||||
wArrangeIcons(wapp->main_window_desc->screen_ptr, True);
|
||||
wArrangeIcons(wApplicationGetMainWindowDesc(wapp)->screen_ptr, True);
|
||||
}
|
||||
|
||||
static WAppIcon *wAppIconCreate(WWindow *leader_win)
|
||||
@@ -381,7 +630,7 @@ static void updateDockNumbers(WScreen *scr)
|
||||
{
|
||||
int length;
|
||||
char ws_numbers[20];
|
||||
WAppIcon *dicon = scr->dock->icon_array[0];
|
||||
WAppIcon *dicon = wDockGetIcon(scr->dock, 0);
|
||||
|
||||
snprintf(ws_numbers, sizeof(ws_numbers), "%i [ %i ]", scr->current_workspace + 1, ((scr->current_workspace / 10) + 1));
|
||||
length = strlen(ws_numbers);
|
||||
@@ -419,7 +668,7 @@ void wAppIconPaint(WAppIcon *aicon)
|
||||
scr->copy_gc, 0, 0, scr->dock_dots->width, scr->dock_dots->height, 0, 0);
|
||||
}
|
||||
#ifdef HIDDENDOT
|
||||
if (wapp && wapp->flags.hidden) {
|
||||
if (wapp && wApplicationIsHidden(wapp)) {
|
||||
XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask);
|
||||
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
|
||||
XCopyArea(dpy, scr->dock_dots->image,
|
||||
@@ -463,7 +712,7 @@ static void relaunchApplication(WApplication *wapp)
|
||||
WScreen *scr;
|
||||
WWindow *wlist, *next;
|
||||
|
||||
scr = wapp->main_window_desc->screen_ptr;
|
||||
scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
wlist = scr->focused_window;
|
||||
if (! wlist)
|
||||
return;
|
||||
@@ -474,7 +723,7 @@ static void relaunchApplication(WApplication *wapp)
|
||||
while (wlist) {
|
||||
next = wlist->next;
|
||||
|
||||
if (wlist->main_window == wapp->main_window) {
|
||||
if (wlist->main_window == wApplicationGetMainWindow(wapp)) {
|
||||
if (RelaunchWindow(wlist))
|
||||
return;
|
||||
}
|
||||
@@ -497,8 +746,8 @@ static void hideCallback(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
WApplication *wapp = (WApplication *) entry->clientdata;
|
||||
|
||||
if (wapp->flags.hidden) {
|
||||
wWorkspaceChange(menu->menu->screen_ptr, wapp->last_workspace);
|
||||
if (wApplicationIsHidden(wapp)) {
|
||||
wWorkspaceChange(menu->menu->screen_ptr, wApplicationGetLastWorkspace(wapp));
|
||||
wUnhideApplication(wapp, False, False);
|
||||
} else {
|
||||
wHideApplication(wapp);
|
||||
@@ -517,7 +766,7 @@ static void unhideHereCallback(WMenu * menu, WMenuEntry * entry)
|
||||
|
||||
static void setIconCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WAppIcon *icon = ((WApplication *) entry->clientdata)->app_icon;
|
||||
WAppIcon *icon = wApplicationGetAppIcon((WApplication *) entry->clientdata);
|
||||
char *file = NULL;
|
||||
WScreen *scr;
|
||||
int result;
|
||||
@@ -569,33 +818,33 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
||||
|
||||
assert(entry->clientdata != NULL);
|
||||
|
||||
shortname = basename(wapp->app_icon->wm_instance);
|
||||
shortname = basename(wApplicationGetAppIcon(wapp)->wm_instance);
|
||||
|
||||
buffer = wstrconcat(wapp->app_icon ? shortname : NULL,
|
||||
buffer = wstrconcat(wApplicationGetAppIcon(wapp) ? shortname : NULL,
|
||||
_(" will be forcibly closed.\n"
|
||||
"Any unsaved changes will be lost.\n" "Please confirm."));
|
||||
|
||||
fPtr = wapp->main_window_desc->fake_group;
|
||||
fPtr = wApplicationGetMainWindowDesc(wapp)->fake_group;
|
||||
|
||||
wretain(wapp->main_window_desc);
|
||||
wretain(wApplicationGetMainWindowDesc(wapp));
|
||||
if (wPreferences.dont_confirm_kill
|
||||
|| wMessageDialog(menu->frame->screen_ptr, _("Kill Application"),
|
||||
buffer, _("Yes"), _("No"), NULL) == WAPRDefault) {
|
||||
if (fPtr != NULL) {
|
||||
WWindow *wwin, *twin;
|
||||
|
||||
wwin = wapp->main_window_desc->screen_ptr->focused_window;
|
||||
wwin = wApplicationGetMainWindowDesc(wapp)->screen_ptr->focused_window;
|
||||
while (wwin) {
|
||||
twin = wwin->prev;
|
||||
if (wwin->fake_group == fPtr)
|
||||
wClientKill(wwin);
|
||||
wwin = twin;
|
||||
}
|
||||
} else if (!wapp->main_window_desc->flags.destroyed) {
|
||||
wClientKill(wapp->main_window_desc);
|
||||
} else if (!wApplicationGetMainWindowDesc(wapp)->flags.destroyed) {
|
||||
wClientKill(wApplicationGetMainWindowDesc(wapp));
|
||||
}
|
||||
}
|
||||
wrelease(wapp->main_window_desc);
|
||||
wrelease(wApplicationGetMainWindowDesc(wapp));
|
||||
wfree(buffer);
|
||||
WCHANGE_STATE(WSTATE_NORMAL);
|
||||
}
|
||||
@@ -617,7 +866,7 @@ static WMenu *createApplicationMenu(WScreen *scr)
|
||||
static void openApplicationMenu(WApplication * wapp, int x, int y)
|
||||
{
|
||||
WMenu *menu;
|
||||
WScreen *scr = wapp->main_window_desc->screen_ptr;
|
||||
WScreen *scr = wApplicationGetMainWindowDesc(wapp)->screen_ptr;
|
||||
int i;
|
||||
|
||||
if (!scr->icon_menu) {
|
||||
@@ -627,7 +876,7 @@ static void openApplicationMenu(WApplication * wapp, int x, int y)
|
||||
|
||||
menu = scr->icon_menu;
|
||||
|
||||
if (wapp->flags.hidden)
|
||||
if (wApplicationIsHidden(wapp))
|
||||
menu->entries[1]->text = _("Unhide");
|
||||
else
|
||||
menu->entries[1]->text = _("Hide");
|
||||
@@ -677,8 +926,8 @@ static void iconDblClick(WObjDescriptor *desc, XEvent *event)
|
||||
|
||||
unhideHere = (event->xbutton.state & ShiftMask);
|
||||
/* go to the last workspace that the user worked on the app */
|
||||
if (!unhideHere && wapp->last_workspace != scr->current_workspace)
|
||||
wWorkspaceChange(scr, wapp->last_workspace);
|
||||
if (!unhideHere && wApplicationGetLastWorkspace(wapp) != scr->current_workspace)
|
||||
wWorkspaceChange(scr, wApplicationGetLastWorkspace(wapp));
|
||||
|
||||
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
||||
|
||||
@@ -905,26 +1154,26 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
}
|
||||
if (lastDock != NULL && lastDock != theNewDock) {
|
||||
/* Leave lastDock in the state we found it */
|
||||
if (lastDock->type == WM_DRAWER) {
|
||||
if (wDockGetType(lastDock) == WM_DRAWER) {
|
||||
wDrawerFillTheGap(lastDock, aicon, (lastDock == originalDock));
|
||||
}
|
||||
if (collapsed) {
|
||||
lastDock->collapsed = 1;
|
||||
wDockSetCollapsed(lastDock, 1);
|
||||
wDockHideIcons(lastDock);
|
||||
collapsed = False;
|
||||
}
|
||||
if (lastDock->auto_raise_lower) {
|
||||
if (wDockIsAutoRaiseLower(lastDock)) {
|
||||
wDockLower(lastDock);
|
||||
}
|
||||
}
|
||||
if (theNewDock != NULL) {
|
||||
if (lastDock != theNewDock) {
|
||||
collapsed = theNewDock->collapsed;
|
||||
collapsed = wDockIsCollapsed(theNewDock);
|
||||
if (collapsed) {
|
||||
theNewDock->collapsed = 0;
|
||||
wDockSetCollapsed(theNewDock, 0);
|
||||
wDockShowIcons(theNewDock);
|
||||
}
|
||||
if (theNewDock->auto_raise_lower) {
|
||||
if (wDockIsAutoRaiseLower(theNewDock)) {
|
||||
wDockRaise(theNewDock);
|
||||
/* And raise the moving tile above it */
|
||||
wRaiseFrame(aicon->icon->core);
|
||||
@@ -932,8 +1181,8 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
lastDock = theNewDock;
|
||||
}
|
||||
|
||||
shad_x = lastDock->x_pos + ix*wPreferences.icon_size;
|
||||
shad_y = lastDock->y_pos + iy*wPreferences.icon_size;
|
||||
shad_x = wDockGetXPos(lastDock) + ix*wPreferences.icon_size;
|
||||
shad_y = wDockGetYPos(lastDock) + iy*wPreferences.icon_size;
|
||||
|
||||
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
|
||||
|
||||
@@ -977,7 +1226,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
command for that appicon, and the user cancels the
|
||||
wInputDialog asking for one). Make the rejection obvious by
|
||||
sliding the icon to its old position */
|
||||
if (lastDock->type == WM_DRAWER) {
|
||||
if (wDockGetType(lastDock) == WM_DRAWER) {
|
||||
// Also fill the gap left in the drawer
|
||||
wDrawerFillTheGap(lastDock, aicon, False);
|
||||
}
|
||||
@@ -995,25 +1244,25 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
/* Possible scenario: user moved an auto-attracted appicon
|
||||
from the clip to the dock, and cancelled the wInputDialog
|
||||
asking for a command */
|
||||
if (lastDock->type == WM_DRAWER) {
|
||||
if (wDockGetType(lastDock) == WM_DRAWER) {
|
||||
wDrawerFillTheGap(lastDock, aicon, False);
|
||||
}
|
||||
/* If aicon comes from a drawer, make some room to reattach it */
|
||||
if (originalDock->type == WM_DRAWER) {
|
||||
WAppIcon *aiconsToShift[ originalDock->icon_count ];
|
||||
if (wDockGetType(originalDock) == WM_DRAWER) {
|
||||
WAppIcon *aiconsToShift[ wDockGetIconCount(originalDock) ];
|
||||
int j = 0;
|
||||
|
||||
for (i = 0; i < originalDock->max_icons; i++) {
|
||||
WAppIcon *ai = originalDock->icon_array[ i ];
|
||||
for (i = 0; i < wDockGetMaxIcons(originalDock); i++) {
|
||||
WAppIcon *ai = wDockGetIcon(originalDock, i);
|
||||
if (ai && ai != aicon &&
|
||||
abs(ai->xindex) >= abs(aicon->xindex))
|
||||
aiconsToShift[j++] = ai;
|
||||
}
|
||||
if (j != originalDock->icon_count - abs(aicon->xindex) - 1)
|
||||
if (j != wDockGetIconCount(originalDock) - abs(aicon->xindex) - 1)
|
||||
// Trust this never happens?
|
||||
wwarning("Shifting j=%d appicons (instead of %d!) to reinsert aicon at index %d.",
|
||||
j, originalDock->icon_count - abs(aicon->xindex) - 1, aicon->xindex);
|
||||
wSlideAppicons(aiconsToShift, j, originalDock->on_right_side);
|
||||
j, wDockGetIconCount(originalDock) - abs(aicon->xindex) - 1, aicon->xindex);
|
||||
wSlideAppicons(aiconsToShift, j, wDockIsOnRightSide(originalDock));
|
||||
// Trust the appicon is inserted at exactly the same place, so its oldX/oldY are consistent with its "new" location?
|
||||
}
|
||||
|
||||
@@ -1021,11 +1270,11 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
wDockReattachIcon(originalDock, aicon, aicon->xindex, aicon->yindex);
|
||||
}
|
||||
else {
|
||||
if (originalDock->auto_collapse && !originalDock->collapsed) {
|
||||
originalDock->collapsed = 1;
|
||||
if (wDockIsAutoCollapse(originalDock) && !wDockIsCollapsed(originalDock)) {
|
||||
wDockSetCollapsed(originalDock, 1);
|
||||
wDockHideIcons(originalDock);
|
||||
}
|
||||
if (originalDock->auto_raise_lower)
|
||||
if (wDockIsAutoRaiseLower(originalDock))
|
||||
wDockLower(originalDock);
|
||||
}
|
||||
}
|
||||
@@ -1037,7 +1286,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
/* If docked (or tried to dock) to a auto_collapsing dock, unset
|
||||
* collapsed, so that wHandleAppIconMove doesn't collapse it
|
||||
* right away (the timer will take care of it) */
|
||||
if (lastDock->auto_collapse)
|
||||
if (wDockIsAutoCollapse(lastDock))
|
||||
collapsed = 0;
|
||||
}
|
||||
else {
|
||||
@@ -1053,11 +1302,11 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
||||
}
|
||||
}
|
||||
wDockDetach(originalDock, aicon);
|
||||
if (originalDock->auto_collapse && !originalDock->collapsed) {
|
||||
originalDock->collapsed = 1;
|
||||
if (wDockIsAutoCollapse(originalDock) && !wDockIsCollapsed(originalDock)) {
|
||||
wDockSetCollapsed(originalDock, 1);
|
||||
wDockHideIcons(originalDock);
|
||||
}
|
||||
if (originalDock->auto_raise_lower)
|
||||
if (wDockIsAutoRaiseLower(originalDock))
|
||||
wDockLower(originalDock);
|
||||
}
|
||||
}
|
||||
@@ -1147,53 +1396,53 @@ static WAppIcon *findDockIconFor(WDock *dock, Window main_window)
|
||||
static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window main_window)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
wapp->app_icon = NULL;
|
||||
wApplicationSetAppIcon(wapp, NULL);
|
||||
|
||||
if (scr->last_dock)
|
||||
wapp->app_icon = findDockIconFor(scr->last_dock, main_window);
|
||||
wApplicationSetAppIcon(wapp, findDockIconFor(scr->last_dock, main_window));
|
||||
|
||||
/* check main dock if we did not find it in last dock */
|
||||
if (!wapp->app_icon && scr->dock)
|
||||
wapp->app_icon = findDockIconFor(scr->dock, main_window);
|
||||
if (!wApplicationGetAppIcon(wapp) && scr->dock)
|
||||
wApplicationSetAppIcon(wapp, findDockIconFor(scr->dock, main_window));
|
||||
|
||||
/* check clips */
|
||||
if (!wapp->app_icon) {
|
||||
if (!wApplicationGetAppIcon(wapp)) {
|
||||
int i;
|
||||
for (i = 0; i < scr->workspace_count; i++) {
|
||||
WDock *dock = scr->workspaces[i]->clip;
|
||||
|
||||
if (dock)
|
||||
wapp->app_icon = findDockIconFor(dock, main_window);
|
||||
wApplicationSetAppIcon(wapp, findDockIconFor(dock, main_window));
|
||||
|
||||
if (wapp->app_icon)
|
||||
if (wApplicationGetAppIcon(wapp))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally check drawers */
|
||||
if (!wapp->app_icon) {
|
||||
if (!wApplicationGetAppIcon(wapp)) {
|
||||
WDrawerChain *dc;
|
||||
for (dc = scr->drawers; dc != NULL; dc = dc->next) {
|
||||
wapp->app_icon = findDockIconFor(dc->adrawer, main_window);
|
||||
if (wapp->app_icon)
|
||||
wApplicationSetAppIcon(wapp, findDockIconFor(dc->adrawer, main_window));
|
||||
if (wApplicationGetAppIcon(wapp))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If created, then set some flags */
|
||||
if (wapp->app_icon && !WFLAGP(wapp->main_window_desc, no_appicon)) {
|
||||
WWindow *mainw = wapp->main_window_desc;
|
||||
if (wApplicationGetAppIcon(wapp) && !WFLAGP(wApplicationGetMainWindowDesc(wapp), no_appicon)) {
|
||||
WWindow *mainw = wApplicationGetMainWindowDesc(wapp);
|
||||
|
||||
wapp->app_icon->running = 1;
|
||||
wapp->app_icon->icon->owner = mainw;
|
||||
wApplicationGetAppIcon(wapp)->running = 1;
|
||||
wApplicationGetAppIcon(wapp)->icon->owner = mainw;
|
||||
if (mainw->wm_hints && (mainw->wm_hints->flags & IconWindowHint))
|
||||
wapp->app_icon->icon->icon_win = mainw->wm_hints->icon_window;
|
||||
wApplicationGetAppIcon(wapp)->icon->icon_win = mainw->wm_hints->icon_window;
|
||||
|
||||
/* Update the icon images */
|
||||
wIconUpdate(wapp->app_icon->icon);
|
||||
wIconUpdate(wApplicationGetAppIcon(wapp)->icon);
|
||||
|
||||
/* Paint it */
|
||||
wAppIconPaint(wapp->app_icon);
|
||||
wAppIconPaint(wApplicationGetAppIcon(wapp));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+87
-39
@@ -29,46 +29,94 @@
|
||||
#include "icon.h"
|
||||
#include "application.h"
|
||||
|
||||
typedef struct WAppIcon {
|
||||
short xindex;
|
||||
short yindex;
|
||||
struct WAppIcon *next;
|
||||
struct WAppIcon *prev;
|
||||
WIcon *icon;
|
||||
int x_pos, y_pos; /* absolute screen coordinate */
|
||||
char *command; /* command used to launch app */
|
||||
#ifdef USE_DOCK_XDND
|
||||
char *dnd_command; /* command to use when something is */
|
||||
/* dropped on us */
|
||||
#endif
|
||||
char *paste_command; /* command to run when
|
||||
* something is pasted */
|
||||
char *wm_class;
|
||||
char *wm_instance;
|
||||
pid_t pid; /* for apps launched from the dock */
|
||||
Window main_window;
|
||||
struct WDock *dock; /* In which dock is docked. */
|
||||
struct _AppSettingsPanel *panel; /* Settings Panel */
|
||||
unsigned int docked:1;
|
||||
unsigned int omnipresent:1; /* If omnipresent when
|
||||
* docked in clip */
|
||||
unsigned int attracted:1; /* If it was attracted by the clip */
|
||||
unsigned int launching:1;
|
||||
unsigned int running:1; /* application is already running */
|
||||
unsigned int relaunching:1; /* launching 2nd instance */
|
||||
unsigned int forced_dock:1;
|
||||
unsigned int auto_launch:1; /* launch app on startup */
|
||||
unsigned int remote_start:1;
|
||||
unsigned int updated:1;
|
||||
unsigned int editing:1; /* editing docked icon */
|
||||
unsigned int drop_launch:1; /* launching from drop action */
|
||||
unsigned int paste_launch:1; /* launching from paste action */
|
||||
unsigned int destroyed:1; /* appicon was destroyed */
|
||||
unsigned int buggy_app:1; /* do not make dock rely on hints
|
||||
* set by app */
|
||||
unsigned int lock:1; /* do not allow to be destroyed */
|
||||
} WAppIcon;
|
||||
typedef struct WAppIcon WAppIcon;
|
||||
|
||||
/******** Accessors/mutators ********/
|
||||
short wAppIconGetXIndex(WAppIcon *aicon);
|
||||
void wAppIconSetXIndex(WAppIcon *aicon, short x_index);
|
||||
|
||||
short wAppIconGetYIndex(WAppIcon *aicon);
|
||||
void wAppIconSetYIndex(WAppIcon *aicon, short y_index);
|
||||
|
||||
struct WAppIcon *wAppIconGetNext(WAppIcon *aicon);
|
||||
|
||||
struct WAppIcon *wAppIconGetPrev(WAppIcon *aicon);
|
||||
|
||||
int wAppIconGetXPos(WAppIcon *aicon);
|
||||
void wAppIconSetXPos(WAppIcon *aicon, int x_pos);
|
||||
|
||||
int wAppIconGetYPos(WAppIcon *aicon);
|
||||
void wAppIconSetYPos(WAppIcon *aicon, int y_pos);
|
||||
|
||||
WIcon *wAppIconGetIcon(WAppIcon *aicon);
|
||||
|
||||
char *wAppIconGetCommand(WAppIcon *aicon);
|
||||
void wAppIconSetCommand(WAppIcon *aicon, char *command);
|
||||
|
||||
#ifdef USE_DOCK_XDND
|
||||
char *wAppIconGetDnDCommand(WAppIcon *aicon);
|
||||
void wAppIconSetDnDCommand(WAppIcon *aicon, char *command);
|
||||
#endif // USE_DOCK_XDND
|
||||
|
||||
char *wAppIconGetPasteCommand(WAppIcon *aicon);
|
||||
void wAppIconSetPasteCommand(WAppIcon *aicon, char *command);
|
||||
|
||||
char *wAppIconGetWmClass(WAppIcon *aicon);
|
||||
|
||||
char *wAppIconGetWmInstance(WAppIcon *aicon);
|
||||
|
||||
pid_t wAppIconGetPid(WAppIcon *aicon);
|
||||
void wAppIconSetPid(WAppIcon *aicon, pid_t pid);
|
||||
|
||||
Window wAppIconGetMainWindow(WAppIcon *aicon);
|
||||
void wAppIconSetMainWindow(WAppIcon *aicon, Window main_window);
|
||||
|
||||
struct WDock *wAppIconGetDock(WAppIcon *aicon);
|
||||
void wAppIconSetDock(WAppIcon *aicon, struct WDock *dock);
|
||||
|
||||
struct _AppSettingsPanel *wAppIconGetPanel(WAppIcon *aicon);
|
||||
void wAppIconSetPanel(WAppIcon *aicon, struct _AppSettingsPanel *panel);
|
||||
|
||||
int wAppIconIsDocked(WAppIcon *aicon);
|
||||
void wAppIconSetDocked(WAppIcon *aicon, int docked);
|
||||
|
||||
int wAppIconIsOmnipresent(WAppIcon *aicon);
|
||||
void wAppIconSetOmnipresent(WAppIcon *aicon, int omnipresent);
|
||||
|
||||
int wAppIconIsAttracted(WAppIcon *aicon);
|
||||
void wAppIconSetAttracted(WAppIcon *aicon, int attracted);
|
||||
|
||||
int wAppIconIsLaunching(WAppIcon *aicon);
|
||||
void wAppIconSetLaunching(WAppIcon *aicon, int launching);
|
||||
|
||||
int wAppIconIsRunning(WAppIcon *aicon);
|
||||
void wAppIconSetRunning(WAppIcon *aicon, int running);
|
||||
|
||||
int wAppIconIsRelaunching(WAppIcon *aicon);
|
||||
void wAppIconSetRelaunching(WAppIcon *aicon, int relaunching);
|
||||
|
||||
int wAppIconIsForceDocked(WAppIcon *aicon);
|
||||
void wAppIconSetForceDocked(WAppIcon *aicon, int forced_dock);
|
||||
|
||||
int wAppIconIsAutoLaunch(WAppIcon *aicon);
|
||||
void wAppIconSetAutoLaunch(WAppIcon *aicon, int auto_launch);
|
||||
|
||||
int wAppIconIsEditing(WAppIcon *aicon);
|
||||
void wAppIconSetEditing(WAppIcon *aicon, int editing);
|
||||
|
||||
int wAppIconIsDropLaunch(WAppIcon *aicon);
|
||||
void wAppIconSetDropLaunch(WAppIcon *aicon, int drop_launch);
|
||||
|
||||
int wAppIconIsPasteLaunch(WAppIcon *aicon);
|
||||
void wAppIconSetPasteLaunch(WAppIcon *aicon, int paste_launch);
|
||||
|
||||
int wAppIconIsBuggyApp(WAppIcon *aicon);
|
||||
void wAppIconSetBuggyApp(WAppIcon *aicon, int buggy_app);
|
||||
|
||||
int wAppIconIsLocked(WAppIcon *aicon);
|
||||
void wAppIconSetLocked(WAppIcon *aicon, int locked);
|
||||
|
||||
/******** Lifecycle/resource management ********/
|
||||
WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *wm_instance,
|
||||
const char *wm_class, int tile);
|
||||
Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user