Commit Graph

11290 Commits

Author SHA1 Message Date
Tristan Van Berkom
de0428fe52 Fixing documentation of gtk_widget_get_request_mode() 2010-09-27 15:11:27 +09:00
Matthias Clasen
d869a1e419 Remove GtkWidgetFlags 2010-09-26 22:18:46 -04:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Javier Jardón
3b8184cfee Move classes that currently derive from GtkObject to GInitiallyUnowned 2010-09-26 22:18:13 -04:00
Javier Jardón
945e97e505 Move documentation to inline comments: GtkPaperSize 2010-09-27 03:49:49 +02:00
Tadej Borovšak
d947178e42 Update and expand GtkAccelMap API docs 2010-09-27 03:04:34 +02:00
Javier Jardón
e267ed84db Move documentation to inline comments: GtkAccelMap 2010-09-27 02:56:25 +02:00
Benjamin Otte
18e489fedd image: Fix up draw function
The previous port to the draw function was a tiny bit incomplete. This
patch should fix the remaining issues and remove unused variables.
2010-09-26 17:51:05 +02:00
Benjamin Otte
c34c05217c accellabel: Remove gtk_widget_is_drawable() check from draw vfunc 2010-09-26 15:11:46 +02:00
Benjamin Otte
41e6da4075 treeview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
bc3d3e6cf4 spinbutton: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
92732ffea0 notebook: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
bd4545c03a menu: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
7a2010ae28 iconview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
90beb8a514 entry: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
e13d93a707 calendar: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:45 +02:00
Benjamin Otte
19d1377494 textview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:45 +02:00
Benjamin Otte
0795f1e0c9 API: Add gtk_cairo_transform_to_window()
The function reverses the transform that GTK does before emitting a draw
event. So we can use it in "old" widgets to revert the coordinate system
properly.
2010-09-26 15:11:45 +02:00
Benjamin Otte
e66129015d cellrenderer: Merge GtkCellSizeRequest into GtkCellRenderer
This mostly goes to keep consistency with the changes to GtkSizeRequest
in the last patch, as GtkCellSizeRequest requires GtkCellRenderer and
GtkCellRenderer implements GtkCellSizeRequest there's no use in keeping
them separate.

This patch renames the functions:
gtk_cell_size_request_get_request_mode()
  => gtk_cell_renderer_get_request_mode()
gtk_cell_size_request_get_width()
  => gtk_cell_renderer_get_preferred_width()
gtk_cell_size_request_get_height()
  => gtk_cell_renderer_get_preferred_height()
gtk_cell_size_request_get_size()
  => gtk_cell_renderer_get_preferred_size()
gtk_cell_size_request_get_width_for_height()
  => gtk_cell_renderer_get_preferred_width_for_height()
gtk_cell_size_request_get_height_for_width()
  => gtk_cell_renderer_get_preferred_height_for_width()
... and moves the corresponding vfuncs to GtkCellRenderer.

The patch also renames the implementations of these functions in cell
renderers to include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
ffa5587fb3 dnd-quartz: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
99eae4e208 window: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
64dddaf1fe widget: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
f999c8dc29 viewport: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
21d6aba620 treeview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
e10f5e9ad5 textview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
e25208825f testutils: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
f0c067063c spinbutton: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
fb43f590e9 plug: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
dca859dfa1 offscreenwindow: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
6eb6135e2d notebook: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
2743f0bdcd menu: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
a145deb083 iconview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
2e5df3306a handlebox: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
34c6e35152 entry: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
7125712299 calendar: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
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