Commit graph

968 commits

Author SHA1 Message Date
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
fredkiefer
fd84d377f2 * Source/opal/OpalGState.m: Add colour handling for all the different
colour spaces.
2019-01-03 23:06:51 +01:00
Pavel Shlyak
3b7f8f0e84
Fix memory leaks in convert.c 2018-12-31 23:42:17 +04:00
fredkiefer
d9bc28c4ca * Source/gsc/GSGState.m (-setColor:state:): Don't copy values onto themselves. 2018-12-02 12:36:28 +01:00
fredkiefer
442eb2515e * Source/opal/OpalContext.m (-initWithGraphicsPort:flipped:): Implement.
* Source/opal/OpalContext.m (-GSSetDevice:::): Get height form
surface if no y value is given.
* Source/opal/OpalSurface.m: Rewrite to handle the case where
device is not set.
2018-09-16 17:27:48 +02:00
fredkiefer
7ee9b40793 * Source/x11/XGServerWindow.m (_setupRootWindow): Make sure the
root name variable is null terminated.
2018-07-16 08:39:55 +02:00
fredkiefer
6e797c9e6d * Source/x11/XGServerWindow.m: Check for bytes_after_ret in
PropGetCheckProperty. Attempt to improve the window border detection.
Based on idea by Tom MacSween <Tom.MacSween@crins-sinrc.ca>
2018-06-20 07:49:36 +02:00
fredkiefer
b9e9f461ab Restructure Atom handling to get all atoms at once.
Add new method on XGServer to get the name of the window manager.
2018-05-01 23:08:35 +02:00
fredkiefer
969b77a6c1 * Source/x11/XGServer.m (_initXContext): Call XInitThreads to
enable drawing in secondary threads.
2018-02-09 21:56:01 +01:00
fredkiefer
1a15d0393e Replace xlib specific font enumerator with the shared one for fontconfig.
Add glyph cache for GSXftFontInfo.
2018-02-05 20:50:48 +01:00
fredkiefer
97011b4952 Merge branch 'master' into opal-bridge 2017-08-07 14:10:42 +02:00
fredkiefer
c379156931 Get DPSshow: to work on scaled windows. 2017-07-31 23:33:34 +02:00
Daniel Ferreira
5f62df88d3 opal/bridge: implement bridge between GUI and Opal types
Implement a bridge between NSColor and CGColorRef and a stub for a
bridge between NSImage and CGImageRef. This improves compatibility with
Quartz.
2017-07-25 11:59:52 +10:00
Daniel Ferreira
720a56dcf3 opal/context: allow the client to supply a graphics port
In Quartz, the "graphics port" bound to an NSGraphicsContext (subclassed
by OpalContext) is a CGContext. We currently initialize one in
OpalSurface if it does not exist, however we do not allow the client to
initialize a graphics context with a custom graphics port, which should
be allowed. This commit enables this feature.
2017-07-25 11:59:52 +10:00
Fred Kiefer
3adb72d6e2 Fix some clang static analyser warnings reported by
Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40485 72102866-910b-0410-8b05-ffd578937521
2017-04-16 11:57:05 +00:00
Fred Kiefer
9f84d3e7fc * Headers/x11/XGGeneric.h: Remove obsolte atom.
* Source/x11/XGServerWindow.m: Clean up code.
	* Source/x11/XGServerWindow.m (-setwindowlevel::): Try to set
	better level for tool tip windows.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40295 72102866-910b-0410-8b05-ffd578937521
2017-01-17 22:01:52 +00:00
Fred Kiefer
168e6f1347 * Source/x11/XGServerWindow.m (-_checkStyle:): Ignore invalid
border information.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40286 72102866-910b-0410-8b05-ffd578937521
2017-01-08 21:01:01 +00:00
Riccardo Mottola
84db7e1e78 include -> import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40169 72102866-910b-0410-8b05-ffd578937521
2016-10-23 20:51:20 +00:00
Fred Kiefer
7befdbcf6b Small opal changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40047 72102866-910b-0410-8b05-ffd578937521
2016-08-02 20:48:01 +00:00
Riccardo Mottola
41804841f2 add missing header to fix warning
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40032 72102866-910b-0410-8b05-ffd578937521
2016-07-26 07:28:27 +00:00
Fred Kiefer
879abf5d3b Output the Postscript font name.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39999 72102866-910b-0410-8b05-ffd578937521
2016-07-15 17:10:21 +00:00
Ivan Vučica
162534acd1 Add return type 'id' to -[GSGState copyWithZone:] method definition.
Cherrypicking gnustep_testplant_branch r39614.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39636 72102866-910b-0410-8b05-ffd578937521
2016-04-06 20:43:32 +00:00
Ivan Vučica
d1d1db4c39 Implement dealloc/copyWithZone on Win32CairoGState instance.
Patch by mlytwyn (cherrypicked from testplant branch, r39618).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39635 72102866-910b-0410-8b05-ffd578937521
2016-04-06 20:43:29 +00:00
Ivan Vučica
61d519425f Remove extraneous semicolon.
Patch by mlytwyn (cherrypicked from testplant branch, r39614).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39634 72102866-910b-0410-8b05-ffd578937521
2016-04-06 20:43:25 +00:00
Fred Kiefer
24be840e39 My final GNUstep commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39237 72102866-910b-0410-8b05-ffd578937521
2015-12-13 17:55:23 +00:00
Riccardo Mottola
cc7fa76c5e Enable Sync only on explicit presence of sync.h, not just Xext.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39198 72102866-910b-0410-8b05-ffd578937521
2015-11-24 23:47:25 +00:00
Wolfgang Lux
1e1185abb3 Create an empty app icon window before eventually checking the window
frame offsets when using WindowMaker. This fixes the issue that the
first GNUstep application started under WindowMaker did not get a
proper application menu.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39171 72102866-910b-0410-8b05-ffd578937521
2015-11-13 15:30:15 +00:00
Fred Kiefer
2478d0b17b Revert part of the repeated key handling as requested by Riccardo.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39131 72102866-910b-0410-8b05-ffd578937521
2015-11-03 08:42:47 +00:00
Fred Kiefer
5843ba3d4d * Source/cairo/CairoGState.m (-GSReadRect:, -DPSimage:..:):
Drawing speedup for slow machines.
        Patch by Josh Freeman <gnustep_lists@twilightedge.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39097 72102866-910b-0410-8b05-ffd578937521
2015-10-27 22:12:52 +00:00
Fred Kiefer
3d95b4d8b2 * Source/x11/XGServerEvent.m (-processEvent:): Move repeate key
detection from process_key_event() to here to enable filtering
        out keyUp events as Cocoa does.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39078 72102866-910b-0410-8b05-ffd578937521
2015-10-16 22:07:24 +00:00
Fred Kiefer
18fd2b7555 * Source/gsc/GSContext.m: Set some defaults.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39046 72102866-910b-0410-8b05-ffd578937521
2015-10-09 00:13:42 +00:00
Fred Kiefer
0f3d255824 * Headers/gsc/GSGState.h
* Source/gsc/GSContext.m
        * Source/gsc/GSGState.m
        * Source/cairo/CairoGState.m
        Implement per gstate methods for antialias, patternPhase and
        compositingOperation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39026 72102866-910b-0410-8b05-ffd578937521
2015-10-03 21:49:35 +00:00
Fred Kiefer
4552dff9f1 * Source/cairo/CairoGState.m: Preliminary support for anti alias
setting for path drawing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39005 72102866-910b-0410-8b05-ffd578937521
2015-09-20 20:34:37 +00:00
Fred Kiefer
75c254d681 * Source/win32/WIN32Server.m (process_char):
Fix bug that caused F11 keypresses to become F12.
        Patch by Adam Fox <adam.fox@testplant.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38881 72102866-910b-0410-8b05-ffd578937521
2015-08-13 21:23:35 +00:00
Sebastian Reitenbach
23b53d84c0 * Source/cairo/CairoGState.m
abs -> fabs
        * Source/x11/XGGLContext.m
          format string fix
        * Headers/x11/XGOpenGL.h
          glxminorversion is int, not long int

Looks good, Ivan Vucica



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38554 72102866-910b-0410-8b05-ffd578937521
2015-05-26 12:00:49 +00:00
Fred Kiefer
239a4b3286 * Source/cairo/CairoGState.m: Add support for image
interpolation setting in context.
        Patch by Josh Freeman <gnustep_lists@twilightedge.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38528 72102866-910b-0410-8b05-ffd578937521
2015-05-22 21:28:20 +00:00
Fred Kiefer
2a3f24197c * Source/gsc/GSGState.m (_fillRect:withPattern:): Add support
for patternPhase.
        Patch by Josh Freeman <gnustep_lists@twilightedge.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38527 72102866-910b-0410-8b05-ffd578937521
2015-05-22 21:14:02 +00:00
Germán Arias
0bb695efa7 Improvements for last changes related with cursors on MS Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38444 72102866-910b-0410-8b05-ffd578937521
2015-04-01 05:52:29 +00:00
Germán Arias
925b52e02e Improvements to handle the cursor on MS Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38429 72102866-910b-0410-8b05-ffd578937521
2015-03-23 19:32:36 +00:00
Fred Kiefer
042f6f3761 * Source/x11/XGServerEvent.m (-processEvent:): Reenable
Richard's frontend based expose code.
        * Source/x11/XGServerWindow.m (-window::::, -_checkStyle:):
        Don't use CWBackPixel, as the window background may be different.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38419 72102866-910b-0410-8b05-ffd578937521
2015-03-22 15:15:20 +00:00
Fred Kiefer
59723d8e42 * Headers/x11/XGGeneric.h
* Source/x11/XGServerWindow.m: Correct name for atom
        net_wm_state_modal_atom. Use this atom to try to set the sate
        for dialog windows to modal.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38417 72102866-910b-0410-8b05-ffd578937521
2015-03-21 18:53:46 +00:00
Germán Arias
7b89c2c3ba Workarounds to re-display windows on MS Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38367 72102866-910b-0410-8b05-ffd578937521
2015-02-28 02:01:28 +00:00
Fred Kiefer
2f804fe716 * Source/cairo/CairoGState.m (-compositeGState:...fraction:):
Disable workaround for cairo > 1.8 for cairo > 1.13.
        Patch by Edwin Ancaer <eancaer@gmail.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38135 72102866-910b-0410-8b05-ffd578937521
2014-10-25 18:14:50 +00:00
Fred Kiefer
2d247b74fb * Source/win32/WIN32Server.m (LoadDisplayMonitorInfo):
Switch monitor logging to Debug level.
        Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37640 72102866-910b-0410-8b05-ffd578937521
2014-01-27 21:59:33 +00:00
Fred Kiefer
03babeb064 * Source/art/blit.m(MPRE): Remove compiler warning.
* Source/art/image.m(-DPSimage:::::::::::): Correct parameter
        types. Fixes bug #41274.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37615 72102866-910b-0410-8b05-ffd578937521
2014-01-19 10:39:21 +00:00
Niels Grewe
51973502b0 Roll back addition of redundant method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37539 72102866-910b-0410-8b05-ffd578937521
2014-01-05 23:03:35 +00:00
Fred Kiefer
6cf28f1c50 * Source/x11/XGServerWindow.m(-_checkStyle:): Change NSLog into
NSDebugLLog.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37535 72102866-910b-0410-8b05-ffd578937521
2014-01-05 16:40:32 +00:00
Niels Grewe
d499d53e75 Add a method to GSDisplayServer that allows you to obtain the
identifier used by the backend's windowing system instead of
just the GNUstep-internal window number. On X11, the identifier
is useful, among other things, to implement the D-Bus menu 
protocol.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37533 72102866-910b-0410-8b05-ffd578937521
2014-01-01 19:45:26 +00:00
Fred Kiefer
4c06213c78 * Source/cairo/CairoGState.m (-GSSetFont:),
* Source/cairo/CairoFaceInfo.m (-drawGlyphs:...): Use scaled
  font directly.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37523 72102866-910b-0410-8b05-ffd578937521
2013-12-29 22:43:15 +00:00
Fred Kiefer
fdb3429ef0 * Source/xlib/GSXftFontInfo.m
* Source/xlib/XGFontManager.m
* Source/xlib/XGBitmap.m: Remove some compiler warnings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37519 72102866-910b-0410-8b05-ffd578937521
2013-12-26 13:02:56 +00:00
Fred Kiefer
5932681446 * Source/cairo/CairoFaceInfo.m (-fontFace): Warn about the usage
of non-scalable fonts.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37490 72102866-910b-0410-8b05-ffd578937521
2013-12-23 12:36:09 +00:00
Fred Kiefer
91e1e5c8d4 * Source/x11/XGServerWindow.m (-_createBuffer, -windowbacking::,
-setWindowdevice:forContext:): Move code from last patch around a bit.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37475 72102866-910b-0410-8b05-ffd578937521
2013-12-18 22:34:20 +00:00
Eric Wasylishen
14d77dbfee * Source/x11/XGServerWindow.m (-_createBuffer): Fix a big
memory leak noticed by Riccardo with the cairo backend,
by #ifdef-ing out this method when using cairo.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37471 72102866-910b-0410-8b05-ffd578937521
2013-12-18 17:40:21 +00:00
Fred Kiefer
664096b79b * Source/x11/XGDragView.m (-_xWindowAcceptingDnDDescendentOf:...):
Correct to work with kwin window decoration.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37460 72102866-910b-0410-8b05-ffd578937521
2013-12-13 15:03:09 +00:00
Fred Kiefer
b624d4a9a9 * Tools/xpbs.m (-xProvideSelection:): Leave enough space for all
possible types.
* Source/x11/XGDragView.m: Simplify D&D window detection code.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37457 72102866-910b-0410-8b05-ffd578937521
2013-12-13 12:58:09 +00:00
Gregory John Casamento
8fa4608cba Minor correction to fix compilation error on Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37268 72102866-910b-0410-8b05-ffd578937521
2013-10-20 22:16:03 +00:00
Fred Kiefer
c5ef196157 * Headers/opal/OpalSurface.h
* Source/opal/OpalSurface.m: Make the -device method public.
        * Headers/opal/OpalContext.h: Remove method definitions.
        * Source/opal/OpalContext.m: Limit the accepted image types.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37172 72102866-910b-0410-8b05-ffd578937521
2013-09-29 20:11:38 +00:00
Fred Kiefer
1c35214821 * Headers/opal/OpalSurface.h
* Source/opal/OpalSurface.m: Remove compiler warnings.
        * Source/opal/OpalContext.m: Move -flushGraphics method to here.
        * Source/opal/OpalGState.m: Simplify -DPSimage. Evaluate CGCTX
        only once per method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37170 72102866-910b-0410-8b05-ffd578937521
2013-09-29 17:10:26 +00:00
Fred Kiefer
78b3ef9b31 Started cleanup of opal backend.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37167 72102866-910b-0410-8b05-ffd578937521
2013-09-29 07:30:20 +00:00
Eric Wasylishen
84ad6eabc5 * Source/opal/OpalGState.m: move variable declaration outside of for loop
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37149 72102866-910b-0410-8b05-ffd578937521
2013-09-23 19:53:33 +00:00
Ivan Vučica
af62575bee Compile fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37148 72102866-910b-0410-8b05-ffd578937521
2013-09-23 19:51:59 +00:00
Ivan Vučica
0cba103120 Compile fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37147 72102866-910b-0410-8b05-ffd578937521
2013-09-23 19:45:09 +00:00
Ivan Vučica
171af98132 OpalGState: Fixed a compile error (extra #endif). Added -DPSsetdash:::. Added stub -DPSsetstrokeadjust:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37146 72102866-910b-0410-8b05-ffd578937521
2013-09-23 18:57:10 +00:00
Ivan Vučica
653eec3473 Cutting down on junk code and unneeded output.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37145 72102866-910b-0410-8b05-ffd578937521
2013-09-23 18:38:40 +00:00
Ivan Vučica
4815f8b518 Fixed images appearing in bottom left corner first.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37144 72102866-910b-0410-8b05-ffd578937521
2013-09-23 18:29:40 +00:00
Ivan Vučica
595cc19471 Fixes for doublebuffering. (Nearly?) correct implementation of -compositeGState: and -drawGState:. Temporarily fixed image drawing issues by lying about drawing to screen.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37142 72102866-910b-0410-8b05-ffd578937521
2013-09-23 18:04:06 +00:00
Ivan Vučica
ff80e49fb1 Added OPGStateRef tracking and switching at appropriate times. Added OpalGState's -copyWithZone:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37119 72102866-910b-0410-8b05-ffd578937521
2013-09-19 22:39:11 +00:00
Ivan Vučica
2e395b6e20 Enabled doublebuffering. Fixed some debug code, disabled some other
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37111 72102866-910b-0410-8b05-ffd578937521
2013-09-18 21:49:32 +00:00
Eric Wasylishen
b259982fab * Source/opal/OpalFontInfo.m: Use new OPFontGetGlyphWithCharacter to
properly look up the glyph for a character.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37099 72102866-910b-0410-8b05-ffd578937521
2013-09-17 21:51:02 +00:00
Ivan Vučica
a212d292f6 (completing the previous commit)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37097 72102866-910b-0410-8b05-ffd578937521
2013-09-17 21:47:09 +00:00
Ivan Vučica
7bc9e1a05a Fixed erroneous offset of glyphs by taking -defaultLineHeightForFont, multiplying by 0.66, and adding that to pt.y. No idea why 0.66 is the right number.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37095 72102866-910b-0410-8b05-ffd578937521
2013-09-17 21:23:58 +00:00
Ivan Vučica
d9d14649ae Partially fixed -GSShowGlyphsWithAdvances::: by removing some temporary debugging code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37093 72102866-910b-0410-8b05-ffd578937521
2013-09-17 19:42:01 +00:00
Eric Wasylishen
7b4690c515 * Source/opal/OpalFontInfo.m: Move font space to user space conversion
to a separate method. Implement -glyphIsEncoded:, -advancementForGlyph:,
-glyphForCharacter:, -glyphWithName:.

For -boundingRectForGlyph:, and -widthOfString:, return fake, fixed
values.
* Source/opal/OpalContext.m: Fix -isDrawingToScreen implementation;
it now returns YES. This has the unfortunate side effect of breaking
image drawing... but, on the positive side, causes NSLayoutManager
to make calls to GSShowGlyphsWithAdvances in batches of up to
16 glyphs, instead of one at a time...!
* Source/opal/OpalGState.m: Implement -GSSetFont:, and make
-GSShowGlyphsWithAdvances: call CGContextShowGlyphsWithAdvances

Overall state is glyphs are drawn.. they appear upside down,
and the glyph runs only seem to draw at (0, 0).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37087 72102866-910b-0410-8b05-ffd578937521
2013-09-17 06:53:08 +00:00
Ivan Vučica
0027a8bd8b Fixed scale of metrics by using unitsPerEm and pointSize.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37084 72102866-910b-0410-8b05-ffd578937521
2013-09-16 23:20:14 +00:00
Ivan Vučica
3f417045cc Opal backend: Progress on implementing fonts based on Opal's Core Graphics and fontconfig/ classes in gnustep-back.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37082 72102866-910b-0410-8b05-ffd578937521
2013-09-16 22:46:45 +00:00
Ivan Vučica
61cf75b2fc In preparation for reusing this code in the Opal backend, moved fontconfig code to a dedicated set of classes that are now superclasses of Cairo backend's font classes.
Fixed a bug in CairoGState: a NSDebugMLLog() had this obvious mistake in its format (as was printed out by the compiler): @"%self"



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37066 72102866-910b-0410-8b05-ffd578937521
2013-09-10 21:07:03 +00:00
Eric Wasylishen
b56aea123d * Source/x11/XIMInputServer.m: If the requested XIM style
(the GSXIMInputMethodStyle user default) is not available,
fall back to using a stlye that both the X server and
GNUstep support, if any. Also, add support for NoneStyle, which
is for simple input methods that don't have any visualization.
Problem reported and tested by Riccardo.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37065 72102866-910b-0410-8b05-ffd578937521
2013-09-10 20:00:11 +00:00
Ivan Vučica
fe626e1e90 Opal: Implemented -defaultLineHeightForFont, the key to getting
GNUstep layouting system to use information provided in
-advancementForGlyph:.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37058 72102866-910b-0410-8b05-ffd578937521
2013-09-09 21:27:45 +00:00
Fred Kiefer
a5b102b243 * Source/x11/XGGLContext.m,
* Source/x11/XGGLFormat.m: Better error reporting by converting
  glGetError() to a string.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37047 72102866-910b-0410-8b05-ffd578937521
2013-09-08 18:19:12 +00:00
Eric Wasylishen
3ec966768f * Source/x11/XIMInputServer.m: Add the setlocale(LC_CTYPE, "") call
back that I removed last year (r35152).

I tested the fcitx input method, and without the setlocale call,
XOpenIM would fail. I'm not sure what the best plan is in the long
term, I wanted to avoid calling setlocale from the core frameworks
but in this case xlib seems to require it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37002 72102866-910b-0410-8b05-ffd578937521
2013-08-21 22:30:15 +00:00
Ivan Vučica
33979910bd opal: Implementation of -graphicsPort that returns a CGContext. Stubs for -DPSsetlinejoin:, -DPSsetlinecap:, -DPSsetmiterlimit:. Implementation of -DPSimage::::::::::: for 32-bit RGB colorspaces
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36940 72102866-910b-0410-8b05-ffd578937521
2013-08-01 22:28:57 +00:00
Fred Kiefer
e3e2a72eed * Source/gsc/GSContext.m: Replace isa with object_getClass().
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36939 72102866-910b-0410-8b05-ffd578937521
2013-07-29 20:59:38 +00:00
Ivan Vučica
2a8c5f64b3 opal: Correct DPSgsave/restore. Disabled doublebuffering. Work on fixing doublebuffering. Implemented various DPS methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36927 72102866-910b-0410-8b05-ffd578937521
2013-07-25 14:49:44 +00:00
Fred Kiefer
b35ef8791a * Source/win32/w32_movesize.m (-decodeWM_EXITSIZEMOVEParams:::):
Remove code that caused missing windows content.
* Source/cairo/CairoContext.m (-flushGraphics): Add experimental
flush code for Windows.
* Source/cairo/Win32CairoSurface.m (-initWithDevice:, -dealloc):
Clean up HDC handling. Based on patch by Marcian Lytwyn
<marcian.lytwyn@advcsi.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36920 72102866-910b-0410-8b05-ffd578937521
2013-07-24 07:34:24 +00:00
Ivan Vučica
82088f34e0 opal: Switched to NSDebugLLog(). Added linking with CoreBase. Implemented CTM management methods. Added DPSsavegstate and DPSrestoregstate.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36918 72102866-910b-0410-8b05-ffd578937521
2013-07-23 23:18:48 +00:00
Ivan Vučica
a64b9f9058 opal: Various fonts related hacks, as well as further attempts to figure out what's going wrong with painting.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36910 72102866-910b-0410-8b05-ffd578937521
2013-07-21 11:58:05 +00:00
Ivan Vučica
fbe9ad1032 opal: Implementation of a lot of drawing and matrix methods. Work on getting backing store support to work.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36893 72102866-910b-0410-8b05-ffd578937521
2013-07-15 15:24:04 +00:00
Ivan Vučica
0a75b89dd3 Drawing a red rectangle with Opal.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36873 72102866-910b-0410-8b05-ffd578937521
2013-07-11 20:44:32 +00:00
Fred Kiefer
6f2602b8dd * Source/x11/XGServerWindow.m (-setIgnoreMouse::): Completely
rewrite this method to use Xfixes.
        * Source/win32/WIN32Server.m (-setIgnoreMouse::): Implement a
        Windows version of this method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36861 72102866-910b-0410-8b05-ffd578937521
2013-07-09 21:23:20 +00:00
Fred Kiefer
e74cf49cda * Source/x11/XGServerWindow.m (-setIgnoreMouse::): New method
that allows to ignore mouse events for a window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36855 72102866-910b-0410-8b05-ffd578937521
2013-07-08 20:46:07 +00:00
Richard Frith-MacDonald
2fc0d26b47 fix order of use of library and header directories
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36837 72102866-910b-0410-8b05-ffd578937521
2013-07-04 16:44:28 +00:00
Ivan Vučica
9a67894038 ARGB visual is only picked if NSOpenGLPFAAlphaSize is specified in the pixel format.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36821 72102866-910b-0410-8b05-ffd578937521
2013-07-03 16:06:38 +00:00