1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00
Commit Graph

60 Commits

Author SHA1 Message Date
Christophe CURIS
e7c8ac76ea WINGs: Added 'const' attribute to functions in wapplication, wappresource, wcolor, wfont, wpixmap
This makes both the API and local function const-correct on their
input parameters.
2013-05-09 16:56:28 +01:00
Carlos R. Mafra
a568686b39 WINGs: Do not call exit()
WMCreateFont() was calling exit() if it could not create the
font, and was trying too hard not to return NULL.

Just return NULL if the font could not be created instead of exit()ing
and let callers decide what to do upon failure.

Thanks to Christian <chris@computersalat.de> for reporting this.
2012-02-18 00:10:48 +00:00
Tamas TEVESZ
a71a604ab1 WINGs: Make wmalloc() intialize allocated memory to 0
- Accordingly remove individual memsets, for now from WINGs only.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:29 +02:00
Carlos R. Mafra
688a56e8ab Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)
2009-08-20 00:59:40 +02:00
Carlos R. Mafra
0a32ecf1fe WMCreateFont: Add missing wfree()'s
I removed (forgot) them when in commit ee28b0257a ("Avoid returning
font=NULL in WMCreateFont()"). Add them back.
2009-08-18 04:33:39 +02:00
Carlos R. Mafra
ee28b0257a WINGs/wfont.c: Avoid returning font=NULL in WMCreateFont()
WPrefs tries to use the fonts listed in the WMCreateFont() call (from WPrefs.c),

font = WMCreateFont(scr, "Lucida Sans,URW Gothic L,Times New Roman,serif"
                         ":bold:pixelsize=26:antialias=true");

and 'font' is later used without accounting the possibility of it being NULL in

WMSetLabelFont(WPrefs.nameL, font);
WMReleaseFont(font);

In particular, WMReleaseFont(font) will kill WPrefs ungracefully with the
following message if font=NULL

WPrefs: wfont.c:193: WMReleaseFont: Assertion `font!=((void *)0)' failed.
Aborted

That happens because the return value of WMCreateFont() can be NULL, so this
patch makes WMCreateFont() never return NULL. If the font creation fails for
some reason (see below), we try to use the emergency DEFAULT_FONT and print
debugging information telling what's going on. If the use of DEFAULT_FONT
also fails, then we terminate WPrefs with exit(1) and let the user know
why exactly if failed.

This bug happened because the font "Lucida Sans" (the first possibility
in the initial call to WMCreateFont()) "exists" in my system as a stale
symbolic link to a location which no longer exists after an upgrade from
java from 1.5.0.14 to 1.5.0.15

    /etc/alternatives/LucidaSansDemiBold.ttf ->
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/fonts/LucidaSansDemiBold.ttf

So the call to XftFontOpenName(display, scrPtr->screen, fname) with
"Lucida Sans" being the first possibility for Xft to try out ended up in 'font'
being NULL because, as far as the Xft library was concerned, "Lucida Sans"
produced a positive match (due to it existing as a symbolic link) but in the end
a NULL result was produced due to the missing symbolic link destination. This later
exposed the bug of WMCreateFont() returning font=NULL and WPrefs.c not checking
whether font=NULL before using it. Bang!

If "Lucida Sans" was the _second_ entry to try and the first one had suceeded,
this bug would not have surfaced.

This solves https://qa.mandriva.com/show_bug.cgi?id=39677

Signed-off-by: Carlos R. Mafra <crmafra@ift.unesp.br>
2008-05-02 20:23:00 -03:00
dan
c0317ddae5 eliminated gcc-4 compilation warnings 2005-08-22 23:58:19 +00:00
dan
e9e1186f1d attempt to fix compilation on solaris with openwin 2004-10-30 06:39:27 +00:00
dan
d8862b0bdf fixed some bugs 2004-10-26 03:40:44 +00:00
kojima
bbd1e5dada fixed some bugs 2004-10-26 03:03:02 +00:00
dan
4bda625076 - Simplified font conversion a bit, as fontconfig does the job of getting
the closest match for us
- Removed wsetfont. No longer needed.
2004-10-22 23:19:37 +00:00
dan
d08691d5a5 - Changed fallback font to 'sans serif:pixelsize=12'
- Fixed convertfonts to account for $LANG
- Fixed convertfonts logic a bit and no longer output slant and weight if
  they are the default ones (medium and roman)
- Applied Pascal's fix for GNUstep menus (modified to also include submenus)
  Still this is not the proper fix, as it can't differentiate between
  submenus and other windows at the floating window level. Correct fix needs
  some extra hints to be set by GNUstep on menus.
2004-10-22 22:27:11 +00:00
dan
08e811aae7 - If fonts are specified as xlfd, convert to fc names before creating them.
This was we internally only deal with fc names and properties. It will
  incur a small performance hit as the font needs to be parsed/unparsed,
  but this is only for backward-compatibility to support old xlfd names.
  People are encouraged to swtich to fontconfig names.
- WINGs no longer adds sans as a fallback for internal fonts. It is
  automatically done by fontconfig (if it can't find the requested font
  it will use the closest match which is the default font: sans-serif)
- Added code to honor the AntialiasesText global option
- Fixed style names for WMCopyFontWithStyle()
- Added fonts in style files where they were missing. Also changed some
  fonts to better defaults.
2004-10-22 00:21:51 +00:00
dan
0c09179f01 - Removed support for legacy systems: OpenLook, KDE-2.x, Gnome-1.x
- Removed #define and #ifdef XFT constructs, as XFT is on all the time
2004-10-14 23:05:20 +00:00
kojima
2b51c21ee5 use macros for property names 2004-10-13 23:48:58 +00:00
kojima
3ed1d3e25c added Font Configuration
updated some outdated default config files
2004-10-13 23:39:29 +00:00
dan
9aca0d5f6e - Check whether libXft is at least version 2.1.2 else refuse to compile.
- Fixed bug in icon chooser dialog that could cause a segmentation fault
  in some cases (Pascal Hofstee <caelian@gmail.com>)
- Fixed crash in asm code in wrlib, with new versions of gcc.
- Fixed bug in the x86_PseudoColor_32_to_8() function which incorrectly
  used the r, g, b fields in the conversion.
- Fixed x86 ASM code in wrlib to work on 64 bit architectures.
- Fixed the focus flicker seen with some apps (notably gtk2)
  (Alexey Spiridonov <snarkmaster@gmail.com>)
- Fixed all crashing bugs that were generated by wmaker starting with the
  WMState file missing.
- Added NetWM support (a modified version of the patch originaly written
  by Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied patch to enhance the Virtual Desktop behaviour, and to integrate
  it with the NetWM code (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied a few xinerama and placement fixes (Peter Zijlstra
    <a.p.zijlstra@chello.nl>)
- Fixed memory leak in dock code.
- Fixed and enhanced the text wrapping in WINGs.
- Fixed the layout of some elements in WPrefs.app
- Added workaround for aplications that don't set the required hints on the
  client leader window, but they set them on normal windows (observer with
  KDE 3.3.0 mainly). This will allow these apps to get an appicon again.
  (they should be fixed still)
- Added workaround for applications that do not set a command with
  XSetCommand(), but instead they set the _NET_WM_PID property. This works
  with operating systems that offer a /proc interface similar to what linux
  has. (This also is to fix problems with KDE 3.3.0 apps, but not only them).
- Fixed bug with autostart and exit scripts not being executed if user
  GNUstep path was different from ~/GNUstep (when setting GNUSTEP_USER_ROOT)
- Added utf8 support in WINGs (removed old X core font code)
- Added utility to convert old font names to new font names in style files
2004-10-12 01:34:32 +00:00
dan
474c4caf94 reverted the last test commit (duh) 2004-07-16 18:50:58 +00:00
dan
109bb540ec another test for cvs notifications 2004-07-16 18:18:36 +00:00
dan
e7d0c5d9e9 - Added xdnd v3 support in WINGs (Sylvain Reynal <sreynal@nerim.net>)
- CVS should compile again
2004-04-07 02:50:52 +00:00
dan
847479b886 Fixed bug with incorrect un-escaping if there is a dot in wm_class. 2003-09-03 19:09:20 +00:00
dan
6aed0cd713 small 'remember todo' comment 2003-08-19 21:44:08 +00:00
dan
39b9edfdcd - Converted functions in wfont.c to use xft semantics in place of old X core
fonts and X font sets.
- New code operates on new fontnames like Arial-8:bold:italic in place of xlfd
  (WMCreateFont can still read an xlfd for back compat)
2003-08-15 02:58:04 +00:00
dan
090cc27f00 fixed a test condition 2003-08-14 01:43:07 +00:00
dan
08225948bc wide char support 2003-08-14 01:39:27 +00:00
dan
74ba4f8eef Started to move towards using xft2 only, for a unified font/locale handling
in WINGs
2003-08-07 00:26:21 +00:00
dan
a4c986fa1b _ fixed bug in resizing a scrollview
- read both XLFDs and XFT style font names from config files (xft case only)
2003-06-12 21:21:57 +00:00
dan
ca43aba088 - Added wstrndup() and WMGetFontName() 2002-12-02 00:01:05 +00:00
dan
dd1ccd2fd6 - enabled the use of SHAPE extension in the color panel. without it the
magnifying glass captured image was shifted and unusable
- removed some comments left in the code for later reviewal
2002-12-01 05:49:13 +00:00
dan
0fe70d2b4e - Fixed a bug with empty frame titles (Alexey Voinov <voins@voins.program.ru>)
- Added WMGetWidgetBackgroundColor()
- Code cleanup in wtext.c
- Renamed WFANonBold and WFANonEmphasized to WFANotBold and WFANotEmphasized
2002-11-25 04:46:00 +00:00
dan
18b3753227 - added WMCopyFontWithChanges() a more generic and powerful function, meant
to replace WMNormalizeFont(), WMEmphasizeFont(), WMStrenghtenFont(),
  WMUnemphasizeFont() and WMUnstrenghtenFont() which are now obsolete and
  were removed.
2002-11-22 04:49:05 +00:00
dan
2fe1b0e3f8 - Added support for antialiased text with multibyte languages too.
(only tested on russian, since that's the only multibyte language
  I can test).
2002-11-21 05:21:42 +00:00
dan
c2ec1cfe8a - Fixed userdefaults in WINGs not to synchronize on exit a domain that is
marked not to be synchronized.
- WMGLOBAL options can now be set in the WindowMaker configuration files
  to overwrite values in WMGLOBAL.
- You can now pass "SystemFont", "BoldSystemFont", "SystemFont-##" or
  "BoldSystemFont-##", with ## being the font size to any font creating
  function to create a font with the (bold) system font font specification.
- Replaced AA with Anitialiased in WINGs font creation function names
- Added WMCreateFontWithFlags(), WMHasAntialiasingSupport() and
  WMIsAntialiasingEnabled()
- Created a separate font cacahe for antialiased fonts
- Added test at startup if Xft supports rendering antialiased fonts (in case
  the application was compiled with Xft support, but is run on an X server
  without support for xft rendering (RENDER extension missing). If no Xft
  support antialiasing will be disabled even if it is enabled in the
  configuration file.
- Finished the Info Panel to work with antialiased fonts.
- Code cleanup in dialog.c. Remade part of Info Panel drawing the Window Maker
  logo.
- Fixed technical style drawing of window resizing.
2002-11-13 15:13:48 +00:00
dan
5e37991b6c Added (forgotten) release for notifications when destroying a WMList. 2002-11-04 06:07:00 +00:00
dan
5230a57599 - Added WMCreateNonAAFont() to WINGs 2002-10-18 02:56:59 +00:00
dan
1e92274495 - Updated WINGs/NEWS with info about hw the API changed how how things
are affected. Fixes for old code too.
- Double buffering in WMList. All widgets or apps using WMList and
  having user drawing porcedures in place will inherit this double
  buffering automatically too.
- New functions in WINGs: WMGetColorAlpha(), WMIsAAFont()
- Misc code cleanups in WINGs and src/dialog.c
2002-10-16 04:05:45 +00:00
dan
2b2fecac12 - Added double buffering when drawing a WMFrame title with an AA font to avoid
flickering.
- Added double buffering when drawing WMList items to avoid flickering
- Shared xft drawable
- Renamed AASystemFont and AABoldSystemFont to AntialiasedSystemFont
  respectively AntialiasedBoldSystemFont in WMGLOBAL
- WMCreateFont falls back to normal fonts if antialiased fonts cannot be
  created (even if enabled)
2002-10-13 18:25:36 +00:00
dan
17f26077b0 Added Xft support in WINGs (for drawing antialiased fonts with transparency)
Details in WINGs/ChangeLog and WINGs/NEWS
2002-10-09 05:14:28 +00:00
dan
a2b404b5b3 - API change in WINGs for WMDraw*String().
WMDrawString() and WMDrawImageString() now take WMColor instead of GC as
  arguments. WMDrawImageString() receives 2 colors (text & background).
  This is to allow easy extension for Xft/Xrender and hide X low level details
- Added alpha channel to WMColor. 2 new functions also:
  WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Removed obsoleted acconfig.h and implemented its functionality using
  AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
  This will definitely enforce the need to use autoconf 2.5x
2002-10-08 08:26:06 +00:00
dan
ad0ad5af22 Added 2 functions to retrieve the default system fonts:
WMDefaultSystemFont(WMScreen *scr) and WMDefaultBoldSystemFont(WMScreen *scr)
2002-03-28 16:22:53 +00:00
dan
1cd1f16c3c fixed bug in WMSetButtonEnabled and WMSetButtonSelected 2002-02-28 11:01:39 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
  have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
2002-01-04 07:32:37 +00:00
kojima
882b9a8e1c - s/sprintf/snprintf
- updated some po's
- fixed crash bug when removing WINDOWS_MENU or WORKSPACE_MENU from rootmenu
- some other stuff i forgot
2001-07-23 20:31:32 +00:00
kojima
51b1bf34b9 fixed some signal handling bugs 2001-03-14 02:54:54 +00:00
nwanua
d00e72bc45 - Changed ConvertFont et al. to WMEmphasizeFont, and added WMNormalizeFont() 2000-11-04 03:47:39 +00:00
nwanua
5f746a3efa *** empty log message *** 2000-11-03 02:33:29 +00:00
dan
497e34b6b8 - Replaced all free() with wfree() where appropriate
- Fixed some memory leaks
2000-10-31 14:57:22 +00:00
nwanua
dae28629bb *** empty log message *** 2000-10-01 03:49:00 +00:00
kojima
e410e1862b fontset name guess when using multibyte 2000-06-17 19:07:57 +00:00
kojima
80fb09a74e replaced free() with wfree() everywhere
fixed bug in wlist that caused colorpanel to crash
1999-10-09 20:07:23 +00:00