Commit Graph

11162 Commits

Author SHA1 Message Date
Benjamin Otte
2e75cecd49 scale: Port to draw vfunc 2010-09-26 15:11:36 +02:00
Benjamin Otte
e605272436 range: Port to draw vfunc 2010-09-26 15:11:36 +02:00
Benjamin Otte
745f110814 range: Make drawing use a single cairo context 2010-09-26 15:11:36 +02:00
Benjamin Otte
1d5796c95b arrow: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
9233a08991 calendar: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
725749cd14 calendar: Fix drawing order for windows 2010-09-26 15:11:35 +02:00
Benjamin Otte
02572cdf7e calendar: Create one cairo_t per expose event and pass it around 2010-09-26 15:11:35 +02:00
Benjamin Otte
ed996bcd68 cellview: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
0a6b7e5759 spinner: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
7121ec2880 image: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
c76221426a image: Always render the whole image
Otherwise effects like blur etc will have funny seams on repaints.
Oh, and also, the draw vfunc doesn't have an equivalent to event->area
;)
2010-09-26 15:11:35 +02:00
Benjamin Otte
5228913f68 spinbutton: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
d13a2ad66a entry: Remove gtk_entry_is_drawable() checks when painting 2010-09-26 15:11:35 +02:00
Benjamin Otte
c412c1c752 entry: Port to draw signal 2010-09-26 15:11:35 +02:00
Benjamin Otte
696989d499 entry: Split else ifs into separate if statements
Preparation for the draw vfunc
2010-09-26 15:11:35 +02:00
Benjamin Otte
ec4be3619f entry: Add bug reference to workaround 2010-09-26 15:11:35 +02:00
Benjamin Otte
867ab99b1a API: Add gtk_cairo_should_draw_window()
See the function documentation for its purpose and the next commit(s)
for examples on how to use it.
2010-09-26 15:11:35 +02:00
Benjamin Otte
04e58c192e ruler: Port to draw signal 2010-09-26 15:11:35 +02:00
Benjamin Otte
ee8788f766 API: ruler: Change draw_pos vfunc to take a cr, width and height
Also refactor code to use it
2010-09-26 15:11:35 +02:00
Benjamin Otte
f5a10b05b5 API: ruler: Remove private ruler draw functions from header 2010-09-26 15:11:34 +02:00
Benjamin Otte
892593eff4 ruler: Change the way the ruler handles exposes
1) Don't directly draw in motion-notify, instead call
   gtk_widget_queue_draw()
2) Don't draw ticks in expose events anymore, only when they were
   changed
2010-09-26 15:11:34 +02:00
Benjamin Otte
c68029b778 API: ruler: Change draw_ticks vfunc
We now pass in a cairo_t of the backbuffer and the width and height of
the widget/backbuffer, so the vfunc has a place to draw to.
2010-09-26 15:11:34 +02:00
Benjamin Otte
3bd8319a08 ruler: Don't create two cairo_t's 2010-09-26 15:11:34 +02:00
Benjamin Otte
84671438b0 separator: Convert to draw signal 2010-09-26 15:11:34 +02:00
Benjamin Otte
812d9b9948 hsv: Convert to draw signal 2010-09-26 15:11:34 +02:00
Benjamin Otte
5ea1d78857 progressbar: Port to new draw signal 2010-09-26 15:11:34 +02:00
Benjamin Otte
7108586b16 widget: Add draw signal
For now, the draw signal is emitted by default from the expose event, so
widgets can chose to either implement the expose event or the draw
function.
This is for the transitional period from expose event to draw signal.

Note that for now subclasses can only implement the draw function when
none of their parents implemented the expose event.
2010-09-26 15:11:34 +02:00
Benjamin Otte
9507670db4 API: Add API to query width and height when rendering
The functions are gtk_widget_get_allocated_width() and
gtk_widget_get_allocated_height().

They are currently identical to using width/height of
gtk_widget_get_allocation(), but are introduced for ease of use (no need
to use a custom struct) and to free people from having to think about
allocation.x and allocation.y (which is where the origin of the cairo
context in GtkWidget::draw is located).
2010-09-26 15:11:34 +02:00
Kristian Rietveld
03cf19e8e2 Create cairo context after running validate_visible_area()
validate_visible_area() can change the vertical adjustment and thus
trigger window moves/scrolls.  This seems to change the surface for
which gtk_tree_view_bin_expose() just created a cairo context.  Creating
the cairo context after the call to validate_visible_area() fixes
such crashes.
2010-09-26 15:11:34 +02:00
Benjamin Otte
e624656c20 API: Remove GdkColormap 2010-09-26 15:11:34 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
9f47be2216 gtk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Benjamin Otte
e316157671 API: gdk_pixbuf_get_from_drawable() => gdk_pixbuf_get_from_window()
The Colormap argument needed to be removed, so the renaming is just a
side effect.
2010-09-26 15:11:32 +02:00
Benjamin Otte
a9f198082a dnd: Remove unused colormap code 2010-09-26 15:11:32 +02:00
Benjamin Otte
3607a4c082 API: Remove setters and getters for default colormaps
This removes:
gtk_widget_set_default_colormap()
gtk_widget_get_default_colormap()
gtk_widget_get_default_visual()

Colormaps are gone, and the default visual is the system visual of the
default screen.
2010-09-26 15:11:32 +02:00
Benjamin Otte
c51e8bd9e5 API: Remove colormap setting and getting from GtkWidget
gtk_widget_get_colormap() and gtk_widget_set_colormap() are gone. They
are replaced by visuals.
2010-09-26 15:11:32 +02:00
Benjamin Otte
4701bdb2a8 style: Move from colormaps to visuals 2010-09-26 15:11:32 +02:00
Benjamin Otte
c64946c52d trayicon: Use XClearArea
gdk_window_clear_area() isn't smart enough to clear to a parent pixmap
that is part of a window that GDK doesn't manage.
2010-09-26 15:11:32 +02:00
Benjamin Otte
4515f0803b trayicon: Change to use gtk_window_set_visual()
One less user of colormaps, and the code is cleaner, too!
2010-09-26 15:11:32 +02:00
Benjamin Otte
59b227e123 window: Keep track of own visual
Add gtk_window_set_visual() and a "visual" property. This allows
changing the window visual to the rgba one and other awesome things
(like implementing the trayicon spec).
2010-09-26 15:11:32 +02:00
Benjamin Otte
913f3fcc9f gtk: Change gtk_widget_get_visual()
We now return the visual of the topmost widget in widget's stack that
has a window. If no such widget exists, but a GtkWindow is a parent, we
return its visual (note: GtkWindow Will gain support for setting visuals
soon). If a window doesn't exist, we return the system visual of the
default screen.

This change has multiple reasons:
- Colormaps are gone
  Now visuals are the most important resource for creating GDK windows.
- Allow widgets to change visuals for themselves and their children
  By walking the hierarchy, we ensure that child windows have the same
  visual as their parents by default. But widgets can still select a
  different visual in their realize handler when creating the GDK
  window.
- Have a replacement for gtk_widget_set_colormap()
  That function is going to die with colormaps, so a replacement was
  needed. That replacement is going to be gdk_window_set_visual().
- Make a future transition to no-window GTK easy
  Should we ever attempt a change to make all GTK widgets no-window, a
  gtk_widget_set_visual() would be silly, as only widgets with windows
  can have their own visuals. So only toplevels will gain the ability to
  change it.
2010-09-26 15:11:31 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
e06d04032b spinner: We're a no-window widget, so setting a colormap does nothing 2010-09-26 15:11:31 +02:00
Benjamin Otte
ce7379a8bd style: Remove depth member from GtkStyle 2010-09-26 15:11:31 +02:00
Benjamin Otte
b09019560b style: Remove depth checks in render functions
There's no need for them anymore now that we render with Cairo.
2010-09-26 15:11:31 +02:00
Benjamin Otte
b479ff9cb5 API: Remove gtk_widget_push_colormap()
And of course, gtk_widget_pop_colormap() is gone, too.
No replacement is necessary, the function is basically unused.
2010-09-26 15:11:31 +02:00
Benjamin Otte
4dd215f82d tests: Remove GdkPixmap from test
It's not used anymore. (Was it ever?)
2010-09-26 15:11:30 +02:00
Benjamin Otte
b7f2f9a678 gtk: Remove special code for detecting pixmaps as event targets 2010-09-26 15:11:30 +02:00
Benjamin Otte
6607f2b794 API: Rename gdk_set_source_pixmap() to gdk_set_source_window()
That's what it's used for now.
2010-09-26 15:11:30 +02:00
Benjamin Otte
332652f702 API: Change offscreen windows to use a cairo_surface_t
This requires changes to all the offscreen surface getters that used to
return a GdkPixmap before.
2010-09-26 15:11:29 +02:00