Compare commits

...

791 Commits

Author SHA1 Message Date
Matthias Clasen
1ae7240932 Update callers
Adapt all our tests and examples to the new initialization api.
2016-12-28 18:57:55 -05:00
Matthias Clasen
a3e2fc2df6 Drop gdk init api
Supporting separately initialized gdk is just not worth it.
2016-12-28 18:57:39 -05:00
Matthias Clasen
deed306e5a Drop arguments from gtk_init
This is our ultimate goal: no more commandline argument handling.
Lots of callers will have to be updated.
2016-12-28 08:49:37 -05:00
Matthias Clasen
9cc64449a8 Simplify initialization code
Now that gtk_get_option_group and gtk_parse_args are no longer
public, we can get rid of them.
2016-12-28 07:46:56 -05:00
Matthias Clasen
72877343fd Drop the --gtk-debug and --gtk-no-debug options
We have environment variables that cover this.
2016-12-27 18:49:30 -05:00
Matthias Clasen
8a816dbc19 Drop the --g-fatal-warnings argument
We don't need it, GLib has an environment variable for this.
2016-12-27 18:48:02 -05:00
Matthias Clasen
002d616ca4 Drop the --gtk-modules argument
We don't need it; the environment variable is enough.
2016-12-27 18:46:45 -05:00
Matthias Clasen
3ea1b37aff Don't export gtk_get_option_group
We want to get rid of commandline option handling in GTK+.
This is a step in that direction.
2016-12-27 18:45:53 -05:00
Matthias Clasen
1d6435db48 Stop exporting gtk_parse_args
We want to stop handling commandline arguments, and that is the
sole purpose of this function. So it has to go
2016-12-27 18:36:19 -05:00
Matthias Clasen
5b411031ba Drop gtk_init_with_args
We want to simplify our initialization code and remove all commandline
argument handling from it. The first stop for this is to reduce the
number of gtk_init variants we have.
2016-12-27 18:31:03 -05:00
Benjamin Otte
68b39a4727 gsk: Add GSK_RENDERING_MODE=full-redraw
Forces a full redraw every frame.
This is done generically, so it's supported on every renderer.

For widget-factory first page (with the spinner spinning and progressbar
pulsing), I get these numbers per frame:

action                  clipped         full redraw
snapshot                   0ms           7-10ms
cairo rendering            0ms          10-15ms
Vulkan rendering         3-5ms          18-20ms
Vulkan expected *          0ms            1-2ms
GL rendering            unsupported     55-62ms

* expected means disabling rendering of unsupported render nodes,
instead of doing fallback drawing. So it overestimates the performance,
because borders and box-shadows are disabled.
2016-12-27 00:48:00 +01:00
Benjamin Otte
a5f8a74ec1 vulkan: Only render minimal region
It's faster to render once for every rectangle in the clip region than
rendering the outline of the clip region.
Especially because this reduces the time necessary to build up the frame
data.

In widget-factory (where we have 3 rectangles), this leads to a 5x
speedup in the rendering time rendering alone.
Snapshotting time goes from 10ms to ~1ms, which is another huge
improvement.
2016-12-27 00:31:33 +01:00
Benjamin Otte
293248c1d3 gdkvulkan: Track changes per swapchain image
... and use those in begin_frame() to ensure all of the invalid area
gets invalidated.
2016-12-26 22:24:22 +01:00
Benjamin Otte
af917c4ade vulkan: Handle linear gradients
Note: We interpolate premultiplied colors as per the CSS spec. This i
different from Cairo, which interpolates unpremultiplied.

So in testcases with translucent gradients, it's actually Cairo that is
wrong.
2016-12-26 17:22:02 +01:00
Benjamin Otte
c0c44c7b9c tests: Add linear gradient test 2016-12-26 17:22:02 +01:00
Benjamin Otte
573ceb0340 tests: Add a patternspec argument for test creation
That way, I don't need to recreate all the tests I don't care about.

This is particularly useful when I want to change the size of the
testcase.
2016-12-26 17:22:01 +01:00
Benjamin Otte
d7e867aa95 tests: Make rendernode --dump-variant actually work 2016-12-26 17:22:01 +01:00
Benjamin Otte
3c8518dce3 gsk: Add missing Mozilla copyright header
I stole one of their shader functions, and if I steal, I might as well
do it right.
2016-12-26 17:22:01 +01:00
Benjamin Otte
599cc995f3 css: Handle repeating gradients with only one offset
Example:
  repeating-linear-gradient(red 50%, blue 50%)

Those gradients in Firefox draw a solid image of the last color, so do
the same here.
2016-12-26 17:22:01 +01:00
Benjamin Otte
5017c3be65 gsk: Insist on ordered color stops
I don't want to sort them later for the shader preparation, so make
sure they come in ordered.
2016-12-26 17:22:01 +01:00
Benjamin Otte
3a79b17309 vulkan: Fix coordinate setup
This makes rendering textures work when the top left of the rendered
texture is not at (0, 0).
2016-12-26 17:22:01 +01:00
Benjamin Otte
c7083a5d37 tests: Make sure number of runs is 1. 2016-12-26 17:22:01 +01:00
Daniel Boles
2a7171534e Box: Restore an accidentally deleted comment
Also, split a MAX() onto its own line to match the others.
2016-12-26 10:57:51 +00:00
Daniel Boles
71bbd8881f Box: avoid recalc/reassignments, improve var names
Homogeneous branches repeated the calculation/assignment of the initial
space available to children. This avoids that by shuffling some code.

Perhaps more importantly, in doing that, I ended up with some ambiguous
names, and Company and I realised how vague the pre-existing naming was.
"size" becomes "extra_space", as this is what it represents. Conversely,
"extra" becomes "size_given_to_child" (albeit still given out in two
different ways depending on whether the Box is homogeneous). My hope is
that these sections of code are now somewhat less baffling than before!
2016-12-25 23:16:14 +00:00
Daniel Boles
5d10174031 Box: Don't unnecessarily repeat a function call
The spacing was already saved in a variable just above.
2016-12-25 21:46:40 +00:00
djb
476cadc7f8 tests: Remove executable bit from C files 2016-12-25 21:46:40 +00:00
Benjamin Otte
78582dd5e9 tests: Fix logic to detect argument length 2016-12-25 06:23:12 +01:00
Benjamin Otte
eacf725778 tests: Add a --runs argument to rendernode
This way we can rerun fast tests lots of times - not so much for
averaging times, but more for sysprof'ing.
2016-12-25 06:23:12 +01:00
Benjamin Otte
c99b46c46d tests: Add another test
In this test, Cairo is almost as fast as Vulkan. I wonder why.
2016-12-25 06:23:12 +01:00
Benjamin Otte
5878f9d8af vulkan: Add shader for color drawing with rectangle clip 2016-12-25 06:23:12 +01:00
Benjamin Otte
b30225e67c vulkan: We use VK_FORMAT_B8G8R8A8_UNORM
... not SRGB. SRGB messes up alpha compositing, GdkRGBA and everything
else.
2016-12-25 06:23:12 +01:00
Marek Černocký
16a9a82021 Updated Czech translation 2016-12-24 14:40:35 +01:00
Benjamin Otte
aa0ec774bf vulkan: Add proof-of-concept clip implementation
We can now clip to cicular rounded rectangles when drawing colors.
2016-12-24 06:19:16 +01:00
Benjamin Otte
81c487b841 vulkan: Fold clip into push constants
As a side effect, the clipping data is now available inside shaders.

Not that any shader would use them yet, but they could!
2016-12-24 06:19:16 +01:00
Benjamin Otte
18b65a2378 vulkan: Change handling of push constants
Instead of storing the wire format, store the true structs and only
convert to the wire format when needed.
2016-12-24 06:19:16 +01:00
Benjamin Otte
b11b7dfb1a gsk: Add debug category for fallbacks
... and use it for the cases in Vulkan where we fall back to Cairo.
2016-12-24 06:19:16 +01:00
Benjamin Otte
2bca24c455 gsk: Add GskVulkanClip
This is now tracking the clips added by the clip nodes.
If any particular node can't deal with a clip, it falls back to Cairo
rendering. But if it can, it will render it directly.
2016-12-24 06:19:16 +01:00
Benjamin Otte
1d84555729 iconhelper: Invalidate style before accessing texture
Invalidating the style might cause invalidation of the texture. So we
end up with a pointer to freed memory.
SAD!
2016-12-24 06:19:16 +01:00
Benjamin Otte
89d38ae93f vulkan: Try combining draw calls
This gives a 5-7% speedup in the case where we're just drawing N colors
and nothing else. So it;s not tremendously useful, but noticeable.
2016-12-24 06:19:16 +01:00
Garrett Regier
23d10df6c6 gsk: Fix memory leak in gsk_render_node_write_to_file() 2016-12-23 07:22:41 -08:00
Piotr Drąg
2750bb5e87 Update POTFILES.in 2016-12-23 16:18:23 +01:00
Benjamin Otte
6cc08d60ef calendar: Implement snapshot() 2016-12-23 12:07:22 +01:00
Benjamin Otte
b97e4e8631 tests: Improve rendernode test further
- Print benchmark output in fallback path
- Always run rendering, even when no filename given
- Don't require a filename when running with --benchmark
2016-12-23 11:31:35 +01:00
Benjamin Otte
a36e5ceea7 cellrenderer: Remove render() vfunc
Make the last 2 cell renderers create the cairo node themselves.
2016-12-23 11:11:52 +01:00
Benjamin Otte
513a8c46af cellrendererpixbuf: Implement snapshot() 2016-12-23 10:50:04 +01:00
Benjamin Otte
a0f65d16bc cellrendererprogress: Implement snapshot() 2016-12-23 10:44:49 +01:00
Benjamin Otte
b901572d86 cellrenderertoggle: Implement snapshot() 2016-12-23 09:31:54 +01:00
Benjamin Otte
c412a717f1 cellrenderertext: Implement snapshot() 2016-12-23 09:23:07 +01:00
Benjamin Otte
677c5bdedf cellrenderer: Move snapshotting down into cell renderers
Now that every call to GtkCellArea is a snapshot call and no more cairo
calls are left, move the actual differentiation between Cairo and
Snapshot down to the cell renderer.
2016-12-23 09:23:04 +01:00
Benjamin Otte
af6e7cc169 tests: Add rendernode-create-tests
Little tool that creates a bunch of test files to throw add the
rendernode binary.
They should really be part of a testsuite, but we have none, so OI just
put them here.
2016-12-23 08:11:01 +01:00
Benjamin Otte
4bb0c70c11 gsk: Add docs and error handling to serialization API 2016-12-23 08:11:01 +01:00
Benjamin Otte
4e866ec06b tests: Add some command-line flags to rendernode 2016-12-23 08:11:01 +01:00
Benjamin Otte
5e089c4345 gsk: Add gsk_render_node_write_to_file()
For when you're in a debugger and need to have a closer look at this
node...
2016-12-23 08:11:01 +01:00
Benjamin Otte
087ea8e531 gsk: Warn on cairo errors during gsk_render_node_draw()
It's the same warning we use inside GTK for when stuff weirdly goes
wrong.
2016-12-23 08:11:01 +01:00
Benjamin Otte
08f9a6078b gsk: Include config.h
The more you know:
Not including config.h causes the public API implemented in this file to
not be exported in the resulting library.
2016-12-23 08:11:01 +01:00
Benjamin Otte
adcde3034e gsk: Implement gsk_renderer_render_texture() on GL 2016-12-23 08:11:01 +01:00
Benjamin Otte
786d3a013e vulkan: Implement gsk_renderer_render_texture() 2016-12-23 08:11:01 +01:00
Benjamin Otte
b0d5224de5 tests: Use gsk_renderer_render_texture()
Only keep the version that calls gsk_render_node_draw() if people
specify the --fallback option.

The actual renderer selection works just as for regular GTK. The easiest
way to influence it is setting the GSK_RENDERER environment variable.
2016-12-23 08:11:01 +01:00
Benjamin Otte
6c56793147 gsk: Add gsk_texture_download() API
Now users can download pixels and make everything slooooooow.
2016-12-23 08:11:01 +01:00
Benjamin Otte
d58799ff7a gdk: Export gdk_cairo_surface_paint_pixbuf() into private header 2016-12-23 08:11:01 +01:00
Benjamin Otte
be8c999fe8 docs: Add GskTexture 2016-12-23 08:11:01 +01:00
Benjamin Otte
2d2209859e gsk: Rename to gsk_texture_download_surface()
I want to reuse the name gsk_texture_download() for downloading the
actual bytes.
2016-12-23 08:11:01 +01:00
Benjamin Otte
373e08d6d4 gsk: Add gsk_renderer_render_texture()
... and implement it for the Cairo renderer.

It's an API that instructs a renderer to render to a texture.
So far this is mostly meant to be used for testing, but I could imagine
it being useful for rendering DND icons.
2016-12-23 08:11:01 +01:00
Benjamin Otte
98086014d8 gskcairo: Don't store the viewport in the global struct
Just query it locally.
2016-12-23 08:11:01 +01:00
Benjamin Otte
d2622d93ad gsk: Don't overdraw with transparent
That code doesn't do anything.

And what the code should be doing (clearing the abckground) isn't
necessary as cairo drawing is guaranteed to clear the surface.
2016-12-23 08:11:01 +01:00
Benjamin Otte
df5e12fc1d rendernode: Fix typo 2016-12-23 08:11:00 +01:00
Benjamin Otte
814b66e1a8 gsk: Remove nonexisting functions
The function was removed when gsk_render_node_draw() was and
gsk_renderer_realize() was refactored respectively.
2016-12-23 08:11:00 +01:00
Benjamin Otte
b4ac7ffed4 tests: Add a simple test to convert rendernode to png
Takes a rendernode file, outputs a PNG. Nothing more.
2016-12-23 08:11:00 +01:00
Benjamin Otte
735846cc82 gsk: Export gsk_render_node_get_bounds()
I'll need it in tests/testsuite soon.
2016-12-23 08:11:00 +01:00
Benjamin Otte
91c71b10e6 inspector: Add a render node save button
Now we can select buggy nodes, save them to a file, and add that file to
our testsuite.
2016-12-23 08:11:00 +01:00
Benjamin Otte
c88d279416 gsk: Add gsk_render_node_serialize/deserialize()
This does a conversion to/from GBytes and is intended for writing tests.

It's really crude but it works.
And that probably means Alex will (ab)use it for broadway.
2016-12-23 08:11:00 +01:00
Benjamin Otte
3a38bc9bf7 gsk: Remove spread member from GskShadow
I had originally thought I'd use GskShadow for box-shadow, but didn't in
the end.

So now it's only used for text-shadow and icon-shadow, and those don't
have a spread.
2016-12-23 08:11:00 +01:00
Marek Černocký
5fa1733944 Updated Czech translation 2016-12-22 23:50:53 +01:00
Benjamin Otte
0efeaf9508 treeview: Port rest of stuff to snapshot()
The only thing still drawn with Cairo are grid lines.
2016-12-22 03:37:32 +01:00
Benjamin Otte
f1825f5eff treeview: Partially convert to snapshot()
The big fat scary bin drawing function that actually draws the cell
renderers - that one is still missing.
2016-12-22 03:37:32 +01:00
Chun-wei Fan
23edff1606 gtkcssimagelinear.c: Avoid VLAs
VLAs are not supported by Visual Studio and possibly other compilers that
are supported by GTK+-3.90+, and probably never will be, although it is a
C99 specification, and it became optional for C11.  It is also not a part
of the newer compiler requirements that are listed out for GTK+-3.90.x.

There exist concerns about the implementation of VLAs in compilers that
support them as well, so change it to a g_newa() approach.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-22 08:40:32 +08:00
Matthias Clasen
e64947662a 3.89.2 2016-12-21 14:12:31 -05:00
Matthias Clasen
a2f0c860ee Fix distcheck 2016-12-21 14:12:31 -05:00
Matthias Clasen
924efd988d Fixes for the gdk docs 2016-12-21 13:57:16 -05:00
Matthias Clasen
961286b7cd Make gsk docs build 2016-12-21 13:57:16 -05:00
Rico Tzschichholz
a571e53491 snapshot: Fix some annoations 2016-12-21 18:16:34 +01:00
Rico Tzschichholz
2b4dfeec7c gsk: Fix build of 22110ef5a4 2016-12-21 18:15:50 +01:00
Alexander Larsson
230d27b079 GskRenderNode: Use C99 flexible arrays to avoid extra allocation
Instead of a separate allocation for any arrays in the render node
we allocate these as part of the render node itself, using C99
flexible arrays.

This leads to less allocations, which is nice, but the major reason
for this is that it allows us to change the allocation scheme further
in the future. For instance, we want to do stack-like allocation so
that all the render-nodes for an entire frame are allocated in one
(or a few) chunks.
2016-12-21 14:01:34 +01:00
Alexander Larsson
22110ef5a4 gsk: Add bounds member to RenderNode
Instead of constantly recalculating this (especially recursively for
parents!) we do it only on construction, because everything is
immutable anyway. Also, most nodes had a bounds already and can
use the new parent member instead.

We also do direct access to the node bounds rather than calling
gsk_render_node_get_bounds in various places, which means
we do less copying.
2016-12-21 14:01:34 +01:00
Alexander Larsson
2d4b46f4f9 gsk: Drop gsk_render_node_make_immutable, nodes are always immutable 2016-12-21 14:01:34 +01:00
Alexander Larsson
4ee45b76ca gsk docs: gsk_render_node_iter_get_type doesn't exist anymore 2016-12-21 14:01:34 +01:00
Baurzhan Muftakhidinov
cfade39459 Update Kazakh translation 2016-12-21 10:56:38 +00:00
Christian Kirbach
24eeea46fa Update German translation
(cherry picked from commit e0856226c5)
2016-12-20 19:11:43 +00:00
Benjamin Otte
def94f03e2 debug: Add GTK_DEBUG=snapshot
This causes the snapshotting algorithm to dump all widget nodes into
their own container node. We then name that group accordingly (ie
"GtkSwitch<0xdeadbeef>") so you can easily see which node belongs where.

The feature is toggleable in the inspector's visual tab.

There's a few problems with it, becuse GtkSnapshot optimized container
nodes away if they are not needed, so we are losing some widgets...
2016-12-20 19:26:40 +01:00
Benjamin Otte
acaa04c031 revealer: Implement snapshot()
The revealer needs to clip the child during animations, whcih draw() did
automatically, but snapshot() does not.
2016-12-20 19:26:40 +01:00
Benjamin Otte
c4065b9ee0 API: Export gtk_container_snapshot_child()
It's equivalent to gtk_container_propagate_draw() and then one is
public, too.
2016-12-20 19:26:40 +01:00
Benjamin Otte
22a657004b debug: Remove pixel-cache debug categories
We have no more pixel cache, so they are kind of useless.
2016-12-20 19:26:40 +01:00
Debarshi Ray
2cbe057351 flowbox: Don't emit child-activated while dragging the pointer
https://bugzilla.gnome.org/show_bug.cgi?id=776306
2016-12-20 18:48:03 +01:00
Benjamin Otte
1b553478f6 cssimageradial: Handle "partial" gradients correctly
When the first/last color stop is not at 0%/100%, we need to start the
repeating at their offsets and not at 0%/100%.

Attached reftest demonstrates the problem.
2016-12-20 18:01:12 +01:00
Benjamin Otte
6c20ddc119 searchbar: Implement snapshot() 2016-12-20 18:01:12 +01:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Benjamin Otte
613194a246 colorswatch: Implement snapshot 2016-12-20 18:01:12 +01:00
Benjamin Otte
4d9eedafcd roundedbox: Add gtk_rounded_boxes_init_for_style()
Instead of making people intiialize a rectangle and then applying border
radius manually, provide a constructor that does it for them.
While doing that, also allow people to instead request the padding box
or the content box.

Refactor all relevant code to use this new constructor.
2016-12-20 18:01:12 +01:00
Benjamin Otte
95a2a5c54c gtk: Remove GtkJunctionSides 2016-12-20 18:01:12 +01:00
Benjamin Otte
f2f5941d65 testgtk: Remove resize grips example
Resize grips are gone. And just showing an empty window is not terribly
exciting.
2016-12-20 18:01:12 +01:00
Benjamin Otte
3f75b11982 frame: Implement snapshot() 2016-12-20 18:01:12 +01:00
Benjamin Otte
c87db76cb5 iconview: Implement snapshot() 2016-12-20 18:01:12 +01:00
Benjamin Otte
94e906c802 cellview: Implement snapshot()
This also adds gtk_cell_area_snapshot().
2016-12-20 18:01:12 +01:00
Benjamin Otte
2034e83a20 gsk: Add GskOutsetShadowNode 2016-12-20 18:01:12 +01:00
Benjamin Otte
fcc1f554d6 gsk: Add GskInsetShadowNode
And again lots of shadow code gets copied to GSK. But we're now almost
at a stage where widget-factory does not use cairo nodes anymore.
2016-12-20 18:01:12 +01:00
Benjamin Otte
4fc64ae3dd gsk: Add contains/intersect functions for GskRoundedRect
... and use them.
2016-12-20 18:01:12 +01:00
Benjamin Otte
2480e0d575 gsk: Add GskShadowNode
... and make the icon rendering code use it.

This requires moving even more shadow renering code into GSK, but so be
it. At least the "shadows not implemented" warning is now gone!
2016-12-20 18:01:12 +01:00
Benjamin Otte
071c9a8221 API: gdk: Add gdk_rgba_is_clear() and gdk_rgba_is_opaque()
I want to use these inside GSK, and I'm not a fan of putting GdkRGBA
APIs into it or duplicating it into GTK.

So public API it is.
2016-12-20 18:01:12 +01:00
Benjamin Otte
15e8a22f08 gsk: Move gtk/gtkcairoblur.c to gsk/gskcairoblur.c 2016-12-20 18:01:11 +01:00
Benjamin Otte
6e31fc4300 inspector: Print node type in node properties 2016-12-20 18:01:11 +01:00
Benjamin Otte
75b76af221 gsk: Add GskBorderNode
The node draws a solid CSS border, which can be used to cover everything
but dashed and dotted borders (double, groove, inset, ...).

For different border styles, we overlay multiple nodes and set their
colors to transparent for sides with non-matching styles.
2016-12-20 18:01:11 +01:00
Benjamin Otte
9af468cdec gtk: Remove unused argument from function 2016-12-20 18:01:11 +01:00
Benjamin Otte
a9809e5d30 gsk: Add gsk_rounded_rect_shrink()
... and replace _gtk_rounded_box_grow() and _gtk_rounded_box_shrink()
with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
1760e0d3f3 vulkan: Get rid of color in push constants
The color comes in instance data now, no need to abuse push constants
for it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
1b90ce6b33 vulkan: Remove color from push constants
It's now handled by the color pipeline.
2016-12-20 18:01:11 +01:00
Benjamin Otte
b04eecf860 vulkan: Pass color rects in instance data
This way, we don't need push constants or per-vertex data, we can render
colored rectangles completely via instance data.
2016-12-20 18:01:11 +01:00
Benjamin Otte
4c74695a85 vulkan: Don't pass texture coordinates to the color pipeline 2016-12-20 18:01:11 +01:00
Benjamin Otte
5dfb74c70c vulkan: Get vertex description from pipeline subclass 2016-12-20 18:01:11 +01:00
Benjamin Otte
b4f04d0c1d vulkan: Split color and blend pipelines 2016-12-20 18:01:11 +01:00
Benjamin Otte
e68b18aa4e vulkan: Move vertex data tracking to the pipeline subclass
That way, different pipelines can draw different kinds of data.
2016-12-20 18:01:11 +01:00
Benjamin Otte
9aecd6dd56 vulkan: Add GskVulkanBlendPipeline
So far that's just a simple pipeline that doesn't do anything.
2016-12-20 18:01:11 +01:00
Benjamin Otte
453478719d vulkan: Make GskVulkanPipeline derivable 2016-12-20 18:01:11 +01:00
Benjamin Otte
65e9894450 menu: Implement snapshot() for the menu code 2016-12-20 18:01:11 +01:00
Benjamin Otte
e492a63e4c paned: Implement snapshot() 2016-12-20 18:01:11 +01:00
Benjamin Otte
8ad7c435ca cssimage: Implement snapshot() for cross-fade 2016-12-20 18:01:11 +01:00
Benjamin Otte
9822fe81a3 snapshot: Implement gtk_snapshot_push_opacity()
Use it in GtkWidget's opacity handling.
2016-12-20 18:01:11 +01:00
Benjamin Otte
6b29dbf26a snapshot: Handle NULL returns in pop_and_append() 2016-12-20 18:01:11 +01:00
Benjamin Otte
30438c6e8b gsk: Add cross-fade node
And implement stack crossfades with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
3e4fd32b54 vulkan: Batch upload image barriers together
Doesn't seem to help much though...
2016-12-20 18:01:11 +01:00
Benjamin Otte
7b9ace488b vulkan: Add GskVulkanUploader
It's the thing that makes sure pixels end up on the GPU.
2016-12-20 18:01:11 +01:00
Benjamin Otte
85559d1fd9 vulkan: Split out command pool
This way we can pass the command pool around.
And that allows us to allocate and submitcustom buffers.
And that is necessary to make staging images work.
2016-12-20 18:01:11 +01:00
Benjamin Otte
ba7ac637bc vulkan: Implement staging-buffer image upload
This is not enabled by default. Use GSK_RENDERING_MODE=staging-buffer to
use the code.
2016-12-20 18:01:11 +01:00
Benjamin Otte
81297857cc snapshot: Convert Range, Scale, ColorScale
And of course Scrollbar, but that one does no drawing itself.
2016-12-20 18:01:11 +01:00
Benjamin Otte
3ef03c8bc0 gsk: Check for NULL in calls to gsk_cairo_node_get_surface()
That function does actually sometimes return NULL and is documented to
do so, so handle that case in the renderers (by omitting the node).
2016-12-20 18:01:11 +01:00
Benjamin Otte
e8cd71228a gsk: Implement linear gradient render nodes 2016-12-20 18:01:11 +01:00
Benjamin Otte
cf520b7a1f gsk: Add blend nodes
Implement blend mode support in GTK background compositing with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
3e26fadb24 css: Replace custom blend modes with GskBlendMode 2016-12-20 18:01:11 +01:00
Benjamin Otte
2118f394d2 gsk: Add missing blend modes
This brings GSK blend modes in line with the CSS spec.
2016-12-20 18:01:11 +01:00
Benjamin Otte
08a2a29c26 vulkan: Add infrastructure for multiple pipelines
And use it to draw solid colors with a 2nd pipeline.
2016-12-20 18:01:11 +01:00
Benjamin Otte
7d837a2ae6 vulkan: Split PipelineLayout into its own object
This way, we can share the layout between different pipelines.
2016-12-20 18:01:11 +01:00
Benjamin Otte
f4f0dba5c6 vulkan: Split render ops into seperate structs
This makes it a lot clearer which members are relevant for each
different operation.
2016-12-20 18:01:11 +01:00
Benjamin Otte
62eb9d42aa vulkan: Add infrastructure for push constants
THe code includes fragment push constants for colors, but that code is
so far unused.
2016-12-20 18:01:10 +01:00
Benjamin Otte
58b2c1d009 cssimage: Port a few more simple ones to snapshots 2016-12-20 18:01:10 +01:00
Benjamin Otte
cd68c93b4c render: Fall back later when rendering backgrounds
We can now render most backgrounds fine.
2016-12-20 18:01:10 +01:00
Benjamin Otte
3d5173d4ac gtk: Fix memleaks
It turns out, some simple getters - such as
gdk_drawing_context_get_clip() - love copying things before returning
them.

I guess somebody has to burn cycles...
2016-12-20 18:01:10 +01:00
Benjamin Otte
dd1cf1ac0f css: An opaque background does not allow omitting push_group
When the background-clip of the background is smaller than the
background-clip of blended images, not pushing a group is wrong.

Test testing exactly that included.
2016-12-20 18:01:10 +01:00
Benjamin Otte
23e35706b4 gsk: Add support for rounded clip rectangles
Also add support to GtkSnapshot, so people can push rounded clips.
2016-12-20 18:01:10 +01:00
Benjamin Otte
f96f16899d roundedbox: Remove _gtk_rounded_box_path()
Use gsk_rounded_rect_path() instead.

That's a private GSK function, be we can just include its header.
2016-12-20 18:01:10 +01:00
Benjamin Otte
fa9b0f9965 roundedbox: Remove _gtk_rounded_box_move()
Use gsk_rounded_rect_offset() instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
e26f84fca0 gtk: Remove GtkRoundedBox struct
Use GskRoundedRect instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
a2dfb1e93f roundedbox: typedef to GskRoundedRect 2016-12-20 18:01:10 +01:00
Benjamin Otte
c04bece131 roundedbox: Use a graphene_size_t for the corners
Obviously, I'm trying to port GtkRoundedBox to GskRoundedRect.

This is the second step on that path.
2016-12-20 18:01:10 +01:00
Benjamin Otte
6d012fb4ea gtk: Get rid of GtkCssCorner
We have GskCorner now which is identical.
2016-12-20 18:01:10 +01:00
Benjamin Otte
59d638a09f gsk: Add GskRoundedRect
It's essentially a port of GtkRoundedBox to graphene.
2016-12-20 18:01:10 +01:00
Benjamin Otte
0a0cbcdcb6 viewport: implement snapshot() 2016-12-20 18:01:10 +01:00
Benjamin Otte
b0175421f2 stack: Implement snapshot()
This uses the new push()/pop() mechanism to its fullest extent when
implementing transitions. It's fun to inspect the results in the
inspector.

Crossfades don't work yet, they continue using a Cairo fallback.

A side effect of the stack conversion is that widget-factory now uses
snapshots for a lot more things.
2016-12-20 18:01:10 +01:00
Benjamin Otte
1137483d15 snapshot: Work on pushing and popping again
It is now possible to call push() subfunctions for simple container
nodes with just a single child. So you can for example
gtk_snapshot_push_clip() a clip region that all the nodes that get
appended later will then obey.

gtk_snapshot_pop() will then not return a container node, but a clip
node containing the container node (and similar for the transform
example).

This is implemented internally by providing a "collect function" when
pushing that is called when popping to collects all the accumulated
nodes and combine them into the single node that gets returned.

To simplify things even more, gtk_snapshot_pop_and_append() has been
added, which pops the currently pushed node and appends it to the
parent.

The icon rendering code has been converted to this approach.
2016-12-20 18:01:10 +01:00
Benjamin Otte
1f988d8b05 gsk: Add gsk_clip_node_new()
The node is a simple clipping node: It does a rectangular clip of its
contents.
2016-12-20 18:01:10 +01:00
Benjamin Otte
68a54ae81f stack: Don't draw an extra background
The gadget draws a background for us, we don't need another one.
2016-12-20 18:01:10 +01:00
Benjamin Otte
07d39299ea gsk: Replace gsk_render_node_set_opacity()
... with gsk_opacity_node_new().

Also implement support for opacity in gtk_widget_snapshot() using this
new node.
2016-12-20 18:01:10 +01:00
Benjamin Otte
671d43b873 cssimage: Implement snapshot() in the fallback image 2016-12-20 18:01:10 +01:00
Benjamin Otte
ed6643cf69 cssimage: Use textures in GtkCssImageSurface
We now use textures instead of surfaces and implement the snapshot()
vfunc instead of draw().
2016-12-20 18:01:10 +01:00
Benjamin Otte
429346fa7e cssimage: Implement a fallback draw() vfunc
... that chains into snapshot. This way, we can stop implementing draw()
in GtkCssImage subclasses and focus on snapshot() instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
c258ee403a snapshot: Make gtk_snapshot_get_renderer() private
Public API doesn't need to be concerned with renderers. Worst case, they
can use NULL instead of the actual renderer.
2016-12-20 18:01:10 +01:00
Benjamin Otte
e6d423e0e2 gsk: Remove gsk_renderer_create_fallback()
Use gsk_render_node_draw() instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
b120075698 snapshot: Add API for colors and textures 2016-12-20 18:01:10 +01:00
Benjamin Otte
ee9aca882d gsk: Add fallback code to renderers
This code makes renderers fall back to Cairo rendering if they don't
know how to handle a render node's type.

This allows adding new render nodes with impunity.
2016-12-20 18:01:10 +01:00
Benjamin Otte
6129daf29b gsk: Add gsk_color_node_new() 2016-12-20 18:01:10 +01:00
Benjamin Otte
361e2cda27 Call gsk_render_node_draw() instead of creating fallback renderers 2016-12-20 18:01:10 +01:00
Benjamin Otte
e82d02432e gsk: Add gsk_render_node_draw()
Draws a node to a given cairo_t. This is mostly intended for fallback
usage.
2016-12-20 18:01:10 +01:00
Benjamin Otte
02131d590e snapshot: Change how gtk_snapshot_push/pop works
Instead of appending a container node and adding the nodes to it as they
come in, we now collect the nodes until gtk_snapshot_pop() is called and
then hand them out in a container node.

The caller of gtk_snapshot_push() is then responsible for doing whatever
he wants with the created node.

Another addigion is the keep_coordinates flag to gtk_snapshot_push()
which allows callers to keep the current offset and clip region or
discard it. Discarding is useful when doing transforms, keeping it is
useful when inserting effect nodes (like the ones I'm about to add).
2016-12-20 18:01:10 +01:00
Benjamin Otte
ca80e9decf snapshot: Handle clip region as part of the state
This is in preparation for further changes.
2016-12-20 18:01:10 +01:00
Benjamin Otte
67fb129ed7 gsk: gsk_render_node_set_transform() => GskTransformNode
Instead of having a setter for the transform, have a GskTransformNode.

Most of the oprations that GTK does do not require a transform, so it
doesn't make sense to have it as a primary attribute.

Also, changing the transform requires updating the uniforms of the GL
renderer, so we're happy if we can avoid that.
2016-12-20 18:01:10 +01:00
Benjamin Otte
19753062c4 gsK: Move children handling to GskContainerNode 2016-12-20 18:01:09 +01:00
Benjamin Otte
e2625f8649 gsk: Remove GskRenderNode::parent
... and all related APIs.
2016-12-20 18:01:09 +01:00
Benjamin Otte
d691dfc894 inspector: Prepare TreeModelRenderNode for brave new world
I'm about to move children handling to the container node, which means
the generic code can no longer assume children APIs existing.

So rewrite the treemodel to work without it.
2016-12-20 18:01:09 +01:00
Benjamin Otte
a8f2b3e75e gsk: Remove world matrix support
Use the real transform and compute it manually.
2016-12-20 18:01:09 +01:00
Benjamin Otte
3eb7c4719b gsk: Remove gsk_render_node_set_bounds()
gsk_render_node_get_bounds() still exists and is computed via vfunc
call:
- containers dynamically compute the bounds from their children
- surface and texture nodes get bounds passed on construction
2016-12-20 18:01:09 +01:00
Benjamin Otte
4d376c80f3 gsk: Remove gsk_render_node_get_size()
In the brave new world of refactored render nodes, this function doesn't
really make any sense anymore. We could turn it into a vfunc, but I
don't think it's useful.

Especially because even in the brave old world, this function was
causing a vastl overallocation of nodes when the GL renderer needed render
targets.
2016-12-20 18:01:09 +01:00
Benjamin Otte
d907f60843 gsk: Add GskRenderNodeClass.make_immutable() 2016-12-20 18:01:09 +01:00
Benjamin Otte
e4ee65fd19 gsk: Remove gsk_render_node_set_opaque()
If we ever feel, we need this function again, we can readd it later.

But nobody is using it other than for overriding opactiy. And you can
just override opacity directly if you care.
2016-12-20 18:01:09 +01:00
Benjamin Otte
684d25bd1a gsk: Add custom structs to RenderNode subclasses
So now we don't need to keep a texture pointer and a surface pointer and
so on in the base struct.
2016-12-20 18:01:09 +01:00
Benjamin Otte
be8b9406e5 gsk: Add GskRenderNodeClass.finalize() 2016-12-20 18:01:09 +01:00
Benjamin Otte
a97b819b81 gsk: Add gsk_container_node_new()
It replaces gsk_renderer_create_render_node() which was doing the eact
same thing, only taking an unused extra argument.
2016-12-20 18:01:09 +01:00
Benjamin Otte
8830a1a1ad gtk: Remove gtk_snapshot_append()
It does not make sense to append an empty container node. Those should
only be push()'d.
2016-12-20 18:01:09 +01:00
Benjamin Otte
f16d523cb2 gsk: Introduce GskRenderNodeClass
This is modeled after GtkCssValueClass. So far it doesn't do anything.
2016-12-20 18:01:09 +01:00
Benjamin Otte
3af4fba895 gsk: Split render node subclasses out into their own file 2016-12-20 18:01:09 +01:00
Benjamin Otte
abd184efc9 gsk: Remove gsk_render_node_is_surface/texture()
Use gsk_render_node_get_node_type() instead.
2016-12-20 18:01:09 +01:00
Benjamin Otte
cb5c5170f4 gsk: Remove unneeded children modifiers
Creating render nodes is fire-and-forget, so all one should do is create
a container, append, append, append and then send it off to the
renderer. So there's no need to replace, insert between or anything
else.
2016-12-20 18:01:09 +01:00
Benjamin Otte
52d2faef88 gsk: Add gsk_cairo_node_new()
Split off Cairo drawn content nodes and require you to allocate them
using this new function.
2016-12-20 18:01:09 +01:00
Benjamin Otte
d1b80a6baa gtk: Don't push cairo nodes
We want to split nodes into containers and nodes that do actual drawing.
So pushing nodes that do drawing is exactly the wrong thing.

Also fix up GtkPopover. There's no need for it to push anything.
2016-12-20 18:01:09 +01:00
Benjamin Otte
8c8691b469 gsk: Add gsk_texture_node_new()
Start the transition into the different node types.
2016-12-20 18:01:09 +01:00
Benjamin Otte
ac5e277a71 gsk: Add GskRenderNodeType
For now, this is unused.
2016-12-20 18:01:09 +01:00
Benjamin Otte
f258af9cce gsk: Remove GskRenderNodeIter 2016-12-20 18:01:09 +01:00
Benjamin Otte
6fb46e3943 gsk: Make GskRenderNode a boxed type 2016-12-20 18:01:09 +01:00
Benjamin Otte
9bff1c12d4 gsk: Remove custom GValue API for GskRenderNode 2016-12-20 18:01:09 +01:00
Benjamin Otte
ff884385c0 gsk: Remove GskRenderNode::hidden
If you want to hide something, don't render it.
2016-12-20 18:01:09 +01:00
Benjamin Otte
04a2c1499a gsk: Remove RenderNode::anchor-point 2016-12-20 18:01:09 +01:00
Balázs Meskó
174d6a5613 Update Hungarian translation 2016-12-20 15:14:01 +00:00
Balázs Meskó
a47cb4d450 Update Hungarian translation 2016-12-20 15:13:33 +00:00
Daniel Mustieles
0ae27a3879 Update Spanish translation 2016-12-20 11:32:30 +00:00
Daniel Mustieles
4a13bd7a3f Update Spanish translation 2016-12-20 11:31:59 +00:00
Chun-wei Fan
696c48d0be build/Makefile.msvcproj: Fix cleanup
When we generate the Visual Studio 2013 projects, we need to remove the
*.vs12.sourcefiles and *.vs12.sourcefile.filters that are generated during
the process, so that 'make distcheck' won't complain about leftover files.
2016-12-20 14:39:39 +08:00
Debarshi Ray
7ea199c831 flowbox: Export gtk_flow_box_get_child_at_pos as public API
https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-20 00:35:17 +01:00
Debarshi Ray
faf2295440 GtkStack: Remove redundant code
Commit 7ce96cb6ac avoids notifications
during destruction by using gtk_widget_in_destruction. Therefore this
code is no longer needed.

This reverts commit 39e7afecb1

https://bugzilla.gnome.org/show_bug.cgi?id=749012
2016-12-20 00:32:15 +01:00
Philip Chimento
76e5fd4d0f GtkApplication: Lack of optional components shouldn't warn
When running uninstalled tests with GtkApplication on an autobuilder with
a fake session bus, warnings will cause the tests to abort. The GNOME
session manager, the Xfce session manager, and the Inhibit portal are all
not needed for normal operation of GTK, so we should not log warnings if
they are not found.

As well as not being present on a fake session bus, it's also not
expected that they'll be present on all platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=774784
2016-12-19 15:20:58 -08:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Debarshi Ray
7331735499 flowbox: Don't emit selected-children-changed during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=776012
2016-12-19 18:05:59 +01:00
Debarshi Ray
f5818c594c listbox: Don't emit selected-rows-changed, etc. during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=776012
2016-12-19 18:05:51 +01:00
Debarshi Ray
9791641d43 flowbox: Rename gtk_flow_box_find_child_at_pos for consistency
... with gtk_list_box_get_row_at_y. It would be nice to avoid the
'find' versus 'get' discrepancy since we are planning to expose it as
public API.

https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-19 15:07:53 +01:00
Chun-wei Fan
4a7e7c00c1 GDK/Win32: Fix Windows backend after GdkWindow simplification
Fix the build after the branch wip/alexl/simplify-gdkwindow was merged, as
there are some changes that broke things in the Windows backend, namely:

-gdk_win32_input_shape_combine_region() should not be removed at this
 point (though it is a stub--otherwise GDK/Win32 will crash)

-Some more code need to be removed due to the removal of items in the
 above-mentioned merged branch

Also, like the X11 backend, do not allow the creation of native child
windows, and stop checking for subsequent child windows
(GDK_WINDOW_CHILD), so that we can clean things up a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-19 17:47:47 +08:00
Marek Černocký
62627bc833 Updated Czech translation 2016-12-19 10:23:54 +01:00
Benjamin Otte
2090219abb scrolledwindow: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
e09fd1eb8a scrolledwindow: Fix rendering
We used to allocate the gadget relative to the view window. We allocate
relative to widget->window now.
2016-12-19 05:36:06 +01:00
Benjamin Otte
e755d9357d notebook: Implement snapshot 2016-12-19 05:36:06 +01:00
Benjamin Otte
3ba5c70028 iconhelper: Implement snapshot 2016-12-19 05:36:06 +01:00
Benjamin Otte
d9619abb11 progressbar: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
1733a3de0e toolbar: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
182dad304a eventbox: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
8900d6cc45 separatortoolitem: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
edf8ffecdf levelbar: Implement snapshot() 2016-12-19 05:36:06 +01:00
Benjamin Otte
96a94fc21d frame: Remove the border node
It does weird clipping that
(a) nobody likes
(b) is hard to support in the new rendering world.
So we take the easy way out.

The actual frame is now drawn by the frame node around the label.
2016-12-19 05:36:06 +01:00
Benjamin Otte
795f38b4cc cellview: Remove code to modify the background
GtkCellView has a gadget, so peopl can do all their shenanigans with
CSS.

And the original use case (overriding the background so that the
cellview's GdkWindow shares the background color of the combobox) is
outdated since we have transparent backgrounds.
2016-12-19 05:36:06 +01:00
Marek Černocký
087cb3f987 Updated Czech translation 2016-12-19 00:54:47 +01:00
Debarshi Ray
339f6e141a Mention that gdk_window_create_similar_image_surface inherits the scale
https://bugzilla.gnome.org/show_bug.cgi?id=776132
2016-12-17 22:50:18 +01:00
Matthias Clasen
2cb975ea77 Make gtk4-icon-browser work
It was using no-longer-existing widgets and properties.
2016-12-16 12:18:33 -05:00
Alexander Larsson
330c7feaa2 gdk: Drop gdk_window_reparent
We're not currently using this, and dropping it allows us to loose
a bunch of code which leads us towards the goal of having GdkWindow
only for toplevels (and reparenting makes not sense for toplevels).
2016-12-16 12:35:03 +01:00
Alexander Larsson
5bf28a3869 gdk: Drop support for native (and thus foreign) subwindows
We can't really support these on e.g. wayland anyway, and we're trying
to get rid of subwindow at totally in the long term, so lets drop this.
It allows us to drop a lot of complexity.
2016-12-16 12:28:44 +01:00
Olivier Fourdan
5c3192c75a wayland: apply empty input shape on parent commit
For subsurfaces, the new state which includes the input shape is not
applied by the compositor if the subsurface is in effective synchronous
mode.

So we need to apply the input shape once parent surface is in effective
desynchronized mode, which is when it's committed, otherwise the input
shape may never be applied if the widget is not using being_paint() /
end_paint() to draw on its subsurface, like clutter does.

We do that only for empty input shape as those won't need update when
the subsurface is resized, for all other non-empty input shape, the
client still has to use begin_paint()/end_paint() for the input shape to
be applied.

https://bugzilla.gnome.org/show_bug.cgi?id=774534
2016-12-15 13:27:39 +01:00
Baurzhan Muftakhidinov
cacd1da8a1 Update Kazakh translation 2016-12-14 11:13:24 +00:00
Matthias Clasen
c4fd5bc233 Add a css parser test for border-spacing 2016-12-10 20:41:07 -05:00
Matthias Clasen
b1f2e3b581 Remove -gtk-gradient from css parser tests
It is not supported anymore.
2016-12-10 20:40:48 -05:00
Matthias Clasen
8fb311cb4b Document the border-spacing CSS property 2016-12-10 20:34:24 -05:00
Benjamin Otte
0eecc6f686 grid: Implement support for CSS border-spacing 2016-12-10 04:32:55 +01:00
Benjamin Otte
404cdd5d02 boxgadget: Implement CSS border-spacing 2016-12-10 04:32:55 +01:00
Benjamin Otte
75c3d193f6 box: Implement support for border-spacing 2016-12-10 04:32:55 +01:00
Benjamin Otte
5aea108802 box: Remove unused member variable 2016-12-10 04:32:55 +01:00
Benjamin Otte
d7148a4718 css: Add "border-spacing" CSS property
It's using a GtkCssPositionValue, even though that name is wrong. But
the functionality of managing 2 lengths is exactly what we want.

Nobody is using this yet.
2016-12-10 04:32:55 +01:00
Matthias Clasen
438ad208e7 Use the new defines
It is no longer GDK_WINDOWING_VULKAN.
2016-12-09 15:51:58 -05:00
Benjamin Otte
cb8483b0a6 gtk: Remove unneeded gtk_snapshot_push()/pop() calls 2016-12-09 21:39:43 +01:00
Benjamin Otte
f8932d643d snapshot: Always create an initial node
This way we ensure that there is only one root node and everybody can
append() with impunity.
2016-12-09 21:39:43 +01:00
Benjamin Otte
2faad03f2f gsk: Improve GSK_RENDERER env var handling
- Recognize "gl" as well as "opengl" for the GL renderer
- GSK_RENDERER=help now works
- g_warning() for an unrecognized renderer (typo detection!)
- g_print() the actual renderer that is used (and error messages when
  selecting) when a GSK_RENDERER is given, so you'll notice if your
  renderer isn't taken.
2016-12-09 21:27:55 +01:00
Benjamin Otte
3e9811d91c build: Don't try to detect vulkan library if the header wasn't found.
We've already failed. No need to fail again.
2016-12-09 21:27:29 +01:00
Matthias Clasen
4ae50bf38e Trivial doc fixups 2016-12-09 14:59:46 -05:00
Benjamin Otte
2c0564a46e build: Make sure GTK compiles without Vulkan headers installed
Previously, code would work fine with --disable-vulkan if the Vulkan
headers were installed - code would happily just use them as they're
installed in /usr/include.
2016-12-09 20:23:06 +01:00
Matthias Clasen
98f5e794a6 Forgotten file 2016-12-09 14:22:14 -05:00
Matthias Clasen
3dd4f76703 Rename GDK_WINDOWING_VULKAN
The WINDOWING defines are only for GDK backends, really.
Define GDK_RENDERING_VULKAN instead.
2016-12-09 14:11:37 -05:00
Matthias Clasen
5b6a837b17 Only include vulkan.h if we have it 2016-12-09 14:05:26 -05:00
Matthias Clasen
17c8ebc4a8 Fix the configure check for Vulkan
GDK_WINDOWING_VULKAN was getting defined regardless of the tests.
2016-12-09 14:00:48 -05:00
Benjamin Otte
f52dd12569 vulkan: Implement texture caching
And with this change, the GPU looks bored again.
2016-12-09 18:35:52 +01:00
Benjamin Otte
6525fbe90f vulkan: Don't create more than one render object
By creating unlimited render objects, we would never wait on the GPU.

This would mean that if the GPU was the bottleneck, we would fill its
queue with render commands faster than it could process them.

And because the nvidia binary driver and my code work surprisingly well
and bugfree, this lead to exhaustion of RAM. I had 50GB of swap
configured and my hard disk was quicker as swap storage than my GPU was
at processing the commands, so stuff still filled up.

At that point my computer became rather unresponsive and I decided to
reboot it, so I that could write this patch.
2016-12-09 18:35:52 +01:00
Benjamin Otte
b3388aaca9 vulkan: Don't limit number of descriptor sets
If we need more than we have reserved as maximum, recreate the
descriptor pool with a higher maximum.
2016-12-09 18:35:52 +01:00
Benjamin Otte
35d1dc6dd5 vulkan: Add more node operations
Add SURFACE and TEXTURE operations. This way, we actually render more
than one node every frame because not everything is a fallback node
anymore that gets composited with its children into a cairo surface.
2016-12-09 18:35:52 +01:00
Benjamin Otte
cf470f31ca vulkan: Push the correct matrix when drawing
Instead of pushing the root matrix, push the world matrix for the
current node. That way, the bounds we emit as vertices are actually
properly transformed.
2016-12-09 18:35:52 +01:00
Benjamin Otte
93448b8c7e vulkan: Enable alpha blending
We will need that once we actually composite stuff.
2016-12-09 18:35:52 +01:00
Benjamin Otte
b3a1732a3e vulkan: Redo descriptor set handling
First, we collect all the info about descriptor sets into a hash table,
then we use its size to determine the amount of sets and allocate those
before we finally go ahead and use the hash table's contents to
initialize the descriptor sets.

And then we're ready to render.
2016-12-09 18:35:52 +01:00
Benjamin Otte
f4685e0291 vulkan: Move remaining structs to VulkanRender object
It now gets to maintain things.
2016-12-09 18:35:52 +01:00
Benjamin Otte
e989375c04 vulkan: Create framebuffers from GskVulkanRender object
Also create them on-demand, as they need to be created per-image and
per-framebuffer, so we don't want to create loads of them.
2016-12-09 18:35:52 +01:00
Benjamin Otte
8756deec58 vulkan: Turn swapchain image targets into GskVulkanImages
This gives us proper refcounting here, too. And there's no longer a
difference between the different types of images.
2016-12-09 18:35:52 +01:00
Benjamin Otte
17c11dd97b vulkan: Store width/height of GskVulkanImage
This is to enable lazy framebuffer creation later.
2016-12-09 18:35:51 +01:00
Benjamin Otte
c160ef16c1 vulkan: Turn GskVulkanImage into a GObject
This way, we can do real refcounting on them.
2016-12-09 18:35:51 +01:00
Benjamin Otte
85bc9ff36b vulkan: Hook up image upload mechanism to env variables
Instead of having to decie at compile-time, check if
GSK_RENDERING=staging-image was given, and if so, select the staging
image upload mode.
2016-12-09 18:35:51 +01:00
Benjamin Otte
b2e30fb66e vulkan: Don't wait until graphics are done computing
We can let the GPU do its stuff without waiting. The GPU knows what it's
doing.

Which means we now get a lot of time to spend on doing CPU things (read:
we're way better in benchmarks).

The old behavior is safer, so we want to keep it around for debugging.
It can be reenabled with GSK_RENDERING_MODE=sync.
2016-12-09 18:35:51 +01:00
Benjamin Otte
ac9d48151b vulkan: Keep render objects around
That way we can reuse them. We only create a new one if the last render
operation hasn't finished executing.
2016-12-09 18:35:51 +01:00
Benjamin Otte
adff39953d vulkan: Move command pool and fence into render object 2016-12-09 18:35:51 +01:00
Benjamin Otte
9635598124 vulkan: Make the GskVulkanRender struct private 2016-12-09 18:35:51 +01:00
Benjamin Otte
eb94153a2c vulkan: Make the VulkanRender object allocated
That way, we can have multiple of those and keep them around for reuse.
2016-12-09 18:35:51 +01:00
Benjamin Otte
747df7aa3c vulkan: Also wait on the draw semaphore when present()ing
That way we have a synchronization primitive at the start and at the
end.
2016-12-09 18:35:51 +01:00
Benjamin Otte
3c5b25b1d1 vulkan: Add GskVulkanRenderPass
And move the actual rendering code there.

A RenderPass is a collection of operations on the same target that
get executed one after another. It roughly targets VkRenderPass or
rather the subpasses of a VkRenderPass.

For now, only the infrastructure is there. No real stuff is happening.
2016-12-09 18:35:51 +01:00
Benjamin Otte
681554787b vulkan: Add GskVulkanRender object
This is refactoring work.

GskVulkanRender is supposed to be the global object for a render
operation, ie GskVulkanRenderer.render() will create this object for
what it does.

The object will be split into stages that perform the operations
necessary to create a drawing.
2016-12-09 18:35:51 +01:00
Benjamin Otte
583956266e vulkan: Make MVP matrix available to vertex shader
We use push constants for this.
2016-12-09 18:35:51 +01:00
Benjamin Otte
13b53656ea vulkan: Upload image data directly
Instead of using a staging iamge, we require the final image to be
linearly allocated and have host-visible memory.

This improves performance quite a bit.

The old code is still there and can be enabled with a simple change
to a #define in gskvulkanimage.h
2016-12-09 18:35:51 +01:00
Benjamin Otte
3c4b952256 vulkan: Make GskVulkanRenderer work
We now create a Cairo renderer, render to an image surface and upload
and retnder it with Vulkan.
2016-12-09 18:35:51 +01:00
Benjamin Otte
9120bdd9e9 xim: Use the native parent window for the X connection
Don't try to gdk_window_get_xid() on the current window.
2016-12-09 18:35:51 +01:00
Benjamin Otte
5e4f95d77f x11: Don't make random windows native
Instead, complain if somebody calls gdk_x11_window_get_xid() on a
non-native window.

We cannot make random windows native anymore because there's no GSK
renderer associated with them, so we cannot draw them.
2016-12-09 18:35:51 +01:00
Benjamin Otte
a7cbbaf8fc gsk: Pass texture coordinates to Vulkan renderer
We just render the coordinates as color, we don't do anything with them
yet.
2016-12-09 18:35:51 +01:00
Benjamin Otte
2a0e7f8829 gsk: Loads of work on Vulkan backend
We can now upload vertices.

And we use this to draw a yellow background. Which is clearly superior
to not drawing anything.

Also, we have shaders now. If you modify them, you need glslc installed
so they can be recompiled into Spir-V bytecode.
2016-12-09 18:35:51 +01:00
Benjamin Otte
3f7cc013cc configure: Improve Vulkan detection
1. Output Vulkan status in summary
2. Add missing "test" call
3. Check for glslc

The glslc check will be necessary later for the code that automatically
compiles the Vulkan glsl source to Spir-V.
Nothing happens if glslc is not available - unless you modify the glsl.
2016-12-09 18:35:51 +01:00
Benjamin Otte
8ba2898e08 vulkan: acquire/present images when drawing
Another step towards the final goal of actually showing something.
2016-12-09 18:35:51 +01:00
Benjamin Otte
06657fa23b gskvulkan: Create render pass and command pool 2016-12-09 18:35:51 +01:00
Benjamin Otte
3e59b11700 gskvulkanrenderer: Create imagevies and framebuffers 2016-12-09 18:35:51 +01:00
Benjamin Otte
5bea4ff45e gsk: Add a vulkan debug category 2016-12-09 18:35:51 +01:00
Benjamin Otte
325efe7078 vulkan: Expose the swapchain images in public API 2016-12-09 18:35:51 +01:00
Benjamin Otte
a753f047df gsk: Add skeleton for Vulkan renderer
The renderer itself obviously doesn't do anything.
2016-12-09 18:35:51 +01:00
Benjamin Otte
0c8e7d0ac0 vulkan: Register debug handler
We now hook Vulkan error reporting into glib's error reporting.

I'm not sure on the severity handling yet, but we can fix that as we go
along.
2016-12-09 18:35:51 +01:00
Benjamin Otte
b6227aa998 gdk: Add GDK_VULKAN env variable
Also add 2 flags:

GDK_VULKAN="disable" will disable Vulkan usage.

GDK_VULKAN="validate" will enable VK_LAYER_LUNARG_standard_validation.
2016-12-09 18:35:51 +01:00
Benjamin Otte
e11a6a0e68 x11: Call gdk_display_sync() when creating Vulkan surfaces
The Vulkan driver wants to operate on an X Window that it is sure does
exist.
2016-12-09 18:35:51 +01:00
Benjamin Otte
e22cb94e50 vulkan: More work on GdkVulkanContext
Code has now arrived at creation of swapchains.
2016-12-09 18:35:51 +01:00
Benjamin Otte
4ef8bf821e vulkan: Turn GdkVulkanContext into a GdkDrawContext 2016-12-09 18:35:51 +01:00
Benjamin Otte
6d1d6e6792 vulkan: Add more infrastructure
gdk_window_create_vulkan_context() now exists and will return a Vulkan
context for the given window. It even initializes the surface. But it
doesn't do anything useful yet.
2016-12-09 18:35:51 +01:00
Benjamin Otte
cca547e5bc vulkan: Initial support
Adds the gdk_display_ref_vulkan() and gdk_display_unref_vulkan()
functions which setup/tear down VUlkan support for the display.

Nothing is using those functions yet.
2016-12-09 18:35:51 +01:00
Benjamin Otte
843fe3eec1 build: Add Vulkan detection code
Also define GDK_WINDOWING_VULKAN if Vulkan is enabled.
2016-12-09 18:35:51 +01:00
Gianvito Cavasoli
87ae5885dd Update Italian translation
(cherry picked from commit 44fb5c9c70)
2016-12-09 10:34:59 +00:00
William Hua
9a7b0847b9 mir: swap buffers on paint 2016-12-08 15:28:31 -05:00
Timm Bäder
489aee5d00 widget: Remove unused adjust_* vfuncs
Expose them privately to gtksizerequest.c using normal functions
instead.
2016-12-07 18:12:54 +01:00
Timm Bäder
1aa1676d9d menu: Replace button-press-handler with gesture 2016-12-07 18:06:37 +01:00
Timm Bäder
be9adea58e toolbar: Replace button-press-event handler with gesture 2016-12-07 18:06:32 +01:00
Timm Bäder
55b1f231fb linkbutton: Replace button-press-event handler with gesture 2016-12-07 18:06:28 +01:00
Timm Bäder
c4a6c37767 separatortoolitem: Remove button-event/motion-event handlers
These only exist for the window dragging which does not exist anymore
currently. It will be reintroduced later in a form that does not require
these handlers.
2016-12-07 18:06:23 +01:00
Timm Bäder
4c12c4ba02 snapshot: Add annotations to parameters/return values 2016-12-07 18:06:17 +01:00
Timm Bäder
ea22bd9d40 widget: Use gtk_widget_measure to measure widget sizes 2016-12-07 08:19:22 +01:00
Timm Bäder
07a9b202ab widget: Remove _gtk_widget_supports_clip 2016-12-07 08:19:22 +01:00
Timm Bäder
3063d4a5e3 widget: Remove gtk_widget_invalidate_style_context 2016-12-07 08:19:22 +01:00
Benjamin Otte
cd2b898353 wayland: Sync attributes also when drawing with GL
Probably syncing attributes shouldn't happen when drawing in the first
place, but what do I know about Wayland. ¯\_(ツ)_/¯
2016-12-06 18:02:11 +01:00
Benjamin Otte
a85a97c1a1 wayland: Uncomment erroneously commented out code
I read the code as if (use_gl) instead of if (!use_gl) and commented it
out in bddfd7bb41. That broke drawing on
Wayland without OpenGL completely.

Whoops.

Now it's back.
2016-12-06 17:51:35 +01:00
Chun-wei Fan
060365a9bb GDK/Win32: Fix build after GDKGL refactoring
There were some parts that need some updates after the refactoring in
GDKGL, so that the code will continue to build and run.

For gdkwindow-win32.c, comment out the parts where we check for use_gl
(which was removed), since we are going to move all drawing to OpenGL,
but don't remove/disable the whole portion as that transition is not
complete at this point.

There a is new GDKGL function that checks for the damaged area of the back
buffer, but since the notion of "damage" is for *NIX (GLX/EGL for
Wayland/mir), meaning that there is no such extension for Windows in this
regard, so we can't support this on Windows as-is, at least for now.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-06 16:47:47 +08:00
Piotr Drąg
82401032c5 Update POTFILES.in 2016-12-05 19:46:59 +01:00
William Hua
fdec3e8a3f build: add gir depends for GdkX11, GdkWin32, and Gsk on Gdk
https://bugzilla.gnome.org/show_bug.cgi?id=775651
2016-12-05 12:56:50 -05:00
William Hua
3c2aefddd4 mir: fix type warning 2016-12-05 11:06:32 -05:00
William Hua
32b3928eda mir: fix build failures 2016-12-05 10:28:48 -05:00
William Hua
e27e8e6e1c mir: implement display monitor vfuncs 2016-12-05 09:17:44 -05:00
Benjamin Otte
8915be00d1 gdkgl: Add gdk_gl_context_get_damage()
This is a way to query the damaged area of the backbuffer.

The GL renderer uses this to compute the extents of that damage region
(computed via buffer age) and use them to minimize the area to redraw.

This changes the semantics of GL rendering to "When calling
gdk_window_begin_frame() with a GL context, the area by
gdk_gl_context_get_damage() needs to be redrawn and every other pixel of
the backbuffer is guaranteed to be correct.
After gdk_window_end_frame() on a GL-drawn window, the whole backbuffer
must be correct.

We can always glXBufferSwap() now because of this.
2016-12-05 15:02:47 +01:00
Benjamin Otte
582ea50faa inspector: Add support for displayin the render region
Now I just need a UI designer that makes this look nice...
2016-12-05 15:02:47 +01:00
Benjamin Otte
9597caef5e glrenderer: Always redraw the whole screen 2016-12-05 15:02:47 +01:00
Benjamin Otte
ca78f5d3cb gdk: Make gdk_window_begin_draw_frame() take a draw context
... instead of a gl context.

This requires some refactoring in the way we mark the shared context as
drawing: We now call begin_frame/end_frame() on it and ignore the call
on the main context.
Unfortunately we need to do this check in all vfuncs, which sucks. But I
haven't found a better way.
2016-12-05 15:02:47 +01:00
Benjamin Otte
60567db486 gskrenderer: Add gsk_renderer_begin_draw_frame()
This way, we can hijack the begin/end draw process and do out own
processing before passing it on to GDK.
2016-12-05 15:02:47 +01:00
Benjamin Otte
e950a5190d inspector: Pass the drawing context into the recorder
That way we can capture both the actual changes (clip region) and the
area that was redrawn (render region), which in OpenGL might not be
identical.

Nothing shows the render region yet though...
2016-12-05 15:02:47 +01:00
Benjamin Otte
358aca9e20 glrenderer: Always redraw the whole screen 2016-12-05 15:02:47 +01:00
Benjamin Otte
da8d886b17 gsk: Change GSK_USE_SOFTWARE env var to GSK_RENDERER
This way, we can use the variable as more than a boolean flag.

This will be useful for Vulkan or D3D renderers.
2016-12-05 15:02:47 +01:00
Benjamin Otte
725a7236c0 gdk: Turn GdkGLContext into a GdkDrawContext 2016-12-05 15:02:47 +01:00
Benjamin Otte
db8e3065bd gdk: Add GdkDrawContext
This will be the base class for GdkVulkanContext and GdkGLContext.
2016-12-05 15:02:47 +01:00
Benjamin Otte
e38bd27d58 gdk: Redo GL drawing
Reenable GL drawing, but do it without Cairo.

Now, the context passed to gdk_window_begin_draw_frame() decides how
drawing is going to happen. If it is NULL, Cairo is used like before.

If a context is passed, Cairo may not be used for drawing and
gdk_drawing_context_get_cairo_context() is going to return NULL.
Instead, the GL renderer must draw to the GL backbuffer and
end_draw_frame() is then swapping that to the front.

The GskGLRenderer has lost the texture it used to render to and adapted
to render directly to the backbuffer instead.

The only thing missing is for GtkGLArea to gain back a performant way to
render. But it didn't have one since the introduction of GSK, this
patchset doesn't change anything about it.

The new rendering avoids two indirections (the GSK renderer's texture
and the GDK double buffering surface).
It improves icon count in the fishbowl demo by 30%.
2016-12-05 15:02:47 +01:00
Benjamin Otte
e87b472143 glcontext: Make begin/end_draw() paired
This way, we can query the GL context's state via
gdk_gl_context_is_drawing().

Use this function to make GL contexts as attached and grant them access
to the front/backbuffer for rendering.

All of this is still unused because GL drawing is still disabled.
2016-12-05 15:02:47 +01:00
Benjamin Otte
182d18bcd1 gdk: Large GL refactoring
No visible changes as GL rendering is disabled at the moment.

What was done:

1. Move window->invalidate_for_new_frame to glcontext->begin_frame
This moves the code to where it is used (the GLContext) and prepares it
for being called where it is used when actually beginning to draw the
frame.

2. Get rid of buffer-age usage
We want to let the application render directly to the backbuffer.
Because of that, we cannot make any assumptions about the contents the
application renders outside the clip area.
In particular GskGLRenderer renders random stuff there but not actual
contents.

3. Pass the actual GL context
Previously, we passed the shared context to end_frame, now we pass the
actual GL context that the application uses for rendering. This is so
that the vfuncs could prepare the actual contexts for rendering (they
don't currently).

4. Simplify the code
The previous code set up the final drawing method in begin_frame.
Instead, we now just ensure the clip area is something we can render
and decide on the actual method in end_frame.
This is both more robust (we can change the clip area in between if we
want to) and less code.
2016-12-05 15:02:47 +01:00
Benjamin Otte
4b484557f5 gsk: Allow 0 for gsk_gl_driver_begin_frame()
Special-case this situation to unset the current framebuffer and render
to the backbuffer again.
2016-12-05 15:02:47 +01:00
Benjamin Otte
4967257f3a gdk: Don't recurse when processing updates
We don't need to send expose events for backwards compatibility anymore.
2016-12-05 15:02:47 +01:00
Benjamin Otte
bddfd7bb41 gdk: Remove all code that only existed because of use_gl
Now that we don't use GL anymore, this code is unnecessary.
2016-12-05 15:02:47 +01:00
Benjamin Otte
77d336de17 gdk: Never draw with GL
This is a temporary switch-off of the GL dawing code that will make
things keep running. All GL related code (like the GSK renderer or
GtkGLArea will now fall back to software.
2016-12-05 15:02:47 +01:00
Benjamin Otte
e42e27304a gskrenderer: Store the GL context
And use it to create the drawing context with it.

Note that this doesn't yet have any effect and is all infrastructure
preparation work.
2016-12-05 15:02:47 +01:00
Benjamin Otte
332ed7be5b API: Require passing a GLContext to begin_draw_frame()
This is in preparation for requiring explicit passing of GL contexts
when drawing.
2016-12-05 15:02:47 +01:00
Benjamin Otte
9c041f6bcc window: Change behavior of gdk_window_begin_draw_frame()
(1) Require a native window
(2) Create the drawing context before calling begin_paint().
2016-12-05 15:02:47 +01:00
Benjamin Otte
a860bbbe46 drawingcontext: Store the GL paint context 2016-12-05 15:02:47 +01:00
Benjamin Otte
633631a47b cssgadget: Compute relative to own allocation, not widget allocation
This would lead to clipped gadgets when the gadget allocation differed
from the widget allocation, like in GtkListBox.
2016-12-05 15:02:46 +01:00
Olivier Fourdan
f6b4477393 wayland: destroy subsurfaces along with parents
Wayland subsurfaces can have other native window parents, but those need
to be destroyed along with the rest of the window hierarchy otherwise
an assert() is reached.

https://bugzilla.gnome.org/show_bug.cgi?id=774915
2016-12-05 10:56:41 +01:00
Timm Bäder
ac20c3eb22 frame: Use gtk_widget_measure to measure child sizes 2016-12-04 12:00:46 +01:00
Timm Bäder
7096d6dd28 viewport: Use gtk_widget_measure to measure child sizes
and rewrite the adjustment handling in a orientation-agnostic way.
2016-12-04 12:00:46 +01:00
Timm Bäder
5ee590fbc8 scrolledwindow: measure child widgets using gtk_widget_measure 2016-12-04 12:00:46 +01:00
Timm Bäder
1ab3d32808 revealer: Measure child widget size using gtk_widget_measure 2016-12-04 12:00:46 +01:00
Timm Bäder
7f8d0acfd3 headerbar: measure children using gtk_widget_measure 2016-12-04 12:00:46 +01:00
Timm Bäder
d45e5ef3dc widget-factory: Use GtkButton:icon-name to construct icon buttons 2016-12-04 12:00:45 +01:00
Timm Bäder
5b05c12780 toolpalette: call set_has_window 2016-12-04 12:00:45 +01:00
Timm Bäder
9f98138ffb printunixdialog: Remove GtkDrawingArea::draw handler
the source file has been updated to use gtk_drawing_area_set_draw_func,
but the draw_cb handler in the ui file is still left.
2016-12-04 12:00:38 +01:00
Benjamin Otte
0d68b22479 stylecontext: Remove a bunch of unneeded headers 2016-12-03 18:15:49 +01:00
Daniel Boles
8efc91c4e0 GtkProgressBar: trivial conditional optimisation
I'd hope the compiler would realise this for us, but let's be explicit.
2016-12-03 16:27:03 +00:00
Timm Bäder
3dac21f20b entry: Refactor get_icon_pixbuf
This way it will only return a pixbuf if the icon helper has a pixbuf.
2016-12-03 13:19:26 +01:00
Timm Bäder
8a543ab23c iconhelper: Ensure the surface used for textures is ARGB32 2016-12-03 13:19:26 +01:00
Timm Bäder
49508ddfdb iconhelper: Remove allocate implementation 2016-12-03 13:19:26 +01:00
Timm Bäder
31ed68dbfa listbox: Fix row hovering
GtkListBox is not a windowed widget anymore so we can't use
gtk_widget_get_window. Just directly access priv->view_window instead to
get the right window.
2016-12-03 13:19:26 +01:00
Timm Bäder
fa4d6e8918 spinbutton: Remove _get_panels 2016-12-03 13:19:26 +01:00
Timm Bäder
36377e9964 Remove gtk_widget_get_preferred_height_and_baseline_for_width
It's just a wrapper around gtk_widget_measure nowadays.
2016-12-03 13:19:25 +01:00
Timm Bäder
8d36fbfbaa togglebutton: Remove unused defines 2016-12-03 13:19:25 +01:00
Debarshi Ray
1f7b03bb2b flowbox: Fix get_child_at_index crash with an invalid index
https://bugzilla.gnome.org/show_bug.cgi?id=775525
2016-12-02 19:17:40 +01:00
Daniel Boles
975a3fa4aa ComboBox: Fix the whitespace fix 2016-12-01 12:59:46 +00:00
Daniel Boles
e723fd6a23 ComboBox: Do not select item before menu realised
For a menu mode CB with wrap_width == 0 and an active item, that item is
selected in gtk_combo_box_menu_popup. Selection causes the MenuShell to
activate and hence take a grab. This was done before the menu was popped
up. A patch distributed in Debian sid - after being proposed on our BZ -
revealed that on the 1st popup of any such ComboBox, within grab_add,
the MenuShell's toplevel's GdkWindow is NULL. This causes a Gdk-CRITICAL
assertion fail on the 1st time opening any such CB, on Debian and if
that patch were merged to GTK+. By selecting after popup, we ensure the
MenuShell is realised before its grab_add and so avoid the critical.

https://bugzilla.gnome.org/show_bug.cgi?id=771242
2016-12-01 12:46:12 +00:00
Daniel Boles
a72dbeba06 ComboBox: Fix whitespace
* Replace tabs for indentation with spaces
 * Remove whitespace at ends of lines
2016-12-01 12:46:12 +00:00
Benjamin Otte
e09b78f7f7 cssshadows: Fix extents computation
Someody busted this code a *lot*.
2016-11-30 23:54:49 +01:00
Benjamin Otte
970f99615e image: Don't translate twice
The animation can pass x/y through to the render_icon() function, so
don't gtk_snapshot_translate() it.
2016-11-30 23:54:49 +01:00
Matthias Clasen
92a1abcd23 wayland: Don't warn if we loose the compositor connection
And instead, exit cleanly. This avoids filling the logs with
these warnings from every single application that has a
connection to the compositor.
2016-11-30 13:45:04 -05:00
Matthias Clasen
1c51da82bd x11: Don't warn if the display is closed
This causes a storm of warnings from all applications in the logs
whenever the display goes away, and is not useful.
2016-11-30 13:45:00 -05:00
William Hua
7d18a86140 gsk: ensure libgsk-4.la before running g-ir-scanner
https://bugzilla.gnome.org/show_bug.cgi?id=775410
2016-11-30 10:30:17 -05:00
Benjamin Otte
318e19f570 gskrenderer: Add GError argument to gsk_renderer_realize()
This way, we don't spam criticals when GL is not available. Instead, we
print a useful debug message to stderr and continue with the Cairo renderer.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2016-11-30 15:58:07 +01:00
Benjamin Otte
5563841603 gsk: Add gsk_renderer_new_for_window()
and remove gsk_renderer_get_for_display().

This new function returns a realized renderer. Because of that, GSK can
catch failures to realize, destroy the renderer and try another one.

Or in short: I can finally use GTK on Weston with the nvidia binary
drivers again.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2016-11-30 15:56:00 +01:00
Benjamin Otte
ce98df881f gsk: Change gsk_renderer_realize()
Instead of having a gsk_renderer_set_window() call, pass the window to
realize(). This way, the realization can fail with the wrong window.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2016-11-30 15:55:45 +01:00
Benjamin Otte
efd04b47aa gdk: Make GdkDrawingContext not per-backend
No backend is using it, and we can put the backend-specific drawing code
into GdkGLContext.
2016-11-30 15:52:22 +01:00
Benjamin Otte
bdcfc17c43 gdkwindow: Remove unused vfunc
GdkGLContext knows how to realize itself.
2016-11-30 15:15:08 +01:00
Benjamin Otte
d12c81f177 flowbox: Size gadget realtive to widget->window
This fixes a few clipping issues and syncs code with GtkListBox.
2016-11-30 15:15:08 +01:00
Benjamin Otte
e28d94bc8b listbox: Move the priv->gadget allocation
It used to be relative to the window, now it is relative to the widget.

That is necessary so the snapshot fuction doesn't confuse coordinate
systems.
2016-11-30 15:15:08 +01:00
Benjamin Otte
238334c74e cairorenderer: Remove nonexisting function from header 2016-11-30 15:15:08 +01:00
Olivier Fourdan
bd4519922c wayland: Check for subsurface looking up the toplevel
gdk_window_get_toplevel() walks up the windows tree looking for the
corresponding toplevel window, but needs to account for subsurfaces as
well on Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=775319
2016-11-30 10:05:47 +01:00
Emmanuele Bassi
c8b92cb0d2 demos: Remove undefined function call
The gtk_container_set_border_width() function has been removed from
the GTK+ 4.x API.
2016-11-29 23:29:10 +00:00
Matthias Clasen
ee1ae7f9ed gtk-demo: Add a demo for tabs
One of the least-appreciated features in pango.
It deserves a demo.
2016-11-29 16:40:24 -05:00
Matthias Clasen
0037d4d257 Don't leak a pixbuf reference in dnd
https://bugzilla.gnome.org/show_bug.cgi?id=775316
2016-11-29 14:42:35 -05:00
Matthias Clasen
316b24e0a0 Fix reference handling in GtkScaleButton
We were leaking the adjustment, since we confuse ourselves
with a property whose initial value comes out of a template.
Stop doing that.

https://bugzilla.gnome.org/show_bug.cgi?id=775212
2016-11-28 15:04:20 -05:00
William Hua
3efbb75619 mir: fix build failures 2016-11-27 21:31:21 -05:00
Sébastien Wilmet
82b2bf2184 docs: fix a parameter name of GtkEntry::populate-popup
Trivial commit.

The documentation block refers to @widget, not @popup. @widget is a
better name since the type is GtkWidget.
2016-11-26 12:31:34 +01:00
Sébastien Wilmet
e2881d1e4f docs: fix docs of functions to convert layout_index <-> text_index
Trivial commit.

The documentation was swapped. The documentation for the parameters and
the return values is good.
2016-11-26 12:31:34 +01:00
Benjamin Otte
8161f8dcca rendericon: Pass the scale factor when rendeirng textures
Fixes icon rendeirng on hidpi.
2016-11-26 11:52:30 +01:00
Cosimo Cecchi
7ebbd075b9 Adwaita: make rubberband selection work again for libgd apps
libgd views still use the old style class.
2016-11-25 18:55:12 +01:00
Matthias Clasen
4939cfd67e Make gtk-encode-symbolic-svg work for icons with dotted names
We were producing org.symbolic.png from org.gnome.Recipes-symbolic.svg,
which is not useful. Look for the last dot in the original name, to
produce the expected org.gnome.Recipes-symbolic.symbolic.png instead.
2016-11-25 08:55:33 -05:00
Dominique Leuenberger
cae8fc74ac Build: Add wayland to GSKs dependencies
gskrenderer.c includes gdk/wayland/gdkwayland.h and as a consequence
we need to be able to locate wayland's headers in case they are not
in standard location.

https://bugzilla.gnome.org/show_bug.cgi?id=775038
2016-11-24 19:53:36 +01:00
Benjamin Otte
624e0e1409 gdk: Rewrite docs some more
Now gdk_window_process_updates() isn't mentioned either.

GDK takes care of redrawing, not you!
2016-11-24 18:31:11 +01:00
Benjamin Otte
d7876bde74 inspector: Remove leftover GDK_PRIVATE_CALL()s 2016-11-24 15:41:19 +01:00
Benjamin Otte
4b6e70b9c8 gdk: Get rid of all mentions of process_all_updates() 2016-11-24 15:26:49 +01:00
Olivier Fourdan
39200e75b6 wayland: Place subsurfaces relative to their parent
Now that subsurfaces can be created as child of another GdkWindow (and
not just the root window), they must be placed according to the location
of their parent, i.e. the abs_x/abs_y must be updated and taken int
account when placing and moving subsurfaces under Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=774917
2016-11-24 09:32:41 +01:00
Benjamin Otte
ae29d4db5a gdk: Use stricter checks for begin_draw_frame()
We don't support drawing on child windows, so make sure nobody tries.
2016-11-24 04:43:42 +01:00
Matthias Clasen
3414f10bad Drop the GDK_PRIVATE_CALL mechanism
We don't need to do this extra complication anymore, since
we're now living inside a single shared library.
2016-11-23 19:31:16 -05:00
Matthias Clasen
1af817e254 inspector: Respect text-scaling-factor value initially
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774893
2016-11-23 19:16:16 -05:00
Florian Müllner
593b75fb69 GtkLabelAccessible: Initialize link before setting parent
Since at-spi-atk commit 96621a5e95 fixed PropertyChange notifications
for AccessibleParent, setting the parent will result in a call to
ref_state_set() which assumes that the object is fully initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=774939
2016-11-23 18:55:42 -05:00
Christian Hergert
c14c9aca34 inspector: ensure controller is a GtkGesture
While GtkEventController implementations today are all GtkGesture, it is
possible to create a GtkEventController manually. This is an extrac check
to ensure we only add gestures to the list.

https://bugzilla.gnome.org/show_bug.cgi?id=774760
2016-11-23 14:03:13 -08:00
Stas Solovey
10a7c65f47 Update Russian translation
(cherry picked from commit dd3cf38c53)
2016-11-23 20:43:13 +00:00
Matthias Clasen
3a947fa318 menu: Don't leak check menu items
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774686
2016-11-23 14:48:17 -05:00
Matthias Clasen
1dded6d633 notebook: Don't leak arrow gadgets
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774743
2016-11-23 14:44:37 -05:00
Matthias Clasen
0e37d67393 text handle: Don't leak adjustments
This can happen if the weak pointer is triggered before the
adjustments are unset. Pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=774790
2016-11-23 13:57:03 -05:00
Benjamin Otte
0cb35bf394 gdk: Only draw toplevels
Simplify gdk_window_paint_on_clock () to only draw the toplevel. We do
no longer draw child windows and offscreens no longer exist.
2016-11-23 19:32:27 +01:00
Benjamin Otte
2a27b7ecc6 API: Remove gdk_window_process_all_updates()
It's completely unused since we have a frame clock.
2016-11-23 19:10:34 +01:00
Benjamin Otte
ef75ca2d53 API: gdk: Remove gdk_window_process_updates()
We have a frame clock now.
2016-11-23 19:02:58 +01:00
Benjamin Otte
4dedafb79b drawingcontext: Add a private struct
This is to control what backends can and cannot access.
2016-11-23 18:49:48 +01:00
Benjamin Otte
4850271ae8 API: Remove gtk_cairo_should_draw_window()
The answer is: Yes.
2016-11-23 18:48:38 +01:00
Benjamin Otte
b7869c65a8 gdk: Move GdkDrawingContext definition to gdktypes.h 2016-11-23 18:48:15 +01:00
Benjamin Otte
8cb96dec7e window: unrealize renderer before destroying GDK window
We need to unrealize the children manually for that to happen, but so it
goes.

The order is necessary because we want the renderer to still be alive
while children are unrealizing.
2016-11-23 18:47:58 +01:00
Lapo Calamandrei
cb1a349d17 HC: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-11-23 17:25:18 +01:00
Lapo Calamandrei
5ab18062a3 HC: really use radial-gradient() in place of -gtk-gradient()
Regenerate the css from sass..
2016-11-23 16:39:14 +01:00
Lapo Calamandrei
eb5b8b22e2 Adwaita: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-11-23 16:14:58 +01:00
Andrew Chadwick
368e0117ed wintab: init only after the display is assigned
Only attempt to initialize Wintab after the display manager announces
that the first default display has been set. Fixes a segfault during
initialization of specific tablet drivers' wintab32.dlls. Add assertions
and verbose comments explaining this nonsense because this stuff is a
pain to have to keep fixing.

https://bugzilla.gnome.org/show_bug.cgi?id=774379
2016-11-22 12:50:32 +01:00
Andrew Chadwick
8fb9d1578d wintab tilt: Check return location for validity
https://bugzilla.gnome.org/show_bug.cgi?id=774265
2016-11-22 12:16:19 +01:00
Marek Cernocky
331302005c Updated Czech translation 2016-11-22 11:57:57 +01:00
Andrew Chadwick
9e3bd03d3e win32: Fix tilt from Wintab devices
Move the orientation sanity-checks into the packet decode func.
Rationale: the packet handling func may otherwise read beyond the end of
device->last_axis_data.

Also expand them to cope with my test Huion's weird reporting.

Also correct the azimuth angle to align with GDK's presentation.

Most importantly, fix annoying comment typo.

https://bugzilla.gnome.org/show_bug.cgi?id=774265
2016-11-22 11:21:06 +01:00
Chun-wei Fan
17fe2288e8 gtk/gtkprintoperation-win32.c: Fix for GTK+-4.0 API
We no longer have GtkPlug nor GtkWin32EmbedManifest for GTK+-4.x, and it
is not entirely clear at this point what would be the "best" replacement
for them, but this issue here prevents GTK+-3.89.x building on Windows.

As a result, this is a fast port to avoid using APIs that have been
removed for 4.x, and things seem to work properly (the print.c page
printed).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-22 11:40:57 +08:00
Matthias Clasen
1f7ab7c069 3.89.1 2016-11-21 18:36:07 -05:00
Andrew Chadwick
6e197afc44 wintab: fix skipping of odd-numbered devices
Fix a regression introduced in 4ce6d10601
which causes devices with an odd-numbered zero-based index in the list
to be passed over incorrectly. This might present as yet another "device
does not send pressure" bug for ~50% of devices out there.

This commit also closes off another potential segfault for wintab_devices
lists which have an odd length.

https://bugzilla.gnome.org/show_bug.cgi?id=774699
2016-11-21 19:11:09 +01:00
Emmanuele Bassi
7ae83717af Bump the Graphene dependency
The initialization macros for Point, Point3D, Size, and Rectangle have
been modified in Graphene 1.5.1 to allow their use as compound
literals.
2016-11-21 16:24:34 +00:00
Emmanuele Bassi
4cbe079767 Use Graphene init macros for compound literals
The Graphene init macros can now be used for compound literals, which
means we need to update our mixed uses.
2016-11-21 16:21:38 +00:00
Gustavo Noronha Silva
8e5e165f79 Fix off by one in check for GtkRoundedBox containing a rectangle
When checking if a rectangle is contained by the rounded box, the code
will refuse a rectangle which is the exact size as the one backing the
rounded box, since it checks for greater or equal width and height.
Check for greater only instead.

https://bugzilla.gnome.org/show_bug.cgi?id=774114
2016-11-21 10:53:11 -02:00
Balázs Meskó
895fd0e773 Update Hungarian translation 2016-11-21 09:35:08 +00:00
Balázs Meskó
bd73a55f32 Update Hungarian translation 2016-11-21 09:33:59 +00:00
Chun-wei Fan
efd92da101 Visual Studio builds: Rename broadwayd to gtk4-broadwayd
We need to update the solution file and the projects that refer to
broadwayd.
2016-11-21 15:51:21 +08:00
Chun-wei Fan
724e7f48e7 gdk/win32/gdkwindow-win32.c: Fix build
Fix the assignment of ->create_draw_context, in which an underscore is
accidently added.
2016-11-21 15:40:28 +08:00
Chun-wei Fan
18b1305d08 build: Complete renaming of broadwayd to gtk4-broadwayd
The parts where the Visual Studio projects are generated must also be updated
so that 'make dist' will work properly.
2016-11-21 15:09:35 +08:00
Matthias Clasen
a33b551f83 Update for 3.89.1 2016-11-20 08:14:36 -05:00
Matthias Clasen
8a88745186 Some additions to the migration guide 2016-11-20 08:14:19 -05:00
Matthias Clasen
7625beec50 fishbowl: Fix up initial text
Avoid the text changing from "0 fish" to "0 icons" right
after opening the fishbowl demo.
2016-11-20 06:15:19 -05:00
Benjamin Otte
e62a4d8eea API: gdk: Remove ability to render window contents
The functions gdk_pixbuf_get_from_window() and
gdk_cairo_set_source_window() are unreliable and depend on the windowing
system (they work great on X11 and Win32, less so on Quartz and Wayland).

With the switch to new drawing API and OpenGL, we can definitely no
longer support a generic way to snapshot windows.

People should either write windowsystem-specific code or draw their
widgets directly - like with gtk_widget_draw() - if they need to get a
rendering.
2016-11-20 11:47:44 +01:00
Benjamin Otte
84918c7e6f modules: Add a check for GTK3 symbols
This way, we can warn if GTK2 or GTK3 are linked into libgtk4.
2016-11-20 11:44:19 +01:00
Benjamin Otte
78888ade0d tools: Rewrite screenshotting code for shooter
Uses X directly, so bypasses both the need to query the root window and
to draw window contents.
2016-11-20 11:43:09 +01:00
Benjamin Otte
196737a958 reftest: Make screenshot code work without GDK
GDK does not support taking images of GDK windows.
2016-11-20 11:20:34 +01:00
Benjamin Otte
dfd9150a82 build: Don't link against libgtk and libgdk
libgdk is statically linked these days, so if you link against it, all
of its symbols will exist twice: Once in libgtk.so and once in your
binary.
2016-11-20 11:19:32 +01:00
Benjamin Otte
fef2f96add tests: Remove outdated tests
The tests read a nonexisting colorprofile, try to convert stuff read
from the window into it, do things that gdk-pixbuf should test and
then aren't even integrated into the testuite.

Sheesh.
2016-11-20 08:33:13 +01:00
Benjamin Otte
1492175a28 window: Remove unused destroy_draw_context vfunc 2016-11-20 07:27:00 +01:00
Benjamin Otte
cb18752f94 gdk: Make each backend have a custom GdkDrawingContext subclass 2016-11-20 07:19:52 +01:00
Benjamin Otte
1912d992d8 gtk-demo: Allow locking of icon count in fishbowl demo
I'm not sure I'm proud of the hack to get the changing icon into the UI
file without having to write code. But it works.
2016-11-20 05:29:03 +01:00
Benjamin Otte
39bf2ba96f cairorenderer: Record cpu time in the profiler 2016-11-20 05:28:52 +01:00
Benjamin Otte
aa084333c8 inspector: Redo recording list
- Make the rows larger
- Display the elapsed time between renderings
- Display if it was a full or a partial redraw
- Add a toggle button to display profiler info
2016-11-20 05:03:18 +01:00
Benjamin Otte
be237dbb5a inspector: Pass the renderer when recording
... and collect the profiler information from the renderer.
2016-11-20 03:54:43 +01:00
Benjamin Otte
32adb31428 inspector: Record a "start" event whenever we start recording 2016-11-20 03:54:43 +01:00
Matthias Clasen
b404ecf294 Drop deprecated gtk_dialog_get_action_area
Add an internal version for the few places where we still need it,
and drop it from everywhere else.
2016-11-19 21:23:17 -05:00
Matthias Clasen
b0303c539c Make unknown window types fatal
This helps gcc to see that there's no point in warning about
gdk_window being used uninitialized.
2016-11-19 21:23:17 -05:00
Benjamin Otte
b93c26f559 render: Refactor background drawing code
We can query the blend mode inside the paint function.
2016-11-19 21:28:18 +01:00
Benjamin Otte
305ea71b97 inspector Reselect bottom row in recorder
When inserting a new recording and the bottommost row was selected,
select the newly added row. This way, you can observe the ongoing
recording.
2016-11-19 20:58:36 +01:00
Benjamin Otte
38f226b5ce render: Propagate snapshot drawing to box shadows
This decouples actual background drawing from shadow drawing in the
snapshot case.

We also now create seperate nodes for shadows vs for backgrounds.
2016-11-19 20:58:36 +01:00
Benjamin Otte
c45f8b1a25 cssshadows: Reengineer API
This way we have an API to query extents per shadow and I want that in
the next patch.
2016-11-19 20:58:36 +01:00
Benjamin Otte
2745c2502f snapshot: Move GtkSnapshot declaration to gtypes.h 2016-11-19 20:58:36 +01:00
Matthias Clasen
8afb655347 Document gtk_menu_place_on_monitor 2016-11-19 13:51:50 -05:00
Matthias Clasen
fd6d28dd8d Add some things to the sections file
This makes gtk-doc happier.
2016-11-19 13:46:13 -05:00
Matthias Clasen
1bffefce7d Small documentation additions 2016-11-19 13:45:58 -05:00
Matthias Clasen
5170218a1d More work towards a clean doc build
Tell gtk-doc about more private headers.
2016-11-19 13:45:04 -05:00
Matthias Clasen
9bacbb489b Don't confuse gtk-doc
It doesn't like doc comments for non-api.
2016-11-19 13:44:36 -05:00
Matthias Clasen
64a75ec87d Drop docs for no-longer-existing API
Poor gtk-doc gets confused so easily...
2016-11-19 13:36:58 -05:00
Matthias Clasen
2d65156be3 Add gtk_im_context_simple_add_compose_file 2016-11-19 13:30:27 -05:00
Matthias Clasen
b0feee803f Add a since tag 2016-11-19 13:30:02 -05:00
Matthias Clasen
6734f354b4 docs: Add gtk_print_job_set_source_fd 2016-11-19 13:26:49 -05:00
Matthias Clasen
d0f8e324b1 Add gtk_menu_place_on_monitor to the docs 2016-11-19 12:53:13 -05:00
Matthias Clasen
712196c416 Don't confuse gtk-doc
Empty doc comments make gtk-doc complain about undocumented
functions, even though these functions are not supposed to
be documented in the first place.
2016-11-19 12:39:09 -05:00
Matthias Clasen
3dc53dab69 Document ::snapshot vfunc 2016-11-19 12:37:19 -05:00
Matthias Clasen
c9c391bd55 Drop macro wrappers for get_version functions
These are not really useful, and were added long ago
as a clutch for transitioning to the new names.
2016-11-19 12:28:52 -05:00
Matthias Clasen
c418ce0365 testgtk: Stop using gtk_micro_version
This will be going away soon
2016-11-19 12:28:52 -05:00
Matthias Clasen
158afb4ef9 Fix a signature mismatch
The new drawingarea draw func returns void.
2016-11-19 12:28:52 -05:00
Benjamin Otte
9dae0a9b00 widgetnode: We never need widget paths anymore
Backwards compat is not necessary in GTK4.
2016-11-19 18:08:35 +01:00
Matthias Clasen
0d1c54b6cc Remove once again, empty doc comments that break the docs
This is just more breakage from introspection ursurping doc
comments. Somebody needs to find a proper solution before this
is brought back.
2016-11-19 12:02:07 -05:00
Ask Hjorth Larsen
270af15f16 Updated Danish translation 2016-11-19 16:29:44 +01:00
Matthias Clasen
0392acd875 Reduce the text shadow warnings
They make it hard to see other useful information.
2016-11-19 08:05:42 -05:00
Baurzhan Muftakhidinov
76b8adcfbd Update Kazakh translation
(cherry picked from commit 4bc2904dae)
2016-11-19 12:16:13 +00:00
Benjamin Otte
dc634fe6db render: Compute extents correctly
I multiplied matrices the wrong way. Again.
2016-11-19 03:15:51 +01:00
Benjamin Otte
14b746eeaa tests: Remove styleexamples test
It's so outdated it doesn't even do anything useful anymore.

So I'll just assume nobody uses it.
2016-11-19 03:02:46 +01:00
Simon Steinbeiss
a1deb8e459 progressbar: add empty and full classes on trough based on fill-level
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-11-19 03:02:46 +01:00
Benjamin Otte
ca47c75272 tests: Use new drawing area APIs in testcairo 2016-11-19 03:02:46 +01:00
Benjamin Otte
4a604cf927 tests: Use drawing area in testellipsise 2016-11-19 03:02:46 +01:00
Benjamin Otte
915e791586 tests: Use new drawing area APIs 2016-11-19 03:02:46 +01:00
Matthias Clasen
295066dad8 inspector: Show render node properties 2016-11-18 20:59:10 -05:00
Matthias Clasen
aa74d96532 Document newly supported 3d transforms in CSS 2016-11-18 19:34:02 -05:00
Matthias Clasen
7d34229cdd More docs cleanup 2016-11-18 18:54:45 -05:00
Benjamin Otte
dbfc1d72fc csstransform: Handle matrix3d() 2016-11-18 21:44:25 +01:00
Benjamin Otte
ff4b8512be csstransform: Implement 3D scale and transform matrices 2016-11-18 21:44:25 +01:00
Benjamin Otte
ef6d95879f csstransforms: Parse 3D rotations 2016-11-18 21:44:25 +01:00
Benjamin Otte
d52fcd914c csstransform: Convert to use graphene_matrix_t
Pre-work to use 3D-transforms.
2016-11-18 21:44:25 +01:00
Benjamin Otte
fe23c3165e tests: Use a drawing area in motion-compression example 2016-11-18 21:44:25 +01:00
Benjamin Otte
e950d0cd8b tests: Use a drawing area in animated-resizing 2016-11-18 21:44:25 +01:00
Matthias Clasen
0a75bb4353 Work towards a clean docs build
Remove various no-longer-existing functions from the sections
file, and exclude more private headers, etc.
2016-11-18 14:43:34 -05:00
Matthias Clasen
b15bc437a6 Rename broadwayd to gtk4-broadwayd
This was the last unprefixed binary, and it was causing file
conflicts between gtk3 and gtk4.
2016-11-18 13:40:37 -05:00
Olivier Fourdan
36575a4424 gdkwindow: Allow native subsurface for all parents
Under Wayland, a subsurface can have another surface as parent, but
gdk would not allow native windows if the parent is not the root window.

Allow native subsurface for all parent under Wayland, not just for the
root window.

https://bugzilla.gnome.org/show_bug.cgi?id=774475
2016-11-18 13:25:36 -05:00
Carlos Garnacho
665c3a2877 wayland: Keep last scale factor on surfaces after it left all outputs
This can be triggered on workspace switches, and on hidpi results in
the scale factor being reset to 1 while the window is not in the
current workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=774476
2016-11-18 13:24:31 -05:00
Matthias Clasen
f73c5dd8dd docs: Name the 3.90 index properly 2016-11-18 08:14:23 -05:00
Matthias Clasen
5c1af1af04 docs: Ignore gtksnapshotprivate.h 2016-11-18 08:12:20 -05:00
Matthias Clasen
0311a1883c snapshot: Name api parameters consistently
gtk-doc gets upset otherwise.
2016-11-18 07:57:10 -05:00
Matthias Clasen
95c13ee471 Document GtkSnapshot
This is just some initial documentation, more detail needed.
2016-11-18 07:43:39 -05:00
Matthias Clasen
9ecb34b4a0 Add some drawing information the migration guide
Mention snapshot(), and the new GtkDrawingArea API.
2016-11-18 07:43:33 -05:00
Matthias Clasen
3c5dbc2f17 docs: Add GtkDrawingAreaDrawFunc 2016-11-18 06:09:46 -05:00
Benjamin Otte
3ee2138ee7 tests: Use a drawing area in testpopup 2016-11-18 07:24:31 +01:00
Benjamin Otte
f2fb2da8bd tests: Make testtooltips not use the draw signal 2016-11-18 07:22:02 +01:00
Benjamin Otte
a57fe52fc6 tests: Produce load without waiting for draw signal 2016-11-18 07:15:12 +01:00
Benjamin Otte
4a06d22c7d tests: Use drawing area instead of draw signal 2016-11-18 07:14:28 +01:00
Benjamin Otte
cd8d84beb6 testsuite: Don't use draw signal, use a drawing area instead 2016-11-18 06:40:53 +01:00
Benjamin Otte
dd6fb87443 printunixdialog: Use new drawing area API 2016-11-18 06:40:53 +01:00
Benjamin Otte
b0f392534f coloreditor: Don't draw a background on boxes
Boxes know how to draw backgrounds these days.
2016-11-18 06:40:53 +01:00
Benjamin Otte
979b56e86f gtk-demo: Update drawing area usage to new APIs
A few demos are broken because they do input on drawing areas.
2016-11-18 06:40:53 +01:00
Benjamin Otte
5940625e9e drawingarea: Add gtk_drawing_area_set_draw_func() 2016-11-18 06:40:53 +01:00
Benjamin Otte
41d1e1fea8 drawingarea: Add content-width and content-height properties
People should use these instead of gtk_widget_set_size_request().
2016-11-18 06:40:53 +01:00
Benjamin Otte
100ac17505 drawingarea: Clean up
No need to send configure events anymore and this should be a no-window
widget.
2016-11-18 06:40:53 +01:00
Matthias Clasen
585b1d5f67 gsk: Don't leak texture surfaces
gsk_texture_download returns a reference.
2016-11-17 20:30:34 -05:00
Matthias Clasen
39e3b3a483 style context: Don't leak a widget path
Found by valgrind.
2016-11-17 20:22:42 -05:00
Benjamin Otte
efa1c6cbd5 widget: Add a defualt snapshot vfunc
Just to avoid having to do NULL checks when calling
widget_class->snapshot. We were crashing with drawing areas who don't
have a draw or a snapshot vfunc (woot!).
2016-11-18 00:47:56 +01:00
Marek Černocký
f8f2b8144f Updated Czech translation 2016-11-18 00:40:11 +01:00
Benjamin Otte
9a06b0fd5f widget: Fix math screwups in clip calculation
We need so subtract the allocation from the clip to get the clip offset,
not the other way around.

This was screwing in particular with marks on GtkScale, because GtkScale
mark clip computation is broken and always returns (0,0) which makes
scales have a waaaaay too large clip.
But that's another bug.
2016-11-17 23:16:14 +01:00
Benjamin Otte
c162b87ebd gdk: Fix a variable
The passed in surface is the current_paint surface, so I guess this
usage hasn't been noticed.
2016-11-17 22:11:33 +01:00
Matthias Clasen
214eb5860d placeview: Don't leak the file enumerator
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774634
2016-11-17 13:50:25 -05:00
Matthias Clasen
0cec768b54 entry: Fix input window position for icons
This makes the icon in the placesview address entry and
in widget-factory's progress entry work again.
2016-11-17 12:04:35 -05:00
Timm Bäder
957274ed1a tests/styleexamples: Remove gtk_render_extension calls
The function doesn't exist anymore so there's nothing to test.
2016-11-17 16:48:57 +01:00
Timm Bäder
55fda57c44 filechooserwidget: Forward file filter to entry
And in the entry, apply the currently used filter as a second step to
the completion items.

https://bugzilla.gnome.org/show_bug.cgi?id=773007
2016-11-17 15:42:25 +01:00
Timm Bäder
f4929360aa sizerequest: rename _compute_size_for_orientation to _measure
They have the exact same parameters and gtk_widget_measure did
unnecessary work before. Also better stack traces!
2016-11-17 15:42:25 +01:00
Matthias Clasen
fbbd3ccfd7 docs: Fix print-related includes
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774614.
2016-11-17 09:33:30 -05:00
Matthias Clasen
5b3b111260 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:06:57 -05:00
Matthias Clasen
2f197ac0c2 Revert "GtkFileChooser: Make local-only default to FALSE"
This reverts commit 0bc79910e0.
2016-11-17 09:05:47 -05:00
Matthias Clasen
0bc79910e0 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:02:29 -05:00
Matthias Clasen
77aa562415 gtk-demo: Set local-only to FALSE for the file chooser
No good reason for that.
2016-11-17 08:51:16 -05:00
Ondrej Holy
16bce17168 gtkplacesview: Add example of IPv6 address in guidance
Square brackets are mandatory for IPv6 addresses. Add example of IPv6
address in the guidance to make it obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-11-17 08:15:40 -05:00
Matthias Clasen
21570a57f2 docs: Update an example
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774490
2016-11-17 06:17:11 -05:00
Caolán McNamara
ce36ac93f4 spin entry should be a child of spin context
https://bugzilla.gnome.org/show_bug.cgi?id=774609
2016-11-17 05:55:20 -05:00
Rafael Fontenelle
4ad4275c24 Update Brazilian Portuguese translation
(cherry picked from commit 0103bbf5eb)
2016-11-17 04:21:33 +00:00
Benjamin Otte
ab60cbd86a snapshot: Implement gtk_snapshot_clips_rect()
And use this to cull widgets and gadgets that are completely outside the
clip region.

A potential optimization is to apply this clip region to cairo contexts
created with gtk_snapshot_append_cairo_node(), but for that we'd need to
apply the inverse matrix to the clip region, and that causes rounding
errors.

Plus, I hope that cairo drawing becomes exceedingly rare so it won't be
used for the whole widget factory like today (which might also explain
why no culling happens in the widget factory outside the header bar.
2016-11-17 03:33:50 +01:00
Benjamin Otte
28b32d336f snapshot: Pass the clip region to the snapshot 2016-11-17 02:14:10 +01:00
Benjamin Otte
7493f90662 snapshot: Add GtkSnapshotState
Essentially copies cairo_gstate_t.

This is in preparation for attaching more information to the snapshot.
2016-11-17 01:55:26 +01:00
Benjamin Otte
5dfe788e9e snapshot: Fix graphene misunderstandings
The equivalent to cairo_matrix_multiply (a, b, c) is
graphene_matrix_multiply (c, b, a).

graphene_matrix_multiply (a, b, c) may not be called with b and c being
the same matrix.
2016-11-17 01:05:15 +01:00
Benjamin Otte
6d9725f7fd snapshot: Add infrastructure to snapshot CSS images
Use this infrastructure to render builtin images. Which means from now
on, GtkCheckbutton, GtkSpinner and a few others use snapshots.
2016-11-16 20:51:53 +01:00
Benjamin Otte
c22a9a03f9 renderbackground: Remove unused functions 2016-11-16 19:31:47 +01:00
Benjamin Otte
bcf70e3a03 API: Remove everything relating to "grip"
Grips have long been unused in GTK, so remove all support for them.
This removes the GTK_STYLE_CLASS_GRIP and the special
gtk_render_handle() code for drawing those grips.
2016-11-16 19:27:43 +01:00
Benjamin Otte
56e11f057c API: Remove gtk_render_extension()
This is long-gone drawing API.
2016-11-16 18:36:10 +01:00
Benjamin Otte
48e7f4191f gsktexture: Allow attaching render data to textures
This allows renderers (or anyone really) to attach "render data" to
textures. Only the first render data sticks.

You can gsk_texture_set_render_data() with the key you will use to
look the data up again, and if no data has been set yet, yours will be
set.

You can retrieve this data via gsk_texture_get_render_data() later on.
If your data has been cleared, NULL will be returned.

When gsk_texture_clear_render_data() is called (which the texture will
call when it is finalized), your destory notify will be called and you
have to release your render data.

The GL driver uses this to attach texture ids to GskTextures.
2016-11-16 17:36:33 +01:00
Benjamin Otte
40565fb030 gsk: Rework GskTexture
We do no longer bind textures to a renderer, instead they are a way for
applications to provide texture data.

For now, that's it. We've reverted to uploading it from scratch every
frame.
2016-11-16 17:36:33 +01:00
Piotr Drąg
455ce80ff7 Update Polish translation 2016-11-16 13:08:32 +01:00
Piotr Drąg
6e9ee9e03c Update Polish translation 2016-11-16 11:43:34 +01:00
Benjamin Otte
f728f33382 container: ensure we only append a single node
The snapshot vfuncs must only append at most a single node,
otherwise things are going to break if the widget is the root node.

Unfortunately there is no code that can check this in a generic fashion,
so we'll have to debug this on a case-by-case basis.
2016-11-15 22:39:26 +01:00
Benjamin Otte
2e9ff11c85 snapshot: push/pop mismatch is critical
This is broken code that needs to be fixed right now.
2016-11-15 22:39:05 +01:00
Benjamin Otte
b8710d8962 widget: Remove get_render_node() vfunc 2016-11-15 17:49:19 +01:00
Benjamin Otte
313a708006 snapshot: Convert inspector's RenderNodeView 2016-11-15 17:49:19 +01:00
Benjamin Otte
e2fb970889 container: Remove get_render_node() support API
It's unused now.
2016-11-15 17:49:19 +01:00
Benjamin Otte
e8381f84d6 snapshot: Convert GtkPopover 2016-11-15 17:49:19 +01:00
Benjamin Otte
475cffd7f8 gadget: Remove gtk_css_gadget_get_render_node()
It's unused now that we can snapshot.
2016-11-15 17:49:19 +01:00
Benjamin Otte
ada70f4872 snapshot: Convert GtkIcon 2016-11-15 17:49:19 +01:00
Benjamin Otte
d38cf9fee2 snapshot: Convert GtkExpander 2016-11-15 17:49:19 +01:00
Benjamin Otte
82eb223c58 Revert "GtkFrame: Convert to indirect rendering"
This reverts commit a0b2b3745f.

Frames cannot be rendered by GSK yet, because they do clipping.
2016-11-15 17:49:19 +01:00
Benjamin Otte
9c1da58ad1 snapshot: Convert GtkSeparator 2016-11-15 17:49:19 +01:00
Benjamin Otte
47a82640a8 Revert "Covert GtkOverlay to indirect rendering"
This reverts commit fd4a1cdad6.

GtkOverlay uses clipping and render nodes can't clip yet.
2016-11-15 17:49:19 +01:00
Benjamin Otte
30e0bbeaaa snapshot: convert GtkListBox 2016-11-15 17:49:19 +01:00
Benjamin Otte
150f75af66 snapshot: Convert GtkFlowBox 2016-11-15 17:49:19 +01:00
Benjamin Otte
a2b1aef6bd Revert "paned: Convert to indirect rendering"
This reverts commit ba9193fc81.

Paneds can do indirect rendering yet as we need clipping support first.
2016-11-15 17:49:19 +01:00
Benjamin Otte
dad8703e03 snapshot: Convert GtkSpinner 2016-11-15 17:49:19 +01:00
Benjamin Otte
0cf9f70ccd snapshot: Convert box gadget
Makes spinbuttons have text again!
2016-11-15 17:49:19 +01:00
Benjamin Otte
3a18bed7d7 gsk: Allow creating cairo contexts for 0x0 nodes
This happens in regular code paths for example when trying to render the
empty text string. We don't want to store a surface on the render
node in such a case (so actual rendering isn't slowed down), but we do
want to return a working cairo context that is not in an error state
(so the cairo rendering can continue without error messages).
2016-11-15 17:49:19 +01:00
Benjamin Otte
703d80eac0 window: Unrealize renderer last
We want to unrealize the renderer only after all widgets have been
unrealized. Otherwise, the widgets cannot release rendering resources
like textures.
2016-11-15 17:49:19 +01:00
Benjamin Otte
e253f408e3 rendernode: Unref texture on finalize
Leaking textures is no fun.
2016-11-15 17:49:19 +01:00
Benjamin Otte
4b8b06bb08 image: Invalidate icon helper when unrealizing
This frees up any cached surfaces and textures in the iconhelper,
ensuring that the renderer can release its texture data.
2016-11-15 17:49:19 +01:00
Benjamin Otte
c0aa065ac1 snapshot: Convert GtkImage and GtkIconHelper
Adds a bunch of new APIs to render textures with theming.

FIXME: Cannot draw shadows for textures.
2016-11-15 17:49:19 +01:00
Benjamin Otte
92e6b3a000 snapshot: Port GtkHeaderBar 2016-11-15 17:48:45 +01:00
Benjamin Otte
55de4e7140 snapshot: Convert GtkFixed 2016-11-15 17:48:45 +01:00
Benjamin Otte
9b6dfa83e2 snapshot: Convert GtkComboBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
349f55f2fe snapshot: Convert GtkLabel and GtkAccelLabel
Also adds gtk_snapshot_render_insertion_cursor().
2016-11-15 17:48:45 +01:00
Benjamin Otte
ab47479045 snapshot: Convert GtkButton and subclasses 2016-11-15 17:48:45 +01:00
Benjamin Otte
4c9033b62d snapshot: Port GtkActionBar 2016-11-15 17:48:45 +01:00
Benjamin Otte
8c77b6f7f1 snapshot: Convert GtkButtonBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
cc1b422f64 snapshot: Convert GtkGrid 2016-11-15 17:48:45 +01:00
Benjamin Otte
64e802c441 snapshot: Convert entry and spinbutton 2016-11-15 17:48:45 +01:00
Benjamin Otte
8ac7918e0b snapshot: convert GtkBox 2016-11-15 17:48:45 +01:00
Benjamin Otte
e3b1c9f1cd snapshot: Port to GtkSwitch
Included is the addition of gtk_snapshot_render_layout(), which is meant
to replace gtk_render_layout().
2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
4e06d8f73c snapshot: Add gtk_css_gadget_snapshot()
Including a snpahsot() vfunc, wee!
2016-11-15 17:48:45 +01:00
Benjamin Otte
ae2477b1bc container: Add snapshot() implementation
Note that this implementation does not respect GDK windows at all. If
your widget requires respecting them, you should write your own
snapshot implementation and not chain up.
2016-11-15 17:48:45 +01:00
Benjamin Otte
2cd9e5170e widget: Add more sophisticated detection of rendering method
We now look at which of get_render_mode, draw or snapshot vfuncs is the
latest to have been overwritten in the class tree and then use that one.

This allows GtkContainerClass and GtkBinClass to override all of them
for without screwing things up.
2016-11-15 17:48:45 +01:00
Benjamin Otte
79d2d0e40d snapshot: Add gtk_snapshot_render_background()
and gtk_snapshot_render_frame() to be direct replacements for the
old gtk_render_*() functions.

Use them to replace Cairo usage completely in gtk_window_snapshot().
2016-11-15 17:48:45 +01:00
Benjamin Otte
9006e697fb flowbox: children per line may not be 0 2016-11-15 17:48:45 +01:00
Benjamin Otte
d1fec79c00 snapshot: Completely reengineer API
We now try to emulate cairo_t:

We keep a stack of nodes via push/pop and a transform matrix.

So whenever a new node is added to the snapshot, we transform it
by the current transform matrix and append it to the current node.
2016-11-15 17:48:45 +01:00
Benjamin Otte
956edd83a7 gsk: Add implementation for gsk_render_node_get_transform() 2016-11-15 17:48:45 +01:00
Benjamin Otte
bb9626dc29 window: Implement snapshot() 2016-11-15 17:48:45 +01:00
Benjamin Otte
b1154be1c4 widget: Add GtkWidgetClass.snapshot() vfunc
Does the same thing as the render vfunc, only that it uses a different
prototype.
2016-11-15 17:48:45 +01:00
Benjamin Otte
93cbba6c3e gtk: Add gtk_widget_snapshot()
It's functionally equivalent to gtk_widget_get_render_node() but uses a
GtkSnapshot argument to carry the state.
2016-11-15 17:48:45 +01:00
Carlos Garnacho
f90dcb33f9 gdk: Fix win32 build typo
We've left libgdk-3 behind. Noticed by Andrew Chadwick, spotted
by Emmanuele Bassi.
2016-11-15 17:09:30 +01:00
Marek Cernocky
4c7f907d16 Updated Czech translation 2016-11-15 14:39:46 +01:00
Matthias Clasen
d462c31233 entry: Avoid recursion in gtk_entry_ensure_layout
This was unintentional, and lead to a memory leak.
2016-11-14 15:17:41 -05:00
Lauri Kasanen
8b75268d1c recent-manager: Fix a memory leak caused by "recent-manager: Add a limit to the list's size"
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-14 14:26:34 -05:00
Matthias Clasen
34e26017e3 appchooser: Plug a memory leak
We were not dropping the reference that the model gives us.

https://bugzilla.gnome.org/show_bug.cgi?id=774352
2016-11-14 14:19:58 -05:00
Andrew Chadwick
83712a48f4 win32: remove an unused func operating on GdkColor
https://bugzilla.gnome.org/show_bug.cgi?id=774347
2016-11-14 14:11:36 -05:00
Matthias Clasen
23354ff6e7 widget-factory: Better progressbar testing
Hook the two top progressbars up to the scale with marks.
Your turn, Lapo.
2016-11-14 08:21:31 -05:00
Olivier Fourdan
03b8a8a880 gtkstack: reorder size_allocate and move_window
Unlike other container widgets, GtkStack would allocate its children
prior to moving its windows, which might prevent further valid size
allocation signals to be emitted.

Re-order the size allocation of child widgets to be performed after
moving the GtkStack windows.

Thanks to Owen for spotting the real issue here.

https://bugzilla.gnome.org/show_bug.cgi?id=767713
2016-11-14 12:24:18 +01:00
Olivier Fourdan
4ae1eab3b1 Revert "gdkwindow: configure native windows in move_native_children()"
This reverts commit 9e2b1ad39e.
2016-11-14 12:24:18 +01:00
Olivier Fourdan
5ccc570cca Revert "gdk: Get rid of unused variables"
This reverts commit 7016409e9f.
2016-11-14 12:24:18 +01:00
Matthias Clasen
2520662d13 Allow replacing input file in gtk-builder-tool simplify 2016-11-12 22:33:01 -05:00
Timm Bäder
c944bf7330 Call gtk_widget_set_has_window for missing windowed widgets 2016-11-12 21:48:23 +01:00
Timm Bäder
4e445e8e53 window: Properly propagate for_size=-1 2016-11-12 20:37:30 +01:00
Timm Bäder
0d88fe65ba stack: Use gtk_widget_measure 2016-11-12 20:37:22 +01:00
Timm Bäder
95eed97586 listbox: Use gtk_widget_measure 2016-11-12 20:37:18 +01:00
Timm Bäder
9a0513d911 window: Use gtk_widget_measure 2016-11-12 20:37:14 +01:00
Timm Bäder
997fd3c81e grid: Use gtk_wiget_measure 2016-11-12 20:37:10 +01:00
Timm Bäder
26746c8369 toolitemgroup: Remove style properties
Replace them with their default values
2016-11-12 08:10:02 +01:00
Timm Bäder
fdc0c6426b combobox: Remove appears-as-list style property
Remove all the code handling the appears-as-list=TRUE case.
2016-11-12 08:10:02 +01:00
Timm Bäder
5e06701f53 treeview: Remove style properties
Replace them with the Adwaita default values
2016-11-12 08:09:58 +01:00
Chun-wei Fan
fcd216a409 gdkscreen-win32.c: Also define _WIN32_WINNT
As in the last commit on gdkdisplay-win32.c, we need to define that to be
0x0600 (Vista) or later so that the items needed in the Windows headers be
activated.

See: https://bugzilla.gnome.org/show_bug.cgi?id=768081#c62
2016-11-11 21:06:01 +08:00
Chun-wei Fan
718efc2f59 gdkdisplay-win32.c: Define _WIN32_WINNT
... to be for Vista (0x0600) or later.  This is so that the necessary
items in the Windows headers be activated so that the code will build
properly on mingw-w64, and we already require Vista or later for GTK+.

Thanks Ting-Wei Lan for pointing this out.

See: https://bugzilla.gnome.org/show_bug.cgi?id=768081#c62
2016-11-11 20:58:16 +08:00
Lauri Kasanen
0d364173f6 recent-manager: Add a limit to the list's size
This fixes a DOS where any app can cause all running gtk apps
to use arbitrary amounts of memory.

Originally reported against mate-panel, where running a big slideshow
in eye-of-mate caused increasing RAM usage in mate-panel.

v2: Hardcode the value
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-10 17:09:45 -05:00
Matthias Clasen
3c27774a5d places sidebar: Don't leak a reference
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185
2016-11-10 15:16:05 -05:00
Matthias Clasen
5e19e06dcc Fix a copy-paste error
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185#c3
2016-11-10 15:07:08 -05:00
Matthias Clasen
547970b0bc headerbar: Don't leak widgets
We were not properly freeing separators that we end up
not using.

https://bugzilla.gnome.org/show_bug.cgi?id=774066
2016-11-10 15:03:35 -05:00
Matthias Clasen
c7d119614f spinbutton: Fix some gadget handling issues
We were not adding the down_button gadget to the parent,
and we were not unreffing the button gadgets.

https://bugzilla.gnome.org/show_bug.cgi?id=774046
2016-11-10 14:46:21 -05:00
Massimo Valentini
8121860251 GdkGLContext: chain finalize handler
https://bugzilla.gnome.org/show_bug.cgi?id=773979
2016-11-10 14:34:31 -05:00
Thibaut Girka
641b42f9f5 Fix loading cached compose tables
https://bugzilla.gnome.org/show_bug.cgi?id=773916
2016-11-10 14:32:59 -05:00
Gustavo Noronha Silva
942e904bcc cssshadowvalue: scale the blur surface by the same factor as the target
Making sure the surfaces are using the same scale factor makes it more
likely a fast path will be used when pixman gets involved, as pointed
out by Benjamin Otte.

https://bugzilla.gnome.org/show_bug.cgi?id=772075
2016-11-10 16:47:13 -02:00
Carlos Garcia Campos
c836be0508 printing: Do not truncate job names in GtkPrintOperation
We are currently truncating job names to 255 bytes, because that's the
maximum allowed length of job-name attribute in CUPS. This is a CUPS
limitation that GtkPrintOperation shouldn't need to know, and it
shouldn't affect other backends, that might have other limitations or
even no limitation at all. This has another side effect, that what you
set as GtkPrintOperation:job-name could be different to what you get if
the property is truncated, this is not documented in
gtk_print_operation_set_job_name(). So, I think the job name should be
truncated by the CUPS backend, right before setting the job-name
attribute.

https://bugzilla.gnome.org/show_bug.cgi?id=774097
2016-11-10 16:57:30 +01:00
Matthias Clasen
7b2313a6df Avoid criticals in gtk_image_get_render_node
These nodes can be NULL, we need to handle that.
2016-11-10 08:26:37 -05:00
Florian Müllner
38a8e4ee7c wayland: Set startup ID from GApplication platform data
The GApplication platform data may contain a startup ID that on X11
is used to set the startup notification ID when activated. Do the
same on the wayland backend to make startup notifications work for
DBus-activated applications where the DESKTOP_STARTUP_ID environment
variable is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=768531
2016-11-09 14:18:14 -05:00
Florian Müllner
d163aba030 gdkdisplay-wayland: Add API to set startup notification ID
For wayland clients, the startup notification ID is currently only set
from the DESKTOP_STARTUP_ID environment variable. As that variable is
only set for clients launched via exec(), startup completion is not
indicated correctly for DBus-activated applications unless an explicit
ID is specified - usually that is not the case, as the default handling
uses gdk_notify_startup_complete().
To address this, we need API to set the startup notification ID from GTK
as we have on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=768531
2016-11-09 14:18:14 -05:00
Benjamin Otte
1259a489f2 iconhelper: Add support for GskTexture
... and use that in GtkImage.
2016-11-08 20:31:34 +01:00
Benjamin Otte
09359197a7 gsk: Implement textures for the Cairo renderer 2016-11-08 20:31:34 +01:00
Benjamin Otte
46eb2c1be9 gsk: Add GskTexture 2016-11-08 20:31:34 +01:00
Marek Cernocky
71aeb8075b Updated Czech translation 2016-11-08 12:38:32 +01:00
Piotr Drąg
7c55830d02 Update POTFILES.skip 2016-11-08 10:08:14 +01:00
Benjamin Otte
c16a7d96b8 range: Don't leak pointers to discarded gadgets 2016-11-08 02:32:40 +01:00
Benjamin Otte
46b9b07a11 reftests: Add reftest for the last 2 fixes
Makes sure that the clipping we do when pushing a group is at the
correct place and in particular doesn't influence shadows.
2016-11-08 02:32:39 +01:00
Benjamin Otte
a54db5adcd render: Draw shadows outside of potential push_group() call
Before, the shadows were clipped.
2016-11-08 02:32:29 +01:00
Benjamin Otte
f9da4f0270 render: Clip the correct rectangle
We translated before.
2016-11-08 02:32:29 +01:00
Lapo Calamandrei
8d212ae5c2 Adwaita: tweak radial-gradient()'s
radial-gradient()'s are behaving, hence simplify the css.
2016-11-07 23:15:56 +01:00
Matthias Clasen
5b8646c6e8 Update the migration guide
Mention the demise of -gtk-gradient, and explain that CSS syntax
works fine for this now.
2016-11-07 16:00:05 -05:00
Matthias Clasen
2a5a94b260 css: Improve spec compliance of the radial gradient parser
The spec says:
"If <shape> is omitted, the ending shape defaults to a circle if the <size>
is a single <length>, and to an ellipse otherwise."

Make it so.
2016-11-07 15:40:21 -05:00
Matthias Clasen
fa7d77d407 Revert "Update the CSS docs for the demise of define-color"
This reverts commit 12d9451b1c.
2016-11-07 15:05:37 -05:00
Matthias Clasen
a1e03346d9 Revert "Update the migration guide"
This reverts commit b868164381.
2016-11-07 15:05:28 -05:00
Matthias Clasen
b868164381 Update the migration guide
Mention some removed CSS extensions.
2016-11-07 14:59:23 -05:00
Matthias Clasen
12d9451b1c Update the CSS docs for the demise of define-color 2016-11-07 14:49:46 -05:00
Matthias Clasen
1410031e57 Drop support for symbolic colors
-gtk-gradient was the last internal user of this code, so
we can drop it now.
2016-11-07 14:46:41 -05:00
Matthias Clasen
069c5e48d4 Update CSS docs to reflect the demise of -gtk-gradient 2016-11-07 14:46:41 -05:00
Matthias Clasen
d674e9c8fa Drop support for -gtk-gradient
The standard CSS radial-gradient can be used instead, and Adwaita
and HighContrast have been ported over.
2016-11-07 14:46:41 -05:00
Matthias Clasen
aceba7484f css: Avoid a crash while parsing radial gradients
has_size does not imply that sizes[0] is != NULL.
2016-11-07 14:46:15 -05:00
Lapo Calamandrei
5af1e87f59 HC: use radial-gradient() in place of -gtk-gradient(). 2016-11-07 18:22:28 +01:00
Lapo Calamandrei
c4a4fe32ea Adwaita: no more -gtk-gradient(), really
the undershoot is drawn with a radial-gradient now.
2016-11-07 18:12:42 +01:00
Chun-wei Fan
e470567fd0 gdkprivate-win32.h: Complete removal of attributes_mask
We removed this parameter from the function declaration, but not the
prototype.  Fix that.
2016-11-07 14:37:32 +08:00
Benjamin Otte
b04e25f29b gdk: gdk_window_new() is not called for foreign windows
So we can remove the special cases that were used for them.
2016-11-07 03:15:00 +01:00
Benjamin Otte
d2c26c471c gdk: Remove attributes_mask from gdk_window_new()
The only remaining values were always treated as 0, so we just hardcode
them to 0.
2016-11-07 01:33:43 +01:00
Benjamin Otte
9fe8b1e112 API: gdk: Remove gdk_window_new()
It's finally no longer public API.
2016-11-07 01:12:47 +01:00
Benjamin Otte
3b93773add API: gdk: Add gdk_window_new_temp()
Your one stop shop for all those nasty hidden input-only windows.
2016-11-07 01:03:17 +01:00
Benjamin Otte
24d0baec38 API: gdk: Add gdk_window_new_popup()
... and use it.
2016-11-06 23:47:56 +01:00
Benjamin Otte
13d8ac83ee range: Use gdk_window_new_input() 2016-11-06 23:46:44 +01:00
Benjamin Otte
0e93e39e74 tests: Remove subsurface test
It did lots of ubsupported things (like creating subsurfaces on every
platform).
2016-11-06 22:03:45 +01:00
Benjamin Otte
b30afff511 API: wayland: Add gdk_wayland_window_new_subsurface()
... and use it instead of gdk_window_new().
2016-11-06 21:36:43 +01:00
Benjamin Otte
87f07bac6b API: gdk: Add gdk_window_new_toplevel()
... and use it in GTK.
2016-11-06 17:40:59 +01:00
Benjamin Otte
7a6cab14eb gdkwindow: Remove GdkWindowAttr.type_hint
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.
2016-11-06 16:22:21 +01:00
Benjamin Otte
e0600346e2 scrolledwindow: Turn into no-window widget 2016-11-06 15:50:26 +01:00
Benjamin Otte
b7619a2603 x11: Set override_redirect on input-only windows
b9955cfff1 broke this.
2016-11-06 15:43:06 +01:00
Benjamin Otte
b7a72224e1 listbox: Turn into no-window widget 2016-11-06 14:52:56 +01:00
Benjamin Otte
2f8df5237f flowbox: Turn into no-window widget 2016-11-06 14:41:07 +01:00
John Ralls
2c642dd654 Update gdk-quartz functions for the demise of GdkDeviceManager. 2016-11-05 15:08:59 -07:00
John Ralls
2b53583e80 Remove screen height and width functions from gdk-quartz.
Since they were previously deleted from gdk.
2016-11-05 15:08:59 -07:00
John Ralls
5416db16f3 Add some new function prototypes to gtkquartz.h.
Fixes compile errors (-Werror,-Wmissing-prototypes).
2016-11-05 15:08:59 -07:00
John Ralls
a45f96e9cb Update GdkOSXVersion enum with the last 4 MacOS releases. 2016-11-05 15:08:59 -07:00
John Ralls
832f5b892c Framework Carbon required for building against MacOSX10.12.sdk.
Should be harmless elsewhere.
2016-11-05 15:08:59 -07:00
Lapo Calamandrei
f4c6994e57 Adwaita: no more -gtk-gradient()
the only place where it was used was the `needs attention` dot
which is now drawn using radial-gradient().
2016-11-05 16:16:37 +01:00
Timm Bäder
a5b967ed31 menu: Properly clip child menuitems
Now that GtkMenu isn't a windowed widget anymore, we have to
differentiate between the (0, 0) of the cairo_t and the position of
priv0->view_window.
2016-11-05 13:39:41 +01:00
Timm Bäder
96f382e5b0 tests/popupat: Remove references to noexistent widgets 2016-11-05 13:39:41 +01:00
Timm Bäder
fdc24c7505 entry: Fix coordinates after rendernode conversion
Ease the transition by removing the text_area and frame vfuncs which are
unused inside GTK+.
2016-11-05 11:56:37 +01:00
Timm Bäder
f483d931ec spinbutton: Convert to indirect rendering 2016-11-05 11:56:36 +01:00
Timm Bäder
932b9acb39 Revert "Revert "Convert GtkEntry to indirect rendering""
This reverts commit f4fa111e32.
2016-11-05 11:56:36 +01:00
Timm Bäder
3b970f4555 button: Remove _get_event_window 2016-11-05 11:56:36 +01:00
Timm Bäder
846cf681e8 Remove gtk_widget_set_mapped
Let all the remaining callers chain up.
2016-11-05 11:56:36 +01:00
Timm Bäder
34626eaa16 notebook: use gesture for clicks
Instead of GtkWidget's buton-press-event/button-release-event
2016-11-05 11:56:33 +01:00
Gábor Kelemen
a47fb1c451 Update Hungarian translation 2016-11-05 09:30:58 +00:00
Piotr Drąg
ff75f1c929 Update POTFILES.skip 2016-11-05 08:51:34 +01:00
Benjamin Otte
079f0427cb fixed: Port to GskRenderNode
The fishbowl demo uses this.
2016-11-05 03:35:46 +01:00
Benjamin Otte
2e284451ff gtk-demo: Add fishbowl demo 2016-11-05 03:35:46 +01:00
Benjamin Otte
a659bbecb9 win32: Remove unused headers 2016-11-05 03:35:36 +01:00
Benjamin Otte
9707f4d3b3 API: gdk: Remove title from gdk_window_new()
Use gdk_window_set_title() afterwards instead.
2016-11-05 03:32:27 +01:00
Benjamin Otte
b9955cfff1 API: gdk: Remove override_redirect flag from GdkWindowAttr
When you want an override-redirect window, you create it that way by
creating a GDK_WINDOW_TEMP window.
2016-11-05 03:32:27 +01:00
Benjamin Otte
33e7a7898f API: gdk: Remove gdk_window_set_override_redirect()
When you want an override-redirect window, you create it that way.
Changing that behavior is not supported anywhere (but on X of course).
2016-11-05 03:32:27 +01:00
Philip Withnall
1dbdbecd39 gtkstylecontext: Clarify memory allocation behaviour of getters
It wasn’t clear that gtk_style_context_get[_valist]() behave like
g_object_get() — i.e. pointer-based types are returned newly-allocated.
Clarify that.

https://bugzilla.gnome.org/show_bug.cgi?id=773954
2016-11-05 00:25:25 +00:00
Matthias Clasen
f4fa111e32 Revert "Convert GtkEntry to indirect rendering"
This reverts commit 3656c9f94c.

Still causes to many unresolved drawing issues.
2016-11-04 13:22:48 -04:00
Matthias Clasen
338534fb8d Fix up the fullscreen_on_monitor support
I didn't pay attention, and forgot to port this code to the
new monitor apis.
2016-11-04 12:41:51 -04:00
Georges Basile Stavracas Neto
8507083928 levelbar: update css nodes even when no offset value is found
GtkLevelBar supports adding custom offsets as style classes, and they
are applied whenever the :value property matches. The current code,
however, only updates any CSS nodes when an offset is found, causing
it to not update when a discrete value changes but no custom offset
is added.

Fix that by always updating the CSS nodes.

https://bugzilla.gnome.org/show_bug.cgi?id=773799
2016-11-04 12:38:21 -04:00
Rui Matos
b8fc4c246a gdkwindow-x11: Add support for gdk_window_fullscreen_on_monitor
This way we can recommend that applications use the
fullscreen_on_monitor() API on both X and Wayland otherwise they'd
have to keep a path for each backend to achieve this functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=773857
2016-11-04 12:10:43 -04:00
Matthias Clasen
2c26f0cae4 Complete the privatization of GtkTextAttributes
This was not quite complete, as gtktextattributes.h was still
being included in public headers.

https://bugzilla.gnome.org/show_bug.cgi?id=773903
2016-11-04 12:05:52 -04:00
Руслан Ижбулатов
e75878f976 W32: Fix malformed svg file
https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-11-04 13:36:34 +00:00
Chun-wei Fan
6abd65c83b GDK-Win32/4.0: Enable HiDPI support for Windows
This enables HiDPI support for GTK+ on Windows, so that the
fonts and window look better on HiDPI displays.  Notes for the current
work:

-The DPI awareness enabling can be disabled if and only if an application
 manifest is not embedded in the app to enable DPI awareness AND a user
 compatibility setting is not set to limit DPI awareness for the app, via
 the envvar GDK_WIN32_DISABLE_HIDPI.  The app manifest/user setting for
 DPI awareness will always win against the envvar, and so the HiDPI items
 will be always setup in such scenarios, unless DPI awareness is disabled.

-Both automatic detection for the scaling factor and setting the scale
 factor using the GDK_SCALE envvar are supported, where the envvar takes
 precedence, which will therefore disable automatic scaling when
 resolution changes.

-We now default to a per-system DPI awareness model, which means that we
 do not handle WM_DPICHANGED, unless one sets the
 GDK_WIN32_PER_MONITOR_HIDPI envvar, where notes for it are in the
 following point.

-Automatic scaling during WM_DISPLAYCHANGE is handled (DPI setting change of
 current monitor) is now supported.  WM_DPICHANGED is handled as well,
 except that the window positioning during the change of scaling still
 needs to be refined, a change in GDK itself may be required for this.

-I am unable to test the wintab items because I don't have such devices
 around.

https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-11-04 18:14:48 +08:00
Chun-wei Fan
3baa4a9741 gdkscreen-win32.c: Remove leftovers of removal of visual APIs
There were some more items that ought to be removed.  Remove them.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-04 17:28:12 +08:00
Balázs Meskó
9898085149 Update Hungarian translation 2016-11-04 06:18:55 +00:00
Benjamin Otte
4b88b81e67 x11: Init no-multihead monitor without root window
Previous code gave warnings because the root window wasn't initialized
yet.
2016-11-04 00:33:13 +01:00
Benjamin Otte
7c474c689a wayland: Remove all mentions of visuals 2016-11-04 00:17:57 +01:00
Benjamin Otte
77a9e90cb9 mir: Remove all mentions of visuals 2016-11-04 00:15:52 +01:00
Benjamin Otte
8040d78c04 broadway: Remove all mentions of visuals 2016-11-04 00:15:07 +01:00
Benjamin Otte
31a0933fe9 quartz: Remove all mentions of visuals 2016-11-04 00:10:43 +01:00
Benjamin Otte
ec06a717ce win32: Remove all mentions of visuals 2016-11-04 00:08:03 +01:00
Benjamin Otte
4585af5719 gdk: Remove visual APIs from GdkScreen
gdk_screen_list_visuals(), gdk_screen_get_system_visual() and
gdk_screen_get_rgba_visual() are gone now.
2016-11-04 00:02:37 +01:00
Benjamin Otte
fe08641205 x11: Maointin window visuals without GdkVisual
That way, we don't need a GdkScreen to create a GdkWindow anymore.
2016-11-03 23:54:39 +01:00
Benjamin Otte
b741d32262 x11: Remove unused hash table
We were neatly populating it, but nobody ever looked at it.
2016-11-03 22:47:42 +01:00
Benjamin Otte
0192f93689 x11: Replace gdk_display_get_window_visual()
... with functions that don't use GdkVisual.

A small step towards getting rid of GdkVisual.
2016-11-03 22:40:36 +01:00
Benjamin Otte
6c6359df4f menubar: We don't need an input window
Input is handled by the menuitems completely.
2016-11-03 21:29:07 +01:00
Benjamin Otte
d8d8059ee1 x11: Use X11 variables instead of GDK variables
This way, we avoid GdkVisual usage.
2016-11-03 20:33:33 +01:00
Benjamin Otte
4ebcb6fd1e x11: Remove unused complexity
With all Windows having the same visual, there's only ever one visual we
need to check.
2016-11-03 20:33:33 +01:00
Benjamin Otte
a178258a2a docs: Remove vfunc that doesn't exist anymore 2016-11-03 20:33:33 +01:00
Lapo Calamandrei
993f867744 Adwaita: correctly style headerbars in a stack
corners are correctly rounded now. Stacked splitted headerbars are
not supported yet though.
2016-11-03 14:04:32 -04:00
Ernestas Kulik
3885e85f77 popover: pop down when pressing escape
Simply hiding the popover may introduce inconsistencies in application
behavior, since popping up/down is the usual use case.

https://bugzilla.gnome.org/show_bug.cgi?id=773885
2016-11-03 15:46:04 +02:00
Matthias Clasen
5c18bf79a1 Add a testcase for stacked headerbars
This currently has some theming issues.
This example is for Lapo to work those out.
2016-11-03 08:32:31 -04:00
Chun-wei Fan
e982f31800 configure.ac: Remove gdk/win32/rc/gdk.rc
This needs to be removed, which was forgotten.  Sorry.
2016-11-03 18:07:43 +08:00
Chun-wei Fan
53077f15d8 autotools: Update MSVC gir build script generation
Now that GTK+ is built as a single DLL, and the .lib that is built is
gtk-4.lib, we need to update the autotools sections in generating the
NMake Makefile snippets so that we can have the correct commands and flags
for building the .gir files, which will all now link to gtk-4-vsXX.dll (or
so).
2016-11-03 18:00:03 +08:00
Chun-wei Fan
e4c5ce4cc3 Visual Studio builds: Use gtk-4.lib for the .lib file
As with the autotools builds, use gtk-4 as the name of the .lib file that
is produced from the build.

Actually this is already done with GTK-3.x with the autotools builds,
but this update is not done there as gtk-3.0.lib/gdk-3.0.lib/gailutil-3.0.lib
was used for such a long time that changing it there might have caused
trouble for people there.
2016-11-03 17:46:32 +08:00
Chun-wei Fan
493ad0cad4 Visual Studio builds: Build GTK+ as a monolithic DLL
Update the project configs to build GDK/GSK as a static lib and include
them into the GTK+ DLL as a monolithic DLL, which is in line with what is
done in the autotools builds, since the code changes needed for Windows
builds for a monolithic build are now in place.
2016-11-03 17:37:49 +08:00
Chun-wei Fan
abef8d4860 Windows: Update code for monolithic GTK DLL
Now that the autotools build folded the GDK/GSK bits into the main GTK+
DLL, there are some updates that need to be done for this.  We need to:

-Fold the DllMain() of GDK-Win32 into the main GTK+ DllMain(), as we need
 the HINSTANCE to register the window.  We can't have two DllMain()'s in a
 single DLL.
-Remove the GDK rc(.in) files, as that is not used anymore.  Make the GTK+
 .rc(.in) file load the gtk.ico GTK+ logo file instead so that we still
 get the GTK+ logo for the application icon by default.  Update the
 autotools build files as well.
-Revert commit b9f9980 as LRN pointed out in comment 25 in bug 773299, as
 GTK+ is now a monolithic DLL, and we ought not to export this private
 function.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-03 16:55:35 +08:00
Olivier Fourdan
2324b96a32 wayland: check valid pending cairo surface
gdk_wayland_window_attach_image() is normally called from
gdk_window_end_paint() to notify the compositor of newly staged drawing.

If any of the drawing code inadvertently dispatches the wayland event
loop (for instance with a gdk_flush() call), then it's possible that by
the time gdk_window_end_paint() is called, the staged drawing is already
destroyed.

This commit bypasses the attach_image call in scenarios where the staged
drawing is prematurely dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=773274
2016-11-03 08:50:34 +01:00
Benjamin Otte
c9a313a125 revealer: Port to no-window widget 2016-11-03 03:00:15 +01:00
Benjamin Otte
acd801000c textview: Convert to no-window widget 2016-11-03 03:00:15 +01:00
Benjamin Otte
6c3d1fba78 iconview: Turn into no-window widget 2016-11-03 03:00:15 +01:00
Benjamin Otte
7e9796568d colorplane: Port to be a no-window widget 2016-11-03 03:00:15 +01:00
Benjamin Otte
0508526658 colorswatch: Readd accidentally removed call 2016-11-03 01:15:08 +01:00
Benjamin Otte
d818f3fcd4 viewport: Turn into no-window widget
While doing so, get rid of the GdkWindow instead of keeping it.
2016-11-02 22:00:29 +01:00
Benjamin Otte
bb8b24da47 menu: Don't set widget->window
Instead, create an input window for the menubar and omit the window for
the menu itself.
2016-11-02 22:00:29 +01:00
Timm Bäder
633a93f418 widget: Remove outdated comment
gtk_widget_override_color is no more.
2016-11-02 18:40:00 +01:00
Timm Bäder
a7efe10ef8 widget: Remove unused visibility-notify-event 2016-11-02 18:40:00 +01:00
Timm Bäder
773c16076b widget: Remove state-flags leftovers 2016-11-02 18:40:00 +01:00
Benjamin Otte
6dddf0447e css: Fix radial-gradient() color stop computation
The copy/paste from the linear gradient code had an error.
2016-11-02 15:19:49 +01:00
Chun-wei Fan
2d7df8e66a gdk/win32: Complete gdk_screen_is_composited() removal
Commit d249e77 (API: screen: Remove gdk_screen_is_composited()) attempted
to update the GDK-Win32 for the removal of the API, but some parts were
missed.  This updates the code so that things continue to build and run.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-02 15:37:10 +08:00
Chun-wei Fan
b9f9980bb4 gsk: Export gsk_render_node_get_bounds()
gtk/inspector/rendernodeview.c calls this private function from GSK, so we
need to ensure that this function is exported so that GTK+ can link
properly on compilers that do not support automatic exporting.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-11-02 15:26:02 +08:00
Benjamin Otte
32a5729d18 gtk: Chain up in realize()
... instead of copy/paste from gtk_widget_real_realize.
2016-11-02 07:16:08 +01:00
Benjamin Otte
b0a5e8764c widget: Insist on widgets calling gtk_widget_set_has_window()
This way, we can grep the code for the bad widgets that set this to
TRUE and fix them.
2016-11-02 06:54:57 +01:00
Benjamin Otte
5e07a31d2b gtk: Call gtk_widget_set_has_window() on every widget
Even if we just set it to the value it already had.
2016-11-02 06:54:57 +01:00
Benjamin Otte
8ea1157d38 treeview: Don't use gtk_widget_get_allocaton()
Use gtk_widget_get_allocated_width()/height() instead.
2016-11-02 06:54:57 +01:00
Chun-wei Fan
21b061b0dd demos/application: Call the right program
We need to update the call to gtk4-application-demo, plus include the
correct icon file for this.
2016-11-02 12:23:41 +08:00
Matthias Clasen
2d14217cd7 inspector: Cosmetic improvements to the recorder 2016-11-01 22:06:25 -04:00
Juan Pablo Ugarte
c607d51890 Use GLSL version 110 for OpenGL 2 shaders.
According to docs and Intel legacy drivers,
GLSL version 130 is for GL 3.0 not GL 2.0/2.1

Validated files with reference compiler from
https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
2016-11-01 15:42:46 -03:00
Matthias Clasen
793f843b08 check button: Update for new box gadget functionality
The box gadget now does the render node conversion for
all its children, so we have less work to do.
2016-11-01 14:29:25 -04:00
Matthias Clasen
18f321df94 expander: Update for new box gadget functionality
The box gadget now does the render node conversion for
all its children, so we have less work to do.
2016-11-01 14:29:25 -04:00
Matthias Clasen
953c7ba6be box gadget: Implement get_render_node vfunc
This implements get_render_node in the obvious way.
2016-11-01 14:29:25 -04:00
Matthias Clasen
68cc1412e5 container: Add a private api for render node propagation
Add a function that propagates a render node for a single
child. This will be used in the box gadget to handle widgets.
2016-11-01 14:29:25 -04:00
Matthias Clasen
30a56acc7d gadget: Add a get_render_node vfunc
This will let us do box gadgets like we do containers.
2016-11-01 14:29:25 -04:00
Matthias Clasen
3656c9f94c Convert GtkEntry to indirect rendering
Warning! This unveils some positioning issue with the secondary icon.
2016-11-01 14:29:25 -04:00
Matthias Clasen
6ed58cfd50 Fix the build
testgtk.c had some dead code referring to GdkColor. Drop it.
2016-11-01 14:11:25 -04:00
Matthias Clasen
7a2537866b Drop GdkColor
It is deprecated and no longer used.
2016-11-01 13:58:11 -04:00
Matthias Clasen
35209f098b Stop supporting GdkColor in text buffer serialization
GdkColor is going away soon.
2016-11-01 13:58:10 -04:00
Matthias Clasen
17a061b8da Drop the settings color parser
We have no color-valued settings anymore.
2016-11-01 13:58:10 -04:00
Matthias Clasen
6e178aede2 Use GdkRGBA for text attributes
Now that GtkTextAttributes is private, we can clean this struct
up a bit. The first step is to switch from GdkColor to GdkRGBA,
and adapt all users.
2016-11-01 13:58:10 -04:00
Matthias Clasen
e6d5a3dce2 Drop GtkTextAttributes from the docs 2016-11-01 13:58:10 -04:00
Matthias Clasen
745c348ff8 Make GtkTextAttributes private
This is a problematic struct, and giving direct access to it
has kept us from making improvements to GtkTextView. Drop it
from the public API, together with the auxiliary APIs. If
it turns out that this functionality is needed, we should add
individual getters.
2016-11-01 13:58:10 -04:00
Benjamin Otte
72a9c53262 inspector: Add a button to clear all recordings
Clears the recordings list, and even better: Frees all your memory.
2016-11-01 18:34:40 +01:00
Benjamin Otte
e02ff7c064 inspector: Collect statistics for unclassable types
I want to know how many GskRenderNodes I have!
2016-11-01 18:34:40 +01:00
Benjamin Otte
3741e6906e inspector: Require toggling on/off of recording
This way, we don't eat up all your memory every time you start the
inspector.
2016-11-01 18:34:40 +01:00
Benjamin Otte
4673318028 inspector: Add list of render nodes to recorder
And make it possible to view the actually selected node in the view.
2016-11-01 18:34:40 +01:00
Benjamin Otte
4265c0e5b0 inspector: Next step in the recorder view
We now record all render operations and display them.

Warning: This is very brute force, you can't clear the recordings or
turn recording off. And this thing easily records 25MB per recorded
frame, so be careful to not run out of memory and get your browser
killed. ;)
2016-11-01 18:34:40 +01:00
Benjamin Otte
e6f711a94a inspector: Add more infrastructure
This one introduces the Recording object which is essentially a single
instance of something that happened.
The RenderRecording is an instance of an actual rendering operation.
2016-11-01 18:34:40 +01:00
Benjamin Otte
98a500a434 inspector: Add outline for a new "recorder" tab 2016-11-01 18:34:40 +01:00
Sébastien Wilmet
59a9eda5ae docs: fix typos in GtkMenuShell 2016-11-01 18:28:09 +01:00
Benjamin Otte
4129b70b96 rendernode: Remove the renderer from the rendernode 2016-11-01 16:32:26 +01:00
Benjamin Otte
a0e63b8a07 rendernode: Require passing a renderer to get_draw_context()
This is in preparation of making render nodes independent of the
renderer, so that they can be rendered multiple times with different
renderers.
2016-11-01 16:32:26 +01:00
Benjamin Otte
e201c4dc92 gsk: Remove gsk_render_node_get_scale_factor()
Scale factors belong to the renderers, not the nodes. The nodes should
just use whatever scale factor the renderer tells them to when
rendering.
2016-11-01 16:32:26 +01:00
Benjamin Otte
3d8b00600e gdkgl: Change prototype of function
The function does not upload a cairo surface, it uploads pixel data.

So don't take a cairo surface as an argument, take pixel data.
2016-11-01 16:32:26 +01:00
Emmanuele Bassi
02c615cc34 gsk: Use the appropriate GLSL version
The GLSL versions are:

  OpenGL 2.1: #version 110
  OpenGL 3.0: #version 130
  OpenGL 3.2: #version 150

  OpenGLES 2.0: #version 100
  OpenGLES 3.0: #version 300 es

So we need to check the version of the GdkGLContext if we want use the
appropriate version, especially for legacy OpenGL contexts, which can be
both 3.x and 2.x.
2016-11-01 15:00:31 +00:00
Marek Černocký
3c1f72671a Updated Czech translation 2016-11-01 09:48:00 +01:00
Benjamin Otte
e96c485afa widget: Create render node with correct bounds
We want a render node where (0,0) is the top left of the widget.
However, we need to account for the clip origin not matching the
allocation origin.
2016-11-01 03:59:37 +01:00
Benjamin Otte
8854279e2a treeview: Clip before translating
We want to clip invalidations to the bin window, not the treeview
itself.
2016-11-01 03:51:48 +01:00
Benjamin Otte
b40aeb7ab4 treeview: Clip to bin window size when drawing bin window
This ensures that the drawing does not extend the actually drawn area.

It also ensures that our math is sane, because the math assumes the clip
area cannot extend the window. After all, before GTK4 it always was like
that.

Fixes a bunch of drawing bugs when the clip area does indeed extend too
far.
2016-11-01 03:51:48 +01:00
Benjamin Otte
b3e5c31b08 rendernode: Transform cairo_t to correct coordinates
We want to have the coordinate system of the created cairo surface to be
identical to the coordinate system of the node's bounds. For that, we
need to translate the cairo surface by the bounds' origin.
2016-11-01 03:42:35 +01:00
Benjamin Otte
f4c4ab6ab1 rendernode: Use ceilf() on the size of the cairo surface
Bounds sizes are floats, so round up to the next integer so we end up
with enough space to draw.
2016-11-01 03:40:01 +01:00
Timm Bäder
ee4ba18d5e stack: Don't underallocate child in interpolate-size case
In that case, we can't just rely on the stack allocation being big
enough. Especially, the child can actually be bigger than the current
stack allocation, so take that into account when positioning it.
2016-10-31 19:29:36 +01:00
Timm Bäder
8dce94c47a stack: Redraw last_visible_surface if child allocation changes
So the widget is properly aligned.
2016-10-31 19:29:36 +01:00
Timm Bäder
212f8a6c7b builderparser: Order string comparisons after frequency
The typical UI file has a lot more <property> tags than it has
<requested> or <interface> tags, etc. so order the string comparisons
according to this expected case.
2016-10-31 19:29:36 +01:00
Timm Bäder
938598032c builderparser: Save tag type instead of tag name
So we can save a few string comparisons
2016-10-31 19:29:36 +01:00
Timm Bäder
e3a3a66370 builderparser: Don't needlessly copy requested object names 2016-10-31 19:29:36 +01:00
Timm Bäder
f415a8bc84 builderparser: stack-allocate ParserData
No reason for it to be heap-allocated, it won't survive this function
call anyway.
2016-10-31 19:29:36 +01:00
Timm Bäder
ba9193fc81 paned: Convert to indirect rendering 2016-10-31 19:29:35 +01:00
Timm Bäder
679b515170 popover: convert to indirect rendering 2016-10-31 19:29:35 +01:00
Timm Bäder
2f2ff773ae separator: Convert to indirect rendering 2016-10-31 19:28:28 +01:00
Timm Bäder
c261d890ad widget: Remove damage-event 2016-10-31 19:28:28 +01:00
Timm Bäder
c25a5606d1 widget: remove show-help 2016-10-31 19:28:28 +01:00
Timm Bäder
5071206d60 widget: Remove app-paintable 2016-10-31 19:28:28 +01:00
Emmanuele Bassi
567f6373c8 build: Clean the uninstalled introspection GIR files
We need to remove them from the build when cleaning them.

Additionally, this automatically adds them to the Git ignore file.
2016-10-31 16:30:10 +00:00
Emmanuele Bassi
a203b8cc28 gsk: Use GskRenderer.create_cairo_surface()
GskRenderNode should ask the renderer for a Cairo surface when creating
a drawing context.
2016-10-31 16:28:09 +00:00
Emmanuele Bassi
50a5deb8e3 gsk: Add internal Renderer.create_cairo_surface()
We need an overridable entry point for GskRenderer to create Cairo
surfaces.

Implementations of GskRenderer can override create_cairo_surface() to
create efficient surfaces, possibly with zero copies involved, depending
on the GDK backend.
2016-10-31 16:26:50 +00:00
Juan Pablo Ugarte
50056d804b gdk/Makefile.am: fixed glsl resources extra dist files.
Use the same wildcard partern used to generate gdk.gresource.xml to include files in EXTRA_DIST var.
2016-10-31 10:15:05 -03:00
Timm Bäder
d7df491656 button: show() the image in gtk_button_new_from_icon_name 2016-10-31 12:23:27 +01:00
Timm Bäder
3ae14630a3 tests: Don't add wigets to a GtkInvisible
It's not a GtkContainer.
2016-10-31 12:20:41 +01:00
Timm Bäder
6488dde4fd box: Use measure() to measure child sizes 2016-10-31 12:20:41 +01:00
Timm Bäder
76ff53193a box: Mark out params of _query_packing as (optional) 2016-10-31 12:20:41 +01:00
Timm Bäder
a829929a41 sidebarrow: Use GtkButton:icon-name 2016-10-31 12:20:41 +01:00
Timm Bäder
3154d3f258 box: Remove unused private API 2016-10-31 12:20:41 +01:00
Timm Bäder
86e94d0e0f dialog: Let GtkButton manage its style classes
A button created using gtk_button_new_with_label will already have the
text-button style class applied.
2016-10-31 12:20:41 +01:00
Timm Bäder
01723fa02f filechooser: Use GtkButton's icon-name property 2016-10-31 12:20:41 +01:00
Rico Tzschichholz
5147ea96e0 gsk: Fix return annotation for gsk_render_node_get_name() 2016-10-30 07:58:05 +01:00
Piotr Drąg
e455843bbb Update POTFILES.in 2016-10-29 21:32:56 +02:00
Benjamin Otte
def62a9dda API: rendernode: Add gsk_render_node_get_name()
Make the debug string available to public API.
2016-10-29 18:10:26 +02:00
Benjamin Otte
d028667fc6 display: Actually initialize variables
Forgot to add this in d249e77bcb.
2016-10-29 18:10:26 +02:00
Lapo Calamandrei
5bb5213486 Adwaita: add more padding to popover menus...
...since Timm removed that from the actual code.
2016-10-29 17:34:49 +02:00
Lapo Calamandrei
91723bfcfc Revert "Adwaita: add more padding to popovers"
Padding should be added back to menu popover only...
This reverts commit 670948586a.
2016-10-29 17:33:26 +02:00
Lapo Calamandrei
da1348edb4 Adwaita: no rounded corners for solid-csd. 2016-10-29 17:18:58 +02:00
Lapo Calamandrei
670948586a Adwaita: add more padding to popovers
...since Timm stole some.
2016-10-29 17:14:07 +02:00
Benjamin Otte
73cd739e19 API: widget: Remove gtk_widget_is_composited()
We don't need to clutter our API with functions that are easily
available elsewhere and effectively unused.
2016-10-29 04:49:47 +02:00
Benjamin Otte
d249e77bcb API: screen: Remove gdk_screen_is_composited()
Switch code to use gdk_display_is_composited() instead.

The new code also doesn't use a vfunc to query the property but rather
requires the backend to call set_composited()/set_rgba() to change the
value.
2016-10-29 04:49:47 +02:00
Benjamin Otte
a334316d5e API: widget: Remove GtkWidget::composited-changed signal
Nobody uses it.

If you need the functionality, listen to display changes on
your widget and then connect to the display's notify::composited.
2016-10-29 04:49:47 +02:00
Benjamin Otte
b69328eb74 inspector: Use the new APIs when displaying information 2016-10-29 04:49:47 +02:00
Benjamin Otte
42d8142cc7 API: gdk: Add gdk_display_is_rgba() and gdk_display_is_composited()
Also add properties for those two properties.

The first property is equivalent to checking if an RGBA visual exists,
the 2nd is equivalent to gdk_screen_is_composited().
2016-10-29 04:49:47 +02:00
Timm Bäder
b2a0105234 frame: Get the render node from the gadget
So we get a proper css background etc. applied.
2016-10-28 19:33:47 +02:00
Timm Bäder
5c99f7a670 Fix clip of more windowed widgets 2016-10-28 19:33:47 +02:00
Timm Bäder
acbdd5c8f2 Fix clip position of windowed widgets 2016-10-28 17:56:51 +02:00
755 changed files with 45051 additions and 41417 deletions

206
NEWS
View File

@@ -1,3 +1,209 @@
Overview of Changes in GTK+ 3.89.2
==================================
* gtk4-icon-browser works again
* gtk-encode symbolic works for icons with names containing dots
* GtkFlowBox and GtkListBox have been changed to no longer emit
the ::selected-children-changed signal during destruction
* gtk-demo has gained an example for using PangoTabArray with GtkTextView
* We now support CSS border-spacing in GtkGrid, GtkBox and in gadgets
* The rendering in GDK and GSK has been further refactored. We now
only draw toplevel windows, and we always redraw the whole window.
* A Vulkan implementation has been added in parallel to the GL one
* Dropped APIs:
gdk_window_process_updates
gdk_window_process_all_updates
gdk_window_reparent
support for native and foreign subwindows
gsk_render_node_{append/prepend/insert} variations
gsk_render_node_make_immutable
gtk_cairo_should_draw_window
gtk_snapshot_append
GtkJunctionSides
* New APIs:
gdk_rgba_is_clear
gdk_rgba_is_opaque
GdkDrawContext: A base class for vulkan and gl contexts
Render node subclasses
GskRoundedRect
gtk_container_snapshot_child
* The GSK_USE_SOFTWARE environment variable has been generalized as GSK_RENDERER.
Use GSK_RENDERER=help to learn about possible values. Other environment variables
that have gained new possible values in clude GSK_DEBUG=vulkan and GTK_DEBUG=snapshot.
* Bugs fixed
749012 GtkStack: Don't emit notify::visible-child during destruction
771242 opening menu for certain types of GtkComboBox causes Gdk-CRITICAL assertion...
772371 Take advantage of Unicode
773299 Ensure GTK+-4.x builds and works on Windows (MSVC in particular)
774265 No tilt for wintab devices
774534 input shape and opaque region not applied without begin_paint()/end_paint()
774686 GtkMenu does not unref all GtkCheckMenuItem it creates
774695 GtkProgressbar needs full and empty classes
774743 GtkNotebook does not unref all GtkBuiltinIcon it creates
774760 inspector: ensure controller is a GtkGesture
774784 Failed to get desktop session proxy is not an error!
774790 GtkTextHandle does not unref all GtkAdjustment it references
774893 Application font sizes scaling gets clamped to 1.00 when starting GtkInspector
774915 Destroying the parent of a subsurface causes _gdk_window_destroy_hierarchy: ...
774917 child subsurfaces need to be placed relative to their parent
774939 GtkLabelAccessible: Initialize link before setting parent
775038 Build: Add wayland to GSKs dependencies
775212 GtkScaleButton does not unref all GtkAdjustment it references
775316 gtk_drag_source_set_icon_pixbuf references the pixbuf received once too much
775319 gdk_window_get_toplevel() fails to return the toplevel of a child subsurface
775410 gsk/Makefile.am runs g-ir-scanner before libgsk-4.la is linked
775525 gtk_flow_box_get_child_at_index shouldn't crash with an invalid index
775651 GdkX11-4.0.gir, GdkWin32-4.0.gir, and Gsk-4.0.gir are generated before Gdk-4...
776132 Mention the difference between gdk_window_create_similar_image_surface and c...
776187 flowbox: Add gtk_flow_box_get_child_at_pos to gtk3
776306 flowbox: Sometimes emits child-activated during rubberband selection
* Translation updates
Czech
German
Hungarian
Italian
Kazakh
Russian
Spanish
Overview of Changes in GTK+ 3.89.1
==================================
This release marks the first snapshot of development leading to GTK+ 4,
it is unstable and expected to change drastically.
Do not use it in production.
GTK+ 3.89 is parallel-installable with the stable GTK+ 3.22.x releases.
The API documentation contains an initial migration guide for porting
from GTK+ 3 to GTK+ 4.
Detailed changes:
* GSK has been integrated. Widgets are now rendered into
GskRenderNodes, which then get drawn using GL
* GTK+ now installs a single shared library, libgtk.so, which includes
GDK and GSK as well
* All installed binaries now use a consistent gtk4- prefix to avoid conflicts
* Dropped APIs:
- all APIs that have been deprecated in GTK+ 3
- (almost) all widget style properties
- offscreen windows
- -gtk-gradient in CSS
- gdk_pixbuf_get_from_window and gdk_cairo_set_source_window
* Changed APIs:
- GtkCssProvider load functions lost their GError argument
* New APIs:
- GMenu items can now have a text-direction attribute
- GtkShortcutsShortcut supports single-finger swipe gestures
- gdk_display_is_rgba and gdk_display_is_composited
- New GtkButton API to construct image buttons:
gtk_button_new_from_icon_name
gtk_button_set_icon_name
- New GdkWindow constructors replacing gdk_window_new:
gdk_window_new_toplevel
gdk_window_new_popup
gdk_window_new_temp
gdk_window_new_child
gdk_window_new_input
gdk_wayland_window_new_subsurface
- gtk_widget_measure replaces gtk_widget_get_preferred_...
- gtk_widget_snapshot replaces gtk_widget_render
- gtk_drawing_area_set_draw_func replaces the ::draw signal
* New examples in gtk4-demo:
- Gestures
- Fishbowl
* GtkInspector now has a frame recorder which shows detailed information
about the widget to render node conversion
* Hi-DPI is now supported with the Windows backend
* gtk-builder-tool can now replace the input file
* Bugs fixed:
756570 gtkplacesview no longer provides guidance on address formats
767713 Fullscreen in wayland is buggy
768531 wayland: Startup notification doesn't work on some apps (eg. gnome-terminal)...
771205 Buttons with circular style class have a suddenly clipped shadow at the bottom
771320 [Wayland] Maps widget is displayed at wrong position inside gnome-contacts
771694 GtkSourceView completion popup window not shown, no grabbed seat found
772075 GTK+ uses a lot more CPU under Wayland than under X11
772345 placesviewrow: busy_spinner when visible offsets the rest of the widgets on the row
772348 placesviewrow: busy_spinner when visible offsets the rest of the widgets on the row
772683 Usage of FALSE instead of gint in glarea demo
772695 Show the keyboard shortcuts from left to right even in RTL
772770 [GtkShortcutsWindow] Support for single-finger swipe gestures
772859 Fix memory leaks in implementations of common widgets
772922 GtkMenu: Try using gdk_window_move_to_rect() more often
772926 shortcutswindow: working version of set_section_name()
773007 GtkFilechooser gives completion for non-matching extensions
773082 overlay: Document availability of properties
773113 tests: fix clipboard test by loading correct icon
773180 Don't second-guess whether our GDK GL context is GLES
773246 Typo in css color definitions documentation
773299 Ensure GTK+-4.x builds and works on Windows (MSVC in particular)
773474 Color chooser dialog opened with show-editor=TRUE has black header bar
773587 recent-manager: Add a limit to the list's size
773799 GtkLevelBar doesn't update blocks on discrete mode
773857 gdkwindow-x11: Add support for gdk_window_fullscreen_on_monitor
773885 pop down GtkPopover on pressing escape
773903 Gtk+4: gtk.h and gtktextiter.h include private gtktextattributes.h
773916 GtkComposeTable caches broken: using a same ~/.XCompose does not work twice in a row
773954 gtkstylecontext: Clarify memory allocation behaviour of getters
773979 GdkGLContext does not chain finalize handler
774046 GtkSpinButton does not always unref priv->{up,down}_button
774066 GtkHeaderBar does not unref all GtkBox and GtkSeparator it creates
774097 GtkPrintOperation should not truncate job names
774114 Window shadows are repainted even if only the contents of the window change
774185 GtkPlacesSidebar does not unref itsel as many times as it references
774347 Fails to build: unknown type name GdkColor
774352 GtkAppChooserWidget does not unref all GAppInfo it references
774475 wayland: gtk+ prevents using subsurfaces if the parent is not root
774476 surfaces with no outputs get scale factor reset
774490 Deprecated example for modify color or font
774609 small fix to foreign drawing spinbutton demo
774614 Wrong #include in Print docs
774634 GtkPlacesView does not unref all GDaemonFileEnumerator it references
774695 GtkProgressbar needs full and empty classes
774699 wintab: list iteration regression causes odd-indexed devices to be ignored during...
* Translation updates
Brazilian Portuguese
Catalan
Czech
Danish
French
German
Greek
Hungarian
Kazakh
Lithuanian
Polish
=======================================================================
Overview of Changes in GTK+ 3.22.1
==================================

View File

@@ -128,6 +128,8 @@ $(top_builddir)/build/win32/vs12/$(1).vcxproj: Makefile
$(CPP) -P - <$(top_srcdir)/build/win32/vs12/$(1).vcxprojin >$(top_builddir)/build/win32/vs12/$(1).vcxproj
$(CPP) -P - <$(top_srcdir)/build/win32/vs12/$(1).vcxproj.filtersin >$(top_builddir)/build/win32/vs12/$(1).vcxproj.filters
$(RM) $(1).vs12.sourcefiles
$(RM) $(1).vs12.sourcefiles.filters
$(top_builddir)/build/win32/vs12/$(1).vs12.headers: Makefile
-$(RM) $(top_builddir)/build/win32/vs12/$(1).vs12.headers

View File

@@ -28,10 +28,10 @@ def main(argv):
base_pc.setup(argv, gdk_parser)
atk_min_ver = '2.15.1'
cairo_min_ver = '1.14.0'
cairo_min_ver = '1.15.2'
gdk_pixbuf_min_ver = '2.30.0'
gdk_win32_sys_libs = '-lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi'
glib_min_ver = '2.45.8'
glib_min_ver = '2.49.4'
epoxy_min_ver = '1.0'
graphene_min_ver = '1.2'
@@ -54,46 +54,29 @@ def main(argv):
'cairo >= ' + cairo_min_ver + ' ' + \
'cairo-gobject >= ' + cairo_min_ver
gdk_pc_replace_items = {'@GDK_PACKAGES@': gio_package + ' ' + \
'pangowin32 pangocairo' + ' ' + \
pkg_required_packages,
'@GDK_PRIVATE_PACKAGES@': gio_package + ' ' + cairo_backends,
'@GDK_EXTRA_LIBS@': gdk_win32_sys_libs + broadway_extra_libs,
'@GDK_EXTRA_CFLAGS@': '',
'gdk-4': 'gdk-4.0'}
gsk_pc_replace_items = {'@GSK_PACKAGES@': pkg_required_packages, + ' ' + \
'graphene-1.0 >= ' + graphene_min_ver
'@GSK_PRIVATE_PACKAGES@': 'epoxy >= ' + epoxy_min_ver,
'@GSK_EXTRA_LIBS@': '',
'@GSK_EXTRA_CFLAGS@': '',
'gsk-4': 'gsk-4.0'}
gtk_pc_replace_items = {'@host@': gdk_args.host,
'@GTK_BINARY_VERSION@': '4.0.0',
'@GDK_PACKAGES@': gio_package + ' ' + \
'pangowin32 pangocairo' + ' ' + \
pkg_required_packages,
'@GSK_PACKAGES@': pkg_required_packages + ' ' + \
'graphene-1.0 >= ' + graphene_min_ver,
'@GTK_PACKAGES@': 'atk >= ' + atk_min_ver + ' ' + \
pkg_required_packages + ' ' + \
gio_package,
'@GDK_PRIVATE_PACKAGES@': gio_package + ' ' + cairo_backends,
'@GSK_PRIVATE_PACKAGES@': 'epoxy >= ' + epoxy_min_ver,
'@GTK_PRIVATE_PACKAGES@': 'atk',
'@GDK_EXTRA_CFLAGS@': '',
'@GSK_EXTRA_CFLAGS@': '',
'@GTK_EXTRA_CFLAGS@': '',
'@GTK_EXTRA_LIBS@': '',
'@GTK_EXTRA_CFLAGS@': '',
'gtk-4': 'gtk-4.0'}
'@GDK_EXTRA_LIBS@': gdk_win32_sys_libs + broadway_extra_libs,
'@GSK_EXTRA_LIBS@': '',
'@GTK_EXTRA_LIBS@': ''}
pkg_replace_items.update(base_pc.base_replace_items)
gdk_pc_replace_items.update(pkg_replace_items)
gtk_pc_replace_items.update(pkg_replace_items)
# Generate gdk-4.0.pc
replace_multi(base_pc.top_srcdir + '/gdk-4.0.pc.in',
base_pc.srcdir + '/gdk-4.0.pc',
gdk_pc_replace_items)
# Generate gsk-4.0.pc
replace_multi(base_pc.top_srcdir + '/gsk-4.0.pc.in',
base_pc.srcdir + '/gsk-4.0.pc',
gsk_pc_replace_items)
# Generate gtk+-4.0.pc
replace_multi(base_pc.top_srcdir + '/gtk+-4.0.pc.in',
base_pc.srcdir + '/gtk+-4.0.pc',

View File

@@ -5,14 +5,14 @@ GENERATED_ITEMS = \
gdk4-win32.vcxproj.filters \
gdk4-broadway.vcxproj \
gdk4-broadway.vcxproj.filters \
broadwayd.vcxproj \
broadwayd.vcxproj.filters \
gdk-4.vcxproj \
gdk-4.vcxproj.filters \
gsk-4.vcxproj \
gsk-4.vcxproj.filters \
gtk-4.vcxproj \
gtk-4.vcxproj.filters \
gtk4-broadwayd.vcxproj \
gtk4-broadwayd.vcxproj.filters \
gtk4-demo.vcxproj \
gtk4-demo.vcxproj.filters \
gtk4-demo-application.vcxproj \
@@ -38,14 +38,14 @@ EXTRA_DIST += \
gdk4-win32.vcxproj.filtersin \
gdk4-broadway.vcxprojin \
gdk4-broadway.vcxproj.filtersin \
broadwayd.vcxprojin \
broadwayd.vcxproj.filtersin \
gdk-4.vcxprojin \
gdk-4.vcxproj.filtersin \
gsk-4.vcxprojin \
gsk-4.vcxproj.filtersin \
gtk-4.vcxprojin \
gtk-4.vcxproj.filtersin \
gtk4-broadwayd.vcxprojin \
gtk4-broadwayd.vcxproj.filtersin \
gtk4-builder-tool.vcxproj \
gtk4-builder-tool.vcxproj.filters \
gtk4-encode-symbolic-svg.vcxproj \
@@ -63,7 +63,7 @@ EXTRA_DIST += \
gtk4-install.vcxproj \
gtk4-install.vcxproj.filters \
gtk4-build-defines.props \
gtk4-copy-gdk-broadway.props \
gtk4-copy-gtk-broadway.props \
gtk4-gen-srcs.props \
gtk4-ignore-broadway.props \
gtk4-install.propsin \

View File

@@ -14,9 +14,6 @@
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\gdk\win32\rc\gdk.rc"><Filter>Resource Files</Filter></ResourceCompile>
</ItemGroup>
<ItemGroup>
#include "gdk-4.vs12.sourcefiles.filters"
<ClCompile Include="..\..\..\gdk\gdkkeynames.c"><Filter>Source Files</Filter></ClCompile>

View File

@@ -41,46 +41,46 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
@@ -89,35 +89,35 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gdk-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gdk-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gdk-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gdk-broadway.props" />
<Import Project="gtk4-build-defines.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
@@ -143,15 +143,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">
<ClCompile>
@@ -166,15 +157,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);$(GdkBroadwayAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -186,17 +168,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">
<ClCompile>
@@ -208,17 +179,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);$(GdkBroadwayAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -233,15 +193,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">
<ClCompile>
@@ -256,15 +207,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);$(GdkBroadwayAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -276,17 +218,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">
<ClCompile>
@@ -298,35 +229,11 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GdkAdditionalLibs);$(GdkBroadwayAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\gdk\win32\rc\gdk.rc" />
</ItemGroup>
<ItemGroup>
#include "gdk-4.vs12.sourcefiles"
<ClCompile Include="..\..\..\gdk\gdkkeynames.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk4-broadway.vcxproj">
<Project>{1df4c475-4472-4ee4-ac2b-3ab5a4c1a453}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gdk4-win32.vcxproj">
<Project>{aba7685a-7cbb-4626-b5e5-6eeea5b489ef}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -25,24 +25,24 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
@@ -85,15 +85,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -105,17 +96,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -130,15 +110,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -150,17 +121,6 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="..\..\..\gsk\gskenumtypes.c.template">
@@ -195,12 +155,6 @@
<ItemGroup>
#include "gsk-4.vs12.sourcefiles"
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -6,7 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk4-win32", "gdk4-win32.vc
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk4-broadway", "gdk4-broadway.vcxproj", "{1DF4C475-4472-4EE4-AC2B-3AB5A4C1A453}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "broadwayd", "broadwayd.vcxproj", "{E9687D21-E214-4A0C-9EB4-8B38EBB783E5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk4-broadwayd", "gtk4-broadwayd.vcxproj", "{E9687D21-E214-4A0C-9EB4-8B38EBB783E5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk-4", "gdk-4.vcxproj", "{5AE8F5CE-9103-4951-AEDE-EA2F3B573BE8}"
EndProject
@@ -138,14 +138,14 @@ Global
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release|Win32.Build.0 = Release|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release|x64.ActiveCfg = Release|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release|x64.Build.0 = Release|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|Win32.ActiveCfg = Debug|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|Win32.Build.0 = Debug|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|x64.ActiveCfg = Debug|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|x64.Build.0 = Debug|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|Win32.ActiveCfg = Release|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|Win32.Build.0 = Release|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|x64.ActiveCfg = Release|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|x64.Build.0 = Release|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|Win32.ActiveCfg = Debug_Broadway|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|Win32.Build.0 = Debug_Broadway|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|x64.ActiveCfg = Debug_Broadway|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Debug_Broadway|x64.Build.0 = Debug_Broadway|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|Win32.ActiveCfg = Release_Broadway|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
{BDAE6DE2-6BCC-4107-94F0-DA12214A02DE}.Debug|Win32.ActiveCfg = Debug|Win32
{BDAE6DE2-6BCC-4107-94F0-DA12214A02DE}.Debug|Win32.Build.0 = Debug|Win32
{BDAE6DE2-6BCC-4107-94F0-DA12214A02DE}.Debug|x64.ActiveCfg = Debug|x64

View File

@@ -5,20 +5,36 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_Broadway|Win32">
<Configuration>Debug_Broadway</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_Broadway|x64">
<Configuration>Debug_Broadway</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_Broadway|Win32">
<Configuration>Release_Broadway</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_Broadway|x64">
<Configuration>Release_Broadway</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{95A4B53D-2773-4406-A2C1-8FD2840BBAD8}</ProjectGuid>
@@ -26,17 +42,12 @@
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
@@ -46,31 +57,78 @@
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-gen-srcs.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-gen-srcs.props" />
<Import Project="gtk4-ignore-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-gen-srcs.props" />
<Import Project="gtk4-copy-gtk-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-gen-srcs.props" />
<Import Project="gtk4-ignore-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gtk-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gtk-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-ignore-broadway.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="gtk4-copy-gtk-broadway.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -88,7 +146,30 @@
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
@@ -108,7 +189,29 @@
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
@@ -133,7 +236,30 @@
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
@@ -153,7 +279,29 @@
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).0.lib</ImportLibrary>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>$(GtkAdditionalLibs);%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
@@ -176,6 +324,18 @@
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating GTK+ DBus Sources...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkDbusBuiltSourcesX64)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Generating GTK+ DBus Sources...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GenerateGtkDbusBuiltSources)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Generating GTK+ DBus Sources...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GenerateGtkDbusBuiltSourcesX64)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Generating GTK+ DBus Sources...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GenerateGtkDbusBuiltSources)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Generating GTK+ DBus Sources...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GenerateGtkDbusBuiltSourcesX64)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\gtk\gtk-win32.rc.body">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copying GTK+ Win32 Version Resource...</Message>
@@ -190,6 +350,18 @@
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Copying GTK+ Win32 Version Resource...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(CopyGtkWin32RC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Copying GTK+ Win32 Version Resource...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(CopyGtkWin32RC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Copying GTK+ Win32 Version Resource...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(CopyGtkWin32RC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Copying GTK+ Win32 Version Resource...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(CopyGtkWin32RC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Copying GTK+ Win32 Version Resource...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(CopyGtkWin32RC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\gtk\libgtk4.manifest.in">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating GTK+ Win32 Manifest...</Message>
@@ -204,10 +376,24 @@
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating GTK+ Win32 Manifest...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkWin32Manifest)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\libgtk4.manifest;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Generating GTK+ Win32 Manifest...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GenerateGtkWin32Manifest)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">..\..\..\gtk\libgtk4.manifest;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Generating GTK+ Win32 Manifest...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GenerateGtkWin32Manifest)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">..\..\..\gtk\libgtk4.manifest;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Generating GTK+ Win32 Manifest...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GenerateGtkWin32Manifest)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">..\..\..\gtk\libgtk4.manifest;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Generating GTK+ Win32 Manifest...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GenerateGtkWin32Manifest)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">..\..\..\gtk\libgtk4.manifest;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\gtk\gtk-win32.rc" />
<ResourceCompile Include="..\..\..\gtk\gtk-win32.rc">
<AdditionalIncludeDirectories>..\..\..\gdk\win32\rc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
#include "gtk-4.vs12.sourcefiles"
@@ -231,6 +417,14 @@
<Manifest Include="..\..\..\gtk\libgtk4.manifest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk4-broadway.vcxproj">
<Project>{1df4c475-4472-4ee4-ac2b-3ab5a4c1a453}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gdk4-win32.vcxproj">
<Project>{aba7685a-7cbb-4626-b5e5-6eeea5b489ef}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -15,6 +15,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
#include "broadwayd.vs12.sourcefiles.filters"
#include "gtk4-broadwayd.vs12.sourcefiles.filters"
</ItemGroup>
</Project>

View File

@@ -163,7 +163,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
#include "broadwayd.vs12.sourcefiles"
#include "gtk4-broadwayd.vs12.sourcefiles"
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gtk4-prebuild.vcxproj">

View File

@@ -14,7 +14,7 @@
<GtkGdkCommonLibs>imm32.lib</GtkGdkCommonLibs>
<GdkAdditionalLibs>winmm.lib;dwmapi.lib;setupapi.lib;$(GtkGdkCommonLibs)</GdkAdditionalLibs>
<GdkBroadwayAdditionalLibs>ws2_32.lib</GdkBroadwayAdditionalLibs>
<GtkAdditionalLibs>atk-1.0.lib;pangowin32-1.0.lib;winspool.lib;comctl32.lib;$(GtkGdkCommonLibs)</GtkAdditionalLibs>
<GtkAdditionalLibs>atk-1.0.lib;pangowin32-1.0.lib;winspool.lib;comctl32.lib;$(GdkAdditionalLibs)</GtkAdditionalLibs>
</PropertyGroup>
<PropertyGroup>
<_PropertySheetDisplayName>gtk4builddefinesprops</_PropertySheetDisplayName>

View File

@@ -166,10 +166,6 @@
<ClCompile Include="..\..\..\gtk\gtk-builder-tool.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="gtk4-build-defines.props" />
<Import Project="gtk4-gen-srcs.props" />
</ImportGroup>
<PropertyGroup>
<_PropertySheetDisplayName>gtk4copygdkbroadwayprops</_PropertySheetDisplayName>
@@ -13,36 +13,22 @@
<PostBuildEvent>
<Command>
if "$(Configuration)" == "Release" goto END
if "$(Configuration)" == "Debug" goto END
if "$(Configuration)" == "Release_Broadway" goto DoRelease
if "$(Configuration)" == "Debug_Broadway" goto DoDebug
:DoRelease
mkdir .\Release\$(Platform)\bin
copy /b $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll .\Release\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\gdk-$(ApiVersion).lib .\Release\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll .\Release\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\gtk-$(ApiVersion).lib .\Release\$(Platform)\bin\
goto END
:DoDebug
mkdir .\Debug\$(Platform)\bin
copy /b $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll .\Debug\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\gdk-$(ApiVersion).lib .\Debug\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll .\Debug\$(Platform)\bin\
copy /b $(Configuration)\$(Platform)\bin\gtk-$(ApiVersion).lib .\Debug\$(Platform)\bin\
goto END
:END
</Command>
</PostBuildEvent>

View File

@@ -158,10 +158,6 @@
#include "gtk4-demo-application.vs12.sourcefiles"
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -172,10 +172,6 @@
#include "gtk4-demo.vs12.sourcefiles"
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -166,8 +166,8 @@
<ClCompile Include="..\..\..\gtk\encodesymbolic.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

View File

@@ -162,10 +162,6 @@
#include "gtk4-icon-browser.vs12.sourcefiles"
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="gtk4-build-defines.props" />
<Import Project="gtk4-gen-srcs.props" />
</ImportGroup>
<PropertyGroup>
<_PropertySheetDisplayName>gtk4ignorebroadwayprops</_PropertySheetDisplayName>
@@ -11,7 +11,7 @@
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Link>
<AdditionalDependencies>$(OutDir)\gdk4-win32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(OutDir)\gsk-4.lib;$(OutDir)\gdk-4.lib;$(OutDir)\gdk4-win32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/EXPORT:gdk_win32_display_manager_get_type</AdditionalOptions>
</Link>
</ItemDefinitionGroup>

View File

@@ -9,18 +9,11 @@
mkdir $(CopyDir)\bin
mkdir $(CopyDir)\lib\pkgconfig
copy "$(BinDir)\$(GtkDllPrefix)gdk-4$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gdk-4$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
copy "$(BinDir)\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gsk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\gtk-$(ApiVersionShort).lib" $(CopyDir)\lib
copy "$(BinDir)\gtk4-demo.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk4-demo.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk4-demo-application.exe" $(CopyDir)\bin
@@ -44,12 +37,9 @@ copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
:DO_BROADWAY_RELEASE
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gsk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gtk-$(ApiVersionShort).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gtk4-demo.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk4-demo.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk4-demo-application.exe $(CopyDir)\bin
@@ -68,12 +58,9 @@ copy .\Release\$(Platform)\bin\gtk4-builder-tool.pdb $(CopyDir)\bin
goto DONE_BIN
:DO_BROADWAY_DEBUG
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gsk-4$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gsk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk-4$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersionShort).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gtk4-demo.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk4-demo.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk4-demo-application.exe $(CopyDir)\bin
@@ -91,9 +78,8 @@ copy .\Debug\$(Platform)\bin\gtk4-builder-tool.pdb $(CopyDir)\bin
:DONE_BIN
copy ..\gdk-4.0.pc $(CopyDir)\lib\pkgconfig
copy ..\gsk-4.0.pc $(CopyDir)\lib\pkgconfig
copy "..\gtk+-4.0.pc" $(CopyDir)\lib\pkgconfig
copy "..\gtk+-4.0.pc" "$(CopyDir)\lib\pkgconfig\gtk+-win32-4.0.pc"
</GtkDoInstallBin>
<GtkDoInstall>
echo off
@@ -131,7 +117,7 @@ $(CopyDir)\bin\gtk4-update-icon-cache.exe --ignore-theme-index --force "$(CopyDi
</GtkPostInstall>
<GenerateGtkPC>$(PythonPath)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=i686-pc-vs$(VSVer)</GenerateGtkPC>
<GenerateGtkPCX64>$(PythonPathX64)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=x86_64-pc-vs$(VSVer)</GenerateGtkPCX64>
<GtkPCFiles>..\gdk-4.0.pc;..\gsk-4.0.pc;..\gtk+-4.0.pc</GtkPCFiles>
<GtkPCFiles>..\gtk+-4.0.pc</GtkPCFiles>
</PropertyGroup>
<PropertyGroup>
<_PropertySheetDisplayName>gtk4installsprops</_PropertySheetDisplayName>

View File

@@ -217,14 +217,6 @@
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gsk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-eb2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk4-demo.vcxproj">
<Project>{bdae6de2-6bcc-4107-94f0-da12214a02de}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
@@ -233,6 +225,10 @@
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk4-broadwayd.vcxproj">
<Project>{e9687d21-e214-4a0c-9eb4-8b38ebb783e5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk4-demo-application.vcxproj">
<Project>{be6b4973-c6ff-4c8f-8e97-a47793c50f44}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
@@ -241,10 +237,6 @@
<Project>{343333c4-d46c-4c97-a986-959cca6f1de0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="broadwayd.vcxproj">
<Project>{e9687d21-e214-4a0c-9eb4-8b38ebb783e5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk4-encode-symbolic-svg.vcxproj">
<Project>{f280bf1a-777a-4fb5-8005-dfbe04621edb}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -166,10 +166,6 @@
<ClCompile Include="..\..\..\gtk\gtk-query-settings.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gdk-4.vcxproj">
<Project>{5ae8f5ce-9103-4951-aede-ea2f3b573be8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-4.vcxproj">
<Project>{95a4b53d-2773-4406-a2c1-8fd2840bbad8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

View File

@@ -4,7 +4,8 @@
<VSVer>12</VSVer>
<GlibEtcInstallRoot>$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
<CopyDir>..\..\..\..\vs$(VSVer)\$(Platform)</CopyDir>
<ApiVersion>4.0</ApiVersion>
<ApiVersionShort>4</ApiVersionShort>
<ApiVersion>$(ApiVersionShort).0</ApiVersion>
<GtkVersion>@GTK_VERSION@</GtkVersion>
<GtkLibtoolCompatibleDllPrefix>lib</GtkLibtoolCompatibleDllPrefix>
<GtkLibtoolCompatibleDllSuffix>.0-0</GtkLibtoolCompatibleDllSuffix>
@@ -28,6 +29,9 @@
<BuildMacro Include="CopyDir">
<Value>$(CopyDir)</Value>
</BuildMacro>
<BuildMacro Include="ApiVersionShort">
<Value>$(ApiVersionShort)</Value>
</BuildMacro>
<BuildMacro Include="ApiVersion">
<Value>$(ApiVersion)</Value>
</BuildMacro>

View File

@@ -29,12 +29,12 @@ EXTRA_DIST += \
gtk4-icon-browser.vcxproj.filters \
gtk4-install.vcxproj \
gtk4-install.vcxproj.filters \
broadwayd.vcxproj \
broadwayd.vcxproj.filters \
gtk4-broadwayd.vcxproj \
gtk4-broadwayd.vcxproj.filters \
gdk4-broadway.vcxproj \
gdk4-broadway.vcxproj.filters \
gtk4-build-defines.props \
gtk4-copy-gdk-broadway.props \
gtk4-copy-gtk-broadway.props \
gtk4-gen-srcs.props \
gtk4-ignore-broadway.props \
gtk4-install.props \

View File

@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [89])
m4_define([gtk_micro_version], [0])
m4_define([gtk_micro_version], [2])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -64,7 +64,7 @@ m4_define([wayland_protocols_required_version], [1.7])
m4_define([mirclient_required_version], [0.22.0])
m4_define([mircookie_required_version], [0.17.0])
m4_define([epoxy_required_version], [1.0])
m4_define([graphene_required_version], [1.2])
m4_define([graphene_required_version], [1.5.1])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
ATK_REQUIRED_VERSION=atk_required_version
@@ -297,6 +297,11 @@ AC_ARG_ENABLE(installed_tests,
[enable_installed_tests=no])
AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes)
AC_ARG_ENABLE(vulkan,
[AS_HELP_STRING([--enable-vulkan],
[support Vulkan graphics API [default=maybe]])],,
[enable_vulkan="maybe"])
AC_ARG_ENABLE(xkb,
[AS_HELP_STRING([--enable-xkb],
[support XKB extension [default=maybe]])],,
@@ -404,7 +409,7 @@ if test "x$enable_quartz_backend" = xyes; then
backend_immodules="$backend_immodules,quartz"
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_QUARTZ"
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa -framework Carbon"
DISABLE_ON_QUARTZ='%'
AM_CONDITIONAL(USE_QUARTZ, true)
if test "x$quartz_relocation" = xyes; then
@@ -1314,6 +1319,33 @@ else
GDK_GIO_PACKAGE="gio-2.0 >= glib_required_version"
fi
# Check for Vulkan support.
if test "x$enable_vulkan" != "xno"; then
vulkan_error=""
AC_CHECK_HEADER([vulkan/vulkan.h],
[AC_CHECK_LIB([vulkan], [vkCreateInstance], [], [vulkan_error="Vulkan library not found"])],
[vulkan_error="Vulkan header not found"])
if test "x$vulkan_error" != "x"; then
if "x$enable_vulkan" = "xyes"; then
AC_MSG_ERROR($vulkan_error)
else
AC_MSG_WARN($vulkan_error)
fi
vulkan_result="no ($vulkan_error)"
else
GDK_EXTRA_LIBS="-lvulkan"
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_RENDERING_VULKAN"
AC_PATH_PROG([GLSLC], [glslc])
vulkan_result="yes"
fi
else
AC_MSG_WARN(Vulkan support explicitly disabled)
vulkan_result="no (Vulkan support explicitly disabled)"
fi
AM_CONDITIONAL(HAVE_VULKAN, test "$vulkan_result" = "yes")
# Check for Pango flags
AC_MSG_CHECKING(Pango flags)
@@ -1374,7 +1406,7 @@ GSK_EXTRA_LIBS=
GSK_EXTRA_CFLAGS=
GSK_PACKAGES="gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version graphene-1.0 >= graphene_required_version"
GSK_PRIVATE_PACKAGES="epoxy >= epoxy_required_version"
GSK_PRIVATE_PACKAGES="epoxy >= epoxy_required_version $WAYLAND_PACKAGES"
PKG_CHECK_MODULES(GSK_DEP, $PANGO_PACKAGES $GSK_PACKAGES $GSK_PRIVATE_PACKAGES)
GSK_DEP_LIBS="$GSK_EXTRA_LIBS $GSK_DEP_LIBS $MATH_LIB"
@@ -1999,7 +2031,6 @@ gdk/broadway/Makefile
gdk/x11/Makefile
gdk/win32/Makefile
gdk/win32/rc/Makefile
gdk/win32/rc/gdk.rc
gdk/quartz/Makefile
gdk/wayland/Makefile
gdk/mir/Makefile
@@ -2035,6 +2066,7 @@ echo " GDK backends: $GDK_BACKENDS"
if test "$enable_x11_backend" = "yes"; then
echo " X11 extensions: $X_EXTENSIONS"
fi
echo " Vulkan support: $vulkan_result"
echo " Print backends: $PRINT_BACKENDS"
echo " Dynamic modules: $build_dynamic_modules"
echo " Included immodules: $included_immodules"

View File

@@ -27,6 +27,7 @@ demos_base = \
event_axes.c \
expander.c \
filtermodel.c \
fishbowl.c \
foreigndrawing.c \
gestures.c \
glarea.c \
@@ -61,6 +62,7 @@ demos_base = \
spinbutton.c \
spinner.c \
stack.c \
tabs.c \
textmask.c \
textview.c \
textscroll.c \

View File

@@ -212,7 +212,7 @@ activate_about (GSimpleAction *action,
"comments", "Program to demonstrate GTK+ functions.",
"authors", authors,
"documenters", documentors,
"logo-icon-name", "gtk3-demo",
"logo-icon-name", "gtk4-demo",
"title", "About GTK+ Code Demos",
NULL);
}

View File

@@ -63,10 +63,10 @@ do_application_demo (GtkWidget *toplevel)
const gchar *command;
GError *error = NULL;
if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk3-demo-application" APP_EXTENSION;
if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk4-demo-application" APP_EXTENSION;
else
command = "gtk3-demo-application";
command = "gtk4-demo-application";
if (!g_spawn_command_line_async (command, &error))
{

View File

@@ -15,15 +15,15 @@ static GtkWidget *frame;
/* draw callback for the drawing area
*/
static gboolean
draw_callback (GtkWidget *widget,
cairo_t *cr,
gpointer data)
static void
draw_function (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
return TRUE;
}
static void
@@ -87,11 +87,9 @@ do_colorsel (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
g_signal_connect (da, "draw", G_CALLBACK (draw_callback), NULL);
/* set a minimum size */
gtk_widget_set_size_request (da, 200, 200);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 200);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 200);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_function, NULL, NULL);
gtk_container_add (GTK_CONTAINER (frame), da);

View File

@@ -51,22 +51,17 @@ css_text_changed (GtkTextBuffer *buffer,
gtk_style_context_reset_widgets (gdk_screen_get_default ());
}
static gboolean
drawing_area_draw (GtkWidget *widget,
cairo_t *cr)
static void
drawing_area_draw (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (da));
gtk_render_background (context, cr,
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
gtk_render_frame (context, cr,
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
return FALSE;
gtk_render_background (context, cr, 0, 0, width, height);
gtk_render_frame (context, cr, 0, 0, width, height);
}
static void
@@ -105,8 +100,9 @@ do_css_multiplebgs (GtkWidget *do_widget)
child = gtk_drawing_area_new ();
gtk_widget_set_name (child, "canvas");
g_signal_connect (child, "draw",
G_CALLBACK (drawing_area_draw), NULL);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (child),
drawing_area_draw,
NULL, NULL);
gtk_container_add (GTK_CONTAINER (container), child);
child = gtk_button_new ();

View File

@@ -94,6 +94,9 @@
<file>zoom_in_cursor.png</file>
<file>zoom_out_cursor.png</file>
</gresource>
<gresource prefix="/fishbowl">
<file>fishbowl.ui</file>
</gresource>
<gresource prefix="/iconview">
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
<file preprocess="to-pixdata">gnome-fs-regular.png</file>
@@ -150,6 +153,7 @@
<file>event_axes.c</file>
<file>expander.c</file>
<file>filtermodel.c</file>
<file>fishbowl.c</file>
<file>flowbox.c</file>
<file>foreigndrawing.c</file>
<file>font_features.c</file>
@@ -186,6 +190,7 @@
<file>stack.c</file>
<file>spinbutton.c</file>
<file>spinner.c</file>
<file>tabs.c</file>
<file>textview.c</file>
<file>textscroll.c</file>
<file>theming_style_classes.c</file>

View File

@@ -50,15 +50,15 @@ scribble_configure_event (GtkWidget *widget,
}
/* Redraw the screen from the surface */
static gboolean
scribble_draw (GtkWidget *widget,
cairo_t *cr,
gpointer data)
static void
scribble_draw (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
return FALSE;
}
/* Draw a rectangle on the screen */
@@ -136,12 +136,14 @@ scribble_motion_notify_event (GtkWidget *widget,
}
static gboolean
checkerboard_draw (GtkWidget *da,
cairo_t *cr,
gpointer data)
static void
checkerboard_draw (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
gint i, j, xcount, ycount, width, height;
gint i, j, xcount, ycount;
#define CHECK_SIZE 10
#define SPACING 2
@@ -154,8 +156,6 @@ checkerboard_draw (GtkWidget *da,
*/
xcount = 0;
width = gtk_widget_get_allocated_width (da);
height = gtk_widget_get_allocated_height (da);
i = SPACING;
while (i < width)
{
@@ -180,11 +180,6 @@ checkerboard_draw (GtkWidget *da,
i += CHECK_SIZE + SPACING;
++xcount;
}
/* return TRUE because we've handled this event, so no
* further processing is required.
*/
return TRUE;
}
static void
@@ -233,14 +228,11 @@ do_drawingarea (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), checkerboard_draw, NULL, NULL);
gtk_container_add (GTK_CONTAINER (frame), da);
g_signal_connect (da, "draw",
G_CALLBACK (checkerboard_draw), NULL);
/*
* Create the scribble area
*/
@@ -255,15 +247,13 @@ do_drawingarea (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 100);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), scribble_draw, NULL, NULL);
gtk_container_add (GTK_CONTAINER (frame), da);
/* Signals used to handle backing surface */
g_signal_connect (da, "draw",
G_CALLBACK (scribble_draw), NULL);
g_signal_connect (da,"configure-event",
G_CALLBACK (scribble_configure_event), NULL);

341
demos/gtk-demo/fishbowl.c Normal file
View File

@@ -0,0 +1,341 @@
/* Benchmark/Fishbowl
*
* This demo models the fishbowl demos seen on the web in a GTK way.
* It's also a neat little tool to see how fast your computer (or
* your GTK version) is.
*/
#include <gtk/gtk.h>
char **icon_names = NULL;
gsize n_icon_names = 0;
GtkWidget *allow_changes;
static void
init_icon_names (GtkIconTheme *theme)
{
GPtrArray *icons;
GList *l, *icon_list;
if (icon_names)
return;
icon_list = gtk_icon_theme_list_icons (theme, NULL);
icons = g_ptr_array_new ();
for (l = icon_list; l; l = l->next)
{
if (g_str_has_suffix (l->data, "symbolic"))
continue;
g_ptr_array_add (icons, g_strdup (l->data));
}
n_icon_names = icons->len;
g_ptr_array_add (icons, NULL); /* NULL-terminate the array */
icon_names = (char **) g_ptr_array_free (icons, FALSE);
/* don't free strings, we assigned them to the array */
g_list_free_full (icon_list, g_free);
}
static const char *
get_random_icon_name (GtkIconTheme *theme)
{
init_icon_names (theme);
return icon_names[g_random_int_range(0, n_icon_names)];
}
#define N_STATS 5
#define STATS_UPDATE_TIME G_USEC_PER_SEC
typedef struct _Stats Stats;
struct _Stats {
gint64 last_stats;
gint64 last_frame;
gint last_suggestion;
guint frame_counter_max;
guint stats_index;
guint frame_counter[N_STATS];
guint item_counter[N_STATS];
};
static Stats *
get_stats (GtkWidget *widget)
{
static GQuark stats_quark = 0;
Stats *stats;
if (G_UNLIKELY (stats_quark == 0))
stats_quark = g_quark_from_static_string ("stats");
stats = g_object_get_qdata (G_OBJECT (widget), stats_quark);
if (stats == NULL)
{
stats = g_new0 (Stats, 1);
g_object_set_qdata_full (G_OBJECT (widget), stats_quark, stats, g_free);
stats->last_frame = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (widget));
stats->last_stats = stats->last_frame;
}
return stats;
}
static gint64
do_stats (GtkWidget *widget,
GtkWidget *info_label,
gint *suggested_change)
{
Stats *stats;
gint64 frame_time, elapsed;
stats = get_stats (widget);
frame_time = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (widget));
elapsed = frame_time - stats->last_frame;
if (stats->last_stats + STATS_UPDATE_TIME < frame_time)
{
char *new_label;
guint i, n_frames;
n_frames = 0;
for (i = 0; i < N_STATS; i++)
{
n_frames += stats->frame_counter[i];
}
new_label = g_strdup_printf ("%u icons - %.1f fps",
stats->item_counter[stats->stats_index],
(double) G_USEC_PER_SEC * n_frames
/ (N_STATS * STATS_UPDATE_TIME));
gtk_label_set_label (GTK_LABEL (info_label), new_label);
g_free (new_label);
if (stats->frame_counter[stats->stats_index] >= 19 * stats->frame_counter_max / 20)
{
if (stats->last_suggestion > 0)
stats->last_suggestion *= 2;
else
stats->last_suggestion = 1;
}
else
{
if (stats->last_suggestion < 0)
stats->last_suggestion--;
else
stats->last_suggestion = -1;
stats->last_suggestion = MAX (stats->last_suggestion, 1 - (int) stats->item_counter[stats->stats_index]);
}
stats->stats_index = (stats->stats_index + 1) % N_STATS;
stats->frame_counter[stats->stats_index] = 0;
stats->item_counter[stats->stats_index] = stats->item_counter[(stats->stats_index + N_STATS - 1) % N_STATS];
stats->last_stats = frame_time;
if (suggested_change)
*suggested_change = stats->last_suggestion;
else
stats->last_suggestion = 0;
}
else
{
if (suggested_change)
*suggested_change = 0;
}
stats->last_frame = frame_time;
stats->frame_counter[stats->stats_index]++;
stats->frame_counter_max = MAX (stats->frame_counter_max, stats->frame_counter[stats->stats_index]);
return elapsed;
}
static void
stats_update (GtkWidget *widget,
gint n_items)
{
Stats *stats;
stats = get_stats (widget);
g_assert ((gint) stats->item_counter[stats->stats_index] + n_items > 0);
stats->item_counter[stats->stats_index] += n_items;
}
typedef struct _FishData FishData;
struct _FishData {
double x;
double y;
double x_speed;
double y_speed;
};
static FishData *
get_fish_data (GtkWidget *fish)
{
static GQuark fish_quark = 0;
FishData *data;
if (G_UNLIKELY (fish_quark == 0))
fish_quark = g_quark_from_static_string ("fish");
data = g_object_get_qdata (G_OBJECT (fish), fish_quark);
if (data == NULL)
{
data = g_new0 (FishData, 1);
g_object_set_qdata_full (G_OBJECT (fish), fish_quark, data, g_free);
data->x = 10;
data->y = 10;
data->x_speed = g_random_double_range (1, 200);
data->y_speed = g_random_double_range (1, 200);
}
return data;
}
static void
add_fish (GtkWidget *bowl,
guint n_fish)
{
GtkWidget *new_fish;
guint i;
for (i = 0; i < n_fish; i++)
{
new_fish = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()),
GTK_ICON_SIZE_DIALOG);
gtk_widget_show (new_fish);
gtk_fixed_put (GTK_FIXED (bowl),
new_fish,
10, 10);
}
stats_update (bowl, n_fish);
}
static void
remove_fish (GtkWidget *bowl,
guint n_fish)
{
GList *list, *children;
guint i;
children = gtk_container_get_children (GTK_CONTAINER (bowl));
g_assert (n_fish < g_list_length (children));
list = children;
for (i = 0; i < n_fish; i++)
{
gtk_container_remove (GTK_CONTAINER (bowl), list->data);
list = list->next;
}
g_list_free (children);
stats_update (bowl, - (gint) n_fish);
{
Stats *stats = get_stats (bowl);
children = gtk_container_get_children (GTK_CONTAINER (bowl));
g_assert (stats->item_counter[stats->stats_index] == g_list_length (children));
g_list_free (children);
}
}
static void
move_one_fish (GtkWidget *fish,
gpointer elapsedp)
{
GtkWidget *fixed = gtk_widget_get_parent (fish);
FishData *data = get_fish_data (fish);
gint64 elapsed = *(gint64 *) elapsedp;
data->x += data->x_speed * ((double) elapsed / G_USEC_PER_SEC);
data->y += data->y_speed * ((double) elapsed / G_USEC_PER_SEC);
if (data->x <= 0)
{
data->x = 0;
data->x_speed = - g_random_double_range (1, 200) * (data->x_speed > 0 ? 1 : -1);
}
else if (data->x > gtk_widget_get_allocated_width (fixed) - gtk_widget_get_allocated_width (fish))
{
data->x = gtk_widget_get_allocated_width (fixed) - gtk_widget_get_allocated_width (fish);
data->x_speed = - g_random_double_range (1, 200) * (data->x_speed > 0 ? 1 : -1);
}
if (data->y <= 0)
{
data->y = 0;
data->y_speed = - g_random_double_range (1, 200) * (data->y_speed > 0 ? 1 : -1);
}
else if (data->y > gtk_widget_get_allocated_height (fixed) - gtk_widget_get_allocated_height (fish))
{
data->y = gtk_widget_get_allocated_height (fixed) - gtk_widget_get_allocated_height (fish);
data->y_speed = - g_random_double_range (1, 200) * (data->y_speed > 0 ? 1 : -1);
}
gtk_fixed_move (GTK_FIXED (fixed), fish, data->x, data->y);
}
static gboolean
move_fish (GtkWidget *bowl,
GdkFrameClock *frame_clock,
gpointer info_label)
{
gint64 elapsed;
gint suggested_change = 0;
elapsed = do_stats (bowl,
info_label,
!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (allow_changes)) ? &suggested_change : NULL);
gtk_container_foreach (GTK_CONTAINER (bowl), move_one_fish, &elapsed);
if (suggested_change > 0)
add_fish (bowl, suggested_change);
else if (suggested_change < 0)
remove_fish (bowl, - suggested_change);
return G_SOURCE_CONTINUE;
}
GtkWidget *
do_fishbowl (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkBuilder *builder;
GtkWidget *bowl, *info_label;
builder = gtk_builder_new_from_resource ("/fishbowl/fishbowl.ui");
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
bowl = GTK_WIDGET (gtk_builder_get_object (builder, "bowl"));
info_label = GTK_WIDGET (gtk_builder_get_object (builder, "info_label"));
allow_changes = GTK_WIDGET (gtk_builder_get_object (builder, "changes_allow"));
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_widget_realize (window);
gtk_widget_add_tick_callback (bowl, move_fish, info_label, NULL);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkWindow" id="window">
<property name="title" translatable="yes">Fishbowl</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="">
<property name="visible">True</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkLabel" id="info_label">
<property name="visible">True</property>
<property name="label">0 icons - 0 fps</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="changes_allow">
<property name="active">False</property>
<property name="visible" bind-source="changes_allow" bind-property="active" bind-flags="invert-boolean">True</property>
<property name="icon-name">changes-allow</property>
<property name="relief">none</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="changes_prevent">
<property name="active" bind-source="changes_allow" bind-property="active" bind-flags="bidirectional|invert-boolean">True</property>
<property name="visible" bind-source="changes_prevent" bind-property="active" bind-flags="invert-boolean">False</property>
<property name="icon-name">changes-prevent</property>
<property name="relief">none</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkFixed" id="bowl">
<property name="visible">True</property>
</object>
</child>
</object>
</interface>

View File

@@ -10,11 +10,14 @@
#include <stdlib.h>
#include <string.h>
static gboolean
draw_color (GtkWidget *drawingarea,
cairo_t *cr,
const char *color_name)
static void
draw_color (GtkDrawingArea *drawingarea,
cairo_t *cr,
int width,
int height,
gpointer data)
{
const char *color_name = data;
GdkRGBA rgba;
if (gdk_rgba_parse (&rgba, color_name))
@@ -22,8 +25,6 @@ draw_color (GtkWidget *drawingarea,
gdk_cairo_set_source_rgba (cr, &rgba);
cairo_paint (cr);
}
return FALSE;
}
static GtkWidget *
@@ -33,8 +34,9 @@ color_swatch_new (const gchar *color)
button = gtk_button_new ();
area = gtk_drawing_area_new ();
g_signal_connect (area, "draw", G_CALLBACK (draw_color), (gpointer) color);
gtk_widget_set_size_request (area, 24, 24);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 24);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 24);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (area), draw_color, (gpointer) color, NULL);
gtk_container_add (GTK_CONTAINER (button), area);
gtk_widget_show_all (button);

View File

@@ -836,7 +836,7 @@ draw_spinbutton (GtkWidget *widget,
/* This information is taken from the GtkSpinButton docs, see "CSS nodes" */
spin_context = get_style (NULL, "spinbutton.horizontal:focus");
entry_context = get_style (NULL, "entry:focus");
entry_context = get_style (spin_context, "entry:focus");
up_context = get_style (spin_context, "button.up:focus:active");
down_context = get_style (spin_context, "button.down:focus");
@@ -881,16 +881,18 @@ draw_spinbutton (GtkWidget *widget,
g_object_unref (spin_context);
}
static gboolean
draw_cb (GtkWidget *widget,
cairo_t *cr)
static void
draw_func (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
gint panewidth, width, height;
GtkWidget *widget = GTK_WIDGET (da);
gint panewidth;
gint x, y;
width = gtk_widget_get_allocated_width (widget);
panewidth = width / 2;
height = gtk_widget_get_allocated_height (widget);
cairo_rectangle (cr, 0, 0, width, height);
cairo_set_source_rgb (cr, 0.9, 0.9, 0.9);
@@ -944,8 +946,6 @@ draw_cb (GtkWidget *widget,
y += height + 10;
draw_combobox (widget, cr, 10 + panewidth, y, panewidth - 20, TRUE, &height);
return FALSE;
}
GtkWidget *
@@ -968,13 +968,12 @@ do_foreigndrawing (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (window), box);
da = gtk_drawing_area_new ();
gtk_widget_set_size_request (da, 400, 400);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 400);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 400);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_func, NULL, NULL);
gtk_widget_set_hexpand (da, TRUE);
gtk_widget_set_vexpand (da, TRUE);
gtk_widget_set_app_paintable (da, TRUE);
gtk_container_add (GTK_CONTAINER (box), da);
g_signal_connect (da, "draw", G_CALLBACK (draw_cb), NULL);
}
if (!gtk_widget_get_visible (window))

View File

@@ -60,20 +60,18 @@ zoom_scale_changed (GtkGestureZoom *gesture,
gtk_widget_queue_draw (widget);
}
static gboolean
drawing_area_draw (GtkWidget *widget,
cairo_t *cr)
static void
drawing_area_draw (GtkDrawingArea *area,
cairo_t *cr,
int width,
int height,
gpointer data)
{
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
if (swipe_x != 0 || swipe_y != 0)
{
cairo_save (cr);
cairo_set_line_width (cr, 6);
cairo_move_to (cr, allocation.width / 2,
allocation.height / 2);
cairo_move_to (cr, width / 2, height / 2);
cairo_rel_line_to (cr, swipe_x, swipe_y);
cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
cairo_stroke (cr);
@@ -87,9 +85,7 @@ drawing_area_draw (GtkWidget *widget,
gdouble angle, scale;
cairo_get_matrix (cr, &matrix);
cairo_matrix_translate (&matrix,
allocation.width / 2,
allocation.height / 2);
cairo_matrix_translate (&matrix, width / 2, height / 2);
cairo_save (cr);
@@ -116,8 +112,8 @@ drawing_area_draw (GtkWidget *widget,
if (long_pressed)
{
cairo_save (cr);
cairo_arc (cr, allocation.width / 2,
allocation.height / 2,
cairo_arc (cr,
width / 2, height / 2,
50, 0, 2 * G_PI);
cairo_set_source_rgba (cr, 0, 1, 0, 0.5);
@@ -125,8 +121,6 @@ drawing_area_draw (GtkWidget *widget,
cairo_restore (cr);
}
return TRUE;
}
GtkWidget *
@@ -150,8 +144,9 @@ do_gestures (GtkWidget *do_widget)
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK);
g_signal_connect (drawing_area, "draw",
G_CALLBACK (drawing_area_draw), NULL);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area),
drawing_area_draw,
NULL, NULL);
/* Swipe */
gesture = gtk_gesture_swipe_new (drawing_area);

View File

@@ -50,6 +50,7 @@ do_pickers (GtkWidget *do_widget)
gtk_widget_set_hexpand (label, TRUE);
picker = gtk_file_chooser_button_new ("Pick a File",
GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (picker), FALSE);
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);

View File

@@ -75,15 +75,15 @@ load_pixbufs (GError **error)
}
/* Expose callback for the drawing area */
static gint
draw_cb (GtkWidget *widget,
cairo_t *cr,
gpointer data)
static void
draw_func (GtkDrawingArea *area,
cairo_t *cr,
int width,
int height,
gpointer data)
{
gdk_cairo_set_source_pixbuf (cr, frame, 0, 0);
cairo_paint (cr);
return TRUE;
}
#define CYCLE_TIME 3000000 /* 3 seconds */
@@ -204,14 +204,13 @@ do_pixbufs (GtkWidget *do_widget)
}
else
{
gtk_widget_set_size_request (window, back_width, back_height);
frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height);
da = gtk_drawing_area_new ();
g_signal_connect (da, "draw",
G_CALLBACK (draw_cb), NULL);
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), back_width);
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), back_height);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_func, NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), da);

View File

@@ -88,10 +88,12 @@ create_fancy_attr_list_for_layout (PangoLayout *layout)
return attrs;
}
static gboolean
rotated_text_draw (GtkWidget *widget,
cairo_t *cr,
gpointer data)
static void
rotated_text_draw (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
#define RADIUS 150
#define N_WORDS 5
@@ -106,15 +108,12 @@ rotated_text_draw (GtkWidget *widget,
PangoAttrList *attrs;
double device_radius;
int width, height;
int i;
/* Create a cairo context and set up a transformation matrix so that the user
* space coordinates for the centered square where we draw are [-RADIUS, RADIUS],
* [-RADIUS, RADIUS].
* We first center, then change the scale. */
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
device_radius = MIN (width, height) / 2.;
cairo_translate (cr,
device_radius + (width - 2 * device_radius) / 2,
@@ -128,7 +127,7 @@ rotated_text_draw (GtkWidget *widget,
cairo_set_source (cr, pattern);
/* Create a PangoContext and set up our shape renderer */
context = gtk_widget_create_pango_context (widget);
context = gtk_widget_create_pango_context (GTK_WIDGET (da));
pango_cairo_context_set_shape_renderer (context,
fancy_shape_renderer,
NULL, NULL);
@@ -164,8 +163,6 @@ rotated_text_draw (GtkWidget *widget,
g_object_unref (layout);
g_object_unref (context);
cairo_pattern_destroy (pattern);
return FALSE;
}
GtkWidget *
@@ -199,8 +196,9 @@ do_rotated_text (GtkWidget *do_widget)
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
GTK_STYLE_CLASS_VIEW);
g_signal_connect (drawing_area, "draw",
G_CALLBACK (rotated_text_draw), NULL);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area),
rotated_text_draw,
NULL, NULL);
/* And a label */
label = gtk_label_new (text);

61
demos/gtk-demo/tabs.c Normal file
View File

@@ -0,0 +1,61 @@
/* Text View/Tabs
*
* GtkTextView can position text at fixed positions, using tabs.
*/
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
GtkWidget *
do_tabs (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *view;
GtkWidget *sw;
GtkTextBuffer *buffer;
PangoTabArray *tabs;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Tabs");
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 20);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 20);
tabs = pango_tab_array_new (3, TRUE);
pango_tab_array_set_tab (tabs, 0, PANGO_TAB_LEFT, 0);
pango_tab_array_set_tab (tabs, 1, PANGO_TAB_LEFT, 150);
pango_tab_array_set_tab (tabs, 2, PANGO_TAB_LEFT, 300);
gtk_text_view_set_tabs (GTK_TEXT_VIEW (view), tabs);
pango_tab_array_free (tabs);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_set_text (buffer, "one\ttwo\tthree\nfour\tfive\tsix\nseven\teight\tnine", -1);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_widget_show_all (sw);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

View File

@@ -7,10 +7,12 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
static gboolean
draw_text (GtkWidget *da,
cairo_t *cr,
gpointer data)
static void
draw_text (GtkDrawingArea *da,
cairo_t *cr,
int width,
int height,
gpointer data)
{
cairo_pattern_t *pattern;
PangoLayout *layout;
@@ -18,7 +20,7 @@ draw_text (GtkWidget *da,
cairo_save (cr);
layout = gtk_widget_create_pango_layout (da, "Pango power!\nPango power!\nPango power!");
layout = gtk_widget_create_pango_layout (GTK_WIDGET (da), "Pango power!\nPango power!\nPango power!");
desc = pango_font_description_from_string ("sans bold 34");
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
@@ -27,9 +29,7 @@ draw_text (GtkWidget *da,
pango_cairo_layout_path (cr, layout);
g_object_unref (layout);
pattern = cairo_pattern_create_linear (0.0, 0.0,
gtk_widget_get_allocated_width (da),
gtk_widget_get_allocated_height (da));
pattern = cairo_pattern_create_linear (0.0, 0.0, width, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, 1.0, 0.0, 0.0);
cairo_pattern_add_color_stop_rgb (pattern, 0.2, 1.0, 0.0, 0.0);
cairo_pattern_add_color_stop_rgb (pattern, 0.3, 1.0, 1.0, 0.0);
@@ -49,8 +49,6 @@ draw_text (GtkWidget *da,
cairo_stroke (cr);
cairo_restore (cr);
return TRUE;
}
GtkWidget *
@@ -72,8 +70,7 @@ do_textmask (GtkWidget *do_widget)
da = gtk_drawing_area_new ();
gtk_container_add (GTK_CONTAINER (window), da);
g_signal_connect (da, "draw",
G_CALLBACK (draw_text), NULL);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_text, NULL, NULL);
}
if (!gtk_widget_get_visible (window))

View File

@@ -567,7 +567,6 @@ do_toolpalette (GtkWidget *do_widget)
/* ===== passive DnD dest ===== */
contents = gtk_drawing_area_new ();
gtk_widget_set_app_paintable (contents, TRUE);
g_object_connect (contents,
"signal::draw", canvas_draw, NULL,
@@ -594,7 +593,6 @@ do_toolpalette (GtkWidget *do_widget)
/* ===== interactive DnD dest ===== */
contents = gtk_drawing_area_new ();
gtk_widget_set_app_paintable (contents, TRUE);
g_object_connect (contents,
"signal::draw", canvas_draw, NULL,

View File

@@ -72,8 +72,9 @@
</object>
</child>
<child>
<object class="GtkVSeparator">
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="orientation">vertical</property>
</object>
</child>
<child>
@@ -110,7 +111,6 @@
<property name="xpad">10</property>
<property name="ypad">10</property>
<property name="stock-size">5</property>
<property name="follow-state">True</property>
</object>
</child>
<child>

View File

@@ -1589,6 +1589,16 @@ scale_format_value (GtkScale *scale, gdouble value)
return g_strdup_printf ("%0.*f", 1, value);
}
static void
adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
{
double fraction;
fraction = gtk_adjustment_get_value (adj) / (gtk_adjustment_get_upper (adj) - gtk_adjustment_get_lower (adj));
gtk_progress_bar_set_fraction (pbar, fraction);
}
static void
activate (GApplication *app)
{
@@ -1861,6 +1871,12 @@ activate (GApplication *app)
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "decrease_button");
g_object_set_data (G_OBJECT (widget), "decrease_button", widget2);
adj = (GtkAdjustment *)gtk_builder_get_object (builder, "adjustment3");
widget = (GtkWidget *)gtk_builder_get_object (builder, "progressbar1");
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "progressbar2");
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget);
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget2);
gtk_widget_show_all (GTK_WIDGET (window));
g_object_unref (builder);

View File

@@ -103,8 +103,9 @@
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="lower">0</property>
<property name="upper">4</property>
<property name="value">1</property>
<property name="value">2</property>
<property name="step_increment">1</property>
<property name="page_increment">1</property>
</object>
@@ -412,16 +413,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="visible">1</property>
<property name="valign">center</property>
<property name="menu_model">gear_menu</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage" id="gear_image">
<property name="visible">1</property>
<property name="icon_size">1</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
</child>
<property name="icon-name">open-menu-symbolic</property>
</object>
<packing>
<property name="pack_type">end</property>
@@ -536,13 +528,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkButton" id="button224">
<property name="visible">1</property>
<property name="can_focus">1</property>
<child>
<object class="GtkImage" id="button224img">
<property name="visible">1</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="icon-name">window-close-symbolic</property>
</object>
<packing>
<property name="fill">0</property>
@@ -1802,16 +1788,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="visible">1</property>
<property name="focus-on-click">0</property>
<property name="relief">none</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage" id="page2dismissi">
<property name="visible">1</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
</object>
@@ -1958,15 +1935,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="menu-model">dinner_menu</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">emblem-system-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
<property name="icon-name">emblem-system-symbolic</property>
</object>
<packing>
<property name="pack_type">end</property>
@@ -2165,16 +2134,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="margin-bottom">6</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">appointment-soon-symbolic</property>
</object>
</child>
<property name="icon-name">appointment-soon-symbolic</property>
</object>
</child>
</object>
@@ -3031,16 +2991,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="draw-indicator">0</property>
<property name="active">1</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">view-grid-symbolic</property>
</object>
</child>
<property name="icon-name">view-grid-symbolic</property>
</object>
</child>
<child>
@@ -3049,16 +3000,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="draw-indicator">0</property>
<property name="group">grid_button</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">view-list-symbolic</property>
</object>
</child>
<property name="icon-name">view-list-symbolic</property>
</object>
</child>
</object>
@@ -3066,17 +3008,10 @@ microphone-sensitivity-medium-symbolic</property>
<child>
<object class="GtkButton" id="circular_button">
<property name="visible">1</property>
<property name="icon-name">emblem-system-symbolic</property>
<style>
<class name="image-button"/>
<class name="circular"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">emblem-system-symbolic</property>
</object>
</child>
</object>
</child>
</object>
@@ -3376,48 +3311,21 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkButton" id="cutbutton">
<property name="visible">1</property>
<property name="sensitive">0</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">edit-cut-symbolic</property>
</object>
</child>
<property name="icon-name">edit-cut-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton" id="copybutton">
<property name="visible">1</property>
<property name="sensitive">0</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">edit-copy-symbolic</property>
</object>
</child>
<property name="icon-name">edit-copy-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton" id="pastebutton">
<property name="visible">1</property>
<property name="sensitive">0</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">edit-paste-symbolic</property>
</object>
</child>
<property name="icon-name">edit-paste-symbolic</property>
</object>
</child>
</object>
@@ -3427,16 +3335,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="sensitive">0</property>
<property name="valign">end</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-size">1</property>
<property name="icon-name">edit-delete-symbolic</property>
</object>
</child>
<property name="icon-name">edit-delete-symbolic</property>
</object>
<packing>
<property name="expand">1</property>
@@ -3472,31 +3371,13 @@ microphone-sensitivity-medium-symbolic</property>
<child>
<object class="GtkButton">
<property name="visible">1</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="icon-name">pan-start-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">1</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="icon-name">pan-end-symbolic</property>
</object>
</child>
</object>
@@ -3570,17 +3451,11 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="relief">none</property>
<property name="focus-on-click">0</property>
<property name="icon-name">window-close-symbolic</property>
<signal name="clicked" handler="tab_close_cb" object="closable_page_1"/>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
@@ -3611,17 +3486,11 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="relief">none</property>
<property name="focus-on-click">0</property>
<property name="icon-name">window-close-symbolic</property>
<signal name="clicked" handler="tab_close_cb" object="closable_page_2"/>
<style>
<class name="small-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">window-close-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
@@ -3710,15 +3579,8 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">1</property>
<property name="valign">center</property>
<property name="popover">notebook_info_popover</property>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon-name">emblem-important-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="icon-name">emblem-important-symbolic</property>
<style>
<class name="image-button"/>
<class name="circular"/>
<class name="flat"/>
</style>

View File

@@ -34,13 +34,16 @@ IGNORE_HFILES= \
gdkdisplaymanagerprivate.h \
gdkdisplayprivate.h \
gdkdndprivate.h \
gdkdrawcontextprivate.h \
gdkframeclockprivate.h \
gdkglcontextprivate.h \
gdkkeysprivate.h \
gdkmonitorprivate.h \
gdkscreenprivate.h \
gdkseatdefaultprivate.h \
gdkseatprivate.h \
gdkvisualprivate.h \
gdkvulkancontextprivate.h \
keyname-table.h \
win32 \
x11 \

View File

@@ -36,6 +36,7 @@
<xi:include href="xml/gdkframetimings.xml" />
<xi:include href="xml/gdkdrawingcontext.xml" />
<xi:include href="xml/gdkglcontext.xml" />
<xi:include href="xml/gdkvulkancontext.xml" />
<xi:include href="xml/events.xml" />
<xi:include href="xml/event_structs.xml" />
<xi:include href="xml/keys.xml" />
@@ -53,7 +54,6 @@
<reference>
<title>Deprecated</title>
<xi:include href="xml/colors.xml" />
<xi:include href="xml/gdkdevicemanager.xml" />
</reference>

View File

@@ -114,6 +114,8 @@ gdk_display_put_event
gdk_display_has_pending
gdk_display_set_double_click_time
gdk_display_set_double_click_distance
gdk_display_is_rgba
gdk_display_is_composited
gdk_display_supports_cursor_color
gdk_display_supports_cursor_alpha
gdk_display_get_default_cursor_size
@@ -125,7 +127,6 @@ gdk_display_supports_clipboard_persistence
gdk_display_store_clipboard
gdk_display_supports_shapes
gdk_display_supports_input_shapes
gdk_display_supports_composite
gdk_display_get_app_launch_context
gdk_display_notify_startup_complete
gdk_display_get_default_seat
@@ -176,27 +177,10 @@ gdk_display_manager_get_type
<TITLE>GdkScreen</TITLE>
GdkScreen
gdk_screen_get_default
gdk_screen_get_system_visual
gdk_screen_get_rgba_visual
gdk_screen_is_composited
gdk_screen_get_root_window
gdk_screen_get_display
gdk_screen_get_number
gdk_screen_list_visuals
gdk_screen_get_toplevel_windows
gdk_screen_get_n_monitors
gdk_screen_get_primary_monitor
gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_workarea
gdk_screen_get_monitor_at_point
gdk_screen_get_monitor_at_window
gdk_screen_get_monitor_height_mm
gdk_screen_get_monitor_width_mm
gdk_screen_get_monitor_plug_name
gdk_screen_get_monitor_scale_factor
gdk_screen_get_setting
gdk_screen_get_font_options
gdk_screen_set_font_options
gdk_screen_get_resolution
gdk_screen_set_resolution
@@ -215,34 +199,17 @@ gdk_screen_get_type
<SECTION>
<TITLE>Pixbufs</TITLE>
<FILE>pixbufs</FILE>
gdk_pixbuf_get_from_window
gdk_pixbuf_get_from_surface
</SECTION>
<SECTION>
<TITLE>Colors</TITLE>
<FILE>colors</FILE>
GdkColor
gdk_color_copy
gdk_color_free
gdk_color_parse
gdk_color_equal
gdk_color_hash
gdk_color_to_string
<SUBSECTION Standard>
GDK_TYPE_COLOR
<SUBSECTION Private>
gdk_color_get_type
</SECTION>
<SECTION>
<TITLE>RGBA Colors</TITLE>
<FILE>rgba_colors</FILE>
GdkRGBA
gdk_rgba_copy
gdk_rgba_free
gdk_rgba_is_clear
gdk_rgba_is_opaque
gdk_rgba_parse
gdk_rgba_equal
gdk_rgba_hash
@@ -295,9 +262,9 @@ GdkGravity
GdkAnchorHints
GdkWindowEdge
GdkWindowTypeHint
GdkWindowAttr
GdkWindowAttributesType
gdk_window_new
gdk_window_new_toplevel
gdk_window_new_popup
gdk_window_new_temp
gdk_window_new_child
gdk_window_new_input
gdk_window_destroy
@@ -336,10 +303,7 @@ gdk_window_resize
gdk_window_move_resize
gdk_window_scroll
gdk_window_move_region
gdk_window_flush
gdk_window_has_native
gdk_window_ensure_native
gdk_window_reparent
gdk_window_raise
gdk_window_lower
gdk_window_restack
@@ -355,13 +319,13 @@ gdk_window_beep
gdk_window_get_scale_factor
gdk_window_set_opaque_region
gdk_window_create_gl_context
gdk_window_create_vulkan_context
gdk_window_mark_paint_from_clip
<SUBSECTION>
gdk_window_get_clip_region
gdk_window_begin_draw_frame
gdk_window_end_draw_frame
gdk_window_should_draw
gdk_window_get_visible_region
<SUBSECTION>
@@ -372,13 +336,10 @@ gdk_window_invalidate_maybe_recurse
gdk_window_get_update_area
gdk_window_freeze_updates
gdk_window_thaw_updates
gdk_window_process_all_updates
gdk_window_process_updates
gdk_window_get_frame_clock
<SUBSECTION>
gdk_window_set_user_data
gdk_window_set_override_redirect
gdk_window_set_accept_focus
gdk_window_get_accept_focus
gdk_window_set_focus_on_map
@@ -395,10 +356,6 @@ gdk_window_input_shape_combine_region
gdk_window_set_child_input_shapes
gdk_window_merge_child_input_shapes
gdk_window_set_title
gdk_window_set_background
gdk_window_set_background_rgba
gdk_window_set_background_pattern
gdk_window_get_background_pattern
GDK_PARENT_RELATIVE
gdk_window_set_cursor
gdk_window_get_cursor
@@ -559,12 +516,12 @@ gdk_cairo_get_clip_rectangle
gdk_cairo_get_drawing_context
gdk_cairo_set_source_rgba
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_window
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_region_create_from_surface
gdk_cairo_surface_create_from_pixbuf
gdk_cairo_draw_from_gl
gdk_cairo_surface_upload_to_gl
</SECTION>
<SECTION>
@@ -702,6 +659,7 @@ gdk_device_get_last_event_window
<SUBSECTION>
gdk_device_tool_get_serial
gdk_device_tool_get_tool_type
gdk_device_tool_get_hardware_id
<SUBSECTION Standard>
GDK_TYPE_AXIS_USE
@@ -721,6 +679,8 @@ GDK_TYPE_DEVICE
GdkDeviceClass
gdk_device_get_type
gdk_device_type_get_type
gdk_device_tool_get_type
gdk_device_tool_new
GDK_MAX_TIMECOORD_AXES
</SECTION>
@@ -1194,6 +1154,7 @@ gdk_wayland_device_get_wl_seat
gdk_wayland_display_get_wl_compositor
gdk_wayland_display_get_wl_display
gdk_wayland_display_get_xdg_shell
gdk_wayland_window_new_subsurface
gdk_wayland_window_get_wl_surface
gdk_wayland_window_set_use_custom_surface
GdkWaylandWindowExported
@@ -1299,6 +1260,22 @@ gdk_frame_timings_get_predicted_presentation_time
gdk_frame_get_type
</SECTION>
<SECTION>
<FILE>gdkdrawcontext</FILE>
GdkDrawContext
gdk_draw_context_get_display
gdk_draw_context_get_window
<SUBSECTION Standard>
GDK_DRAW_CONTEXT
GDK_IS_DRAW_CONTEXT
GDK_TYPE_DRAW_CONTEXT
GDK_DRAW_CONTEXT_CLASS
GDK_DRAW_CONTEXT_GET_CLASS
GDK_IS_DRAW_CONTEXT_CLASS
gdk_draw_context_get_type
</SECTION>
<SECTION>
<FILE>gdkglcontext</FILE>
GdkGLContext
@@ -1321,6 +1298,7 @@ gdk_gl_context_is_legacy
<SUBSECTION>
GdkGLError
gdk_gl_context_realize
gdk_gl_context_get_damage
gdk_gl_context_make_current
gdk_gl_context_get_current
gdk_gl_context_clear_current
@@ -1378,3 +1356,23 @@ GDK_TYPE_DRAWING_CONTEXT
GDK_DRAWING_CONTEXT
GDK_IS_DRAWING_CONTEXT
</SECTION>
<SECTION>
<FILE>gdkvulkancontext</FILE>
GdkVulkanContext
gdk_vulkan_context_get_device
gdk_vulkan_context_get_draw_index
gdk_vulkan_context_get_draw_semaphore
gdk_vulkan_context_get_image
gdk_vulkan_context_get_image_format
gdk_vulkan_context_get_instance
gdk_vulkan_context_get_n_images
gdk_vulkan_context_get_physical_device
gdk_vulkan_context_get_queue
gdk_vulkan_context_get_queue_family_index
<SUBSECTION Standard>
gdk_vulkan_context_get_type
gdk_vulkan_error_quark
gdk_vulkan_strerror
</SECTION>

View File

@@ -18,7 +18,6 @@
<title>API Reference</title>
<xi:include href="xml/GskRenderer.xml" />
<xi:include href="xml/GskRenderNode.xml" />
<xi:include href="xml/GskRenderNodeIter.xml" />
</reference>
<index id="api-index-full">

View File

@@ -1,17 +1,18 @@
<SECTION>
<FILE>GskRenderer</FILE>
gsk_renderer_get_for_display
gsk_renderer_new_for_window
gsk_renderer_set_viewport
gsk_renderer_get_viewport
gsk_renderer_set_scale_factor
gsk_renderer_get_scale_factor
gsk_renderer_set_window
gsk_renderer_get_window
gsk_renderer_get_display
gsk_renderer_realize
gsk_renderer_unrealize
gsk_renderer_create_render_node
gsk_renderer_begin_draw_frame
gsk_renderer_end_draw_frame
gsk_renderer_render
gsk_renderer_render_texture
<SUBSECTION Standard>
GSK_IS_RENDERER
GSK_RENDERER
@@ -26,40 +27,43 @@ GSK_TYPE_SCALING_FILTER
<FILE>GskRenderNode</FILE>
gsk_render_node_ref
gsk_render_node_unref
gsk_render_node_get_parent
gsk_render_node_get_first_child
gsk_render_node_get_last_child
gsk_render_node_get_next_sibling
gsk_render_node_get_previous_sibling
gsk_render_node_append_child
gsk_render_node_prepend_child
gsk_render_node_insert_child_at_pos
gsk_render_node_insert_child_before
gsk_render_node_insert_child_after
gsk_render_node_remove_child
gsk_render_node_replace_child
gsk_render_node_remove_all_children
gsk_render_node_get_n_children
gsk_render_node_contains
gsk_render_node_set_bounds
gsk_render_node_set_transform
gsk_render_node_set_anchor_point
gsk_render_node_set_opacity
gsk_render_node_set_hidden
gsk_render_node_is_hidden
gsk_render_node_set_opaque
gsk_render_node_is_opaque
gsk_render_node_get_draw_context
GskBlendMode
gsk_render_node_set_blend_mode
GskRenderNodeType
gsk_render_node_get_node_type
gsk_render_node_draw
GskSerializationError
gsk_render_node_serialize
gsk_render_node_deserialize
gsk_render_node_write_to_file
GskScalingFilter
gsk_render_node_set_scaling_filters
gsk_render_node_get_scale_factor
gsk_render_node_set_name
gsk_value_set_render_node
gsk_value_take_render_node
gsk_value_get_render_node
gsk_value_dup_render_node
gsk_render_node_get_name
gsk_render_node_get_bounds
gsk_color_node_new
gsk_linear_gradient_node_new
gsk_repeating_linear_gradient_node_new
gsk_border_node_new
gsk_texture_node_new
gsk_inset_shadow_node_new
gsk_outset_shadow_node_new
gsk_cairo_node_new
gsk_cairo_node_get_draw_context
gsk_container_node_new
gsk_container_node_get_n_children
gsk_container_node_get_child
gsk_transform_node_new
gsk_transform_node_get_child
gsk_opacity_node_new
gsk_opacity_node_get_child
gsk_clip_node_new
gsk_clip_node_get_child
gsk_rounded_clip_node_new
gsk_rounded_clip_node_get_child
GskShadow
gsk_shadow_node_new
GskBlendMode
gsk_blend_node_new
gsk_cross_fade_node_new
<SUBSECTION Standard>
GSK_IS_RENDER_NODE
GSK_RENDER_NODE
@@ -69,19 +73,40 @@ GskRenderNode
GskRenderNodeClass
gsk_render_node_get_type
GSK_TYPE_BLEND_MODE
<SUBSECTION Standard>
gsk_serialization_error_quark
GSK_SERIALIZATION_ERROR
GSK_TYPE_SERIALIZATION_ERROR
</SECTION>
<SECTION>
<FILE>GskRenderNodeIter</FILE>
gsk_render_node_iter_new
gsk_render_node_iter_free
gsk_render_node_iter_init
gsk_render_node_iter_is_valid
gsk_render_node_iter_prev
gsk_render_node_iter_next
gsk_render_node_iter_remove
<FILE>GskTexture</FILE>
gsk_texture_ref
gsk_texture_unref
gsk_texture_new_for_data
gsk_texture_new_for_pixbuf
gsk_texture_get_width
gsk_texture_get_height
gsk_texture_download
<SUBSECTION Standard>
GSK_TYPE_RENDER_NODE_ITER
GskRenderNodeIter
gsk_render_node_iter_get_type
GskTexture
gsk_texture_get_type
GSK_TYPE_TEXTURE
GSK_IS_TEXTURE
</SECTION>
<SECTION>
<FILE>GskRoundedRect</FILE>
GskCorner
GskRoundedRect
gsk_rounded_rect_init
gsk_rounded_rect_init_copy
gsk_rounded_rect_init_from_rect
gsk_rounded_rect_normalize
gsk_rounded_rect_offset
gsk_rounded_rect_shrink
gsk_rounded_rect_is_rectilinear
gsk_rounded_rect_contains_point
gsk_rounded_rect_contains_rect
gsk_rounded_rect_intersects_rect
</SECTION>

View File

@@ -1,3 +1,2 @@
gsk_render_node_get_type
gsk_render_node_iter_get_type
gsk_renderer_get_type

View File

@@ -31,37 +31,48 @@ IGNORE_HFILES = \
gtkapplicationprivate.h \
gtkbindingsprivate.h \
gtkbitmaskprivate.h \
gtkboxgadgetprivate.h \
gtkboxprivate.h \
gtkbuilderprivate.h \
gtkbuiltiniconprivate.h \
gtkbuttonprivate.h \
gtkcairoblurprivate.h \
gtkcellareaboxcontextprivate.h \
gtkcheckbuttonprivate.h \
gtkclipboardprivate.h \
gtkcolorchooserprivate.h \
gtkcoloreditorprivate.h \
gtkcolorplaneprivate.h \
gtkcolorscaleprivate.h \
gtkcolorswatchprivate.h \
gtkcolorutils.h \
gtkcomboboxprivate.h \
gtkcomposetable.h \
gtkcontainerprivate.h \
gtkcssanimatedstyleprivate.h \
gtkcssanimationprivate.h \
gtkcssarrayvalueprivate.h \
gtkcssbgsizevalueprivate.h \
gtkcssbordervalueprivate.h \
gtkcsscalcvalueprivate.h \
gtkcsscolorvalueprivate.h \
gtkcsscornervalueprivate.h \
gtkcsscustomgadgetprivate.h \
gtkcsscustompropertyprivate.h \
gtkcssdimensionvalueprivate.h \
gtkcsseasevalueprivate.h \
gtkcssenginevalueprivate.h \
gtkcssenumvalueprivate.h \
gtkcssgadgetprivate.h \
gtkcssiconthemevalueprivate.h \
gtkcssimagebuiltinprivate.h \
gtkcssimagecrossfadeprivate.h \
gtkcssimagefallbackprivate.h \
gtkcssimagegradientprivate.h \
gtkcssimageiconthemeprivate.h \
gtkcssimagelinearprivate.h \
gtkcssimageradialprivate.h \
gtkcssimageprivate.h \
gtkcssimagerecolorprivate.h \
gtkcssimagescaledprivate.h \
gtkcssimagesurfaceprivate.h \
gtkcssimageurlprivate.h \
@@ -73,8 +84,10 @@ IGNORE_HFILES = \
gtkcsslookupprivate.h \
gtkcssmatcherprivate.h \
gtkcssnodeprivate.h \
gtkcssnodestylecacheprivate.h \
gtkcssnodedeclarationprivate.h \
gtkcssnumbervalueprivate.h \
gtkcsspalettevalueprivate.h \
gtkcsspathnodeprivate.h \
gtkcssparserprivate.h \
gtkcsspositionvalueprivate.h \
@@ -88,6 +101,7 @@ IGNORE_HFILES = \
gtkcssshorthandpropertyprivate.h\
gtkcssstaticstyleprivate.h \
gtkcssstringvalueprivate.h \
gtkcssstylechangeprivate.h \
gtkcssstylefuncsprivate.h \
gtkcssstyleprivate.h \
gtkcssstylepropertyprivate.h \
@@ -99,9 +113,13 @@ IGNORE_HFILES = \
gtkcssunsetvalueprivate.h \
gtkcssvalueprivate.h \
gtkcsswidgetnodeprivate.h \
gtkcsswin32sizevalueprivate.h \
gtkdebugupdatesprivate.h \
gtkdialogprivate.h \
gtkdndprivate.h \
gtkentryprivate.h \
gtkeventcontrollerprivate.h \
gtkfilechoosernativeprivate.h \
gtkfilechooserprivate.h \
gtkfilechooserwidgetprivate.h \
gtkfontchooserprivate.h \
@@ -116,9 +134,13 @@ IGNORE_HFILES = \
gtkgesturezoomprivate.h \
gtkheaderbarprivate.h \
gtkhslaprivate.h \
gtkiconprivate.h \
gtkiconhelperprivate.h \
gtkiconthemeprivate.h \
gtkiconviewprivate.h \
gtkimagedefinitionprivate.h \
gtkimageprivate.h \
gtkimcontextsimpleprivate.h \
gtkimmoduleprivate.h \
gtklabelprivate.h \
gtklockbuttonprivate.h \
@@ -138,12 +160,12 @@ IGNORE_HFILES = \
gtkprinter-private.h \
gtkprintoperation-private.h \
gtkprivate.h \
gtkprogresstrackerprivate.h \
gtkrangeprivate.h \
gtkrecentchooserprivate.h \
gtkrenderbackgroundprivate.h \
gtkrenderborderprivate.h \
gtkrendericonprivate.h \
gtkrenderprivate.h \
gtkroundedboxprivate.h \
gtkscaleprivate.h \
gtksearchengine.h \
@@ -154,25 +176,31 @@ IGNORE_HFILES = \
gtksearchentryprivate.h \
gtkselectionprivate.h \
gtksettingsprivate.h \
gtkshortcutsshortcutprivate.h \
gtkshortcutswindowprivate.h \
gtksidebarrowprivate.h \
gtksizegroup-private.h \
gtksizerequestcacheprivate.h \
gtksnapshotprivate.h \
gtkstyleanimationprivate.h \
gtkstylecascadeprivate.h \
gtkstylecontextprivate.h \
gtkstylepropertyprivate.h \
gtkstyleproviderprivate.h \
gtktextattributes.h \
gtktextattributesprivate.h \
gtktextchildprivate.h \
gtktexthandleprivate.h \
gtktextiterprivate.h \
gtktextmarkprivate.h \
gtktexttagprivate.h \
gtktextviewprivate.h \
gtktogglebuttonprivate.h \
gtktoolbarprivate.h \
gtktoolpaletteprivate.h \
gtktooltipprivate.h \
gtktooltipwindowprivate.h \
gtkutilsprivate.h \
gtktreeprivate.h \
gtkwidgetprivate.h \
gtkwin32themeprivate.h \
@@ -219,6 +247,8 @@ IGNORE_HFILES = \
gtkprinteroption.h \
gtkprinteroptionset.h \
gtkprinteroptionwidget.h \
gtkprinter-private.h \
gtkprintoperation-portal.h \
gtkprint-win32.h \
gtkprintutils.h \
gtkprivate.h \
@@ -246,7 +276,10 @@ IGNORE_HFILES = \
gtktreedatalist.h \
gtktreemenu.h \
gtktypebuiltins.h \
gtkwidgetpathprivate.h \
gtkwindow-decorate.h \
gtkwin32drawprivate.h \
gtkwin32themeprivate.h \
xdgmime \
xembed.h
@@ -277,7 +310,6 @@ MKHTML_OPTIONS="--path=\"$(abs_srcdir):$(top_srcdir)/examples\""
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
content_files = \
broadway.xml \
broadwayd.xml \
building.sgml \
compiling.sgml \
css-overview.xml \
@@ -285,6 +317,7 @@ content_files = \
drawing-model.xml \
getting_started.xml \
glossary.xml \
gtk4-broadwayd.xml \
gtk4-demo-application.xml \
gtk4-demo.xml \
gtk4-icon-browser.xml \
@@ -485,17 +518,17 @@ EXTRA_DIST += version.xml.in gtk4.types.in
########################################################################
man_MANS = \
gtk4-query-immodules.1 \
gtk4-update-icon-cache.1 \
gtk4-encode-symbolic-svg.1 \
gtk4-launch.1 \
gtk4-broadwayd.1 \
gtk4-builder-tool.1 \
gtk4-demo.1 \
gtk4-demo-application.1 \
gtk4-widget-factory.1 \
gtk4-encode-symbolic-svg.1 \
gtk4-icon-browser.1 \
broadwayd.1 \
gtk4-builder-tool.1 \
gtk4-query-settings.1
gtk4-launch.1 \
gtk4-query-immodules.1 \
gtk4-query-settings.1 \
gtk4-update-icon-cache.1 \
gtk4-widget-factory.1
if ENABLE_MAN

View File

@@ -682,7 +682,6 @@ button {
Gradients are images that smoothly fades from one color to another. CSS
provides ways to specify repeating and non-repeating linear and radial
gradients. Radial gradients can be circular, or axis-aligned ellipses.
In addition to CSS gradients, GTK+ has its own -gtk-gradient extensions.
</para>
<para>
@@ -734,76 +733,9 @@ label {
GTK+ extends the CSS syntax for images and also uses it for specifying icons.
</para>
<literallayout><code>〈gtk image〉 = 〈gtk gradient〉 | 〈themed icon〉 | 〈scaled image〉 | 〈recolored image〉 | 〈win32 theme part〉</code>
<literallayout><code>〈gtk image〉 = 〈themed icon〉 | 〈scaled image〉 | 〈recolored image〉 | 〈win32 theme part〉</code>
</literallayout>
<para>
GTK+ supports an alternative syntax for linear and radial gradients (which
was implemented before CSS gradients were supported).
</para>
<literallayout><code>〈gtk gradient〉 = 〈gtk linear gradient〉 | 〈gtk radial gradient〉</code>
<code>〈gtk linear gradient〉 = -gtk-gradient(linear,</code>
<code> [ 〈x position〉 〈y position〉 , ]{2}</code>
<code> 〈gtk color stops〉 )</code>
<code>〈gtk radial gradient〉 = -gtk-gradient(radial,</code>
<code> [ 〈x position〉 〈y position〉 , 〈radius〉 , ]{2}</code>
<code> 〈gtk color stops〉 )</code>
<code>〈x position〉 = left | right | center | 〈number〉</code>
<code>〈y position〉 = top | bottom | center | 〈number〉</code>
<code>〈radius 〉 = 〈number〉</code>
<code>〈gtk color stops〉 = 〈gtk color stop〉 [ , 〈gtk color stop〉 ]+</code>
<code>〈gtk color stop〉 = color-stop( 〈number〉 , 〈color〉 ) | from( 〈color〉 ) | to( 〈color〉 )</code>
</literallayout>
<para>
The numbers used to specify x and y positions, radii, as well as the
positions of color stops, must be between 0 and 1. The keywords for for
x and y positions (left, right, top, bottom, center), map to numeric
values of 0, 1 and 0.5 in the obvious way. Color stops using the from() and
to() syntax are abbreviations for color-stop with numeric positions of
0 and 1, respectively.
</para>
<example>
<title>Linear gradients</title>
<programlisting><![CDATA[
button {
background-image: -gtk-gradient (linear,
left top, right bottom,
from(@yellow), to(@blue));
}
label {
background-image: -gtk-gradient (linear,
0 0, 0 1,
color-stop(0, @yellow),
color-stop(0.2, @blue),
color-stop(1, #0f0));
}
]]></programlisting>
</example>
<example>
<title>Radial gradients</title>
<programlisting><![CDATA[
button {
background-image: -gtk-gradient (radial,
center center, 0,
center center, 1,
from(@yellow), to(@green));
}
label {
background-image: -gtk-gradient (radial,
0.4 0.4, 0.1,
0.6 0.6, 0.7,
color-stop(0, #f00),
color-stop(0.1, $a0f),
color-stop(0.2, @yellow),
color-stop(1, @green));
}
]]></programlisting>
</example>
<para>
GTK+ has extensive support for loading icons from icon themes. It is
accessible from CSS with the -gtk-icontheme syntax.

View File

@@ -456,9 +456,15 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
</tgroup>
</table>
<literallayout><code>〈transform〉 = matrix( 〈number〉 [ , 〈number〉 ]{5} ) | translate( 〈length〉, 〈length〉 ) | translateX( 〈length〉 ) | translateY( 〈length〉 ) |</code>
<code> scale( 〈number〉[ , 〈number〉 ]? ) | scaleX( 〈number〉 ) | scaleY( 〈number〉 ) | rotate( 〈angle〉 ) | skew( 〈angle〉 [ , 〈angle〉 ]? ) |</code>
<code> skewX( 〈angle〉 ) | skewY( 〈angle〉 )</code>
<literallayout><code>〈transform〉 = matrix( 〈number〉 [ , 〈number〉 ]{5} ) |</code>
<code> matrix3d( 〈number〉 [ , 〈number〉 ]{15} ) |</code>
<code> translate( 〈length〉, 〈length〉 ) | translate3d( 〈length〉, 〈length〉, 〈length〉 ) |</code>
<code> translateX( 〈length〉 ) | translateY( 〈length〉 ) | translateZ( 〈length〉 ) |</code>
<code> scale( 〈number〉[ , 〈number〉 ]? ) | scale3d( 〈number〉, 〈number〉, 〈number〉) |</code>
<code> scaleX( 〈number〉 ) | scaleY( 〈number〉 ) | scaleZ( 〈number〉 ) |</code>
<code> rotate( 〈angle〉 ) | rotate3d( 〈number〉, 〈number〉, 〈number〉, 〈angle〉 ) |</code>
<code> rotateX( 〈angle〉 ) | rotateY( 〈angle〉 ) | rotateZ( 〈angle〉 ) |</code>
<code> skew( 〈angle〉 [ , 〈angle〉 ]? ) | skewX( 〈angle〉 ) | skewY( 〈angle〉 )</code>
<code>〈color palette〉 = default | 〈name〉 〈color〉 [ , 〈name〉 〈color〉 ]*</code>
</literallayout>
@@ -1107,7 +1113,7 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
<entry></entry>
<entry><ulink url="http://www.w3.org/TR/2011/REC-CSS2-20110607/colors.html#propdef-background-image">CSS2</ulink>,
<ulink url="http://www.w3.org/TR/css3-background/#background-image">CSS3</ulink></entry>
<entry>not supported: urls without quotes, CSS radial gradients, colors in crossfades</entry>
<entry>not supported: urls without quotes, colors in crossfades</entry>
</row>
<row>
<entry>background-blend-mode</entry>
@@ -1369,5 +1375,33 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
〈binding name〉 must have been assigned to a binding set with a @binding-set rule.
</para>
<table pgwide="1">
<title>Table-related properties</title>
<tgroup cols="7">
<colspec colnum="4" align="center"/>
<colspec colnum="5" align="center"/>
<thead>
<row><entry>Name</entry><entry>Value</entry><entry>Initial</entry><entry>Inh.</entry><entry>Ani.</entry><entry>Reference</entry><entry>Notes</entry></row>
</thead>
<tbody>
<row>
<entry>borderspacing</entry>
<entry><code>〈length〉{1,2}</code></entry>
<entry><code>0</code></entry>
<entry></entry>
<entry></entry>
<entry><ulink url="https://www.w3.org/TR/CSS2/tables.html#separated-borders">CSS2</ulink>,
<ulink url="https://www.w3.org/TR/2016/WD-css-tables-3-20161025/#border-spacing-property">CSS3</ulink></entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
<para>
The border-spacing property is respected by GtkBox and GtkGrid, and by box gadgets that
are used internally in complex widgets.
</para>
</refsect1>
</refentry>

View File

@@ -259,6 +259,7 @@
<xi:include href="xml/gtktooltip.xml" />
<xi:include href="xml/gtkviewport.xml" />
<xi:include href="xml/gtkaccessible.xml" />
<xi:include href="xml/gtksnapshot.xml" />
</chapter>
<chapter id="AbstractObjects">
@@ -363,7 +364,7 @@
<xi:include href="gtk4-builder-tool.xml" />
<xi:include href="gtk4-launch.xml" />
<xi:include href="gtk4-query-settings.xml" />
<xi:include href="broadwayd.xml" />
<xi:include href="gtk4-broadwayd.xml" />
</part>
<part id="platform-support">
@@ -437,6 +438,10 @@
<title>Index of new symbols in 3.22</title>
<xi:include href="xml/api-index-3.22.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-90" role="3.90">
<title>Index of new symbols in 3.90</title>
<xi:include href="xml/api-index-3.90.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>

View File

@@ -2,10 +2,10 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="broadwayd">
<refentry id="gtk4-broadwayd">
<refentryinfo>
<title>broadwayd</title>
<title>gtk4-broadwayd</title>
<productname>GTK+</productname>
<authorgroup>
<author>
@@ -17,19 +17,19 @@
</refentryinfo>
<refmeta>
<refentrytitle>broadwayd</refentrytitle>
<refentrytitle>gtk4-broadwayd</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>broadwayd</refname>
<refname>gtk4-broadwayd</refname>
<refpurpose>Broadway display server</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>broadwayd</command>
<command>gtk4-broadwayd</command>
<arg choice="opt">--port <replaceable>PORT</replaceable></arg>
<arg choice="opt">--address <replaceable>ADDRESS</replaceable></arg>
<arg choice="opt">--unixsocket <replaceable>ADDRESS</replaceable></arg>
@@ -39,15 +39,15 @@
<refsect1><title>Description</title>
<para>
<command>broadwayd</command> is a display server for the Broadway
<command>gtk4-broadwayd</command> is a display server for the Broadway
GDK backend. It allows multiple GTK+ applications to display their
windows in the same web browser, by connecting to broadwayd.
windows in the same web browser, by connecting to gtk4-broadwayd.
</para>
<para>
When using broadwayd, specify the display number to use, prefixed
When using gtk4-broadwayd, specify the display number to use, prefixed
with a colon, similar to X. The default display number is 0.
<programlisting>
broadwayd :5
gtk4-broadwayd :5
</programlisting>
Then point your web browser at <literal>http://127.0.0.1:8085</literal>.
Start your applications like this:

View File

@@ -57,7 +57,8 @@
<varlistentry>
<term><option>simplify</option></term>
<listitem><para>Simplifies the .ui file by removing properties that
are set to their default values and write the resulting XML to stdout.</para></listitem>
are set to their default values and write the resulting XML to stdout,
or back to the input file.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>enumerate</option></term>
@@ -71,6 +72,16 @@
</variablelist>
</refsect1>
<refsect1><title>Simplify Options</title>
<para>The <option>simplify</option> command accepts the following options:</para>
<variablelist>
<varlistentry>
<term><option>--replace</option></term>
<listitem><para>Write the content back to the .ui file instead of stdout.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1><title>Preview Options</title>
<para>The <option>preview</option> command accepts the following options:</para>
<variablelist>

View File

@@ -250,24 +250,6 @@ GtkAssistantPrivate
gtk_assistant_get_type
</SECTION>
<SECTION>
<FILE>gtkarrow</FILE>
<TITLE>GtkArrow</TITLE>
GtkArrow
gtk_arrow_new
gtk_arrow_set
<SUBSECTION Standard>
GTK_ARROW
GTK_IS_ARROW
GTK_TYPE_ARROW
GTK_ARROW_CLASS
GTK_IS_ARROW_CLASS
GTK_ARROW_GET_CLASS
<SUBSECTION Private>
GtkArrowPrivate
gtk_arrow_get_type
</SECTION>
<SECTION>
<FILE>gtkaspectframe</FILE>
<TITLE>GtkAspectFrame</TITLE>
@@ -514,28 +496,15 @@ gtk_button_new
gtk_button_new_with_label
gtk_button_new_with_mnemonic
gtk_button_new_from_icon_name
gtk_button_pressed
gtk_button_released
gtk_button_clicked
gtk_button_enter
gtk_button_leave
gtk_button_set_relief
gtk_button_get_relief
gtk_button_get_label
gtk_button_set_label
gtk_button_get_use_underline
gtk_button_set_use_underline
gtk_button_set_focus_on_click
gtk_button_get_focus_on_click
gtk_button_set_alignment
gtk_button_get_alignment
gtk_button_set_image
gtk_button_get_image
gtk_button_set_image_position
gtk_button_get_image_position
gtk_button_set_always_show_image
gtk_button_get_always_show_image
gtk_button_get_event_window
gtk_button_set_icon_name
gtk_button_get_icon_name
<SUBSECTION Standard>
GTK_BUTTON
@@ -641,8 +610,6 @@ gtk_check_menu_item_get_type
GtkColorButton
gtk_color_button_new
gtk_color_button_new_with_rgba
gtk_color_button_set_rgba
gtk_color_button_get_rgba
gtk_color_button_set_title
gtk_color_button_get_title
<SUBSECTION Standard>
@@ -657,64 +624,6 @@ gtk_color_button_get_type
GtkColorButtonPrivate
</SECTION>
<SECTION>
<FILE>gtkcolorsel</FILE>
<TITLE>GtkColorSelection</TITLE>
GtkColorSelection
GtkColorSelectionClass
gtk_color_selection_new
gtk_color_selection_set_has_opacity_control
gtk_color_selection_get_has_opacity_control
gtk_color_selection_set_has_palette
gtk_color_selection_get_has_palette
gtk_color_selection_get_current_alpha
gtk_color_selection_set_current_alpha
gtk_color_selection_get_current_color
gtk_color_selection_set_current_color
gtk_color_selection_get_previous_alpha
gtk_color_selection_set_previous_alpha
gtk_color_selection_get_previous_color
gtk_color_selection_set_previous_color
gtk_color_selection_get_current_rgba
gtk_color_selection_set_current_rgba
gtk_color_selection_get_previous_rgba
gtk_color_selection_set_previous_rgba
gtk_color_selection_is_adjusting
gtk_color_selection_palette_from_string
gtk_color_selection_palette_to_string
GtkColorSelectionChangePaletteFunc
gtk_color_selection_set_change_palette_with_screen_hook
GtkColorSelectionChangePaletteWithScreenFunc
<SUBSECTION Standard>
GTK_COLOR_SELECTION
GTK_IS_COLOR_SELECTION
GTK_TYPE_COLOR_SELECTION
GTK_COLOR_SELECTION_CLASS
GTK_IS_COLOR_SELECTION_CLASS
GTK_COLOR_SELECTION_GET_CLASS
<SUBSECTION Private>
GtkColorSelectionPrivate
gtk_color_selection_get_type
</SECTION>
<SECTION>
<FILE>gtkcolorseldlg</FILE>
<TITLE>GtkColorSelectionDialog</TITLE>
GtkColorSelectionDialog
gtk_color_selection_dialog_new
gtk_color_selection_dialog_get_color_selection
<SUBSECTION Standard>
GTK_COLOR_SELECTION_DIALOG
GTK_IS_COLOR_SELECTION_DIALOG
GTK_TYPE_COLOR_SELECTION_DIALOG
GTK_COLOR_SELECTION_DIALOG_CLASS
GTK_IS_COLOR_SELECTION_DIALOG_CLASS
GTK_COLOR_SELECTION_DIALOG_GET_CLASS
<SUBSECTION Private>
GtkColorSelectionDialogPrivate
gtk_color_selection_dialog_get_type
</SECTION>
<SECTION>
<FILE>gtkcombobox</FILE>
<TITLE>GtkComboBox</TITLE>
@@ -748,10 +657,6 @@ gtk_combo_box_popdown
gtk_combo_box_get_popup_accessible
gtk_combo_box_get_row_separator_func
gtk_combo_box_set_row_separator_func
gtk_combo_box_set_add_tearoffs
gtk_combo_box_get_add_tearoffs
gtk_combo_box_set_title
gtk_combo_box_get_title
gtk_combo_box_set_button_sensitivity
gtk_combo_box_get_button_sensitivity
gtk_combo_box_get_has_entry
@@ -805,7 +710,6 @@ gtk_combo_box_text_get_type
<TITLE>GtkContainer</TITLE>
GtkContainer
GtkContainerClass
GTK_IS_RESIZE_CONTAINER
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID
gtk_container_add
gtk_container_remove
@@ -820,7 +724,6 @@ gtk_container_get_focus_vadjustment
gtk_container_set_focus_vadjustment
gtk_container_get_focus_hadjustment
gtk_container_set_focus_hadjustment
gtk_container_resize_children
gtk_container_child_type
gtk_container_child_get
gtk_container_child_set
@@ -832,6 +735,7 @@ gtk_container_child_notify
gtk_container_child_notify_by_pspec
gtk_container_forall
gtk_container_propagate_draw
gtk_container_snapshot_child
gtk_container_get_focus_chain
gtk_container_set_focus_chain
gtk_container_unset_focus_chain
@@ -873,8 +777,6 @@ gtk_dialog_get_widget_for_response
gtk_dialog_get_action_area
gtk_dialog_get_content_area
gtk_dialog_get_header_bar
<SUBSECTION>
gtk_alternative_dialog_button_order
<SUBSECTION Standard>
GTK_DIALOG
@@ -893,6 +795,12 @@ gtk_dialog_get_type
<TITLE>GtkDrawingArea</TITLE>
GtkDrawingArea
gtk_drawing_area_new
gtk_drawing_area_get_content_width
gtk_drawing_area_set_content_width
gtk_drawing_area_get_content_height
gtk_drawing_area_set_content_height
GtkDrawingAreaDrawFunc
gtk_drawing_area_set_draw_func
<SUBSECTION Standard>
GTK_DRAWING_AREA
GTK_IS_DRAWING_AREA
@@ -942,7 +850,6 @@ gtk_entry_set_buffer
gtk_entry_set_text
gtk_entry_get_text
gtk_entry_get_text_length
gtk_entry_get_text_area
gtk_entry_set_visibility
gtk_entry_get_visibility
gtk_entry_set_invisible_char
@@ -1221,6 +1128,10 @@ gtk_file_chooser_select_file
gtk_file_chooser_set_current_folder_file
gtk_file_chooser_set_file
gtk_file_chooser_unselect_file
gtk_file_chooser_add_choice
gtk_file_chooser_remove_choice
gtk_file_chooser_set_choice
gtk_file_chooser_get_choice
<SUBSECTION Standard>
GTK_FILE_CHOOSER
GTK_IS_FILE_CHOOSER
@@ -1648,6 +1559,7 @@ gtk_im_context_get_type
GtkIMContextSimple
gtk_im_context_simple_new
gtk_im_context_simple_add_table
gtk_im_context_simple_add_compose_file
GTK_MAX_COMPOSE_LEN
<SUBSECTION Standard>
GTK_IM_CONTEXT_SIMPLE
@@ -1832,11 +1744,9 @@ gtk_menu_set_accel_group
gtk_menu_get_accel_group
gtk_menu_set_accel_path
gtk_menu_get_accel_path
gtk_menu_set_title
gtk_menu_get_title
gtk_menu_set_monitor
gtk_menu_get_monitor
gtk_menu_get_tearoff_state
gtk_menu_place_on_monitor
gtk_menu_set_reserve_toggle_size
gtk_menu_get_reserve_toggle_size
<SUBSECTION>
@@ -1844,7 +1754,6 @@ gtk_menu_popdown
gtk_menu_reposition
gtk_menu_get_active
gtk_menu_set_active
gtk_menu_set_tearoff_state
gtk_menu_attach_to_widget
gtk_menu_detach
gtk_menu_get_attach_widget
@@ -1924,8 +1833,6 @@ GtkMenuItemClass
gtk_menu_item_new
gtk_menu_item_new_with_label
gtk_menu_item_new_with_mnemonic
gtk_menu_item_set_right_justified
gtk_menu_item_get_right_justified
gtk_menu_item_get_label
gtk_menu_item_set_label
gtk_menu_item_get_use_underline
@@ -2147,6 +2054,7 @@ GTK_IS_PANED_CLASS
GTK_PANED_GET_CLASS
<SUBSECTION Private>
GtkPanedPrivate
gtk_paned_get_type
</SECTION>
@@ -2295,11 +2203,9 @@ gtk_range_set_upper_stepper_sensitivity
gtk_range_get_upper_stepper_sensitivity
gtk_range_get_flippable
gtk_range_set_flippable
gtk_range_get_min_slider_size
gtk_range_get_range_rect
gtk_range_get_slider_range
gtk_range_get_slider_size_fixed
gtk_range_set_min_slider_size
gtk_range_set_slider_size_fixed
<SUBSECTION Standard>
@@ -2747,8 +2653,6 @@ gtk_rc_property_parse_flags
gtk_rc_property_parse_requisition
gtk_rc_property_parse_border
gtk_settings_reset_property
GtkIMPreeditStyle
GtkIMStatusStyle
<SUBSECTION Standard>
GtkSettingsClass
GTK_IS_SETTINGS
@@ -2908,24 +2812,6 @@ GtkLevelBarPrivate
gtk_level_bar_get_type
</SECTION>
<SECTION>
<FILE>gtktearoffmenuitem</FILE>
<TITLE>GtkTearoffMenuItem</TITLE>
GtkTearoffMenuItem
GtkTearoffMenuItemClass
gtk_tearoff_menu_item_new
<SUBSECTION Standard>
GTK_TEAROFF_MENU_ITEM
GTK_IS_TEAROFF_MENU_ITEM
GTK_TYPE_TEAROFF_MENU_ITEM
GTK_TEAROFF_MENU_ITEM_CLASS
GTK_IS_TEAROFF_MENU_ITEM_CLASS
GTK_TEAROFF_MENU_ITEM_GET_CLASS
<SUBSECTION Private>
GtkTearoffMenuItemPrivate
gtk_tearoff_menu_item_get_type
</SECTION>
<SECTION>
<FILE>gtktextbuffer</FILE>
<TITLE>GtkTextBuffer</TITLE>
@@ -3064,7 +2950,6 @@ gtk_text_iter_inside_sentence
gtk_text_iter_is_cursor_position
gtk_text_iter_get_chars_in_line
gtk_text_iter_get_bytes_in_line
gtk_text_iter_get_attributes
gtk_text_iter_get_language
gtk_text_iter_is_end
gtk_text_iter_is_start
@@ -3157,13 +3042,6 @@ gtk_text_tag_get_priority
gtk_text_tag_set_priority
gtk_text_tag_event
gtk_text_tag_changed
GtkTextAttributes
GtkTextAppearance
gtk_text_attributes_new
gtk_text_attributes_copy
gtk_text_attributes_copy_values
gtk_text_attributes_unref
gtk_text_attributes_ref
<SUBSECTION Standard>
GTK_TEXT_TAG
GTK_IS_TEXT_TAG
@@ -3171,11 +3049,9 @@ GTK_TYPE_TEXT_TAG
GTK_TEXT_TAG_CLASS
GTK_IS_TEXT_TAG_CLASS
GTK_TEXT_TAG_GET_CLASS
GTK_TYPE_TEXT_ATTRIBUTES
<SUBSECTION Private>
GtkTextTagPrivate
gtk_text_tag_get_type
gtk_text_attributes_get_type
</SECTION>
<SECTION>
@@ -3276,7 +3152,6 @@ gtk_text_view_set_tabs
gtk_text_view_get_tabs
gtk_text_view_set_accepts_tab
gtk_text_view_get_accepts_tab
gtk_text_view_get_default_attributes
gtk_text_view_im_context_filter_keypress
gtk_text_view_reset_im_context
gtk_text_view_set_input_purpose
@@ -3307,30 +3182,6 @@ gtk_text_child_anchor_get_type
GtkTextBTree
</SECTION>
<SECTION>
<FILE>gtktoggleaction</FILE>
<TITLE>GtkToggleAction</TITLE>
GtkToggleAction
gtk_toggle_action_new
gtk_toggle_action_toggled
gtk_toggle_action_set_active
gtk_toggle_action_get_active
gtk_toggle_action_set_draw_as_radio
gtk_toggle_action_get_draw_as_radio
<SUBSECTION Standard>
GTK_TYPE_TOGGLE_ACTION
GTK_TOGGLE_ACTION
GTK_TOGGLE_ACTION_CLASS
GTK_IS_TOGGLE_ACTION
GTK_IS_TOGGLE_ACTION_CLASS
GTK_TOGGLE_ACTION_GET_CLASS
GtkToggleActionClass
<SUBSECTION Private>
gtk_toggle_action_get_type
GtkToggleActionPrivate
</SECTION>
<SECTION>
<FILE>gtktogglebutton</FILE>
<TITLE>GtkToggleButton</TITLE>
@@ -4146,8 +3997,6 @@ gtk_cell_view_set_model
gtk_cell_view_get_model
gtk_cell_view_set_displayed_row
gtk_cell_view_get_displayed_row
gtk_cell_view_set_background_color
gtk_cell_view_set_background_rgba
gtk_cell_view_set_draw_sensitive
gtk_cell_view_get_draw_sensitive
gtk_cell_view_set_fit_model
@@ -4203,7 +4052,7 @@ gtk_cell_area_has_renderer
gtk_cell_area_foreach
gtk_cell_area_foreach_alloc
gtk_cell_area_event
gtk_cell_area_render
gtk_cell_area_snapshot
gtk_cell_area_get_cell_allocation
gtk_cell_area_get_cell_at_position
gtk_cell_area_create_context
@@ -4321,7 +4170,7 @@ GtkCellRendererClass
gtk_cell_renderer_class_set_accessible_type
gtk_cell_renderer_get_aligned_area
gtk_cell_renderer_get_size
gtk_cell_renderer_render
gtk_cell_renderer_snapshot
gtk_cell_renderer_activate
gtk_cell_renderer_start_editing
gtk_cell_renderer_stop_editing
@@ -4601,6 +4450,33 @@ GTK_VOLUME_BUTTON_GET_CLASS
gtk_volume_button_get_type
</SECTION>
<SECTION>
<FILE>gtksnapshot</FILE>
<TITLE>GtkSnapshot</TITLE>
GtkSnapshot
gtk_snapshot_push
gtk_snapshot_push_node
gtk_snapshot_push_transform
gtk_snapshot_push_clip
gtk_snapshot_push_rounded_clip
gtk_snapshot_pop
gtk_snapshot_pop_and_append
gtk_snapshot_set_transform
gtk_snapshot_transform
gtk_snapshot_translate_2d
gtk_snapshot_append_node
gtk_snapshot_append_cairo_node
gtk_snapshot_append_texture_node
gtk_snapshot_append_color_node
gtk_snapshot_clips_rect
gtk_snapshot_render_background
gtk_snapshot_render_frame
gtk_snapshot_render_focus
gtk_snapshot_render_layout
gtk_snapshot_render_insertion_cursor
gtk_snapshot_render_icon
</SECTION>
<SECTION>
<FILE>gtkwidget</FILE>
<TITLE>GtkWidget</TITLE>
@@ -4609,7 +4485,6 @@ GtkWidgetClass
GtkCallback
GtkRequisition
GtkAllocation
GtkWidgetHelpType
gtk_widget_new
gtk_widget_destroy
gtk_widget_in_destruction
@@ -4662,16 +4537,9 @@ gtk_widget_set_device_enabled
gtk_widget_get_device_enabled
gtk_widget_get_toplevel
gtk_widget_get_ancestor
gtk_widget_get_visual
gtk_widget_set_visual
gtk_widget_is_ancestor
gtk_widget_translate_coordinates
gtk_widget_hide_on_delete
gtk_widget_set_style
gtk_widget_ensure_style
gtk_widget_get_style
gtk_widget_reset_rc_styles
gtk_widget_get_default_style
gtk_widget_set_direction
GtkTextDirection
gtk_widget_get_direction
@@ -4679,21 +4547,6 @@ gtk_widget_set_default_direction
gtk_widget_get_default_direction
gtk_widget_shape_combine_region
gtk_widget_input_shape_combine_region
gtk_widget_path
gtk_widget_class_path
gtk_widget_override_background_color
gtk_widget_override_color
gtk_widget_override_font
gtk_widget_override_symbolic_color
gtk_widget_override_cursor
gtk_widget_modify_style
gtk_widget_get_modifier_style
gtk_widget_modify_fg
gtk_widget_modify_bg
gtk_widget_modify_text
gtk_widget_modify_base
gtk_widget_modify_font
gtk_widget_modify_cursor
gtk_widget_create_pango_context
gtk_widget_get_pango_context
gtk_widget_set_font_options
@@ -4701,22 +4554,17 @@ gtk_widget_get_font_options
gtk_widget_set_font_map
gtk_widget_get_font_map
gtk_widget_create_pango_layout
gtk_widget_render_icon
gtk_widget_render_icon_pixbuf
gtk_widget_queue_draw_area
gtk_widget_queue_draw_region
gtk_widget_set_app_paintable
gtk_widget_set_redraw_on_allocate
gtk_widget_mnemonic_activate
gtk_widget_class_install_style_property
gtk_widget_class_find_style_property
gtk_widget_class_list_style_properties
gtk_widget_region_intersect
gtk_widget_send_focus_change
gtk_widget_style_get
gtk_widget_style_get_property
gtk_widget_style_get_valist
gtk_widget_style_attach
gtk_widget_class_set_accessible_type
gtk_widget_class_set_accessible_role
gtk_widget_get_accessible
@@ -4739,7 +4587,6 @@ gtk_widget_get_no_show_all
gtk_widget_list_mnemonic_labels
gtk_widget_add_mnemonic_label
gtk_widget_remove_mnemonic_label
gtk_widget_is_composited
gtk_widget_error_bell
gtk_widget_keynav_failed
gtk_widget_get_tooltip_markup
@@ -4754,7 +4601,6 @@ gtk_widget_trigger_tooltip_query
gtk_widget_get_window
gtk_widget_register_window
gtk_widget_unregister_window
gtk_cairo_should_draw_window
gtk_cairo_transform_to_window
gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
@@ -4764,7 +4610,6 @@ gtk_widget_get_allocated_baseline
gtk_widget_get_allocated_size
gtk_widget_get_clip
gtk_widget_set_clip
gtk_widget_get_app_paintable
gtk_widget_get_can_default
gtk_widget_set_can_default
gtk_widget_get_can_focus
@@ -4775,7 +4620,6 @@ gtk_widget_get_has_window
gtk_widget_set_has_window
gtk_widget_get_sensitive
gtk_widget_is_sensitive
GtkStateType
gtk_widget_get_visible
gtk_widget_is_visible
gtk_widget_set_visible
@@ -4786,7 +4630,6 @@ gtk_widget_has_default
gtk_widget_has_focus
gtk_widget_has_visible_focus
gtk_widget_has_grab
gtk_widget_has_rc_style
gtk_widget_is_drawable
gtk_widget_is_toplevel
gtk_widget_set_window
@@ -4796,7 +4639,6 @@ gtk_widget_set_support_multidevice
gtk_widget_get_support_multidevice
gtk_widget_set_realized
gtk_widget_get_realized
gtk_widget_set_mapped
gtk_widget_get_mapped
gtk_widget_device_is_shadowed
gtk_widget_get_modifier_mask
@@ -4896,7 +4738,6 @@ GtkWindowClass
GtkWindowType
gtk_window_new
gtk_window_set_title
gtk_window_set_wmclass
gtk_window_set_resizable
gtk_window_get_resizable
gtk_window_add_accel_group
@@ -4905,8 +4746,6 @@ gtk_window_activate_focus
gtk_window_activate_default
gtk_window_set_modal
gtk_window_set_default_size
gtk_window_set_default_geometry
gtk_window_set_geometry_hints
gtk_window_set_gravity
gtk_window_get_gravity
GtkWindowPosition
@@ -4985,10 +4824,7 @@ gtk_window_get_group
gtk_window_has_group
gtk_window_get_window_type
gtk_window_move
gtk_window_parse_geometry
gtk_window_reshow_with_initial_size
gtk_window_resize
gtk_window_resize_to_geometry
gtk_window_set_default_icon_list
gtk_window_set_default_icon
gtk_window_set_default_icon_from_file
@@ -5109,11 +4945,6 @@ gtk_get_micro_version
gtk_get_binary_age
gtk_get_interface_age
gtk_check_version
gtk_major_version
gtk_minor_version
gtk_micro_version
gtk_binary_age
gtk_interface_age
<SUBSECTION>
GTK_MAJOR_VERSION
@@ -5178,8 +5009,6 @@ GTK_STYLE_PROVIDER_PRIORITY_THEME
GTK_STYLE_PROVIDER_PRIORITY_SETTINGS
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
GTK_STYLE_PROVIDER_PRIORITY_USER
gtk_style_provider_get_icon_factory
gtk_style_provider_get_style
gtk_style_provider_get_style_property
<SUBSECTION Standard>
GTK_TYPE_STYLE_PROVIDER
@@ -5228,7 +5057,6 @@ GTK_STYLE_CLASS_ERROR
GTK_STYLE_CLASS_EXPANDER
GTK_STYLE_CLASS_FRAME
GTK_STYLE_CLASS_FLAT
GTK_STYLE_CLASS_GRIP
GTK_STYLE_CLASS_HEADER
GTK_STYLE_CLASS_HIGHLIGHT
GTK_STYLE_CLASS_HORIZONTAL
@@ -5296,8 +5124,6 @@ gtk_style_context_new
gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_get
GtkJunctionSides
gtk_style_context_get_junction_sides
gtk_style_context_get_parent
gtk_style_context_get_path
gtk_style_context_get_property
@@ -5315,16 +5141,12 @@ gtk_style_context_get_border_color
gtk_style_context_get_border
gtk_style_context_get_padding
gtk_style_context_get_margin
gtk_style_context_get_font
gtk_style_context_state_is_running
gtk_style_context_lookup_color
gtk_style_context_remove_provider
gtk_style_context_remove_provider_for_screen
gtk_style_context_reset_widgets
gtk_style_context_set_background
gtk_style_context_restore
gtk_style_context_save
gtk_style_context_set_junction_sides
gtk_style_context_set_parent
gtk_style_context_set_path
gtk_style_context_add_class
@@ -5351,7 +5173,6 @@ gtk_render_background
gtk_render_background_get_clip
gtk_render_check
gtk_render_expander
gtk_render_extension
gtk_render_focus
gtk_render_frame
gtk_render_frame_gap
@@ -5421,47 +5242,6 @@ gtk_css_provider_error_quark
gtk_css_section_get_type
</SECTION>
<SECTION>
<FILE>gtksymboliccolor</FILE>
<TITLE>GtkSymbolicColor</TITLE>
GtkSymbolicColor
gtk_symbolic_color_new_literal
gtk_symbolic_color_new_name
gtk_symbolic_color_new_shade
gtk_symbolic_color_new_alpha
gtk_symbolic_color_new_mix
gtk_symbolic_color_new_win32
gtk_symbolic_color_ref
gtk_symbolic_color_unref
gtk_symbolic_color_resolve
gtk_symbolic_color_to_string
<SUBSECTION Standard>
GTK_TYPE_SYMBOLIC_COLOR
<SUBSECTION Private>
gtk_symbolic_color_get_type
</SECTION>
<SECTION>
<FILE>gtkgradient</FILE>
<TITLE>GtkGradient</TITLE>
GtkGradient
gtk_gradient_new_linear
gtk_gradient_new_radial
gtk_gradient_add_color_stop
gtk_gradient_ref
gtk_gradient_unref
gtk_gradient_resolve
gtk_gradient_resolve_for_context
gtk_gradient_to_string
<SUBSECTION Standard>
GTK_TYPE_GRADIENT
gtk_gradient_get_type
</SECTION>
<SECTION>
<FILE>gtkselection</FILE>
<TITLE>Selections</TITLE>
@@ -5585,7 +5365,6 @@ GtkTargetFlags
GtkDragResult
<SUBSECTION Destination Side>
gtk_drag_dest_set
gtk_drag_dest_set_proxy
gtk_drag_dest_unset
gtk_drag_dest_find_target
gtk_drag_dest_get_target_list
@@ -5601,7 +5380,6 @@ gtk_drag_get_source_widget
gtk_drag_highlight
gtk_drag_unhighlight
<SUBSECTION Source Side>
gtk_drag_begin
gtk_drag_begin_with_coordinates
gtk_drag_cancel
gtk_drag_set_icon_widget
@@ -5641,7 +5419,6 @@ gtk_binding_entry_add_signal
gtk_binding_entry_add_signal_from_string
gtk_binding_entry_skip
gtk_binding_entry_remove
gtk_binding_set_add_path
</SECTION>
<SECTION>
@@ -5808,7 +5585,7 @@ GtkPrintOperationPrivate
<SECTION>
<INCLUDE>gtk/gtkprintunixdialog.h</INCLUDE>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintunixdialog</FILE>
<TITLE>GtkPrintUnixDialog</TITLE>
GtkPrintUnixDialog
@@ -6155,7 +5932,7 @@ gtk_print_context_get_type
<SECTION>
<INCLUDE>gtk/gtkprintjob.h</INCLUDE>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkprintjob</FILE>
<TITLE>GtkPrintJob</TITLE>
GtkPrintJob
@@ -6166,6 +5943,7 @@ gtk_print_job_get_printer
gtk_print_job_get_title
gtk_print_job_get_status
gtk_print_job_set_source_file
gtk_print_job_set_source_fd
gtk_print_job_get_surface
gtk_print_job_send
gtk_print_job_set_track_print_status
@@ -6206,7 +5984,7 @@ gtk_print_job_get_type
<SECTION>
<INCLUDE>gtk/gtkpagesetupunixdialog.h</INCLUDE>
<INCLUDE>gtk/gtkunixprint.h</INCLUDE>
<FILE>gtkpagesetupunixdialog</FILE>
<TITLE>GtkPageSetupUnixDialog</TITLE>
GtkPageSetupUnixDialog
@@ -6255,7 +6033,7 @@ gtk_mount_operation_get_parent
gtk_mount_operation_set_screen
gtk_mount_operation_get_screen
gtk_show_uri
gtk_show_uri_on_parent
gtk_show_uri_on_window
<SUBSECTION Standard>
GTK_IS_MOUNT_OPERATION
GTK_IS_MOUNT_OPERATION_CLASS
@@ -6812,6 +6590,7 @@ GtkFlowBox
gtk_flow_box_new
gtk_flow_box_insert
gtk_flow_box_get_child_at_index
gtk_flow_box_get_child_at_pos
gtk_flow_box_set_hadjustment
gtk_flow_box_set_vadjustment
@@ -6895,8 +6674,6 @@ gtk_popover_set_constrain_to
gtk_popover_get_constrain_to
gtk_popover_set_modal
gtk_popover_get_modal
gtk_popover_set_transitions_enabled
gtk_popover_get_transitions_enabled
gtk_popover_set_default_widget
gtk_popover_get_default_widget
<SUBSECTION Standard>
@@ -7264,6 +7041,7 @@ GTK_GET_SHORTCUTS_WINDOW_CLASS
<SUBSECTION Private>
GtkShortcutsWindowClass
gtk_shortcuts_window_get_type
GTK_SHORTCUTS_WINDOW_GET_CLASS
</SECTION>
<SECTION>
@@ -7279,6 +7057,7 @@ GTK_GET_SHORTCUTS_SECTION_CLASS
<SUBSECTION Private>
GtkShortcutsSectionClass
gtk_shortcuts_section_get_type
GTK_SHORTCUTS_SECTION_GET_CLASS
</SECTION>
<SECTION>
@@ -7294,6 +7073,7 @@ GTK_GET_SHORTCUTS_GROUP_CLASS
<SUBSECTION Private>
GtkShortcutsGroupClass
gtk_shortcuts_group_get_type
GTK_SHORTCUTS_GROUP_GET_CLASS
</SECTION>
<SECTION>
@@ -7310,4 +7090,26 @@ GTK_GET_SHORTCUTS_SHORTCUT_CLASS
<SUBSECTION Private>
GtkShortcutsShortcutClass
gtk_shortcuts_shortcut_get_type
gtk_shortcuts_shortcut_update_accel
GTK_SHORTCUTS_SHORTCUT_GET_CLASS
</SECTION>
<SECTION>
<FILE>gtkshortcutlabel</FILE>
GtkShortcutLabel
gtk_shortcut_label_new
gtk_shortcut_label_get_accelerator
gtk_shortcut_label_get_disabled_text
gtk_shortcut_label_set_accelerator
gtk_shortcut_label_set_disabled_text
<SUBSECTION Private>
GtkShortcutLabelClass
gtk_shortcut_label_get_type
GTK_TYPE_SHORTCUT_LABEL
GTK_SHORTCUT_LABEL
GTK_SHORTCUT_LABEL_CLASS
GTK_SHORTCUT_LABEL_GET_CLASS
GTK_IS_SHORTCUT_LABEL
GTK_IS_SHORTCUT_LABEL_CLASS
</SECTION>

View File

@@ -52,6 +52,14 @@
</para>
</section>
<section>
<title>Do not use widget style properties</title>
<para>
Style properties do not exist in GTK+ 4. You should stop using them in
your custom CSS.
</para>
</section>
<section>
<title>Review your window creation flags</title>
<para>
@@ -98,6 +106,14 @@
</para>
</section>
<section>
<title>Stop using gdk_pixbuf_get_from_window() and gdk_cairo_set_source_window()</title>
<para>
These functions are not supported in GTK+ 4. Instead, either use backend-specific
APIs, or render your widgets using gtk_widget_render().
</para>
</section>
</section>
<section>
@@ -110,6 +126,17 @@
have been either impossible or impractical.
</para>
<section>
<title>Adapt to GdkWindow API changes</title>
<para>
The gdk_window_new() function has been replaced by a number of more
specialized constructors: gdk_window_new_toplevel(), gdk_window_new_popup(),
gdk_window_new_temp(), gdk_window_new_child(), gdk_window_new_input(),
gdk_wayland_window_new_subsurface(). Use the appropriate ones to create
your windows.
</para>
</section>
<section>
<title>Adapt to GtkStyleContext API changes</title>
<para>
@@ -121,6 +148,15 @@
</para>
</section>
<section>
<title>Adapt to GtkCssProvider API changes</title>
<para>
In GTK+ 4, the various #GtkCssProvider load functions have lost
their #GError argument. If you want to handle CSS loading errors,
use the #GtkCssProvider::parsing-error signal instead.
</para>
</section>
<section>
<title>Stop using GtkContainer::border-width</title>
<para>
@@ -133,7 +169,7 @@
<section>
<title>Adapt to GtkWidget's size request changes</title>
<para>
GTK+3 used five different virtual functions in GtkWidget to
GTK+ 3 used five different virtual functions in GtkWidget to
implement size requisition, namely the gtk_widget_get_preferred_width()
family of functions. To simplify widget implementations, GTK+4 uses
only one virtual function, GtkWidgetClass::measure() that widgets
@@ -141,6 +177,43 @@
</para>
</section>
<section>
<title>Don't use -gtk-gradient in your CSS</title>
<para>
GTK+ now supports standard CSS syntax for both linear and radial
gradients, just use those.
</para>
</section>
<section>
<title>Use gtk_widget_measure</title>
<para>
gtk_widget_measure replaces the various gtk_widget_get_preferred_ functions
for querying sizes.
</para>
</section>
<section>
<title>Adapt to drawing model changes</title>
<para>
This area has seen the most radical changes in the transition from GTK+ 3
to GTK+ 4. Widgets no longer use a draw() function to render their contents
to a cairo surface. Instead, they have a snapshot() function that creates
one or more GskRenderNodes to represent their content. Third-party widgets
that use a draw() function or a #GtkWidget::draw signal handler for custom
drawing will need to be converted to use gtk_snapshot_append_cairo_node().
</para>
<para>
The auxiliary #GtkSnapshot object has APIs to help with creating render
nodes.
</para>
<para>
If you are using a #GtkDrawingArea for custom drawing, you need to switch
to using gtk_drawing_area_set_draw_func() to set a draw function. This is
pretty much a direct replacement for a #GtkWidget::draw signal handler.
</para>
</section>
</section>
</chapter>

View File

@@ -570,7 +570,7 @@ RGBA drawing capabilities.
Note that the presence of an RGBA visual is no guarantee that the
window will actually appear transparent on screen. On X11, this
requires a compositing manager to be running. See
gtk_widget_is_composited() for a way to find out if the alpha
gdk_display_is_composited() for a way to find out if the alpha
channel will be respected.
</para>
</answer>

View File

@@ -178,18 +178,6 @@ additional environment variables.
<term>no-css-cache</term>
<listitem><para>Bypass caching for CSS style properties</para></listitem>
</varlistentry>
<varlistentry>
<term>no-pixel-cache</term>
<listitem><para>Disable the pixel cache</para></listitem>
</varlistentry>
<varlistentry>
<term>plugsocket</term>
<listitem><para>Cross-process embedding</para></listitem>
</varlistentry>
<varlistentry>
<term>pixel-cache</term>
<listitem><para>Pixel cache</para></listitem>
</varlistentry>
<varlistentry>
<term>printing</term>
<listitem><para>Printing support</para></listitem>
@@ -222,6 +210,10 @@ additional environment variables.
<term>layout</term>
<listitem><para>Show layout borders</para></listitem>
</varlistentry>
<varlistentry>
<term>snapshot</term>
<listitem><para>Include debug render nodes in the generated snapshots</para></listitem>
</varlistentry>
</variablelist>
The special value <literal>all</literal> can be used to turn on all
debug options. The special value <literal>help</literal> can be used

View File

@@ -148,13 +148,10 @@ displays after the widget is created with gtk_text_view_set_buffer().
<para>
There are two ways to affect text attributes in #GtkTextView.
You can change the default attributes for a given #GtkTextView, and you can
apply tags that change the attributes for a region of text. For text features
that come from the theme &mdash; such as font and foreground color &mdash; use
standard #GtkWidget functions such as gtk_widget_modify_font() or
gtk_widget_override_color(). For other attributes there are dedicated methods on
#GtkTextView such as gtk_text_view_set_tabs().
The way to affect text attributes in #GtkTextView is to
apply tags that change the attributes for a region of text.
For text features that come from the theme &mdash; such as font and
foreground color &mdash; use CSS to override their default values.
<informalexample><programlisting>
GtkWidget *view;
@@ -163,6 +160,8 @@ gtk_widget_override_color(). For other attributes there are dedicated methods on
PangoFontDescription *font_desc;
GdkRGBA rgba;
GtkTextTag *tag;
GtkCssProvider *provider;
GtkStyleContext *context;
view = gtk_text_view_new (<!-- -->);
@@ -170,14 +169,18 @@ gtk_widget_override_color(). For other attributes there are dedicated methods on
gtk_text_buffer_set_text (buffer, "Hello, this is some text", -1);
/* Change default font throughout the widget */
font_desc = pango_font_description_from_string ("Serif 15");
gtk_widget_modify_font (view, font_desc);
pango_font_description_free (font_desc);
/* Change default color throughout the widget */
gdk_rgba_parse ("green", &amp;rgba);
gtk_widget_override_color (view, GTK_STATE_FLAG_NORMAL, &amp;rgba);
/* Change default font and color throughout the widget */
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider,
"textview {"
" font: 15 serif;"
" color: green;"
"}",
-1);
context = gtk_widget_get_style_context (view);
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
/* Change left margin throughout the widget */
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30);

View File

@@ -1,6 +1,7 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <gdkx.h>
#include <cairo-xlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/wait.h>
@@ -136,9 +137,10 @@ static GdkPixbuf *
take_window_shot (Window child,
DecorationType decor)
{
GdkWindow *window, *root_window;
cairo_surface_t *surface;
XWindowAttributes attrs;
Window xid;
gint x_orig, y_orig;
Display *dpy;
gint x = 0, y = 0;
gint width, height;
@@ -150,35 +152,39 @@ take_window_shot (Window child,
else
xid = child;
window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), xid);
root_window = gdk_screen_get_root_window (gdk_window_get_screen (window));
dpy = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
XGetWindowAttributes (dpy, xid, &attrs);
width = gdk_window_get_width (window);
height = gdk_window_get_height (window);
gdk_window_get_origin (window, &x_orig, &y_orig);
width = attrs.width;
height = attrs.height;
if (x_orig < 0)
if (attrs.x < 0)
{
x = - x_orig;
width = width + x_orig;
x_orig = 0;
x = - attrs.x;
width = width + attrs.x;
}
if (y_orig < 0)
if (attrs.y < 0)
{
y = - y_orig;
height = height + y_orig;
y_orig = 0;
y = - attrs.y;
height = height + attrs.y;
}
if (x_orig + width > gdk_window_get_width (root_window))
width = gdk_window_get_width (root_window) - x_orig;
if (attrs.x + x + width > WidthOfScreen (DefaultScreenOfDisplay (dpy)))
width = WidthOfScreen (DefaultScreenOfDisplay (dpy)) - attrs.x - x;
if (y_orig + height > gdk_window_get_height (root_window))
height = gdk_window_get_height (root_window) - y_orig;
if (attrs.y + y + height > HeightOfScreen (DefaultScreenOfDisplay (dpy)))
height = HeightOfScreen (DefaultScreenOfDisplay (dpy)) - attrs.y - y;
tmp = gdk_pixbuf_get_from_window (window,
x, y, width, height);
surface = cairo_xlib_surface_create (dpy,
xid,
attrs.visual,
attrs.width,
attrs.height);
tmp = gdk_pixbuf_get_from_surface (surface,
x, y,
width, height);
cairo_surface_destroy (surface);
if (tmp != NULL)
{
@@ -203,8 +209,8 @@ take_window_shot (Window child,
static GList *toplevels;
static guint shot_id;
static gboolean
static gboolean
window_is_csd (GdkWindow *window)
{
gboolean set;

View File

@@ -798,7 +798,6 @@ create_page_setup_dialog (void)
settings);
info = new_widget_info ("pagesetupdialog", widget, ASIS);
gtk_widget_set_app_paintable (info->window, FALSE);
info->include_decorations = TRUE;
return info;

View File

@@ -15,7 +15,7 @@ main (int argc,
GObject *window;
GObject *button;
gtk_init (&argc, &argv);
gtk_init ();
/* Construct a GtkBuilder instance and load our UI description */
builder = gtk_builder_new ();

View File

@@ -67,6 +67,7 @@ gdk_public_h_sources = \
gdkdisplay.h \
gdkdisplaymanager.h \
gdkdnd.h \
gdkdrawcontext.h \
gdkdrawingcontext.h \
gdkevents.h \
gdkframetimings.h \
@@ -90,14 +91,11 @@ gdk_public_h_sources = \
gdkthreads.h \
gdktypes.h \
gdkvisual.h \
gdkvulkancontext.h \
gdkwindow.h
deprecated_h_sources = \
deprecated/gdkcolor.h
gdk_h_sources = \
$(gdk_public_h_sources) \
$(deprecated_h_sources)
$(gdk_public_h_sources)
gdk_private_headers = \
gdk-private.h \
@@ -110,6 +108,7 @@ gdk_private_headers = \
gdkdisplaymanagerprivate.h \
gdkdisplayprivate.h \
gdkdndprivate.h \
gdkdrawcontextprivate.h \
gdkdrawingcontextprivate.h \
gdkframeclockidle.h \
gdkframeclockprivate.h \
@@ -122,14 +121,10 @@ gdk_private_headers = \
gdkintl.h \
gdkkeysprivate.h \
gdkvisualprivate.h \
gdkvulkancontextprivate.h \
gdkx.h
deprecated_c_sources = \
deprecated/gdkcolor.c
gdk_c_sources = \
$(deprecated_c_sources) \
gdk-private.c \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
@@ -142,6 +137,7 @@ gdk_c_sources = \
gdkdisplay.c \
gdkdisplaymanager.c \
gdkdnd.c \
gdkdrawcontext.c \
gdkdrawingcontext.c \
gdkevents.c \
gdkframetimings.c \
@@ -163,6 +159,7 @@ gdk_c_sources = \
gdkseatdefault.c \
gdkselection.c \
gdkvisual.c \
gdkvulkancontext.c \
gdkwindow.c \
gdkwindowimpl.c
@@ -211,8 +208,6 @@ endif # USE_QUARTZ
if USE_WIN32
libgdk_4_la_LIBADD += win32/libgdk-win32.la
libgdk_4_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o
libgdk_4_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o
endif # USE_WIN32
if USE_BROADWAY
@@ -340,7 +335,7 @@ w32_introspection_files = \
win32/gdkwindow-win32.c
if OS_WIN32
GdkWin32-noinst-4.0.gir: libgdk-3.la Gdk-noinst-4.0.gir Makefile
GdkWin32-noinst-4.0.gir: libgdk-4.la Gdk-noinst-4.0.gir Makefile
GdkWin32_noinst_4_0_gir_SCANNERFLAGS = \
--identifier-prefix=Gdk \
--c-include="gdk/gdkwin32.h" \
@@ -355,7 +350,7 @@ endif # OS_WIN32
noinst_DATA = $(INTROSPECTION_GIRS)
CLEANFILES += $(gir_DATA)
CLEANFILES += $(INTROSPECTION_GIRS)
endif # HAVE_INTROSPECTION
@@ -444,29 +439,20 @@ stamp-gc-h: $(top_builddir)/config.status
#
# Resources
#
glsl_sources := $(wildcard $(srcdir)/resources/glsl/*.glsl)
gdk.gresource.xml: Makefile.am
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
echo "<gresources>" >> $@; \
echo " <gresource prefix='/org/gtk/libgdk'>" >> $@; \
for f in $(srcdir)/resources/glsl/*.glsl; do \
for f in $(glsl_sources); do \
n=`basename $$f`; \
echo " <file alias='glsl/$$n'>resources/glsl/$$n</file>" >> $@; \
done; \
echo " </gresource>" >> $@; \
echo "</gresources>" >> $@;
glsl_sources = \
resources/glsl/gl3-texture-2d.fs.glsl \
resources/glsl/gl3-texture-2d.vs.glsl \
resources/glsl/gl3-texture-rect.fs.glsl \
resources/glsl/gl3-texture-rect.vs.glsl \
resources/glsl/gl2-texture-2d.fs.glsl \
resources/glsl/gl2-texture-2d.fs.glsl \
resources/glsl/gl2-texture-rect.vs.glsl \
resources/glsl/gl2-texture-rect.vs.glsl \
resources/glsl/gles2-texture.fs.glsl \
resources/glsl/gles2-texture.vs.glsl
EXTRA_DIST += $(glsl_sources)
CLEANFILES += gdk.gresource.xml
@@ -510,20 +496,20 @@ INTROSPECTION_INTERMEDIATE_ITEMS = \
$(top_builddir)/build/win32/GdkWin32_4_0_gir_list
Gdk_4_0_gir_MSVC_FILES = $(introspection_files)
Gdk_4_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_4_0_gir_EXPORT_PACKAGES)
Gdk_4_0_gir_MSVC_INCLUDE_GIRS = $(Gdk_4_0_gir_INCLUDES)
Gdk_4_0_gir_MSVC_LIBS = gdk-4.0
Gdk_4_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_noinst_4_0_gir_EXPORT_PACKAGES)
Gdk_4_0_gir_MSVC_INCLUDE_GIRS = $(Gdk_noinst_4_0_gir_INCLUDES)
Gdk_4_0_gir_MSVC_LIBS = gtk-4
Gdk_4_0_gir_MSVC_CFLAGS = $(BASE_MSVC_GIR_CFLAGS)
Gdk_4_0_gir_MSVC_SCANNERFLAGS = $(Gdk_4_0_gir_SCANNERFLAGS)
Gdk_4_0_gir_MSVC_SCANNERFLAGS = $(Gdk_noinst_4_0_gir_SCANNERFLAGS)
GdkWin32_4_0_gir_MSVC_FILES = $(w32_introspection_files)
GdkWin32_4_0_gir_MSVC_INCLUDE_GIRS = $(GdkWin32_4_0_gir_INCLUDES)
GdkWin32_4_0_gir_MSVC_INCLUDE_GIRS = $(GdkWin32_noinst_4_0_gir_INCLUDES)
GdkWin32_4_0_gir_MSVC_LIBS = $(Gdk_4_0_gir_MSVC_LIBS)
GdkWin32_4_0_gir_MSVC_CFLAGS = $(BASE_MSVC_GIR_CFLAGS)
GdkWin32_4_0_gir_MSVC_SCANNERFLAGS = \
--identifier-prefix=Gdk \
--c-include="gdk/gdkwin32.h" \
--include-uninstalled=./Gdk-noinst-4.0.gir
--include-uninstalled=./Gdk-4.0.gir
include $(top_srcdir)/build/Makefile.msvc-introspection

View File

@@ -20,7 +20,7 @@ LDADDS = $(GDK_DEP_LIBS) -lrt
noinst_LTLIBRARIES = libgdk-broadway.la
bin_PROGRAMS = broadwayd
bin_PROGRAMS = gtk4-broadwayd
libgdkinclude_HEADERS = \
gdkbroadway.h
@@ -29,8 +29,7 @@ libgdkbroadwayinclude_HEADERS = \
gdkbroadwaydisplay.h \
gdkbroadwaywindow.h \
gdkbroadwaycursor.h \
gdkbroadwaymonitor.h \
gdkbroadwayvisual.h
gdkbroadwaymonitor.h
EXTRA_DIST += toarray.pl
@@ -73,7 +72,6 @@ libgdk_broadway_la_SOURCES = \
gdkscreen-broadway.h \
gdkselection-broadway.c \
gdktestutils-broadway.c \
gdkvisual-broadway.c \
gdkwindow-broadway.c \
gdkwindow-broadway.h \
gdkprivate-broadway.h \
@@ -86,7 +84,7 @@ libgdk_broadway_la_LIBADD = \
$(NULL)
endif
broadwayd_SOURCES = \
gtk4_broadwayd_SOURCES = \
broadway-protocol.h \
broadwayd.c \
broadway-server.h \
@@ -97,9 +95,9 @@ broadwayd_SOURCES = \
broadway-output.c
if OS_WIN32
broadwayd_LDADD = $(GDK_DEP_LIBS) -lws2_32
gtk4_broadwayd_LDADD = $(GDK_DEP_LIBS) -lws2_32
else
broadwayd_LDADD = $(GDK_DEP_LIBS) @SHM_LIBS@
gtk4_broadwayd_LDADD = $(GDK_DEP_LIBS) @SHM_LIBS@
endif
MAINTAINERCLEANFILES = $(broadway_built_sources)
@@ -108,7 +106,7 @@ EXTRA_DIST += $(broadway_built_sources)
BUILT_SOURCES = $(broadway_built_sources)
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk4-broadway broadwayd
MSVCPROJS = gdk4-broadway gtk4-broadwayd
gdk4_broadway_FILES = $(libgdk_broadway_la_SOURCES)
gdk4_broadway_EXCLUDES = dummy
@@ -118,14 +116,14 @@ gdk4_broadway_HEADERS_INST = $(libgdkbroadwayinclude_HEADERS)
gdk4_broadway_HEADERS_EXCLUDES = dummy
broadwayd_FILES = $(broadwayd_SOURCES)
broadwayd_EXCLUDES = dummy
gtk4_broadwayd_FILES = $(gtk4_broadwayd_SOURCES)
gtk4_broadwayd_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
dist-hook: \
$(top_builddir)/build/win32/vs12/gdk4-broadway.vcxproj \
$(top_builddir)/build/win32/vs12/broadwayd.vcxproj \
$(top_builddir)/build/win32/vs12/gtk4-broadwayd.vcxproj \
$(top_builddir)/build/win32/vs12/gdk4-broadway.vs12.headers
-include $(top_srcdir)/git.mk

View File

@@ -449,7 +449,7 @@ main (int argc, char *argv[])
{
if (*argv[1] != ':')
{
g_printerr ("Usage broadwayd [:DISPLAY]\n");
g_printerr ("Usage gtk4-broadwayd [:DISPLAY]\n");
exit (1);
}
display = argv[1];

View File

@@ -33,7 +33,6 @@
#include <gdk/broadway/gdkbroadwaywindow.h>
#include <gdk/broadway/gdkbroadwaycursor.h>
#include <gdk/broadway/gdkbroadwaymonitor.h>
#include <gdk/broadway/gdkbroadwayvisual.h>
#undef __GDKBROADWAY_H_INSIDE__

View File

@@ -1,46 +0,0 @@
/* gdkbroadwayvisual.h
*
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_BROADWAY_VISUAL_H__
#define __GDK_BROADWAY_VISUAL_H__
#include <gdk/gdk.h>
G_BEGIN_DECLS
#define GDK_TYPE_BROADWAY_VISUAL (gdk_broadway_visual_get_type ())
#define GDK_BROADWAY_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisual))
#define GDK_BROADWAY_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisualClass))
#define GDK_IS_BROADWAY_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_VISUAL))
#define GDK_IS_BROADWAY_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_VISUAL))
#define GDK_BROADWAY_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_VISUAL, GdkBroadwayVisualClass))
#ifdef GDK_COMPILATION
typedef struct _GdkBroadwayVisual GdkBroadwayVisual;
#else
typedef GdkVisual GdkBroadwayVisual;
#endif
typedef struct _GdkBroadwayVisualClass GdkBroadwayVisualClass;
GDK_AVAILABLE_IN_ALL
GType gdk_broadway_visual_get_type (void);
G_END_DECLS
#endif /* __GDK_BROADWAY_VISUAL_H__ */

View File

@@ -101,8 +101,6 @@ _gdk_broadway_display_open (const gchar *display_name)
_gdk_broadway_display_init_dnd (display);
_gdk_broadway_screen_setup (broadway_display->screens[0]);
if (display_name == NULL)
display_name = g_getenv ("BROADWAY_DISPLAY");
@@ -343,8 +341,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
display_class->supports_cursor_alpha = _gdk_broadway_display_supports_cursor_alpha;
display_class->supports_cursor_color = _gdk_broadway_display_supports_cursor_color;
display_class->before_process_all_updates = _gdk_broadway_display_before_process_all_updates;
display_class->after_process_all_updates = _gdk_broadway_display_after_process_all_updates;
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
display_class->create_window_impl = _gdk_broadway_display_create_window_impl;

View File

@@ -36,7 +36,6 @@
#include "gdkdisplay-broadway.h"
#include "gdkbroadwaycursor.h"
#include "gdkbroadwayvisual.h"
#include "gdkbroadwaywindow.h"
void _gdk_broadway_resync_windows (void);
@@ -90,15 +89,12 @@ gboolean _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode);
void _gdk_broadway_screen_events_init (GdkScreen *screen);
GdkVisual *_gdk_broadway_screen_get_system_visual (GdkScreen * screen);
GList *_gdk_broadway_screen_list_visuals (GdkScreen *screen);
void _gdk_broadway_screen_size_changed (GdkScreen *screen,
BroadwayInputScreenResizeNotify *msg);
void _gdk_broadway_events_got_input (BroadwayInputMsg *message);
void _gdk_broadway_screen_init_root_window (GdkScreen *screen);
void _gdk_broadway_screen_init_visuals (GdkScreen *screen);
void _gdk_broadway_display_init_dnd (GdkDisplay *display);
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
@@ -120,15 +116,12 @@ void _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
void _gdk_broadway_display_before_process_all_updates (GdkDisplay *display);
void _gdk_broadway_display_after_process_all_updates (GdkDisplay *display);
void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindowAttr *attributes);
gboolean _gdk_broadway_display_set_selection_owner (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,

View File

@@ -99,27 +99,13 @@ static void
gdk_broadway_screen_finalize (GObject *object)
{
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (object);
gint i;
if (broadway_screen->root_window)
g_object_unref (broadway_screen->root_window);
/* Visual Part */
for (i = 0; i < broadway_screen->nvisuals; i++)
g_object_unref (broadway_screen->visuals[i]);
g_free (broadway_screen->visuals);
G_OBJECT_CLASS (gdk_broadway_screen_parent_class)->finalize (object);
}
static GdkVisual *
gdk_broadway_screen_get_rgba_visual (GdkScreen *screen)
{
GdkBroadwayScreen *broadway_screen = GDK_BROADWAY_SCREEN (screen);
return broadway_screen->rgba_visual;
}
GdkScreen *
_gdk_broadway_screen_new (GdkDisplay *display,
gint screen_number)
@@ -131,29 +117,11 @@ _gdk_broadway_screen_new (GdkDisplay *display,
broadway_screen = GDK_BROADWAY_SCREEN (screen);
broadway_screen->display = display;
_gdk_broadway_screen_init_visuals (screen);
_gdk_broadway_screen_init_root_window (screen);
return screen;
}
/*
* It is important that we first request the selection
* notification, and then setup the initial state of
* is_composited to avoid a race condition here.
*/
void
_gdk_broadway_screen_setup (GdkScreen *screen)
{
}
static gboolean
gdk_broadway_screen_is_composited (GdkScreen *screen)
{
return TRUE;
}
static gboolean
gdk_broadway_screen_get_setting (GdkScreen *screen,
const gchar *name,
@@ -178,10 +146,6 @@ gdk_broadway_screen_class_init (GdkBroadwayScreenClass *klass)
screen_class->get_display = gdk_broadway_screen_get_display;
screen_class->get_root_window = gdk_broadway_screen_get_root_window;
screen_class->is_composited = gdk_broadway_screen_is_composited;
screen_class->get_setting = gdk_broadway_screen_get_setting;
screen_class->get_rgba_visual = gdk_broadway_screen_get_rgba_visual;
screen_class->get_system_visual = _gdk_broadway_screen_get_system_visual;
screen_class->list_visuals = _gdk_broadway_screen_list_visuals;
}

View File

@@ -23,7 +23,6 @@
#define __GDK_BROADWAY_SCREEN_H__
#include <gdk/gdkscreenprivate.h>
#include <gdk/gdkvisual.h>
#include "gdkprivate-broadway.h"
G_BEGIN_DECLS
@@ -46,16 +45,6 @@ struct _GdkBroadwayScreen
GdkDisplay *display;
GdkWindow *root_window;
/* Visual Part */
GdkVisual **visuals;
gint nvisuals;
GdkVisual *system_visual;
GdkVisual *rgba_visual;
gint available_depths[7];
gint navailable_depths;
GdkVisualType available_types[6];
gint navailable_types;
};
struct _GdkBroadwayScreenClass
@@ -68,7 +57,6 @@ struct _GdkBroadwayScreenClass
GType gdk_broadway_screen_get_type (void);
GdkScreen * _gdk_broadway_screen_new (GdkDisplay *display,
gint screen_number);
void _gdk_broadway_screen_setup (GdkScreen *screen);
G_END_DECLS

View File

@@ -1,137 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gdkvisualprivate.h"
#include "gdkprivate-broadway.h"
#include "gdkscreen-broadway.h"
#include "gdkinternals.h"
struct _GdkBroadwayVisual
{
GdkVisual visual;
};
struct _GdkBroadwayVisualClass
{
GObjectClass parent_class;
};
G_DEFINE_TYPE (GdkBroadwayVisual, gdk_broadway_visual, GDK_TYPE_VISUAL)
static void
gdk_broadway_visual_finalize (GObject *object)
{
G_OBJECT_CLASS (gdk_broadway_visual_parent_class)->finalize (object);
}
static void
gdk_broadway_visual_class_init (GdkBroadwayVisualClass *visual_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (visual_class);
object_class->finalize = gdk_broadway_visual_finalize;
}
static void
gdk_broadway_visual_init (GdkBroadwayVisual *visual)
{
}
void
_gdk_broadway_screen_init_visuals (GdkScreen *screen)
{
GdkBroadwayScreen *broadway_screen;
GdkVisual **visuals;
int nvisuals;
g_return_if_fail (GDK_IS_SCREEN (screen));
broadway_screen = GDK_BROADWAY_SCREEN (screen);
nvisuals = 2;
visuals = g_new (GdkVisual *, nvisuals);
visuals[0] = g_object_new (GDK_TYPE_BROADWAY_VISUAL, NULL);
visuals[0]->screen = screen;
visuals[0]->type = GDK_VISUAL_TRUE_COLOR;
visuals[0]->depth = 32;
visuals[0]->byte_order = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? GDK_LSB_FIRST : GDK_MSB_FIRST;
visuals[0]->red_mask = 0xff0000;
visuals[0]->green_mask = 0xff00;
visuals[0]->blue_mask = 0xff;
visuals[0]->colormap_size = 256;
visuals[0]->bits_per_rgb = 8;
visuals[1] = g_object_new (GDK_TYPE_BROADWAY_VISUAL, NULL);
visuals[1]->screen = screen;
visuals[1]->type = GDK_VISUAL_TRUE_COLOR;
visuals[1]->depth = 24;
visuals[1]->byte_order = (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? GDK_LSB_FIRST : GDK_MSB_FIRST;
visuals[1]->red_mask = 0xff0000;
visuals[1]->green_mask = 0xff00;
visuals[1]->blue_mask = 0xff;
visuals[1]->colormap_size = 256;
visuals[1]->bits_per_rgb = 8;
broadway_screen->system_visual = visuals[1];
broadway_screen->rgba_visual = visuals[0];
broadway_screen->navailable_depths = 2;
broadway_screen->available_depths[0] = 32;
broadway_screen->available_depths[1] = 24;
broadway_screen->navailable_types = 1;
broadway_screen->available_types[0] = GDK_VISUAL_TRUE_COLOR;
broadway_screen->visuals = visuals;
broadway_screen->nvisuals = nvisuals;
}
GdkVisual *
_gdk_broadway_screen_get_system_visual (GdkScreen * screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return ((GdkVisual *) GDK_BROADWAY_SCREEN (screen)->system_visual);
}
GList *
_gdk_broadway_screen_list_visuals (GdkScreen *screen)
{
GList *list;
GdkBroadwayScreen *broadway_screen;
guint i;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
broadway_screen = GDK_BROADWAY_SCREEN (screen);
list = NULL;
for (i = 0; i < broadway_screen->nvisuals; ++i)
list = g_list_append (list, broadway_screen->visuals[i]);
return list;
}

View File

@@ -256,8 +256,7 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
GdkWindowAttr *attributes)
{
GdkWindowImplBroadway *impl;
GdkBroadwayDisplay *broadway_display;
@@ -386,11 +385,6 @@ _gdk_broadway_window_destroy (GdkWindow *window,
impl->id);
}
static void
gdk_broadway_window_destroy_foreign (GdkWindow *window)
{
}
/* This function is called when the XWindow is really gone.
*/
static void
@@ -509,26 +503,11 @@ gdk_window_broadway_move_resize (GdkWindow *window,
window->resize_count++;
}
static gboolean
gdk_window_broadway_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y)
{
return FALSE;
}
static void
gdk_window_broadway_raise (GdkWindow *window)
{
}
static void
gdk_window_broadway_restack_under (GdkWindow *window,
GList *native_siblings /* in requested order, first is bottom-most */)
{
}
static void
gdk_window_broadway_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
@@ -785,13 +764,6 @@ gdk_window_broadway_input_shape_combine_region (GdkWindow *window,
{
}
static void
gdk_broadway_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect)
{
}
static void
gdk_broadway_window_set_accept_focus (GdkWindow *window,
gboolean accept_focus)
@@ -1020,18 +992,6 @@ gdk_broadway_window_set_functions (GdkWindow *window,
return;
}
static cairo_region_t *
gdk_broadway_window_get_shape (GdkWindow *window)
{
return NULL;
}
static cairo_region_t *
gdk_broadway_window_get_input_shape (GdkWindow *window)
{
return NULL;
}
static void
gdk_broadway_window_end_paint (GdkWindow *window)
{
@@ -1297,29 +1257,13 @@ static void
create_moveresize_window (MoveResizeData *mv_resize,
guint32 timestamp)
{
GdkWindowAttr attributes;
gint attributes_mask;
GdkGrabStatus status;
GdkSeat *seat;
GdkDevice *pointer;
g_assert (mv_resize->moveresize_emulation_window == NULL);
attributes.x = -100;
attributes.y = -100;
attributes.width = 10;
attributes.height = 10;
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_ONLY;
attributes.override_redirect = TRUE;
attributes.event_mask = 0;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
mv_resize->moveresize_emulation_window =
gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (mv_resize->display)),
&attributes,
attributes_mask);
mv_resize->moveresize_emulation_window = gdk_window_new_temp (mv_resize->display);
gdk_window_show (mv_resize->moveresize_emulation_window);
@@ -1515,16 +1459,6 @@ gdk_broadway_window_set_opacity (GdkWindow *window,
opacity = 1;
}
void
_gdk_broadway_display_before_process_all_updates (GdkDisplay *display)
{
}
void
_gdk_broadway_display_after_process_all_updates (GdkDisplay *display)
{
}
guint32
gdk_broadway_get_last_seen_time (GdkWindow *window)
{
@@ -1550,10 +1484,8 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->get_events = gdk_window_broadway_get_events;
impl_class->raise = gdk_window_broadway_raise;
impl_class->lower = gdk_window_broadway_lower;
impl_class->restack_under = gdk_window_broadway_restack_under;
impl_class->restack_toplevel = gdk_window_broadway_restack_toplevel;
impl_class->move_resize = gdk_window_broadway_move_resize;
impl_class->reparent = gdk_window_broadway_reparent;
impl_class->set_device_cursor = gdk_window_broadway_set_device_cursor;
impl_class->get_geometry = gdk_window_broadway_get_geometry;
impl_class->get_root_coords = gdk_window_broadway_get_root_coords;
@@ -1561,9 +1493,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
impl_class->destroy = _gdk_broadway_window_destroy;
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
impl_class->get_shape = gdk_broadway_window_get_shape;
impl_class->get_input_shape = gdk_broadway_window_get_input_shape;
impl_class->end_paint = gdk_broadway_window_end_paint;
impl_class->beep = gdk_broadway_window_beep;
@@ -1580,7 +1509,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->set_startup_id = gdk_broadway_window_set_startup_id;
impl_class->set_transient_for = gdk_broadway_window_set_transient_for;
impl_class->get_frame_extents = gdk_broadway_window_get_frame_extents;
impl_class->set_override_redirect = gdk_broadway_window_set_override_redirect;
impl_class->set_accept_focus = gdk_broadway_window_set_accept_focus;
impl_class->set_focus_on_map = gdk_broadway_window_set_focus_on_map;
impl_class->set_icon_list = gdk_broadway_window_set_icon_list;

View File

@@ -1,202 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gdkcolor.h"
#include "gdkscreen.h"
#include "gdkinternals.h"
#include <time.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* SECTION:colors
* @Short_description: Manipulation of colors
* @Title: Colors
*
* A #GdkColor represents a color.
*
* When working with cairo, it is often more convenient
* to use a #GdkRGBA instead, and #GdkColor has been
* deprecated in favor of #GdkRGBA.
*/
/**
* gdk_color_copy:
* @color: a #GdkColor
*
* Makes a copy of a #GdkColor.
*
* The result must be freed using gdk_color_free().
*
* Returns: a copy of @color
*
* Deprecated: 3.14: Use #GdkRGBA
*/
GdkColor*
gdk_color_copy (const GdkColor *color)
{
GdkColor *new_color;
g_return_val_if_fail (color != NULL, NULL);
new_color = g_slice_new (GdkColor);
*new_color = *color;
return new_color;
}
/**
* gdk_color_free:
* @color: a #GdkColor
*
* Frees a #GdkColor created with gdk_color_copy().
*
* Deprecated: 3.14: Use #GdkRGBA
*/
void
gdk_color_free (GdkColor *color)
{
g_return_if_fail (color != NULL);
g_slice_free (GdkColor, color);
}
/**
* gdk_color_hash:
* @color: a #GdkColor
*
* A hash function suitable for using for a hash
* table that stores #GdkColors.
*
* Returns: The hash function applied to @color
*
* Deprecated: 3.14: Use #GdkRGBA
*/
guint
gdk_color_hash (const GdkColor *color)
{
return ((color->red) +
(color->green << 11) +
(color->blue << 22) +
(color->blue >> 6));
}
/**
* gdk_color_equal:
* @colora: a #GdkColor
* @colorb: another #GdkColor
*
* Compares two colors.
*
* Returns: %TRUE if the two colors compare equal
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb)
{
g_return_val_if_fail (colora != NULL, FALSE);
g_return_val_if_fail (colorb != NULL, FALSE);
return ((colora->red == colorb->red) &&
(colora->green == colorb->green) &&
(colora->blue == colorb->blue));
}
G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
gdk_color_copy,
gdk_color_free)
/**
* gdk_color_parse:
* @spec: the string specifying the color
* @color: (out): the #GdkColor to fill in
*
* Parses a textual specification of a color and fill in the
* @red, @green, and @blue fields of a #GdkColor.
*
* The string can either one of a large set of standard names
* (taken from the X11 `rgb.txt` file), or it can be a hexadecimal
* value in the form “\#rgb” “\#rrggbb”, “\#rrrgggbbb” or
* “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits of
* the red, green, and blue components of the color, respectively.
* (White in the four forms is “\#fff”, “\#ffffff”, “\#fffffffff”
* and “\#ffffffffffff”).
*
* Returns: %TRUE if the parsing succeeded
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_parse (const gchar *spec,
GdkColor *color)
{
PangoColor pango_color;
if (pango_color_parse (&pango_color, spec))
{
color->red = pango_color.red;
color->green = pango_color.green;
color->blue = pango_color.blue;
return TRUE;
}
else
return FALSE;
}
/**
* gdk_color_to_string:
* @color: a #GdkColor
*
* Returns a textual specification of @color in the hexadecimal
* form “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits
* representing the red, green and blue components respectively.
*
* The returned string can be parsed by gdk_color_parse().
*
* Returns: a newly-allocated text string
*
* Since: 2.12
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gchar *
gdk_color_to_string (const GdkColor *color)
{
PangoColor pango_color;
g_return_val_if_fail (color != NULL, NULL);
pango_color.red = color->red;
pango_color.green = color->green;
pango_color.blue = color->blue;
return pango_color_to_string (&pango_color);
}

View File

@@ -1,87 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_COLOR_H__
#define __GDK_COLOR_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <cairo.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/**
* GdkColor:
* @pixel: For allocated colors, the pixel value used to
* draw this color on the screen. Not used anymore.
* @red: The red component of the color. This is
* a value between 0 and 65535, with 65535 indicating
* full intensity
* @green: The green component of the color
* @blue: The blue component of the color
*
* A #GdkColor is used to describe a color,
* similar to the XColor struct used in the X11 drawing API.
*
* Deprecated: 3.14: Use #GdkRGBA
*/
struct _GdkColor
{
guint32 pixel;
guint16 red;
guint16 green;
guint16 blue;
};
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_get_type)
GType gdk_color_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_copy)
GdkColor *gdk_color_copy (const GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_free)
void gdk_color_free (GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_hash)
guint gdk_color_hash (const GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_equal)
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_parse)
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_to_string)
gchar * gdk_color_to_string (const GdkColor *color);
G_END_DECLS
#endif /* __GDK_COLOR_H__ */

View File

@@ -1,22 +0,0 @@
#include "config.h"
#include "gdk-private.h"
GdkPrivateVTable *
gdk__private__ (void)
{
static GdkPrivateVTable table = {
gdk_device_grab_info,
gdk_display_open_default,
gdk_add_option_entries,
gdk_pre_parse,
gdk_gl_get_flags,
gdk_gl_set_flags,
gdk_window_freeze_toplevel_updates,
gdk_window_thaw_toplevel_updates,
gdk_display_get_rendering_mode,
gdk_display_set_rendering_mode,
gdk_window_move_to_rect
};
return &table;
}

View File

@@ -4,8 +4,6 @@
#include <gdk/gdk.h>
#include "gdk/gdkinternals.h"
#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
GdkDisplay * gdk_display_open_default (void);
gboolean gdk_device_grab_info (GdkDisplay *display,
@@ -35,38 +33,4 @@ void gdk_window_move_to_rect (GdkWindow *window,
gint rect_anchor_dx,
gint rect_anchor_dy);
typedef struct {
/* add all private functions here, initialize them in gdk-private.c */
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
gboolean *owner_events);
GdkDisplay *(* gdk_display_open_default) (void);
void (* gdk_add_option_entries) (GOptionGroup *group);
void (* gdk_pre_parse) (void);
GdkGLFlags (* gdk_gl_get_flags) (void);
void (* gdk_gl_set_flags) (GdkGLFlags flags);
void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window);
void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window);
GdkRenderingMode (* gdk_display_get_rendering_mode) (GdkDisplay *display);
void (* gdk_display_set_rendering_mode) (GdkDisplay *display,
GdkRenderingMode mode);
void (* gdk_window_move_to_rect) (GdkWindow *window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity window_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy);
} GdkPrivateVTable;
GDK_AVAILABLE_IN_ALL
GdkPrivateVTable * gdk__private__ (void);
#endif /* __GDK__PRIVATE_H__ */

208
gdk/gdk.c
View File

@@ -150,6 +150,11 @@ static const GDebugKey gdk_gl_keys[] = {
{ "gles", GDK_GL_GLES },
};
static const GDebugKey gdk_vulkan_keys[] = {
{ "disable", GDK_VULKAN_DISABLE },
{ "validate", GDK_VULKAN_VALIDATE },
};
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
{ "events", GDK_DEBUG_EVENTS },
@@ -165,95 +170,10 @@ static const GDebugKey gdk_debug_keys[] = {
{ "eventloop", GDK_DEBUG_EVENTLOOP },
{ "frames", GDK_DEBUG_FRAMES },
{ "settings", GDK_DEBUG_SETTINGS },
{ "opengl", GDK_DEBUG_OPENGL }
{ "opengl", GDK_DEBUG_OPENGL },
{ "vulkan", GDK_DEBUG_VULKAN }
};
static gboolean
gdk_arg_debug_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
guint debug_value = g_parse_debug_string (value,
(GDebugKey *) gdk_debug_keys,
G_N_ELEMENTS (gdk_debug_keys));
if (debug_value == 0 && value != NULL && strcmp (value, "") != 0)
{
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-debug"));
return FALSE;
}
_gdk_debug_flags |= debug_value;
return TRUE;
}
static gboolean
gdk_arg_no_debug_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
guint debug_value = g_parse_debug_string (value,
(GDebugKey *) gdk_debug_keys,
G_N_ELEMENTS (gdk_debug_keys));
if (debug_value == 0 && value != NULL && strcmp (value, "") != 0)
{
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option --gdk-no-debug"));
return FALSE;
}
_gdk_debug_flags &= ~debug_value;
return TRUE;
}
#endif /* G_ENABLE_DEBUG */
static gboolean
gdk_arg_class_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
gdk_set_program_class (value);
gdk_progclass_overridden = TRUE;
return TRUE;
}
static gboolean
gdk_arg_name_cb (const char *key, const char *value, gpointer user_data, GError **error)
{
g_set_prgname (value);
return TRUE;
}
static const GOptionEntry gdk_args[] = {
{ "class", 0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_class_cb,
/* Description of --class=CLASS in --help output */ N_("Program class as used by the window manager"),
/* Placeholder in --class=CLASS in --help output */ N_("CLASS") },
{ "name", 0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_name_cb,
/* Description of --name=NAME in --help output */ N_("Program name as used by the window manager"),
/* Placeholder in --name=NAME in --help output */ N_("NAME") },
#ifndef G_OS_WIN32
{ "display", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &_gdk_display_name,
/* Description of --display=DISPLAY in --help output */ N_("X display to use"),
/* Placeholder in --display=DISPLAY in --help output */ N_("DISPLAY") },
#endif
#ifdef G_ENABLE_DEBUG
{ "gdk-debug", 0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_debug_cb,
/* Description of --gdk-debug=FLAGS in --help output */ N_("GDK debugging flags to set"),
/* Placeholder in --gdk-debug=FLAGS in --help output */ N_("FLAGS") },
{ "gdk-no-debug", 0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_no_debug_cb,
/* Description of --gdk-no-debug=FLAGS in --help output */ N_("GDK debugging flags to unset"),
/* Placeholder in --gdk-no-debug=FLAGS in --help output */ N_("FLAGS") },
#endif
{ NULL }
};
void
gdk_add_option_entries (GOptionGroup *group)
{
g_option_group_add_entries (group, gdk_args);
}
static gpointer
register_resources (gpointer dummy G_GNUC_UNUSED)
@@ -275,7 +195,7 @@ void
gdk_pre_parse (void)
{
const char *rendering_mode;
const gchar *gl_string;
const gchar *gl_string, *vulkan_string;
gdk_initialized = TRUE;
@@ -304,12 +224,11 @@ gdk_pre_parse (void)
(GDebugKey *) gdk_gl_keys,
G_N_ELEMENTS (gdk_gl_keys));
if (getenv ("GDK_NATIVE_WINDOWS"))
{
g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"
"See the documentation for gdk_window_ensure_native() on how to get native windows.");
g_unsetenv ("GDK_NATIVE_WINDOWS");
}
vulkan_string = getenv("GDK_VULKAN");
if (vulkan_string != NULL)
_gdk_vulkan_flags = g_parse_debug_string (vulkan_string,
(GDebugKey *) gdk_vulkan_keys,
G_N_ELEMENTS (gdk_vulkan_keys));
rendering_mode = g_getenv ("GDK_RENDERING");
if (rendering_mode)
@@ -323,53 +242,6 @@ gdk_pre_parse (void)
}
}
/**
* gdk_parse_args:
* @argc: the number of command line arguments.
* @argv: (inout) (array length=argc): the array of command line arguments.
*
* Parse command line arguments, and store for future
* use by calls to gdk_display_open().
*
* Any arguments used by GDK are removed from the array and @argc and @argv are
* updated accordingly.
*
* You shouldnt call this function explicitly if you are using
* gtk_init(), gtk_init_check(), gdk_init(), or gdk_init_check().
*
* Since: 2.2
**/
void
gdk_parse_args (int *argc,
char ***argv)
{
GOptionContext *option_context;
GOptionGroup *option_group;
GError *error = NULL;
if (gdk_initialized)
return;
gdk_pre_parse ();
option_context = g_option_context_new (NULL);
g_option_context_set_ignore_unknown_options (option_context, TRUE);
g_option_context_set_help_enabled (option_context, FALSE);
option_group = g_option_group_new (NULL, NULL, NULL, NULL, NULL);
g_option_context_set_main_group (option_context, option_group);
g_option_group_add_entries (option_group, gdk_args);
if (!g_option_context_parse (option_context, argc, argv, &error))
{
g_warning ("%s", error->message);
g_error_free (error);
}
g_option_context_free (option_context);
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
}
/**
* gdk_get_display_arg_name:
*
@@ -419,60 +291,6 @@ gdk_display_open_default (void)
return display;
}
/**
* gdk_init_check:
* @argc: (inout): the number of command line arguments.
* @argv: (array length=argc) (inout): the array of command line arguments.
*
* Initializes the GDK library and connects to the windowing system,
* returning %TRUE on success.
*
* Any arguments used by GDK are removed from the array and @argc and @argv
* are updated accordingly.
*
* GTK+ initializes GDK in gtk_init() and so this function is not usually
* needed by GTK+ applications.
*
* Returns: %TRUE if initialization succeeded.
*/
gboolean
gdk_init_check (int *argc,
char ***argv)
{
gdk_parse_args (argc, argv);
return gdk_display_open_default () != NULL;
}
/**
* gdk_init:
* @argc: (inout): the number of command line arguments.
* @argv: (array length=argc) (inout): the array of command line arguments.
*
* Initializes the GDK library and connects to the windowing system.
* If initialization fails, a warning message is output and the application
* terminates with a call to `exit(1)`.
*
* Any arguments used by GDK are removed from the array and @argc and @argv
* are updated accordingly.
*
* GTK+ initializes GDK in gtk_init() and so this function is not usually
* needed by GTK+ applications.
*/
void
gdk_init (int *argc, char ***argv)
{
if (!gdk_init_check (argc, argv))
{
const char *display_name = gdk_get_display_arg_name ();
g_warning ("cannot open display: %s", display_name ? display_name : "");
exit(1);
}
}
/**
* SECTION:threads
* @Short_description: Functions for using GDK in multi-threaded programs

View File

@@ -39,6 +39,7 @@
#include <gdk/gdkdisplay.h>
#include <gdk/gdkdisplaymanager.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdrawcontext.h>
#include <gdk/gdkdrawingcontext.h>
#include <gdk/gdkenumtypes.h>
#include <gdk/gdkevents.h>
@@ -61,12 +62,9 @@
#include <gdk/gdkthreads.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkvisual.h>
#include <gdk/gdkvulkancontext.h>
#include <gdk/gdkwindow.h>
#ifndef GDK_DISABLE_DEPRECATED
#include <gdk/deprecated/gdkcolor.h>
#endif
#include <gdk/gdk-autocleanup.h>
#undef __GDK_H_INSIDE__

View File

@@ -151,7 +151,7 @@ gdk_cairo_region (cairo_t *cr,
}
}
static void
void
gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
const GdkPixbuf *pixbuf)
{
@@ -198,7 +198,9 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
q[0] = p[2];
q[1] = p[1];
q[2] = p[0];
q[3] = 0xFF;
#else
q[0] = 0xFF;
q[1] = p[0];
q[2] = p[1];
q[3] = p[2];
@@ -323,40 +325,6 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
cairo_surface_destroy (surface);
}
/**
* gdk_cairo_set_source_window:
* @cr: a cairo context
* @window: a #GdkWindow
* @x: X coordinate of location to place upper left corner of @window
* @y: Y coordinate of location to place upper left corner of @window
*
* Sets the given window as the source pattern for @cr.
*
* The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
* so that the origin of @window is @x, @y. The window contains all its
* subwindows when rendering.
*
* Note that the contents of @window are undefined outside of the
* visible part of @window, so use this function with care.
*
* Since: 2.24
*/
void
gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
gdouble x,
gdouble y)
{
cairo_surface_t *surface;
g_return_if_fail (cr != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
surface = _gdk_window_ref_cairo_surface (window);
cairo_set_source_surface (cr, surface, x, y);
cairo_surface_destroy (surface);
}
/*
* _gdk_cairo_surface_extents:
* @surface: surface to measure

View File

@@ -23,7 +23,6 @@
#endif
#include <gdk/gdkversionmacros.h>
#include <gdk/deprecated/gdkcolor.h>
#include <gdk/gdkrgba.h>
#include <gdk/gdkdrawingcontext.h>
#include <gdk/gdkpixbuf.h>
@@ -43,11 +42,6 @@ void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
gdouble pixbuf_x,
gdouble pixbuf_y);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
gdouble x,
gdouble y);
GDK_AVAILABLE_IN_ALL
void gdk_cairo_rectangle (cairo_t *cr,

View File

@@ -24,6 +24,7 @@
#include "gdkdisplay.h"
#include "gdkdisplayprivate.h"
#include "gdkintl.h"
#include "gdk-private.h"
#include "gdkdeviceprivate.h"
@@ -66,6 +67,15 @@
* gdk_display_get_device_manager().
*/
enum
{
PROP_0,
PROP_COMPOSITED,
PROP_RGBA,
LAST_PROP
};
static GParamSpec *props[LAST_PROP] = { NULL, };
enum {
OPENED,
@@ -89,6 +99,29 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
static void
gdk_display_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GdkDisplay *display = GDK_DISPLAY (object);
switch (prop_id)
{
case PROP_COMPOSITED:
g_value_set_boolean (value, gdk_display_is_composited (display));
break;
case PROP_RGBA:
g_value_set_boolean (value, gdk_display_is_rgba (display));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
gdk_display_real_make_default (GdkDisplay *display)
{
@@ -156,6 +189,7 @@ gdk_display_class_init (GdkDisplayClass *class)
object_class->finalize = gdk_display_finalize;
object_class->dispose = gdk_display_dispose;
object_class->get_property = gdk_display_get_property;
class->get_app_launch_context = gdk_display_real_get_app_launch_context;
class->window_type = GDK_TYPE_WINDOW;
@@ -168,6 +202,38 @@ gdk_display_class_init (GdkDisplayClass *class)
class->get_primary_monitor = gdk_display_real_get_primary_monitor;
/**
* GdkDisplay:composited:
*
* %TRUE if the display properly composits the alpha channel.
* See gdk_display_is_composited() for details.
*
* Since: 3.90
*/
props[PROP_COMPOSITED] =
g_param_spec_boolean ("composited",
P_("Composited"),
P_("Composited"),
TRUE,
G_PARAM_READABLE);
/**
* GdkDisplay:rgba:
*
* %TRUE if the display supports an alpha channel. See gdk_display_is_rgba()
* for details.
*
* Since: 3.90
*/
props[PROP_RGBA] =
g_param_spec_boolean ("rgba",
P_("RGBA"),
P_("RGBA"),
TRUE,
G_PARAM_READABLE);
g_object_class_install_properties (object_class, LAST_PROP, props);
/**
* GdkDisplay::opened:
* @display: the object on which the signal is emitted
@@ -324,6 +390,9 @@ gdk_display_init (GdkDisplay *display)
(GDestroyNotify) g_free);
display->rendering_mode = _gdk_rendering_mode;
display->composited = TRUE;
display->rgba = TRUE;
}
static void
@@ -1862,16 +1931,14 @@ _gdk_display_create_window_impl (GdkDisplay *display,
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask)
GdkWindowAttr *attributes)
{
GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display,
window,
real_parent,
screen,
event_mask,
attributes,
attributes_mask);
attributes);
}
GdkWindow *
@@ -2068,6 +2135,94 @@ gdk_display_set_rendering_mode (GdkDisplay *display,
display->rendering_mode = mode;
}
/**
* gdk_display_is_composited:
* @display: a #GdkDisplay
*
* Returns whether windows can reasonably be expected to have
* their alpha channel drawn correctly on the screen. Check
* gdk_display_is_rgba() for wether the display supports an
* alpha channel.
*
* On X11 this function returns whether a compositing manager is
* compositing on @display.
*
* On modern displays, this value is always %TRUE.
*
* Returns: Whether windows with RGBA visuals can reasonably be
* expected to have their alpha channels drawn correctly on the screen.
*
* Since: 3.90
**/
gboolean
gdk_display_is_composited (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
return display->composited;
}
void
gdk_display_set_composited (GdkDisplay *display,
gboolean composited)
{
g_return_if_fail (GDK_IS_DISPLAY (display));
if (display->composited == composited)
return;
display->composited = composited;
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_COMPOSITED]);
}
/**
* gdk_display_is_rgba:
* @display: a #GdkDisplay
*
* Returns wether windows on this @display are created with an
* alpha channel.
*
* Even if a %TRUE is returned, it is possible that the
* windows alpha channel wont be honored when displaying the
* window on the screen: in particular, for X an appropriate
* windowing manager and compositing manager must be running to
* provide appropriate display. Use gdk_display_is_composited()
* to check if that is the case.
*
* For setting an overall opacity for a top-level window, see
* gdk_window_set_opacity().
*
* On modern displays, this value is always %TRUE.
*
* Returns: %TRUE if windows are created with an alpha channel or
* %FALSE if the display does not support this functionality.
*
* Since: 3.90
**/
gboolean
gdk_display_is_rgba (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
return display->rgba;
}
void
gdk_display_set_rgba (GdkDisplay *display,
gboolean rgba)
{
g_return_if_fail (GDK_IS_DISPLAY (display));
if (display->rgba == rgba)
return;
display->rgba = rgba;
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_RGBA]);
}
void
gdk_display_add_seat (GdkDisplay *display,
GdkSeat *seat)

View File

@@ -65,6 +65,11 @@ void gdk_display_close (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
gboolean gdk_display_is_closed (GdkDisplay *display);
GDK_AVAILABLE_IN_3_90
gboolean gdk_display_is_composited (GdkDisplay *display);
GDK_AVAILABLE_IN_3_90
gboolean gdk_display_is_rgba (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
GdkEvent* gdk_display_get_event (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL

View File

@@ -24,6 +24,10 @@
#include "gdkmonitor.h"
#include "gdkinternals.h"
#ifdef GDK_RENDERING_VULKAN
#include <vulkan/vulkan.h>
#endif
G_BEGIN_DECLS
#define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
@@ -120,8 +124,18 @@ struct _GdkDisplay
guint double_click_time; /* Maximum time between clicks in msecs */
guint double_click_distance; /* Maximum distance between clicks in pixels */
guint has_gl_extension_texture_non_power_of_two : 1;
guint has_gl_extension_texture_rectangle : 1;
#ifdef GDK_RENDERING_VULKAN
VkInstance vk_instance;
VkDebugReportCallbackEXT vk_debug_callback;
VkPhysicalDevice vk_physical_device;
VkDevice vk_device;
VkQueue vk_queue;
uint32_t vk_queue_family_index;
guint vulkan_refcount;
#endif /* GDK_RENDERING_VULKAN */
guint rgba : 1;
guint composited : 1;
GdkRenderingMode rendering_mode;
@@ -133,6 +147,8 @@ struct _GdkDisplayClass
GObjectClass parent_class;
GType window_type; /* type for native windows for this display, set in class_init */
GType vk_context_type; /* type for GdkVulkanContext, must be set if vk_extension_name != NULL */
const char *vk_extension_name; /* Name of required windowing vulkan extension or %NULL (default) if Vulkan isn't supported */
const gchar * (*get_name) (GdkDisplay *display);
GdkScreen * (*get_default_screen) (GdkDisplay *display);
@@ -175,9 +191,6 @@ struct _GdkDisplayClass
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
void (*before_process_all_updates) (GdkDisplay *display);
void (*after_process_all_updates) (GdkDisplay *display);
gulong (*get_next_serial) (GdkDisplay *display);
void (*notify_startup_complete) (GdkDisplay *display,
@@ -192,8 +205,7 @@ struct _GdkDisplayClass
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindowAttr *attributes);
GdkKeymap * (*get_keymap) (GdkDisplay *display);
void (*push_error_trap) (GdkDisplay *display);
@@ -321,13 +333,17 @@ void _gdk_display_create_window_impl (GdkDisplay *display
GdkWindow *real_parent,
GdkScreen *screen,
GdkEventMask event_mask,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindowAttr *attributes);
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);
void gdk_display_set_rgba (GdkDisplay *display,
gboolean rgba);
void gdk_display_set_composited (GdkDisplay *display,
gboolean composited);
void gdk_display_add_seat (GdkDisplay *display,
GdkSeat *seat);
void gdk_display_remove_seat (GdkDisplay *display,

284
gdk/gdkdrawcontext.c Normal file
View File

@@ -0,0 +1,284 @@
/* GDK - The GIMP Drawing Kit
*
* gdkdrawcontext.c: base class for rendering system support
*
* Copyright © 2016 Benjamin Otte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gdkdrawcontextprivate.h"
#include "gdkinternals.h"
#include "gdkintl.h"
/**
* SECTION:gdkdrawcontext
* @Title: GdkDrawContext
* @Short_description: Drawing context base class
*
* #GdkDrawContext is the base object used by contexts implementing different
* rendering methods, such as #GdkGLContext or #GdkVulkanContext. It provides
* shared functionality between those contexts.
*
* You will always interact with one of those subclasses.
*/
typedef struct _GdkDrawContextPrivate GdkDrawContextPrivate;
struct _GdkDrawContextPrivate {
GdkWindow *window;
guint is_drawing : 1;
};
enum {
PROP_0,
PROP_DISPLAY,
PROP_WINDOW,
LAST_PROP
};
static GParamSpec *pspecs[LAST_PROP] = { NULL, };
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkDrawContext, gdk_draw_context, G_TYPE_OBJECT)
static void
gdk_draw_context_dispose (GObject *gobject)
{
GdkDrawContext *context = GDK_DRAW_CONTEXT (gobject);
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
g_clear_object (&priv->window);
G_OBJECT_CLASS (gdk_draw_context_parent_class)->dispose (gobject);
}
static void
gdk_draw_context_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GdkDrawContext *context = GDK_DRAW_CONTEXT (gobject);
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
switch (prop_id)
{
case PROP_WINDOW:
priv->window = g_value_dup_object (value);
g_assert (priv->window != NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
}
static void
gdk_draw_context_get_property (GObject *gobject,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GdkDrawContext *context = GDK_DRAW_CONTEXT (gobject);
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
switch (prop_id)
{
case PROP_DISPLAY:
g_value_set_object (value, gdk_draw_context_get_display (context));
break;
case PROP_WINDOW:
g_value_set_object (value, priv->window);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
}
static void
gdk_draw_context_class_init (GdkDrawContextClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = gdk_draw_context_set_property;
gobject_class->get_property = gdk_draw_context_get_property;
gobject_class->dispose = gdk_draw_context_dispose;
/**
* GdkDrawContext:display:
*
* The #GdkDisplay used to create the #GdkDrawContext.
*
* Since: 3.90
*/
pspecs[PROP_DISPLAY] =
g_param_spec_object ("display",
P_("Display"),
P_("The GDK display used to create the context"),
GDK_TYPE_DISPLAY,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
/**
* GdkDrawContext:window:
*
* The #GdkWindow the gl context is bound to.
*
* Since: 3.90
*/
pspecs[PROP_WINDOW] =
g_param_spec_object ("window",
P_("Window"),
P_("The GDK window bound to the context"),
GDK_TYPE_WINDOW,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, LAST_PROP, pspecs);
}
static void
gdk_draw_context_init (GdkDrawContext *self)
{
}
/*< private >
* gdk_draw_context_is_drawing:
* @context: a #GdkDrawContext
*
* Returns %TRUE if @context is in the process of drawing to its window. In such
* cases, it will have access to the window's backbuffer to render the new frame
* onto it.
*
* Returns: %TRUE if the context is between begin_frame() and end_frame() calls.
*
* Since: 3.90
*/
gboolean
gdk_draw_context_is_drawing (GdkDrawContext *context)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
return priv->is_drawing;
}
/*< private >
* gdk_draw_context_begin_frame:
* @context: a #GdkDrawContext
* @region: (inout): The clip region that needs to be repainted
*
* Sets up @context and @drawing for a new drawing.
*
* The @context is free to update @region to the size that actually needs to
* be repainted. Contexts that do not support partial blits for example may
* want to invalidate the whole window instead.
*
* The function does not clear the background. Clearing the backgroud is the
* job of the renderer. The contents of the backbuffer are undefined after this
* function call.
*
* Since: 3.90
*/
void
gdk_draw_context_begin_frame (GdkDrawContext *context,
cairo_region_t *region)
{
GdkDrawContextPrivate *priv;
g_return_if_fail (GDK_IS_DRAW_CONTEXT (context));
g_return_if_fail (region != NULL);
priv = gdk_draw_context_get_instance_private (context);
priv->is_drawing = TRUE;
GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, region);
}
/*< private >
* gdk_draw_context_end_frame:
* @context: a #GdkDrawContext
* @painted: The area that has been redrawn this frame
* @damage: The area that we know is actually different from the last frame
*
* Copies the back buffer to the front buffer.
*
* This function may call `glFlush()` implicitly before returning; it
* is not recommended to call `glFlush()` explicitly before calling
* this function.
*
* Since: 3.16
*/
void
gdk_draw_context_end_frame (GdkDrawContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
GdkDrawContextPrivate *priv;
g_return_if_fail (GDK_IS_DRAW_CONTEXT (context));
GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, painted, damage);
priv = gdk_draw_context_get_instance_private (context);
priv->is_drawing = FALSE;
}
/**
* gdk_draw_context_get_display:
* @context: a #GdkDrawContext
*
* Retrieves the #GdkDisplay the @context is created for
*
* Returns: (nullable) (transfer none): a #GdkDisplay or %NULL
*
* Since: 3.90
*/
GdkDisplay *
gdk_draw_context_get_display (GdkDrawContext *context)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
return priv->window ? gdk_window_get_display (priv->window) : NULL;
}
/**
* gdk_draw_context_get_window:
* @context: a #GdkDrawContext
*
* Retrieves the #GdkWindow used by the @context.
*
* Returns: (nullable) (transfer none): a #GdkWindow or %NULL
*
* Since: 3.90
*/
GdkWindow *
gdk_draw_context_get_window (GdkDrawContext *context)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
return priv->window;
}

47
gdk/gdkdrawcontext.h Normal file
View File

@@ -0,0 +1,47 @@
/* GDK - The GIMP Drawing Kit
*
* gdkdrawcontext.h: base class for rendering system support
*
* Copyright © 2016 Benjamin Otte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DRAW_CONTEXT__
#define __GDK_DRAW_CONTEXT__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
G_BEGIN_DECLS
#define GDK_TYPE_DRAW_CONTEXT (gdk_draw_context_get_type ())
#define GDK_DRAW_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_DRAW_CONTEXT, GdkDrawContext))
#define GDK_IS_DRAW_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_DRAW_CONTEXT))
GDK_AVAILABLE_IN_3_90
GType gdk_draw_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_90
GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context);
GDK_AVAILABLE_IN_3_90
GdkWindow * gdk_draw_context_get_window (GdkDrawContext *context);
G_END_DECLS
#endif /* __GDK_DRAW_CONTEXT__ */

View File

@@ -0,0 +1,59 @@
/* GDK - The GIMP Drawing Kit
*
* gdkdrawcontext.h: base class for rendering system support
*
* Copyright © 2016 Benjamin Otte
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DRAW_CONTEXT_PRIVATE__
#define __GDK_DRAW_CONTEXT_PRIVATE__
#include "gdkdrawcontext.h"
G_BEGIN_DECLS
#define GDK_DRAW_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAW_CONTEXT, GdkDrawContextClass))
#define GDK_IS_DRAW_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAW_CONTEXT))
#define GDK_DRAW_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAW_CONTEXT, GdkDrawContextClass))
typedef struct _GdkDrawContextClass GdkDrawContextClass;
struct _GdkDrawContext
{
GObject parent_instance;
};
struct _GdkDrawContextClass
{
GObjectClass parent_class;
void (* begin_frame) (GdkDrawContext *context,
cairo_region_t *update_area);
void (* end_frame) (GdkDrawContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
};
gboolean gdk_draw_context_is_drawing (GdkDrawContext *context);
void gdk_draw_context_begin_frame (GdkDrawContext *context,
cairo_region_t *region);
void gdk_draw_context_end_frame (GdkDrawContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
G_END_DECLS
#endif /* __GDK__DRAW_CONTEXT_PRIVATE__ */

View File

@@ -46,13 +46,24 @@
#include "gdkglcontextprivate.h"
#include "gdk-private.h"
G_DEFINE_TYPE (GdkDrawingContext, gdk_drawing_context, G_TYPE_OBJECT)
typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate;
struct _GdkDrawingContextPrivate {
GdkWindow *window;
GdkDrawContext *paint_context;
cairo_region_t *clip;
cairo_t *cr;
};
G_DEFINE_TYPE_WITH_PRIVATE (GdkDrawingContext, gdk_drawing_context, G_TYPE_OBJECT)
enum {
PROP_0,
PROP_WINDOW,
PROP_CLIP,
PROP_PAINT_CONTEXT,
N_PROPS
};
@@ -63,16 +74,18 @@ static void
gdk_drawing_context_dispose (GObject *gobject)
{
GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject);
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self);
/* Unset the drawing context, in case somebody is holding
* onto the Cairo context
*/
if (self->cr != NULL)
gdk_cairo_set_drawing_context (self->cr, NULL);
if (priv->cr != NULL)
gdk_cairo_set_drawing_context (priv->cr, NULL);
g_clear_object (&self->window);
g_clear_pointer (&self->clip, cairo_region_destroy);
g_clear_pointer (&self->cr, cairo_destroy);
g_clear_object (&priv->window);
g_clear_object (&priv->paint_context);
g_clear_pointer (&priv->clip, cairo_region_destroy);
g_clear_pointer (&priv->cr, cairo_destroy);
G_OBJECT_CLASS (gdk_drawing_context_parent_class)->dispose (gobject);
}
@@ -84,15 +97,27 @@ gdk_drawing_context_set_property (GObject *gobject,
GParamSpec *pspec)
{
GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject);
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self);
switch (prop_id)
{
case PROP_WINDOW:
self->window = g_value_dup_object (value);
priv->window = g_value_dup_object (value);
if (priv->window == NULL)
{
g_critical ("The drawing context of type %s does not have a window "
"associated to it. Drawing contexts can only be created "
"using gdk_window_begin_draw_frame().",
G_OBJECT_TYPE_NAME (gobject));
return;
}
case PROP_PAINT_CONTEXT:
priv->paint_context = g_value_dup_object (value);
break;
case PROP_CLIP:
self->clip = g_value_dup_boxed (value);
priv->clip = g_value_dup_boxed (value);
break;
default:
@@ -107,15 +132,20 @@ gdk_drawing_context_get_property (GObject *gobject,
GParamSpec *pspec)
{
GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject);
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (self);
switch (prop_id)
{
case PROP_WINDOW:
g_value_set_object (value, self->window);
g_value_set_object (value, priv->window);
break;
case PROP_CLIP:
g_value_set_boxed (value, self->clip);
g_value_set_boxed (value, priv->clip);
break;
case PROP_PAINT_CONTEXT:
g_value_set_object (value, priv->paint_context);
break;
default:
@@ -123,28 +153,11 @@ gdk_drawing_context_get_property (GObject *gobject,
}
}
static void
gdk_drawing_context_constructed (GObject *gobject)
{
GdkDrawingContext *self = GDK_DRAWING_CONTEXT (gobject);
if (self->window == NULL)
{
g_critical ("The drawing context of type %s does not have a window "
"associated to it. Drawing contexts can only be created "
"using gdk_window_begin_draw_frame().",
G_OBJECT_TYPE_NAME (gobject));
}
G_OBJECT_CLASS (gdk_drawing_context_parent_class)->constructed (gobject);
}
static void
gdk_drawing_context_class_init (GdkDrawingContextClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructed = gdk_drawing_context_constructed;
gobject_class->set_property = gdk_drawing_context_set_property;
gobject_class->get_property = gdk_drawing_context_get_property;
gobject_class->dispose = gdk_drawing_context_dispose;
@@ -175,6 +188,19 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* GdkDrawingContext:paint-context:
*
* The #GdkDrawContext used to draw or %NULL if Cairo is used.
*
* Since: 3.90
*/
obj_property[PROP_PAINT_CONTEXT] =
g_param_spec_object ("paint-context", "Paint context", "The context used to draw",
GDK_TYPE_DRAW_CONTEXT,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, N_PROPS, obj_property);
}
@@ -214,10 +240,13 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
/**
* gdk_drawing_context_get_cairo_context:
* @context:
* @context: a #GdkDrawingContext created with a %NULL paint context
*
* Retrieves a Cairo context to be used to draw on the #GdkWindow
* that created the #GdkDrawingContext.
* that created the #GdkDrawingContext. The @context must have been
* created without a #GdkDrawContext for this function to work. If
* gdk_drawing_context_get_paint_context() does not return %NULL,
* then this function will.
*
* The returned context is guaranteed to be valid as long as the
* #GdkDrawingContext is valid, that is between a call to
@@ -225,36 +254,42 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
*
* Returns: (transfer none): a Cairo context to be used to draw
* the contents of the #GdkWindow. The context is owned by the
* #GdkDrawingContext and should not be destroyed
* #GdkDrawingContext and should not be destroyed. %NULL is
* returned when a paint context is in used.
*
* Since: 3.22
*/
cairo_t *
gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
{
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
g_return_val_if_fail (GDK_IS_WINDOW (context->window), NULL);
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
if (context->cr == NULL)
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
g_return_val_if_fail (GDK_IS_WINDOW (priv->window), NULL);
if (priv->paint_context != NULL)
return NULL;
if (priv->cr == NULL)
{
cairo_region_t *region;
cairo_surface_t *surface;
surface = _gdk_window_ref_cairo_surface (context->window);
context->cr = cairo_create (surface);
surface = _gdk_window_ref_cairo_surface (priv->window);
priv->cr = cairo_create (surface);
gdk_cairo_set_drawing_context (context->cr, context);
gdk_cairo_set_drawing_context (priv->cr, context);
region = gdk_window_get_current_paint_region (context->window);
cairo_region_union (region, context->clip);
gdk_cairo_region (context->cr, region);
cairo_clip (context->cr);
region = gdk_window_get_current_paint_region (priv->window);
cairo_region_union (region, priv->clip);
gdk_cairo_region (priv->cr, region);
cairo_clip (priv->cr);
cairo_region_destroy (region);
cairo_surface_destroy (surface);
}
return context->cr;
return priv->cr;
}
/**
@@ -270,9 +305,31 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
GdkWindow *
gdk_drawing_context_get_window (GdkDrawingContext *context)
{
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
return context->window;
return priv->window;
}
/**
* gdk_drawing_context_get_paint_context:
* @context: a #GdkDrawingContext
*
* Retrieves the paint context used to draw with.
*
* Returns: (transfer none): a #GdkDrawContext or %NULL
*
* Since: 3.90
*/
GdkDrawContext *
gdk_drawing_context_get_paint_context (GdkDrawingContext *context)
{
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
return priv->paint_context;
}
/**
@@ -288,12 +345,14 @@ gdk_drawing_context_get_window (GdkDrawingContext *context)
cairo_region_t *
gdk_drawing_context_get_clip (GdkDrawingContext *context)
{
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
if (context->clip == NULL)
if (priv->clip == NULL)
return NULL;
return cairo_region_copy (context->clip);
return cairo_region_copy (priv->clip);
}
/**
@@ -309,12 +368,14 @@ gdk_drawing_context_get_clip (GdkDrawingContext *context)
gboolean
gdk_drawing_context_is_valid (GdkDrawingContext *context)
{
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), FALSE);
if (context->window == NULL)
if (priv->window == NULL)
return FALSE;
if (gdk_window_get_drawing_context (context->window) != context)
if (gdk_window_get_drawing_context (priv->window) != context)
return FALSE;
return TRUE;

View File

@@ -31,7 +31,6 @@ G_BEGIN_DECLS
#define GDK_DRAWING_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContext))
#define GDK_IS_DRAWING_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_DRAWING_CONTEXT))
typedef struct _GdkDrawingContext GdkDrawingContext;
typedef struct _GdkDrawingContextClass GdkDrawingContextClass;
GDK_AVAILABLE_IN_3_22
@@ -39,6 +38,8 @@ GType gdk_drawing_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_22
GdkWindow * gdk_drawing_context_get_window (GdkDrawingContext *context);
GDK_AVAILABLE_IN_3_90
GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context);
GDK_AVAILABLE_IN_3_22
cairo_region_t *gdk_drawing_context_get_clip (GdkDrawingContext *context);

View File

@@ -12,11 +12,6 @@ G_BEGIN_DECLS
struct _GdkDrawingContext
{
GObject parent_instance;
GdkWindow *window;
cairo_region_t *clip;
cairo_t *cr;
};
struct _GdkDrawingContextClass

View File

@@ -340,18 +340,11 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
GdkGLContext *paint_context;
cairo_surface_t *image;
cairo_matrix_t matrix;
int dx, dy, window_scale;
gboolean trivial_transform;
cairo_surface_t *group_target;
GdkWindow *direct_window, *impl_window;
guint framebuffer;
int alpha_size = 0;
cairo_region_t *clip_region;
GdkGLContextPaintData *paint_data;
impl_window = window->impl_window;
window_scale = gdk_window_get_scale_factor (impl_window);
int major, minor, version;
paint_context = gdk_window_get_paint_gl_context (window, NULL);
if (paint_context == NULL)
@@ -388,324 +381,71 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
return;
}
group_target = cairo_get_group_target (cr);
direct_window = cairo_surface_get_user_data (group_target, &direct_key);
cairo_get_matrix (cr, &matrix);
dx = matrix.x0;
dy = matrix.y0;
gdk_gl_context_get_version (paint_context, &major, &minor);
version = major * 100 + minor;
/* Trivial == integer-only translation */
trivial_transform =
(double)dx == matrix.x0 && (double)dy == matrix.y0 &&
matrix.xx == 1.0 && matrix.xy == 0.0 &&
matrix.yx == 0.0 && matrix.yy == 1.0;
/* TODO: Use glTexSubImage2D() and do a row-by-row copy to replace
* the GL_UNPACK_ROW_LENGTH support
*/
if (gdk_gl_context_get_use_es (paint_context) &&
!(version >= 300 || gdk_gl_context_has_unpack_subimage (paint_context)))
goto out;
/* For direct paint of non-alpha renderbuffer, we can
just do a bitblit */
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
source_type == GL_RENDERBUFFER &&
alpha_size == 0 &&
direct_window != NULL &&
direct_window->current_paint.use_gl &&
trivial_transform &&
clip_region != NULL)
/* TODO: avoid reading back non-required data due to dest clip */
image = cairo_surface_create_similar_image (cairo_get_target (cr),
(alpha_size == 0) ? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_ARGB32,
width, height);
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
framebuffer = paint_data->tmp_framebuffer;
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
if (source_type == GL_RENDERBUFFER)
{
int unscaled_window_height;
int i;
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
framebuffer = paint_data->tmp_framebuffer;
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0);
/* Translate to impl coords */
cairo_region_translate (clip_region, dx, dy);
glEnable (GL_SCISSOR_TEST);
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
/* We can use glDrawBuffer on OpenGL only; on GLES 2.0 we are already
* double buffered so we don't need it...
*/
if (!gdk_gl_context_get_use_es (paint_context))
glDrawBuffer (GL_BACK);
else
{
int maj, min;
gdk_gl_context_get_version (paint_context, &maj, &min);
/* ... but on GLES 3.0 we can use the vectorized glDrawBuffers
* call.
*/
if ((maj * 100 + min) >= 300)
{
static const GLenum buffers[] = { GL_BACK };
glDrawBuffers (G_N_ELEMENTS (buffers), buffers);
}
}
#define FLIP_Y(_y) (unscaled_window_height - (_y))
for (i = 0; i < cairo_region_num_rectangles (clip_region); i++)
{
cairo_rectangle_int_t clip_rect, dest;
cairo_region_get_rectangle (clip_region, i, &clip_rect);
clip_rect.x *= window_scale;
clip_rect.y *= window_scale;
clip_rect.width *= window_scale;
clip_rect.height *= window_scale;
glScissor (clip_rect.x, FLIP_Y (clip_rect.y + clip_rect.height),
clip_rect.width, clip_rect.height);
dest.x = dx * window_scale;
dest.y = dy * window_scale;
dest.width = width * window_scale / buffer_scale;
dest.height = height * window_scale / buffer_scale;
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
{
int clipped_src_x = x + (dest.x - dx * window_scale);
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
glBlitFramebufferEXT(clipped_src_x, clipped_src_y,
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
dest.x, FLIP_Y(dest.y + dest.height),
dest.x + dest.width, FLIP_Y(dest.y),
GL_COLOR_BUFFER_BIT, GL_NEAREST);
if (impl_window->current_paint.flushed_region)
{
cairo_rectangle_int_t flushed_rect;
flushed_rect.x = dest.x / window_scale;
flushed_rect.y = dest.y / window_scale;
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
&flushed_rect);
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
&flushed_rect);
}
}
}
glDisable (GL_SCISSOR_TEST);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
#undef FLIP_Y
}
/* For direct paint of alpha or non-alpha textures we can use texturing */
else if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
source_type == GL_TEXTURE &&
direct_window != NULL &&
direct_window->current_paint.use_gl &&
trivial_transform &&
clip_region != NULL)
{
int unscaled_window_height;
GLint texture_width;
GLint texture_height;
int i, n_rects, n_quads;
GdkTexturedQuad *quads;
cairo_rectangle_int_t clip_rect;
/* Translate to impl coords */
cairo_region_translate (clip_region, dx, dy);
if (alpha_size != 0)
{
cairo_region_t *opaque_region, *blend_region;
opaque_region = cairo_region_copy (clip_region);
cairo_region_subtract (opaque_region, impl_window->current_paint.flushed_region);
cairo_region_subtract (opaque_region, impl_window->current_paint.need_blend_region);
if (!cairo_region_is_empty (opaque_region))
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
opaque_region);
blend_region = cairo_region_copy (clip_region);
cairo_region_intersect (blend_region, impl_window->current_paint.need_blend_region);
glEnable (GL_BLEND);
if (!cairo_region_is_empty (blend_region))
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
blend_region);
cairo_region_destroy (opaque_region);
cairo_region_destroy (blend_region);
}
glBindTexture (GL_TEXTURE_2D, source);
if (gdk_gl_context_get_use_es (paint_context))
{
texture_width = width;
texture_height = height;
}
else
{
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texture_width);
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texture_height);
}
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnable (GL_SCISSOR_TEST);
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
#define FLIP_Y(_y) (unscaled_window_height - (_y))
cairo_region_get_extents (clip_region, &clip_rect);
glScissor (clip_rect.x * window_scale, FLIP_Y ((clip_rect.y + clip_rect.height) * window_scale),
clip_rect.width * window_scale, clip_rect.height * window_scale);
n_quads = 0;
n_rects = cairo_region_num_rectangles (clip_region);
quads = g_new (GdkTexturedQuad, n_rects);
for (i = 0; i < n_rects; i++)
{
cairo_rectangle_int_t dest;
cairo_region_get_rectangle (clip_region, i, &clip_rect);
clip_rect.x *= window_scale;
clip_rect.y *= window_scale;
clip_rect.width *= window_scale;
clip_rect.height *= window_scale;
dest.x = dx * window_scale;
dest.y = dy * window_scale;
dest.width = width * window_scale / buffer_scale;
dest.height = height * window_scale / buffer_scale;
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
{
int clipped_src_x = x + (dest.x - dx * window_scale);
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
GdkTexturedQuad quad = {
dest.x, FLIP_Y(dest.y),
dest.x + dest.width, FLIP_Y(dest.y + dest.height),
clipped_src_x / (float)texture_width, (clipped_src_y + dest.height) / (float)texture_height,
(clipped_src_x + dest.width) / (float)texture_width, clipped_src_y / (float)texture_height,
};
quads[n_quads++] = quad;
if (impl_window->current_paint.flushed_region)
{
cairo_rectangle_int_t flushed_rect;
flushed_rect.x = dest.x / window_scale;
flushed_rect.y = dest.y / window_scale;
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
&flushed_rect);
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
&flushed_rect);
}
}
}
if (n_quads > 0)
gdk_gl_texture_quads (paint_context, GL_TEXTURE_2D, n_quads, quads, FALSE);
g_free (quads);
if (alpha_size != 0)
glDisable (GL_BLEND);
#undef FLIP_Y
}
else
{
/* Software fallback */
int major, minor, version;
gdk_gl_context_get_version (paint_context, &major, &minor);
version = major * 100 + minor;
/* TODO: Use glTexSubImage2D() and do a row-by-row copy to replace
* the GL_UNPACK_ROW_LENGTH support
*/
if (gdk_gl_context_get_use_es (paint_context) &&
!(version >= 300 || gdk_gl_context_has_unpack_subimage (paint_context)))
goto out;
/* TODO: avoid reading back non-required data due to dest clip */
image = cairo_surface_create_similar_image (cairo_get_target (cr),
(alpha_size == 0) ? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_ARGB32,
width, height);
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
framebuffer = paint_data->tmp_framebuffer;
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
if (source_type == GL_RENDERBUFFER)
{
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
}
else
{
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, source, 0);
}
glPixelStorei (GL_PACK_ALIGNMENT, 4);
glPixelStorei (GL_PACK_ROW_LENGTH, cairo_image_surface_get_stride (image) / 4);
/* The implicit format conversion is going to make this path slower */
if (!gdk_gl_context_get_use_es (paint_context))
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image));
else
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image));
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
cairo_surface_mark_dirty (image);
/* Invert due to opengl having different origin */
cairo_scale (cr, 1, -1);
cairo_translate (cr, 0, -height / buffer_scale);
cairo_set_source_surface (cr, image, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint (cr);
cairo_surface_destroy (image);
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, source, 0);
}
glPixelStorei (GL_PACK_ALIGNMENT, 4);
glPixelStorei (GL_PACK_ROW_LENGTH, cairo_image_surface_get_stride (image) / 4);
/* The implicit format conversion is going to make this path slower */
if (!gdk_gl_context_get_use_es (paint_context))
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image));
else
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image));
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
cairo_surface_mark_dirty (image);
/* Invert due to opengl having different origin */
cairo_scale (cr, 1, -1);
cairo_translate (cr, 0, -height / buffer_scale);
cairo_set_source_surface (cr, image, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint (cr);
cairo_surface_destroy (image);
out:
if (clip_region)
cairo_region_destroy (clip_region);
}
/* This is always called with the paint context current */
@@ -726,6 +466,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
float umax, vmax;
gboolean use_texture_rectangle;
guint target;
paint_context = gdk_gl_context_get_current ();
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
paint_context &&
@@ -741,10 +482,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height);
sx = sy = 1;
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
cairo_surface_get_device_offset (surface,
&device_x_offset, &device_y_offset);
cairo_surface_get_device_scale (surface, &sx, &sy);
cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset);
glGenTextures (1, &texture_id);
if (use_texture_rectangle)
@@ -780,7 +519,12 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
e.height *= sy;
image = cairo_surface_map_to_image (surface, &e);
gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
gdk_gl_context_upload_texture (paint_context,
cairo_image_surface_get_data (image),
e.width,
e.height,
cairo_image_surface_get_stride (image),
target);
cairo_surface_unmap_image (surface, image);
@@ -855,7 +599,12 @@ gdk_cairo_surface_upload_to_gl (cairo_surface_t *surface,
rect.height = height;
tmp = cairo_surface_map_to_image (surface, &rect);
gdk_gl_context_upload_texture (context, tmp, rect.width, rect.height, target);
gdk_gl_context_upload_texture (context,
cairo_image_surface_get_data (tmp),
rect.width,
rect.height,
cairo_image_surface_get_stride (tmp),
target);
cairo_surface_unmap_image (surface, tmp);
}

View File

@@ -88,8 +88,6 @@
#include <epoxy/gl.h>
typedef struct {
GdkDisplay *display;
GdkWindow *window;
GdkGLContext *shared_context;
int major;
@@ -114,8 +112,6 @@ typedef struct {
enum {
PROP_0,
PROP_DISPLAY,
PROP_WINDOW,
PROP_SHARED_CONTEXT,
LAST_PROP
@@ -125,7 +121,7 @@ static GParamSpec *obj_pspecs[LAST_PROP] = { NULL, };
G_DEFINE_QUARK (gdk-gl-error-quark, gdk_gl_error)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkGLContext, gdk_gl_context, G_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkGLContext, gdk_gl_context, GDK_TYPE_DRAW_CONTEXT)
static GPrivate thread_current_context = G_PRIVATE_INIT (g_object_unref);
@@ -140,8 +136,6 @@ gdk_gl_context_dispose (GObject *gobject)
if (current == context)
g_private_replace (&thread_current_context, NULL);
g_clear_object (&priv->display);
g_clear_object (&priv->window);
g_clear_object (&priv->shared_context);
G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject);
@@ -154,6 +148,7 @@ gdk_gl_context_finalize (GObject *gobject)
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_clear_pointer (&priv->paint_data, g_free);
G_OBJECT_CLASS (gdk_gl_context_parent_class)->finalize (gobject);
}
static void
@@ -166,34 +161,6 @@ gdk_gl_context_set_property (GObject *gobject,
switch (prop_id)
{
case PROP_DISPLAY:
{
GdkDisplay *display = g_value_get_object (value);
if (display)
g_object_ref (display);
if (priv->display)
g_object_unref (priv->display);
priv->display = display;
}
break;
case PROP_WINDOW:
{
GdkWindow *window = g_value_get_object (value);
if (window)
g_object_ref (window);
if (priv->window)
g_object_unref (priv->window);
priv->window = window;
}
break;
case PROP_SHARED_CONTEXT:
{
GdkGLContext *context = g_value_get_object (value);
@@ -218,14 +185,6 @@ gdk_gl_context_get_property (GObject *gobject,
switch (prop_id)
{
case PROP_DISPLAY:
g_value_set_object (value, priv->display);
break;
case PROP_WINDOW:
g_value_set_object (value, priv->window);
break;
case PROP_SHARED_CONTEXT:
g_value_set_object (value, priv->shared_context);
break;
@@ -237,9 +196,10 @@ gdk_gl_context_get_property (GObject *gobject,
void
gdk_gl_context_upload_texture (GdkGLContext *context,
cairo_surface_t *image_surface,
const guchar *data,
int width,
int height,
int stride,
guint texture_target)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
@@ -253,21 +213,19 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
(priv->use_es && (priv->gl_version >= 30 || priv->has_unpack_subimage)))
{
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image_surface) / 4);
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / 4);
if (priv->use_es)
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image_surface));
data);
else
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image_surface));
data);
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}
else
{
GLvoid *data = cairo_image_surface_get_data (image_surface);
int stride = cairo_image_surface_get_stride (image_surface);
int i;
if (priv->use_es)
@@ -275,14 +233,14 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
for (i = 0; i < height; i++)
glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char*) data + (i * stride));
glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_RGBA, GL_UNSIGNED_BYTE, data + (i * stride));
}
else
{
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
for (i = 0; i < height; i++)
glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (unsigned char*) data + (i * stride));
glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data + (i * stride));
}
}
}
@@ -297,44 +255,81 @@ gdk_gl_context_real_realize (GdkGLContext *self,
return FALSE;
}
static cairo_region_t *
gdk_gl_context_real_get_damage (GdkGLContext *context)
{
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
return cairo_region_create_rectangle (&(GdkRectangle) {
0, 0,
gdk_window_get_width (window),
gdk_window_get_height (window)
});
}
static void
gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
cairo_region_t *region)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkWindow *window;
GdkGLContext *shared;
cairo_region_t *damage;
int ww, wh;
shared = gdk_gl_context_get_shared_context (context);
if (shared)
{
gdk_draw_context_begin_frame (GDK_DRAW_CONTEXT (shared), region);
return;
}
damage = gdk_gl_context_get_damage (context);
cairo_region_union (region, damage);
cairo_region_destroy (damage);
window = gdk_draw_context_get_window (draw_context);
ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window);
wh = gdk_window_get_height (window) * gdk_window_get_scale_factor (window);
gdk_gl_context_make_current (context);
/* Initial setup */
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glDisable (GL_DEPTH_TEST);
glDisable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glViewport (0, 0, ww, wh);
}
static void
gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
cairo_region_t *painted,
cairo_region_t *damage)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkGLContext *shared;
shared = gdk_gl_context_get_shared_context (context);
if (shared)
{
gdk_draw_context_end_frame (GDK_DRAW_CONTEXT (shared), painted, damage);
return;
}
}
static void
gdk_gl_context_class_init (GdkGLContextClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
klass->realize = gdk_gl_context_real_realize;
klass->get_damage = gdk_gl_context_real_get_damage;
/**
* GdkGLContext:display:
*
* The #GdkDisplay used to create the #GdkGLContext.
*
* Since: 3.16
*/
obj_pspecs[PROP_DISPLAY] =
g_param_spec_object ("display",
P_("Display"),
P_("The GDK display used to create the GL context"),
GDK_TYPE_DISPLAY,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
/**
* GdkGLContext:window:
*
* The #GdkWindow the gl context is bound to.
*
* Since: 3.16
*/
obj_pspecs[PROP_WINDOW] =
g_param_spec_object ("window",
P_("Window"),
P_("The GDK window bound to the GL context"),
GDK_TYPE_WINDOW,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
draw_context_class->begin_frame = gdk_gl_context_real_begin_frame;
draw_context_class->end_frame = gdk_gl_context_real_end_frame;
/**
* GdkGLContext:shared-context:
@@ -368,34 +363,27 @@ gdk_gl_context_init (GdkGLContext *self)
priv->use_es = -1;
}
/*< private >
* gdk_gl_context_end_frame:
/**
* gdk_gl_context_get_damage:
* @context: a #GdkGLContext
* @painted: The area that has been redrawn this frame
* @damage: The area that we know is actually different from the last frame
*
* Copies the back buffer to the front buffer.
* Returns the part of the backbuffer that is known to be damaged and would
* need to be redrawn. This is the area that needs to be respected in addition
* to areas invalidated by GTK or the windowing system itself.
*
* This function may call `glFlush()` implicitly before returning; it
* is not recommended to call `glFlush()` explicitly before calling
* this function.
*
* Since: 3.16
*/
void
gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
* Returns: The damage to the backbuffer
**/
cairo_region_t *
gdk_gl_context_get_damage (GdkGLContext *context)
{
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), cairo_region_create ());
GDK_GL_CONTEXT_GET_CLASS (context)->end_frame (context, painted, damage);
return GDK_GL_CONTEXT_GET_CLASS (context)->get_damage (context);
}
GdkGLContextPaintData *
gdk_gl_context_get_paint_data (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
if (priv->paint_data == NULL)
@@ -882,7 +870,7 @@ gdk_gl_context_make_current (GdkGLContext *context)
}
}
if (gdk_display_make_gl_context_current (priv->display, context))
if (gdk_display_make_gl_context_current (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), context))
{
g_private_replace (&thread_current_context, g_object_ref (context));
gdk_gl_context_check_extensions (context);
@@ -902,11 +890,9 @@ gdk_gl_context_make_current (GdkGLContext *context)
GdkDisplay *
gdk_gl_context_get_display (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
return priv->display;
return gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
}
/**
@@ -922,11 +908,9 @@ gdk_gl_context_get_display (GdkGLContext *context)
GdkWindow *
gdk_gl_context_get_window (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
return priv->window;
return gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
}
/**
@@ -995,9 +979,7 @@ gdk_gl_context_clear_current (void)
current = g_private_get (&thread_current_context);
if (current != NULL)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (current);
if (gdk_display_make_gl_context_current (priv->display, NULL))
if (gdk_display_make_gl_context_current (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (current)), NULL))
g_private_replace (&thread_current_context, NULL);
}
}

View File

@@ -82,6 +82,9 @@ gboolean gdk_gl_context_get_use_es (GdkGLContext *
GDK_AVAILABLE_IN_3_16
gboolean gdk_gl_context_realize (GdkGLContext *context,
GError **error);
GDK_AVAILABLE_IN_3_90
cairo_region_t * gdk_gl_context_get_damage (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16
void gdk_gl_context_make_current (GdkGLContext *context);
GDK_AVAILABLE_IN_3_16

View File

@@ -22,6 +22,7 @@
#define __GDK_GL_CONTEXT_PRIVATE_H__
#include "gdkglcontext.h"
#include "gdkdrawcontextprivate.h"
G_BEGIN_DECLS
@@ -33,19 +34,18 @@ typedef struct _GdkGLContextClass GdkGLContextClass;
struct _GdkGLContext
{
GObject parent_instance;
GdkDrawContext parent_instance;
};
struct _GdkGLContextClass
{
GObjectClass parent_class;
GdkDrawContextClass parent_class;
gboolean (* realize) (GdkGLContext *context,
GError **error);
void (* end_frame) (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
cairo_region_t * (* get_damage) (GdkGLContext *context);
gboolean (* texture_from_surface) (GdkGLContext *context,
cairo_surface_t *surface,
cairo_region_t *region);
@@ -77,18 +77,16 @@ void gdk_gl_context_set_is_legacy (GdkGLContext
gboolean is_legacy);
void gdk_gl_context_upload_texture (GdkGLContext *context,
cairo_surface_t *image_surface,
const guchar *data,
int width,
int height,
int stride,
guint texture_target);
GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext *context);
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
void gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
G_END_DECLS

View File

@@ -35,4 +35,5 @@ gchar *_gdk_display_name = NULL;
gchar *_gdk_display_arg_name = NULL;
gboolean _gdk_disable_multidevice = FALSE;
guint _gdk_gl_flags = 0;
guint _gdk_vulkan_flags = 0;
GdkRenderingMode _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;

View File

@@ -41,6 +41,7 @@ G_BEGIN_DECLS
/* Debugging support */
typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkWindowAttr GdkWindowAttr;
typedef enum {
GDK_EVENT_FILTER_REMOVED = 1 << 0
@@ -68,6 +69,7 @@ typedef enum {
GDK_DEBUG_FRAMES = 1 << 11,
GDK_DEBUG_SETTINGS = 1 << 12,
GDK_DEBUG_OPENGL = 1 << 13,
GDK_DEBUG_VULKAN = 1 << 14
} GdkDebugFlag;
typedef enum {
@@ -86,11 +88,17 @@ typedef enum {
GDK_GL_GLES = 1 << 6
} GdkGLFlags;
typedef enum {
GDK_VULKAN_DISABLE = 1 << 0,
GDK_VULKAN_VALIDATE = 1 << 1,
} GdkVulkanFlags;
extern GList *_gdk_default_filters;
extern GdkWindow *_gdk_parent_root;
extern guint _gdk_debug_flags;
extern guint _gdk_gl_flags;
extern guint _gdk_vulkan_flags;
extern GdkRenderingMode _gdk_rendering_mode;
#ifdef G_ENABLE_DEBUG
@@ -147,6 +155,17 @@ struct _GdkEventPrivate
typedef struct _GdkWindowPaint GdkWindowPaint;
struct _GdkWindowAttr
{
gint event_mask;
gint x, y;
gint width;
gint height;
GdkWindowWindowClass wclass;
GdkWindowType window_type;
GdkWindowTypeHint type_hint;
};
struct _GdkWindow
{
GObject parent_instance;
@@ -173,75 +192,6 @@ struct _GdkWindow
GList *filters;
GList *children;
GList children_list_node;
GList *native_children;
/* The paint logic here is a bit complex because of our intermingling of
* cairo and GL. Let's first go over the cairo-alone case:
*
* 1) gdk_window_begin_paint_region() is called with an update region. If
* the backend wants it, we redirect drawing to a temporary surface
* sized the same as the update region and set `surface_needs_composite`
* to TRUE. Otherwise, we paint directly onto the real server-side window.
*
* 2) Things paint with cairo using GdkDrawingContext
*
* 3) When everything is painted, the user calls gdk_window_end_paint().
* If there was a temporary surface, this is composited back onto the
* real backing surface in the appropriate places.
*
* This is similar to double buffering, except we only have partial surfaces
* of undefined contents, and instead of swapping between two buffers, we
* create a new temporary buffer every time.
*
* When we add GL to the mix, we have this instead:
*
* 1) gdk_window_begin_paint_region() is called with an update region like
* before. We always redirect cairo drawing to a temporary surface when
* GL is enabled.
*
* 2) Things paint with cairo using GdkDrawingContext. Whenever
* something paints, it calls gdk_window_mark_paint_from_clip() to mark
* which regions it has painted in software. We'll learn what this does
* soon.
*
* 3) Something paints with GL and uses gdk_cairo_draw_from_gl() to
* composite back into the scene. We paint this onto the backing
* store for the window *immediately* by using GL, rather than
* painting to the temporary surface, and keep track of the area that
* we've painted in `flushed_region`.
*
* 4) Something paints using software again. It calls
* gdk_window_mark_paint_from_clip(), which subtracts the region it
* has painted from `flushed_region` and adds the region to
* `needs_blended_region`.
*
* 5) Something paints using GL again, using gdk_cairo_draw_from_gl().
* It paints directly to the backing store, removes the region it
* painted from `needs_blended_region`, and adds to `flushed_region`.
*
* 6) gdk_window_end_paint() is called. It composites the temporary surface
* back to the window, using GL, except it doesn't bother copying
* `flushed_region`, and when it paints `needs_blended_region`, it also
* turns on GL blending.
*
* That means that at any point in time, we have three regions:
*
* * `region` - This is the original invalidated region and is never
* touched.
*
* * `flushed_region` - This is the portion of `region` that has GL
* contents that have been painted directly to the window, and
* doesn't have any cairo drawing painted over it.
*
* * `needs_blended_region` - This is the portion of `region` that
* GL contents that have part cairo drawing painted over it.
* gdk_window_end_paint() will draw this region using blending.
*
* `flushed_region` and `needs_blended_region` never intersect, and the
* rest of `region` that isn't covered by either is the "opaque region",
* which is any area of cairo drawing that didn't ever intersect with GL.
* We can paint these from GL without turning on blending.
**/
struct {
/* The temporary surface that we're painting to. This will be composited
@@ -250,11 +200,8 @@ struct _GdkWindow
cairo_surface_t *surface;
cairo_region_t *region;
cairo_region_t *flushed_region;
cairo_region_t *need_blend_region;
gboolean surface_needs_composite;
gboolean use_gl;
} current_paint;
GdkGLContext *gl_paint_context;
@@ -396,6 +343,9 @@ void gdk_gl_texture_quads (GdkGLContext *paint_context,
GdkTexturedQuad *quads,
gboolean flip_colors);
void gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
const GdkPixbuf *pixbuf);
void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
GdkWindow *window);
cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
@@ -410,6 +360,8 @@ void gdk_cairo_set_drawing_context (cairo_t *cr,
cairo_surface_t *
_gdk_window_ref_cairo_surface (GdkWindow *window);
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes);
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);

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