Benjamin Otte
5f57cede3c
widget: Check the widget has an allocation in gtk_widget_draw()
...
Following the mailing list discussion, require that the widget does not
have a pending size_allocate when calling the draw function.
http://mail.gnome.org/archives/gtk-devel-list/2010-September/msg00214.html
and the associated thread explain this in more detail.
2010-09-26 15:11:43 +02:00
Benjamin Otte
b89920e203
API: Add gtk_widget_draw()
...
And here's the final patch that all the previous patches were about.
2010-09-26 15:11:43 +02:00
Benjamin Otte
1142c8bf18
API: gtk_cell_renderer_render_cairo() => gtk_cell_renderer_render()
2010-09-26 15:11:43 +02:00
Benjamin Otte
ec6e97be4d
API: Remove gtk_cell_renderer_render()
...
The next commit will rename gtk_cell_renderer_render_cairo() to
gtk_cell_renderer_render() again
2010-09-26 15:11:43 +02:00
Benjamin Otte
67284a57de
API: Get rid of gtk_draw_insertion_cursor()
...
and rename gtk_cairo_draw_insertion_cursor() to
gtk_draw_insertion_cursor().
2010-09-26 15:11:43 +02:00
Benjamin Otte
1d3f6b30b0
API: Rename gtk_cairo_paint_*() to gtk_paint_*()
...
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
70e6aba0d0
API: style: Remove old drawing functions
2010-09-26 15:11:42 +02:00
Benjamin Otte
326f887ae7
API: widget: Remove the expose event
...
gtk_widget_send_expose() now calls the draw function.
2010-09-26 15:11:42 +02:00
Benjamin Otte
9aa4f417d0
API: Remove gtk_container_propagate_expose()
...
Also, move the documentation to its replacement
gtk_widget_propagate_draw().
2010-09-26 15:11:42 +02:00
Benjamin Otte
7947b3faf8
container: Implement gtk_container_propagate_draw() without fallbacks
...
No more fallbacks to gtk_container_propagate_expose().
2010-09-26 15:11:42 +02:00
Benjamin Otte
45744d9a5f
Change semantics of the draw signal
...
Previously, we tried to move the context's origin to the widget's top
left location, no matter what window the paint was happening on. Now we
only do that for child windows of the widget's window and leave the
context untouched for windows that the widget has created outside its
own hierarchy. In those casses, we also don't clip the context to
the widget's allocation.
Includes fixes to GtkHandlebox for this effect and fixes all known
issues with it.
These semantics assume that gtk_widget_draw() should only draw the parts
of a widget that are inside child windows and not draw stuff that is
located in completely different GdkWindows. In the handlebox case, it
means that it should only draw the handle when it is attached, but not
when it isn't. We'll likely need a special draw function for the
detached handlebox if we want to draw it.
2010-09-26 15:11:42 +02:00
Benjamin Otte
0acec382c8
widget: Clip drawing to the widget's allocation.
...
I've seen (and written) quite some widgets (and theme engines) that use
cairo_paint() to draw the background. So avoiding overdraw makes sense.
Also move all that setup into a _gtk_widget_draw_internal() function
that will be used by all functions that can be used by other functions
that draw widgets.
2010-09-26 15:11:42 +02:00
Benjamin Otte
0c285bad75
iconfactory: Initialize varibale to NULL in failure path
...
Otherwise we use random memory and that is not good.
2010-09-26 15:11:42 +02:00
Benjamin Otte
8929321cba
image: Add a default case to switch statement to avoid gcc warnings
2010-09-26 15:11:42 +02:00
Benjamin Otte
3f10e45ea1
printunixdialog: Connect to draw vfunc
2010-09-26 15:11:40 +02:00
Benjamin Otte
d207fd05e5
printunixdialog: Connect to draw signal for collate callback
2010-09-26 15:11:40 +02:00
Benjamin Otte
b0f078ba43
dnd-quartz: Connect to draw func for dnd hilight
2010-09-26 15:11:40 +02:00
Benjamin Otte
729f80b554
dnd: Connect to raw func for drag hilight
2010-09-26 15:11:40 +02:00
Benjamin Otte
830cda9e32
colorsel: Connect to draw signal
2010-09-26 15:11:40 +02:00
Benjamin Otte
b717f1b265
filechooserentry: Connect to draw event
2010-09-26 15:11:40 +02:00
Benjamin Otte
8f2fdec7d6
colorbutton: Connect to draw event
2010-09-26 15:11:40 +02:00
Benjamin Otte
5f771c8a9f
notebook: Connect to draw signal
2010-09-26 15:11:40 +02:00
Benjamin Otte
c54968e964
tooltip: Connect to draw signal
2010-09-26 15:11:40 +02:00
Benjamin Otte
bec11c352d
toolitemgroup: Connect to draw signal
2010-09-26 15:11:40 +02:00
Benjamin Otte
a4bbe4da10
assistant: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
b0c5302115
trayicon: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
1b9f793311
window: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
15f48a818d
window: Remove hack to set background
...
I can't see this having any effect in current code, but who knows...
2010-09-26 15:11:39 +02:00
Benjamin Otte
67299ed106
expander: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
e63d6dd379
frame: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
fac27827c4
frame: Remove unneeded is_drawable() check
2010-09-26 15:11:39 +02:00
Benjamin Otte
ff97485695
API: checkbutton: Port to draw vfunc
...
Requires changing the API of the draw_indicator vfunc.
2010-09-26 15:11:39 +02:00
Benjamin Otte
be8a398bb5
radiobutton: Remove redundant is_drawable() check
2010-09-26 15:11:39 +02:00
Benjamin Otte
70bdbb3f4c
checkbutton: Remove redundant is_drawable() check
2010-09-26 15:11:39 +02:00
Benjamin Otte
66bd7c1578
checkbutton: Remove excessive is_drawable() check
2010-09-26 15:11:39 +02:00
Benjamin Otte
6a0c31143f
handlebox: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
2e53b58b01
handlebox: Simplify painting code
2010-09-26 15:11:39 +02:00
Benjamin Otte
08d05f954d
handlebox: Don't draw outside of expose events
...
We do a queue_draw() via queue_resize() here, so everything's fine.
2010-09-26 15:11:39 +02:00
Benjamin Otte
748d3d612d
button: Port to draw vfunc
...
Also port togglebutton, they use the same paint function.
2010-09-26 15:11:39 +02:00
Benjamin Otte
e0be884297
button: Remove is_drawable() check
...
It's already done in the expose function
2010-09-26 15:11:39 +02:00
Benjamin Otte
ee15f5aab1
tearoffmenuitem: remove is_drawable() check
2010-09-26 15:11:39 +02:00
Benjamin Otte
c9c9d2ac15
API: checkmenuitem: Port to draw vfunc
...
Requires changing the draw_indicator vfunc to take a cairo_t.
2010-09-26 15:11:39 +02:00
Benjamin Otte
79477e097d
tearoffmenuitem: Port to draw vfunc
2010-09-26 15:11:39 +02:00
Benjamin Otte
557b9d0b26
tearoffmenuitem: Don't clear the window, it should be clear already
2010-09-26 15:11:38 +02:00
Benjamin Otte
d992df0a47
tearoffmenuitem: Merge paint() into expose()
2010-09-26 15:11:38 +02:00
Benjamin Otte
6f6c81e527
menuitem: Remove is_drawable() check
2010-09-26 15:11:38 +02:00
Benjamin Otte
475f96216d
menuitem: Port to draw vfunc
2010-09-26 15:11:38 +02:00
Benjamin Otte
e6d1c8aeab
menuitem: Move paint function into expose function
2010-09-26 15:11:38 +02:00
Benjamin Otte
1f640d127e
combobox: Port to draw vfunc
2010-09-26 15:11:38 +02:00
Benjamin Otte
fe4c61b1ec
eventbox: Port to draw vfunc
2010-09-26 15:11:38 +02:00