Compare commits

...

353 Commits

Author SHA1 Message Date
Emmanuele Bassi
ed087f2a30 gsk: Add the ability to create fallback renderers
While porting GTK to GskRenderer we noticed that the current fallback
code for widgets using Cairo to draw is not enough to cover all the
possible cases.

For instance, if a container widget still uses GtkWidget::draw to render
its children, and at least one of them has been ported to using render
nodes instead, the container won't know how to draw it.

For this reason we want to provide to layers above GSK the ability to
create a "fallback" renderer instance, created using a "parent"
GskRenderer instance, but using a Cairo context as the rendering target
instead of a GdkDrawingContext.

GTK will use this inside the gtk_widget_draw() implementation, if a
widget implements GtkWidgetClass.get_render_node().
2016-10-17 16:22:02 +01:00
Emmanuele Bassi
df54c81d7f gsk: Update Cairo renderer
The Cairo renderer has been lagging behind a series of changes inside
GskRenderer, like surface-less nodes, so it needs to be updated.
2016-10-17 16:22:02 +01:00
Emmanuele Bassi
3ccd45b9e0 gsk: Make GskRenderer.render() drawing context-agnostic
We're going to need to allow rendering on a specific cairo_t in order to
implement fallback code paths inside GTK; this means that there will be
times when we have a transient GskRenderer instance that does not have a
GdkDrawingContext to draw on.

Instead of adding a new render() implementation for those cases and then
decide which one to use, we can remove the drawing context argument from
the virtual function itself, and allow using a NULL GdkDrawingContext
when calling gsk_renderer_render(). A later commit will add a generic
function to create a transient GskRenderer with a cairo_t attached to
it.

Renderers inside GSK will have to check whether we have access to a
GdkDrawingContext, in which case we're going to use it; or if we have
access to a cairo_t and a window.
2016-10-17 16:22:02 +01:00
Emmanuele Bassi
0d08d2d63a docs: Update the GSK API reference section 2016-10-17 16:22:01 +01:00
Emmanuele Bassi
40de4d590a gsk: Move GskRenderNode getters to internal API
GskRenderNode is, at its core, a write-only API; you're supposed to set
up the render nodes instead of querying them for state.

Querying render nodes is left to the GskRenderer implementation.
2016-10-17 16:22:01 +01:00
Emmanuele Bassi
111a440dda gsk: Remove GskRenderer:auto-clear
We control the clearing inside each GskRenderer implementation, and we
don't allow providing a target surface any more.
2016-10-17 16:22:01 +01:00
Matthias Clasen
9df3067bb8 Convert GtkSpinner to indirect rendering 2016-10-17 16:22:01 +01:00
Matthias Clasen
46c7128094 Convert GtkImage to indirect rendering 2016-10-17 16:22:01 +01:00
Matthias Clasen
781b5aac86 Convert GtkAccelLabel to indirect rendering 2016-10-17 16:22:01 +01:00
Matthias Clasen
df28f92187 Convert GtkLabel to indirect rendering
Warning! This breaks GtkAccelLabel. It will be fixed in the next
commit.
2016-10-17 16:22:01 +01:00
Matthias Clasen
59f95e1e1f Convert GtkFlowBox to indirect rendering 2016-10-17 16:22:01 +01:00
Matthias Clasen
0a2467ce3b container: Prepare to prune render nodes
Add a should_propagate function for render nodes. Eventually,
this is meant to avoid creating render nodes for child widgets
that are outside the parents clip area. Since we don't have
that information available right now, just filter out nondrawable
children for now.
2016-10-17 16:22:01 +01:00
Matthias Clasen
d6acfd81c7 Split css background into individual render nodes
Use separate render nodes for each layer in a multi-image
background. WARNING: blend modes don't work right yet.
2016-10-17 16:22:01 +01:00
Matthias Clasen
697d0e9ed9 Add blend mode to debug spew 2016-10-17 16:22:01 +01:00
Matthias Clasen
a21409c61b Don't create render nodes for empty backgrounds 2016-10-17 16:22:01 +01:00
Matthias Clasen
e825ca92e7 Break out the css background render node in a function
This is in preparation for creating separate render nodes
for individual backgrounds.
2016-10-17 16:22:00 +01:00
Matthias Clasen
ed3740933e Make outer shadows work again
Change get_render_node to return nodes that are sized to the clip
area and expect to be placed at the clip position; change
gtk_container_propagate_render_node to place child render nodes
accordingly, and change gtk_css_gadget_get_render_node to return
nodes that are sized accordingly as well.
2016-10-17 16:22:00 +01:00
Alexander Larsson
0f1a8bfe20 gsk: Fix hidpi scaling
We store the vertices in (unscaled) window coords (but the item size
is still scaled to match the texture size). Also, the
projection/model-view multiplication order is switched so that the scale
is applied at the right place.
2016-10-17 16:22:00 +01:00
Alexander Larsson
f78330139f gdk_cairo_surface_upload_to_gl: Don't apply device scale
The arguments to this function is the texture width/height, and these
are already scaled.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
5e973006b4 gsk: Remove :use-alpha from GskRenderer
It's unused, and we always assume we render with an alpha channel
enabled because it's 2016.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
b1c5475046 gsk: Move scaling filters to GskRenderNode
The renderer will always use nearest-neighbor filters because it renders
at 1:1 pixel to texel ratio.

On the other hand, render nodes may be scaled, so we need to offer a way
to control the minification and magnification filters.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
ea3c2f4889 gsk: Allow adding a GL texture as a node content
If we already have a GL texture we definitely don't want to use
gdk_cairo_draw_from_gl() to draw on a Cairo context if we're going
to take the Cairo surface to which we draw and put it into an OpenGL
texture.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
2aeb9f61a6 gsk: Drop modelview/projection from GskRenderer API
The details of the modelview and projection matrices are only useful for
the GL renderer; there's really no point in having those details
available in the generic API — especially as the Cairo fallback renderer
cannot really set up a complex modelview or a projection matrix.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
11151379df gtk: Sort children by window depth when rendering
This makes popovers pop over instead of under.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
fc15f027ec gsk: Ensure that non-drawing nodes are supported
Non-drawing nodes should skip the texturing phase.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
63dc543d0e gtk: Add a box render node for gadgets
Instead of using the background as the gadget's node, we add a
non-drawing node that can be used to apply offsets; all other nodes are
children of the "box" node.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
4befa6b653 gsk: Fix the blend mode
The default blend mode should be the equivalent of Cairo's OVER
operator.
2016-10-17 16:22:00 +01:00
Emmanuele Bassi
c454c1ad2c gsk: Reuse VAOs with identical buffers
Just like we reuse texture ids with the same size we can, at the expense
of a little memory, reuse vertex buffers if they reference the same
attributes and contain the same data.

Each VAO is marked as free at the end of the frame, and if it's not
reused in the following frame, it gets dropped.
2016-10-17 16:21:59 +01:00
Emmanuele Bassi
84c5472752 gsk: Remove child-transform from render nodes
The child-transform is useful only if we also provide clipping to the
parent nodes, otherwise children will just be drawn outside of the
parent's bounds.

We'll introduce child transforms either at a higher layer, or once we
add clipping support to GskRenderNode.
2016-10-17 16:21:59 +01:00
Matthias Clasen
88d02b8f91 Covert GtkOverlay to indirect rendering
There is no gadget, so we use the gtk_widget_create_render_node
function for the first time here.
2016-10-17 16:21:59 +01:00
Matthias Clasen
8c9717119d Convert GtkComboBox to indirect rendering
The removal of the draw method in GtkComboBox reveals another
instance of parent-child invariant violation in GtkComboBoxText.
2016-10-17 16:21:59 +01:00
Matthias Clasen
b3063fe3a0 GtkButtonBox: Convert to indirect rendering 2016-10-17 16:21:59 +01:00
Matthias Clasen
bf4c44fbf1 Small documentation additions 2016-10-17 16:21:59 +01:00
Matthias Clasen
92273b5d19 Small fixes for the docs
Set titles and short descriptions for the sections.
2016-10-17 16:21:59 +01:00
Matthias Clasen
710a326db2 gsk: Build docs 2016-10-17 16:21:59 +01:00
Matthias Clasen
8851d75ba8 GtkListBox: Convert to indirect rendering
Note that there is a problem with the pixel cache that causes
listboxes to come out black when in a scrolled window.
2016-10-17 16:21:59 +01:00
Matthias Clasen
ed8db31f81 gadget: Fix handling of custom content
The transformations here were wrong, causing content to go nowhere.
This patch fixes check and radio buttons to appear as expected.
2016-10-17 16:21:59 +01:00
Matthias Clasen
d40636b6b0 GtkCheckButton: Convert to indirect rendering
This is another example of indirect rendering with a box gadget.
There is currently still some positioning problem with the
checkmark.
2016-10-17 16:21:59 +01:00
Matthias Clasen
fddc1a9708 Prevent box gadget content from being drawn twice
Now that we split out box gadget children into separate
render nodes, we must not draw them onto the box gadgets
node anymore.
2016-10-17 16:21:59 +01:00
Matthias Clasen
4ea6ee4567 GtkExpander: Convert to indirect rendering
This is the first example of indirect rendering involving
a box gadget. For now, we iterate the child gadgets manually,
and rely on gtk_container_propagate_render_node for the
child widgets. Eventually, we may want a better solution
here.
2016-10-17 16:21:58 +01:00
Matthias Clasen
9286c1c0fa gadget: Add a has_content vfunc
...and implement it for GtkCssGadget and GtkCssCustomGadget.
This allows us to decide on a per-object basis if a custom
gadget needs a render node for content or not.
2016-10-17 16:21:58 +01:00
Matthias Clasen
82166f8d72 button: Restore focus
The custom gadget draw function has the side effect of informing
the gadget machinery wether to draw focus or not. Bring the
draw function back, just for its boolean return value. We may
want to find a better solution for this.
2016-10-17 16:21:58 +01:00
Matthias Clasen
cf96e92b8b Allow selective debug spew
I don't think this should stay in the code long-term, but it
is useful for debugging. It helped me track down some suspicious
placements of render nodes.
2016-10-17 16:21:58 +01:00
Matthias Clasen
1140c20309 Add details to css render nodes
Give all nodes the same detail about the owner widget.
This reveals that every GtkCssCustomGadget gets a
DrawGadgetContents node, even if their draw_func is NULL.
We may want to come up with a better solution for that.
2016-10-17 16:21:58 +01:00
Matthias Clasen
5228506b6f Some debug help
Make the bounds of drawing surfaces created by render nodes visible.

Trigger with GSK_DEBUG=surface.
2016-10-17 16:21:58 +01:00
Matthias Clasen
6fd807ae0d Drop an unused variable 2016-10-17 16:21:58 +01:00
Emmanuele Bassi
cd78d1a69a gtk: Clean up render fallback node creation in GtkWidget 2016-10-17 16:21:58 +01:00
Emmanuele Bassi
fe590578f9 gtk: Port GtkHeaderBar to render nodes 2016-10-17 16:21:58 +01:00
Emmanuele Bassi
ae4e72d944 gtk: Port GtkActionBar to render nodes 2016-10-17 16:21:58 +01:00
Emmanuele Bassi
00d4b62dce gtk: Attempt at handling CSS coordinates
When creating the GskRenderNodes for the gadgets we should not translate
the coordinates inside the Cairo context, but we should tweak the
coordinates of the anchor point.

This is still not enough to get an appropriate rendering, as the result
is still slightly offset to the left.
2016-10-17 16:21:58 +01:00
Emmanuele Bassi
c0cd978311 gsk: Pass the appropriate value for the n_quads argument
Instead of passing the size of the buffer, we should pass the number of
quads; we know what the size of a single quad structure is, so we can do
the multiplication internally when creating the VAO.

This allows us to print the quads for debugging purposes.
2016-10-17 16:21:57 +01:00
Matthias Clasen
cd14236dfe GtkFrame: Convert to indirect rendering
Create a GskRenderNode for the contents of the frame.
2016-10-17 16:21:57 +01:00
Emmanuele Bassi
fb9413d464 gtk: Add convenience function for creating render nodes
GtkWidget.create_render_node() sets up a GskRenderNode appropriate for
rendering the contents of a widget, including its bounds,
transformation, and anchor point.
2016-10-17 16:21:57 +01:00
Emmanuele Bassi
7f22c023de gsk: Rename set_offset() to set_anchor_point()
The naming is consistent with other scene graph libraries, as it
represents an additional translation transformation applied on top of
the provided transformation matrices.

We can also simplify the implementation by applying the translation when
we compute the world matrix.
2016-10-17 16:21:57 +01:00
Emmanuele Bassi
bda1701301 gsk: Recycle textures across frames
We keep the textures used inside a frame around until the end of the
following frame; whenever we need a texture with the same size, and
it's not marked in use, then we just reuse the existing texture.
2016-10-17 16:21:57 +01:00
Matthias Clasen
399a03f475 Fix fallback render nodes
We were allocating a surface thats big enough for the clip, and
we were setting the transform for that, but then GtkContainer
was overriding the transform with the one for the allocation.
Also, we were drawing at the clip position, not the allocation
position.
2016-10-17 16:21:57 +01:00
Matthias Clasen
8f75be4647 Add an offset to render nodes
This will let us account for the difference between
clip and allocation.
2016-10-17 16:21:57 +01:00
Matthias Clasen
daec615286 gsk: Split of debug spew for transforms
This was overwhelming other useful debug output, so make it
opt-in. We print the render items for both opengl and transforms,
since the matrices bleed into each other, otherwise.
2016-10-17 16:21:57 +01:00
Matthias Clasen
2695f32eb3 gsk: Add debug macros that trigger on two conditions
This will be useful in the following commits.
2016-10-17 16:21:57 +01:00
Matthias Clasen
9ec2875543 gsk: Add a debug flag for transforms 2016-10-17 16:21:57 +01:00
Matthias Clasen
5b735cff00 gsk: Improve debug output a bit
Indent render node debug spew to make the tree structure obvious.
2016-10-17 16:21:57 +01:00
Matthias Clasen
ae10683e95 button: Convert to indirect rendering
WARNING! This commit breaks GtkButton subclasses.
2016-10-17 16:21:56 +01:00
Matthias Clasen
0c39051cbe Convert GtkGrid to indirect rendering
Following the example of GtkBox.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
1cd7d4f7cd gsk: Add GskProfiler to GskRenderer
The profiler instance is per-renderer, and is accesible to
implementations.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
34b6993d15 gsk: Add profiler object
The GskProfiler holds counters and timers, and will be used by the
renderer implementations to acquire frame timings.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
c99536c752 box: Port from immediate to deferred rendering
Drop the ::draw() vfunc implementation in favour of the
::get_render_node() vfunc.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
2e70e041f1 Integrate CSS gadget with GSK render nodes
First stab at an internal API that generates render nodes when drawing a
CSS gadget.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
aed3ab1e85 gtk: Update the coordinates when propagating render nodes
Just like gtk_container_propagate_draw() does for the immediate mode
rendering.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
6c08ea6283 Use the projection to flip around the content
Since we use an FBO to render the contents of the render node tree, the
coordinate space is going to be flipped in GL. We can undo the flip by
using an appropriate projection matrix, instead of changing the sampling
coordinates in the shaders and updating all our coordinates at render
time.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
4c986971fd widget: Fix compatibility fallbacks 2016-10-17 16:21:56 +01:00
Emmanuele Bassi
9b9141fea9 gsk: Add texture size to debug message 2016-10-17 16:21:56 +01:00
Emmanuele Bassi
8471405b7f gsk: Take into account the scaling factor
We need to apply a scaling factor whenever we deal with user-supplied
coordinates, like:

 - when creating textures
 - when setting up the viewport
 - when submitting the scene
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
c77cc127ea gsk: Tie render nodes to renderers
Render nodes need access to rendering information like scaling factors.
If we keep render nodes separate from renderers until we submit a nodes
tree for rendering we're going to have to duplicate all that information
in a way that makes the API more complicated and fuzzier on its
semantics.

By having GskRenderer create GskRenderNode instances we can tie nodes
and renderers together; since higher layers will also have access to
the renderer instance, this does not add any burden to callers.

Additionally, if memory measurements indicate that we are spending too
much time in the allocation of new render nodes, we can now easily
implement a free-list or a renderer-specific allocator without breaking
the API.
2016-10-17 16:21:56 +01:00
Emmanuele Bassi
89500c5d84 gsk: Bind GL context to the GL profiler
Similarly to how we bind it to the GL driver object used by the GSK GL
renderer.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
e48cc71656 gtk: Port GtkWindow to render nodes
WARNING: BROKEN COMMIT
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
db10f1ff64 gtk: Add GtkContainer API to gather render nodes
We cannot implement GtkWidgetClass.get_render_node() in GtkContainer
without breaking the fallback path that renders a widget to a single
render node rasterization. For GtkContainer subclasses we should provide
a simple API, similar to gtk_container_propagate_draw(), that gathers
all the render nodes for each child.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
020e4e5bfa gtk: Name GSK render nodes
For debugging purposes it's helpful to name the nodes.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
bbf11f749b gsk: Fix build without Wayland 2016-10-17 16:21:55 +01:00
Emmanuele Bassi
0ca16c5a7e gsk: Add redirection to FBOs for opacity groups
If a node is non-opaque and has a non-zero opacity we need to paint its
contents and children first to an off screen buffer, and then render the
resulting texture at the desired opacity — otherwise the opacities will
combine and result in the wrong rendering.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
11085dccae gsk: Drop opaque/transparent item split
We're not going to use separate rendering lists soon, and the way we
render items is less similar to a gaming engine and more similar to a
simpler compositor. This means we don't need to perform a two pass
rendering — opaque items first, transparent items later.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
f9ca3f0143 gsk: Rename uniforms and attributes in shaders
Use appropriate names, and annotate the names with the types — 'u' for
uniforms, 'a' for attributes. The common preambles for shaders are split
from the bodies, so we need some way to distinguish the uniforms and the
attributes just from their name.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
512cbcb6e0 gsk: Move resource handling inside GskGLDriver
We want the GL driver to cache as many resources as possible, so we can
always ensure that we're in a consistent state, and we can handle state
transitions more appropriately.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
78f320c01d gsk: Simplify buffer handling in GskGLRenderer
We don't have optional stencil and depth buffers, like GtkGLArea: we
always create both of them internally.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
f661d097a6 gsk: Drop render buffer code path from GskGLRenderer
We always use texturing, to preserve the alpha channel when blitting the
frame buffer object on the window surface.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
c481c01322 gsk: Rework surface -> texture API
Drop the texture parameters handling from the texture creation, and
associate them with the contents upload. Also, rename the function to
something more in line with what it does.
2016-10-17 16:21:55 +01:00
Emmanuele Bassi
2059da9967 gsk: Add GL driver API to create render targets
It's going to be used by the GL renderer to safely create and bind
FBOs when needed.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
cc6b7a5ea0 gsk: Turn texture cache into a hash table
We want to add the list of FBOs tied to a texture; this means we cannot
trivally copy the Texture structure when adding it to a GArray. We're
also going to have more textures than VAOs, so it makes more sense to
use a O(1) access data structure for them.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
66d16d19c1 gsk: Add GL profiler
We can use the GL_ARB_timer_query extension (available since OpenGL
3.2, and part of the OpenGL specification since version 3.3) to query
the time elapsed when drawing each frame. This allows us to gather
timing information on our use of the GPU.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
77dc24be86 gsk: Split surface upload from texture creation
We're going to need a method to create textures without a surface.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
829676c93d gsk: Enable depth testing
Use the appropriate depth testing function for transparent items.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
e02836f989 gsk: Use consistent naming for blend fragment shader
This should make it immediately clear if we're doing something wrong.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
841ca89956 gsk: Fix pre-condition check
We warn if the node is marked as not mutable.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
509a219fcb gsk: Flip mutability on GskRenderNode.finalize
We use the public API when removing children nodes, so we need to mark
the node as mutable while we destroy it.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
5313aa28d6 gsk: Add specific debug type for shaders
So that we don't lose GskShaderBuilder debugging messages in the stream
of GskGLRenderer ones.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
984e205ddb gsk: Add GskGLDriver
We can move the caching and management of textures, VAOs, and state of
the GL machinery into a single object, GskGLDriver.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
e3bf255d2f gsk: Use the right pointer to the parent RenderItem
We copy the local RenderItem into the render items array, so we need to
use the copy in the array in order to get the correct reference.
2016-10-17 16:21:54 +01:00
Emmanuele Bassi
07d823e9ff Ensure that render nodes are translated
The clip rectangle may have non-zero offsets, so we need to ensure that
the GskRenderNode associated to the rendered area is translated by those
same offsets.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
3bf8f49ead gsk: Add fundamental type annotations for GskRenderNode
We need to annotate the GskRenderNode so that the introspection
machinery can find the functions for managing reference counting
and GValues.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
ea982b5564 gsk: Add 'blit' program
For the root node we do not need to use blending, as it does not have
any backdrop to blend into. We can use a simpler 'blit' program that
only takes the content of the source and fills the texture quad with
it.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
d0c6c6251e gsk: Consolidate program creation and storage
We should use ShaderBuilder to create and store programs for the GL
renderer. This allows us to simplify the creation of programs (by moving
the compilation phase into the ShaderBuilder::create_program() method),
and move towards the ability to create multiple programs and just keep a
reference to the program id.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
c04db84c48 docs: Add more GSK documentation 2016-10-17 16:21:53 +01:00
Emmanuele Bassi
9155bbaafb gsk: Add more modes to the blend shader
Use the compositing CSS spec at:

  https://www.w3.org/TR/compositing-1/#blending

For the implementation.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
8420dc7682 gsk: Don't store the uniform and attribute location twice
We should keep the ShaderBuilder around and use it to query the various
uniform and attribute locations when needed, instead of storing those
offsets into the Renderer instance, and copying them. This allows a bit
more flexibility, once we have more than one program built into the
renderer.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
9dde2ebf67 gsk: Add getter for program id in ShaderBuilder
Since we store it into the ShaderBuilder instance we should also allow
getting the program id.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
999db0f9c8 gsk: Add debugging notes to ShaderBuilder
Print out the generated shader and the list of available uniforms and
attributes.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
34a5eb01e3 gsk: Rework how GLSL shaders are built
The GL renderer should build the GLSL shaders using GskShaderBuilder.
This allows us to separate the common parts into separate files, and
assemble them as necessary, instead of shipping one big shader per type
of GL API (GL3, GL legacy, and GLES).
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
cf76f81409 gsk: Add ShaderBuilder
GskShaderBuilder is an ancillary, private type that deals with the
internals of taking GLSL shaders from resources and building them,
with the additional feature of being able to compose shaders from a
common preamble, as well as adding conditional defines (useful for
enabling debugging code in the shaders themselves).
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
c4a2f3b5fb gsk: Add rendering debug mode for shaders
It's going to be useful to inject debugging data into the shaders used
by GSK.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
7a98ef45e1 gdk: Add more GDK_GL_ERROR error ids
We're going to use them in other locations.
2016-10-17 16:21:53 +01:00
Emmanuele Bassi
907fc8d21e gsk: Use the node's blend mode in the GL renderer 2016-10-17 16:21:52 +01:00
Emmanuele Bassi
51b889bf8f gsk: Store blend mode in the render node 2016-10-17 16:21:52 +01:00
Emmanuele Bassi
d1d2ae6c25 gsk: Make GskBlendMode enumeration public 2016-10-17 16:21:52 +01:00
Emmanuele Bassi
53cbbf8cf2 gsk: Allow sampling between parent and child nodes 2016-10-17 16:21:52 +01:00
Emmanuele Bassi
145e45db26 gsk: Group render state attributes 2016-10-17 16:21:52 +01:00
Emmanuele Bassi
4e2f35fdf2 gsk: Turn GskRenderNode into a pure GTypeInstance
Using GObject as the base type for a transient tree may prove to be too
intensive, especially when creating a lot of node instances. Since we
don't need properties or signals, and we don't need complex destruction
semantics, we can use GTypeInstance directly as the base type for
GskRenderNode.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
81377767a2 gtk: Use GskRenderNode to render widgets
We need a virtual function to retrieve the GskRenderNode for each
widget, which is supposed to attach its own children's GskRenderNodes.
Additionally, we want to maintain the existing GtkWidget::draw mechanism
for widgets that do not implement get_render_node() — as well as widgets
that have handlers connected to the ::draw signal.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
6aed0210a4 gtk: Add a GskRenderer to GtkWindow
Each top-level should have its own GskRenderer, to be used when drawing
the render node tree.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
9992e35c59 gsk: Rework GskRenderer and GskRenderNode semantics
This commit changes the way GskRenderer and GskRenderNode interact and
are meant to be used.

GskRenderNode should represent a transient tree of rendering nodes,
which are submitted to the GskRenderer at render time; this allows the
renderer to take ownership of the render tree. Once the toolkit and
application code have finished assembling it, the render tree ownership
is transferred to the renderer.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
79a9f700c4 gsk: Flush the GL render items cache
Whenever the render tree changes we want to drop the RenderItem arrays,
as each item contains a pointer to the GskRenderNode which becomes
dangling once the root node changed.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
ea95e22a75 gsk: Add GskRenderer::clear_tree
We need a way to clear eventual caches inside GskRenderer subclasses if
the root node has changed.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
625e930222 gsk: Port GskGLRenderer to GLES
Use the appropriate API and shaders if the GdkGLContext was created for
OpenGL ES instead of OpenGL.
2016-10-17 16:21:52 +01:00
Emmanuele Bassi
0eaf85704b gsk: Use surface-to-texture utility function
Now that we have it.
2016-10-17 16:21:51 +01:00
Emmanuele Bassi
55d2522fb0 gsk: Rename shaders for OpenGL 2016-10-17 16:21:51 +01:00
Emmanuele Bassi
0f57ab4a54 gdk: Add utility for uploading Cairo surfaces to GL
The surface-to-GL upload logic has become more complicated with the
addition of the GLES code paths; it's more logical to have a public
utility function that can be called from GDK users, instead of copy
pasting the whole thing multiple times.
2016-10-17 16:21:51 +01:00
Emmanuele Bassi
ae8d209e50 build: Add GSK deps to GTK 2016-10-17 16:21:51 +01:00
Emmanuele Bassi
a422f45544 Initial implementation of GSK rendering pipeline
GSK is conceptually split into two scene graphs:

 * a simple rendering tree of operations
 * a complex set of logical layers

The latter is built on the former, and adds convenience and high level
API for application developers.

The lower layer, though, is what gets transformed into the rendering
pipeline, as it's simple and thus can be transformed into appropriate
rendering commands with minimal state changes.

The lower layer is also suitable for reuse from more complex higher
layers, like the CSS machinery in GTK, without necessarily port those
layers to the GSK high level API.

This lower layer is based on GskRenderNode instances, which represent
the tree of rendering operations; and a GskRenderer instance, which
takes the render nodes and submits them (after potentially reordering
and transforming them to a more appropriate representation) to the
underlying graphic system.
2016-10-17 16:21:51 +01:00
Emmanuele Bassi
2378965e92 gsk: Initial commit / build environment 2016-10-17 16:21:51 +01:00
Benjamin Otte
dbeeaf7de6 cssprovider: Remove GError out argument from load functions
People should use the GtkCssProvider::parsing-error signal instead.
2016-10-17 16:52:05 +02:00
Ben Iofel
55e599c561 textbufferserialize: declare set_error as G_GNUC_PRINTF
And fix a missing format argument
2016-10-17 10:36:26 -04:00
Ben Iofel
84739239ce colorscale: modify loop variables in loop body 2016-10-17 15:17:28 +01:00
Emmanuele Bassi
7b73bc3572 build: Use correct compiler flag
The name is -Wformat-nonliteral.
2016-10-17 15:13:09 +01:00
Garrett Regier
7173df1dd1 gtk+: Fix GI warnings about missing parameters
These were removed for GTK+ 4.
2016-10-17 07:07:20 -07:00
Emmanuele Bassi
a0aa1d963a broadway: Remove redundant declaration 2016-10-17 14:56:38 +01:00
Emmanuele Bassi
2332ac444c gtk/utils: Include stdio.h
We need it because of the declaration using FILE*.
2016-10-17 14:51:16 +01:00
Ignacio Casal Quinteiro
a12b691b76 gtkicontheme: check if the context quark string is not null
On windows you might not have a theme installed by default which
means that when trying to create the context quark it will fail.
If then we try to replace a NULL key in the hash table it will crash.

https://bugzilla.gnome.org/show_bug.cgi?id=769859
2016-10-17 13:04:31 +02:00
Emmanuele Bassi
857d241e22 Remove redundant variable declaration
The inner `var` declaration is shadowing the outer one.
2016-10-17 11:52:00 +01:00
Emmanuele Bassi
20b2e479f8 build: Add various compiler warnings and errors
Just like GLib, GTK+ would benefit from getting warnings and errors from
the compilers.

We check various, common warnings, especially for a future use of C99;
additionally, we promote some warnings to errors, in order to ensure
that simple mistakes are caught during the development phase, before
they are submitted to the code repository.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
6a9be60a16 notebook: Remove redundant variable declarations
We're already declaring notebook and priv at the top of the function,
and assigning them to the same values.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
39e848c0eb icontheme: Drop unnecessary allocation
Use a static array for the known icon sizes, now that we don't allow
registering custom icon sizes any more. This allows us to cut a one-off
allocation that makes Valgrind sad.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
5563ba96bc Avoid variable shadowing in GtkShortcutsSection 2016-10-17 11:44:11 +01:00
Emmanuele Bassi
fc9826fb41 Remove declarations for getresuid()/getresgid()
Back in 2001, their prototypes were missing from system headers, but
since glibc 2.3.2 they are defined in unistd.h if _GNU_SOURCE is
defined.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
db6f9a8e45 gtk: Add missing function declarations 2016-10-17 11:44:11 +01:00
Emmanuele Bassi
b3adbbe5e7 text: Constify field of GtkTextLineSegmentClass
We only use it internally for statically allocated structures, with
static strings, so there's no reason for it to be a `char*`.
2016-10-17 11:44:11 +01:00
Emmanuele Bassi
1f132607f7 gtk: Use appropriate constness for variables 2016-10-17 11:44:11 +01:00
Emmanuele Bassi
590e7e68d8 filechooserwidget: Rename error variable
Avoid shadowing an existing error.
2016-10-17 11:44:10 +01:00
Emmanuele Bassi
e75bbafeac filechooserbutton: Remove unnecessary declaration 2016-10-17 11:44:10 +01:00
Emmanuele Bassi
9557364216 gtk: Mark internal functions as static
These functions are only used within their compilation unit.
2016-10-17 11:44:10 +01:00
Emmanuele Bassi
fbf6aa1776 colorscale: Rename variables
Avoid shadowing existing variables.
2016-10-17 11:44:10 +01:00
Emmanuele Bassi
4ba169b82e cellview: Constify argument 2016-10-17 11:44:10 +01:00
Emmanuele Bassi
5880d1b990 gtk: Cast static strings assigned to non-const variables
GtkTargetEntry.target is particularly egregious, and it should really be
constified.
2016-10-17 11:44:10 +01:00
Emmanuele Bassi
9bb816f8ee gtk: Include the appropriate headers 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
3fdbe2ea13 widget: Make gtk_widget_get_parent_muxer() as static
It's a private function, used only inside gtkwidget.c and not declared
in any private header.
2016-10-17 11:10:14 +01:00
Emmanuele Bassi
24d59f6c34 inspector: Mark internal function as static 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
44885bcfed Remove redundant declarations 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
923b868400 gdk/x11: Constify argument 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
175800f345 Add private header for GtkTextView
This allows us to declare the symbols that are currently used inside
gtktextdisplay.c without incurring in the wrath of the compiler.
2016-10-17 11:10:14 +01:00
Emmanuele Bassi
8b9153d109 Remove redundant declarations 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
5e388fc3e4 Fix _gtk_get_slowdown()
We need to pass void as the argument type.
2016-10-17 11:10:14 +01:00
Emmanuele Bassi
1db5d7fd8d Remove redundant declarations 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
81e5996c91 Include the appropriate headers
The GtkStackAccessible implementation should include the private header,
and the private header should include the public one.
2016-10-17 11:10:14 +01:00
Emmanuele Bassi
d8892c0fdb Remove redundant declarations 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
137e1aa988 Use appropriate const declaration for static strings 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
68cab95c5d Remove re-declarations of public functions 2016-10-17 11:10:14 +01:00
Emmanuele Bassi
d64ca9560c Remove redundant declaration 2016-10-17 11:10:13 +01:00
Emmanuele Bassi
a87bdc47c7 stylecontext: Remove gtk_gradient_resolve_for_context()
Just like we remove gtk_gradient_resolve().
2016-10-17 11:10:13 +01:00
Emmanuele Bassi
dae97c3027 textview: Remove commented block
It's referencing gdk_cairo_create(), which does not exist any more.
2016-10-17 10:44:27 +01:00
Emmanuele Bassi
cf9b9a034b gdk: Comment out gdk_cairo_create() 2016-10-17 10:44:27 +01:00
Emmanuele Bassi
07cd87eb9c gdk: Remove mentions of gdk_cairo_create()
This function does not exist any more.
2016-10-17 10:44:27 +01:00
Matthias Clasen
95b9981a87 Fix the doc build
Remove no-longer-existing types.
2016-10-16 14:10:52 -04:00
Piotr Drąg
12dad0c234 Update POTFILES.in 2016-10-16 19:49:54 +02:00
Benjamin Otte
a65a4de38d gdk: Remove old code to create drawing context
You now have to use a GdkDrawingContext
2016-10-16 18:18:58 +02:00
Benjamin Otte
17895e746c tests: Remove custom preview from print-editor
It's using gdk_cairo_create() to do the drawing, which is unsupported.
2016-10-16 18:18:58 +02:00
Benjamin Otte
b4a7fc7d75 tests: Remove code from testinput that does nothing 2016-10-16 18:18:58 +02:00
Benjamin Otte
e76ba9a3c3 gdk: Remove gdk_window_set_debug_updates()
The update tracking code was ugly and using deprecated drawing APIs. It
was also in the wrong place.

So instead of trying to keep it working, I'll remove it. We need to find
a better way to put it and make it work there.
2016-10-16 18:18:58 +02:00
Benjamin Otte
4a95f8802c widget: Remove gtk_widget_set_double_buffered()
Everything is always double-buffered.
2016-10-16 18:18:58 +02:00
Benjamin Otte
36b7ad0cd2 shortcutswindow: Modernize some code
No functional changes, just don't call valist functions anymore.
2016-10-16 18:18:58 +02:00
Benjamin Otte
6c7b6f9654 menu: Modernize code
No functional changes, just don't call valist functions anymore.
2016-10-16 18:18:58 +02:00
Benjamin Otte
cda617df4d API: sizegroup: Remove gtk_size_group_set_ignore_hidden() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1d4f23da8e API: container: Remove GtkContainer::child property 2016-10-16 18:18:58 +02:00
Benjamin Otte
d4d3374729 container: Remove gtk_container_set_resize_mode() 2016-10-16 18:18:58 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Benjamin Otte
7ae008421a API: Remove libgail-util 2016-10-16 18:18:58 +02:00
Benjamin Otte
9b9b475f0a API: stylecontext: Remove regions 2016-10-16 18:17:21 +02:00
Benjamin Otte
1a7dcb2053 gdk: Remove unused argument parsing structs 2016-10-16 18:17:21 +02:00
Benjamin Otte
59c702d88c gdk: Remove leftover structs from ClientMessage days 2016-10-16 18:17:21 +02:00
Benjamin Otte
10a7963ebf gdk: Remove unused structs from ColorMap days 2016-10-16 18:17:21 +02:00
Benjamin Otte
95d2f0b831 css: Remove custom properties
Those aren't used anymore, now that theming engines are gone.
2016-10-16 18:17:21 +02:00
Benjamin Otte
1a5b842682 API: Remove GtkStyleProperties 2016-10-16 18:17:21 +02:00
Benjamin Otte
dd83f9ca86 API: Remove API to set CSS properties from GValues
This API was only used in GtkModifierStyle and GtkStyleProperties and
they are both on their way out.

CSS properties must now be set using strings via the regular parser API.
2016-10-16 18:17:21 +02:00
Benjamin Otte
66dd954290 API: stylecontext: Remove old unused animation functions 2016-10-16 18:17:21 +02:00
Timm Bäder
f2c455fedb Remove GtkThemingEngine
As well as the corresponding GtkCssEngineValue used to parse it in css.
2016-10-16 18:17:21 +02:00
Timm Bäder
9f930c08a6 ui: Don't unnecessarily set GtkEntry:invisible-char 2016-10-16 18:17:21 +02:00
Timm Bäder
f360a69f4c entry: Remove invisible-char style property 2016-10-16 18:17:21 +02:00
Timm Bäder
58a76b700f stylecontext: Remove _REGION_ constants 2016-10-16 18:17:21 +02:00
Timm Bäder
ed184b3935 Remove GtkIconFactory
Move the icon size lookup API into gtkicontheme.c
2016-10-16 18:17:21 +02:00
Timm Bäder
5b00a31c30 widget-factory: Stop using custom icon sizes 2016-10-16 18:17:21 +02:00
Timm Bäder
9fd1a1bbe3 widget: Remove cursor-aspect-ratio/window-dragging style properties
And replaces its usages in GtkTextView/GtkStyleContext with a hard-coded
0.04 which was the default value for cursor-aspect-ratio.  Also remove
the public gtk_draw_insertion_cursor which used draw_insertion_cursor
which in turn looked up cursor-aspect-ratio
2016-10-16 18:17:21 +02:00
Timm Bäder
ccd3ff7fba gtkwidget: Remove gtk_widget_class_install_style_property_parser...
... from public API
2016-10-16 18:17:21 +02:00
Timm Bäder
281c1e4fe5 widget: Remove cursor-aspect-ratio style property 2016-10-16 18:17:21 +02:00
Timm Bäder
08c1c584b3 Remove GtkModifierStyle 2016-10-16 18:17:21 +02:00
Timm Bäder
9a388690f4 widget: Remove gtk_widget_override* API 2016-10-16 18:17:21 +02:00
Timm Bäder
addb655aee testoverlay: Stop using gtk_widget_override API 2016-10-16 18:17:21 +02:00
Timm Bäder
7377b7e5c2 plugman: Stop using gtk_override_color 2016-10-16 18:17:21 +02:00
Timm Bäder
3c901d6376 Remove a few more unused style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
b1d35a594e widget: Remove text-handle-width/height style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
9f5baf9130 GtkTextHandle: Use min-width/min-height
instead of GtkWidget's text-handle-width/text-handle-height style
properties
2016-10-16 18:17:21 +02:00
Timm Bäder
999d45b4e8 Remove various unused style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
6a6c49369e Fix a few GtkTextTag:*-gdk references 2016-10-16 18:17:21 +02:00
Timm Bäder
601839c825 Remove various sizing related style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
feac88dc52 switch: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
86dbe591d2 entry: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
2455bd0857 widget: Remove visibility-notify-event 2016-10-16 18:17:21 +02:00
Timm Bäder
1add02879e entry: Remove inner-border (style) property 2016-10-16 18:17:21 +02:00
Timm Bäder
878f2e4107 widget: Remove deprecated margin-left/right properties 2016-10-16 18:17:21 +02:00
Timm Bäder
d34b7d98b2 widget: Remove gtk_widget_{s,g}et_composite_name 2016-10-16 18:17:21 +02:00
Timm Bäder
80ab5ea942 widget: Remove gtk_widget_get_requisition 2016-10-16 18:17:21 +02:00
Timm Bäder
16b0906b4a widget: Remove gtk_widget_send_expose 2016-10-16 18:17:21 +02:00
Timm Bäder
bc0cef27a2 widget: Remove gtk_widget_{s,g}et_state 2016-10-16 18:17:21 +02:00
Timm Bäder
4a2c087a1e widget: Remove gtk_widget_region_intersect 2016-10-16 18:17:21 +02:00
Timm Bäder
a80a1cf8a6 widget: Remove gtk_widget_get_child_requisition 2016-10-16 18:17:21 +02:00
Timm Bäder
b3bd5fefb1 widget: Remove gtk_widget_size_request 2016-10-16 18:17:21 +02:00
Timm Bäder
4c10807e24 widget: Remove state-changed signal 2016-10-16 18:17:21 +02:00
Timm Bäder
96d9abded8 widget: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
2cfa05fc84 testsensitive: Use state-flags-changed instead of state-changed 2016-10-16 18:17:21 +02:00
Timm Bäder
040db1efcd Remove some deprecated GdkColor style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
627a824cab image: Remove GtkIconSet API 2016-10-16 18:17:21 +02:00
Timm Bäder
efffa3b6bd range: Remove min slider size setter/getter 2016-10-16 18:17:21 +02:00
Timm Bäder
aca35a14a0 scrollbar: Remove min-slider-length style property 2016-10-16 18:17:21 +02:00
Timm Bäder
116cb9fc0c label: Remove now unneeded deprecation markers 2016-10-16 18:17:21 +02:00
Timm Bäder
2e96f8ae70 scrolledwindow: Remove window-placement-set property 2016-10-16 18:17:21 +02:00
Timm Bäder
ba9220591f scrolledwindow: Remove scrollbar-spacing and scrollbars-within-bevel 2016-10-16 18:17:21 +02:00
Timm Bäder
05353ec933 scrolledwindow: Remove _add_with_viewport
Replaced by a normal gtk_container_add
2016-10-16 18:17:21 +02:00
Timm Bäder
33ece4e37a Remove GtkHSV 2016-10-16 18:17:21 +02:00
Timm Bäder
134556435d Remove various deprecated GtkOrientable subclasses 2016-10-16 18:17:21 +02:00
Timm Bäder
d06d17b81e Remove gtkcolorsel(dialog).{c,h} 2016-10-16 18:17:21 +02:00
Timm Bäder
9c09669711 window: Remove _set/_get_opacity 2016-10-16 18:17:21 +02:00
Timm Bäder
7fa4ac08ea window: Remove resize grip API 2016-10-16 18:17:21 +02:00
Timm Bäder
9cfbaf4916 Remove gtkfontsel.{c,h} 2016-10-16 18:17:21 +02:00
Timm Bäder
3b336dda73 dialog: Remove alternative button order API 2016-10-16 18:17:21 +02:00
Timm Bäder
2acc31b46a Remove GtkHandleBox 2016-10-16 18:17:21 +02:00
Timm Bäder
155fa4664d Remove GtkImageMenuItem 2016-10-16 18:17:21 +02:00
Timm Bäder
8a3595236d reftests: Remove GtkMisc tests 2016-10-16 18:17:21 +02:00
Timm Bäder
5d3a5ffdfb Fix a few css/a11y test cases
They were broken because of missing -icon-stock properties in GtkEntry
and GtkButton not creating an adjustment child anymore.
2016-10-16 18:17:21 +02:00
Timm Bäder
7f79a3fade Remove GtkMisc 2016-10-16 18:17:21 +02:00
Timm Bäder
cc3dceee83 testfilechooserbutton: Remove GtkMisc API usage 2016-10-16 18:17:21 +02:00
Timm Bäder
7088d9d294 reftests: Remove celldenderer-pixbuf-stock
The stock properties tested here don't exist anymore.
2016-10-16 18:17:21 +02:00
Timm Bäder
367f13a76f Remove GtkArrow 2016-10-16 18:17:21 +02:00
Timm Bäder
9b5a50bf22 shortcutswindow: Stop using GtkArrow 2016-10-16 18:17:21 +02:00
Timm Bäder
ad155fb26c Remove GtkStock API from GtkImage 2016-10-16 18:17:21 +02:00
Timm Bäder
f37cb8f9d0 reftests: Remove GtkMisc properties from now non-misc widgets 2016-10-16 18:17:21 +02:00
Timm Bäder
eadb49d97f recentchoosermenu: Stop using GtkImageMenuItem 2016-10-16 18:17:21 +02:00
Timm Bäder
421be38a3c toolbutton: Stop using GtkImageMenuItem 2016-10-16 18:17:21 +02:00
Timm Bäder
d36e4125d1 testgtk: Remove GtkImageMenuItem usage 2016-10-16 18:17:21 +02:00
Timm Bäder
b9a304cf6f testgtk: fix css 2016-10-16 18:17:21 +02:00
Timm Bäder
ac31a00dcf testbuttons: Stop looking at use-stock property
Doesn't exist anymore. Instead, force the image to be visible on one of
the buttons.
2016-10-16 18:17:21 +02:00
Timm Bäder
10e24d58c3 button: Remove _{get,set}_focus_click
Deprecated for the GtkWidget variant. Also remove some unused fields
from the GtkButtonPrivate struct.
2016-10-16 18:17:21 +02:00
Timm Bäder
10a92a210b button: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
9f2ca684e2 button: Remove deprecated signals from public API 2016-10-16 18:17:21 +02:00
Timm Bäder
590cd6a9f2 button: Remove GtkStock API 2016-10-16 18:17:21 +02:00
Timm Bäder
4162d65a7b tests: Remove teststockbuttonmenu 2016-10-16 18:17:21 +02:00
Timm Bäder
485d1b9835 Button: Remove alignment API 2016-10-16 18:17:21 +02:00
Timm Bäder
9d43644153 label,image: Remove GtkMisc usage 2016-10-16 18:17:21 +02:00
Timm Bäder
f45dadadd0 box: Remove 'padding' child property 2016-10-16 18:17:21 +02:00
Timm Bäder
c301357627 inspector: Remove object_title from css editor
It's unused
2016-10-16 18:17:21 +02:00
Timm Bäder
91f989006c Don't use GtkBox's center child in a few places
We can as well use a normal child and let it hexpand.
2016-10-16 18:17:21 +02:00
Benjamin Otte
eace2cf421 API: Remove gdk_window_set_background()
Backgrounds are always transparent black.
2016-10-16 18:17:21 +02:00
Benjamin Otte
bae12e6a2f tests: Remove testwindows test
It wasn't drawing anything anymore...
2016-10-16 18:17:21 +02:00
Benjamin Otte
0df388051d API: Remove GtkStyle
All the remaining gtkrc.c stuff like GtkRcStyle goes with it.
2016-10-16 18:17:21 +02:00
Benjamin Otte
05763e4875 settings: Pull in the RC parsing code 2016-10-16 18:17:21 +02:00
Benjamin Otte
361d322bfb immodules: Move path code out of gtkrc 2016-10-16 18:17:21 +02:00
Benjamin Otte
1aa336b500 cellrendererspinner: Draw our own spinner
This is the GtkStyle code just moved.
2016-10-16 18:17:21 +02:00
Benjamin Otte
662001b60a API: Remove ability to set visuals on windows
And with it, gtk_widget_get_visual() and gtk_widget_set_visual() are
gone.

We now always use the RGBA visual (if available) and otherwise fall back
to the system visual.
2016-10-16 18:17:21 +02:00
Benjamin Otte
380494c1d7 API: Remove gtk_drag_dest_set_proxy()
Proxies were only used by GtkSocket.
2016-10-16 18:17:21 +02:00
Benjamin Otte
021fe010b6 API: Remove GtkPlug, GtkSocket and GtkWin32EmbedWidget 2016-10-16 18:17:21 +02:00
Benjamin Otte
89f2e17f91 API: Remove gdk_window_set_composited()
And the related call gdk_display_supports_composite().
2016-10-16 18:17:21 +02:00
Benjamin Otte
8d54c641f1 screen: Remove unused vfunc
GdkScreenClass.broadcast_client_message was unused, but a bunch of
backends still had functions (not) implementing it.
2016-10-16 18:17:21 +02:00
Benjamin Otte
ad64402a55 filechooserwidget: Query dpi from CssStyle 2016-10-16 18:17:21 +02:00
Benjamin Otte
77cdbfde97 fontchooserwidget: Query dpi from CssStyle 2016-10-16 18:17:21 +02:00
Benjamin Otte
fec8069e7b API: screen: Stop storing font options
font options are only ever set by the GtkSettings object and only ever
used inside GTK, so just store them there.
2016-10-16 18:17:21 +02:00
Benjamin Otte
fcbd480c76 API: Remove GDK_WA_CURSOR
The cursor was set using gdk_window_set_cursor() even in
gdk_window_new().

So instead of having yet another flag, just make the users of that flag
call gdk_window_set_cursor() directly after the window was created.
2016-10-16 18:17:21 +02:00
Benjamin Otte
2fd5048943 API: window: Remove suppport for changing wmclass_name/group
X11 was the only backend to support it and people can just override it
using XSetClassHint() directly.
The docs already advertised the function as "Do not use".

Keep the existing call to XSetClassHint() in place, so that we keep
setting the same values as in GTK3.
2016-10-16 18:17:21 +02:00
Timm Bäder
fe24fcbc3e Delete gtkvbox.{c,h} 2016-10-16 18:17:21 +02:00
Timm Bäder
fb3d9022ad Remove GtkHBox 2016-10-16 18:17:21 +02:00
Benjamin Otte
9a5de96187 API: Remove GtkNumerableIcon 2016-10-16 18:17:21 +02:00
Benjamin Otte
d09e48cec1 API: Remove -gtk_widget_get_root_window() 2016-10-16 18:17:21 +02:00
Benjamin Otte
9be9e00a0e API: screen: Remove gdk_screen_make_display_name()
It's identical to gdk_display_get_name().
2016-10-16 18:17:21 +02:00
Benjamin Otte
6b9e481e38 API: screen: Remove gdk_screen_get_active_window()
... and gdk_screen_get_window_stack().

Those functions were originally added in
5afb4f0f11 but do not seem to be used as
they are not implemented anywhere but in X.

As GDK is not meant to fulfill window management functionality I'm going
to remove these functions without replacements.
2016-10-16 18:17:21 +02:00
Benjamin Otte
26f9b584be API: gdk: Remove gdk_screen_get_number()
It's useless everywhere but in internal X11 code.
2016-10-16 18:17:21 +02:00
Benjamin Otte
0be88cc76e API: Remove gdk_screen_get_width() and gdk_screen_get_height()
... and gdk_screen_get_width_mm() and gdk_screen_get_height_mm() and
the shortcut counterparts that call these functions on the default
screen.

Modern display servers don't provide an ability to query the size of a
screen or display so we shouldn't allow that either.
2016-10-16 18:17:21 +02:00
Benjamin Otte
579edbbca8 display: Insist that backends implement the monitor vfuncs
We cannot fallback anymore once we remove the ability to query screen
size, and that's about to happen.
2016-10-16 18:17:21 +02:00
Benjamin Otte
ed30f271f5 gdk: Insist axis.min_value < axis.max_value
Remove fallback code that would substitute screen size otherwise.
2016-10-16 18:17:21 +02:00
Benjamin Otte
2033b06cb6 gdk: Require passing screen size to translate_screen_coord() 2016-10-16 18:17:21 +02:00
Benjamin Otte
4445807421 shooter: Use root window size instead of screen size
Avoids usage deprecated screen size.
2016-10-16 18:17:21 +02:00
Benjamin Otte
013caef941 testgtk: Remove feature unsupported in Wayland
Wayland doesn't allow positioning windows randomly, so don't try.
2016-10-16 18:17:21 +02:00
Benjamin Otte
c2125e80a3 API: window: Remove geometry support 2016-10-16 18:17:21 +02:00
Benjamin Otte
4ed9452e90 API: menu: Remove tearoff support 2016-10-16 18:17:21 +02:00
Benjamin Otte
1a0a423250 API: gdk: Remove monitor APIs on GdkScreen 2016-10-16 18:17:21 +02:00
Benjamin Otte
d2a8667f83 API: Remove GtkStatusIcon 2016-10-16 18:17:21 +02:00
Benjamin Otte
c0276e2c5c applaunchcontext: Ignore screen name
It's guaranteed to be identical to the display name.
2016-10-16 18:17:21 +02:00
Benjamin Otte
9222b4cd7c inspector: Use display name instead of screen name
This is for future compatibility as they are guaranteed to be identical.
2016-10-16 18:17:21 +02:00
Benjamin Otte
f7cebf5c1f wayland: Use GdkMonitor APIs 2016-10-16 18:17:21 +02:00
Benjamin Otte
7232b4f735 x11: Use GdkMonitor APIs 2016-10-16 18:17:21 +02:00
Benjamin Otte
d33c251cf6 gdk: Use GdkMonitor APIs
... instead of the old ones using GdkScreen
2016-10-16 18:17:21 +02:00
Benjamin Otte
266fd36f3f inspector: Port to GdkMonitor 2016-10-16 18:17:21 +02:00
Benjamin Otte
29c570a660 tests: Port to GdkMonitor 2016-10-16 18:17:21 +02:00
Benjamin Otte
76d95c312d display: Don't return NULL in get_primary_monitor()
Nobody ever does a NULL check there so all that causes is crashes. So
we better return a non-primary monitor than NULL.

Fixes gdk-wayland always returning NULL.
2016-10-16 18:17:21 +02:00
Benjamin Otte
dcb816f99a gdk: Fix docs typo 2016-10-16 18:17:21 +02:00
Benjamin Otte
7016409e9f gdk: Get rid of unused variables 2016-10-16 18:15:37 +02:00
Aurimas Černius
713d4ad3e6 Updated Lithuanian translation 2016-10-15 22:07:36 +03:00
Matthias Clasen
a703ba8406 Avoid 0/FALSE confusion
Since this is supposedly exemplary code, lets get it right.

https://bugzilla.gnome.org/show_bug.cgi?id=772683
2016-10-14 11:15:27 -04:00
Alan Jenkins
b7baf3371b shortcutswindow: working version of set_section_name()
(testing before+after, it actually works now)

https://bugzilla.gnome.org/show_bug.cgi?id=772926
2016-10-14 10:57:32 -04:00
Matthias Clasen
565b35ac00 Add new gestures to gtk4-demo
Show the new single-finger swipe gestures in the builder
shortcuts example.
2016-10-13 15:02:36 -04:00
Felix Riemann
b6cdc3961a GtkShortcutsShortcut: Support single finger swipe gestures
https://bugzilla.gnome.org/show_bug.cgi?id=772770
2016-10-13 15:02:36 -04:00
Jakub Steiner
21fa12120c gestures: provide new artwork
- illustrations for single finger swiping left and right

https://bugzilla.gnome.org/show_bug.cgi?id=772770
2016-10-13 15:02:36 -04:00
Ben Iofel
a9464f65c3 docs: replace gtk3 with gtk4 in man pages 2016-10-13 13:45:14 -04:00
Alan Jenkins
38667b8dd0 scrolledwindow: fix leak of pan_gesture
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:02 -04:00
Alan Jenkins
982c4a70b6 headerbar: fix leak of label_sizing_box
Since the widget is not added to a container, we have the responsibility
to sink the initial floating reference, and ultimately to unref it.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:02 -04:00
Alan Jenkins
3731da14a0 headerbar: fix leak of separator
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:02 -04:00
Alan Jenkins
8ef4f7fd74 headerbar: fix leak of start_box/end_box
gtk_widget_destroy() removes widgets from their container.  However
_internal_ widgets must be unref'ed using gtk_widget_unparent() instead.
This is symmetric with the fact that these widgets were ref'ed by direct
call to gtk_widget_set_parent().  It's also the method that was used in
gtk_headerbar_destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:01 -04:00
Alan Jenkins
8aa9339b2d shortcutsgroup: fix leak of title
like previous commit, albeit simpler this time

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:01 -04:00
Alan Jenkins
353281d9d0 applicationwindow: fix leak of help_overlay
> Due to Gtk+ keeping a reference to the window internally,
> gtk_window_new() does not return a reference to the caller.
> To delete a GtkWindow, call gtk_widget_destroy().

Caller(s) aren't expecting a need to delete help_overlay themselves
once they've installed it.  (E.g. see gtk_application_window_added()).

I didn't notice any direct precedents, but there's a parallel in the
current implementation of gtk_container_destroy() which uses
gtk_widget_destroy() on any added widget.

This avoids leaking 100s of kB per window, when I tested nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:39:01 -04:00
Christian Hergert
133da65433 menusectionbox: add support for "text-direction" attribute
This allows the use of a "text-direction" hint set to one of "none", "rtl",
or "ltr" to enforce the text direction of a "horizontal-buttons"
display-hint.

This is useful when a menu has buttons that map to physical space in the
UI and therefore must match the application widgetry.

https://bugzilla.gnome.org/show_bug.cgi?id=772775
2016-10-13 06:34:50 -04:00
Olivier Fourdan
9e2b1ad39e gdkwindow: configure native windows in move_native_children()
ClutterEmbed on Wayland uses a subsurface and relocates it on configure
events, but when placed within a scrolled window, no configure event is
emitted and the ClutterEmbed subsurface remains static.

Emit a configure event for native windows in GdkWindow's internal
move_native_children() so that custom widgets relying on configure
events such as ClutterEmbed can relocate their stuff.

Similarly, when switching to/from normal/maximized/fullscreen states
which change the shadows' size and possibly shows/hides a header bar,
we need to emit a configure event even if the abs_x/abs_y haven't
changed to make sure the subsurface is size appropriately.

https://bugzilla.gnome.org/show_bug.cgi?id=771320
https://bugzilla.gnome.org/show_bug.cgi?id=767713
2016-10-13 08:53:59 +02:00
Piotr Drąg
b65fbbf739 Update Polish translation 2016-10-12 19:50:06 +02:00
Lapo Calamandrei
9054e49776 Adwaita: dodge drop active style for window and decoration nodes
to hilight drop target there is a wildcard selector which turns
the border and shadow to green, this clearly shouldn't happen when
the whole window is a drop target.
2016-10-12 19:34:10 +02:00
Tom Tryfonidis
3e3f20854b Update Greek translation
(cherry picked from commit e74dc54567)
2016-10-11 11:05:34 +00:00
Christian Hergert
a68915abd1 shortcuts: the accelerator should always be LTR
Even on RTL languages, we want the shortcut to be LTR so that we always
have <control> to the left of the accel keyval.

https://bugzilla.gnome.org/show_bug.cgi?id=772695
2016-10-10 13:56:48 -07:00
djb
fe6030a41b gtkplacesviewrow: stop busy_spinner from offsetting the other widgets when visible
...by putting it in a stack. The busy_spinner and eject_button are
mutually exclusive, but only the latter was coded to ensure that its
visibility did not cause the rest of the row to reflow. By putting both
widgets in a stack and setting child_visible on that, the row allocates
enough space to show one - or none - at once, avoiding any misalignment.

https://bugzilla.gnome.org/show_bug.cgi?id=772345

https://bugzilla.gnome.org/show_bug.cgi?id=772348
2016-10-10 15:13:50 -04:00
Matthias Clasen
0d00e0c3d3 Fix the build 2016-10-10 14:37:09 -04:00
Adam Jackson
434ce02ebe Use eglGetPlatformDisplay{,EXT} if available
Calling eglGetDisplay forces libEGL to guess what kind of pointer you
passed it. Different EGL libraries will do different things here, and in
particular glvnd will do something different than Mesa. Since we do have
an API that allows us to explicitly type the display, use it.

The explicit call to eglGetProcAddress is working around a bug in
libepoxy 1.3, which does not understand the EGL concept of client
extensions. Since it does not, the normal epoxy resolver for
eglGetPlatformDisplayEXT would not find any provider for that entry
point, and crash when you attempted to call it.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:17:09 -04:00
Adam Jackson
3b11575f0b Fix some EGLDisplay * abuse
EGLDisplays are already opaque pointers, and eglGetDisplay returns an
EGLDisplay not a pointer to one.

Signed-off-by: Adam Jackson <ajax@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772415
2016-10-10 14:17:09 -04:00
Ask Hjorth Larsen
31b77ae0b6 Updated Danish translation 2016-10-09 22:05:28 +02:00
Rūdolfs Mazurs
5db8cc4f18 Update Latvian translation 2016-10-09 19:32:14 +03:00
Matthias Clasen
b373c6054e Remove autoconf macros from the docs 2016-10-07 14:05:57 -04:00
Matthias Clasen
a03a12098d Drop deprecated autoconf macro
AM_PATH_GTK_3_0 is deprecated, use PKG_CHECK_MODULES([GTK], [gtk+-3.0])
instead.
2016-10-07 13:26:37 -04:00
Matthias Clasen
ce74c3a5a5 Re-add missing files 2016-10-07 11:17:49 -04:00
Matthias Clasen
bbe5980c54 Make docs parallel installable
This addresses gdk and gtk docs.
2016-10-07 10:34:50 -04:00
Matthias Clasen
b337b405a3 Make the demos build 2016-10-07 10:34:50 -04:00
Matthias Clasen
d053d5c58f Rename Makefile references from 3.0 to 4.0
This is almost certainly incomplete.
Needs careful scrutiny
2016-10-07 10:34:50 -04:00
Matthias Clasen
74f3d7f6d3 Switch gettext domain from gtk30 to gtk40 2016-10-07 10:34:50 -04:00
Matthias Clasen
ecd384eeb7 Adjust versions in configure.ac
This is almost certainly incomplete or wrong in some places.
Needs careful scrutiny
2016-10-07 10:34:50 -04:00
Matthias Clasen
4cce6104a4 Rename pc files from 3.0 to 4.0 2016-10-07 10:34:50 -04:00
gogo
eeffde368f Update Croatian translation
(cherry picked from commit 0a08a199d8)
2016-10-06 16:16:43 +00:00
gogo
f06485e278 Update Croatian translation
(cherry picked from commit 051fddaa61)
2016-10-06 16:09:19 +00:00
Matthias Clasen
ddd1ac0934 entry: Fix a corner case of overwrite mode
We currently beep when a character is appended at the end in
overwrite mode. That is obviously not right. Patch based on
a patch by Ian MacDonald.

https://bugzilla.gnome.org/show_bug.cgi?id=772389
2016-10-05 12:22:21 -04:00
Lapo Calamandrei
3da324fbce Adwaita: render updated assets. 2016-10-05 13:47:52 +02:00
Lapo Calamandrei
f2eda1acc5 Adwaita: update assets svg
correct colors for pointy sliders assets.
2016-10-05 11:35:47 +02:00
Piotr Drąg
81cad59aeb gtk-launch: Move translator comment one line down
So it appears in .po files.
2016-10-03 16:45:20 +02:00
William Hua
83efaaf64a gtkcombobox: pass trigger event when popping up menu
https://bugzilla.gnome.org/show_bug.cgi?id=771242
2016-10-03 09:18:59 -04:00
Milo Casagrande
870af2b7c6 Updated Italian translation 2016-10-03 09:36:15 +00:00
Milo Casagrande
fac9d59303 Updated Italian translation 2016-10-03 09:30:44 +00:00
Jiri Grönroos
51fb56504e Updated Finnish translation 2016-10-02 17:57:30 +00:00
974 changed files with 18244 additions and 69813 deletions

View File

@@ -1,8 +1,8 @@
## Makefile.am for GTK+
include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
SRC_SUBDIRS = gdk gsk gtk modules demos tests testsuite examples
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs build
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -36,40 +36,41 @@ MAINTAINERCLEANFILES = \
## Copy .pc files to target-specific names
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc gtk+-mir-3.0.pc: gtk+-3.0.pc
gtk+-x11-4.0.pc gtk+-win32-4.0.pc gtk+-quartz-4.0.pc gtk+-broadway-4.0.pc gtk+-wayland-4.0.pc gtk+-mir-4.0.pc: gtk+-4.0.pc
rm -f $@ && \
cp gtk+-3.0.pc $@
cp gtk+-4.0.pc $@
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc gdk-mir-3.0.pc: gdk-3.0.pc
gdk-x11-4.0.pc gdk-win32-4.0.pc gdk-quartz-4.0.pc gdk-broadway-4.0.pc gdk-wayland-4.0.pc gdk-mir-4.0.pc: gdk-4.0.pc
rm -f $@ && \
cp gdk-3.0.pc $@
cp gdk-4.0.pc $@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-3.0.pc gtk+-3.0.pc gail-3.0.pc
pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-3.0.pc}
pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-3.0.pc}
pkgconfig_DATA = gdk-4.0.pc gsk-4.0.pc gtk+-4.0.pc gail-4.0.pc
pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-4.0.pc}
pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-4.0.pc}
if OS_UNIX
pkgconfig_DATA += gtk+-unix-print-3.0.pc
pkgconfig_DATA += gtk+-unix-print-4.0.pc
endif
DISTCLEANFILES = \
gtk+-unix-print-3.0.pc \
gtk+-3.0.pc \
gtk+-x11-3.0.pc \
gtk+-win32-3.0.pc \
gtk+-quartz-3.0.pc \
gtk+-broadway-3.0.pc \
gtk+-wayland-3.0.pc \
gtk+-mir-3.0.pc \
gdk-3.0.pc \
gdk-x11-3.0.pc \
gdk-win32-3.0.pc \
gdk-quartz-3.0.pc \
gdk-broadway-3.0.pc \
gdk-wayland-3.0.pc \
gdk-mir-3.0.pc \
gail-3.0.pc \
gtk+-unix-print-4.0.pc \
gtk+-4.0.pc \
gtk+-x11-4.0.pc \
gtk+-win32-4.0.pc \
gtk+-quartz-4.0.pc \
gtk+-broadway-4.0.pc \
gtk+-wayland-4.0.pc \
gtk+-mir-4.0.pc \
gsk-4.0.pc \
gdk-4.0.pc \
gdk-x11-4.0.pc \
gdk-win32-4.0.pc \
gdk-quartz-4.0.pc \
gdk-broadway-4.0.pc \
gdk-wayland-4.0.pc \
gdk-mir-4.0.pc \
gail-4.0.pc \
config.lt
distclean-local:
@@ -93,7 +94,7 @@ ChangeLog:
.PHONY: ChangeLog
uninstall-local:
rm -f $(DESTDIR)$(pkgconfigdir)/gtk+-3.0.pc
rm -f $(DESTDIR)$(pkgconfigdir)/gtk+-4.0.pc
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
@@ -104,6 +105,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-installed-tests
GITIGNORE_TRANSLATION_DIRS = po-properties
GITIGNOREFILES = po-properties/gtk30-properties.pot
GITIGNOREFILES = po-properties/gtk40-properties.pot
-include $(top_srcdir)/git.mk

View File

@@ -9,15 +9,15 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [22])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [1])
m4_define([gtk_minor_version], [89])
m4_define([gtk_micro_version], [0])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
[gtk_major_version.gtk_minor_version.gtk_micro_version])
# This is the X.Y used in -lgtk-FOO-X.Y
m4_define([gtk_api_version], [3.0])
# This is the X.Y used in -lgtk-X.Y
m4_define([gtk_api_version], [4.0])
AC_PREREQ([2.62])
AC_INIT([gtk+], [gtk_version],
@@ -38,7 +38,7 @@ AC_CANONICAL_HOST
# for GTK+.
#
#GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
m4_define([gtk_binary_version], [3.0.0])
m4_define([gtk_binary_version], [4.0.0])
# required versions of other packages
m4_define([glib_required_major], [2])
@@ -64,6 +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])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
ATK_REQUIRED_VERSION=atk_required_version
@@ -168,7 +169,7 @@ AC_USE_SYSTEM_EXTENSIONS
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.7])
GETTEXT_PACKAGE=gtk30
GETTEXT_PACKAGE=gtk40
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The prefix for our gettext translation domains.])
@@ -1365,6 +1366,26 @@ AC_SUBST(GDK_EXTRA_CFLAGS)
AC_SUBST(GDK_DEP_LIBS)
AC_SUBST(GDK_DEP_CFLAGS)
########################################
# Check for GSK flags
########################################
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"
PKG_CHECK_MODULES(GSK_DEP, $PANGO_PACKAGES $GSK_PACKAGES $GSK_PRIVATE_PACKAGES)
GSK_DEP_LIBS="$GSK_EXTRA_LIBS $GSK_DEP_LIBS $MATH_LIB"
GSK_DEP_CFLAGS="$GSK_DEP_CFLAGS $GSK_EXTRA_CFLAGS"
AC_SUBST(GSK_PACKAGES)
AC_SUBST(GSK_PRIVATE_PACKAGES)
AC_SUBST(GSK_EXTRA_LIBS)
AC_SUBST(GSK_EXTRA_CFLAGS)
AC_SUBST(GSK_DEP_LIBS)
AC_SUBST(GSK_DEP_CFLAGS)
########################################
# Check for Accessibility Toolkit flags
@@ -1379,7 +1400,7 @@ fi
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version graphene-1.0 >= graphene_required_version"
if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
fi
@@ -1862,6 +1883,37 @@ _______EOF
gdk_windowing='$GDK_WINDOWING'
])
dnl Compiler flags; macro originates from systemd
dnl See https://bugzilla.gnome.org/show_bug.cgi?id=608953
AC_ARG_ENABLE(compile-warnings,
[AS_HELP_STRING([--disable-compile-warnings], [Do not use builtin compiler warnings])],
[],
[enable_compile_warnings=yes])
AS_IF([test "x$enable_compile_warnings" = xyes], [
AX_APPEND_COMPILE_FLAGS([ dnl
-Wall dnl
-Wundef dnl
-Wnested-externs dnl
-Wpointer-arith dnl
-Wstrict-prototypes dnl
-Wcast-align dnl
-Wuninitialized dnl
-Wmissing-include-dirs dnl
-Wshadow dnl
-Wformat=2 dnl
-Wformat-nonliteral dnl
-Wformat-security dnl
-Wimplicit-function-declaration dnl
-Werror=redundant-decls dnl
-Werror=write-strings dnl
-Werror=missing-declarations dnl
-Werror=missing-prototypes dnl
-Werror=empty-body dnl
-Werror=init-self dnl
], [GTK_WARN_CFLAGS])
])
AC_SUBST(GTK_WARN_CFLAGS)
dnl
dnl Check for -Bsymbolic-functions linker flag used to avoid
dnl intra-library PLT jumps, if available.
@@ -1891,11 +1943,11 @@ INSTALL
config.h.win32
gtk-zip.sh
Makefile
gdk-3.0.pc
gtk+-3.0.pc
gtk+-unix-print-3.0.pc
gail-3.0.pc
m4macros/Makefile
gdk-4.0.pc
gsk-4.0.pc
gtk+-4.0.pc
gtk+-unix-print-4.0.pc
gail-4.0.pc
po/Makefile.in
po-properties/Makefile.in
demos/Makefile
@@ -1925,6 +1977,7 @@ testsuite/css/parser/Makefile
testsuite/css/nodes/Makefile
testsuite/css/style/Makefile
testsuite/gdk/Makefile
testsuite/gsk/Makefile
testsuite/gtk/Makefile
testsuite/reftests/Makefile
testsuite/tools/Makefile
@@ -1932,11 +1985,11 @@ docs/Makefile
docs/reference/Makefile
docs/reference/gdk/Makefile
docs/reference/gdk/version.xml
docs/reference/gsk/Makefile
docs/reference/gsk/version.xml
docs/reference/gtk/Makefile
docs/reference/gtk/gtk3.types
docs/reference/gtk/gtk4.types
docs/reference/gtk/version.xml
docs/reference/libgail-util/Makefile
docs/reference/libgail-util/version.xml
docs/tools/Makefile
build/Makefile
build/win32/Makefile
@@ -1957,12 +2010,12 @@ gdk/quartz/Makefile
gdk/wayland/Makefile
gdk/mir/Makefile
gdk/gdkversionmacros.h
gsk/Makefile
gtk/Makefile
gtk/makefile.msc
gtk/gtkversion.h
gtk/gtk-win32.rc.body
gtk/libgtk3.manifest
libgail-util/Makefile
modules/Makefile
modules/input/Makefile
modules/printbackends/Makefile

View File

@@ -92,11 +92,11 @@ AM_CPPFLAGS = \
$(GTK_DEP_CFLAGS)
DEPS = \
$(top_builddir)/gtk/libgtk-3.la
$(top_builddir)/gtk/libgtk-4.la
LDADDS = \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-4.la \
$(top_builddir)/gdk/libgdk-4.la \
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \
-lm
@@ -106,10 +106,10 @@ AM_CPPFLAGS += $(FONTDEMO_CFLAGS)
LDADDS += $(FONTDEMO_LIBS)
endif
bin_PROGRAMS = gtk3-demo gtk3-demo-application
bin_PROGRAMS = gtk4-demo gtk4-demo-application
desktopdir = $(datadir)/applications
dist_desktop_DATA = gtk3-demo.desktop
dist_desktop_DATA = gtk4-demo.desktop
BUILT_SOURCES = demos.h demo_resources.c
@@ -132,22 +132,22 @@ demos.h: $(demos) geninclude.pl
demos.h.win32: $(demos_base) geninclude.pl
$(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos_base)) > demos.h.win32
nodist_gtk3_demo_SOURCES = demos.h
nodist_gtk4_demo_SOURCES = demos.h
gtk3_demo_SOURCES = \
gtk4_demo_SOURCES = \
$(demos) \
demo_resources.c \
main.c
gtk3_demo_DEPENDENCIES = $(DEPS)
gtk3_demo_LDADD = $(LDADDS)
gtk3_demo_LDFLAGS = -export-dynamic
gtk4_demo_DEPENDENCIES = $(DEPS)
gtk4_demo_LDADD = $(LDADDS)
gtk4_demo_LDFLAGS = -export-dynamic
gtk3_demo_application_SOURCES = \
gtk4_demo_application_SOURCES = \
application.c \
demo_resources.c
gtk3_demo_application_LDADD = $(LDADDS)
gtk4_demo_application_LDADD = $(LDADDS)
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/demo.gresource.xml)
@@ -164,12 +164,12 @@ appsicon48dir = $(iconthemedir)/48x48/apps
appsicon256dir = $(iconthemedir)/256x256/apps
appsiconscalabledir = $(iconthemedir)/scalable/apps
dist_appsicon16_DATA = data/16x16/gtk3-demo.png data/16x16/gtk3-demo-symbolic.symbolic.png
dist_appsicon22_DATA = data/22x22/gtk3-demo.png data/22x22/gtk3-demo-symbolic.symbolic.png
dist_appsicon24_DATA = data/24x24/gtk3-demo.png data/24x24/gtk3-demo-symbolic.symbolic.png
dist_appsicon32_DATA = data/32x32/gtk3-demo.png data/32x32/gtk3-demo-symbolic.symbolic.png
dist_appsicon48_DATA = data/48x48/gtk3-demo.png data/48x48/gtk3-demo-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk3-demo.png data/256x256/gtk3-demo-symbolic.symbolic.png
dist_appsicon16_DATA = data/16x16/gtk4-demo.png data/16x16/gtk4-demo-symbolic.symbolic.png
dist_appsicon22_DATA = data/22x22/gtk4-demo.png data/22x22/gtk4-demo-symbolic.symbolic.png
dist_appsicon24_DATA = data/24x24/gtk4-demo.png data/24x24/gtk4-demo-symbolic.symbolic.png
dist_appsicon32_DATA = data/32x32/gtk4-demo.png data/32x32/gtk4-demo-symbolic.symbolic.png
dist_appsicon48_DATA = data/48x48/gtk4-demo.png data/48x48/gtk4-demo-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk4-demo.png data/256x256/gtk4-demo-symbolic.symbolic.png
update_icon_cache = $(top_builddir)/gtk/gtk-update-icon-cache$(EXEEXT) --ignore-theme-index --force
@@ -185,19 +185,19 @@ uninstall-update-icon-cache:
test -n "$(DESTDIR)" || $(update_icon_cache) "$(iconthemedir)"
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gtk3-demo gtk3-demo-application
MSVCPROJS = gtk4-demo gtk4-demo-application
gtk3_demo_FILES = $(gtk3_demo_SOURCES)
gtk3_demo_EXCLUDES = font_features.c|pagesetup.c
gtk4_demo_FILES = $(gtk4_demo_SOURCES)
gtk4_demo_EXCLUDES = font_features.c|pagesetup.c
gtk3_demo_application_FILES = $(gtk3_demo_application_SOURCES)
gtk3_demo_application_EXCLUDES = dummy
gtk4_demo_application_FILES = $(gtk4_demo_application_SOURCES)
gtk4_demo_application_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
dist-hook: \
$(top_builddir)/build/win32/vs9/gtk3-demo.vcproj \
$(top_builddir)/build/win32/vs9/gtk3-demo-application.vcproj
$(top_builddir)/build/win32/vs9/gtk4-demo.vcproj \
$(top_builddir)/build/win42/vs9/gtk4-demo-application.vcproj
DISTCLEANFILES = demos.h demos.h.win32

View File

@@ -94,15 +94,14 @@ create_page1 (GtkWidget *assistant)
GtkWidget *box, *label, *entry;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
@@ -118,11 +117,10 @@ create_page2 (GtkWidget *assistant)
GtkWidget *box, *checkbutton;
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
gtk_box_pack_start (GTK_BOX (box), checkbutton, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), checkbutton, FALSE, FALSE);
gtk_widget_show_all (box);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);

View File

@@ -11,7 +11,6 @@
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>

View File

@@ -23,7 +23,6 @@ create_bbox (gint horizontal,
else
bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width (GTK_CONTAINER (bbox), 5);
gtk_container_add (GTK_CONTAINER (frame), bbox);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
@@ -62,70 +61,68 @@ do_button_box (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10);
gtk_widget_set_margin_top (frame_horz, 10);
gtk_widget_set_margin_bottom (frame_horz, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND),
TRUE, TRUE, 5);
TRUE, TRUE);
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER),
TRUE, TRUE, 5);
TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND),
TRUE, TRUE, 5);
TRUE, TRUE);
}
if (!gtk_widget_get_visible (window))

View File

@@ -305,7 +305,6 @@ create_frame (ChangeDisplayInfo *info,
*frame = gtk_frame_new (title);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_container_add (GTK_CONTAINER (*frame), hbox);
scrollwin = gtk_scrolled_window_new (NULL, NULL);
@@ -313,7 +312,7 @@ create_frame (ChangeDisplayInfo *info,
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), scrollwin, TRUE, TRUE);
*tree_view = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE);
@@ -323,7 +322,7 @@ create_frame (ChangeDisplayInfo *info,
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
*button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox, FALSE, FALSE);
if (!info->size_group)
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -363,11 +362,11 @@ create_display_frame (ChangeDisplayInfo *info)
button = left_align_button_new ("_Open...");
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE);
button = left_align_button_new ("_Close");
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE);
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
G_TYPE_STRING,
@@ -539,11 +538,10 @@ do_changedisplay (GtkWidget *do_widget)
content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window));
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE);
frame = create_display_frame (info);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
initialize_displays (info);

View File

@@ -219,51 +219,47 @@ do_clipboard (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
/* Create the first entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Copy"));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE);
g_signal_connect (button, "clicked",
G_CALLBACK (copy_button_clicked), entry);
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
/* Create the second entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Paste"));
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE);
g_signal_connect (button, "clicked",
G_CALLBACK (paste_button_clicked), entry);
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
/* Create the first image */
image = gtk_image_new_from_icon_name ("dialog-warning",

View File

@@ -74,10 +74,7 @@ do_colorsel (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
@@ -86,7 +83,7 @@ do_colorsel (GtkWidget *do_widget)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
@@ -101,7 +98,7 @@ do_colorsel (GtkWidget *do_widget)
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE);
g_signal_connect (button, "clicked",
G_CALLBACK (change_color_callback), NULL);

View File

@@ -318,8 +318,6 @@ do_combobox (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_container_add (GTK_CONTAINER (window), vbox);
@@ -327,10 +325,9 @@ do_combobox (GtkWidget *do_widget)
* insensitive rows
*/
frame = gtk_frame_new ("Items with icons");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_add (GTK_CONTAINER (frame), box);
model = create_icon_store ();
@@ -368,10 +365,9 @@ do_combobox (GtkWidget *do_widget)
/* A combobox demonstrating trees.
*/
frame = gtk_frame_new ("Where are we ?");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_add (GTK_CONTAINER (frame), box);
model = create_capital_store ();
@@ -396,10 +392,9 @@ do_combobox (GtkWidget *do_widget)
/* A GtkComboBoxEntry with validation */
frame = gtk_frame_new ("Editable");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_add (GTK_CONTAINER (frame), box);
combo = gtk_combo_box_text_new_with_entry ();
@@ -414,10 +409,9 @@ do_combobox (GtkWidget *do_widget)
/* A combobox with string IDs */
frame = gtk_frame_new ("String IDs");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_add (GTK_CONTAINER (frame), box);
combo = gtk_combo_box_text_new ();

View File

@@ -45,7 +45,7 @@ css_text_changed (GtkTextBuffer *buffer,
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
gtk_css_provider_load_from_data (provider, text, -1);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());

View File

@@ -50,7 +50,7 @@ update_css_for_blend_mode (GtkCssProvider *provider,
blend_mode,
blend_mode);
gtk_css_provider_load_from_data (provider, css, -1, NULL);
gtk_css_provider_load_from_data (provider, css, -1);
g_bytes_unref (bytes);
g_free (css);

View File

@@ -45,7 +45,7 @@ css_text_changed (GtkTextBuffer *buffer,
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
gtk_css_provider_load_from_data (provider, text, -1);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());

View File

@@ -44,7 +44,7 @@ css_text_changed (GtkTextBuffer *buffer,
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
gtk_css_provider_load_from_data (provider, text, -1);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());

View File

@@ -43,7 +43,7 @@ css_text_changed (GtkTextBuffer *buffer,
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_css_provider_load_from_data (provider, text, -1, NULL);
gtk_css_provider_load_from_data (provider, text, -1);
g_free (text);
gtk_style_context_reset_widgets (gdk_screen_get_default ());

View File

@@ -27,13 +27,13 @@ add_section (GtkWidget *box,
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_top (label, 10);
gtk_widget_set_margin_bottom (label, 10);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, TRUE);
section = gtk_flow_box_new ();
gtk_widget_set_halign (section, GTK_ALIGN_START);
gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (section), GTK_SELECTION_NONE);
gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (section), 2);
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (section), 20);
gtk_box_pack_start (GTK_BOX (box), section, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), section, FALSE, TRUE);
return section;
}

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 874 B

After

Width:  |  Height:  |  Size: 874 B

View File

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 437 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 465 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 581 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 854 B

After

Width:  |  Height:  |  Size: 854 B

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -56,16 +56,15 @@ interactive_dialog_clicked (GtkButton *button,
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE);
image = gtk_image_new_from_icon_name ("dialog-question", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
@@ -114,41 +113,38 @@ do_dialog (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
frame = gtk_frame_new ("Dialogs");
gtk_container_add (GTK_CONTAINER (window), frame);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (frame), vbox);
/* Standard message dialog */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
button = gtk_button_new_with_mnemonic ("_Message Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (message_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL),
FALSE, FALSE, 0);
FALSE, FALSE);
/* Interactive dialog*/
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
button = gtk_button_new_with_mnemonic ("_Interactive Dialog");
g_signal_connect (button, "clicked",
G_CALLBACK (interactive_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 4);
gtk_grid_set_column_spacing (GTK_GRID (table), 4);
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);

View File

@@ -215,10 +215,7 @@ do_drawingarea (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (close_window), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
@@ -228,11 +225,11 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Checkerboard pattern</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
/* set a minimum size */
@@ -250,11 +247,11 @@ do_drawingarea (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Scribble area</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
da = gtk_drawing_area_new ();
/* set a minimum size */

View File

@@ -349,7 +349,6 @@ do_editable_cells (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Editable Cells");
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
@@ -358,7 +357,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Shopping list (you can edit the cells!)"),
FALSE, FALSE, 0);
FALSE, FALSE);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -366,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE);
/* create models */
items_model = create_items_model ();
@@ -387,17 +386,17 @@ do_editable_cells (GtkWidget *do_widget)
/* some buttons */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
button = gtk_button_new_with_label ("Add item");
g_signal_connect (button, "clicked",
G_CALLBACK (add_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE);
button = gtk_button_new_with_label ("Remove item");
g_signal_connect (button, "clicked",
G_CALLBACK (remove_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
}

View File

@@ -29,24 +29,23 @@ do_entry_buffer (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"Entries share a buffer. Typing in one is reflected in the other.");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
/* Create a buffer */
buffer = gtk_entry_buffer_new (NULL, 0);
/* Create our first entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
/* Create the second entry */
entry = gtk_entry_new_with_buffer (buffer);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
g_object_unref (buffer);
}

View File

@@ -56,15 +56,14 @@ do_entry_completion (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
/* Create our entry */
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
/* Create the completion object */
completion = gtk_entry_completion_new ();

View File

@@ -85,7 +85,7 @@ do_expander (GtkWidget *do_widget)
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_box_pack_end (GTK_BOX (area), expander, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (area), expander, TRUE, TRUE);
gtk_widget_show_all (expander);
g_signal_connect (expander, "notify::expanded",
G_CALLBACK (expander_cb), window);

View File

@@ -180,11 +180,11 @@ draw_style_common (GtkStyleContext *context,
GtkBorder margin, border, padding;
int min_width, min_height;
gtk_style_context_get_margin (context, gtk_style_context_get_state (context), &margin);
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
gtk_style_context_get_margin (context, &margin);
gtk_style_context_get_border (context, &border);
gtk_style_context_get_padding (context, &padding);
gtk_style_context_get (context, gtk_style_context_get_state (context),
gtk_style_context_get (context,
"min-width", &min_width,
"min-height", &min_height,
NULL);
@@ -217,11 +217,11 @@ query_size (GtkStyleContext *context,
GtkBorder margin, border, padding;
int min_width, min_height;
gtk_style_context_get_margin (context, gtk_style_context_get_state (context), &margin);
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
gtk_style_context_get_margin (context, &margin);
gtk_style_context_get_border (context, &border);
gtk_style_context_get_padding (context, &padding);
gtk_style_context_get (context, gtk_style_context_get_state (context),
gtk_style_context_get (context,
"min-width", &min_width,
"min-height", &min_height,
NULL);
@@ -308,7 +308,7 @@ draw_menu (GtkWidget *widget,
&menu_x, &menu_y, &menu_width, &menu_height);
/* Hovered with right arrow */
gtk_style_context_get (hoveredarrowmenuitem_context, gtk_style_context_get_state (hoveredarrowmenuitem_context),
gtk_style_context_get (hoveredarrowmenuitem_context,
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
arrow_size = MIN (arrow_width, arrow_height);
draw_style_common (hovermenuitem_context, cr, menu_x, menu_y, menu_width, menuitem1_height,
@@ -320,13 +320,13 @@ draw_menu (GtkWidget *widget,
/* Left arrow sensitive, and right arrow insensitive */
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height, menu_width, menuitem2_height,
&contents_x, &contents_y, &contents_width, &contents_height);
gtk_style_context_get (arrowmenuitem_context, gtk_style_context_get_state (arrowmenuitem_context),
gtk_style_context_get (arrowmenuitem_context,
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
arrow_size = MIN (arrow_width, arrow_height);
gtk_render_arrow (arrowmenuitem_context, cr, G_PI / 2,
contents_x,
contents_y + (contents_height - arrow_size) / 2, arrow_size);
gtk_style_context_get (disabledarrowmenuitem_context, gtk_style_context_get_state (disabledarrowmenuitem_context),
gtk_style_context_get (disabledarrowmenuitem_context,
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
arrow_size = MIN (arrow_width, arrow_height);
gtk_render_arrow (disabledarrowmenuitem_context, cr, G_PI / 2,
@@ -337,7 +337,7 @@ draw_menu (GtkWidget *widget,
/* Left check enabled, sensitive, and right check unchecked, insensitive */
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height, menu_width, menuitem3_height,
&contents_x, &contents_y, &contents_width, &contents_height);
gtk_style_context_get (checkmenuitem_context, gtk_style_context_get_state (checkmenuitem_context),
gtk_style_context_get (checkmenuitem_context,
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
draw_style_common (checkmenuitem_context, cr,
contents_x,
@@ -345,7 +345,7 @@ draw_menu (GtkWidget *widget,
toggle_width, toggle_height,
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
gtk_render_check (checkmenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
gtk_style_context_get (disabledcheckmenuitem_context, gtk_style_context_get_state (disabledcheckmenuitem_context),
gtk_style_context_get (disabledcheckmenuitem_context,
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
draw_style_common (disabledcheckmenuitem_context, cr,
contents_x + contents_width - toggle_width,
@@ -363,7 +363,7 @@ draw_menu (GtkWidget *widget,
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height + menuitem3_height + menuitem4_height,
menu_width, menuitem5_height,
&contents_x, &contents_y, &contents_width, &contents_height);
gtk_style_context_get (radiomenuitem_context, gtk_style_context_get_state (radiomenuitem_context),
gtk_style_context_get (radiomenuitem_context,
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
draw_style_common (radiomenuitem_context, cr,
contents_x,
@@ -371,7 +371,7 @@ draw_menu (GtkWidget *widget,
toggle_width, toggle_height,
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
gtk_render_check (radiomenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
gtk_style_context_get (disabledradiomenuitem_context, gtk_style_context_get_state (disabledradiomenuitem_context),
gtk_style_context_get (disabledradiomenuitem_context,
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
draw_style_common (disabledradiomenuitem_context, cr,
contents_x + contents_width - toggle_width,
@@ -527,7 +527,7 @@ draw_horizontal_scrollbar (GtkWidget *widget,
query_size (trough_context, NULL, height);
query_size (slider_context, NULL, height);
gtk_style_context_get (slider_context, gtk_style_context_get_state (slider_context),
gtk_style_context_get (slider_context,
"min-width", &slider_width, NULL);
draw_style_common (scrollbar_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
@@ -780,7 +780,7 @@ draw_combobox (GtkWidget *widget,
query_size (button_box_context, NULL, height);
query_size (arrow_context, NULL, height);
gtk_style_context_get (arrow_context, gtk_style_context_get_state (arrow_context),
gtk_style_context_get (arrow_context,
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
arrow_size = MIN (arrow_width, arrow_height);
@@ -852,7 +852,7 @@ draw_spinbutton (GtkWidget *widget,
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
gtk_style_context_get (up_context, gtk_style_context_get_state (up_context),
gtk_style_context_get (up_context,
"min-width", &icon_width, "min-height", &icon_height, NULL);
icon_size = MIN (icon_width, icon_height);
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-add-symbolic", icon_size, 0);
@@ -864,7 +864,7 @@ draw_spinbutton (GtkWidget *widget,
g_object_unref (pixbuf);
gtk_style_context_get (down_context, gtk_style_context_get_state (down_context),
gtk_style_context_get (down_context,
"min-width", &icon_width, "min-height", &icon_height, NULL);
icon_size = MIN (icon_width, icon_height);
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-remove-symbolic", icon_size, 0);

View File

@@ -333,7 +333,7 @@ create_axis_slider (int axis)
GtkAdjustment *adj;
const char *text;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
switch (axis)
{
@@ -393,7 +393,6 @@ create_glarea_window (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "OpenGL Area");
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
Name=GTK+ Demo
Comment=GTK+ code examples and demonstrations
Exec=gtk3-demo
Icon=gtk3-demo
Exec=gtk4-demo
Icon=gtk4-demo
Terminal=false
Type=Application
StartupNotify=true

View File

@@ -268,8 +268,6 @@ do_hypertext (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
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);

View File

@@ -266,7 +266,7 @@ do_iconview (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
tool_bar = gtk_toolbar_new ();
gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE);
up_button = gtk_tool_button_new (NULL, NULL);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
@@ -291,7 +291,7 @@ do_iconview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE);
/* Create the store and fill it with the contents of '/' */
parent = g_strdup ("/");

View File

@@ -347,22 +347,19 @@ do_images (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (cleanup_callback), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Image loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
image = gtk_image_new_from_icon_name ("gtk3-demo", GTK_ICON_SIZE_DIALOG);
@@ -374,13 +371,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Animation loaded from a file</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
image = gtk_image_new_from_resource ("/images/floppybuddy.gif");
@@ -391,13 +388,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Symbolic themed icon</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG);
@@ -410,13 +407,13 @@ do_images (GtkWidget *do_widget)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Progressive image loading</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
/* Create an empty image for now; the progressive loader
* will create the pixbuf and fill it in.
@@ -428,7 +425,7 @@ do_images (GtkWidget *do_widget)
/* Sensitivity control */
button = gtk_toggle_button_new_with_mnemonic ("_Insensitive");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE);
g_signal_connect (button, "toggled",
G_CALLBACK (toggle_sensitivity_callback),

View File

@@ -59,30 +59,29 @@ do_infobar (GtkWidget *do_widget)
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Message");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Warning");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
@@ -91,54 +90,55 @@ do_infobar (GtkWidget *do_widget)
bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL);
gtk_info_bar_set_show_close_button (GTK_INFO_BAR (bar), TRUE);
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Error");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
gtk_container_add (GTK_CONTAINER (actions), button);
bar = gtk_info_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE);
button = gtk_toggle_button_new_with_label ("Other");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
gtk_container_add (GTK_CONTAINER (actions), button);
frame = gtk_frame_new ("Info bars");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 8);
gtk_widget_set_margin_top (frame, 8);
gtk_widget_set_margin_bottom (frame, 8);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
gtk_container_add (GTK_CONTAINER (frame), vbox2);
/* Standard message dialog */
label = gtk_label_new ("An example of different info bars");
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE);
gtk_widget_show_all (actions);
gtk_box_pack_start (GTK_BOX (vbox2), actions, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), actions, FALSE, FALSE);
}
if (!gtk_widget_get_visible (window))

View File

@@ -56,7 +56,6 @@ do_links (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Links");
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@@ -262,13 +262,12 @@ do_list_store (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -276,7 +275,7 @@ do_list_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE);
/* create tree model */
model = create_model ();

View File

@@ -359,10 +359,10 @@ do_listbox (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("Messages from Gtk+ and friends");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listbox);

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk30">
<interface domain="gtk40">
<!-- interface-requires gtk+ 3.10 -->
<!-- interface-requires gtkdemo 3.10 -->
<object class="GtkMenu" id="menu1">

View File

@@ -105,8 +105,6 @@ do_menus (GtkWidget *do_widget)
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (window), box);
gtk_widget_show (box);
@@ -117,7 +115,7 @@ do_menus (GtkWidget *do_widget)
menubar = gtk_menu_bar_new ();
gtk_widget_set_hexpand (menubar, TRUE);
gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE);
gtk_widget_show (menubar);
menu = create_menu (2);
@@ -138,20 +136,19 @@ do_menus (GtkWidget *do_widget)
gtk_widget_show (menuitem);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE);
gtk_widget_show (box2);
button = gtk_button_new_with_label ("Flip");
g_signal_connect (button, "clicked",
G_CALLBACK (change_orientation), menubar);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Close");
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);

View File

@@ -233,18 +233,16 @@ gtk_rotated_bin_realize (GtkWidget *widget)
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = allocation.x + border_width;
attributes.y = allocation.y + border_width;
attributes.width = allocation.width - 2 * border_width;
attributes.height = allocation.height - 2 * border_width;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
@@ -255,10 +253,9 @@ gtk_rotated_bin_realize (GtkWidget *widget)
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@@ -384,8 +381,6 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GtkRequisition child_requisition;
double s, c;
double w, h;
guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
@@ -396,12 +391,8 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width = border_width * 2 + w;
requisition->height = border_width * 2 + h;
requisition->width = c * child_requisition.width + s * child_requisition.height;
requisition->height = s * child_requisition.width + c * child_requisition.height;
}
static void
@@ -433,21 +424,18 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
guint border_width;
gint w, h;
gdouble s, c;
gtk_widget_set_allocation (widget, allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
w = allocation->width;
h = allocation->height;
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x + border_width,
allocation->y + border_width,
allocation->x,
allocation->y,
w, h);
if (bin->child && gtk_widget_get_visible (bin->child))
@@ -578,8 +566,6 @@ do_offscreen_window (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
0, G_PI/2, 0.01);
@@ -591,8 +577,8 @@ do_offscreen_window (GtkWidget *do_widget)
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed), bin);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE);
gtk_container_add (GTK_CONTAINER (bin), button);
}

View File

@@ -172,18 +172,16 @@ gtk_mirror_bin_realize (GtkWidget *widget)
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = allocation.x + border_width;
attributes.y = allocation.y + border_width;
attributes.width = allocation.width - 2 * border_width;
attributes.height = allocation.height - 2 * border_width;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_EXPOSURE_MASK
@@ -194,10 +192,9 @@ gtk_mirror_bin_realize (GtkWidget *widget)
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@@ -310,7 +307,6 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
@@ -319,9 +315,8 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
gtk_widget_get_preferred_size ( (bin->child),
&child_requisition, NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width = border_width * 2 + child_requisition.width + 10;
requisition->height = border_width * 2 + child_requisition.height * 2 + 10;
requisition->width = child_requisition.width + 10;
requisition->height = child_requisition.height * 2 + 10;
}
static void
@@ -354,19 +349,16 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
gint w, h;
guint border_width;
gtk_widget_set_allocation (widget, allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
w = allocation->width;
h = allocation->height;
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x + border_width,
allocation->y + border_width,
allocation->x,
allocation->y,
w, h);
if (bin->child && gtk_widget_get_visible (bin->child))
@@ -383,8 +375,8 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (bin->offscreen_window,
allocation->x + border_width,
allocation->y + border_width,
allocation->x,
allocation->y,
child_allocation.width, child_allocation.height);
gtk_widget_size_allocate (bin->child, &child_allocation);
}
@@ -483,8 +475,6 @@ do_offscreen_window2 (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
bin = gtk_mirror_bin_new ();
@@ -502,11 +492,11 @@ do_offscreen_window2 (GtkWidget *do_widget)
gtk_size_group_add_widget (group, applybutton);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE);
gtk_container_add (GTK_CONTAINER (bin), hbox);
gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE);
}
if (!gtk_widget_get_visible (window))

View File

@@ -63,10 +63,14 @@ do_overlay (GtkWidget *do_widget)
label = gtk_label_new ("<span foreground='blue' weight='ultrabold' font='40'>Numbers</span>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 8);
gtk_widget_set_margin_top (label, 8);
gtk_widget_set_margin_bottom (label, 8);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number");
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 8);
gtk_widget_set_margin_top (entry, 8);
gtk_widget_set_margin_bottom (entry, 8);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
gtk_container_add (GTK_CONTAINER (window), overlay);

View File

@@ -85,7 +85,6 @@ create_pane_options (GtkPaned *paned,
child2 = gtk_paned_get_child2 (paned);
frame = gtk_frame_new (frame_label);
gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
table = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -142,14 +141,12 @@ do_panes (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "Paned Widgets");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE);
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
@@ -179,14 +176,14 @@ do_panes (GtkWidget *do_widget)
"Horizontal",
"Left",
"Right"),
FALSE, FALSE, 0);
FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (vbox),
create_pane_options (GTK_PANED (vpaned),
"Vertical",
"Top",
"Bottom"),
FALSE, FALSE, 0);
FALSE, FALSE);
gtk_widget_show_all (vbox);
}

View File

@@ -22,15 +22,11 @@ do_pickers (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
gtk_container_add (GTK_CONTAINER (window), table);
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
label = gtk_label_new ("Color:");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);

View File

@@ -25,7 +25,6 @@ create_popover (GtkWidget *parent,
popover = gtk_popover_new (parent);
gtk_popover_set_position (GTK_POPOVER (popover), pos);
gtk_container_add (GTK_CONTAINER (popover), child);
gtk_container_set_border_width (GTK_CONTAINER (popover), 6);
gtk_widget_show (child);
return popover;
@@ -132,7 +131,6 @@ do_popover (GtkWidget *do_widget)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
gtk_container_set_border_width (GTK_CONTAINER (box), 24);
gtk_container_add (GTK_CONTAINER (window), box);
g_signal_connect (window, "destroy",

View File

@@ -2,7 +2,6 @@
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkWindow" id="window">
<property name="border_width">5</property>
<property name="default_width">300</property>
<property name="default_height">300</property>
<property name="title">Revealer</property>

View File

@@ -21,7 +21,6 @@
</object>
<object class="GtkWindow" id="window1">
<property name="title" translatable="yes">Scales</property>
<property name="border-width" translatable="yes">20</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">1</property>

View File

@@ -239,25 +239,23 @@ do_search_entry (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Search entry demo");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE);
/* Create our entry */
entry = gtk_search_entry_new ();
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE);
/* Create the find and cancel buttons */
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_box_pack_start (GTK_BOX (hbox), notebook, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), notebook, FALSE, FALSE);
find_button = gtk_button_new_with_label ("Find");
g_signal_connect (find_button, "clicked",

View File

@@ -87,17 +87,16 @@ do_search_entry2 (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
entry = gtk_search_entry_new ();
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
gtk_box_pack_start (GTK_BOX (container), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (container), entry, FALSE, FALSE);
searchbar = gtk_search_bar_new ();
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_ENTRY (entry));
gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
gtk_container_add (GTK_CONTAINER (searchbar), container);
gtk_box_pack_start (GTK_BOX (vbox), searchbar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), searchbar, FALSE, FALSE);
/* Hook the search bar to key presses */
g_signal_connect (window, "key-press-event",
@@ -105,27 +104,26 @@ do_search_entry2 (GtkWidget *do_widget)
/* Help */
label = gtk_label_new ("Start Typing to search");
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE);
/* Toggle button */
button = gtk_toggle_button_new_with_label ("Search");
g_object_bind_property (button, "active",
searchbar, "search-mode-enabled",
G_BINDING_BIDIRECTIONAL);
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE);
/* Result */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE);
label = gtk_label_new ("Result:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed_cb), label);
@@ -133,16 +131,15 @@ do_search_entry2 (GtkWidget *do_widget)
G_CALLBACK (changed_cb), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE);
label = gtk_label_new ("Signal:");
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_start (label, 6);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
g_signal_connect (entry, "search-changed",
G_CALLBACK (search_changed), label);

View File

@@ -375,6 +375,7 @@
<child>
<object class="GtkShortcutsSection">
<property name="visible">1</property>
<property name="max-height">16</property>
<property name="section-name">terminal</property>
<property name="title" translatable="yes">Terminal Shortcuts</property>
<child>
@@ -452,6 +453,43 @@
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">1</property>
<property name="title" translatable="yes">'Special' combinations</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">t+t</property>
<property name="title" translatable="yes">You want tea ?</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;shift&gt;&lt;ctrl&gt;</property>
<property name="title" translatable="yes">Shift Control</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;ctrl&gt;&amp;&lt;ctrl&gt;</property>
<property name="title" translatable="yes">Control Control</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">Control_L&amp;Control_R</property>
<property name="title" translatable="yes">Left and right control</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">1</property>
@@ -499,41 +537,18 @@
<property name="title" translatable="yes">A stock swipe gesture</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">1</property>
<property name="title" translatable="yes">'Special' combinations</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">t+t</property>
<property name="title" translatable="yes">You want tea ?</property>
<property name="shortcut-type">gesture-swipe-left</property>
<property name="title" translatable="yes">A stock swipe gesture</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;shift&gt;&lt;ctrl&gt;</property>
<property name="title" translatable="yes">Shift Control</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;ctrl&gt;&amp;&lt;ctrl&gt;</property>
<property name="title" translatable="yes">Control Control</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">Control_L&amp;Control_R</property>
<property name="title" translatable="yes">Left and right control</property>
<property name="shortcut-type">gesture-swipe-right</property>
<property name="title" translatable="yes">A stock swipe gesture</property>
</object>
</child>

View File

@@ -49,7 +49,7 @@ do_sidebar (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
@@ -57,9 +57,9 @@ do_sidebar (GtkWidget *do_widget)
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX(box), widget, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(box), widget, FALSE, FALSE);
gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE);
for (i=0; (c = *(pages+i)) != NULL; i++ )
{

View File

@@ -109,17 +109,15 @@ do_sizegroup (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
g_object_set_data_full (G_OBJECT (window), "size-group", size_group, g_object_unref);
/* Create one frame holding color options */
frame = gtk_frame_new ("Color Options");
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
table = gtk_grid_new ();
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_grid_set_row_spacing (GTK_GRID (table), 5);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -129,10 +127,9 @@ do_sizegroup (GtkWidget *do_widget)
/* And another frame holding line style options */
frame = gtk_frame_new ("Line Options");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
table = gtk_grid_new ();
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_grid_set_row_spacing (GTK_GRID (table), 5);
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -142,7 +139,7 @@ do_sizegroup (GtkWidget *do_widget)
/* And a check button to turn grouping on and off */
check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping");
gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
g_signal_connect (check_button, "toggled",

View File

@@ -52,8 +52,7 @@ do_spinner (GtkWidget *do_widget)
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE);
/* Sensitive */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);

View File

@@ -157,7 +157,7 @@ create_text_view (GtkWidget *hbox,
guint timeout;
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);

View File

@@ -481,10 +481,8 @@ do_textview (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "Multiple Views");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
gtk_container_add (GTK_CONTAINER (window), vpaned);
/* For convenience, we just use the autocreated buffer from

View File

@@ -25,7 +25,6 @@ do_theming_style_classes (GtkWidget *do_widget)
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@@ -443,7 +443,6 @@ do_toolpalette (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
/* Add widgets to control the ToolPalette appearance: */
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
@@ -473,7 +472,7 @@ do_toolpalette (GtkWidget *do_widget)
"text", 0,
NULL);
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_orientation), &iter);
gtk_box_pack_start (GTK_BOX (box), combo_orientation, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), combo_orientation, FALSE, FALSE);
/* Style combo box: */
style_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
@@ -512,11 +511,11 @@ do_toolpalette (GtkWidget *do_widget)
"text", 0,
NULL);
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_style), &iter);
gtk_box_pack_start (GTK_BOX (box), combo_style, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), combo_style, FALSE, FALSE);
/* Add hbox */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, TRUE);
/* Add and fill the ToolPalette: */
palette = gtk_tool_palette_new ();
@@ -529,7 +528,6 @@ do_toolpalette (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (palette_scroller),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_set_border_width (GTK_CONTAINER (palette_scroller), 6);
gtk_widget_set_hexpand (palette_scroller, TRUE);
gtk_container_add (GTK_CONTAINER (palette_scroller), palette);
@@ -549,8 +547,7 @@ do_toolpalette (GtkWidget *do_widget)
/* ===== notebook ===== */
notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (notebook), 6);
gtk_box_pack_end (GTK_BOX(hbox), notebook, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX(hbox), notebook, FALSE, FALSE);
/* ===== DnD for tool items ===== */
@@ -585,7 +582,6 @@ do_toolpalette (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
contents_scroller,
@@ -615,7 +611,6 @@ do_toolpalette (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller,
gtk_label_new ("Interactive DnD Mode"));

View File

@@ -202,7 +202,6 @@ do_transparent (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "Transparency");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
view = gtk_text_view_new ();
@@ -220,7 +219,7 @@ do_transparent (GtkWidget *do_widget)
provider = gtk_css_provider_new ();
css = g_strdup_printf ("* { border-width: 0px %dpx %dpx 0px; }",
SHADOW_OFFSET_X, SHADOW_OFFSET_Y);
gtk_css_provider_load_from_data (provider, css, -1, NULL);
gtk_css_provider_load_from_data (provider, css, -1);
g_free (css);
gtk_style_context_add_provider (gtk_widget_get_style_context (entry),
GTK_STYLE_PROVIDER (provider),

View File

@@ -398,12 +398,11 @@ do_tree_store (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Jonathan's Holiday Card Planning Sheet"),
FALSE, FALSE, 0);
FALSE, FALSE);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -411,7 +410,7 @@ do_tree_store (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE);
/* create model */
model = create_model ();

View File

@@ -6,17 +6,17 @@ AM_CPPFLAGS = \
$(GTK_DEP_CFLAGS)
LDADD = \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-4.la \
$(top_builddir)/gdk/libgdk-4.la \
$(GTK_DEP_LIBS)
bin_PROGRAMS = gtk3-icon-browser
bin_PROGRAMS = gtk4-icon-browser
desktopdir = $(datadir)/applications
dist_desktop_DATA = gtk3-icon-browser.desktop
dist_desktop_DATA = gtk4-icon-browser.desktop
gtk3_icon_browser_SOURCES = \
gtk4_icon_browser_SOURCES = \
main.c \
iconbrowserapp.c iconbrowserapp.h \
iconbrowserwin.c iconbrowserwin.h \
@@ -36,13 +36,13 @@ EXTRA_DIST = \
window.ui
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gtk3-icon-browser
MSVCPROJS = gtk4-icon-browser
gtk3_icon_browser_FILES = $(gtk3_icon_browser_SOURCES)
gtk3_icon_browser_EXCLUDES = dummy
gtk4_icon_browser_FILES = $(gtk4_icon_browser_SOURCES)
gtk4_icon_browser_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
dist-hook: $(top_builddir)/build/win32/vs9/gtk3-icon-browser.vcproj
dist-hook: $(top_builddir)/build/win32/vs9/gtk4-icon-browser.vcproj
-include $(top_srcdir)/git.mk

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Icon Browser
Comment=An application that shows themed icons
Exec=gtk3-icon-browser
Icon=gtk3-icon-browser
Exec=gtk4-icon-browser
Icon=gtk4-icon-browser
Terminal=false
Type=Application
StartupNotify=true

View File

@@ -1,29 +1,29 @@
include $(top_srcdir)/Makefile.decl
bin_PROGRAMS = gtk3-widget-factory
bin_PROGRAMS = gtk4-widget-factory
desktopdir = $(datadir)/applications
dist_desktop_DATA = gtk3-widget-factory.desktop
dist_desktop_DATA = gtk4-widget-factory.desktop
gtk3_widget_factory_SOURCES = \
gtk4_widget_factory_SOURCES = \
widget-factory.c \
widget_factory_resources.c
BUILT_SOURCES = \
widget_factory_resources.c
gtk3_widget_factory_DEPENDENCIES = \
$(top_builddir)/gtk/libgtk-3.la
gtk4_widget_factory_DEPENDENCIES = \
$(top_builddir)/gtk/libgtk-4.la
gtk3_widget_factory_CPPFLAGS = \
gtk4_widget_factory_CPPFLAGS = \
-I$(top_srcdir) \
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS) \
$(NULL)
gtk3_widget_factory_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-3.la \
gtk4_widget_factory_LDADD = \
$(top_builddir)/gdk/libgdk-4.la \
$(top_builddir)/gtk/libgtk-4.la \
$(GTK_DEP_LIBS) \
$(NULL)
@@ -40,12 +40,12 @@ appsicon32dir = $(iconthemedir)/32x32/apps
appsicon48dir = $(iconthemedir)/48x48/apps
appsicon256dir = $(iconthemedir)/256x256/apps
dist_appsicon16_DATA = data/16x16/gtk3-widget-factory.png data/16x16/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon22_DATA = data/22x22/gtk3-widget-factory.png data/22x22/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon24_DATA = data/24x24/gtk3-widget-factory.png data/24x24/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon32_DATA = data/32x32/gtk3-widget-factory.png data/32x32/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon48_DATA = data/48x48/gtk3-widget-factory.png data/48x48/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk3-widget-factory.png data/256x256/gtk3-widget-factory-symbolic.symbolic.png
dist_appsicon16_DATA = data/16x16/gtk4-widget-factory.png data/16x16/gtk4-widget-factory-symbolic.symbolic.png
dist_appsicon22_DATA = data/22x22/gtk4-widget-factory.png data/22x22/gtk4-widget-factory-symbolic.symbolic.png
dist_appsicon24_DATA = data/24x24/gtk4-widget-factory.png data/24x24/gtk4-widget-factory-symbolic.symbolic.png
dist_appsicon32_DATA = data/32x32/gtk4-widget-factory.png data/32x32/gtk4-widget-factory-symbolic.symbolic.png
dist_appsicon48_DATA = data/48x48/gtk4-widget-factory.png data/48x48/gtk4-widget-factory-symbolic.symbolic.png
dist_appsicon256_DATA = data/256x256/gtk4-widget-factory.png data/256x256/gtk4-widget-factory-symbolic.symbolic.png
update_icon_cache = $(top_builddir)/gtk/gtk-update-icon-cache$(EXEEXT) --ignore-theme-index --force

View File

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

View File

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

View File

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 750 B

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Widget Factory
Comment=A showcase for GTK+ widgets, designed for testing themes.
Exec=gtk3-widget-factory
Icon=gtk3-widget-factory
Exec=gtk4-widget-factory
Icon=gtk4-widget-factory
Terminal=false
Type=Application
StartupNotify=true

View File

@@ -787,7 +787,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
"margin", 6,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE);
gdk_rgba_parse (&rgba, color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -799,7 +799,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE);
gtk_widget_show_all (row);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
@@ -898,7 +898,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
"margin", 6,
"xalign", 0.0,
NULL);
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE);
gdk_rgba_parse (&rgba, colors[i].color);
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
"rgba", &rgba,
@@ -910,7 +910,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), swatch);
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE);
gtk_widget_show_all (row);
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
row = gtk_widget_get_parent (row);
@@ -1507,45 +1507,7 @@ g_test_permission_class_init (GTestPermissionClass *class)
permission_class->release_finish = release_finish;
}
static int icon_sizes[5];
static void
register_icon_sizes (void)
{
static gboolean registered;
if (registered)
return;
registered = TRUE;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
icon_sizes[0] = gtk_icon_size_register ("a", 16, 16);
icon_sizes[1] = gtk_icon_size_register ("b", 24, 24);
icon_sizes[2] = gtk_icon_size_register ("c", 32, 32);
icon_sizes[3] = gtk_icon_size_register ("d", 48, 48);
icon_sizes[4] = gtk_icon_size_register ("e", 64, 64);
G_GNUC_END_IGNORE_DEPRECATIONS
}
static int
find_icon_size (GtkIconSize size)
{
gint w, h, w2, h2;
gint i;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_icon_size_lookup (size, &w, &h);
for (i = 0; i < G_N_ELEMENTS (icon_sizes); i++)
{
gtk_icon_size_lookup (icon_sizes[i], &w2, &h2);
if (w == w2)
return i;
}
G_GNUC_END_IGNORE_DEPRECATIONS
return 2;
}
static int icon_sizes[] = {0, 1, 2, 3, 4, 5, 6};
static void
update_buttons (GtkWidget *iv, int pos)
@@ -1564,21 +1526,16 @@ increase_icon_size (GtkWidget *iv)
GList *cells;
GtkCellRendererPixbuf *cell;
GtkIconSize size;
int i;
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (iv));
cell = cells->data;
g_list_free (cells);
g_object_get (cell, "stock-size", &size, NULL);
i = find_icon_size (size);
i = CLAMP (i + 1, 0, G_N_ELEMENTS (icon_sizes) - 1);
size = icon_sizes[i];
size = MIN (size + 1, G_N_ELEMENTS (icon_sizes) - 1);
g_object_set (cell, "stock-size", size, NULL);
update_buttons (iv, i);
update_buttons (iv, size);
gtk_widget_queue_resize (iv);
}
@@ -1589,21 +1546,16 @@ decrease_icon_size (GtkWidget *iv)
GList *cells;
GtkCellRendererPixbuf *cell;
GtkIconSize size;
int i;
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (iv));
cell = cells->data;
g_list_free (cells);
g_object_get (cell, "stock-size", &size, NULL);
i = find_icon_size (size);
i = CLAMP (i - 1, 0, G_N_ELEMENTS (icon_sizes) - 1);
size = icon_sizes[i];
size = MAX (size - 1, 1);
g_object_set (cell, "stock-size", size, NULL);
update_buttons (iv, i);
update_buttons (iv, size);
gtk_widget_queue_resize (iv);
}
@@ -1618,7 +1570,7 @@ reset_icon_size (GtkWidget *iv)
cell = cells->data;
g_list_free (cells);
g_object_set (cell, "stock-size", icon_sizes[2], NULL);
g_object_set (cell, "stock-size", 2, NULL);
update_buttons (iv, 2);
@@ -1680,7 +1632,6 @@ activate (GApplication *app)
GAction *action;
g_type_ensure (my_text_view_get_type ());
register_icon_sizes ();
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");

View File

@@ -441,7 +441,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkBox" id="page1">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="border-width">10</property>
<property name="spacing">10</property>
<child>
<object class="GtkBox" id="box2">
@@ -1830,7 +1829,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<object class="GtkBox">
<property name="visible">1</property>
<property name="spacing">10</property>
<property name="border-width">16</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
@@ -2778,7 +2776,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="model">iconsmodel</property>
<child>
<object class="GtkCellRendererPixbuf" id="iconviewcell">
<property name="stock-size">5</property>
<property name="stock-size">2</property>
</object>
<attributes>
<attribute name="icon-name">0</attribute>
@@ -2873,7 +2871,6 @@ microphone-sensitivity-medium-symbolic</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="border-width">16</property>
<property name="spacing">10</property>
<child>
<object class="GtkBox">

View File

@@ -28,8 +28,8 @@ Make sure that gtk-doc is the latest released version.
3) Update the pot files and commit the changes:
make -C po gtk30.pot
make -C po-properties gtk30-properties.pot
make -C po gtk40.pot
make -C po-properties gtk40-properties.pot
4) In particular, if this is a major, stable, release, verify that
README.in contains the relevant release notes and that the

View File

@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
SUBDIRS = gdk gtk libgail-util
SUBDIRS = gdk gsk gtk
GITIGNOREFILES = */*.1

View File

@@ -3,7 +3,7 @@
AUTOMAKE_OPTIONS = 1.6
# The name of the module.
DOC_MODULE=gdk3
DOC_MODULE=gdk4
# The top-level SGML file.
DOC_MAIN_SGML_FILE=gdk-docs.sgml
@@ -61,7 +61,7 @@ AM_CPPFLAGS = \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-3.la $(GDK_DEP_LIBS)
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-4.la $(GDK_DEP_LIBS)
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--output-format=xml --name-space=gdk

View File

@@ -6,7 +6,7 @@
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GDK 3 Reference Manual</title>
<title>GDK 4 Reference Manual</title>
<releaseinfo>
This document is for the GDK 3 library, version &version;
The latest versions can be found online at

View File

@@ -22,12 +22,6 @@ gdk_get_display
<SUBSECTION>
gdk_flush
<SUBSECTION>
gdk_screen_width
gdk_screen_height
gdk_screen_width_mm
gdk_screen_height_mm
<SUBSECTION>
gdk_pointer_grab
@@ -211,13 +205,8 @@ gdk_screen_is_composited
gdk_screen_get_root_window
gdk_screen_get_display
gdk_screen_get_number
gdk_screen_get_width
gdk_screen_get_height
gdk_screen_get_width_mm
gdk_screen_get_height_mm
gdk_screen_list_visuals
gdk_screen_get_toplevel_windows
gdk_screen_make_display_name
gdk_screen_get_n_monitors
gdk_screen_get_primary_monitor
gdk_screen_get_monitor_geometry
@@ -233,8 +222,6 @@ gdk_screen_get_font_options
gdk_screen_set_font_options
gdk_screen_get_resolution
gdk_screen_set_resolution
gdk_screen_get_active_window
gdk_screen_get_window_stack
<SUBSECTION Standard>
GDK_SCREEN
@@ -410,9 +397,6 @@ gdk_window_mark_paint_from_clip
<SUBSECTION>
gdk_window_get_clip_region
gdk_window_begin_paint_rect
gdk_window_begin_paint_region
gdk_window_end_paint
gdk_window_begin_draw_frame
gdk_window_end_draw_frame
gdk_window_should_draw
@@ -430,7 +414,6 @@ gdk_window_freeze_updates
gdk_window_thaw_updates
gdk_window_process_all_updates
gdk_window_process_updates
gdk_window_set_debug_updates
gdk_window_enable_synchronized_configure
gdk_window_configure_finished
gdk_window_get_frame_clock
@@ -624,7 +607,6 @@ gdk_pango_context_get_for_display
<FILE>cairo_interaction</FILE>
gdk_window_create_similar_surface
gdk_window_create_similar_image_surface
gdk_cairo_create
gdk_cairo_get_clip_rectangle
gdk_cairo_get_drawing_context
gdk_cairo_set_source_color

View File

@@ -0,0 +1,79 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6
# The name of the module.
DOC_MODULE = gsk3
# The top-level SGML file.
DOC_MAIN_SGML_FILE = gsk-docs.xml
# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS = --deprecated-guards=GDK_DISABLE_DEPRECATED \
--ignore-decorators=G_GNUC_WARN_UNUSED_RESULT
# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR = $(top_srcdir)/gsk
# Used for dependencies
HFILE_GLOB = $(top_srcdir)/gsk/*.h
CFILE_GLOB = $(top_srcdir)/gsk/*.c
# Header files to ignore when scanning
IGNORE_HFILES = \
gskcairorendererprivate.h \
gskdebugprivate.h \
gskdriverprivate.h \
gskprofilerprivate.h \
gskglrendererprivate.h \
gskprivate.h \
gskprofilerprivate.h \
gskrendererprivate.h \
gskrendernodeprivate.h \
gskshaderbiulderprivate.h
# Extra files to add when scanning
EXTRA_HFILES =
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gsk \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
GTKDOC_LIBS = $(top_builddir)/gsk/libgsk-3.la $(GDK_DEP_LIBS)
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--output-format=xml --name-space=gsk
# Extra SGML files that are included by DOC_MAIN_SGML_FILE
content_files = \
version.xml
# Images to copy into HTML directory
HTML_IMAGES =
if ENABLE_DOC_CROSS_REFERENCES
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS= \
--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \
--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib \
--extra-dir=$(CAIRO_PREFIX)/share/gtk-doc/html/cairo
endif
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = cd $(srcdir) && \
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
#TESTS = $(GTKDOC_CHECK)
endif
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GSK 3 Reference Manual</title>
<releaseinfo>
This document is for the GSK 3 library, version &version;
The latest versions can be found online at
<ulink role="online-location" url="http://developer.gnome.org/gdk3/">http://developer.gnome.org/gsk3/</ulink>.
</releaseinfo>
</bookinfo>
<reference id="reference">
<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">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
</book>

View File

@@ -0,0 +1,87 @@
<SECTION>
<FILE>GskRenderer</FILE>
gsk_renderer_get_for_display
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_render
<SUBSECTION Standard>
GSK_IS_RENDERER
GSK_RENDERER
GSK_TYPE_RENDERER
GskRenderer
GskRendererClass
gsk_renderer_get_type
GSK_TYPE_SCALING_FILTER
</SECTION>
<SECTION>
<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
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
<SUBSECTION Standard>
GSK_IS_RENDER_NODE
GSK_RENDER_NODE
GSK_TYPE_RENDER_NODE
GSK_VALUE_HOLDS_RENDER_NODE
GskRenderNode
GskRenderNodeClass
gsk_render_node_get_type
GSK_TYPE_BLEND_MODE
</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
<SUBSECTION Standard>
GSK_TYPE_RENDER_NODE_ITER
GskRenderNodeIter
gsk_render_node_iter_get_type
</SECTION>

View File

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

View File

@@ -3,7 +3,7 @@
AUTOMAKE_OPTIONS = 1.6
# The name of the module.
DOC_MODULE=gtk3
DOC_MODULE=gtk4
# The top-level SGML file.
DOC_MAIN_SGML_FILE=gtk-docs.sgml
@@ -157,7 +157,6 @@ IGNORE_HFILES = \
gtksidebarrowprivate.h \
gtksizegroup-private.h \
gtksizerequestcacheprivate.h \
gtksocketprivate.h \
gtkstyleanimationprivate.h \
gtkstylecascadeprivate.h \
gtkstylecontextprivate.h \
@@ -233,7 +232,6 @@ IGNORE_HFILES = \
gtksearchenginesimple.h \
gtksearchenginequartz.h \
gtksequence.h \
gtksocketprivate.h \
gtktextbtree.h \
gtktextbufferserialize.h \
gtktextdisplay.h \
@@ -248,9 +246,6 @@ IGNORE_HFILES = \
gtktreedatalist.h \
gtktreemenu.h \
gtktypebuiltins.h \
gtkxembed.h \
gtkwin32embed.h \
gtkwin32embedwidget.h \
gtkwindow-decorate.h \
xdgmime \
xembed.h
@@ -270,8 +265,8 @@ CPPFLAGS += \
-UGTK_DISABLE_SINGLE_INCLUDES
GTKDOC_LIBS = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-4.la \
$(top_builddir)/gtk/libgtk-4.la \
$(GTK_DEP_LIBS)
@@ -291,14 +286,14 @@ content_files = \
drawing-model.xml \
getting_started.xml \
glossary.xml \
gtk3-demo-application.xml \
gtk3-demo.xml \
gtk3-icon-browser.xml \
gtk3-widget-factory.xml \
gtk4-demo-application.xml \
gtk4-demo.xml \
gtk4-icon-browser.xml \
gtk4-widget-factory.xml \
gtk-builder-tool.xml \
gtk-encode-symbolic-svg.xml \
gtk-launch.xml \
gtk-query-immodules-3.0.xml \
gtk-query-immodules-4.0.xml \
gtk-query-settings.xml \
gtk-update-icon-cache.xml \
input-handling.xml \
@@ -450,8 +445,6 @@ HTML_IMAGES = \
$(srcdir)/images/focus.png \
$(srcdir)/images/handles.png \
$(srcdir)/images/extensions.png \
$(srcdir)/images/numerableicon.png \
$(srcdir)/images/numerableicon2.png \
$(srcdir)/images/bloatpad-osx.png \
$(srcdir)/images/bloatpad-gnome.png \
$(srcdir)/images/bloatpad-xfce.png \
@@ -498,19 +491,19 @@ endif
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in gtk3.types.in
EXTRA_DIST += version.xml.in gtk4.types.in
########################################################################
man_MANS = \
gtk-query-immodules-3.0.1 \
gtk-query-immodules-4.0.1 \
gtk-update-icon-cache.1 \
gtk-encode-symbolic-svg.1 \
gtk-launch.1 \
gtk3-demo.1 \
gtk3-demo-application.1 \
gtk3-widget-factory.1 \
gtk3-icon-browser.1 \
gtk4-demo.1 \
gtk4-demo-application.1 \
gtk4-widget-factory.1 \
gtk4-icon-browser.1 \
broadwayd.1 \
gtk-builder-tool.1 \
gtk-query-settings.1

View File

@@ -29,10 +29,10 @@ The following interactive shell session demonstrates how
<literal>pkg-config</literal> is used (the actual output on
your system may be different):
<programlisting>
$ pkg-config --cflags gtk+-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/lib64/gtk-3.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
$ pkg-config --libs gtk+-3.0
-pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
$ pkg-config --cflags gtk+-4.0
-pthread -I/usr/include/gtk-4.0 -I/usr/lib64/gtk-4.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
$ pkg-config --libs gtk+-4.0
-pthread -lgtk-4 -lgdk-4 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
</programlisting>
</para>
<para>
@@ -42,7 +42,7 @@ feature of the shell. If you enclose a command in backticks
substituted into the command line before execution. So to compile
a GTK+ Hello, World, you would type the following:
<programlisting>
$ cc `pkg-config --cflags gtk+-3.0` hello.c -o hello `pkg-config --libs gtk+-3.0`
$ cc `pkg-config --cflags gtk+-4.0` hello.c -o hello `pkg-config --libs gtk+-4.0`
</programlisting>
</para>
@@ -67,7 +67,7 @@ this range will trigger compiler warnings.
Here is how you would compile hello.c if you want to allow it
to use symbols that were not deprecated in 3.2:
<programlisting>
$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-3.0`
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-4.0`
</programlisting>
</para>
@@ -75,7 +75,7 @@ $ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 he
And here is how you would compile hello.c if you don't want
it to use any symbols that were introduced after 3.4:
<programlisting>
$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-3.0`
$ cc `pkg-config --cflags gtk+-4.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-4.0`
</programlisting>
</para>
@@ -97,34 +97,5 @@ define the preprocessor symbol GDK_MULTIDEVICE_SAFE by using the command
line option <literal>-DGTK_MULTIDEVICE_SAFE=1</literal>.
</para>
<refsect2>
<title>Useful autotools macros</title>
<para>
GTK+ provides various macros for easily checking version and backends
supported. The macros are
<variablelist>
<varlistentry>
<term>AM_PATH_GTK_3_0([minimum-version], [if-found], [if-not-found], [modules])</term>
<listitem>This macro should be used to check that GTK+ is installed
and available for compilation. The four arguments are optional, and
they are: <emphasis>minimum-version</emphasis>, the minimum version
of GTK+ required for compilation; <emphasis>if-found</emphasis>, the
action to perform if a valid version of GTK+ has been found;
<emphasis>if-not-found</emphasis>, the action to perform if a valid
version of GTK+ has not been found; <emphasis>modules</emphasis>, a
list of modules to be checked along with GTK+.</listitem>
</varlistentry>
<varlistentry>
<term>GTK_CHECK_BACKEND([backend-name], [minimum-version], [if-found], [if-not-found])</term>
<listitem>This macro should be used to check if a specific backend
is supported by GTK+. The <emphasis>minimum-version</emphasis>,
<emphasis>if-found</emphasis> and <emphasis>if-not-found</emphasis>
arguments are optional.</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
</refsect1>
</refentry>

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