Commit Graph

1525 Commits

Author SHA1 Message Date
Timm Bäder
2455bd0857 widget: Remove visibility-notify-event 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
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
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
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
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
d09e48cec1 API: Remove -gtk_widget_get_root_window() 2016-10-16 18:17:21 +02:00
Christoph Reiter
ae8ffc775d widget: Don't print underallocation warnings by default
See similar changes:
    https://git.gnome.org/browse/gtk+/commit/?id=1b15588732f2c4e3c59994a59613d4e5c963e283
    https://git.gnome.org/browse/gtk+/commit/?id=54fdcb3ffac3383432b379f3e16e8cb0086b8101

https://bugzilla.gnome.org/show_bug.cgi?id=770388
2016-09-30 14:41:01 -04:00
Timm Bäder
54fdcb3ffa widget: Don't print missing allocation warning by default
This was meant to be silenced unless expicitly requested but
G_ENABLE_DEBUG is defined by default unless --disable-debug is passed to
configure, so use G_ENABLE_CONSISTENCY_CHECKS instead which is only
defined if --enable-debug is explicitly passed.
2016-09-22 09:01:06 +02:00
Emmanuele Bassi
bb705837bc Ensure drawing context is set
If somebody decides to use gtk_widget_set_double_buffered() in the
middle of a draw() then there's the risk of calling end_draw_frame()
with an invalid pointer.

Some overeager compilers may warn about the double_buffered bit field
changing values and leading to a potentially uninitialized variable.

In order to avoid compiler warnings or crashes, we can simply store the
value of the double_buffered bit field at the beginning of the rendering
and use that instead of the actual bit field.

https://bugzilla.gnome.org/show_bug.cgi?id=771463
2016-09-15 10:17:24 +01:00
Timm Bäder
5ea69a136b widget: Only warn about missing allocation if G_ENABLE_DEBUG
Not all occurrences of this warning can be fixed today, so put it behind
a G_ENABLE_DEBUG flag since it still shows legitimate problems even if
some of them are false positives.
2016-09-14 18:06:54 -04:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Carlos Garnacho
3a6d0ff2ab gtk: Add minimal handling of pad events
No real handling is yet performed, to be done through a GdkEventController

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Timm Bäder
50a0c5f242 widget: remove some unneeded function prototypes 2016-08-04 13:09:08 +02:00
Sébastien Wilmet
af5ef152b1 docs: GtkWidget::style-updated vs GtkStyleContext::changed
Explain the difference between those two signals.

Add "Since: 3.0" for GtkStyleContext::changed, since that signal has
been added in commit 9f84e101bf, present
since 2.91.6.

https://bugzilla.gnome.org/show_bug.cgi?id=769047
2016-07-25 09:26:41 -04:00
Sébastien Wilmet
3432587f89 docs: add missing info for gtk_widget_get_style_context()
It is important to know whether the returned object can or cannot
change, for a certain widget. For example to connect to the
GtkStyleContext::changed signal.

https://bugzilla.gnome.org/show_bug.cgi?id=769047
2016-07-25 09:26:41 -04:00
Matthias Clasen
8db8891c66 Use g_clear_object in a few more places 2016-07-25 08:32:08 -04:00
Emmanuele Bassi
8f1fd7d964 docs: Fix typo. 2016-07-12 18:09:20 +01:00
Emmanuele Bassi
c0dae6c146 docs: Attempt a better explanation for gtk_widget_destroy()
Clarify the nature of this function, and the expectations after it's
been called.
2016-07-12 12:44:23 +01:00
Timm Bäder
d52f6ff710 widget: Don't unnecessarily export function
_gtk_widget_get_translation_to_window is only used in gtkwidget.c
2016-06-27 14:43:53 +02:00
Emmanuele Bassi
40ee61a686 gtk: Keep Firefox working in the DrawingContext world
Firefox does a bunch of interesting things with GTK.

If the top-level GtkWindow does not have a "csd" style class associated,
Firefox will happily draw the contents of the container used to render
HTML and XUL directly on the top level's GdkWindow; on the other hand,
if a "csd" style class is found, the MozContainer will create a new
child window, and draw on it.

Then, Firefox will proceed to disable double buffering on both the
top-level window and the MozContainer (unless they are backed by the
same GdkWindow, in which case only the top-level will be
single-buffered) *and* it will add a GDK_EXPOSURE_MASK flag to the
MozContainer events for good measure (even if this is only needed for
GTK+ 2.x).

After landing the GdkDrawingContext API in GdkWindow, GTK enabled
automatic double buffering on all top-level windows backed by a native
surface, ad most users of single buffering rely on child widgets instead
of top-levels, and we'd still like to have the same double buffering
behaviour for all top-levels on all backends. Obviously, with Firefox
disabling double buffering on the top-level window, the change broke
their drawing mechanism.

Ideally, Firefox could be fixed to not disable double buffering on the
top-level window when MozContainer has a separate GdkWindow — i.e. the
CSD case — but since we did introduce a slight change of behaviour in
fringe users of the GTK+ API, let's keep backwards compatibility with
the old code for a little while longer, and create an intermediate Cairo
context unbound from the GdkDrawingContext, like we used to do until
GTK+ 3.20.
2016-06-22 11:41:59 +01:00
Emmanuele Bassi
c3f4fe334d Deprecate gtk_widget_send_expose()
We have various replacements for what this function does, and we are not
calling it internally any more.
2016-06-10 16:13:27 +01:00
Emmanuele Bassi
c5d0522a23 Deprecate the gdk_window_begin/end_paint family of functions
They are replaced by the more appropriate gdk_window_begin_draw_frame()
and gdk_window_end_draw_frame() functions.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
dda6a0d385 Associate the drawing context to the Cairo context
Instead of associating the GdkWindow that created the GdkDrawingContext
we can directly bind the Cairo context to the GDK drawing context.

Cairo contexts created via gdk_cairo_create() go back to not having a
GdkWindow associated to them, like they did before we introduced the
gdk_window_begin_draw_frame() API.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
a7ef37da2a Add GdkDrawingContext
Instead of giving out Cairo contexts, GdkWindow should provide a
"drawing context", which can then create Cairo contexts on demand; this
allows us to future proof the API for when we're going to use a
different rendering pipeline, like OpenGL.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Emmanuele Bassi
2c7b21718f Simplify the widget rendering entry point
Now that GDK has the appropriate API, we can simplify the widget drawing
code into a single function.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00
Benjamin Otte
775e277ab9 widget: Add classes to widget path even if no style context exists yet
This removes leftover code from when classes where added to the style
context.
Now that they get added directly to css nodes, the classes can exist
without a style context.

https://bugzilla.gnome.org/show_bug.cgi?id=767312
2016-06-07 16:12:18 +02:00
Timm Bäder
a961b05200 widget: Avoid a deprecation warning 2016-06-02 21:52:11 +02:00
Matthias Clasen
f168de3ada Add a warning for a broken situation
When we emit ::draw, the widget should not have alloc_needed set
anymore. If this happens, it indicates a broken situation. Add a
warning to help tracking down why this might occur.

See https://bugzilla.gnome.org/show_bug.cgi?id=765410
2016-05-30 16:19:29 -04:00
Matthias Clasen
b90ae2cfbf Add a deprecation note
Mark GtkWidget:style property as deprecated in the docs.
2016-05-23 20:40:03 -04:00
Alban Browaeys
cd305c1970 widget: fix GtkLabelAccessible NULL links.
Fix testsuite/a11y/about.ui GtkAboutDialog :
"CRITICAL **: atk_hyperlink_get_start_index: assertion 'ATK_IS_HYPERLINK (link)' failed"
That is set widget->priv->accessible as soon as accessible object is generated.

When accessible object is created accessible->priv->widget is set,
if widget->priv->accessible is not , then _gtk_label_accessible_update_links
exits early, thus without creating the links on the accessible side.
(This as it checks for the widget to have the accessible set before proceeding).

https://bugzilla.gnome.org/show_bug.cgi?id=766458
2016-05-15 10:24:34 -04:00
Benjamin Otte
ddcf47026d widget: No longer postpone style-updated on unrealized widgets
GTK used to not emit GtkWidget::style-updated on widgets that weren't
realized. This sped up construction of complex widgetry in the early
days of GTK3 where we instantly invalidated on every change.
We don't do that anymore, so in theory (and in my limited testing with
widget-factory) this shouldn't be a prolem anymore.

What is a problem though is that postponing style-updated leads to 2
problems:
(1) Unrealized widgets will not emit style-updated which may cause them
    to not properly update their state and return wrong values from
    get_preferred_width/height() etc
(2) Emitting style-updated during realize can happen too late.
    When a widget is not made child-visible by its parent (common
    examples: notebook, paned) it will also not be realized when the
    parent is initially shown. However, when they get realized later
    (after a resize of the parent), they will emit style-updated (and
    potentially queue a resize) during size-allocate.

https://bugzilla.gnome.org/show_bug.cgi?id=765700
2016-05-14 18:48:22 +02:00
Timm Bäder
7116988bcb widget: Add Since annotation to gtk_widget_queue_allocate 2016-05-10 12:53:42 +02:00
Ray Strode
3cba63b2f8 widget: add missing detail to ::query-tooltip emission
This was an oversight in commit dfb368e29bb58b4313b578f0ce75cfc8ead9a1.
2016-05-06 22:31:45 -04:00
Matthias Clasen
3c09783005 Clean up builder parser data after parsing
No need to have these linger around in qdata.
2016-05-06 16:09:12 -04:00
Matthias Clasen
0f116135f4 Avoid emitting ::style-set by name
GtkStyle is deprecated, but we still emit ::style-set quite
a bit, so lets at least not be slow while doing it.
2016-05-06 10:14:07 -04:00
Matthias Clasen
12dfb368e2 Don't emit ::query-tooltip by name
This signal is emitted quite a bit, and we can easily avoid it.
2016-05-06 10:14:07 -04:00
Matthias Clasen
64710def82 Stop storing has-tooltip in qdata
This is queried quite a bit, and we have room for an extra
bit in GtkWidgetPrivate.
2016-05-06 10:14:07 -04:00
Matthias Clasen
ff3264b4c5 widget: Store accessible in GtkWidgetPrivate
Every widget may have one of these, and they are accessed somewhat
frequently.
2016-05-06 06:44:28 -04:00
Matthias Clasen
46edfaa89c Fix indentation mishap 2016-05-06 06:44:28 -04:00