Commit graph

1375 commits

Author SHA1 Message Date
Sergii Stoian
09bf6067c2
Merge pull request #14 from trunkmaster/master
Correct application icon images in WM
2020-01-14 10:55:29 +02:00
Sergii Stoian
d1dd3f0f5c * Source/x11/XGServerWindow.m (ALPHA_THRESHOLD): removed duplicate of
definition.
2020-01-14 10:52:59 +02:00
Sergii Stoian
9e298b2142 * Source/x11/XGServerWindow.m (alphaMaskForImage):
(imagecursor:::): renamed missed image_mask() call.
2020-01-14 02:05:07 +02:00
Sergii Stoian
f9a9d6679b * Source/x11/XGServerWindow.m (alphaMaskForImage): renamed from
image_mask().
  (swapColors): new function to convert colors from ARGB order into RGBA
  (big-endian systems) or BGRA (little-endian systems).
  (_createAppIconPixmaps): use swapColors() and remove unused code.
  (restrictWindow:toImage:): use alphaMaskForImage().
  (imagecursor:::): use swapColors() and remove unused code.
2020-01-14 01:58:30 +02:00
Sergii Stoian
528660834c * Source/x11/XGServerWindow.m (_createNetIcon:result:size:): fixed
off-by-one mistake during alpha handling. Enable disabled code and
  remove temprorary one.
  (window::::): set NetWM icon to window for all EWMH capable WMs even
  it's WindowMaker.
  (image_mask): new function to create alpha mask for image. It's based
  on xgps_cursor_mask() code with additional argument `alpha_treshold`.
  This function may be used for images (alpha_treshold == 0) with real
  alpha mask and for cursors (if no Xcursor library is used - no alpha
  is used, no shadows in cursors, alpha_treshold == 158 is used to cut
  transparent pixels).
  (_createAppIconPixmaps): icon pixmap creation rewritten to support
  images with alpha channel using wraster functions. Use image_mask().
  (restrictWindow:toImage:): use image_mask() instead of
  xgps_cursor_mask().
  (xgps_cursor_mask): removed as image_mask() replaced it.
  Guard xgps_cursor_image( with #if - will not be compiled if Xcursor
  is used.
  (imagecursor:::): use image_mask() instead of xgps_cursor_mask().
2020-01-13 01:34:11 +02:00
fredkiefer
de86246567 * Source/cairo/CairoFontInfo.m: Revert to the old defaults for
hinting and allow for all possible values to be set.
2019-12-24 14:10:02 +01:00
Fred Kiefer
f409903fb4
Merge pull request #12 from gnustep/ivucica-codeowners-1
Add CODEOWNERS.
2019-11-04 09:08:11 +01:00
Ivan Vučica
3acbb83ef1
Add CODEOWNERS. 2019-11-03 22:54:07 +00:00
Gregory John Casamento
c6919519c6 Update version 2019-09-13 23:35:48 -04:00
fredkiefer
36283735ab * Source/cairo/CairoFontInfo.m,
* Source/fontconfig/FCFontEnumerator.m: Small cleanup of last pull
request.
2019-05-19 22:56:48 +02:00
fredkiefer
5362c305bc Add ChangeLog to merged pull request. 2019-05-19 21:13:29 +02:00
Fred Kiefer
8691c48537
Merge pull request #5 from Deek/deek
Font system revamp
2019-05-19 18:06:46 +02:00
Fred Kiefer
d2d0e6650a
Merge pull request #11 from trunkmaster/master
Mouse cursor images handling fix and cleanup
2019-05-01 14:15:14 +02:00
Gregory John Casamento
d5f2097261 Add changes to address 16 bit support in Xlib. Need to test 2019-04-20 11:17:57 -04:00
Sergii Stoian
00a1180684 * Source/x11/XGServerWindow.m (standardcursor::): Getting of
XC_fleur as GSCloseHandCursor was removed because it loads in
NSCursor as image.
2019-04-20 02:01:40 +03:00
Sergii Stoian
39e2e16bec * Source/x11/XGServerWindow.m (standardcursor::): revert resizing
cursor names to the old values upon request of project owner.
2019-04-18 01:22:57 +03:00
Sergii Stoian
d4a4888b9d * Source/x11/XGServerWindow.m (getStandardBitmap): send bitmapFormat
to _convertToFormatBitsPerSample::::::::. Fixes display of colored
mouse cursor images.
(standardcursor::): cleanup in Xlib cursors handling. Additional
cursor types were added: GSClosedHandCursor, GSOpenHandCursor.
Removed GSDisappearingItemCursor type handling - it loads in NSCursor
from image.
2019-04-17 18:06:19 +03:00
Fred Kiefer
9f750d2c4f
Merge pull request #10 from trunkmaster/master
Support for configurable mouse properties
2019-04-12 16:11:18 +02:00
Sergii Stoian
b5003272a7 * Source/x11/XGServerEvent.m (mouseOptionsChanged:): change double-click
minimum value to 200 and default to 300.
2019-04-12 15:45:39 +03:00
Sergii Stoian
59b1f51e5f * Source/x11/XGServerEvent.m (processEvent:): do not send event if
disabled menu mouse button was released.
2019-04-11 13:15:09 +03:00
Sergii Stoian
7981c3e41c * Source/x11/XGServerEvent.m (initializeMouse): new method. Calls -mouseOptionsChanged:
and setups observer for defaults changes.
(mouseOptionsChanged:): new method. Read mouse properties from user defaults.
(processEvent:): respect mouse options on ButtonPress and ButtonRelease events.

* Source/x11/XGServer.m (dealloc): remove notification observer.
2019-04-11 01:50:30 +03:00
Fred Kiefer
6f69fdcc2f
Merge pull request #9 from trunkmaster/master
Added support for WindowMaker's WMFHideApplication action.
2019-04-06 23:32:22 +02:00
Sergii Stoian
2f4c96f9d1 hidewindow method was renamed to hideApplication. 2019-04-06 22:32:29 +03:00
Sergii Stoian
b492ac87cd Added support for WindowMaker's WMFHideApplication action. 2019-04-05 14:46:05 +03:00
Fred Kiefer
ba2d592083
Merge pull request #8 from trunkmaster/master
Send double-click on appicon to WindowMaker
2019-04-04 16:41:11 +02:00
Sergii Stoian
f9958176db Do not send NSEvent only for single-click on appicon and minindow in WindowMaker environment. 2019-04-04 12:10:47 +03:00
Sergii Stoian
21f38f8060 Send double-click on appicon to the WindowMaker. Old code sent to WM only single-click. 2019-04-04 01:22:25 +03:00
Fred Kiefer
ee865548bf
Merge pull request #7 from trunkmaster/master
Handle `-autolaunch YES` application argument
2019-04-03 22:36:13 +02:00
Sergii Stoian
233c129a5c WM_IGNORE_FOCUS_EVENTS atom was added. Use new atom in orderwindow::: code added in last commit. 2019-04-03 19:13:30 +03:00
Sergii Stoian
a6595e320d Map application icon window without focus switch for applications executed with argument -autolaunch YES in WindowMaker environment. 2019-04-02 19:38:44 +03:00
Fred Kiefer
41e57d8d5f
Merge pull request #6 from trunkmaster/master
Set `Utility` window type for NSFloatingWindowLevel.
2019-03-26 22:26:41 +01:00
Sergii Stoian
f4d01bab0c Added ChangeLog entry to Source/x11/XGServerWindow.m change. 2019-03-26 23:23:25 +02:00
Sergii Stoian
0374820172 Set Utility window type for NSFloatingWindowLevel. 2019-03-26 17:12:55 +02:00
Jeff Teunissen
f87842d08a Turn on hinting and subpixel rendering for Cairo.
There's no good reason not to enable subpixel rendering and hinting.
Leaving it off makes GNUstep apps look worse than everything else, in
exchange for having -advancementForGlyph: be totally consistent, which
may not even be necessary.

So, yeah, let's just turn this stuff on. I reused the subpixel default
from back-art to preserve configs, and added a GSFontHinting default to
control text hinting.

Use 0 for whatever Cairo defaults to, 1 for off, 2 for slight hinting,
3 for medium hinting, or 4 for full hinting.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
0578a7d915 Add some generated files to .gitignore 2019-03-26 03:58:18 -04:00
Jeff Teunissen
d519e8542b Stub code for SFNT access
Some simple code for getting access to the main SFNT tables used for
drawing the right glyphs in the right ways. It's hidden with an "#if 0" for
future use.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
8f19df1949 Support named glyphs, encodings in Cairo
Implement a method for accessing named glyphs and character codings from
Cairo.

This is a necessary first step for complex glyph substitution, and even
simple things like standard ligatures.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
1b23bfe1fd Better sorting of fonts
Rather than sorting fonts by the integer value of "traits", let's sort by
the traits we are looking for specifically. Again, like many other things,
totally correct handling of this stuff will have to wait for a good method
of inspecting and correctly processing SFNT tables.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
d0a9f5b943 Handle "strange" font weights
Fontconfig's font weights are almost but not entirely defined by the
constants found in its source code. Things like FC_WEIGHT_LIGHT are not,
as we had presumed, a list of definitive weights. As such, it seems there
are a goodly number of fonts that have weights not appearing in the list.

For example, say there's a font that is heavier than Medium (weight 100 for
fontconfig, and 6 for us) but not as heavy as Demibold (FC: 180, GS: 7),
then it might tell Fontconfig it has a weight of 130.

When this happens, we _could_ assign its NSWeight to be 6 or 7, but it's
possible that there will be another face in that font that ALSO fits there,
which might throw off the sorting. Instead, what I suggest is to do what
I have done...assign an NSWeight with a weight class that represents the
numeric distance _between_ the two defined values.

So the GS weight for this font face becomes something like:

NSWeight = 6 + ((FCWeight - Medium) * (1.0 / (Demibold - Medium)))

or, in numeric terms, 6 + 0.375

In service of this change, I have switched the actual Weight value within
the font dictionary from int to float. This is an attempt to translate this
situation into a sortable form we can work with, compressing an approximate
range of possible FC font weights into our 0-15 system.

There may well be a better way to go about this, such as figuring out where
fontconfig gets this info in the first place and converting from the source
directly, but accessing the SFNT tables (which will almost certainly be
required) is something for a later day.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
5737e249f5 fix 'italic' detection
Don't check for italic, check for slant greater than roman. That way, we
catch oblique (which is more slanted than 'italic') too.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
8df5bb1064 More postscriptname support
Support reading the PS name from a pattern.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
325c927814 fontconfig: use fullname for displayName (most of the time)
Can't use fullname ALL the time, because some (mostly Adobe) fonts store
a duplicate of their PostScript name in the fullname field (and for that
case, we can just do what we already did), but it works well for just about
everything else.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
ecba94053d sort font faces
GNUstep's font architecture makes it extremely difficult and annoying to
have a properly sorted font panel (or even one that makes any sense at all).

This might not be the best place to implement font sorting, but I'll be
damned if I can find a better one. The font enumerator knows where to look,
and has all the information needed to do it.

So, once we've enumerated all the fonts, sort them with a function that's
only slightly more clever than alphabetizing them. We sort by these
criteria, in order of importance:

1. font weight
2. traits (numeric ordering)
3. style name, with special cases so "Regular"/"Normal"/"Roman" sort
   earlier than other stuff (caption, titling, etc.)

This sorting function seems to work about as well as can be expected,
producing the obvious "Regular"/"Italic"/"Bold"/"Bold Italic" for
undemanding families, while getting more advanced ones (like, say, the 168
font faces of Kepler Std) pretty close.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
233e44dc4c Support fontconfig 2.11's new 'postscriptname' attribute.
GNUstep has been bending over backwards to deal with fontconfig's baffling
lack of support for PostScript-style font names, just as it bent over
backwards to deal with XLFD's lack of same. Luckily, the fontconfig guys
have done us (and let's be honest, ghostscript and every pdf reader in
creation) a solid, and now that it's here it would be downright criminal
to not use it.

Implement it. :)
2019-03-26 03:58:18 -04:00
Jeff Teunissen
016f5eda25 Cairo: Reduce the hilarity of the font panel
Use many more weights and widths when generating the (still extremely
stupid) synthetic PostScript font names.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
390f82f064 make displayName work 2019-03-26 03:58:18 -04:00
Ivan Vučica
390be8237c
release-chore: Update to 0.27.0. 2019-01-06 22:23:49 +00:00
fredkiefer
9b43c1d568 * Documentation/news.texi: Fill in some details for pending release. 2019-01-03 23:26:21 +01:00
fredkiefer
fd84d377f2 * Source/opal/OpalGState.m: Add colour handling for all the different
colour spaces.
2019-01-03 23:06:51 +01:00
Fred Kiefer
059f42a869
Merge pull request #4 from shlyakpavel/patch-2
Fix memory leaks in convert.c
2019-01-01 14:58:03 +01:00