Commit Graph

23193 Commits

Author SHA1 Message Date
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
f52a1fcfbd API: remove gdk_drawable_get_size() 2010-09-26 15:11:45 +02:00
Benjamin Otte
5b687d938a gdk: Remove default implementations for get_*_region
This should only be used on windows anyway and GdkWindow has an
implementation for both functions.
2010-09-26 15:11:45 +02:00
Benjamin Otte
9403e167b4 docs: Get rid of gdk_drawable_get_size() usage in shooter example 2010-09-26 15:11:45 +02:00
Benjamin Otte
aa70d351c4 tests: Get rid of gdk_drawable_get_size() usage in testwindows 2010-09-26 15:11:45 +02:00
Benjamin Otte
cdba1f6519 tests: Get rid of gdk_drawable_get_size() usage in offscreenbox 2010-09-26 15:11:45 +02:00
Benjamin Otte
15497825c0 testgtk: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +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
c5d309e596 msw-engine: Remove sanitize_size code
It's not needed with the new APIs
2010-09-26 15:11:43 +02:00
Benjamin Otte
f5ad38fdc4 gtk-demo: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
9826c31a9f gdk: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
0a57863f73 win32: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
f44f35548d quartz: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
e8e657725c x11: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:43 +02:00
Benjamin Otte
6c971ac479 API: Remove window clear APIs
The feature can and should be implemented manually using
gdk_window_get_background() and Cairo drawing. A non-cairo drawing API
does not make sense in GDK anymore.
2010-09-26 15:11:43 +02:00
Benjamin Otte
fd200f07f5 gdk: No need to clear offscreen window when showing
I don't think it's necessary to clear the backing surface when showing
the window, as we're going to repaint it anyway. If it's needed, we can
implement it again using internal APIs, as the public window_clear()
APIs are going away.
2010-09-26 15:11:43 +02:00
Benjamin Otte
af32c9c9be API: Add size getters for GdkWindow
gdk_window_get_width() and gdk_window_get_height() will replace
gdk_drawable_get_size().
2010-09-26 15:11:43 +02:00
Matthias Clasen
f3ccf2fccf Add gtk_cairo_should_draw_window to the docs 2010-09-26 15:11:43 +02:00
Matthias Clasen
b7027d778c Docs: start migration guide additions 2010-09-26 15:11:43 +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
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
45836db7a5 test: Port offscreen test to draw vfunc 2010-09-26 15:11:42 +02:00