1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-30 12:34:07 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
gryf 02d2d0f2e3 Additional function for checking head
Added function for checking head of certain location. This function is
used for determinig head bounduary.
2017-01-16 21:25:17 +01:00
gryf 58561dc08a Fix for unmaximize.
New way for traverse windows introduced an regression for maximize
toggle from keyboard. Bring the maximize toggle back.
2017-01-16 21:05:45 +01:00
gryf 54aae6c062 Enabling moving window in cycles.
WindowMaker have a Maximus feature expanded by ability to resize windows
to half screen (horizontally and vertically). Although, there was no way
to move windows between different heads (while screen is spanned between
different monitors - heads - if there was no xinerama used). This patch
enables possibility for moving windows between states. Assuming we have
a window on first head, maximize left would make the window occupy left
half of the screen. Assuming we have another head right of the first
head, following scenario will be possible:

- maximize right will make window occupy entire free space (just like
  ordinary maximizing will do)
- another maximize right will make window be maximized half right of the
  first screen
- another maximize right will make window be maximized half left on
  second screen
- another maximize right will make window be maximized on second screen
- another maximize right will make window be maximized half right on
  second screen
- another maximize right will make no effect

So it will cycle between half screen/fullscreen making window to travel
from left to right. Same goes for opposite direction.
2017-01-15 21:07:07 +01:00
516 changed files with 12460 additions and 29681 deletions
-45
View File
@@ -30,8 +30,6 @@ 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
@@ -89,54 +87,11 @@ 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
+1 -1
View File
@@ -4,7 +4,7 @@
If you find a bug please fill this form and send it to
wmaker-dev@googlegroups.com Please, USE THIS FORM!!!
wmaker-dev@lists.windowmaker.org Please, USE THIS FORM!!!
0. Before reporting this bug I already:
[ ] read the NEWS, README and INSTALL files
+5 -142
View File
@@ -1,95 +1,3 @@
Changes since version 0.95.7:
.............................
- Build on Ubuntu 14.04
(Johann Haarhoff <johann@haarhoff.org.za>)
- Window Maker 0.95.7 Debian files
- create_appicon_from_dock checks if no_appicon flag is set
- New applications do not create Cached Icon
- Remove unused argument in save_appicon
- Avoid recreate Cached icon moving between docks
- Avoid create again a docked application cache icon
- save the icon filename instead the full path
- Remove cache icon when detached
- usermenu.c Avoid compiler warnings
- Enable usermenu
(Rodolfo García Peñas (kix) <kix@kix.es>)
- wmaker: fixed infinite loop in switching within group
(Satya Mishra <qufgmx@gmail.com>)
- wmaker: Print error dialog when attempting to delete an in-use workspace.
(Doug Torrance <dtorrance@piedmont.edu>)
- debian: Ignore missing documentation for --runstatedir.
- debian: Use dh_autoreconf.
- debian: Simplify debian/rules.
- debian: Fix typo occurred. (Thanks, lintian.)
- debian: wmaker manpage moved from 1x to 1.
(Andreas Metzler <ametzler@bebt.de>)
- debian: Add wmiv to wmaker package.
- debian: Add version 0.95.6-1.2 entry to changelog.
- debian: Update with final version of 0.95.7-1 packaging.
- wmaker: Maintain sorting of windows by workspace in switch menu.
- debian: Update with version 0.95.7-2 packaging.
- wmaker: Update copyright years in info panel.
- wmaker: Remove prototype for unused get_right_position_on_screen function.
- wmaker: Fix typos (used codespell).
- wmaker: Add option for window snap to top edge to maximize to full screen.
- wmaker: Use window placement settings on other workspaces.
- wmaker: Add keyboard shortcuts for keeping window on top or at bottom.
- wmaker: Display keyboard shortcuts for remaining options in window menu.
- wmaker: Fix whitespace in menu.h; passes checkpatch.pl inspection.
- wmaker: Implement basic menu shading.
(Doug Torrance <dtorrance@piedmont.edu>)
- Translations: Dutch language files updated
- Translations: Frisian language files updated
(Alwin <translations@ziggo.nl>)
- wmlib: Add pkg-config file.
- wmlib: Remove install-exec-local target.
- WPrefs: Code formatting in TexturePanel.c; minimizes checkpatch.pl warnings.
- WPrefs: Add support for fpixmap ("fillscale") texture.
- check-doc: Ignore runstatedir in check-cmdline-options-doc.sh
- check-doc: Ignore with-aix-soname in check-cmdline-options-doc.sh
- debian: Remove 56_ignore_runstatedir.diff.
- debian: Update with version 0.95.7-3 packaging.
- debian: Update with version 0.95.7-4 packaging.
- debian: Update with version 0.95.7-5 packaging.
- debian: Update with version 0.95.7-6 packaging.
- wmmenugen: Fix segfault; argv[argc] doesn't exist.
(Doug Torrance <dtorrance@piedmont.edu>)
- getstyle: fix wcopy_file paths
(Alexandru Lazar <alazar@startmail.com>)
- wmaker: fix stacking order of dock and fullscreen
- wmaker: allow alt+tabbed windows over fullscreen
(Bjørn Mork <bjorn@mork.no>)
- WPrefs: Update path for Debian menu
- Use wprefs_bindir output variable to set WPrefs path in menus.
- Remove WindowMaker/mkMakefile script.
- Don't try and add removed file mkMakefile to distribution tarball.
- Look for plmenu in build directory when creating WMRootMenu.
- debian: Update with version 0.95.7-7 packaging.
- configure: Use PKG_PROG_PKG_CONFIG macro to allow cross building.
(Doug Torrance <dtorrance@piedmont.edu>)
- Trivial cleanup: Removed unused defines.
(Roman Dobosz <gryf73@gmail.com>)
- Added 'head' parameter to wMaximizeWindow
- Added wGetHeadRelativeToCurrentHead function
- Added option for ability to move half-maximized between heads.
- Added possibility for half-maximized windows to move across the screens.
- Fixed wrong (re)stored dimensions for unmaximized window.
(gryf <gryf73@gmail.com>)
- Bugfix for moving windows between heads.
- New option for enabling alternative half-maximized window movement.
- Alternative way for traversing half-maximized windows.
- New option for moving mouse pointer along with half-maximized windows.
- Implementation for moving mouse pointer within the maximized window.
- Refactoring handleMaximize() function
- Removed trailing whitespaces from readme files.
- Fixed couple of compilator warning and removed unused macros.
(Roman Dobosz <gryf73@gmail.com>)
- wmaker: Do not place icons under the dock
(Cyrus Rahman <crahman@gmail.com>)
- debian: Update with version 0.95.7-8 packaging.
(Doug Torrance <dtorrance@piedmont.edu>)
Changes since version 0.95.6:
.............................
@@ -488,51 +396,6 @@ Changes since version 0.95.6:
- debian: Import version 0.95.6-1.
- debian: Import version 0.95.6-1.1.
(Doug Torrance <dtorrance@monmouthcollege.edu>)
- Import of (partly outdated) Ukrainian translations.
(Martin Dietze <mdietze@gmail.com>)
- Add folder with fedora .spec file
(Alexey I. Froloff <raorn@raorn.name>)
- make: Add Ukrainian translation files to EXTRA_DIST.
- wmiv: Add long command line options --help and --version.
- wmiv: Improve help text.
- doc: Add manpage for wmiv.
(Doug Torrance <dtorrance@monmouthcollege.edu>)
- wmaker: replaced old email address with the official one
- WINGs: Updated news with the API changes that occurred between 0.95.6 and
0.95.7
- WINGs: ran spell checker on the NEWS file
- WINGs: fix non-portable int conversion for printf in font panel size handling
- WRaster: fix unused variable warning when XShm extention is not enabled
(Christophe CURIS <christophe.curis@free.fr>)
- New translation into Frisian for Window Maker
(Alwin <translations@ziggo.nl>)
- wrlib: fixed gcc version needed for deprecated attribute support
- Configure: increased the version of Automake requested
(Christophe CURIS <christophe.curis@free.fr>)
- configure: Fix output of libdir directory in summary
(Josip Deanovic <djosip+news@linuxpages.net>)
- wmaker: fix detection of legacy Apercu configuration keywords
- WPrefs: fix conversion of old "Apercu" setting to the new keywords
(Christophe CURIS <christophe.curis@free.fr>)
- wmaker: Allow window snapping and linked workspaces simultaneously.
- wmaker: Allow configuration of window snapping detect distances.
- WPrefs: Add ability to set integer values in Expert panel
- WPrefs: Add snap edge and corner detect to Expert panel.
(Doug Torrance <dtorrance@monmouthcollege.edu>)
- Translations: Dutch updates for WPrefs
- Translations: Frisian updates for WPrefs
(Alwin <translations@ziggo.nl>)
- configure: fixed incorrect variable name that prevented --disable-xdnd to
work
(Rodolfo García Peñas (kix) <kix@kix.es>)
- Revert "wmaker: fix clearing of window attribute that was not saved properly"
- Disable pager by default
(Carlos R. Mafra <crmafra@gmail.com>)
- Allow using keypad Enter to commit move/resize
- Allow using numpad Enter key in dialogs for confirmation
(Amadeusz Sławiński <amade@asmblr.net>)
- Window Maker 0.95.7
(Carlos R. Mafra <crmafra@gmail.com>)
Changes since version 0.95.5:
@@ -969,7 +832,7 @@ Changes since version 0.95.5:
- WMaker: moved XGrab/XUngrabPointer into the conditional code
- News: created section dedicated to the changes related to 0.95.3
- News: added description of a change that may be interesting to users
- News: added section to describe the changes that have occurred in 0.95.4
- News: added section to describe the changes that have occured in 0.95.4
- News: marked the current changes as part of 0.95.5 and describe the drawers
feature
- News: described the new features for future 0.95.6 release
@@ -1103,7 +966,7 @@ Changes since version 0.95.5:
#50158)
- WPrefs: fix NULL pointer handling when getting the Modifiers (Coverity
#50200)
- WPrefs: add warning when renderTexture encounters some unknown settings
- WPrefs: add warning when renderTexture encounters some unknow settings
(Christophe CURIS <christophe.curis@free.fr>)
- util/wmiv: add image auto orientation detection
(David Maciejak <david.maciejak@gmail.com>)
@@ -4063,7 +3926,7 @@ Changes since version 0.17.5:
icons
- fixed bug in focusfollowmouse that made windows under the currently
focused window that close, to not get the focus
- if the app is a .app, it will try to find its icon in the .app
- if the app is a .app, it will try to find it's icon in the .app
directory and save it in the WMWindowAttributes, so that the dock can use it.
- drag docklets that select for mouse events to with Alt+drag
@@ -4934,7 +4797,7 @@ Changes since version 0.3.2:
- application icons (not mini-windows) like I think how it is on NEXTSTEP(tm)
- fixed "slippery" icon movement
- added a Dock (not for GNUstep, as it will have its own)
- added a Dock (not for GNUstep, as it will have it's own)
Changes since version 0.3.1:
............................
@@ -4964,7 +4827,7 @@ it's opened to select items, just drag the pointer
- transient owners get a different titlebar color when the focus
is in the transient (e.g, in NeXTese: mainWindow is highlighted correctly when
the keyWindow is a panel)
- when transient is closed, its owner always get the focus
- when transient is closed, it's owner always get the focus
- fixed XGrabButton/BadAccess bug
- fixed window_count error (this time I'm 90% sure)
- fixed focusNextWindow through Alt-Tab bug with non-focusable windows
+14 -14
View File
@@ -15,7 +15,7 @@ Summary of Contents:
1.2 Where can I get Window Maker?
1.3 Where are the mailing list archives?
1.4 Where is more documentation on configuring Window Maker?
1.5 What is an appicon?
1.5 What is an App Icon?
1.6 How can I get a question added to the FAQ?
1.7 How do I report bugs?
1.8 Is there an anonymous cvs server?
@@ -134,7 +134,7 @@ Introduction:
1.1 What is Window Maker?
----------------------------------
Window Maker is an elegant X11 window manager that emulates the
Window Maker is an elegant X11 window manger that emulates the
OpenStep desktop with some noticeable enhancements. Look at
http://wm.current.nu/themes/my-themes.html and
http://wm.current.nu/themes/screenshots.html
@@ -333,7 +333,7 @@ Window Maker distribution.
The author Anthony Quinn <southgat@frontiernet.net> has released a
version that works with Window Maker >= 0.15.x. It is available from
its home page at http://www.frontiernet.net/~southgat/wmsound/
it's home page at http://www.frontiernet.net/~southgat/wmsound/
or on Largo's site at http://wm.current.nu/files.html#wmsound
for your convenience.
@@ -352,7 +352,7 @@ GNOME application they have no title bar" below.
To use it with CDE, read the answer for "How do I switch
CDE's window manager to use Window Maker?"
To use it with KDE, read its documentation to get rid of kwm (and possibly
To use it with KDE, read it's documentation to get rid of kwm (and possibly
kpanel) and replace it with wmaker. Then, start WPrefs.app, go to "Mouse
Preferences" and set the "Disable mouse actions" check box. You will
need to restart Window Maker to make this change take effect. The
@@ -507,7 +507,7 @@ exec wmaker
Things to try if it doesn't work: (somewhat fuzzy and random)
This should do it although I did have problems sometimes initially which I
fixed by randomly trying absolute paths for wmaker in .xsession/.xinitrc and/or
fixed by randomly trying absolute pathes for wmaker in .xsession/.xinitrc and/or
making the dtprofile/.xinitrc/etc executable. It helps logging in on the console
(select from CDE login screen) and start X manually using 'X'.
If it works that way it should work when logging into the CDE environment.
@@ -628,7 +628,7 @@ the last app started by .xinitrc is closed.
the X server will be closed, and your session will end.
3.3 How do I "dock" appicons on the Clip?
3.3 How do I "dock" AppIcons on the Clip?
-----------------------------------------
Just drag icons near it like you would for the dock. Note that if you place
the clip near the dock, you may have problems docking appicons in either.
@@ -674,7 +674,7 @@ David Reviejo <dreviejo@arrakis.es> best summed up this answer:
3.7 How do I "undock" appicons?
3.7 How do I "undock" AppIcons?
----------------------------------
If the program is not running, just drag the icon to the middle of your
desktop (away from the dock and clip) and watch it disappear.
@@ -731,7 +731,7 @@ These directories will be listed under the "Search Path" section of WPrefs.
3.11 When I run GNOME application they have no title bar.
----------------------------------
The GNOME toolkit decided to behave in its own way, so it draws its own title bar
The GNOME toolkit decided to behave his own way, so it draws its own title bar
with buttons, and asks Window Maker to not draw anything (title bar, resize bar,
close and miniaturise button, ...).
@@ -838,7 +838,7 @@ AlwaysUserIcon=Yes;
};
4.6 How do I get a Tile background for my appicons (those things in
4.6 How do I get a Tile background for my AppIcons (those things in
the dock)?
----------------------------------
You need to change 1 line to your ~/GNUstep/Defaults/WindowMaker file.
@@ -868,9 +868,9 @@ Application Icon'' Option then Save, Apply and close the dialog.
This should allow you do dock the program normally.
Emulate AppIcon does exactly the same thing as dockit, a small app
Emulate Appicon does exactly the same thing as dockit, a small app
distributed with ancient versions of Window Maker before the Attribute
Editor existed (now deprecated for the obvious reason). If Emulate AppIcon
Editor existed (now deprecated for the obvious reason). If Emulate Appicon
does not work, dockit will not work either. Such applications violate the
ICCCM (Inter-Client Communication Conventions Manual) and are considered
badly coded for not setting the instance.class hints.
@@ -898,7 +898,7 @@ NoAppIcon=Yes;
4.9 How do I set a pixmap background?
----------------------------------
Here is the in-depth explanation straight from the NEWS file:
Here is the in depth explanation straight from the NEWS file:
wmsetbg now accepts the following options:
usage: wmsetbg [-options] image
@@ -1283,7 +1283,7 @@ WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified size: 400 by 300
program specified minimum size: 400 by 300
Now, when scilab opens its window, Window Maker nicely does exactly what it
Now, when scilab opens it's window, Window Maker nicely does exactly what it
is told, that is, map the window at position 136679205, 1074468360 which
obviously falls outside the screen no matter how big is your monitor ;)
@@ -1476,7 +1476,7 @@ Themes:
8.1 What exactly are themes?
----------------------------------
Themes are a great aspect of Window Maker allowing a user to simply
save the entire 'look' of their desktop in an archive to distribute freely among
save the entire 'look' of their desktop in a Archive to distribute freely among
friends, fellow users and/or the whole net in general. :)
See the theme-HOWTO at http://wm.current.nu/themes/theme-HOWTO.html
+5 -43
View File
@@ -19,19 +19,10 @@ config-paths.h: Makefile
@echo '#define PIXMAPDIR "$(pixmapdir)"' >> $@
@echo '' >> $@
@echo '/* where shared data is stored */' >> $@
@echo '#define PKGDATADIR "$(datadir)/$(PACKAGE_TARNAME)"' >> $@
@echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@
@echo '' >> $@
@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"' >> $@
@echo '/* where the configuration is stored */' >> $@
@echo '#define SYSCONFDIR "$(sysconfdir)"' >> $@
ACLOCAL_AMFLAGS = -I m4
@@ -50,13 +41,11 @@ EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \
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
script/replace-ac-keywords.sh
.PHONY: coverage-reset coverage
@@ -73,10 +62,6 @@ coverage:
genhtml --output-directory @lcov_output_directory@ coverage/coverage.info
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
@@ -95,34 +80,13 @@ if HAVE_XGETTEXT
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) update-lang || exit $$?); \
done
SUBDIRS_PO = wrlib/po WINGs/po po util/po WPrefs.app/po
SUBDIRS_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))
@@ -142,8 +106,6 @@ configure-documentation:
--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
+4 -313
View File
@@ -1,316 +1,7 @@
NEWS for veteran Window Maker users
-----------------------------------
-- 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 state of the window while using
half-maximized feature. Unmaximized window have its state saved during that
process, which was use to unmaximize it. For example, if there is a window,
which is maximized on the half left side of the screen, and while requesting
left-half-maximized, it become unmaximized with size and dimension restored to
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 window always
can be unmaximzied using appropriate keyboard shortcut or by selecting
"Unmaximize" from 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 previously defined key combination), so it
become:
┌┬───────┬────────┬─────────────────┬┐
├┘ ├────────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ └┤
├┬┐ └────────┼┬┬┐ │
└┴┴───────────────┴┴┴┴───────────────┘
In this example there is an assumption that WindowMaker is configured, that
maximized windows wont cover mini icons nor 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-maxmimize:
┌┬────────────────┬────────┬────────┬┐
├┘ │ ├────────┼┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ │ │ ├┤
├┬┐ ├┬┬┐ └────────┘│
└┴┴───────────────┴┴┴┴───────────────┘
And final activation of right-half-maxmimize:
┌┬────────────────┬───────┬─────────┬┐
├┘ ├───────┤ ├┤
│ │ │ ├┤
│ │ │ ├┤
│ ├───────┘ ├┤
│ │ └┤
├┬┐ ├┬┬┐ │
└┴┴───────────────┴┴┴┴───────────────┘
Where window is restored its size (but not position, since it it on different
head now). Moving 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
@@ -1698,7 +1389,7 @@ 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 its area. Setting AUTO_RAISE_DELAY to a very
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.
@@ -2627,7 +2318,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 its stdout to construct menu.
// opens command and uses it's stdout to construct menu.
// Command's output must be a valid menu description.
OPEN_MENU | command
3. Directory handling.
@@ -3230,7 +2921,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 its key to Dock. For example, if your WMDock
file in WMState and set it's key to Dock. For example, if your WMDock
contains:
{
+5 -5
View File
@@ -129,8 +129,8 @@ HELP ME!!!
==========
There is a mailing list for discussing Window Maker at
wmaker-user@googlegroups.com. To subscribe to it, visit
https://groups.google.com/forum/#!forum/wmaker-user
wmaker-user@lists.windowmaker.org To subscribe to it, send a message to
wmaker-user-subscribe@lists.windowmaker.org
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 its
same time. You might get unexpected behavior when Window Maker updates it's
configuration files.
If you really desire to do this, try running Window Maker with the command line
@@ -209,7 +209,7 @@ while keeping a nice appearance and good functionality, follow the items bellow:
- 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 its value to a value like the number of different icons you
memory usage, set it's value to a value like the number of different icons you
use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
@@ -311,5 +311,5 @@ project. The name 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@googlegroups.com
to wmaker-dev@lists.windowmaker.org
+2 -2
View File
@@ -134,7 +134,7 @@ Sending the patch to the mailing list
Send your patches to:
wmaker-dev@googlegroups.com
wmaker-dev@lists.windowmaker.org
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
@@ -147,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@googlegroups.com>"
git config sendemail.to "Window Maker Devel <wmaker-dev@lists.windowmaker.org>"
# If you're sending more than 1 patch, you may be interested in having an
# introduction mail for the batch:
+1 -7
View File
@@ -1,9 +1,3 @@
Changes since wmaker 0.96.0:
............................
- added W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls
Changes since wmaker 0.92.0:
............................
@@ -140,7 +134,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 occurred when input handling was done with poll
- fixed mem leak that occured 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
+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 \
@XFT_LIBS@ @INTLIBS@ @XLIBS@
@XFTLIBS@ @INTLIBS@ @XLIBS@
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
+2 -3
View File
@@ -24,9 +24,8 @@
#include <WINGs/WINGs.h>
#include <WINGs/WUtil.h>
#include <inttypes.h>
#include <stdnoreturn.h>
noreturn void wAbort(void)
void wAbort()
{
exit(0);
}
@@ -41,7 +40,7 @@ void show(WMWidget * self, void *data)
WMSetLabelText(l, buf);
}
noreturn void quit(WMWidget * self, void *data)
void quit(WMWidget * self, void *data)
{
(void) self;
(void) data;
+3 -3
View File
@@ -10,7 +10,7 @@ include_HEADERS = wtableview.h wtabledelegates.h
lib_LTLIBRARIES = libExtraWINGs.la
noinst_PROGRAMS = tableview
noinst_PROGRAMS = test
EXTRA_DIST =
@@ -25,6 +25,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFT_LIBS@ @INTLIBS@ @XLIBS@
@XFTLIBS@ @INTLIBS@
tableview_LDADD = wtableview.o wtabledelegates.o $(LDADD)
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
@@ -19,18 +19,13 @@ 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];
@@ -49,8 +44,6 @@ 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
@@ -66,7 +59,6 @@ static WMTableViewDelegate delegate = {
void clickedTable(WMWidget * w, void *self)
{
(void) w;
int row = WMGetTableViewClickedRow((WMTableView *) self);
WMEditTableViewRow(self, row);
+8 -14
View File
@@ -2,8 +2,6 @@
#include <WINGs/WINGsP.h>
#include <X11/cursorfont.h>
#include <stdint.h>
#include <math.h>
#include <float.h>
#include "wtableview.h"
@@ -276,7 +274,7 @@ static void adjustScrollers(WMTableView * table)
prop = 1.0;
} else {
oprop = WMGetScrollerKnobProportion(table->hscroll);
if (fabs(oprop) <= DBL_EPSILON)
if (oprop == 0.0)
oprop = 1.0;
ovalue = WMGetScrollerValue(table->hscroll);
@@ -292,7 +290,7 @@ static void adjustScrollers(WMTableView * table)
prop = 1.0;
} else {
oprop = WMGetScrollerKnobProportion(table->vscroll);
if (fabs(oprop) <= DBL_EPSILON)
if (oprop == 0.0)
oprop = 1.0;
ovalue = WMGetScrollerValue(table->vscroll);
@@ -334,7 +332,7 @@ static void doScroll(WMWidget * self, void *data)
case WSIncrementWheel:
case WSIncrementLine:
value += (float)table->rowHeight / size;
if (value > (float)1.0)
if (value > 1.0)
value = 1.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -346,7 +344,7 @@ static void doScroll(WMWidget * self, void *data)
case WSDecrementPage:
value -= vpsize / size;
if (value < (float)0.0)
if (value < 0.0)
value = 0.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -354,7 +352,7 @@ static void doScroll(WMWidget * self, void *data)
case WSIncrementPage:
value += vpsize / size;
if (value > (float)1.0)
if (value > 1.0)
value = 1.0;
WMSetScrollerParameters(self, value, WMGetScrollerKnobProportion(self));
repaintTable(table);
@@ -400,7 +398,6 @@ 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;
@@ -454,8 +451,6 @@ static void splitterHandler(XEvent * event, void *data)
static void realizeTable(void *data, WMNotification * notif)
{
(void) notif;
repaintTable(data);
}
@@ -795,6 +790,7 @@ void WMSetTableViewRowHeight(WMTableView * table, int height)
void WMScrollTableViewRowToVisible(WMTableView * table, int row)
{
WMScroller *scroller;
WMRange range;
WMRect rect;
int newY, tmp;
@@ -802,6 +798,7 @@ 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;
@@ -1160,8 +1157,6 @@ static void handleEvents(XEvent * event, void *data)
static void handleResize(W_ViewDelegate * self, WMView * view)
{
(void) self;
reorganizeInterior(view->self);
}
@@ -1172,8 +1167,7 @@ static void reorganizeInterior(WMTableView * table)
WMSize size = getTotalSize(table);
WMView *view = table->view;
int vw, vh;
int hsThickness = 0;
int vsThickness = 0;
int hsThickness, vsThickness;
if (table->vscroll)
vsThickness = WMWidgetWidth(table->vscroll);
+8 -7
View File
@@ -8,11 +8,13 @@ DIST_SUBDIRS = $(SUBDIRS) Tests Examples Extras
libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@
libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
dist_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@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGO_LIBS@
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@
libWUtil_la_LIBADD = @LIBBSD@
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
@@ -87,12 +89,11 @@ libWUtil_la_SOURCES = \
wutil.c
AM_CFLAGS = @PANGO_CFLAGS@
AM_CFLAGS =
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@
-I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
@XFTFLAGS@ @HEADER_SEARCH_PATH@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = WINGs.pc WUtil.pc
@@ -106,8 +107,8 @@ WINGs.pc: Makefile
@echo 'Version: $(VERSION)' >> $@
@echo 'Requires: wrlib WUtil' >> $@
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
@echo 'Libs.private: $(XFT_LIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
@echo 'Cflags: $(inc_search_path) @PANGO_CFLAGS@' >> $@
@echo 'Libs.private: $(XFTLIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
@echo 'Cflags: $(inc_search_path)' >> $@
WUtil.pc: Makefile
@echo "Generating $@"
+1 -3
View File
@@ -1,9 +1,7 @@
** API and ABI modifications since wmaker 0.96.0
----------------------------------------------------
** API and ABI modifications since wmaker 0.92.0
** libWINGs **
<WINGsP.h>
W_KeycodeToKeysym ADDED
struct W_DragDestinationInfo: new members added SIZE CHANGE
<WINGs.h>
+6 -6
View File
@@ -8,25 +8,25 @@
kojima@windowmaker.info
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
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
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 its design is a little sloppy,
The library is limited and it's 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 its limitations, although you'll probably be able to
workaround some of it's limitations, although you'll probably be able to
write something like a trivial tic-tac-toe game without knowing much Xlib.
Some of its functions are designed to support the Window Maker window
manager (see http://windowmaker.info) In fact, its primary role is to
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
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
+2 -3
View File
@@ -6,7 +6,7 @@ noinst_PROGRAMS = wtest wmquery wmfile testmywidget
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFT_LIBS@ @INTLIBS@ @XLIBS@
@XFTLIBS@ @INTLIBS@ @XLIBS@
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
@@ -17,5 +17,4 @@ 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\" @XFT_CFLAGS@ @HEADER_SEARCH_PATH@ \
@PANGO_CFLAGS@
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@
-1
View File
@@ -64,7 +64,6 @@ 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"
_Noreturn void wAbort(void)
void wAbort()
{
exit(1);
}
+7 -4
View File
@@ -19,14 +19,14 @@
#include "logo.xpm"
_Noreturn void wAbort(void)
void wAbort()
{
exit(1);
}
char *ProgName;
_Noreturn void usage(void)
void usage(void)
{
fprintf(stderr,
"usage:\n"
@@ -53,10 +53,13 @@ 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");
@@ -93,14 +96,14 @@ int main(int argc, char **argv)
if (panelType == SAVE_PANEL_TYPE) {
sPanel = WMGetSavePanel(scr);
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
title, NULL) == True)
/*title */ NULL, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(sPanel));
else
printf("\n");
} else {
oPanel = WMGetOpenPanel(scr);
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
title, NULL) == True)
/*title */ NULL, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(oPanel));
else
printf("\n");
+5 -3
View File
@@ -11,14 +11,14 @@
#include "logo.xpm"
_Noreturn void wAbort(void)
void wAbort()
{
exit(1);
exit(1);
}
char *ProgName;
_Noreturn void usage(void)
void usage(void)
{
fprintf(stderr,
"usage:\n"
@@ -45,6 +45,8 @@ int main(int argc, char **argv)
char *initial = NULL;
char *result = NULL;
int ch;
extern char *optarg;
extern int optind;
WMInitializeApplication("WMQuery", &argc, argv);
+3 -19
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).
*/
_Noreturn void wAbort(void)
void wAbort()
{
exit(1);
}
@@ -25,7 +25,6 @@ int windowCount = 0;
void closeAction(WMWidget * self, void *data)
{
(void)data;
WMDestroyWidget(self);
windowCount--;
printf("window closed, window count = %d\n", windowCount);
@@ -166,13 +165,10 @@ 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);
}
@@ -484,7 +480,6 @@ void testColorPanel(WMScreen * scr)
void sliderCallback(WMWidget * w, void *data)
{
(void)data;
printf("SLIDER == %i\n", WMGetSliderValue(w));
}
@@ -521,7 +516,7 @@ void testSlider(WMScreen * scr)
void testTextField(WMScreen * scr)
{
WMWindow *win;
WMTextField *field, *field2, *field3;
WMTextField *field, *field2;
windowCount++;
@@ -540,11 +535,6 @@ 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);
@@ -759,8 +749,6 @@ void testTabView(WMScreen * scr)
void splitViewConstrainProc(WMSplitView * sPtr, int indView, int *minSize, int *maxSize)
{
(void)sPtr;
switch (indView) {
case 0:
*minSize = 20;
@@ -794,7 +782,6 @@ 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);
@@ -809,7 +796,6 @@ void appendSubviewButtonAction(WMWidget * self, void *data)
void removeSubviewButtonAction(WMWidget * self, void *data)
{
(void)self;
WMSplitView *sPtr = (WMSplitView *) data;
int count = WMGetSplitViewSubviewsCount(sPtr);
@@ -822,14 +808,12 @@ 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);
}
@@ -918,7 +902,7 @@ void testSplitView(WMScreen * scr)
WMMapWidget(win);
}
void testUD(void)
void testUD()
{
WMUserDefaults *defs;
char str[32];
+1 -11
View File
@@ -5,14 +5,4 @@ AUTOMAKE_OPTIONS =
# is this a kluge? if so, how should i do it?
includedir = @includedir@/WINGs
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 $@ $<
include_HEADERS = WINGs.h WUtil.h WINGsP.h
+16 -31
View File
@@ -26,7 +26,7 @@
#include <WINGs/WUtil.h>
#include <X11/Xlib.h>
#define WINGS_H_VERSION 20230226
#define WINGS_H_VERSION 20150508
#ifdef __cplusplus
@@ -736,7 +736,7 @@ Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
void *cdata);
extern const char *WMSelectionOwnerDidChangeNotification;
extern char *WMSelectionOwnerDidChangeNotification;
/* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
@@ -795,8 +795,6 @@ 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);
@@ -977,11 +975,11 @@ WMPoint WMGetViewScreenPosition(WMView *view);
WMWidget* WMWidgetOfView(WMView *view);
/* notifications */
extern const char *WMViewSizeDidChangeNotification;
extern char *WMViewSizeDidChangeNotification;
extern const char *WMViewFocusDidChangeNotification;
extern char *WMViewFocusDidChangeNotification;
extern const char *WMViewRealizedNotification;
extern char *WMViewRealizedNotification;
/* ---[ WINGs/wballoon.c ]------------------------------------------------ */
@@ -1190,9 +1188,9 @@ void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
extern const char *WMTextDidChangeNotification;
extern const char *WMTextDidBeginEditingNotification;
extern const char *WMTextDidEndEditingNotification;
extern char *WMTextDidChangeNotification;
extern char *WMTextDidBeginEditingNotification;
extern char *WMTextDidEndEditingNotification;
/* ---[ WINGs/wscroller.c ]----------------------------------------------- */
@@ -1212,7 +1210,7 @@ void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
void WMSetScrollerArrowsPosition(WMScroller *sPtr,
WMScrollArrowPosition position);
extern const char *WMScrollerDidScrollNotification;
extern char *WMScrollerDidScrollNotification;
/* ---[ WINGs/wlist.c ]--------------------------------------------------- */
@@ -1291,8 +1289,8 @@ Bool WMListAllowsMultipleSelection(WMList *lPtr);
Bool WMListAllowsEmptySelection(WMList *lPtr);
extern const char *WMListDidScrollNotification;
extern const char *WMListSelectionDidChangeNotification;
extern char *WMListDidScrollNotification;
extern char *WMListSelectionDidChangeNotification;
/* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
@@ -1324,7 +1322,7 @@ void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
WMCompareDataProc *func);
/* Don't free the returned string. */
const char* WMSetBrowserPath(WMBrowser *bPtr, const char *path);
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
/* free the returned string */
char* WMGetBrowserPath(WMBrowser *bPtr);
@@ -1462,10 +1460,6 @@ 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);
@@ -1500,7 +1494,7 @@ void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
extern const char *WMColorPanelColorChangedNotification;
extern char *WMColorPanelColorChangedNotification;
/* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
@@ -1513,7 +1507,7 @@ WMColor* WMGetColorWellColor(WMColorWell *cPtr);
void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
extern const char *WMColorWellDidChangeNotification;
extern char *WMColorWellDidChangeNotification;
/* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
@@ -1533,8 +1527,6 @@ void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
void WMScrollViewScrollPoint(WMScrollView * sPtr, WMPoint point);
WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
@@ -1847,17 +1839,10 @@ 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,
@@ -1882,7 +1867,7 @@ void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
void WMSetFilePanelDirectory(WMFilePanel *panel, const char *path);
void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
/* you can free the returned string */
char* WMGetFilePanelFileName(WMFilePanel *panel);
@@ -1890,7 +1875,7 @@ char* WMGetFilePanelFileName(WMFilePanel *panel);
void WMFreeFilePanel(WMFilePanel *panel);
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
const char *path, const char *name, char **fileTypes);
char *path, const char *name, char **fileTypes);
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
@@ -5,7 +5,9 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@USE_PANGO@#include <pango/pango.h>
#ifdef USE_PANGO
#include <pango/pango.h>
#endif
#include <WINGs/WINGs.h>
@@ -41,7 +43,7 @@ typedef struct _WINGsConfiguration {
unsigned mouseWheelDown;
} _WINGsConfiguration;
extern const char *_WINGS_progname;
extern char *_WINGS_progname;
extern _WINGsConfiguration WINGsConfiguration;
extern struct W_Application WMApplication;
@@ -457,7 +459,9 @@ typedef struct W_Font {
short refCount;
char *name;
@USE_PANGO@ PangoLayout *layout;
#ifdef USE_PANGO
PangoLayout *layout;
#endif
} W_Font;
#define W_FONTID(f) (f)->font->fid
@@ -494,8 +498,6 @@ 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 ]--------------------------------------------------------- */
+1 -12
View File
@@ -193,16 +193,6 @@ 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 ]-------------------------------------------------- */
@@ -249,7 +239,7 @@ char* wexpandpath(const char *path);
int wcopy_file(const char *toPath, const char *srcFile, const char *destFile);
/* don't free the returned string */
const char* wgethomedir(void);
char* wgethomedir(void);
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
@@ -864,7 +854,6 @@ 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);
+1 -1
View File
@@ -599,7 +599,7 @@ static void dragSourceResponseTimeOut(void *destView)
W_DragDestinationInfoClear(info);
}
void W_DragDestinationStopTimer(void)
void W_DragDestinationStopTimer()
{
if (dndDestinationTimer != NULL) {
WMDeleteTimerHandler(dndDestinationTimer);
+1 -1
View File
@@ -1080,7 +1080,7 @@ static void dragSourceResponseTimeOut(void *source)
}
}
void W_DragSourceStopTimer(void)
void W_DragSourceStopTimer()
{
if (dndSourceTimer != NULL) {
WMDeleteTimerHandler(dndSourceTimer);
+6 -2
View File
@@ -39,7 +39,7 @@
#endif
const char *wgethomedir(void)
char *wgethomedir()
{
static char *home = NULL;
char *tmp;
@@ -48,7 +48,11 @@ const char *wgethomedir(void)
if (home)
return home;
tmp = GETENV("HOME");
#ifdef HAVE_SECURE_GETENV
tmp = secure_getenv("HOME");
#else
tmp = getenv("HOME");
#endif
if (tmp) {
home = wstrdup(tmp);
return home;
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
# [Christophe CURIS, 2015/01/31]
# This script is now reporting itself as deprecated (this should have been done
# a long time ago), so it should be kept for at least 2 years from now in order
# to allow users to update their scripts, and then removed.
if test $# -eq 0; then
echo "Error: $0 is deprecated, please use 'pkg-config WINGs ...'" >&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo "Warning: $0 is deprecated, please use 'pkg-config WINGs --cflags'" >&2
pkg-config WINGs --cflags
;;
--ldflags|--lflags)
echo "Warning: $0 is deprecated, please use 'pkg-config WINGs --libs'" >&2
pkg-config WINGs --libs-only-L
;;
--libs)
echo "Warning: $0 is deprecated, please use 'pkg-config WINGs --libs'" >&2
pkg-config WINGs --libs
;;
*)
echo "Error: $0 is deprecated, please use 'pkg-config WINGs ...'" >&2
exit 1
;;
esac
shift
done
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
# [Christophe CURIS, 2015/01/31]
# This script is now reporting itself as deprecated (this should have been done
# a long time ago), so it should be kept for at least 2 years from now in order
# to allow users to update their scripts, and then removed.
if test $# -eq 0; then
echo "Error: $0 is deprecated, please use 'pkg-config WUtil ...'" >&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo "Warning: $0 is deprecated, please use 'pkg-config WUtil --cflags'" >&2
pkg-config WUtil --cflags
;;
--ldflags|--lflags)
echo "Warning: $0 is deprecated, please use 'pkg-config WUtil --libs'" >&2
pkg-config WUtil --libs-only-L
;;
--libs)
echo "Warning: $0 is deprecated, please use 'pkg-config WUtil --libs'" >&2
pkg-config WUtil --libs
;;
*)
echo "Error: $0 is deprecated, please use 'pkg-config WUtil ...'" >&2
exit 1
;;
esac
shift
done
+1 -2
View File
@@ -107,8 +107,7 @@ void *wmalloc(size_t size)
}
}
}
if (tmp != NULL)
memset(tmp, 0, size);
memset(tmp, 0, size);
return tmp;
}
+3 -3
View File
@@ -536,7 +536,7 @@ found_end_define_fname:
while (*src != '\0') {
idx = 0;
if (*src == '~') {
const char *home = wgethomedir();
char *home = wgethomedir();
while (*home != '\0') {
if (idx < sizeof(buffer) - 2)
buffer[idx++] = *home;
@@ -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)) ;
}
strncpy(parser->cond.stack[0].name, cmd_name, sizeof(parser->cond.stack[0].name) - 1);
strcpy(parser->cond.stack[0].name, cmd_name);
parser->cond.stack[0].line = parser->line_number;
}
+2 -6
View File
@@ -167,7 +167,6 @@ 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;
@@ -280,8 +279,7 @@ WParserMacro *menu_parser_find_macro(WMenuParser parser, const char *name)
continue;
return macro;
check_next_macro:
;
check_next_macro: ;
}
return NULL;
}
@@ -393,8 +391,6 @@ 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++;
@@ -696,7 +692,7 @@ static void w_create_macro(WMenuParser parser, const char *name, WParserMacroFun
WParserMacro *macro;
macro = wmalloc(sizeof(*macro));
strncpy(macro->name, name, sizeof(macro->name) - 1);
strcpy(macro->name, name);
macro->function = handler;
macro->arg_count = -1;
macro->next = parser->macros;
+1 -1
View File
@@ -4,7 +4,7 @@ CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) $(DOMAIN).pot
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po fy.po hu.po nl.po sk.po sr.po
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po fy.po hu.po nl.po sk.po
# WUtil files:
POTFILES = \
-1
View File
@@ -9,7 +9,6 @@ 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
-----
-1
View File
@@ -9,7 +9,6 @@ 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"
-1
View File
@@ -14,7 +14,6 @@ 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"
-1
View File
@@ -12,7 +12,6 @@ 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"
-1
View File
@@ -15,7 +15,6 @@ 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"
-1
View File
@@ -10,7 +10,6 @@ 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"
+72 -33
View File
@@ -1,14 +1,14 @@
# Translation into Western Frisian for Window Maker
# Copyright (C) 2015-2019 Window Maker Developers Team
# Copyright (C) 2015 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"
"Project-Id-Version: wmaker-0.95.6+\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"
"POT-Creation-Date: 2015-06-14 16:10+0200\n"
"PO-Revision-Date: 2015-06-14 00:00+0000\n"
"Last-Translator: Alwin <translations@ziggo.nl>\n"
"Language-Team: Western Frisian\n"
"Language: fy\n"
@@ -99,7 +99,7 @@ msgstr "foartidich bestânsein, ferwachte in nije rigel nei '\\'"
#, 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"
"bestânsein berikt by sykje nei '*/' foar kommentaar begûnen op rigel %d"
#: ../../WINGs/menuparser.c:344
msgid "missing closing double-quote before end-of-line"
@@ -111,7 +111,7 @@ 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"
msgstr "te folle neste makro-útwurkingen, syklus ôfbrutsen"
#: ../../WINGs/menuparser.c:439
#, c-format
@@ -140,7 +140,7 @@ msgstr "ûntbrekkende slutende '%c' yn bestânsnammeopjefte"
#: ../../WINGs/menuparser.c:503
msgid "too many nested #include's"
msgstr "te folle neske #include's"
msgstr "te folle neste #include's"
#: ../../WINGs/menuparser.c:568
#, c-format
@@ -150,11 +150,11 @@ 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"
msgstr "ûntbrekkend makronammeargumint by #%s"
#: ../../WINGs/menuparser.c:600
msgid "too many nested #if sequences"
msgstr "te folle neske #if-rigen"
msgstr "te folle neste #if-rigen"
#: ../../WINGs/menuparser.c:626 ../../WINGs/menuparser.c:643
#, c-format
@@ -168,7 +168,7 @@ 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\""
msgstr "foartidich bestânsein by ynlêze arg.-list foar makro \"%s\""
#: ../../WINGs/menuparser_macros.c:194
#, c-format
@@ -196,7 +196,7 @@ msgstr ""
#: ../../WINGs/menuparser_macros.c:253
#, c-format
msgid "macro \"%s\" already defined, ignoring redefinition"
msgstr "makro \"%s\" al definiearre, negearret werdefiniearjen"
msgstr "makro \"%s\" al definiearre, negearret werdefiniearje"
#: ../../WINGs/menuparser_macros.c:346
#, c-format
@@ -225,7 +225,7 @@ 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\""
msgstr "foartidich rigelein by sykje nei arguminten by makro \"%s\""
#: ../../WINGs/menuparser_macros.c:536
#, c-format
@@ -345,7 +345,7 @@ 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'"
msgstr "flater by ynlêze bestân '%s'"
#: ../../WINGs/proplist.c:1578
#, c-format
@@ -355,32 +355,32 @@ 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"
msgstr "oanmeitsje unyk tydlik bestân (%s) mislearre"
#: ../../WINGs/proplist.c:1670
#, c-format
msgid "mktemp (%s) failed"
msgstr "oanmeitsjen tydlik bestân (%s) mislearre"
msgstr "oanmeitsje tydlik bestân (%s) mislearre"
#: ../../WINGs/proplist.c:1677
#, c-format
msgid "open (%s) failed"
msgstr "iepenjen (%s) mislearre"
msgstr "iepenje (%s) mislearre"
#: ../../WINGs/proplist.c:1684
#, c-format
msgid "writing to file: %s failed"
msgstr "skriuwen nei bestân: %s mislearre"
msgstr "skriuwe nei bestân: %s mislearre"
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "fclose (%s) failed"
msgstr "ôfsluten stream (%s) mislearre"
msgstr "ôfslute stream (%s) mislearre"
#: ../../WINGs/proplist.c:1701
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "omneamen ('%s' nei '%s') mislearre"
msgstr "omneame ('%s' nei '%s') mislearre"
#: ../../WINGs/proplist.c:1772
#, c-format
@@ -388,14 +388,14 @@ 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"
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
msgstr "fariabele GNUSTEP_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"
msgstr "kin domeinbestân '%s' net ynlêze by syngronisearje"
#: ../../WINGs/dragcommon.c:60
#, c-format
@@ -414,11 +414,11 @@ 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..."
msgstr "XDND-seleksje ferlern by 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"
msgstr "koe XDND-ferzje net krije foar doel fan ferslepe"
#: ../../WINGs/dragsource.c:774
msgid "could not get ownership of XDND selection"
@@ -456,7 +456,7 @@ msgstr "Kleuren"
#: ../../WINGs/wcolorpanel.c:568 ../../WINGs/wcolorpanel.c:2720
msgid "Brightness"
msgstr "Helderens"
msgstr "Helderheid"
#: ../../WINGs/wcolorpanel.c:570 ../../WINGs/wcolorpanel.c:644
#: ../../WINGs/wcolorpanel.c:675 ../../WINGs/wcolorpanel.c:706
@@ -558,7 +558,7 @@ msgstr "Nij..."
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Kleurepaniel: Koe map %s, nedich om ynstellingen te bewarjen, net oanmeitsje"
"Kleurepaniel: Koe map %s, nedich om ynstellingen te bewarje, net oanmeitsje"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1176 ../../WINGs/wcolorpanel.c:3073
@@ -568,7 +568,7 @@ msgstr "Bestânsflater"
#: ../../WINGs/wcolorpanel.c:1177
msgid "Could not create ColorPanel configuration directory"
msgstr "Koe ynstellingemap Kleurepaniel net oanmeitsje"
msgstr "Koe ynstellingenmap Kleurepaniel net oanmeitsje"
#: ../../WINGs/wcolorpanel.c:1178 ../../WINGs/wcolorpanel.c:3074
#: ../../WINGs/wcolorpanel.c:3079 ../../WINGs/wcolorpanel.c:3104
@@ -593,7 +593,7 @@ msgstr "Fersêding"
#: ../../WINGs/wcolorpanel.c:2788
msgid "Hue"
msgstr "Tint"
msgstr "Tinte"
#: ../../WINGs/wcolorpanel.c:3012
msgid "Open Palette"
@@ -610,7 +610,7 @@ 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!"
msgstr "Koe bestân net ferwiderje út ynstellingenmap!"
#: ../../WINGs/wcolorpanel.c:3103
msgid "Rename"
@@ -737,12 +737,12 @@ msgstr "Bestân"
#: ../../WINGs/wfilepanel.c:719
#, c-format
msgid "Removing %s failed: %s"
msgstr "Ferwiderjen %s mislearre: %s"
msgstr "Ferwiderje %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'."
msgstr "Der trede in flater op by blêdzje troch '%s'."
#: ../../WINGs/wfilepanel.c:754
#, c-format
@@ -799,7 +799,7 @@ 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"
msgstr "WINGs: Koe ôfbyldingenbestân bestjoeringseleminten net lade: %s"
#: ../../WINGs/widgets.c:542
#, c-format
@@ -824,7 +824,7 @@ msgstr "0 inch"
#: ../../WINGs/wtextfield.c:494
msgid "only left alignment is supported in textfields"
msgstr "allinnich lofts rjochtsjen wurdt stipe yn tekstfjilden"
msgstr "allinnich lofts rjochtsje wurdt stipe yn tekstfjilden"
#: ../../WINGs/wwindow.c:160
msgid "window title conversion error... using STRING encoding"
@@ -833,3 +833,42 @@ msgstr "finstertitelomsettingsflater... brûkt STRING-kodearring"
#: ../../WINGs/wwindow.c:181
msgid "icon title conversion error... using STRING encoding"
msgstr "ikoantitelomsettingsflater... brûkt STRING-kodearring"
# Keep next entries for wmaker-0.95.6
msgid "Could not open input file \"%s\""
msgstr "Koe ynfierbestân \"%s\" net iepenje"
msgid "Could not create target file \"%s\""
msgstr "Koe doelbestân \"%s\" net oanmeitsje"
msgid "An error occured browsing '%s'."
msgstr "Der trede in flater op by blêdzje troch '%s'."
msgid ""
"invalid characted '%c' in arg-list for macro \"%s\" while expecting "
"parameter name"
msgstr ""
"ûnjildich letterteken '%c' yn arg.-list foar makro \"%s\", ferwachte "
"parameternamme"
msgid ""
"invalid characted '%c' in arg-list for macro \"%s\" while expecting ',' "
"or ')'"
msgstr ""
"ûnjildich letterteken '%c' yn arg.-list foar makro \"%s\", ferwachte ',' "
"of ')'"
msgid "unknow directive '#%s'"
msgstr "ûnbekende oanwizing '#%s'"
msgid "found #%s but have no matching #if"
msgstr "#%s fûn, mar hat gjin bybehearrende #if"
msgid "too many nested includes"
msgstr "te folle neste #include's"
msgid "could not find file \"%s\" for include"
msgstr "koe bestân \"%s\" net fine foar #include"
msgid "too many nested macro expansion, breaking loop"
msgstr "te folle neste makro-útwurkingen, syklus ôfbrutsen"
+3 -3
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: hu\n"
"Language: \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 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"
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"
#. something happened with the file. just overwrite it
#: ../../../wmaker-crm/WINGs/userdefaults.c:196
+9 -3
View File
@@ -1,5 +1,5 @@
# New translation into Dutch for Window Maker
# Copyright (C) 2014-2019 Window Maker Developers Team
# Copyright (C) 2014-2015 Window Maker Developers Team
# This file is distributed under the same license as the windowmaker package.
# Original by Alwin <translations@ziggo.nl>, 2014.
#
@@ -389,9 +389,9 @@ msgid "Could not create component %s"
msgstr "Kon component %s niet aanmaken"
#: ../../WINGs/userdefaults.c:72
msgid "variable WMAKER_USER_ROOT defined with invalid path, not used"
msgid "variable GNUSTEP_USER_ROOT defined with invalid path, not used"
msgstr ""
"variabele WMAKER_USER_ROOT, gedefinieerd met ongeldig pad, niet gebruikt"
"variabele GNUSTEP_USER_ROOT, gedefinieerd met ongeldig pad, niet gebruikt"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:210 ../../WINGs/userdefaults.c:225
@@ -843,6 +843,9 @@ msgstr "Kon invoerbestand \"%s\" niet openen"
msgid "Could not create target file \"%s\""
msgstr "Kon doelbestand \"%s\" niet aanmaken"
msgid "An error occured browsing '%s'."
msgstr "Er trad 'n fout op bij bladeren door '%s'."
msgid ""
"invalid characted '%c' in arg-list for macro \"%s\" while expecting "
"parameter name"
@@ -857,6 +860,9 @@ msgstr ""
"ongeldig letterteken '%c' in arg.-lijst voor macro \"%s\", verwachtte ',' "
"of ')'"
msgid "unknow directive '#%s'"
msgstr "onbekende aanwijzing '#%s'"
msgid "found #%s but have no matching #if"
msgstr "#%s gevonden, maar heeft geen bijbehorende #if"
-1
View File
@@ -19,7 +19,6 @@ 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"
-806
View File
@@ -1,806 +0,0 @@
# 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 кодирање"
+13 -38
View File
@@ -1253,34 +1253,22 @@ int WMGetPropListItemCount(WMPropList * plist)
Bool WMIsPLString(WMPropList * plist)
{
if (plist)
return (plist->type == WPLString);
else
return False;
return (plist->type == WPLString);
}
Bool WMIsPLData(WMPropList * plist)
{
if (plist)
return (plist->type == WPLData);
else
return False;
return (plist->type == WPLData);
}
Bool WMIsPLArray(WMPropList * plist)
{
if (plist)
return (plist->type == WPLArray);
else
return False;
return (plist->type == WPLArray);
}
Bool WMIsPLDictionary(WMPropList * plist)
{
if (plist)
return (plist->type == WPLDictionary);
else
return False;
return (plist->type == WPLDictionary);
}
Bool WMIsPropListEqualTo(WMPropList * plist, WMPropList * other)
@@ -1695,7 +1683,6 @@ 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;
}
@@ -1732,7 +1719,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 $WMAKER_USER_ROOT
* refuses to create anything outside $GNUSTEP_USER_ROOT
*
* returns 1 on success, 0 on failure
*/
@@ -1743,7 +1730,7 @@ int wmkdirhier(const char *path)
size_t p, plen;
struct stat st;
/* Only create directories under $WMAKER_USER_ROOT */
/* Only create directories under $GNUSTEP_USER_ROOT */
if ((t = wusergnusteppath()) == NULL)
return 0;
if (strncmp(path, t, strlen(t)) != 0)
@@ -1824,7 +1811,7 @@ static int wrmdirhier_fn(const char *path, const struct stat *st,
/*
* remove a directory hierarchy
*
* refuses to remove anything outside $WMAKER_USER_ROOT/Defaults or $WMAKER_USER_ROOT/Library
* refuses to remove anything outside $GNUSTEP_USER_ROOT
*
* returns 1 on success, 0 on failure
*
@@ -1834,27 +1821,15 @@ 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 $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);
/* Only remove directories under $GNUSTEP_USER_ROOT */
if ((t = wusergnusteppath()) == NULL)
return EPERM;
if (strncmp(path, t, strlen(t)) != 0)
return EPERM;
/* 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
const char *WMSelectionOwnerDidChangeNotification = "WMSelectionOwnerDidChange";
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, (void *) XFree);
wdata = WMCreateDataWithBytesNoCopy(data, len * bpi, (WMFreeDataProc *) XFree);
WMSetDataFormat(wdata, bits);
return wdata;
+7 -5
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, slen1;
size_t slen;
if (!str1 && str2)
return wstrdup(str2);
@@ -213,11 +213,13 @@ char *wstrconcat(const char *str1, const char *str2)
else if (!str1 && !str2)
return NULL;
slen1 = strlen(str1);
slen = slen1 + strlen(str2) + 1;
slen = strlen(str1) + strlen(str2) + 1;
str = wmalloc(slen);
strcpy(str, str1);
strcpy(str + slen1, str2);
if (wstrlcpy(str, str1, slen) >= slen ||
wstrlcat(str, str2, slen) >= slen) {
wfree(str);
return NULL;
}
return str;
}
+24 -22
View File
@@ -40,32 +40,36 @@ 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(void)
const char *wusergnusteppath()
{
static const char subdir[] = "/" GSUSER_SUBDIR;
static const char subdir[] = "/GNUstep";
static char *path = NULL;
char *gspath;
const char *h;
char *gspath, *h;
int pathlen;
if (path)
/* Value have been already computed, re-use it */
return path;
gspath = GETENV("WMAKER_USER_ROOT");
#ifdef HAVE_SECURE_GETENV
gspath = secure_getenv("GNUSTEP_USER_ROOT");
#else
gspath = getenv("GNUSTEP_USER_ROOT");
#endif
if (gspath) {
gspath = wexpandpath(gspath);
if (gspath) {
path = gspath;
return path;
}
wwarning(_("variable WMAKER_USER_ROOT defined with invalid path, not used"));
wwarning(_("variable GNUSTEP_USER_ROOT defined with invalid path, not used"));
}
h = wgethomedir();
@@ -80,19 +84,6 @@ const char *wusergnusteppath(void)
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;
@@ -100,20 +91,31 @@ char *wdefaultspathfordomain(const char *domain)
size_t slen;
gspath = wusergnusteppath();
slen = strlen(gspath) + strlen("/" DEFAULTS_SUBDIR "/") + strlen(domain) + 1;
slen = strlen(gspath) + strlen(DEFAULTS_DIR) + strlen(domain) + 4;
path = wmalloc(slen);
strcpy(path, gspath);
strcat(path, "/" DEFAULTS_SUBDIR "/");
strcat(path, DEFAULTS_DIR);
strcat(path, "/");
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)
{
return wstrconcat(PKGCONFDIR "/", 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;
}
void w_save_defaults_changes(void)
+22 -32
View File
@@ -9,7 +9,7 @@
struct W_Application WMApplication;
const char *_WINGS_progname = NULL;
char *_WINGS_progname = NULL;
Bool W_ApplicationInitialized(void)
{
@@ -83,7 +83,7 @@ void WMSetResourcePath(const char *path)
WMApplication.resourcePath = wstrdup(path);
}
char *WMGetApplicationName(void)
char *WMGetApplicationName()
{
return WMApplication.applicationName;
}
@@ -131,9 +131,7 @@ error:
char *WMPathForResourceOfType(const char *resource, const char *ext)
{
const char *gslocapps, *gssysapps, *gsuserapps;
char *path, *appdir;
char buffer[PATH_MAX];
size_t slen;
path = appdir = NULL;
@@ -142,12 +140,12 @@ char *WMPathForResourceOfType(const char *resource, const char *ext)
* Paths are searched in this order:
* - resourcePath/ext
* - dirname(argv[0])/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
* - 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
*/
if (WMApplication.resourcePath) {
@@ -172,40 +170,32 @@ char *WMPathForResourceOfType(const char *resource, const char *ext)
}
}
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");
slen = strlen(WMApplication.applicationName) + sizeof("Applications/.app");
appdir = wmalloc(slen);
if (snprintf(appdir, slen, "/%s.app", WMApplication.applicationName) >= slen)
if (snprintf(appdir, slen, "Applications/%s.app", WMApplication.applicationName) >= slen)
goto out;
gsuserapps = GETENV("GNUSTEP_USER_APPS");
if (!gsuserapps) {
snprintf(buffer, sizeof(buffer), "%s/Applications", wusergnusteppath());
gsuserapps = buffer;
}
path = checkFile(gsuserapps, appdir, ext, resource);
path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource);
if (path)
goto out;
gslocapps = GETENV("GNUSTEP_LOCAL_APPS");
if (!gslocapps)
gslocapps = "/usr/local/lib/GNUstep/Applications";
path = checkFile(gslocapps, appdir, ext, resource);
path = checkFile(wusergnusteppath(), appdir, ext, resource);
if (path)
goto out;
gssysapps = GETENV("GNUSTEP_SYSTEM_APPS");
if (!gssysapps)
gssysapps = "/usr/lib/GNUstep/Applications";
path = checkFile(gssysapps, appdir, ext, resource);
path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource);
if (path)
goto out;
path = checkFile("/usr/GNUstep/System/Applications", appdir, ext, resource); /* falls through */
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 */
out:
if (appdir)
+2 -3
View File
@@ -619,12 +619,11 @@ void WMSetBrowserHasScroller(WMBrowser * bPtr, int hasScroller)
bPtr->flags.hasScroller = hasScroller;
}
const char *WMSetBrowserPath(WMBrowser * bPtr, const char *path)
char *WMSetBrowserPath(WMBrowser * bPtr, char *path)
{
int i;
char *str;
char *tmp;
const char *retPtr = NULL;
char *tmp, *retPtr = NULL;
int item;
WMListItem *listItem;
+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 = 0;
color->flags.exact = 1;
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 = scr->black;
color = WMBlackColor(scr);
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 = scr->black;
color = WMBlackColor(scr);
return color;
}
+30 -33
View File
@@ -44,7 +44,7 @@
# include <X11/extensions/shape.h>
#endif
const char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification";
char *WMColorPanelColorChangedNotification = "WMColorPanelColorChangedNotification";
/*
* Bitmaps for magnifying glass cursor
@@ -67,6 +67,9 @@ 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,
@@ -394,7 +397,7 @@ static WMColorPanel *makeColorPanel(WMScreen * scrPtr, const char *name)
panel->mode = WMWheelModeColorPanel;
panel->lastChanged = 0;
panel->slidersmode = WMRGBModeColorPanel;
panel->configurationPath = wstrconcat(wuserdatapath(), "/Colors/");
panel->configurationPath = wstrconcat(wusergnusteppath(), "/Library/Colors/");
/* Some General Purpose Widgets */
panel->colorWell = WMCreateColorWell(panel->win);
@@ -1159,18 +1162,21 @@ static void readConfiguration(W_ColorPanel * panel)
DIR *dPtr;
struct dirent *dp;
struct stat stat_buf;
int item;
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);
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);
}
return;
}
@@ -2259,7 +2265,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;
@@ -2382,8 +2388,6 @@ void rgbIntToChar(W_ColorPanel *panel, int *value)
case RGBhex:
format = "%0X";
break;
default:
format = "";
}
sprintf(tmp, format, value[0]);
@@ -2604,7 +2608,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;
@@ -2640,9 +2644,9 @@ static void hsbSliderCallback(WMWidget * w, void *data)
static void hsbTextFieldCallback(void *observerData, WMNotification * notification)
{
CPColor cpColor = {};
CPColor cpColor;
int value[3];
char tmp[12]; /* We only 4 bytes needed, but compilers cannot know that */
char tmp[4];
int n;
W_ColorPanel *panel = (W_ColorPanel *) observerData;
@@ -3395,9 +3399,6 @@ static void rgbInit(W_ColorPanel * panel)
case RGBhex:
format = "%0X";
break;
default:
/* Avoid compiler warning */
format = "";
}
sprintf(tmp, format, panel->color.rgb.red);
@@ -3450,7 +3451,7 @@ static void hsbInit(W_ColorPanel * panel)
WMSetSliderValue(panel->hsbSaturationS, value[1]);
WMSetSliderValue(panel->hsbBrightnessS, value[2]);
sprintf(tmp, "%hu", value[0]);
sprintf(tmp, "%d", value[0]);
WMSetTextFieldText(panel->hsbHueT, tmp);
sprintf(tmp, "%d", value[1]);
WMSetTextFieldText(panel->hsbSaturationT, tmp);
@@ -3501,17 +3502,13 @@ static void convertCPColor(CPColor * color)
old_hue = color->hsv.hue;
RRGBtoHSV(&(color->rgb), &(color->hsv));
/*
* 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) )
/* 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))
)
color->hsv.hue = old_hue;
break;
case cpHSV:
+4 -4
View File
@@ -3,7 +3,7 @@
#define XDND_COLOR_DATA_TYPE "application/X-color"
const char *WMColorWellDidChangeNotification = "WMColorWellDidChangeNotification";
char *WMColorWellDidChangeNotification = "WMColorWellDidChangeNotification";
typedef struct W_ColorWell {
W_Class widgetClass;
@@ -173,10 +173,10 @@ WMColorWell *WMCreateColorWell(WMWidget * parent)
void WMSetColorWellColor(WMColorWell * cPtr, WMColor * color)
{
if (cPtr->color && cPtr->color != color) {
if (cPtr->color)
WMReleaseColor(cPtr->color);
cPtr->color = WMRetainColor(color);
}
cPtr->color = WMRetainColor(color);
if (cPtr->colorView->flags.realized && cPtr->colorView->flags.mapped)
paintColorWell(cPtr);
-6
View File
@@ -29,12 +29,6 @@
# 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_ */
+4 -4
View File
@@ -343,7 +343,7 @@ void WMFreeFilePanel(WMFilePanel * panel)
}
int
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, const char *path, const char *name, char **fileTypes)
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, char *path, const char *name, char **fileTypes)
{
WMScreen *scr = WMWidgetScreen(panel->win);
@@ -387,12 +387,12 @@ WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, const cha
return (panel->flags.canceled ? False : True);
}
void WMSetFilePanelDirectory(WMFilePanel * panel, const char *path)
void WMSetFilePanelDirectory(WMFilePanel * panel, char *path)
{
WMList *list;
WMListItem *item;
int col;
const char *rest;
char *rest;
rest = WMSetBrowserPath(panel->browser, path);
if (strcmp(path, "/") == 0)
@@ -761,7 +761,7 @@ static void goFloppy(WMWidget *widget, void *p_panel)
static void goHome(WMWidget *widget, void *p_panel)
{
WMFilePanel *panel = p_panel;
const char *home;
char *home;
/* Parameter not used, but tell the compiler that it is ok */
(void) widget;
+33 -47
View File
@@ -70,30 +70,37 @@ 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 = NULL;
FcPattern *pattern;
char *result;
if (font && font[0] == '-') {
if (font[0] == '-') {
pattern = xlfdToFcPattern(font);
} else {
pattern = FcNameParse((const FcChar8 *) font);
}
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;
}
}
/*FcPatternPrint(pattern); */
if (size > 0) {
FcPatternDel(pattern, FC_PIXEL_SIZE);
@@ -102,6 +109,12 @@ 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);
@@ -122,7 +135,7 @@ WMFont *WMCreateFont(WMScreen * scrPtr, const char *fontName)
double size;
#endif
if (fontName && fontName[0] == '-') {
if (fontName[0] == '-') {
fname = xlfdToFcName(fontName);
} else {
fname = wstrdup(fontName);
@@ -174,10 +187,6 @@ WMFont *WMCreateFont(WMScreen * scrPtr, const char *fontName)
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);
@@ -201,11 +210,6 @@ 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);
@@ -233,16 +237,6 @@ 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);
@@ -258,11 +252,7 @@ WMFont *WMSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;
fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, DEFAULT_FONT);
if (!fontSpec) {
return NULL;
}
fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, NULL);
font = WMCreateFont(scrPtr, fontSpec);
@@ -280,11 +270,7 @@ WMFont *WMBoldSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;
fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, DEFAULT_FONT);
if (!fontSpec) {
return NULL;
}
fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, NULL);
font = WMCreateFont(scrPtr, fontSpec);
@@ -340,7 +326,7 @@ void WMDrawString(WMScreen * scr, Drawable d, WMColor * color, WMFont * font, in
#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')
if ((previous_text == NULL) || (strcmp(text, previous_text) != 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
@@ -378,7 +364,7 @@ WMDrawImageString(WMScreen * scr, Drawable d, WMColor * color, WMColor * backgro
#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')
if ((previous_text == NULL) || (strcmp(text, previous_text) != 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
+2 -2
View File
@@ -700,7 +700,7 @@ static void typefaceClick(WMWidget * w, void *data)
WM_ITERATE_ARRAY(face->sizes, size, i) {
if (size != NULL) {
int size_int = (intptr_t) size;
int size_int = (int) size;
sprintf(buffer, "%i", size_int);
@@ -802,7 +802,7 @@ static void setFontPanelFontName(FontPanel * panel, const char *family, const ch
char buffer[32];
if (vsize != NULL) {
int size_int = (intptr_t) vsize;
int size_int = (int) vsize;
sprintf(buffer, "%i", size_int);
-3
View File
@@ -253,9 +253,6 @@ WMFrame *WMCreateFrame(WMWidget * parent)
static void destroyFrame(Frame * fPtr)
{
if (fPtr->textColor)
WMReleaseColor(fPtr->textColor);
if (fPtr->caption)
wfree(fPtr->caption);
+1 -2
View File
@@ -385,7 +385,6 @@ 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);
@@ -945,7 +944,7 @@ void WMSetFocusToWidget(WMWidget * widget)
/*
* WMRealizeWidget-
* Realizes the widget and all its children.
* Realizes the widget and all it's children.
*
*/
void WMRealizeWidget(WMWidget * w)
-29
View File
@@ -213,32 +213,3 @@ 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;
}
+11 -500
View File
@@ -1,10 +1,8 @@
#include "WINGsP.h"
#include <ctype.h>
#include <strings.h>
const char *WMListDidScrollNotification = "WMListDidScrollNotification";
const char *WMListSelectionDidChangeNotification = "WMListSelectionDidChangeNotification";
char *WMListDidScrollNotification = "WMListDidScrollNotification";
char *WMListSelectionDidChangeNotification = "WMListSelectionDidChangeNotification";
typedef struct W_List {
W_Class widgetClass;
@@ -29,15 +27,11 @@ 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;
@@ -54,7 +48,6 @@ 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);
@@ -69,8 +62,6 @@ 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);
@@ -122,9 +113,6 @@ 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;
@@ -141,8 +129,7 @@ WMList *WMCreateList(WMWidget * parent)
| ClientMessageMask, handleEvents, lPtr);
WMCreateEventHandler(lPtr->view, ButtonPressMask | ButtonReleaseMask
| EnterWindowMask | LeaveWindowMask | ButtonMotionMask
| KeyPressMask, handleActionEvents, lPtr);
| EnterWindowMask | LeaveWindowMask | ButtonMotionMask, handleActionEvents, lPtr);
lPtr->itemHeight = WMFontHeight(scrPtr->normalFont) + 1;
@@ -301,14 +288,6 @@ 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);
}
@@ -516,16 +495,15 @@ static void paintItem(List * lPtr, int index)
static void paintList(List * lPtr)
{
W_Screen *scrPtr = lPtr->view->screen;
int i, lim, itemCount;
int i, lim;
if (!lPtr->view->flags.mapped)
return;
itemCount = WMGetArrayItemCount(lPtr->items);
if (itemCount > 0) {
if (lPtr->topItem + lPtr->fullFitLines + lPtr->flags.dontFitAll > itemCount) {
if (WMGetArrayItemCount(lPtr->items) > 0) {
if (lPtr->topItem + lPtr->fullFitLines + lPtr->flags.dontFitAll > WMGetArrayItemCount(lPtr->items)) {
lim = itemCount - lPtr->topItem;
lim = WMGetArrayItemCount(lPtr->items) - 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);
@@ -842,7 +820,7 @@ void WMSetListSelectionToRange(WMList * lPtr, WMRange range)
void WMSelectAllListItems(WMList * lPtr)
{
int i, itemCount;
int i;
WMListItem *item;
if (!lPtr->flags.allowMultipleSelection)
@@ -855,8 +833,7 @@ void WMSelectAllListItems(WMList * lPtr)
WMFreeArray(lPtr->selectedItems);
lPtr->selectedItems = WMCreateArrayWithArray(lPtr->items);
itemCount = WMGetArrayItemCount(lPtr->items);
for (i = 0; i < itemCount; i++) {
for (i = 0; i < WMGetArrayItemCount(lPtr->items); i++) {
item = WMGetFromArray(lPtr->items, i);
if (!item->selected) {
item->selected = 1;
@@ -882,11 +859,10 @@ void WMSelectAllListItems(WMList * lPtr)
*/
static void unselectAllListItems(WMList * lPtr, WMListItem * exceptThis)
{
int i, itemCount;
int i;
WMListItem *item;
itemCount = WMGetArrayItemCount(lPtr->items);
for (i = 0; i < itemCount; i++) {
for (i = 0; i < WMGetArrayItemCount(lPtr->items); i++) {
item = WMGetFromArray(lPtr->items, i);
if (item != exceptThis && item->selected) {
item->selected = 0;
@@ -944,85 +920,6 @@ 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;
@@ -1062,7 +959,6 @@ static void handleActionEvents(XEvent * event, void *data)
WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL;
}
WMSetFocusToWidget(lPtr);
break;
case LeaveNotify:
@@ -1074,9 +970,6 @@ 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:
@@ -1183,381 +1076,6 @@ 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);
@@ -1605,10 +1123,6 @@ 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);
@@ -1618,9 +1132,6 @@ 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);
+10 -290
View File
@@ -25,7 +25,7 @@ static void handleKeyPress(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
if (ksym == XK_Return && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn || panel->othBtn) {
@@ -89,12 +89,10 @@ 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) {
@@ -162,7 +160,6 @@ 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);
@@ -173,13 +170,13 @@ WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
/* create buttons */
if (otherButton)
ow = WMWidthOfString(defaultFont, otherButton, strlen(otherButton));
ow = WMWidthOfString(scrPtr->normalFont, otherButton, strlen(otherButton));
if (alternateButton)
aw = WMWidthOfString(defaultFont, alternateButton, strlen(alternateButton));
aw = WMWidthOfString(scrPtr->normalFont, alternateButton, strlen(alternateButton));
if (defaultButton)
dw = WMWidthOfString(defaultFont, defaultButton, strlen(defaultButton));
dw = WMWidthOfString(scrPtr->normalFont, defaultButton, strlen(defaultButton));
dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
@@ -209,187 +206,18 @@ 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);
@@ -421,7 +249,7 @@ static void handleKeyPress2(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
if (ksym == XK_Return && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn) {
@@ -510,10 +338,8 @@ 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)
@@ -545,23 +371,21 @@ 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(defaultFont, cancelButton, strlen(cancelButton));
aw = WMWidthOfString(scrPtr->normalFont, cancelButton, strlen(cancelButton));
if (okButton)
dw = WMWidthOfString(defaultFont, okButton, strlen(okButton));
dw = WMWidthOfString(scrPtr->normalFont, okButton, strlen(okButton));
w = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
if (aw > w)
@@ -582,7 +406,6 @@ 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;
@@ -592,104 +415,6 @@ 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);
@@ -709,7 +434,7 @@ static void handleKeyPress3(XEvent * event, void *clientData)
XLookupString(&event->xkey, NULL, 0, &ksym, NULL);
if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) {
if (ksym == XK_Return && panel->defBtn) {
WMPerformButtonClick(panel->defBtn);
} else if (ksym == XK_Escape) {
if (panel->altBtn) {
@@ -732,12 +457,10 @@ 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) {
@@ -810,10 +533,10 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
/* create buttons */
if (defaultButton)
dw = WMWidthOfString(defaultFont, defaultButton, strlen(defaultButton));
dw = WMWidthOfString(scrPtr->normalFont, defaultButton, strlen(defaultButton));
if (alternateButton)
aw = WMWidthOfString(defaultFont, alternateButton, strlen(alternateButton));
aw = WMWidthOfString(scrPtr->normalFont, alternateButton, strlen(alternateButton));
dw = dw + (scrPtr->buttonArrow ? scrPtr->buttonArrow->width : 0);
@@ -838,7 +561,6 @@ 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);
@@ -848,7 +570,5 @@ WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
WMRealizeWidget(panel->win);
WMMapSubwidgets(panel->win);
WMReleaseFont(defaultFont);
return panel;
}
-50
View File
@@ -252,56 +252,6 @@ 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;
+4 -1
View File
@@ -181,7 +181,10 @@ 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) {
snprintf(c, sizeof(c), "%hu", ++j);
if (j < 10)
snprintf(c, 3, "%d", ++j);
else
snprintf(c, 3, "%2d", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
}
+1 -1
View File
@@ -20,7 +20,7 @@
#define AUTOSCROLL_DELAY 40
const char *WMScrollerDidScrollNotification = "WMScrollerDidScrollNotification";
char *WMScrollerDidScrollNotification = "WMScrollerDidScrollNotification";
typedef struct W_Scroller {
W_Class widgetClass;
+3
View File
@@ -41,6 +41,9 @@ 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)))
+15 -31
View File
@@ -166,15 +166,12 @@ 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
@@ -218,11 +215,6 @@ 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);
@@ -625,7 +617,7 @@ static void paintText(Text * tPtr)
TextBlock *tb;
WMFont *font;
const char *text;
int len, y, c, s, done = False, dir; /* dir 1 = down */
int len, y, c, s, done = False, dir /* 1 = down */ ;
WMScreen *scr = tPtr->view->screen;
Display *dpy = tPtr->view->screen->display;
Window win = tPtr->view->window;
@@ -2044,13 +2036,17 @@ 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 == XA_TEXT || target == XA_COMPOUND_TEXT) {
if (target == XA_STRING || target == TEXT || target == COMPOUND_TEXT) {
char *text = WMGetTextSelectedStream(tPtr);
if (text) {
@@ -2063,18 +2059,19 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
} else
printf("didn't get it\n");
if (target == XA_TARGETS) {
Atom supported_type[4];
_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == _TARGETS) {
Atom array[4];
supported_type[0] = XA_TARGETS;
supported_type[1] = XA_STRING;
supported_type[2] = XA_TEXT;
supported_type[3] = XA_COMPOUND_TEXT;
array[0] = _TARGETS;
array[1] = XA_STRING;
array[2] = TEXT;
array[3] = COMPOUND_TEXT;
data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
data = WMCreateDataWithBytes(&array, sizeof(array));
WMSetDataFormat(data, 32);
*type = XA_ATOM;
*type = target;
return data;
}
@@ -2308,7 +2305,6 @@ static void handleTextKeyPress(Text * tPtr, XEvent * event)
case XK_Return:
*buffer = '\n';
/* FALLTHRU */
default:
if (*buffer != 0 && !control_pressed) {
insertTextInteractively(tPtr, buffer, strlen(buffer));
@@ -2548,7 +2544,6 @@ static void handleActionEvents(XEvent * event, void *data)
break;
}
/* FALLTHRU */
case ButtonRelease:
if (tPtr->flags.pointerGrabbed) {
tPtr->flags.pointerGrabbed = False;
@@ -2977,17 +2972,6 @@ 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;
+66 -110
View File
@@ -10,9 +10,9 @@
#define CURSOR_BLINK_ON_DELAY 600
#define CURSOR_BLINK_OFF_DELAY 300
const char *WMTextDidChangeNotification = "WMTextDidChangeNotification";
const char *WMTextDidBeginEditingNotification = "WMTextDidBeginEditingNotification";
const char *WMTextDidEndEditingNotification = "WMTextDidEndEditingNotification";
char *WMTextDidChangeNotification = "WMTextDidChangeNotification";
char *WMTextDidBeginEditingNotification = "WMTextDidBeginEditingNotification";
char *WMTextDidEndEditingNotification = "WMTextDidEndEditingNotification";
typedef struct W_TextField {
W_Class widgetClass;
@@ -239,9 +239,9 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
TextField *tPtr = view->self;
int count;
Display *dpy = tPtr->view->screen->display;
Atom XA_TARGETS;
Atom XA_TEXT = XInternAtom(dpy, "TEXT", False);
Atom XA_COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
Atom _TARGETS;
Atom TEXT = XInternAtom(dpy, "TEXT", False);
Atom COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
WMData *data;
/* Parameter not used, but tell the compiler that it is ok */
@@ -251,7 +251,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 == XA_TEXT || target == XA_COMPOUND_TEXT) {
if (target == XA_STRING || target == TEXT || target == COMPOUND_TEXT) {
data = WMCreateDataWithBytes(&(tPtr->text[count]), abs(tPtr->selection.count));
WMSetDataFormat(data, 8);
@@ -260,19 +260,19 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
return data;
}
XA_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == XA_TARGETS) {
_TARGETS = XInternAtom(dpy, "TARGETS", False);
if (target == _TARGETS) {
Atom supported_type[4];
supported_type[0] = XA_TARGETS;
supported_type[0] = _TARGETS;
supported_type[1] = XA_STRING;
supported_type[2] = XA_TEXT;
supported_type[3] = XA_COMPOUND_TEXT;
supported_type[2] = TEXT;
supported_type[3] = COMPOUND_TEXT;
data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
WMSetDataFormat(data, 32);
*type = XA_ATOM;
*type = target;
return data;
}
@@ -446,13 +446,6 @@ 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);
}
@@ -497,6 +490,11 @@ 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);
}
@@ -663,7 +661,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;
tPtr->usableWidth = tPtr->view->size.width - 2 * tPtr->offsetWidth /*+ 2 */ ;
}
static char *makeHiddenString(int length)
@@ -848,8 +846,8 @@ static void paintTextField(TextField * tPtr)
count = tPtr->viewPosition;
}
rx = tx + WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]),
count - tPtr->viewPosition);
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font, text, count)
- WMWidthOfString(tPtr->font, text, tPtr->viewPosition);
WMDrawImageString(screen, drawbuffer, color, screen->gray,
tPtr->font, rx, ty, &(text[count]), count2);
@@ -944,7 +942,7 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
{
char buffer[64];
KeySym ksym;
const char *textEvent = NULL;
char *textEvent = NULL;
void *data = NULL;
int count, refresh = 0;
int control_pressed = 0;
@@ -967,7 +965,6 @@ 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) {
@@ -1004,10 +1001,8 @@ 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;
@@ -1024,13 +1019,12 @@ 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);
@@ -1046,8 +1040,9 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
if (tPtr->cursorPosition < tPtr->viewPosition) {
tPtr->viewPosition = tPtr->cursorPosition;
}
refresh = 1;
refresh = 1;
} else
paintCursor(tPtr);
}
if (shifted)
cancelSelection = 0;
@@ -1063,13 +1058,12 @@ 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) {
@@ -1082,8 +1076,10 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
}
tPtr->cursorPosition = i;
incrToFit2(tPtr);
refresh = 1;
refresh = incrToFit2(tPtr);
if (!refresh)
paintCursor(tPtr);
}
if (shifted)
cancelSelection = 0;
@@ -1099,18 +1095,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;
refresh = 1;
} else
paintCursor(tPtr);
}
if (shifted)
cancelSelection = 0;
@@ -1126,18 +1122,19 @@ 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;
incrToFit(tPtr);
refresh = 1;
refresh = incrToFit(tPtr);
if (!refresh)
paintCursor(tPtr);
}
if (shifted)
cancelSelection = 0;
@@ -1152,7 +1149,6 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
else
modified = False;
/* FALLTHRU */
case XK_BackSpace:
if (!modified) {
if (tPtr->selection.count) {
@@ -1181,10 +1177,8 @@ 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) {
@@ -1400,25 +1394,7 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
tPtr->viewPosition);
}
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);
}
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
/* Do not allow text selection in secure textfields */
if (tPtr->flags.secure) {
@@ -1451,35 +1427,17 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
if (tPtr->flags.enabled && !tPtr->flags.focused) {
WMSetFocusToWidget(tPtr);
}
if (tPtr->flags.focused) {
tPtr->selection.position = tPtr->cursorPosition;
tPtr->selection.count = 0;
}
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
event->xbutton.x - tPtr->usableWidth
+ textWidth);
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) / 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;
@@ -1493,31 +1451,29 @@ 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)
void WHandleEvents()
{
/* Check any expired timers */
W_CheckTimerHandlers();
+3 -5
View File
@@ -5,9 +5,9 @@
/* the notifications about views */
const char *WMViewSizeDidChangeNotification = "WMViewSizeDidChangeNotification";
const char *WMViewFocusDidChangeNotification = "WMViewFocusDidChangeNotification";
const char *WMViewRealizedNotification = "WMViewRealizedNotification";
char *WMViewSizeDidChangeNotification = "WMViewSizeDidChangeNotification";
char *WMViewFocusDidChangeNotification = "WMViewFocusDidChangeNotification";
char *WMViewRealizedNotification = "WMViewRealizedNotification";
#define EVENT_MASK \
KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \
@@ -490,7 +490,6 @@ 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));
@@ -505,7 +504,6 @@ void W_SetViewBackgroundPixmap(W_View *view, WMPixmap *pix)
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);
-4
View File
@@ -395,11 +395,7 @@ 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;
+12 -33
View File
@@ -446,18 +446,12 @@ static void str2rcolor(RContext * rc, const char *name, RColor * color)
{
XColor xcolor;
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;
}
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;
}
static void dumpRImage(const char *path, RImage * image)
@@ -617,7 +611,6 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
break;
default:
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -644,7 +637,6 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
break;
default:
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -679,7 +671,6 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
break;
default:
wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
/* FALLTHRU */
case 'D':
style = RDiagonalGradient;
break;
@@ -1076,8 +1067,6 @@ 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;
@@ -1136,8 +1125,6 @@ static void changePage(WMWidget * w, void *data)
if (w) {
section = WMGetPopUpButtonSelectedItem(panel->secP);
if (section < 0)
return;
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
@@ -1237,8 +1224,6 @@ 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;
@@ -1267,7 +1252,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, tmp;
int width, height, x, y;
Display *dpy = WMScreenDisplay(scr);
WMColor *back = (state & WLDSSelected) ? WMWhiteColor(scr) : WMGrayColor(scr);
WMListItem *item;
@@ -1296,8 +1281,7 @@ 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);
tmp = WMGetPopUpButtonSelectedItem(panel->secP);
if ((tmp >= 0) && ((1 << tmp) & titem->selectedFor))
if ((1 << WMGetPopUpButtonSelectedItem(panel->secP)) & 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);
@@ -1432,10 +1416,6 @@ 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;
@@ -1447,6 +1427,7 @@ static void changeColorPage(WMWidget * w, void *data)
colorOptions[panel->oldcsection].hand.y);
}
if (w) {
section = WMGetPopUpButtonSelectedItem(panel->colP);
panel->oldcsection = section;
if (panel->preview)
@@ -1747,8 +1728,6 @@ static void colorWellObserver(void *self, WMNotification * n)
(void) n;
p = WMGetPopUpButtonSelectedItem(panel->colP);
if (p < 0)
return;
WMReleaseColor(panel->colors[p]);
@@ -1840,10 +1819,10 @@ static void createPanel(Panel * p)
char *tmp;
Bool ok = True;
panel->fprefix = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME);
panel->fprefix = wstrconcat(wusergnusteppath(), "/Library/WindowMaker");
if (access(panel->fprefix, F_OK) != 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
if (mkdir(panel->fprefix, 0755) < 0) {
werror("%s", panel->fprefix);
ok = False;
}
@@ -1853,7 +1832,7 @@ static void createPanel(Panel * p)
wfree(panel->fprefix);
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) {
if (-1 == mkdir(panel->fprefix, 0755) && errno != EEXIST) {
if (mkdir(panel->fprefix, 0755) < 0) {
werror("%s", panel->fprefix);
}
}
+8 -187
View File
@@ -2,9 +2,8 @@
*
* WPrefs - Window Maker Preferences Program
*
* Copyright (c) 2014-2023 Window Maker Team
* Copyright (c) 2014 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
@@ -26,7 +25,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 struct expert_option {
static const struct {
const char *label; /* Text displayed to user */
int def_state; /* True/False: the default value, if not defined in current config */
@@ -72,15 +71,9 @@ static struct expert_option {
{ 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" },
@@ -95,7 +88,7 @@ static struct expert_option {
/* default: */ False, OPTION_WMAKER, "KbdModeLock" },
#endif /* XKB_MODELOCK */
{ N_("Snap a window to edge or corner by dragging."),
{ N_("Maximize (snap) a window to edge or corner by dragging."),
/* default: */ False, OPTION_WMAKER, "WindowSnapping" },
{ N_("Distance from edge to begin window snap."),
@@ -104,39 +97,9 @@ static struct expert_option {
{ 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" },
/* 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
};
@@ -154,8 +117,6 @@ typedef struct _Panel {
WMButton *swi[wlengthof_nocheck(expert_options)];
WMTextField *textfield[wlengthof_nocheck(expert_options)];
WMScrollView *sv;
WMWidget *frame;
} _Panel;
@@ -164,134 +125,15 @@ typedef struct _Panel {
static void changeIntTextfield(void *data, int delta)
{
WMTextField *textfield;
char *text, buffer[12];
char *text;
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);
sprintf(text, "%d", value);
WMSetTextFieldText(textfield, text);
}
static void downButtonCallback(WMWidget *self, void *data)
@@ -306,19 +148,6 @@ static void upButtonCallback(WMWidget *self, void *data)
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)
{
_Panel *panel = (_Panel *) p;
@@ -342,7 +171,6 @@ 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++) {
if (expert_options[i].class != OPTION_WMAKER_INT) {
panel->swi[i] = WMCreateSwitchButton(f);
@@ -417,7 +245,7 @@ static void createPanel(Panel *p)
default:
#ifdef DEBUG
wwarning("expert_options[%d].class = %d, this should not happen\n",
wwarning("export_options[%d].class = %d, this should not happen\n",
i, expert_options[i].class);
#endif
state = expert_options[i].def_state;
@@ -429,11 +257,6 @@ static void createPanel(Panel *p)
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);
}
@@ -470,7 +293,6 @@ static void storeDefaults(_Panel *panel)
text = WMGetTextFieldText(panel->textfield[i]);
value = atoi(text);
wfree(text);
SetIntegerForKey(value, expert_options[i].op_name);
break;
@@ -494,7 +316,6 @@ Panel *InitExpert(WMWidget *parent)
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeDefaults;
panel->callbacks.prepareForClose = scrollViewPrepareForClose;
AddSection(panel, ICON_FILE);
+13 -10
View File
@@ -22,7 +22,6 @@
#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
@@ -522,7 +521,7 @@ static void selectedOption(WMWidget * w, void *data)
WMListItem *item = WMGetListItem(panel->sizeL, i);
int distance;
distance = fabs(size - atoi(item->text));
distance = abs(size - atoi(item->text));
if (i == 0 || distance < closest) {
closest = distance;
@@ -570,9 +569,6 @@ 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;
@@ -583,12 +579,19 @@ static void showData(_Panel * panel)
if (ofont)
wfree(ofont);
if (strcmp(fontOptions[i].option, "SystemFont") == 0)
font = WMGetFontName(WMDefaultSystemFont(scr));
else if (strcmp(fontOptions[i].option, "BoldSystemFont") == 0)
font = WMGetFontName(WMDefaultBoldSystemFont(scr));
else
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 {
font = GetStringForKey(fontOptions[i].option);
}
if (font)
font = wstrdup(font);
WMSetMenuItemRepresentedObject(item, font);
-465
View File
@@ -1,465 +0,0 @@
/* HotCornerShortcuts.c - screen corners actions
*
* WPrefs - Window Maker Preferences Program
*
* Copyright (c) 2023 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "WPrefs.h"
typedef struct _Panel {
WMBox *box;
char *sectionName;
char *description;
CallbackRec callbacks;
WMWidget *parent;
WMPixmap *icon;
Pixmap quarter[4];
WMFrame *hcF;
WMButton *hcB;
WMFrame *hceF;
WMSlider *hceS;
WMLabel *hceL;
WMFrame *hcdescF;
WMLabel *hcdescL;
WMFrame *hcdelayF;
WMButton *hcdelayB[5];
WMTextField *hcdelayT;
WMLabel *hcdelayL;
WMLabel *icornerL;
WMFrame *hcactionsF;
WMTextField *hcactionsT[4];
char hotcornerDelaySelected;
} _Panel;
#define ICON_FILE "hotcorners"
#define DELAY_ICON "timer%i"
#define DELAY_ICON_S "timer%is"
static void edgeCallback(WMWidget * w, void *data)
{
_Panel *panel = (_Panel *) data;
char buffer[64];
int i;
/* Parameter not used, but tell the compiler that it is ok */
(void) w;
i = WMGetSliderValue(panel->hceS);
if (i == 0)
sprintf(buffer, _("OFF"));
else if (i == 1)
sprintf(buffer, _("1 pixel"));
else if (i <= 4)
/* 2-4 */
sprintf(buffer, _("%i pixels"), i);
else
/* >4 */
sprintf(buffer, _("%i pixels "), i); /* note space! */
WMSetLabelText(panel->hceL, buffer);
}
static void showData(_Panel * panel)
{
int i;
char buffer[32];
WMPropList *array;
if (!GetObjectForKey("HotCornerDelay"))
i = 250;
else
i = GetIntegerForKey("HotCornerDelay");
sprintf(buffer, "%i", i);
WMSetTextFieldText(panel->hcdelayT, buffer);
switch (i) {
case 0:
WMPerformButtonClick(panel->hcdelayB[0]);
break;
case 250:
WMPerformButtonClick(panel->hcdelayB[1]);
break;
case 500:
WMPerformButtonClick(panel->hcdelayB[2]);
break;
case 750:
WMPerformButtonClick(panel->hcdelayB[3]);
break;
case 1000:
WMPerformButtonClick(panel->hcdelayB[4]);
break;
}
i = GetIntegerForKey("HotCornerEdge");
i = i < 0 ? 2 : i;
i = i > 10 ? 10 : i;
WMSetSliderValue(panel->hceS, i);
edgeCallback(NULL, panel);
WMSetButtonSelected(panel->hcB, GetBoolForKey("HotCorners"));
array = GetObjectForKey("HotCornerActions");
if (array && (!WMIsPLArray(array) || WMGetPropListItemCount(array) != sizeof(panel->hcactionsT) / sizeof(WMTextField *))) {
wwarning(_("invalid data in option HotCornerActions."));
} else {
if (array) {
for (i = 0; i < sizeof(panel->hcactionsT) / sizeof(WMTextField *); i++)
if (strcasecmp(WMGetFromPLString(WMGetFromPLArray(array, i)), "None") != 0)
WMSetTextFieldText(panel->hcactionsT[i], WMGetFromPLString(WMGetFromPLArray(array, i)));
}
}
}
static void storeData(_Panel * panel)
{
WMPropList *list;
WMPropList *tmp;
char *str;
int i;
SetBoolForKey(WMGetButtonSelected(panel->hcB), "HotCorners");
str = WMGetTextFieldText(panel->hcdelayT);
if (sscanf(str, "%i", &i) != 1)
i = 0;
SetIntegerForKey(i, "HotCornerDelay");
free(str);
SetIntegerForKey(WMGetSliderValue(panel->hceS), "HotCornerEdge");
list = WMCreatePLArray(NULL, NULL);
for (i = 0; i < sizeof(panel->hcactionsT) / sizeof(WMTextField *); i++) {
str = WMGetTextFieldText(panel->hcactionsT[i]);
if (strlen(str) == 0)
str = "None";
tmp = WMCreatePLString(str);
WMAddToPLArray(list, tmp);
}
SetObjectForKey(list, "HotCornerActions");
}
static void pushDelayButton(WMWidget * w, void *data)
{
_Panel *panel = (_Panel *) data;
panel->hotcornerDelaySelected = 1;
if (w == panel->hcdelayB[0]) {
WMSetTextFieldText(panel->hcdelayT, "0");
} else if (w == panel->hcdelayB[1]) {
WMSetTextFieldText(panel->hcdelayT, "250");
} else if (w == panel->hcdelayB[2]) {
WMSetTextFieldText(panel->hcdelayT, "500");
} else if (w == panel->hcdelayB[3]) {
WMSetTextFieldText(panel->hcdelayT, "700");
} else if (w == panel->hcdelayB[4]) {
WMSetTextFieldText(panel->hcdelayT, "1000");
}
}
static void delayTextChanged(void *observerData, WMNotification * notification)
{
_Panel *panel = (_Panel *) observerData;
int i;
/* Parameter not used, but tell the compiler that it is ok */
(void) notification;
if (panel->hotcornerDelaySelected) {
for (i = 0; i < 5; i++) {
WMSetButtonSelected(panel->hcdelayB[i], False);
}
panel->hotcornerDelaySelected = 0;
}
}
static void createPanel(Panel * p)
{
_Panel *panel = (_Panel *) p;
int i;
char *buf1, *buf2;
WMColor *color;
WMFont *font;
char *path;
RImage *xis = NULL;
WMScreen *scr = WMWidgetScreen(panel->parent);
RContext *rc = WMScreenRContext(scr);
GC gc = XCreateGC(scr->display, WMWidgetXID(panel->parent), 0, NULL);
path = LocateImage(ICON_FILE);
if (path) {
xis = RLoadImage(rc, path, 0);
if (!xis) {
wwarning(_("could not load image file %s"), path);
}
wfree(path);
}
panel->box = WMCreateBox(panel->parent);
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
/***************** Hot Corner lelf side frames *****************/
panel->hcF = WMCreateFrame(panel->box);
WMResizeWidget(panel->hcF, 240, 53);
WMMoveWidget(panel->hcF, 15, 17);
panel->hcB = WMCreateSwitchButton(panel->hcF);
WMResizeWidget(panel->hcB, 150, 30);
WMMoveWidget(panel->hcB, 15, 12);
WMSetButtonText(panel->hcB, _("Enable Hot Corners"));
WMMapSubwidgets(panel->hcF);
panel->hceF = WMCreateFrame(panel->box);
WMSetFrameTitle(panel->hceF, _("Hot Corner Edge"));
WMResizeWidget(panel->hceF, 240, 40);
WMMoveWidget(panel->hceF, 15, 77);
panel->hceS = WMCreateSlider(panel->hceF);
WMResizeWidget(panel->hceS, 80, 15);
WMMoveWidget(panel->hceS, 15, 18);
WMSetSliderMinValue(panel->hceS, 2);
WMSetSliderMaxValue(panel->hceS, 10);
WMSetSliderAction(panel->hceS, edgeCallback, panel);
panel->hceL = WMCreateLabel(panel->hceF);
WMResizeWidget(panel->hceL, 100, 15);
WMMoveWidget(panel->hceL, 105, 18);
WMMapSubwidgets(panel->hceF);
panel->hcdescF = WMCreateFrame(panel->box);
WMResizeWidget(panel->hcdescF, 240, 95);
WMMoveWidget(panel->hcdescF, 15, 130);
panel->hcdescL = WMCreateLabel(panel->hcdescF);
WMResizeWidget(panel->hcdescL, 200, 70);
WMMoveWidget(panel->hcdescL, 15, 10);
WMSetLabelText(panel->hcdescL,
_("Instructions:\n\n"
" - assign command to corner\n"
" - or leave it empty\n"));
WMMapSubwidgets(panel->hcdescF);
/***************** Hot Corner Action Delay *****************/
panel->hcdelayF = WMCreateFrame(panel->box);
WMResizeWidget(panel->hcdelayF, 245, 60);
WMMoveWidget(panel->hcdelayF, 265, 10);
WMSetFrameTitle(panel->hcdelayF, _("Hot Corner Delay"));
buf1 = wmalloc(strlen(DELAY_ICON) + 1);
buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);
for (i = 0; i < 5; i++) {
char *path;
panel->hcdelayB[i] = WMCreateCustomButton(panel->hcdelayF, WBBStateChangeMask);
WMResizeWidget(panel->hcdelayB[i], 25, 25);
WMMoveWidget(panel->hcdelayB[i], 12 + (30 * i), 25);
WMSetButtonBordered(panel->hcdelayB[i], False);
WMSetButtonImagePosition(panel->hcdelayB[i], WIPImageOnly);
WMSetButtonAction(panel->hcdelayB[i], pushDelayButton, panel);
if (i > 0)
WMGroupButtons(panel->hcdelayB[0], panel->hcdelayB[i]);
sprintf(buf1, DELAY_ICON, i);
sprintf(buf2, DELAY_ICON_S, i);
path = LocateImage(buf1);
if (path) {
panel->icon = WMCreatePixmapFromFile(scr, path);
if (panel->icon) {
WMSetButtonImage(panel->hcdelayB[i], panel->icon);
WMReleasePixmap(panel->icon);
} else {
wwarning(_("could not load icon file %s"), path);
}
wfree(path);
}
path = LocateImage(buf2);
if (path) {
panel->icon = WMCreatePixmapFromFile(scr, path);
if (panel->icon) {
WMSetButtonAltImage(panel->hcdelayB[i], panel->icon);
WMReleasePixmap(panel->icon);
} else {
wwarning(_("could not load icon file %s"), path);
}
wfree(path);
}
}
wfree(buf1);
wfree(buf2);
panel->hcdelayT = WMCreateTextField(panel->hcdelayF);
WMResizeWidget(panel->hcdelayT, 36, 20);
WMMoveWidget(panel->hcdelayT, 165, 28);
WMAddNotificationObserver(delayTextChanged, panel, WMTextDidChangeNotification, panel->hcdelayT);
panel->hcdelayL = WMCreateLabel(panel->hcdelayF);
WMResizeWidget(panel->hcdelayL, 36, 16);
WMMoveWidget(panel->hcdelayL, 205, 32);
WMSetLabelText(panel->hcdelayL, _("ms"));
color = WMDarkGrayColor(scr);
font = WMSystemFontOfSize(scr, 10);
WMSetLabelTextColor(panel->hcdelayL, color);
WMSetLabelFont(panel->hcdelayL, font);
WMReleaseColor(color);
WMReleaseFont(font);
WMMapSubwidgets(panel->hcdelayF);
/***************** Set Hot Corner Actions ****************/
panel->hcactionsF = WMCreateFrame(panel->box);
WMSetFrameTitle(panel->hcactionsF, _("Hot Corner Actions"));
WMResizeWidget(panel->hcactionsF, 245, 148);
WMMoveWidget(panel->hcactionsF, 265, 77);
panel->icornerL = WMCreateLabel(panel->hcactionsF);
WMResizeWidget(panel->icornerL, 24, 24);
WMMoveWidget(panel->icornerL, 10, 18);
WMSetLabelImagePosition(panel->icornerL, WIPImageOnly);
CreateImages(scr, rc, xis, ICON_FILE, &panel->icon, NULL);
if (panel->icon)
{
WMPixmap *nicon;
panel->quarter[0] = XCreatePixmap(scr->display, WMWidgetXID(panel->parent), panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
XCopyArea(scr->display, WMGetPixmapXID(panel->icon), panel->quarter[0], gc, 0, 0, panel->icon->width/2, panel->icon->height/2, 0, 0);
nicon = WMCreatePixmapFromXPixmaps(scr, panel->quarter[0], WMGetPixmapMaskXID(panel->icon),
panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
WMSetLabelImage(panel->icornerL, nicon);
WMReleasePixmap(nicon);
}
panel->hcactionsT[0] = WMCreateTextField(panel->hcactionsF);
WMResizeWidget(panel->hcactionsT[0], 180, 20);
WMMoveWidget(panel->hcactionsT[0], 50, 20);
panel->icornerL = WMCreateLabel(panel->hcactionsF);
WMResizeWidget(panel->icornerL, 24, 24);
WMMoveWidget(panel->icornerL, 10, 48);
WMSetLabelImagePosition(panel->icornerL, WIPImageOnly);
if (panel->icon)
{
WMPixmap *nicon;
panel->quarter[1] = XCreatePixmap(scr->display, WMWidgetXID(panel->parent), panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
XCopyArea(scr->display, WMGetPixmapXID(panel->icon), panel->quarter[1], gc, panel->icon->width/2, 0, panel->icon->width/2, panel->icon->height/2, 0, 0);
nicon = WMCreatePixmapFromXPixmaps(scr, panel->quarter[1], WMGetPixmapMaskXID(panel->icon),
panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
WMSetLabelImage(panel->icornerL, nicon);
WMReleasePixmap(nicon);
}
panel->hcactionsT[1] = WMCreateTextField(panel->hcactionsF);
WMResizeWidget(panel->hcactionsT[1], 180, 20);
WMMoveWidget(panel->hcactionsT[1], 50, 50);
panel->icornerL = WMCreateLabel(panel->hcactionsF);
WMResizeWidget(panel->icornerL, 24, 24);
WMMoveWidget(panel->icornerL, 10, 78);
WMSetLabelImagePosition(panel->icornerL, WIPImageOnly);
if (panel->icon)
{
WMPixmap *nicon;
panel->quarter[2] = XCreatePixmap(scr->display, WMWidgetXID(panel->parent), panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
XCopyArea(scr->display, WMGetPixmapXID(panel->icon), panel->quarter[2], gc, 0, panel->icon->height/2, panel->icon->width/2, panel->icon->height/2, 0, 0);
nicon = WMCreatePixmapFromXPixmaps(scr, panel->quarter[2], WMGetPixmapMaskXID(panel->icon),
panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
WMSetLabelImage(panel->icornerL, nicon);
WMReleasePixmap(nicon);
}
panel->hcactionsT[2] = WMCreateTextField(panel->hcactionsF);
WMResizeWidget(panel->hcactionsT[2], 180, 20);
WMMoveWidget(panel->hcactionsT[2], 50, 80);
panel->icornerL = WMCreateLabel(panel->hcactionsF);
WMResizeWidget(panel->icornerL, 24, 24);
WMMoveWidget(panel->icornerL, 10, 108);
WMSetLabelImagePosition(panel->icornerL, WIPImageOnly);
if (panel->icon)
{
WMPixmap *nicon;
panel->quarter[3] = XCreatePixmap(scr->display, WMWidgetXID(panel->parent), panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
XCopyArea(scr->display, WMGetPixmapXID(panel->icon), panel->quarter[3], gc, panel->icon->width/2, panel->icon->height/2, panel->icon->width/2, panel->icon->height/2, 0, 0);
nicon = WMCreatePixmapFromXPixmaps(scr, panel->quarter[3], WMGetPixmapMaskXID(panel->icon),
panel->icon->width/2, panel->icon->height/2, WMScreenDepth(scr));
WMSetLabelImage(panel->icornerL, nicon);
WMReleasePixmap(nicon);
}
panel->hcactionsT[3] = WMCreateTextField(panel->hcactionsF);
WMResizeWidget(panel->hcactionsT[3], 180, 20);
WMMoveWidget(panel->hcactionsT[3], 50, 107);
WMMapSubwidgets(panel->hcactionsF);
if (xis)
RReleaseImage(xis);
XFreeGC(scr->display, gc);
WMRealizeWidget(panel->box);
WMMapSubwidgets(panel->box);
showData(panel);
}
static void prepareForClose(_Panel *panel)
{
int i;
WMScreen *scr = WMWidgetScreen(panel->parent);
WMReleasePixmap(panel->icon);
for (i = 0; i < sizeof(panel->quarter) / sizeof(Pixmap); i++)
XFreePixmap(scr->display, panel->quarter[i]);
}
Panel *InitHotCornerShortcuts(WMWidget *parent)
{
_Panel *panel;
panel = wmalloc(sizeof(_Panel));
panel->sectionName = _("Hot Corner Shortcut Preferences");
panel->description = _("Choose actions to perform when you move the\n"
"mouse pointer to the screen corners.");
panel->parent = parent;
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeData;
panel->callbacks.prepareForClose = prepareForClose;
AddSection(panel, ICON_FILE);
return panel;
}
+61 -33
View File
@@ -60,6 +60,8 @@ typedef struct _Panel {
CallbackRec callbacks;
Bool have_legacy_apercu;
WMWidget *parent;
WMFrame *posF;
@@ -73,13 +75,12 @@ typedef struct _Panel {
WMButton *posB[wlengthof_nocheck(icon_position_dbvalue)];
WMFrame *animF;
WMPopUpButton *animP;
WMButton *animB[wlengthof_nocheck(icon_animation)];
WMFrame *optF;
WMButton *arrB;
WMButton *omnB;
WMButton *sclB;
WMButton *marginB;
struct {
WMFrame *frame;
@@ -174,7 +175,6 @@ static void showData(_Panel * panel)
WMSetButtonSelected(panel->arrB, GetBoolForKey("AutoArrangeIcons"));
WMSetButtonSelected(panel->omnB, GetBoolForKey("StickyIcons"));
WMSetButtonSelected(panel->sclB, GetBoolForKey("SingleClickLaunch"));
WMSetButtonSelected(panel->marginB, GetBoolForKey("EnforceIconMargin"));
str = GetStringForKey("IconPosition");
if (str != NULL) {
@@ -195,12 +195,20 @@ static void showData(_Panel * panel)
if (i < 0)
i = 0;
else if (i > 29)
i = 29;
else if (i > 9)
i = 9;
WMSetPopUpButtonSelectedItem(panel->sizeP, i);
/* Mini-Previews for Icons */
/*
* Backward Compatibility:
* These settings changed names after 0.95.6, so to avoid breaking user's
* config we still support the old names, and silently convert them to the
* new settings
* This hack should be kept for at least 2 years, that means >= 2017.
*/
panel->have_legacy_apercu = False;
str = GetStringForKey("MiniwindowPreviewBalloons");
if (str != NULL) {
/* New names found, use them in priority */
@@ -212,6 +220,25 @@ static void showData(_Panel * panel)
} else {
i = minipreview_minimum_size;
}
} else {
/* No new names, try the legacy names */
b = GetBoolForKey("MiniwindowApercuBalloons");
if (b) {
panel->have_legacy_apercu = True;
i = GetIntegerForKey("ApercuSize");
/*
* In the beginning, the option was coded as a multiple of the icon
* size; then it was converted to pixel size
*/
if (i < 24)
i *= GetIntegerForKey("IconSize");
if (i <= minipreview_minimum_size)
i = minipreview_minimum_size + 1; /* +1 to not display as "off" */
} else {
i = minipreview_minimum_size;
}
}
WMSetSliderValue(panel->minipreview.slider, i);
minipreview_slider_changed(panel->minipreview.slider, panel);
@@ -221,7 +248,7 @@ static void showData(_Panel * panel)
if (str != NULL) {
for (i = 0; i < wlengthof(icon_animation); i++) {
if (strcasecmp(str, icon_animation[i].db_value) == 0) {
WMSetPopUpButtonSelectedItem(panel->animP, i);
WMPerformButtonClick(panel->animB[i]);
goto found_animation_value;
}
}
@@ -229,7 +256,7 @@ static void showData(_Panel * panel)
str, icon_animation[0].db_value);
}
/* If we're here, no valid value have been found so we fall-back to the default */
WMSetPopUpButtonSelectedItem(panel->animP, 0);
WMPerformButtonClick(panel->animB[0]);
found_animation_value:
;
}
@@ -339,7 +366,7 @@ static void createPanel(Panel * p)
panel->sizeP = WMCreatePopUpButton(panel->sizeF);
WMResizeWidget(panel->sizeP, 80, 20);
WMMoveWidget(panel->sizeP, 10, 19);
for (i = 24; i <= 256; i += 8) {
for (i = 24; i <= 96; i += 8) {
sprintf(buf, "%ix%i", i, i);
WMAddPopUpButtonItem(panel->sizeP, buf);
}
@@ -372,57 +399,50 @@ static void createPanel(Panel * p)
/***************** Animation ****************/
panel->animF = WMCreateFrame(panel->box);
WMResizeWidget(panel->animF, 215, 52);
WMResizeWidget(panel->animF, 215, 110);
WMMoveWidget(panel->animF, 292, 6);
WMSetFrameTitle(panel->animF, _("Iconification Animation"));
panel->animP = WMCreatePopUpButton(panel->animF);
WMResizeWidget(panel->animP, 195, 20);
WMMoveWidget(panel->animP, 10, 19);
for (i = 0; i < wlengthof(icon_animation); i++)
WMAddPopUpButtonItem(panel->animP, _(icon_animation[i].label));
for (i = 0; i < wlengthof(icon_animation); i++) {
panel->animB[i] = WMCreateRadioButton(panel->animF);
WMResizeWidget(panel->animB[i], 192, 20);
WMMoveWidget(panel->animB[i], 12, 16 + i * 22);
if (i > 0)
WMGroupButtons(panel->animB[0], panel->animB[i]);
WMSetButtonText(panel->animB[i], _(icon_animation[i].label));
}
WMMapSubwidgets(panel->animF);
/***************** Options ****************/
panel->optF = WMCreateFrame(panel->box);
WMResizeWidget(panel->optF, 215, 148);
WMMoveWidget(panel->optF, 292, 72);
WMResizeWidget(panel->optF, 215, 90);
WMMoveWidget(panel->optF, 292, 130);
/* WMSetFrameTitle(panel->optF, _("Icon Display")); */
starty = 8 + 14; /* the last term centers the checkboxes within the panel; subtract 13 for a new option */
panel->arrB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->arrB, 198, 26);
WMMoveWidget(panel->arrB, 12, starty);
starty += 26;
WMMoveWidget(panel->arrB, 12, 8);
WMSetButtonText(panel->arrB, _("Auto-arrange icons"));
WMSetBalloonTextForView(_("Keep icons and miniwindows arranged all the time."), WMWidgetView(panel->arrB));
panel->omnB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->omnB, 198, 26);
WMMoveWidget(panel->omnB, 12, starty);
starty += 26;
WMMoveWidget(panel->omnB, 12, 34);
WMSetButtonText(panel->omnB, _("Omnipresent miniwindows"));
WMSetBalloonTextForView(_("Make miniwindows be present in all workspaces."), WMWidgetView(panel->omnB));
panel->sclB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->sclB, 198, 26);
WMMoveWidget(panel->sclB, 12, starty);
starty += 26;
WMMoveWidget(panel->sclB, 12, 60);
WMSetButtonText(panel->sclB, _("Single click activation"));
WMSetBalloonTextForView(_("Launch applications and restore windows with a single click."), WMWidgetView(panel->sclB));
panel->marginB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->marginB, 198, 26);
WMMoveWidget(panel->marginB, 12, starty);
starty += 26;
WMSetButtonText(panel->marginB, _("Enforce icon margin"));
WMSetBalloonTextForView(_("Make sure that the icon image does not protrude into the icon frame."), WMWidgetView(panel->marginB));
WMMapSubwidgets(panel->optF);
WMRealizeWidget(panel->box);
@@ -438,7 +458,6 @@ static void storeData(_Panel * panel)
SetBoolForKey(WMGetButtonSelected(panel->arrB), "AutoArrangeIcons");
SetBoolForKey(WMGetButtonSelected(panel->omnB), "StickyIcons");
SetBoolForKey(WMGetButtonSelected(panel->sclB), "SingleClickLaunch");
SetBoolForKey(WMGetButtonSelected(panel->marginB), "EnforceIconMargin");
SetIntegerForKey(WMGetPopUpButtonSelectedItem(panel->sizeP) * 8 + 24, "IconSize");
@@ -459,8 +478,17 @@ static void storeData(_Panel * panel)
}
SetIntegerForKey(i, "MiniPreviewSize");
}
if (panel->have_legacy_apercu) {
RemoveObjectForKey("MiniwindowApercuBalloons");
RemoveObjectForKey("ApercuSize");
}
SetStringForKey(icon_animation[WMGetPopUpButtonSelectedItem(panel->animP)].db_value, "IconificationStyle");
for (i = 0; i < wlengthof(icon_animation); i++) {
if (WMGetButtonSelected(panel->animB[i])) {
SetStringForKey(icon_animation[i].db_value, "IconificationStyle");
break;
}
}
}
Panel *InitIcons(WMWidget *parent)
+50 -182
View File
@@ -23,8 +23,6 @@
#include "WPrefs.h"
#include <ctype.h>
#include <sys/select.h>
#include <sys/time.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>
@@ -67,7 +65,7 @@ typedef struct _Panel {
* First parameter is the internal keyword known by WMaker
* Second is the text displayed to the user
*/
static struct keyOption {
static const struct {
const char *key;
const char *title;
} keyOptions[] = {
@@ -86,14 +84,11 @@ static struct keyOption {
{ "RHMaximizeKey", N_("Maximize active window right half") },
{ "THMaximizeKey", N_("Maximize active window top half") },
{ "BHMaximizeKey", N_("Maximize active window bottom half") },
{ "TLCMaximizeKey", N_("Maximize active window top left corner") },
{ "TRCMaximizeKey", N_("Maximize active window top right corner") },
{ "BLCMaximizeKey", N_("Maximize active window bottom left corner") },
{ "BRCMaximizeKey", N_("Maximize active window bottom right corner") },
{ "MaximusKey", N_("Tile active window") },
{ "CenterKey", N_("Center active window") },
{ "KeepOnTopKey", N_("Toggle window on top status") },
{ "KeepAtBottomKey",N_("Toggle window at bottom status") },
{ "LTCMaximizeKey", N_("Maximize active window left top corner") },
{ "RTCMaximizeKey", N_("Maximize active window right top corner") },
{ "LBCMaximizeKey", N_("Maximize active window left bottom corner") },
{ "RBCMaximizeKey", N_("Maximize active window right bottom corner") },
{ "MaximusKey", N_("Maximus: Tiled maximization ") },
{ "OmnipresentKey", N_("Toggle window omnipresent status") },
{ "RaiseKey", N_("Raise active window") },
{ "LowerKey", N_("Lower active window") },
@@ -151,20 +146,12 @@ static struct keyOption {
{ "WindowShortcut9Key", N_("Shortcut for window 9") },
{ "WindowShortcut10Key", N_("Shortcut for window 10") },
/* Head Selection */
{ "MoveTo12to6Head", N_("Move to right/bottom/left/top head") },
{ "MoveTo6to12Head", N_("Move to left/top/right/bottom head") },
/* Misc. */
{ "WindowRelaunchKey", N_("Launch new instance of application") },
{ "ScreenSwitchKey", N_("Switch to next screen/monitor") },
{ "ScreenSwitchKey", N_("Switch to Next Screen/Monitor") },
{ "RunKey", N_("Run application") },
{ "ExitKey", N_("Exit Window Maker") },
{ "DockRaiseLowerKey", N_("Raise/Lower Dock") },
{ "ClipRaiseLowerKey", N_("Raise/Lower Clip") },
{ "ScreenCaptureKey", N_("Capture the entire screen") },
{ "WindowCaptureKey", N_("Capture a window") },
{ "PartialCaptureKey", N_("Capture a portion of the screen") }
{ "ClipRaiseLowerKey", N_("Raise/Lower Clip") }
#ifdef XKB_MODELOCK
,{ "ToggleKbdModeKey", N_("Toggle keyboard language") }
#endif /* XKB_MODELOCK */
@@ -309,61 +296,25 @@ static int NumLockMask(Display *dpy)
return mask;
}
/* Append the modifier prefix and key name to the keybuf */
static void build_key_combo(unsigned int xkstate, const char *keyname,
unsigned int numlock_mask, char keybuf[64])
{
if (xkstate & ControlMask)
strcat(keybuf, "Control+");
if (xkstate & ShiftMask)
strcat(keybuf, "Shift+");
if ((numlock_mask != Mod1Mask) && (xkstate & Mod1Mask))
strcat(keybuf, "Mod1+");
if ((numlock_mask != Mod2Mask) && (xkstate & Mod2Mask))
strcat(keybuf, "Mod2+");
if ((numlock_mask != Mod3Mask) && (xkstate & Mod3Mask))
strcat(keybuf, "Mod3+");
if ((numlock_mask != Mod4Mask) && (xkstate & Mod4Mask))
strcat(keybuf, "Mod4+");
if ((numlock_mask != Mod5Mask) && (xkstate & Mod5Mask))
strcat(keybuf, "Mod5+");
wstrlcat(keybuf, keyname, 64);
}
/*
* Interactively capture a key shortcut or keychain,
* function waits KeychainTimeoutDelay or 300 ms after
* each key press for another key in the chain,
* and returns the full key specification string.
*/
char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
{
XEvent ev;
KeySym ksym, lksym, uksym;
/* Large enough for several chained chords */
char buffer[512];
char keybuf[64];
char *key;
char buffer[64];
char *key = NULL;
unsigned int numlock_mask;
Bool have_key = False;
Bool chain_mode;
int timeout_ms;
timeout_ms = GetIntegerForKey("KeychainTimeoutDelay");
if (timeout_ms <= 0)
timeout_ms = 300;
buffer[0] = '\0';
/* ---- Phase 1: capture the first key (blocking) ---- */
while (*capturing) {
XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
numlock_mask = NumLockMask(dpy);
/* conditional mask check to get numeric keypad keys */
ksym = W_KeycodeToKeysym(dpy, ev.xkey.keycode, ev.xkey.state & numlock_mask?1:0);
if (xext_xkb_supported)
/* conditional mask check to get numeric keypad keys */
ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, ev.xkey.state & numlock_mask?1:0);
else
ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
if (!IsModifierKey(ksym)) {
if (convert_case) {
@@ -373,95 +324,44 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
key = XKeysymToString(ksym);
}
keybuf[0] = '\0';
build_key_combo(ev.xkey.state, key, numlock_mask, keybuf);
wstrlcat(buffer, keybuf, sizeof(buffer));
have_key = True;
*capturing = 0;
break;
}
}
WMHandleEvent(&ev);
}
/* ---- Phase 2: collect additional chain keys with timeout ---- */
chain_mode = (timeout_ms > 0);
while (*capturing && chain_mode) {
int xfd = ConnectionNumber(dpy);
fd_set rfds;
struct timeval tv;
if (!XPending(dpy)) {
FD_ZERO(&rfds);
FD_SET(xfd, &rfds);
tv.tv_sec = timeout_ms / 1000;
tv.tv_usec = (timeout_ms % 1000) * 1000;
XFlush(dpy);
if (select(xfd + 1, &rfds, NULL, NULL, &tv) == 0)
break; /* timeout: the chain is complete */
}
XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
WMNextEvent(dpy, &ev);
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
numlock_mask = NumLockMask(dpy);
ksym = W_KeycodeToKeysym(dpy, ev.xkey.keycode,
ev.xkey.state & numlock_mask ? 1 : 0);
if (!IsModifierKey(ksym)) {
if (convert_case) {
XConvertCase(ksym, &lksym, &uksym);
key = XKeysymToString(uksym);
} else {
key = XKeysymToString(ksym);
}
keybuf[0] = '\0';
build_key_combo(ev.xkey.state, key, numlock_mask, keybuf);
wstrlcat(buffer, " ", sizeof(buffer));
wstrlcat(buffer, keybuf, sizeof(buffer));
}
} else {
WMHandleEvent(&ev);
}
}
if (!have_key || !*capturing)
if (!key)
return NULL;
*capturing = 0;
buffer[0] = 0;
if (ev.xkey.state & ControlMask)
strcat(buffer, "Control+");
if (ev.xkey.state & ShiftMask)
strcat(buffer, "Shift+");
if ((numlock_mask != Mod1Mask) && (ev.xkey.state & Mod1Mask))
strcat(buffer, "Mod1+");
if ((numlock_mask != Mod2Mask) && (ev.xkey.state & Mod2Mask))
strcat(buffer, "Mod2+");
if ((numlock_mask != Mod3Mask) && (ev.xkey.state & Mod3Mask))
strcat(buffer, "Mod3+");
if ((numlock_mask != Mod4Mask) && (ev.xkey.state & Mod4Mask))
strcat(buffer, "Mod4+");
if ((numlock_mask != Mod5Mask) && (ev.xkey.state & Mod5Mask))
strcat(buffer, "Mod5+");
wstrlcat(buffer, key, sizeof(buffer));
return wstrdup(buffer);
}
/*
* check if the keystr entered is already set to another action
* if found it returns the position in the keyOptions
*/
static int isKeySet(_Panel *panel, char *keystr)
{
int i;
char *str;
for (i = 0; i < panel->actionCount; i++) {
str = NULL;
if (panel->shortcuts[i]) {
str = wtrimspace(panel->shortcuts[i]);
if (strlen(str) == 0) {
wfree(str);
str = NULL;
}
}
if (str) {
if (strcmp(keystr, str) == 0) {
wfree(str);
return i;
}
wfree(str);
}
}
return -1;
}
static void captureClick(WMWidget * w, void *data)
{
_Panel *panel = (_Panel *) data;
@@ -476,37 +376,23 @@ static void captureClick(WMWidget * w, void *data)
XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, GrabModeAsync, GrabModeAsync, CurrentTime);
shortcut = capture_shortcut(dpy, &panel->capturing, 1);
if (shortcut) {
int key_idx = -1;
int row = WMGetListSelectedItemRow(panel->actLs);
key_idx = isKeySet(panel, shortcut);
if (key_idx >= 0 && (key_idx != row)) {
char *msg;
WMSetTextFieldText(panel->shoT, shortcut);
if (row >= 0) {
if (panel->shortcuts[row])
wfree(panel->shortcuts[row]);
panel->shortcuts[row] = shortcut;
msg = wstrconcat(_("Key shortcut already in use by the "), _(keyOptions[key_idx].title));
WMRunAlertPanel(WMWidgetScreen(w), GetWindow(),
_("Error"),
msg,
_("OK"), NULL, NULL);
wfree(msg);
wfree(shortcut);
WMRedisplayWidget(panel->actLs);
} else {
WMSetTextFieldText(panel->shoT, shortcut);
if (row >= 0) {
if (panel->shortcuts[row])
wfree(panel->shortcuts[row]);
panel->shortcuts[row] = shortcut;
WMRedisplayWidget(panel->actLs);
} else {
wfree(shortcut);
}
wfree(shortcut);
}
}
}
panel->capturing = 0;
WMSetButtonText(w, _("Capture"));
WMSetLabelText(panel->instructionsL, _("Click on Capture to interactively define the shortcut key(s)."));
WMSetLabelText(panel->instructionsL, _("Click on Capture to interactively define the shortcut key."));
XUngrabKeyboard(dpy, CurrentTime);
}
@@ -518,9 +404,6 @@ static void clearShortcut(WMWidget * w, void *data)
/* Parameter not used, but tell the compiler that it is ok */
(void) w;
/* Cancel any ongoing capture so the keychain loop is unblocked */
panel->capturing = 0;
WMSetTextFieldText(panel->shoT, NULL);
if (row >= 0) {
@@ -610,20 +493,6 @@ static void paintItem(WMList * lPtr, int index, Drawable d, char *text, int stat
WMDrawString(scr, d, panel->black, panel->font, x + 20, y, text, strlen(text));
}
static int cmpKeyOptions(const void *v1, const void *v2)
{
int rc;
const struct keyOption *opt1 = (struct keyOption *)v1;
const struct keyOption *opt2 = (struct keyOption *)v2;
if ((rc = strncmp(opt1->title, opt2->title, 20)) < 0)
return -1;
else if (rc > 0)
return 1;
return 0;
}
static void createPanel(Panel * p)
{
_Panel *panel = (_Panel *) p;
@@ -663,7 +532,6 @@ static void createPanel(Panel * p)
WMSetListUserDrawProc(panel->actLs, paintItem);
WMHangData(panel->actLs, panel);
qsort(keyOptions, wlengthof(keyOptions), sizeof(keyOptions[0]), cmpKeyOptions);
for (i = 0; i < wlengthof(keyOptions); i++) {
WMAddListItem(panel->actLs, _(keyOptions[i].title));
}
+3 -16
View File
@@ -10,20 +10,9 @@ wpdatadir = @wprefs_datadir@
wpdata_DATA = WPrefs.tiff WPrefs.xpm
applicationsdir = @datadir@/applications
applications_DATA = WPrefs.desktop
WPrefs.desktop: WPrefs.desktop.in
$(AM_V_GEN)sed -e "s:#wprefs_bindir#:${wprefs_bindir}:" \
-e "s:#wprefs_datadir#:${wprefs_datadir}:" $< > $@
EXTRA_DIST = $(wpdata_DATA) \
KeyboardSettings.c \
Themes.c \
WPrefs.desktop.in
DISTCLEANFILES = WPrefs.desktop
Themes.c
WPrefs_SOURCES = \
main.c \
@@ -35,7 +24,6 @@ WPrefs_SOURCES = \
Expert.c \
Focus.c \
FontSimple.c \
HotCornerShortcuts.c \
Icons.c \
KeyboardShortcuts.c \
Menu.c \
@@ -57,11 +45,10 @@ WPrefs_SOURCES = \
# KeyboardSettings.c \
# Themes.c
AM_CFLAGS = @PANGO_CFLAGS@
AM_CFLAGS =
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \
-I$(top_builddir)/wrlib -I$(top_srcdir)/WINGs -I$(top_builddir)/WINGs \
@HEADER_SEARCH_PATH@
-I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@
WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
+20 -81
View File
@@ -22,7 +22,6 @@
#include "WPrefs.h"
#include <assert.h>
#include <ctype.h>
#include <unistd.h>
#include <X11/keysym.h>
#include <X11/cursorfont.h>
@@ -291,8 +290,6 @@ static void changedItemPad(WMWidget * w, void *data)
_Panel *panel = (_Panel *) data;
int padn = WMGetPopUpButtonSelectedItem(w);
if (padn < 0)
return;
WMUnmapWidget(panel->itemPad[panel->currentPad]);
WMMapWidget(panel->itemPad[padn]);
@@ -509,7 +506,7 @@ static void createPanel(_Panel * p)
WMSetScrollViewContentView(sview, WMWidgetView(pad));
data = putNewItem(panel, pad, ExternalInfo, _("Debian Menu"));
data->param.pipe.command = "/etc/" GSUSER_SUBDIR "/" DEFAULTS_SUBDIR "/menu.hook";
data->param.pipe.command = "/etc/X11/WindowMaker/menu.hook";
data = putNewItem(panel, pad, PipeInfo, _("RedHat Menu"));
data->param.pipe.command = "wmconfig --output wmaker";
@@ -520,25 +517,19 @@ static void createPanel(_Panel * p)
data = putNewItem(panel, pad, DirectoryInfo, _("Themes"));
data->param.directory.command = "setstyle";
data->param.directory.directory =
"/usr/share/" PACKAGE_TARNAME "/Themes"
" /usr/local/share/" PACKAGE_TARNAME "/Themes"
" $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Themes";
"/usr/share/WindowMaker/Themes /usr/local/share/WindowMaker/Themes $HOME/GNUstep/Library/WindowMaker/Themes";
data->param.directory.stripExt = 1;
data = putNewItem(panel, pad, DirectoryInfo, _("Bg Images (scale)"));
data->param.directory.command = "wmsetbg -u -s";
data->param.directory.directory =
"/opt/kde2/share/wallpapers"
" /usr/share/" PACKAGE_TARNAME "/Backgrounds"
" $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Backgrounds";
"/opt/kde2/share/wallpapers /usr/share/WindowMaker/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds";
data->param.directory.stripExt = 1;
data = putNewItem(panel, pad, DirectoryInfo, _("Bg Images (tile)"));
data->param.directory.command = "wmsetbg -u -t";
data->param.directory.directory =
"/opt/kde2/share/wallpapers"
" /usr/share/" PACKAGE_TARNAME "/Backgrounds"
" $HOME/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Backgrounds";
"/opt/kde2/share/wallpapers /usr/share/WindowMaker/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds";
data->param.directory.stripExt = 1;
smenu = putNewSubmenu(pad, _("Assorted XTerms"));
@@ -622,13 +613,12 @@ static void createPanel(_Panel * p)
WMAddNotificationObserver(dataChanged, panel, WMTextDidChangeNotification, panel->pathT);
label = WMCreateLabel(panel->pathF);
WMResizeWidget(label, width - 20, 90);
WMResizeWidget(label, width - 20, 80);
WMMoveWidget(label, 10, 50);
WMSetLabelText(label, _("Enter the path for a file containing a menu\n"
"or a list of directories with the programs you\n"
"want to have listed in the menu. Ex:\n"
"~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/menu\n"
"or\n" "/usr/bin ~/xbin"));
"~/GNUstep/Library/WindowMaker/menu\n" "or\n" "/usr/bin ~/xbin"));
WMMapSubwidgets(panel->pathF);
@@ -923,11 +913,6 @@ static ItemData *parseCommand(WMPropList * item)
data->type = ExecInfo;
if (parameter == NULL) {
wfree(data);
return NULL;
}
data->param.exec.command = wstrdup(parameter);
if (shortcut)
data->param.exec.shortcut = wstrdup(shortcut);
@@ -940,12 +925,6 @@ static ItemData *parseCommand(WMPropList * item)
* |pipe
*/
p = parameter;
if (p == NULL) {
wfree(data);
return NULL;
}
while (isspace(*p) && *p)
p++;
if (*p == '|') {
@@ -1456,12 +1435,12 @@ static WEditMenu *buildSubmenu(_Panel * panel, WMPropList * pl)
WSetEditMenuItemImage(item, panel->markerPix[data->type]);
WSetEditMenuItemData(item, data, (WMCallback *) freeItemData);
} else {
char buf[256];
snprintf(buf, sizeof(buf), _("Invalid menu command \"%s\" with label \"%s\" cleared"),
char *buf = wmalloc(1024);
snprintf(buf, 1024, _("Invalid menu command \"%s\" with label \"%s\" cleared"),
WMGetFromPLString(WMGetFromPLArray(pi, 1)),
WMGetFromPLString(WMGetFromPLArray(pi, 0)));
WMRunAlertPanel(scr, panel->parent, _("Warning"), buf, _("OK"), NULL, NULL);
wfree(buf);
}
}
@@ -1502,53 +1481,18 @@ static WMPropList *getDefaultMenu(_Panel * panel)
static void showData(_Panel * panel)
{
char *menuPath, *labelText;
char buf[1024];
const char *gspath;
char *menuPath;
WMPropList *pmenu;
menuPath = wdefaultspathfordomain("WMRootMenu");
gspath = wusergnusteppath();
menuPath = wmalloc(strlen(gspath) + 32);
strcpy(menuPath, gspath);
strcat(menuPath, "/Defaults/WMRootMenu");
pmenu = WMReadPropListFromFile(menuPath);
/* check if WMRootMenu references another file, and if so,
if that file is in proplist format */
while (WMIsPLString(pmenu)) {
char *path = NULL;
path = wexpandpath(WMGetFromPLString(pmenu));
if (access(path, F_OK) < 0) {
char *old_path = path;
path = wfindfile(DEF_CONFIG_PATHS, path);
wfree(old_path);
}
/* TODO: if needed, concatenate locale suffix to path.
See getLocalizedMenuFile() in src/rootmenu.c. */
if (!path)
break;
if (access(path, W_OK) < 0) {
snprintf(buf, sizeof(buf),
_("The menu file \"%s\" referenced by "
"WMRootMenu is read-only.\n"
"You cannot use WPrefs to modify it."),
path);
WMRunAlertPanel(WMWidgetScreen(panel->parent),
panel->parent,
_("Warning"), buf,
_("OK"), NULL, NULL);
panel->dontSave = True;
wfree(path);
return;
}
pmenu = WMReadPropListFromFile(path);
menuPath = path;
}
if (!pmenu || !WMIsPLArray(pmenu)) {
int res;
@@ -1573,14 +1517,6 @@ static void showData(_Panel * panel)
panel->menuPath = menuPath;
snprintf(buf, sizeof(buf),
_("\n\nWhen saved, the menu will be written to the file\n\"%s\"."),
menuPath);
labelText = WMGetLabelText(panel->sections[NoInfo][0]);
labelText = wstrconcat(labelText, buf);
WMSetLabelText(panel->sections[NoInfo][0], labelText);
wfree(labelText);
buildMenuFromPL(panel, pmenu);
WMReleasePropList(pmenu);
@@ -1621,12 +1557,15 @@ static WMPropList *processData(const char *title, ItemData * data)
case ExecInfo:
if (data->param.exec.command == NULL)
goto return_null;
#if 1
if (strpbrk(data->param.exec.command, "&$*|><?`=;")) {
s1 = "SHEXEC";
} else {
s1 = "EXEC";
}
#else
s1 = "SHEXEC";
#endif
if (notblank(data->param.exec.shortcut)) {
WMAddToPLArray(item, pscut);
+6 -5
View File
@@ -381,7 +381,10 @@ static void fillModifierPopUp(WMPopUpButton * pop)
if (mapping->modifiermap[idx] != 0) {
int l;
for (l = 0; l < 4; l++) {
ksym = W_KeycodeToKeysym(dpy, mapping->modifiermap[idx], l);
if (xext_xkb_supported)
ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
else
ksym = XKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0);
if (ksym != NoSymbol)
break;
}
@@ -647,7 +650,7 @@ static void storeCommandInScript(const char *cmd, const char *line)
umask(permissions);
permissions = (S_IRWXU | S_IRWXG | S_IRWXO) & (~permissions);
path = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME "/autostart");
path = wstrconcat(wusergnusteppath(), "/Library/WindowMaker/autostart");
f = fopen(path, "rb");
if (!f) {
@@ -665,7 +668,7 @@ static void storeCommandInScript(const char *cmd, const char *line)
char *tmppath;
FILE *fo;
tmppath = wstrconcat(wuserdatapath(), "/" PACKAGE_TARNAME "/autostart.tmp");
tmppath = wstrconcat(wusergnusteppath(), "/Library/WindowMaker/autostart.tmp");
fo = fopen(tmppath, "wb");
if (!fo) {
werror(_("could not create temporary file %s"), tmppath);
@@ -748,8 +751,6 @@ static void storeData(_Panel * panel)
int action;
action = WMGetPopUpButtonSelectedItem(panel->mouse_action[i].popup);
if (action < 0)
continue;
if (button_list[i].type == T_BUTTON)
db_value = button_actions[action].db_value;
else
+6 -6
View File
@@ -77,11 +77,11 @@ static void showData(_Panel * panel)
if (array)
wwarning(_("bad value in option IconPath. Using default path list"));
addPathToList(panel->icoL, -1, "~/pixmaps");
addPathToList(panel->icoL, -1, "~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/Icons");
addPathToList(panel->icoL, -1, "~/GNUstep/Library/Icons");
addPathToList(panel->icoL, -1, "/usr/include/X11/pixmaps");
addPathToList(panel->icoL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Icons");
addPathToList(panel->icoL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Pixmaps");
addPathToList(panel->icoL, -1, "/usr/share/" PACKAGE_TARNAME "/Icons");
addPathToList(panel->icoL, -1, "/usr/local/share/WindowMaker/Icons");
addPathToList(panel->icoL, -1, "/usr/local/share/WindowMaker/Pixmaps");
addPathToList(panel->icoL, -1, "/usr/share/WindowMaker/Icons");
} else {
for (i = 0; i < WMGetPropListItemCount(array); i++) {
val = WMGetFromPLArray(array, i);
@@ -94,8 +94,8 @@ static void showData(_Panel * panel)
if (array)
wwarning(_("bad value in option PixmapPath. Using default path list"));
addPathToList(panel->pixL, -1, "~/pixmaps");
addPathToList(panel->pixL, -1, "~/" GSUSER_SUBDIR "/" USERDATA_SUBDIR "/" PACKAGE_TARNAME "/Pixmaps");
addPathToList(panel->pixL, -1, "/usr/local/share/" PACKAGE_TARNAME "/Pixmaps");
addPathToList(panel->pixL, -1, "~/GNUstep/Library/WindowMaker/Pixmaps");
addPathToList(panel->pixL, -1, "/usr/local/share/WindowMaker/Pixmaps");
} else {
for (i = 0; i < WMGetPropListItemCount(array); i++) {
val = WMGetFromPLArray(array, i);
+3 -7
View File
@@ -196,13 +196,9 @@ static void storeData(_Panel * panel)
int i;
i = WMGetPopUpButtonSelectedItem(panel->sizeP);
if (i < 0)
return;
SetStringForKey(resize_display[i].db_value, "ResizeDisplay");
i = WMGetPopUpButtonSelectedItem(panel->posiP);
if (i < 0)
return;
SetStringForKey(move_display[i].db_value, "MoveDisplay");
lr = WMGetButtonSelected(panel->lrB);
@@ -284,14 +280,14 @@ static void createPanel(Panel * p)
/***************** Options ****************/
panel->optF = WMCreateFrame(panel->box);
WMResizeWidget(panel->optF, 255, 96);
WMResizeWidget(panel->optF, 255, 94);
WMMoveWidget(panel->optF, 15, 125);
WMSetFrameTitle(panel->optF, _("AppIcon bouncing"));
for (i = 0; i < wlengthof(appicon_bouncing); i++) {
panel->bounceB[i] = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->bounceB[i], 237, 26);
WMMoveWidget(panel->bounceB[i], 9, 16 + i * 26);
WMMoveWidget(panel->bounceB[i], 9, 14 + i * 25);
WMSetButtonText(panel->bounceB[i], _(appicon_bouncing[i].label));
if (appicon_bouncing[i].default_value)
@@ -306,7 +302,7 @@ static void createPanel(Panel * p)
/***************** Workspace border ****************/
panel->borderF = WMCreateFrame(panel->box);
WMResizeWidget(panel->borderF, 220, 77);
WMResizeWidget(panel->borderF, 220, 75);
WMMoveWidget(panel->borderF, 285, 144);
WMSetFrameTitle(panel->borderF, _("Workspace border"));
+3 -3
View File
@@ -7,7 +7,7 @@
WPrefs.app is the preferences "editor" for the WindowMaker window
manager. It can be used to set most of the preference options of WindowMaker
and define its applications menu. It also can change some settings
and define it's applications menu. It also can change some settings
that do not belong to WindowMaker.
Although WPrefs.app is designed to be easy to use, you should read the
@@ -16,7 +16,7 @@ of WindowMaker that are not related to configuration.
To run WPrefs, do not put it in your search path. Instead, run it
with the full path, like /usr/local/GNUstep/Applications/WPrefs.app/WPrefs
Then, dock its application icon. The dock will automatically detect its
Then, dock it's application icon. The dock will automatically detect it's
icon and use it.
If you change configuration often, you might want to leave WPrefs
@@ -46,7 +46,7 @@ The mouse speed configuration is saved as a call for xset in
~/G/D/L/W/autostart. WindowMaker calls this file when it is started.
If you don't want or can't use the menu definition section, do not
open its section (or if you do open it, do not Save), or WPrefs will
open it's section (or if you do open it, do not Save), or WPrefs will
overwrite your ~/G/D/WMRootMenu file.
Only options that have different values than what is found in the
+81 -81
View File
@@ -117,21 +117,16 @@ typedef struct _TexturePanel {
} _TexturePanel;
enum {
TYPE_SOLID,
TYPE_GRADIENT,
TYPE_SGRADIENT,
TYPE_TGRADIENT,
TYPE_PIXMAP
};
#define TYPE_SOLID 0
#define TYPE_GRADIENT 1
#define TYPE_SGRADIENT 2
#define TYPE_TGRADIENT 3
#define TYPE_PIXMAP 4
enum {
PTYPE_TILE,
PTYPE_SCALE,
PTYPE_CENTER,
PTYPE_MAXIMIZE,
PTYPE_FILL
};
#define PTYPE_TILE 0
#define PTYPE_SCALE 1
#define PTYPE_CENTER 2
#define PTYPE_MAXIMIZE 3
/*
*--------------------------------------------------------------------------
@@ -141,7 +136,7 @@ enum {
/************/
static void updateGradButtons(TexturePanel *panel)
static void updateGradButtons(TexturePanel * panel)
{
RImage *image;
WMPixmap *pixmap;
@@ -185,7 +180,7 @@ static void updateGradButtons(TexturePanel *panel)
}
}
static void updateTGradImage(TexturePanel *panel)
static void updateTGradImage(TexturePanel * panel)
{
RImage *image, *gradient;
WMPixmap *pixmap;
@@ -206,17 +201,19 @@ static void updateTGradImage(TexturePanel *panel)
to.green = WMGreenComponentOfColor(color) >> 8;
to.blue = WMBlueComponentOfColor(color) >> 8;
if (panel->image->width < 141 || panel->image->height < 91)
if (panel->image->width < 141 || panel->image->height < 91) {
image = RMakeTiledImage(panel->image, 141, 91);
else
} else {
image = RCloneImage(panel->image);
}
if (WMGetButtonSelected(panel->dirhB))
if (WMGetButtonSelected(panel->dirhB)) {
gradient = RRenderGradient(image->width, image->height, &from, &to, RHorizontalGradient);
else if (WMGetButtonSelected(panel->dirvB))
} else if (WMGetButtonSelected(panel->dirvB)) {
gradient = RRenderGradient(image->width, image->height, &from, &to, RVerticalGradient);
else
} else {
gradient = RRenderGradient(image->width, image->height, &from, &to, RDiagonalGradient);
}
RCombineImagesWithOpaqueness(image, gradient, WMGetSliderValue(panel->topaS));
RReleaseImage(gradient);
@@ -228,7 +225,7 @@ static void updateTGradImage(TexturePanel *panel)
RReleaseImage(image);
}
static void updateSGradButtons(TexturePanel *panel)
static void updateSGradButtons(TexturePanel * panel)
{
RImage *image;
WMPixmap *pixmap;
@@ -267,7 +264,7 @@ static void updateSGradButtons(TexturePanel *panel)
/*********** Gradient ************/
static void updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
static void updateSVSlider(WMSlider * sPtr, Bool saturation, WMFont * font, RHSVColor * hsv)
{
RImage *image;
WMPixmap *pixmap;
@@ -315,7 +312,7 @@ static void updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVCo
WMReleasePixmap(pixmap);
}
static void updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
static void updateHueSlider(WMSlider * sPtr, WMFont * font, RHSVColor * hsv)
{
RColor *colors[8];
RImage *image;
@@ -356,7 +353,7 @@ static void updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
wfree(colors[i]);
}
static void sliderChangeCallback(WMWidget *w, void *data)
static void sliderChangeCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
RHSVColor hsv;
@@ -420,8 +417,9 @@ static void sliderChangeCallback(WMWidget *w, void *data)
}
colors[i] = NULL;
if (panel->gimage != None)
if (panel->gimage != None) {
XFreePixmap(WMScreenDisplay(scr), panel->gimage);
}
image = RRenderMultiGradient(30, i * WMGetListItemHeight(panel->gcolL), colors, RVerticalGradient);
RConvertImage(WMScreenRContext(scr), image, &panel->gimage);
@@ -434,7 +432,7 @@ static void sliderChangeCallback(WMWidget *w, void *data)
updateGradButtons(panel);
}
static void paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect)
static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text, int state, WMRect * rect)
{
TexturePanel *panel = (TexturePanel *) WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
@@ -467,7 +465,7 @@ static void paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, i
WMReleaseColor(gray);
}
static void gradAddCallback(WMWidget *w, void *data)
static void gradAddCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
WMListItem *item;
@@ -491,7 +489,7 @@ static void gradAddCallback(WMWidget *w, void *data)
WMSetButtonEnabled(panel->okB, WMGetListNumberOfRows(panel->gcolL) > 1);
}
static void gradClickCallback(WMWidget *w, void *data)
static void gradClickCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
WMListItem *item;
@@ -513,7 +511,7 @@ static void gradClickCallback(WMWidget *w, void *data)
sliderChangeCallback(panel->gsatS, panel);
}
static void gradDeleteCallback(WMWidget *w, void *data)
static void gradDeleteCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
WMListItem *item;
@@ -547,7 +545,7 @@ static void gradDeleteCallback(WMWidget *w, void *data)
/*************** Simple Gradient ***************/
static void colorWellObserver(void *self, WMNotification *n)
static void colorWellObserver(void *self, WMNotification * n)
{
/* Parameter not used, but tell the compiler that it is ok */
(void) n;
@@ -555,7 +553,7 @@ static void colorWellObserver(void *self, WMNotification *n)
updateSGradButtons(self);
}
static void opaqChangeCallback(WMWidget *w, void *data)
static void opaqChangeCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
@@ -567,7 +565,7 @@ static void opaqChangeCallback(WMWidget *w, void *data)
/****************** Image ******************/
static void updateImage(TexturePanel *panel, const char *path)
static void updateImage(TexturePanel * panel, const char *path)
{
WMScreen *scr = WMWidgetScreen(panel->win);
RImage *image;
@@ -615,12 +613,12 @@ static void updateImage(TexturePanel *panel, const char *path)
}
}
static void browseImageCallback(WMWidget *w, void *data)
static void browseImageCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
WMOpenPanel *opanel;
WMScreen *scr = WMWidgetScreen(w);
static char *ipath;
static char *ipath = NULL;
opanel = WMGetOpenPanel(scr);
WMSetFilePanelCanChooseDirectories(opanel, False);
@@ -672,24 +670,25 @@ static void browseImageCallback(WMWidget *w, void *data)
}
}
static void buttonCallback(WMWidget *w, void *data)
static void buttonCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
if (w == panel->okB)
if (w == panel->okB) {
(*panel->okAction) (panel->okData);
else
} else {
(*panel->cancelAction) (panel->cancelData);
}
}
static void changeTypeCallback(WMWidget *w, void *data)
static void changeTypeCallback(WMWidget * w, void *data)
{
TexturePanel *panel = (TexturePanel *) data;
int newType;
int i;
newType = WMGetPopUpButtonSelectedItem(w);
if (newType < 0 || newType == panel->currentType)
if (newType == panel->currentType)
return;
if (panel->currentType >= 0) {
@@ -732,7 +731,7 @@ static void changeTypeCallback(WMWidget *w, void *data)
* Public functions
*--------------------------------------------------------------------------
*/
void ShowTexturePanel(TexturePanel *panel)
void ShowTexturePanel(TexturePanel * panel)
{
Display *dpy = WMScreenDisplay(WMWidgetScreen(panel->win));
Screen *scr = DefaultScreenOfDisplay(dpy);
@@ -743,24 +742,24 @@ void ShowTexturePanel(TexturePanel *panel)
WMMapWidget(panel->win);
}
void HideTexturePanel(TexturePanel *panel)
void HideTexturePanel(TexturePanel * panel)
{
WMUnmapWidget(panel->win);
}
void SetTexturePanelOkAction(TexturePanel *panel, WMCallback *action, void *clientData)
void SetTexturePanelOkAction(TexturePanel * panel, WMCallback * action, void *clientData)
{
panel->okAction = action;
panel->okData = clientData;
}
void SetTexturePanelCancelAction(TexturePanel *panel, WMCallback *action, void *clientData)
void SetTexturePanelCancelAction(TexturePanel * panel, WMCallback * action, void *clientData)
{
panel->cancelAction = action;
panel->cancelData = clientData;
}
void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *texture)
void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList * texture)
{
WMScreen *scr = WMWidgetScreen(panel->win);
char *str, *type;
@@ -776,8 +775,9 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
return;
p = WMGetFromPLArray(texture, 0);
if (!p)
if (!p) {
goto bad_texture;
}
type = WMGetFromPLString(p);
/*............................................... */
@@ -786,10 +786,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SOLID);
p = WMGetFromPLArray(texture, 1);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->defcW, color);
@@ -802,10 +803,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SGRADIENT);
p = WMGetFromPLArray(texture, 1);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->tcol1W, color);
@@ -813,10 +815,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMReleaseColor(color);
p = WMGetFromPLArray(texture, 2);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->tcol2W, color);
@@ -843,10 +846,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMSetSliderValue(panel->topaS, i);
p = WMGetFromPLArray(texture, 3);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->tcol1W, color);
@@ -854,10 +858,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMReleaseColor(color);
p = WMGetFromPLArray(texture, 4);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->tcol2W, color);
@@ -868,9 +873,9 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
if (panel->imageFile)
wfree(panel->imageFile);
panel->imageFile = wfindfileinarray(panel->pathList,
WMGetFromPLString(WMGetFromPLArray(texture, 1)));
if (panel->imageFile != NULL) {
if ((panel->imageFile = wfindfileinarray(panel->pathList,
WMGetFromPLString(WMGetFromPLArray(texture, 1)))) !=
NULL) {
panel->image = RLoadImage(WMScreenRContext(scr), panel->imageFile, 0);
updateTGradImage(panel);
@@ -894,10 +899,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_GRADIENT);
p = WMGetFromPLArray(texture, 1);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
color = WMCreateNamedColor(scr, str, False);
WMSetColorWellColor(panel->defcW, color);
@@ -909,10 +915,11 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
XColor xcolor;
p = WMGetFromPLArray(texture, i);
if (!p)
if (!p) {
str = "black";
else
} else {
str = WMGetFromPLString(p);
}
XParseColor(WMScreenDisplay(scr), WMScreenRContext(scr)->cmap, str, &xcolor);
@@ -946,9 +953,6 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
case 'M':
WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_MAXIMIZE);
break;
case 'F':
WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_FILL);
break;
default:
case 'T':
WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_TILE);
@@ -997,13 +1001,13 @@ void SetTexturePanelTexture(TexturePanel *panel, const char *name, WMPropList *t
}
char *GetTexturePanelTextureName(TexturePanel *panel)
char *GetTexturePanelTextureName(TexturePanel * panel)
{
return WMGetTextFieldText(panel->nameT);
}
WMPropList *GetTexturePanelTexture(TexturePanel *panel)
WMPropList *GetTexturePanelTexture(TexturePanel * panel)
{
WMPropList *prop = NULL;
WMColor *color;
@@ -1034,10 +1038,6 @@ WMPropList *GetTexturePanelTexture(TexturePanel *panel)
prop = WMCreatePLArray(WMCreatePLString("mpixmap"),
WMCreatePLString(panel->imageFile), WMCreatePLString(str), NULL);
break;
case PTYPE_FILL:
prop = WMCreatePLArray(WMCreatePLString("fpixmap"),
WMCreatePLString(panel->imageFile), WMCreatePLString(str), NULL);
break;
case PTYPE_CENTER:
prop = WMCreatePLArray(WMCreatePLString("cpixmap"),
WMCreatePLString(panel->imageFile), WMCreatePLString(str), NULL);
@@ -1104,12 +1104,13 @@ WMPropList *GetTexturePanelTexture(TexturePanel *panel)
color = WMGetColorWellColor(panel->defcW);
str = WMGetColorRGBDescription(color);
if (WMGetButtonSelected(panel->dirdB))
if (WMGetButtonSelected(panel->dirdB)) {
prop = WMCreatePLArray(WMCreatePLString("mdgradient"), WMCreatePLString(str), NULL);
else if (WMGetButtonSelected(panel->dirvB))
} else if (WMGetButtonSelected(panel->dirvB)) {
prop = WMCreatePLArray(WMCreatePLString("mvgradient"), WMCreatePLString(str), NULL);
else
} else {
prop = WMCreatePLArray(WMCreatePLString("mhgradient"), WMCreatePLString(str), NULL);
}
wfree(str);
for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {
@@ -1130,12 +1131,12 @@ WMPropList *GetTexturePanelTexture(TexturePanel *panel)
return prop;
}
void SetTexturePanelPixmapPath(TexturePanel *panel, WMPropList *array)
void SetTexturePanelPixmapPath(TexturePanel * panel, WMPropList * array)
{
panel->pathList = array;
}
TexturePanel *CreateTexturePanel(WMWindow *keyWindow)
TexturePanel *CreateTexturePanel(WMWindow * keyWindow)
/*CreateTexturePanel(WMScreen *scr)*/
{
TexturePanel *panel;
@@ -1406,7 +1407,6 @@ TexturePanel *CreateTexturePanel(WMWindow *keyWindow)
WMAddPopUpButtonItem(panel->arrP, _("Scale"));
WMAddPopUpButtonItem(panel->arrP, _("Center"));
WMAddPopUpButtonItem(panel->arrP, _("Maximize"));
WMAddPopUpButtonItem(panel->arrP, _("Fill"));
WMSetPopUpButtonSelectedItem(panel->arrP, 0);
WMMapSubwidgets(panel->imageF);
@@ -1475,7 +1475,7 @@ TexturePanel *CreateTexturePanel(WMWindow *keyWindow)
char *ProgName = "test";
void testOKButton(WMWidget *self, void *data)
void testOKButton(WMWidget * self, void *data)
{
char *test;
Display *dpy;
@@ -1504,13 +1504,13 @@ void testOKButton(WMWidget *self, void *data)
}
void testCancelButton(WMWidget *self, void *data)
void testCancelButton(WMWidget * self, void *data)
{
wwarning("Exiting test....");
exit(0);
}
void wAbort(void)
void wAbort()
{
exit(1);
}
+1 -11
View File
@@ -23,7 +23,6 @@
#include "WPrefs.h"
#include <assert.h>
#include <X11/Xatom.h>
#ifdef HAVE_STDNORETURN
#include <stdnoreturn.h>
@@ -517,9 +516,6 @@ void Initialize(WMScreen * scr)
char **list;
int i;
char *path;
long pid;
Atom net_wm_pid;
Display *dpy = WMScreenDisplay(scr);
list = RSupportedFileFormats();
for (i = 0; list[i] != NULL; i++) {
@@ -551,11 +547,6 @@ void Initialize(WMScreen * scr)
WMRealizeWidget(WPrefs.win);
net_wm_pid = XInternAtom(dpy, "_NET_WM_PID", False);
pid = (long)getpid();
XChangeProperty(dpy, WMWidgetXID(WPrefs.win), net_wm_pid, XA_CARDINAL,
32, PropModeReplace, (unsigned char *)&pid, 1);
WMSetWindowMiniwindowImage(WPrefs.win, WMGetApplicationIconImage(scr));
WMMapWidget(WPrefs.win);
@@ -584,7 +575,6 @@ void Initialize(WMScreen * scr)
InitKeyboardSettings(WPrefs.banner);
#endif
InitKeyboardShortcuts(WPrefs.banner);
InitHotCornerShortcuts(WPrefs.banner);
InitMouseSettings(WPrefs.banner);
InitAppearance(WPrefs.banner);
@@ -612,7 +602,7 @@ static void loadConfigurations(WMScreen * scr, WMWindow * mainw)
char *path;
FILE *file;
char buffer[1024];
char mbuf[1069]; /* Size of buffer and extra characters for the sprintfs */
char mbuf[1024];
int v1, v2, v3;
path = wdefaultspathfordomain("WindowMaker");
-9
View File
@@ -1,9 +0,0 @@
[Desktop Entry]
Version=1.5
Type=Application
Name=WPrefs
Comment=Window Maker Preferences
TryExec=#wprefs_bindir#/WPrefs
Exec=WPrefs
Icon=#wprefs_datadir#/WPrefs.xpm
Categories=Settings;DesktopSettings;
+1 -2
View File
@@ -33,7 +33,6 @@
#include <wraster.h>
#include <WINGs/WINGs.h>
#include <WINGs/WINGsP.h>
/* Needed for HAVE_LIBINTL_H and EXTENDED_WINDOWSHORTCUT */
#include "../src/wconfig.h"
@@ -55,6 +54,7 @@
/****/
extern char *NOptionValueChanged;
extern Bool xext_xkb_supported;
typedef struct _Panel Panel;
@@ -155,7 +155,6 @@ Panel *InitDocks(WMWidget *parent);
Panel *InitExpert(WMWidget *parent);
Panel *InitFocus(WMWidget *parent);
Panel *InitFontSimple(WMWidget *parent);
Panel *InitHotCornerShortcuts(WMWidget *parent);
Panel *InitIcons(WMWidget *parent);
Panel *InitKeyboardShortcuts(WMWidget *parent);
Panel *InitMenu(WMWidget *parent);
+2 -5
View File
@@ -207,15 +207,12 @@ static void createPanel(Panel * p)
static void storeData(_Panel * panel)
{
int tmp = WMGetPopUpButtonSelectedItem(panel->posP);
if (tmp < 0)
return;
SetBoolForKey(!WMGetButtonSelected(panel->linkB), "DontLinkWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->cyclB), "CycleWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->newB), "AdvanceToNewWorkspace");
SetStringForKey(WSNamePositions[tmp], "WorkspaceNameDisplayPosition");
SetStringForKey(WSNamePositions[WMGetPopUpButtonSelectedItem(panel->posP)],
"WorkspaceNameDisplayPosition");
}
Panel *InitWorkspace(WMWidget *parent)
+1 -1
View File
@@ -1150,7 +1150,7 @@ static void dragItem(WEditMenu * menu, WEditMenuItem * item, Bool copy)
static XColor back = { 0, 0xffff, 0xffff, 0xffff, DoRed | DoGreen | DoBlue, 0 };
Display *dpy = W_VIEW_DISPLAY(menu->view);
WMScreen *scr = W_VIEW_SCREEN(menu->view);
int x = 0, y = 0;
int x, y;
int dx, dy;
Bool done = False;
Window blaw;
+20
View File
@@ -35,6 +35,8 @@
#endif
char *NOptionValueChanged = "NOptionValueChanged";
Bool xext_xkb_supported = False;
#define MAX_DEATHS 64
@@ -64,6 +66,19 @@ static void print_help(const char *progname)
puts(_(" --help print this message and exit"));
}
#if 0
static RETSIGTYPE handleDeadChild(int sig)
{
pid_t pid;
int status;
pid = waitpid(-1, &status, WNOHANG);
if (pid > 0) {
DeadChildren[DeadChildrenCount++] = pid;
}
}
#endif
void AddDeadChildHandler(pid_t pid, void (*handler) (void *), void *data)
{
int i;
@@ -149,12 +164,17 @@ int main(int argc, char **argv)
wfatal(_("could not open display %s"), XDisplayName(display_name));
exit(0);
}
#if 0
XSynchronize(dpy, 1);
#endif
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
if (!scr) {
wfatal(_("could not initialize application"));
exit(0);
}
xext_xkb_supported = XkbQueryExtension(dpy, NULL, NULL, NULL, NULL, NULL);
WMPLSetCaseSensitive(False);
Initialize(scr);
+1 -3
View File
@@ -5,8 +5,7 @@ CATALOGS = @WPREFSMOFILES@
CLEANFILES = $(DOMAIN).pot $(CATALOGS)
EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po fy.po hr.po hu.po \
it.po ja.po ko.po nl.po pt.po ru.po sk.po sr.po tr.po uk.po zh_CN.po \
zh_TW.po
it.po ja.po ko.po nl.po pt.po ru.po sk.po uk.po zh_CN.po zh_TW.po
POTFILES = \
$(top_srcdir)/WPrefs.app/Appearance.c \
@@ -15,7 +14,6 @@ POTFILES = \
$(top_srcdir)/WPrefs.app/Expert.c \
$(top_srcdir)/WPrefs.app/Focus.c \
$(top_srcdir)/WPrefs.app/FontSimple.c \
$(top_srcdir)/WPrefs.app/HotCornerShortcuts.c \
$(top_srcdir)/WPrefs.app/Icons.c \
$(top_srcdir)/WPrefs.app/KeyboardShortcuts.c \
$(top_srcdir)/WPrefs.app/Menu.c \
+2 -3
View File
@@ -1,7 +1,7 @@
File Language Current Maintainer
------------------------------------------------------------------------------
pt.po Portuguese Eliphas Levy Theodoro <eliphas@conectiva.com.br>
hr.po Croatian Toni Biliæ <tbilic@oliver.efos.hr>
hr.po Croatian Toni Biliæ <tbilic@oliver.efos.hr>
fr.po French Bastien NOCERA <hadess@writeme.com>
Hadess <hadess@infonie.fr>
Antoine Hulin <antoine@origan.fdn.org>
@@ -23,7 +23,6 @@ bg.po Bulgarian Slavei Karadjov <slaff@exco.net>
Anton Zinoviev <zinoviev@debian.org>
sk.po Slovak Jan 'judas' Tomka <judas@linux.sk>
et.po Estonian Ivar Smolin <okul@linux.ee>
ca.po Catalan Ernest Adrogué <eadrogue@gmx.net>
ca.po Catalan Ernest Adrogué <eadrogue@gmx.net>
nl.po Dutch Alwin <translations@ziggo.nl>
fy.po Frisian Alwin <translations@ziggo.nl>
sr.po Serbian Strahinya Radich <sr@strahinja.org>
-1
View File
@@ -8,7 +8,6 @@ msgstr ""
"PO-Revision-Date: 2001-04-18 23:22+03:00\n"
"Last-Translator: Anton Zinoviev <zinoviev@debian.org>\n"
"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-1
View File
@@ -14,7 +14,6 @@ msgstr ""
"PO-Revision-Date: 2003-09-16 23:15+0200\n"
"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-1
View File
@@ -16,7 +16,6 @@ msgstr ""
"PO-Revision-Date: 2001-10-14 21:07+0000\n"
"Last-Translator: Jiří Hnídek <jiri.hnidek@vslib.cz>\n"
"Language-Team: czech <cs@li.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: unknown\n"
+1 -2
View File
@@ -18,7 +18,6 @@ msgstr ""
"PO-Revision-Date: 2010-02-02 10:49+0100\n"
"Last-Translator: Carlos R. Mafra <crmafra@gmail.com>\n"
"Language-Team: German <>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -820,7 +819,7 @@ msgstr "Clip in den Vor-/Hintergrund"
#: ../../WPrefs.app/KeyboardShortcuts.c:518
msgid "Toggle keyboard language"
msgstr "Tastaturbelegung ändern"
msgstr "Tastatursbelegung ändern"
#: ../../WPrefs.app/KeyboardShortcuts.c:532
msgid "Shortcut"
-1
View File
@@ -8,7 +8,6 @@ msgstr ""
"PO-Revision-Date: 2003-09-19 03:05-0400\n"
"Last-Translator: Alberto Giménez <algibe@teleline.es>\n"
"Language-Team: Spanish \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: unknown\n"

Some files were not shown because too many files have changed in this diff Show More