1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-29 03:54:06 +02:00

Compare commits

..

854 Commits

Author SHA1 Message Date
David Maciejak 5b631cad93 wmaker: fix EmulateAppIcon index from advanced_option
This patch is fixing the EmulateAppIcon index which should be
moreChk[8], moreChk[7] used until now is for DontSaveSession
attribute.
2026-04-06 23:47:47 +01:00
David Maciejak ee9fd77a56 wmaker: fix crash for windows without WM_HINTS
This patch is adding a guard before calling wm_hints->icon_pixmap.
Crash can be reproduced with decoration-less apps when disabling
"Emulate application icon" attribute.

Ref:

Program terminated with signal SIGSEGV, Segmentation fault.
806 if (!getSize(wwin->wm_hints->icon_pixmap, &w, &h, &d)) {
[Current thread is 1 (Thread 0x7ffff660ed40 (LWP 29297))]
2026-04-06 23:47:47 +01:00
David Maciejak 62e341b5cc wmaker: add test for _NET_WM_FULLSCREEN_MONITORS
This patch is adding a small test app to validate that
_NET_WM_FULLSCREEN_MONITORS is working as expected.
2026-04-05 21:47:05 +01:00
David Maciejak fa49b7c003 WINGs: avoid splitting UTF-8 characters when wrapping text
This patch is to split UTF-8 word by characters and not bytes.
Issue reported at https://github.com/window-maker/wmaker/issues/65
2026-04-04 21:35:36 +01:00
David Maciejak 6dbc6c95ab WINGs: make UTF-8 functions global
This patch is moving the existing UTF-8 functions from wtextfield.c
to WINGsP.h.in to be available to all modules.
2026-04-04 21:35:36 +01:00
David Maciejak 4babc0e422 Doc: fix typos in NEWS and README 2026-04-04 15:41:07 +01:00
David Maciejak 33fba87ed1 wmaker: add directional window focus
This patch is adding directional window focus
(like in openbox), where the focus can be passed to
the current window neighboors with a shortcut key.
Comparisons are performed using window centres.

New options are FocusWindowLeftKey, FocusWindowRightKey,
FocusWindowUpKey, FocusWindowDownKey.
Other WM are setting those to SUPER+LEFT/RIGHT/UP/DOWN keys
but currently those are not set by default.

CirculateRaise option which is described in WPrefs as
'Raise window when switching focus with keyboard' is also
used to raise/not raise windows that are fully covered by
other windows.
2026-04-03 10:35:39 +01:00
David Maciejak a3c02a22bd NEWS: add new feature descriptions 2026-04-03 10:35:39 +01:00
David Maciejak 0d74066aea wmaker: treat _NET_WM_WINDOW_TYPE property as a list
This patch is treating the _NET_WM_WINDOW_TYPE property as an array
of atoms as defined in X11. Currently, we are only getting the first one,
while the client can set multiple window types ordered from most specific
to least specific.
2026-04-02 08:57:25 +01:00
David Maciejak 26a296db23 wmaker: dynamic vim-like window marking feature
This patch is adding vim-like window marking, like in i3.
A window can be dynamically assigned a mark label.
Then a marked window can be pulled or jumped to.
Or the current focused window can be swapped with a marked window.

The mark label appears in the Window List in between the window
title and the workspace name.

Those new options in WindowMaker conf file are used to control
the actions: MarkSetKey, MarkUnsetKey, MarkBringKey, MarkJumpKey
and MarkSwapKey.

Those actions are set to None by default.
2026-04-02 08:57:25 +01:00
David Maciejak ac1fa7fc6d wmaker: fix client repositioning on frame moves
This patch is preventing X server gravity adjustments from offsetting
the client windows esp when the gravity is non standard as seen
in openoffice with xprop: 'window gravity: Static'.
Also fixing _NET_WM_STATE property query request as in X11 it can
contain multiple atoms simultaneously, acting as an array.
2026-03-29 20:05:17 +01:00
David Maciejak 1f03c13f4d wmaker: improve support for RandR
This patch is improving the support for RandR.
It uses version 1.3 released in March 2009.
Most of the support is done in randr.c/randr.h
It is built on top of the mature Xinerama structure
but Xinerama lib is not required.
Like for Xinerama, RandR is now auto enabled if the
library is found at compiled time.

RandR support can be used in 2 modes:
A static mode (which is the default) is to define manually
your setup with external tools like xrandr or arandr,
like for example what Openbox is doing.

A dynamic mode, which is triggered on hotplug events,
like for example what GNOME is doing.
If a new monitor is detected, it will select the best mode
available and add it to the right on the existing monitors.

The mode can be switched with a new option available in WindowMaker
conf file (or via WPrefs expert panel):

HotplugMonitor = NO;
2026-03-28 10:50:23 +00:00
David Maciejak 8e84264036 WPrefs: add hotplug monitor option in expert panel
This patch is adding a new HotplugMonitor option
to automatically (de)activate monitors on randr hotplug events.
It is disabled by default.
2026-03-28 10:50:23 +00:00
David Maciejak 4b4abf4c50 wmaker: update callback function checks
This patch is adding the check for the getString function
that was added in commit be495bedbc.
2026-03-27 23:30:05 +00:00
David Maciejak a631e3060e wmaker: remove apercu struct check artefact
This patch is removing the check for the legacy_minipreview_config struct
which was removed in commit fa8121ee61
Without it we can see the error below when running make check:

Error: structure "legacy_minipreview_config" was not found in ./defaults.c
2026-03-27 23:30:05 +00:00
David Maciejak 6c5c3e6181 wmaker: fix wire frame drawing when snapping
This patch is fixing the wire frame dimension which
was computed wrongly when FrameBorderWidth was set
and the window snapped top half or bottom half.
In such case, drawTransparentFrame was passed the
width and height of the screen while it should have
used an inner frame size (meaning without frame border).
The result bug was that the wire frame width was too large
and the right edge displayed out of the monitor head.
2026-03-27 23:30:05 +00:00
David Maciejak 329f82f6e7 WPrefs: set the PID of the application to the window
This patch is setting the _NET_WM_PID atom for WPrefs
to report its PID.

Before the patch, the PID reported is unset (0)
$ wmctrl -lp|grep 'Window Maker Preferences'
0x00a000b0  0 0      Linux Window Maker Preferences

After the patch, the PID is set (20110 in the example below)
0x00a000b0  0 20110  Linux Window Maker Preference
2026-03-23 20:43:42 +00:00
David Maciejak 60a900be28 wmaker: make sure reloaded saved window position is in visible space
This patch is checking if the session saved window positions fall
in dead space, for example when a monitor no longer exists.
If it's the case the window position is moved to the nearest active
head.
2026-03-22 22:21:00 +00:00
David Maciejak c7c736e283 wmaker: set proper group window class when hint is empty
This patch is a follow up of commit
073235ada4
as it appears there is the same issue with the WMState
configuration file when a session state is saved.

For example, with terminator, the file will contain:
  ...
  Applications = (
    {
      Dock = Dock;
      Maximized = 0x0000;
      Name = terminator.;
      ...

After the patch:
  ...
  Applications = (
    {
      Dock = Dock;
      Maximized = 0x0000;
      Name = terminator.Terminator;
      ...
2026-03-20 10:11:02 +00:00
David Maciejak 752a949492 wmaker: fix window position issues with dockapps
The patch with commit 839061a25a
introduces an issue with dockapps that are creating their main
windows with size 1x1. That new patch is moving the existing
code further below in the wManageWindow function to be able
to check if the window flag is_dockapp is set.
Issue was seen with wmsystemtray and wmmemload.
2026-03-20 10:11:02 +00:00
David Maciejak be495bedbc wmaker: allow the screenshot filename template to be set
This patch is adding a new option ScreenshotFilenameTemplate for users
to change the default strftime format "screenshot_%Y-%m-%d_at_%H:%M:%S".
For example, Teams is not allowing the ':' char in the filename of file
to be shared so I always have to rename the file.
2026-03-20 10:11:02 +00:00
gryf 412b3eace2 Make border opaque.
When composite manager (like picom or xcompmgr) is used together with
Window Maker, some of the windows (i.e. terminator) might have
transparent border. This patch will prevent from such situation.

Closes: https://github.com/window-maker/wmaker/issues/58
2026-03-20 10:11:02 +00:00
David Maciejak 0aeba6064b WPrefs: improve capture_shortcut function
This patch is improving the capture_shortcut function to be able
to capture a sequence of multiple key pressed.
2026-03-14 16:20:49 +00:00
David Maciejak ec115fedf7 wmaker: revamp titlebar language button
This patch is replacing the modelock legacy hardcoded language dropdown
icons with a compact titlebar button based on the current locale.
(it adds also a detection to xkbfile library which is required to get
the short name of the locale).
Now supports up to 4 layouts, clicking on the language button will cycle
through them (XKB officially supports up to four groups).
2026-03-14 16:20:49 +00:00
David Maciejak 29177f94ed wmaker: extend default keybinding for multikeys support and add sticky-chain mode
This patch extends the existing keybindings to support multiple keys and
add an optional "sticky chain" mode that lets a prefix remain active until users press
a cancel key so users can enter the continuation key without re-pressing the prefix.

The idea is to bring Emacs shortcuts keybinding to wmaker.

Normal (existing and enhanced) mode:

Prefix behaves like a one-shot release before the next key if any.
For example: Mod1+h -> hide the active application, that is still working as usual.
But if you want for example to have all your window management keys under the same leader key
you can now do something like that:
"Mod4+w h" which is pressing the Super key with w, releasing them and pressing h.
You can assign that key sequence to an action.

Sticky chain mode:

Pressing a configured prefix enters a short-lived sticky state.
Sticky state expires on timeout or when explicitly canceled (with KeychainCancelKey).
For example, you can define:
"Mod4+a x" -> run xterm
"Mod4+a b f" -> run firefox
"Mod4+a b c" -> run google chrome

In sticky mode, "Mod4+a x x b f", then KeychainCancelKey or KeychainTimeoutDelay, will launch 2 xterm and firefox.

New options for WindowMaker conf file:

KeychainTimeoutDelay: timeout in milliseconds (can be set to 0)
Default: 500
Example: KeychainTimeoutDelay = 500;

KeychainCancelKey: explicit keybinding used to cancel an active sticky chain.
If set to None the feature has no dedicated cancel key and the chain only ends by timeout
or naturally if the keybind pressed is not defined.
Default: None
Example: KeychainCancelKey = Escape;
2026-03-14 16:20:49 +00:00
gryf ae050ceb40 Respect user defined icons.
Currently, when switchpanel is invoked (usually by alt-tab), icons are
taken with the order from higher priority to lower:

* appicon
* user defined icon
* net_icon
* default icon

Using appicon, when no net_icon nor user icon is defined is good,
although it will provide another confusion with user defined icons,
which will be ignored for all apps which provide appicons. With this
patch order of selecting icon for an app is:

* user defined icon
* appicon
* net_icon
* default icon

Note, that even, if there is icon defined for certain application,
usually it need to have "Ignore client supplied icon" checkbox ticked,
especially for the apps like Firefox.
2026-03-13 13:40:37 +00:00
David Maciejak b27b44db72 wmaker: filter inotify events only to expected config files
This patch is checking if the notification wmaker is receiving
from the Defaults directory is coming from a proper expected config file.
Until now, using vim for example to open any of the files,
for example WMRootMenu would reload the configs, even before saving
the file.
You would see in the logs:
warning: Inotify: Reading config files in defaults database.

because vim by default is creating a .swp file in that same directory.
2026-03-05 09:03:58 +00:00
gryf c6f029c946 Make mouse wheel window focus configurable.
With commit e45a3bc07d a behavior change
was introduced that may disrupt the workflow of a user who may
intentionally want to give focus to a window without bringing it to the
front. Using the scroll wheel is less intrusive compared to the left,
right, and especially the middle (in the case of a terminal) mouse
buttons.

This commit introduces the ability to change the behavior by enabling or
disabling the ability to focus a window with mouse wheel in the expert
panel.
2026-02-26 10:04:15 +00:00
David Maciejak 66bf19c1e0 wmaker: add new ModifierKeyShortLabels option
This patch is adding a new ModifierKeyShortLabels option to the
WindowMaker file to let the user specify the modifier key labels
used in the shortcuts like those appearing in the root menu.
For example, to overwrite the default labels, a user can set
the new option value to:

ModifierKeyShortLabels = (
  "\342\207\247",
  "\342\214\203",
  "\342\214\245",
  "\342\207\255",
  "\342\207\263",
  "\342\214\230",
  "\342\207\252",
  "\342\227\206",
  "\342\214\245"
);

Which is using the same symbols as defined in macos.
For example, instead of printing M4+, "\342\214\230"
will print the ⌘ (Command) symbol.
2026-02-25 07:54:55 +00:00
David Maciejak 073235ada4 wmaker: set proper group window class when hint is empty
This patch is setting a proper class hint internally
when the app is not setting any.
That issue can be reproduced with terminator 2.1.3,
where the window itself is setting a proper WM_CLASS

$ xprop|grep WM_CLASS
WM_CLASS(STRING) = "terminator", "Terminator

But the window id # of group leader: 0x1000001
is setting only the instance name not the class name.
$ xprop -id 0x1000001|grep CLASS
WM_CLASS(STRING) = "terminator", ""

The issue is that wmaker is using those 2 string values
for the dock apps and to identify linked launched apps.
Those strings are concatenated and used in WMWindowAttributes.
Without the patch, that entry below is created:

  terminator. = {
    Icon = terminator..xpm;
  };

If wmaker is warm restarted, a new entry appears in WMWindowAttributes:

  terminator. = {
    Icon = terminator..xpm;
  };

  terminator = {
    Icon = terminator..xpm;
  };

and the opened window is not linked anymore to the dock app as the
WM_CLASS is different.
So you can launch the app as many times as you want from the dock,
the dock icon will
always have the 3 dots on the bottom left corner showing no window
apps are linked to it.

In case if the group window is not defining a CLASS but the client window
has one, the patch is setting the group window CLASS to the value of the
client window CLASS, or as a fallback, as seen in PropGetWMClass function,
setting it to "default".

With the patch, in WMWindowAttributes, we have now:
  terminator.Terminator = {
    Icon = terminator.Terminator.xpm;
  };

and a warm restart is not creating another entry.
2026-02-22 09:23:40 +00:00
David Maciejak 1b8eb63376 wmaker: add check in getSize function to prevent X error
This patch is checking if the passed Drawable exists before calling
XGetGeometry on it, as seen when using Steam and trying to change
the attributes of the 'Friends & Chat' popup window, wmaker is
generating such error in the logs:
warning: internal X error: BadDrawable (invalid Pixmap or Window parameter)
	Request code: 14 X_GetGeometry
	Request minor code: 0
	Resource ID: 0x0
	Error serial: 32091
2026-02-22 09:23:40 +00:00
David Maciejak 75a8299d18 wmaker: set the color pixel for TrueColor display
As mentioned in commit 67e2f5e1ca,
for TrueColor display it's not necessary to allocate a color but
it is required to set the pixel property of the XColor.
2026-02-20 08:47:50 +00:00
David Maciejak cc0a652ea8 WPrefs: add mouse wheel action to the expert panel
This patch is adding the mouse wheel action to be performed
on the expert text frame panel.
2026-02-16 17:55:21 +00:00
David Maciejak 80079cd343 WINGs: improve wlist widget
This patch is adding keyboard control to the wlist widget
(up/down/pgup/pgdw/home/end) and typeahead list search.
That component is for example used in the wmaker icon chooser,
and WPrefs keyboard shortcut, font conf panels.
2026-02-16 17:55:21 +00:00
David Maciejak 955c6793a6 WINGs: fix memory leaks and potential buffer over-read in wfont
This patch is fixing memory leaks when pango structures are used
but not freed.
Also according to commit 4f050ebab9,
previous_text string in WMWidthOfString can be not NULL terminated,
the same construct is used in WMDrawString and WMDrawImageString
functions, so to be safe better to also check for the length
of the string.
2026-02-16 01:41:16 +00:00
David Maciejak 189679b49c wmaker: don't exit wmaker if app child process errored
This patch is fixing a possible memory corruption and abnormal exit
of wmaker when a created child process errored.
This had been kind of mentioned at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040643
and I also experienced it with especially Steam.
At first, I also thought it was a crash or a memory corruption,
but gdb or valgrind are not reporting anything.
In fact, Steam is not setting properly some hints and that is bringing
some issues. More patches will be needed to support that app properly.
For example, WM_COMMAND is not set properly and when you are trying to
relaunch the app from the appIcon the child process is generating an error
and the actual code is calling Exit(-1) which is entirely exiting wmaker,
that's why from gdb you can see the message
[Inferior 4 (process 567278) exited normally] and no crash.
2026-02-15 20:38:59 +00:00
David Maciejak e45a3bc07d wmaker: ignore mouse wheel when giving window focus
This patch is fixing a window focus issue by ignoring mouse wheel
up/down buttons. How to reproduce the issue:
open 2 xterm with one window overlapping the other, in 1 xterm list
files with ls to have the scrollbar to appear, click the other xterm
to give focus to its window, now mouse wheel up or down on the other
xterm, at that point the window is focused but under the other xterm.
Try to click left button to get it to appear on top, it will not work
cause the focus is set already on it. With that patch the click to
focus is working.
2026-02-14 16:10:30 +00:00
David Maciejak bc16a03722 WINGs: fix compiler warnings on fontl example
The patch is fixing some compiler warnings about missing
noreturn keyword.
2026-02-14 16:10:30 +00:00
David Maciejak 260415eb42 wmaker: treat empty icon name hint as unset
This patch is treating empty _NET_WM_ICON_NAME as unset,
thus the code is falling back to set the appicon title
to the window title. Case seen with virtualbox where
the _NET_WM_ICON_NAME(UTF8_STRING) is set to empty string.
2026-02-13 09:06:07 +00:00
David Maciejak c8174a4b2e wmaker: add room for the modelock option in winspector
This patch is conditionaly adding some extra room in the window
inspector advanced options frame if modelock is enabled to fit
the extra option. Without it the option text is truncated.
2026-02-11 22:02:05 +00:00
David Maciejak 2901b418ad wmaker: add window app icon to the window list
This patch is adding the app icon in between the flags icon and
the window name from the window list.
Feature request from https://github.com/window-maker/wmaker/issues/19
It is disabled by default, it needs WindowListAppIcons to be
set to YES manually in the conf file or "Show app icons in window list."
enabled from WPrefs expert panel.
2026-02-10 09:35:23 +00:00
David Maciejak ae6b03e50f wmiv: fix default window size
Set default windows size to 10x10 as 1x1 is unmanaged since
commit 839061a25a.
2026-02-09 09:23:07 +00:00
David Maciejak 128ba2ddc7 wmaker: use appicon icons in the switchpanel when existing
This patch is making sure the icons shown in the switchpanel
are also those used for the appicon. For example, for xterm
the icon used in the switchpanel is the default app and not the
icon provided by xterm app.
Seems that issue is also present in vanilla wmaker 0.96.
2026-02-09 09:23:07 +00:00
David Maciejak 7ca96b9ed6 wmaker: fix titlebar glitch issues with modelock
This patch is fixing 2 issues with the modelock language pixmap
located in the titlebar.

If wmaker is compiled with modelock support but modelock is disabled
from the expert preferences, dialog windows like run command or exit
will not show the language pixmap but will show empty frame borders.

When modelock is enabled from the expert preferences, it needs a
warm restart for the titlebars to be updated with the language pixmap.
If afterwards, modelock is disabled from the expert preferences,
any old windows that is gettting focus will be repainted and the language
pixmap will be destroyed but the empty frame borders will still be
present. Now to fully disable modelock for existing opened windows,
wmaker needs a warm restart.
2026-02-09 09:23:07 +00:00
David Maciejak 839061a25a wmaker: fix window position issues
This patch is fixing some initial window position issues
as seen for example with virtualbox.
Now wmaker is not trying to manage the 1x1 app internal windows
which was resulting on some position issues (stacking the window
app on the left side).
It also fixes some window jitters issues when the app is trying
to negotiate some tiny position adjustments.
Related to bug at https://github.com/window-maker/wmaker/issues/26
2026-02-07 20:39:24 +00:00
David Maciejak 1e63c590b6 wmaker: factorize duplicated code
This patch is factorizing is_same and getBool functions in misc.
is_same is renamed to WMStrEqual
getBool is renamed to WMPLGetBool
to prevent name collision issues.
2026-02-07 20:37:46 +00:00
David Maciejak 92e1e9fb0b WPrefs: fix some truncated texts
This patch is fixing some text truncation in the ergonomic and
hot corner preference tabs.
2026-02-07 13:33:40 +00:00
David Maciejak ddf0b20367 wmaker: refactor get_corner()
This patch refactors get_corner() for better readability
and performance.
2026-02-07 13:33:40 +00:00
David Maciejak d303317a31 wmaker: handle keybinding change notifications
This patch is to fix an issue seen on FreeBSD 15 where
keybinding are mixed up at the cold start of wmaker.
It is mentioned at https://github.com/window-maker/wmaker/issues/43
Seems that issue is not happening on Linux.
A warm restart ("restart window maker") from the root menu
is getting rid of that issue temporarily.

To solve that issue, now wmaker is reloading the keyboard mapping
via the new wReadKeybindings function when a XkbNewKeyboardNotifyMask
event is received.
It means xkb, which is part of X11 core,
is now used by default and not conditionally with modelock.
I tried to delay reading the keybinding as late as possible but
it did not solve the issue as seems X is started with a improper
keyboard by default.

Here some debug trace when the bindings are loaded by wmaker on FreeBSD:

Keybind F12: keycode=96 modifier=0x0   <--- cold starting wmaker
Keybind F11: keycode=95 modifier=0x0
Keybind Escape: keycode=9 modifier=0x4
Keybind M: keycode=58 modifier=0x8
Keybind H: keycode=43 modifier=0x8
Keybind Up: keycode=98 modifier=0x8   <--- keycode is wrong, provided by X11
Keybind Down: keycode=104 modifier=0x8
Keybind Tab: keycode=23 modifier=0x8
Keybind Tab: keycode=23 modifier=0x9
Keybind Right: keycode=102 modifier=0xc
Keybind Left: keycode=100 modifier=0xc
Keybind 1: keycode=10 modifier=0x8
Keybind 2: keycode=11 modifier=0x8
Keybind 3: keycode=12 modifier=0x8
Keybind 4: keycode=13 modifier=0x8
Keybind 5: keycode=14 modifier=0x8
Keybind 6: keycode=15 modifier=0x8
Keybind 7: keycode=16 modifier=0x8
Keybind 8: keycode=17 modifier=0x8
Keybind 9: keycode=18 modifier=0x8
Keybind 0: keycode=19 modifier=0x8
Keybind Print: keycode=111 modifier=0x0   <--- keycode is wrong, 111 is UP key

/usr/ports/x11-wm/windowmaker/work/WindowMaker-0.96.0/src/.libs/wmaker(execInitScript(main.c:531)):
error: /root/GNUstep/Library/WindowMaker/autostart:could not execute initialization script   <--- warm restart from wmaker
Keybind F12: keycode=96 modifier=0x0
Keybind F11: keycode=95 modifier=0x0
Keybind Escape: keycode=9 modifier=0x4
Keybind M: keycode=58 modifier=0x8
Keybind H: keycode=43 modifier=0x8
Keybind Up: keycode=111 modifier=0x8   <--- UP key keycode is correct
Keybind Down: keycode=116 modifier=0x8
Keybind Tab: keycode=23 modifier=0x8
Keybind Tab: keycode=23 modifier=0x9
Keybind Right: keycode=114 modifier=0xc
Keybind Left: keycode=113 modifier=0xc
Keybind 1: keycode=10 modifier=0x8
Keybind 2: keycode=11 modifier=0x8
Keybind 3: keycode=12 modifier=0x8
Keybind 4: keycode=13 modifier=0x8
Keybind 5: keycode=14 modifier=0x8
Keybind 6: keycode=15 modifier=0x8
Keybind 7: keycode=16 modifier=0x8
Keybind 8: keycode=17 modifier=0x8
Keybind 9: keycode=18 modifier=0x8
Keybind 0: keycode=19 modifier=0x8
Keybind Print: keycode=107 modifier=0x0   <--- Print keycode is correct

Alternatively, to mitigate the issue, .xinitrc can be set to:

setxkbmap -layout us
exec wmaker

or whatever layout you are using.
2026-02-07 13:33:40 +00:00
David Maciejak c620b354b5 wmaker: fix some truncated texts in the info panel
This patch is fixing some text truncation especially
for displaying the total memory allocated in debug mode
and the image formats (when the JXL support is enabled).
2026-02-07 13:33:40 +00:00
David Maciejak ebac2bbcd8 wmaker: fix compiler warning in properties.c
This patch is fixing a compiler warning for the implicit
conversion of int to char changes value from 255 to -1
when at the line *ptr++ = 255 the code is trying to store
the value 255 into a char.
2026-02-07 13:33:40 +00:00
David Maciejak 3281349f8d WINGs: remove unnecessary warning in wtextfield
Since commit 77db6dc649
("WINGs: fix right and center aligned wtextfield"),
right and center alignments are working in wtextfield.
2026-02-07 13:32:27 +00:00
David Maciejak 3f5280987e WINGs: refactor wlist
This patch refactors wlist to bring some improvements
to not count the list of entries at each loop iteration.
2026-02-07 13:31:28 +00:00
David Maciejak 6d0953bc22 wmaker: add support for _NET_WM_MOVERESIZE
This patch adds support for _NET_WM_MOVERESIZE hint as defined in EWMH
which allows a window without decorations to manage itself (moving/resizing).
The purpose is to fix the issue mentioned at https://github.com/window-maker/wmaker/issues/20

Tested with VS Code, Google Chrome, Steam and Discord.

Specs are available at https://specifications.freedesktop.org/wm/1.5/ar01s04.html#id-1.5.4
2026-02-03 18:05:20 +00:00
David Maciejak ef1a504898 wrlib: alpha combine speed improvement
This patch is improving the alpha combine function by using int
instead of float. That function is used for example in the
switch panel to merge the transparency mask.
The change is practically indistinguishable to the human eye
for a single-pass blend but the performance gained is huge.

I've been doing some benchmark of wrlib and even implemented AVX2 support.
But the gain compared to the complexity of AVX2 is not worth,
while having int usage in that specific function is a really good trade-off.

Here the result:

Alpha Blending Performance Test
Image size: 1024x768 (786432 pixels)
Iterations: 100

AVX2 support: YES

=== RGBA Source Test ===
Original (float):     2.540 ms/frame  (393.8 FPS)
Optimized (int):      1.983 ms/frame  (504.2 FPS)  [1.3x speedup]
AVX2 optimized:       1.843 ms/frame  (542.6 FPS)  [1.4x speedup]

By using int, the alpha blending in that use case is 28% faster.
2026-01-27 10:56:30 +00:00
David Maciejak 474b23344a wrlib: change default scaling interpolation to Catmull-Rom
This patch is implementing a new default Catmull-Rom filter
to resize images.
Catmull-Rom is a special case of cubic interpolation with B=0 and
C=0.5 (in the Mitchell-Netravali formulation).
It provides slighlty sharper results than Mitchell with the same
performance.
Catmull-Rom is a better choice for a window manager as it prioritizes
sharpness, making small elements feel crisp.
2026-01-27 10:53:34 +00:00
David Maciejak 77db6dc649 WINGs: fix right and center aligned wtextfield
This patch is fixing some issues in how right and center aligned
wtextfields are handled.
-text selection with mouse was not working properly especially
setting and identifying the cursor position
-middle button paste was only working for left aligned text
2026-01-27 10:52:04 +00:00
David Maciejak b09ac30233 WINGs: add case to wtextfield test
This patch adds a wtextfield center aligned to the unit test.
2026-01-27 10:50:58 +00:00
David Maciejak 6e14b6142b wmaker: fix _NET_WM_NAME window manager's name
xterm is not working properly (it's not advertising its internal icon)
if the window manager's name contains a space, seems to be specific
to xterm as xeyes and xpaint are working fine.
2026-01-27 10:47:58 +00:00
David Maciejak 7778df2fc5 wmaker: add keyboard control to crash window
This patch is allowing to control the wpopupbutton entries
via keyboard up/down arrows.
It happens to me a few weeks ago during development,
wmaker crashed and I lost the mouse control.
I was stuck on that dialog box without a way to select another entry.
2026-01-25 01:28:53 +00:00
David Maciejak 156841f80e WINGs: wpopupbutton add two functions to change the displayed item
This patch is adding WMSelectPopUpButtonPreviousItem and
WMSelectPopUpButtonNextItem functions to the widget.
The WINGs lib version is bumped.
2026-01-25 01:28:53 +00:00
David Maciejak c82e6dad5c wmaker: set the window manager's information
According to EWMH specification, the active window manager is supposed
to set some information. Those can be gathered for example with
'wmctrl -m'.

Before the patch:
$ wmctrl -m
Name: N/A
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF

After the patch:
$ wmctrl -m
Name: Window Maker 0.96.0
Class: wmaker
PID: 6866
Window manager's "showing the desktop" mode: OFF
2026-01-24 14:24:03 +00:00
David Maciejak 95c68fe26d configure: add optional --enable-native option to compilation flags
This patch adds an option to enable native CPU optimizations
by adding -march=native to the compiler flags, tuning the
generated code for the build machine at the expense of portability.

In some tests, especially on wrlib I saw 8% perf improvement.
Should be used by developers or those who recompile wmaker for their own usage.
2026-01-24 14:24:03 +00:00
David Maciejak 77c3b95fd5 Doc: fix wmiv man page
Sort out the argument order or else 'make check' will complain.
2026-01-24 00:52:25 +00:00
David Maciejak b662d0827c WINGs: wfont fallback to default font when font is not found
This patch is fixing the issue reported
at https://github.com/window-maker/wmaker/issues/62
where wmaker is crashing if the font specified in WMGLOBAL is not found.
Now by default it will failsafe to DEFAULT_FONT.
2026-01-22 22:46:10 +00:00
David Maciejak a542934e67 WINGs: fix cursor ghosting issue in wtextfield
The cursor is moved using right/left arrows but as it's blinking
and a XOR function is used to hide/unhide it, it happens the cursor
can be not hidden properly from its previous position.
Better to refresh the view to avoid such issues.
2026-01-22 22:46:10 +00:00
David Maciejak d2b2c3238b WINGs: fix cursor position in wtextfield
In case the cursor is positioned out of the textfield view
after a delete and more chars are entered, wmaker process
will reach 100% and become unresponsive.

How to reproduce:
in the run command window enter an overly long text (longer than
the current input field view). Then, press home to go back to the
beginning of the string. Then, shift-End to select all the text,
then del to delete all the text. At that point the cursor is still
out of the view and if you enter more text wmaker process will be stuck.
2026-01-22 22:46:10 +00:00
David Maciejak d37a3162e0 WINGs: fix TARGETS request return type
According to the ICCCM, a reply to a TARGETS request must be a list of atoms.
Took the chance to also fix variable naming consistency between wtext and
wtextfield which are using the same kind of code.
2026-01-22 22:46:10 +00:00
David Maciejak 9ddacfc29b Fix typos and some appicon consistency in the FAQ 2026-01-18 14:54:28 +00:00
David Maciejak 7e21785710 wmiv: add support for archive files and a new option to ignore unknown image format
This patch adds optional support for compressed files and a new --ignore-unknown option
to ignore unknown image format. It also adds local filename drag-and-drop support.
And a copy current image to clipboard feature with ctrl+c shortcut.

It also fixes:
- fullscreen issue on multi monitors setup by using randr
- app icon advertised via _NET_WM_ICON
- fix UTF-8 filename usage in window title
2026-01-17 22:03:09 +00:00
David Maciejak 7cfdf6bd68 WRaster: add function to save image in memory
This patch adds the RSaveRawImage() function to the WRaster lib
to be able to save image structure in memory.
The WRaster lib version is bumped.
2026-01-17 22:03:09 +00:00
David Maciejak 72942267aa Prevent wrong UTF-8 window title truncation
The patch is fixing a UTF-8 truncation issue that could happen with the window title
when it was shrinked to be displayed in the window list (F11), leading to
an infinite loop.

Issue was reported at https://github.com/window-maker/wmaker/issues/61
2026-01-15 15:56:20 +00:00
Balló György ac19c4bc07 Don't set X-GDM-SessionRegisters to true
Window Maker does not call the RegisterSession() method on GDM's D-Bus
interface, causing that GDM doesn't know that the login was successful,
which leads to problems. If X-GDM-SessionRegisters is not specified or
false, GDM registers the session itself.

I noticed this when I logged out from Window Maker, and tried to log
in into another session with GDM, it doesn't work, because the login
screen hangs as the previous session was not entered into registered
state within GDM.

If X-GDM-SessionRegisters=true is specified, GDM expects that the
session will be registered via D-Bus:
https://gitlab.gnome.org/GNOME/gdm/-/commit/1c061b84ffc3e874da825982d18d970556ff74bb

E.g. GNOME Shell calls RegisterSession() method after login:
https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/0e37cd2ec92c5fbbc0870272e5e00fc07a705eba

Older versions behave the same way as would be X-GDM-SessionRegisters
not set or false.

Currently X-GDM-SessionRegisters=true is used only by GNOME Shell. All
other sessions omit this property, because they don't call the
RegisterSession() method on GDM's D-Bus interface after login.
2026-01-13 13:11:21 +00:00
David Maciejak 14bd13b1be Doc: fix spelling errors 2026-01-04 14:57:50 +00:00
David Maciejak afe13d3e72 New expert option: cycle all windows from all workspaces
Mentioned on the WMaker user mailing list, option disabled by default.

https://groups.google.com/g/wmaker-user/c/pR8P-ZYCDFo/m/Wo42U_xqBgAJ

So basically the patch is adding a new expert option in WPrefs (disabled by
default) to allow the switch panel to cycle over all the windows from all
workspaces. I believe it's useful if you are using a lot of fullscreen apps
each on different workspaces.
2026-01-03 19:23:34 +00:00
Carlos R. Mafra e356ef8c05 Revert "Prevent unnecessary RandR wmaker restart"
This reverts commit 3579c85af1.

As pointed out by David Maciejak himself, this patch triggers
an odd behavior:

 "Now I cannot do a rectangular selection on the desktop with the left
 click of the mouse like I used to do.
 Seems the XRRQueryVersion call to get randr version is messing up with the
 X events. I tried to move up the call in src/startup.c and src/main.c
 instead to the point where the bug cannot be reproduced if I am putting the
 XRRQueryVersion code just before the call to wDefaultsInitDomain
 "WMWindowAttributes" (in src/startup.c) which is really weird."
2025-12-30 20:25:46 +00:00
David Maciejak 3d993a7323 Fix UTF-8 usage in icon title
When pango is enabled and a window title contains UTF-8 chars,
there is a chance the miniaturized icon title will cut in 2 an UTF-8 char
leading to a glitch in the title.
2025-12-29 16:10:24 +00:00
David Maciejak a4a6e65ca9 Fix for ignore client supplied icon attributes
As mentioned on the WMaker user mailing list some time ago
https://groups.google.com/g/wmaker-user/c/95M_pb_Qlbs/m/6qJLJSqoAwAJ
The Ignore client supplied icon from the windows attributes is not working.
That's especially visible with firefox and thunderbird when they are using
NET_WM_ICON to push the embedded icon.
That patch is making sure to ignore the embedded icon if the user defined one.
2025-12-29 16:10:24 +00:00
David Maciejak 4392fdc291 WRaster: Add optional support to JPEG XL
Detect if libjxl is intalled, and build-in support in raster lib.
Feature can be disabled/enabled at configure time.
2025-12-27 19:48:37 +00:00
David Maciejak 67e2f5e1ca Prevent XAllocColor() call on TrueColor display
As reported in bug https://github.com/window-maker/wmaker/issues/50
X11 XAllocColor() call from wGetColorForColormap() in src/resources.c is returning some errors
especially seen when running GZDoom.

TrueColor display has been the dominant standard for well over a decade, meaning almost all modern X servers default to a TrueColor visual.
The default colormap is predefined and read-only, making allocation with XAllocColor() unnecessary (and meaning no need to free it too).
The patch is checking the display visual, and in case the display is truecolor, it does not allocate or free the color, just looking up for it.
Once the patch applied, GZDoom is not reporting warnings anymore.
2025-12-25 23:22:57 +00:00
David Maciejak 3579c85af1 Prevent unnecessary RandR wmaker restart
As reported in bug https://github.com/window-maker/wmaker/issues/34
when RandR is enabled, everytime a monitor is turned on or off wmaker is restarting
(that happens either manually or automatically with DPMS).
This behavior causes issues with xscreensaver.

How to reproduce the issue:
-install xscreensaver and lock the screen
-turn off then on the monitor manually
-you can see that wmaker was restarted and behind the xscreensaver lock window,
the desktop appears, potentially leaking information

Instead of using the RandR event RRScreenChangeNotifyMask which is too generic,
the patch is using RRCrtcChangeNotifyMask defined since RandR 1.2 (released in 2007).
In the recent RandR version, events for output (hardware) changes are propagated via
RROutputChangeNotifyMask while layout changes (like position, size, rotation)
are propagated via RRCrtcChangeNotifyMask.

The patch is purposedly not listening for RROutputChangeNotifyMask,
thus wmaker is not restarting on DPMS events anymore.

Currently, in case a new monitor is added (or removed) wmaker is not discovering it anyway
even after an automatic restart.
Either, wmaker has to be exited and restarted fully or an external tool like arandr
has to be used to configure the new monitor. So after the patch functionality remains unchanged.
2025-12-24 12:37:12 +00:00
David Maciejak 896bbce2e5 Remove default print key grabbing 2025-12-21 21:23:30 +00:00
David Maciejak 8f1ee27595 Remove duplicated code 2025-12-21 21:23:13 +00:00
Страхиња Радић 541947e9ef Update translator's email for Serbian
This patch updates my email throughout the source.

Signed-off-by: Страхиња Радић <sr@strahinja.org>
2025-10-27 20:47:25 +00:00
Страхиња Радић 7bb7d0f4d6 m4/wm_i18n.m4: Make compatible with POSIX sed
Currently, it seems like the script m4/wm_i18n.m4 is passing some editing
commands to sed(1), which are not strictly conforming to POSIX[1]. Namely, the
"grouping" command:

	{ command; command }

needs to have either a semicolon or a newline before the closing brace:

	{ command; command; }

or

	{ command; command
	}

according to POSIX.

On systems which don't use the lax GNU sed by default (like OpenBSD), the
current configuration and compilation goes like this:

$ autoreconf -vif

	...
	sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
	sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
	... (etc)

$ ./configure --without-menu-textdomain CATALOGS=sr.mo LINGUAS=sr \
	LIBS=-lintl MSGFMT=msgfmt --mandir=/usr/local/man

	...

	Translated languages to support     :

	configure: WARNING: No language from $LINGUAS are supported

$ gmake && doas gmake install
	... (no .mo files are generated nor installed)

and so on, since the editing commands in question are affecting the processing
of .po files.

This patch proposes inserting semicolons before the closing brace in the
mentioned editing commands passed to sed(1).

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html#tag_20_109_13_03

Signed-off-by: Страхиња Радић <sr@strahinja.org>
2025-10-27 20:47:25 +00:00
Doug Torrance da676c9e9e Add WPrefs Serbian translation to EXTRA_DIST
Otherwise "make check" fails (script/check-translation-sources.sh).
2024-11-12 10:15:17 +00:00
Doug Torrance 4edf589a5b Remove cruft from autogen.sh 2024-11-12 10:15:17 +00:00
Doug Torrance 709eec4bce Update autogen.sh so that it can be run from build directory 2024-11-12 10:15:17 +00:00
Jeremy Sowden b179803c11 Fix spelling errors
* "unknow" -> "unknown"
* "occured" -> "occurred"

Remove some entries from PO files where these entries contain spelling errors
and there are other entries that are identical except for these mistakes.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden 5cd40deb20 Add missing Language: headers to PO files
msgfmt complains.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden 9db1ea580d Ignore wrlib gettext artefacts
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden 9e56f58742 Remove obsolete autoconf macro
`AC_PROG_GCC_TRADITIONAL` is obsolete and is now just an alias for `AC_PROG_CC`,
which is already defined.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Страхиња Радић 4b946f69e2 Update Serbian translation from master branch
Signed-off-by: Страхиња Радић <contact@strahinja.org>
2023-11-02 21:03:07 +00:00
Страхиња Радић d55be193b8 Edit leftover automake files and READMEs for Serbian localization
This patch adds sr.po files to Makefile.am files throughout the repository
where needed. It also adds credits for Serbian localization in README files as
needed.

Signed-off-by: Страхиња Радић <contact@strahinja.org>
2023-11-02 19:28:30 +00:00
Strahinya e5b227fe8d Add Serbian localization
This patch adds Serbian localization to Window Maker.

Signed-off-by: Страхиња Радић <contact@strahinja.org>
2023-11-01 19:36:20 +00:00
Страхиња Радић d947095881 util/wmgenmenu.c(main): Close parentheses around vgradient
Currently, menu definitions created by wmgenmenu don't include the closing
parenthesis in vgradient constructs. This patch adds the missing closing
parentheses.

Signed-off-by: Страхиња Радић <contact@strahinja.org>
2023-11-01 13:25:52 +00:00
Carlos R. Mafra 93b049356f Revert "WUtil: Be more strict about base directory for wmkdirhier()"
This reverts commit a0b283a60f,
as it breaks saving the history in ~GNUstep/.AppInfo/WindowMaker/History
by restricting modifications to either ~GNUstep/Defaults or ~GNUstep/Library.

Thanks to Paul Selig for reporting this issue.
2023-08-21 22:22:32 +01:00
Carlos R. Mafra 75f353bef4 Update .gitignore
Since

fc63d72032 (WINGs: Fix incorrect use of macro USE_PANGO in installed header)

and

0e274dc979 (WRaster: Fix incorrect use of macro USE_XSHM in installed header)

the files wrlib/wraster.h and WINGs/WINGs/WINGsP.h are generated by the compilation,
so add them to .gitignore
2023-08-21 21:35:30 +01:00
Christophe CURIS 2264ed9de6 Fix calculation of version number in the library mapfiles
As reported by Andreas Metzler, the latest API change in lib WRaster caused
a compatibility issue because the internal version number was increased.

To correctly handle this situation, this patch does 2 things:
 - do not discard the 2 last number in the "c:r:a" version, because we need them;
 - when calculating the version for the mapfile, use the formula that is
suggested in libtool's documentation.

The purpose of the formula is that when API is changed, if a new function
is added then the version is not incremented to reflect that we are still
compatible with current binaries, it will be incremented only when there
is a break in compatibility.
2023-08-12 21:53:52 +01:00
Carlos R. Mafra d0aa2cefcd Window Maker 0.96.0 2023-08-05 08:46:23 +01:00
David Maciejak a52d13c8b8 Fix autoconf obsolete macros
autogen.sh is reporting some warnings as below

./autogen.sh 2>&1 |grep "obsolete"
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:115: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:115: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:134: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:134: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:135: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:135: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:373: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:373: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:458: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:681: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:807: warning: The macro `AC_TRY_LINK' is obsolete.

As the minimum autoconf version required is v2.69,
we need to make sure to update obsolete macros as described at
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2023-04-14 23:45:00 +01:00
David Maciejak 215b6ee2e6 Set proper motif wm hints name
Just a cosmetic change as the variable is currently not in use.
According to the Motif Toolkit API and MwmUtil.h, the last long
variable from the Motif WM Hints struct is currenlty used
for the status.
2023-04-09 10:42:52 +01:00
David Maciejak ab45c6c6c2 Add central position feature for active window
This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
2023-03-31 09:11:38 +01:00
David Maciejak 3344f2b040 NEWS: Hot corners feature description
Add an entry in the NEWS to describe the Hot Corners feature.
2023-03-26 10:35:33 +01:00
David Maciejak ecef2b2890 WPrefs: Hot corner preferences
Add a new "Hot Corner Shortcut Preferences" section to WPrefs
to configure the Hot Corners feature.
2023-03-26 10:35:33 +01:00
David Maciejak 802cbc0d75 Hot corners feature core
Add mouse pointer position detection to trigger the corner actions.

Screen corners can be assigned an external command to be
executed when the mouse pointer is entering those areas.

In WPrefs, "Hot Corner Shortcut Preferences" can be used
for configuration or by manually adding a "HotCorners" key
and value to "YES" in the ~/GNUstep/Defaults/WindowMaker file.

Actions are specified by the "HotCornerActions" and are defined
as a four entries list ("top left action", "top right action",
"bottom left action", "bottom right action").
A screen corner area is a cube shape defined by the "HotCornerEdge"
which is a number of pixels from 2 (by default) to 10.

To lower the risk of triggering that feature accidentally a
"HotCornerDelay" key can be used which is the time before the action
is triggered while the pointer is in one of the screen corner.
Default value is 250 ms.

Hot Corners feature is disabled by default.
2023-03-26 10:35:33 +01:00
David Maciejak 157d1ba85f Fix internal function name typo
The patch is to fix a typo in the fct name movePionterToWindowCenter
2023-03-23 12:57:58 +00:00
David Maciejak 91e7f37074 WPrefs: fix keyboard shortcut sorting order
That patch is fixing some Actions entries that are not sorted properly.
One is using some upper/lower cases.
And the other one, is displaying numbers while alphabetic sorting is not
working properly on numbers. For example:
Shortcut for window 1
Shortcut for window 10
Shortcut for window 2
...
2023-03-21 15:20:19 +00:00
David Maciejak 18a539b372 Add some more cases to handle window unusual size request
As discussed on the ML, the test to check for CARD16 limit is probably innacurate.
Check instead for maxH and maxW which are set by default to twice the size
of the screen or to the max values passed by the window normal hints property.
2023-03-16 15:02:18 +00:00
David Maciejak eae9200c5d Fix ICCM ConfigureNotify request
According to ICCM specs at [1]

*Not changing the size, location, border width, or stacking order of the window at all.
A client will receive a synthetic ConfigureNotify event that describes the (unchanged)
geometry of the window. The (x,y) coordinates will be in the root coordinate system,
adjusted for the border width the client requested, irrespective of any reparenting
that has taken place. The border_width will be the border width the client requested.
The client will not receive a real ConfigureNotify event because no change has actually
taken place.

*Moving or restacking the window without resizing it or changing its border width.
A client will receive a synthetic ConfigureNotify event following the change that
describes the new geometry of the window. The event's (x,y) coordinates will be in
the root coordinate system adjusted for the border width the client requested.
The border_width will be the border width the client requested. The client may not
receive a real ConfigureNotify event that describes this change because the window
manager may have reparented the top-level window. If the client does receive a
real event, the synthetic event will follow the real one.

*Resizing the window or changing its border width
(regardless of whether the window was also moved or restacked).
A client that has selected for StructureNotify events will receive a real
ConfigureNotify event.
Note that the coordinates in this event are relative to the parent,
which may not be the root if the window has been reparented. The coordinates will
reflect the actual border width of the window (which the window manager may have
changed). The TranslateCoordinates request can be used to convert the coordinates
if required.

In Window Maker, the first case is not implemented: doing a synthetic ConfigureNotify
to notify no changes were done. That's creating some issues with app like Citrix icaclient
when sometime windows are blank and need to be moved to be refreshed.

[1]https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#configuring_the_window
2023-03-16 15:02:18 +00:00
David Maciejak 25cb9d208a Update window.c copyright
Just updating the copyright line in the file header.
2023-03-16 15:02:18 +00:00
David Maciejak 23471b2e21 WPrefs: update maximization feature descriptions
Align the old maximization descriptions to the new visual indicator
names. The internal shortcut names had also been updated, meaning a
reconfiguration of the shortcuts in WPrefs is required.
2023-03-16 11:36:02 +00:00
David Maciejak 258ffc8b97 Window menu: add maximization visual indicators
Add visual indicators for the maximization options in the window menu.
2023-03-14 12:27:16 +00:00
David Maciejak 86b7ec1a58 Restore proper drawer direction when screen was resized
Since 48d4820dee the dock is positioned
dynamically based on the screen midpoint.
The side issue using such method is if in case the screen was temporarily
resized the dock as a chance to be displayed on the other side making
the drawer saved configuration from WMState esp the direction wrong when
wm is started again.
For example, the dock and drawer are displayed on the right of the screen.
Then the screen resolution is downsized temporaily to half or less of
the previous size. The position stored in WMState will be updated and the
direction of the drawer is still opening on the left.
But on next wm start, when reading the conf.
The position of the dock and drawer are corresponding to the
middle or less of the unresized screen. The dock and drawer will be sticked
on the left. But the drawer direction was not updated and still opening
on the left (which is out of the screen).
2023-03-14 12:27:16 +00:00
Doug Torrance 9831e3f72a Move declarations to beginning of switch statements
Several variable declarations were recently added immediately after
labels, but this causes compile errors in GCC versions prior to 11,
e.g.,

    wsmap.c: In function ‘handle_event’:
    wsmap.c:534:4: error: a label can only be part of a statement and a declaration is not a statement
      534 |    WMScreen *wmscr = wsmap->scr->wmscreen;
          |    ^~~~~~~~

We move these declarations to the top of the corresponding switch
statements so that Window Maker can compile on these older versions of
GCC.
2023-03-13 15:33:21 +00:00
David Maciejak 0a55facac0 wmiv: align version with wm
Use wm version for the wmiv util.
2023-03-13 15:32:19 +00:00
David Maciejak 0ecf7d3540 KeepDockOnPrimaryHead: fix drawer direction
When that option is on, swapping drawer does not always mean
swapping drawer direction. For example if drawer is on the left
side of the second head and moving to the left side of the first head,
the direction should be the same.
2023-03-13 15:32:19 +00:00
David Maciejak 4576b5bf1e Info Panel: display proper number of colors in deepcolor env
Instead of displaying a number of unitary colors in 10bit env,
display a more human readable message.
2023-03-13 15:32:19 +00:00
David Maciejak 0526ddfc54 WINGs: Make the Extras examples to compile
There is a table view example which is not compiling cause
of a missing lib, also fixed some warnings.
2023-03-12 09:44:10 +00:00
David Maciejak 4c52232ee7 Window titlebar double click to unmaximize
Commit 6e2075f3df from 2020 added
a feature to maximize window when double clicking on the titlebar.
But unmaximizing is not supported so when double clicking again
on the window titlebar the window geometry was not reverted back.
2023-03-12 09:44:10 +00:00
David Maciejak 43edd37ee2 Update file headers year copyright
Update copyright year for Window Maker Team entries.
2023-03-12 09:44:10 +00:00
David Maciejak e95aea2e30 Workspace pager: display ? on non visited mini workspace
When the workspace pager is displayed it's showing grey mini workspaces
for non rendered/non visited workspaces. That patch is adding an exclamation
mark in the middle of the dummy grey background mini workspaces.
2023-03-11 11:38:25 +00:00
David Maciejak 038a3588d6 WINGs: W_KeycodeToKeysym remove unnecessary if test
min_kc value is always -1 at that point in the code, so need to test it
as it's always true.
2023-03-09 15:05:58 +00:00
David Maciejak 0b2fd6a8c8 WINGs: handle fixed size windows
According to the EWMH specs, windows can indicate that they are
non-resizable by setting minheight = maxheight and minwidth = maxwidth
in the ICCCM WM_NORMAL_HINTS property. That should be for example
the case for WPrefs app which is not resizable.
Window Maker currently is overwriting that flag in src/window.c for
apps that are exposing GNUstepHints instead.
This patch is making sure the apps created with WINGs is removing
the WMResizableWindowMask to hide the resizebar.
2023-03-09 15:05:58 +00:00
David Maciejak 3e991badf7 SwitchPanel: fix app icons opacity combination
For some apps the background is not displayed properly, showing
some kind of shawow around the app icon like for example firefox
or skype. This is due to an issue in combining alpha channels.
2023-03-09 15:05:58 +00:00
David Maciejak ac6d284269 NEWS: add entry for libXRes support 2023-03-09 15:05:58 +00:00
David Maciejak 83b94b1616 Update news and changelog files 2023-03-07 17:31:07 +00:00
David Maciejak d045ffcf7d Add a screenshot capture feature
This patch adds a feature to take screenshots directly from Window Maker.
Having the feature embeded direclty inside Window Maker allows us to take
advantage of how Window Maker is managing and handling Windows.
Three new actions can be bound to a key shortcut from WPrefs.
The screenshot files are saved in ~/GNUstep/Library/WindowMaker/Screenshots/
dir, with a "screenshot_%Y-%m-%d_at_%H:%M:%S" format followed by the
extension. Preferably as a PNG or JPG file if available.
Meaning, to work Window Maker via WRaster needs to support
at least one of those format.

"Capture the entire screen" is quite standard, it takes a screenshot
of the whole screen area (even in multiheads env).
"Capture a portion of the screen" requires the user to draw a rectangle which
will be captured.
Those two first are quite straightforward, just taking a live picture of
the screen.
The last one is "Capture a window" which works in best effort mode,
it catures the focused window. As Window Maker by default is not using
any compositor (like for example Xcompmgr) it can only dump the content
displayed on the screen.
If a window is minimized or out of the screen, there is high chance the
image will be split or some area greyed in case other windows overlapped it.
2023-03-07 17:30:59 +00:00
David Maciejak 6c69dc32a0 WINGs: Make the test examples to compile
Those examples are optional but currently cannot compile properly.
The compiler is reporting some unused variables and missing header file.
2023-03-07 17:24:41 +00:00
David Maciejak 3b1c00ad06 WINGs: comment out wtext unused NOTIFY macro
The compiler is reporting the warning below
wtext.c:171: warning: macro "NOTIFY" is not used [-Wunused-macros]

That macro is only used once within that C file, code which is commented
out already.
2023-03-06 20:16:07 +00:00
David Maciejak dd6fe27858 WPrefs: convert workspacename.xpm X11 color name to hex
On window maker built without libxpm, a simple build-in xpm support is used.
That component does not support X11 color name thus when trying to load
that image we are getting a file corrupted error.
Colors manually converted using ref at
https://www.ehdp.com/methods/x11-colors/x11-colors-rgb-values-05.htm
2023-03-05 00:16:44 +00:00
David Maciejak 45f3f5d0ae Util: fix wmgenmenu memory leak and help msg
Memory allocated from wstrconcat() calls are not freed properly.
Help msg is reporting the wrong directory where to install WMRootMenu.
2023-03-05 00:16:44 +00:00
David Maciejak 7185af15cf Use wtokenfree whenever there is wtokensplit
Whenever wtokensplit is used to split into argv/argc, it's better to
use the built-in function wtokenfree() as a wfree call only on argv
is not freeing the memory properly.
2023-03-05 00:16:44 +00:00
David Maciejak 80e8dd43f7 Convert tile.xpm X11 color name to hex
On window maker built without libxpm, a simple build-in xpm support is used.
That component does not support X11 color name thus when trying to load
that image we are getting a file corrupted error.
Colors manually converted using ref at
https://www.ehdp.com/methods/x11-colors/x11-colors-rgb-values-05.htm
2023-03-05 00:16:44 +00:00
David Maciejak a383074c99 WPrefs: sort alphabetically the key shortcut actions and expert options
There are too many entries now in key shortcut actions and expert options,
better to sort them dynamically.
2023-03-03 14:15:19 +00:00
David Maciejak 52a623729d Coverity: fix WRaster convert uninitialized scalar variable 2023-03-03 14:15:19 +00:00
David Maciejak d4ee17f0b5 Coverity: fix WPrefs workspace negative array index read 2023-03-03 14:15:19 +00:00
David Maciejak 7475bc5d0a Coverity: fix util wmsetbg resource leak 2023-03-03 14:15:19 +00:00
David Maciejak 35f87b5592 WRaster: add new file references for translation
This patch is adding the references for the two newly added files
save_jpeg.c and save_png.c for translation (even if those new
files are not adding any new strings to be translated).
2023-03-03 09:51:24 +00:00
David Maciejak 5e37d13eb6 Coverity: fix wmgenmenu resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 4b1aee3e79 Coverity: fix wmmenugen resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 0ccc5bbde7 Coverity: fix wmspec dereference after null check 2023-03-02 17:04:48 +00:00
David Maciejak 59a686d22e Coverity: fix WPrefs appearance negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 26d46f6e16 Coverity: fix WPrefs menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak ceafbf0629 Coverity: fix WPrefs mousesettings menu negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak cf178d011b Coverity: fix WPrefs preference negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 682c2767c2 Coverity: fix WPrefs texturepanel negative array index read 2023-03-02 17:04:48 +00:00
David Maciejak 0e00c6b605 Coverity: fix dialog dereference null return value
This patch is making sure defaultPath returns from FindImage() is not null
and freeing the variables.
2023-03-02 17:04:48 +00:00
David Maciejak e9717ed719 Coverity: fix WPrefs appearance time of check time of use 2023-03-02 17:04:48 +00:00
David Maciejak 9e59d19507 Coverity: fix WPrefs editmenu uninitialized scalar variables 2023-03-02 17:04:48 +00:00
David Maciejak 94f98dcd25 Coverity: fix WRaster convert uninitialized scalar variable 2023-03-02 17:04:48 +00:00
David Maciejak 6c7266c338 Coverity: fix session resource leak 2023-03-02 17:04:48 +00:00
David Maciejak b4bd6d0cad Coverity: fix xmodifier uninitialized scalar variable 2023-03-02 17:04:48 +00:00
David Maciejak c7f7c10d7c Coverity: fix wmsetbg string not null terminated 2023-03-02 17:04:48 +00:00
David Maciejak d831766572 Coverity: fix rootmenu structurally dead code 2023-03-02 17:04:48 +00:00
David Maciejak e2ecfbfd54 Coverity: fix wcolorpanel uninitialized scalar value 2023-03-02 17:04:48 +00:00
David Maciejak a8ec32d41a Coverity: fix setstyle resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 1215680b6d Coverity: fix misc resource leak 2023-03-02 17:04:48 +00:00
David Maciejak 77df89396c Coverity: fix menuparser_macro uninitialized pointer read 2023-03-02 17:04:48 +00:00
David Maciejak c8883fdbb0 WRaster: add functions to save image on disk
This patch adds the RSaveTitledImage() function to the WRaster lib
to be able to save file on disk either as a PNG or a JPEG file.
Those two formats depends on optional external libs.
The function can take an optional title/comment which will
be save inside the file.

The WRaster lib and header versions are bumped.
2023-03-02 10:23:47 +00:00
David Maciejak 3cc5808dcd Coverity: fix wmspec uninitialized layer variable 2023-02-28 13:40:48 +00:00
David Maciejak 8ca89f0141 Coverity: fix RContextAttributes uninitialized variable 2023-02-28 13:33:11 +00:00
David Maciejak 76fa91d21e Coverity: fix wmiv resource leak 2023-02-28 13:33:11 +00:00
David Maciejak d2d5297a1e Coverity: fix potential buffer overflow 2023-02-28 13:33:11 +00:00
David 7b317a5fba wmiv: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
This patch replaces XkbKeycodeToKeysym in wmiv by our
own function W_KeycodeToKeysym.
2023-02-28 03:33:21 +00:00
David Maciejak 9f8dc6f5dc Use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
This patch replaces XkbKeycodeToKeysym by our
own function W_KeycodeToKeysym.
2023-02-27 23:05:27 +00:00
David Maciejak bc56db0776 WPrefs: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
This patch replaces XKeycodeToKeysym and XkbKeycodeToKeysym
in WPrefs by our own function W_KeycodeToKeysym.
2023-02-27 23:05:27 +00:00
David Maciejak 15d06ff064 WINGs: Add W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls
XKeycodeToKeysym was deprecated some time ago and we replaced
those function calls to XkbKeycodeToKeysym.
Usage of XkbKeycodeToKeysym is not the best as it appears
the XKEYBOARD can be disabled via xorg.conf (at least on Linux).
So just replacing XKeycodeToKeysym() with XkbKeycodeToKeysym()
could cause run-time errors on top of the compilation warning
we may have.
Better fix is to address the problem without introducing a
dependency on XKEYBOARD. W_KeycodeToKeysym is the equivalent
code for XKeycodeToKeysym/XkbKeycodeToKeysym using
XGetKeyboardMapping instead.

As a new function is added to the library WINGs library version
is bumped.
2023-02-27 22:37:44 +00:00
David Maciejak 2dd98666f1 Store window maximize state as hex value
As the maximize state is defined as a bit-field internally.
Better to store the flag in the WMSTATE file as hex value.
2023-02-27 22:37:44 +00:00
David Maciejak d1a7db8aea Compile by default with POSIX 7 revision
Compile by default with POSIX-2008 standard for Linux and FreeBSD.
2023-02-27 22:37:44 +00:00
David Maciejak 64a8ecb390 Code cleaning: removing trailing space
The patch is removing trailing space(s) before
the semicolon ending line. .c and .h files were checked.
2023-02-27 22:37:44 +00:00
David Maciejak a9e336256b Doc: add disable-res description 2023-02-26 11:02:46 +00:00
David Maciejak e9b20b51e9 WPrefs: check if captured keyboard shortcut is not in use
Make sure the captured keyboard shortcut is not already in use
by another action, if it's the case an error popup is shown and
the key is not kept.
2023-02-25 13:31:42 +00:00
David Maciejak 1d8b38b6e0 Fix compiler warnings from texture.c v2
The patch fixes those 2 warnings below from texture.c.
It reverts the previous v1 patch and fixes the compiler warning
by updating the texture.h wTextureMakeIGradient header instead.

texture.c:205:81: warning: argument 3 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  205 | WTexIGradient *wTextureMakeIGradient(WScreen *scr, int thickness1, const RColor colors1[2],
      |                                                                    ~~~~~~~~~~~~~^~~~~~~~~~
In file included from texture.c:33:
texture.h:165:53: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |                                                     ^~~~~~~~~~~~~~
texture.c:206:67: warning: argument 5 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  206 |                                      int thickness2, const RColor colors2[2])
      |                                                      ~~~~~~~~~~~~~^~~~~~~~~~
texture.h:165:74: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |
2023-02-25 13:31:42 +00:00
David Maciejak 82ad19d420 Fix compiler warnings from texture.c
The patch fixes those 2 warnings below from texture.c

texture.c:205:81: warning: argument 3 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  205 | WTexIGradient *wTextureMakeIGradient(WScreen *scr, int thickness1, const RColor colors1[2],
      |                                                                    ~~~~~~~~~~~~~^~~~~~~~~~
In file included from texture.c:33:
texture.h:165:53: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |                                                     ^~~~~~~~~~~~~~
texture.c:206:67: warning: argument 5 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  206 |                                      int thickness2, const RColor colors2[2])
      |                                                      ~~~~~~~~~~~~~^~~~~~~~~~
texture.h:165:74: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |
2023-02-24 12:19:38 +00:00
David Maciejak 492b22d975 Fix compiler warning from menu.c
The patch fixes the compiler warning below

menu.c: In function 'restoreMenuRecurs':
menu.c:2450:47: warning: '%s' directive output may be truncated writing up to 510 bytes into a region of size between 509 and 1019 [-Wformat-truncation=]
 2450 |         snprintf(buffer, sizeof(buffer), "%s\\%s", path, menu->frame->title);
      |                                               ^~

The code is taking care of checking properly the string passed to the buffer,
so there is no issue, the change is just to make the compiler happy.
2023-02-24 12:19:38 +00:00
David Maciejak 62405fbb75 Detect and override illegal window size hints v2
The patch is trying to mitigate and properly address the issue described at
https://github.com/window-maker/wmaker/issues/26
A buggy application (in that example virtualbox) is requesting a window size creation
that is way too big and basically at the limit of X11 protocol
(width and height are defined as CARD16).
See details at https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html
During the tests, virtualbox has been seen requesting for window creation of size 843x65508.
Even xprop is reporting incorrect values.

There had been an attempt before with the commit
https://repo.or.cz/wmaker-crm.git?a=commit;h=6668715402a5d8e2ecda6702076a06bf8988721e

But the patch is broken and not implemented at the right place.
As described in the wWindowConfigure function header, the size passed by the client app
should not be trusted and should be vetted with a prior call to wWindowConstrainSize.
wWindowConstrainSize call was missing only once in the wClientConfigure function from client.c
What wWindowConstrainSize doing now is basically setting a failsafe window size fo 640x480
if both width and height are above the size of CARD16.
If only one dimension is oversized, it's setting a default 4/3 window ratio.
Oversized here has not been changed and it's defined in windowmaker as double the screen size.
2023-02-22 20:10:31 +00:00
David Maciejak f1fef40f0d Make window maximize state persistent
Window maximize state is not persistent between windowmaker sessions.
This patch is updating the save and restore workspace state functions
to update the state in the WMSTATE file.
2023-02-21 18:16:35 +00:00
David Maciejak 2fb9308a67 Info Panel: Add libXRes info if supported
If windowmaker was compiled with libXRes,
add XRes info in the "Additional support" section.

Take also the chance to remove the mode +x on the source code file.
2023-02-20 23:07:02 +00:00
David Maciejak d902477efd Set missing WM_COMMAND using pid given from libXRes
For apps which are not setting the window WM_COMMAND property like those old
apps using Motif toolkit (I am thinking of NEdit for example)
it's bringing some issues in windowmaker which is relying on it for a few interactions.
Especially,
*an app without WM_COMMAND will not be saved during the workspace state
(so session restore is not working for them)
*when added to the dock, the settings parameters are empty and need to be filled
*cannot autostart from the dock (even if the settings are manually filled and saved)
*right click on the app titlebar, and choosing Launch has no effect

Most of the time, those apps are also not setting the X11_NET_WM_PID property.
With the pid we could have a chance to find the running program.
To link a window to a pid, there is the X11 Resource extension library (libXRes).
After checking, gnome and xfce are also using the same method to handle such issues.

The patch is checking if the libXRes is present on the system (but it's not mandatory to compile).
Then, it adds a layer on top of wNETWMGetPidForWindow to not only check the window property
but if necessary to get the underlying pid from libXRes if available.
That's solving the points mentioned above.
2023-02-20 15:00:55 +00:00
David Maciejak 5ee19c2308 Allow WM_COMMAND-less app to autostart
For apps which are not setting the window WM_COMMAND property like those old
apps using Motif toolkit (I am thinking of NEdit for example)
it's bringing some issues in windowmaker which is relying on it for a few interactions.
Especially,
*an app without WM_COMMAND will not be saved during the workspace state
(so session restore is not working for them)
*when added to the dock, the settings parameters are empty and need to be filled
*cannot autostart from the dock (even if the settings are manually filled and saved)
*right click on the app titlebar, and choosing Launch has no effect

The patch below allows the workspace state to be saved for those apps without WM_COMMAND
that have been launched from the dock. We are just reusing what have been set in the
Application Path Settings of the dock app (and it does not require extra libs like libXRes).
2023-02-20 15:00:55 +00:00
David Maciejak fabd4252ab Allow exit panel to be bound to a key shortcut
While debugging the save/restore workspace state, I found quite
useful to be able to exit windowmaker using a key shortcut.
2023-02-20 15:00:55 +00:00
David Maciejak 630e9292c2 Factorize duplicate run command code
Run command from the menu and run command from the key shortcut are from two different codes.
Merge them into one function instead.
2023-02-19 10:10:49 +00:00
David Maciejak 14d1b8197a WRaster: Avoid undefined setjmp() behavior with libjpeg
Fix compiler warning:
load_jpeg.c: In function 'RLoadJPEG':
load_jpeg.c:100:17: warning: variable 'image' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]

As it was not working to only set the RImage *image as volatile,
I had to refactor the code by following the example from
https://github.com/libjpeg-turbo/libjpeg-turbo/commit/410c028f3396d1fa9bcc72608079ff4d3d76b03e#diff-e7cb632359a2be17c1008b50f9ec85691cd5d66834d5fe8f63ef65ceb06682ee
2023-02-19 10:10:41 +00:00
David Maciejak 4d658341d2 Add support for _NET_WM_FULLSCREEN_MONITORS
This patch adds the _NET_WM_FULLSCREEN_MONITORS hint as defined in EWMH which is based on Xinerama.
It's allowing a window to be displayed fullscreen on multiple monitors.

Issue mentioned at https://github.com/window-maker/wmaker/issues/8
Specs at https://specifications.freedesktop.org/wm-spec/1.5/ar01s06.html#idm45763309187776
GTK test program used https://bugzilla.gnome.org/show_bug.cgi?id=414476
2023-02-18 08:41:08 +00:00
David Maciejak ac75047aef Fix mini workspace compiler warnings
The patch is to fix warnings like:
wsmap.c: In function "update_mini_workspace":
wsmap.c:451:55: warning: "%d" directive output may be truncated writing between 1 and 11 bytes into a region of size 10 [-Wformat-truncation=]
  451 |                         snprintf(name, sizeof(name), "%d", general_index);
2023-02-17 21:51:06 +00:00
David Maciejak 6d6f9f6ff5 Info Panel: Fix uninitialized posn variable 2023-02-16 11:34:54 +00:00
David Maciejak 370adc94e7 Ignore WM_NORMAL_HINTS resize increment for maximized windows
If you are trying to maximize old apps that are setting a resize increment
in term of WM_NORMAL_HINTS notion the window will not be maximized fully (by a few pixels).
It's easy to reproduce with xterm, ctrl double click on the title bar.
xprop extract sample is giving:
program specified resize increment: 6 by 13

For those maximized windows the patch is just ignoring the resize increment.
Seems the same issue happened on that project
https://github.com/paperwm/PaperWM/issues/106
2023-02-16 01:21:25 +00:00
David Maciejak 532acdc443 WRaster: Avoid types deprecated with libtiff 4.3
This patch is fixing compiler warnings like:

load_tiff.c:42:9: warning: 'uint16' is deprecated [-Wdeprecated-declarations]
load_tiff.c:43:9: warning: 'uint32' is deprecated [-Wdeprecated-declarations]

As starting from libtiff 4.3, released in April 2021, types were moved
from uint16 to uint16_t and uint32 to uint32_t respectively.

See https://libtiff.gitlab.io/libtiff/releases/v4.3.0.html
2023-02-15 11:24:09 +00:00
David Maciejak d7d38aa443 Info Panel: display more OS details
Rely on old utsname and os-release (http://0pointer.de/blog/projects/os-release) when available
to display more underlying OS details in the Info panel.
The idea is when someone creates a bug entry we can request them to copy/paste that screen
to give more info about the context that could help us debug the issue.
For example, on my current system it's displaying:
"Running on: Ubuntu 22.10 (x86_64)"
2023-02-15 09:37:06 +00:00
David Maciejak a6209cc89b Set a better exit panel message
Replace the exit window manager generic message with Window Maker term instead.
2023-02-15 09:37:06 +00:00
David Maciejak 01bd523cee WINGs: allow keypad enter key to validate button
This patch allows the keypad enter key to validate the button click action.
2023-02-15 09:37:06 +00:00
David Maciejak 45ab72a78a InfoPanel: fix out of display text
When debug is enabled, the memory allocated details is supposed to display the free chunks
but as the text length is too long it's getting out of the display area.
This patch is increasing the window width to handle such case.
2023-02-13 13:10:14 +00:00
David Maciejak 437b76812d Info Panel: mallinfo is deprecated use mallinfo2 instead
Replacing mallinfo with mallinfo2.

The fields of the mallinfo structure that is returned by the
older mallinfo() function are typed as int.  However, because
some internal bookkeeping values may be of type long, the
reported values may wrap around zero and thus be inaccurate.
2023-02-11 10:35:23 +00:00
David Maciejak e3ee459a78 Info Panel: use system time to get the current year
Use the system date to get the current year to insert inside the copyright line.
So no need to update that string anymore.
2023-02-11 10:33:22 +00:00
David Maciejak d70b546f2e Fix wrong XKeycodeToKeysym index value
XKeycodeToKeysym was deprecated some time ago and wmaker code was patched to use the definition from XKBlib instead.
(https://repo.or.cz/wmaker-crm.git?a=commit;h=0382dd5dd7ecae2112a0c6366eaf9e6ab68ad354)

Before being deprecated,  XKeycodeToKeysym was prototyped at X11/Xlib.h as
KeySym XKeycodeToKeysym(display, keycode, index)

Now it's available in X11/XKBlib.h as
KeySym XkbKeycodeToKeysym(display, keycode, group, level)

Basically level now which is the 4th parameter is our old index variable (3rd parameter).

On systems which don't have xkb supported the value set for index is wrong.
As seen in old patch at https://repo.or.cz/wmaker-crm.git/blobdiff/139f912e618870cc7fd908099f203450547eb658..43c3526d2120712f72579398b73ef92283d9078b:/WPrefs.app/MouseSettings.c
we should pass the l value to old XKeycodeToKeysym function and not the 0 value which is used for the group in the new XkbKeycodeToKeysym definition.
2023-02-11 10:30:52 +00:00
David Maciejak 812930b7cd Fix icon.c unused variable compiler warning
Just to please the compiler as it's reporting:
icon.c: In function 'get_icon_cache_path':
icon.c:425:13: warning: unused variable 'len' [-Wunused-variable]
2023-02-11 10:30:02 +00:00
David Maciejak 2a14004fc3 SwitchPanel: make sure WMRetainColor and WMReleaseColor calls are even
The number of calls to WMRetainColor for a color in use should the same as the number of calls to WMReleaseColor
to free that color. In case of discrepancy, random crashes can happen and memory is not freed properly.
To debug that issue I checked the retained colors when the switchpanel is opened and then checked if those colors are properly released once the panel is closed.

This patch fixes the issue mentioned at https://github.com/window-maker/wmaker/issues/22
2023-02-10 11:24:55 +00:00
David Maciejak 04e9f33437 WINGs: Fix incorrect findCloseColor exact flag value
In case the color cannot be allocated exactly by createRGBAColor function,
the findCloseColor function is used as a failover function to find a color close to the requested color.
By definition that color is then not exact.
createRGBAColor exact flag should be 1 while findCloseColor exact flag should be 0
2023-02-10 11:24:44 +00:00
David Maciejak 150816c687 Fix missing linefeed on the error message
Just to display the error message properly in case there is no display.
2023-02-08 00:14:48 +00:00
Torrance, Douglas ddacfa5d63 Include screen.h in dialog.h for definition of WScreen 2023-01-26 10:15:58 +00:00
Torrance, Douglas 0718297e9a Correctly draw window snapping hints on multi-head systems
Previously, the transparent frames that were drawn prior to snapping a
window assumed that there was only one head, i.e., that the new
position and dimensions of the window would be based on the dimensions
of the entire screen.

However, this is not the case on multi-head systems, and so we now
base the transparent frame's position and dimensions on the current
head of the window.

We also refactor the code so that the new dimensions are computed in
the switch statement and finish with one final call to
drawTransparentFrame.
2023-01-20 11:54:07 +00:00
Torrance, Douglas 9cc16182d3 Use dock to determine whether drawer is on right side when swapping
Previously, we assumed that it always switched from left to right or
vice versa when calling swapDrawer.  However, now we may also call
swapDrawer when changing the value of "KeepDockOnPrimaryHead", which
wouldn't actually switch which side of the screen it's on.

So instead, we determine which side of the screen it should be on
based on the dock.
2023-01-20 10:34:36 +00:00
Torrance, Douglas f6165d6e80 Use actual x position of dock when saving state
Previously, we either saved it as 0 or -ICON_SIZE, and then adjusted
it depending on the screen width when restoring the state.

But since the introduction of the "KeepDockOnPrimaryHead" option, the
state-restoring code has changed so that the dock will go on the left if the
x-coordinate of the position in WMState is to the left of the midpoint
of the screen and on the right otherwise.  But previously (unless the
user manually set the value in WMState) this would always send the
dock to the left, even if it had been on the right, since the x-coordinate
automatically saved to WMState in this case was negative.

We simplify things by saving the actual x position of the dock to WMState.
2023-01-20 10:34:36 +00:00
Torrance, Douglas 10c36d244e Use dock's position to determine position of dock menu
Previously, we assumed that if the dock was on the right, then the
menu should be on the far right of the entire screen, but this is no
longer the case with "KeepDockOnPrimaryHead" set to "YES".
2023-01-20 10:34:36 +00:00
Torrance, Douglas 515eb652c7 Update the dock position when "KeepDockOnPrimaryHead" is changed 2023-01-18 12:18:03 +00:00
Torrance, Douglas 8ed92efa3c Rename swapDock to wDockSwap and add to dock.h
We'll be calling it from defaults.c.
2023-01-18 12:18:03 +00:00
Torrance, Douglas cc839f8bc5 Add default value of "KeepDockOnPrimaryHead" to Defaults/WindowMaker 2023-01-18 12:18:03 +00:00
Torrance, Douglas 48d4820dee Support "KeepDockOnPrimaryHead" when restoring state
We use the new helper function getDockXPosition to determine where
to put the dock.  If WMState gives an x-coordinate less than the
center of the screen, we put it on the left, and otherwise we put it
on the right.
2023-01-18 12:18:03 +00:00
Torrance, Douglas d4f5f3ec7f Support "KeepDockOnPrimaryHead" when initially creating dock
We use the new "getDockXPosition" helper function to find the x
position of the main icon, whose position is used in "wDockCreate" to
get the position of the entire dock.

Previously, "KeepDockOnPrimaryHead" was only taken into account
when *moving* the dock and not when creating it.
2023-01-18 12:18:03 +00:00
Torrance, Douglas 83f7fa43ce Add helper function for computing the dock's x position
Avoid code duplication since we'll need to make this computation in
several places.
2023-01-18 12:18:03 +00:00
Torrance, Douglas 55a816bdbc Keep dock on primary head if KeepDockOnPrimaryHead is YES
This implements a feature request [1] to allow the possibility of
keeping the dock on the primary head on a multi-head system.

In particular, if the new KeepDockOnPrimaryHead option is set to YES,
the dock will either be on the left- or right-hand side of the primary
screen.  If it is NO, then we get the current behavior, i.e., the dock
will either be on the left-hand side of the leftmost head or the
right-hand side of the rightmost head.

[1] https://github.com/window-maker/wmaker/issues/24

Closes: #24
2023-01-15 00:18:34 +00:00
Torrance, Douglas 7639fa1c15 Add "KeepDockOnPrimaryHead" checkbox to WPrefs experts panel 2023-01-15 00:18:34 +00:00
Torrance, Douglas 93b411f258 Document "KeepDockOnPrimaryHead" option in NEWS 2023-01-15 00:18:34 +00:00
Torrance, Douglas 326a67e18f Add new "KeepDockOnPrimaryHead" option
Once implemented, this will keep the dock on the primary head (when
there are multiple heads) when YES.  The default value is NO, the
current behavior, i.e., treat all monitors together as one large screen.
2023-01-15 00:18:34 +00:00
Petre Rodan c089c6aea4 Fix segfault on right-click sweep of menu
bug description: after menu is displayed I get a segfault when trying to hover over the last menu
entry. it looks like under some circumstances menu->entries[] gets accessed past the last valid
value (off by one).

how to reproduce:
right-click desktop to show menu and keep right mouse button pressed
sweep mouse up-down the menu a few times - it crashes all the time between 1-5 sweeps

this commit fixes the unwanted behaviour, in active use since december 2021.
2023-01-06 12:47:22 +00:00
Torrance, Douglas 66b0ee3c4d Add WPrefs to XDG desktop menu
We include a desktop entry file for WPrefs so that it will be included
in XDG-compatible menus.  See the specifications at:

https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
2022-02-17 22:31:18 +00:00
Torrance, Douglas a6c8577eb4 Include wmaker.desktop in distribution tarball
This fixes a bug where building from a tarball generated by "make
dist" would fail due to the absence of this file.
2022-02-17 22:31:18 +00:00
Doug Torrance 094001a53d Convert Slovak language manpages from ISO-8859-2 to UTF-8 2021-10-10 11:53:29 +01:00
Doug Torrance deba131857 Convert Czech language manpages from ISO-8859-2 to UTF-8 2021-10-10 11:53:11 +01:00
Doug Torrance a9bc9751a2 Use quotes around "Window Maker" in translated manpage title headers
This matches the English manpage and also prevents
wrong-manual-section Lintian warnings in the Debian package, as "Maker"
was being interpreted as the section of these manpages.
2021-10-09 13:53:34 +01:00
Torrance, Douglas 58b6728743 Add desktop file for display manager session configuration
Files in /usr/share/xsessions are used by some display managers (e.g.,
LightDM and GDM) to detect available sessions.  Such a file has been
shipped in the Debian Window Maker package for years.
2021-10-09 09:55:40 +01:00
Christophe CURIS 894d096d6e WINGs: in WText, do not re-query Atom value every time they are used
It is resource-consuming to query the server for an Atom, yet the protocol
ensures the values will stay unique, so we'd better ask them once and
retain the values for further use.
2021-09-04 19:03:53 +01:00
Christophe CURIS a41b0aa21d WINGs: Simplify function wstrconcat
Because we have allocated enough space, it is a waste of time to check the
size after copy and cat; beside the use of plain strxxx functions may allow
compiler to make a better job.
2021-09-04 19:03:53 +01:00
Christophe CURIS d4cc033379 Util: Rewrite error message generation to avoid potential problem
The call to 'snprintf' may change the value of 'errno', which means that
the 'perror' call would print a wrong error message, not the one from
'fopen'.
2021-09-04 19:03:53 +01:00
Christophe CURIS 308b9f4975 Configure: Fix non-working libbsd usage when explicitly requested
Due to a missing comma, in the AS_IF the action run-if-false is actually
merged with run-if-true action, which means that with_libbsd is always
empty when user provides --with[out]-libbsd.
2021-09-04 19:03:53 +01:00
Christophe CURIS 1d1c904126 Configure: Place the argument checks at the beginning of execution
The autotool provides a simple mechanism which allows us to move ("divert")
the checks we do on the user arguments to the beginning of the script, yet
without needing to scatter the code.

This is good because we can raise errors very fast, user do not have to
wait until many other checks have passed before knowing he has to correct
his argument list; yet on our side we can keep related things together.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-09-04 19:03:53 +01:00
Christophe CURIS ca4ae5068b WINGs: Simplify wglobaldefaultspathfordomain
The original code was over-complicated, it can be reduced to a one-line
call to a function that does the same thing, with the bonus that it will
behave better in the case where domain == NULL.
2021-08-10 09:42:43 +01:00
Christophe CURIS 26491867a3 WINGs: Fix incomplete prototypes for functions that take no argument 2021-08-10 09:42:43 +01:00
John D Pell dce34e926b wmaker.inst: remove all modification to ~/.xinitrc
I cannot imagine that modifying an existing ~/.xinitrc is ever wanted, and creating an ~/.xinitrc when none exists is much worse.

If a user created their own ~/.xinitrc, then don't modify it.
The user will modify it if they like.

If the user did not create their own ~/.xinitrc, then creating one will short-circuit X startup as `startx` will *replace* the system's version with the user's version.
Literally ~/.Xresources won't be loaded.
There's no way this is expected behavior.
2021-08-10 09:42:43 +01:00
John D Pell a0b283a60f WUtil: Be more strict about base directory for wmkdirhier()
The original code refused to create anything not in $WMAKER_USER_ROOT, now
we go one step further and limit creation inside its 'Library' or
'Defaults' sub-directories.
2021-08-10 09:42:43 +01:00
John D Pell 671db45007 WUtil: Be more strict about base directory for wrmdirhier()
The original code refused to delete anything not in $WMAKER_USER_ROOT, now
we go one step further and limit deletion inside 'Library' or 'Defaults'.
2021-08-10 09:42:43 +01:00
John D Pell 0c6ad643c8 Change generation of Data Dir in the global header
It has become common practice in previous patches to use PACKAGE_TARNAME
instead of hard-coding "WindowMaker" when working with paths, so let's be
as consistent in the generated header.
2021-08-10 09:42:43 +01:00
John D Pell 5076b6f496 Default Files: Replace misleading variables 'defsdatadir' in Makefiles
The parameter name 'defsdatadir' was copied in to many sub-Makefiles; for
all of them give a unique name for clarity.
2021-08-10 09:42:43 +01:00
Christophe CURIS 54c8535365 Configure: Add an error message when using deprecated "--with-defsdatadir" 2021-08-10 09:42:43 +01:00
John D Pell 24f5b32469 Configure: Rename setting DEFSDATADIR to PKGCONFDIR
Directory /etc/WindowMaker is for global defaults configuration, it is not
a "data" folder which is $PREFIX/share/WindowMaker.

The name change make it more consistent with other names.
2021-08-10 09:42:43 +01:00
John D Pell 85169642ca WMaker: Store history in $XDG_STATE_HOME if defined
The FreeDesktop XDG standard suggests storing history in the directory
pointed by $XDG_STATE_HOME; so if we find it is defined we prefer to use
it over the default path. If undefined, keep the old behaviour.

This may introduce a loss of history for users that had some in the legacy
place but have the variable, we consider this very unlikely to be a problem
but if user complains we can suggest them to move the legacy file over the
empty new one.
2021-08-10 09:42:43 +01:00
Christophe CURIS 9f9ef6417e Utils: Use the constants added in config-paths.h for paths
Replace hard-coded directory names by the constants that have been
previously added to the common header.
2021-08-10 09:42:43 +01:00
Christophe CURIS fb2a6d2e61 WPrefs: Use the constants added in config-paths.h for paths
Replace hard-coded directory names by the constants that have been
previously added to the common header.
2021-08-10 09:42:43 +01:00
John D Pell 8219c36488 WINGs: Use the constants added in config-paths.h for paths
Replace hard-coded directory names by the constants that have been
previously added to the common header.
2021-08-10 09:42:43 +01:00
John D Pell bd38778bef Use wuserdatapath() everytime it is applicable
Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).

The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
2021-08-10 09:42:43 +01:00
John D Pell 1e45ff2305 WUtil: New function wuserdatapath() to get path for application data
Returns the path in the user's GNUstep library: ~/GNUstep/Library
2021-08-10 09:42:43 +01:00
John D Pell 7e1cdf2d59 Add definition of directory names used for building paths in common header
The organisation of the file tree for storing application files depends on
a number of directories with a specific name.
This patch puts these names in the generated "config-paths.h" so they can
be shared between WINGs and WindowMaker, and could be user-configured in
the future.
2021-08-10 09:42:43 +01:00
Christophe CURIS 43f0474013 WINGs: Properly mark 'const' more 'char*' in the public API
Because the previous patch brought a (welcome) change in the public API,
seize the opportunity to go further in the improvement.
2021-08-10 09:42:43 +01:00
John D Pell a079544647 WINGs: Properly mark 'const' some 'char*' in the public API
Update all the callers in our code to deal with the const qualifier
where the compiler reports an issue.
2021-08-10 09:42:43 +01:00
John D Pell 03ec24502d WMaker: Fix logical-not operator in framewin.c
As reported by clang, (!wPreferences.new_style == TS_NEW) inverts the
"wPreferences.new_style" and not the whole expression. Use the appropriate
comparison operator to avoid misunderstanding.
2021-08-10 09:42:43 +01:00
John D Pell 5c90ed9d2d WPrefs: Use wdefaultspathfordomain() to build path to the root menu file
For the Menu edition tab, when building the path to the file that contains
the menu data, rely on wdefaultspathfordomain instead of constructing the
path with many hard-coded names.
2021-08-10 09:42:43 +01:00
John D Pell 735651df55 WMaker: Use wdefaultspathfordomain() to get path for Defaults directory
Instead of constructing path to user's defaults directory with hard-coded
names, just query wdefaultspathfordomain with a blank domain: this returns
the equivalent of "~/GNUstep/Defaults/", yet avoiding problems related to
duplicating strings.
2021-08-10 09:42:43 +01:00
John D Pell bfab769065 WINGs: Improve search path logic in WMPathForResourceOfType
The man page says environment variables are used, and if they don't exist
it falls back to defaults, yet this was not true in WINGS.

This changes implements the checks for the default paths used when the env
variables are not defined; these default paths have been fixed (+lib) to
match the GNUstep layout ('fhs'), expect for the very last path which keeps
the legacy layout.

For the user Apps folder, rely on wusergnusteppath() (~/GNUstep) to build
the path.

The previous code was only partially functional as the hard-coded paths
did not exist in any of GNUstep standard file system layout and the
GNUSTEP_*_ROOT environment variables were not provided by GNUstep for a
while. This means it would never work no matter how environment variables
were set when using layouts: 'debian', 'fhs', 'next', 'Apple', 'mac',
'fhs-system', or 'standalone'.
2021-08-10 09:42:43 +01:00
John D Pell c060477d57 WINGs: Simplify use of HAVE_SECURE_GETENV
Define the macro GETENV(x) instead of sprinkling code with #ifdef HAVE_SECURE_GETENV
everytime we want to use it.
2021-08-10 09:42:43 +01:00
Torrance, Douglas 75f133285f Fix segfault in color picker
Previously, we released the color well's color even if it was the same
as the new color.  This eventually resulted in a segfault when calling
WMPaintColorSwatch because we tried calling XFillRectangle with no
display.

We fix this by only releasing/updating the color well's if it differs
from the new color.
2021-06-29 22:32:31 +01:00
Torrance, Douglas a6ec6a30a3 Use wmkdirhier instead of mkdir to create color config directory
Otherwise, if ~/GNUstep/Library doesn't already exist, then creating
~/GNUstep/Library/Colors will fail.
2021-06-29 22:32:31 +01:00
Christophe CURIS 6afa419b01 Website: Create script to update the list of man pages in the index
It is a good idea to have an Index web page with the list of the man pages
available, but there is a risk to have it outdated, so there is a script to
take care of this for us.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-06-20 22:28:19 +01:00
Christophe CURIS a2bf67f54c Website: Create script to generate the HTML version of the man pages
When running the 'make website' command, it will call groff to convert the
man pages into HTML and post-process them to get them in the style of the
site, then place them in the Website Git Repository.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-06-20 22:28:19 +01:00
Christophe CURIS 351e05dca9 Configure: Add a maintainer option to prepare generation of HTML for the website
When the new configure option '--with-web-repo' is used, the new target
'make website' becomes available and will generate HTML pages to be placed
in the Homepage Repository.

This patch does not generate any content yet but it prepares the skeleton
to handle everything.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-06-05 23:54:15 +01:00
Christophe CURIS ae78e88eef Repair compilation when Pango support is enabled
It seems there have been changes in the way Pango's header files are
installed in recent versions, probably to allow having multiple versions
together on a system.

Because one public header from WINGs has to include Pango's header, we must
include the search path provided by Pango into our WINGs search path that
are returned by pkg-config (the .pc file).

They are then also added to WindowMaker and WPrefs which use the header but
can't rely on the path from the .pc file which has not been installed yet.

Reported-by: Carlos R. Mafra <crmafra@gmail.com>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-29 23:55:10 +01:00
Christophe CURIS f049635fa5 Configure: Rewrite the detection for Pango library
Make use of the standard macro for PKG_CONFIG; the default behaviour is now
to use Pango if present, instead of requiring explicit user request, yet
still not making it mandatory.

The detection code was moved to a macro to keep the configure.ac script
(relatively) small, and consistent with what is done for most other libs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-29 20:15:09 +01:00
Doug Torrance 4221e30bd2 Convert WPrefs.app/po/README from iso-8859-1 to utf-8 2021-05-25 22:12:23 -04:00
Doug Torrance 71558f4ce3 Convert WindowMaker/README from iso-8859-1 to utf-8 2021-05-25 22:10:15 -04:00
Doug Torrance 4b61081353 Convert po/README from iso-8859-1 to utf-8 2021-05-25 22:05:30 -04:00
Christophe CURIS 4138c57631 Configure: Rewrite the macro for checking Xft2 version
The original macro used over-complicated things, like:
 - useless uses of 'eval',
 - split AC_CACHE_CHECK construct (AC_MSG_CHECKING + AC_CACHE_VAL +
AC_MSG_RESULT)
 - dubious variable name (CPPFLAGS_old, which is not the "old" value but
the "saved" value for a temporary change)
 - variable CPPFLAGS was changed at wrong hierarchy level
 - calculate the integer value for XFT_VERSION in m4 instead generating
shell commands that had to do it on user side
 - indentation was missing

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-22 20:00:41 +01:00
Christophe CURIS 0bbb122b94 Configure: Rewrite detection for Xft2 to properly use PKG_CONFIG macro
The goal is to use standard macros, which make code easier to maintain
(smaller, more consistent). We still keep the legacy "xfg-config" method
because we don't want to drop support for old hardware/software.

A side effect is the change in the name of the variables for the makefile,
but this goes in favour of consistency.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-22 20:00:41 +01:00
Christophe CURIS 0e274dc979 WRaster: Fix incorrect use of macro USE_XSHM in installed header
The header "wraster.h" needs different behaviour depending on whether the
support for X Shared Memory extension was enabled or not; but the related
macro USE_XSHM is defined by WindowMaker's configure. After this header
have been installed, the macro is no more useable.

This patch makes the "wraster.h" a generated file, so it will be different
depending on USE_XSHM, but will not make use of the macro itself.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:50:43 +01:00
Christophe CURIS 4dfb0dd059 WRaster: Create french translation to have at least one
The translation check would complain because it does not find any '.po'
files, so I am providing one translation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS bcb53700d6 WRaster: Improve error messages to provide useful information to user
The original error messages tended to be a bit sparse, now they try to be
a little bit more helpful, and translatable in user's language.

In xutil.c:122, took opportunity fix a problem because calling 'perror'
after other function which are likely to have changed the errno is likely
to provide a wrong error string.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS e5f7ef23a6 WRaster: Made a few messages translatable
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 70f89fd9c5 WRaster: Add initialisation for locale support
Because the library does not have an initialisation function, we need to
rely on an automatic called-on-load mechanism, which is provided through
a compiler attribute 'constructor'.

However, as the project aims to still compile on old hard/software, we
include a check in 'configure' to ensure it works, and if not use the
legacy solution.

Note: Because we introduce a new DEFINE, the 'config.h.in' needs to be
regenerated, otherwise you may get a compilation error in wrlib. This is
done by re-running './autogen.sh'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 19202fd2db WRaster: Create header for i18n helper functions
This patch is just adding a single header, but because it also modifies
all the C files to add the #include, it was made as a patch on its own to
ease review.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS aadd694a6b WRaster: Create structure to make the library translatable
The library did not propose the mechanisms to be translated, this patch is
creating the structure in autoconf/automake and the translation directory
so its messages can be also translated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS fbec3a728f wmaker: Do not allocate memory for a temporary string for the Window Shortcut menu
When creating the list of possible shortcut for windows to populate the
window menu, a temporary buffer was allocated to hold that string.

As this allocation participates to memory fragmentation, this patch makes
use of storage on the stack instead which is also faster.

Took opportunity to include the shortcut number (%i) in the string to be
translated, because it is unlikely that adding that number at the end of
the string is right in all languages. Updated french translation because
it is the only one I am confident with.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 944bb49997 wrlib: Add compiler attributes to the API functions
With proper attributes, the compiler is able to do some extra checks on
user side to make code safer and/or better optimised.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 0ac6827a9b wmmenugen: Fix memory leaks when parsing menu in wmconfig format
As reported by Coverity (CID #50181, #50182 and #50183) the strings allocated by parse_wmconfig_line were not freed after use.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS f030ab7664 wmmenugen: Fix memory leaks in XDG menu generation when getting locale-dependant name
As reported by Coverity as CID #50142, #50143, #50144 and #50145, all the
strings allocated by 'parse_locale' were never freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 2a8fc1df9a wmmenugen: Fix memory leak when parsing names for menus in XDG format
As reported by Coverity (CID #50146), if the function getLocalizedStringValue
returns without matching the entry, the storage for the entry's locale was
leaked.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 296456f361 wmmenugen: Fix memory leak when parsing categories in an XDG menu
Reported by Coverity (CID #50147)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS f2cd2c9f03 WRaster: Properly set file's mtime in the cache when loading an image
The library maintains a cache to not reload a file that was previously
loaded. In order to still reload an image in case its file would have
changed in the meantime, the cache saves the file's modification time.

As reported by Coverity (CID #331576) the 'stat' function was not on the
execution path the first time an image is loaded, which means the cache
information is populated with junk data. This could lead to an image not
being reloaded for example.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS d125f80dee WRaster: Stop parsing number in PPM file if invalid syntax is found
When the function 'pm_getuint' is reading a number, it prints an error
message if it encounters a non-digit number, yet it still enters the
processing loop which will cause an invalid number to be calculated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 8e47ca8e62 WPrefs: Add check for invalid OPEN_MENU/EXEC in PL-Menu to avoid potential crash
As reported by Coverity (CID #50047, #50048), if the proplist is incorrect
and has an OPEN_MENU or (SH)EXEC command without its arguments, we did
dereference a NULL pointer.
Now we simply return the NULL value, appropriate to have the caller of the
function issue a message.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 29cf48b934 WPrefs: Provide fall-back colour in the case of colour name not found
As reported by Coverity (CID #331571), we did not check the return value of
the call to XParseColor. If the function is given a colour name that it
does not know, we would return an uninitialised colour.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 816fa00625 WUtil: Make sure wmalloc/wrealloc won't fail because of the abort handler
As pointed by Coverity (#50074), despite the expected behaviour that
'wmalloc' should never return NULL, it may still happen if an abort handler
set by user (with wsetabort) does not call exit() as expected. In such
case we make sure the NULL pointer dereference does not happen inside
WINGs code because we assume it is a known user choice.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 6ebec0bb9f WUtil: Fix non-closed file handle in WMWritePropListToFile
As reported by Coverity (CID #50129), in case of error during the write
operation, the failure path does include close of the file handle. In
addition to the resource leak, this may be a problem if the application
were to make a second try on the same file.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 7c50721747 WPrefs: Fix memory leak in Expert tab
As reported by Coverity (CID #331553), we leak the allocated string
returned by 'WMGetTextFieldText'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 4559cbbccc WPrefs: Fix memory leak in the Menu tab
As reported by Coverity (CID #331559), the call to 'wfindfile' replaces
the value for variable 'path' but we did not free its previous content.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS e828e1c074 Fix use-after-free error in wIconStore reported by Coverity
The function always returns the filename where the icon have been saved,
but in the case where the save operation failed we would free the memory
for that file name, yet still return this pointer like if it were valid.

Took opportunity to remove redundant free(path) which is done a couple
lines later, because redundancy is a source of problem for code
maintenance.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 97a9300aa4 Fix memory leak reported by Coverity
As reported in CID #331577, we re-use the variable 'tmp' without freeing
the previously allocated pointer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS fd56152202 WPrefs: fix memory leak and potential buffer overflow
Coverity pointed that the "text" returned by WMGetTextFieldText was never
freed (CID #331578, because WMSetTextFieldText does its own copy, it does
not take the pointer as-is).

By looking at the code, there is also a potential buffer overflow because
the buffer alloc'd for "value" is sized for the exact number of digits
before increase, but the +delta can make the number use more digits so we
may write past the end of original buffer.
We write to a stack-allocated one, so it does not cost anything and does
not participates to memory fragmentation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 58862300f9 WINGs: Fix invalid handling of Blue in the HSV conversion in ColorPanel widget
Because of a minor bug, when pure blue was chosen in RGB in the ColorPanel,
the conversion to HSV would mistreat it as white and resets its hue,
leading to possible user annoyance.
2021-05-18 17:49:17 +01:00
Christophe CURIS 1612d2f345 WINGs: increase temporary buffer to silence a gcc warning
The code limits the integer number to 0..359 so we need 4 bytes to store
that, but that require too complex flow processing for compilers to deduce
it.

It does not cost to increase the temporary buffer to the minimum size
requested by GCC, so let's do this, because spurious warnings can
potentially divert us from more important ones.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 920c6d16b1 wraster: Remove duplicate code
Duplicating things makes maintenance error-prone, which is not a good idea.
In case the abort procedure would need an update, it would be easy then
to forget some place, leading to leaks, if not worse.

Beside, goto is not as bad as academics would like people to believe, when
it is used correctly (and this case is one of them).
The name for the label was given an explicit meaning to make code easy to
understand.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS 8aecba27d1 Fix usage of float constant reported by gcc
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS fc63d72032 WINGs: Fix incorrect use of macro USE_PANGO in installed header
The header "WINGsP.h" needs different behaviour depending on whether the
support for Pango was enabled or not. But the related macro USE_PANGO is
defined by WindowMaker's configure, and after this header have been
installed the macro is no more valid.

This patch makes the "WINGsP.h" a generated file, so it will be different
depending on USE_PANGO, but will not make use of the macro itself.

As a side effect of being now generated, the include paths in the makefile
have been updated to include build-dir too, because for users doing an
out-of-tree build the generated file (that is used during compilation) is
placed in the build-dir.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Xander eb2a9d97a2 Make dock dots scalable
This patch makes the three dots in the dock change their size when bigger icon size is used.
The logic here is such that the dots are scaled only when a certain icon size is reached;
for instance, the dots will remain unchanged if icon size is less than 128x128 px, and will
be twice as big if it's set to a value from 128x128 to 184x184 px. The get_dot_mult() func
calculates and returns the scale multiplier. In the draw_dot() func, XDrawLine() and
XDrawPoint() were replaced with XFillRectangle() because those funcs do not allow their
result to be scalable. This patch does not require additional icon size values (those bigger
than 96x96 px) to exist, but makes no use without them.
2021-05-07 18:03:19 +01:00
Xander 9abe4165d1 Add icon sizes
The classic WindowMaker allows tile icon size up to 96x96 px. This patch rises this value
to 256x256 px. It also sets the max number of visible items in the corresponding pref list
to 29 (instead of 9), so the new values show up in the list. This patch makes it possible
to use dockapps that allow changing their size to bigger than 64x64 px, see
https://gitlab.com/xander1988/dockapps for more info.
2021-05-07 18:02:03 +01:00
gryf 82ab2d2d06 Correct calculation of usable space for reserved area.
Previous patch has correct the way, how reserved area found in
_NET_WM_STRUT was calculated. Unfortunately, the calculation was not
precise, as for not reserved areas (i.e. values of 0 for one of the
cardinals is set) must be calculated anyway for given head, otherwise
usable area might be too broad.
2021-03-18 16:08:40 +00:00
gryf bbf24d1d39 Correct way for reserved space on multihead environment.
Applications such a panels or docks have ability for reserving space so
that no windows should cover or overlap them. There is (partially)
support for it by checking the _NET_WM_STRUT property, although
calculation for the reserved space was wrong in case of several heads
enabled.

In this patch calculation for reserved area has been corrected.
2021-03-16 20:39:54 +00:00
Helge Kreutzmann 224cb403a7 Tippfehler in de.po von WPrefs (WindowMaker)
per Zufall habe ich einen Tippfehler gefunden
2020-12-07 16:53:16 +00:00
Nick Berendsen 1cd8fea423 Add support for _NET_WM_STATE_FOCUSED
Thanks to Jeremy Sowden for sending the patch to the mailing list.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2020-10-27 15:35:08 +00:00
Diedrich Vorberg a98680cd14 Patch for GetCommandForPid() in osdep_darwin.c
the function mentioned above caused segfaults on MacOS. The attached patch
seems to solve that.

Details: The functions provides an array of string pointers (the argument
vector) pointing to a buffer allocated and referred to by a static local
variable `args`. This buffer was used on each subsequent call. For one
thing this would overwrite old values and for another this caused segfaults.

My new implementation allocates a buffer for the argument vector plus the
actual string data on each call. The caller will wfree() the buffer, but
until then has available an independent copy of the strings.
2020-10-19 20:38:29 +01:00
Alexander Komarov 7d423a3a0f Added Expert option: "Close rootmenu when mouse (left or right) is clicked outside focus.
Common WindowMaker's rootmenu behavior if press right mouse button open menu and close only with same button.
It's uncomfortably, it patch  allows close menu by left or right is clicked outside focus.
Changed func "static WMenu*configureMenu(WScreen *scr, WMPropList *definition)" to non-static forglobal use.
Added new  OPTION_WMAKER for this Expert-option. Changed event.c: for correct work should use initialization
func configureMenu afterwMenuDestroy (this is a feature of the event implementation XEvent).
2020-09-13 16:56:09 +01:00
Alexander Komarov 033d2d9a6f Changed Russian translation 2020-08-11 10:49:13 +01:00
Alexander Komarov 6e2075f3df Double click on titlebar maximize a window to fullscreen 2020-08-10 12:15:01 +01:00
XOR 5d2fd7bf7e WPrefs: Create Turkish translation 2020-06-28 17:54:15 +01:00
Christophe CURIS f6742662ec Tell git to ignore files created during i18n preparation
The 'pot' files are templates generated when we want to update the 'po'
files against latest source code;

the 'mo' files are compiled 'po' files to be installed
2020-06-28 11:33:31 +01:00
Doug Torrance 583f66ec4e Turn off automake's warning messages about using GNU make extensions
We've been using addsuffix in WindowMaker/Makefile.am and may use others
in the future.
2020-06-22 18:07:09 +01:00
gryf cd23e77fd1 Remove Debian related build files.
Keeping Debian related build files should not be the duty of wmaker
development team, but Debian package maintainers.
2020-05-31 17:34:28 +01:00
gryf 230a501d36 Fix typo on defining imagemagick version.
In this patch we will fix an issue during compilation on systems, which
have ImageMagick version 7, and slightly more recent version of
compiler. If we define USE_MAGICK with null value, compilation will fail
on preprocessor check on such defined variable.
2020-04-20 09:03:56 +01:00
Doug Torrance 3022edd060 wrlib: Fix typo in macro containing ImageMagick version
It's USE_MAGICK, not USE_MAGIC.  Also, we wrap the if/else statement
in an ifdef.  This doesn't really affect anything since load_magick.c
won't be compiled if USE_MAGICK is undefined because of an if statement
in the Makefile.  But in the off chance that it is somehow, then we will
try to load a nonexistent version 6 header file since USE_MAGICK will
be interprested as 0 and 0 < 7 is true.
2020-04-19 07:58:28 +01:00
Doug Torrance 1713a88656 debian: Remove ImageMagick patch; an equivalent patch now exists in next
If a user wanted to build a Debian package from the next branch, then
it would fail immediately when quilt tried to apply the patches.
2020-04-19 07:58:28 +01:00
Doug Torrance 00a25db9ea checkpatch.pl: Escape curly braces in regexes
Unescaped curly braces  have been deprecated since Perl 5.26 and are
illegal in Perl 5.30. I copied the relevant lines from the latest kernel
source, so we'll inherit a couple other improvements as well.
2020-04-18 22:27:29 +01:00
Doug Torrance c678580621 debian: Update with version 0.95.9-2 packaging. 2020-04-18 19:49:26 +01:00
Doug Torrance 44bc9cc264 Fix various abs() issues.
The abs() function should take an int as argument, but there were
several instances in the code where it was taking an unsigned int or a
double.  In these case, we took one of the following approaches:

* If the argument was a double, use fabs() instead.
* If the argument was unsigned and was certainly going to be positive
  (i.e,. no subtraction), then drop abs() altogether.
* If the argument was unsigned as result of adding or subtracting signed
  and unsigned ints, then we cast all the unsigned ints to signed ints.
2020-04-18 19:49:26 +01:00
Doug Torrance dfa92906c0 wrlib: Compile with either ImageMagick 6 and 7
We dropped ImageMagick 6 support in 0.95.9.  However, ImageMagick 6 is
still widespread (e.g., ImageMagick 7 has not been packaged in Debian
yet), and upstream plans on maintaining it until at least 2028 [1].

In this patch, we detect the version of the MagickWand library installed
on the user's system and include the appropriate header file when
building wrlib.

Note: I've only tested this with ImageMagick 6, so I'd appreciate
confirmation that it works with ImageMagick 7.

[1] https://github.com/ImageMagick/ImageMagick6/blob/master/NEWS.txt
2020-04-18 19:49:25 +01:00
Doug Torrance 27dc5efd2e debian: Update with version 0.95.9-1 packaging. 2020-04-17 08:20:50 +01:00
Doug Torrance 86659be668 wmlib: Use X flags from configure
We use the AC_PATH_XTRA macro to find all the X library paths during
build, but we weren't actually using the variables it generated for
building wmlib.  Instead, we just hardcoded the linker flag "-lX11",
which may or may not actually work.
2020-04-09 14:54:06 +01:00
Doug Torrance e314f10909 configure: Fix typo in libXmu check.
As the literal string "wm_cv_xext_xmu" will never be equal to "xno",
we always ran the code that was supposed to run when the variable
$wm_cv_xext_xmu was not equal to "no".  In particular, if libXmu
was not found, then we proceeded as if it had been found.
2020-04-09 14:54:06 +01:00
Doug Torrance 54a24ab6f7 Remove trailing whitespace.
Also, the script is a one-liner, stolen from [1]:

ack --print0 -l '[ \t]+$' | xargs -0 -n1 perl -pi -e 's/[ \t]+$//'

[1]
https://stackoverflow.com/questions/149057/how-to-remove-trailing-whitespace-of-all-files-recursively
2020-04-09 14:28:09 +01:00
Doug Torrance a17d131da3 Remove apostrophes from instances of possessive "its".
I noticed one instance of this while looking at the code the other day,
and after a quick grep, realized it happened a *lot*!  One of the many
frustrating things about the English language is that we use apostrophes
to make pretty much everything possessive *except* the pronoun "it".
In that case, we use "its".  "It's" is reserved for the contraction
meaning "it is" or "it has".
2020-04-09 09:05:50 +01:00
David Michael 6320bb6219 configure: Allow changing default search paths
This changes the behavior of the --with-{inc,lib}s-from arguments
to replace the default paths instead of adding to them.  This is
required when cross-compiling in a sysroot, since the default paths
will include files from the host system which can have an
incompatible architecture.
2020-04-06 16:35:53 +01:00
Carlos R. Mafra f9bc310fa6 Window Maker 0.95.9 2020-04-04 11:02:28 +01:00
Carlos R. Mafra 58249c2b9b Update .gitignore file 2020-04-04 10:55:42 +01:00
David Maciejak bb716a4ca1 util: renamed wmiv DEBUG constant name
To prevent compilation warning message saying DEBUG name is already defined
2020-03-28 10:13:11 +00:00
David Maciejak 91f8e21668 WPrefs: fixed malformed TIFF file generating libtiff warnings
The original ergonomic.tiff file samples/pixel property was wrong which was generating the warning message from libtiff
"TIFFReadDirectory: Warning, Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.."
2020-03-28 01:02:56 +00:00
David Maciejak 5f18f60fd2 WPrefs: increased open submenu label size
Give more space for the open submenu label to be displayed properly
2020-03-28 01:02:41 +00:00
David Maciejak a215869067 wrlib: Fixed warning msg using libpng
Call png_set_interlace_handling() to get rid of the warning message "libpng warning: Interlace handling should be turned on when using png_read_image"
2020-03-27 09:00:37 +00:00
David Maciejak 909deea70c bump copyright year in Info Panel
bump copyright year in Info Panel
2020-03-25 10:08:17 +00:00
David Maciejak 984a992d0e Fix typo
Renamed isPointNearBoder() function
2020-03-25 10:05:02 +00:00
nchilingaryan@aua.am e82d86813e Update Armenian translation
I did some part of translatin back in 2008, now I fixed bugs and updated it
so that all the messages are translated.
2020-03-05 10:19:49 +00:00
Jeremy Sowden d9bc96e497 strncpy's third argument should be the length of the dest buffer, not the source. 2019-08-06 11:04:05 +01:00
Jeremy Sowden a7baed6cf7 Fixed expression checking whether flag is set. 2019-08-06 11:04:05 +01:00
Jeremy Sowden a12f0d453a Fixed buffer size. 2019-08-06 11:04:05 +01:00
Jeremy Sowden 41193bdacd Fixed function-pointer compatibility. 2019-08-06 11:04:05 +01:00
Jeremy Sowden a7f8e990db Added explicit fall-through comments to pacify GCC. 2019-08-06 11:04:05 +01:00
Jeremy Sowden b59273f199 Added missing function declaration. 2019-08-06 11:04:05 +01:00
Haroldo be922384ac slight increase in default switch panel icon size to improve border view 2019-07-28 23:05:28 +01:00
Haroldo 31f16b65a3 higher resolution images for switch panel 2019-07-28 20:21:14 +01:00
Haroldo 3665410377 make switchpanel configurable 2019-07-14 17:43:28 +01:00
Jeremy Sowden 4477ae4da4 Prefer TryExec to Exec when generating menu entries from XDG desktop files.
From the comments at the top of wmmenugen_parse_xdg.c:

  Since there is no passing of file name arguments or anything of the
  sort to applications from the menu, execname is determined as follows:

   - If `TryExec' is present, use that;
   - else use `Exec' with any switches stripped

However, Exec used to be preferred.  Changed code to prefer TryExec.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden 9330a021e5 Omit field-code in Exec fields when generating menu-entries from XDG desktop-files.
Exec fields in desktop-files may include field-codes which act as
place-holders for command-line arguments.  Previously the Exec arguments
were being passed through intact.  However, since Window Maker has no
support for expanding the field-codes, we now remove them and preserve
the remaining arguments.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden 41ab926090 Parse Exec fields when generating menu-entries from XDG desktop-files.
Exec fields in desktop-files are subject to escaping.  Unescape them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden b32ccee5cb Undo XDG string-escaping when generating menu-entries.
In XDG desktop files, string values are subject to escaping.  Undo this
when parsing them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden 6734646265 Use pointers as parameters instead of pointer-to-pointers.
Some functions expected pointers-to-pointers where pointers would do.
Changed them to use pointers.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Rodolfo García Peñas (kix) 6a044fe5ae load_jpeg.c Return NULL
The image is NULL, we can return NULL here.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 6dd1498f7c load_jpeg.c Style
This patch is just coding style. Removes some empty lines,...

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 090b761fde load_jpeg.c Removed dead code
This patch removes the code not used. Because the if block
check that buffer[0] is NULL, then, we don't need check it
again inside.

Image is not used yet, so is NULL. We can return NULL.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 49db946aa2 load_jpeg.c Clean code
This patch returns NULL, because the variable image is not used yet.

The patch also removes three lines:

- buffer[0] = NULL;       /* Initialize pointer to avoid spurious free in cleanup code */
  RErrorCode = RERR_BADIMAGEFILE;
  jpeg_destroy_decompress(&cinfo);
  fclose(file);
- if (buffer[0])
-    free(buffer[0]);

buffer is a local variable. The malloc is not used yet. So:

- We set the value to NULL, then check if is null to call free(). So the free()
  call is never used. We can remove the last too lines.
- We don't need set now to NULL, because the variable is empty (the
  initializated (or not) value is not used, and is destroyed as local variable
  when we returns, just one line later.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) a2cc89dd3d load_jpeg.c Removed goto
This patch removes the goto call. I copied the code after the bye: label and
I paste it in the goto-calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) de09ac5dad WPrefs.c Removed format-overflow warning
This patch adds some characters to the mbuf buffer, to allow the buffer size and some extra characters.

WPrefs.c: In function ‘loadConfigurations’:
../src/wconfig.h:400:17: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 1018 [-Wformat-overflow=]

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 3dce639aae Appearance.c Removed fallthrough warning
This patch adds some comments to remove the falthrough warning.

Appearance.c: In function ‘renderTexture’:
../WINGs/WINGs/WUtil.h:230:32: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define wwarning(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_WARNING, fmt, ## args)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Appearance.c:675:4: note: in expansion of macro ‘wwarning’
    wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
    ^~~~~~~~
Appearance.c:676:3: note: here
   case 'D':
   ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 00dffbe317 wmiv.c Removed indentation warning
This patch removes the indentation problem. The patch includes a long comment about the change.

wmiv.c: In function ‘main’:
wmiv.c:843:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    if (e.xclient.data.l[0] == delWindow)
    ^~
wmiv.c:845:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
     break;
     ^~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 7759d06851 wmgenmenu.c Removed format-truncation
This patch removes the format-truncation warning. The problem is because buf and comm are arrays with the same size (PATH_MAX). In the snprintf, comm is copied to buf, more some extra characters. The patch reduces the size for the array comm in the extra characters. Without the patch, the comm array is truncated. With the patch, the same characters are copied, without the warning.

wmgenmenu.c: In function ‘find_and_write’:
wmgenmenu.c:436:41: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
     snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
                                         ^
wmgenmenu.c:436:5: note: ‘snprintf’ output 5 or more bytes (assuming 4105) into a destination of size 4104
     snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) bf644338e4 gradient.c Removed implicit-fallthrough warnings
This patch adds the comments to remove the warnings.

gradient.c: In function ‘renderGradientWidth’:
gradient.c:162:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:163:2: note: here
  case 2:
  ^~~~
gradient.c:166:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:167:2: note: here
  case 1:
  ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 95561fba08 wtextfield.c: Removed multiple warnings
This patch removes the implicit-fallthrough warnings for GCC7. Just add the FALLTHRU comment.
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) a0b223263e wtext.c Remove warnings
This patch removes the FALLTHRU warnings in wtext.c. Only includes the comments for GCC7.

wtext.c: In function ‘handleActionEvents’:
wtext.c:2508:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (event->xbutton.button == Button2) {
      ^
wtext.c:2547:2: note: here
  case ButtonRelease:
  ^~~~
wtext.c: In function ‘handleTextKeyPress’:
wtext.c:2307:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *buffer = '\n';
   ~~~~~~~~^~~~~~
wtext.c:2308:2: note: here
  default:
  ^~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 2555413838 wruler.c Remove format-truncation warning
This patch removes the format-truncation error. The warning is because c has size of 3, but using "%d" is not possible to store the value.

wruler.c: In function ‘paintRuler.part.0’:
wruler.c:184:28: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=]
    snprintf(c, sizeof(c), "%d", ++j);
                            ^~
wruler.c:184:27: note: directive argument in the range [1, 2147483647]
    snprintf(c, sizeof(c), "%d", ++j);
                           ^~~~
wruler.c:184:4: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 3
    snprintf(c, sizeof(c), "%d", ++j);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The value "j" is the result of "m < w". w is the result of rPtr->view->size.width - rPtr->margins.left;, and both variables are unsigned int. So the value for w is an unsigned int and m is related to i. m cannot be greater of unsigned int.

	i = j = m = 0;
	w = rPtr->view->size.width - rPtr->margins.left;
	while (m < w) {
		XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
			  rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
		if (i != 0 && i % 8 == 0) {
			snprintf(c, sizeof(c), "%hu", ++j);
			WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
				     rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
		}
		m = (++i) * 10;
	}

The printf modifier should be unsigned int.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 3e3f06a7be widgets.c Removes implicit-fallthrough warning
This patch removes this warning:

widgets.c: In function `renderPixmap':
widgets.c:385:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (mask)
        ^
widgets.c:388:4: note: here
    case '.':
    ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 1f80c82091 wcolorpanel.c Removed hsbInit warnings
This patch removes these warnings in the hsbInit function.

wcolorpanel.c: In function ‘hsbInit’:
wcolorpanel.c:3456:16: warning: ‘%u’ directive writing between 1 and 5 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(tmp, "%d", value[0]);
                ^~
wcolorpanel.c:3456:15: note: directive argument in the range [0, 65535]
  sprintf(tmp, "%d", value[0]);
               ^~~~
wcolorpanel.c:3456:2: note: ‘sprintf’ output between 2 and 6 bytes into a destination of size 4
  sprintf(tmp, "%d", value[0]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The problem is that the hue variable in the RHSVColor struct. This variable is not an integer, is a shor variable, so using the printf using the "%d" modifier spects an integer. Using a "%hu" prints a unsigned short value.

typedef struct RHSVColor {
    unsigned short hue;	       /* 0-359 */
    unsigned char saturation;      /* 0-255 */
    unsigned char value;	       /* 0-255 */
} RHSVColor;
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) fb5f6c30c0 wcolorpanel.c: Remove warning in rgbIntToChar
This patch removes this warning. The default case should not be used.

wcolorpanel.c: In function ‘rgbIntToChar’:
wcolorpanel.c:2392:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, value[1]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) 972d85610a wcolorpanel.c Avoid compiler warning
This patch removes this warning. The patch adds a switch case that never should happend.

wcolorpanel.c: In function ‘rgbInit’:
wcolorpanel.c:3403:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, panel->color.rgb.green);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix) f0f95165e4 WINGs/selection.c Removed compiler warning
This patch removes this warning:

selection.c:265:64: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
  wdata = WMCreateDataWithBytesNoCopy((void *) data, len * bpi, (WMFreeDataProc *) XFree);

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2019-06-20 22:04:31 +01:00
Tim Taenny f895b906a4 Adjusted size of the Legal Information panel
With the changes to the layout, which were introduced in the
previous patch series, and the correction of the default font
size, the Legal Information panel was too small to display the
complete text.
It has been set to a sufficient size.
2019-06-19 18:06:53 +01:00
Tim Taenny 5ab9b7c6be Renamed the ScaleX/Y macros and their local variables
The names of the macros and the local variables that they use
have been changed to make them less "user-space" like.

    ScaleX -> WMScaleX
    ScaleY -> WMScaleY
    fw     -> wmScaleWidth
    fh     -> wmScaleHeight
2019-06-19 18:06:53 +01:00
Tim Taenny 1e490f8233 Adjusted scale factors in ScaleX and ScaleY macros
The scale factors in the macros were based on the assumption that
the default font size was 11. But the actual default font size is
12. This value is specified as DEFAULT_FONT_SIZE in
WINGS/configuration.c.
2019-06-19 18:06:53 +01:00
Tim Taenny ba3df2599d Use fixed font size in original WMCreate*Panel functions
Instead of just assuming that the size of the system font has not
been changed by the user, the WMCreateAlertPanel,
WMCreateInputPanel and WMCreateGenericPanel functions now use a
fixed default font size of 12, so that changing the system font's
size in WPrefs.app does not break the fixed layouts of these panels.
("12" is specified as DEFAULT_FONT_SIZE in WINGS/configuration.c)
2019-06-19 18:06:53 +01:00
Tim Taenny c803218ed1 New functions for the creation of scaled panels (WMCreateScaled*Panel)
To prevent breaking applications depending on the static layout
behavior of the WMCreateAlertPanel and WMCreateInputPanel functions
in WINGs, the scaling functionality has been moved to the new
functions WMCreateScaledAlertPanel and WMCreateScaledInputPanel.

The system dialogs (wMessageDialog, wExitDialog, etc.) now use the
new functions, thus keeping the improved layout introduced in the
previous patches.
2019-06-19 18:06:53 +01:00
Carlos R. Mafra 6c6853ea30 util: add wmiv entry to README 2019-06-15 16:49:34 +01:00
Tim Taenny b48b503eb1 Improved layout of the Info Panel
Instead of relying on static pixel values for position and size of
the widgets, the info panel now scales its widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny 1c8b680e3d Improved layout of the Legal Panel
Instead of relying on static pixel values for position and size of
the widgets, the legal panel now scales its widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny 5eeaf6b890 Improved layout of the Icon Chooser Panel
Instead of relying on static pixel values for position and size of
the widgets, the icon chooser panel now scales its widgets based
on the selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny f9236c8d20 Improved layout of the Input Panels
Instead of relying on static pixel values for position and size of
the widgets, the input panels now scale their widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny 26bb94a8e7 Improved layout of the Alert Panels
Instead of relying on static pixel values for position and size of
the widgets, the alert panels now scale their widgets based on the
selected system font size.
2019-06-12 23:42:27 +01:00
Tim Taenny b185d46286 Added ScaleX and ScaleY macros to WINGs
To reduce code duplication the ScaleX and ScaleY macros have been
moved to WUtil.h. Along with the function WMGetScaleBaseFromSystemFont
these macros can be used in all panels to scale the widgets based on
the current system font size instead of giving fixed pixel sizes which
messes up the panels if a larger system font is selected in WPrefs.

Use the macros in the following way:

    instead of   WMResizeWidget(widget, 128, 64);
                 WMMoveWidget(widget, 32, 32);

    use          int fw, fh;
                 WMGetScaleBaseFromSystemFont(scr->wmscreen, &fw, &fh);
                 WMResizeWidget(widget, ScaleX(128), ScaleY(64));
                 WMMoveWidget(widget, ScaleX(32), ScaleY(32));
2019-06-12 23:42:27 +01:00
Tim Taenny 8f29bdc690 Improved layout of the widgets in the DockAppSettingsPanel
Instead of relying on static pixel values for position and size of
the widgets, the DockAppSettingsPanel now scales its widgets based
on the selected system font size.
2019-06-12 23:42:27 +01:00
Christophe CURIS e2cfed3377 Do not stop compilation if library Xmu is not found
We use only 1 function from this library, and it is in a case that should
be rare nowadays: displays with indexed color.
This commit makes it acceptable to compile if the library is missing.
2019-05-04 14:50:48 +01:00
Christophe CURIS 4665972175 Change the way the ChangeLog date is extracted for Texi2txt generated docs
When building into another directory than in the source, the hard-coded
relative path to the changelog will fail finding the file, causing an empty
date in the generated file when '@today' is used.

This patch is making sure the ChangeLog is taken in the source directory to
avoid any problem.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:21:00 +00:00
Christophe CURIS 8606ae9a83 WINGs: simplify code
It looks like the original code was expecting the side effect of specifying
a length in the %d to smartly truncate the number, which it does not.
The new code has the same behaviour without extra complexity.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Christophe CURIS 070f0ad8f4 WPrefs: Dead code removal
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Christophe CURIS 2913ac0f09 Do not allocate memory for a temporary buffer
This kind of things participates in memory fragmentation, so it is
generally a bad practice when an on-stack allocation is enough.
Took opportunity to reduce the buffer size, there's no point in
overallocating memory (the new size being still way too much).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Christophe CURIS dae63b5e96 WPrefs: Prefer use of 'sizeof' instead of hard-coded values
Hard-coding a value is prone to errors when maintaining the code; using the
builtin C macro 'sizeof' is a much safer choice.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2019-02-22 16:08:36 +00:00
Doug Torrance 738a78b3e2 Replace GNUSTEP_USER_ROOT environment variable with WMAKER_USER_ROOT
As reported in Debian bug #922284 [1]:

    As evident from the prefix, GNUSTEP_USER_ROOT is a GNUstep variable and
    Window Maker should not set it.  Furthemore, it has been deprecated for
    12 years already.  As of gnustep-make/2.7.0-4 the GNUstep build system
    is configured in strict v2 mode which makes it impossible to compile
    GNUstep software.  In a terminal started from a Window Maker session:

    yavor@aneto:/tmp/gorm.app-1.2.24$ make
    This is gnustep-make 2.7.0. Type 'make print-gnustep-make-help' for help.
    Running in gnustep-make version 2 strict mode.
    rm -f InterfaceBuilder; \
    ln -s GormLib InterfaceBuilder
    /usr/share/GNUstep/Makefiles/config-noarch.make:121: *** GNUSTEP_USER_ROOT
    is obsolete.  Stop.

    It is also impossible to build gnustep-make from pristine upstream
    source:

    yavor@aneto:/tmp$ wget -q
      ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.7.0.tar.gz
    yavor@aneto:/tmp$ tar xzf gnustep-make-2.7.0.tar.gz
    yavor@aneto:/tmp$ cd gnustep-make-2.7.0/
    yavor@aneto:/tmp/gnustep-make-2.7.0$ ./configure
    ...
    yavor@aneto:/tmp/gnustep-make-2.7.0$ make
    config-noarch.make:121: *** GNUSTEP_USER_ROOT is obsolete.  Stop.

    Note that the majority of GNUstep users use Window Maker as their window
    manager and many of them build GNUstep software from source, mostly
    because of the GNUstep Objective-C runtime which depends on Clang
    (Debian packages use GCC and the GCC/GNU runtime).

Our solution is to replace the GNUSTEP_USER_ROOT environment variable with our
own environment variable, WMAKER_USER_ROOT.  This is documented in NEWS.

[1] https://bugs.debian.org/922284
2019-02-17 18:44:33 +00:00
Stig-Ørjan Smelror 1dace5699f Drop support for Imagemagick version < 7
Had to do a few modifications to get WM to build with Imagemagick 7.

Attached is the diff from the latest git checkout.

Cheers,
Stig
2019-02-12 19:14:01 +00:00
Tim Taenny 5a95631091 Added expert option for WrapAppiconsInDock property to WPrefs
In 2013 Daniel added the functionality to wrap icons, which are
attached to the dock, around the screen edges when the dock is
being moved vertically.
This patch adds an expert option to WPrefs.app for setting the
property which enables/disables this feature.

Remark: In my opinion, the default value for that property should
        be changed to NO, as this is also the default behavior in
        NeXTSTEP. It is handy to be able to move all these icons
        out of sight when working with maximized application
        windows.
2019-02-05 21:32:04 +00:00
Tim Taenny 2427200c3e Added feature: automatic scaling of application icons
If the option "Enforce icon margin" is selected, application window
icons will be selected or scaled so that they only use 75% of the
available icon_size.
Even if the feature is not enabled, this change will scale down
large application icons to icon_size, so that icons can be used
that were rejected by the previous implementation of findBestIcon.
(Example: The Qt Creator icon never showed before, because it is
only provided in 128x128 resolution. Now it's visible.)
2019-01-31 17:22:49 +00:00
Tim Taenny d6c1ac3ecf Added icon feature option to WPrefs: Enforce icon margin
The current findBestIcon function usually selects an icon image
that almost completely fills up the (default) 64x64 pixels of an
icon. As Dan noted in the function, the icon images should use only
75% of the available space, which would result in room for the
miniwindow title and better overall aesthetics.

This feature option provides for enabling such an automatic "icon
shrinking" functionality.

Note: This commit only introduces the new option, not the actual
      image shrinking.
2019-01-31 17:22:49 +00:00
Tim Taenny 9b5eaa3d3e Use popup button for animation style instead of option group in WPrefs
To make some room for an additional icon option (yet to be committed)
the options group for selecting the iconification animation is
replaced by a popup button. This allows for adding at least two more
checkboxes in the options and makes adding new animation styles less
painful.
2019-01-31 17:22:49 +00:00
Tim Taenny 2beb5f2c52 Fixed icon loading during Attribute Inspector startup
When opening the "Icon and Initial Workspace" panel of the Attribute
Inspector, the Miniwindow Image and the corresponding text field were
always empty, even if an icon had been selected, applied and saved
before. The file name was not loaded from the database on startup
of the inspector window.

With this change, the icon and the text field are properly set on
startup of the inspector window.
2019-01-30 23:43:23 +00:00
Carlos R. Mafra f1809a7786 wmgenmenu: add a few programs 2019-01-22 22:25:06 +00:00
Gaspar Chilingarov 8b919b0d33 support moving window between heads using keyboard
Window Maker allows to perform practically all operations with windows
using only keyboard. One of the actions so far which required using
mouse was dragging window from one head (monitor) to another.

This patch introduces support for keyboard shortcuts. These shortcuts
move windows in circular fashion (if you have 3 and more monitors).

In case of 2 or 3 monitors arranged horizontally - window will just move
right/left.

In case of 3x3 setup - it is impossible to move window to central
monitor with keyboard.

- preserves window position and size (if display sizes are same)
- otherwise tries to fit window to smaller display
2018-12-16 10:13:50 +00:00
Doug Torrance d13b78bdde configure: Fix pkg-config variable typo.
The variable set by PKG_PROG_PKG_CONFIG which points to the pkg-config
utility is PKG_CONFIG, not PKGCONFIG.  The latter was previously used
when trying to detect the presence of the MagickWand library when Window
Maker was built using --enable-magick.
2018-08-08 08:51:45 +01:00
Gaspar Chilingarov 6668715402 Detect and override illegal window size hints
The problem - when VirtualBox starts virtual machine, window has very
small height (couple of pixels) and it requires some manual fiddling
to resize it to something usable.

See related bugs here:

https://www.virtualbox.org/ticket/14718#comment:19 - small horizontal
line in the middle of the screen is newly opened virtual machine's
window.

https://www.virtualbox.org/ticket/15863

Inspecting with xdebug and xprop reveals that VirtualBox sends wrong hints:

Request(12): ConfigureWindow window=0x0660000a values={x=27 y=559
width=720 height=65512}

Which is interpreted by X server wrongly and shown with xprop as

WM_NORMAL_HINTS(WM_SIZE_HINTS)
:
                user specified location: 27, 559
                user specified size: 720 by -24
                program specified minimum size: 254 by 109
                window gravity: Static

Some part of X11 interprets such large value as signed int and wraps
it to negative value.

The solution will be if program requests such big window - detect it,
ignore requested size and resize it to some reasonable defaults.

Disclaimer - I tested it only on Ubuntu 16.04, but should apply to
another systems as well - see bug reports.
2018-05-21 13:02:22 +01:00
Doug Torrance 100745d356 setstyle: Add support for fpixmap ("fillscale") textures 2018-05-15 19:55:28 +01:00
Doug Torrance 7c89ca2551 menu: Fix broken "Save Theme" option.
This option had been broken for several reasons:
* The getstyle utility does not replace the #usergnusteppath# macro which
  was passed to it by the menu.
* When processing the USER_THEMES_DIR macro, the menu inserts a space
  afterwards, and so the directory and filename were passed to getstyle
  as two separate arguments.
* It used the old, pre-0.50.0 theme format.

By using the -p option to getstyle, we can avoid these issues, as we don't
need to specify the directory *and* it uses the 'new' (since 1999) themepack
format.
2018-05-15 19:43:25 +01:00
Doug Torrance 0c737bc834 Add new Adwaita style to Makefile. 2018-05-15 14:26:51 +01:00
Doug Torrance b3f8d0997b New Adwaita style which approximates the look of the default GTK theme. 2018-05-15 10:13:48 +01:00
Doug Torrance 673ea18020 Update mailing list links to new Google Groups. 2018-05-14 16:51:23 +01:00
Bad Sector c89ec25c80 Fixes missing appicons after restarting Window Maker
Fixes the bug where if the icon image is accidentally set to
nothing or the image file is deleted, the appicon keeps losing
its icon (it resets to the default cube icon) when Window Maker
exits/restarts (depending on how the user cleared the icon this
may persist even after redocking the application if information
about the application window is still in the WM).  One way to
easily see this bug is to open the main window's attributes and
press the Save button (no need to do anything else) as this
clears the icon file (this is a separate bug that needs to be
fixed but it is more of a minor UI bug since clearing the image
should simply reset the icon to the application provided one if
the Ignore client supplied icon is not set).  Another way to
see it is to open the properties box in a docked application
that is not running and clear the image field.  After either of
these two actions are performed, restart Window Maker and see
that the icons are missing.

This patch fixes the above bug by calling save_appicon when the
appicon object is created and the application provided icon is
already available (window maker actually tries to save the icon
at an earlier stage but this is done as a side effect of
"painting" the dock icon - which also saves the icon - but this
is done too early, before ownership information is available).

Note that this bug seems to be a regression introduced from
commit 9c4b19d8aa (or one of the
related commits around the same time, they seem to be a bit too
aggressive in not saving icons).  This patch addresses the
concern in that commit about only saving the icon for docked
applications.
2018-04-18 10:09:38 +01:00
Bad Sector 569fbff07c wmaker: Add new advanced option to ignore decoration changes from clients.
This adds an option (IgnoreDecorationChanges in plist) for windows to
ignore any requests from the clients for changing decorations. Since the
default state for any window pre-request is to have all decorations visible
this basically means that applications cannot hide any of the titlebar,
sizing bar, titlebar buttons, etc and any hint that causes these elements
to be hidden will be followed by a restoration if this option is set.

 This is useful for broken clients (e.g. Steam) and clients that force
subpar client side decorations. It is basically a per-window setting of the
global advanced option to ignore Gtk hints, except that it also applies to
non-Gtk applications.
2018-02-14 08:16:55 +00:00
Bernhard M. Wiedemann 36879de261 texi2txt: Use ChangeLog date instead of build date
in order to make builds reproducible. See
https://reproducible-builds.org/
for why this is good.

This date call works with GNU date and BSD date. Without this patch,
/usr/share/doc/packages/WindowMaker/README.i18n will differ in the
line An alternative solution could use the $SOURCE_DATE_EPOCH
variable defined in
https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2017-12-24 11:58:20 -02:00
Alwin bfd88e07e6 wmaker: Adding copyright year 2017
The Info Panel didn't show the current year.
2017-09-14 21:08:26 +02:00
Alwin 81b89f6a4c wmaker: Fixing a menu typo
There was a typo in background.menu. Although the menu worked fine, it
caused these errors in the logs:

  wmaker(WMReadPropListFromFile(proplist.c:1543)): error: error reading
    from file '/usr/share/WindowMaker/Backgrounds'
2017-09-14 21:08:26 +02:00
Alwin 6cfc71d40a Translations: Frisian language files for WPrefs and menus updated
Compacting two translations to fit the available space; two new strings.
The menus are now split like the English ones, using appearance.menu.fy
and background.menu.fy. A new comment was added to menu.fy.in.
2017-09-14 21:08:26 +02:00
Alwin ccc676a2bf Translations: Dutch language files for WPrefs and menus updated
Compacting a translation to fit the available space; two new strings.
The menus are now split like the English ones, using appearance.menu.nl
and background.menu.nl. A new comment was added to menu.nl.in.
2017-09-14 21:08:26 +02:00
Doug Torrance 2dbd778ed4 WPrefs: Inform user which menu file is being edited. 2017-08-19 15:59:13 +01:00
Doug Torrance f63635dd17 WPrefs: Save menu back to the file we read it from.
Previously, we saved any modifications back to WMRootMenu, regardless of
the file we read the menu from.
2017-08-19 15:59:13 +01:00
Doug Torrance 97702618de WPrefs: Display warning when attempting to modify a read-only menu file. 2017-08-19 15:59:13 +01:00
Doug Torrance b68a1994c2 debian: Remove patch 54_Debian_wmmacros.diff.
This patch is now unnecessary, as we have removed the SETSTYLE and
LOCAL_*_DIR macros and have added the USER_*_DIR upstream.
2017-08-19 11:14:38 +01:00
Doug Torrance fe459fbab3 menu: Add USER_*_DIR macros.
Inspired by the Debian patch 54_Debian_wmmacros.diff.  These macros are
actually already referenced in appearance.menu and background.menu, but
only Debian installations have taken advantage of them.

We use the new #usergnusteppath# macro to reference the user GNUstep path.
2017-08-19 11:14:38 +01:00
Doug Torrance 5f2dac318c menu: New macro #usergnusteppath# for user GNUstep directory
This macro is used when handling directories with OPEN_MENU, e.g., to list
available image files for setting the workspace background.

When parsing a menu file, we replace any instances of #usergnusteppath#
with either GNUSTEP_USER_ROOT or ~/GNUstep if the former is not set.  In
this way, authors of menu files do not have to worry about whether users
will have this variable set or not.

We also document this feature in WindowMaker/menu.in, which generates the
default English language old-style menu and currently contains the existing
documentation for the Window Maker menu system.
2017-08-19 11:14:38 +01:00
Doug Torrance bfda22ef1a menu: Remove unused LOCAL_*_DIR macros.
We remove the macros LOCAL_THEMES_DIR, LOCAL_STYLES_DIR,
LOCAL_ICON_SETS_DIR, and LOCAL_BACKGROUNDS_DIR.

They were only referenced in the Debian patch 54_Debian_wmmacros.diff, which
set them to /usr/local/share/WindowMaker/{Themes,Styles,etc.}.

In a default installation, THEMES_DIR, STYLES_DIR, etc. coincide exactly
with these paths.  In a Debian installation (which defaults to /usr/share
instead of /usr/local/share), it seems unlikely that a user would have these
files in both locations.
2017-08-19 11:14:38 +01:00
Doug Torrance 46daa76f77 menu: Remove unused SETSTYLE macro. 2017-08-19 11:14:38 +01:00
Doug Torrance 02cc702029 WPrefs: Edit proplist menus referenced by WMRootMenu.
Previously, WPrefs could only be used to edit the menu specified in
WMRootMenu.

In a recent commit, the ability to specify a menu in proplist format defined
in another file which is referenced by WMRootMenu was added.  However, if a
user attempted to edit such a menu in WPrefs, an error dialog appeared.

We add the ability for WPrefs to read such a menu.  After the user makes any
changes, the result is stored in WMRootMenu, and *not* the original file.
2017-08-19 11:14:38 +01:00
Doug Torrance 6f195b18fc WINGs: WMIsPL* functions return False if proplist is null.
Previously, calls to WMIsPLString, WMIsPLData, WMIsPLArray, and
WMIsPLDictionary would result in a segfault if the argument was null.
This could happen, e.g., if we are checking which type of proplist
was just parsed from a file, but the parsing failed.

These functions now return False in this case.
2017-08-19 11:14:38 +01:00
Doug Torrance 101ef6f28e menu: For consistency, use appearance.menu for English-language menus. 2017-08-18 02:14:11 +01:00
Doug Torrance 5a5595f76c menu: Add WPrefs to appearance.menu.
WPrefs appears under the 'Appearances' submenu of both menu and plmenu.
2017-08-18 02:14:11 +01:00
Doug Torrance 1a5abe9d84 menu: Add Bluemarine to solid background color options.
This color was present in menu and plmenu, but not background.menu.
2017-08-18 02:14:11 +01:00
Doug Torrance d364afff02 menu: Write data directory during build instead of with wmaker.inst.
Many of the menu files contain the macro #wmdatadir# as a placeholder for
the data directory containing Window Maker themes, styles, background
pixmaps, etc.  This macro is replaced by the the actual path to the data
directory (by default /usr/local/share/WindowMaker) by the wmaker.inst
script, but only when copying WMRootMenu to the user's home directory.

Instead, we replace the macro during the build.  This way, *every* menu
file has the correct path.

Note that several of the files in question were not previously generated
during build.  These have been renamed with a .in extension.
2017-08-18 02:14:11 +01:00
Doug Torrance 273d17a0be menu: Include all aspect ratio options for background pixmap.
The background menu was missing "centered", "maximized", and "filled".

This closes Debian bug #85591 [1]:
  The current default for the scaled backgrounds menu is to use
  scaling without keeping the aspect ratio.

  This very rarely yields to a usable background.

  Could the default be changed to scaling with keeping the aspect
  ratio ?

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=85591
2017-08-18 02:14:11 +01:00
Doug Torrance d6f754e747 debian: Update with version 0.95.8-2 packaging. 2017-08-15 10:34:03 +01:00
Doug Torrance b07075aed3 wmaker: Allow WMRootMenu to reference menu files in proplist format.
Previously, WMRootMenu could either be a menu file in proplist format
itself, or it could reference another menu file in the old style format.

If WMRootMenu referenced another menu file in proplist format, this file
was parsed assuming it was in the old style format and thus failed, as
observed by Andreas Metzler [1].

In this patch, we first attempt to parse a referenced menu file as if
it were in proplist format.  If this fails, then we fall back on the old
style format.  This has the disadvantage of spamming the terminal with
various parsing errors if the menu file is in the old style format.

[1] https://www.mail-archive.com/wmaker-dev@lists.windowmaker.org/msg07097.html
2017-08-13 10:34:46 +01:00
Doug Torrance ad4545b1d8 debian: Update with version 0.95.8-1 packaging. 2017-07-09 22:26:51 +01:00
Doug Torrance ee36395ddf debian: Update with version 0.95.8-1~exp2 packaging. 2017-07-08 23:18:22 +01:00
Doug Torrance ff865c31f0 wmmenugen: Sort menu entries with no category into 'Other'. 2017-07-07 09:59:29 +01:00
Doug Torrance adc1687f98 wmmenugen: Use 'Other' instead of 'Applications' for unknown categories.
From https://standards.freedesktop.org/menu-spec/latest/apa.html:

 Category-based menus based on the Main Categories listed in this
 specification do not provide a complete ontology for all available
 applications. Category-based menu implementations SHOULD therefore provide
 a "catch-all" submenu for applications that cannot be appropriately placed
 elsewhere.

Emphasis on *submenu*.  By using 'Applications', these menu entries were
sorted into the top level.
2017-07-07 09:59:29 +01:00
Doug Torrance ac0690b324 wmmenugen: Add reserved categories.
From https://standards.freedesktop.org/menu-spec/latest/apas03.html:

Reserved Categories have a desktop-specific meaning that has not been
standardized (yet). Desktop entry files that use a reserved category MUST
also include an appropriate OnlyShowIn= entry to restrict themselves to
those environments that properly support the reserved category as used.
2017-07-07 09:59:29 +01:00
Doug Torrance c261f8ec35 wmmenugen: Add missing 'Science' menu category.
See https://standards.freedesktop.org/menu-spec/latest/apa.html
2017-07-07 09:59:29 +01:00
Christophe CURIS e037ae3684 util: fix parsing of XDG menus with multiple groups
The specification for XDG menu files allows having more than one group and
assumes no constraint on their order. The original code assumed that once
the proper group marker was found, everything after was part of it, causing
misinterpretation of some data, like taking the wrong launch command.

This patch stops the parsing of the menu XDG file when a new group is
found, hence implementing the expected behaviour.

Reported-by: Andreas Metzler <ametzler@bebt.de>
2017-07-03 14:45:26 +01:00
Doug Torrance 83f0b764e6 WINGs: Set widget background pixmaps before realization.
Previously, when WMSetWidgetBackgroundPixmap() was called prior to
WMRealizeWidget(), no background pixmap was actually set.

This is because while the CWBackPixmap bit is correctly set to 1, the
CWBackPixel bit remains set to 1.  When XCreateWindow() is finally
called during realization, the background pixel takes precendence over the
background pixmap.

We fix this by setting CWBackPixel to 0 when setting CWBackPixmap to 1 and
vice versa.
2017-03-22 09:26:24 +00:00
Doug Torrance 3140c09240 wmaker: Consistent configuration options.
The default configuration options are given in two places in the source
code:
  - src/default.c
  - WindowMaker/Defaults/WindowMaker.in

The defaults are initially set in the former, but are then overwritten by
the latter.

Ideally, the default options in these two locations should coincide.
However, there are currently several issues.
- Many of the options are missing from WindowMaker/Defaults/WindowMaker.in
- Many of the options have conflicting defaults between the two locations.
- A number of options given in WindowMaker/Defaults/WindowMaker.in no longer
  exist.

In this patch, we bring the defaults in the two locations in line with one
another.  We have given preference to the defaults in W/D/WindowMaker, as
these are the one users have been used to.

Some of the paths in IconPath and PixmapPath have been removed.  In
particular, the various system pixmap paths (/usr/include/X11/pixmaps,
/usr/share/pixmaps, and /usr/local/share/pixmaps) have been removed in
favor of PIXMAPDIR, which is specified by the user at build.  Also,
/usr/share/icons has been removed from IconPath.  The root of this
directory will contain very few icons, as the icons themselves are located
in subdirectories corresponding to XDG icon themes.

We add a comment to src/defaults.c to remind future developers who
add or remove options to change the default values in both locations.

We also take the opportunity to remove the unused DEF_INFO_TEXT_FONT
macro.
2017-03-22 09:26:24 +00:00
Doug Torrance 8fba9945e0 WPrefs: Properly read system fonts in font configuration panel.
Previously, only the user's WMGLOBAL file would be read to determine the
current WINGs fonts (System Font and Bold System Font) in the Font
Configuration panel.  It is quite possible that this information would
not be in the user's WMGLOBAL file, but instead in the system WMGLOBAL
file.

We instead use the WMDefaultSystemFont and WMBoldDefaultSystemFont
functions to get this information.
2017-03-20 18:06:12 +00:00
Carlos R. Mafra 30cd22859a Merge branch 'master' into next
I forgot to add the wmaker 0.95.8 commit back into the next
branch. Doing it now.
2017-03-20 18:03:24 +00:00
Doug Torrance e13cfcd093 debian: Don't try to install scripts/manpages which have been removed. 2017-03-16 15:26:39 +00:00
Doug Torrance c2a03a3de5 debian: Update with version 0.95.8-1~exp1 packaging. 2017-03-15 16:50:42 +00:00
Doug Torrance db6b50e6c1 doc: Remove manpage for upgrade-windowmaker-defaults script.
This script is only available in the Debian package, is very out of date,
and will be soon be removed.
2017-03-12 00:12:18 +00:00
Doug Torrance fa8121ee61 wmaker/WPrefs: Remove legacy support for deprecated apercus.
Replaced by minipreviews in December 2014.  Over two years have passed.
2017-03-12 00:12:18 +00:00
Doug Torrance f6320d4fa5 configure: Remove deprecated --with-nlsdir option.
Deprecated in December 2014, and over two years have passed.
2017-03-12 00:12:18 +00:00
Doug Torrance cea5f6107c WINGs/wrlib: Remove deprecated get-*-flags scripts.
These have been replaced by pkg-config.  Christophe left a note in January
2015 to remove them, and this time has now passed.
2017-03-12 00:12:18 +00:00
Carlos R. Mafra 5d643a67dd Window Maker 0.95.8 2017-03-11 11:10:26 +00:00
Doug Torrance 9087222d1e doc: Add new --with-defsdatadir option to INSTALL-WMAKER. 2017-03-10 20:31:26 +00:00
Doug Torrance dede386b3d debian: Remove patch 51_wmaker_man.diff; applied upstream. 2017-03-10 17:25:32 +00:00
Doug Torrance b2b2ebad4c NEWS: Add note about new global defaults directory configuration. 2017-03-10 17:25:32 +00:00
Alwin d4a0b2f115 Translations: Frisian language file for WPrefs updated
A few new entries were translated.
2017-03-10 14:53:38 +00:00
Alwin 2411298ff6 Translations: Dutch language file for WPrefs updated
A few new entries were translated.
2017-03-10 14:53:38 +00:00
Doug Torrance cdaa7a4520 doc: Add info about user icons directory to manpage.
Based on patch in Debian package.  See:
debian/patches/51_wmaker_man.diff
2017-03-10 10:20:58 +00:00
Doug Torrance 7df224440b doc: Update global autostart/exitscript path in manpage. 2017-03-10 10:20:58 +00:00
Doug Torrance 01ad3ead5d doc: Use new defsdatadir variable to specify defaults directory in manpage. 2017-03-10 10:20:58 +00:00
Doug Torrance 6fa1c0c009 configure: Add option to specify global defaults directory.
Previously, this was only (partially) possible by redefining the macro
GLOBAL_DEFAULTS_SUBDIR.  This told Window Maker to look for the global
config files in a particular subdirectory of SYSCONFDIR.

However:
* This is undocumented.
* GLOBAL_DEFAULTS_SUBDIR is ignored when installing the config files.  They
  are always installed to SYSCONFDIR/WindowMaker.

To solve these issues, we add a "--with-defsdatadir" option to configure
which allows a user to specify the global defaults directory.
2017-03-10 10:20:58 +00:00
Doug Torrance ac92f1a844 wrlib: Bump soname version to 6.
Usually, a soname bump is reserved for when an interface is added, changed,
or removed.  This has not happened to wrlib.  However, I think there is a
special circumstance that warrants the bump.

In particular, there are two versions of wrlib version 5 in the wild:
* The one that shipped with wmaker 0.95.6, which uses symbol version
  LIBWRASTER3.
* The one that shipped with wmaker 0.95.7, which uses symbol version
  LIBWRASTER5.
This was reported in Debian bug #811304 [1].  Binaries which were built
against the older wrlib won't run after upgrading to the newer one, even
though they are supposedly using the same soname version.

(We get around this currently in Debian by patching the old LIBWRASTER3
symbol version back in.)

I propose we bump to version 6 and put this mess behind us.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811304
2017-03-10 10:20:58 +00:00
Doug Torrance 21d3fadebb ChangeLog: Update with commits since v0.95.7. 2017-03-10 10:20:58 +00:00
Doug Torrance 3986629590 debian: Update with version 0.95.7-8 packaging. 2017-03-10 01:21:32 +00:00
Cyrus Rahman c052addd1d wmaker: Do not place icons under the dock
While I love the new maximizing functions, in the process of
developing them the code to keep icons from under the dock was lost.

I have created a patch to prevent this problem.
2017-03-06 15:19:55 +00:00
gryf 6e4698fe11 Fixed couple of compilator warning and removed unused macros. 2017-02-25 10:19:52 +00:00
gryf 3617e4c20c Removed trailing whitespaces from readme files. 2017-02-25 10:19:51 +00:00
gryf f3fdf0b8dd Refactoring handleMaximize() function
Simplify handleMaximize function for "not effective" case, where there
was couple of duplicate code, now there is one indentation level less
and readability increased.
2017-02-21 19:24:36 +00:00
gryf 9328ba5b3c Implementation for moving mouse pointer within the maximized window.
Mouse pointer can be now moved together with window if keyboard was used
for arrange maximized windows on screen. This feature can be turned on
in WPrefs.app in Expert tab by selecting "Move mouse pointer with half
MAXIMIZED windows.", or setting "PointerWithHalfMaxWindows" to "Yes" on
~/GNUstep/Defaults/WindowMaker file.
2017-02-21 19:24:36 +00:00
gryf c9fbcda0b0 New option for moving mouse pointer along with half-maximized windows.
This option might be usable for using keyboard for moving windows
around. This option will enable moving mouse pointer for such windows.
2017-02-21 19:24:36 +00:00
gryf eadb7f3ab2 Alternative way for traversing half-maximized windows.
Now it is possible for change a bit pattern for changing state between
half-maximized windows. Half maximized windows will become maximized if
there is issued half-maximizing shortcut in opposite direction. Issue
half-maximizing command on same direction on already maximized window,
will have no effect.
2017-02-21 19:24:35 +00:00
gryf 9e7987713f New option for enabling alternative half-maximized window movement.
Added new option to Window Maker for enabling alternative way for
half-maximized windows movement. Option can be found on Expert section
in WPrefs app.
2017-02-21 19:24:35 +00:00
gryf 62d62eebf1 Bugfix for moving windows between heads.
Previous bugfix introduced another regression. It fixed the issue with
size of the unmaximized window, but break new functionality. Revert back
code for maximizing using mouse, leaving out head detection for keyboard
actions, since it is already calculated.

Mouse actions for maximize also has to be fixed due to different
behaviour in original implementation - movement of the window which is
called in handleMaximize filter out MAX_KEYBOARD from argument passed to
the wMaximizeWindow, so that it will always assume that all the actions
have to be done on the head where mouse pointer resides. For moving
windows between heads feature, calculated head is always passed and
used, regardless of how maximizing was invoked (keyboard or mouse) and
mouse pointer position.
2017-02-21 19:24:35 +00:00
gryf 160f879cce Fixed wrong (re)stored dimensions for unmaximized window. 2017-02-13 20:01:53 +00:00
gryf 28da4c98e3 Added possibility for half-maximized windows to move across the screens.
Using MoveHalfMaximizedWindowsBetweenScreens option user can enable
ability for moving half-maximized windows not only within current
screen/head/display, but also to other heads, if they exists. Note, that
only vertically or horizontally maximized windows can be transfered to
another display. Quarter-maximized windows are not supported, since it
is ambiguous to predict in which direction such window should be moved.
2017-02-08 07:26:35 +00:00
gryf 17a47af160 Added option for ability to move half-maximized between heads.
Added new option to Window Maker preferences to enable half-maximized
windows movement on all available heads. Option can be found in WPrefs
app on Expert section.
2017-02-08 07:26:35 +00:00
gryf 014a315f3a Added wGetHeadRelativeToCurrentHead function
A new function for obtaining possible heads (displays) was added. It
allow to query for a head in four directions relative to the current
one.
2017-02-08 07:26:35 +00:00
gryf e2f8525728 Added 'head' parameter to wMaximizeWindow
Additional 'head' parameter will help to select head (display) where
window should be maximized.
2017-02-08 07:26:35 +00:00
gryf 002d415d02 Trivial cleanup: Removed unused defines. 2017-02-04 13:06:13 +00:00
Doug Torrance 92bc458fac configure: Use PKG_PROG_PKG_CONFIG macro to allow cross building.
Patch by Helmut Grohne <helmut@subdivi.de> to fix Debian bug #853236 [1]:

> wmaker fails to cross build from source, because it forces the use of
> pkg-config without $ac_tool_prefix. Discovering pkg-config with the
> PKG_PROG_PKG_CONFIG macro considers $ac_tool_prefix and thus makes cross
> compilation succeed. Please consider applying the attached patch after
> stretch is released.
>
> Helmut

[1] https://bugs.debian.org/853236
2017-01-31 01:44:56 +00:00
Doug Torrance 6f3dbfeaba debian: Update with version 0.95.7-7 packaging. 2017-01-29 10:07:59 -05:00
Doug Torrance 3426f8110b Look for plmenu in build directory when creating WMRootMenu.
Previously, plmenu already existed in the source directory, and that's where
make looked for it.  Now, however, it is generated to include the proper
path to WPrefs and therefore is in the build directory.

See
https://www.gnu.org/software/make/manual/html_node/Makefile-Basics.html
for more about this distinction.
2017-01-29 10:07:59 -05:00
Doug Torrance f9b2cf9747 Don't try and add removed file mkMakefile to distribution tarball. 2017-01-20 21:01:42 -05:00
Doug Torrance ad590811f6 Remove WindowMaker/mkMakefile script.
It was used to generate WindowMaker/Makefile.am, but hasn't been touched
since 1999.  Meanwhile, WindowMaker/Makefile.am has been changed manually
a number of times.
2017-01-20 19:51:12 -05:00
Doug Torrance d48a37060c Use wprefs_bindir output variable to set WPrefs path in menus.
The path to WPrefs has been hardcoded in many of the menu files to
/usr/local/GNUstep/Applications/WPrefs.app/WPrefs, which would only actually
work if the user ran something like:
     ./configure --with-gnustepdir=/usr/local/GNUstep
during build.

Instead, we add a .in extension to all menu files with this issue and use sed
to use the actual WPrefs path (given by the wprefs_bindir output variable) and
generate a new menu file.

A very similar idea is already used to generate the WMState file, which sets
WPrefs as the command for the Window Maker logo tile in the dock.

This patch fixes Debian bug #851737:
https://bugs.debian.org/851737
2017-01-19 18:40:13 -05:00
Doug Torrance 23417d9934 WPrefs: Update path for Debian menu 2016-11-13 15:52:06 +00:00
Bjørn Mork 5561199c87 wmaker: allow alt+tabbed windows over fullscreen
Fullscreen windows should only be on top when they are in focus. Change
the stacking level temporarily back to WMNormalLevel if the fullscreen
window loses focus due to an alt+tab operation.

Change the stacking level back to WMFullscreenLevel if the fullscreen
window receives the focus again.

Cc: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-12 23:21:00 +01:00
Bjørn Mork 6429847494 wmaker: fix stacking order of dock and fullscreen
This reverts the commits:
 311ab6b08c ("Raise fullscreened window")
 a504370f3b ("Remove WMFullscreenLevel")

Removing WMFullscreenLevel had the side effect that a dock or panel
having the _NET_WM_WINDOW_TYPE_DOCK type would stack on top of
fullscreen windows, obscuring part of them.  This is unwanted. No
other window should cover a focused fullscreen window:.
https://specifications.freedesktop.org/wm-spec/latest/ar01s09.html#STACKINGORDER

Simply raising the fullscreen window to the top of the stack of normal
windows is not sufficient if there are windows with higher stacking
levels present.  The separate WMFullscreenLevel is needed.

Cc: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2016-07-12 23:21:00 +01:00
Alexandru Lazar b7a1528833 getstyle: fix wcopy_file paths
Some (presumably stale) calls to wcopy_file used what appears to
be an incorrect destination which did not always exist. This patch
forces assets to be copied under <themedir>/<asset>, rather than
<themedir><absolute path of asset>. It works by first getting the
"new" path (i.e. the one that will be inserted in the property
list), which is relative to <themedir> (and appears to be always
in the root directory, too); it then copies the file to that path.

This *may* have been the original intended behaviour, as the one
it replaces clutters the path and leaks configuration data. In
addition, the style file seems to store only the file's name, not
the path relative to <themedir>, even when the file is copied with
its full hierarchy.

Signed-off-by: Alexandru Lazar <alazar@startmail.com>
2016-04-24 19:11:08 -04:00
Doug Torrance 2ea6162629 wmmenugen: Fix segfault; argv[argc] doesn't exist. 2016-04-24 19:05:34 -04:00
Doug Torrance 5a730d63b2 debian: Update with version 0.95.7-6 packaging. 2016-03-24 16:17:44 -04:00
Doug Torrance fd31b29d0d debian: Update with version 0.95.7-5 packaging. 2016-03-09 15:27:04 -05:00
Doug Torrance ebf2801f4a debian: Update with version 0.95.7-4 packaging.
Note that the patch 57_ignore_with-aix-soname.diff, mentioned in
debian/changelog, is not included as it has already been applied to the next
branch.
2016-02-15 13:37:34 -05:00
Doug Torrance 8b46f16205 debian: Update with version 0.95.7-3 packaging. 2016-02-10 07:52:54 +05:30
Doug Torrance 2da2045efa debian: Remove 56_ignore_runstatedir.diff.
This patch has now been applied in next, so its presence among the Debian
patches would cause quilt to fail for those trying to build packages from
next.
2016-02-10 07:52:54 +05:30
Doug Torrance 67e9e7e554 check-doc: Ignore with-aix-soname in check-cmdline-options-doc.sh
Control: tags -1 forwarded wmaker-dev@lists.windowmaker.org

libtool 2.4.4 will add a --with-aix-soname option.  Ignore it when checking
whether INSTALL-WMAKER is up to date.

Fixes Debian bug #814213 [1].  Proposed fix to Debian package at [2].

   From: Chris Lamb <lamby@debian.org>
   Subject: wmaker: FTBFS: Error: program option '--with-aix-soname' is not in
     the documentation './INSTALL-WMAKER'
   Date: Tue, 09 Feb 2016 09:59:14 +0100

   Dear Maintainer,

   wmaker fails to build from source in unstable/amd64:

     [..]

     make  check-local
     make[4]: Entering directory '/home/lamby/temp/
       cdt.20160209093619.fGSQWYa4PE/wmaker-0.95.7'
     ./script/check-cmdline-options-doc.sh \
     	--program "./configure" --text-doc "./INSTALL-WMAKER" \
     	--ignore-prg 'with-PACKAGE,without-PACKAGE # only template names from
	  Autoconf' \
     	--ignore-prg 'program-prefix,program-suffix,program-transform-name
	  # in INSTALL' \
     	--ignore-prg 'version,quiet,srcdir,build,host,cache-file,no-create
	  # in INSTALL' \
     	--ignore-prg 'enable-silent-rules,disable-silent-rules # should be in
	  INSTALL' \
     	--ignore-prg 'enable-dependency-tracking,disable-dependency-tracking
	  # in INSTALL' \
     	--ignore-prg 'enable-shared,enable-static # should be in INSTALL' \
     	--ignore-prg 'disable-option-checking,enable-fast-install # should be
	  in INSTALL' \
     	--ignore-prg 'disable-libtool-lock,with-pic,with-gnu-ld,with-sysroot
	  # for libtool' \
     	--ignore-prg 'runstatedir #new in autoconf 2.70, backported in Debian' \
     	--ignore-prg 'with-x # no use, it would not work without X'
     Error: program option '--with-aix-soname' is not in the documentation
       './INSTALL-WMAKER'
     Makefile:951: recipe for target 'configure-documentation' failed
     make[4]: *** [configure-documentation] Error 1

     [..]

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814213
[2] http://anonscm.debian.org/cgit/pkg-wmaker/wmaker.git/commit/?id=dd955a7
2016-02-09 23:21:42 +05:30
Doug Torrance 4f18b3e1f4 check-doc: Ignore runstatedir in check-cmdline-options-doc.sh
autoconf 2.70 will add a --runstatedir option, Debian has backported it.
Ignore it when checking whether INSTALL-WMAKER is up to date.

Patch by Andreas Metzler from Debian package [1].

[1] https://sources.debian.net/src/wmaker/0.95.7-3/debian/patches/
    56_ignore_runstatedir.diff/
2016-02-09 23:21:42 +05:30
Doug Torrance cb1760dc0b WPrefs: Add support for fpixmap ("fillscale") texture. 2016-01-24 08:53:21 -05:00
Doug Torrance 9f7e51e66d WPrefs: Code formatting in TexturePanel.c; minimizes checkpatch.pl warnings. 2016-01-24 08:53:21 -05:00
Doug Torrance bf6f81434b wmlib: Remove install-exec-local target.
This was made redundant by defining pkgconfigdir and pkgconfig_DATA.  On
some systems (with automake < 1.15), this caused a build failure, e.g., [1]:

/usr/bin/install -c -m 644 wmlib.pc /«BUILDDIR»/wmaker-0.95.7+201601230517/
 debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/
/usr/bin/install -c -m 644 wmlib.pc '/«BUILDDIR»/wmaker-0.95.7+201601230517/
 debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
/usr/bin/install: cannot create regular file '/«BUILDDIR»/
 wmaker-0.95.7+201601230517/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/
 wmlib.pc': File exists

Also change the definition of DISTCLEANFILES to pkgconfig_DATA to match
the Makefiles for WINGs and wrlib.

[1] https://launchpadlibrarian.net/234989800/
 buildlog_ubuntu-precise-amd64.wmaker_0.95.7+201601230517-0ppa201601211606~
 ubuntu12.04.1_BUILDING.txt.gz
2016-01-23 09:36:53 -05:00
Doug Torrance af892d7dd6 wmlib: Add pkg-config file. 2016-01-23 00:17:05 -05:00
Alwin 7fa14a0137 Translations: Frisian language files updated
New entries were translated, and a lot improved.
2016-01-21 13:10:43 -05:00
Alwin 51d36afc8f Translations: Dutch language files updated
New entries were translated, a few improved.
2016-01-21 13:10:43 -05:00
Doug Torrance 84727563f9 wmaker: Implement basic menu shading.
Menus may now be shaded like other windows by double clicking on their title
bars.  Note that, even if animations are enabled, the shade animation seen
with other windows does not work for menus.

This fixes Debian bug #72038 [1]:

  From: Chris Pimlott <pimlottc@null.net>
  Subject: wmaker: Persistant menus should be shade-able
  Date: Tue, 19 Sep 2000 14:04:41 -0400

  One of the many little things that makes me appreciate Window
  Maker is that by clicking on the title bar of a menu, it can be made
  "persistant" so it stays on screen and doesn't dissappear after click or
  mouseout like normal.  I find it useful if I need to run a number of
  commands in a submenu, or for keeping a list of open windows on
  screen.

  The usefulness of this feature could be extended by allowing menus
  to be shaded (by double-clicking the title) like normal windows, thus
  collapsing them to take up less space when not needed but still be
  persistant.  Perhaps other commands of windows (like maximizing/
  minimizing, resizing) might be considered as well, although
  personally only shading stands out as particularly useful for menus.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=72038
2016-01-21 08:52:36 -05:00
Doug Torrance c7c0b43629 wmaker: Fix whitespace in menu.h; passes checkpatch.pl inspection. 2016-01-21 08:52:36 -05:00
Doug Torrance ac33bb9d1b wmaker: Display keyboard shortcuts for remaining options in window menu.
In particular, Keep on top, Keep at bottom, and Omnipresent.
2016-01-20 08:27:07 -05:00
Doug Torrance 563cda28d3 wmaker: Add keyboard shortcuts for keeping window on top or at bottom.
This closes Debian bug #306808 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306808
2016-01-20 08:27:07 -05:00
Doug Torrance 65802d3402 wmaker: Use window placement settings on other workspaces.
Previously, if a window was placed on a workspace other than the current one,
the window placement settings (given by WindowPlacement) were ignored and
the window was drawn in the upper left hand corner.  This is Debian
bug #181735, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181735

Part of the bug report by Andrew Gorcester from the link above
is reproduced here:

"When placing a window in a non-active workspace (which usually happens
if the user asks for a program to be started when wmaker is launched,
and defines an initial workspace in the window's attributes dialog),
Windowmaker doesn't follow specified rules on window placement.

All windows of programs that don't manage their own window placement
(Gaim manages placement itself, for instance) are placed in the far
upper-left corner.  Usually windows originate from 64, 64, because the
clip occupies the upper-left corner by default."
2016-01-20 08:14:48 -05:00
Doug Torrance 9de5a27dbc wmaker: Add option for window snap to top edge to maximize to full screen.
This is a common behavior in a number of other environments, e.g., Unity
and Windows.
2016-01-17 22:54:49 -05:00
Doug Torrance 42e4069541 wmaker: Fix typos (used codespell). 2016-01-17 22:54:49 -05:00
Doug Torrance e5632a9120 wmaker: Remove prototype for unused get_right_position_on_screen function. 2016-01-17 22:54:49 -05:00
Doug Torrance c3ad2513a9 wmaker: Update copyright years in info panel. 2016-01-17 22:54:49 -05:00
Doug Torrance 7277787110 debian: Update with version 0.95.7-2 packaging. 2016-01-16 15:16:46 -05:00
Doug Torrance 2f33b3c2bc wmaker: Maintain sorting of windows by workspace in switch menu.
Previously, this sorting failed when one window was moved to another
workspace.

This fixes Debian bug #280851 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=280851
2016-01-16 01:13:20 -05:00
Doug Torrance fd19456d66 debian: Update with final version of 0.95.7-1 packaging.
For those interested, the official Debian packaging repository is at:
https://anonscm.debian.org/git/pkg-wmaker/wmaker.git
2016-01-10 14:23:25 -05:00
Doug Torrance 688c2277d7 debian: Add version 0.95.6-1.2 entry to changelog. 2016-01-06 07:51:06 -05:00
Doug Torrance 755ce07d76 debian: Add wmiv to wmaker package. 2016-01-06 07:51:06 -05:00
Andreas Metzler fc6ed78654 debian: wmaker manpage moved from 1x to 1.
wmaker manpage was also moved from section 1x to 1. Fix pointer in
README.Debian and update-alternatives slave link.
2016-01-04 13:47:36 -05:00
Andreas Metzler c11b08d42b debian: Fix typo occured. (Thanks, lintian.) 2016-01-04 13:47:25 -05:00
Andreas Metzler f7e1f5d5f4 debian: Simplify debian/rules.
Use dh_auto_configure, especially for handling dpkg-buildflags.
2016-01-04 13:47:16 -05:00
Andreas Metzler 4660e5b1eb debian: Use dh_autoreconf.
Use dh_autoreconf instead of invoking autogen.sh in the configure
target.
2016-01-04 13:47:05 -05:00
Andreas Metzler f58cf6a8cd debian: Ignore missing documentation for --runstatedir.
Ignore runstatedir in check-cmdline-options-doc.sh
autoconf 2.70 will add a --runstatedir option, Debian has backported
it. Ignore it when checking whether INSTALL is up to date.
2016-01-04 13:46:48 -05:00
Doug Torrance 15ae70b159 wmaker: Print error dialog when attempting to delete an in-use workspace. 2015-10-02 07:14:53 -04:00
Satya Mishra 88393f4a6c wmaker: fixed infinite loop in switching within group 2015-10-01 17:06:40 -04:00
Doug Torrance 1f74d4698c ChangeLog: Bring up to date through 0.95.7 release. 2015-08-30 09:34:23 +01:00
Rodolfo García Peñas (kix) 97189ce2cc Enable usermenu
This patch enables the usermenu when the application is launched
and the usermenu file exists.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-25 15:42:06 +01:00
Rodolfo García Peñas (kix) 2fec5f9f28 usermenu.c Avoid compiler warnings
This patch includes some changes to avoid compiler warnings and
some code style.

Compiler warnings are:

- notifyClient, do not uses the menu argument. Including (void) menu.
- WUserMenuData, keyover: label is not used.
- configureUserMenu, params is not initialized.
- configureUserMenu, mentry is not initialized.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-25 15:42:06 +01:00
Rodolfo García Peñas (kix) 7a2eb68aa4 Remove cache icon when detached
This pach removes the icon from the icon cache when the icon is
detached from the dock/clip.

That helps to hold tidy the icon cache folder.

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) 8a822004ee save the icon filename instead the full path
This patch saves the icon filename in the database and in the disk. wmaker
can find the icon in the different folders, including the cache folder.

This patch is based in the comments of Zoltan:

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) 54db8d6c43 Avoid create again a docked application cache icon
This patch avoids to create again the cache icon for a docked application.
If the application is docked, then the icon was previosly created.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) e11800652e Avoid recreate Cached icon moving between docks
This patch avoids to create again the icon in the Cache if the icon
was in other Dock/Clip/Drawer, becasue the icon was previously created
and exits.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) b2c5078987 Remove unused argument in save_appicon
The argument dock is always True, so can be removed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) 9c4b19d8aa New applications do not create Cached Icon
This patch avoids to create Cached Icons for all applications. Only
the applications docked should create it, as Zoltan said:

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) b281587397 create_appicon_from_dock checks if no_appicon flag is set
As Josip Deanovic reported:

-------8<-------
In previous versions e.g. 0.80.2 up until 0.95.3 when an application
attributes are set with "NoAppIcon = Yes;" ("No application icon" option
in attributes window), it was possible to launch multiple instances of
the application from wmdock using double-click.

After doing a git bisect per your suggestion I have found and reported
this:

bc0700e016 is the first bad commit
commit bc0700e016
Author: Rodolfo García Peñas (kix) <kix@kix.es>
Date:   Mon Jun 18 11:15:19 2012 +0200

    Create WAppIcon always

    When the application is created, the WAppIcon now is created always,
    but it is only painted if the flag is not set.

    The icon initialization to NULL can be done now at
app_icon_create_from_docks
    because it is always called.

:040000 040000 7c58877ad5
33d52affb3 M      src
-------8<-------

This patch reverts this change (not the patch). Now the function
create_appicon_from_dock checks if the flag no_appicon is set,
and then, do not execute the code related to the appicon.

Because the connection between the icon and the window is broken
(icon->owner is null) we need check if the icon->owner exists
when we try to re-create the icon in the Window Attributes window.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00
Rodolfo García Peñas (kix) 7e42fedcbb Window Maker 0.95.7 Debian files
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-15 15:40:53 +01:00
Johann Haarhoff c84e787a24 Build on Ubuntu 14.04 2015-08-13 19:30:43 +01:00
Carlos R. Mafra 2db044993b Window Maker 0.95.7 2015-08-02 11:52:08 +01:00
Amadeusz Sławiński 49e94f9747 Allow using numpad Enter key in dialogs for confirmation
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2015-07-27 18:00:39 +01:00
Amadeusz Sławiński 16e92d89aa Allow using keypad Enter to commit move/resize
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2015-07-27 18:00:39 +01:00
Carlos R. Mafra fc437783f9 Disable pager by default
New features like this one should be disabled by default.
2015-07-25 17:45:28 -03:00
Carlos R. Mafra fee129b181 Revert "wmaker: fix clearing of window attribute that was not saved properly"
This reverts commit 14d1d3f141.

Conflicts:
	src/winspector.c

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-07-15 14:42:14 -03:00
Rodolfo García Peñas (kix) e545b2abf9 configure: fixed incorrect variable name that prevented --disable-xdnd to work
The name of the variable used in the AM_CONDITIONAL check was not aligned
with the name used at the other places of the file, which made the test
always succeed, making the conditional always enabled, causing an
unnecessary file to be included if user asked to disable the feature,
feature which was still not enabled.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-28 19:44:17 -03:00
Alwin b6f48ee9b8 Translations: Frisian updates for WPrefs
Main purpose of this change is to add the latest msgid's. It also
adds an advice from the Afûk language institute, on an adjective
not found in any dictionary.
2015-06-28 19:43:59 -03:00
Alwin cc23912efc Translations: Dutch updates for WPrefs
Main purpose of this change is to add the latest msgid's. It also
fixes a typo, and prevents the lower part of a letter `g' from
becoming invisible when a large font is used.
2015-06-28 19:43:59 -03:00
Doug Torrance d9ea6f0e25 WPrefs: Add snap edge and corner detect to Expert panel.
These are both integer values, and thus use the new OPTION_WMAKER_INT class.
We also update the text describing the window snapping feature for
clarification and consistency.
2015-06-26 10:24:21 -03:00
Doug Torrance fa821810cf WPrefs: Add ability to set integer values in Expert panel
Previously, only boolean values could be changed using the Expert panel.
This patch adds the ability to change integer values.  A new class,
OPTION_WMAKER_INT, is added.  When this class is used, a textfield and two
buttons (up and down) appear instead of a checkbox.  Users can either type
the integer value or increment/decrement it using the arrows.
2015-06-26 10:24:21 -03:00
Doug Torrance 443a08ea16 wmaker: Allow configuration of window snapping detect distances.
This patch introduces two new configuration values, SnapEdgeDetect and
SnapCornerDetect, which users can set to change the distance from an edge
or corner at which window snapping will begin.  The defaults are 1 and 10,
respectively.

Suggested-by: Josip Deanovic <djosip+news@linuxpages.net>
2015-06-23 15:56:27 +01:00
Doug Torrance 791fdd1eff wmaker: Allow window snapping and linked workspaces simultaneously.
If workspaces are linked, then windows will only snap to the top or bottom
of the screen.

Suggested-by: Josip Deanovic <djosip+news@linuxpages.net>
2015-06-23 15:56:27 +01:00
Christophe CURIS e666cfc6a5 WPrefs: fix conversion of old "Apercu" setting to the new keywords
As pointed by Josip, the code for loading the legacy setting keywords for
the Minipreview feature did not update correctly the configuration:

 - if the setting used a size as a multiple of icon size, this was
understood as the minimum pixel size, which meant here disabling the
feature. The code is now consistent with what Window Maker does;

 - if the old keyword were found, they were loaded but not removed from the
database after creating the new ones, which is a source of problem as
Window Maker assumes that the presence of the legacy keywords means they
are to be taken in consideration.

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-20 17:34:57 +01:00
Christophe CURIS ae7e228aa4 wmaker: fix detection of legacy Apercu configuration keywords
As reported by Josip, the code in Window Maker to detect the use of the
legacy keyword "MiniwindowApercuBalloons" and "ApercuSize" was broken,
which means they were always seen as used even when not present.

This patch fixes the detection to only use them if they were effectively
used.

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-20 17:34:56 +01:00
Josip Deanovic 0dfb42caae configure: Fix output of libdir directory in summary
This patch fixes the output status of the configure script which
currently gives output such as this:
<output>

Window Maker was configured as follows:
Installation path prefix            : /usr/local/windowmaker-0.95.7.next
Installation path for binaries      : /usr/local/windowmaker-0.95.7.next/bin
Installation path for libraries     : ${exec_prefix}/lib
Installation path for WPrefs.app    : /usr/local/windowmaker-0.95.7.next
...
2015-06-20 17:34:56 +01:00
Christophe CURIS 6691a653a7 Configure: increased the version of Automake requested
The compilation of the WRaster library needs the keyword
EXTRA_*_DEPENDENCIES in its Makefile so the configure.ac have been updated
to require at least the version of automake in which it is added.

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-20 17:34:56 +01:00
Christophe CURIS 325dc85891 wrlib: fixed gcc version needed for deprecated attribute support
The support for a custom message in the attribute 'deprecated' have been
added only from gcc 4.5.0 and not 4.0, so the check was updated accordingly
to avoid compilation error with version 4.0 to 4.4.

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-19 21:11:52 +01:00
Alwin eb1c06d704 New translation into Frisian for Window Maker
This is a complete translation into the Frisian language, mainly
done by translating it from the Dutch language files already in
Window Maker.
2015-06-14 19:36:24 +01:00
Christophe CURIS 177c5095e9 WRaster: fix unused variable warning when XShm extention is not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-13 11:03:59 -06:00
Christophe CURIS ae9cb306ef WINGs: fix non-portable int conversion for printf in font panel size handling
The original code assumed that the (void *) type could be safely converted
to an integer for the printf use, but it is not that simple, as pointed by
gcc when compiling on 32-bits platforms, where pointers do not match
anymore the long (%li) size.

The new code now do the conversions by the rules, so the compiler knows
what is happening and printf always gets the 'int' it expects.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-13 11:03:59 -06:00
Christophe CURIS 35068ba2d2 WINGs: ran spell checker on the NEWS file
The command used was:
  aspell --lang=en_GB check WINGs/NEWS

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-13 11:03:58 -06:00
Christophe CURIS 1c191f0e66 WINGs: Updated news with the API changes that occured between 0.95.6 and 0.95.7
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-13 11:03:58 -06:00
Doug Torrance b35cc42205 ChangeLog: Update to prepare for version 0.95.7. 2015-06-13 11:02:20 -06:00
Christophe CURIS 73420b3d2d wmaker: replaced old email address with the official one
In the crash handling dialog there was a reference to an old email address.
This patch replaces it with the official one, taken from the 'configure.ac'
definition so it will not need manual update anymore.

The mail address is inserted in the string with a '%s' in order to not have
it in the translation files (po) to ease the maintainer's task in case of
future change.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-06-13 08:40:50 -06:00
Doug Torrance 280615f8a1 doc: Add manpage for wmiv. 2015-06-13 08:40:50 -06:00
Doug Torrance 1b1cb99e36 wmiv: Improve help text.
In particular, we add entries for the two command line options for `make
check` to work, add some whitespace for readability, and enclose the keys
in brackets so `make check` doesn't think the - key is one of the command
line options.  We also capitalize Esc and the letter keys for readability.
2015-06-13 08:40:50 -06:00
Doug Torrance 08b27e5edd wmiv: Add long command line options --help and --version.
We will need --help for `make check` to work once we add a manpage.
2015-06-13 08:40:50 -06:00
Doug Torrance 9bd400db67 make: Add Ukrainian translation files to EXTRA_DIST.
Otherwise, "make check" fails as scripts/check-translation-sources.sh
returns an error.
2015-06-13 08:40:50 -06:00
Alexey I. Froloff c68431c612 Add folder with fedora .spec file
On Wed, May 27, 2015 at 12:31:38PM +0100, Carlos R. Mafra wrote:
> Could you consider to submit your work with the specfile to the
> wmaker git repository? The idea being that other people could
> add the %ifdef's needed for other distros too, and we would have
> a central specfile for wmaker.

I've made a COPR repo and built "wmaker-crm-next" for EPEL-7,
F20, F21, F22 and Rawhide.  Attaching spec and additional
sources.

https://copr.fedoraproject.org/coprs/raorn/wmaker-crm-next/
2015-06-13 08:40:50 -06:00
Martin Dietze 5714dce424 Import of (partly outdated) Ukrainian translations. 2015-06-13 08:40:49 -06:00
Doug Torrance b295a2029e debian: Import version 0.95.6-1.1. 2015-05-26 23:49:28 +01:00
Doug Torrance 67da339ccb debian: Import version 0.95.6-1. 2015-05-26 23:49:28 +01:00
Alwin 945f4d2389 WPrefs: creating more space for translations
Making some wasted pixels available in the Options section of Icon
Preferences, by redividing the heights and vertical offsets.

The reason is that one or more translations may easily become
larger, and will automatically be wrapped to a second line. In the
current situation, those two lines appear more or less stripped,
depending on the font size. The upper and/or lower part of the fonts
become invisible, which make them hard to read. It's ugly also.

Currently the Dutch and other translations benefit from this
change.
2015-05-25 22:41:04 +01:00
Christophe CURIS b64d9e6be0 wrlib: changed Gamma Correction calculation to use single-precision float
The original code was using double precision floating point to perform the
color corrections for the creation of the standard colormap. This precision
is not necessary because color coding is 16 bits anyway, and on some
architecture the double precision comes with a cost.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS 9ab2203456 Use single-precision math functions when available
Since C99 we have floating point functions available for single precision,
so as it is what we need we detect them (configure) and use them when
appropriate. The goal is to avoid unnecessary float->double + double->float
conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS d28edde23e Added some explicit conversion to double precision
When the result of the operation is expected to use double precision, this
patchs adds an explicit conversion to that type to tell the compiler that
this is what we want, and not an unexpected side effect.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS 79a95d7173 Fixed floating point constants defined as double but expected as float
To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS 1df08cc492 configure: Add compiler detection on non optimal floating point constant
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS bae28b2fae doc: changed section for translated man pages from 1x to 1
Similarly to the previous patch that changed the section for the core man
pages, this patch updates the translated man pages.

Took opportunity to re-order alphabetically the files in the Makefile
because it eases maintenance.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS d6d165c29d doc: do not install translated man pages if the language was not enabled in LINGUAS
When people cherry-pick the languages they want to install, they certainly
do not care for man pages in other languages. So, instead of always
installing them, the configure script will now automatically detect which
ones need to be installed.

Took opportunity to add a section in the I18N manual to invite contributors
to think about the man pages if contribute to translations.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS 0a009143c3 util: improve the command line argument parsing in wmmenugen
The code ignored the last argument provided on the command line;

It did not support the recommended '--version' and '--help' from GNU which
are often handy;

It used an unusual syntax to specify the parser, now it can also use more
usual "-parser=name" and "-parser name", the old syntax is still supported
to avoid breaking compatibility;

When a problem is found with an argument, the program stops instead of
printing an error message and continuing;

There's been updates on the exit codes in case of problem because it is an
information that could be useful for people calling the program from a
script;

Took the opportunity to provide more information in the man page and to
get it cross-checked against the program's option list during "make check".

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS 8088dc1eab doc: changed section for man pages from 1x to 1
As pointed by Douglas Torrance, nowadays no application is using anymore
the 1x section for the man pages, so this patch is changing the section for
all our concerned man pages to 1 (general commands).

Took opportunity to add some missing references in "see also" sections.

Reported-by: Doug Torrance <dtorrance@monmouthcollege.edu>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Alwin 4d0585ede2 WMaker: trivial fix in text string
Typo.
2015-05-18 13:43:34 +01:00
Alwin 81e51182e5 Translations: Dutch language files updated
New entries were translated, a few improved.
2015-05-18 13:43:34 +01:00
Christophe CURIS 42acb5d34c doc: describe Iain Patterson's new feature for ICCCM compliance
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 6aad540b88 wmaker: support providing ICCCM version, for compliance with the standard
The standard specify that the pseudo-selection which is used to
cooperatively replace window managers should actually contain the version
of the ICCCM standard which is supported. As this could be handy for
compatibility checks in the future, let Window Maker comply.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS ea2b5f0641 wmaker: make the '--replace' de-activable at compile time
As it is really unlikely that in normal use case someone would need this
feature, it is now conditional code, which is not enabled by default; the
configure scripts now propose a '--enable-wmreplace' option to enable the
corresponding code, as people making package for distributions may want to
enable the feature to provide users the ability to give a try of all the
window managers.

Suggested-by: Carlos R. Mafra <crmafra@gmail.com>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Iain Patterson 28b0169147 wmaker: replace and be replaced (ICCCM protocol)
Use the same logic used by xfwm4, metacity et al to replace an existing
window manager on the screen and allow other window managers to replace
us, as defined by the ICCCM 2.0:

http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html
  Communication with the Window Manager by Means of Selections

By convention those window managers try to become the selection owner of
the WM_Sn atom where n is the screen number.  If the atom is owned by
another window manager and the --replace argument was not given to wmaker
we fail to start.  If the argument was given we try to become the new
owner and wait for the existing window manger to exit.

After a successful startup we watch for SelectionClear events on the
atom and initiate a shutdown if one arrives, as that implies that
another window manager was started with --replace.
2015-05-15 17:44:50 +01:00
Christophe CURIS fa5f8d9937 wmaker-check: rewrote parsing of structure fields for callback checker
Doug Torrance reported a problem with some versions of AWK which caused the
signed/unsigned attribute to not be properly ignored, because the regular
expression was using a GNU extension to keep it simple.

While trying to reproduce it, I discovered that mawk was chocking on one
regexp used in parsing the type+names parsing of structure members.

This patch is rewriting the parsing, because hacking regexp to make them
fall working is still not the best solution for maintainability. There is
now a clearer code which is also safer because it will handle more
gracefully corner cases.

Reported-by: Doug Torrance <dtorrance@monmouthcollege.edu>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS ea42641033 Add a configuration option to ignore Decoration Hints from GTK-based application
As reported by Nerijus Baliunas and Paul Jakma, the GNOME application,
which use the GTK toolkit, are asking to have no window decoration. This
can be solved by editing the window's attributes in Window Maker, but this
can be tedious when there are many GNOME application used.

This patch adds a configuration option: Window Maker tries to detect for
GTK-based windows and in this case ignore the decoration hints that were
provided by the application.

Suggested-by: Paul Jakma <paul@jakma.org>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 5ecb96cbf4 doc: describe the GNOME application issue in the FAQ
Now that Window Maker have been fixed to allow the user to properly control
and save the title bar/resize bar/other decoration settings on the window,
describe the problem reported (first) by Nerijus Baliunas, so more people
may find the answer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 14d1d3f141 wmaker: fix clearing of window attribute that was not saved properly
As reported by Nerijus Baliunas, there was a problem when unchecking an
attribute in the Window Inspector and saving it. The original code was
meant to save an attribute that is being checked by user, but not one that
is explicitly unchecked, which means than although it looked ok when using
the "Apply" button, it was not remembered when restarting the application.

In continuation to the clean-up started in the previous patches, this one
is updating the Window Inspector to display 2 check-boxes, one read-only on
the left, displaying the state requested by the application, and a second
one which makes use of the new Tri-State button in WINGs to let the user
specify if he wants to force-on, force-off, or leave as-is the attribute.

The saving to the property list is then updated to take into account this
new 3-state when saving to the file, so relaunching the application will
remember correctly the user choice.

Reported-by: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 976083f5b9 WINGs: create a new type of Tri-State Switch Button (to doc)
There are some times when we need a Switch Button (aka CheckBox) with more
than 2 states, generally to express check/uncheck/leave-as-is.

This patch extends the Button widget to support the new WBTTriState type,
similar to the existing WBTSwitch except it supports a 3rd state which is
reported to application as '-1'.

The implementation was done in order to not break the binary API. The
version have been incremented in the WINGs header to reflect the change,
but not the version in the 'configure.ac' because that have already been
done in commit c6e323e75d for the next Window Maker release.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 997b3e5d91 wmaker: honour MWM Hint to have no border to a window
As there is already an attribute to allow changing this behaviour, and this
is being using for the Net WM hints, there is no reason to not support it
for MWM Hints also; contrary to the initial guess suggested by the comment
it costs actually nothing to properly support that.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS fd1dd9c7ea wmaker: fix misuse of 'user_flags' instead of 'client_flags' for window attributes
The structure containing the information on windows contains 2 sets of
attributes, client_flags which contains those asked by the application
through Hints (like MWM Hints and others) and user_flags which was defined
to allow the user to override them.

Unfortunately many places of the code was using the wrong structure to save
the attributes to (for example by using the WSETUFLAG macro) which was
merely ok as the user_flags have priority, but when we want to provide a
clean consistent behaviour to users, we need to get things in the right
place.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS a8f6abc9ea wmaker: moved the list of Application Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options
for all the windows of an application. This list was defined through many
hard-coded things; by defining an array with everything at the beginning of
the file it is easier to maintain (the code is simpler because it is more
generic) and to make it evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 8276ff1331 wmaker: moved the list of Advanced Options into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options
for a window. This list was defined through many hard-coded things; by
defining an array with everything at the beginning of the file it is easier
to maintain (the code is simpler because it is more generic) and to make it
evolve in the future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS 1a068faa49 wmaker: moved the list of Window Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change the list of attributes for
a window. This list of attributes was defined through many hard-coded
things; by defining an array with everything at the beginning of the file
it is easier to maintain (the code is simpler because it is more generic)
and to make it evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-15 17:44:50 +01:00
Christophe CURIS c3ba9aeba3 wmaker: moved calculation of internal offset in handleDockMove outside the loop
As pointed by the "checkpatch.pl" script, one line was too long in respect
of the coding style.

This line contains the calculation of an offset when storing a value in an
array, as this offset is a constant during all the loop, this patch is
calculating the offset only once before the loop and then uses this result,
which should make the code faster (although gcc may already optimise this
kind of things), makes it compliant with coding style, and takes the
opportunity to explain the reasons behind this offset.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS 5881d1a8ba wmaker: moved the definition of the entries for the window menu options to an array
By defining the const array with everything at the beginning of the file,
it is easier to maintain and to make evolve.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS bed5ebea89 wmaker: moved the definition of the list of entries for the window menu to an array
By defining the const array with everything at the beginning of the file,
it is easier to maintain and to make evolve (all stuff at the same place).

Merged the function makeMakeShortcutMenu into makeOptionsMenu because it
allows to use a simple callback in the structure like for the other
submenus and because its complexity did not justify a dedicated function.

Took opportunity to give a more appropriate name to the index
MC_DUMMY_MOVETO which did not mean what the entry is about.

As a side effect, this should close Coverity #50251 which was about saving
the return value of function into a variable but not using it, which is not
really good for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Rodolfo García Peñas (kix) edc12fad9f wmaker: removed dead code related to 'GLOBAL_SUBMENU_FILE'
There was the possibility to include a global sub-menu to the root menu
using a dedicated file, but this does not look like it is really useful as
this root menu is already defined by a user file, and the root menu is
already specific enough that it does not need anything more 'global'.

Furthermore, the variable enabling this feature (GLOBAL_SUBMENU_FILE) is
not defined anywhere (neither from "configure", nor in "wconfig.h", ...) and
is also not documented at all.

Considering it was introduced a very long time ago (1999!) and was not
touched anymore, this patch removes the dead code associated with it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS af2aba6f95 wmaker: do not use strcmp twice on the same thing, in function appiconBalloon
It is not really efficient to call it twice because the strings will not
change, and by using the appropriate trick it can make the code smaller,
with less redundancy, so less prone to bugs and easier to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS 784f6794e5 wmaker: remove one level of pointers for the function SlideWindows
The function does not need to be passed a array of pointer to windows
because it does not change content of the pointers. It is more efficient to
directly use an array of windows as the parameter, and simpler also.

As 'SlideWindow' is also concerned, it can be simplified and turned into
an inlinable function so the compiler can optimise it.

Took opportunity to de-CamelCase the name of the functions to comply with
the project's coding style.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS 8fa16bef00 wmaker: reorganisation of the control flow of the function 'findDock'
Changed the code to return as soon as the result is known because it makes
the code simpler to understand, which is good for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:30 +01:00
Christophe CURIS 1c1909d5fe wmaker: took as much assignation as possible outside 'if' statements
It is generally considered bad practice to place an assignation inside the
expression for an "if" statement because it is often a source of bug,
because of possible typos and because it makes reviewing code more
complicated.

This patch fixes as much cases as possible to make the code easier to read.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS e14fad1162 wmaker: fix warnings from compiler when animations are disabled
The code for animating stuff needs some parameters in a few functions,
which are not used when animations are disabled at compile time, so the
compiler issues some warnings about them.

This patch adds the appropriate statements to disable declaration that
are not needed in this case, and tell the compiler it is ok to not use
the parameters not needed, thus fixing the warnings.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS 0bab67f9be configure: Added option to disable animations
The old behaviour was to expect the user to go modify manually a source
file which is not a great idea because that's typically the kind of things
in charge of the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS 6ef010d974 Code refactoring: replaced macro 'ANIMATIONS' by 'USE_ANIMATIONS' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS 9d9b6d3fcf wmaker: fix incorrect type for variable in the global preference structure
As pointed by the new check script, the preference "show_clip_title" is
defined as a Boolean value in the preference loading function, which uses
the callback function "getBool", which expect a variable of type "char",
but the variable was not defined with that type.

This patch changes the type for the appropriate one to avoid possible
problems.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Christophe CURIS ba3e575971 wmaker: add script to check the call-back function used when loading configuration
Because the C compiler cannot check the consistency between the type of the
variable being pointed to, and the type expected by the call-back function
that is used to parse and store the value from the configuration file,
there is a risk of mismatch that can cause Window Maker to misbehave due to
data corruption, which depends strongly on the configuration values and the
architecture on which Window Maker is running.

This patch introduces a script that checks the consistency where possible, to
raise the issues when performing "make check".

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-08 18:53:29 +01:00
Alwin 3d6da4b210 WPrefs: trivial fixes in text strings
Fix some typos.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin f2f1bcb209 WMaker: trivial fixes in text strings
Remove an error message with the same meaning, because a synonym
was used. Also fix a typo.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin 495e82fc9a WINGs: trivial fixes in text strings
Fixing typos and/or inconsistencies in error messages. Some
backports for the Dutch .po file.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Alwin ea39621f91 Translations: Dutch language files updated
Recently added/changed msgid's were translated, plus a few
improvements. Kept some entries for last stable release. Removed
abbreviated forms from menu comment.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2015-04-28 09:06:33 -04:00
Christophe CURIS e03088ebe2 wmaker: fix non-portable int argument for printf in error message
The original code assumed that the sizeof returns a long int type, which is
true on 64 bits platform but not on 32 bits platforms, as pointed by gcc.

The new code does an explicit conversions to 'int' (which should be enough
for that case) so the format specifier in printf will always be ok,
whatever platform Window Maker is compiled for.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:07 -04:00
Christophe CURIS bc4f3352b6 wmaker: fix crash when switching workspace with "Affiche.app"
As reported by Martin Dietze, when switching workspace (mainly with
keyboard shortcut) while the focus was set on a sticky note from the
GNUstep application "Affiche.app" would cause Window Maker to crash.

This crash was due to the application creating its menu with an Omnipresent
state; Window Maker tried to be smart by smartly setting the focus to this
window after the workspace change, unfortunately when removing the window
of the note from the screen the application would decide to remove also the
omnipresent menu (because it is not necessary anymore).

Because we kept a pointer to an outdated WWindow, we would silently corrupt
memory, which would later cause a crash in an unrelated place (fortunately
in this case it happened quite soon).

This patch adds a check to make sure the window we want to focus is still
a valid one, and if it is not we just ignore it to fall back on another
mechanism already in place for picking the window to focus.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS c8ea949b1a wmaker: converted macro 'SAME' into a static function
There are some risks associated with the way arguments are used in macros,
and using a function also allows check on the type of arguments and leaves
more room to the compiler for making the best optimisation choice; it also
allows writing easier to read code (and thus, to maintain).

As a side effect, this should also help Coverity in avoiding false positive
bug reports (like #109605 and #109607).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 6ef343ed87 WUtil: fix improper use of de-allocated variable (Coverity #109618)
As pointed by Coverity, the variable 'path_dst' was first free'd, then it
was used in the 'unlink' function.

This patch fixes the call order to de-allocate the string only when it is
no more needed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 032f6587d9 WINGs: remove useless function call in WColorPanel (Coverity #109617)
As reported by Coverity, the function 'customSetPalette' is making a call
to 'WMGetPopUpButtonSelectedItem', but this function does nothing to the
widget but only return a value, which is not used at all, so this patch
removes the call to the function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS a93570e5be wmaker: remove useless null pointer check (Coverity #109612)
As pointed by Coverity, the pointer in wwin->frame have already been
dereferenced many times in the function, so it is useless to include a
check later; removing it makes the code smaller thus easier to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS d72e6d415a wmaker: remove non-necessary allocation (Coverity #109609)
As pointed by Coverity, there was a memory leak because the buffer used to
create the wmsetbg command is allocated twice.

Because it is not really necessary to call 'wmalloc' for such a small case
(it is not efficient and participates to memory fragmentation), this patch
replaces the dynamic memory allocation by a buffer on the stack, which also
solves to de-allocation issue.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 04404bf47c wmaker: fix memory leak in the Workspace Map if there is no workspace (Coverity #109608)
As pointed by Coverity, there is a safety check on the number of workspace
which aborts the function, but the storage memory have already been
allocated so it would leak this buffer.

The case where the number of workspace is 0 is probably not supposed to
happen (there should always be at least 1 workspace, the current one), but
it is better to keep safety checks, so this patch is moving the check at
the beginning so no leak will occur.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS ae07899122 wmaker: fix incorrect size for memory allocation (Coverity #50207)
As pointed by Coverity, when increasing the size of the array allocated to
store the pointers to menus in a cascaded menu, the incorrect value was
used in argument to the sizeof which lead to over-allocating memory.

This patch replaces the name of the structure (which should have been the
pointer type) by the variable actually being used, fixing the size issue
and making maintainability easier by tracking the type of the variable
which is less prone to bugs in case of change.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 15db368291 WINGs: fix memory leak in WMSubtractPLDictionaries (Coverity #50128)
As pointed by Coverity, a temporary proplist is created with the list of
keys to be removed from the source proplist, but this temporary proplist
was not released at the end, leaking memory.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS ba8cd2abe4 Handle NULL pointer as good as possible (Coverity #50099)
As pointed by Coverity, in the "Configuration" panel of WPrefs there are
some images loaded, but if the images cannot be loaded correctly then the
returned NULL pointer can crash the application as it is dereferenced in
further function calls.

To solve this case, this patch is adding a NULL pointer check in the
functions RScaleImage (wrlib) and WMCreatePixmapFromRImage (WINGs), so both
can accept that NULL pointer to also return NULL, which means the existing
check for "icon == NULL" in the WPrefs code will be useful.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 8d09af51b8 wmaker: check return value for XGetWindowAttributes (Coverity #50032)
As reported by Coverity, the return value for XGetWindowAttributes is
usually checked in many places, because it is a good practice to ensure
that it did work, but it was not checked when called in the function
'wClientCheckProperty'.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS 2086eefb7e texi2txt: add workaround for a known bug in "mawk"
As reported by Douglas Torrance, the script that generates the plain text
documentation from the texinfo source would crash due to the cross-
references when the version of awk used is "mawk".

This is actually a known bug in mawk:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=172774

It looks like the bug have been fixed in mawk, but Debian is still
providing a broken version. To avoid problems, this patch is introducing a
workaround in the matching pattern that causes the issue every time it is
being used.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS 842e145e0a doc: re-generate the top directory documentation when "make dist" is invoked
As pointed by Douglas Torrance, there are some case where the 2 docs
INSTALL-WMAKER and README.i18n are not re-generated properly, one of the
cases being if the user grabs the sources from Git to make a source package
only (ie, without compiling anything).

This patch adds a hook to "make dist" so it will re-generate the docs if
needed. Because the "dist-hook" is run after Automake has copied the files
to the temporary directory (distdir) then we also include an explicit copy
of the files there to have the latest version.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS b4cf94aacd Code refactoring: replaced macro 'XDND' by 'USE_DOCK_XDND' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.

As the feature concerns the Dock and not DnD in general (WINGs support is
not disabled), make it a bit more clear in the macro name and document the
configure flag in the Installation Manual.

Took opportunity to compile the corresponding file only when the feature is
not disabled.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS 2ebfcd9c5c configure: Added option to disable Motif WM Hints support
The old behaviour was to expect the user to go modify manually a source
file which is not a great idea because that's typically the kind of things
in charge of the configure script.

As a side effect, we can now use an automake conditional to avoid compiling
the source file in charge of the feature when not used, instead of trying
to compile an empty-looking file.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS 1cef020eb3 Code refactoring: replaced macro 'MWM_HINTS' by 'USE_MWM_HINTS' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS 30fe0fb05f check-doc: add an option to ignore some explicit options from the command's help
There are a few rare cases where some options listed in the program's
built-in help page may not be documented for a valid reason. This patch
provides an option to the checking script to not complain about them, but:

 - the listed options must include a comment about why, to ensure that the
user thinks twice about it and because it is better for maintainability;

 - the listed option must be part of the options listed by the application
to ensure the command line invocation of the script will remain up to date.

This new option is then used for the check of the "configure" options
because for a few of them the right place to document them is in the
INSTALL file provided by Autoconf and not in our Window Maker specific doc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS d1c9f791d8 doc: describe the "new" options to the "configure" script
As there are many options, they have been split into 5 sections; added
documentation for all the legacy Window Maker options that were missing and
for the new ones; added documentation for a few of the "autotools" standard
options that can be considered interesting.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 23:29:37 +01:00
Christophe CURIS 0c09d1f40d check the "configure" option list against the INSTALL-WMAKER documentation
In order to ease the job of keeping the documentation aligned against the
sources, this patch adds a check of the list of options returned by
"configure --help" against the options that are listed in the
INSTALL-WMAKER file.

The check is ran as part of "make check", which also implies it will break
a "make distcheck" operation when not in line.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 1ba9a8bcf5 doc: removed a few deprecated stuff from the Installation Manual
Setting LANG/LINGUAS to en_RN should not be a problem with the current
configure script, so don't mention it;

Removed the section about the "WindowMaker-extra" package, because this
things looks to be deprecated;

Removed the 2 errors related to configure, because as the Autotool versions
is now specified in the configure.ac this situation should not arise.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS cfba824ed4 doc: update information in the Installation Manual
- update the list of supported platforms according to current known status;

- updated URL links to all dependencies to the current known URL;

- moved the dependency on Autotools to a dedicated section, because it is
not supposed to be necessary for people compiling from the distributed
source archive, and updated the version according to current status;

- extended the chapter on getting the sources to contain all info that
could be needed;

- added a note about compiler requirement to ease understanding the actual
requirements;

- documented some long-time known dependancies (libbsd, inotify, boehm gc);

- fixed a few strings here and there;

- made an appropriate reference to the README.i18n for the troubleshooting
of NLS.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 5cb1df5e27 doc: convert INSTALL-WMAKER into a texinfo source processed by texi2txt
The source of the documentation is in Texinfo format to have the
possibility someday to distribute in more format that just plain text;

The INSTALL-WMAKER original file will now be generated automatically when
running the 'autogen.sh' script (for those who made a git-checkout) and
when running 'make' (for the people who create the distribution archive).

The current document have seen these changes:

 - added all the texinfo header (including the copyright notice);

 - texinfo formatting command in place everywhere applicable;

 - re-ordering of the content to try to get a consistent document.

Apart from this, the document should not have seen any change on the
content, because this deserves dedicated patches to show the evolution.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS b3ec1ac8f4 texi2txt: add support for making cross-references in the document
The texinfo format provides 3 commands @ref, @xref and @pxref to make cross
references to existing @nodes in the document; it also provides a command
@anchor to place arbitrary targets for cross-reference.

Because these will be handy for the Installation Manual that already does
some references, this patch implements the 4 commands:

 - change the '@node' command, that did nothing, to now track potential
reference points;

 - add the '@anchor' command to register a new target for x-ref;

 - implement the 3 '@*ref' commands with similar behaviour as the texinfo
format states, with support for all arguments, generating a temporary
"@x##@" pattern for the line target;

 - generate a new file (*.xrf, a sed script) at the end with the
replacement for x-ref patterns with the correct line number, and perform
a few consistency checks;

 - during the final search-and-replace used to insert the Table of Content,
include the x-ref replacement.

The current script has some limitations:
 - because we cannot know in advance the target line number for the x-ref,
we insert it with a constant size of 5 characters to avoid breaking the
justification alignment when doing the replace;

 - there is a strict order to respect between @node and @chapter/@section,
which is needed because we have to include a line offset to get it right
when using the order given in the texinfo manual.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 22e62c0637 texi2txt: add support for the @table command
The texinfo format provides a command '@table' which is useful to provide
a list of object (function, variables, options, ...) with their associated
description.

As this will be very handy for the Installation Manual, this patch
implements the command in the script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 04de317dde texi2txt: add support for enumerated lists
The texinfo format provides a command to generate list of item which are
prefixed by an auto-incremented number or letter.

This command was not implemented but as it will be used by the Installation
Manual of Window Maker, this patch implements it, reusing much of the code
that was handling the unordered lists.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 438accb312 texi2txt: fix support embedded item lists to allow nested lists
There are some cases where it can be useful to embed a list of item into
another list; the script was almost ready to handle this case, this patch
brings the missing stuff to get it to work properly.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS 355a2e6906 doc: the man page for "wmsetbg" is now processed by a script
Because the tool's help page changes whether Xinerama support was compiled
or not, its man page have to reflect this, so instead of being simply
copied the file is processed with the 'replace-ac-keywords' script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:11 +01:00
Christophe CURIS c743c4b77b doc: updated man pages for many tools
This patch perform simple fixes to the man pages and tool help page:
 - minor style updates, to get cleaner pages
 - option re-ordering, to have them in alphabetic order (easier to search for)
 - consistency updates for descriptions and number of dash
 - spell-checking

The biggest changes are:
 - wmagnify: the option 'vdisplay' was not documented at all;

 - getstyle: the list of attributes that are taken for the Style are now
described in their own section to clarify the page;

 - setstyle: the help page left thinking that the file argument was
optional, which is not the case;

 - wdread: as the Exit Code may be useful, and it is not unusable, it is
now documented;

 - wmgenmenu: added information about how the content of the menu is
generated;

 - wmsetbg: added a section about dithering/best-match because as nowadays
most screens are in True Color, the reason for the option may not be clear.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS f6c9410ee7 doc: add check of the program options against their man pages
The program WPrefs and most of the programs in the util/ directory have a
man page, this patch adds the appropriate call to the checking script when
"make check" is used.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS 709a6dc203 doc: changed section for man page of "wdread" to 1x for consistency
All the man pages for our tools that interact with Window Maker are placed
in the "1x" section, but the "wdread" page was an exception for no known
reason.

For consistency, this patch renames the file to the same "1x" section.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS d3414d335f wmaker: create script to handle conditional and variables replacement in man pages
Because the man page references some stuff that are dependant on the
configure options, it is a good idea to update the man page accordingly, so
the user will not be puzzled later.

There is now a script which takes care of replacing '@var@' in the same way
autoconf does, but also which can handle conditional '@def@' removal (for
the case of feature dependant command line options).

The man page for Window Maker is now processed this way so user will always
see accurate information.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS 6749e38693 wmaker: improve the documentation for the command-line options
There were 2 options that were not documented at all, which are now listed
in the 'wmaker --help';

The man page have been updated according to the 'check-cmdline-opts' script
feedback, including:
 - adding 2 options that were missing (global_def_path, no-drawer);
 - removed 2 options that do not exist anymore (no-cpp, create-stdcmap);
 - sorting the options, to make them easier to search for.

In addition, took opportunity to:
 - remove the double description for 'visual-id';
 - improve a number of descriptions to make them clearer;
 - fix minor stuff (typo, spaces at end of lines).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS b6270f5a92 wmaker: created script to check program's options against documentation
In order to ease the job of keeping the documentations up to date, there is
a new script 'check-cmdline-options' that checks a program's options (with
the '--help' option) and compare them with its documentation (the manual
page) to make sure everything is aligned.

This is triggered with "make check" for wmaker.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS 794a8f408a WINGs: mark the script 'get-wings-flags' as deprecated
This script should have been removed a long time ago, in favour of
pkg-config which has to be present anyway to compile Window Maker.

This patch makes the script print a warning about it, and now calls itself
pkg-config, instead of being generated; the man page was also updated
accordingly (and spell-checked).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS 324e338087 WUtil: mark the script 'get-wutil-flags' as deprecated
This script should have been removed a long time ago, in favour of
pkg-config which has to be present anyway to compile Window Maker.

This patch makes the script print a warning about it, and now calls itself
pkg-config, instead of being generated; the man page was also updated
accordingly (and spell-checked).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS efdb29762d wrlib: mark the script 'get-wraster-flags' as deprecated
This script should have been removed a long time ago, in favour of
pkg-config which has to be present anyway to compile Window Maker.

This patch makes the script print a warning about it, and now calls itself
pkg-config, instead of being generated; the man page was also updated
accordingly (and spell-checked).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-18 19:31:10 +01:00
Doug Torrance 0277a99d08 wmaker: Add autocomplete/history feature to keyboard shortcut Run dialog.
As reported by Juan Giordana, the autocomplete/history feature which is
available to Run dialogs brought up by the root menu is not available to Run
dialogs brought up by a keyboard shortcut.  This patch enables this
behavior.
2015-02-13 17:58:55 +00:00
Christophe CURIS d309aa65d4 i18n: fix failing generation of the README.i18n file
The command in 'autogen.sh' was using an invalid syntax to call the script,
so the file was not generated; this patch fixes the invocation.

The test in the makefile was not correct because it would not generate the
file if it was deleted; now the check works whether the file exists or not,
and properly skips generation if it is read-only (for make distcheck).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-02-01 01:45:43 +00:00
Christophe CURIS 2bf380cd27 txt-from-texi: remove use of the 'switch' statement for portability
This 'switch' control statement is actually a GNU extension, so it is not
portable to other awk implementations.

This patch replace them with the traditional 'if...else' sequence which
will work everywhere.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-31 17:58:46 +00:00
Christophe CURIS 5293a5ae41 txt-from-texi: fixed use of awk 'match' function to be portable
As reported by Doug Torrance, the 3rd argument to the 'match' function is
actually a GNU extension, so it breaks compatibility when run with another
version of awk, for instance mawk.

This script changes the code to stuck to the 2 arguments version which is
posix.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-31 17:58:46 +00:00
Christophe CURIS d9996e6e93 make: moved PHONY outside the USE_LCOV conditional
Apparently, automake does not like when there are multiple .PHONY
definitions and some of them are conditionals, it generates a warning:

  Makefile.am:84: warning: .PHONY was already defined in condition USE_LCOV, which is included in condition TRUE ...
  Makefile.am:58: ... '.PHONY' previously defined here

This is probably a false message, because in the end, conditional or not,
the result will not be significantly different, so this patch just moves
the .PHONY definition outside the conditional so Automake will not print
the warning.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS a9a0d2ac85 make: new target 'update-lang' to update the PO files for a languages against latest sources
With the new target, it is now easy to update all translations in the
project for a language against latest code with the simple command, run
from the top directory:

  make update-lang PO=<lang>

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 2429d5e196 doc: explain how to help translating the Window Maker project
Removed the information dispatched in the many po/README files and created
a more elaborate chapter in the README.i18n file to explain the process
involved to participate.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 58854cab9b txt-from-texi: add support for variables
The support for variables in the text-from-texi script is used to
automatically insert the current version of Window Maker, inherited from
the definition in the AC_INIT command, so it will be always correctly
updated without the need for hand work.

Having this version information is recommended by GNU texinfo because if
the document happens to get distributed outside a package it can help user
avoid problems.

The second use is to define a variable 'emailsupport' which contains the
email address of the development team, so we can also inherit it from the
AC_INIT setting.

The third use is for a special variable 'cctexi2txt' to differentiate
between texi2any and our script, because when using texi2any the title
page is not generated, so we need to duplicate some information in the
source, but we do not want it to appear twice in our generated doc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 740c812476 make: remove installed translations when performing Uninstall
When support for translated languages was enabled, the localisation files
were installed, but make uninstall did not take care to remove them. This
patch fixes this by properly removing them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 56acd42e43 configure: add possibility to list available languages with LINGUAS=list
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS d42960ad35 configure: enable all languages when performing make distcheck
In order to improve the amount of things that are checked by the make
distcheck command, this patch enables support for I18N with all the
languages that are supported.

To achieve this, this patch adds the non-standard special case LINGUAS='*'
which automatically enable all known languages.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS bdeb635194 doc: moved the FAQ on i18n into the dedicated README.i18n
The FAQ was merged in the i18n documentation file to avoid having many
files for a single topic.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS d543decee6 configure: rewrote support for option '--disable-locale'
Renamed it to '--disable-xlocale' because the original name is misleading
about what the option really is for (it sets locale for X, not locales in
general) and updated its documentation;

Added checks to report incorrect uses to the user;

It is now possible to use '--enable-xlocale' to explicitely request for the
feature, so configure would stop if it were not found.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS f222a319b1 configure: rewrote the support for option '--with-menu-textdomain'
The idea is to include consistency check to warn the user if he is not
using it properly, instead of silently misbehaving;

Updated code style to use Autoconf macros for consistency.

Took opportunity to remove the hacky setting inside 'config-paths.h' where
it is a bit out of place, in favour of a standard DEFINE in the 'config.h'.

Include in the i18n documentation the explanation on how Window Maker
translates the menus, both when the 'menu-textdomain' option is used and
when it is not.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS bf6bc120a5 configure: replaced option '--with-nls' by autoconf's '--localedir'
Autoconf have been providing the option '--localedir' for a long time now,
so this patch removes the deprecated '--with-nls' option and makes use of
the standard '--localedir' instead.

Took opportunity to define the path in the 'config-paths.h' in the same way
the other paths are defined to be consistent, which also simplify the
compilation commands.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 1b0b2d7b1b doc: describe how to choose the language (i18n) at run time
Removed the current section from 'INSTALL-WMAKER' and wrote an updated
chapter in the new README.i18n, to explain how the language is chosen at
run-time.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS bd49dbc2f5 doc: explain how to compile with language support
Now that the setup in configure.ac have been cleaned, moved the original
documentation from the 'INSTALL-WMAKER' file into the dedicated doc
'README.i18n' and updated it.

The information is completely removed from 'INSTALL-WMAKER' with an
invitation to see the new i18n doc in order to keep that file relatively
small and to avoid duplicating information, which is always harder to
maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS b944a4beb2 configure: add check for the program "msgfmt" when i18n is requested
The program may not be installed because it is not needed for non-dev
activities, so it is better to check at the beginning than to let the
compilation fail later. The check is done only if the user has specified
that he wants to install translations.

Took the opportunity to make the generation of "mo" file follow the silent
rules in Makefiles if user enabled them.

Signed-off-by: Christophe <curis@Ares.blacknet.hell>
2015-01-20 21:29:24 +00:00
Christophe CURIS 2cfb2b5276 configure: rewrote detection for 'xgettext'
The main change is to use Autoconf's syntax for consistency;

Now the detected program is used in the makefiles (user has the possibility
to change the name of the command);

A conditional is used to avoid enabling make targets that would fail if
the command does not exist.

Took opportunity to implement the silent-rules compliance to POT generation
rules.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 80e00c3521 configure: rewrote the support for languages in localisation
The code was moved to a dedicated file (wm_i18n.m4) to reduce the size of
configure.ac;

It now searches for gettext+libintl only if LINGUAS is specified, because
there is no need for them otherwise;

The list of supported locales is created automatically from the list of
files present in the source tree, so there won't be problem forgetting to
update the variables when a new language is added, or removed because
one is considered outdated;

The new syntax is now using as much as possible Autoconf's syntax to ensure
consistency and better portability;

Took opportunity to improve the language check loop to make it smaller and
to tell when a locale that the user asked for is not fully supported.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 6efbb812b0 doc: create the skeleton to have a documentation for Internationalisation
The source of the documentation is in Texinfo format to have the
possibility someday to distribute in more format that just plain text;

There is a new Makefile to generate automatically the plain text file to be
distributed from the source; this doc is also generated by 'autogen.sh'
because a user would expect to find it before compiling the program, so
even before the 'configure' script have been generated, in the case he is
compiling from a git checkout;

There is a new script to generate the documentation, because from the way
we generate it we cannot assume that 'texi2any' is available  and working
on the user's computer; it is also the opportunity to generate a better
looking document (see the description at the beginning of the script);

In this commit, the documentation only contains the base skeleton, it does
not contain yet any useful content because it is worth it's own commit.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS bb544439f4 make: add a variable 'DOMAIN' for the name of the pot and mo files
Having the name of the domain hard-coded in many places in the makefiles
makes it harder to maintain them, specially because much code is duplicated
between the makefiles that handle po files.

There is now the variable DOMAIN that is set once in each concerned
makefile, and the rest of the makefile makes use of it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS c72f013136 make: remove unnecessary chmod when creating directories for locales installation
The permissions are already set correctly by the installation script, so it
it not necessary to re-do it afterwards, it makes the code more complex and
error prone, so this patch removes these chmods.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS d6abbafeef WPrefs: fix list of source files for translation
A few files were missing from the list of sources files to be translated.

Took opportunity to make a few strings translatable.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 609b3c29a6 wmaker: add missing source files for translation
As pointed by the new script, a number of source file were not included in
the list of files to check for translations.

Took opportunity to make translatable a few of the messages.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS 6000af3828 WINGs: add missing source files for translation
As pointed by the new check script, many source files were not in the list
used for translation.

Took opportunity to make translatable a few messages that could help user.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS b266808331 created script to check the list of source files to handle for translation
Because the source file is redefined in the 'po/' directories, there is a
possibility that they get misaligned.

There is now a script that will check everything is in line; it is
triggered by "make check".

The case of the "util/" stuff is excluded at current time because the way
they are defined makes it hard to properly deduce the correct list of
sources, and it is not worth, the core need being on wmaker and WPrefs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:23 +00:00
Doug Torrance 3d2948e1a0 Add generate-mapfile-from-header.sh to distribution tarball. 2015-01-14 23:40:02 +00:00
Christophe CURIS d458304610 wrlib: generate automatically the list of symbols to keep from the API header
Instead of having to maintain manually the map file for LD with the list of
symbols that we want to keep in the WRaster library (the purpose is to hide
internal symbols), this patch implements a script that parses the public
API header and extracts automatically the list of names that are supposed
to be visible to the user.

The goal is to reduce possible human errors, like for example the function
RCombineAlpha that was forgotten from the list, yet still keep the map file
feature which is considered a good practice (it reduces the risk for name
clash and the risk of mis-use of internal stuff from the library).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-05 15:28:44 +00:00
Christophe CURIS d12b647069 updated autoconf macro gl_LD_VERSION_SCRIPT from gnulib to version 4
This new version now checks that version script with syntax error are
rejected, it probably led to mis-detect the option as supported when it was
actually just ignored with at most a warning; it also now implement caching
of the result to speed-up re-run of configure if user enabled it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-05 15:28:44 +00:00
Christophe CURIS 796b557c3a configure: rewrote 2 ARG_WITH for paths to provide better feedback
The 2 options '--with-pixmapdir' and '--with-gnustepdir' did not provide
any feedback to the user if they were not used correctly. The new code now
performs more checks and tell the user about problems.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:10 +00:00
Christophe CURIS c7843e3f3b configure: rewrote 3 ARG_ENABLEs to get them to behave properly
In addition to proper quoting for M4, the macro would not behave totally as
expected: for example, providing '--disable-modelock' would enable the
feature instead of keeping it disabled as the default.

The definitions now properly behave as expectable, so the user can
explicitly specify how he wants the feature even if it is the default; it
will also fail on improper use which is always a good idea to ease possible
future evolution.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:10 +00:00
Christophe CURIS 85a3fb13cc configure: minor updates on quoting for consistency with Autoconf's syntax
Using the appropriate quoting (with [xxx]) can spare us some problem, so
for maintainability of the script the proper quoting was added in a few
places to have a consistent file.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:10 +00:00
Christophe CURIS 78690de103 configure: cosmetic improvements on comments
This patch brings more consistency in the presentation of comments,
including:
 - 2 line spaces between blocks (M4 macro tend to make the file look quite
bulky, so it is making the file more aerated)
 - fixes in the length of underlining
 - adding a few comments on the reason of the check to ease maintainance

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS 2c6c7d51c9 configure: add email address for bug reports in AC_INIT
The mail address we use is the developer's mailing list; putting it in the
macro will get Autoconf to place it in a few strategic places where it is a
good idea to have it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS f956609a43 configure: added the copyright notice at the begining of the file
This include using the AC_COPYRIGHT macro so our copyright will also be
placed in the generated configure script.

Took opportunity to update the comment on how the file should be processed
to simplify user's life.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS 200b0d4098 configure: remove a few commented-out stuff that are deprecated
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS 99b1e26412 configure: updates as reported by 'autoupdate'
Some macros have evolved, so this patch brings the appropriate updates:
 - AC_OUTPUT(...) is now split in AC_CONFIG_FILES(...) and AC_OUTPUT, took
the opportunity to sort the list of files so it is easier to maintain

 - the macro AC_DECL_SYS_SIGLIST is now replaced by the more generic
AC_CHECK_DECLS([sys_siglist]), but as it turns out that we're not using it,
the check was just removed

 - autoconf assumes that AC_TYPE_SIGNAL is deprecated because the type was
fixed since C89, but as we expect to still run on old hardware, we keep the
macro given by autoupdate on our side for when Autoconf will stop providing
the macro

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS 33d711ce6a wmaker: remove execute permissions on the source file 'wsmap.c'
A source file is not supposed to have the 'execute' bit set, removing it to
avoid problems.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-31 17:10:39 +00:00
Christophe CURIS 5c9438115b Renamed "Apercu" to "MiniPreview" in the configuration database
The name of the 2 settings have been changed:
 - enable: MiniwindowApercuBalloons -> MiniwindowPreviewBalloons
 - size: ApercuSize -> MiniPreviewSize

The old name is still supported to avoid breaking user's configuration, but
WPrefs will update the setting to the new names when updating the
configuration.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-31 11:10:46 +00:00
Christophe CURIS 67b4302ef8 Renamed "apercu" to "minipreview" in the source code
To be consistent, all place where the not-properly-written "apercu" was
used in the source code (of wmaker and WPrefs) it has been replaced by an
appropriate "minipreview" or similar, to be in line with the new name
suggested by Yuri Tarasievich.

This new name is better understood by contributors who speak usual english,
but not this word which comes From french but is sparsely understood by
british people.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-31 11:10:30 +00:00
Christophe CURIS 35fe34ac85 Renamed "Aperçu" into "Mini-Preview" in visible places
Having an thing whose name requires special UTF-8 character to be properly
displayed is a source of portability problem (including xgettext issue
reported by Alwin);

Considering also that this french word is only understood (sparesely) in
Great Britain, but not by international english speaking community;

This patch then replace it by the "Mini-Preview" suggested by Yuri
Tarasievich, which is more likely to be understood.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-31 11:09:30 +00:00
Christophe CURIS e78e485fb3 make: do not compile stuff in the 'test' directory
To be consistent with the rest of the project's behaviour, do not try to
compile what is in the toplevel's "test" directory for a normal
compilation.

The content of this directory does not really test anything, so it is not
useful for users, and there is always the risk that it could break
compilation because it is not heavily maintained (and does not deserves to)
so this patch just skips the directory, as already done for wrlib/tests/
and WINGs/Tests.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-30 18:59:18 +00:00
Christophe CURIS 7962bfa612 wmaker: removed global variable "flags.nopolling"
As found by Rodolfo García Peñas, this flag is never given a value; further
investigations in the history of the project show that this flag have never
been implemented because its action is totally redundant with the flag
"noupdate".

As the later flag's name is more clear about what the behaviour for the
user is, as opposed to what is being done under the hood, its name is kept
and the "nopolling" flag is removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-30 18:59:18 +00:00
Alwin 94136ad29a WPrefs: trivial fixes in text strings
Fix a typo in an error message. Remove an inconsistent dot on a
button. Adds a missing dot in Expert preferences.
2014-12-24 15:24:42 +00:00
Alwin a65536f500 WMaker: trivial fixes in text strings
Add missing spaces in balloons/error messages. Capitalize `Alt' in
balloon. One report by the Italian translater.
2014-12-24 15:24:42 +00:00
Alwin a5a23f966e WINGs: trivial fix in text string
Fix a typo in an error message.
2014-12-24 15:24:41 +00:00
Alwin e3769a0b09 WPrefs: make a text string translatable
The WPrefs miniwindow shows a shorter title that could be translated.
2014-12-23 11:33:36 +00:00
Alwin 1dc7dc4309 Translations: Dutch .po files updated
Recently added/changed msgid's were translated, plus a few cosmetic
improvements. Kept one entry for last stable release.
2014-12-23 11:33:36 +00:00
Doug Torrance 8abf7762cb WPrefs: Clarify purpose of "window snapping" feature in expert panel. 2014-12-23 11:33:36 +00:00
Christophe CURIS 3ed8cb6ffa WPrefs: add possibility to configure the size of the aperçu
The Icon preference panel have been rearranged to include a slider which
controls the size of the Aperçu. This slider is also used to turn off the
feature, so the related checkbox have been removed from the Misc preference
panel, because it is more convenient to have the related settings at the
same place.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS 31c00a8749 WPrefs: add an image to represent the window in the Window Placement frame
The original square box did not look like anything, by using an image that
looks like a small window it is more clear to users what it represents.

The image was drawn as an XPM keeping a style consistent with everything
else; it was then converted to TIFF using ImageMagick:
  convert -depth 8 -compress lzw xpm/smallwindow.xpm tiff/smallwindow.tiff

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS a887b44977 WPrefs: grouped the choices for Window Move Display in a single place
By having an array, it makes the code simpler in many places, thus easier
to maintain and to implement new possibilities.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS d2101b287a WPrefs: grouped the choices for Window Resize Display in a single place
By having an array, it makes the code simpler in many places, thus easier
to maintain and to implement new possibilities.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS 6ef4b06cca WPrefs: created an array to store the database values for the Icon Position setting
By having an array, it makes the code simpler in many places, thus easier
to maintain. Took opportunity to include a comment about the trick used to
have a value convenient for use.

It is the opportunity to log an error message to user instead of silently
accepting invalid values.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Christophe CURIS d89b1f5ca3 WPrefs: moved the list of icon animations into an array
By grouping the information together, it makes the code less prone to
errors and easier to maintain as it links things that are related.

Took opportunity to log a message for the case where an invalid value
was found to ease user's debug.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-23 11:33:36 +00:00
Yury Tarasievich 034edb19e3 WPrefs: improve texts in the Window Handling panel
Did not update the translations msgid because I think translators may
wish to get it visible so they can bring similar improvements.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-21 17:35:06 +00:00
Christophe CURIS 9b67b36276 configure: add detection for O_NOFOLLOW flag to the open function
As discovered by Douglas Torrance, this flag is not really portable, so
this patch adds a check in the configure script to detect if any known
define could help. If no value works, we fall back to defining it with the
neutral value '0', so the compilation will not fail.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-17 17:33:56 +00:00
Christophe CURIS e1146e56e0 configure: rewrote the detection for WebP image library
Unfortunately, the detection was broken because the header is using a hack
on the function name to provide compatibility between different versions of
the API, which means the usual link test, which uses a known name of a
symbol, cannot work without also using the header to get the hack applied
on the function's name.

The new detection mechanism now simply check for both header and link at
the same time, so we're probably safe until a Major API change is decided,
in which case we will also have to update WRaster's code anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-16 09:37:48 +00:00
Christophe CURIS 7d6ecb51f6 wmaker: rewrote the update of _NET_WORKAREA property
As reported by Moritz, the Qt toolkit (and maybe a few other ones) are
using the content of this property, but WindowMaker did not set it properly
so for examples the menus in KDE could fail to display in multi-screen
configuration (probably because the toolkit is using the property to make
sure the menu stays in the visible area).

The original code just assumed it was safe to use the usable area of the
1st screen in the list, but unfortunately it is not that simple.

The new code calculates a rectangle that contains the usable region from
all the screens, so the toolkit gets a more accurate value.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-16 09:37:48 +00:00
Christophe CURIS be1c2a01dc configure: require a minimum version for Autoconf to avoid wrong generation
As found by Douglas Torrance, when the 'configure' script is generated
using v2.68 of autoconf then it gets wrongly generated due to a regression
in the handling of names in AS_VAR_PUSHDEF, and crashes with this kind of
sibylline messages:

checking CFLAGS for -Wtrampolines... ./configure: line 11916: wm_cv_c_check_compopt_Werror_trampolines=no, unknown: command not found

This patch adds a check on autoconf version to ensure the problem will get
caught as soon as possible.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-15 20:24:22 +00:00
David Maciejak c6e323e75d WINGs: increment version
This patch is incrementing version number as the API changed.
2014-12-10 10:19:54 +00:00
Christophe CURIS 0e884f793a util: remove local constants GLOBAL_DEFAULTS_SUBDIR that are not used
As pointed by gcc, this macro is not used anywhere in the 2 files. Because
the code also suggests that they should be inherited from any other place
anyway, remove them from the file to prevent them from being used in the
future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:20 +00:00
Christophe CURIS f9b14d7824 WPrefs: remove unused constants ICON_TITLE_*FONT
Apparently, there was a time when it was though to add a label below (?)
the icons of the list of panels, but this has never been finished and the
unfinished code to do this was even removed in commit
  0e01e69205

So, as it is unlikely that the "feature" will return, and if it did the
font should be handled in a better way, this patch removes the definition
of the constants with the names for the font used for those labels.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:20 +00:00
Christophe CURIS ee617cb291 wmaker: comment out definition of wm-spec constant that we do not use
Include a comment to explain what their aim is, and why WindowMaker is not
making use of them. They are not simply removed because it is informative
for future contributors that we know about them and we purposedly decided
to not use them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS b3c20610e9 wmaker: remove parameter 'which' from local function 'restoreMenu'
This parameter is given always the same value, so there is not reason to
keep it. The code is updated to take this value into account, and the
related constants are removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 1d1c5f77c7 wmaker: remove constants HORIZONTAL and VERTICAL from moveres.c
These 2 constants have been defined at the beginning of the project, but
where never used later. As the use of the associated constants suggests
that they are not bringing anything useful, this patch simply removes them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS b5e89127ca wmaker: add code to explicitly ignore Motif-WM flags we don't want to handle
The goal is to explain the reason why we don't do anything about them, so
people looking at the code in the future will know why it is this way. The
expected side effect is also to silent warnings [-Wunused-macros] from gcc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 7ce2636f63 wmaker: removed unused constant SCROLL_STEPS in the switchpanel code
As pointed by gcc, this constant is not used anywhere in the code. It seems
to have been prepared for a scroll animation when the switchpanel would be
too big to fit the screen, but the code looks like to never have been
activated, and was cleaned away in commit
  6d08aa22d8

If the feature were to be re-added, it would be better to use something
proportional to the menu scroll speed parameter that can be configured by
user anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 10b890e920 wmaker: removed unused macro DBLCLICK_TIME
As pointed by gcc, this macro is not used anywhere, that is probably
because the code have been relying on the function "IsDoubleClick" for a
very long time now.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 4799df5506 replaced all local definitions of PI by a single one
For code maintainability, it is better to have a single definition of the
constant than many ones dispatched in many places. In addition, we try to
count on the constant M_PI that can be defined by the header <math.h> if
possible because it may have the best accuracy for the platform.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 723f217355 remove unused macros defining corner positions
As pointed by gcc, the 4 constant the define the corner positions are not
used anywhere in the code, and it looks like it has always been like this.
As it is a cost for maintainability, get rid of them.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 1d0f02f5ca remove a few unused constant for size of buffers
As pointed by gcc, a few constants which contain sizes for buffers are not
used anywhere in the code. This is probably due to code cleanup, where
these buffers have been removed or where size is automatically calculated
by using 'sizeof' instead to reduce risk of bugs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS bbd42b3a20 WINGs: reuse GNUstep header instead of duplicating stuff in wwindow.c
There is a header that defines the stucts and constants to support GNUstep
specific things, and it is already used somewhere else in WINGs, so instead
of duplicating locally the stuff we re-use the header, it makes code easier
to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS ff77b6b2e5 WINGs: remove internal XDND macros that are not used
The group of XDND_* macro do not bring a lot in term of clarity, so it is
probable that they will get away someday, but at current time as 2 of them
are not used anywhere they get removed to prevent their use in the future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 3bf2978e63 WINGs: remove macro ABS_SHIFT from the wcolorpanel code
This macro was define a *very* long time ago, in commit
  d98f1fa645
but was not used at that time, and have never been used anywhere since
then.

As the macro does not look like a good idea for performance anyway, get rid
of it before anyone could get tempted to use it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 59106395c0 WINGs: remove dead code from 'loadPixmaps'
It seems the code had the possibility to load a default icon, probably to
be used on the windows if the main program does not provide any.

This code however have never been enabled, probably because it is better to
not provide an icon and let the window manager use its own.

This patch then removes that dead code, but keeps the image as part of the
WINGs resource for the case where an application would have been using it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS e09df40f78 WINGs: remove unused macro NFONT in wbutton
As pointed by gcc, this macro is never used in the code; when no font is
defined by user the 'paintButton' code already falls back to the
'normalFont' of the screen, and this code could not need the macro anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 4b0838e93a WINGs: remove unused constant DEFAULT_BORDER_WIDTH in wcolorwell
As pointed by gcc, this constant is not used anywhere, and it looks like
it have always been the case. As there's no reason to specifically add a
border to this widget, remove the constant.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 781fd777eb WINGs: remove constants used for default width+height for the widget
As pointed by gcc, the height is never used and the code make use of the
SCROLLER_WIDTH constant anyway, so this patch updates the code to directly
use that constant instead of intermediate values that just adds noise for
code maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS 03385c3d78 WINGs: remove the macro DEFAULT_TITLE because it is not used
As pointed by gcc, the macro is not used, that is probably because it is
totally ok to never provide a title from X point of view, so there is now
reason to fall back to that empty constant.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS e5efbe0cf2 configure: make the gcc check for trampolines stronger
Because the use of trampolines can be a lot of problems, this patch changes
the use of the flag to:
 - make it an error if possible, so coders are forced to not use them;
 - always enable them, not just for debug, so we increase the probability
to get them caught.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS 149f6b0390 configure: add a few warning flags for gcc and clang to help catch bugs
They concern topics like:
 - portability;
 - dangerous constructs;
 - clearer code for maintainability

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS 30e1fad926 configure: add macro to check compiler flag '-Wstrict-prototype'
Strict prototype are better for portability and to avoid bugs because it
makes sure the compiler has the information to properly validate the
arguments given when a function is called.

This flag however need special care when checking for it, because the
declaration for 'main' generated by autoconf cannot be a strict prototype
so the detection would always see the flag as failing.

This patch handles this by creating a dedicated macro for this detection
which uses a good prototype because we're in a case where it is possible,
so the detection will not always fail; it also makes sure to add the flag
to CFLAG only at the end, to avoid falsely crashing any further test done
in the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS 11fe8bd860 configure: rewrote the detection for -Wunused-macro
This flag is always detected as unsupported because every time autoconf is
generating a test program for any feature, it puts at the beginning of the
test source all the '#define' that have been detected so far, which is what
we expect normally.

But for this option, as we cannot reasonably make a dummy use of every
macro, the warning triggers and falsely gets autoconf into thinking it does
not work.

This patch creates a dedicated macro (WM_CFLAGS_GCC_OPTION_UNUSEDMACROS)
for this flag, which works around the problem by having no '#define' in the
test source. It also adds a new macro WM_CFLAGS_GCC_OPTION_POSTPONED
because if the flag works, we still cannot add it to the compilation
command because it could fail all further tests done, so the macro will add
it to CFLAGS only at the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
David Maciejak fa4d50a0ca wrlib: Merge some duplicate code when allocating color
This patch is adding a static function named allocateColor to merge
some duplicate code.
2014-12-10 10:19:18 +00:00
Christophe CURIS 0c938a3c0c WPrefs: fix icon used in the Opaque/Non-opaque Move setting
Apparently, some pixels from the close button on the window image were
missing from the Non-opaque image, they have been added in the XPM file
which was then converted to TIFF with ImageMagick's command:
  convert -depth 8 -compress lzw xpm/nonopaque.xpm tiff/nonopaque.tiff
to have a file similar to what was there before

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS be4849448f WPrefs: fix memory leak when storing the list of texture in Appearence panel (Coverity #50112)
As pointed by Coverity, the PLStrings created to store the information on
the texture leak. This is due to the fact that they are created with a
refCount of 1, then the PLArray in which they are placed increments that
count, so at list destruction the count would return to 1 instead of 0,
meaning the PLStrings won't be freed.

This patch release the PLStrings once after adding them to the PLArray so
the count will go back to 1, which means they will be properly freed when
the PLArray will be released.

Took opportunity to remove the call to WMRetainPropList on the titem-prop
because it artificially increases the refCount but this is already done
when adding to the PLArray.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS af1bcde13a checkpatch: fix bug in regular expression
Recent version of perl seem to report incorrect stuff in regular expression
and this seems to be fixed in the kernel reference file, so this patch
brings the fix to our (older) version so we won't get that spurious message
when running the script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS 34d82e5462 wmaker: replaced macro 'store_modifier' by an inline function, in X Modifier initialisation
A macro can be a source of problems, because the compiler has no type on
the arguments to make checks. Using an inline function allows to do those
checks, meaning clearer error messages, it provides clear info in case of
name collision, it is easier to maintain (no need for the hacky '\' for
multi-lines) and the scope of visibility can be controlled more easily (no
need for #undef).

The macro store_modifier had to face a slight change because its 2nd
parameter is used as a reference, which is now clearly visible in the
prototype of the function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS de00154fa1 wmaker: replaced macro by an inline function, in X Modifier initialisation
A macro can be a source of problems, because the compiler has no type on
the arguments to make checks. Using an inline function allows to do those
checks, meaning clearer error messages, it provides clear info in case of
name collision, it is easier to maintain (no need for the hacky '\' for
multi-lines) and the scope of visibility can be controlled more easily (no
need for #undef).

Took opportunity to change a 0 to the constant NoSymbol which is the name
defined by X for this case and another to NULL which is the right way to
set a null pointer in C.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS d9438e65ef makefile: make silent rule work also for generated files
A few files are generated using custom commands, which so far did not
follow the silent rule as the compilation stuff.

This patch adds the needed stuff so they will also be silent if the user
wants so, leading to a cleaner build process where warning/error messages
are more visible.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS 4bed8d14d7 wmaker: remove unnecessary null pointer checks in handle_event of wsmap
The function is called only if wsmap is not null, and the function is not
modifying its value so it won't become null. Removed the checks to keep the
code as simple as possible for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS ad84a2dc8f wmaker: moved the variable 'process_workspacemap_event' to the global namespace
The definition in the local header was not correct; it works because gcc is
tolerant to this kind of errors but other compilers are not. The
declaration was creating a local variable in each file that call header,
and because it is not static gcc's linker will merge them. Other compilers
will at best complain for duplicate symbol, and at worst silently duplicate
the variable so it will not work as expected.

The variable is now moved to the existing structure meant for global
variables, so now the code is really clear about using a global variable
instead of a static/local one.

Took opportunity to add some missing 'static' attributes to some variables.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
David Maciejak 41745d98d4 wmaker: add core workspace pager functions
This patch is adding the core code needed to run the workspace pager.

Currently when called, a new frame presenting mini workspace images
are displayed at the bottom of the screen above other windows.
When clicking on one of the miniatures, the workspace is switched and
the frame is closed.

Drawbacks: a screenshot of the workspace is used for the miniatures.
This screenshot is taken only when a workspace switched event occurs.

First, it means that the workspace switching process can be longer than
usual. Secondly, updated minitatures can only be available when the
workspace is "opened" (cause windows have to be mapped to be able to
be copied).

So when wmaker is (re)started or when for example a window is moved to
another workspace the corresponding miniature is NOT updated.
(I did not find a clean and easy way to do so, feel free to share if
you have some ideas)
2014-12-10 10:19:18 +00:00
David Maciejak 519302223c wmaker: add workspace pager underlying configuration
This path is adding the functions and variables needed for workspace pager preferences.
An option to enable/disable the workspace pager, and one to set a default background image.
2014-12-10 10:19:18 +00:00
David Maciejak ea8f18aff1 WPrefs: add workspace pager configuration
This patch is adding a checkbox in the expert zone to disable
completely the workspace pager and add an entry in keyshortcut
preference to set the shortcut used to open the pager with the
action "Open workspace pager".

The default frame background can be configured by setting an optional
variable "WorkspaceMapBack" from WindowMaker conf file as in:

WorkspaceMapBack = (tpixmap, "/tmp/testme.png", gray20);

or

WorkspaceMapBack = (solid, "#2c2482");
2014-12-10 10:19:18 +00:00
David Maciejak c10469264d WINGs: add functions to set widget background image
With this patch we can set widget background image.
As now, only background color was available.
2014-12-07 09:52:21 +00:00
Christophe CURIS 47ac986b53 Make sub-directories visible the automake's "dist*" targets
We have a few directories with source codes that we tell configure to
prepare, but we do not actually want them built during normal operations
(tests and examples only).

However, there are some special targets brought by automake which still
need to see them, so this patch adds these directories to the list, but
only for these rules, we keep them unvisited by the normal build process.

The wanted side effect of this is that now "make distcheck" works untill
the end as expectable.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-07 09:52:21 +00:00
Christophe CURIS 12babda9e7 WPrefs: link against math library because it is used in a few places
The code is making use of a few of the libm functions, but it looks like
gcc adds automatically the libm dependency (either by trying to be smart or
as an inherited dependency?).

Apparently, when compiling with clang-3.5 the function 'round' still needs
the use of math library (the others do not seem to), so this patch adds it
to the list of link libraries, which is more portable.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-07 09:52:21 +00:00
Christophe CURIS 80f18f60d2 WPrefs: Use standard C declaration of array instead of GNU syntax
As pointed by Clang, the declaration of array was using the GNU old syntax,
not the standard C.
2014-12-07 09:52:21 +00:00
Christophe CURIS 10371836ed wmaker: work around compilers that do not support nested functions
There are a few cases in which nested functions are an helpful way to write
code, as this is explained in 'script/nested-func-to-macro.sh'. However,
some compiler do not support them (like clang), so this patch proposes an
elegant solution, where developers can get the benefit of them, but for
users they are automatically converted to C macro if needed.

The advantage of this solution is that we keep the code simple, there is no
hack in the source (like #ifdef and code duplication), yet still having the
full advantages.

The translation is done according to what have been detected by configure
(see the WM_PROG_CC_NESTEDFUNC macro) so that user has nothing to do.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-07 09:52:21 +00:00
Christophe CURIS a24efec61f util: use wfree instead of free for consistency
The memory was allocated with wmalloc, so for consistency it should be
freed using wfree. This could be a problem if the user compiled with
support for Boehm GC, or if we later decide to add support for other malloc
libraries.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 6397f3403a util: return from 'findCopyFile' if the source file could not be found (Coverity #50075)
As pointed by Coverity, the function handles the case where the file to be
copied is not found by properly warning the user and the deleting the
currently built theme directory, but then it continued executing the file
copy that would crash on the null pointer.

This patch just adds the missing return that will avoid the crash.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 8ed6eacd06 WPrefs: fix memory leaks on temporary colours to draw icon's title in Appearence preview (Coverity #72808, #72810)
Two WMColor were created to draw the background for the title on icons for
iconified windows, in the Appearance panel. As pointed by Coverity, these
colors were not released after use, which this patch fixes.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 54feb499cb WPrefs: fix memory leak when storing the list of colors in Appearence panel
The name of the color is stored in a newly created PLString which leaks.
This is due to the fact that they are created with a refCount of 1, then
the PLArray in which they are placed increments that count, so at list
destruction the count would return to 1 instead of 0, meaning the
PLString won't be freed.

This patch properly calls  WMReleasePropList after addition to the list, so
that the count goes back to 1, which means it will be automatically freed
when the PLArray will be released.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS d83b5de644 wmaker: remove unnecessary check in acceptXDND (Coverity #72817)
As pointed by Coverity, if dock is still null at this point then the
function will return via the previous check, because it is not possible to
have icon_pos >= 0 if dock is null.

This patch removes the check because it complicate the code which is not
recommended for maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 3dea732ccb wmaker: removed variable 'done' to prepare return status in 'wNETWMProcessClientMessage'
Using a variable to store the return value that will be used later is not a
good idea, because it forces to track everywhere in the function when
needing to work on the function.

This patch removes the variables and places explicit return if each case,
so on first look it is clear where the code stops.

It also fixes a bug where the function would handle an event but still
returns False (meaning the event was not treated), whose root cause was
coming from the complexity brought by the variable.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 243a1924fa wmaker: fix signedness of variable (Coverity #50082, #50222)
Coverity complain that there can be security issues because the variable
'i' is being modified using untrusted data (coming from a file). This is
probably pessimistic, because in the present case we're talking with the
kernel.

Using the correct signedness for the variable should however keep us safe,
and (I hope) make Coverity happy.

Took opportunity to include an error message in case of read problem
because it can help to debug.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 1bd9621709 wmaker: do not store return value that we don't use (Coverity #50252)
As pointed by Coverity, we store a value into the variable 'entry' but we
never use it later, although we re-use the variable.

For the maintainability of the code, it is not really good as it could
mislead into thinking the value could be used, so this patch removes the
assignation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 8b78681a7f wmaker: remove intermediate strcpy in updateWorkspaceMenu (Coverity #50213)
Coverity warned because the 2 strcpy may overflow the target buffer (the
code relies on a constant for the max allowed workspace name length).

As in both cases the temporary copy is not useful because the temp copy
will be strdup'd just after, this patch removes the temporary buffer and
uses directly the string.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 7bf2565316 wmaker: replaced temporary allocation by local storage for error message
In case of problem with a directory when building the list of files for the
Icon Chooser dialog, an error message was generated using a temporary
allocated buffer. This is not really good for memory fragmentation, so this
patch re-uses the local buffer which will be enough for all reasonable
cases.

Took opportunity to make message less prone to translation difficulties,
and include more information about the problem to the user so he may know
what went wrong.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 7542451a04 wmaker: fix possible buffer overrun with filename for Icon Chooser (Coverity #50218)
As pointed by Coverity, there is a possible (yet improbable) buffer overrun
when building the list of files to be used in the Icon Chooser dialog.

Better safe than sorry, let's use the safer function to build the complete
name, and add a little message to the user in case of problem so at least
he can know something was not right.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS aa8ade1ef1 wmaker: change strcpy to the version with size check (Coverity #50217)
As pointed by Coverity, there were a number of copies done into fixed-size
buffer, it's safer to use the function that sets a limit on the size to
avoid a crash.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS 1b00071c26 wmaker: add check for null pointer in wAppIconCreateForDock (Coverity #50053)
As pointed by Coverity, there is in the same procedure a check for null
pointer before use, and later a direct use without check.

In most case, the pointer is not null, but it one case it is hard to be
sure that the pointer cannot be null, so it's safer to just add a check
there also.

Took opportunity to swap the order of the arguments in the if, because if
the config flag is false it is not necessary to spend time on doing the
more expensive strcmp.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:47 +00:00
Christophe CURIS 63733c9133 WINGs: fix possible problems due to sign extension when setting Icon (Coverity #50202)
As pointed by Coverity, there might be some problems due to sign extension
when performing the shifts and ors operations when converting the RImage to
the format expected for the WM_ICON property.

This patch try to improve things by using as much as possible unsigned
types and by using explicit types conversion instead of counting on the
wrong implicit type conversion done by the language.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:47 +00:00
Christophe CURIS c5d4c27a90 WINGs: to not allocate memory for a short lived array (Coverity #50136)
As pointed by Coverity, the array created to temporary store the list of
Atoms used in the function 'requestHandler' was leaked.

Because this array is very short lived, there is no need to allocate memory
for this, it just participates in memory fragmentation. Instead, we use now
memory on the stack which is more efficient.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:47 +00:00
Christophe CURIS b80118fb41 WINGs: fix WMPathForResourceOfType to check for all the paths it claims to check
The "documentation" of the function claims to check for the resource in a
number of path, but factually if the application did provide its argument
list when creating the WINGs App structure (which is likely) then the
search would stop before checking all paths.

The code now continues as expectable if the resource was not found in the
path. Took opportunity to avoid a temporary allocation that participated in
memory fragmentation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:47 +00:00
Christophe CURIS 4f050ebab9 WINGs: fix infinite loop when using Pango on string that have to be split
As reported by Charles Philip Chan, WPrefs would get into infinite loop
when the support for Pango is enabled.

The problem is due to long strings that are broken into multiple lines by
WINGs. This is done in an iterative process in the internal function
'fitText'.

In order to avoid the cost of duplicating many times the sub-strings, the
functions involved do not place a NUL at the string-splitting position, but
they rely instead on giving the length of the string as a parameter.

The code that checks the Pango text (to avoid re-submitting the string when
not needed) did not use that length, so it would always keep the original
string that is too long, so the fitText function would always receive the
same result and loop forever trying to find where to split the string.

This patch adds the check on the length, so Pango is given the appropriate
string for its pixel size calculation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 15:33:46 +00:00
Christophe CURIS 88352b7274 wmaker: do not remove Title Bar for windows that declare themselves as Toolbar or Tear-off menu
As pointed by Germán Arias, some windows in GNUstep did not have a title
bar because they declare themselves with the NET_WM type MENU.

A closer look at the spec shows that this type is meant for stuff like tear
off menus, and thus like for toolbar it is not expected that the
application does not want a titlebar, as opposite to DROPDOWN_MENU,
POPUP_MENU and COMBO.

So, this patch moves the case for TYPE_MENU to be the same as TYPE_TOOLBAR
and remove the flag that disables having a title bar.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:43:38 +00:00
Christophe CURIS 3a15750ad5 WPrefs: add check for image validity in 'loadRImage' (Coverity #50221, #50081)
As pointed by Coverity, the function blindly trust the data read from the
file, but in case of problem (corrupted file, not enough memory) it could
behave badly.

This patch adds a check for the depth, counts on RCreateImage to check the
width and height, and in any case it now includes a message for the user in
case he would like to understand what's wrong.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS d1e1521a88 WPrefs: fix possible buffer overrun (Coverity #50216)
As pointed by Coverity, if the Keysym name is very long and many modifiers
are used, the function 'capture_shortcut' could overflow its internal
buffer.

As the case is very unlikely to appear, do not increase the size of the internal
buffer (it seems to be already well sized, and we have no know maximum size
for a Keysym name), just use the appropriate function to append the name
at the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 8c1f59a40f WPrefs: remove fuzzy translation that are likely to puzzle user
Unfortunately this will lower the translation score for German, but the
translation guessed by fuzzy matching in gettext is not acceptable in the
current case: the translated string is already used for another entry in
the list, meaning that user would not see the difference between the two
and would probably then not understand why things do not behave the way he
expects.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 2b65b0416e wmaker: fix size of element given to the 'qsort' function (Coverity #50210)
As pointed by Coverity, the sizeof used was not done on the right type.
This worked because the element was a pointer all pointers types have the
same size in most platforms.

For code maintainability, the code will now take the size from the first
element of the array to be sorted, so that if the structure gets changed
someday the expression will stay valid.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 2ed24561ff wmaker: removed case from switch that is unreachable (Coverity #50043)
There is a check a few line above that already return from the function
because there is nothing to do for that case, so the case statement cannot
be reached. As not all case are covered in that switch anyway that won't
make a difference, and because an 'int' is used instead of an 'enum' the
compiler will not be able complain anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 6e8639c47d wmaker: change message to have only one string to translate and to have more information
The warning message was duplicated many times for each possible case, but
it could have used the same message everywhere, which ease the work of
translators. Took opportunity to include the complete command being
processed so that the user will know more about the problem and may be able
to fix it.

Updated the French translation to show the gain, but not the other
languages because it require more knowledge than what Google Translate can
provide me.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 877c26b467 wmaker: do not duplicate a string that does not need to be (Coverity #72814)
As coverity pointed, the duplicated string was never freed. Considering
what is done with it, is not necessary to allocate a duplicate for it, it
is a waste of time and participates in memory fragmentation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 285a926539 wmaker: update error message to have only one string to be translated
As a previous patch modified some instances of the error message to include
more information to the user, it is a good idea to update also the other
uses of the message, so that:
 - people helping on translation will have less messages to translate
 - this mean we provide more information to the user in these places too,
which can help him solve the problem

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:38 +00:00
Christophe CURIS 65e5f452ec wmaker: fix possible buffer overrun in readMenuPipe (Coverity #50211, #50212)
As Coverity pointed, when building the command line to execute the current
code just assumed that it would fit in the large buffer. If user were to
provide a line too long, this would crash.

Factually this is probably not possible at current time because the command
given to the function was actually already limited to the MAXLINE size when
it was read, but this may not be guaranteed in future evolution.

Better safe than sorry, so the patch implement a size check when appending
strings, using a more efficient method (strcat re-parse the destination
string from the beginning to find its end every time).

Took the opportunity to:
 - not include a trailing space at the end of the command
 - do not run command if it was truncated (it could be a problem) but
provide a message to the user about it, so he may fix the problem

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS d726eaf617 wmaker: fixes in function 'UnescapeWM_CLASS' (Coverity #50101, #50186, #50187)
As coverity found a number of problem in the code, a few changes are made
to the function:
 - allocate better sizes for the strings (the original code allocated too
much room in many cases and missed the room for the final '\0' in a case)
 - do not free strings if empty anymore (the actual check was not correct
anyway), but avoid allocating in first place if it is not necessary.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS ac3212b001 wmaker: fix memory leak in get_icon_filename (Coverity #50132)
Coverity pointed that in the typical code path the function FindImage would
be called twice, leading in leakage of the allocated result from the first
call.

This patch updates the condition so that the case won't arise.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 7013b72dce wmaker: remove unnecessary null check in readMenuDirectory (Coverity #50190)
As pointed by Coverity, the pointer cannot be null, otherwise the code
would have crashed earlier. As the code seems to always set a valid
pointer, there's no need to make a check there.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS de5ef8c4f1 wmaker: make parsing on display name less prone to crash in SetupEnvironment (Coverity #50096)
When creating the environment variable for the sub-process that wmaker can
create, Coverity pointed that if was possible to crash if the name of the
display did not contain the ':', which is probably ok in most case, but we
can't be sure about what it could contain in special cases.

This patch adds a proper check so, at least, it would not crash if the case
were to arise.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 38463df102 wmaker: fix incomplete null pointer check in wFrameWindowChangeTitle (Coverity #50058)
As pointed by Coverity, despite the numerous null pointer checks there is
still a case where one can pass trough and make wmaker crash.

This patch simplifies it all but making only one check at the beginning so
the code is safe and the remaining is simpler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS e27bab9f36 wmaker: remove unnecessary null check (Coverity #50196)
As pointed by Coverity, text cannot be null in this part of code. The
analysis shows that if it were, the function wIconChangeImageFile would
have directed execution to the 'else' branch. (and if it hadn't, the code
would have crashed beforehand because 'strlen' does not like null pointers)

Coverity recommends to remove the unnecessary check for code the
maintainability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 694e66e30d wmaker: removed unnecessary variable 'done' in panelBtnCallback
The variable is assigned a value that never change, so it adds extra
complexity which is not good for code maintainability. It is probable that
this was meant for cases that are handled in current code with early
function return, which are better for code readability.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS a6d7ac8cb9 wmaker: removed unnecessary null pointer check (Coverity #50041)
As pointed by Coverity, the 'cmd' is checked for null at the beginning of
the function, so the second case to handle the null pointer is not needed.
This also means that 'command' cannot be null (wstrdup never returns null)
so the code can also be simplified.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 421e9f942c wmaker: improve error messages when trying to start the helper
Try to provide better messages to understand what went wrong, including
more information, and made them translatable;

Changed the call to 'dup' into 'dup2' which has a safer behaviour because
we can specify the target descriptor we want;

Removed a few check for the 'close()' because in these cases we do not
really care if they fail (we can't do anything about it and it just adds
noise in the logs).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 39357e4f90 wmaker: close unneeded file handles when running the bg helper (Coverity #50137)
As pointed by Coverity, the file descriptor used in 'dup' to become the
child process's STDIN is leaked, because it will not be used anymore, so we
close it after the dup.

Similarly, the file descriptors that represent the other ends of the pipe
for each process are useless, so let's close them too to keep a reasonable
number of opened file descriptors over time.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS e16c6fbf2a wmaker: moved the code for the bg helper to a dedicated function
In order to make code easier to maintain, the code related to creating the
Helper process (which helps by setting the background of the workspace) is
moved to a dedicated function, which have been moved to the same location
as the function for communicating with the helper.

Took opportunity to de-CamelCase the related names.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 38d160cb8c wmaker: minor fixes for the size of an aperçu
There was a probable bug when reading settings, because the function used
was 'getInt' which would try to store the result in a 'char'. As it would
be probably easier for user to have the value directly in pixels, the
storage is now done in an int so there won't be problem anymore.

Changed the behaviour of the constant APERCU_BORDER, which would be assumed
to be the size of the border in pixel, but in previous code it was actually
the sum of the two border (1 on each side). All maths have been changed to
have it as a single border width.

Took opportunity to group variable assignation for titleHeight and
shortenTitle in a single place, because it is not convenient to have them
spread around (one value in the beginning and others later in the code) and
using default values prevents some checks that modern compiler can do to
help produce safer code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:43:37 +00:00
Christophe CURIS 572af55c9f wmaker: removed unnecessary assignation (Coverity #50257)
As pointed by Coverity, the return value is saved into a variable, but this
value is never used. As the variable is re-used afterwards, this
assignation could mislead on what is done, so for code maintainability the
value is just ignored.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS 3d9c059591 wmaker: removed unnecessary check when painting application icon (Coverity #50052)
As pointed by Coverity, there was a check for null pointer on
scr->dock_dots, but this check was not made in the 2nd use of it, done if
the HIDDENDOT feature was enabled.

Investigation show that it is not possible that this pointer could be
created NULL, so let's remove the unneeded check.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS 810796b390 WMaker: Fixed crash if the RContext creation fail on a Screen (Coverity #50066)
As pointed by Coverity, it is possible that RCreateContext fails for more
reasons that were handled by wScreenInit, so we provide an error message
for the other cases along with cleaner return from function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS 00f3ab0eaa wmaker: avoid allocating temporary memory in GetShortcutKey (Coverity #50115)
As pointed by Coverity, the function GetShortcutKey was allocating memory
for temporary operation, and did not free it in the end.

Because it participates in memory fragmentation and it is not really
efficient, this patch removes the allocation and uses a local storage on
the stack, and replaces wstrappend in favour of a fast string build.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS 894d3e89bf wmaker: replaced dangerous function type conversion by argument conversion
A type conversion applied to a function when used as a pointer is dangerous
because the compiler may not be able to make sure arguments will be
compatible across architectures, so it can crash the application.

This is replaced by a function prototype matching exactly what is expected
for the callback, and have the type conversion on the argument done inside
the function so the compiler have complete liberty to generate any code
needed to handle it safely.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS f60f14b7bd WINGs: fix possible null pointer dereference in W_RealizeView (Coverity #50060)
As pointed by Coverity, the function makes use of a pointer which may be
null, so we have to properly check that to ensure application will not
crash.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:19 +00:00
Christophe CURIS 0c659c1618 WINGs: removed unnecessary size checks in WMGetBrowserPaths
The function is building strings from the directory names into an allocated
buffer, but the function took time first to calculate the exact size needed
for the resulting string, so the check on wstrlcat's result will never
fail.

As we still use wstrlcat it is not possible to overrun the buffer, we would
just return a truncated string in the list instead of return no list at all
but the case where it would happen is impossible.

This should fix Coverity #50111 (Resource leak) which was present in the
code of one of the related early return.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS 082de93ca0 WINGs: inverted the direction for mouse wheel on WMSliders
The original choice may have looked mathematically correct, but it was
actually counter-intuitive and opposite to what every other application
do with sliders.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS 01fbeab1d4 WUtil: fix default rights for file created when saving PropList
When creating the temporary file that will become the final file if no
problem occurs, there is a chmod done which does not give write access to
the group and to the others, but this is the task of the user-set umask.

This patch makes the rights to everything (except execution, of course) and
still applies the umask, so in the end the file will have the rights that
user wants.

Took the opportunity to make a little change related to the umask: it seems
that some version of mkstemp have a security issue, which is in not a
problem in our use case, but Coverity reports it (#50201) so as it does not
cost anything, the patch also fixes it with an appropriate comment to
explain the situation.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS 155e1f1fe1 WUtil: rewrote wcopy_file for better error handling and to fix Coverity #50234
The original code used the libc "fopen" kind of operation, which are handy
when manipulating text files, but:
 - bring an overhead for binary files that we don't need here;
 - does not provide the mechanisms for safe error handling and special cases

As Coverity reported a Time-of-Check/Time-of-Use type of security issue,
took the opportunity to fix it and increased the size of the buffer used
for data to allow better use of modern disk performances.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Christophe CURIS 662b83769a WUtil: changed order for null pointer check in array functions (Coverity #72806, #72807, #72819)
As pointed by Coverity, there were some null pointer checks that had been
misplaced, due to a pointer dereference present in a preceding check. This
had been fixed by adding another null check in the check, making a
duplicate check.

This patch moves the null pointer check in first place, and remove the
pointer check from the range check to separate the pointer check on one
side and the range check on the other side.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-23 22:42:18 +00:00
Alwin 40139e208b Catch-up and some cosmetic changes of the Dutch .po files
Catch-up and some cosmetic changes of the Dutch .po files

Recently added msgid's were translated, plus a few really minor
changes. Kept some entries for last stable release.
2014-11-23 22:42:18 +00:00
Gaspar Chilingarov 7cb948098a wmaker: Support omnipresent setting toggle from keyboard 2014-11-23 22:42:18 +00:00
Christophe CURIS 33855a7a12 WPrefs: replaced call to external program "chmod" by the equivalent system call
It is more efficient to use the dedicated function than to call an external
binary program to do the job, and it reduce the risk of problem in case the
path would end up with potentially problematic characters.

It should also close Coverity bug #50225 ("Use of untrusted string value")

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS 34f35ee534 WPrefs: changed label from "msec" to the standard "ms" from the SI
The International System of Units defines "ms" as the standard abbreviation
for milliseconds, so let's use it everywhere to be consistent.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS 3846609072 WPrefs: minor improvements to the Workspace panel
It is general practice to not consider the strings displayed in a dialog as
real sentences, so this patch removes the dots at the end (including in the
translation);

Took the opportunity to fix some translated string that were probably not
found anymore to due other changes;

Moved a few widgets to make everything look better centered;

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-23 22:42:18 +00:00
Christophe CURIS 7e40a61d16 WPrefs: minor reorganisation in the Keyboard Shortcut panel
The goal was to reduce the risk of truncated lines in the list of actions
(a few of them are a bit long - and need to be!), so it was an opportunity
to align the widgets with consistent spacing.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:04 +00:00
Christophe CURIS 14dc8dd415 WPrefs: minor improvements to the Focus Preference panel
It is general practice to not consider the strings displayed in a dialog as
real sentences, so this patch removes the dots at the end (including in the
translation);

Took the opportunity to make a light cleanup of the translations in the
concerned areas, and fix some translated string that were probably not
found anymore to due other changes;

Make small reorganisation of the widgets to reduce the risk of truncated
strings, with keeping the overall clean aspect of the panel;

Took the opportunity to clarify the label related to the colormap to avoid
misunderstanding, and include a balloon text to clarify its reason-to-be
because, as modern display tend to all be TrueColor, it may not be
intuitive to new user what it's for.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:04 +00:00
Christophe CURIS 1b183633e1 WPrefs: small reorganisation in the Dock Preferences panel
The goal is to reduce the risk for truncated label, and take the
opportunity to align everything with consistent spacings.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS c3c8a0654c WPrefs: reorganised the Window Handling Settings panel for better look
Due to a long history of evolution, it was time to rethink the placement
of all widgets to achieve a clean look. The frames have been reshuffled to
be aligned to each other, and as a bonus the Mod+Wheel setting now has its
own frame instead of being part of another unrelated frame.

Took opportunity to include an info balloon to explain what the "by
keyboard" checkbox actually means.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS 753f44ca83 WPrefs: reorganised the Preference panel for better look
As many option have been added to it, the panel started to look overloaded.
With a little rework, it now displays the same options in a cleaner way.
Took opportunity to include some balloon help for the AppIcon option to try
to be clearer than what the short label allows.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS 03a7771c86 WPrefs: reorganised the Mouse Settings panel for better look
As many option have been added to it, the panel started to look overloaded.
Content have been slightly moved to make it look nicely organised inside
the window, and with possibly less truncated text.

Took opportunity to include a visual feedback to the user, when checking
the "Disable mouse actions" box then we disable the related popup menu
buttons to reflect this.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS 60d9fc5bb7 WPrefs: grouped items related to the mouse actions in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS 17c3404bef WPrefs: grouped the balloon text for the dock configuration with the rest of the struct
As the data to create the icons for the dock configuration was already
grouped in a structure, it is a good idea to also include the balloon text
which is linked to them in the array, so the code is simpler and safer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Christophe CURIS 68e550b924 WPrefs: moved the titles of Clip Delay frames to an array
As the code is already treating these frames as an array, it is a good idea
to do the same for their titles so it is possible to reuse its size at
convenient places to make the code safer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-08 20:12:03 +00:00
Doug Torrance 48ce9d046e debian: Capitalize "Maker" in X session desktop entry. 2014-11-08 11:22:52 +00:00
Doug Torrance 0acbec36ac WINGs: Link examples against Xlib.
The font lister WINGs example program was failing to build because it uses
the XOpenDisplay() function from Xlib.
2014-11-04 14:33:08 +00:00
Doug Torrance 4a2e202af8 WINGs: Avoid cast from pointer to integer of different size compiler warnings. 2014-11-02 13:14:54 +01:00
Doug Torrance a47f07cfc3 WINGs: Fix unused parameter compiler warnings in examples. 2014-11-02 13:14:54 +01:00
Doug Torrance fc35dfd277 WINGs: Fix decimal/hexadecimal conversion bug in color panel.
In particular, the values were only being converted when the RGB slider was used
to pick the color.  If another tool was used, e.g., the magnifying glass, th e
value was assumed to be decimal, even if hexadecimal was selected.
2014-11-02 13:14:54 +01:00
Christophe CURIS 74dc2d2cc0 WPrefs: use length of array instead of hard-coded constant for sample colours
In the panel for Appearance configuration, there are some sample colours
proposed to users; the code used to have a bunch of constants hard-coded
to handle these colours.

This patch replace all constants with the macro wlengthof to use the number
of element in the array determined by the compiler, so modifying the list
won't cause hidden bugs. This include a somehow smarter code to dispatch
the colours in the window to automatically arrange them cleanly whatever
their number is.

Took opportunity to de-CamelCase the name of the array as it did not add
complexity in the patch.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS efe0da4618 WPrefs: grouped items related to the possible window placement algorithms in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS 8522283d68 WPrefs: grouped items related to the behaviour of moving a maximized window in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Took the opportunity to de-CamelCase the name of the variable to comply
with project's coding rules.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS d02d362295 WPrefs: grouped items related to the AppIcon bouncing configuration in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:20 +01:00
Christophe CURIS e73c3e84de WPrefs: grouped items related to the help balloon configuration in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync. It also makes the code simpler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS 454c7bec5d WPrefs: grouped items related to the window title alignment in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS c0d4c16336 WPrefs: grouped items related to the menu style in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS 4bb93d3dab WPrefs: replaced a few constants by the macro 'wlengthof'
This reduce the risk to miss something in case the array they refer to gets
updated, because with the macro the proper number of element will be
evaluated by the compiler automatically.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS 6ac27ba842 WPrefs: created macro 'wlengthof_nocheck' for the cases were wlengthof cannot be used
Because the macro wlengthof preforms a check of validity of its argument
with static_assert, there is a use case where it fails with a compiler
error. This patch introduces an alternate macro without the check, to be
used only for this specific case.

To be able to use the size of the array, a few of those array declaration
have to be moved before the structure in which their size is used.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:13:19 +01:00
Christophe CURIS 7d09b2c04f wrlib: add support for release 5.1.0 of the libgif
As reported by Andrew, the compilation of the WRaster broke because
there was an API change in libgif v5.1 versus the v5.0 (something had been
forgotten for DGifCloseFile to be easily used in wrappers for dynamic
languages).

Now, if we have detected that we're in 5.x release, we use the GIFLIB_MINOR
macro to see what the function prototype is (this macro was introduced only
in 4.1.6 so we cannot fully rely on it to detect the version of the
library).

The possible error code is not used because at the place we use the
function we would not be able do do anything more meaningful with it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS 3de5b8fb42 util: removed usage of external '__progname' because it is not portable
As reported by Milan Čermák, using this variable breaks compilation on
Solaris, because it is a hack which is not standard. To ensure portability,
we now rely on main's argv[0] which is always available.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS ff8fc10a65 configure: add detection for 'nanosleep' function with appropriate headers
As reported by Milan Čermák, Solaris needs extra library 'rt' to have
access to that POSIX function, so we properly check for it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Milan Čermák 484c880fd0 wmaker: remove call to internal X11 header
The header 'Xarch' is not part of the standard, it is an internal header
that is already included by the other headers; furthermore it is not needed
directly by the code in wmspec.c.

As it breaks compilation on some platforms (namely Solaris 10), its call is
removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Milan Čermák 1748a18380 wrlib: fix usage of deprecated attribute for gcc 3.x
It seems that the argument to the attribute 'deprecated' is a novelty of
gcc 4.x, the attribute introduced in gcc 3.x did not take any parameter.

As Solaris 10 is providing gcc 3.4.3, this patch updates the detection in
the public API header to make it compile properly.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS 461214d870 util: clarify error message in "wmaker.inst" in case of directory creation failure
Previously, the directory was expected to already exist, but as now it is
automatically created it is a good idea in case of problem to have the
message clearer.

Took opportunity to indent properly that part of code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:04:14 +01:00
BALATON Zoltan cb3702559a wmaker: Restore multi screen functionality by reverting wrong commits
Revert patches that moved variables from WMScreen to global level
because this broke X displays with multiple independent screens and
caused dock and clip icons to become mixed up. When managing multiple
screens each screen used to have it's own state/dock and clip. This
commit restores that by reverting mainly the commits listed below (and
those that are invalidated by reverting these) and fixing up later
commits to apply after the revert.

Reverted commits:
f60e65001b Moved 'workspace_name_font' from the Screen to a Workspace object in the global namespace
9e103a46e9 Variable workspace_count moved to the workspace object in the global namespace
e5ae684d02 Variable last_workspace moved to workspace object in global namespace
c610b8d7ce Variable current_workspace moved to workspace object in global namespace
f0c5073600 Array of workspaces moved to the workspace object in the global namespace
9c252988f8 Variable workspace_menu moved to workspace object in global namespace
e86b8dcb2f Clip, Dock and Drawers menu moved to appropriate global namespace
074092f319 Removed WScreen args not used
4a7daf2322 AppIcon list moved out of WScreen
2103fe390b Variable clip_icon moved to clip object in the global namespace
014bc52531 wClipIconPaint appicon argument removed
40e1ea08b8 Varible session_state moved to global namespace
6987d4aa40 Removed WScreen argument
0de3e590ce shortcutWindows moved to w_global
2e64831fb6 Removed unused variable wapp_list
b6423a7b4f wmaker: Moved variable Screen Count into the global namespace

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
Khaled Hosny e3dcadde30 WINGs: Add optional Pango text layout support
Currently WINGs renders text using Xft directly which does not support
any advanced text layout that is needed for scripts like Arabic or Indic
scripts (or even things like automatic ligature support for Latin
script).

With Pango we also get text fallback for free, so no more square boxes
for characters not supported in the current font (unless no font on the
system supports the specified character, of course).

This patch introduces support for using Pango to render the text (though
its Xft backed), to avoid forcing the additional dependency to everyone
it is made off by default.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak 1485233292 wmaker: fix maximizing window in multiple screens env
This patch is fixing the maximize window feature.
As it was reported by Miikka Veijonen, in multiple
screens env wmaker is reserving some space for the dock
even on screen that are not displaying it.

This patch is only adjusting the working area for the head
that is displaying the dock.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak 870a73ff32 WINGs: add function to get button caption
This patch is adding a new function WMGetButtonText to get the button caption.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 13:04:14 +01:00
David Maciejak 65f8cb7a4b wmaker: fix arbitrary shell command injection
Workspace background pref can be tricked to run arbitrary cmds.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance a307b9f867 Update ChangeLog, from version 0.92.0+ to most recent commit.
Generated by the new update-changelog.pl script.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance d3f9c2cd75 Add script to update ChangeLog from git log.
This patch adds update-changelog.pl, a script which adds the subject line and
author of every commit since ChangeLog was last touched by git, in a style
consistent with the entries up to version 0.92.0.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance 4546065276 wmaker: Consistent whitespace in WindowMaker.h.
Previously, the whitespace in WindowMaker was inconsistent, with some
indentation using spaces and some using tabs, and a mixture of tabs and spaces
used to align comments at the ends of lines.  As a result, patches that touched
this file would often result in warnings from checkpatch.pl.

This patch fixes this so that indentation uses tabs and all other alignment uses
spaces.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance 47ec274760 wmaker: Add more directions for window snapping.
This patch adds the ability to "snap" a window to the top, bottom, or any of the
four corners of the screen.  It uses three new helper functions, drawSnapFrame,
getSnapDirection, and doSnap, to reduce code duplication and increase
readability.

It also updates NEWS to indicate the additional directions.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance da940a1e4d NEWS: Add note about dragging maximized windows.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance b20a58d592 WPrefs.app: Add ability to set behavior when dragging a maximized window.
You can now set the behavior when dragging a maximized window, i.e., the
"DragMaximizedWindow" option from ~/GNUstep/Defaults/WindowMaker, from the
"Window Handling" tab of WPrefs.app.

Note that to make room for the pop-up button required to set this option, the
switch button to set the "OpenTransientOnOwnerWorkspace" option has been moved
to the "Expert User Preferences" tab and the "Edge Resistance" frame has been
made slightly smaller.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:04 +01:00
Doug Torrance 9937566ec4 wmaker: Add new options for dragging maximized windows.
You can now configure the behavior when dragging a maximized window by setting
DragMaximizedWindow in ~/GNUstep/Defaults/WindowMaker.  The options are:
- Move: Move the window and retain its maximized status and geometry (the
  current behavior and the default).
- RestoreGeometry: Move the window and unmaximize it, restoring its original
  geometry.
- Unmaximize: Move the window and unmaximize it, retaining its maximized
  geometry.
- NoMove: Don't move the window.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Amadeusz Sławiński 81e2b42746 fix maximize when dock is set 'on top' and it should be covered
Window Maker was not correctly maximizing windows in some cases

"... do not cover dock" enabled with "Dock postion":
Normal             - maximizes ok
Auto raise & lower - maximizes ok
Keep on Top        - maximizes ok

"... do not cover dock" disabled with "Dock postion":
Normal             - maximizes ok
Auto raise & lower - maximizes ok
Keep on Top        - maximizes not covering dock

Reported-by: Johann Haarhoff <johann@haarhoff.org.za>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance 3d7e271d3b NEWS: Add note about window snapping.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance 4d82f9efde WPrefs.app: Add ability to enable or disable "unmaximize on move" feature.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance 12fa7b2203 wmaker: Add "unmaximize on move" feature.
This patch adds the ability to completely unmaximize, i.e., clear the maximized
flag and return to the original geometry, a maximized window that is moved.
This behavior mirrors that of other common desktop enviroments, e.g., GNOME,
Unity, and Windows.

To enable this feature, set "UnmaximizeOnMove = YES" in
~/GNUstep/Defaults/WindowMaker.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance 38b58112ac wmaker: Clear maximized flag of a maximized window when moved.
If a user moves a window which is currently maximized, the current behavior is
to keep the window geometry and maximized status unchanged.  This can lead to
peculiar behavior.  For example, suppose a user maximizes a window to the
right half of the screen (either through the window menu, keyboard shortcut, or
new snapping feature), then moves it, and then attempts maximize it to the
right half of the screen again.  Instead of the expected result, the window is
unmaximized and returned to its original geometry.

This patch changes the behavior by clearing the maximization flag when a
maximized window is moved.  Then, when a window is maximized and then moved, it
can be maximized again without issues.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance a8f0b68eaf WPrefs.app: Add ability to enable or disable window snapping.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance df49061865 wmaker: Add window snapping feature.
This patch adds the ability to "snap" a window to one side of the screen by
dragging it to that side.  It is enabled by setting WindowSnapping = "YES" in
~/GNUstep/Defaults/WindowMaker.

Note that window snapping is automatically disabled if DontLinkWorkspaces =
"NO", as this feature also involves dragging a window to one side of the
screen.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 5f6f73e178 util: create custom GNUSTEP dir if needed
This patch is creating the missing custom GNUSTEP dir.
Patch found on vinelinux.org as WindowMaker-0.95.6-GSDIR.patch.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 5b42f6d090 wmaker: add clip mouse wheel action to change workspace
This patch is adding mouse wheel action on clip to switch from
one workspace to another. It's a modified version of the vinelinux.org
(WindowMaker-0.95.6-wheel.diff) which was setting the action on the entire dock.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 334e2cc5f4 wmaker: improve windows listing in switchpanel
This patch is updating makeWindowListArray function,
as it crosses the whole window focused list each time
we don't have to bother on checking previous and then next
focused windows, so saving some cycles here.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
Doug Torrance 1497bc354b wmaker: Remove dead links from BUGFORM.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 0d0169a413 WPrefs: add new mouse actions configuration
This patch is adding GUI configuration for new mouse actions:
-Previous Workspace
-Next Workspace
-Previous Window
-Next Window
-Switch Windows

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak f40095ac9e wmaker: add new button and wheel mouse actions
This patch is adding atomic mouse actions to mouse buttons to:
-focus on previous or next window
-move to previous or next workspace

and adding wheel action to
-switch between windows

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 39f6130a28 wmaker: use defined wWindowSingleFocus() function
This patch is cleaning focuswindow() local function to call
wWindowSingleFocus() global function.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 36b9f6cb23 wmaker: add next and previous window focus functions
This patch is adding a wWindowFocusPrev() and wWindowFocusNext() functions.
And copying switchmenu.c focusWindow() as wWindowSingleFocus().

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 7082561a42 WPrefs: set default to 1st color in gradient texture
This patch is updating the gradient texture user experience
by auto selecting the first color in the list when possible
and fixing the autoselection after a delete action.

In fact what that is called gradient colors is just a list of colors
with hue/saturation/brightness value.
That patch is loading the first one from the list (color, hue,
saturation, brightness) and setting the 3 sliders according to that
value instead of using some default hardcoded values.
The default color value on the top-right is never modified.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:03 +01:00
David Maciejak 10e0bdf39b wmaker: update NEWS for 0.95.6
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak 88d9deea83 wrlib: merge gradient duplicate code
This patch is adding a new static function named renderGradientWidth
to factorize some code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
Alwin bec572ea8b Make two text strings translatable
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
Alwin a392c30b0d Catch-up and some improvements of the Dutch .po files
Recently added msgid's were translated, and some existing translations
improved. As development is done in git 'next', strings from wmaker-0.95.6
will be remained at the end of the files, so they are backward compatible.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak 0399d70868 wmaker: merge reading menu duplicate code
This patch is adding a readMenu function to be called from
readMenuPipe and readMenuFile, saving about 20 lines of code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak 09761a75f0 WINGs: merge bagtree duplicate code
This patch is adding a new static function treeDeleteNode to factorize some code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak 2a3c11e202 WINGs: merge hashtable duplicate code
This patch is adding a new static function hashGetItem to factorize some code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
David Maciejak 118beb2c60 wmaker: improve key shortcut labelling
This patch is improving the key shortcut labelling in the root menu.
It modifies the GetShortcutString function to save some cycles
as wXModifierFromKey is already doing all the string comparisons.
This patch introduces a new function called wXModifierToShortcutLabel
that is checking the return value from wXModifierFromKey.
Not sure why Control was set as a special key, as keyboards could
have 2 controls but also 2 shift keys.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-11-02 12:50:02 +01:00
597 changed files with 59894 additions and 18763 deletions
+51 -3
View File
@@ -30,6 +30,12 @@ m4/ltversion.m4
m4/lt~obsolete.m4
src/wconfig.h
WINGs/WINGs/WINGsP.h
wrlib/wraster.h
# These files are generated by scripts
INSTALL-WMAKER
README.i18n
# These files are compilation stuff
*.lo
@@ -58,7 +64,6 @@ util/wmsetup
util/wxcopy
util/wxpaste
wrlib/get-wraster-flags
wrlib/tests/testdraw
wrlib/tests/testgrad
wrlib/tests/testrot
@@ -74,8 +79,6 @@ WINGs/Tests/testmywidget
WINGs/Tests/wmfile
WINGs/Tests/wmquery
WINGs/Tests/wtest
WINGs/get-wings-flags
WINGs/get-wutil-flags
WPrefs.app/WPrefs
@@ -84,11 +87,56 @@ wrlib/wrlib.pc
WINGs/WINGs.pc
WINGs/WUtil.pc
wrlib/libwraster.map
WindowMaker/appearance.menu
WindowMaker/menu
WindowMaker/menu.bg
WindowMaker/menu.fi
WindowMaker/menu.fy
WindowMaker/menu.hu
WindowMaker/menu.ko
WindowMaker/menu.nl
WindowMaker/menu.ro
WindowMaker/menu.sk
WindowMaker/menu.zh_TW
WindowMaker/plmenu
WindowMaker/plmenu.bg
WindowMaker/plmenu.es
WindowMaker/plmenu.fi
WindowMaker/plmenu.fy
WindowMaker/plmenu.ja
WindowMaker/plmenu.ko
WindowMaker/plmenu.nl
WindowMaker/plmenu.pl
WindowMaker/plmenu.ro
WindowMaker/plmenu.sk
WindowMaker/plmenu.zh_CN
WindowMaker/plmenu.zh_TW
WindowMaker/wmmacros
WindowMaker/Defaults/WMRootMenu
WindowMaker/Defaults/WMState
WindowMaker/Defaults/WMWindowAttributes
WindowMaker/Defaults/WindowMaker
WindowMaker/IconSets/Default.iconset
WPrefs.app/WPrefs.desktop
# These files are generated by the i18n process
/po/WindowMaker.pot
/po/*.mo
/WINGs/po/WINGs.pot
/WINGs/po/*.mo
/WPrefs.app/po/WPrefs.pot
/WPrefs.app/po/*.mo
/util/po/*.pot
/util/po/*.mo
/wrlib/po/*.pot
/wrlib/po/*.mo
# Some text editors generate backup files
*~
.pc
+2 -2
View File
@@ -210,7 +210,7 @@ various fixes/enhancements to WINGs
Yoav Yerushalmi <yoav@mit.edu>
Fixed -visualid for screens that can do multiple depths. Another fix in
Fixed -visualid for screens that can do multiple depths. Another fix in
libproplist. Chooses best depth in screen.
FRBall <frb@umr.edu>
@@ -218,7 +218,7 @@ dgradient fix
"]d" <id@windowmaker.info>
Window list menu miniaturized/hidden hints, XDE support, XKB lock
Window list menu miniaturized/hidden hints, XDE support, XKB lock
language status, WINGs enhancements, bug fixes, window commands menu
enhancement, window move/resize by keyboard. GNUstepGlow.tiff icon,
WINGs color panel, Appearance section icon(s)
+5 -10
View File
@@ -3,13 +3,8 @@
---------------------------
If you find a bug please fill this form and send it to
wmaker-dev@lists.windowmaker.org Please, USE THIS FORM!!!
You can also report a bug in the WWW bug tracker at
http://bugs.windowmaker.org/projects/wmaker/issues or by sending this report to
bugs@windowmaker.org
If you find a bug please fill this form and send it to
wmaker-dev@googlegroups.com Please, USE THIS FORM!!!
0. Before reporting this bug I already:
[ ] read the NEWS, README and INSTALL files
@@ -21,8 +16,8 @@ bugs@windowmaker.org
[ ] crashed
[ ] configuration option does not work
[ ] weird behavior
[ ] cosmetic
[ ] some problem with WPrefs
[ ] cosmetic
[ ] some problem with WPrefs
[ ] others: ...................................
2. Detailed description of what happened:
@@ -33,7 +28,7 @@ bugs@windowmaker.org
4. Configure time options you specified:
[ ] --enable-kanji
[ ] --disable-shape
[ ] --disable-shape
[ ] --enable-single-icon
[ ] --enable-modelock
[ ] Others: .......................
+2 -2
View File
@@ -1,5 +1,5 @@
Newly added
- after a crash, wmaker will forget the hidden state of the apps and just
- after a crash, wmaker will forget the hidden state of the apps and just
show their windows minimized. normal restart is unaffected
- after a crash, wmaker will completely mess the window's saved geometries
and maximizing will have weird results. restart is unaffected
@@ -16,7 +16,7 @@ Newly added
in the session/allow docking it if yes.
- the SHELL environment variable support in the apps menu was removed
because of a problem with tcsh. If ~/.tcshrc contains "stty erase ^H",
it will block and the cmd will not be executed.
it will block and the cmd will not be executed.
- mouse grab being done in client window (in wWindowResetMouseGrabs())
instead of the frame window. If grab is done in frame, titlebar buttons
dont work well
+1 -1
View File
@@ -51,4 +51,4 @@ of this license document, but changing it is not allowed.
Ok, the purpose of this license is simple
and you just
DO WHAT THE FUCK YOU WANT TO.
DO WHAT THE FUCK YOU WANT TO.
+2840 -65
View File
File diff suppressed because it is too large Load Diff
+393 -370
View File
File diff suppressed because it is too large Load Diff
-69
View File
@@ -1,69 +0,0 @@
If I18N support does not work for you, check these:
- the LANG environment variable is set to your locale, and
the locale is supported by your OS's locale or X's locale
emulation. you can display all supported locales by
executing "locale -a" command if it available. and you
can check if your locale is supported by X's locale emulation.
See "/usr/X11R6/lib/X11/locale/locale.alias"
- Check if you're using appropriate fonts for the locale you
chose. If you're using a font set that has a different
encoding than the one used by Xlib or libc, bad things can
happen. Try specifically putting the encoding in the LANG
variable, like ru_RU.KOI8-R. Again, see
"/usr/X11R6/lib/X11/locale/locale.alias"
- if your OS doesn't support any locale or if your OS doesn't
support a locale for your language, you can use X Window System's
locale emulation feature instead of OS's locale. To use this
feature, add this option to the configure, "--with-x-locale".
if your OS is commercial one, such as Solaris, IRIX, AIX, ...
you perhaps don't have to use X's locale emulation.
But if your OS is Linux or NetBSD or..., it is possible that
your locale is not supported so far. then use "--with-x-locale".
Note: to use X's locale emulation, your Xlib has to be
compiled so that the locale emulation is enabled.
Linux RedHat5.0's default Xlib is not compiled
like that. (RH4.x are ok). Recompiled Xlib for
RH5.0 where you can use locale emulation is available
here:
ftp://ftp.linux.or.jp/pub/RPM/glibc
- the fonts you're using support your locale. if your font
setting on $HOME/GNUstep/Defaults/WindowMaker is like..
WindowTitleFont = "Trebuchet MS:bold:pixelsize=12";
MenuTitleFont = "Trebuchet MS:bold:pixelsize=12";
......................................................
then you can't display Asian language (ja, ko, ch) characters using
Trebuchet MS. A font that is guaranteed to work for any language is
sans (or sans-serif). sans is not a font itself, but an alias which
points to multiple fonts and will load the first in that list that
has the ability to show glyphs in your language. If you don't know
a font that is suited for you language you can always set all your
fonts to something like:
"sans:pixelsize=12"
However, please note that if your font is something like:
"Trebuchet MS,sans serif:pixelsize=12"
this will not be able to display Asian languages if any of the
previous fonts before sans are installed. This is because unlike
the proper font pickup that sans guarantees for your language,
this construct only allows a font fallback mechanism, which tries
all the fonts in the list in order, until it finds one that is
available, even if it doesn't support your language.
Also you need to change font settings in style files in
the "$HOME/Library/WindowMaker/Style" directory.
- the LC_CTYPE environment variable is unset or it has the correct
value. If you don't know what is the correct value, unset it.
-437
View File
@@ -1,437 +0,0 @@
Installation Instructions for Window Maker
The latest version of Window Maker (-crm) can be found in the
git repository at
http://repo.or.cz/w/wmaker-crm.git
SUPPORTED PLATFORMS
===================
- Intel GNU/Linux Systems in general
Patches to make it work on other platforms are welcome.
REQUIREMENTS:
=============
The following software is required to use Window Maker:
- X11R6.x
Window Maker can be compiled in older versions of X, like X11R5
(Solaris) or X11R4 (OpenWindows) but it will not work 100% correctly.
In such servers there will not be application icons and you'll have
trouble using the dock. Upgrading the client libraries (Xlib, Xt etc)
will help if you can't upgrade the server.
The following is required to build Window Maker:
- Basic obvious stuff
gcc (or some other ANSI C compiler)
glibc development files (usually glibc-devel in Linux distributions)
X development files (XFree86-devel or something similar)
- autoconf, automake and libtool
autoconf 2.54
automake 1.4
libtool 1.4.2
- Xft2
and its dependencies (such as freetype2 and fontconfig)
You will also need the development files for it (xft2-devel)
OPTIONAL:
=========
These libraries are not required to make Window Maker work, but they
are supported in case you want to use them. Version numbers are those
that I have (and therefore, guaranteed to work), but other versions
might work too.
- libXPM 4.7 or newer
Older versions may not work!!!
Available at ftp://sunsite.unc.edu/pub/Linux/libs/X/
There is built-in support for XPM files, but it will not
load images in some uncommon encodings.
- libpng 0.96 or newer and zlib
For PNG image support.
http://www.cdrom.com/pub/png/
- libtiff 3.4 or newer
For TIFF image support.
You can get it at ftp://ftp.sgi.com/graphics/tiff
- libjpeg 6.0.1 or newer
For JPEG image support
http://www.ijg.org/
- libgif 2.2 or libungif
For GIF image support
ftp://prtr-13.ucsc.edu/pub/libungif/
- GNU xgettext
If you want to use translated messages, you will need GNU gettext.
Other versions of gettext are not compatible and will not work.
Get the GNU version from ftp://ftp.gnu.org
CONFIGURE OPTIONS:
==================
If you downloaded the cvs or git versions, type
./autogen.sh
to generate the config files.
These options can be passed to the configure script to enable/disable
some Window Maker features. Example:
./configure --enable-modelock --disable-gif
will configure Window Maker with modelock supported and disable gif support.
Normally, you won't need any of them.
To get a list of other options, run ./configure --help
--with-libs-from
specify additional paths for libraries to be searched.
The -L flag must precede each path, like:
--with-libs-from="-L/opt/libs -L/usr/local/lib"
--with-incs-from
specify additional paths for header files to be searched.
The -I flag must precede each paths, like:
--with-incs-from="-I/opt/headers -I/usr/local/include"
--disable-shm
disable use of the MIT shared memory extension. This will slow down
texture generation a little bit, but in some cases it seems to be
necessary due to a bug that manifests as messed icons and textures.
--disable-motif
disable support for mwm window manager hints
--enable-modelock
XKB language status lock support. If you don't know what it is you
probably don't need it.
--disable-xpm
disables use of the XPM library even if it is available on your
system.
--disable-png
disables use of PNG library
--disable-tiff
disable use of TIFF library
--disable-gif
disable use of GIF library
--disable-jpeg
disable use of JPEG library
--disable-shape
disables shaped windows (for oclock, xeyes etc.)
PLATFORM SPECIFIC NOTES:
========================
- GNU/Linux in general
Make sure you have /usr/local/lib in /etc/ld.so.conf and that you
run ldconfig after installing.
Uninstall any packaged version of Window Maker before installing a new
version.
- RedHat GNU/Linux
RedHat systems have several annoying problems. If you use it,
be sure to follow the steps below or Window Maker will not work:
* if you installed the Window Maker that comes with RedHat, uninstall
it before upgrading;
* make sure you don't have the LANG and LINGUAS environment variables
set to en_RN;
* make sure you have /usr/local/bin in your PATH environment
variable;
* make sure you have /usr/local/lib in /etc/ld.so.conf before running
ldconfig;
- PowerPC MkLinux
You will need to have the latest version of Xpmac. Older versions
seem to have bugs that cause the system to hang.
- Debian GNU/Linux
If you want JPEG and TIFF support, make sure you have libtiff-dev
and libjpeg-dev installed.
- SuSE GNU/Linux
If you installed the Window Maker package from SuSE,
uninstall it before trying to compile wmaker or you
might have problems.
- MetroX (unknown version)
MetroX has a bug that corrupts pixmaps that are set as window
backgrounds. If you use MetroX and has weird problems with
textures, do not use textures in title bars. Or use a different
X server.
INSTALLATION:
=============
Build Window Maker
------------------
For a quick start, type the following in your shell prompt:
./configure
make
then, login as root and type:
make install
ldconfig
or if you want to strip the debugging symbols from the binaries and make them
smaller, you can instead type:
make install-strip
ldconfig
This will build and install Window Maker with default parameters.
If you want to customize some compile-time options, you can do the
following.
1. (optional) Look at the CONFIGURE OPTIONS section above for the
options available. Also run:
./configure --help
to get a complete listing of other options that are available.
2. Run configure with the options you want. For example, if you
want to use the --enable-modelock option, type:
./configure --enable-modelock
3. (optional) Edit src/wconfig.h with your favorite text editor
and browse through it for some options you might want to change.
4. Compile. Just type:
make
5. Login as root (if you can't do that, read the "I don't have the
root password :-(" section) and install Window Maker in your system:
su root
make install
User specific configuration
---------------------------
These instructions do not need to be followed when upgrading Window Maker
from an older version, unless stated differently in the NEWS file.
Every user on your system that wishes to run Window Maker must do the
following:
1. Install Window Maker configuration files in your home directory.
Type:
wmaker.inst
wmaker.inst will install Window Maker configuration files and will
setup X to automatically launch Window Maker at startup.
That's it!
You can type "man wmaker" to get some general help for configuration
and other stuff.
Read the User Guide for a more in-depth explanation of Window Maker.
You might want to take a look at the FAQ too.
Installing the extras package
-----------------------------
Unpack WindowMaker-extra-<version-number>.tar.gz in /usr/local/share
You can get the file at http://windowmaker.org/pub/source/release/. This file
is optional and only have a few icons, and themes. Look for the latest
<version-number> available. Also there is a WindowMaker-extra.readme to
instruct you where that package should go.
I don't have the root password :(
---------------------------------
If you can't get superuser privileges (can't be root) you can install
wmaker in your own home directory. For that, supply the --prefix option
when running configure in step 2 of building Window Maker. You will
also need to supply the --with-gnustepdir option, to specify the path for
WPrefs.app Example:
./configure --prefix=/home/jshmoe --with-gnustepdir=/home/jshmoe/GNUstep/Applications
Then make /home/jshmoe/bin be included in your search PATH, add
/home/jshmoe/lib to your LD_LIBRARY_PATH environment variable and run
bin/wmaker.inst
Of course, /home/jshmoe is supposed to be replaced with your actual home
directory path.
UPGRADING
=========
If you are upgrading from an older version of Window Maker:
1. Configure and build Window Maker as always
2. Install Window Maker (but do not run wmaker.inst)
3. Read the NEWS file and update your configuration files if necessary.
TROUBLESHOOTING
===============
When you have some trouble during configuration (while running configure),
like not being able to use a graphic format library you think you have
installed, look at the config.log file for clues of the problem.
== Error with loading fonts, even if they exist.
Try rebuilding without NLS support.
== Error when configuring
ltconfig: unrecognized option `--no-reexec'
Try `ltconfig --help' for more information.
configure: error: libtool configure failed
remove the --no-reexec option from aclocal.m4 and reconfigure
Also make sure the autoconf and automake versions you have installed are:
autoconf 2.13
automake 1.4
libtool 1.3
Note that it must not be libtool 1.2b, it must be libtool 1.3,
from the GNU sites.
== configure doesn't detect libtiff, or other graphic libraries.
Delete config.cache, then rerun configure adding the following options to
configure (among the other options you use):
--with-libs-from="-L/usr/local/lib"
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
Put the paths where your graphic libs and their corresponding header files are
located. You can put multiple paths in any of these options, as the example
of --with-incs-from shows. Just put a space between them.
== configure doesn't detect libXpm.
* Check if you have a symbolic link from libXpm.so.4.9 to libXpm.so
== Segmentation fault on startup
* Check if the version of libXPM you have is at least 4.7
* Check if you have an updated version of ~/GNUstep/Defaults/WindowMaker
If you're not sure, try renaming ~/GNUstep to ~/GNUtmp and then run wmaker.inst
== "...: your machine is misconfigured. gethostname() returned (none)"
* the hostname of your machine is set to something invalid, that starts
with a parenthesis. Do a man hostname for info about how to set it.
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
* Window Maker could not read your menu definition file
you should check wmaker's output for an error, it may be
visible in the console or in the .xsession-errors file.
== checking lex output file root... configure: error: cannot find output from true; giving up
* Read the REQUIREMENTS section of this file.
LOCALES/INTERNATIONALIZATION
============================
Window Maker has national language support. To enable national language
support, you must compile Window Maker with some additional parameters.
0 - You must have the GNU gettext package installed. It can be
obtained at ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
Steps 1 to 3 can be skipped if you use the Install script.
1 - You have to select the languages you want to support. Set the
LINGUAS to the list of locales you want. English is always
supported. Example:
setenv LINGUAS "pt ja de"
in csh
or
export LINGUAS;LINGUAS="pt ja de"
in sh
The list of supported locales can be found in po/README.
English is the default language.
Read po/README if you wish to translate and maintain locale files
for other languages.
2 - Additionally, if your language uses multi-byte characters, such
as Japanese or Korean, you must set the MultiByteText option to YES
in ~/GNUstep/Defaults/WMGLOBAL
3 - Configure, build and install Window Maker normally.
4 - To select a particular locale at run-time you must set the LANG
environment variable to the locale you want. For example, if you want to set
the Portuguese locale, you must run
setenv LANG pt
in csh or
export LANG; LANG=pt
in Bourne sh and similar
Note: If you have the LC_CTYPE environment variable set, you must
unset it before running wmaker.
For menu definition files, Window Maker searches for them in the
following order (for Brazilian Portuguese, in this case):
menu.pt_BR
menu.pt
menu
+111 -15
View File
@@ -12,31 +12,54 @@ config-paths.h: Makefile
@echo "Generating $@"
@echo '/* this is a generated file - do not edit */' > $@
@echo '' >> $@
@echo '/* gettext domain used for menu translations */' >> $@
@if test -z "$(menutextdomain)"; then \
echo '/* #undef MENU_TEXTDOMAIN "$(menutextdomain)" */' >> $@; \
else \
echo '#define MENU_TEXTDOMAIN "$(menutextdomain)"' >> $@; \
fi
@echo '/* define where the translations are stored */' >> $@
@echo '#define LOCALEDIR "$(localedir)"' >> $@
@echo '' >> $@
@echo '/* define an extra path for pixmaps */' >> $@
@echo '#define PIXMAPDIR "$(pixmapdir)"' >> $@
@echo '' >> $@
@echo '/* where shared data is stored */' >> $@
@echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@
@echo '#define PKGDATADIR "$(datadir)/$(PACKAGE_TARNAME)"' >> $@
@echo '' >> $@
@echo '/* where the configuration is stored */' >> $@
@echo '#define SYSCONFDIR "$(sysconfdir)"' >> $@
@echo '/* where the global defaults are stored */' >> $@
@echo '#define PKGCONFDIR "$(pkgconfdir)"' >> $@
@echo '' >> $@
@echo '/* where the user data root is located */' >> $@
@echo '#define GSUSER_SUBDIR "GNUstep"' >> $@
@echo '' >> $@
@echo '/* where the user defaults are stored */' >> $@
@echo '#define DEFAULTS_SUBDIR "Defaults"' >> $@
@echo '' >> $@
@echo '/* where the user data are stored */' >> $@
@echo '#define USERDATA_SUBDIR "Library"' >> $@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib WPrefs.app doc test
# Improve coverage in 'make distcheck' by checking that translations work
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-silent-rules LINGUAS='*'
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N INSTALL \
INSTALL-WMAKER README.definable-cursor \
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib WPrefs.app doc
DIST_SUBDIRS = $(SUBDIRS) test
EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \
INSTALL-WMAKER README.i18n README.definable-cursor \
The-perfect-Window-Maker-patch.txt \
README COPYING.WTFPL autogen.sh \
email-clients.txt checkpatch.pl
email-clients.txt checkpatch.pl update-changelog.pl \
script/check-cmdline-options-doc.sh \
script/check-translation-sources.sh \
script/check-wmaker-loaddef-callbacks.sh \
script/generate-html-from-man.sh \
script/generate-mapfile-from-header.sh \
script/generate-po-from-template.sh \
script/generate-txt-from-texi.sh \
script/nested-func-to-macro.sh \
script/replace-ac-keywords.sh \
script/replace-generated-content.sh
.PHONY: coverage-reset coverage
if USE_LCOV
coverage-reset:
@@ -48,6 +71,79 @@ coverage:
-mkdir -p coverage @lcov_output_directory@
lcov --compat-libtool --capture --directory . --output-file coverage/coverage.info
genhtml --output-directory @lcov_output_directory@ coverage/coverage.info
.PHONY: coverage-reset coverage
endif
################################################################################
# Section for the I18N processing
################################################################################
# make update-lang PO=<lang>
# ==========================
# Update the PO files against the POT file in all the translation sub-directories
#
# We do not use an automatic recursive target from Automake (AM_EXTRA_RECURSIVE_TARGETS)
# because we want to check only once that the variable PO was defined; the added bonus
# being that we do not process all directories but only the related ones, which is
# faster and a lot less verbose
update-lang:
if HAVE_XGETTEXT
@if echo "$(PO)" | grep -v '^[a-z][a-z]\(_[A-Z][A-Z]\)\?$$' > /dev/null ; then \
echo "Error: invalid value \"$(PO)\" for update-lang, use PO=<lang>" >&2 ; exit 1 ; \
fi ; \
for subdir in $(SUBDIRS_PO); do \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) update-lang || exit $$?); \
done
SUBDIRS_PO = wrlib/po WINGs/po po util/po WPrefs.app/po
else
@echo "Error: the program 'xgettext' was not found by configure, it is mandatory for this operation" >&2 ; exit 1
endif
.PHONY: update-lang
################################################################################
# Section related to generating HTML content for the website
################################################################################
if WITH_WEB_REPO
SUBDIRS_WEB = doc
website:
@for subdir in $(SUBDIRS_WEB); do \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) website || exit $$?); \
done
endif
.PHONY: website
################################################################################
# Section for the automated checks
################################################################################
# Create a 'silent-rule' for our make check the same way automake does
AM_V_CHKOPTS = $(am__v_CHKOPTS_$(V))
am__v_CHKOPTS_ = $(am__v_CHKOPTS_$(AM_DEFAULT_VERBOSITY))
am__v_CHKOPTS_0 = @echo " CHK $@" ;
am__v_CHKOPTS_1 =
check-local: configure-documentation
configure-documentation:
$(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \
--program "$(top_srcdir)/configure" --text-doc "$(top_srcdir)/INSTALL-WMAKER" \
--ignore-prg 'with-PACKAGE,without-PACKAGE # only template names from Autoconf' \
--ignore-prg 'program-prefix,program-suffix,program-transform-name # in INSTALL' \
--ignore-prg 'version,quiet,srcdir,build,host,cache-file,no-create # in INSTALL' \
--ignore-prg 'enable-silent-rules,disable-silent-rules # should be in INSTALL' \
--ignore-prg 'enable-dependency-tracking,disable-dependency-tracking # in INSTALL' \
--ignore-prg 'enable-shared,enable-static # should be in INSTALL' \
--ignore-prg 'disable-option-checking,enable-fast-install # should be in INSTALL' \
--ignore-prg 'disable-libtool-lock,with-pic,with-gnu-ld,with-sysroot # for libtool' \
--ignore-prg 'runstatedir #new in autoconf 2.70, backported in Debian' \
--ignore-prg 'with-aix-soname #new in libtool 2.4.4' \
--ignore-prg 'with-x # no use, it would not work without X'
.PHONY: configure-documentation
+645 -54
View File
@@ -1,7 +1,571 @@
NEWS for veteran Window Maker users
-----------------------------------
-- 0.97.0
Directional window focus
------------------------
The keyboard focus can now be moved in a specific direction (left, right,
up, down) relative to the currently focused window, using window centres
for comparison. The shortcuts can be configured in WPrefs under
"Keyboard Shortcuts", or set directly in ~/GNUstep/Defaults/WindowMaker
via "FocusWindowLeftKey", "FocusWindowRightKey", "FocusWindowUpKey" and
"FocusWindowDownKey" (disabled by default).
The existing "CirculateRaise" option ("Raise window when switching focus
with keyboard" in WPrefs) also controls whether windows that are fully
obscured by others are raised when receiving focus this way.
Vim-like window marking
-----------------------
Windows can now be dynamically assigned a mark label (a key or
modifier+key combination) allowing them to be instantly recalled without
searching. This is inspired by vim's mark-and-jump navigation.
The mark label is displayed in the window list menu between the window
title and the workspace name.
Five actions can be configured in ~/GNUstep/Defaults/WindowMaker
(or in WPrefs under "Keyboard Shortcuts")
"MarkSetKey": assign a label to the focused window (e.g. with the
action bound to "Super+M", pressing "Super+M x" marks the focused
window with label 'x').
"MarkUnsetKey": remove the mark from a labeled window.
"MarkJumpKey": focus and raise the window with the given label.
"MarkBringKey": move the marked window to the current workspace and
focus it.
"MarkSwapKey": swap the focused window with the marked window.
Those are disabled by default.
Marks are persistent across sessions and saved in the WMState file.
Multi-key and sticky-chain keybindings
--------------------------------------
Keyboard shortcuts now support multi-key sequences, similar to
Emacs-style prefix bindings (e.g. pressing a leader key followed by
one or more continuation keys).
An optional sticky-chain mode allows a prefix key to remain active
until a cancel key is pressed or a timeout expires, making it possible
to trigger multiple actions in sequence without re-entering the prefix.
New options in ~/GNUstep/Defaults/WindowMaker:
"KeychainTimeoutDelay" is the timeout in milliseconds after which an
active chain expires. Default is 500. Set to 0 to disable the
timeout.
"KeychainCancelKey" sets a key to explicitly cancel an active chain.
(disabled by default).
Configurable modifier key labels
---------------------------------
A new "ModifierKeyShortLabels" option in ~/GNUstep/Defaults/WindowMaker
allows customizing the labels shown for modifier keys in menus and
keyboard shortcut displays. Unicode symbols can be used in place of the
default text labels. For example to use the same symbol as defined on
MacOS:
ModifierKeyShortLabels = (
"\342\207\247",
"\342\214\203",
"\342\214\245",
"\342\207\255",
"\342\207\263",
"\342\214\230",
"\342\207\252",
"\342\227\206",
"\342\214\245"
);
Configurable mouse wheel focus behavior
----------------------------------------
Scrolling the mouse wheel over a window can now optionally move the
keyboard focus to that window. The option is available in WPrefs under
"Expert User Preferences", or by setting "MouseWheelFocusEnable" in
~/GNUstep/Defaults/WindowMaker (NO by default).
Application icons in the window list
-------------------------------------
Application icons can now be shown in the window list menu. This behavior
can be configured by setting the "WindowListAppIcons" option in
~/GNUstep/Defaults/WindowMaker or "Show app icons in window list." in
WPrefs under "Expert User Preferences" (NO by default).
Configurable screenshot filename template
-----------------------------------------
The filename (strftime compatible) format used when saving screenshots
can now be customized by setting the "ScreenshotFileNameTemplate"
option in ~/GNUstep/Defaults/WindowMaker. The default remains the
format introduced in 0.96.0.
JPEG XL image support
---------------------
WRaster can now optionally load JPEG XL images if the libjxl
library is present at build time. The feature can be toggled at
configure time with --enable-jxl/--disable-jxl.
wmiv: archive files and unknown format handling
-----------------------------------------------
wmiv can now open images stored inside archive files (with libarchive).
A new option to silently skip unknown image formats is also available.
It supports ctrl+c shortcut to copy the current image to the clipboard.
Support for _NET_WM_MOVERESIZE
------------------------------
Window Maker now handles the _NET_WM_MOVERESIZE EWMH message, which
allows applications to initiate interactive window moves and resizes
through a standard protocol request (for those applications without
decorations: VS Code, Google Chrome, Steam and Discord, ...).
Cycle windows across all workspaces
-----------------------------------
A new 'Cycle all windows from all workspaces' expert option allows
the Alt-Tab window switcher to include windows from all workspaces,
not only the current one. Which is the "CycleAllWorkspaces" option
in ~/GNUstep/Defaults/WindowMaker (NO by default).
RandR and multi-monitor improvements
------------------------------------
RandR version >= 1.3 is automatically enabled when detected. By default,
it operates in static mode, requiring the screen layout to be defined
manually. A new "HotplugMonitor" option in ~/GNUstep/Defaults/WindowMaker
(NO by default) enables automatic monitor detection on hotplug events,
adding newly connected monitors to the right of the existing layout.
This option is also available in WPrefs expert panel under
"Automatically (de)activate monitors on hotplug events".
Titlebar language button revamp
-------------------------------
When the modelock feature is enabled, the legacy hardcoded language
dropdown icons in the titlebar are replaced by a compact button
displaying the short name of the current XKB locale (those are
basically the layouts displayed via setxkbmap -query).
Clicking the button cycles through up to four keyboard layouts
(matching the four XKB groups). The xkbfile library is required for
this feature.
-- 0.96.0
Hot Corners feature
-------------------
Screen corners can be assigned an external command to be
executed when the mouse pointer is entering those areas.
In WPrefs, "Hot Corner Shortcut Preferences" can be used
for configuration or by manually adding a "HotCorners" key
and value to "YES" in the ~/GNUstep/Defaults/WindowMaker file.
Hot Corners feature is disabled by default.
Actions are specified by the "HotCornerActions" and are defined
as a four entries list ("top left action", "top right action",
"bottom left action", "bottom right action").
A screen corner area is a cube shape defined by the "HotCornerEdge"
which is a number of pixels from 2 (by default) to 10.
To lower the risk of triggering that feature accidentally a
"HotCornerDelay" key can be used which is the time before the action
is triggered while the pointer is in one of the screen corner.
Default value is 250 ms.
Screenshot capture feature
--------------------------
In WPrefs "Keyboard Shortcut Preferences" tab, three new actions can
be configured: "Capture a portion of the screen", "Capture a window",
"Capture the entire screen". The file is saved in
~/GNUstep/Library/WindowMaker/Screenshots directory under a filename
format "screenshot_%Y-%m-%d_at_%H:%M:%S" followed by the extension.
Which can be png or jpg based on WRaster dependencies.
libXRes is now an optional dependency
-------------------------------------
XRes the resource extension for the X protocol is used to find the
underlying processes (and PIDs) responsible for displaying the windows.
Support for _NET_WM_FULLSCREEN_MONITORS hint
--------------------------------------------
That hint allows applications that support it to be set as fullscreen on multiple heads.
It depends on Xinerama extension support.
Keep dock on primary head
-------------------------
To keep the dock on the primary head in a multi-head setup, set the option
"KeepDockOnPrimaryHead" in ~/GNUstep/Defaults/WindowMaker to "YES" or click
"Keep dock on primary head" under the WPrefs "Expert User Preferences" tab.
-- 0.95.9
Configurable SwitchPanel
------------------------
SwitchPanel is now more configurable: you can configure the switch panel icon
size by setting the "SwitchPanelIconSize" option to your preferred value in
~/GNUstep/Defaults/WindowMaker. The font size used in this panel now is also
sensible to changes in the system font.
New user configuration directory environment variable
-----------------------------------------------------
In previous versions, the GNUstep directory used to store a user's Window Maker
configuration files was specified by the GNUSTEP_USER_ROOT environment variable,
which defaulted to ~/GNUstep. However, this environment variable was deprecated
in gnustep-make v2. Therefore, it has been replaced by the WMAKER_USER_ROOT
environment variable.
libXmu is now an optional dependency
------------------------------------
If the library is not found, compilation work, the only limitation will arise
when trying to install the standard colormap on displays which are not TrueColor.
Please note that if you have the library but not the headers, configure will
still stop; there is no user option to explicitly disable the library use.
-- 0.95.8
Move pointer with maximized windows
-----------------------------------
Implementation for moving mouse pointer within the maximized window.
Mouse pointer can be now moved together with window if keyboard was used for
arrange maximized windows on screen. This feature can be turned on in WPrefs.app
in Expert tab by selecting "Move mouse pointer with half maximized windows.", or
setting "PointerWithHalfMaxWindows" to "Yes" on ~/GNUstep/Defaults/WindowMaker
file.
Alternative way for traverse half-maximized windows
---------------------------------------------------
For now, there could be three possible states of the window while using
the half-maximized feature. Unmaximized windows have their state saved during
that process, which is used to unmaximize them. For example, if there is a
window that is maximized on the left half of the screen, and while requesting
left-half-maximize it becomes unmaximized with its size and dimensions
restored to the original state.
By setting "AlternativeHalfMaximized" option to "Yes"
~/GNUstep/Defaults/WindowMaker config file (or by using WPrefs.app and option
"Alternative transitions between states for half maximized windows."), there
would be slightly different change in window "traverse". Given layout depicted
below:
┌┬────────────────────┬┐
├┘ ┌───────┐ ├┤
│ ├───────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ └───────┘ └┤
├┬┐ │
└┴┴────────────────────┘
Window can be moved using keyboard shortcut right-half-maximize:
┌┬─────────┬──────────┬┐
├┘ ├──────────┼┤
│ │ ├┤
│ │ ├┤
│ │ ├┤
│ │ ├┤
├┬┐ └──────────┘│
└┴┴────────────────────┘
Further invoking right-half-maximize will do nothing. Note, that the window always
can be unmaximized using an appropriate keyboard shortcut or by selecting
"Unmaximize" from the window menu.
Going to opposite direction by invoking left-half-maximize, will make the window
maximized in both, vertical and horizontal directions:
┌─────────────────────┬┐
├─────────────────────┼┤
│ ├┤
│ ├┤
│ ├┤
│ ├┤
├┬┬───────────────────┘│
└┴┴────────────────────┘
Further invoking left-half-maximize, will make the window maximized in half left
side od the screen:
┌──────────┬──────────┬┐
├──────────┤ ├┤
│ │ ├┤
│ │ ├┤
│ │ ├┤
│ │ └┤
├┬┬────────┘ │
└┴┴────────────────────┘
And again, further invoking left-half-maximize, will do nothing in this mode.
This change affects all possible half-maximized window state also quarters.
Issuing bottom-left-corner will take lower left quarter of the screen (nothing
is new so far):
┌┬────────────────────┬┐
├┘ ├┤
│ ├┤
├──────────┐ ├┤
├──────────┤ ├┤
│ │ └┤
├┬┬────────┘ │
└┴┴────────────────────┘
Issuing bottom-right-corner again will change window state to bottom half
maximized:
┌┬────────────────────┬┐
├┘ ├┤
│ ├┤
├─────────────────────┼┤
├─────────────────────┼┤
│ ├┤
├┬┬───────────────────┘│
└┴┴────────────────────┘
Invoking bottom-right-corner again:
┌┬────────────────────┬┐
├┘ ├┤
│ ├┤
│ ┌──────────┼┤
│ ├──────────┼┤
│ │ ├┤
├┬┐ └──────────┘│
└┴┴────────────────────┘
Issuing bottom-right-corner again will have no effect.
Move half-maximized windows between the screens
-----------------------------------------------
New option was introduced to allow change of behaviour of half-maximize windows
in multiple displays environment. In such environment it is more natural that
half maximized windows would travel from one screen to another. Now it is
possible to make that happen by setting an option
"MoveHalfMaximizedWindowsBetweenScreens" to "Yes" in
~/GNUstep/Defaults/WindowMaker config file, or by checking "Allow move
half-maximized windows between multiple screens." in 'Expert User Preferences"
tab in WPrefs.app.
For example, given there are two screens in layout where one display is on the
left and second display is on the right with window on first screen:
┌┬────────────────┬─────────────────┬┐
├┘ ┌───────┐ │ ├┤
│ ├───────┤ │ ├┤
│ │ │ │ ├┤
│ │ │ │ ├┤
│ └───────┘ │ └┤
├┬┐ ├┬┬┐ │
└┴┴───────────────┴┴┴┴───────────────┘
It can be right-half-maximized (using the previously defined key combination), so it
becomes:
┌┬───────┬────────┬─────────────────┬┐
├┘ ├────────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ └┤
├┬┐ └────────┼┬┬┐ │
└┴┴───────────────┴┴┴┴───────────────┘
In this example there is an assumption that WindowMaker is configured, that
maximized windows won't cover mini icons nor the dock.
Without setting new option to true, issuing another right-half-maximize will
restore window dimensions and position to the original state (like on the first
figure). With new option set to true it will move window to second screen like:
┌┬────────────────┬────────┬────────┬┐
├┘ ├────────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ └┤
├┬┐ ├┬┬┬─────┘ │
└┴┴───────────────┴┴┴┴───────────────┘
Another activation of right-half-maximize:
┌┬────────────────┬────────┬────────┬┐
├┘ │ ├────────┼┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
├┬┐ ├┬┬┐ └────────┘│
└┴┴───────────────┴┴┴┴───────────────┘
And final activation of right-half-maximize:
┌┬────────────────┬───────┬─────────┬┐
├┘ ├───────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ ├───────┘ ├┤
│ │ └┤
├┬┐ ├┬┬┐ │
└┴┴───────────────┴┴┴┴───────────────┘
Where the window is restored to its size (but not position, since it is on a different
head now). Moving a window in directions like left-half-maximize,
top-half-maximize and bottom-half-maximize will behave in similar way depending
on the layout of displays.
Note, that only windows that are half-maximized vertically or horizontally can
be moved to another screen due to the fact, that direction of movement of
quarter-maximized windows is ambiguous. As for vertical/horizontal-maximize,
since doesn't move the window but only stretch it vertically/horizontally this
feature also doesn't apply.
Snapping a window to the top
----------------------------
You can now choose whether snapping a window to the top edge of the screen
maximizes it to the top half (the previous and default behavior) or to the
full screen by setting "SnapToTopMaximizesFullscreen" to "NO" or "YES",
respectively. This setting can also be changed by unchecking or checking
"Snapping a window to the top maximizes it to the full screen" in the
"Expert User Preferences" tab in WPrefs.app.
Global defaults directory configuration
---------------------------------------
You can now configure the global defaults directory, where the system
WindowMaker, WMRootMenu, etc. files are stored, by running
./configure --with-defsdatadir=/path/to/defaults
at build time. The previous method, which only partially worked, involved
defining the GLOBAL_DEFAULTS_SUBDIR macro. This is no longer available.
Note that the default location is ${sysconfdir}/WindowMaker.
-- 0.95.7
Window snapping
---------------
You can now "snap" a window, i.e., maximize it to a side or corner of the
screen, by dragging it to that side or corner. It is enabled by setting
"WindowSnapping = YES" in ~/GNUstep/Defaults/WindowMaker or selecting "Maximize
(snap) a window to edge or corner by dragging." under "Expert User Preferences"
in WPrefs.app.
Note that if "Switch workspaces while dragging windows" is selected under
"Workspace Preferences" in WPrefs.app, or if "DontLinkWorkspaces = NO" in
~/GNUstep/Defaults/WindowMaker, then you may only snap a window to the top or
bottom of the screen.
You may set the distance (in pixels) from the edge or corner of the screen at
which a window will begin snapping using "SnapEdgeDetect" and "SnapCornerDetect"
in ~/GNUstep/Defaults/WindowMaker or setting "Distance from edge/corner to begin
window snap." under "Expert User Preferences" in WPrefs.app. (The defaults are
1 pixel and 10 pixels, respectively).
Dragging maximized windows
--------------------------
You can now control the behavior when a maximized window is dragged by setting
the "DragMaximizedWindow" option in ~/GNUstep/Defaults/WindowMaker or by
selecting an option from the "When dragging a maximized window..." pop-up button
under "Window Handling Preferences" in WPrefs.app.
There are four choices:
* "Move" ("...change position (normal behavior)" in WPrefs.app) is the default
and traditional behavior. A maximized window is moved when dragged and
remains maximized, i.e., it keeps its maximized geometry and can later be
unmaximized.
* "RestoreGeometry" ("...restore unmaximized geometry") is the behavior standard
in desktop environments like GNOME, Cinnamon, and Unity. A maximized window
is moved when dragged and is completely unmaximized, i.e., its unmaximized
geometry is restored.
* "Unmaximize" ("...consider the window unmaximized") causes a maximized window
to be moved when dragged and remains partially maximized, i.e., it keeps its
maximized geometry, but is considered to be unmaximized. In particular, it can
be immediately re-maximized.
* "NoMove" ("...do not move the window") prevents a maximized window from being
moved when dragged.
Note that, to accommodate this option in the "Window Handling Preferences" tab in
WPrefs.app, the option to "Open dialogs in the same workspace as their owners"
(which sets the "OpenTransientOnOwnerWorkspace" option from
~/GNUstep/Defaults/WindowMaker) has been moved to "Expert User Preferences".
Mini-Previews instead of Apercus
--------------------------------
Since the original name was not really clear because it is a French word that
is rarely used by British people, it was decided to change it to the more usual
Mini-Preview name. The setting is configurable with WPrefs in the Icon
Preferences tab, the size is now expressed in pixels directly.
Ignore Decoration Hints from GNOME applications
-----------------------------------------------
The GNOME applications ask Window Maker to get no title bar and no resize bar to
their windows by using "Hints". You can re-add them using the Attribute dialog
in the Window menu, but if you are using many GNOME applications you may want to
tell Window Maker to just ignore them. This is done with the new setting called
"IgnoreGtkHints", which is available in the "Expert" panel in WPrefs.
Cooperative Window Manager Replacement
--------------------------------------
The ICCCM defines a protocol for window managers to ask to replace the currently
running one; Window Maker now supports it. You can ask Window Maker to take the
place of current one by running "wmaker --replace", or any other window manager
can ask Window Maker to leave the place for them when started the same way.
Please note that this feature must be explicitely enabled at compile time because
by default it is not compiled in ("configure --enable-wmreplace").
--- 0.95.6
More image format supported
@@ -12,6 +576,33 @@ can now load WebP images. It can also make use of the ImageMagick library
to support a lot more formats, like SVG, BMP, TGA...
Mini-window apercu
------------------
A small preview of window contents can be enabled from WPrefs,
in Miscellaneous Ergonomic Preferences, check miniwindow apercus.
Apercu size can be configured using the ApercuSize variable with
$ wdwrite WindowMaker ApercuSize 4
in multiples of the icon size (in this case the apercu size will be four
times the icon size).
The default size is 2 (twice the icon size).
Support for up to 9-buttons mouse
---------------------------------
The action for the newly supported buttons can be configured from WPrefs.
wmiv, an image viewer application
---------------------------------
wmiv is a quick image viewer using wrlib to be run from the command line.
--- 0.95.5
Support for generated menus in proplist format
@@ -302,7 +893,7 @@ The 4 corner images will be copied in their original sizes and the rest will
be scaled to the final panel size.
background_image, width and height are optional. If you leave them out,
a gray panel will be used. If your machine is not very fast, you may want
a gray panel will be used. If your machine is not very fast, you may want
to use it.
@@ -325,7 +916,7 @@ Antialiased font support
With the addition of Xft2 support in the WINGs library, now
Window Maker can display antialiased text with TrueType or any scalable fonts.
You can pick fonts for Window Maker in the Font configuration section of
You can pick fonts for Window Maker in the Font configuration section of
WPrefs.
Antialiased text is enabled by default, but can be disabled by adding
@@ -359,7 +950,7 @@ These are to be proplist format menus, for example:
or, in case you want a submenu:
(("Submenu",
(("Submenu",
("Foobar", EXEC, foobar),
("Blabla", EXEC, blabla)))
@@ -402,7 +993,7 @@ shading and unshading respectfully.
However, to avoid unwanted triggers of shading/unshading the window, two
consecutive mouse wheel events in the same direction are required. The
trigger won't occur if the events are separated by more than a double-click's
trigger won't occur if the events are separated by more than a double-click's
worth of time, which is technically speaking like making a double-click with
the button that corresponds to the mouse wheel direction.
@@ -507,7 +1098,7 @@ Less dependencies
starting with 0.70.0 libPropList is no longer required to build Window
Maker. PropList handling code was added to WINGs being now better
integrated with all the rest. For more details check the Changelog and the
integrated with all the rest. For more details check the Changelog and the
following files:
./WINGs/ChangeLog
./WINGs/NEWS
@@ -580,9 +1171,9 @@ behavior regarding workspaces you can now (use WPrefs.app to do this).
Client supplied icons
---------------------
Window Maker saves the client supplied icons in
~/GNUstep/Library/WindowMaker/CachedPixmaps in XPM format for later use
when the app is no longer running (to have the image to display for docked
Window Maker saves the client supplied icons in
~/GNUstep/Library/WindowMaker/CachedPixmaps in XPM format for later use
when the app is no longer running (to have the image to display for docked
icons for example).
Until recently the XPM images saved by Window Maker were incorrect, but a
@@ -590,9 +1181,9 @@ recent fix in the code to save XPM's fixed them. But with this fix, all
previously saved XPM's in that directory are no longer readable (they give
wrong images on screen or fail to load).
To avoid the need for the user to fix this by hand editing WMWindowAttributes
and removing all references to icons in ~/GNUstep/Library/WindowMaker/CachedPixmaps
which can be annoying, new code was added to Window Maker to permit the
To avoid the need for the user to fix this by hand editing WMWindowAttributes
and removing all references to icons in ~/GNUstep/Library/WindowMaker/CachedPixmaps
which can be annoying, new code was added to Window Maker to permit the
regeneration of images in ~/GNUstep/Library/WindowMaker/CachedPixmaps if they are missing.
With this addition, all you need to do to fix your old broken images, is to
@@ -694,7 +1285,7 @@ performance increases can go up to 150%
Weendoze Window Cycling (alt-tab)
---------------------------------
Window cycling was changed to weendoze style.
Window cycling was changed to weendoze style.
NoBorder Window Attribute
@@ -739,7 +1330,7 @@ Others
- added DONT_SCALE_ICONS compile time option
- added --dont-restore cmd line option. When passed to wmaker, it
wont restore the state saved previously.
won't restore the state saved previously.
--- 0.61.1
@@ -790,7 +1381,7 @@ arguments. To code new plugin, please see plugin.h for more information.
User Menu
---------
The user menu is now a compile time option disabled by default.
The user menu is now a compile time option disabled by default.
Supply --enable-usermenu to configure to enable it.
@@ -924,7 +1515,7 @@ New Options
MenuStyle=<style>; will change the menu texture style.
<style> can be:
normal (default): for the traditional one texture per item, with bevels in
normal (default): for the traditional one texture per item, with bevels in
each
singleTexture: for a single texture that spans the whole menu, with bevels
@@ -941,7 +1532,7 @@ where <texture> is any of the textures you normally use in titlebars and
other places.
If the style file/theme does not contain a ResizebarBack option, setstyle
will automatically hack it so that wmaker will make the theme work like
will automatically hack it so that wmaker will make the theme work like
before.
@@ -1042,7 +1633,7 @@ Full Screen Maximization
The FullMaximize window attribute will allow the window to
be maximized to the full size of the screen (ignoring anything
like titlebar, resizebar, dock, panels etc). It should be useful
for programs that must use the whole screen, like games or things
for programs that must use the whole screen, like games or things
like presentation programs.
@@ -1051,7 +1642,7 @@ like presentation programs.
KDE Application Menu script
---------------------------
wkdemenu.pl is a converter from KDE application menu structures to wmaker
wkdemenu.pl is a converter from KDE application menu structures to wmaker
menu that can be used as a piped menu. Look wkdemenu.sh for how to use it.
@@ -1081,14 +1672,14 @@ Window Maker has become a GNU program (part of the GNU Project).
Title text drop shadow
----------------------
drop shadow option added for titlebar text. This is a compile time
drop shadow option added for titlebar text. This is a compile time
option which needs to be defined in src/wconfig.h after you run
configure and before you run make.
New options and syntax for your WindowMaker domain file are:
Shadow = yes/no;
FShadowColor = <color>;
FShadowColor = <color>;
PShadowColor = <color>;
UShadowColor = <color>;
MShadowColor = <color>;
@@ -1152,7 +1743,7 @@ it will scale the pixmap by keeping the aspect ratio (maximize or maxpect).
The option only works for workspace backgrounds.
Also added IGNORE_PPOSITION compile time flag, which is equivalent
to NoPPosition from fvwm.
to NoPPosition from fvwm.
@@ -1163,7 +1754,7 @@ to NoPPosition from fvwm.
KDE and GNOME
-------------
Added full support for GNOME and KWM hints.
Added full support for GNOME and KWM hints.
Read the INSTALL file to see how enable them.
Everything in the so called GNOME window manager bla bla bla pseudo-spec is
@@ -1172,13 +1763,13 @@ implemented.
As for KDE stuff, it implements 90% of everything kwm does, adds some
Window Maker specific extensions to it and still uses half of the memory
kwm does, which should be enough to let you dump kwm ;) For details on what
exactly is implemented, see comments in src/kwm.c Read the README.KDE file
exactly is implemented, see comments in src/kwm.c Read the README.KDE file
for more information.
WARNING: Some KDE hints are badly designed, so doing things like using
kpanel's desktop switcher/pager and Window Maker's internal workspace
management functions to create, destroy and rename workspaces at the same
management functions to create, destroy and rename workspaces at the same
time might cause unknown effects. To be on the safe side, only
use either of them to manage workspaces. Switching workspaces is hopefully,
safe, so you can switch workspaces from wherever you want.
@@ -1193,7 +1784,7 @@ workspaces. The WorkspaceBack is used as the default background image.
Example:
WorkspaceSpecificBack = ((solid, red), (cpixmap, ship.jpg, gray), (),
WorkspaceSpecificBack = ((solid, red), (cpixmap, ship.jpg, gray), (),
(dgradient, red, blue))
This will set the background image of workspace 1 to (solid, 0),
@@ -1222,8 +1813,8 @@ WindowMaker/README.themes file.
New Texture Type
----------------
Textured gradients will tile a texture pixmap and combine it with a gradient,
using an arbitrary opaqueness.
Textured gradients will tile a texture pixmap and combine it with a gradient,
using an arbitrary opaqueness.
Syntax is (thgradient, <file>, <opaqueness>, <color1>, <color2>)
(tvgradient, <file>, <opaqueness>, <color1>, <color2>)
@@ -1279,10 +1870,10 @@ Clip icons when the mouse pointer enter/leave the Clip. To avoid unwanted
raising/lowering there is a time threshold before raising/lowering.
The thresholds can be changed in wconfig.h by changing one or both of
AUTO_LOWER_DELAY and AUTO_RAISE_DELAY (expressed in milliseconds).
For example if you set AUTO_RAISE_DELAY to 0, then the Clip will be raised as
soon as the mouse pointer enters it's area. Setting AUTO_RAISE_DELAY to a very
big value, will make the Clip to practically do not auto raise unless clicked,
but to be automatically lowered after AUTO_LOWER_DELAY (ms) when leaved.
For example, if you set AUTO_RAISE_DELAY to 0, then the Clip will be raised as
soon as the mouse pointer enters its area. Setting AUTO_RAISE_DELAY to a very
big value will make the Clip practically not auto-raise unless clicked,
but it will still be automatically lowered after AUTO_LOWER_DELAY (ms) when left.
New ThemePack Format
@@ -1294,7 +1885,7 @@ the old format is still supported. The new format is documented
in the WindowMaker/README.themes file.
Root Menu
Root Menu
---------
The -noext option for OPEN_MENU will strip whatever is after the last .
@@ -1322,7 +1913,7 @@ WDesktopLevel
If you have a 5 button mouse and want to give some utility for
the extra 2 buttons, edit the appropriate line in src/wconfig.h
Clicking Button4 in the root window will switch you to the previous
Clicking Button4 in the root window will switch you to the previous
workspace and Button5 will do that for the next.
@@ -1348,7 +1939,7 @@ Hysteresis for menu item selection
Hopefully it's intelligent enough, so you won't notice it.
In case you want to know what's it, it's equivalent to that
(insanely long) 2 second delay present in that Windoze95 menu,
(insanely long) 2 second delay present in that Windoze95 menu,
but more useful than annoying (I hope :). To see it, do the following
with your current wmaker version and later with 0.20.3:
@@ -1437,7 +2028,7 @@ make
make install
You also don't need to worry about GNOME libPropList incompatibilities
anymore.
anymore.
Bug with focus lost in sloppy focus fixed
@@ -1476,11 +2067,11 @@ optimize it and remove a few hundred of bytes, then use --disable-sound or
--- 0.20.0
Multihead support. wmaker will now manage all screens that are attached to the
display.
display.
------------------------------------------------------------------------------
It does so from a single process (instead of spawning a new process for each
screen, like fvwm does). This keeps memory usage a lot lower than fvwm.
@@ -1578,7 +2169,7 @@ c3 can be v or h (meaning vertical or horizontal)
case is insensitive.
For example,
For example,
IconPosition = blh;
is the old iconPosition position.
@@ -1635,7 +2226,7 @@ submenus was removed, so a menu that looked like:
( Applications,
("Xterm", EXEC, "xterm"),
(
(
(Paint,
("Gimp", EXEC, "gimp"),
("XV", EXEC, "xv")
@@ -1659,7 +2250,7 @@ Misc
----
NUMLOCK_HACK is back. This time it works and is enabled by default.
If you think you don't need it and promise me that you won't send
If you think you don't need it and promise me that you won't send
"bug" reports saying that shortcuts stop working after a while, you can
disable it ;) It will save some memory and CPU.
@@ -1703,7 +2294,7 @@ New Options
-----------
PixmapPath was split to PixmapPath and IconPath. PixmapPath is the path
for the pixmaps used as textures and IconPath is for the icons.
for the pixmaps used as textures and IconPath is for the icons.
Don't forget to add IconPath to your current configuration file.
There's also a new library in ~/GNUstep/Library/Icons. You should place
@@ -1749,7 +2340,7 @@ Misc. Changes
Removed --with-gnome and made MWM_HINTS defined by default.
This means that "GNOME support" will work with no additional
flags passed to configure.
flags passed to configure.
Added support for KDE, by adding a DisableWorkspaceMouseActions option.
Set it to YES and run krootwm to be able to use everything in kfm.
@@ -1776,7 +2367,7 @@ Interface Changes
-----------------
** Configuration of docked applications is now done in a panel instead of
in the menu.
in the menu.
** Added a command menu for application icons
@@ -1954,7 +2545,7 @@ Now, selecting icons is as easy as clicking in the file name in a list.
Simplified Options
------------------
IconSlideStep, IconSlideSlowDown and IconSlideDelay were merged to
IconSlideStep, IconSlideSlowDown and IconSlideDelay were merged to
IconSlideSpeed
MenuScrollStep and MenuScrollDelay were merged to MenuScrollSpeed
@@ -2049,7 +2640,7 @@ applets of that kind, because the icon window do not belongs to WindowMaker,
but to the application itself. For such icons you must keep the mouse over the
icon groundplate, else it will collapse back. But usually these type of icons
will not stay in a collapsed clip, since one needs to see what they show.
When the clip is leaved it will collapse back after a delay of 1 second, unless
When the clip is left it will collapse back after a delay of 1 second, unless
the mouse is moved back to the clip area. The delay can be set modifying
AUTO_COLLAPSE_DELAY in wconfig.h. Default is 1000 (ms) which means 1 second.
@@ -2209,7 +2800,7 @@ The OPEN_MENU command now supports the following syntax:
// it in current position
OPEN_MENU file.menu
2. Pipe menu handling.
// opens command and uses it's stdout to construct menu.
// opens command and uses its stdout to construct menu.
// Command's output must be a valid menu description.
OPEN_MENU | command
3. Directory handling.
@@ -2386,8 +2977,8 @@ When the step to move becomes smaller than IconSlideStep, IconSlideStep will
be used further until the destination is reached.
This way a nice deceleration effect is achieved, since while the icon
approaches destination, it will use smaller steps, gibing the illusion that
the icons is moving slower.
approaches the destination, it will use smaller steps, giving the illusion that
the icons are moving slower.
IconSlideDelay will give the pause between steps, and is expressed in ms.
@@ -2752,7 +3343,7 @@ thus, making a menu with entries like:
(mhgradient, colorX, color1, color2, color3, ..., colorn)
(mvgradient, colorX, color1, color2, color3, ..., colorn)
You can put any number of colors >= 2.
You can put any number of colors >= 2.
colorX is a special color that is used as the solid color of the
texture when wmaker needs a solid color (like in miniwindow title and
@@ -2812,7 +3403,7 @@ when they are first mapped
titlebar gradients are in a single piece now
the WMDock file was merged into the WMState file. You can insert this
file in WMState and set it's key to Dock. For example, if your WMDock
file in WMState and set its key to Dock. For example, if your WMDock
contains:
{
@@ -2843,13 +3434,13 @@ then you can merge both and have:
The configuration format has changed!! Forget everything about the old
format.
dockapp was removed and the old version will not work anymore.
dockapp was removed and the old version will not work anymore.
the dialogs require tcl/tk. they will be rewritten in plain C
These are some tips for people upgrading from older versions and don't want
too many unused files around. There is no problem if you decide to keep
too many unused files around. There is no problem if you decide to keep
them for a while.
you can rm -r ~/gnustep if you don't want anything from there
+24 -23
View File
@@ -8,7 +8,7 @@
by
Alfredo K. Kojima
Alfredo K. Kojima
Dan Pascu
@@ -21,19 +21,19 @@
Congratulations! You have purchased an extremely fine
device that would give you thousands of years of trouble-free
device that would give you thousands of years of trouble-free
service, except that you undoubtedly will destroy it via some
typical bonehead consumer maneuver. Which is why we ask you
to PLEASE FOR GOD'S SAKE READ THIS OWNER'S MANUAL CAREFULLY
BEFORE YOU UNPACK THE DEVICE. YOU ALREADY UNPACKED IT, DIDN'T
YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED IT ON AND
YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED IT ON AND
FIDDLED WITH THE KNOBS, AND NOW YOUR CHILD, THE SAME CHILD WHO
ONCE SHOVED A POLISH SAUSAGE INTO YOUR VIDEOCASSETTE RECORDER
AND SET IT ON "FAST FORWARD", THIS CHILD ALSO IS FIDDLING
WITH THE KNOBS, RIGHT? AND YOU'RE JUST NOW STARTING TO READ
THE INSTRUCTIONS, RIGHT??? WE MIGHT AS WELL JUST BREAK THESE
DEVICES RIGHT AT THE FACTORY BEFORE WE SHIP THEM OUT, YOU
KNOW THAT?
WITH THE KNOBS, RIGHT? AND YOU'RE JUST NOW STARTING TO READ
THE INSTRUCTIONS, RIGHT??? WE MIGHT AS WELL JUST BREAK THESE
DEVICES RIGHT AT THE FACTORY BEFORE WE SHIP THEM OUT, YOU
KNOW THAT?
-- Dave Barry, "Read This First!"
@@ -67,7 +67,7 @@ Documentation
Read before asking.
* README files all over the source tree have info related to the stuff
in the directories.
in the directories.
* INSTALL has installation instructions and some troubleshooting tips.
You're meant to read it if you are compiling the sources.
@@ -112,7 +112,7 @@ Directories & Files in the Source Tree
* util/ has various utility programs.
* WPrefs.app/ is the configuration program.
* WPrefs.app/ is the configuration program.
* src/wconfig.h has compile time options you can change to select some
options/features and other stuff.
@@ -129,8 +129,8 @@ HELP ME!!!
==========
There is a mailing list for discussing Window Maker at
wmaker-user@lists.windowmaker.org To subscribe to it, send a message to
wmaker-user-subscribe@lists.windowmaker.org
wmaker-user@googlegroups.com. To subscribe to it, visit
https://groups.google.com/forum/#!forum/wmaker-user
If you got a problem, ask there (after reading the docs, of course). The people
there is more likely to be able to answer your questions than we are. For bug
@@ -178,7 +178,7 @@ Running multiple instances of Window Maker
It is not a good idea to run more than one instance of Window Maker
from the same user (so that wmaker will use the same configuration files) at the
same time. You might get unexpected behavior when Window Maker updates it's
same time. You might get unexpected behavior when Window Maker updates its
configuration files.
If you really desire to do this, try running Window Maker with the command line
@@ -190,7 +190,7 @@ Performance Tuning
==================
If you want to diminish Window Maker's memory usage and improve performance,
while keeping a nice appearance and good functionality, follow the items bellow:
while keeping a nice appearance and good functionality, follow the items below:
- use solid textures for everything, mainly title bars and menus. If you want a
nice looking desktop, use the Traditional style.
@@ -201,14 +201,15 @@ while keeping a nice appearance and good functionality, follow the items bellow:
- edit wconfig.h and disable the NUMLOCK_HACK and the features you don't use
anyway (keep in mind that some of the #defines might not work, as they are not
fully supported). Make sure to always keep NumLock and ScrollLock turned off.
- turn on DisableAnimations. You can also #undefine ANIMATIONS in wconfig.h
- strip down the default IconPath and PixmapPath entries to contain only
the paths that you really have in your system.
- turn on DisableAnimations. You can also specify --disable-animation at compile
time to the configure script.
- strip down the default IconPath and PixmapPath entries to contain only
the paths that you really have in your system.
- do not use large images in the root background
- remove support for image formats you don't use
- to reduce memory usage, disable the icon cache, by setting the RIMAGE_CACHE
environment variable to 0. If you want to increase performance at the cost of
memory usage, set it's value to a value like the number of different icons you
memory usage, set its value to a value like the number of different icons you
use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
@@ -224,7 +225,7 @@ To enable it, hit the Control+Shift+NumLock or Shift+NumLock key combination.
You should hear the speaker beeping. To disable it, do the same thing.
To control the mouse the numeric keypad is used as follows:
- 4 (left arrow), 7 (Home), 8 (up arrow), 9 (PgUp), 6 (right arrow),
- 4 (left arrow), 7 (Home), 8 (up arrow), 9 (PgUp), 6 (right arrow),
3 (PgDn), 2 (down arrow) and 1 (End) move the mouse to the corresponding
direction;
- holding one of the above keys and then holding the 5 key will move the
@@ -239,7 +240,7 @@ pointer faster;
clicked with the 0 (Ins) key.
The above key values work in a XFree86 3.2 (X11R6.1) X server but your
The above key values work on an XFree86 3.2 (X11R6.1) X server, but your
mileage may vary.
@@ -251,7 +252,7 @@ that crashes Window Maker, please send a backtrace with your bug report.
To make a useful backtrace, you need a core file with debugging information
produced by Window Maker when it crashes. It should have been installed without
stripping too.
being stripped.
To compile wmaker with debugging information:
@@ -286,7 +287,7 @@ The icons listed in COPYING.WTFPL and are distributed in this program and were
made by Banlu Kemiyatorn (]d), are licensed through the "do What The Fuck you
want to Public License". Read the COPYING.WTFPL file for the complete license.
NeXT, OpenStep and NEXTSTEP are a trademarks of NeXT Computer, Inc. All other
NeXT, OpenStep and NEXTSTEP are trademarks of NeXT Computer, Inc. All other
trademarks are property of their respective owners.
The authors reserve the right to make changes in the software without prior
@@ -306,9 +307,9 @@ screenshots.
The AUTHORS file contains a list of the people who have contributed to the
project. The name of people who have helped with localization (translation) can
project. The names of people who have helped with localization (translation) can
be found in po/README and Window Maker/README
If you have any comments, fixes and bug reports (filled BUGFORMs) send them
to wmaker-dev@lists.windowmaker.org
to wmaker-dev@googlegroups.com
+1 -1
View File
@@ -23,7 +23,7 @@ They have the following meanings:
none The cursor is inherited from the parent window (often,
this means the root window).
builtin Use the cursor named <cursor-name> from X11's set of
built-in cursors. The names are the same as you use
with 'xsetroot -cursor_name'. See the xsetroot(1) man
+1 -1
View File
@@ -46,7 +46,7 @@ Maybe some day:
Never: (so, dont even bother to ask)
======
- different themes for each workspace. Unless you give us a SGI/Power Onyx
with 2 CPUs ;).
with 2 CPUs ;).
- anything that requires the mouse pointer to be jumped by WindowMaker to
somewhere. This is *terrible* behaviour. And it's not just IMO.
- rewrite to use Gtk... I wont even bother to explain why...
+8 -3
View File
@@ -32,6 +32,11 @@ This does not only enable debugging information, which you may need when
testing your work, it also enables a number of extra compiler warning
which help keeping safer code.
You will probably want also to run this in the end, because it does some
checks on the source tree:
make check
__________________________
Producing a patch with git
--------------------------
@@ -129,7 +134,7 @@ Sending the patch to the mailing list
Send your patches to:
wmaker-dev@lists.windowmaker.org
wmaker-dev@googlegroups.com
Please do not send patches to any individual developer unless you have a very
good reason to avoid more people being able to comment (and improve) on your
@@ -142,7 +147,7 @@ you, otherwise you may face the problems below. Doing this is really easy:
# (of course, replace smtp.example.com with your ISP's)
git config --global sendemail.smtpserver "smtp.example.com"
git config --global sendemail.validate true
git config sendemail.to "Window Maker Devel <wmaker-dev@lists.windowmaker.org>"
git config sendemail.to "Window Maker Devel <wmaker-dev@googlegroups.com>"
# If you're sending more than 1 patch, you may be interested in having an
# introduction mail for the batch:
@@ -200,7 +205,7 @@ Example .gitconfig
ui = auto
[apply]
whitespace = fix
+22 -16
View File
@@ -1,3 +1,9 @@
Changes since wmaker 0.96.0:
............................
- added W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls
Changes since wmaker 0.92.0:
............................
@@ -63,7 +69,7 @@ Changes since wmaker 0.80.1:
- Fixed small memory leak in the font panel code.
- Fixed call to qsort in WMSortArray.
- Fixed a memleak in the file panel.
- Double/triple-click selection in text widgets
- Double/triple-click selection in text widgets
(Vitaly Ovtchinnikov <ov@rbcmail.ru>)
- Fixed bug in tableview (clicked row callback got incorrect row)
(Carlos Torres <vlaadbrain@operamail.com>)
@@ -102,7 +108,7 @@ Changes since wmaker 0.70.0:
............................
- added an internal strcasecmp() (only on systems where is not present)
- removed some redundant includes of ../src/config.h when wconfig.h is
- removed some redundant includes of ../src/config.h when wconfig.h is
included too
- removed a wsyserror() message when reading a property list from file
(the programmer should decide if to give that message or just ignore).
@@ -117,7 +123,7 @@ Changes since wmaker 0.65.0:
related error when text was selected in a textfiled.
- moved wstrdup(), wstrconcat() and wstrappend() from memory.c to string.c
- added property list handling code making libPropList unnecessary and
obsolete. Backward compatibility is provided through the
obsolete. Backward compatibility is provided through the
WINGs/proplist-compat.h header file which has #defines from old libPropList
function names to new function names with minimal changes. Read this
header file and the NEWS file for more details about this subject.
@@ -134,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
@@ -197,7 +203,7 @@ changes since wmaker 0.63.1:
changes since wmaker 0.62.1:
............................
- added WRuler widget
- added WText widget (rtf multiline text widget)
- added WText widget (rtf multiline text widget)
Nwanua Elumeze <nwanua@colorado.edu>
- added a new AUTO option for the UseMultiByte option
- added WMRaiseWidget()/WMLowerWidget()
@@ -217,7 +223,7 @@ changes since wmaker 0.62.1:
- added WMGetListSelectedItems()
- added WMSetListAllowMultipleSelection(), WMListAllowsMultipleSelection().
- added WMSetListAllowEmptySelection(), WMListAllowsEmptySelection().
- WMListSelectionDidChangeNotification passes NULL as the notification
- WMListSelectionDidChangeNotification passes NULL as the notification
client data (previously passed the selected item row).
- added WMUnselectListItem(), WMSelectAllListItems(), WMUnselectAllListItems()
- better behavior of wheel mices in WMList. Simple mouse wheel events
@@ -243,8 +249,8 @@ changes since wmaker 0.62.1:
str1 with str2 and returns that in a newly malloc'ed string.
Be sure to rename wstrappend with wstrconcat in your code too, else
hazardous things can happen!
- implemented a new wstrappend() function. wstrappend(dst, src) will append
src to dst modifing dst and returning a pointer to it. No new string is
- implemented a new wstrappend() function. wstrappend(dst, src) will append
src to dst modifing dst and returning a pointer to it. No new string is
generated, except if dst is NULL, in which case its the same as calling
wstrdup(src).
dst can ONLY be NULL or a dynamically allocated string (obtained from a
@@ -334,7 +340,7 @@ changes since wmaker 0.61.1:
item that is beyond the total number of items present in the popup button.
- changed names of functions for SplitView to be consistent. Some contained
SubView while other Subview. Now all have Subview.
- fixed a bug in how input events were posted. Establishing 2 or more input
- fixed a bug in how input events were posted. Establishing 2 or more input
handlers for the same file descriptor, handling different (read/write/except)
events, caused wrong handlers to be called.
- Reimplemented the input and idle handlers with WMBag to avoid a functional
@@ -346,7 +352,7 @@ changes since wmaker 0.61.1:
2. if new_size is 0, call wfree(old), and return NULL.
3. if both old is a valid pointer and new_size>0, call realloc.
- added wstrerror(int errnum) to return the string associated with errnum.
- new wsyserrorwithcode(int error, const char* fmt, ...), similar to
- new wsyserrorwithcode(int error, const char* fmt, ...), similar to
wsyserror(), but printing the message for the specified error code.
- added 3 new classes: WMData, WMHost and WMConnection
- fixed a big memory leak in the color panel code (from Pascal Hofstee).
@@ -357,7 +363,7 @@ changes since wmaker 0.61.0:
- added WMGetTextFieldFont()
- escape key in panels (craig nellist <crn@ozemail.com.au>)
- applied patch with fixes and enhancements to textfield
- applied patch with fixes and enhancements to textfield
(Franck Wolff <wolff@cybercable.fr>)
- changed WMList to use WMBag internally, instead of a linked list
- replaced WMAddSortedListItem() with WMSortListItems()
@@ -437,10 +443,10 @@ changes since wmaker 0.53.0:
The notifications will still work, but using the delegate is preferable
How to convert old code to delegate callbacks:
1 - create a variable (static or dynamic) of the type of the
1 - create a variable (static or dynamic) of the type of the
delegate for the widget type.
2 - Replace the notification observers with the equivalent
delegate callbacks.
2 - Replace the notification observers with the equivalent
delegate callbacks.
3 - Put pointers to the callbacks in the delegate variable.
Take a look in wfilepanel.c to see how it is used there.
@@ -480,7 +486,7 @@ changes since wmaker 0.51.2:
- added WMColorWellDidChangeNotification
- added wfindfileinarray()
- fixed bug in window title setting
- fixed bug in window title setting
(MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp>)
changes since wmaker 0.51.1:
@@ -611,7 +617,7 @@ I don't remember everything, but here it goes:
The same panel will be reused every time you call for it, unless you free it.
- changed semantics of WMCreateFont() so that it returns NULL if the requested
font can't be loaded
- removed WMAddDestroyCallback()
- removed WMAddDestroyCallback()
- fixed bug in WMRemovePopUpButtonItem()
- added function for user specified item height in WMList
- added WMSetPopUpButtonText(). It will set the default text in the button
+1 -1
View File
@@ -8,7 +8,7 @@ noinst_PROGRAMS = fontl puzzle colorpick
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@
@XFT_LIBS@ @INTLIBS@ @XLIBS@
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
+1
View File
@@ -7,6 +7,7 @@ void showSelectedColor(void *self, void *cdata)
{
WMColorPanel *panel = (WMColorPanel *) self;
(void) cdata;
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
}
+7 -3
View File
@@ -23,8 +23,10 @@
#include <stdint.h>
#include <WINGs/WINGs.h>
#include <WINGs/WUtil.h>
#include <inttypes.h>
#include <stdnoreturn.h>
void wAbort()
noreturn void wAbort(void)
{
exit(0);
}
@@ -35,12 +37,14 @@ void show(WMWidget * self, void *data)
void *d;
WMLabel *l = (WMLabel *) data;
d = WMGetHangedData(self);
sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
sprintf(buf, "%"PRIiPTR" - 0x%"PRIxPTR" - 0%"PRIoPTR, (intptr_t) d, (intptr_t) d, (intptr_t) d);
WMSetLabelText(l, buf);
}
void quit(WMWidget * self, void *data)
noreturn void quit(WMWidget * self, void *data)
{
(void) self;
(void) data;
exit(0);
}
+3
View File
@@ -155,6 +155,9 @@ static void resizeObserver(void *self, WMNotification * notif)
WMSize size = WMGetViewSize(WMWidgetView(win));
int x, y;
(void) self;
(void) notif;
WinSize = size.width;
for (y = 0; y < Size; y++) {
for (x = 0; x < Size; x++) {
+6 -6
View File
@@ -5,26 +5,26 @@ AUTOMAKE_OPTIONS =
# is this a kluge? if so, how should i do it?
includedir = @includedir@/WINGs
include_HEADERS = wtableview.h wtabledelegates.h
include_HEADERS = wtableview.h wtabledelegates.h
lib_LTLIBRARIES = libExtraWINGs.la
noinst_PROGRAMS = test
noinst_PROGRAMS = tableview
EXTRA_DIST =
EXTRA_DIST =
libExtraWINGs_la_SOURCES = \
wtableview.c \
wtabledelegates.c \
wtableview.h \
wtabledelegates.h
wtabledelegates.h
AM_CPPFLAGS = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@
@XFT_LIBS@ @INTLIBS@ @XLIBS@
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
tableview_LDADD = wtableview.o wtabledelegates.o $(LDADD)
@@ -19,13 +19,18 @@ static char *options[] = {
int numberOfRows(WMTableViewDelegate * self, WMTableView * table)
{
(void) self;
(void) table;
return 20;
}
void *valueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row)
{
(void) self;
/*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column); */
int i;
if (col1[0] == 0) {
for (i = 0; i < 20; i++) {
char buf[128];
@@ -44,6 +49,8 @@ void *valueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row)
void setValueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row, void *data)
{
(void) self;
if ((uintptr_t)WMGetTableColumnId(column) == 1)
col1[row] = data;
else
@@ -59,6 +66,7 @@ static WMTableViewDelegate delegate = {
void clickedTable(WMWidget * w, void *self)
{
(void) w;
int row = WMGetTableViewClickedRow((WMTableView *) self);
WMEditTableViewRow(self, row);
+4 -4
View File
@@ -11,15 +11,15 @@ WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *table);
WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent);
WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *table);
WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *table);
void WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate,
char **options, int count);
WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView *parent);
#ifdef __cplusplus
}
#endif
#endif
+14 -8
View File
@@ -2,6 +2,8 @@
#include <WINGs/WINGsP.h>
#include <X11/cursorfont.h>
#include <stdint.h>
#include <math.h>
#include <float.h>
#include "wtableview.h"
@@ -274,7 +276,7 @@ static void adjustScrollers(WMTableView * table)
prop = 1.0;
} else {
oprop = WMGetScrollerKnobProportion(table->hscroll);
if (oprop == 0.0)
if (fabs(oprop) <= DBL_EPSILON)
oprop = 1.0;
ovalue = WMGetScrollerValue(table->hscroll);
@@ -290,7 +292,7 @@ static void adjustScrollers(WMTableView * table)
prop = 1.0;
} else {
oprop = WMGetScrollerKnobProportion(table->vscroll);
if (oprop == 0.0)
if (fabs(oprop) <= DBL_EPSILON)
oprop = 1.0;
ovalue = WMGetScrollerValue(table->vscroll);
@@ -332,7 +334,7 @@ static void doScroll(WMWidget * self, void *data)
case WSIncrementWheel:
case WSIncrementLine:
value += (float)table->rowHeight / size;
if (value > 1.0)
if (value > (float)1.0)
value = 1.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -344,7 +346,7 @@ static void doScroll(WMWidget * self, void *data)
case WSDecrementPage:
value -= vpsize / size;
if (value < 0.0)
if (value < (float)0.0)
value = 0.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -352,7 +354,7 @@ static void doScroll(WMWidget * self, void *data)
case WSIncrementPage:
value += vpsize / size;
if (value > 1.0)
if (value > (float)1.0)
value = 1.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -398,6 +400,7 @@ static void doScroll(WMWidget * self, void *data)
static void splitterHandler(XEvent * event, void *data)
{
(void) event;
WMTableColumn *column = (WMTableColumn *) data;
WMTableView *table = column->table;
int done = 0;
@@ -451,6 +454,8 @@ static void splitterHandler(XEvent * event, void *data)
static void realizeTable(void *data, WMNotification * notif)
{
(void) notif;
repaintTable(data);
}
@@ -790,7 +795,6 @@ void WMSetTableViewRowHeight(WMTableView * table, int height)
void WMScrollTableViewRowToVisible(WMTableView * table, int row)
{
WMScroller *scroller;
WMRange range;
WMRect rect;
int newY, tmp;
@@ -798,7 +802,6 @@ void WMScrollTableViewRowToVisible(WMTableView * table, int row)
rect = getVisibleRect(table);
range = rowsInRect(table, rect);
scroller = table->vscroll;
if (row < range.position) {
newY = row * table->rowHeight - rect.size.height / 2;
@@ -1157,6 +1160,8 @@ static void handleEvents(XEvent * event, void *data)
static void handleResize(W_ViewDelegate * self, WMView * view)
{
(void) self;
reorganizeInterior(view->self);
}
@@ -1167,7 +1172,8 @@ static void reorganizeInterior(WMTableView * table)
WMSize size = getTotalSize(table);
WMView *view = table->view;
int vw, vh;
int hsThickness, vsThickness;
int hsThickness = 0;
int vsThickness = 0;
if (table->vscroll)
vsThickness = WMWidgetWidth(table->vscroll);
+12 -30
View File
@@ -3,23 +3,22 @@
AUTOMAKE_OPTIONS =
SUBDIRS = WINGs . po Documentation Resources
DIST_SUBDIRS = $(SUBDIRS) Tests Examples Extras
libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@
libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
bin_SCRIPTS = get-wings-flags get-wutil-flags
lib_LTLIBRARIES = libWUtil.la libWINGs.la
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGO_LIBS@
libWUtil_la_LIBADD = @LIBBSD@
EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags.in
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
# wbutton.c
# wbutton.c
libWINGs_la_SOURCES = \
configuration.c \
dragcommon.c \
@@ -88,16 +87,17 @@ libWUtil_la_SOURCES = \
wutil.c
AM_CFLAGS =
AM_CFLAGS = @PANGO_CFLAGS@
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
-I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
@XFTFLAGS@ @HEADER_SEARCH_PATH@
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
-I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \
-I$(top_builddir)/wrlib -I$(top_srcdir)/src \
@XFT_CFLAGS@ @HEADER_SEARCH_PATH@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = WINGs.pc WUtil.pc
DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags get-wutil-flags
DISTCLEANFILES = $(pkgconfig_DATA)
WINGs.pc: Makefile
@echo "Generating $@"
@@ -106,18 +106,8 @@ WINGs.pc: Makefile
@echo 'Version: $(VERSION)' >> $@
@echo 'Requires: wrlib WUtil' >> $@
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
@echo 'Libs.private: $(XFTLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
@echo 'Cflags: $(inc_search_path)' >> $@
get-wings-flags: get-wings-flags.in Makefile
@echo "Generating $@"
@$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \
-e 's#$${lib_search_path}#$(lib_search_path)#;' \
-e 's#$${GFXLIBS}#$(GFXLIBS)#;' \
-e 's#$${XFTLIBS}#$(XFTLIBS)#;' \
-e 's#$${INTLIBS}#$(INTLIBS)#;' \
-e 's#$${XLIBS}#$(XLIBS)#;' < $(abs_srcdir)/get-wings-flags.in > $@
@chmod 755 $@
@echo 'Libs.private: $(XFT_LIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
@echo 'Cflags: $(inc_search_path) @PANGO_CFLAGS@' >> $@
WUtil.pc: Makefile
@echo "Generating $@"
@@ -127,11 +117,3 @@ WUtil.pc: Makefile
@echo 'Libs: -L$(libdir) -lWUtil' >> $@
@echo 'Libs.private: $(INTLIBS)' >> $@
@echo 'Cflags: -I$(includedir)' >> $@
get-wutil-flags: get-wutil-flags.in Makefile
@echo "Generating $@"
@$(SED) -e 's#$${includedir}#$(includedir)#;' \
-e 's#$${libdir}#$(libdir)#;' \
-e 's#$${INTLIBS}#$(INTLIBS)#;' < $(abs_srcdir)/get-wutil-flags.in > $@
@chmod 755 $@
+61 -14
View File
@@ -1,7 +1,9 @@
** API and ABI modifications since wmaker 0.92.0
** API and ABI modifications since wmaker 0.96.0
----------------------------------------------------
** libWINGs **
<WINGsP.h>
W_KeycodeToKeysym ADDED
struct W_DragDestinationInfo: new members added SIZE CHANGE
<WINGs.h>
@@ -155,6 +157,41 @@ wshellquote ADDED
----------------------------------------------------
*** Fri May 15 18:44:50 CEST 2015 - Christophe
New Tri-state type for WMButton
-------------------------------
A new check-box type button is available with state On/Off/Tri, the later being
generally used to express "leave as-is". The states are cycled through as user
click on the button. It is created with:
btn = WMCreateButton(parent_widget, WBTTriState);
There are is this case 3 possible values for WMSetButtonSelected/WMGetButtonSelected:
- 0 and 1, the legacy checked/unchecked states
- the new -1, when in the 3rd state
*** Sun Dec 7 10:52:21 CET 2014 - David
Support for pixmap in the background of Widget
----------------------------------------------
The new function WMSetWidgetBackgroundPixmap was introduced to specify a pixmap
that will be displayed as the background of a widget instead of the usual plain
color. The dual WMGetWidgetBackgroundPixmap is provided too.
*** Sun Nov 2 13:04:14 CET 2014 - David
Get the text of a button
------------------------
It was assumed that there was no need to retrieve the text from a button because
it is generally a static constant text, but there are some cases where this can
be useful, so the new function WMGetButtonText was added to the API.
*** Thu May 9 18:24:03 CEST 2013 - Christophe
Const-correctness API changes for WRaster, WUtils and WINGs
@@ -172,14 +209,24 @@ This function now returns 'const char *' because its result must *not* be
modified, so it may generate a const related warning in old code.
*** Fri Mar 7 00:39:28 CET 2014 - David
New function WMCreateScaledBlendedPixmapFromFile
------------------------------------------------
This function can load an image from a file and if it is bigger than the
specified width/height then it will be scaled down to fit the size while
keeping the aspect ratio of the original image.
*** Mon Oct 14 19:42:42 EEST 2002 - Dan
Double buffering
----------------
To avoid flickering caused by redrawing the widgets on Expose events, a
double buffering tehnique was implemented for most of the widgets.
This flickering effect has gotten more vizible with the introduction
double buffering technique was implemented for most of the widgets.
This flickering effect has gotten more visible with the introduction
of antialiased fonts. If with normal text one can redraw the text over the
old one over and over again without any degradation of the text (new pixels
simply overwrite old pixels), with antialiased text the situation is
@@ -191,7 +238,7 @@ The double buffer is implemented to solve this issue.
This is a change that that will be automatically available for any WINGs
applications and will require no change in the existing code.
However there is an exception from this in case of WMList if you delegate
the drawing of items to userspace (read below for the compelte details).
the drawing of items to userspace (read below for the complete details).
*** Mon Oct 14 22:07:42 EEST 2002 - Dan
@@ -199,10 +246,10 @@ the drawing of items to userspace (read below for the compelte details).
WMList change
-------------
In case of WMList there is the posibility to delegate the drawing of the
In case of WMList there is the possibility to delegate the drawing of the
list items to the application that is linked with WINGs, and this code will
not be inside the WINGs library, but in userland. Since we use the double
buffering tehnique in this case too (to allow all widgets based on WMList
buffering technique in this case too (to allow all widgets based on WMList
and the ones that draw their list items by themselves to benefit from the
double buffering advantage automatically), we no longer pass the window to
the user code doing item drawing, but instead pass this pixmap in which we
@@ -231,7 +278,7 @@ This change is required to support extending WMFont to allow it to handle
antialiased fonts through the XFree86 Xft2 extension.
This also has the advantage of hiding low level X11 details and use WINGs
internat objects instead.
internal objects instead.
To fix your old code to work with the new WINGs API you need to replace the
GC passed to WMDraw***String() in your code with a WMColor*.
@@ -298,7 +345,7 @@ WMSendConnectionData() can return 3 values: -1, 0, 1
-1 - means that the connection has died. you should stop sending data and
close the connection ASAP.
1 - means that the data was succesfully sent
1 - means that the data was successfully sent
0 - means that the data (or part of it) was not sent. however, it was saved
in a queue and the library will try to send it later when possible.
@@ -307,14 +354,14 @@ on, until the return value of such a send call will be 0.
After it returns 0 you can continue sending, however, the data will not be
sent over the connection because the operating system cannot accept any more
data for the moment. Instead it will be queued inside the library, making your
program's memory footprint increase. If the ammount of data you need to
program's memory footprint increase. If the amount of data you need to
send is limited and not too big, this shouldn't be a problem, because your
data will be queued and sent when the operating system will notify the
library that sending is possible again.
If this is the case you can just ignore the output of WMSendConnectionData()
and not set a callback for canResumeSending.
However, if the ammount of data you have to send is undetermined and you
However, if the amount of data you have to send is undetermined and you
also want to keep a small memory footprint for your program (so that it
won't grow until it uses all your available memory ;) ), you will have to
stop sending data over the connection as soon as WMSendConnectionData()
@@ -343,13 +390,13 @@ Property lists handling code
----------------------------
Code to handle property lists was added to WINGs. It is more robust
than the libPropList code, mostly because some conflicting concepts
than the libPropList code, mostly because some conflicting concepts
borrowed from UserDefaults (which libPropList use) are no longer used in
the WINGs property lists code. These borrowed concepts conflicted with the
retain/release mechanism of property lists and could lead in certain cases
to segmentation faults when executing libPropList based code. But the worse
part was that these libPropList problems were practically unsolvable without
removing one of those conflicting concepts and without a complete redesign.
removing one of those conflicting concepts and without a complete redesign.
The new WINGs property lists code is also better integrated with the other
data types from WINGs and is actively maintained.
@@ -424,10 +471,10 @@ All WM...IconImage() functions operate on RImages
and will also convert the RImage to a WMPixmap with a threshold of 128
and will use that pixmap for the appicon image. If that doesn't satisfy
you, you can make a call to WMSetApplicationIconPixmap() on your own to
set whatever WMPixmap you see fit for the appicon.
set whatever WMPixmap you see fit for the appicon.
- WMSetApplicationIconPixmap() will set the WMPixmap to be used for the
appicon and for the panels
appicon and for the panels
If you use only one of the above functions, the corresponding image/pixmap
+12 -12
View File
@@ -3,35 +3,35 @@
by
Alfredo Kengi Kojima
Alfredo Kengi Kojima
kojima@windowmaker.info
WINGs is a small widget set with the N*XTSTEP look and feel. It's API
is inspired in OpenStep and it's implementation borrows some ideas
WINGs is a small widget set with the N*XTSTEP look and feel. Its API
is inspired in OpenStep and its implementation borrows some ideas
from Tk. It has a reasonable set of widgets, sufficient for building
small applications (like a CDPlayer or hacking something like rxvt). It
also has other functions that are usefull for applications, like a
User Defaults alike configuration manager and a notification system.
The library is limited and it's design is a little sloppy,
so it's not intended to build large or complex applications, like
The library is limited and its design is a little sloppy,
so it's not intended to build large or complex applications, like
anything more complex than a CDPlayer. GNUstep should be used for such
applications.
Since WINGs is written in C and is sort of low-level it is small
and faster than say, Motif or even Athena. Knowing Xlib will help you to
workaround some of it's limitations, although you'll probably be able to
and faster than say, Motif or even Athena. Knowing Xlib will help you to
workaround some of its limitations, although you'll probably be able to
write something like a trivial tic-tac-toe game without knowing much Xlib.
Some of it's functions are designed to support the Window Maker window
manager (see http://windowmaker.info) In fact, it's primary role is to
Some of its functions are designed to support the Window Maker window
manager (see http://windowmaker.info) In fact, its primary role is to
support Window Maker. All other uses of it are just an added bonus.
It will help you to understand the API if you read the ApplicationKit
reference manual, distributed as a PDF by Apple. The function names,
structs and most of the intrinsics are very close to OpenStep classes.
structs and most of the intrinsics are very close to OpenStep classes.
Internationalization:
@@ -66,7 +66,7 @@ Widgets provided by WINGs:
- input box
- file panel
- color panel
- alert panel
- alert panel
- font panel
If you think you can code the following, please do. They are needed by
+5 -4
View File
@@ -2,14 +2,14 @@
AUTOMAKE_OPTIONS =
noinst_PROGRAMS = wtest wmquery wmfile testmywidget
noinst_PROGRAMS = wtest wmquery wmfile testmywidget
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@ @XLIBS@
@XFT_LIBS@ @INTLIBS@ @XLIBS@
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
@@ -17,4 +17,5 @@ wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFT_CFLAGS@ @HEADER_SEARCH_PATH@ \
@PANGO_CFLAGS@
+1
View File
@@ -64,6 +64,7 @@ static W_Class myWidgetClass = 0;
*/
W_Class InitMyWidget(WMScreen * scr)
{
(void)scr;
/* register our widget with WINGs and get our widget class ID */
if (!myWidgetClass) {
myWidgetClass = W_RegisterUserWidget();
+1 -1
View File
@@ -4,7 +4,7 @@
#include "mywidget.h"
void wAbort()
_Noreturn void wAbort(void)
{
exit(1);
}
+4 -4
View File
@@ -8,16 +8,16 @@ ftp.windowmaker.info</u></font><Br>
</center>
<b><i>Window Maker</b>
<Img src=upbtn.xpm></i>is the GNU window manager
<Img src=upbtn.xpm></i>is the GNU window manager
for the X Window System. It was
designed to emulate the look and feel of part of the NEXTSTEP(tm) GUI. Its
supposed to be relatively fast and small, feature rich, easy to configure and
supposed to be relatively fast and small, feature rich, easy to configure and
easy to use, with a simple and elegant appearance borrowed from NEXTSTEP(tm).
<p>
<b>Window Maker</b> was designed keeping integration with GNUstep in
<b>Window Maker</b> was designed keeping integration with GNUstep in
mind and is the
"official" window manager for it. It is also part of the GNU project
(<u>www.gnu.org</u>)
(<u>www.gnu.org</u>)
<p>
<b>What is <i>GNUstep?</i></b><p>
+4 -7
View File
@@ -19,14 +19,14 @@
#include "logo.xpm"
void wAbort()
_Noreturn void wAbort(void)
{
exit(1);
}
char *ProgName;
void usage(void)
_Noreturn void usage(void)
{
fprintf(stderr,
"usage:\n"
@@ -53,13 +53,10 @@ int main(int argc, char **argv)
WMPixmap *pixmap;
WMOpenPanel *oPanel;
WMSavePanel *sPanel;
/* RImage *image; */
char *title = NULL;
char *initial = "/";
int ch;
int panelType = OPEN_PANEL_TYPE;
extern char *optarg;
extern int optind;
if (!dpy) {
puts("could not open display");
@@ -96,14 +93,14 @@ int main(int argc, char **argv)
if (panelType == SAVE_PANEL_TYPE) {
sPanel = WMGetSavePanel(scr);
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
/*title */ NULL, NULL) == True)
title, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(sPanel));
else
printf("\n");
} else {
oPanel = WMGetOpenPanel(scr);
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
/*title */ NULL, NULL) == True)
title, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(oPanel));
else
printf("\n");
+3 -5
View File
@@ -11,14 +11,14 @@
#include "logo.xpm"
void wAbort()
_Noreturn void wAbort(void)
{
exit(1);
exit(1);
}
char *ProgName;
void usage(void)
_Noreturn void usage(void)
{
fprintf(stderr,
"usage:\n"
@@ -45,8 +45,6 @@ int main(int argc, char **argv)
char *initial = NULL;
char *result = NULL;
int ch;
extern char *optarg;
extern int optind;
WMInitializeApplication("WMQuery", &argc, argv);
+19 -3
View File
@@ -14,7 +14,7 @@
* This will be called when the application will be terminated because
* of a fatal error (only for memory allocation failures ATM).
*/
void wAbort()
_Noreturn void wAbort(void)
{
exit(1);
}
@@ -25,6 +25,7 @@ int windowCount = 0;
void closeAction(WMWidget * self, void *data)
{
(void)data;
WMDestroyWidget(self);
windowCount--;
printf("window closed, window count = %d\n", windowCount);
@@ -165,10 +166,13 @@ void testBox(WMScreen * scr)
static void singleClick(WMWidget * self, void *data)
{
(void)self;
(void)data;
}
static void doubleClick(WMWidget * self, void *data)
{
(void)data;
WMSelectAllListItems((WMList *) self);
}
@@ -480,6 +484,7 @@ void testColorPanel(WMScreen * scr)
void sliderCallback(WMWidget * w, void *data)
{
(void)data;
printf("SLIDER == %i\n", WMGetSliderValue(w));
}
@@ -516,7 +521,7 @@ void testSlider(WMScreen * scr)
void testTextField(WMScreen * scr)
{
WMWindow *win;
WMTextField *field, *field2;
WMTextField *field, *field2, *field3;
windowCount++;
@@ -535,6 +540,11 @@ void testTextField(WMScreen * scr)
WMMoveWidget(field2, 20, 50);
WMSetTextFieldAlignment(field2, WARight);
field3 = WMCreateTextField(win);
WMResizeWidget(field3, 200, 20);
WMMoveWidget(field3, 20, 80);
WMSetTextFieldAlignment(field3, WACenter);
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
@@ -749,6 +759,8 @@ void testTabView(WMScreen * scr)
void splitViewConstrainProc(WMSplitView * sPtr, int indView, int *minSize, int *maxSize)
{
(void)sPtr;
switch (indView) {
case 0:
*minSize = 20;
@@ -782,6 +794,7 @@ static void resizeSplitView(XEvent * event, void *data)
void appendSubviewButtonAction(WMWidget * self, void *data)
{
(void)self;
WMSplitView *sPtr = (WMSplitView *) data;
char buf[64];
WMLabel *label = WMCreateLabel(sPtr);
@@ -796,6 +809,7 @@ void appendSubviewButtonAction(WMWidget * self, void *data)
void removeSubviewButtonAction(WMWidget * self, void *data)
{
(void)self;
WMSplitView *sPtr = (WMSplitView *) data;
int count = WMGetSplitViewSubviewsCount(sPtr);
@@ -808,12 +822,14 @@ void removeSubviewButtonAction(WMWidget * self, void *data)
void orientationButtonAction(WMWidget * self, void *data)
{
(void)self;
WMSplitView *sPtr = (WMSplitView *) data;
WMSetSplitViewVertical(sPtr, !WMGetSplitViewVertical(sPtr));
}
void adjustSubviewsButtonAction(WMWidget * self, void *data)
{
(void)self;
WMAdjustSplitViewSubviews((WMSplitView *) data);
}
@@ -902,7 +918,7 @@ void testSplitView(WMScreen * scr)
WMMapWidget(win);
}
void testUD()
void testUD(void)
{
WMUserDefaults *defs;
char str[32];
+11 -1
View File
@@ -5,4 +5,14 @@ AUTOMAKE_OPTIONS =
# is this a kluge? if so, how should i do it?
includedir = @includedir@/WINGs
include_HEADERS = WINGs.h WUtil.h WINGsP.h
BUILT_SOURCES = WINGsP.h
CLEANFILES = WINGsP.h
include_HEADERS = WINGs.h WUtil.h
nodist_include_HEADERS = WINGsP.h
EXTRA_DIST = WINGsP.h.in
WINGsP.h: WINGsP.h.in $(top_builddir)/config.h
$(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \
--header "$(top_builddir)/config.h" \
--filter "USE_PANGO" \
-o $@ $<
+40 -17
View File
@@ -26,7 +26,7 @@
#include <WINGs/WUtil.h>
#include <X11/Xlib.h>
#define WINGS_H_VERSION 20140612
#define WINGS_H_VERSION 20230226
#ifdef __cplusplus
@@ -127,7 +127,8 @@ typedef enum {
WBTRadio = 5,
WBTMomentaryChange = 6,
WBTOnOff = 7,
WBTMomentaryLight = 8
WBTMomentaryLight = 8,
WBTTriState = 9
} WMButtonType;
/* button behaviour masks */
@@ -735,7 +736,7 @@ Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
void *cdata);
extern char *WMSelectionOwnerDidChangeNotification;
extern const char *WMSelectionOwnerDidChangeNotification;
/* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
@@ -794,6 +795,8 @@ char* WMGetFontName(WMFont *font);
unsigned int WMFontHeight(WMFont *font);
void WMGetScaleBaseFromSystemFont(WMScreen *scrPtr, int *alphabetWidth, int *fontHeight);
void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
@@ -930,6 +933,10 @@ void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
void WMSetWidgetBackgroundPixmap(WMWidget *w, WMPixmap *pix);
WMPixmap *WMGetWidgetBackgroundPixmap(WMWidget *w);
void WMMapSubwidgets(WMWidget *w);
void WMUnmapSubwidgets(WMWidget *w);
@@ -970,11 +977,11 @@ WMPoint WMGetViewScreenPosition(WMView *view);
WMWidget* WMWidgetOfView(WMView *view);
/* notifications */
extern char *WMViewSizeDidChangeNotification;
extern const char *WMViewSizeDidChangeNotification;
extern char *WMViewFocusDidChangeNotification;
extern const char *WMViewFocusDidChangeNotification;
extern char *WMViewRealizedNotification;
extern const char *WMViewRealizedNotification;
/* ---[ WINGs/wballoon.c ]------------------------------------------------ */
@@ -1069,6 +1076,9 @@ void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
void WMSetButtonText(WMButton *bPtr, const char *text);
/* Returns direct pointer to internal data, do not modify! */
const char *WMGetButtonText(WMButton *bPtr);
void WMSetButtonAltText(WMButton *bPtr, const char *text);
void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
@@ -1180,9 +1190,9 @@ void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
extern char *WMTextDidChangeNotification;
extern char *WMTextDidBeginEditingNotification;
extern char *WMTextDidEndEditingNotification;
extern const char *WMTextDidChangeNotification;
extern const char *WMTextDidBeginEditingNotification;
extern const char *WMTextDidEndEditingNotification;
/* ---[ WINGs/wscroller.c ]----------------------------------------------- */
@@ -1202,7 +1212,7 @@ void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
void WMSetScrollerArrowsPosition(WMScroller *sPtr,
WMScrollArrowPosition position);
extern char *WMScrollerDidScrollNotification;
extern const char *WMScrollerDidScrollNotification;
/* ---[ WINGs/wlist.c ]--------------------------------------------------- */
@@ -1281,8 +1291,8 @@ Bool WMListAllowsMultipleSelection(WMList *lPtr);
Bool WMListAllowsEmptySelection(WMList *lPtr);
extern char *WMListDidScrollNotification;
extern char *WMListSelectionDidChangeNotification;
extern const char *WMListDidScrollNotification;
extern const char *WMListSelectionDidChangeNotification;
/* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
@@ -1314,7 +1324,7 @@ void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
WMCompareDataProc *func);
/* Don't free the returned string. */
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
const char* WMSetBrowserPath(WMBrowser *bPtr, const char *path);
/* free the returned string */
char* WMGetBrowserPath(WMBrowser *bPtr);
@@ -1452,6 +1462,10 @@ void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
int WMSelectPopUpButtonPreviousItem(WMPopUpButton *bPtr);
int WMSelectPopUpButtonNextItem(WMPopUpButton *bPtr);
/* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
@@ -1486,7 +1500,7 @@ void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
extern char *WMColorPanelColorChangedNotification;
extern const char *WMColorPanelColorChangedNotification;
/* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
@@ -1499,7 +1513,7 @@ WMColor* WMGetColorWellColor(WMColorWell *cPtr);
void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
extern char *WMColorWellDidChangeNotification;
extern const char *WMColorWellDidChangeNotification;
/* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
@@ -1519,6 +1533,8 @@ void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
void WMScrollViewScrollPoint(WMScrollView * sPtr, WMPoint point);
WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
@@ -1831,10 +1847,17 @@ WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, const char *tit
const char *msg, const char *defaultButton,
const char *alternateButton, const char *otherButton);
WMAlertPanel* WMCreateScaledAlertPanel(WMScreen *app, WMWindow *owner, const char *title,
const char *msg, const char *defaultButton,
const char *alternateButton, const char *otherButton);
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, const char *title,
const char *msg, const char *defaultText, const char *okButton,
const char *cancelButton);
WMInputPanel* WMCreateScaledInputPanel(WMScreen *app, WMWindow *owner, const char *title,
const char *msg, const char *defaultText, const char *okButton,
const char *cancelButton);
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
const char *title, const char *defaultButton,
@@ -1859,7 +1882,7 @@ void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
void WMSetFilePanelDirectory(WMFilePanel *panel, const char *path);
/* you can free the returned string */
char* WMGetFilePanelFileName(WMFilePanel *panel);
@@ -1867,7 +1890,7 @@ char* WMGetFilePanelFileName(WMFilePanel *panel);
void WMFreeFilePanel(WMFilePanel *panel);
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
char *path, const char *name, char **fileTypes);
const char *path, const char *name, char **fileTypes);
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
@@ -5,6 +5,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@USE_PANGO@#include <pango/pango.h>
#include <WINGs/WINGs.h>
@@ -40,7 +41,7 @@ typedef struct _WINGsConfiguration {
unsigned mouseWheelDown;
} _WINGsConfiguration;
extern char *_WINGS_progname;
extern const char *_WINGS_progname;
extern _WINGsConfiguration WINGsConfiguration;
extern struct W_Application WMApplication;
@@ -251,7 +252,7 @@ typedef struct W_Screen {
Atom wmIconDragOffsetAtom;
Atom wmStateAtom; /* WM_STATE */
Atom utf8String;
Atom netwmName;
@@ -265,6 +266,16 @@ typedef struct W_Screen {
struct W_View *modalView;
unsigned modalLoop:1;
unsigned ignoreNextDoubleClick:1;
/*
* New stuff in Window Maker 0.95.7
* Added at the end of the structure to avoid breaking binary compatibility
* with previous versions of the toolkit
*/
W_Pixmap *tristateButtonImageOn;
W_Pixmap *tristateButtonImageOff;
W_Pixmap *tristateButtonImageTri;
} W_Screen;
#define W_DRAWABLE(scr) (scr)->rcontext->drawable
@@ -445,6 +456,8 @@ typedef struct W_Font {
short y;
short refCount;
char *name;
@USE_PANGO@ PangoLayout *layout;
} W_Font;
#define W_FONTID(f) (f)->font->fid
@@ -481,6 +494,8 @@ void W_SetPreeditPositon(W_View *view, int x, int y);
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
int buflen, KeySym *keysym, Status *status);
KeySym W_KeycodeToKeysym(Display *display, KeyCode keycode, int index);
/* ---[ wmisc.c ]--------------------------------------------------------- */
@@ -565,6 +580,8 @@ struct W_View {
void *hangedData; /* data holder for user program */
WMColor *backColor;
WMPixmap *backImage;
Cursor cursor;
@@ -657,6 +674,8 @@ void W_ResizeView(W_View *view, unsigned int width, unsigned int height);
void W_SetViewBackgroundColor(W_View *view, WMColor *color);
void W_SetViewBackgroundPixmap(W_View *view, WMPixmap *pix);
void W_SetViewCursor(W_View *view, Cursor cursor);
void W_SetFocusOfTopLevel(W_View *toplevel, W_View *view);
@@ -667,6 +686,37 @@ void W_BroadcastMessage(W_View *targetParent, XEvent *event);
void W_DispatchMessage(W_View *target, XEvent *event);
/* ---[ UTF-8 helpers ]--------------------------------------------------- */
static inline int oneUTF8CharBackward(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[--pos] >= 0x80 && ustr[pos] <= 0xbf) ;
return pos;
}
static inline int oneUTF8CharForward(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[++pos] >= 0x80 && ustr[pos] <= 0xbf) ;
return pos;
}
// find the beginning of the UTF8 char pointed by str
static inline int seekUTF8CharStart(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[pos] >= 0x80 && ustr[pos] <= 0xbf)
--pos;
return pos;
}
#ifdef __cplusplus
}
+12 -1
View File
@@ -193,6 +193,16 @@ typedef void WMNotificationObserverAction(void *observerData,
sizeof(array) / sizeof(array[0]); \
})
/* These macros can be used to adjust the location and size pixel values in
* the panel layouts so that they match the configured size of the system
* font (useful with high DPI screens, where you have to increase this size).
* The macros require two local variables to be set:
* wmScaleWidth: the width of the alphabet in the current system font
* wmScaleHeight: the height of the current system font
* Use the WMGetScaleBaseFromSystemFont function to set these values.
*/
#define WMScaleX(value) ((int)((double)value / 177.0 * (double)wmScaleWidth + 0.5))
#define WMScaleY(value) ((int)((double)value / 15.0 * (double)wmScaleHeight + 0.5))
/* ---[ WINGs/memory.c ]-------------------------------------------------- */
@@ -239,7 +249,7 @@ char* wexpandpath(const char *path);
int wcopy_file(const char *toPath, const char *srcFile, const char *destFile);
/* don't free the returned string */
char* wgethomedir(void);
const char* wgethomedir(void);
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
@@ -854,6 +864,7 @@ Bool WMWritePropListToFile(WMPropList *plist, const char *path);
/* don't free the returned string */
const char* wusergnusteppath(void);
const char* wuserdatapath(void);
/* Free the returned string when you no longer need it */
char* wdefaultspathfordomain(const char *domain);
+6 -6
View File
@@ -126,11 +126,11 @@ void WMAddToArray(WMArray * array, void *item)
void WMInsertInArray(WMArray * array, int index, void *item)
{
wassertr(array && index >= 0 && index <= array->itemCount);
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);
@@ -148,11 +148,11 @@ void *WMReplaceInArray(WMArray * array, int index, void *item)
{
void *old;
wassertrv(array && index >= 0 && index <= array->itemCount, NULL);
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);
@@ -167,11 +167,11 @@ void *WMReplaceInArray(WMArray * array, int index, void *item)
int WMDeleteFromArray(WMArray * array, int index)
{
wassertrv(array && index >= 0 && index < array->itemCount, 0);
if (array == NULL)
return 0;
wassertrv(index >= 0 && index < array->itemCount, 0);
if (array->destructor) {
array->destructor(array->items[index]);
}
+9 -29
View File
@@ -420,10 +420,8 @@ void WMInsertInBag(WMBag * self, int index, void *item)
self->count++;
}
int WMRemoveFromBag(WMBag * self, void *item)
static int treeDeleteNode(WMBag * self, W_Node *ptr)
{
W_Node *ptr = treeFind(self->root, self->nil, item);
if (ptr != self->nil) {
W_Node *tmp;
@@ -439,11 +437,15 @@ int WMRemoveFromBag(WMBag * self, void *item)
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
return 1;
} else {
return 0;
}
return 0;
}
int WMRemoveFromBag(WMBag * self, void *item)
{
W_Node *ptr = treeFind(self->root, self->nil, item);
return treeDeleteNode(self, ptr);
}
int WMEraseFromBag(WMBag * self, int index)
@@ -470,29 +472,7 @@ int WMEraseFromBag(WMBag * self, int index)
int WMDeleteFromBag(WMBag * self, int index)
{
W_Node *ptr = treeSearch(self->root, self->nil, index);
if (ptr != self->nil) {
W_Node *tmp;
self->count--;
tmp = treeSuccessor(ptr, self->nil);
while (tmp != self->nil) {
tmp->index--;
tmp = treeSuccessor(tmp, self->nil);
}
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
wassertrv(self->count == 0 || self->root->index >= 0, 1);
return 1;
} else {
return 0;
}
return treeDeleteNode(self, ptr);
}
void *WMGetFromBag(WMBag * self, int index)
+4 -3
View File
@@ -1,3 +1,4 @@
#include "wconfig.h"
#include "WINGsP.h"
@@ -56,7 +57,7 @@ WMDragOperationType W_ActionToOperation(WMScreen * scr, Atom action)
} else {
char *tmp = XGetAtomName(scr->display, action);
wwarning("unknown XDND action %s ", tmp);
wwarning(_("unknown XDND action %s"), tmp);
XFree(tmp);
return WDOperationCopy;
@@ -138,7 +139,7 @@ W_SendDnDClientMessage(Display * dpy, Window win, Atom message,
#endif
if (!windowExists(dpy, win)) {
wwarning("xdnd message target %lu does no longer exist.", win);
wwarning(_("target %lu for XDND message no longer exists"), win);
return False; /* message not sent */
}
@@ -216,7 +217,7 @@ void W_HandleDNDClientMessage(WMView * toplevel, XClientMessageEvent * event)
return;
}
} else {
wwarning("received dnd enter msg with unsupported version %i", XDND_SOURCE_VERSION(info));
wwarning(_("unsupported version %i for XDND enter message"), XDND_SOURCE_VERSION(info));
W_DragDestinationCancelDropOnEnter(toplevel, info);
return;
}
+1 -3
View File
@@ -19,9 +19,7 @@
#define XDND_REQUIRED_TYPES(dragInfo) dragInfo->destInfo->requiredTypes
#define XDND_SOURCE_ACTION(dragInfo) dragInfo->sourceAction
#define XDND_DEST_ACTION(dragInfo) dragInfo->destinationAction
#define XDND_SOURCE_OPERATIONS(dragInfo) dragInfo->destInfo->sourceOperations
#define XDND_DROP_DATAS(dragInfo) dragInfo->destInfo->dropDatas
#define XDND_DROP_DATA_COUNT(dragInfo) dragInfo->destInfo->dropDataCount
#define XDND_DEST_VIEW_IS_REGISTERED(dragInfo) ((dragInfo->destInfo) != NULL)\
&& ((dragInfo->destInfo->destView->dragDestinationProcs) != NULL)
@@ -601,7 +599,7 @@ static void dragSourceResponseTimeOut(void *destView)
W_DragDestinationInfoClear(info);
}
void W_DragDestinationStopTimer()
void W_DragDestinationStopTimer(void)
{
if (dndDestinationTimer != NULL) {
WMDeleteTimerHandler(dndDestinationTimer);
+5 -5
View File
@@ -160,7 +160,7 @@ static void selectionLost(WMView * view, Atom selection, void *cdata)
(void) selection;
(void) cdata;
wwarning("DND selection lost during drag operation...");
wwarning(_("XDND selection lost during drag operation..."));
}
static void selectionDone(WMView * view, Atom selection, Atom target, void *cdata)
@@ -755,7 +755,7 @@ static void storeDestinationProtocolVersion(WMDraggingInfo * info)
XFree(winXdndVersion);
} else {
XDND_DEST_VERSION(info) = 0;
wwarning("failed to read XDND version of drop target");
wwarning(_("could not get XDND version for target of drop"));
}
}
@@ -771,7 +771,7 @@ static void initMotionProcess(WMView * view, WMDraggingInfo * info, XEvent * eve
XDND_TIMESTAMP(info) = event->xmotion.time;
if (!WMCreateSelectionHandler(view, scr->xdndSelectionAtom, CurrentTime, XDND_SELECTION_PROCS(info), NULL)) {
wwarning("could not get ownership or DND selection");
wwarning(_("could not get ownership of XDND selection"));
return;
}
@@ -1067,7 +1067,7 @@ static void dragSourceResponseTimeOut(void *source)
WMView *view = (WMView *) source;
WMDraggingInfo *info = &(W_VIEW_SCREEN(view)->dragInfo);
wwarning("delay for drag destination response expired");
wwarning(_("delay for drag destination response expired"));
sendLeaveMessage(info);
recolorCursor(info, False);
@@ -1080,7 +1080,7 @@ static void dragSourceResponseTimeOut(void *source)
}
}
void W_DragSourceStopTimer()
void W_DragSourceStopTimer(void)
{
if (dndSourceTimer != NULL) {
WMDeleteTimerHandler(dndSourceTimer);
+90 -48
View File
@@ -23,7 +23,9 @@
#include "WUtil.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -37,7 +39,7 @@
#endif
char *wgethomedir()
const char *wgethomedir(void)
{
static char *home = NULL;
char *tmp;
@@ -46,11 +48,7 @@ char *wgethomedir()
if (home)
return home;
#ifdef HAVE_SECURE_GETENV
tmp = secure_getenv("HOME");
#else
tmp = getenv("HOME");
#endif
tmp = GETENV("HOME");
if (tmp) {
home = wstrdup(tmp);
return home;
@@ -422,60 +420,104 @@ char *wfindfileinarray(WMPropList *array, const char *file)
return NULL;
}
int wcopy_file(const char *dir, const char *src_file, const char *dest_file)
int wcopy_file(const char *dest_dir, const char *src_file, const char *dest_file)
{
FILE *src, *dst;
size_t nread, nwritten;
char *dstpath;
struct stat st;
char buf[4096];
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 */
/* only to a directory */
if (stat(dir, &st) != 0 || !S_ISDIR(st.st_mode))
return -1;
/* only copy files */
if (stat(src_file, &st) != 0 || !S_ISREG(st.st_mode))
return -1;
do {
src = fopen(src_file, "rb");
} while ((src == NULL) && (errno == EINTR));
if (src == NULL) {
werror(_("Could not open input file \"%s\""), src_file);
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;
}
dstpath = wstrconcat(dir, dest_file);
do {
dst = fopen(dstpath, "wb");
} while ((dst == NULL) && (errno == EINTR));
if (dst == NULL) {
werror(_("Could not create target file \"%s\""), dstpath);
wfree(dstpath);
fclose(src);
/* Only accept to copy regular files */
if (fstat(fd_src, &stat_src) != 0 || !S_ISREG(stat_src.st_mode)) {
close(fd_src);
return -1;
}
do {
nread = fread(buf, 1, sizeof(buf), src);
if (ferror(src))
break;
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;
}
nwritten = fwrite(buf, 1, nread, dst);
if (ferror(dst) || feof(src) || nread != nwritten)
break;
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;
}
} while (1);
for (;;) {
ssize_t size_data;
const char *write_ptr;
size_t write_remain;
if (ferror(src) || ferror(dst))
unlink(dstpath);
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;
}
fclose(src);
fchmod(fileno(dst), st.st_mode);
fsync(fileno(dst));
if (fclose(dst))
wwarning("error occured during fclose(\"%s\")", dstpath);
wfree(dstpath);
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;
}
-31
View File
@@ -1,31 +0,0 @@
#!/bin/sh
WCFLAGS="${inc_search_path}"
WLFLAGS="${lib_search_path}"
WLIBS="-lWINGs -lWUtil -lwraster ${GFXLIBS} ${XFTLIBS} ${XLIBS} -lm ${INTLIBS}"
usage="Usage: get-wings-flags [--cflags] [--ldflags] [--libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo $WCFLAGS
;;
--ldflags|--lflags)
echo $WLFLAGS
;;
--libs)
echo $WLIBS
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
-31
View File
@@ -1,31 +0,0 @@
#!/bin/sh
WCFLAGS="-I${includedir}"
WLFLAGS="-L${libdir}"
WLIBS="-lWUtil ${INTLIBS}"
usage="Usage: get-wutil-flags [--cflags] [--ldflags] [--libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo $WCFLAGS
;;
--ldflags|--lflags)
echo $WLFLAGS
;;
--libs)
echo $WLIBS
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
+19 -31
View File
@@ -154,7 +154,7 @@ unsigned WMCountHashTable(WMHashTable * table)
return table->itemCount;
}
void *WMHashGet(WMHashTable * table, const void *key)
static HashItem *hashGetItem(WMHashTable *table, const void *key)
{
unsigned h;
HashItem *item;
@@ -177,44 +177,32 @@ void *WMHashGet(WMHashTable * table, const void *key)
item = item->next;
}
}
if (item)
return (void *)item->data;
else
return item;
}
void *WMHashGet(WMHashTable * table, const void *key)
{
HashItem *item;
item = hashGetItem(table, key);
if (!item)
return NULL;
return (void *)item->data;
}
Bool WMHashGetItemAndKey(WMHashTable * table, const void *key, void **retItem, void **retKey)
{
unsigned h;
HashItem *item;
h = HASH(table, key);
item = table->table[h];
if (table->callbacks.keyIsEqual) {
while (item) {
if ((*table->callbacks.keyIsEqual) (key, item->key)) {
break;
}
item = item->next;
}
} else {
while (item) {
if (key == item->key) {
break;
}
item = item->next;
}
}
if (item) {
if (retKey)
*retKey = (void *)item->key;
if (retItem)
*retItem = (void *)item->data;
return True;
} else {
item = hashGetItem(table, key);
if (!item)
return False;
}
if (retKey)
*retKey = (void *)item->key;
if (retItem)
*retItem = (void *)item->data;
return True;
}
void *WMHashInsert(WMHashTable * table, const void *key, const void *data)
+2 -1
View File
@@ -107,7 +107,8 @@ void *wmalloc(size_t size)
}
}
}
memset(tmp, 0, size);
if (tmp != NULL)
memset(tmp, 0, size);
return tmp;
}
+9 -9
View File
@@ -377,7 +377,7 @@ found_end_squote:
if (limit-- > 0)
goto restart_token_split;
WMenuParserError(parser, _("too many nested macro expansion, breaking loop") );
WMenuParserError(parser, _("too many nested macro expansions, breaking loop"));
while (isnamechr(*parser->rd))
parser->rd++;
@@ -436,7 +436,7 @@ static void menu_parser_get_directive(WMenuParser parser)
menu_parser_condition_end(parser);
} else {
WMenuParserError(parser, _("unknow directive '#%s'"), command);
WMenuParserError(parser, _("unknown directive '#%s'"), command);
return;
}
@@ -500,7 +500,7 @@ found_end_define_fname:
count++;
if (count > MAX_NESTED_INCLUDES) {
WMenuParserError(parser, _("too many nested includes") );
WMenuParserError(parser, _("too many nested #include's"));
return False;
}
}
@@ -536,7 +536,7 @@ found_end_define_fname:
while (*src != '\0') {
idx = 0;
if (*src == '~') {
char *home = wgethomedir();
const char *home = wgethomedir();
while (*home != '\0') {
if (idx < sizeof(buffer) - 2)
buffer[idx++] = *home;
@@ -565,7 +565,7 @@ found_end_define_fname:
src++;
}
}
WMenuParserError(parser, _("could not find file \"%s\" for include"), req_filename);
WMenuParserError(parser, _("could not find file \"%s\" for #include"), req_filename);
return False;
}
@@ -612,10 +612,10 @@ static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists)
macro = menu_parser_find_macro(parser, macro_name);
parser->cond.stack[0].skip =
((check_exists) && (macro == NULL)) ||
((!check_exists) && (macro != NULL)) ;
((!check_exists) && (macro != NULL));
}
strcpy(parser->cond.stack[0].name, cmd_name);
strncpy(parser->cond.stack[0].name, cmd_name, sizeof(parser->cond.stack[0].name) - 1);
parser->cond.stack[0].line = parser->line_number;
}
@@ -623,7 +623,7 @@ static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists)
static void menu_parser_condition_else(WMenuParser parser)
{
if (parser->cond.depth <= 0) {
WMenuParserError(parser, _("found #%s but have no matching #if"), "else" );
WMenuParserError(parser, _("found #%s but has no matching #if"), "else");
return;
}
@@ -640,7 +640,7 @@ static void menu_parser_condition_end(WMenuParser parser)
int idx;
if (parser->cond.depth <= 0) {
WMenuParserError(parser, _("found #%s but have no matching #if"), "endif" );
WMenuParserError(parser, _("found #%s but has no matching #if"), "endif");
return;
}
+8 -4
View File
@@ -167,6 +167,7 @@ void menu_parser_define_macro(WMenuParser parser)
return;
}
macro = wmalloc(sizeof(*macro));
memset(arg_name, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
/* Isolate name of macro */
idx = 0;
@@ -206,7 +207,7 @@ void menu_parser_define_macro(WMenuParser parser)
arg_names_buf[idx] = '\0';
if (idx < sizeof(arg_names_buf) - 1) idx++;
} else {
WMenuParserError(parser, _("invalid characted '%c' in arg-list for macro \"%s\" while expecting parameter name"),
WMenuParserError(parser, _("invalid character '%c' in arg-list for macro \"%s\" while expecting parameter name"),
*parser->rd, macro->name);
wfree(macro);
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content
@@ -217,7 +218,7 @@ void menu_parser_define_macro(WMenuParser parser)
if (*parser->rd == ')') break;
if (*parser->rd != ',') {
WMenuParserError(parser, _("invalid characted '%c' in arg-list for macro \"%s\" while expecting ',' or ')'"),
WMenuParserError(parser, _("invalid character '%c' in arg-list for macro \"%s\" while expecting ',' or ')'"),
*parser->rd, macro->name);
wfree(macro);
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content
@@ -279,7 +280,8 @@ WParserMacro *menu_parser_find_macro(WMenuParser parser, const char *name)
continue;
return macro;
check_next_macro: ;
check_next_macro:
;
}
return NULL;
}
@@ -391,6 +393,8 @@ void menu_parser_expand_macro(WMenuParser parser, WParserMacro *macro)
unsigned int size;
int i, space_left;
memset(arg_value, 0, MAX_MACRO_ARG_COUNT * sizeof(char *));
/* Skip the name of the macro, this was not done by caller */
for (i = 0; macro->name[i] != '\0'; i++)
parser->rd++;
@@ -692,7 +696,7 @@ static void w_create_macro(WMenuParser parser, const char *name, WParserMacroFun
WParserMacro *macro;
macro = wmalloc(sizeof(*macro));
strcpy(macro->name, name);
strncpy(macro->name, name, sizeof(macro->name) - 1);
macro->function = handler;
macro->arg_count = -1;
macro->next = parser->macros;
+93 -18
View File
@@ -1,50 +1,125 @@
nlsdir = $(NLSDIR)
DOMAIN = WINGs
CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) WINGs.pot
CLEANFILES = $(CATALOGS) $(DOMAIN).pot
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po hu.po nl.po sk.po
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po fy.po hu.po nl.po sk.po sr.po
# WUtil files:
POTFILES = \
$(top_srcdir)/WINGs/array.c \
$(top_srcdir)/WINGs/bagtree.c \
$(top_srcdir)/WINGs/data.c \
$(top_srcdir)/WINGs/error.c \
$(top_srcdir)/WINGs/findfile.c \
$(top_srcdir)/WINGs/handlers.c \
$(top_srcdir)/WINGs/hashtable.c \
$(top_srcdir)/WINGs/memory.c \
$(top_srcdir)/WINGs/menuparser.c \
$(top_srcdir)/WINGs/menuparser_macros.c \
$(top_srcdir)/WINGs/misc.c \
$(top_srcdir)/WINGs/notification.c \
$(top_srcdir)/WINGs/proplist.c \
$(top_srcdir)/WINGs/string.c \
$(top_srcdir)/WINGs/tree.c \
$(top_srcdir)/WINGs/userdefaults.c \
$(top_srcdir)/WINGs/usleep.c \
$(top_srcdir)/WINGs/wapplication.c \
$(top_srcdir)/WINGs/wutil.c
# WINGs files:
POTFILES += \
$(top_srcdir)/WINGs/configuration.c \
$(top_srcdir)/WINGs/dragcommon.c \
$(top_srcdir)/WINGs/dragdestination.c \
$(top_srcdir)/WINGs/dragsource.c \
$(top_srcdir)/WINGs/selection.c \
$(top_srcdir)/WINGs/wappresource.c \
$(top_srcdir)/WINGs/wballoon.c \
$(top_srcdir)/WINGs/wbox.c \
$(top_srcdir)/WINGs/wbrowser.c \
$(top_srcdir)/WINGs/wbutton.c \
$(top_srcdir)/WINGs/wcolor.c \
$(top_srcdir)/WINGs/wcolorpanel.c \
$(top_srcdir)/WINGs/wcolorwell.c \
$(top_srcdir)/WINGs/wevent.c \
$(top_srcdir)/WINGs/wfilepanel.c \
$(top_srcdir)/WINGs/wframe.c \
$(top_srcdir)/WINGs/wfont.c \
$(top_srcdir)/WINGs/wfontpanel.c \
$(top_srcdir)/WINGs/widgets.c \
$(top_srcdir)/WINGs/wruler.c
$(top_srcdir)/WINGs/winputmethod.c \
$(top_srcdir)/WINGs/wlabel.c \
$(top_srcdir)/WINGs/wlist.c \
$(top_srcdir)/WINGs/wmenuitem.c \
$(top_srcdir)/WINGs/wmisc.c \
$(top_srcdir)/WINGs/wpanel.c \
$(top_srcdir)/WINGs/wpixmap.c \
$(top_srcdir)/WINGs/wpopupbutton.c \
$(top_srcdir)/WINGs/wprogressindicator.c \
$(top_srcdir)/WINGs/wruler.c \
$(top_srcdir)/WINGs/wscroller.c \
$(top_srcdir)/WINGs/wscrollview.c \
$(top_srcdir)/WINGs/wslider.c \
$(top_srcdir)/WINGs/wsplitview.c \
$(top_srcdir)/WINGs/wtabview.c \
$(top_srcdir)/WINGs/wtext.c \
$(top_srcdir)/WINGs/wtextfield.c \
$(top_srcdir)/WINGs/wview.c \
$(top_srcdir)/WINGs/wwindow.c
SUFFIXES = .po .mo
.po.mo:
msgfmt -c -o $@ $<
.po.mo:
$(AM_V_GEN)$(MSGFMT) -c -o $@ $<
all-local: $(CATALOGS)
WINGs.pot: $(POTFILES)
xgettext --default-domain=WINGs \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WINGs.po WINGs.pot; then \
rm -f WINGs.po; \
.PHONY: update-lang
if HAVE_XGETTEXT
update-lang: $(DOMAIN).pot
$(AM_V_GEN)$(top_srcdir)/script/generate-po-from-template.sh \
-n "$(PACKAGE_NAME)" -v "$(PACKAGE_VERSION)" -b "$(PACKAGE_BUGREPORT)" \
-t "$(DOMAIN).pot" "$(srcdir)/$(PO).po"
$(DOMAIN).pot: $(POTFILES)
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f WINGs.po WINGs.pot; \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)
$(mkinstalldirs) $(DESTDIR)$(nlsdir)
chmod 755 $(DESTDIR)$(nlsdir)
$(mkinstalldirs) $(DESTDIR)$(localedir)
for n in $(CATALOGS) __DuMmY ; do \
if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
chmod 755 $(DESTDIR)$(nlsdir)/$$l; \
chmod 755 $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WINGs.mo; \
$(mkinstalldirs) $(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
fi; \
done
uninstall-local:
for n in $(CATALOGS) ; do \
l=`basename $$n .mo`; \
rm -f $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
done
# Create a 'silent rule' for our make check the same way automake does
AM_V_CHKTRANS = $(am__v_CHKTRANS_$(V))
am__v_CHKTRANS_ = $(am__v_CHKTRANS_$(AM_DEFAULT_VERBOSITY))
am__v_CHKTRANS_0 = @echo " CHK translations" ;
am__v_CHKTRANS_1 =
# 'make check' will make sure the tranlation sources are in line with the compiled source
check-local:
$(AM_V_CHKTRANS)$(top_srcdir)/script/check-translation-sources.sh \
"$(srcdir)" -s "$(top_srcdir)/WINGs/Makefile.am"
+2 -6
View File
@@ -1,9 +1,3 @@
Instructions for translating po files can be found in the po/README directory
in the top of the WindowMaker source tree.
All files are in UTF-8
File Language Note Current Maintainer
------------------------------------------------------------------------------
ca.po Catalan Ernest Adrogué <eadrogue@gmx.net>
@@ -14,6 +8,8 @@ fr.po French Emmanuel Benoit <tseeker@neptune.fr>
sk.po Slovak Jan 'judas' Tomka <judas@linux.sk>
bg.po Bulgarian Anton Zinoviev <zinoviev@debian.org>
nl.po Dutch Alwin <translations@ziggo.nl>
fy.po Frisian Alwin <translations@ziggo.nl>
sr.po Serbian Strahinya Radich <sr@strahinja.org>
Notes
-----
+2 -1
View File
@@ -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"
@@ -545,7 +546,7 @@ msgstr "\"%s\" е директория."
#: ../../WINGs/wfilepanel.c:829
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Настъпи грешка при показване на \"%s\"."
#: ../../WINGs/wfilepanel.c:833
+2 -1
View File
@@ -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"
@@ -557,7 +558,7 @@ msgstr "\"%s\" és un directori."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "S'ha produït un error mentre s'explorava \"%s\"."
#: ../../WINGs/wfilepanel.c:836
+6 -5
View File
@@ -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"
@@ -22,8 +23,8 @@ msgid "Bad address-service-protocol combination"
msgstr "Nesprávná kombinace adresa-služba-protokol"
#: ../../WINGs/dragsource.c:541
msgid "DND selection lost during drag operation..."
msgstr "DND výběr se ztratil během opere táhnutí..."
msgid "XDND selection lost during drag operation..."
msgstr "XDND výběr se ztratil během opere táhnutí..."
#: ../../WINGs/dragsource.c:610
#, c-format
@@ -31,8 +32,8 @@ msgid "drag & drop timed out while waiting for response from 0x%x\n"
msgstr "čas pro drag & drop vypršel během čekání na odpoveď z 0x%x\n"
#: ../../WINGs/dragsource.c:728
msgid "could not get ownership or DND selection"
msgstr "nemožné získat vlastnictví nebo DND výběr"
msgid "could not get ownership of XDND selection"
msgstr "nemožné získat vlastnictví nebo XDND výběr"
#: ../../WINGs/dragsource.c:898
#, c-format
@@ -489,7 +490,7 @@ msgstr "'%s' je adresář."
#: ../../WINGs/wfilepanel.c:821
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Při prohlížení '%s' nastala chyba."
#: ../../WINGs/wfilepanel.c:825
+4 -3
View File
@@ -3,10 +3,10 @@
#
# Initial translation
# Gudio Scholz <guido.scholz@bayernline.de>
#
#
# Adapted to versions 0.80 ff.
# Torsten Marek <shlomme@gmx.net>
#
#
msgid ""
msgstr ""
@@ -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"
@@ -553,7 +554,7 @@ msgstr "'%s' ist ein Verzeichnis."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Fehler beim Lesen von '%s'."
#: ../../WINGs/wfilepanel.c:836
+2 -1
View File
@@ -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"
@@ -559,7 +560,7 @@ msgstr "'%s' est un répertoire."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Une erreur s'est produite pendant le parcours de '%s'."
#: ../../WINGs/wfilepanel.c:836
+835
View File
@@ -0,0 +1,835 @@
# Translation into Western Frisian for Window Maker
# Copyright (C) 2015-2019 Window Maker Developers Team
# This file is distributed under the same license as the windowmaker package.
# Original by Alwin <translations@ziggo.nl>, 2015.
#
msgid ""
msgstr ""
"Project-Id-Version: wmaker-0.95.7+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-21 16:19+0100\n"
"PO-Revision-Date: 2016-01-21 00:00+0000\n"
"Last-Translator: Alwin <translations@ziggo.nl>\n"
"Language-Team: Western Frisian\n"
"Language: fy\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../WINGs/error.c:106
msgid "fatal: "
msgstr "ûnwerstelber: "
#: ../../WINGs/error.c:112
msgid "error: "
msgstr "flater: "
#: ../../WINGs/error.c:118
msgid "warning: "
msgstr "warskôging: "
#: ../../WINGs/findfile.c:63
#, c-format
msgid "could not get password entry for UID %i"
msgstr "koe accountgegevens foar UID %i net krije"
#: ../../WINGs/findfile.c:93
#, c-format
msgid "could not get password entry for user %s"
msgstr "koe accountgegevens foar brûker %s net krije"
#: ../../WINGs/findfile.c:212
#, c-format
msgid "could not expand %s"
msgstr "koe %s net útwurkje"
#: ../../WINGs/findfile.c:441
#, c-format
msgid "Could not open input file \"%s\": %s"
msgstr "Koe ynfierbestân \"%s\" net iepenje: %s"
#: ../../WINGs/findfile.c:457
#, c-format
msgid "Could not create target file \"%s\": %s"
msgstr "Koe doelbestân \"%s\" net oanmeitsje: %s"
#: ../../WINGs/findfile.c:465
msgid "could not allocate memory for the copy buffer"
msgstr "koe ûnthâld foar de kopybuffer net tawize"
#: ../../WINGs/findfile.c:482
#, c-format
msgid "could not read from file \"%s\": %s"
msgstr "koe bestân \"%s\" net ynlêze: %s"
#: ../../WINGs/findfile.c:497
#, c-format
msgid "could not write data to file \"%s\": %s"
msgstr "koe gjin data skriuwe nei bestân \"%s\": %s"
#: ../../WINGs/findfile.c:509
#, c-format
msgid "could not set permission 0%03o on file \"%s\": %s"
msgstr "koe tastimming 0%03o net ynstelle op bestân \"%s\": %s"
#: ../../WINGs/findfile.c:513
#, c-format
msgid "could not close the file \"%s\": %s"
msgstr "koe bestân \"%s\" net ôfslute: %s"
#: ../../WINGs/menuparser.c:110
#, c-format
msgid " included from file \"%s\" at line %d"
msgstr " ynfoege út bestân \"%s\" op rigel %d"
#: ../../WINGs/menuparser.c:142
#, c-format
msgid "missing #endif to match #%s at line %d"
msgstr "ûntbrekkende #endif behearrend by #%s op rigel %d"
#: ../../WINGs/menuparser.c:200
msgid "multiple SHORTCUT definition not valid"
msgstr "meartallige SHORTCUT-bepalingen net jildich"
#: ../../WINGs/menuparser.c:253
msgid "premature end of file while expecting a new line after '\\'"
msgstr "foartidich bestânsein, ferwachte in nije rigel nei '\\'"
#: ../../WINGs/menuparser.c:279
#, c-format
msgid "reached end of file while searching '*/' for comment started at line %d"
msgstr ""
"bestânsein berikt by sykjen nei '*/' foar kommentaar begûnen op rigel %d"
#: ../../WINGs/menuparser.c:344
msgid "missing closing double-quote before end-of-line"
msgstr "ûntbrekkend slutend dûbeld oanhelteken foar rigelein"
#: ../../WINGs/menuparser.c:362
msgid "missing closing simple-quote before end-of-line"
msgstr "ûntbrekkend slutend inkeld oanhelteken foar rigelein"
#: ../../WINGs/menuparser.c:380
msgid "too many nested macro expansions, breaking loop"
msgstr "te folle neske makro-útwurkingen, syklus ôfbrutsen"
#: ../../WINGs/menuparser.c:439
#, c-format
msgid "unknown directive '#%s'"
msgstr "ûnbekende oanwizing '#%s'"
#: ../../WINGs/menuparser.c:444
#, c-format
msgid "extra text after '#' command is ignored: \"%.16s...\""
msgstr "ekstra tekst nei #-kommando wurdt negearre: \"%.16s...\""
#: ../../WINGs/menuparser.c:459
msgid "no file name found for #include"
msgstr "gjin bestânsnamme fûn foar #include"
#: ../../WINGs/menuparser.c:471
msgid "file name must be enclosed in brackets or double-quotes for #define"
msgstr ""
"bestânsnamme moat omsletten wurde mei heakjes of dûbelde oanheltekens foar "
"#define"
#: ../../WINGs/menuparser.c:485
#, c-format
msgid "missing closing '%c' in filename specification"
msgstr "ûntbrekkende slutende '%c' yn bestânsnammeopjefte"
#: ../../WINGs/menuparser.c:503
msgid "too many nested #include's"
msgstr "te folle neske #include's"
#: ../../WINGs/menuparser.c:568
#, c-format
msgid "could not find file \"%s\" for #include"
msgstr "koe bestân \"%s\" net fine foar #include"
#: ../../WINGs/menuparser.c:589
#, c-format
msgid "missing macro name argument to #%s"
msgstr "ûntbrekkend makronamme-argumint by #%s"
#: ../../WINGs/menuparser.c:600
msgid "too many nested #if sequences"
msgstr "te folle neske #if-rigen"
#: ../../WINGs/menuparser.c:626 ../../WINGs/menuparser.c:643
#, c-format
msgid "found #%s but has no matching #if"
msgstr "#%s fûn, mar hat gjin bybehearrende #if"
#: ../../WINGs/menuparser_macros.c:166
msgid "no macro name found for #define"
msgstr "gjin makronamme fûn foar #define"
#: ../../WINGs/menuparser_macros.c:187
#, c-format
msgid "premature end of file while reading arg-list for macro \"%s\""
msgstr "foartidich bestânsein by ynlêzen arg.-list foar makro \"%s\""
#: ../../WINGs/menuparser_macros.c:194
#, c-format
msgid "too many parameters for macro \"%s\" definition"
msgstr "te folle parameters foar bepaling makro \"%s\""
#: ../../WINGs/menuparser_macros.c:209
#, c-format
msgid ""
"invalid character '%c' in arg-list for macro \"%s\" while expecting "
"parameter name"
msgstr ""
"ûnjildich letterteken '%c' yn arg.-list foar makro \"%s\", ferwachte "
"parameternamme"
#: ../../WINGs/menuparser_macros.c:220
#, c-format
msgid ""
"invalid character '%c' in arg-list for macro \"%s\" while expecting ',' or "
"')'"
msgstr ""
"ûnjildich letterteken '%c' yn arg.-list foar makro \"%s\", ferwachte ',' of "
"')'"
#: ../../WINGs/menuparser_macros.c:253
#, c-format
msgid "macro \"%s\" already defined, ignoring redefinition"
msgstr "makro \"%s\" al definiearre, negearret werdefiniearjen"
#: ../../WINGs/menuparser_macros.c:346
#, c-format
msgid "more content than supported for the macro \"%s\""
msgstr "mear ynhâld as stipe foar makro \"%s\""
#: ../../WINGs/menuparser_macros.c:455
#, c-format
msgid "expansion for macro \"%s\" too big, line truncated"
msgstr "útwurking foar makro \"%s\" te grut, rigel ynkoarte"
#: ../../WINGs/menuparser_macros.c:467
#, c-format
msgid "macro \"%s\" needs parenthesis for arguments"
msgstr "makro \"%s\" hat heakjes nedich foar arguminten"
#: ../../WINGs/menuparser_macros.c:498
msgid "missing closing quote or double-quote before end-of-line"
msgstr "ûntbrekkend slutend of dûbeld oanhelteken foar rigelein"
#: ../../WINGs/menuparser_macros.c:521
#, c-format
msgid "too many arguments for macro \"%s\", expected only %d"
msgstr "te folle arguminten foar makro \"%s\", ferwachte allinnich %d"
#: ../../WINGs/menuparser_macros.c:530
#, c-format
msgid "premature end of line while searching for arguments to macro \"%s\""
msgstr "foartidich rigelein by sykjen nei arguminten by makro \"%s\""
#: ../../WINGs/menuparser_macros.c:536
#, c-format
msgid "not enough arguments for macro \"%s\", expected %d but got only %d"
msgstr ""
"ûnfoldwaande arguminten foar makro \"%s\", ferwachte %d, mar krige allinnich "
"%d"
#: ../../WINGs/menuparser_macros.c:541
#, c-format
msgid "too much data in parameter list of macro \"%s\", truncated"
msgstr "te folle data yn parameterlist fan makro \"%s\", ynkoarte"
#: ../../WINGs/menuparser_macros.c:561
#, c-format
msgid "size of value for macro '%s' is too big, truncated"
msgstr "wearde foar makro '%s' is te lang, ynkoarte"
#: ../../WINGs/menuparser_macros.c:642 ../../WINGs/menuparser_macros.c:668
#, c-format
msgid "could not determine %s"
msgstr "koe %s net fêststelle"
#: ../../WINGs/proplist.c:78
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "syntaksflater yn %s %s, rigel %i: %s"
#: ../../WINGs/proplist.c:134
msgid "Only string or data is supported for a proplist dictionary key"
msgstr ""
#: ../../WINGs/proplist.c:167 ../../WINGs/proplist.c:217
#: ../../WINGs/proplist.c:382 ../../WINGs/proplist.c:458
#: ../../WINGs/proplist.c:1048 ../../WINGs/proplist.c:1098
#: ../../WINGs/proplist.c:1246 ../../WINGs/proplist.c:1314
#: ../../WINGs/proplist.c:1419 ../../WINGs/proplist.c:1463
msgid "Used proplist functions on non-WMPropLists objects"
msgstr ""
#: ../../WINGs/proplist.c:635
msgid "unterminated PropList string"
msgstr ""
#: ../../WINGs/proplist.c:673
msgid "unterminated PropList data"
msgstr ""
#: ../../WINGs/proplist.c:681
msgid "unterminated PropList data (missing hexdigit)"
msgstr ""
#: ../../WINGs/proplist.c:693 ../../WINGs/proplist.c:698
msgid "non hexdigit character in PropList data"
msgstr ""
#: ../../WINGs/proplist.c:730
msgid "unterminated PropList array"
msgstr ""
#: ../../WINGs/proplist.c:738
msgid "missing or unterminated PropList array"
msgstr ""
#: ../../WINGs/proplist.c:748
msgid "could not get PropList array element"
msgstr ""
#: ../../WINGs/proplist.c:775
msgid "unterminated PropList dictionary"
msgstr ""
#: ../../WINGs/proplist.c:792
msgid "missing PropList dictionary key"
msgstr ""
#: ../../WINGs/proplist.c:794
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr ""
#: ../../WINGs/proplist.c:802
msgid "error parsing PropList dictionary key"
msgstr ""
#: ../../WINGs/proplist.c:810
msgid "missing = in PropList dictionary entry"
msgstr ""
#: ../../WINGs/proplist.c:818
msgid "error parsing PropList dictionary entry value"
msgstr ""
#: ../../WINGs/proplist.c:826
msgid "missing ; in PropList dictionary entry"
msgstr ""
#: ../../WINGs/proplist.c:885
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr ""
#: ../../WINGs/proplist.c:888
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Kommentaar is net tastean binnen domeinbestannen fan WindowMaker."
#: ../../WINGs/proplist.c:1483 ../../WINGs/proplist.c:1548
#: ../../WINGs/proplist.c:1612
msgid "extra data after end of property list"
msgstr "ekstra data nei ein fan 'property list'"
#: ../../WINGs/proplist.c:1523
#, c-format
msgid "could not get size for file '%s'"
msgstr "koe grutte foar bestân '%s' net krije"
#: ../../WINGs/proplist.c:1531
#, c-format
msgid "error reading from file '%s'"
msgstr "flater by ynlêzen bestân '%s'"
#: ../../WINGs/proplist.c:1578
#, c-format
msgid "%s:could not open menu file"
msgstr "%s:koe menubestân net iepenje"
#: ../../WINGs/proplist.c:1660
#, c-format
msgid "mkstemp (%s) failed"
msgstr "oanmeitsjen unyk tydlik bestân (%s) mislearre"
#: ../../WINGs/proplist.c:1670
#, c-format
msgid "mktemp (%s) failed"
msgstr "oanmeitsjen tydlik bestân (%s) mislearre"
#: ../../WINGs/proplist.c:1677
#, c-format
msgid "open (%s) failed"
msgstr "iepenjen (%s) mislearre"
#: ../../WINGs/proplist.c:1684
#, c-format
msgid "writing to file: %s failed"
msgstr "skriuwen nei bestân: %s mislearre"
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "fclose (%s) failed"
msgstr "ôfsluten stream (%s) mislearre"
#: ../../WINGs/proplist.c:1701
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "omneamen ('%s' nei '%s') mislearre"
#: ../../WINGs/proplist.c:1772
#, c-format
msgid "Could not create component %s"
msgstr "Koe komponint %s net oanmeitsje"
#: ../../WINGs/userdefaults.c:72
msgid "variable WMAKER_USER_ROOT defined with invalid path, not used"
msgstr "fariabele WMAKER_USER_ROOT, definiearre mei ûnjildich paad, net brûkt"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:210 ../../WINGs/userdefaults.c:225
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "kin domeinbestân '%s' net ynlêze by syngronisearjen"
#: ../../WINGs/dragcommon.c:60
#, c-format
msgid "unknown XDND action %s"
msgstr "ûnbekende XDND-aksje %s"
#: ../../WINGs/dragcommon.c:142
#, c-format
msgid "target %lu for XDND message no longer exists"
msgstr "doel %lu foar XDND-berjocht bestiet net mear"
#: ../../WINGs/dragcommon.c:220
#, c-format
msgid "unsupported version %i for XDND enter message"
msgstr "net-stipe ferzje %i foar XDND-berjocht by binnen gean"
#: ../../WINGs/dragsource.c:163
msgid "XDND selection lost during drag operation..."
msgstr "XDND-seleksje ferlern ûnder fersleephanneling..."
#: ../../WINGs/dragsource.c:758
msgid "could not get XDND version for target of drop"
msgstr "koe XDND-ferzje net krije foar doel fan ferslepen"
#: ../../WINGs/dragsource.c:774
msgid "could not get ownership of XDND selection"
msgstr "koe eigendom fan XDND-seleksje net krije"
#: ../../WINGs/dragsource.c:1070
msgid "delay for drag destination response expired"
msgstr "wachttiid foar antwurd fersleepbestimming ferstrutsen"
#: ../../WINGs/wcolor.c:204 ../../WINGs/wcolor.c:214 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:288
#, c-format
msgid "could not allocate %s color"
msgstr "koe kleur %s net tawize"
#: ../../WINGs/wcolor.c:204
msgid "white"
msgstr "wyt"
#: ../../WINGs/wcolor.c:214
msgid "black"
msgstr "swart"
#: ../../WINGs/wcolor.c:250
msgid "gray"
msgstr "griis"
#: ../../WINGs/wcolor.c:288
msgid "dark gray"
msgstr "donkergriis"
#: ../../WINGs/wcolorpanel.c:393
msgid "Colors"
msgstr "Kleuren"
#: ../../WINGs/wcolorpanel.c:568 ../../WINGs/wcolorpanel.c:2720
msgid "Brightness"
msgstr "Helderens"
#: ../../WINGs/wcolorpanel.c:570 ../../WINGs/wcolorpanel.c:644
#: ../../WINGs/wcolorpanel.c:675 ../../WINGs/wcolorpanel.c:706
#: ../../WINGs/wcolorpanel.c:781 ../../WINGs/wcolorpanel.c:812
#: ../../WINGs/wcolorpanel.c:844 ../../WINGs/wcolorpanel.c:877
#: ../../WINGs/wcolorpanel.c:2016 ../../WINGs/wcolorpanel.c:2722
#: ../../WINGs/wcolorpanel.c:2756 ../../WINGs/wcolorpanel.c:2790
msgid "Color Panel: Could not allocate memory"
msgstr "Kleurepaniel: Koe gjin ûnthâld tawize"
#: ../../WINGs/wcolorpanel.c:642
msgid "Red"
msgstr "Read"
#: ../../WINGs/wcolorpanel.c:673
msgid "Green"
msgstr "Grien"
#: ../../WINGs/wcolorpanel.c:704
msgid "Blue"
msgstr "Blau"
#: ../../WINGs/wcolorpanel.c:718
msgid "Decimal"
msgstr "Desimaal"
#: ../../WINGs/wcolorpanel.c:726
msgid "Hexadecimal"
msgstr "Heksadesimaal"
#: ../../WINGs/wcolorpanel.c:779
msgid "Cyan"
msgstr "Cyaan"
#: ../../WINGs/wcolorpanel.c:810
msgid "Magenta"
msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:842
msgid "Yellow"
msgstr "Giel"
#: ../../WINGs/wcolorpanel.c:875
msgid "Black"
msgstr "Swart"
#: ../../WINGs/wcolorpanel.c:950
msgid "Spectrum"
msgstr "Spektrum"
#: ../../WINGs/wcolorpanel.c:976
msgid "Palette"
msgstr "Palet"
#: ../../WINGs/wcolorpanel.c:981
msgid "New from File..."
msgstr "Nij út bestân..."
#: ../../WINGs/wcolorpanel.c:982 ../../WINGs/wcolorpanel.c:1027
#: ../../WINGs/wcolorpanel.c:1042
msgid "Rename..."
msgstr "Omneame..."
#: ../../WINGs/wcolorpanel.c:983 ../../WINGs/wcolorpanel.c:1028
#: ../../WINGs/wcolorpanel.c:1043 ../../WINGs/wcolorpanel.c:3180
msgid "Remove"
msgstr "Ferwiderje"
#: ../../WINGs/wcolorpanel.c:984
msgid "Copy"
msgstr "Kopiearje"
#: ../../WINGs/wcolorpanel.c:985
msgid "New from Clipboard"
msgstr "Nij fan klamboerd"
#: ../../WINGs/wcolorpanel.c:1004
msgid "X11-Colors"
msgstr "X11-kleuren"
#: ../../WINGs/wcolorpanel.c:1021
msgid "Color"
msgstr "Kleur"
#: ../../WINGs/wcolorpanel.c:1026
msgid "Add..."
msgstr "Tafoegje..."
#: ../../WINGs/wcolorpanel.c:1036
msgid "List"
msgstr "List"
#: ../../WINGs/wcolorpanel.c:1041
msgid "New..."
msgstr "Nij..."
#: ../../WINGs/wcolorpanel.c:1170
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Kleurepaniel: Koe map %s, nedich om ynstellingen te bewarjen, net oanmeitsje"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1176 ../../WINGs/wcolorpanel.c:3073
#: ../../WINGs/wcolorpanel.c:3077
msgid "File Error"
msgstr "Bestânsflater"
#: ../../WINGs/wcolorpanel.c:1177
msgid "Could not create ColorPanel configuration directory"
msgstr "Koe ynstellingemap Kleurepaniel net oanmeitsje"
#: ../../WINGs/wcolorpanel.c:1178 ../../WINGs/wcolorpanel.c:3074
#: ../../WINGs/wcolorpanel.c:3079 ../../WINGs/wcolorpanel.c:3104
#: ../../WINGs/wfilepanel.c:227 ../../WINGs/wfilepanel.c:596
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
#: ../../WINGs/wfilepanel.c:883 ../../WINGs/wfontpanel.c:532
msgid "OK"
msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1184
msgid "Color Panel: Could not find file"
msgstr "Kleurepaniel: Koe bestân net fine"
#: ../../WINGs/wcolorpanel.c:1380 ../../WINGs/wcolorpanel.c:1441
#: ../../WINGs/wcolorpanel.c:1501
msgid "Color Panel: X failed request"
msgstr "Kleurepaniel: X-oanfraach mislearre"
#: ../../WINGs/wcolorpanel.c:2754
msgid "Saturation"
msgstr "Fersêding"
#: ../../WINGs/wcolorpanel.c:2788
msgid "Hue"
msgstr "Tint"
#: ../../WINGs/wcolorpanel.c:3012
msgid "Open Palette"
msgstr "Iepenje palet"
#: ../../WINGs/wcolorpanel.c:3074
msgid "Invalid file format !"
msgstr "Unjildige bestânsfoarm!"
#: ../../WINGs/wcolorpanel.c:3076
#, c-format
msgid "can't remove file %s"
msgstr "kin bestân %s net ferwiderje"
#: ../../WINGs/wcolorpanel.c:3078
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Koe bestân net ferwiderje út ynstellingemap!"
#: ../../WINGs/wcolorpanel.c:3103
msgid "Rename"
msgstr "Omneame"
#: ../../WINGs/wcolorpanel.c:3103
msgid "Rename palette to:"
msgstr "Neam palet om nei:"
#: ../../WINGs/wcolorpanel.c:3104 ../../WINGs/wfilepanel.c:236
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
msgid "Cancel"
msgstr "Annulearje"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3120 ../../WINGs/wfilepanel.c:715
msgid "Warning"
msgstr "Warskôging"
#: ../../WINGs/wcolorpanel.c:3121
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Palet bestiet al!\n"
"\n"
"Oerskriuwe?"
#: ../../WINGs/wcolorpanel.c:3121 ../../WINGs/wcolorpanel.c:3180
msgid "No"
msgstr "Nee"
#: ../../WINGs/wcolorpanel.c:3121 ../../WINGs/wcolorpanel.c:3180
msgid "Yes"
msgstr "Ja"
#: ../../WINGs/wcolorpanel.c:3152
#, c-format
msgid "Couldn't rename palette %s to %s"
msgstr "Koe palet %s net omneame nei %s"
#: ../../WINGs/wcolorpanel.c:3175
msgid "This will permanently remove the palette "
msgstr "Dit sil it palet "
#: ../../WINGs/wcolorpanel.c:3177
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
" definityf ferwiderje.\n"
"\n"
"Binne jo wis dat jo dit palet ferwiderje wolle?"
#: ../../WINGs/wcolorpanel.c:3199
#, c-format
msgid "Couldn't remove palette %s"
msgstr "Koe palet %s net ferwiderje"
#: ../../WINGs/wcolorpanel.c:3499
msgid "Color Panel: Color unspecified"
msgstr "Kleurepaniel: Kleur net opjûn"
#: ../../WINGs/wfilepanel.c:216
msgid "Name:"
msgstr "Namme:"
#: ../../WINGs/wfilepanel.c:306 ../../WINGs/wfilepanel.c:364
msgid "Open"
msgstr "Iepenje"
#: ../../WINGs/wfilepanel.c:322 ../../WINGs/wfilepanel.c:370
msgid "Save"
msgstr "Bewarje"
#: ../../WINGs/wfilepanel.c:506
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: Koe map %s net iepenje\n"
#: ../../WINGs/wfilepanel.c:526
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: Koe status %s net fêststelle\n"
#: ../../WINGs/wfilepanel.c:596 ../../WINGs/wfilepanel.c:883
#: ../../WINGs/wfontpanel.c:531
msgid "Error"
msgstr "Flater"
#: ../../WINGs/wfilepanel.c:610
msgid "Create Directory"
msgstr "Map oanmeitsje"
#: ../../WINGs/wfilepanel.c:611
msgid "Enter directory name"
msgstr "Fier mapnamme yn"
#: ../../WINGs/wfilepanel.c:639
#, c-format
msgid "Can not create %s: %s"
msgstr "Kin %s net oanmeitsje: %s"
#: ../../WINGs/wfilepanel.c:705
#, c-format
msgid "Can not find %s: %s"
msgstr "Kin %s net fine: %s"
#: ../../WINGs/wfilepanel.c:711
#, c-format
msgid "Delete %s %s?"
msgstr "%s %s ferwiderje?"
#: ../../WINGs/wfilepanel.c:712
msgid "directory"
msgstr "Map"
#: ../../WINGs/wfilepanel.c:712
msgid "file"
msgstr "Bestân"
#: ../../WINGs/wfilepanel.c:719
#, c-format
msgid "Removing %s failed: %s"
msgstr "Ferwiderjen %s mislearre: %s"
#: ../../WINGs/wfilepanel.c:751
#, c-format
msgid "An error occurred browsing '%s'."
msgstr "Der trede in flater op by blêdzjen troch '%s'."
#: ../../WINGs/wfilepanel.c:754
#, c-format
msgid "'%s' is not a directory."
msgstr "'%s' is gjin map."
#: ../../WINGs/wfilepanel.c:883
msgid "File does not exist."
msgstr "Bestân bestiet net."
#: ../../WINGs/wfont.c:43
#, c-format
msgid "invalid font: %s. Trying '%s'"
msgstr "ûnjildich lettertype: %s. Probearret '%s'"
#: ../../WINGs/wfont.c:260 ../../WINGs/wfont.c:278
#, c-format
msgid "could not load font: %s."
msgstr "koe lettertype net lade: %s."
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
#: ../../WINGs/wfontpanel.c:184
msgid "Font Panel"
msgstr "Lettertypen"
#: ../../WINGs/wfontpanel.c:220
msgid "The quick brown fox jumps over the lazy dog"
msgstr "De rappe brune foks springt oer de loaie hûn"
#: ../../WINGs/wfontpanel.c:226
msgid "Family"
msgstr "Famylje"
#: ../../WINGs/wfontpanel.c:237
msgid "Typeface"
msgstr "Lettertype"
#: ../../WINGs/wfontpanel.c:248
msgid "Size"
msgstr "Grutte"
#: ../../WINGs/wfontpanel.c:267
msgid "Set"
msgstr "Ynstelle"
#: ../../WINGs/wfontpanel.c:273
msgid "Revert"
msgstr "Werstelle"
#: ../../WINGs/wfontpanel.c:532
msgid "Could not init font config library\n"
msgstr "Koe biblioteek 'lettertype ynstelle' net inisjalisearje\n"
#: ../../WINGs/widgets.c:446
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: Koe ôfbyldingebestân bestjoeringseleminten net lade: %s"
#: ../../WINGs/widgets.c:542
#, c-format
msgid "WINGs: could not open display %s"
msgstr "WINGs: Koe skerm %s net iepenje"
#: ../../WINGs/widgets.c:771
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr ""
"koe gjin lettertypen lade. Soargje derfoar dat jo ynstallearre lettertypen "
"en lokalisaasjeynstellingen korrekt binne."
#: ../../WINGs/winputmethod.c:65
msgid "could not add destroy callback for XIM input method"
msgstr ""
#: ../../WINGs/wruler.c:175
msgid "0 inches"
msgstr "0 inch"
#: ../../WINGs/wtextfield.c:494
msgid "only left alignment is supported in textfields"
msgstr "allinnich lofts rjochtsjen wurdt stipe yn tekstfjilden"
#: ../../WINGs/wwindow.c:160
msgid "window title conversion error... using STRING encoding"
msgstr "finstertitelomsettingsflater... brûkt STRING-kodearring"
#: ../../WINGs/wwindow.c:181
msgid "icon title conversion error... using STRING encoding"
msgstr "ikoantitelomsettingsflater... brûkt STRING-kodearring"
+4 -4
View File
@@ -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"
@@ -197,8 +197,8 @@ msgid "Could not create component %s"
msgstr "Nem sikerült létrehozni a %s elemet"
#: ../../../wmaker-crm/WINGs/userdefaults.c:65
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
msgstr "A GNUSTEP_USER_ROOT változó be van állítva, de rossz értékre. Nem használom"
msgid "variable WMAKER_USER_ROOT defined with invalid path, not used"
msgstr "A WMAKER_USER_ROOT változó be van állítva, de rossz értékre. Nem használom"
#. something happened with the file. just overwrite it
#: ../../../wmaker-crm/WINGs/userdefaults.c:196
@@ -537,7 +537,7 @@ msgstr "Hiba \"%s\" törlésekor: %s"
#: ../../../wmaker-crm/WINGs/wfilepanel.c:749
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Hiba történt a '%s' olvasásakor."
#: ../../../wmaker-crm/WINGs/wfilepanel.c:752
+395 -106
View File
@@ -1,14 +1,14 @@
# New translation into Dutch for Window Maker
# Copyright (C) 2014 Window Maker Developers Team
# Copyright (C) 2014-2019 Window Maker Developers Team
# This file is distributed under the same license as the windowmaker package.
# Original by Alwin <translations@ziggo.nl>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: wmaker-0.95.5-473-gb431dcc3\n"
"Project-Id-Version: wmaker-0.95.6+\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-20 10:55+0200\n"
"PO-Revision-Date: 2014-06-20 00:00+0200\n"
"POT-Creation-Date: 2015-05-18 08:07+0200\n"
"PO-Revision-Date: 2015-05-18 00:00+0000\n"
"Last-Translator: Alwin <translations@ziggo.nl>\n"
"Language-Team: Dutch\n"
"Language: nl\n"
@@ -28,30 +28,226 @@ msgstr "fout: "
msgid "warning: "
msgstr "waarschuwing: "
#: ../../WINGs/findfile.c:61
#: ../../WINGs/findfile.c:63
#, c-format
msgid "could not get password entry for UID %i"
msgstr "kon accountgegevens voor UID %i niet krijgen"
#: ../../WINGs/findfile.c:91
#: ../../WINGs/findfile.c:93
#, c-format
msgid "could not get password entry for user %s"
msgstr "kon accountgegevens voor gebruiker %s niet krijgen"
#: ../../WINGs/findfile.c:210
#: ../../WINGs/findfile.c:212
#, c-format
msgid "could not expand %s"
msgstr "kon %s niet uitwerken"
#: ../../WINGs/findfile.c:444
#: ../../WINGs/findfile.c:441
#, c-format
msgid "Could not open input file \"%s\""
msgstr "Kon invoerbestand \"%s\" niet openen"
msgid "Could not open input file \"%s\": %s"
msgstr "Kon invoerbestand \"%s\" niet openen: %s"
#: ../../WINGs/findfile.c:453
#: ../../WINGs/findfile.c:457
#, c-format
msgid "Could not create target file \"%s\""
msgstr "Kon doelbestand \"%s\" niet aanmaken"
msgid "Could not create target file \"%s\": %s"
msgstr "Kon doelbestand \"%s\" niet aanmaken: %s"
#: ../../WINGs/findfile.c:465
msgid "could not allocate memory for the copy buffer"
msgstr "kon geheugen voor de kopiebuffer niet toewijzen"
#: ../../WINGs/findfile.c:482
#, c-format
msgid "could not read from file \"%s\": %s"
msgstr "kon bestand \"%s\" niet inlezen: %s"
#: ../../WINGs/findfile.c:497
#, c-format
msgid "could not write data to file \"%s\": %s"
msgstr "kon geen data schrijven naar bestand \"%s\": %s"
#: ../../WINGs/findfile.c:509
#, c-format
msgid "could not set permission 0%03o on file \"%s\": %s"
msgstr "kon toestemming 0%03o niet instellen op bestand \"%s\": %s"
#: ../../WINGs/findfile.c:513
#, c-format
msgid "could not close the file \"%s\": %s"
msgstr "kon bestand \"%s\" niet afsluiten: %s"
#: ../../WINGs/menuparser.c:110
#, c-format
msgid " included from file \"%s\" at line %d"
msgstr " ingevoegd uit bestand \"%s\" op regel %d"
#: ../../WINGs/menuparser.c:142
#, c-format
msgid "missing #endif to match #%s at line %d"
msgstr "ontbrekende #endif behorend bij #%s op regel %d"
#: ../../WINGs/menuparser.c:200
msgid "multiple SHORTCUT definition not valid"
msgstr "meervoudige SHORTCUT-bepalingen niet geldig"
#: ../../WINGs/menuparser.c:253
msgid "premature end of file while expecting a new line after '\\'"
msgstr "voortijdig bestandseinde, verwachtte 'n nieuwe regel na '\\'"
#: ../../WINGs/menuparser.c:279
#, c-format
msgid "reached end of file while searching '*/' for comment started at line %d"
msgstr ""
"bestandseinde bereikt bij zoeken naar '*/' voor commentaar begonnen op regel "
"%d"
#: ../../WINGs/menuparser.c:344
msgid "missing closing double-quote before end-of-line"
msgstr "ontbrekend sluitend dubbel aanhalingsteken voor regeleinde"
#: ../../WINGs/menuparser.c:362
msgid "missing closing simple-quote before end-of-line"
msgstr "ontbrekend sluitend enkel aanhalingsteken voor regeleinde"
#: ../../WINGs/menuparser.c:380
msgid "too many nested macro expansions, breaking loop"
msgstr "te veel geneste macro-uitwerkingen, cyclus afgebroken"
#: ../../WINGs/menuparser.c:439
#, c-format
msgid "unknown directive '#%s'"
msgstr "onbekende aanwijzing '#%s'"
#: ../../WINGs/menuparser.c:444
#, c-format
msgid "extra text after '#' command is ignored: \"%.16s...\""
msgstr "extra tekst na #-commando wordt genegeerd: \"%.16s...\""
#: ../../WINGs/menuparser.c:459
msgid "no file name found for #include"
msgstr "geen bestandsnaam gevonden voor #include"
#: ../../WINGs/menuparser.c:471
msgid "file name must be enclosed in brackets or double-quotes for #define"
msgstr ""
"bestandsnaam moet omsloten worden met haakjes of dubbele aanhalingstekens "
"voor #define"
#: ../../WINGs/menuparser.c:485
#, c-format
msgid "missing closing '%c' in filename specification"
msgstr "ontbrekende sluitende '%c' in bestandsnaamopgave"
#: ../../WINGs/menuparser.c:503
msgid "too many nested #include's"
msgstr "te veel geneste #include's"
#: ../../WINGs/menuparser.c:568
#, c-format
msgid "could not find file \"%s\" for #include"
msgstr "kon bestand \"%s\" niet vinden voor #include"
#: ../../WINGs/menuparser.c:589
#, c-format
msgid "missing macro name argument to #%s"
msgstr "ontbrekend macronaamargument bij #%s"
#: ../../WINGs/menuparser.c:600
msgid "too many nested #if sequences"
msgstr "te veel geneste #if-reeksen"
#: ../../WINGs/menuparser.c:626 ../../WINGs/menuparser.c:643
#, c-format
msgid "found #%s but has no matching #if"
msgstr "#%s gevonden, maar heeft geen bijbehorende #if"
#: ../../WINGs/menuparser_macros.c:166
msgid "no macro name found for #define"
msgstr "geen macronaam gevonden voor #define"
#: ../../WINGs/menuparser_macros.c:187
#, c-format
msgid "premature end of file while reading arg-list for macro \"%s\""
msgstr "voortijdig bestandseinde bij inlezen arg.-lijst voor macro \"%s\""
#: ../../WINGs/menuparser_macros.c:194
#, c-format
msgid "too many parameters for macro \"%s\" definition"
msgstr "te veel parameters voor bepaling macro \"%s\""
#: ../../WINGs/menuparser_macros.c:209
#, c-format
msgid ""
"invalid character '%c' in arg-list for macro \"%s\" while expecting "
"parameter name"
msgstr ""
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte "
"parameternaam"
#: ../../WINGs/menuparser_macros.c:220
#, c-format
msgid ""
"invalid character '%c' in arg-list for macro \"%s\" while expecting ',' or "
"')'"
msgstr ""
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte ',' of "
"')'"
#: ../../WINGs/menuparser_macros.c:253
#, c-format
msgid "macro \"%s\" already defined, ignoring redefinition"
msgstr "macro \"%s\" al gedefinieerd, negeert herdefiniëren"
#: ../../WINGs/menuparser_macros.c:346
#, c-format
msgid "more content than supported for the macro \"%s\""
msgstr "meer inhoud dan ondersteund voor macro \"%s\""
#: ../../WINGs/menuparser_macros.c:455
#, c-format
msgid "expansion for macro \"%s\" too big, line truncated"
msgstr "uitwerking voor macro \"%s\" te groot, regel ingekort"
#: ../../WINGs/menuparser_macros.c:467
#, c-format
msgid "macro \"%s\" needs parenthesis for arguments"
msgstr "macro \"%s\" heeft haakjes nodig voor argumenten"
#: ../../WINGs/menuparser_macros.c:498
msgid "missing closing quote or double-quote before end-of-line"
msgstr "ontbrekend sluitend of dubbel aanhalingsteken voor regeleinde"
#: ../../WINGs/menuparser_macros.c:521
#, c-format
msgid "too many arguments for macro \"%s\", expected only %d"
msgstr "te veel argumenten voor macro \"%s\", verwachtte alleen %d"
#: ../../WINGs/menuparser_macros.c:530
#, c-format
msgid "premature end of line while searching for arguments to macro \"%s\""
msgstr "voortijdig regeleinde bij zoeken naar argumenten bij macro \"%s\""
#: ../../WINGs/menuparser_macros.c:536
#, c-format
msgid "not enough arguments for macro \"%s\", expected %d but got only %d"
msgstr ""
"onvoldoende argumenten voor macro \"%s\", verwachtte %d, maar kreeg alleen %d"
#: ../../WINGs/menuparser_macros.c:541
#, c-format
msgid "too much data in parameter list of macro \"%s\", truncated"
msgstr "te veel data in parameterlijst van macro \"%s\", ingekort"
#: ../../WINGs/menuparser_macros.c:561
#, c-format
msgid "size of value for macro '%s' is too big, truncated"
msgstr "waarde voor macro '%s' is te lang, ingekort"
#: ../../WINGs/menuparser_macros.c:642 ../../WINGs/menuparser_macros.c:668
#, c-format
msgid "could not determine %s"
msgstr "kon %s niet vaststellen"
#: ../../WINGs/proplist.c:78
#, c-format
@@ -65,8 +261,8 @@ msgstr ""
#: ../../WINGs/proplist.c:167 ../../WINGs/proplist.c:217
#: ../../WINGs/proplist.c:382 ../../WINGs/proplist.c:458
#: ../../WINGs/proplist.c:1048 ../../WINGs/proplist.c:1098
#: ../../WINGs/proplist.c:1245 ../../WINGs/proplist.c:1313
#: ../../WINGs/proplist.c:1418 ../../WINGs/proplist.c:1462
#: ../../WINGs/proplist.c:1246 ../../WINGs/proplist.c:1314
#: ../../WINGs/proplist.c:1419 ../../WINGs/proplist.c:1463
msgid "Used proplist functions on non-WMPropLists objects"
msgstr ""
@@ -137,71 +333,102 @@ msgstr ""
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Commentaar is niet toegestaan binnen domeinbestanden van WindowMaker."
#: ../../WINGs/proplist.c:1482 ../../WINGs/proplist.c:1547
#: ../../WINGs/proplist.c:1604
#: ../../WINGs/proplist.c:1483 ../../WINGs/proplist.c:1548
#: ../../WINGs/proplist.c:1612
msgid "extra data after end of property list"
msgstr "extra data na einde van 'property list'"
#: ../../WINGs/proplist.c:1522
#: ../../WINGs/proplist.c:1523
#, c-format
msgid "could not get size for file '%s'"
msgstr "kon grootte voor bestand '%s' niet krijgen"
#: ../../WINGs/proplist.c:1530
#: ../../WINGs/proplist.c:1531
#, c-format
msgid "error reading from file '%s'"
msgstr "fout bij lezen uit bestand '%s'"
msgstr "fout bij inlezen bestand '%s'"
#: ../../WINGs/proplist.c:1575
#: ../../WINGs/proplist.c:1578
#, c-format
msgid "%s:could not open menu file"
msgstr "%s:kon menubestand niet openen"
#: ../../WINGs/proplist.c:1642
#: ../../WINGs/proplist.c:1660
#, c-format
msgid "mkstemp (%s) failed"
msgstr "aanmaken uniek tijdelijk bestand (%s) mislukt"
#: ../../WINGs/proplist.c:1653
#: ../../WINGs/proplist.c:1670
#, c-format
msgid "mktemp (%s) failed"
msgstr "aanmaken tijdelijk bestand (%s) mislukt"
#: ../../WINGs/proplist.c:1660
#: ../../WINGs/proplist.c:1677
#, c-format
msgid "open (%s) failed"
msgstr "openen (%s) mislukt"
#: ../../WINGs/proplist.c:1667
#: ../../WINGs/proplist.c:1684
#, c-format
msgid "writing to file: %s failed"
msgstr "schrijven naar bestand: %s mislukt"
#: ../../WINGs/proplist.c:1676
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "fclose (%s) failed"
msgstr "afsluiten stream (%s) mislukt"
#: ../../WINGs/proplist.c:1684
#: ../../WINGs/proplist.c:1701
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "hernoemen ('%s' naar '%s') mislukt"
#: ../../WINGs/proplist.c:1755
#: ../../WINGs/proplist.c:1772
#, c-format
msgid "Could not create component %s"
msgstr "Kon component %s niet aanmaken"
#: ../../WINGs/userdefaults.c:72
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
msgid "variable WMAKER_USER_ROOT defined with invalid path, not used"
msgstr ""
"variabele GNUSTEP_USER_ROOT, gedefinieerd met ongeldig pad, niet gebruikt"
"variabele WMAKER_USER_ROOT, gedefinieerd met ongeldig pad, niet gebruikt"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:210 ../../WINGs/userdefaults.c:225
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "kan domein niet lezen uit bestand '%s' bij synchroniseren"
msgstr "kan domeinbestand '%s' niet inlezen bij synchroniseren"
#: ../../WINGs/dragcommon.c:60
#, c-format
msgid "unknown XDND action %s"
msgstr "onbekende XDND-actie %s"
#: ../../WINGs/dragcommon.c:142
#, c-format
msgid "target %lu for XDND message no longer exists"
msgstr "doel %lu voor XDND-bericht bestaat niet meer"
#: ../../WINGs/dragcommon.c:220
#, c-format
msgid "unsupported version %i for XDND enter message"
msgstr "niet-ondersteunde versie %i voor XDND-bericht bij binnengaan"
#: ../../WINGs/dragsource.c:163
msgid "XDND selection lost during drag operation..."
msgstr "XDND-selectie verloren tijdens versleephandeling..."
#: ../../WINGs/dragsource.c:758
msgid "could not get XDND version for target of drop"
msgstr "kon XDND-versie niet krijgen voor doel van verslepen"
#: ../../WINGs/dragsource.c:774
msgid "could not get ownership of XDND selection"
msgstr "kon eigendom van XDND-selectie niet krijgen"
#: ../../WINGs/dragsource.c:1070
msgid "delay for drag destination response expired"
msgstr "wachttijd voor antwoord versleepbestemming verstreken"
#: ../../WINGs/wcolor.c:204 ../../WINGs/wcolor.c:214 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:288
@@ -225,102 +452,110 @@ msgstr "grijs"
msgid "dark gray"
msgstr "donkergrijs"
#: ../../WINGs/wcolorpanel.c:399
#: ../../WINGs/wcolorpanel.c:393
msgid "Colors"
msgstr "Kleuren"
#: ../../WINGs/wcolorpanel.c:574 ../../WINGs/wcolorpanel.c:2726
#: ../../WINGs/wcolorpanel.c:568 ../../WINGs/wcolorpanel.c:2720
msgid "Brightness"
msgstr "Helderheid"
#: ../../WINGs/wcolorpanel.c:576 ../../WINGs/wcolorpanel.c:650
#: ../../WINGs/wcolorpanel.c:681 ../../WINGs/wcolorpanel.c:712
#: ../../WINGs/wcolorpanel.c:787 ../../WINGs/wcolorpanel.c:818
#: ../../WINGs/wcolorpanel.c:850 ../../WINGs/wcolorpanel.c:883
#: ../../WINGs/wcolorpanel.c:2022 ../../WINGs/wcolorpanel.c:2728
#: ../../WINGs/wcolorpanel.c:2762 ../../WINGs/wcolorpanel.c:2796
#: ../../WINGs/wcolorpanel.c:570 ../../WINGs/wcolorpanel.c:644
#: ../../WINGs/wcolorpanel.c:675 ../../WINGs/wcolorpanel.c:706
#: ../../WINGs/wcolorpanel.c:781 ../../WINGs/wcolorpanel.c:812
#: ../../WINGs/wcolorpanel.c:844 ../../WINGs/wcolorpanel.c:877
#: ../../WINGs/wcolorpanel.c:2016 ../../WINGs/wcolorpanel.c:2722
#: ../../WINGs/wcolorpanel.c:2756 ../../WINGs/wcolorpanel.c:2790
msgid "Color Panel: Could not allocate memory"
msgstr "Kleurenpaneel: Kon geen geheugen toewijzen"
#: ../../WINGs/wcolorpanel.c:648
#: ../../WINGs/wcolorpanel.c:642
msgid "Red"
msgstr "Rood"
#: ../../WINGs/wcolorpanel.c:679
#: ../../WINGs/wcolorpanel.c:673
msgid "Green"
msgstr "Groen"
#: ../../WINGs/wcolorpanel.c:710
#: ../../WINGs/wcolorpanel.c:704
msgid "Blue"
msgstr "Blauw"
#: ../../WINGs/wcolorpanel.c:785
#: ../../WINGs/wcolorpanel.c:718
msgid "Decimal"
msgstr "Decimaal"
#: ../../WINGs/wcolorpanel.c:726
msgid "Hexadecimal"
msgstr "Hexadecimaal"
#: ../../WINGs/wcolorpanel.c:779
msgid "Cyan"
msgstr "Cyaan"
#: ../../WINGs/wcolorpanel.c:816
#: ../../WINGs/wcolorpanel.c:810
msgid "Magenta"
msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:848
#: ../../WINGs/wcolorpanel.c:842
msgid "Yellow"
msgstr "Geel"
#: ../../WINGs/wcolorpanel.c:881
#: ../../WINGs/wcolorpanel.c:875
msgid "Black"
msgstr "Zwart"
#: ../../WINGs/wcolorpanel.c:956
#: ../../WINGs/wcolorpanel.c:950
msgid "Spectrum"
msgstr "Spectrum"
#: ../../WINGs/wcolorpanel.c:982
#: ../../WINGs/wcolorpanel.c:976
msgid "Palette"
msgstr "Palet"
#: ../../WINGs/wcolorpanel.c:987
#: ../../WINGs/wcolorpanel.c:981
msgid "New from File..."
msgstr "Nieuw uit bestand..."
#: ../../WINGs/wcolorpanel.c:988 ../../WINGs/wcolorpanel.c:1033
#: ../../WINGs/wcolorpanel.c:1048
#: ../../WINGs/wcolorpanel.c:982 ../../WINGs/wcolorpanel.c:1027
#: ../../WINGs/wcolorpanel.c:1042
msgid "Rename..."
msgstr "Hernoemen..."
#: ../../WINGs/wcolorpanel.c:989 ../../WINGs/wcolorpanel.c:1034
#: ../../WINGs/wcolorpanel.c:1049 ../../WINGs/wcolorpanel.c:3188
#: ../../WINGs/wcolorpanel.c:983 ../../WINGs/wcolorpanel.c:1028
#: ../../WINGs/wcolorpanel.c:1043 ../../WINGs/wcolorpanel.c:3180
msgid "Remove"
msgstr "Verwijderen"
#: ../../WINGs/wcolorpanel.c:990
#: ../../WINGs/wcolorpanel.c:984
msgid "Copy"
msgstr "Kopiëren"
#: ../../WINGs/wcolorpanel.c:991
#: ../../WINGs/wcolorpanel.c:985
msgid "New from Clipboard"
msgstr "Nieuw van klembord"
#: ../../WINGs/wcolorpanel.c:1010
#: ../../WINGs/wcolorpanel.c:1004
msgid "X11-Colors"
msgstr "X11-kleuren"
#: ../../WINGs/wcolorpanel.c:1027
#: ../../WINGs/wcolorpanel.c:1021
msgid "Color"
msgstr "Kleur"
#: ../../WINGs/wcolorpanel.c:1032
#: ../../WINGs/wcolorpanel.c:1026
msgid "Add..."
msgstr "Toevoegen..."
#: ../../WINGs/wcolorpanel.c:1042
#: ../../WINGs/wcolorpanel.c:1036
msgid "List"
msgstr "Lijst"
#: ../../WINGs/wcolorpanel.c:1047
#: ../../WINGs/wcolorpanel.c:1041
msgid "New..."
msgstr "Nieuw..."
#: ../../WINGs/wcolorpanel.c:1176
#: ../../WINGs/wcolorpanel.c:1170
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
@@ -328,76 +563,76 @@ msgstr ""
"Kleurenpaneel: Kon map %s, nodig om instellingen op te slaan, niet aanmaken"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1182 ../../WINGs/wcolorpanel.c:3081
#: ../../WINGs/wcolorpanel.c:3085
#: ../../WINGs/wcolorpanel.c:1176 ../../WINGs/wcolorpanel.c:3073
#: ../../WINGs/wcolorpanel.c:3077
msgid "File Error"
msgstr "Bestandsfout"
#: ../../WINGs/wcolorpanel.c:1183
#: ../../WINGs/wcolorpanel.c:1177
msgid "Could not create ColorPanel configuration directory"
msgstr "Kon instellingenmap Kleurenpaneel niet aanmaken"
#: ../../WINGs/wcolorpanel.c:1184 ../../WINGs/wcolorpanel.c:3082
#: ../../WINGs/wcolorpanel.c:3087 ../../WINGs/wcolorpanel.c:3112
#: ../../WINGs/wcolorpanel.c:1178 ../../WINGs/wcolorpanel.c:3074
#: ../../WINGs/wcolorpanel.c:3079 ../../WINGs/wcolorpanel.c:3104
#: ../../WINGs/wfilepanel.c:227 ../../WINGs/wfilepanel.c:596
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
#: ../../WINGs/wfilepanel.c:883 ../../WINGs/wfontpanel.c:534
#: ../../WINGs/wfilepanel.c:883 ../../WINGs/wfontpanel.c:532
msgid "OK"
msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1190
#: ../../WINGs/wcolorpanel.c:1184
msgid "Color Panel: Could not find file"
msgstr "Kleurenpaneel: Kon bestand niet vinden"
#: ../../WINGs/wcolorpanel.c:1386 ../../WINGs/wcolorpanel.c:1447
#: ../../WINGs/wcolorpanel.c:1507
#: ../../WINGs/wcolorpanel.c:1380 ../../WINGs/wcolorpanel.c:1441
#: ../../WINGs/wcolorpanel.c:1501
msgid "Color Panel: X failed request"
msgstr "Kleurenpaneel: X-aanvraag mislukt"
#: ../../WINGs/wcolorpanel.c:2760
#: ../../WINGs/wcolorpanel.c:2754
msgid "Saturation"
msgstr "Verzadiging"
#: ../../WINGs/wcolorpanel.c:2794
#: ../../WINGs/wcolorpanel.c:2788
msgid "Hue"
msgstr "Tint"
#: ../../WINGs/wcolorpanel.c:3020
#: ../../WINGs/wcolorpanel.c:3012
msgid "Open Palette"
msgstr "Open palet"
#: ../../WINGs/wcolorpanel.c:3082
#: ../../WINGs/wcolorpanel.c:3074
msgid "Invalid file format !"
msgstr "Ongeldige bestandsvorm!"
#: ../../WINGs/wcolorpanel.c:3084
#: ../../WINGs/wcolorpanel.c:3076
#, c-format
msgid "can't remove file %s"
msgstr "kan bestand %s niet verwijderen"
#: ../../WINGs/wcolorpanel.c:3086
#: ../../WINGs/wcolorpanel.c:3078
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Kon bestand niet verwijderen uit instellingenmap!"
#: ../../WINGs/wcolorpanel.c:3111
#: ../../WINGs/wcolorpanel.c:3103
msgid "Rename"
msgstr "Hernoemen"
#: ../../WINGs/wcolorpanel.c:3111
#: ../../WINGs/wcolorpanel.c:3103
msgid "Rename palette to:"
msgstr "Hernoem palet naar:"
#: ../../WINGs/wcolorpanel.c:3112 ../../WINGs/wfilepanel.c:236
#: ../../WINGs/wcolorpanel.c:3104 ../../WINGs/wfilepanel.c:236
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
msgid "Cancel"
msgstr "Annuleren"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3128 ../../WINGs/wfilepanel.c:715
#: ../../WINGs/wcolorpanel.c:3120 ../../WINGs/wfilepanel.c:715
msgid "Warning"
msgstr "Waarschuwing"
#: ../../WINGs/wcolorpanel.c:3129
#: ../../WINGs/wcolorpanel.c:3121
msgid ""
"Palette already exists !\n"
"\n"
@@ -407,24 +642,24 @@ msgstr ""
"\n"
"Overschrijven?"
#: ../../WINGs/wcolorpanel.c:3129 ../../WINGs/wcolorpanel.c:3188
#: ../../WINGs/wcolorpanel.c:3121 ../../WINGs/wcolorpanel.c:3180
msgid "No"
msgstr "Nee"
#: ../../WINGs/wcolorpanel.c:3129 ../../WINGs/wcolorpanel.c:3188
#: ../../WINGs/wcolorpanel.c:3121 ../../WINGs/wcolorpanel.c:3180
msgid "Yes"
msgstr "Ja"
#: ../../WINGs/wcolorpanel.c:3160
#: ../../WINGs/wcolorpanel.c:3152
#, c-format
msgid "Couldn't rename palette %s to %s"
msgstr "Kon palet %s niet hernoemen naar %s"
#: ../../WINGs/wcolorpanel.c:3183
#: ../../WINGs/wcolorpanel.c:3175
msgid "This will permanently remove the palette "
msgstr "Dit zal 't palet "
#: ../../WINGs/wcolorpanel.c:3185
#: ../../WINGs/wcolorpanel.c:3177
msgid ""
".\n"
"\n"
@@ -434,12 +669,12 @@ msgstr ""
"\n"
"Weet u zeker dat u dit palet wilt verwijderen?"
#: ../../WINGs/wcolorpanel.c:3207
#: ../../WINGs/wcolorpanel.c:3199
#, c-format
msgid "Couldn't remove palette %s"
msgstr "Kon palet %s niet verwijderen"
#: ../../WINGs/wcolorpanel.c:3497
#: ../../WINGs/wcolorpanel.c:3499
msgid "Color Panel: Color unspecified"
msgstr "Kleurenpaneel: Kleur niet opgegeven"
@@ -458,15 +693,15 @@ msgstr "Opslaan"
#: ../../WINGs/wfilepanel.c:506
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: kon map %s niet openen\n"
msgstr "WINGs: Kon map %s niet openen\n"
#: ../../WINGs/wfilepanel.c:526
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: kon status %s niet vaststellen\n"
msgstr "WINGs: Kon status %s niet vaststellen\n"
#: ../../WINGs/wfilepanel.c:596 ../../WINGs/wfilepanel.c:883
#: ../../WINGs/wfontpanel.c:533
#: ../../WINGs/wfontpanel.c:531
msgid "Error"
msgstr "Fout"
@@ -508,8 +743,8 @@ msgstr "Verwijderen %s mislukt: %s"
#: ../../WINGs/wfilepanel.c:751
#, c-format
msgid "An error occured browsing '%s'."
msgstr "'n Fout trad op bij bladeren door '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Er trad 'n fout op bij bladeren door '%s'."
#: ../../WINGs/wfilepanel.c:754
#, c-format
@@ -520,55 +755,60 @@ msgstr "'%s' is geen map."
msgid "File does not exist."
msgstr "Bestand bestaat niet."
#: ../../WINGs/wfont.c:37
#: ../../WINGs/wfont.c:43
#, c-format
msgid "invalid font: %s. Trying '%s'"
msgstr "ongeldig lettertype: %s. Probeert '%s'"
#: ../../WINGs/wfont.c:227 ../../WINGs/wfont.c:245
#: ../../WINGs/wfont.c:260 ../../WINGs/wfont.c:278
#, c-format
msgid "could not load font: %s."
msgstr "kon lettertype niet laden: %s."
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
#: ../../WINGs/wfontpanel.c:186
#: ../../WINGs/wfontpanel.c:184
msgid "Font Panel"
msgstr "Lettertypen"
#: ../../WINGs/wfontpanel.c:222
#: ../../WINGs/wfontpanel.c:220
msgid "The quick brown fox jumps over the lazy dog"
msgstr "De snelle bruine vos springt over de luie hond"
#: ../../WINGs/wfontpanel.c:228
#: ../../WINGs/wfontpanel.c:226
msgid "Family"
msgstr "Familie"
#: ../../WINGs/wfontpanel.c:239
#: ../../WINGs/wfontpanel.c:237
msgid "Typeface"
msgstr "Lettertype"
#: ../../WINGs/wfontpanel.c:250
#: ../../WINGs/wfontpanel.c:248
msgid "Size"
msgstr "Grootte"
#: ../../WINGs/wfontpanel.c:269
#: ../../WINGs/wfontpanel.c:267
msgid "Set"
msgstr "Instellen"
#: ../../WINGs/wfontpanel.c:275
#: ../../WINGs/wfontpanel.c:273
msgid "Revert"
msgstr "Herstellen"
#: ../../WINGs/wfontpanel.c:534
#: ../../WINGs/wfontpanel.c:532
msgid "Could not init font config library\n"
msgstr "Kon bibliotheek 'lettertype instellen' niet initialiseren\n"
#: ../../WINGs/widgets.c:389
#: ../../WINGs/widgets.c:446
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: kon afbeeldingenbestand besturingselementen niet laden: %s"
msgstr "WINGs: Kon afbeeldingenbestand besturingselementen niet laden: %s"
#: ../../WINGs/widgets.c:724
#: ../../WINGs/widgets.c:542
#, c-format
msgid "WINGs: could not open display %s"
msgstr "WINGs: Kon scherm %s niet openen"
#: ../../WINGs/widgets.c:771
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
@@ -576,6 +816,55 @@ msgstr ""
"kon geen lettertypen laden. Zorg ervoor dat uw geïnstalleerde lettertypen en "
"lokalisatie-instellingen juist zijn."
#: ../../WINGs/winputmethod.c:65
msgid "could not add destroy callback for XIM input method"
msgstr ""
#: ../../WINGs/wruler.c:175
msgid "0 inches"
msgstr "0 inch"
#: ../../WINGs/wtextfield.c:494
msgid "only left alignment is supported in textfields"
msgstr "alleen links uitlijnen wordt ondersteund in tekstvelden"
#: ../../WINGs/wwindow.c:160
msgid "window title conversion error... using STRING encoding"
msgstr "venstertitelomzettingsfout... gebruikt STRING-codering"
#: ../../WINGs/wwindow.c:181
msgid "icon title conversion error... using STRING encoding"
msgstr "icoontitelomzettingsfout... gebruikt STRING-codering"
# Keep next entries for wmaker-0.95.6
msgid "Could not open input file \"%s\""
msgstr "Kon invoerbestand \"%s\" niet openen"
msgid "Could not create target file \"%s\""
msgstr "Kon doelbestand \"%s\" niet aanmaken"
msgid ""
"invalid characted '%c' in arg-list for macro \"%s\" while expecting "
"parameter name"
msgstr ""
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte "
"parameternaam"
msgid ""
"invalid characted '%c' in arg-list for macro \"%s\" while expecting ',' "
"or ')'"
msgstr ""
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte ',' "
"of ')'"
msgid "found #%s but have no matching #if"
msgstr "#%s gevonden, maar heeft geen bijbehorende #if"
msgid "too many nested includes"
msgstr "te veel geneste #include's"
msgid "could not find file \"%s\" for include"
msgstr "kon bestand \"%s\" niet vinden voor #include"
msgid "too many nested macro expansion, breaking loop"
msgstr "te veel geneste macro-uitwerkingen, cyclus afgebroken"
+2 -1
View File
@@ -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"
@@ -557,7 +558,7 @@ msgstr "'%s' je adresár."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgid "An error occurred browsing '%s'."
msgstr "Pri prehliadaní '%s' nastala chyba."
#: ../../WINGs/wfilepanel.c:836
+806
View File
@@ -0,0 +1,806 @@
# Serbian messages for Window Maker
# Copyright (C) 1997-2006 Alfredo K. Kojima
# 1998-2006 Dan Pascu
# 2013-2020 Window Maker Developers Team
# This file is distributed under the same license as the Window Maker package.
# Strahinya Radich (Страхиња Радић) <sr@strahinja.org>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: WindowMaker 0.96.0\n"
"Report-Msgid-Bugs-To: wmaker-dev@googlegroups.com\n"
"POT-Creation-Date: 2023-11-02 19:36+0100\n"
"PO-Revision-Date: 2023-11-02 19:48+0100\n"
"Last-Translator: Страхиња Радић <sr@strahinja.org>\n"
"Language-Team: Serbian <sr@li.org>\n"
"Language: sr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: poe 1.6.0-1-g10e6dcc\n"
#: ../../WINGs/error.c:106
msgid "fatal: "
msgstr "фатално: "
#: ../../WINGs/error.c:112
msgid "error: "
msgstr "грешка: "
#: ../../WINGs/error.c:118
msgid "warning: "
msgstr "упозорење: "
#: ../../WINGs/findfile.c:59
#, c-format
msgid "could not get password entry for UID %i"
msgstr "не може се добавити унос лозинке за UID %i"
#: ../../WINGs/findfile.c:89
#, c-format
msgid "could not get password entry for user %s"
msgstr "не може се добавити унос лозинке за корисника %s"
#: ../../WINGs/findfile.c:208
#, c-format
msgid "could not expand %s"
msgstr "не може се проширити %s"
#: ../../WINGs/findfile.c:437
#, c-format
msgid "Could not open input file \"%s\": %s"
msgstr "Не може се отворити улазна датотека „%s“: %s"
#: ../../WINGs/findfile.c:453
#, c-format
msgid "Could not create target file \"%s\": %s"
msgstr "Не може се креирати одредишна датотека „%s“: %s"
#: ../../WINGs/findfile.c:461
msgid "could not allocate memory for the copy buffer"
msgstr "не може се алоцирати меморија за бафер за копирање"
#: ../../WINGs/findfile.c:478
#, c-format
msgid "could not read from file \"%s\": %s"
msgstr "не може се прочитати датотека „%s“: %s"
#: ../../WINGs/findfile.c:493
#, c-format
msgid "could not write data to file \"%s\": %s"
msgstr "не могу се уписати подаци у датотеку „%s“: %s"
#: ../../WINGs/findfile.c:505
#, c-format
msgid "could not set permission 0%03o on file \"%s\": %s"
msgstr "не може се поставити дозвола 0%03o на датотеци „%s“: %s"
#: ../../WINGs/findfile.c:509
#, c-format
msgid "could not close the file \"%s\": %s"
msgstr "не може се затворити датотека „%s“: %s"
#: ../../WINGs/menuparser.c:110
#, c-format
msgid " included from file \"%s\" at line %d"
msgstr " укључена из датотеке „%s“ у реду %d"
#: ../../WINGs/menuparser.c:142
#, c-format
msgid "missing #endif to match #%s at line %d"
msgstr "недостаје #endif који би одговарао #%s у реду %d"
#: ../../WINGs/menuparser.c:200
msgid "multiple SHORTCUT definition not valid"
msgstr "вишеструка дефиниција SHORTCUT није исправна"
#: ../../WINGs/menuparser.c:253
msgid "premature end of file while expecting a new line after '\\'"
msgstr "прерани крај датотеке док се очекивао нови ред после „\\“"
#: ../../WINGs/menuparser.c:279
#, c-format
msgid "reached end of file while searching '*/' for comment started at line %d"
msgstr "достигнут крај датотеке приликом тражења „*/“ за коментар започет у реду %d"
#: ../../WINGs/menuparser.c:344
msgid "missing closing double-quote before end-of-line"
msgstr "недостаје завршни наводник пре краја реда"
#: ../../WINGs/menuparser.c:362
msgid "missing closing simple-quote before end-of-line"
msgstr "недостаје завршни апостроф пре краја реда"
#: ../../WINGs/menuparser.c:380
msgid "too many nested macro expansions, breaking loop"
msgstr "превише угњеждених проширења макроа, прекида се петља"
#: ../../WINGs/menuparser.c:439
#, c-format
msgid "unknown directive '#%s'"
msgstr "непозната директива „#%s“"
#: ../../WINGs/menuparser.c:444
#, c-format
msgid "extra text after '#' command is ignored: \"%.16s...\""
msgstr "сувишни текст после наредбе „#“ је игнорисан: „%.16s...“"
#: ../../WINGs/menuparser.c:459
msgid "no file name found for #include"
msgstr "назив датотеке у #include-у није пронађен"
#: ../../WINGs/menuparser.c:471
msgid "file name must be enclosed in brackets or double-quotes for #define"
msgstr "назив датотеке у #define-у мора бити окружен угластим заградама или наводницима"
#: ../../WINGs/menuparser.c:485
#, c-format
msgid "missing closing '%c' in filename specification"
msgstr "недостаје завршно „%c“ у задавању назива датотеке"
#: ../../WINGs/menuparser.c:503
msgid "too many nested #include's"
msgstr "превише угњеждених #include-ова"
#: ../../WINGs/menuparser.c:568
#, c-format
msgid "could not find file \"%s\" for #include"
msgstr "не може се наћи датотека „%s“ у #include-у"
#: ../../WINGs/menuparser.c:589
#, c-format
msgid "missing macro name argument to #%s"
msgstr "недостаје аргумент #%s - назив макроа"
#: ../../WINGs/menuparser.c:600
msgid "too many nested #if sequences"
msgstr "превише угњеждених секвенци #if"
#: ../../WINGs/menuparser.c:626 ../../WINGs/menuparser.c:643
#, c-format
msgid "found #%s but has no matching #if"
msgstr "пронађено #%s, али без одговарајућег #if"
#: ../../WINGs/menuparser_macros.c:166
msgid "no macro name found for #define"
msgstr "назив макроа за #define није пронађен"
#: ../../WINGs/menuparser_macros.c:188
#, c-format
msgid "premature end of file while reading arg-list for macro \"%s\""
msgstr "прерани крај датотеке приликом читања листе аргумената за макро „%s“"
#: ../../WINGs/menuparser_macros.c:195
#, c-format
msgid "too many parameters for macro \"%s\" definition"
msgstr "превише параметара за дефиницију макроа „%s“"
#: ../../WINGs/menuparser_macros.c:210
#, c-format
msgid "invalid character '%c' in arg-list for macro \"%s\" while expecting parameter name"
msgstr "неисправни знак „%c“ у листи аргумената за макро „%s“ док се очекивао назив параметра"
#: ../../WINGs/menuparser_macros.c:221
#, c-format
msgid "invalid character '%c' in arg-list for macro \"%s\" while expecting ',' or ')'"
msgstr "неисправни знак „%c“ у листи аргумената за макро „%s“ док се очекивало „,“ или „)“"
#: ../../WINGs/menuparser_macros.c:254
#, c-format
msgid "macro \"%s\" already defined, ignoring redefinition"
msgstr "макро „%s“ је већ дефинисан, игнорише се поновна дефиниција"
#: ../../WINGs/menuparser_macros.c:348
#, c-format
msgid "more content than supported for the macro \"%s\""
msgstr "више садржаја него што је подржано за макро „%s“"
#: ../../WINGs/menuparser_macros.c:459
#, c-format
msgid "expansion for macro \"%s\" too big, line truncated"
msgstr "проширење макроа „%s“ је превелико, ред је исечен"
#: ../../WINGs/menuparser_macros.c:471
#, c-format
msgid "macro \"%s\" needs parenthesis for arguments"
msgstr "макроу „%s“ су потребне заграде за аргументе"
#: ../../WINGs/menuparser_macros.c:502
msgid "missing closing quote or double-quote before end-of-line"
msgstr "недостаје завршни наводник или апостроф пре краја реда"
#: ../../WINGs/menuparser_macros.c:525
#, c-format
msgid "too many arguments for macro \"%s\", expected only %d"
msgstr "превише аргумената за макро „%s“, очекује се само %d"
#: ../../WINGs/menuparser_macros.c:534
#, c-format
msgid "premature end of line while searching for arguments to macro \"%s\""
msgstr "прерани крај реда приликом тражења аргумената за макро „%s“"
#: ../../WINGs/menuparser_macros.c:540
#, c-format
msgid "not enough arguments for macro \"%s\", expected %d but got only %d"
msgstr "недовољно аргумената за макро „%s“, очекује се %d, али само постоји %d"
#: ../../WINGs/menuparser_macros.c:545
#, c-format
msgid "too much data in parameter list of macro \"%s\", truncated"
msgstr "превише података у листи параметара макроа „%s“, исечено"
#: ../../WINGs/menuparser_macros.c:565
#, c-format
msgid "size of value for macro '%s' is too big, truncated"
msgstr "величина вредности макроа „%s“ је превелика, исечено"
#: ../../WINGs/menuparser_macros.c:646 ../../WINGs/menuparser_macros.c:672
#, c-format
msgid "could not determine %s"
msgstr "не може се одредити %s"
#: ../../WINGs/proplist.c:78
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "синтаксна грешка у %s %s, ред %i: %s"
#: ../../WINGs/proplist.c:134
msgid "Only string or data is supported for a proplist dictionary key"
msgstr "Само ниска или подаци су подржани у proplist речничком кључу"
#: ../../WINGs/proplist.c:167 ../../WINGs/proplist.c:217
#: ../../WINGs/proplist.c:382 ../../WINGs/proplist.c:458
#: ../../WINGs/proplist.c:1048 ../../WINGs/proplist.c:1098
#: ../../WINGs/proplist.c:1246 ../../WINGs/proplist.c:1326
#: ../../WINGs/proplist.c:1431 ../../WINGs/proplist.c:1475
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "Користе се proplist функције над не-WMPropLists објектима"
#: ../../WINGs/proplist.c:635
msgid "unterminated PropList string"
msgstr "незатворена PropList ниска"
#: ../../WINGs/proplist.c:673
msgid "unterminated PropList data"
msgstr "незатворен PropList податак"
#: ../../WINGs/proplist.c:681
msgid "unterminated PropList data (missing hexdigit)"
msgstr "незатворен PropList податак (недостаје хекс-цифра)"
#: ../../WINGs/proplist.c:693 ../../WINGs/proplist.c:698
msgid "non hexdigit character in PropList data"
msgstr "знак који није хекс-цифра у PropList подацима"
#: ../../WINGs/proplist.c:730
msgid "unterminated PropList array"
msgstr "незатворен PropList низ"
#: ../../WINGs/proplist.c:738
msgid "missing or unterminated PropList array"
msgstr "недостајући или незатворени PropList низ"
#: ../../WINGs/proplist.c:748
msgid "could not get PropList array element"
msgstr "не може се добавити елемент PropList низа"
#: ../../WINGs/proplist.c:775
msgid "unterminated PropList dictionary"
msgstr "незатворени PropList речник"
#: ../../WINGs/proplist.c:792
msgid "missing PropList dictionary key"
msgstr "недостајући кључ PropList речника"
#: ../../WINGs/proplist.c:794
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "недостаје кључ PropList речничке ставке или је речник незатворен"
#: ../../WINGs/proplist.c:802
msgid "error parsing PropList dictionary key"
msgstr "грешка приликом рашчлањивања кључа PropList речника"
#: ../../WINGs/proplist.c:810
msgid "missing = in PropList dictionary entry"
msgstr "недостаје = у ставци PropList речника"
#: ../../WINGs/proplist.c:818
msgid "error parsing PropList dictionary entry value"
msgstr "грешка приликом рашчлањивања вредности PropList речничког уноса"
#: ../../WINGs/proplist.c:826
msgid "missing ; in PropList dictionary entry"
msgstr "недостаје ; у речничком уносу PropList"
#: ../../WINGs/proplist.c:885
msgid "was expecting a string, data, array or dictionary. If it's a string, try enclosing it with \"."
msgstr "очекује се ниска, податак, низ или речник. Ако је у питању ниска, пробајте да је окружите са \"."
#: ../../WINGs/proplist.c:888
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Коментари нису дозвољени унутар датотека домена WindowMaker-а."
#: ../../WINGs/proplist.c:1495 ../../WINGs/proplist.c:1560
#: ../../WINGs/proplist.c:1624
msgid "extra data after end of property list"
msgstr "вишак података после листе особина"
#: ../../WINGs/proplist.c:1535
#, c-format
msgid "could not get size for file '%s'"
msgstr "не може се одредити величина датотеке „%s“"
#: ../../WINGs/proplist.c:1543
#, c-format
msgid "error reading from file '%s'"
msgstr "грешка приликом читања датотеке „%s“"
#: ../../WINGs/proplist.c:1590
#, c-format
msgid "%s:could not open menu file"
msgstr "%s:не може се отворити датотека менија"
#: ../../WINGs/proplist.c:1672
#, c-format
msgid "mkstemp (%s) failed"
msgstr "mkstemp (%s) није успео"
#: ../../WINGs/proplist.c:1682
#, c-format
msgid "mktemp (%s) failed"
msgstr "mktemp (%s) није успео"
#: ../../WINGs/proplist.c:1689
#, c-format
msgid "open (%s) failed"
msgstr "open (%s) није успео"
#: ../../WINGs/proplist.c:1696
#, c-format
msgid "writing to file: %s failed"
msgstr "уписивање у датотеку: %s није успело"
#: ../../WINGs/proplist.c:1706
#, c-format
msgid "fclose (%s) failed"
msgstr "fclose (%s) није успео"
#: ../../WINGs/proplist.c:1714
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "rename („%s“ у „%s“) није успео"
#: ../../WINGs/proplist.c:1785
#, c-format
msgid "Could not create component %s"
msgstr "Не може се креирати компонента %s"
#: ../../WINGs/userdefaults.c:68
msgid "variable WMAKER_USER_ROOT defined with invalid path, not used"
msgstr "променљива WMAKER_USER_ROOT је задата са неисправном путањом, не користи се"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:208 ../../WINGs/userdefaults.c:223
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "не може се учитати домен из датотеке „%s“ приликом синхронизовања"
#: ../../WINGs/dragcommon.c:60
#, c-format
msgid "unknown XDND action %s"
msgstr "непозната XDND акција %s"
#: ../../WINGs/dragcommon.c:142
#, c-format
msgid "target %lu for XDND message no longer exists"
msgstr "одредиште %lu XDND поруке више не постоји"
#: ../../WINGs/dragcommon.c:220
#, c-format
msgid "unsupported version %i for XDND enter message"
msgstr "неподржана верзија %i XDND улазне поруке"
#: ../../WINGs/dragsource.c:163
msgid "XDND selection lost during drag operation..."
msgstr "XDND избор је изгубљен приликом операције превлачења..."
#: ../../WINGs/dragsource.c:758
msgid "could not get XDND version for target of drop"
msgstr "не може се одредити верзија XDND-а за одредиште превлачења"
#: ../../WINGs/dragsource.c:774
msgid "could not get ownership of XDND selection"
msgstr "не може се одредити власништво над XDND избором"
#: ../../WINGs/dragsource.c:1070
msgid "delay for drag destination response expired"
msgstr "пауза за одговор одредишта превлачења је истекла"
#: ../../WINGs/wcolor.c:204 ../../WINGs/wcolor.c:214 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:288
#, c-format
msgid "could not allocate %s color"
msgstr "не може се алоцирати боја %s"
#: ../../WINGs/wcolor.c:204
msgid "white"
msgstr "бела"
#: ../../WINGs/wcolor.c:214
msgid "black"
msgstr "црна"
#: ../../WINGs/wcolor.c:250
msgid "gray"
msgstr "сива"
#: ../../WINGs/wcolor.c:288
msgid "dark gray"
msgstr "тамно сива"
#: ../../WINGs/wcolorpanel.c:390
msgid "Colors"
msgstr "Боје"
#: ../../WINGs/wcolorpanel.c:565 ../../WINGs/wcolorpanel.c:2716
msgid "Brightness"
msgstr "Светлина"
#: ../../WINGs/wcolorpanel.c:567 ../../WINGs/wcolorpanel.c:641
#: ../../WINGs/wcolorpanel.c:672 ../../WINGs/wcolorpanel.c:703
#: ../../WINGs/wcolorpanel.c:778 ../../WINGs/wcolorpanel.c:809
#: ../../WINGs/wcolorpanel.c:841 ../../WINGs/wcolorpanel.c:874
#: ../../WINGs/wcolorpanel.c:2010 ../../WINGs/wcolorpanel.c:2718
#: ../../WINGs/wcolorpanel.c:2752 ../../WINGs/wcolorpanel.c:2786
msgid "Color Panel: Could not allocate memory"
msgstr "Панел за боје: Неуспешно алоцирање меморије"
#: ../../WINGs/wcolorpanel.c:639
msgid "Red"
msgstr "Црвена"
#: ../../WINGs/wcolorpanel.c:670
msgid "Green"
msgstr "Зелена"
#: ../../WINGs/wcolorpanel.c:701
msgid "Blue"
msgstr "Плава"
#: ../../WINGs/wcolorpanel.c:715
msgid "Decimal"
msgstr "Децимално"
#: ../../WINGs/wcolorpanel.c:723
msgid "Hexadecimal"
msgstr "Хексадекадно"
#: ../../WINGs/wcolorpanel.c:776
msgid "Cyan"
msgstr "Цијан"
#: ../../WINGs/wcolorpanel.c:807
msgid "Magenta"
msgstr "Магента"
#: ../../WINGs/wcolorpanel.c:839
msgid "Yellow"
msgstr "Жута"
#: ../../WINGs/wcolorpanel.c:872
msgid "Black"
msgstr "Црна"
#: ../../WINGs/wcolorpanel.c:947
msgid "Spectrum"
msgstr "Спектар"
#: ../../WINGs/wcolorpanel.c:973
msgid "Palette"
msgstr "Палета"
#: ../../WINGs/wcolorpanel.c:978
msgid "New from File..."
msgstr "Нова из датотеке..."
#: ../../WINGs/wcolorpanel.c:979 ../../WINGs/wcolorpanel.c:1024
#: ../../WINGs/wcolorpanel.c:1039
msgid "Rename..."
msgstr "Преименуј..."
#: ../../WINGs/wcolorpanel.c:980 ../../WINGs/wcolorpanel.c:1025
#: ../../WINGs/wcolorpanel.c:1040 ../../WINGs/wcolorpanel.c:3176
msgid "Remove"
msgstr "Уклони"
#: ../../WINGs/wcolorpanel.c:981
msgid "Copy"
msgstr "Копирај"
#: ../../WINGs/wcolorpanel.c:982
msgid "New from Clipboard"
msgstr "Нова из клипборда"
#: ../../WINGs/wcolorpanel.c:1001
msgid "X11-Colors"
msgstr "X11 боје"
#: ../../WINGs/wcolorpanel.c:1018
msgid "Color"
msgstr "Боја"
#: ../../WINGs/wcolorpanel.c:1023
msgid "Add..."
msgstr "Додај..."
#: ../../WINGs/wcolorpanel.c:1033
msgid "List"
msgstr "Листа"
#: ../../WINGs/wcolorpanel.c:1038
msgid "New..."
msgstr "Нова..."
#: ../../WINGs/wcolorpanel.c:1165
#, c-format
msgid "Color Panel: Could not create directory %s needed to store configurations"
msgstr "Панел за боје: Не може се креирати директоријум %s неопходан за чување подешавања"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1171 ../../WINGs/wcolorpanel.c:3069
#: ../../WINGs/wcolorpanel.c:3073
msgid "File Error"
msgstr "Грешка датотеке"
#: ../../WINGs/wcolorpanel.c:1172
msgid "Could not create ColorPanel configuration directory"
msgstr "Не може се креирати директоријум са подешавањима ColorPanel"
#: ../../WINGs/wcolorpanel.c:1173 ../../WINGs/wcolorpanel.c:3070
#: ../../WINGs/wcolorpanel.c:3075 ../../WINGs/wcolorpanel.c:3100
#: ../../WINGs/wfilepanel.c:227 ../../WINGs/wfilepanel.c:596
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
#: ../../WINGs/wfilepanel.c:883 ../../WINGs/wfontpanel.c:532
msgid "OK"
msgstr "ОК"
#: ../../WINGs/wcolorpanel.c:1178
msgid "Color Panel: Could not find file"
msgstr "Панел за боје: Не може се пронаћи датотека"
#: ../../WINGs/wcolorpanel.c:1374 ../../WINGs/wcolorpanel.c:1435
#: ../../WINGs/wcolorpanel.c:1495
msgid "Color Panel: X failed request"
msgstr "Панел за боје: Неуспешан захтев X-а"
#: ../../WINGs/wcolorpanel.c:2750
msgid "Saturation"
msgstr "Засићење"
#: ../../WINGs/wcolorpanel.c:2784
msgid "Hue"
msgstr "Нијанса"
#: ../../WINGs/wcolorpanel.c:3008
msgid "Open Palette"
msgstr "Отвори палету"
#: ../../WINGs/wcolorpanel.c:3070
msgid "Invalid file format !"
msgstr "Неисправан формат датотеке !"
#: ../../WINGs/wcolorpanel.c:3072
#, c-format
msgid "can't remove file %s"
msgstr "не може се уклонити датотека %s"
#: ../../WINGs/wcolorpanel.c:3074
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Не може се уклонити датотека из директоријума са подешавањима !"
#: ../../WINGs/wcolorpanel.c:3099
msgid "Rename"
msgstr "Преименовање"
#: ../../WINGs/wcolorpanel.c:3099
msgid "Rename palette to:"
msgstr "Преименуј палету у:"
#: ../../WINGs/wcolorpanel.c:3100 ../../WINGs/wfilepanel.c:236
#: ../../WINGs/wfilepanel.c:611 ../../WINGs/wfilepanel.c:715
msgid "Cancel"
msgstr "Поништи"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3116 ../../WINGs/wfilepanel.c:715
msgid "Warning"
msgstr "Упозорење"
#: ../../WINGs/wcolorpanel.c:3117
msgid "Palette already exists !\n\nOverwrite ?"
msgstr "Палета већ постоји !\n\nПреписати ?"
#: ../../WINGs/wcolorpanel.c:3117 ../../WINGs/wcolorpanel.c:3176
msgid "No"
msgstr "Не"
#: ../../WINGs/wcolorpanel.c:3117 ../../WINGs/wcolorpanel.c:3176
msgid "Yes"
msgstr "Да"
#: ../../WINGs/wcolorpanel.c:3148
#, c-format
msgid "Couldn't rename palette %s to %s"
msgstr "Палета %s се не може преименовати у %s"
#: ../../WINGs/wcolorpanel.c:3171
msgid "This will permanently remove the palette "
msgstr "Ово ће трајно уклонити палету "
#: ../../WINGs/wcolorpanel.c:3173
msgid ".\n\nAre you sure you want to remove this palette ?"
msgstr ".\n\nДа ли сте сигурни да желите да уклоните палету ?"
#: ../../WINGs/wcolorpanel.c:3195
#, c-format
msgid "Couldn't remove palette %s"
msgstr "Не може се уклонити палета %s"
#: ../../WINGs/wcolorpanel.c:3498
msgid "Color Panel: Color unspecified"
msgstr "Панел за боју: Боја није задата"
#: ../../WINGs/wfilepanel.c:216
msgid "Name:"
msgstr "Назив:"
#: ../../WINGs/wfilepanel.c:306 ../../WINGs/wfilepanel.c:364
msgid "Open"
msgstr "Отвори"
#: ../../WINGs/wfilepanel.c:322 ../../WINGs/wfilepanel.c:370
msgid "Save"
msgstr "Сачувај"
#: ../../WINGs/wfilepanel.c:506
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: не може се отворити директоријум %s\n"
#: ../../WINGs/wfilepanel.c:526
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: не може се stat-овати %s\n"
#: ../../WINGs/wfilepanel.c:596 ../../WINGs/wfilepanel.c:883
#: ../../WINGs/wfontpanel.c:531
msgid "Error"
msgstr "Грешка"
#: ../../WINGs/wfilepanel.c:610
msgid "Create Directory"
msgstr "Креирање директоријума"
#: ../../WINGs/wfilepanel.c:611
msgid "Enter directory name"
msgstr "Унесите назив директоријума"
#: ../../WINGs/wfilepanel.c:639
#, c-format
msgid "Can not create %s: %s"
msgstr "Не може се креирати %s: %s"
#: ../../WINGs/wfilepanel.c:705
#, c-format
msgid "Can not find %s: %s"
msgstr "Не може се наћи %s: %s"
#: ../../WINGs/wfilepanel.c:711
#, c-format
msgid "Delete %s %s?"
msgstr "Обрисати %s %s?"
#: ../../WINGs/wfilepanel.c:712
msgid "directory"
msgstr "директоријум"
#: ../../WINGs/wfilepanel.c:712
msgid "file"
msgstr "датотеку"
#: ../../WINGs/wfilepanel.c:719
#, c-format
msgid "Removing %s failed: %s"
msgstr "Уклањање %s није успело: %s"
#: ../../WINGs/wfilepanel.c:751
#, c-format
msgid "An error occurred browsing '%s'."
msgstr "Догодила се грешка приликом прегледања „%s“."
#: ../../WINGs/wfilepanel.c:754
#, c-format
msgid "'%s' is not a directory."
msgstr "„%s“ није директоријум."
#: ../../WINGs/wfilepanel.c:883
msgid "File does not exist."
msgstr "Датотека не постоји."
#: ../../WINGs/wfont.c:43
#, c-format
msgid "invalid font: %s. Trying '%s'"
msgstr "неисправан фонт: %s. Проба се „%s“"
#: ../../WINGs/wfont.c:270 ../../WINGs/wfont.c:288
#, c-format
msgid "could not load font: %s."
msgstr "не може се учитати фонт: %s."
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
#: ../../WINGs/wfontpanel.c:184
msgid "Font Panel"
msgstr "Панел за фонт"
#: ../../WINGs/wfontpanel.c:220
msgid "The quick brown fox jumps over the lazy dog"
msgstr "Одбациће кавгаџија плаштом чађ у жељезни фењер"
#: ../../WINGs/wfontpanel.c:226
msgid "Family"
msgstr "Фамилија"
#: ../../WINGs/wfontpanel.c:237
msgid "Typeface"
msgstr "Словни лик"
#: ../../WINGs/wfontpanel.c:248
msgid "Size"
msgstr "Величина"
#: ../../WINGs/wfontpanel.c:267
msgid "Set"
msgstr "Постави"
#: ../../WINGs/wfontpanel.c:273
msgid "Revert"
msgstr "Врати"
#: ../../WINGs/wfontpanel.c:532
msgid "Could not init font config library\n"
msgstr "Не може се иницијализовати библиотека font config\n"
#: ../../WINGs/widgets.c:447
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: не може се учитати датотека са сликама виџета: %s"
#: ../../WINGs/widgets.c:543
#, c-format
msgid "WINGs: could not open display %s"
msgstr "WINGs: не може се отворити приказ %s"
#: ../../WINGs/widgets.c:772
msgid "could not load any fonts. Make sure your font installation and locale settings are correct."
msgstr "не може се учитати ниједан фонт. Проверите да ли су фонтови исправно инсталирани и да али су подешавања језика исправна."
#: ../../WINGs/winputmethod.c:65
msgid "could not add destroy callback for XIM input method"
msgstr "не може се додати destroy callback за XIM метод уноса"
#: ../../WINGs/wruler.c:175
msgid "0 inches"
msgstr "0 инча"
#: ../../WINGs/wtextfield.c:494
msgid "only left alignment is supported in textfields"
msgstr "у текстуалним пољима је подржано само лево уравнање"
#: ../../WINGs/wwindow.c:160
msgid "window title conversion error... using STRING encoding"
msgstr "грешка приликом конверзије наслова прозора... користи се STRING кодирање"
#: ../../WINGs/wwindow.c:181
msgid "icon title conversion error... using STRING encoding"
msgstr "грешка приликом конверзије наслова иконе... користи се STRING кодирање"
+50 -15
View File
@@ -1213,6 +1213,7 @@ WMPropList *WMSubtractPLDictionaries(WMPropList * dest, WMPropList * source, Boo
for (i = 0; i < WMGetArrayItemCount(keys->d.array); i++) {
WMRemoveFromPLDictionary(dest, WMGetFromArray(keys->d.array, i));
}
WMReleasePropList(keys);
return dest;
}
@@ -1252,22 +1253,34 @@ int WMGetPropListItemCount(WMPropList * plist)
Bool WMIsPLString(WMPropList * plist)
{
return (plist->type == WPLString);
if (plist)
return (plist->type == WPLString);
else
return False;
}
Bool WMIsPLData(WMPropList * plist)
{
return (plist->type == WPLData);
if (plist)
return (plist->type == WPLData);
else
return False;
}
Bool WMIsPLArray(WMPropList * plist)
{
return (plist->type == WPLArray);
if (plist)
return (plist->type == WPLArray);
else
return False;
}
Bool WMIsPLDictionary(WMPropList * plist)
{
return (plist->type == WPLDictionary);
if (plist)
return (plist->type == WPLDictionary);
else
return False;
}
Bool WMIsPropListEqualTo(WMPropList * plist, WMPropList * other)
@@ -1645,13 +1658,22 @@ Bool WMWritePropListToFile(WMPropList * plist, const char *path)
thePath = wstrconcat(path, ".XXXXXX");
#ifdef HAVE_MKSTEMP
/*
* We really just want to read the current umask, but as Coverity is
* pointing a possible security issue:
* some versions of mkstemp do not set file rights properly on the
* created file, so it is recommended so set the umask beforehand.
* As we need to set an umask to read the current value, we take this
* opportunity to set a temporary aggresive umask so Coverity won't
* complain, even if we do not really care in the present use case.
*/
mask = umask(S_IRWXG | S_IRWXO);
if ((fd = mkstemp(thePath)) < 0) {
werror(_("mkstemp (%s) failed"), thePath);
goto failure;
}
mask = umask(0);
umask(mask);
fchmod(fd, 0644 & ~mask);
fchmod(fd, 0666 & ~mask);
if ((theFile = fdopen(fd, "wb")) == NULL) {
close(fd);
}
@@ -1673,6 +1695,7 @@ Bool WMWritePropListToFile(WMPropList * plist, const char *path)
if (fprintf(theFile, "%s\n", desc) != strlen(desc) + 1) {
werror(_("writing to file: %s failed"), thePath);
wfree(desc);
fclose(theFile);
goto failure;
}
@@ -1709,7 +1732,7 @@ Bool WMWritePropListToFile(WMPropList * plist, const char *path)
* file, and the last component is stripped off. the rest is the
* the hierarchy to be created.
*
* refuses to create anything outside $GNUSTEP_USER_ROOT
* refuses to create anything outside $WMAKER_USER_ROOT
*
* returns 1 on success, 0 on failure
*/
@@ -1720,7 +1743,7 @@ int wmkdirhier(const char *path)
size_t p, plen;
struct stat st;
/* Only create directories under $GNUSTEP_USER_ROOT */
/* Only create directories under $WMAKER_USER_ROOT */
if ((t = wusergnusteppath()) == NULL)
return 0;
if (strncmp(path, t, strlen(t)) != 0)
@@ -1801,7 +1824,7 @@ static int wrmdirhier_fn(const char *path, const struct stat *st,
/*
* remove a directory hierarchy
*
* refuses to remove anything outside $GNUSTEP_USER_ROOT
* refuses to remove anything outside $WMAKER_USER_ROOT/Defaults or $WMAKER_USER_ROOT/Library
*
* returns 1 on success, 0 on failure
*
@@ -1811,15 +1834,27 @@ static int wrmdirhier_fn(const char *path, const struct stat *st,
*/
int wrmdirhier(const char *path)
{
const char *libpath;
char *udefpath = NULL;
struct stat st;
int error;
const char *t;
/* Only remove directories under $GNUSTEP_USER_ROOT */
if ((t = wusergnusteppath()) == NULL)
return EPERM;
if (strncmp(path, t, strlen(t)) != 0)
return EPERM;
/* Only remove directories under $WMAKER_USER_ROOT/Defaults or $WMAKER_USER_ROOT/Library */
libpath = wuserdatapath();
if (strncmp(path, libpath, strlen(libpath)) == 0)
if (path[strlen(libpath)] == '/')
goto path_in_valid_tree;
udefpath = wdefaultspathfordomain("");
if (strncmp(path, udefpath, strlen(udefpath)) == 0)
/* Note: by side effect, 'udefpath' already contains a final '/' */
goto path_in_valid_tree;
wfree(udefpath);
return EPERM;
path_in_valid_tree:
wfree(udefpath);
/* Shortcut if it doesn't exist to begin with */
if (stat(path, &st) == -1)
+2 -2
View File
@@ -7,7 +7,7 @@
#define MAX_PROPERTY_SIZE 8*1024
char *WMSelectionOwnerDidChangeNotification = "WMSelectionOwnerDidChange";
const char *WMSelectionOwnerDidChangeNotification = "WMSelectionOwnerDidChange";
typedef struct SelectionHandler {
WMView *view;
@@ -261,7 +261,7 @@ static WMData *getSelectionData(Display * dpy, Window win, Atom where)
bpi = bits / 8;
wdata = WMCreateDataWithBytesNoCopy(data, len * bpi, (WMFreeDataProc *) XFree);
wdata = WMCreateDataWithBytesNoCopy(data, len * bpi, (void *) XFree);
WMSetDataFormat(wdata, bits);
return wdata;
+5 -7
View File
@@ -204,7 +204,7 @@ char *wstrndup(const char *str, size_t len)
char *wstrconcat(const char *str1, const char *str2)
{
char *str;
size_t slen;
size_t slen, slen1;
if (!str1 && str2)
return wstrdup(str2);
@@ -213,13 +213,11 @@ char *wstrconcat(const char *str1, const char *str2)
else if (!str1 && !str2)
return NULL;
slen = strlen(str1) + strlen(str2) + 1;
slen1 = strlen(str1);
slen = slen1 + strlen(str2) + 1;
str = wmalloc(slen);
if (wstrlcpy(str, str1, slen) >= slen ||
wstrlcat(str, str2, slen) >= slen) {
wfree(str);
return NULL;
}
strcpy(str, str1);
strcpy(str + slen1, str2);
return str;
}
+23 -25
View File
@@ -40,36 +40,32 @@ char *WMUserDefaultsDidChangeNotification = "WMUserDefaultsDidChangeNotification
static void synchronizeUserDefaults(void *foo);
#define DEFAULTS_DIR "/Defaults"
#ifndef HAVE_INOTIFY
/* Check defaults database for changes every this many milliseconds */
/* XXX: this is shared with src/ stuff, put it in some common header */
#define UD_SYNC_INTERVAL 2000
#endif
const char *wusergnusteppath()
const char *wusergnusteppath(void)
{
static const char subdir[] = "/GNUstep";
static const char subdir[] = "/" GSUSER_SUBDIR;
static char *path = NULL;
char *gspath, *h;
char *gspath;
const char *h;
int pathlen;
if (path)
/* Value have been already computed, re-use it */
return path;
#ifdef HAVE_SECURE_GETENV
gspath = secure_getenv("GNUSTEP_USER_ROOT");
#else
gspath = getenv("GNUSTEP_USER_ROOT");
#endif
gspath = GETENV("WMAKER_USER_ROOT");
if (gspath) {
gspath = wexpandpath(gspath);
if (gspath) {
path = gspath;
return path;
}
wwarning(_("variable GNUSTEP_USER_ROOT defined with invalid path, not used"));
wwarning(_("variable WMAKER_USER_ROOT defined with invalid path, not used"));
}
h = wgethomedir();
@@ -84,6 +80,19 @@ const char *wusergnusteppath()
return path;
}
const char *wuserdatapath(void)
{
static char *path = NULL;
if (path)
/* Value have been already computed, re-use it */
return path;
path = wstrconcat(wusergnusteppath(), "/" USERDATA_SUBDIR);
return path;
}
char *wdefaultspathfordomain(const char *domain)
{
char *path;
@@ -91,31 +100,20 @@ char *wdefaultspathfordomain(const char *domain)
size_t slen;
gspath = wusergnusteppath();
slen = strlen(gspath) + strlen(DEFAULTS_DIR) + strlen(domain) + 4;
slen = strlen(gspath) + strlen("/" DEFAULTS_SUBDIR "/") + strlen(domain) + 1;
path = wmalloc(slen);
strcpy(path, gspath);
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
strcat(path, "/" DEFAULTS_SUBDIR "/");
strcat(path, domain);
return path;
}
/* XXX: doesn't quite belong to *user*defaults.c */
#ifndef GLOBAL_DEFAULTS_SUBDIR
#define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
#endif
char *wglobaldefaultspathfordomain(const char *domain)
{
char *t = NULL;
size_t len;
len = strlen( SYSCONFDIR ) + strlen( GLOBAL_DEFAULTS_SUBDIR ) + strlen(domain) + 3;
t = wmalloc(len);
snprintf(t, len, "%s/%s/%s", SYSCONFDIR, GLOBAL_DEFAULTS_SUBDIR, domain);
return t;
return wstrconcat(PKGCONFDIR "/", domain);
}
void w_save_defaults_changes(void)
@@ -591,7 +589,7 @@ void WMSetUDFloatForKey(WMUserDefaults * database, float value, const char *defa
WMPropList *object;
char buffer[128];
sprintf(buffer, "%f", value);
sprintf(buffer, "%f", (double)value);
object = WMCreatePLString(buffer);
WMSetUDObjectForKey(database, object, defaultName);
+45 -36
View File
@@ -9,7 +9,7 @@
struct W_Application WMApplication;
char *_WINGS_progname = NULL;
const char *_WINGS_progname = NULL;
Bool W_ApplicationInitialized(void)
{
@@ -83,7 +83,7 @@ void WMSetResourcePath(const char *path)
WMApplication.resourcePath = wstrdup(path);
}
char *WMGetApplicationName()
char *WMGetApplicationName(void)
{
return WMApplication.applicationName;
}
@@ -131,22 +131,23 @@ error:
char *WMPathForResourceOfType(const char *resource, const char *ext)
{
char *path, *tmp, *appdir;
int i;
const char *gslocapps, *gssysapps, *gsuserapps;
char *path, *appdir;
char buffer[PATH_MAX];
size_t slen;
path = tmp = appdir = NULL;
path = appdir = NULL;
/*
* Paths are searched in this order:
* - resourcePath/ext
* - dirname(argv[0])/ext
* - GNUSTEP_USER_ROOT/Applications/ApplicationName.app/ext
* - ~/GNUstep/Applications/ApplicationName.app/ext
* - GNUSTEP_LOCAL_ROOT/Applications/ApplicationName.app/ext
* - /usr/local/GNUstep/Applications/ApplicationName.app/ext
* - GNUSTEP_SYSTEM_ROOT/Applications/ApplicationName.app/ext
* - /usr/GNUstep/Applications/ApplicationName.app/ext
* - WMAKER_USER_ROOT/Applications/ApplicationName.app/ext
* - GNUSTEP_USER_APPS/ApplicationName.app/ext
* - GNUSTEP_LOCAL_APPS/ApplicationName.app/ext
* - /usr/local/lib/GNUstep/Applications/ApplicationName.app/ext
* - GNUSTEP_SYSTEM_APPS/ApplicationName.app/ext
* - /usr/lib/GNUstep/Applications/ApplicationName.app/ext
*/
if (WMApplication.resourcePath) {
@@ -156,49 +157,57 @@ char *WMPathForResourceOfType(const char *resource, const char *ext)
}
if (WMApplication.argv[0]) {
tmp = wstrdup(WMApplication.argv[0]);
i = strlen(tmp);
while (i > 0 && tmp[i] != '/')
i--;
tmp[i] = 0;
if (i > 0) {
char *ptr_slash;
ptr_slash = strrchr(WMApplication.argv[0], '/');
if (ptr_slash != NULL) {
char tmp[ptr_slash - WMApplication.argv[0] + 1];
strncpy(tmp, WMApplication.argv[0], sizeof(tmp)-1);
tmp[sizeof(tmp) - 1] = '\0';
path = checkFile(tmp, NULL, ext, resource);
} else {
path = NULL;
if (path)
goto out;
}
goto out;
}
slen = strlen(WMApplication.applicationName) + sizeof("Applications/.app");
snprintf(buffer, sizeof(buffer), "Applications/%s.app", WMApplication.applicationName);
path = checkFile(GETENV("WMAKER_USER_ROOT"), buffer, ext, resource);
if (path)
goto out;
slen = strlen(WMApplication.applicationName) + sizeof("/.app");
appdir = wmalloc(slen);
if (snprintf(appdir, slen, "Applications/%s.app", WMApplication.applicationName) >= slen)
if (snprintf(appdir, slen, "/%s.app", WMApplication.applicationName) >= slen)
goto out;
path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource);
gsuserapps = GETENV("GNUSTEP_USER_APPS");
if (!gsuserapps) {
snprintf(buffer, sizeof(buffer), "%s/Applications", wusergnusteppath());
gsuserapps = buffer;
}
path = checkFile(gsuserapps, appdir, ext, resource);
if (path)
goto out;
path = checkFile(wusergnusteppath(), appdir, ext, resource);
gslocapps = GETENV("GNUSTEP_LOCAL_APPS");
if (!gslocapps)
gslocapps = "/usr/local/lib/GNUstep/Applications";
path = checkFile(gslocapps, appdir, ext, resource);
if (path)
goto out;
path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource);
gssysapps = GETENV("GNUSTEP_SYSTEM_APPS");
if (!gssysapps)
gssysapps = "/usr/lib/GNUstep/Applications";
path = checkFile(gssysapps, appdir, ext, resource);
if (path)
goto out;
path = checkFile("/usr/local/GNUstep", appdir, ext, resource);
if (path)
goto out;
path = checkFile(getenv("GNUSTEP_SYSTEM_ROOT"), appdir, ext, resource);
if (path)
goto out;
path = checkFile("/usr/GNUstep", appdir, ext, resource); /* falls through */
path = checkFile("/usr/GNUstep/System/Applications", appdir, ext, resource); /* falls through */
out:
if (tmp)
wfree(tmp);
if (appdir)
wfree(appdir);
-5
View File
@@ -229,11 +229,6 @@ void W_BalloonHandleEnterView(WMView * view)
#define LEFT 0
#define RIGHT 2
#define TLEFT (TOP|LEFT)
#define TRIGHT (TOP|RIGHT)
#define BLEFT (BOTTOM|LEFT)
#define BRIGHT (BOTTOM|RIGHT)
#define SPACE 12
static void drawBalloon(WMScreen * scr, Pixmap bitmap, Pixmap pix, int x, int y, int w, int h, int side)
+6 -12
View File
@@ -565,7 +565,7 @@ static void scrollCallback(WMWidget * scroller, void *self)
floatValue = (floatValue * value) / value;
newFirst = rint(floatValue * (float)(bPtr->columnCount - bPtr->maxVisibleColumns));
newFirst = rint(floatValue * (double)(bPtr->columnCount - bPtr->maxVisibleColumns));
if (bPtr->firstVisibleColumn != newFirst)
scrollToColumn(bPtr, newFirst, False);
@@ -619,11 +619,12 @@ void WMSetBrowserHasScroller(WMBrowser * bPtr, int hasScroller)
bPtr->flags.hasScroller = hasScroller;
}
char *WMSetBrowserPath(WMBrowser * bPtr, char *path)
const char *WMSetBrowserPath(WMBrowser * bPtr, const char *path)
{
int i;
char *str;
char *tmp, *retPtr = NULL;
char *tmp;
const char *retPtr = NULL;
int item;
WMListItem *listItem;
@@ -781,11 +782,7 @@ WMArray *WMGetBrowserPaths(WMBrowser * bPtr)
path = wmalloc(slen);
/* ignore first `/' */
for (i = 0; i <= column; i++) {
if (wstrlcat(path, bPtr->pathSeparator, slen) >= slen) {
wfree(path);
WMFreeArray(paths);
return NULL;
}
wstrlcat(path, bPtr->pathSeparator, slen);
if (i == column) {
item = lastItem;
} else {
@@ -793,10 +790,7 @@ WMArray *WMGetBrowserPaths(WMBrowser * bPtr)
}
if (!item)
break;
if (wstrlcat(path, item->text, slen) >= slen) {
wfree(path);
return NULL;
}
wstrlcat(path, item->text, slen);
}
WMAddToArray(paths, path);
}
+35 -6
View File
@@ -17,6 +17,7 @@ typedef struct W_Button {
W_Pixmap *image;
W_Pixmap *altImage;
W_Pixmap *tsImage;
W_Pixmap *dimage;
@@ -37,7 +38,7 @@ typedef struct W_Button {
WMImagePosition imagePosition:4;
WMAlignment alignment:2;
unsigned int selected:1;
unsigned int selected:2;
unsigned int enabled:1;
@@ -98,7 +99,6 @@ static void handleActionEvents(XEvent * event, void *data);
static char *WMPushedRadioNotification = "WMPushedRadioNotification";
#define NFONT(b) (b)->view->screen->normalFont
WMButton *WMCreateCustomButton(WMWidget * parent, int behaviourMask)
{
@@ -184,6 +184,14 @@ WMButton *WMCreateButton(WMWidget * parent, WMButtonType type)
bPtr->altImage = WMRetainPixmap(scrPtr->radioButtonImageOn);
break;
case WBTTriState:
bPtr = WMCreateCustomButton(parent, WBBStateChangeMask);
bPtr->flags.bordered = 0;
bPtr->image = WMRetainPixmap(scrPtr->tristateButtonImageOff);
bPtr->altImage = WMRetainPixmap(scrPtr->tristateButtonImageOn);
bPtr->tsImage = WMRetainPixmap(scrPtr->tristateButtonImageTri);
break;
default:
case WBTMomentaryLight:
bPtr = WMCreateCustomButton(parent, WBBSpringLoadedMask | WBBPushLightMask);
@@ -198,7 +206,7 @@ WMButton *WMCreateButton(WMWidget * parent, WMButtonType type)
WMSetButtonText(bPtr, DEFAULT_RADIO_TEXT);
bPtr->flags.alignment = DEFAULT_RADIO_ALIGNMENT;
bPtr->flags.imagePosition = DEFAULT_RADIO_IMAGE_POSITION;
} else if (type == WBTSwitch) {
} else if (type == WBTSwitch || type == WBTTriState) {
W_ResizeView(bPtr->view, DEFAULT_SWITCH_WIDTH, DEFAULT_SWITCH_HEIGHT);
WMSetButtonText(bPtr, DEFAULT_SWITCH_TEXT);
bPtr->flags.alignment = DEFAULT_SWITCH_ALIGNMENT;
@@ -325,6 +333,11 @@ void WMSetButtonText(WMButton * bPtr, const char *text)
}
}
const char *WMGetButtonText(WMButton *bPtr)
{
return bPtr->caption;
}
void WMSetButtonAltText(WMButton * bPtr, const char *text)
{
if (bPtr->altCaption)
@@ -367,7 +380,10 @@ void WMSetButtonDisabledTextColor(WMButton * bPtr, WMColor * color)
void WMSetButtonSelected(WMButton * bPtr, int isSelected)
{
bPtr->flags.selected = isSelected ? 1 : 0;
if ((bPtr->flags.type == WBTTriState) && (isSelected < 0))
bPtr->flags.selected = 2;
else
bPtr->flags.selected = isSelected ? 1 : 0;
if (bPtr->view->flags.realized) {
paintButton(bPtr);
@@ -380,6 +396,9 @@ int WMGetButtonSelected(WMButton * bPtr)
{
CHECK_CLASS(bPtr, WC_Button);
if ((bPtr->flags.type == WBTTriState) && (bPtr->flags.selected == 2))
return -1;
return bPtr->flags.selected;
}
@@ -554,7 +573,9 @@ static void paintButton(Button * bPtr)
if (bPtr->flags.stateChange) {
if (bPtr->altCaption)
caption = bPtr->altCaption;
if (bPtr->altImage)
if (bPtr->flags.selected == 2)
image = bPtr->tsImage;
else if (bPtr->altImage)
image = bPtr->altImage;
if (bPtr->altTextColor)
textColor = bPtr->altTextColor;
@@ -655,6 +676,8 @@ static void handleActionEvents(XEvent * event, void *data)
case ButtonPress:
if (event->xbutton.button == Button1) {
static const unsigned int next_state[4] = { [0] = 1, [1] = 2, [2] = 0 };
bPtr->flags.prevSelected = bPtr->flags.selected;
bPtr->flags.wasPushed = 0;
bPtr->flags.pushed = 1;
@@ -663,7 +686,10 @@ static void handleActionEvents(XEvent * event, void *data)
dopaint = 1;
break;
}
bPtr->flags.selected = !bPtr->flags.selected;
if (bPtr->flags.type == WBTTriState)
bPtr->flags.selected = next_state[bPtr->flags.selected];
else
bPtr->flags.selected = !bPtr->flags.selected;
dopaint = 1;
if (bPtr->flags.continuous && !bPtr->timer) {
@@ -744,5 +770,8 @@ static void destroyButton(Button * bPtr)
if (bPtr->altImage)
WMReleasePixmap(bPtr->altImage);
if (bPtr->tsImage)
WMReleasePixmap(bPtr->tsImage);
wfree(bPtr);
}
+3 -3
View File
@@ -51,7 +51,7 @@ static WMColor *findCloseColor(WMScreen * scr, unsigned short red, unsigned shor
color->refCount = 1;
color->color = xcolor;
color->alpha = alpha;
color->flags.exact = 1;
color->flags.exact = 0;
color->gc = NULL;
return color;
@@ -91,7 +91,7 @@ WMColor *WMCreateRGBColor(WMScreen * scr, unsigned short red, unsigned short gre
color = findCloseColor(scr, red, green, blue, 0xffff);
}
if (!color)
color = WMBlackColor(scr);
color = scr->black;
return color;
}
@@ -117,7 +117,7 @@ WMColor *WMCreateRGBAColor(WMScreen * scr, unsigned short red, unsigned short gr
color = findCloseColor(scr, red, green, blue, alpha);
}
if (!color)
color = WMBlackColor(scr);
color = scr->black;
return color;
}
+54 -52
View File
@@ -44,7 +44,7 @@
# include <X11/extensions/shape.h>
#endif
char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification";
const char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification";
/*
* Bitmaps for magnifying glass cursor
@@ -67,9 +67,6 @@ static unsigned char Cursor_bits[] = {
0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x70
};
/* Cursor shape-mask */
#define Cursor_shape_width 32
#define Cursor_shape_height 32
static unsigned char Cursor_shape_bits[] = {
0x00, 0x7e, 0x00, 0x00, 0xc0, 0x81, 0x03, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x08,
0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x20, 0x00, 0x02, 0x00, 0x40, 0x00, 0x02, 0x00,
@@ -264,13 +261,7 @@ enum {
#define COLORWHEEL_PART 1
#define CUSTOMPALETTE_PART 2
#define BUFSIZE 1024
#define MAX_LENGTH 1024
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
static char *generateNewFilename(const char *curName);
static void convertCPColor(CPColor * color);
@@ -403,7 +394,7 @@ static WMColorPanel *makeColorPanel(WMScreen * scrPtr, const char *name)
panel->mode = WMWheelModeColorPanel;
panel->lastChanged = 0;
panel->slidersmode = WMRGBModeColorPanel;
panel->configurationPath = wstrconcat(wusergnusteppath(), "/Library/Colors/");
panel->configurationPath = wstrconcat(wuserdatapath(), "/Colors/");
/* Some General Purpose Widgets */
panel->colorWell = WMCreateColorWell(panel->win);
@@ -721,7 +712,7 @@ static WMColorPanel *makeColorPanel(WMScreen * scrPtr, const char *name)
WMAddNotificationObserver(rgbTextFieldCallback, panel, WMTextDidEndEditingNotification, panel->rgbBlueT);
panel->rgbDecB = WMCreateButton(panel->rgbFrm, WBTRadio);
WMSetButtonText(panel->rgbDecB, "Decimal");
WMSetButtonText(panel->rgbDecB, _("Decimal"));
WMSetButtonSelected(panel->rgbDecB, 1);
panel->rgbState = RGBdec;
WMSetButtonAction(panel->rgbDecB, rgbDecToHex, panel);
@@ -729,7 +720,7 @@ static WMColorPanel *makeColorPanel(WMScreen * scrPtr, const char *name)
WMMoveWidget(panel->rgbDecB, 2, 81);
panel->rgbHexB = WMCreateButton(panel->rgbFrm, WBTRadio);
WMSetButtonText(panel->rgbHexB, "Hexadecimal");
WMSetButtonText(panel->rgbHexB, _("Hexadecimal"));
WMSetButtonAction(panel->rgbHexB, rgbDecToHex, panel);
WMResizeWidget(panel->rgbHexB, PWIDTH - 8, 23);
WMMoveWidget(panel->rgbHexB, 2, 104);
@@ -1168,21 +1159,18 @@ static void readConfiguration(W_ColorPanel * panel)
DIR *dPtr;
struct dirent *dp;
struct stat stat_buf;
int item;
if (stat(panel->configurationPath, &stat_buf) != 0) {
if (mkdir(panel->configurationPath, S_IRWXU | S_IRGRP | S_IROTH | S_IXGRP | S_IXOTH) != 0) {
werror(_("Color Panel: Could not create directory %s needed"
" to store configurations"), panel->configurationPath);
WMSetPopUpButtonEnabled(panel->customPaletteMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListColorMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListListMenuBtn, False);
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
_("File Error"),
_("Could not create ColorPanel configuration directory"),
_("OK"), NULL, NULL);
}
if (!wmkdirhier(panel->configurationPath)) {
werror(_("Color Panel: Could not create directory %s needed"
" to store configurations"), panel->configurationPath);
WMSetPopUpButtonEnabled(panel->customPaletteMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListColorMenuBtn, False);
WMSetPopUpButtonEnabled(panel->colorListListMenuBtn, False);
WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win,
_("File Error"),
_("Could not create ColorPanel configuration directory"),
_("OK"), NULL, NULL);
return;
}
@@ -1954,7 +1942,7 @@ static void wheelInitMatrix(W_ColorPanel * panel)
if (sat < 256) {
if (xcor != 0)
dhue[0] = rint(atan((double)ycor / (double)xcor) *
(180.0 / M_PI)) + (xcor < 0 ? 180.0 : 0.0);
(180.0 / WM_PI)) + (xcor < 0 ? 180.0 : 0.0);
else
dhue[0] = 270;
@@ -2240,7 +2228,7 @@ static void wheelPositionSelectionOutBounds(W_ColorPanel * panel, int x, int y)
panel->color.hsv.value = 255 - WMGetSliderValue(panel->wheelBrightnessS);
if (xcor != 0)
hue = rint(atan(-(double)ycor / (double)xcor) * (180.0 / M_PI));
hue = rint(atan(-(double)ycor / (double)xcor) * (180.0 / WM_PI));
else {
if (ycor < 0)
hue = 90;
@@ -2260,9 +2248,9 @@ static void wheelPositionSelectionOutBounds(W_ColorPanel * panel, int x, int y)
wheelUndrawSelection(panel);
panel->colx = 2 + rint((colorWheelSize * (1.0 + cos(panel->color.hsv.hue * (M_PI / 180.0)))) / 2.0);
panel->colx = 2 + rint((colorWheelSize * (1.0 + cos(panel->color.hsv.hue * (WM_PI / 180.0)))) / 2.0);
/* "+2" because of "colorWheelSize + 4" */
panel->coly = 2 + rint((colorWheelSize * (1.0 + sin(-panel->color.hsv.hue * (M_PI / 180.0)))) / 2.0);
panel->coly = 2 + rint((colorWheelSize * (1.0 + sin(-panel->color.hsv.hue * (WM_PI / 180.0)))) / 2.0);
wheelUpdateSelection(panel);
cpColor = panel->color;
@@ -2271,7 +2259,7 @@ static void wheelPositionSelectionOutBounds(W_ColorPanel * panel, int x, int y)
static void wheelUpdateBrightnessGradientFromLocation(W_ColorPanel * panel)
{
CPColor from;
CPColor from = {};
unsigned long ofs;
ofs = panel->coly * panel->wheelMtrx->width + panel->colx;
@@ -2394,6 +2382,8 @@ void rgbIntToChar(W_ColorPanel *panel, int *value)
case RGBhex:
format = "%0X";
break;
default:
format = "";
}
sprintf(tmp, format, value[0]);
@@ -2614,7 +2604,7 @@ static void cmykTextFieldCallback(void *observerData, WMNotification * notificat
static void hsbSliderCallback(WMWidget * w, void *data)
{
CPColor cpColor;
CPColor cpColor = {};
int value[3];
char tmp[4];
W_ColorPanel *panel = (W_ColorPanel *) data;
@@ -2650,9 +2640,9 @@ static void hsbSliderCallback(WMWidget * w, void *data)
static void hsbTextFieldCallback(void *observerData, WMNotification * notification)
{
CPColor cpColor;
CPColor cpColor = {};
int value[3];
char tmp[4];
char tmp[12]; /* We only 4 bytes needed, but compilers cannot know that */
int n;
W_ColorPanel *panel = (W_ColorPanel *) observerData;
@@ -2873,8 +2863,6 @@ static void customSetPalette(W_ColorPanel * panel)
panel->palXRatio = (double)(panel->customPaletteImg->width) / (double)(customPaletteWidth);
panel->palYRatio = (double)(panel->customPaletteImg->height) / (double)(customPaletteHeight);
WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
}
static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
@@ -3360,10 +3348,10 @@ static void wheelInit(W_ColorPanel * panel)
panel->colx = 2 + rint((colorWheelSize / 2.0) *
(1 + (panel->color.hsv.saturation / 255.0) *
cos(panel->color.hsv.hue * M_PI / 180.0)));
cos(panel->color.hsv.hue * WM_PI / 180.0)));
panel->coly = 2 + rint((colorWheelSize / 2.0) *
(1 + (panel->color.hsv.saturation / 255.0) *
sin(-panel->color.hsv.hue * M_PI / 180.0)));
sin(-panel->color.hsv.hue * WM_PI / 180.0)));
wheelCalculateValues(panel, panel->color.hsv.value);
@@ -3391,6 +3379,7 @@ static void grayInit(W_ColorPanel * panel)
static void rgbInit(W_ColorPanel * panel)
{
char tmp[4];
const char *format;
if (panel->color.set != cpRGB)
convertCPColor(&panel->color);
@@ -3399,11 +3388,23 @@ static void rgbInit(W_ColorPanel * panel)
WMSetSliderValue(panel->rgbGreenS, panel->color.rgb.green);
WMSetSliderValue(panel->rgbBlueS, panel->color.rgb.blue);
sprintf(tmp, "%d", panel->color.rgb.red);
switch (panel->rgbState) {
case RGBdec:
format = "%d";
break;
case RGBhex:
format = "%0X";
break;
default:
/* Avoid compiler warning */
format = "";
}
sprintf(tmp, format, panel->color.rgb.red);
WMSetTextFieldText(panel->rgbRedT, tmp);
sprintf(tmp, "%d", panel->color.rgb.green);
sprintf(tmp, format, panel->color.rgb.green);
WMSetTextFieldText(panel->rgbGreenT, tmp);
sprintf(tmp, "%d", panel->color.rgb.blue);
sprintf(tmp, format, panel->color.rgb.blue);
WMSetTextFieldText(panel->rgbBlueT, tmp);
}
@@ -3449,7 +3450,7 @@ static void hsbInit(W_ColorPanel * panel)
WMSetSliderValue(panel->hsbSaturationS, value[1]);
WMSetSliderValue(panel->hsbBrightnessS, value[2]);
sprintf(tmp, "%d", value[0]);
sprintf(tmp, "%hu", value[0]);
WMSetTextFieldText(panel->hsbHueT, tmp);
sprintf(tmp, "%d", value[1]);
WMSetTextFieldText(panel->hsbSaturationT, tmp);
@@ -3500,13 +3501,17 @@ static void convertCPColor(CPColor * color)
old_hue = color->hsv.hue;
RRGBtoHSV(&(color->rgb), &(color->hsv));
/* In black the hue is undefined, and may change by conversion
* Same for white. */
if (((color->rgb.red == 0) &&
(color->rgb.green == 0) &&
(color->rgb.blue == 0)) ||
((color->rgb.red == 0) && (color->rgb.green == 0) && (color->rgb.blue == 255))
)
/*
* For pure grey colors, the Hue is generally calculated
* as 0, but in reality the Hue does not matter.
*
* But in an interactive GUI it is interresting to remember
* the previous Hue because if user moves away from perfect
* grey then he could be interrested in finding back his
* previous tint
*/
if ((color->rgb.red == color->rgb.green) &&
(color->rgb.red == color->rgb.blue) )
color->hsv.hue = old_hue;
break;
case cpHSV:
@@ -3515,9 +3520,6 @@ static void convertCPColor(CPColor * color)
}
}
#define ABS_SHIFT(val, shift) \
(((shift) > 0) ? (val) >> (shift) : (val) << -(shift))
static RColor ulongToRColor(WMScreen * scr, unsigned long value)
{
RColor color;
+5 -6
View File
@@ -3,7 +3,7 @@
#define XDND_COLOR_DATA_TYPE "application/X-color"
char *WMColorWellDidChangeNotification = "WMColorWellDidChangeNotification";
const char *WMColorWellDidChangeNotification = "WMColorWellDidChangeNotification";
typedef struct W_ColorWell {
W_Class widgetClass;
@@ -80,7 +80,6 @@ static WMDragDestinationProcs _DragDestinationProcs = {
#define DEFAULT_WIDTH 60
#define DEFAULT_HEIGHT 30
#define DEFAULT_BORDER_WIDTH 6
#define MIN_WIDTH 16
#define MIN_HEIGHT 8
@@ -174,10 +173,10 @@ WMColorWell *WMCreateColorWell(WMWidget * parent)
void WMSetColorWellColor(WMColorWell * cPtr, WMColor * color)
{
if (cPtr->color)
if (cPtr->color && cPtr->color != color) {
WMReleaseColor(cPtr->color);
cPtr->color = WMRetainColor(color);
cPtr->color = WMRetainColor(color);
}
if (cPtr->colorView->flags.realized && cPtr->colorView->flags.mapped)
paintColorWell(cPtr);
@@ -212,7 +211,7 @@ static void willResizeColorWell(W_ViewDelegate * self, WMView * view, unsigned i
if (*height < MIN_HEIGHT)
*height = MIN_HEIGHT;
bw = (int)((float)WMIN(*width, *height) * 0.24);
bw = (int)((float)WMIN(*width, *height) * 0.24F);
W_ResizeView(cPtr->colorView, *width - 2 * bw, *height - 2 * bw);
+6
View File
@@ -29,6 +29,12 @@
# define _(text) (text)
#endif
#ifdef HAVE_SECURE_GETENV
#define GETENV(x) secure_getenv((x))
#else
#define GETENV(x) getenv((x))
#endif
#endif /* WINGS_CONFIG_H_ */
+5 -5
View File
@@ -343,7 +343,7 @@ void WMFreeFilePanel(WMFilePanel * panel)
}
int
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, char *path, const char *name, char **fileTypes)
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, const char *path, const char *name, char **fileTypes)
{
WMScreen *scr = WMWidgetScreen(panel->win);
@@ -387,12 +387,12 @@ WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, char *pat
return (panel->flags.canceled ? False : True);
}
void WMSetFilePanelDirectory(WMFilePanel * panel, char *path)
void WMSetFilePanelDirectory(WMFilePanel * panel, const char *path)
{
WMList *list;
WMListItem *item;
int col;
char *rest;
const char *rest;
rest = WMSetBrowserPath(panel->browser, path);
if (strcmp(path, "/") == 0)
@@ -748,7 +748,7 @@ static void goFloppy(WMWidget *widget, void *p_panel)
(void) widget;
if (stat(WINGsConfiguration.floppyPath, &filestat)) {
showError(scr, panel->win, _("An error occured browsing '%s'."), WINGsConfiguration.floppyPath);
showError(scr, panel->win, _("An error occurred browsing '%s'."), WINGsConfiguration.floppyPath);
return;
} else if (!S_ISDIR(filestat.st_mode)) {
showError(scr, panel->win, _("'%s' is not a directory."), WINGsConfiguration.floppyPath);
@@ -761,7 +761,7 @@ static void goFloppy(WMWidget *widget, void *p_panel)
static void goHome(WMWidget *widget, void *p_panel)
{
WMFilePanel *panel = p_panel;
char *home;
const char *home;
/* Parameter not used, but tell the compiler that it is ok */
(void) widget;
+111 -31
View File
@@ -12,6 +12,12 @@
#include <X11/Xft/Xft.h>
#include <fontconfig/fontconfig.h>
#ifdef USE_PANGO
#include <pango/pango.h>
#include <pango/pangofc-fontmap.h>
#include <pango/pangoxft.h>
#endif
#define DEFAULT_FONT "sans serif:pixelsize=12"
#define DEFAULT_SIZE WINGsConfiguration.defaultFontSize
@@ -64,37 +70,30 @@ static Bool hasProperty(FcPattern * pattern, const char *property)
return False;
}
static Bool hasPropertyWithStringValue(FcPattern * pattern, const char *object, const char *value)
{
FcChar8 *str;
int id;
if (!value || value[0] == 0)
return True;
id = 0;
while (FcPatternGetString(pattern, object, id, &str) == FcResultMatch) {
if (strcasecmp(value, (char *)str) == 0) {
return True;
}
id++;
}
return False;
}
static char *makeFontOfSize(const char *font, int size, const char *fallback)
{
FcPattern *pattern;
FcPattern *pattern = NULL;
char *result;
if (font[0] == '-') {
if (font && font[0] == '-') {
pattern = xlfdToFcPattern(font);
} else {
pattern = FcNameParse((const FcChar8 *) font);
}
/*FcPatternPrint(pattern); */
if (!pattern) {
wwarning(_("could not load font spec: %s."), font);
if (!fallback)
return NULL;
pattern = FcPatternCreate();
if (!pattern)
return NULL;
if (!FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) fallback)) {
wfatal(_("could not load default font spec: %s."), fallback);
FcPatternDestroy(pattern);
return NULL;
}
}
if (size > 0) {
FcPatternDel(pattern, FC_PIXEL_SIZE);
@@ -103,12 +102,6 @@ static char *makeFontOfSize(const char *font, int size, const char *fallback)
FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)DEFAULT_SIZE);
}
if (fallback && !hasPropertyWithStringValue(pattern, FC_FAMILY, fallback)) {
FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) fallback);
}
/*FcPatternPrint(pattern); */
result = (char *)FcNameUnparse(pattern);
FcPatternDestroy(pattern);
@@ -120,8 +113,16 @@ WMFont *WMCreateFont(WMScreen * scrPtr, const char *fontName)
Display *display = scrPtr->display;
WMFont *font;
char *fname;
#ifdef USE_PANGO
PangoFontMap *fontmap;
PangoContext *context;
PangoLayout *layout;
FcPattern *pattern;
PangoFontDescription *description;
double size;
#endif
if (fontName[0] == '-') {
if (fontName && fontName[0] == '-') {
fname = xlfdToFcName(fontName);
} else {
fname = wstrdup(fontName);
@@ -156,6 +157,29 @@ WMFont *WMCreateFont(WMScreen * scrPtr, const char *fontName)
font->name = fname;
#ifdef USE_PANGO
fontmap = pango_xft_get_font_map(scrPtr->display, scrPtr->screen);
context = pango_font_map_create_context(fontmap);
layout = pango_layout_new(context);
pattern = FcNameParse((FcChar8 *) font->name);
description = pango_fc_font_description_from_pattern(pattern, FALSE);
/* Pango examines FC_SIZE but not FC_PIXEL_SIZE of the patten, but
* font-name has only "pixelsize", so set the size manually here.
*/
if (FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
pango_font_description_set_absolute_size(description, size * PANGO_SCALE);
pango_layout_set_font_description(layout, description);
font->layout = layout;
pango_font_description_free(description);
g_object_unref(context);
FcPatternDestroy(pattern);
#endif
assert(WMHashInsert(scrPtr->fontCache, font->name, font) == NULL);
return font;
@@ -177,6 +201,11 @@ void WMReleaseFont(WMFont * font)
font->refCount--;
if (font->refCount < 1) {
XftFontClose(font->screen->display, font->font);
#ifdef USE_PANGO
if (font->layout) {
g_object_unref(font->layout);
}
#endif
if (font->name) {
WMHashRemove(font->screen->fontCache, font->name);
wfree(font->name);
@@ -204,6 +233,16 @@ char *WMGetFontName(WMFont * font)
return font->name;
}
void WMGetScaleBaseFromSystemFont(WMScreen *scrPtr, int *alphabetWidth, int *fontHeight)
{
WMFont *font;
font = WMDefaultSystemFont(scrPtr);
*alphabetWidth = WMWidthOfString(font, "abcdefghijklmnopqrstuvwxyz", 26);
*fontHeight = WMFontHeight(font);
WMReleaseFont(font);
}
WMFont *WMDefaultSystemFont(WMScreen * scrPtr)
{
return WMRetainFont(scrPtr->normalFont);
@@ -219,7 +258,11 @@ WMFont *WMSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;
fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, NULL);
fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, DEFAULT_FONT);
if (!fontSpec) {
return NULL;
}
font = WMCreateFont(scrPtr, fontSpec);
@@ -237,7 +280,11 @@ WMFont *WMBoldSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;
fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, NULL);
fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, DEFAULT_FONT);
if (!fontSpec) {
return NULL;
}
font = WMCreateFont(scrPtr, fontSpec);
@@ -252,18 +299,34 @@ WMFont *WMBoldSystemFontOfSize(WMScreen * scrPtr, int size)
int WMWidthOfString(WMFont * font, const char *text, int length)
{
#ifdef USE_PANGO
const char *previous_text;
int width;
#else
XGlyphInfo extents;
#endif
wassertrv(font != NULL && text != NULL, 0);
#ifdef USE_PANGO
previous_text = pango_layout_get_text(font->layout);
if ((previous_text == NULL) || (strncmp(text, previous_text, length) != 0) || previous_text[length] != '\0')
pango_layout_set_text(font->layout, text, length);
pango_layout_get_pixel_size(font->layout, &width, NULL);
return width;
#else
XftTextExtentsUtf8(font->screen->display, font->font, (XftChar8 *) text, length, &extents);
return extents.xOff; /* don't ask :P */
#endif
}
void WMDrawString(WMScreen * scr, Drawable d, WMColor * color, WMFont * font, int x, int y, const char *text, int length)
{
XftColor xftcolor;
#ifdef USE_PANGO
const char *previous_text;
#endif
wassertr(font != NULL);
@@ -275,7 +338,14 @@ void WMDrawString(WMScreen * scr, Drawable d, WMColor * color, WMFont * font, in
XftDrawChange(scr->xftdraw, d);
#ifdef USE_PANGO
previous_text = pango_layout_get_text(font->layout);
if ((previous_text == NULL) || (strncmp(text, previous_text, length) != 0) || previous_text[length] != '\0')
pango_layout_set_text(font->layout, text, length);
pango_xft_render_layout(scr->xftdraw, &xftcolor, font->layout, x * PANGO_SCALE, y * PANGO_SCALE);
#else
XftDrawStringUtf8(scr->xftdraw, &xftcolor, font->font, x, y + font->y, (XftChar8 *) text, length);
#endif
}
void
@@ -284,6 +354,9 @@ WMDrawImageString(WMScreen * scr, Drawable d, WMColor * color, WMColor * backgro
{
XftColor textColor;
XftColor bgColor;
#ifdef USE_PANGO
const char *previous_text;
#endif
wassertr(font != NULL);
@@ -303,7 +376,14 @@ WMDrawImageString(WMScreen * scr, Drawable d, WMColor * color, WMColor * backgro
XftDrawRect(scr->xftdraw, &bgColor, x, y, WMWidthOfString(font, text, length), font->height);
#ifdef USE_PANGO
previous_text = pango_layout_get_text(font->layout);
if ((previous_text == NULL) || (strncmp(text, previous_text, length) != 0) || previous_text[length] != '\0')
pango_layout_set_text(font->layout, text, length);
pango_xft_render_layout(scr->xftdraw, &textColor, font->layout, x * PANGO_SCALE, y * PANGO_SCALE);
#else
XftDrawStringUtf8(scr->xftdraw, &textColor, font->font, x, y + font->y, (XftChar8 *) text, length);
#endif
}
WMFont *WMCopyFontWithStyle(WMScreen * scrPtr, WMFont * font, WMFontStyle style)
+9 -6
View File
@@ -43,8 +43,6 @@ typedef struct W_FontPanel {
#define MIN_UPPER_HEIGHT 20
#define MIN_LOWER_HEIGHT 140
#define MAX_FONTS_TO_RETRIEVE 2000
#define BUTTON_SPACE_HEIGHT 40
#define MIN_WIDTH 250
@@ -701,8 +699,10 @@ static void typefaceClick(WMWidget * w, void *data)
WMClearList(panel->sizLs);
WM_ITERATE_ARRAY(face->sizes, size, i) {
if ((uintptr_t)size != 0) {
sprintf(buffer, "%li", (uintptr_t)size);
if (size != NULL) {
int size_int = (intptr_t) size;
sprintf(buffer, "%i", size_int);
WMAddListItem(panel->sizLs, buffer);
}
@@ -800,8 +800,11 @@ static void setFontPanelFontName(FontPanel * panel, const char *family, const ch
WM_ITERATE_ARRAY(face->sizes, vsize, i) {
char buffer[32];
if ((uintptr_t)vsize != 0) {
sprintf(buffer, "%li", (uintptr_t)vsize);
if (vsize != NULL) {
int size_int = (intptr_t) vsize;
sprintf(buffer, "%i", size_int);
WMAddListItem(panel->sizLs, buffer);
}
+3
View File
@@ -253,6 +253,9 @@ WMFrame *WMCreateFrame(WMWidget * parent)
static void destroyFrame(Frame * fPtr)
{
if (fPtr->textColor)
WMReleaseColor(fPtr->textColor);
if (fPtr->caption)
wfree(fPtr->caption);
+87 -15
View File
@@ -97,6 +97,66 @@ static char *RADIO_BUTTON_OFF[] = {
"..... .....",
};
#define TRISTATE_BUTTON_ON_WIDTH 15
#define TRISTATE_BUTTON_ON_HEIGHT 15
static char *TRISTATE_BUTTON_ON[] = {
"%%%%%%%%%%%%%%.",
"%%%%%%%%%%%%%. ",
"%% . ",
"%% ## ## . ",
"%% ### ### . ",
"%% ### ### . ",
"%% ##### . ",
"%% ### . ",
"%% ##### . ",
"%% ### ### . ",
"%% ### ### . ",
"%% ## ## . ",
"%% . ",
"%............. ",
". ",
};
#define TRISTATE_BUTTON_OFF_WIDTH 15
#define TRISTATE_BUTTON_OFF_HEIGHT 15
static char *TRISTATE_BUTTON_OFF[] = {
"%%%%%%%%%%%%%%.",
"%%%%%%%%%%%%%. ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%% . ",
"%............. ",
". ",
};
#define TRISTATE_BUTTON_TRI_WIDTH 15
#define TRISTATE_BUTTON_TRI_HEIGHT 15
static char *TRISTATE_BUTTON_TRI[] = {
"%%%%%%%%%%%%%%.",
"%%%%%%%%%%%%%. ",
"%% . ",
"%% # # # # # . ",
"%% # # # # . ",
"%% # # # # # . ",
"%% # # # # . ",
"%% # # # # # . ",
"%% # # # # . ",
"%% # # # # # . ",
"%% # # # # . ",
"%% # # # # # . ",
"%% . ",
"%............. ",
". ",
};
static char *BUTTON_ARROW[] = {
"..................",
"....##....#### ...",
@@ -325,6 +385,7 @@ static void renderPixmap(W_Screen * screen, Pixmap d, Pixmap mask, char **data,
if (mask)
XDrawPoint(screen->display, mask, screen->monoGC, x, y);
/* FALLTHRU */
case '.':
case 'l':
XDrawPoint(screen->display, d, lightGC, x, y);
@@ -363,10 +424,7 @@ static WMPixmap *makePixmap(W_Screen * sPtr, char **data, int width, int height,
}
#define T_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.tiff"
#define T_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.tiff"
#define X_WINGS_IMAGES_FILE RESOURCE_PATH"/Images.xpm"
#define X_DEFAULT_OBJECT_ICON_FILE RESOURCE_PATH"/defaultIcon.xpm"
static Bool loadPixmaps(WMScreen * scr)
{
@@ -474,16 +532,6 @@ static Bool loadPixmaps(WMScreen * scr)
RReleaseImage(image);
#if 0
scr->defaultObjectIcon = WMCreatePixmapFromFile(scr, T_DEFAULT_OBJECT_ICON_FILE);
if (!scr->defaultObjectIcon) {
scr->defaultObjectIcon = WMCreatePixmapFromFile(scr, X_DEFAULT_OBJECT_ICON_FILE);
}
if (!scr->defaultObjectIcon) {
wwarning("WINGs: could not load default icon file");
return False;
}
#endif
return True;
}
@@ -492,7 +540,7 @@ WMScreen *WMOpenScreen(const char *display)
Display *dpy = XOpenDisplay(display);
if (!dpy) {
wwarning("WINGs: could not open display %s", XDisplayName(display));
wwarning(_("WINGs: could not open display %s"), XDisplayName(display));
return NULL;
}
@@ -742,6 +790,15 @@ WMScreen *WMCreateScreenWithRContext(Display * display, int screen, RContext * c
scrPtr->radioButtonImageOff = makePixmap(scrPtr, RADIO_BUTTON_OFF,
RADIO_BUTTON_OFF_WIDTH, RADIO_BUTTON_OFF_HEIGHT, False);
scrPtr->tristateButtonImageOn = makePixmap(scrPtr, TRISTATE_BUTTON_ON,
TRISTATE_BUTTON_ON_WIDTH, TRISTATE_BUTTON_ON_HEIGHT, False);
scrPtr->tristateButtonImageOff = makePixmap(scrPtr, TRISTATE_BUTTON_OFF,
TRISTATE_BUTTON_OFF_WIDTH, TRISTATE_BUTTON_OFF_HEIGHT, False);
scrPtr->tristateButtonImageTri = makePixmap(scrPtr, TRISTATE_BUTTON_TRI,
TRISTATE_BUTTON_TRI_WIDTH, TRISTATE_BUTTON_TRI_HEIGHT, False);
scrPtr->buttonArrow = makePixmap(scrPtr, BUTTON_ARROW, BUTTON_ARROW_WIDTH, BUTTON_ARROW_HEIGHT, False);
scrPtr->pushedButtonArrow = makePixmap(scrPtr, BUTTON_ARROW2,
@@ -888,7 +945,7 @@ void WMSetFocusToWidget(WMWidget * widget)
/*
* WMRealizeWidget-
* Realizes the widget and all it's children.
* Realizes the widget and all its children.
*
*/
void WMRealizeWidget(WMWidget * w)
@@ -960,6 +1017,21 @@ WMColor *WMGetWidgetBackgroundColor(WMWidget * w)
return W_VIEW(w)->backColor;
}
void WMSetWidgetBackgroundPixmap(WMWidget *w, WMPixmap *pix)
{
if (!pix)
return;
W_SetViewBackgroundPixmap(W_VIEW(w), pix);
if (W_VIEW(w)->flags.mapped)
WMRedisplayWidget(w);
}
WMPixmap *WMGetWidgetBackgroundPixmap(WMWidget *w)
{
return W_VIEW(w)->backImage;
}
void WMRaiseWidget(WMWidget * w)
{
W_RaiseView(W_VIEW(w));
+32 -1
View File
@@ -1,6 +1,8 @@
#include <X11/Xlib.h>
#include "wconfig.h"
#include "WINGsP.h"
typedef struct W_IMContext {
@@ -60,7 +62,7 @@ void W_InitIM(W_Screen * scr)
cb.callback = destroyIM_cb;
cb.client_data = (XPointer) scr;
if (XSetIMValues(scr->imctx->xim, XNDestroyCallback, &cb, NULL))
wwarning("could not add destroy callback for input method");
wwarning(_("could not add destroy callback for XIM input method"));
XUnregisterIMInstantiateCallback(scr->display, NULL, NULL, NULL, instantiateIM_cb, (XPointer) scr);
/* Get available input style */
XGetIMValues(scr->imctx->xim, XNQueryInputStyle, &im_styles, NULL);
@@ -211,3 +213,32 @@ int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer, int bufl
#endif
return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
}
/*
* Map a keycode to the corresponding keysym
* To replace the deprecated X11 function XKeycodeToKeysym
*/
KeySym W_KeycodeToKeysym(Display *display, KeyCode keycode, int index)
{
static int min_kc = -1;
static int max_kc;
int num_syms;
KeySym *key_syms;
KeySym ks;
XDisplayKeycodes(display, &min_kc, &max_kc);
if (keycode < min_kc || keycode > max_kc || index < 0) {
return NoSymbol;
}
key_syms = XGetKeyboardMapping(display, keycode, 1, &num_syms);
if (index >= num_syms) {
XFree(key_syms);
return NoSymbol;
}
ks = key_syms[index];
XFree(key_syms);
return ks;
}
+500 -11
View File
@@ -1,8 +1,10 @@
#include "WINGsP.h"
#include <ctype.h>
#include <strings.h>
char *WMListDidScrollNotification = "WMListDidScrollNotification";
char *WMListSelectionDidChangeNotification = "WMListSelectionDidChangeNotification";
const char *WMListDidScrollNotification = "WMListDidScrollNotification";
const char *WMListSelectionDidChangeNotification = "WMListSelectionDidChangeNotification";
typedef struct W_List {
W_Class widgetClass;
@@ -27,11 +29,15 @@ typedef struct W_List {
WMHandlerID *idleID; /* for updating the scroller after adding elements */
WMHandlerID *selectID; /* for selecting items in list while scrolling */
WMHandlerID *typeaheadID; /* for clearing typeahead buffer */
WMScroller *vScroller;
Pixmap doubleBuffer;
char *typeahead;
int typeaheadLen;
struct {
unsigned int allowMultipleSelection:1;
unsigned int allowEmptySelection:1;
@@ -48,6 +54,7 @@ typedef struct W_List {
#define DEFAULT_HEIGHT 150
#define SCROLL_DELAY 100
#define TYPEAHEAD_CLEAR_DELAY 700
static void destroyList(List * lPtr);
static void paintList(List * lPtr);
@@ -62,6 +69,8 @@ static void scrollBackwardSelecting(void *data);
static void vScrollCallBack(WMWidget * scroller, void *self);
static void toggleItemSelection(WMList * lPtr, int index);
static void jumpToFirstItemWithPrefix(WMList * lPtr, const char *prefix, int prefixLen);
static void typeaheadTimeout(void *data);
static void updateGeometry(WMList * lPtr);
static void didResizeList(W_ViewDelegate * self, WMView * view);
@@ -113,6 +122,9 @@ WMList *WMCreateList(WMWidget * parent)
W_Screen *scrPtr = W_VIEW(parent)->screen;
lPtr = wmalloc(sizeof(List));
lPtr->typeahead = NULL;
lPtr->typeaheadLen = 0;
lPtr->typeaheadID = NULL;
lPtr->widgetClass = WC_List;
@@ -129,7 +141,8 @@ WMList *WMCreateList(WMWidget * parent)
| ClientMessageMask, handleEvents, lPtr);
WMCreateEventHandler(lPtr->view, ButtonPressMask | ButtonReleaseMask
| EnterWindowMask | LeaveWindowMask | ButtonMotionMask, handleActionEvents, lPtr);
| EnterWindowMask | LeaveWindowMask | ButtonMotionMask
| KeyPressMask, handleActionEvents, lPtr);
lPtr->itemHeight = WMFontHeight(scrPtr->normalFont) + 1;
@@ -288,6 +301,14 @@ void WMClearList(WMList * lPtr)
WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL;
}
if (lPtr->typeaheadID) {
WMDeleteTimerHandler(lPtr->typeaheadID);
lPtr->typeaheadID = NULL;
}
if (lPtr->typeahead) {
lPtr->typeahead[0] = '\0';
lPtr->typeaheadLen = 0;
}
if (lPtr->view->flags.realized) {
updateScroller(lPtr);
}
@@ -495,15 +516,16 @@ static void paintItem(List * lPtr, int index)
static void paintList(List * lPtr)
{
W_Screen *scrPtr = lPtr->view->screen;
int i, lim;
int i, lim, itemCount;
if (!lPtr->view->flags.mapped)
return;
if (WMGetArrayItemCount(lPtr->items) > 0) {
if (lPtr->topItem + lPtr->fullFitLines + lPtr->flags.dontFitAll > WMGetArrayItemCount(lPtr->items)) {
itemCount = WMGetArrayItemCount(lPtr->items);
if (itemCount > 0) {
if (lPtr->topItem + lPtr->fullFitLines + lPtr->flags.dontFitAll > itemCount) {
lim = WMGetArrayItemCount(lPtr->items) - lPtr->topItem;
lim = itemCount - lPtr->topItem;
XClearArea(scrPtr->display, lPtr->view->window, 19,
2 + lim * lPtr->itemHeight, lPtr->view->size.width - 21,
lPtr->view->size.height - lim * lPtr->itemHeight - 3, False);
@@ -820,7 +842,7 @@ void WMSetListSelectionToRange(WMList * lPtr, WMRange range)
void WMSelectAllListItems(WMList * lPtr)
{
int i;
int i, itemCount;
WMListItem *item;
if (!lPtr->flags.allowMultipleSelection)
@@ -833,7 +855,8 @@ void WMSelectAllListItems(WMList * lPtr)
WMFreeArray(lPtr->selectedItems);
lPtr->selectedItems = WMCreateArrayWithArray(lPtr->items);
for (i = 0; i < WMGetArrayItemCount(lPtr->items); i++) {
itemCount = WMGetArrayItemCount(lPtr->items);
for (i = 0; i < itemCount; i++) {
item = WMGetFromArray(lPtr->items, i);
if (!item->selected) {
item->selected = 1;
@@ -859,10 +882,11 @@ void WMSelectAllListItems(WMList * lPtr)
*/
static void unselectAllListItems(WMList * lPtr, WMListItem * exceptThis)
{
int i;
int i, itemCount;
WMListItem *item;
for (i = 0; i < WMGetArrayItemCount(lPtr->items); i++) {
itemCount = WMGetArrayItemCount(lPtr->items);
for (i = 0; i < itemCount; i++) {
item = WMGetFromArray(lPtr->items, i);
if (item != exceptThis && item->selected) {
item->selected = 0;
@@ -920,6 +944,85 @@ static void toggleItemSelection(WMList * lPtr, int index)
}
}
static int findItemWithPrefix(List * lPtr, const char *prefix, int prefixLen)
{
if (prefixLen <= 0)
return -1;
int i, itemCount;
itemCount = WMGetArrayItemCount(lPtr->items);
for (i = 0; i < itemCount; i++) {
WMListItem *item = WMGetFromArray(lPtr->items, i);
if (!item || !item->text || item->text[0] == '\0')
continue;
if (strncasecmp(item->text, prefix, prefixLen) == 0)
return i;
}
return -1;
}
static void jumpToFirstItemWithPrefix(WMList * lPtr, const char *prefix, int prefixLen)
{
int index, oldTop, visibleCount;
index = findItemWithPrefix(lPtr, prefix, prefixLen);
if (index < 0)
return;
if (lPtr->flags.allowMultipleSelection) {
WMRange range;
range.position = index;
range.count = 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMSelectListItem(lPtr, index);
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
visibleCount = lPtr->fullFitLines + lPtr->flags.dontFitAll;
if (visibleCount < 1)
visibleCount = 1;
oldTop = lPtr->topItem;
if (index < lPtr->topItem) {
lPtr->topItem = index;
} else {
if (lPtr->flags.dontFitAll) {
if (lPtr->fullFitLines <= 0) {
lPtr->topItem = index;
} else {
int lastFullyVisible = lPtr->topItem + lPtr->fullFitLines - 1;
if (index > lastFullyVisible)
lPtr->topItem = index - lPtr->fullFitLines + 1;
}
} else if (index >= lPtr->topItem + visibleCount) {
lPtr->topItem = index - visibleCount + 1;
}
}
if (lPtr->topItem < 0)
lPtr->topItem = 0;
if (lPtr->view->flags.realized && lPtr->topItem != oldTop)
updateScroller(lPtr);
}
static void typeaheadTimeout(void *data)
{
List *lPtr = (List *) data;
lPtr->typeaheadID = NULL;
if (lPtr->typeahead) {
lPtr->typeahead[0] = '\0';
lPtr->typeaheadLen = 0;
}
}
static void handleActionEvents(XEvent * event, void *data)
{
List *lPtr = (List *) data;
@@ -959,6 +1062,7 @@ static void handleActionEvents(XEvent * event, void *data)
WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL;
}
WMSetFocusToWidget(lPtr);
break;
case LeaveNotify:
@@ -970,6 +1074,9 @@ static void handleActionEvents(XEvent * event, void *data)
lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY, scrollBackwardSelecting, lPtr);
}
}
WMWidget *parentWidget = WMWidgetOfView(lPtr->view->parent);
if (parentWidget)
WMSetFocusToWidget(parentWidget);
break;
case ButtonPress:
@@ -1076,6 +1183,381 @@ static void handleActionEvents(XEvent * event, void *data)
prevItem = tmp;
}
break;
case KeyPress:
char buffer[16];
KeySym ksym;
Status status;
int len;
WMScreen *scr = lPtr->view->screen;
XWindowAttributes wattr;
if (event->xkey.state & (ControlMask | Mod1Mask))
break;
if (!(XGetWindowAttributes(scr->display, lPtr->view->window, &wattr) && wattr.map_state == IsViewable))
break;
len = W_LookupString(lPtr->view, &event->xkey, buffer, (int)sizeof(buffer) - 1, &ksym, &status);
if (len < 0)
break;
if (len > 0)
buffer[len] = '\0';
/* Handle navigation keys */
switch (ksym) {
case XK_Up: {
int newRow;
int itemCount = WMGetArrayItemCount(lPtr->items);
int cur = WMGetListSelectedItemRow(lPtr);
if (lPtr->flags.allowMultipleSelection && WMGetArrayItemCount(lPtr->selectedItems) > 0) {
WMListItem *lastSel = WMGetFromArray(lPtr->selectedItems, WMGetArrayItemCount(lPtr->selectedItems) - 1);
if (lastSel)
cur = WMGetFirstInArray(lPtr->items, lastSel);
}
if (cur == WLNotFound)
cur = lPtr->topItem;
newRow = cur - 1;
if (newRow < 0)
newRow = 0;
if (newRow != cur && itemCount > 0) {
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = cur;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
/* Ensure visibility */
if (newRow < lPtr->topItem) {
lPtr->topItem = newRow;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
}
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
case XK_Down: {
int newRow;
int itemCount = WMGetArrayItemCount(lPtr->items);
int cur = WMGetListSelectedItemRow(lPtr);
if (lPtr->flags.allowMultipleSelection && WMGetArrayItemCount(lPtr->selectedItems) > 0) {
WMListItem *lastSel = WMGetFromArray(lPtr->selectedItems, WMGetArrayItemCount(lPtr->selectedItems) - 1);
if (lastSel)
cur = WMGetFirstInArray(lPtr->items, lastSel);
}
if (cur == WLNotFound)
cur = lPtr->topItem;
newRow = cur + 1;
if (newRow >= itemCount)
newRow = itemCount - 1;
if (newRow != cur && itemCount > 0) {
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = cur;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
/* Ensure visibility */
if (newRow > (lPtr->topItem + lPtr->fullFitLines - 1)) {
lPtr->topItem = newRow - lPtr->fullFitLines + 1;
if (lPtr->topItem < 0)
lPtr->topItem = 0;
/* Ensure we don't scroll past the end */
if (lPtr->topItem + lPtr->fullFitLines > itemCount)
lPtr->topItem = itemCount - lPtr->fullFitLines;
if (lPtr->topItem < 0)
lPtr->topItem = 0;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
}
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
case XK_Page_Up: {
int newRow;
int page = lPtr->fullFitLines > 0 ? lPtr->fullFitLines : 1;
int cur = WMGetListSelectedItemRow(lPtr);
if (cur == WLNotFound)
cur = lPtr->topItem;
newRow = cur - page;
if (newRow < 0)
newRow = 0;
if (newRow != cur) {
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = cur;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
if (newRow < lPtr->topItem) {
lPtr->topItem = newRow;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
}
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
case XK_Page_Down: {
int newRow;
int page = lPtr->fullFitLines > 0 ? lPtr->fullFitLines : 1;
int itemCount = WMGetArrayItemCount(lPtr->items);
int cur = WMGetListSelectedItemRow(lPtr);
if (cur == WLNotFound)
cur = lPtr->topItem;
newRow = cur + page;
if (newRow >= itemCount)
newRow = itemCount - 1;
if (newRow != cur && itemCount > 0) {
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = cur;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
/* Ensure visibility */
if (newRow > (lPtr->topItem + lPtr->fullFitLines - 1)) {
lPtr->topItem = newRow - lPtr->fullFitLines + 1;
if (lPtr->topItem < 0)
lPtr->topItem = 0;
/* Ensure we don't scroll past the end */
if (lPtr->topItem + lPtr->fullFitLines > itemCount)
lPtr->topItem = itemCount - lPtr->fullFitLines;
if (lPtr->topItem < 0)
lPtr->topItem = 0;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
}
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
case XK_Home: {
int itemCount = WMGetArrayItemCount(lPtr->items);
if (itemCount > 0) {
int newRow = 0;
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = lPtr->topItem;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
if (newRow < lPtr->topItem) {
lPtr->topItem = newRow;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
}
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
case XK_End: {
int itemCount = WMGetArrayItemCount(lPtr->items);
if (itemCount > 0) {
int newRow = itemCount - 1;
if (lPtr->flags.allowMultipleSelection) {
if (event->xkey.state & ShiftMask) {
WMRange range;
int anchor = WMGetListSelectedItemRow(lPtr);
if (anchor == WLNotFound || WMGetArrayItemCount(lPtr->selectedItems) == 0) {
anchor = lPtr->topItem;
}
range.position = anchor;
if (newRow >= anchor)
range.count = newRow - anchor + 1;
else
range.count = newRow - anchor - 1;
WMSetListSelectionToRange(lPtr, range);
} else {
WMRange range = { .position = newRow, .count = 1 };
WMSetListSelectionToRange(lPtr, range);
lastClicked = newRow;
}
} else {
WMSelectListItem(lPtr, newRow);
lastClicked = newRow;
}
/* Ensure the last item is fully visible */
lPtr->topItem = itemCount - lPtr->fullFitLines;
if (lPtr->topItem < 0)
lPtr->topItem = 0;
if (lPtr->view->flags.realized)
updateScroller(lPtr);
/* Trigger action callback */
if (lPtr->action)
(*lPtr->action) (lPtr, lPtr->clientData);
}
break;
}
default:
break;
}
/* If we handled a navigation keysym, avoid falling through to typeahead logic */
if (ksym == XK_Up || ksym == XK_Down || ksym == XK_Page_Up || ksym == XK_Page_Down || ksym == XK_Home || ksym == XK_End)
break;
if (len <= 0)
break;
buffer[len] = '\0';
if (ksym == XK_Escape) {
if (lPtr->typeaheadID) {
WMDeleteTimerHandler(lPtr->typeaheadID);
lPtr->typeaheadID = NULL;
}
if (lPtr->typeahead) {
lPtr->typeahead[0] = '\0';
lPtr->typeaheadLen = 0;
}
break;
}
if (ksym == XK_BackSpace) {
if (lPtr->typeaheadLen > 0 && lPtr->typeahead) {
lPtr->typeaheadLen--;
lPtr->typeahead[lPtr->typeaheadLen] = '\0';
}
} else if (len == 1 && isalnum((unsigned char)buffer[0])) {
if (!lPtr->typeahead) {
lPtr->typeahead = wmalloc(2);
lPtr->typeaheadLen = 0;
}
lPtr->typeahead = wrealloc(lPtr->typeahead, lPtr->typeaheadLen + 2);
lPtr->typeahead[lPtr->typeaheadLen] = buffer[0];
lPtr->typeaheadLen++;
lPtr->typeahead[lPtr->typeaheadLen] = '\0';
} else {
break;
}
if (lPtr->typeaheadLen > 0)
jumpToFirstItemWithPrefix(lPtr, lPtr->typeahead, lPtr->typeaheadLen);
if (lPtr->typeaheadID) {
WMDeleteTimerHandler(lPtr->typeaheadID);
lPtr->typeaheadID = NULL;
}
if (lPtr->typeaheadLen > 0)
lPtr->typeaheadID = WMAddTimerHandler(TYPEAHEAD_CLEAR_DELAY, typeaheadTimeout, lPtr);
break;
}
if (lPtr->topItem != topItem)
WMPostNotificationName(WMListDidScrollNotification, lPtr, NULL);
@@ -1123,6 +1605,10 @@ static void destroyList(List * lPtr)
WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL;
if (lPtr->typeaheadID)
WMDeleteTimerHandler(lPtr->typeaheadID);
lPtr->typeaheadID = NULL;
if (lPtr->selectedItems)
WMFreeArray(lPtr->selectedItems);
@@ -1132,6 +1618,9 @@ static void destroyList(List * lPtr)
if (lPtr->doubleBuffer)
XFreePixmap(lPtr->view->screen->display, lPtr->doubleBuffer);
if (lPtr->typeahead)
wfree(lPtr->typeahead);
WMRemoveNotificationObserver(lPtr);
wfree(lPtr);
+18 -7
View File
@@ -122,11 +122,14 @@ static int fitText(const char *text, WMFont * font, int width, int wrap)
word1 = word2;
}
for (i = word1; i < word2; i++) {
w = WMWidthOfString(font, text, i);
if (w > width) {
/* Advance character by character (not byte by byte) */
i = word1;
while (i < word2) {
int next_i = i + oneUTF8CharForward(text + i, word2 - i);
w = WMWidthOfString(font, text, next_i);
if (w > width)
break;
}
i = next_i;
}
/* keep words complete if possible */
@@ -220,12 +223,20 @@ W_PaintTextAndImage(W_View * view, int wrap, WMColor * textColor, W_Font * font,
XFillRectangle(screen->display, d, WMColorGC(backColor),
0, 0, view->size.width, view->size.height);
} else {
if (view->attribs.background_pixmap) {
#ifndef DOUBLE_BUFFER
XClearWindow(screen->display, d);
XClearWindow(screen->display, d);
#else
XSetForeground(screen->display, screen->copyGC, view->attribs.background_pixel);
XFillRectangle(screen->display, d, screen->copyGC, 0, 0, view->size.width, view->size.height);
XCopyArea(screen->display, view->attribs.background_pixmap, d, screen->copyGC, 0, 0, view->size.width, view->size.height, 0, 0);
#endif
} else {
#ifndef DOUBLE_BUFFER
XClearWindow(screen->display, d);
#else
XSetForeground(screen->display, screen->copyGC, view->attribs.background_pixel);
XFillRectangle(screen->display, d, screen->copyGC, 0, 0, view->size.width, view->size.height);
#endif
}
}
if (relief == WRFlat) {
+290 -10
View File
@@ -25,7 +25,7 @@ static void handleKeyPress(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if (ksym == XK_Return && panel->defBtn) {
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn || panel->othBtn) {
@@ -89,10 +89,12 @@ WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
const char *alternateButton, const char *otherButton)
{
WMAlertPanel *panel;
WMFont *defaultFont;
int dw = 0, aw = 0, ow = 0, w;
WMBox *hbox;
WMPixmap *icon;
defaultFont = WMSystemFontOfSize(scrPtr, 12);
panel = wmalloc(sizeof(WMAlertPanel));
if (owner) {
@@ -160,6 +162,7 @@ WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
WMFontHeight(scrPtr->normalFont) * 4, 0, 5);
WMSetLabelText(panel->mLbl, msg);
WMSetLabelTextAlignment(panel->mLbl, WACenter);
WMSetLabelFont(panel->mLbl, defaultFont);
}
panel->hbox = WMCreateBox(panel->vbox);
@@ -170,13 +173,13 @@ WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
/* create buttons */
if (otherButton)
ow = WMWidthOfString(scrPtr->normalFont, otherButton, strlen(otherButton));
ow = WMWidthOfString(defaultFont, otherButton, strlen(otherButton));
if (alternateButton)
aw = WMWidthOfString(scrPtr->normalFont, alternateButton, strlen(alternateButton));
aw = WMWidthOfString(defaultFont, alternateButton, strlen(alternateButton));
if (defaultButton)
dw = WMWidthOfString(scrPtr->normalFont, defaultButton, strlen(defaultButton));
dw = WMWidthOfString(defaultFont, defaultButton, strlen(defaultButton));
dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
@@ -206,18 +209,187 @@ WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);
WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(panel->defBtn, WIPRight);
WMSetButtonFont(panel->defBtn, defaultFont);
}
if (alternateButton) {
panel->altBtn = WMCreateCommandButton(panel->hbox);
WMAddBoxSubviewAtEnd(panel->hbox, WMWidgetView(panel->altBtn), False, True, aw, 0, 5);
WMSetButtonAction(panel->altBtn, alertPanelOnClick, panel);
WMSetButtonText(panel->altBtn, alternateButton);
WMSetButtonFont(panel->altBtn, defaultFont);
}
if (otherButton) {
panel->othBtn = WMCreateCommandButton(panel->hbox);
WMSetButtonAction(panel->othBtn, alertPanelOnClick, panel);
WMAddBoxSubviewAtEnd(panel->hbox, WMWidgetView(panel->othBtn), False, True, ow, 0, 5);
WMSetButtonText(panel->othBtn, otherButton);
WMSetButtonFont(panel->othBtn, defaultFont);
}
WMMapSubwidgets(panel->hbox);
WMCreateEventHandler(W_VIEW(panel->win), KeyPressMask, handleKeyPress, panel);
WMRealizeWidget(panel->win);
WMMapSubwidgets(panel->win);
WMReleaseFont(defaultFont);
return panel;
}
WMAlertPanel *WMCreateScaledAlertPanel(WMScreen * scrPtr, WMWindow * owner,
const char *title, const char *msg, const char *defaultButton,
const char *alternateButton, const char *otherButton)
{
WMAlertPanel *panel;
int dw = 0, aw = 0, ow = 0, w;
WMBox *hbox;
WMPixmap *icon;
int wmScaleWidth, wmScaleHeight;
int pwidth, pheight;
panel = wmalloc(sizeof(WMAlertPanel));
if (owner) {
panel->win = WMCreatePanelWithStyleForWindow(owner, "alertPanel", WMTitledWindowMask);
} else {
panel->win = WMCreateWindowWithStyle(scrPtr, "alertPanel", WMTitledWindowMask);
}
/* calculate and set the panel's size */
WMGetScaleBaseFromSystemFont(scrPtr, &wmScaleWidth, &wmScaleHeight);
pwidth = WMScaleX(400);
pheight = WMScaleY(5) /* upper margin */
+ 64 /* icon size */
+ WMScaleY(5) /* space between icon and divider line */
+ 2 /* divider line */
+ WMScaleY(5); /* space between divider line and message */
if (msg)
pheight += WMFontHeight(scrPtr->normalFont) * 4 + WMScaleY(5);
pheight += WMScaleY(44);
WMResizeWidget(panel->win, pwidth, pheight);
WMSetWindowInitialPosition(panel->win,
(scrPtr->rootView->size.width - pwidth) / 2,
(scrPtr->rootView->size.height - pheight) / 2);
WMSetWindowTitle(panel->win, "");
panel->vbox = WMCreateBox(panel->win);
WMSetViewExpandsToParent(WMWidgetView(panel->vbox), 0, 0, 0, 0);
WMSetBoxHorizontal(panel->vbox, False);
WMMapWidget(panel->vbox);
hbox = WMCreateBox(panel->vbox);
WMSetBoxBorderWidth(hbox, WMScaleX(5));
WMSetBoxHorizontal(hbox, True);
WMMapWidget(hbox);
WMAddBoxSubview(panel->vbox, WMWidgetView(hbox), False, True, 64 + 2 * WMScaleY(5), 0, WMScaleY(5));
panel->iLbl = WMCreateLabel(hbox);
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
WMMapWidget(panel->iLbl);
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
icon = WMCreateApplicationIconBlendedPixmap(scrPtr, (RColor *) NULL);
if (icon) {
WMSetLabelImage(panel->iLbl, icon);
WMReleasePixmap(icon);
} else {
WMSetLabelImage(panel->iLbl, scrPtr->applicationIconPixmap);
}
if (title) {
WMFont *largeFont;
largeFont = WMBoldSystemFontOfSize(scrPtr, 24);
panel->tLbl = WMCreateLabel(hbox);
WMMapWidget(panel->tLbl);
WMAddBoxSubview(hbox, WMWidgetView(panel->tLbl), True, True, 64, 0, 0);
WMSetLabelText(panel->tLbl, title);
WMSetLabelTextAlignment(panel->tLbl, WALeft);
WMSetLabelFont(panel->tLbl, largeFont);
WMReleaseFont(largeFont);
}
/* create divider line */
panel->line = WMCreateFrame(panel->win);
WMMapWidget(panel->line);
WMAddBoxSubview(panel->vbox, WMWidgetView(panel->line), False, True, 2, 2, WMScaleY(5));
WMSetFrameRelief(panel->line, WRGroove);
if (msg) {
panel->mLbl = WMCreateLabel(panel->vbox);
WMSetLabelWraps(panel->mLbl, True);
WMMapWidget(panel->mLbl);
WMAddBoxSubview(panel->vbox, WMWidgetView(panel->mLbl), True, True,
WMFontHeight(scrPtr->normalFont) * 4, 0, WMScaleY(5));
WMSetLabelText(panel->mLbl, msg);
WMSetLabelTextAlignment(panel->mLbl, WACenter);
}
panel->hbox = WMCreateBox(panel->vbox);
WMSetBoxBorderWidth(panel->hbox, WMScaleX(10));
WMSetBoxHorizontal(panel->hbox, True);
WMMapWidget(panel->hbox);
WMAddBoxSubview(panel->vbox, WMWidgetView(panel->hbox), False, True, WMScaleY(44), 0, 0);
/* create buttons */
if (otherButton)
ow = WMWidthOfString(scrPtr->normalFont, otherButton, strlen(otherButton));
if (alternateButton)
aw = WMWidthOfString(scrPtr->normalFont, alternateButton, strlen(alternateButton));
if (defaultButton)
dw = WMWidthOfString(scrPtr->normalFont, defaultButton, strlen(defaultButton));
dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
aw += WMScaleX(30);
ow += WMScaleX(30);
dw += WMScaleX(30);
w = WMAX(dw, WMAX(aw, ow));
if ((w + WMScaleX(10)) * 3 < pwidth) {
aw = w;
ow = w;
dw = w;
} else {
int t;
t = pwidth - 4 * WMScaleX(10) - aw - ow - dw;
aw += t / 3;
ow += t / 3;
dw += t / 3;
}
if (defaultButton) {
panel->defBtn = WMCreateCommandButton(panel->hbox);
WMResizeWidget(panel->defBtn, dw, WMScaleY(24));
WMSetButtonAction(panel->defBtn, alertPanelOnClick, panel);
WMAddBoxSubviewAtEnd(panel->hbox, WMWidgetView(panel->defBtn), False, True, dw, 0, 0);
WMSetButtonText(panel->defBtn, defaultButton);
WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);
WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(panel->defBtn, WIPRight);
}
if (alternateButton) {
panel->altBtn = WMCreateCommandButton(panel->hbox);
WMResizeWidget(panel->altBtn, aw, WMScaleY(24));
WMAddBoxSubviewAtEnd(panel->hbox, WMWidgetView(panel->altBtn), False, True, aw, 0, WMScaleX(5));
WMSetButtonAction(panel->altBtn, alertPanelOnClick, panel);
WMSetButtonText(panel->altBtn, alternateButton);
}
if (otherButton) {
panel->othBtn = WMCreateCommandButton(panel->hbox);
WMResizeWidget(panel->othBtn, ow, WMScaleY(24));
WMSetButtonAction(panel->othBtn, alertPanelOnClick, panel);
WMAddBoxSubviewAtEnd(panel->hbox, WMWidgetView(panel->othBtn), False, True, ow, 0, WMScaleX(5));
WMSetButtonText(panel->othBtn, otherButton);
}
WMMapSubwidgets(panel->hbox);
@@ -249,7 +421,7 @@ static void handleKeyPress2(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if (ksym == XK_Return && panel->defBtn) {
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn) {
@@ -338,8 +510,10 @@ WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, const char
const char *defaultText, const char *okButton, const char *cancelButton)
{
WMInputPanel *panel;
WMFont *defaultFont;
int x, dw = 0, aw = 0, w;
defaultFont = WMSystemFontOfSize(scrPtr, 12);
panel = wmalloc(sizeof(WMInputPanel));
if (owner)
@@ -371,21 +545,23 @@ WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, const char
WMResizeWidget(panel->mLbl, 320 - 40, WMFontHeight(scrPtr->normalFont) * 2);
WMSetLabelText(panel->mLbl, msg);
WMSetLabelTextAlignment(panel->mLbl, WALeft);
WMSetLabelFont(panel->mLbl, defaultFont);
}
panel->text = WMCreateTextField(panel->win);
WMMoveWidget(panel->text, 20, 85);
WMResizeWidget(panel->text, 320 - 40, WMWidgetHeight(panel->text));
WMSetTextFieldText(panel->text, defaultText);
WMSetTextFieldFont(panel->text, defaultFont);
WMAddNotificationObserver(endedEditingObserver, panel, WMTextDidEndEditingNotification, panel->text);
/* create buttons */
if (cancelButton)
aw = WMWidthOfString(scrPtr->normalFont, cancelButton, strlen(cancelButton));
aw = WMWidthOfString(defaultFont, cancelButton, strlen(cancelButton));
if (okButton)
dw = WMWidthOfString(scrPtr->normalFont, okButton, strlen(okButton));
dw = WMWidthOfString(defaultFont, okButton, strlen(okButton));
w = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
if (aw > w)
@@ -406,6 +582,7 @@ WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, const char
WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);
WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(panel->defBtn, WIPRight);
WMSetButtonFont(panel->defBtn, defaultFont);
}
if (cancelButton) {
x -= w + 10;
@@ -415,6 +592,104 @@ WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, const char
WMMoveWidget(panel->altBtn, x, 124);
WMResizeWidget(panel->altBtn, w, 24);
WMSetButtonText(panel->altBtn, cancelButton);
WMSetButtonFont(panel->altBtn, defaultFont);
}
WMCreateEventHandler(W_VIEW(panel->win), KeyPressMask, handleKeyPress2, panel);
WMRealizeWidget(panel->win);
WMMapSubwidgets(panel->win);
WMSetFocusToWidget(panel->text);
WMReleaseFont(defaultFont);
return panel;
}
WMInputPanel *WMCreateScaledInputPanel(WMScreen * scrPtr, WMWindow * owner, const char *title, const char *msg,
const char *defaultText, const char *okButton, const char *cancelButton)
{
WMInputPanel *panel;
int x, dw = 0, aw = 0, w;
int wmScaleWidth, wmScaleHeight;
panel = wmalloc(sizeof(WMInputPanel));
if (owner)
panel->win = WMCreatePanelWithStyleForWindow(owner, "inputPanel", WMTitledWindowMask);
else
panel->win = WMCreateWindowWithStyle(scrPtr, "inputPanel", WMTitledWindowMask);
WMSetWindowTitle(panel->win, "");
WMGetScaleBaseFromSystemFont(scrPtr, &wmScaleWidth, &wmScaleHeight);
WMResizeWidget(panel->win, WMScaleX(320), WMScaleY(160));
if (title) {
WMFont *largeFont;
largeFont = WMBoldSystemFontOfSize(scrPtr, WMScaleY(24));
panel->tLbl = WMCreateLabel(panel->win);
WMMoveWidget(panel->tLbl, WMScaleX(20), WMScaleY(16));
WMResizeWidget(panel->tLbl, WMScaleX(320) - 2 * WMScaleX(20), WMFontHeight(largeFont) + WMScaleY(4));
WMSetLabelText(panel->tLbl, title);
WMSetLabelTextAlignment(panel->tLbl, WALeft);
WMSetLabelFont(panel->tLbl, largeFont);
WMReleaseFont(largeFont);
}
if (msg) {
panel->mLbl = WMCreateLabel(panel->win);
WMMoveWidget(panel->mLbl, WMScaleX(20), WMScaleY(50));
WMResizeWidget(panel->mLbl, WMScaleX(320) - 2 * WMScaleX(20), WMFontHeight(scrPtr->normalFont) * 2);
WMSetLabelText(panel->mLbl, msg);
WMSetLabelTextAlignment(panel->mLbl, WALeft);
}
panel->text = WMCreateTextField(panel->win);
WMMoveWidget(panel->text, WMScaleX(20), WMScaleY(85));
WMResizeWidget(panel->text, WMScaleX(320) - 2 * WMScaleX(20), WMScaleY(20));
WMSetTextFieldText(panel->text, defaultText);
WMAddNotificationObserver(endedEditingObserver, panel, WMTextDidEndEditingNotification, panel->text);
/* create buttons */
if (cancelButton)
aw = WMWidthOfString(scrPtr->normalFont, cancelButton, strlen(cancelButton));
if (okButton)
dw = WMWidthOfString(scrPtr->normalFont, okButton, strlen(okButton));
w = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
if (aw > w)
w = aw;
w += WMScaleX(30);
x = WMScaleX(310);
if (okButton) {
x -= w + WMScaleX(10);
panel->defBtn = WMCreateCustomButton(panel->win, WBBPushInMask
| WBBPushChangeMask | WBBPushLightMask);
WMSetButtonAction(panel->defBtn, inputBoxOnClick, panel);
WMMoveWidget(panel->defBtn, x, WMScaleY(124));
WMResizeWidget(panel->defBtn, w, WMScaleY(24));
WMSetButtonText(panel->defBtn, okButton);
WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);
WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(panel->defBtn, WIPRight);
}
if (cancelButton) {
x -= w + WMScaleX(10);
panel->altBtn = WMCreateCommandButton(panel->win);
WMSetButtonAction(panel->altBtn, inputBoxOnClick, panel);
WMMoveWidget(panel->altBtn, x, WMScaleY(124));
WMResizeWidget(panel->altBtn, w, WMScaleY(24));
WMSetButtonText(panel->altBtn, cancelButton);
}
WMCreateEventHandler(W_VIEW(panel->win), KeyPressMask, handleKeyPress2, panel);
@@ -434,7 +709,7 @@ static void handleKeyPress3(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if (ksym == XK_Return && panel->defBtn) {
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn) {
@@ -457,10 +732,12 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
const char *title, const char *defaultButton, const char *alternateButton)
{
WMGenericPanel *panel;
WMFont *defaultFont;
int dw = 0, aw = 0, w;
WMBox *hbox;
WMPixmap *icon;
defaultFont = WMSystemFontOfSize(scrPtr, 12);
panel = wmalloc(sizeof(WMGenericPanel));
if (owner) {
@@ -533,10 +810,10 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
/* create buttons */
if (defaultButton)
dw = WMWidthOfString(scrPtr->normalFont, defaultButton, strlen(defaultButton));
dw = WMWidthOfString(defaultFont, defaultButton, strlen(defaultButton));
if (alternateButton)
aw = WMWidthOfString(scrPtr->normalFont, alternateButton, strlen(alternateButton));
aw = WMWidthOfString(defaultFont, alternateButton, strlen(alternateButton));
dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
@@ -561,6 +838,7 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
WMSetButtonImage(panel->defBtn, scrPtr->buttonArrow);
WMSetButtonAltImage(panel->defBtn, scrPtr->pushedButtonArrow);
WMSetButtonImagePosition(panel->defBtn, WIPRight);
WMSetButtonFont(panel->defBtn, defaultFont);
}
WMMapSubwidgets(hbox);
@@ -570,5 +848,7 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
WMRealizeWidget(panel->win);
WMMapSubwidgets(panel->win);
WMReleaseFont(defaultFont);
return panel;
}
+3
View File
@@ -85,6 +85,9 @@ WMPixmap *WMCreatePixmapFromRImage(WMScreen * scrPtr, RImage * image, int thresh
WMPixmap *pixPtr;
Pixmap pixmap, mask;
if (image == NULL)
return NULL;
if (!RConvertImageMask(scrPtr->rcontext, image, &pixmap, &mask, threshold)) {
return NULL;
}
+50
View File
@@ -252,6 +252,56 @@ WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton * bPtr, int index)
return WMGetFromArray(bPtr->items, index);
}
int WMSelectPopUpButtonPreviousItem(WMPopUpButton * bPtr)
{
int testIndex;
CHECK_CLASS(bPtr, WC_PopUpButton);
if (bPtr->flags.pullsDown || bPtr->selectedItemIndex < 0)
return -1;
testIndex = bPtr->selectedItemIndex - 1;
while (testIndex >= 0 && !WMGetPopUpButtonItemEnabled(bPtr, testIndex))
testIndex--;
if (testIndex != -1) {
WMSetPopUpButtonSelectedItem(bPtr, testIndex);
if (bPtr->action)
(*bPtr->action) (bPtr, bPtr->clientData);
return testIndex;
}
return -1;
}
int WMSelectPopUpButtonNextItem(WMPopUpButton * bPtr)
{
int itemCount;
int testIndex;
CHECK_CLASS(bPtr, WC_PopUpButton);
if (bPtr->flags.pullsDown || bPtr->selectedItemIndex < 0)
return -1;
itemCount = WMGetArrayItemCount(bPtr->items);
testIndex = bPtr->selectedItemIndex + 1;
while (testIndex < itemCount && !WMGetPopUpButtonItemEnabled(bPtr, testIndex))
testIndex++;
if (testIndex != itemCount) {
WMSetPopUpButtonSelectedItem(bPtr, testIndex);
if (bPtr->action)
(*bPtr->action) (bPtr, bPtr->clientData);
return testIndex;
}
return -1;
}
static void paintPopUpButton(PopUpButton * bPtr)
{
W_Screen *scr = bPtr->view->screen;
+1 -4
View File
@@ -181,10 +181,7 @@ static void drawRulerOnPixmap(Ruler * rPtr)
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
if (i != 0 && i % 8 == 0) {
if (j < 10)
snprintf(c, 3, "%d", ++j);
else
snprintf(c, 3, "%2d", ++j);
snprintf(c, sizeof(c), "%hu", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
}
+10 -12
View File
@@ -20,7 +20,7 @@
#define AUTOSCROLL_DELAY 40
char *WMScrollerDidScrollNotification = "WMScrollerDidScrollNotification";
const char *WMScrollerDidScrollNotification = "WMScrollerDidScrollNotification";
typedef struct W_Scroller {
W_Class widgetClass;
@@ -64,8 +64,6 @@ typedef struct W_Scroller {
} flags;
} Scroller;
#define DEFAULT_HEIGHT 60
#define DEFAULT_WIDTH SCROLLER_WIDTH
#define DEFAULT_ARROWS_POSITION WSAMinEnd
#define BUTTON_SIZE ((SCROLLER_WIDTH) - 4)
@@ -108,7 +106,7 @@ WMScroller *WMCreateScroller(WMWidget * parent)
WMCreateEventHandler(sPtr->view, ExposureMask | StructureNotifyMask
| ClientMessageMask, handleEvents, sPtr);
W_ResizeView(sPtr->view, DEFAULT_WIDTH, DEFAULT_WIDTH);
W_ResizeView(sPtr->view, SCROLLER_WIDTH, SCROLLER_WIDTH);
sPtr->flags.arrowsPosition = DEFAULT_ARROWS_POSITION;
WMCreateEventHandler(sPtr->view, ButtonPressMask | ButtonReleaseMask
@@ -170,10 +168,10 @@ void WMSetScrollerParameters(WMScroller * sPtr, float floatValue, float knobProp
assert(!isnan(floatValue));
if (floatValue < 0.0)
sPtr->floatValue = 0.0;
else if (floatValue > 1.0)
sPtr->floatValue = 1.0;
if (floatValue < 0.0F)
sPtr->floatValue = 0.0F;
else if (floatValue > 1.0F)
sPtr->floatValue = 1.0F;
else
sPtr->floatValue = floatValue;
@@ -182,9 +180,9 @@ void WMSetScrollerParameters(WMScroller * sPtr, float floatValue, float knobProp
sPtr->knobProportion = min_knob_proportion;
sPtr->flags.documentFullyVisible = 0;
} else if (knobProportion >= 1.0) {
} else if (knobProportion >= 1.0F) {
sPtr->knobProportion = 1.0;
sPtr->knobProportion = 1.0F;
sPtr->flags.documentFullyVisible = 1;
} else {
@@ -346,7 +344,7 @@ static int knobLength(Scroller * sPtr)
length -= 2 * (BUTTON_SIZE + 1);
}
tmp = (int)((float)length * sPtr->knobProportion + 0.5);
tmp = (int)((float)length * sPtr->knobProportion + 0.5F);
/* keep minimum size */
if (tmp < BUTTON_SIZE)
tmp = BUTTON_SIZE;
@@ -420,7 +418,7 @@ static void paintScroller(Scroller * sPtr)
length - (int)(knobP + knobL), view->size.height - 4);
} else {
/* before */
if (knobP > 0.0)
if (knobP > 0.0F)
XFillRectangle(scr->display, d, scr->stippleGC,
2, ofs, view->size.width - 4, (int)knobP);
+2 -2
View File
@@ -506,7 +506,7 @@ static void updateScrollerProportion(ScrollView * sPtr)
prop = (float)sPtr->viewport->size.width / (float)sPtr->contentView->size.width;
if (oldP < 1.0)
if (oldP < 1.0F)
value = (prop * oldV) / oldP;
else
value = 0;
@@ -518,7 +518,7 @@ static void updateScrollerProportion(ScrollView * sPtr)
prop = (float)sPtr->viewport->size.height / (float)sPtr->contentView->size.height;
if (oldP < 1.0)
if (oldP < 1.0F)
value = (prop * oldV) / oldP;
else
value = 0;
+4 -4
View File
@@ -410,16 +410,16 @@ static void handleActionEvents(XEvent * event, void *data)
switch (event->type) {
case ButtonPress:
if (event->xbutton.button == WINGsConfiguration.mouseWheelUp && !sPtr->flags.dragging) {
/* Wheel up */
if (event->xbutton.button == WINGsConfiguration.mouseWheelDown && !sPtr->flags.dragging) {
/* Wheel down */
if (sPtr->value + 1 <= sPtr->maxValue) {
WMSetSliderValue(sPtr, sPtr->value + 1);
if (sPtr->flags.continuous && sPtr->action) {
(*sPtr->action) (sPtr, sPtr->clientData);
}
}
} else if (event->xbutton.button == WINGsConfiguration.mouseWheelDown && !sPtr->flags.dragging) {
/* Wheel down */
} else if (event->xbutton.button == WINGsConfiguration.mouseWheelUp && !sPtr->flags.dragging) {
/* Wheel up */
if (sPtr->value - 1 >= sPtr->minValue) {
WMSetSliderValue(sPtr, sPtr->value - 1);
if (sPtr->flags.continuous && sPtr->action) {
-3
View File
@@ -41,9 +41,6 @@ typedef struct W_SplitView {
/* TODO: rewrite --Dan */
#define _GetSubviewsCount() WMGetArrayItemCount(sPtr->subviews)
#define _AddPSubviewStruct(P) \
(WMAddToArray(sPtr->subviews,((void*)P)))
#define _GetPSubviewStructAt(i) \
((W_SplitViewSubview*)WMGetFromArray(sPtr->subviews,(i)))
+31 -16
View File
@@ -166,12 +166,15 @@ typedef struct W_Text {
WMArray *xdndDestinationTypes;
} Text;
/* not used */
#if 0
#define NOTIFY(T,C,N,A) {\
WMNotification *notif = WMCreateNotification(N,T,A);\
if ((T)->delegate && (T)->delegate->C)\
(*(T)->delegate->C)((T)->delegate,notif);\
WMPostNotification(notif);\
WMReleaseNotification(notif);}
#endif
#define TYPETEXT 0
@@ -215,6 +218,11 @@ static char *default_bullet[] = {
" ooo "
};
/* These id are used when sharing the selected text between applications */
static Atom XA_TARGETS = None;
static Atom XA_TEXT = None;
static Atom XA_COMPOUND_TEXT = None;
static void handleEvents(XEvent * event, void *data);
static void layOutDocument(Text * tPtr);
static void updateScrollers(Text * tPtr);
@@ -617,7 +625,7 @@ static void paintText(Text * tPtr)
TextBlock *tb;
WMFont *font;
const char *text;
int len, y, c, s, done = False, dir /* 1 = down */ ;
int len, y, c, s, done = False, dir; /* dir 1 = down */
WMScreen *scr = tPtr->view->screen;
Display *dpy = tPtr->view->screen->display;
Window win = tPtr->view->window;
@@ -2036,17 +2044,13 @@ static void releaseSelection(Text * tPtr)
static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *cdata, Atom * type)
{
Text *tPtr = view->self;
Display *dpy = tPtr->view->screen->display;
Atom _TARGETS;
Atom TEXT = XInternAtom(dpy, "TEXT", False);
Atom COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
WMData *data = NULL;
/* Parameter not used, but tell the compiler that it is ok */
(void) selection;
(void) cdata;
if (target == XA_STRING || target == TEXT || target == COMPOUND_TEXT) {
if (target == XA_STRING || target == XA_TEXT || target == XA_COMPOUND_TEXT) {
char *text = WMGetTextSelectedStream(tPtr);
if (text) {
@@ -2059,20 +2063,18 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
} else
printf("didn't get it\n");
_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == _TARGETS) {
Atom *ptr;
if (target == XA_TARGETS) {
Atom supported_type[4];
ptr = wmalloc(4 * sizeof(Atom));
ptr[0] = _TARGETS;
ptr[1] = XA_STRING;
ptr[2] = TEXT;
ptr[3] = COMPOUND_TEXT;
supported_type[0] = XA_TARGETS;
supported_type[1] = XA_STRING;
supported_type[2] = XA_TEXT;
supported_type[3] = XA_COMPOUND_TEXT;
data = WMCreateDataWithBytes(ptr, 4 * 4);
data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
WMSetDataFormat(data, 32);
*type = target;
*type = XA_ATOM;
return data;
}
@@ -2306,6 +2308,7 @@ static void handleTextKeyPress(Text * tPtr, XEvent * event)
case XK_Return:
*buffer = '\n';
/* FALLTHRU */
default:
if (*buffer != 0 && !control_pressed) {
insertTextInteractively(tPtr, buffer, strlen(buffer));
@@ -2545,6 +2548,7 @@ static void handleActionEvents(XEvent * event, void *data)
break;
}
/* FALLTHRU */
case ButtonRelease:
if (tPtr->flags.pointerGrabbed) {
tPtr->flags.pointerGrabbed = False;
@@ -2973,6 +2977,17 @@ WMText *WMCreateTextForDocumentType(WMWidget * parent, WMAction * parser, WMActi
dpy = tPtr->view->screen->display;
scr = tPtr->view->screen;
if (XA_TARGETS == None) {
/*
* Because the X protocol guaranties that the value will never change in
* the lifespan of the server, we query the values only the first time a
* widget is created
*/
XA_TARGETS = XInternAtom(dpy, "TARGETS", False);
XA_TEXT = XInternAtom(dpy, "TEXT", False);
XA_COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
}
tPtr->view->self = tPtr;
tPtr->view->attribs.cursor = scr->textCursor;
tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor;
+111 -93
View File
@@ -10,9 +10,9 @@
#define CURSOR_BLINK_ON_DELAY 600
#define CURSOR_BLINK_OFF_DELAY 300
char *WMTextDidChangeNotification = "WMTextDidChangeNotification";
char *WMTextDidBeginEditingNotification = "WMTextDidBeginEditingNotification";
char *WMTextDidEndEditingNotification = "WMTextDidEndEditingNotification";
const char *WMTextDidChangeNotification = "WMTextDidChangeNotification";
const char *WMTextDidBeginEditingNotification = "WMTextDidBeginEditingNotification";
const char *WMTextDidEndEditingNotification = "WMTextDidEndEditingNotification";
typedef struct W_TextField {
W_Class widgetClass;
@@ -122,35 +122,6 @@ static WMSelectionProcs selectionHandler = {
#define TEXT_WIDTH2(tPtr, start, end) (WMWidthOfString((tPtr)->font, \
&((tPtr)->text[(start)]), (end) - (start)))
static inline int oneUTF8CharBackward(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[--pos] >= 0x80 && ustr[pos] <= 0xbf) ;
return pos;
}
static inline int oneUTF8CharForward(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[++pos] >= 0x80 && ustr[pos] <= 0xbf) ;
return pos;
}
// find the beginning of the UTF8 char pointed by str
static inline int seekUTF8CharStart(const char *str, int len)
{
const unsigned char *ustr = (const unsigned char *)str;
int pos = 0;
while (len-- > 0 && ustr[pos] >= 0x80 && ustr[pos] <= 0xbf)
--pos;
return pos;
}
static void normalizeRange(TextField * tPtr, WMRange * range)
{
if (range->position < 0 && range->count < 0)
@@ -239,9 +210,9 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
TextField *tPtr = view->self;
int count;
Display *dpy = tPtr->view->screen->display;
Atom _TARGETS;
Atom TEXT = XInternAtom(dpy, "TEXT", False);
Atom COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
Atom XA_TARGETS;
Atom XA_TEXT = XInternAtom(dpy, "TEXT", False);
Atom XA_COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
WMData *data;
/* Parameter not used, but tell the compiler that it is ok */
@@ -251,7 +222,7 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
count = tPtr->selection.count < 0
? tPtr->selection.position + tPtr->selection.count : tPtr->selection.position;
if (target == XA_STRING || target == TEXT || target == COMPOUND_TEXT) {
if (target == XA_STRING || target == XA_TEXT || target == XA_COMPOUND_TEXT) {
data = WMCreateDataWithBytes(&(tPtr->text[count]), abs(tPtr->selection.count));
WMSetDataFormat(data, 8);
@@ -260,19 +231,19 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
return data;
}
_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == _TARGETS) {
XA_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == XA_TARGETS) {
Atom supported_type[4];
supported_type[0] = _TARGETS;
supported_type[0] = XA_TARGETS;
supported_type[1] = XA_STRING;
supported_type[2] = TEXT;
supported_type[3] = COMPOUND_TEXT;
supported_type[2] = XA_TEXT;
supported_type[3] = XA_COMPOUND_TEXT;
data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
WMSetDataFormat(data, 32);
*type = target;
*type = XA_ATOM;
return data;
}
@@ -446,6 +417,13 @@ void WMDeleteTextFieldRange(WMTextField * tPtr, WMRange range)
decrToFit(tPtr);
/* Ensure cursor is visible after deletion */
if (tPtr->cursorPosition < tPtr->viewPosition) {
tPtr->viewPosition = tPtr->cursorPosition;
} else {
incrToFit2(tPtr);
}
paintTextField(tPtr);
}
@@ -490,11 +468,6 @@ void WMSetTextFieldAlignment(WMTextField * tPtr, WMAlignment alignment)
tPtr->flags.alignment = alignment;
if (alignment != WALeft) {
wwarning("only left alignment is supported in textfields");
return;
}
if (tPtr->view->flags.realized) {
paintTextField(tPtr);
}
@@ -661,7 +634,7 @@ static void didResizeTextField(W_ViewDelegate * self, WMView * view)
tPtr->offsetWidth = WMAX((tPtr->view->size.height - WMFontHeight(tPtr->font)) / 2, 1);
tPtr->usableWidth = tPtr->view->size.width - 2 * tPtr->offsetWidth /*+ 2 */ ;
tPtr->usableWidth = tPtr->view->size.width - 2 * tPtr->offsetWidth;
}
static char *makeHiddenString(int length)
@@ -846,8 +819,8 @@ static void paintTextField(TextField * tPtr)
count = tPtr->viewPosition;
}
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font, text, count)
- WMWidthOfString(tPtr->font, text, tPtr->viewPosition);
rx = tx + WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]),
count - tPtr->viewPosition);
WMDrawImageString(screen, drawbuffer, color, screen->gray,
tPtr->font, rx, ty, &(text[count]), count2);
@@ -942,7 +915,7 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
{
char buffer[64];
KeySym ksym;
char *textEvent = NULL;
const char *textEvent = NULL;
void *data = NULL;
int count, refresh = 0;
int control_pressed = 0;
@@ -965,6 +938,7 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
switch (ksym) {
case XK_Tab:
#ifdef XK_ISO_Left_Tab
/* FALLTHRU */
case XK_ISO_Left_Tab:
#endif
if (!controled) {
@@ -1000,6 +974,11 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
}
break;
#ifdef XK_KP_Enter
/* FALLTHRU */
case XK_KP_Enter:
#endif
/* FALLTHRU */
case XK_Return:
if (!modified) {
data = (void *)WMReturnTextMovement;
@@ -1016,12 +995,13 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
controled = False;
#ifdef XK_KP_Left
/* FALLTHRU */
case XK_KP_Left:
#endif
/* FALLTHRU */
case XK_Left:
if (tPtr->cursorPosition > 0) {
int i;
paintCursor(tPtr);
i = tPtr->cursorPosition;
i += oneUTF8CharBackward(&tPtr->text[i], i);
@@ -1037,9 +1017,8 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
if (tPtr->cursorPosition < tPtr->viewPosition) {
tPtr->viewPosition = tPtr->cursorPosition;
refresh = 1;
} else
paintCursor(tPtr);
}
refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1055,12 +1034,13 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
controled = False;
#ifdef XK_KP_Right
/* FALLTHRU */
case XK_KP_Right:
#endif
/* FALLTHRU */
case XK_Right:
if (tPtr->cursorPosition < tPtr->textLen) {
int i;
paintCursor(tPtr);
i = tPtr->cursorPosition;
if (controled) {
@@ -1073,10 +1053,8 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
}
tPtr->cursorPosition = i;
refresh = incrToFit2(tPtr);
if (!refresh)
paintCursor(tPtr);
incrToFit2(tPtr);
refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1092,18 +1070,18 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
controled = False;
#ifdef XK_KP_Home
/* FALLTHRU */
case XK_KP_Home:
#endif
/* FALLTHRU */
case XK_Home:
if (!controled) {
if (tPtr->cursorPosition > 0) {
paintCursor(tPtr);
tPtr->cursorPosition = 0;
if (tPtr->viewPosition > 0) {
tPtr->viewPosition = 0;
refresh = 1;
} else
paintCursor(tPtr);
}
refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1119,19 +1097,18 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
controled = False;
#ifdef XK_KP_End
/* FALLTHRU */
case XK_KP_End:
#endif
/* FALLTHRU */
case XK_End:
if (!controled) {
if (tPtr->cursorPosition < tPtr->textLen) {
paintCursor(tPtr);
tPtr->cursorPosition = tPtr->textLen;
tPtr->viewPosition = 0;
refresh = incrToFit(tPtr);
if (!refresh)
paintCursor(tPtr);
incrToFit(tPtr);
refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1146,6 +1123,7 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
else
modified = False;
/* FALLTHRU */
case XK_BackSpace:
if (!modified) {
if (tPtr->selection.count) {
@@ -1174,8 +1152,10 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
modified = False;
#ifdef XK_KP_Delete
/* FALLTHRU */
case XK_KP_Delete:
#endif
/* FALLTHRU */
case XK_Delete:
if (!modified) {
if (tPtr->selection.count) {
@@ -1391,7 +1371,25 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
tPtr->viewPosition);
}
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
if (tPtr->flags.alignment == WARight) {
int textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
event->xmotion.x - tPtr->usableWidth + textWidth);
} else {
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
}
} else if (tPtr->flags.alignment == WACenter) {
int textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
event->xmotion.x - (tPtr->usableWidth - textWidth) / 2);
} else {
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
}
} else {
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
}
/* Do not allow text selection in secure textfields */
if (tPtr->flags.secure) {
@@ -1424,17 +1422,35 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
if (tPtr->flags.enabled && !tPtr->flags.focused) {
WMSetFocusToWidget(tPtr);
}
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
event->xbutton.x - tPtr->usableWidth
+ textWidth);
} else
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xbutton.x);
if (tPtr->flags.focused) {
tPtr->selection.position = tPtr->cursorPosition;
tPtr->selection.count = 0;
}
paintTextField(tPtr);
break;
case WACenter:
textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
if (tPtr->flags.enabled && !tPtr->flags.focused) {
WMSetFocusToWidget(tPtr);
}
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
event->xbutton.x - tPtr->usableWidth
+ textWidth);
} else
event->xbutton.x - (tPtr->usableWidth - textWidth) / 2);
} else {
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xbutton.x);
}
if (tPtr->flags.focused) {
tPtr->selection.position = tPtr->cursorPosition;
tPtr->selection.count = 0;
}
paintTextField(tPtr);
break;
@@ -1448,29 +1464,31 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
tPtr->selection.count = 0;
paintTextField(tPtr);
}
if (event->xbutton.button == Button2 && tPtr->flags.enabled) {
char *text;
int n;
if (!WMRequestSelection(tPtr->view, XA_PRIMARY, XA_STRING,
event->xbutton.time, pasteText, NULL)) {
text = XFetchBuffer(tPtr->view->screen->display, &n, 0);
if (text) {
text[n] = 0;
WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
XFree(text);
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
(void *)WMInsertTextEvent);
}
} else {
tPtr->flags.waitingSelection = 1;
}
}
break;
default:
break;
}
if (event->xbutton.button == Button2 && tPtr->flags.enabled) {
char *text;
int n;
if (!WMRequestSelection(tPtr->view, XA_PRIMARY, XA_STRING,
event->xbutton.time, pasteText, NULL)) {
text = XFetchBuffer(tPtr->view->screen->display, &n, 0);
if (text) {
text[n] = 0;
WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
XFree(text);
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
(void *)WMInsertTextEvent);
}
} else {
tPtr->flags.waitingSelection = 1;
}
}
break;
case ButtonRelease:
+1 -1
View File
@@ -5,7 +5,7 @@
#include "WINGsP.h"
void WHandleEvents()
void WHandleEvents(void)
{
/* Check any expired timers */
W_CheckTimerHandlers();
+27 -4
View File
@@ -5,9 +5,9 @@
/* the notifications about views */
char *WMViewSizeDidChangeNotification = "WMViewSizeDidChangeNotification";
char *WMViewFocusDidChangeNotification = "WMViewFocusDidChangeNotification";
char *WMViewRealizedNotification = "WMViewRealizedNotification";
const char *WMViewSizeDidChangeNotification = "WMViewSizeDidChangeNotification";
const char *WMViewFocusDidChangeNotification = "WMViewFocusDidChangeNotification";
const char *WMViewRealizedNotification = "WMViewRealizedNotification";
#define EVENT_MASK \
KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \
@@ -100,7 +100,8 @@ static W_View *createView(W_Screen * screen, W_View * parent)
view->attribFlags = CWEventMask | CWBitGravity;
view->attribs = defAtts;
view->attribFlags |= CWBackPixel | CWColormap | CWBorderPixel;
view->attribFlags |= CWBackPixel | CWColormap | CWBorderPixel | CWBackPixmap;
view->attribs.background_pixmap = None;
view->attribs.background_pixel = W_PIXEL(screen->gray);
view->attribs.border_pixel = W_PIXEL(screen->black);
view->attribs.colormap = screen->colormap;
@@ -188,6 +189,12 @@ void W_RealizeView(W_View * view)
}
if (!view->flags.realized) {
if (view->parent == NULL) {
wwarning("trying to realize widget without parent");
return;
}
parentWID = view->parent->window;
view->window = XCreateWindow(dpy, parentWID, view->pos.x, view->pos.y,
view->size.width, view->size.height, 0,
@@ -483,6 +490,7 @@ void W_SetViewBackgroundColor(W_View * view, WMColor * color)
view->backColor = WMRetainColor(color);
view->attribFlags |= CWBackPixel;
view->attribFlags &= ~CWBackPixmap;
view->attribs.background_pixel = W_PIXEL(color);
if (view->flags.realized) {
XSetWindowBackground(view->screen->display, view->window, W_PIXEL(color));
@@ -490,6 +498,21 @@ void W_SetViewBackgroundColor(W_View * view, WMColor * color)
}
}
void W_SetViewBackgroundPixmap(W_View *view, WMPixmap *pix)
{
if (view->backImage)
WMReleasePixmap(view->backImage);
view->backImage = WMRetainPixmap(pix);
view->attribFlags |= CWBackPixmap;
view->attribFlags &= ~CWBackPixel;
view->attribs.background_pixmap = pix->pixmap;
if (view->flags.realized) {
XSetWindowBackgroundPixmap(view->screen->display, view->window, pix->pixmap);
XClearWindow(view->screen->display, view->window);
}
}
void W_SetViewCursor(W_View * view, Cursor cursor)
{
view->cursor = cursor;
+22 -37
View File
@@ -1,8 +1,12 @@
#include <X11/Xmd.h>
#include "wconfig.h"
#include "WINGsP.h"
#include "GNUstep.h"
#include <X11/Xatom.h>
typedef struct W_Window {
@@ -46,32 +50,6 @@ typedef struct W_Window {
} flags;
} _Window;
typedef struct {
CARD32 flags;
CARD32 window_style;
CARD32 window_level;
CARD32 reserved;
Pixmap miniaturize_pixmap; /* pixmap for miniaturize button */
Pixmap close_pixmap; /* pixmap for close button */
Pixmap miniaturize_mask; /* miniaturize pixmap mask */
Pixmap close_mask; /* close pixmap mask */
CARD32 extra_flags;
} GNUstepWMAttributes;
#define GSWindowStyleAttr (1<<0)
#define GSWindowLevelAttr (1<<1)
#define GSMiniaturizePixmapAttr (1<<3)
#define GSClosePixmapAttr (1<<4)
#define GSMiniaturizeMaskAttr (1<<5)
#define GSCloseMaskAttr (1<<6)
#define GSExtraFlagsAttr (1<<7)
/* extra flags */
#define GSDocumentEditedFlag (1<<0)
#define GSNoApplicationIconFlag (1<<5)
#define WMFHideOtherApplications 10
#define WMFHideApplication 12
static void willResizeWindow(W_ViewDelegate *, WMView *, unsigned *, unsigned *);
@@ -85,7 +63,6 @@ struct W_ViewDelegate _WindowViewDelegate = {
#define DEFAULT_WIDTH 400
#define DEFAULT_HEIGHT 180
#define DEFAULT_TITLE ""
static void destroyWindow(_Window * win);
@@ -180,7 +157,7 @@ static void setWindowTitle(WMWindow * win, const char *title)
result = XmbTextListToTextProperty(scr->display, (char **)&title, 1, XStdICCTextStyle, &property);
if (result == XNoMemory || result == XLocaleNotSupported) {
wwarning("window title conversion error... using STRING encoding");
wwarning(_("window title conversion error... using STRING encoding"));
XStoreName(scr->display, win->view->window, title);
} else {
XSetWMName(scr->display, win->view->window, &property);
@@ -201,7 +178,7 @@ static void setMiniwindowTitle(WMWindow * win, const char *title)
result = XmbTextListToTextProperty(scr->display, (char **)&title, 1, XStdICCTextStyle, &property);
if (result == XNoMemory || result == XLocaleNotSupported) {
wwarning("icon title conversion error..using STRING encoding");
wwarning(_("icon title conversion error... using STRING encoding"));
XSetIconName(scr->display, win->view->window, title);
} else {
XSetWMIconName(scr->display, win->view->window, &property);
@@ -217,7 +194,7 @@ static void setMiniwindowTitle(WMWindow * win, const char *title)
static void setMiniwindow(WMWindow *win, RImage *image)
{
WMScreen *scr = win->view->screen;
long *data;
unsigned long *data;
int x, y;
int o;
@@ -232,15 +209,19 @@ static void setMiniwindow(WMWindow *win, RImage *image)
for (y = 0; y < image->height; y++) {
for (x = 0; x < image->width; x++) {
long pixel;
unsigned long pixel;
int offs = (x + y * image->width);
if (image->format == RRGBFormat)
pixel = image->data[offs * 3] << 16 | image->data[offs * 3 + 1] << 8
| image->data[offs * 3 + 2];
else
pixel = image->data[offs * 4] << 16 | image->data[offs * 4 + 1] << 8
| image->data[offs * 4 + 2] | image->data[offs * 4 + 3] << 24;
if (image->format == RRGBFormat) {
pixel = ((unsigned long) image->data[offs * 3 ]) << 16;
pixel |= ((unsigned long) image->data[offs * 3 + 1]) << 8;
pixel |= ((unsigned long) image->data[offs * 3 + 2]);
} else {
pixel = ((unsigned long) image->data[offs * 4 ]) << 16;
pixel |= ((unsigned long) image->data[offs * 4 + 1]) << 8;
pixel |= ((unsigned long) image->data[offs * 4 + 2]);
pixel |= ((unsigned long) image->data[offs * 4 + 3]) << 24;
}
data[o++] = pixel;
}
@@ -414,7 +395,11 @@ static void setWindowMakerHints(WMWindow * win)
memset(&attribs, 0, sizeof(GNUstepWMAttributes));
attribs.flags = GSWindowStyleAttr | GSWindowLevelAttr | GSExtraFlagsAttr;
if (win->minSize.width == win->maxSize.width && win->minSize.height == win->maxSize.height)
win->flags.style &= ~WMResizableWindowMask;
attribs.window_style = win->flags.style;
attribs.window_level = win->level;
if (win->flags.documentEdited)
attribs.extra_flags = GSDocumentEditedFlag;
+251 -213
View File
@@ -28,9 +28,119 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <math.h>
#include "TexturePanel.h"
static const struct {
const char *key;
const char *default_value;
const char *label;
WMRect preview; /* The rectangle where the corresponding object is displayed */
WMPoint hand; /* The coordinate where the hand is drawn when pointing this item */
} colorOptions[] = {
/* Related to Window titles */
{ "FTitleColor", "white", N_("Focused Window Title"),
{ { 30, 10 }, { 190, 20 } }, { 5, 10 } },
{ "UTitleColor", "black", N_("Unfocused Window Title"),
{ { 30, 40 }, { 190, 20 } }, { 5, 40 } },
{ "PTitleColor", "white", N_("Owner of Focused Window Title"),
{ { 30, 70 }, { 190, 20 } }, { 5, 70 } },
/* Related to Menus */
{ "MenuTitleColor", "white", N_("Menu Title") ,
{ { 30, 120 }, { 90, 20 } }, { 5, 120 } },
{ "MenuTextColor", "black", N_("Menu Item Text") ,
{ { 30, 140 }, { 90, 20 } }, { 5, 140 } },
{ "MenuDisabledColor", "#616161", N_("Disabled Menu Item Text") ,
{ { 30, 160 }, { 90, 20 } }, { 5, 160 } },
{ "HighlightColor", "white", N_("Menu Highlight Color") ,
{ { 30, 180 }, { 90, 20 } }, { 5, 180 } },
{ "HighlightTextColor", "black", N_("Highlighted Menu Text Color") ,
{ { 30, 200 }, { 90, 20 } }, { 5, 180 } },
/*
* yuck kluge: the coordinate for HighlightTextColor are actually those of the last "Normal item"
* at the bottom when user clicks it, the "yuck kluge" in the function 'previewClick' will swap it
* for the MenuTextColor selection as user would expect
*
* Note that the entries are reffered by their index for performance
*/
/* Related to Window's border */
{ "FrameFocusedBorderColor", "black", N_("Focused Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
{ "FrameBorderColor", "black", N_("Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
{ "FrameSelectedBorderColor", "white", N_("Selected Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
/* Related to Icons and Clip */
{ "IconTitleColor", "white", N_("Miniwindow Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "IconTitleBack", "black", N_("Miniwindow Title Back") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "ClipTitleColor", "black", N_("Clip Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "CClipTitleColor", "#454045", N_("Collapsed Clip Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } }
};
/********************************************************************/
typedef enum {
MSTYLE_NORMAL = 0,
MSTYLE_SINGLE = 1,
MSTYLE_FLAT = 2
} menu_style_index;
static const struct {
const char *db_value;
const char *file_name;
} menu_style[] = {
[MSTYLE_NORMAL] = { "normal", "msty1" },
[MSTYLE_SINGLE] = { "singletexture", "msty2" },
[MSTYLE_FLAT] = { "flat", "msty3" }
};
/********************************************************************/
static const struct {
const char *label;
const char *db_value;
} wintitle_align[] = {
[WALeft] = { N_("Left"), "left" },
[WACenter] = { N_("Center"), "center" },
[WARight] = { N_("Right"), "right" }
};
/********************************************************************/
static const char *const sample_colors[] = {
"black",
"#292929",
"#525252",
"#848484",
"#adadad",
"#d6d6d6",
"white",
"#d6d68c",
"#d6a57b",
"#8cd68c",
"#8cd6ce",
"#d68c8c",
"#8c9cd6",
"#bd86d6",
"#d68cbd",
"#d64a4a",
"#4a5ad6",
"#4ad6ce",
"#4ad65a",
"#ced64a",
"#d6844a",
"#8ad631",
"#ce29c6",
"#ce2973"
};
/********************************************************************/
typedef struct _Panel {
WMBox *box;
char *sectionName;
@@ -60,20 +170,20 @@ typedef struct _Panel {
WMFrame *colF;
WMPopUpButton *colP;
WMColor *colors[15];
WMColor *colors[wlengthof_nocheck(colorOptions)];
WMColorWell *colW;
WMColorWell *sampW[24];
WMColorWell *sampW[wlengthof_nocheck(sample_colors)];
/* options */
WMFrame *optF;
WMFrame *mstyF;
WMButton *mstyB[3];
WMButton *mstyB[wlengthof_nocheck(menu_style)];
WMFrame *taliF;
WMButton *taliB[3];
WMButton *taliB[wlengthof_nocheck(wintitle_align)];
/* */
@@ -94,9 +204,9 @@ typedef struct _Panel {
char oldTabItem;
int menuStyle;
menu_style_index menuStyle;
int titleAlignment;
WMAlignment titleAlignment;
Pixmap preview;
Pixmap previewNoText;
@@ -151,10 +261,6 @@ static WMTabViewDelegate tabviewDelegate = {
#define TEDIT_FILE "tedit"
#define TEXTR_FILE "textr"
#define MSTYLE1_FILE "msty1"
#define MSTYLE2_FILE "msty2"
#define MSTYLE3_FILE "msty3"
/* XPM */
static char *blueled_xpm[] = {
"8 8 17 1",
@@ -263,34 +369,6 @@ static char *hand_xpm[] = {
" "
};
static char *sampleColors[] = {
"black",
"#292929",
"#525252",
"#848484",
"#adadad",
"#d6d6d6",
"white",
"#d6d68c",
"#d6a57b",
"#8cd68c",
"#8cd6ce",
"#d68c8c",
"#8c9cd6",
"#bd86d6",
"#d68cbd",
"#d64a4a",
"#4a5ad6",
"#4ad6ce",
"#4ad65a",
"#ced64a",
"#d6844a",
"#8ad631",
"#ce29c6",
"#ce2973",
"black"
};
static const struct {
const char *key;
const char *default_value;
@@ -345,12 +423,6 @@ enum {
TEXPREV_HEIGHT = 24
};
enum {
MSTYLE_NORMAL,
MSTYLE_SINGLE,
MSTYLE_FLAT
};
enum {
FTITLE_COL,
UTITLE_COL,
@@ -369,70 +441,23 @@ enum {
CCLIP_COL
};
static const struct {
const char *key;
const char *default_value;
const char *label;
WMRect preview; /* The rectangle where the corresponding object is displayed */
WMPoint hand; /* The coordinate where the hand is drawn when pointing this item */
} colorOptions[] = {
/* Related to Window titles */
{ "FTitleColor", "white", N_("Focused Window Title"),
{ { 30, 10 }, { 190, 20 } }, { 5, 10 } },
{ "UTitleColor", "black", N_("Unfocused Window Title"),
{ { 30, 40 }, { 190, 20 } }, { 5, 40 } },
{ "PTitleColor", "white", N_("Owner of Focused Window Title"),
{ { 30, 70 }, { 190, 20 } }, { 5, 70 } },
/* Related to Menus */
{ "MenuTitleColor", "white", N_("Menu Title") ,
{ { 30, 120 }, { 90, 20 } }, { 5, 120 } },
{ "MenuTextColor", "black", N_("Menu Item Text") ,
{ { 30, 140 }, { 90, 20 } }, { 5, 140 } },
{ "MenuDisabledColor", "#616161", N_("Disabled Menu Item Text") ,
{ { 30, 160 }, { 90, 20 } }, { 5, 160 } },
{ "HighlightColor", "white", N_("Menu Highlight Color") ,
{ { 30, 180 }, { 90, 20 } }, { 5, 180 } },
{ "HighlightTextColor", "black", N_("Highlighted Menu Text Color") ,
{ { 30, 200 }, { 90, 20 } }, { 5, 180 } },
/*
* yuck kluge: the coordinate for HighlightTextColor are actually those of the last "Normal item"
* at the bottom when user clicks it, the "yuck kluge" in the function 'previewClick' will swap it
* for the MenuTextColor selection as user would expect
*
* Note that the entries are reffered by their index for performance
*/
/* Related to Window's border */
{ "FrameFocusedBorderColor", "black", N_("Focused Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
{ "FrameBorderColor", "black", N_("Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
{ "FrameSelectedBorderColor", "white", N_("Selected Window Border Color") ,
{ { 0, 0 }, { 0, 0 } }, { -22, -21 } },
/* Related to Icons and Clip */
{ "IconTitleColor", "white", N_("Miniwindow Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "IconTitleBack", "black", N_("Miniwindow Title Back") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "ClipTitleColor", "black", N_("Clip Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } },
{ "CClipTitleColor", "#454045", N_("Collapsed Clip Title") ,
{ { 155, 130 }, { 64, 64 } }, { 130, 132 } }
};
static void str2rcolor(RContext * rc, const char *name, RColor * color)
{
XColor xcolor;
XParseColor(rc->dpy, rc->cmap, name, &xcolor);
color->alpha = 255;
color->red = xcolor.red >> 8;
color->green = xcolor.green >> 8;
color->blue = xcolor.blue >> 8;
if (XParseColor(rc->dpy, rc->cmap, name, &xcolor) != 0) {
color->alpha = 255;
color->red = xcolor.red >> 8;
color->green = xcolor.green >> 8;
color->blue = xcolor.blue >> 8;
} else {
/* Color Name was not found - Return white instead */
color->alpha = 255;
color->red = 255;
color->green = 255;
color->blue = 255;
}
}
static void dumpRImage(const char *path, RImage * image)
@@ -540,10 +565,10 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
if (path) {
timage = RLoadImage(rc, path, 0);
if (!timage)
wwarning("could not load file '%s': %s", path, RMessageForError(RErrorCode));
wwarning(_("could not load file '%s': %s"), path, RMessageForError(RErrorCode));
wfree(path);
} else {
wwarning("could not find file '%s' for %s of texture", str, type);
wwarning(_("could not find file '%s' for texture type %s"), str, type);
timage = NULL;
}
if (!timage) {
@@ -591,7 +616,8 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
style = RHorizontalGradient;
break;
default:
wwarning("unknow direction in '%s', falling back to diagonal", type);
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -617,7 +643,8 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
style = RHorizontalGradient;
break;
default:
wwarning("unknow direction in '%s', falling back to diagonal", type);
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -651,7 +678,8 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
style = RHorizontalGradient;
break;
default:
wwarning("unknow direction in '%s', falling back to diagonal", type);
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -698,7 +726,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
break;
default:
wwarning("type '%s' in not a supported type for a texture", type);
wwarning(_("type '%s' is not a supported type for a texture"), type);
RReleaseImage(timage);
return None;
}
@@ -1048,6 +1076,8 @@ static void deleteTexture(WMWidget * w, void *data)
(void) w;
section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
row = WMGetListSelectedItemRow(panel->texLs);
item = WMGetListItem(panel->texLs, row);
titem = (TextureListItem *) item->clientData;
@@ -1066,7 +1096,7 @@ static void deleteTexture(WMWidget * w, void *data)
WMReleasePropList(titem->prop);
if (titem->path) {
if (remove(titem->path) < 0 && errno != ENOENT) {
werror("could not remove file %s", titem->path);
werror(_("could not remove file %s"), titem->path);
}
wfree(titem->path);
}
@@ -1106,6 +1136,8 @@ static void changePage(WMWidget * w, void *data)
if (w) {
section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
@@ -1205,6 +1237,8 @@ static void textureDoubleClick(WMWidget * w, void *data)
/* unselect old texture */
section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
titem = (TextureListItem *) item->clientData;
@@ -1233,7 +1267,7 @@ static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int
{
_Panel *panel = (_Panel *) WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
int width, height, x, y;
int width, height, x, y, tmp;
Display *dpy = WMScreenDisplay(scr);
WMColor *back = (state & WLDSSelected) ? WMWhiteColor(scr) : WMGrayColor(scr);
WMListItem *item;
@@ -1262,7 +1296,8 @@ static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int
XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0,
TEXPREV_WIDTH, TEXPREV_HEIGHT, x + 5, y + 5);
if ((1 << WMGetPopUpButtonSelectedItem(panel->secP)) & titem->selectedFor)
tmp = WMGetPopUpButtonSelectedItem(panel->secP);
if ((tmp >= 0) && ((1 << tmp) & titem->selectedFor))
WMDrawPixmap(panel->onLed, d, x + TEXPREV_WIDTH + 10, y + 6);
else if (titem->selectedFor)
WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6);
@@ -1291,10 +1326,22 @@ static Pixmap loadRImage(WMScreen * scr, const char *path)
cnt = fscanf(f, "%02x%02x%1x", &w, &h, &d);
if (cnt != 3) {
wwarning(_("could not read size of image from '%s', ignoring"), path);
fclose(f);
return None;
}
if (d < 3 || d > 4) {
wwarning(_("image \"%s\" has an invalid depth of %d, ignoring"), path, d);
fclose(f);
return None;
}
image = RCreateImage(w, h, d == 4);
if (image == NULL) {
wwarning(_("could not create RImage for \"%s\": %s"),
path, RMessageForError(RErrorCode));
fclose(f);
return None;
}
read_size = w * h * d;
if (fread(image->data, 1, read_size, f) == read_size)
RConvertImage(WMScreenRContext(scr), image, &pixmap);
@@ -1353,8 +1400,8 @@ static void fillColorList(_Panel * panel)
list = WMGetUDObjectForKey(udb, "ColorList");
if (!list) {
for (i = 0; i < 24; i++) {
color = WMCreateNamedColor(scr, sampleColors[i], False);
for (i = 0; i < wlengthof(sample_colors); i++) {
color = WMCreateNamedColor(scr, sample_colors[i], False);
if (!color)
continue;
WMSetColorWellColor(panel->sampW[i], color);
@@ -1363,7 +1410,7 @@ static void fillColorList(_Panel * panel)
} else {
WMPropList *c;
for (i = 0; i < WMIN(24, WMGetPropListItemCount(list)); i++) {
for (i = 0; i < WMIN(wlengthof(sample_colors), WMGetPropListItemCount(list)); i++) {
c = WMGetFromPLArray(list, i);
if (!c || !WMIsPLString(c))
continue;
@@ -1385,6 +1432,10 @@ static void changeColorPage(WMWidget * w, void *data)
WMScreen *scr = WMWidgetScreen(panel->box);
RContext *rc = WMScreenRContext(scr);
section = WMGetPopUpButtonSelectedItem(panel->colP);
if (section < 0)
return;
if (panel->preview) {
GC gc;
@@ -1396,7 +1447,6 @@ static void changeColorPage(WMWidget * w, void *data)
colorOptions[panel->oldcsection].hand.y);
}
if (w) {
section = WMGetPopUpButtonSelectedItem(panel->colP);
panel->oldcsection = section;
if (panel->preview)
@@ -1593,7 +1643,9 @@ static void updateColorPreviewBox(_Panel * panel, int elements)
panel->smallFont, 155, 130, 64, 13, WALeft,
_("Icon Text"));
}
WMReleaseColor(light);
WMReleaseColor(dim);
}
if (elements & (1 << CLIP_COL) || elements & (1 << CCLIP_COL)) {
Pixmap pix;
@@ -1695,6 +1747,8 @@ static void colorWellObserver(void *self, WMNotification * n)
(void) n;
p = WMGetPopUpButtonSelectedItem(panel->colP);
if (p < 0)
return;
WMReleaseColor(panel->colors[p]);
@@ -1749,37 +1803,31 @@ static void changedTabItem(struct WMTabViewDelegate *self, WMTabView * tabView,
static void menuStyleCallback(WMWidget * self, void *data)
{
_Panel *panel = (_Panel *) data;
menu_style_index i;
if (self == panel->mstyB[0]) {
panel->menuStyle = MSTYLE_NORMAL;
updatePreviewBox(panel, 1 << PMITEM);
} else if (self == panel->mstyB[1]) {
panel->menuStyle = MSTYLE_SINGLE;
updatePreviewBox(panel, 1 << PMITEM);
} else if (self == panel->mstyB[2]) {
panel->menuStyle = MSTYLE_FLAT;
updatePreviewBox(panel, 1 << PMITEM);
for (i = 0; i < wlengthof(menu_style); i++) {
if (self == panel->mstyB[i]) {
panel->menuStyle = i;
break;
}
}
updatePreviewBox(panel, 1 << PMITEM);
}
static void titleAlignCallback(WMWidget * self, void *data)
{
_Panel *panel = (_Panel *) data;
WMAlignment align;
if (self == panel->taliB[0]) {
panel->titleAlignment = WALeft;
updatePreviewBox(panel, 1 << PFOCUSED | 1 << PUNFOCUSED | 1 << POWNER);
} else if (self == panel->taliB[1]) {
panel->titleAlignment = WACenter;
updatePreviewBox(panel, 1 << PFOCUSED | 1 << PUNFOCUSED | 1 << POWNER);
} else if (self == panel->taliB[2]) {
panel->titleAlignment = WARight;
updatePreviewBox(panel, 1 << PFOCUSED | 1 << PUNFOCUSED | 1 << POWNER);
for (align = 0; align < wlengthof(wintitle_align); align++) {
if (self == panel->taliB[align]) {
panel->titleAlignment = align;
break;
}
}
updatePreviewBox(panel, 1 << PFOCUSED | 1 << PUNFOCUSED | 1 << POWNER);
}
static void createPanel(Panel * p)
@@ -1792,10 +1840,10 @@ static void createPanel(Panel * p)
char *tmp;
Bool ok = True;
panel->fprefix = wstrconcat(wusergnusteppath(), "/Library/WindowMaker");
panel->fprefix = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME);
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix);
ok = False;
}
@@ -1805,7 +1853,7 @@ static void createPanel(Panel * p)
wfree(panel->fprefix);
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
werror("%s", panel->fprefix);
}
}
@@ -1952,13 +2000,31 @@ static void createPanel(Panel * p)
WMMoveWidget(panel->colW, 30, 75);
WMAddNotificationObserver(colorWellObserver, panel, WMColorWellDidChangeNotification, panel->colW);
for (i = 0; i < 4; i++) {
int j;
for (j = 0; j < 6; j++) {
panel->sampW[i + j * 4] = WMCreateColorWell(panel->colF);
WMResizeWidget(panel->sampW[i + j * 4], 22, 22);
WMMoveWidget(panel->sampW[i + j * 4], 130 + i * 22, 40 + j * 22);
WSetColorWellBordered(panel->sampW[i + j * 4], False);
{ /* Distribute the color samples regularly in the right half */
const int parent_width = 242;
const int parent_height = 195;
const int available_width = (parent_width / 2) - 7;
const int available_height = parent_height - 7 - 20 - 7 - 7;
const int widget_size = 22;
const int nb_x = (int) round(sqrt(wlengthof(sample_colors) * available_width / available_height));
const int nb_y = (wlengthof(sample_colors) + nb_x - 1) / nb_x;
const int offset_x = (parent_width / 2) + (available_width - nb_x * widget_size) / 2;
const int offset_y = (7 + 20 + 7) + (available_height - nb_y * widget_size) / 2;
int x, y;
x = 0; y = 0;
for (i = 0; i < wlengthof(sample_colors); i++) {
panel->sampW[i] = WMCreateColorWell(panel->colF);
WMResizeWidget(panel->sampW[i], widget_size, widget_size);
WMMoveWidget(panel->sampW[i], offset_x + x * widget_size, offset_y + y * widget_size);
WSetColorWellBordered(panel->sampW[i], False);
if (++x >= nb_x) {
y++;
x = 0;
}
}
}
@@ -1979,7 +2045,7 @@ static void createPanel(Panel * p)
WMMoveWidget(panel->mstyF, 15, 10);
WMSetFrameTitle(panel->mstyF, _("Menu Style"));
for (i = 0; i < 3; i++) {
for (i = 0; i < wlengthof(menu_style); i++) {
WMPixmap *icon;
char *path;
@@ -1988,17 +2054,7 @@ static void createPanel(Panel * p)
WMMoveWidget(panel->mstyB[i], 15 + i * 65, 20);
WMSetButtonImagePosition(panel->mstyB[i], WIPImageOnly);
WMSetButtonAction(panel->mstyB[i], menuStyleCallback, panel);
switch (i) {
case 0:
path = LocateImage(MSTYLE1_FILE);
break;
case 1:
path = LocateImage(MSTYLE2_FILE);
break;
case 2:
path = LocateImage(MSTYLE3_FILE);
break;
}
path = LocateImage(menu_style[i].file_name);
if (path) {
icon = WMCreatePixmapFromFile(scr, path);
if (icon) {
@@ -2020,20 +2076,10 @@ static void createPanel(Panel * p)
WMMoveWidget(panel->taliF, 15, 100);
WMSetFrameTitle(panel->taliF, _("Title Alignment"));
for (i = 0; i < 3; i++) {
for (i = 0; i < wlengthof(wintitle_align); i++) {
panel->taliB[i] = WMCreateRadioButton(panel->taliF);
WMSetButtonAction(panel->taliB[i], titleAlignCallback, panel);
switch (i) {
case 0:
WMSetButtonText(panel->taliB[i], _("Left"));
break;
case 1:
WMSetButtonText(panel->taliB[i], _("Center"));
break;
case 2:
WMSetButtonText(panel->taliB[i], _("Right"));
break;
}
WMSetButtonText(panel->taliB[i], _(wintitle_align[i].label));
WMResizeWidget(panel->taliB[i], 90, 18);
WMMoveWidget(panel->taliB[i], 10, 15 + 20 * i);
}
@@ -2093,21 +2139,27 @@ static void showData(_Panel * panel)
const char *str;
str = GetStringForKey("MenuStyle");
if (str && strcasecmp(str, "flat") == 0) {
panel->menuStyle = MSTYLE_FLAT;
} else if (str && strcasecmp(str, "singletexture") == 0) {
panel->menuStyle = MSTYLE_SINGLE;
} else {
panel->menuStyle = MSTYLE_NORMAL;
panel->menuStyle = MSTYLE_NORMAL;
if (str != NULL) {
for (i = 0; i < wlengthof(menu_style); i++) {
if (strcasecmp(str, menu_style[i].db_value) == 0) {
panel->menuStyle = i;
break;
}
}
}
str = GetStringForKey("TitleJustify");
if (str && strcasecmp(str, "left") == 0) {
panel->titleAlignment = WALeft;
} else if (str && strcasecmp(str, "right") == 0) {
panel->titleAlignment = WARight;
} else {
panel->titleAlignment = WACenter;
panel->titleAlignment = WACenter;
if (str != NULL) {
WMAlignment align;
for (align = 0; align < wlengthof(wintitle_align); align++) {
if (strcasecmp(str, wintitle_align[align].db_value) == 0) {
panel->titleAlignment = align;
break;
}
}
}
for (i = 0; i < wlengthof(colorOptions); i++) {
@@ -2159,30 +2211,8 @@ static void storeData(_Panel * panel)
}
}
switch (panel->menuStyle) {
case MSTYLE_SINGLE:
SetStringForKey("singletexture", "MenuStyle");
break;
case MSTYLE_FLAT:
SetStringForKey("flat", "MenuStyle");
break;
default:
case MSTYLE_NORMAL:
SetStringForKey("normal", "MenuStyle");
break;
}
switch (panel->titleAlignment) {
case WALeft:
SetStringForKey("left", "TitleJustify");
break;
case WARight:
SetStringForKey("right", "TitleJustify");
break;
default:
case WACenter:
SetStringForKey("center", "TitleJustify");
break;
}
SetStringForKey(menu_style[panel->menuStyle].db_value, "MenuStyle");
SetStringForKey(wintitle_align[panel->titleAlignment].db_value, "TitleJustify");
}
static void prepareForClose(_Panel * panel)
@@ -2198,11 +2228,16 @@ static void prepareForClose(_Panel * panel)
/* store list of textures */
for (i = 8; i < WMGetListNumberOfRows(panel->texLs); i++) {
WMPropList *pl_title, *pl_path;
item = WMGetListItem(panel->texLs, i);
titem = (TextureListItem *) item->clientData;
texture = WMCreatePLArray(WMCreatePLString(titem->title),
WMRetainPropList(titem->prop), WMCreatePLString(titem->path), NULL);
pl_title = WMCreatePLString(titem->title);
pl_path = WMCreatePLString(titem->path);
texture = WMCreatePLArray(pl_title, titem->prop, pl_path, NULL);
WMReleasePropList(pl_title);
WMReleasePropList(pl_path);
WMAddToPLArray(textureList, texture);
}
@@ -2212,14 +2247,17 @@ static void prepareForClose(_Panel * panel)
/* store list of colors */
textureList = WMCreatePLArray(NULL, NULL);
for (i = 0; i < 24; i++) {
for (i = 0; i < wlengthof(sample_colors); i++) {
WMColor *color;
char *str;
WMPropList *pl_color;
color = WMGetColorWellColor(panel->sampW[i]);
str = WMGetColorRGBDescription(color);
WMAddToPLArray(textureList, WMCreatePLString(str));
pl_color = WMCreatePLString(str);
WMAddToPLArray(textureList, pl_color);
WMReleasePropList(pl_color);
wfree(str);
}
WMSetUDObjectForKey(udb, textureList, "ColorList");
+63 -72
View File
@@ -21,6 +21,37 @@
#include "WPrefs.h"
static const char *const clip_delay_frame_titles[] = {
N_("Clip autocollapsing delays"),
N_("Clip autoraising delays")
};
static const struct {
const char *key;
const char *string;
} auto_delay[] = {
{ "ClipAutoexpandDelay", N_("Before auto-expansion") },
{ "ClipAutocollapseDelay", N_("Before auto-collapsing") },
{ "ClipAutoraiseDelay", N_("Before auto-raising") },
{ "ClipAutolowerDelay", N_("Before auto-lowering") }
};
static char *autoDelayPresetValues[5] = { "0", "100", "250", "600", "1000" };
static const struct {
const char *disable_key;
const char *icon_file;
const char *balloon_text;
} dock_config[] = {
{ "DisableDock", "dock",
N_("Disable/enable the application Dock (the\nvertical icon bar in the side of the screen).") },
{ "DisableClip", "clip",
N_("Disable/enable the Clip (that thing with\na paper clip icon).") },
{ "DisableDrawers", "drawer",
N_("Disable/enable Drawers (a dock that stores\napplication icons horizontally). The dock is required.") }
};
typedef struct _Panel {
WMBox *box;
@@ -32,14 +63,14 @@ typedef struct _Panel {
WMWidget *parent;
WMFrame *autoDelayF[2];
WMLabel *autoDelayL[4];
WMButton *autoDelayB[4][5];
WMTextField *autoDelayT[4];
WMLabel *autoDelayMsL[4];
WMFrame *autoDelayF[wlengthof_nocheck(clip_delay_frame_titles)];
WMLabel *autoDelayL[wlengthof_nocheck(auto_delay)];
WMButton *autoDelayB[wlengthof_nocheck(auto_delay)][wlengthof_nocheck(autoDelayPresetValues)];
WMTextField *autoDelayT[wlengthof_nocheck(auto_delay)];
WMLabel *autoDelayMsL[wlengthof_nocheck(auto_delay)];
WMFrame *dockF;
WMButton *docksB[3];
WMButton *docksB[wlengthof_nocheck(dock_config)];
} _Panel;
#define ICON_FILE "dockclipdrawersection"
@@ -48,28 +79,6 @@ typedef struct _Panel {
#define DELAY_ICON "timer%i"
#define DELAY_ICON_S "timer%is"
static const struct {
const char *key;
const char *string;
} auto_delay[] = {
{ "ClipAutoexpandDelay", N_("Before auto-expansion") },
{ "ClipAutocollapseDelay", N_("Before auto-collapsing") },
{ "ClipAutoraiseDelay", N_("Before auto-raise") },
{ "ClipAutolowerDelay", N_("Before auto-lowering") }
};
static char *autoDelayPresetValues[5] = { "0", "100", "250", "600", "1000" };
static const struct {
const char *disable_key;
const char *icon_file;
} dock_config[] = {
{ "DisableDock", "dock" },
{ "DisableClip", "clip" },
{ "DisableDrawers", "drawer" }
};
static void showData(_Panel *panel);
static void storeData(_Panel *panel);
@@ -78,9 +87,9 @@ static void pushAutoDelayButton(WMWidget *w, void *data)
{
_Panel *panel = (_Panel *) data;
int i, j;
for (i = 0; i < 4; i++)
for (i = 0; i < wlengthof(auto_delay); i++)
{
for (j = 0; j < 5; j++)
for (j = 0; j < wlengthof(autoDelayPresetValues); j++)
{
if (w == panel->autoDelayB[i][j])
{
@@ -98,7 +107,7 @@ static void adjustButtonSelectionBasedOnValue(_Panel *panel, int row, const char
if (!value)
return;
for (j = 0; j < 5; j++)
for (j = 0; j < wlengthof(autoDelayPresetValues); j++)
{
int isThatOne = !strcmp(autoDelayPresetValues[j], value);
WMSetButtonSelected(panel->autoDelayB[row][j], isThatOne);
@@ -112,7 +121,7 @@ static void autoDelayChanged(void *observerData, WMNotification *notification)
_Panel *panel = (_Panel *) observerData;
int row;
WMTextField *anAutoDelayT = (WMTextField *) WMGetNotificationObject(notification);
for (row = 0; row < 4; row++)
for (row = 0; row < wlengthof(panel->autoDelayT); row++)
{
if (anAutoDelayT != panel->autoDelayT[row])
{
@@ -170,29 +179,25 @@ static void createPanel(Panel *p)
buf1 = wmalloc(strlen(DELAY_ICON) + 1);
buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);
for (k = 0; k < 2; k++)
for (k = 0; k < wlengthof(clip_delay_frame_titles); k++)
{
panel->autoDelayF[k] = WMCreateFrame(panel->box);
WMResizeWidget(panel->autoDelayF[k], 370, 100);
WMMoveWidget(panel->autoDelayF[k], 15, 10 + k * 110);
if (k == 0)
WMSetFrameTitle(panel->autoDelayF[k], _("Clip autocollapsing delays"));
else
WMSetFrameTitle(panel->autoDelayF[k], _("Clip autoraising delays"));
WMResizeWidget(panel->autoDelayF[k], 372, 100);
WMMoveWidget(panel->autoDelayF[k], 11, 10 + k * 110);
WMSetFrameTitle(panel->autoDelayF[k], _(clip_delay_frame_titles[k]));
for (i = 0; i < 2; i++)
{
panel->autoDelayL[i + k * 2] = WMCreateLabel(panel->autoDelayF[k]);
WMResizeWidget(panel->autoDelayL[i + k * 2], 155, 20);
WMMoveWidget(panel->autoDelayL[i + k * 2], 10, 27 + 40 * i);
WMResizeWidget(panel->autoDelayL[i + k * 2], 152, 20);
WMMoveWidget(panel->autoDelayL[i + k * 2], 8, 27 + 40 * i);
WMSetLabelText(panel->autoDelayL[i + k * 2], _(auto_delay[i + k * 2].string));
/* WMSetLabelTextAlignment(panel->autoDelayL[i + k * 2], WARight); */
for (j = 0; j < 5; j++)
for (j = 0; j < wlengthof(autoDelayPresetValues); j++)
{
panel->autoDelayB[i + k * 2][j] = WMCreateCustomButton(panel->autoDelayF[k], WBBStateChangeMask);
WMResizeWidget(panel->autoDelayB[i + k * 2][j], 25, 25);
WMMoveWidget(panel->autoDelayB[i + k * 2][j], 145 + (28 * j), 25 + 40 * i);
WMMoveWidget(panel->autoDelayB[i + k * 2][j], 160 + (26 * j), 25 + 40 * i);
WMSetButtonBordered(panel->autoDelayB[i + k * 2][j], False);
WMSetButtonImagePosition(panel->autoDelayB[i + k * 2][j], WIPImageOnly);
WMSetButtonAction(panel->autoDelayB[i + k * 2][j], pushAutoDelayButton, panel);
@@ -217,16 +222,16 @@ static void createPanel(Panel *p)
}
panel->autoDelayT[i + k * 2] = WMCreateTextField(panel->autoDelayF[k]);
WMResizeWidget(panel->autoDelayT[i + k * 2], 36, 20);
WMMoveWidget(panel->autoDelayT[i + k * 2], 287, 27 + 40 * i);
WMResizeWidget(panel->autoDelayT[i + k * 2], 41, 20);
WMMoveWidget(panel->autoDelayT[i + k * 2], 293, 27 + 40 * i);
WMAddNotificationObserver(autoDelayChanged, panel, WMTextDidChangeNotification, panel->autoDelayT[i + k * 2]);
color = WMDarkGrayColor(scr);
font = WMSystemFontOfSize(scr, 10);
panel->autoDelayMsL[i + k * 2] = WMCreateLabel(panel->autoDelayF[k]);
WMResizeWidget(panel->autoDelayMsL[i + k * 2], 36, 16);
WMMoveWidget(panel->autoDelayMsL[i + k * 2], 327, 33 + 40 *i);
WMSetLabelText(panel->autoDelayMsL[i + k * 2], _("msec"));
WMResizeWidget(panel->autoDelayMsL[i + k * 2], 26, 16);
WMMoveWidget(panel->autoDelayMsL[i + k * 2], 337, 30 + 40 * i);
WMSetLabelText(panel->autoDelayMsL[i + k * 2], _("ms"));
WMSetLabelTextColor(panel->autoDelayMsL[i + k * 2], color);
WMSetLabelFont(panel->autoDelayMsL[i + k * 2], font);
WMReleaseColor(color);
@@ -241,10 +246,10 @@ static void createPanel(Panel *p)
/***************** Enable/disable clip/dock/drawers *****************/
panel->dockF = WMCreateFrame(panel->box);
WMResizeWidget(panel->dockF, 115, 210);
WMMoveWidget(panel->dockF, 390, 10);
WMMoveWidget(panel->dockF, 394, 10);
WMSetFrameTitle(panel->dockF, _("Dock/Clip/Drawer"));
for (i = 0; i < 3; i++)
for (i = 0; i < wlengthof(dock_config); i++)
{
panel->docksB[i] = WMCreateButton(panel->dockF, WBTToggle);
WMResizeWidget(panel->docksB[i], 56, 56);
@@ -259,24 +264,10 @@ static void createPanel(Panel *p)
WMSetButtonAltImage(panel->docksB[i], icon1);
WMReleasePixmap(icon1);
}
switch(i)
{
case 0:
WMSetBalloonTextForView(_("Disable/enable the application Dock (the\n"
"vertical icon bar in the side of the screen)."), WMWidgetView(panel->docksB[i]));
break;
case 1:
WMSetBalloonTextForView(_("Disable/enable the Clip (that thing with\n"
"a paper clip icon)."), WMWidgetView(panel->docksB[i]));
break;
case 2:
WMSetBalloonTextForView(_("Disable/enable Drawers (a dock that stores\n"
"application icons horizontally). The dock is required."), WMWidgetView(panel->docksB[i]));
break;
}
WMSetBalloonTextForView(_(dock_config[i].balloon_text), WMWidgetView(panel->docksB[i]));
WMSetButtonAction(panel->docksB[i], pushDockButton, panel);
}
WMMapSubwidgets(panel->dockF);
if (xis)
@@ -291,7 +282,7 @@ static void createPanel(Panel *p)
static void storeData(_Panel *panel)
{
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < wlengthof(auto_delay); i++)
{
char *str;
@@ -299,7 +290,7 @@ static void storeData(_Panel *panel)
SetStringForKey(str, auto_delay[i].key);
wfree(str);
}
for (i = 0; i < 3; i++)
for (i = 0; i < wlengthof(dock_config); i++)
{
SetBoolForKey(!WMGetButtonSelected(panel->docksB[i]), dock_config[i].disable_key);
}
@@ -309,13 +300,13 @@ static void showData(_Panel *panel)
{
char *value;
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < wlengthof(auto_delay); i++)
{
value = GetStringForKey(auto_delay[i].key);
WMSetTextFieldText(panel->autoDelayT[i], value);
adjustButtonSelectionBasedOnValue(panel, i, value);
}
for (i = 0; i < 3; i++)
for (i = 0; i < wlengthof(dock_config); i++)
{
WMSetButtonSelected(panel->docksB[i], !GetBoolForKey(dock_config[i].disable_key));
}
+295 -11
View File
@@ -2,8 +2,9 @@
*
* WPrefs - Window Maker Preferences Program
*
* Copyright (c) 2014 Window Maker Team
* Copyright (c) 2014-2023 Window Maker Team
* Copyright (c) 1998-2003 Alfredo K. Kojima
* Copyright (c) 2009-2026 Window Maker Team
*
* 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
@@ -25,7 +26,7 @@
/* This structure containts the list of all the check-buttons to display in the
* expert tab of the window with the corresponding information for effect
*/
static const struct {
static struct expert_option {
const char *label; /* Text displayed to user */
int def_state; /* True/False: the default value, if not defined in current config */
@@ -33,7 +34,8 @@ static const struct {
enum {
OPTION_WMAKER,
OPTION_WMAKER_ARRAY,
OPTION_USERDEF
OPTION_USERDEF,
OPTION_WMAKER_INT
} class;
const char *op_name; /* The identifier for the option in the config file */
@@ -43,6 +45,12 @@ static const struct {
{ N_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."),
/* default: */ False, OPTION_WMAKER, "DisableMiniwindows" },
{ N_("Ignore decoration hints for GTK applications."),
/* default: */ False, OPTION_WMAKER, "IgnoreGtkHints" },
{ N_("Enable workspace pager."),
/* default: */ False, OPTION_WMAKER, "EnableWorkspacePager" },
{ N_("Do not set non-WindowMaker specific parameters (do not use xset)."),
/* default: */ False, OPTION_USERDEF, "NoXSetStuff" },
@@ -64,9 +72,15 @@ static const struct {
{ N_("Cycle windows only on the active head."),
/* default: */ False, OPTION_WMAKER, "CycleActiveHeadOnly" },
{ N_("Cycle all windows from all workspaces."),
/* default: */ False, OPTION_WMAKER, "CycleAllWorkspaces" },
{ N_("Ignore minimized windows when cycling."),
/* default: */ False, OPTION_WMAKER, "CycleIgnoreMinimized" },
{ N_("Show app icons in window list."),
/* default: */ False, OPTION_WMAKER, "WindowListAppIcons" },
{ N_("Show switch panel when cycling windows."),
/* default: */ True, OPTION_WMAKER_ARRAY, "SwitchPanelImages" },
@@ -78,12 +92,55 @@ static const struct {
#ifdef XKB_MODELOCK
{ N_("Enable keyboard language switch button in window titlebars."),
/* default: */ False, OPTION_WMAKER, "KbdModeLock" }
/* default: */ False, OPTION_WMAKER, "KbdModeLock" },
#endif /* XKB_MODELOCK */
{ N_("Snap a window to edge or corner by dragging."),
/* default: */ False, OPTION_WMAKER, "WindowSnapping" },
{ N_("Distance from edge to begin window snap."),
/* default: */ 1, OPTION_WMAKER_INT, "SnapEdgeDetect" },
{ N_("Distance from corner to begin window snap."),
/* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
{ N_("Snap a window to the top to maximize it to the full screen."),
/* default: */ False, OPTION_WMAKER, "SnapToTopMaximizesFullscreen" },
{ N_("Allow move half-maximized windows between multiple screens."),
/* default: */ False, OPTION_WMAKER, "MoveHalfMaximizedWindowsBetweenScreens" },
{ N_("Alternative transitions between states for half maximized windows."),
/* default: */ False, OPTION_WMAKER, "AlternativeHalfMaximized" },
{ N_("Move mouse pointer with half maximized windows."),
/* default: */ False, OPTION_WMAKER, "PointerWithHalfMaxWindows" },
{ N_("Open dialogs in the same workspace as their owners."),
/* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" },
{ N_("Wrap dock-attached icons around the screen edges."),
/* default: */ True, OPTION_WMAKER, "WrapAppiconsInDock" },
{ N_("Double click on titlebar maximizes/minimizes a window to/from full screen."),
/* default: */ False, OPTION_WMAKER, "DbClickFullScreen" },
{ N_("Close rootmenu when mouse (left or right) is clicked outside focus."),
/* default: */ False, OPTION_WMAKER, "CloseRootMenuByLeftOrRightMouseClick" },
{ N_("Keep dock on primary head."),
/* default: */ False, OPTION_WMAKER, "KeepDockOnPrimaryHead"},
{ N_("Allow windows to take focus using mouse wheel."),
/* default: */ False, OPTION_WMAKER, "MouseWheelFocus"},
#ifdef USE_RANDR
{ N_("Automatically (de)activate monitors on hotplug events."),
/* default: */ False, OPTION_WMAKER, "HotplugMonitor"},
#endif
};
typedef struct _Panel {
WMBox *box;
char *sectionName;
@@ -94,12 +151,173 @@ typedef struct _Panel {
WMWidget *parent;
WMButton *swi[sizeof(expert_options) / sizeof(expert_options[0])];
WMButton *swi[wlengthof_nocheck(expert_options)];
WMTextField *textfield[wlengthof_nocheck(expert_options)];
WMScrollView *sv;
WMWidget *frame;
} _Panel;
#define ICON_FILE "expert"
static void changeIntTextfield(void *data, int delta)
{
WMTextField *textfield;
char *text, buffer[12];
int value;
textfield = (WMTextField *)data;
text = WMGetTextFieldText(textfield);
value = atoi(text);
wfree(text);
value += delta;
sprintf(buffer, "%d", value);
WMSetTextFieldText(textfield, buffer);
}
static void scrollViewWheelHandler(XEvent *event, void *data)
{
_Panel *panel = (_Panel *) data;
int amount, viewH, contentH, newY, maxY;
WMRect rect;
WMPoint pt;
if (!panel || !panel->sv || !panel->frame)
return;
if (event->type != ButtonPress)
return;
if (event->xbutton.button != WINGsConfiguration.mouseWheelUp &&
event->xbutton.button != WINGsConfiguration.mouseWheelDown)
return;
rect = WMGetScrollViewVisibleRect(panel->sv);
viewH = rect.size.height;
contentH = WMWidgetHeight(panel->frame);
if (event->xbutton.state & ControlMask) {
amount = viewH; /* page */
} else if (event->xbutton.state & ShiftMask) {
amount = 1; /* line */
} else {
amount = viewH / 3; /* default */
if (amount == 0)
amount = 1;
}
if (event->xbutton.button == WINGsConfiguration.mouseWheelUp)
amount = -amount;
newY = rect.pos.y + amount;
maxY = contentH - viewH;
if (maxY < 0)
maxY = 0;
if (newY < 0)
newY = 0;
if (newY > maxY)
newY = maxY;
pt.x = rect.pos.x;
pt.y = newY;
WMScrollViewScrollPoint(panel->sv, pt);
}
static void scrollViewRealizeObserver(void *self, WMNotification *not)
{
(void) not;
_Panel *panel = (_Panel *) self;
Display *dpy = NULL;
Window viewport_win = 0;
WMView *frameView;
if (!panel || !panel->frame)
return;
frameView = WMWidgetView(panel->frame);
if (frameView && frameView->parent) {
dpy = frameView->screen->display;
viewport_win = frameView->parent->window;
}
/* fallback: use the scrollview's view window if parent viewport not available */
if (!viewport_win && panel->sv) {
WMView *svView = WMWidgetView(panel->sv);
if (svView && svView->screen) {
dpy = svView->screen->display;
viewport_win = svView->window;
}
}
if (!dpy || viewport_win == 0)
return;
XGrabButton(dpy, WINGsConfiguration.mouseWheelUp, AnyModifier, viewport_win,
True, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None);
XGrabButton(dpy, WINGsConfiguration.mouseWheelDown, AnyModifier, viewport_win,
True, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None);
}
static void scrollViewPrepareForClose(Panel *p)
{
_Panel *panel = (_Panel *) p;
Display *dpy = NULL;
Window viewport_win = 0;
if (!panel)
return;
if (panel->frame) {
WMView *frameView = WMWidgetView(panel->frame);
if (frameView && frameView->parent) {
dpy = frameView->screen->display;
viewport_win = frameView->parent->window;
}
}
if (!viewport_win && panel->sv) {
WMView *svView = WMWidgetView(panel->sv);
if (svView && svView->screen) {
dpy = svView->screen->display;
viewport_win = svView->window;
}
}
if (dpy && viewport_win != 0) {
XUngrabButton(dpy, WINGsConfiguration.mouseWheelUp, AnyModifier, viewport_win);
XUngrabButton(dpy, WINGsConfiguration.mouseWheelDown, AnyModifier, viewport_win);
}
WMRemoveNotificationObserver(panel);
}
static void downButtonCallback(WMWidget *self, void *data)
{
(void) self;
changeIntTextfield(data, -1);
}
static void upButtonCallback(WMWidget *self, void *data)
{
(void) self;
changeIntTextfield(data, 1);
}
static int cmpExpertOptions(const void *v1, const void *v2)
{
int rc;
const struct expert_option *opt1 = (struct expert_option *)v1;
const struct expert_option *opt2 = (struct expert_option *)v2;
if ((rc = strcmp(opt1->label, opt2->label)) < 0)
return -1;
else if (rc > 0)
return 1;
return 0;
}
static void createPanel(Panel *p)
{
@@ -124,12 +342,15 @@ static void createPanel(Panel *p)
WMSetFrameRelief(f, WRFlat);
udb = WMGetStandardUserDefaults();
qsort(expert_options, wlengthof(expert_options), sizeof(expert_options[0]), cmpExpertOptions);
for (i = 0; i < wlengthof(expert_options); i++) {
panel->swi[i] = WMCreateSwitchButton(f);
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
if (expert_options[i].class != OPTION_WMAKER_INT) {
panel->swi[i] = WMCreateSwitchButton(f);
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
WMSetButtonText(panel->swi[i], _(expert_options[i].label));
WMSetButtonText(panel->swi[i], _(expert_options[i].label));
}
switch (expert_options[i].class) {
case OPTION_WMAKER:
@@ -151,19 +372,68 @@ static void createPanel(Panel *p)
state = WMGetUDBoolForKey(udb, expert_options[i].op_name);
break;
case OPTION_WMAKER_INT:
{
char tmp[10];
WMButton *up, *down;
WMLabel *label;
panel->textfield[i] = WMCreateTextField(f);
WMResizeWidget(panel->textfield[i], 41, 20);
WMMoveWidget(panel->textfield[i], 22, 7 + i * 25);
down = WMCreateCommandButton(f);
WMSetButtonImage(down, WMGetSystemPixmap(WMWidgetScreen(down), WSIArrowDown));
WMSetButtonAltImage(down,
WMGetSystemPixmap(WMWidgetScreen(down), WSIHighlightedArrowDown));
WMSetButtonImagePosition(down, WIPImageOnly);
WMSetButtonAction(down, downButtonCallback, panel->textfield[i]);
WMResizeWidget(down, 16, 16);
WMMoveWidget(down, 5, 9 + i * 25);
up = WMCreateCommandButton(f);
WMSetButtonImage(up, WMGetSystemPixmap(WMWidgetScreen(up), WSIArrowUp));
WMSetButtonAltImage(up, WMGetSystemPixmap(WMWidgetScreen(up), WSIHighlightedArrowUp));
WMSetButtonImagePosition(up, WIPImageOnly);
WMSetButtonAction(up, upButtonCallback, panel->textfield[i]);
WMResizeWidget(up, 16, 16);
WMMoveWidget(up, 64, 9 + i * 25);
label = WMCreateLabel(f);
WMSetLabelText(label, _(expert_options[i].label));
WMResizeWidget(label, FRAME_WIDTH - 99, 25);
WMMoveWidget(label, 85, 5 + i * 25);
if (GetStringForKey(expert_options[i].op_name))
state = GetIntegerForKey(expert_options[i].op_name);
else
state = expert_options[i].def_state;
sprintf(tmp, "%d", state);
WMSetTextFieldText(panel->textfield[i], tmp);
break;
}
default:
#ifdef DEBUG
wwarning("export_options[%d].class = %d, this should not happen\n",
wwarning("expert_options[%d].class = %d, this should not happen\n",
i, expert_options[i].class);
#endif
state = expert_options[i].def_state;
break;
}
WMSetButtonSelected(panel->swi[i], state);
if (expert_options[i].class != OPTION_WMAKER_INT)
WMSetButtonSelected(panel->swi[i], state);
}
WMMapSubwidgets(panel->box);
WMSetScrollViewContentView(sv, WMWidgetView(f));
/* keep references for the wheel handler and register it */
panel->sv = sv;
panel->frame = f;
WMCreateEventHandler(WMWidgetView(sv), ButtonPressMask, scrollViewWheelHandler, panel);
WMAddNotificationObserver(scrollViewRealizeObserver, panel, WMViewRealizedNotification, WMWidgetView(sv));
WMRealizeWidget(panel->box);
}
@@ -192,6 +462,19 @@ static void storeDefaults(_Panel *panel)
case OPTION_USERDEF:
WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[i]), expert_options[i].op_name);
break;
case OPTION_WMAKER_INT:
{
char *text;
int value;
text = WMGetTextFieldText(panel->textfield[i]);
value = atoi(text);
wfree(text);
SetIntegerForKey(value, expert_options[i].op_name);
break;
}
}
}
}
@@ -211,6 +494,7 @@ Panel *InitExpert(WMWidget *parent)
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeDefaults;
panel->callbacks.prepareForClose = scrollViewPrepareForClose;
AddSection(panel, ICON_FILE);
+27 -18
View File
@@ -205,13 +205,13 @@ static void createPanel(Panel * p)
panel->kfocB[0] = WMCreateRadioButton(box);
WMSetButtonText(panel->kfocB[0], _("Manual: Click on the window to set "
"keyboard input focus."));
"keyboard input focus"));
WMAddBoxSubview(box, WMWidgetView(panel->kfocB[0]), True, True, 20, 0, 0);
panel->kfocB[1] = WMCreateRadioButton(box);
WMGroupButtons(panel->kfocB[0], panel->kfocB[1]);
WMSetButtonText(panel->kfocB[1], _("Auto: Set keyboard input focus to "
"the window under the mouse pointer."));
"the window under the mouse pointer"));
WMAddBoxSubview(box, WMWidgetView(panel->kfocB[1]), True, True, 20, 0, 0);
WMMapSubwidgets(box);
@@ -223,17 +223,26 @@ static void createPanel(Panel * p)
panel->cfocF = WMCreateFrame(panel->box);
WMResizeWidget(panel->cfocF, 240, 77);
WMMoveWidget(panel->cfocF, 15, 143);
WMSetFrameTitle(panel->cfocF, _("Install colormap in the window..."));
WMSetFrameTitle(panel->cfocF, _("Install colormap from the window..."));
WMSetBalloonTextForView(_("This option is for screens that can display only a limited number\n"
"of colors at a time, so they use an indexed table of colors (called\n"
"a ColorMap) that each application customizes for its needs, and\n"
"WindowMaker will set the global ColorMap dynamically from the\n"
"active application.\n"
"You can know the capability of your screen in WindowMaker's info\n"
"panel as the 'visual'."),
WMWidgetView(panel->cfocF));
panel->manB = WMCreateRadioButton(panel->cfocF);
WMResizeWidget(panel->manB, 225, 20);
WMMoveWidget(panel->manB, 10, 20);
WMSetButtonText(panel->manB, _("...that has the input focus."));
WMResizeWidget(panel->manB, 226, 24);
WMMoveWidget(panel->manB, 9, 18);
WMSetButtonText(panel->manB, _("...that has the input focus"));
panel->autB = WMCreateRadioButton(panel->cfocF);
WMResizeWidget(panel->autB, 225, 20);
WMMoveWidget(panel->autB, 10, 45);
WMSetButtonText(panel->autB, _("...that's under the mouse pointer."));
WMResizeWidget(panel->autB, 226, 24);
WMMoveWidget(panel->autB, 9, 43);
WMSetButtonText(panel->autB, _("...that's under the mouse pointer"));
WMGroupButtons(panel->manB, panel->autB);
WMMapSubwidgets(panel->cfocF);
@@ -297,7 +306,7 @@ static void createPanel(Panel * p)
panel->raisL = WMCreateLabel(panel->raisF);
WMResizeWidget(panel->raisL, 36, 16);
WMMoveWidget(panel->raisL, 205, 32);
WMSetLabelText(panel->raisL, _("msec"));
WMSetLabelText(panel->raisL, _("ms"));
WMSetLabelTextColor(panel->raisL, color);
WMSetLabelFont(panel->raisL, font);
@@ -312,19 +321,19 @@ static void createPanel(Panel * p)
WMMoveWidget(panel->optF, 265, 88);
panel->ignB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->ignB, 225, 50);
WMResizeWidget(panel->ignB, 228, 50-2);
WMMoveWidget(panel->ignB, 10, 4);
WMSetButtonText(panel->ignB, _("Do not let applications receive " "the click used to focus windows."));
WMSetButtonText(panel->ignB, _("Do not let applications receive the click used to focus windows"));
panel->newB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->newB, 225, 35);
WMMoveWidget(panel->newB, 10, 49);
WMSetButtonText(panel->newB, _("Automatically focus new windows."));
WMResizeWidget(panel->newB, 228, 35);
WMMoveWidget(panel->newB, 10, 52);
WMSetButtonText(panel->newB, _("Automatically focus new windows"));
panel->craisB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->craisB, 225, 36);
WMMoveWidget(panel->craisB, 10, 85);
WMSetButtonText(panel->craisB, _("Raise window when switching\nfocus with keyboard."));
WMResizeWidget(panel->craisB, 228, 36);
WMMoveWidget(panel->craisB, 10, 87);
WMSetButtonText(panel->craisB, _("Raise window when switching focus with keyboard"));
WMMapSubwidgets(panel->optF);
+13 -16
View File
@@ -1,9 +1,9 @@
/* FontSimple.c- simplified font configuration panel
*
*
* WPrefs - Window Maker Preferences Program
*
*
* Copyright (c) 1998-2004 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
@@ -22,6 +22,7 @@
#include "WPrefs.h"
#include <unistd.h>
#include <fontconfig/fontconfig.h>
#include <math.h>
/* workaround for older fontconfig, that doesn't define these constants */
#ifndef FC_WEIGHT_NORMAL
@@ -521,7 +522,7 @@ static void selectedOption(WMWidget * w, void *data)
WMListItem *item = WMGetListItem(panel->sizeL, i);
int distance;
distance = abs(size - atoi(item->text));
distance = fabs(size - atoi(item->text));
if (i == 0 || distance < closest) {
closest = distance;
@@ -569,6 +570,9 @@ static void showData(_Panel * panel)
{
int i;
WMMenuItem *item;
WMScreen *scr;
scr = WMWidgetScreen(panel->parent);
for (i = 0; i < WMGetPopUpButtonNumberOfItems(panel->optionP); i++) {
char *ofont, *font;
@@ -579,19 +583,12 @@ static void showData(_Panel * panel)
if (ofont)
wfree(ofont);
if (strcmp(fontOptions[i].option, "SystemFont") == 0 ||
strcmp(fontOptions[i].option, "BoldSystemFont") == 0) {
char *path;
WMUserDefaults *defaults;
path = wdefaultspathfordomain("WMGLOBAL");
defaults = WMGetDefaultsFromPath(path);
wfree(path);
font = WMGetUDStringForKey(defaults,
fontOptions[i].option);
} else {
if (strcmp(fontOptions[i].option, "SystemFont") == 0)
font = WMGetFontName(WMDefaultSystemFont(scr));
else if (strcmp(fontOptions[i].option, "BoldSystemFont") == 0)
font = WMGetFontName(WMDefaultBoldSystemFont(scr));
else
font = GetStringForKey(fontOptions[i].option);
}
if (font)
font = wstrdup(font);
WMSetMenuItemRepresentedObject(item, font);

Some files were not shown because too many files have changed in this diff Show More