Commit Graph

48 Commits

Author SHA1 Message Date
Руслан Ижбулатов
ef01e6ee52 GDK W32: Adapt to event filter removal
Add a new W32 backend-specific message filtering mechanism.
Works roughly the same way old event filtering did, but without
events (events are GDK/X11 concept that never really made sense
on W32), so there's no functionality for 'altering' events being
emitted. If an event needs to be emitted in response to a message
do it yourself.

Implemented like this, it should give better performance than
if we were to use GLib signals for this, since W32 sends a LOT
of messages (unlike X11, which doesn't send events as often)
all the time, and invoking the signal machinery on *each* message
would probably be bad.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-03-29 17:43:55 +00:00
Alexander Larsson
4ac450b324 Convert all references to GdkEvent->surface 2018-03-20 16:25:50 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Chun-wei Fan
a601e5d10e gtk/gtkwin32theme.c: Include gdk/gdkprivate.h
We still need to access the GdkEvent structure here directly, as using
the GdkEvent getters is likely not worth the trouble involved.

Please see Emmanuele's comment (#97) of the following bug URL.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:48:01 +08:00
Jaime Velasco Juan
5c6dda0459 gtkwin32theme: delete #if 0 code
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-26 16:25:49 +02:00
Jaime Velasco Juan
7e3f9d6f71 win32 theme: No need to create a DC for GetThemePartSize
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-26 16:25:49 +02:00
Jaime Velasco Juan
77ff3ada62 win32 theme: use TS_TRUE in GetThemePartSize
Several styles return a size of 0x0px when using TS_DRAW, as
we don't pass a RECT to draw into.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-26 16:25:49 +02:00
Benjamin Otte
c73db50aed win32: Implement GetSystemMetric() fallbacks
Default values taken from Wine.
2016-02-21 20:44:36 +01:00
Benjamin Otte
c2dd3c0d89 win32: Move variable definition to not cause gcc warning
It's only used on win32, so only define it there.
2016-02-21 20:44:36 +01:00
Benjamin Otte
eda348d2b5 win32: Handle size queries for all values
Fall back to GetSystemMetrics() whenever GetThemeSysSize() didn't work.
2016-02-21 03:02:36 +01:00
Benjamin Otte
67b893c5f8 win32 theme: Add a way to query border of theme parts 2016-02-17 04:49:26 +01:00
Benjamin Otte
c98007f9fd win32: Add fallback code to draw theme parts 2016-02-17 04:36:18 +01:00
Benjamin Otte
37e3ccb2f6 win32: Split out fallback code into separate file
(1) Actual Windows users don't care about it
(2) It's easier to get rid of
2016-02-17 04:36:18 +01:00
Benjamin Otte
3c0cd8aea4 win32 theme: Include the default win32 colors 2016-02-16 02:53:33 +01:00
Benjamin Otte
f425b5549c win32: Add support for -gtk-win32-part-width/height to CSS
It's unused by now, but I want it for min-width of checks/radios.
2016-02-15 04:41:12 +01:00
Benjamin Otte
3597baf272 win32: Update color handling to recent GtkWin32Theme changes 2016-02-15 04:41:12 +01:00
Benjamin Otte
a1617c6d6d win32: Canonicalize theme-name before adding to hash table
This way, we get rid of du0plicates.
2016-02-15 04:41:12 +01:00
Benjamin Otte
d584e22e02 win32: Add gtk_win32_theme_parse()
So all places can use this function instead of parsing things themselves.
2016-02-15 04:41:12 +01:00
Benjamin Otte
3b19db425e css: Add a number value handling win32 sizes 2016-02-15 04:41:12 +01:00
Benjamin Otte
88b7dfdb1e win32: Move init code into windows-specific code
Avoids warnings about undefined functions on non-windows.
2016-02-11 04:14:28 +01:00
Benjamin Otte
4dfbaccd67 win32 theme: Add a GtkWin32Theme object
This object wraps a HTHEME and takes care of recreating it on theme changes.
2016-02-11 03:44:48 +01:00
Benjamin Otte
1519801878 win32: Capture WM_THEMECHANGED
We're not doing anything useful with it yet. This will follow in the coming commits.
2016-02-11 03:44:48 +01:00
Benjamin Otte
99153ed585 win32: Remove XP-specific code
We don't support XP anymore.
2016-02-11 03:44:48 +01:00
Benjamin Otte
a620a1d688 win32: Remove unused functions / header includes 2016-02-11 03:44:48 +01:00
Benjamin Otte
08ac1504d2 symboliccolor: Implement using GtkCssValue 2012-11-25 02:41:17 +01:00
Benjamin Otte
1367ef7e54 cssstylefuncs: Remove base argument
The GtkCssParser keeps track of the base file now.
2012-05-11 16:42:12 +02:00
Benjamin Otte
1223d53a82 cssparser: Move symbolic color parser to gtksymboliccolor.c 2012-04-17 08:59:19 +02:00
Benjamin Otte
bd400b0957 win32: Move variable declarations into #if block 2012-04-07 13:01:24 +02:00
Alexander Larsson
a4cde82365 win32: Fall back to raleigh with the classic theme
This is not ideal, we should have a real classic windows theme,
but at least its better than everything being pink, which is what
happens otherwise when theming is not enables.
2012-04-03 19:26:15 +02:00
Chun-wei Fan
f32d8be6a5 gtk/gtkwin32theme.c: Remove C99ism 2012-03-21 23:28:43 +08:00
Alexander Larsson
d43632fbdc win32: More theme workaround on XP 2012-03-20 11:36:03 +01:00
Alexander Larsson
cb1a825cc3 win32: Theme statusbars 2012-03-16 16:44:24 +01:00
Alexander Larsson
dcaec2610d win32: Add more theme workarounds on XP 2012-03-15 21:12:33 +01:00
Benjamin Otte
05e6cde97d win32: Fix compiler warning 2012-03-15 02:55:25 +01:00
Alexander Larsson
e9f070db0f win32: Fix up toolbar rendering on XP
It seems XP doesn't correctly set the alpha when rendering toolbar
buttons on an alpha target, we fix this up afterwards if necessary.
2012-03-13 17:10:44 +01:00
Alexander Larsson
f4a68dff88 Fix rendering of theme parts on Windows XP
It seems XP doesn't handle drawing non-alpha theme parts
on alpha destinations. We fix this by using alpha bitmaps only when
needed.

However this means any non-drawn area by the theme part is now draw
black, so we must take more care to only draw where the theme part draws,
so we find the theme part size when available.
2012-03-09 16:43:00 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
d021ed7c5e win32: Remove GtkWin32ThemePart
Its job is done by GtkCssImage now.
2012-01-09 18:37:57 +01:00
Benjamin Otte
8f42f8c554 win32: Export _gtk_win32_theme_part_create_surface() 2012-01-09 18:37:56 +01:00
Benjamin Otte
590b125ffc win32: Export _gtk_win32_lookup_htheme_by_classname() 2012-01-09 18:37:56 +01:00
Alexander Larsson
21c7e8cf47 win32-theme: Support custom margins in win32 theme parts 2011-11-28 09:13:54 +01:00
Alexander Larsson
7c092be0ce win32-theme: Make syntax for mixing theme parts more regular
This lets us extend the argument list better
2011-11-28 08:58:41 +01:00
Alexander Larsson
5f782d2449 win32-theme: Support mixing parts
We need this to do something about the non-existing inconsistent
radio button state in win32.
2011-11-18 11:06:32 +01:00
Alexander Larsson
3309639c1c Add support for win32 theme colors as symbolic colors 2011-11-18 10:16:38 +01:00
Alexander Larsson
fdbf029df3 win32-theme: Support multiple parts being combined
This is needed for e.g. scrollbar sliders
2011-11-17 14:34:39 +01:00
Alexander Larsson
bc38cf1ff8 win32-theme: Support -gtk-win32-size CSS value 2011-11-17 12:30:08 +01:00
Alexander Larsson
abe6598a13 Add initial cut at win32 theme support for CSS
We now support -gtk-win32-theme-part(class,part,state) in background
and border-image CSS properties. This renders the corresponding
theme part using DrawThemeBackground() and acts as a base for a
CSS based windows theme.

Note that we build the parsing code even on non-win32 so that
all themese will parse the same on all arches. We draw pink instead
of the actual theme parts on non-win32 though.
2011-11-17 12:29:03 +01:00