Commit Graph

718 Commits

Author SHA1 Message Date
Matthias Clasen
b9f66d9197 Add docs for new API 2010-09-15 13:52:52 -04:00
Matthias Clasen
38e09dcbb1 Use gint instead of in for local consistency 2010-09-15 13:22:51 -04:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Havoc Pennington
474f80442a Add margin and alignment properties to GtkWidget
h-align = START,END,CENTER,FILL
v-align = START,END,CENTER,FILL
margin-left,right,top,bottom
margin

These should obsolete all such similar properties on
layout containers, GtkMisc, GtkAlignment, GtkContainer::border-width

Margin is outside the size request.
If margin were not outside the set_size_request() it would not work the
same way as container-supplied (child property) padding.

Conceptually set_size_request() forces the value from the subclass
(the original unadjusted request) and then we go on to adjust
the request further by adding the margin.
2010-09-12 21:47:10 -04:00
Havoc Pennington
cd2a19a68d GtkWidget: add adjust_size_request adjust_size_allocation virtual funcs
Use these new methods to handle set_size_request (aka aux_info)
inside gtkwidget.c, instead of having external code mess with it.

The virtual functions can be used for other purposes in the
future. For example, GtkContainer::border_width could be
automatically implemented for all container subclasses.
2010-09-12 21:47:10 -04:00
Havoc Pennington
9debfe243f Use _gtk_widget_get_aux_info_or_defaults() when possible in gtkwidget.c
Did not update uses in other files because the plan is to
get rid of those other uses anyhow. So don't want to make
this function available in the header.
2010-09-12 21:47:10 -04:00
Havoc Pennington
cf68c2636a add _gtk_widget_get_aux_info_or_defaults()
This is better than peeking aux info then testing != NULL
in several ways:
- it returns const aux info so if we don't create we can't write
- it ensures that the default we assume if aux_info is NULL is
  the same as the default we set if we've created the aux info
- it avoids typing in != NULL checks
2010-09-12 21:47:10 -04:00
Havoc Pennington
cf6eb47758 default impls of width_for_height,hfw should chain directly not use wrapper API
In GtkBin and GtkWidget we tried to provide handy defaults that
call get_width if there's no get_width_for_height and
get_height for get_height_for_width.

However, they used the wrapper API on GtkSizeRequest instead of
chaining directly to the other method implementation.

This could result in all kinds of surprising behavior, for example,
get_width_for_height() would now already include the effects of set_size_request().

If nothing else it's inefficient. But it's just conceptually wrong,
because to chain to another implementation, we should call the other
implementation, not call a wrapper around the other implementation
(when we're already inside a previous invocation of the wrapper,
i.e. compute_size_for_orientation() ends up reinvoking itself
in the same orientation on the same object which it pretty
likely isn't intending to do)

https://bugzilla.gnome.org/show_bug.cgi?id=628829
2010-09-12 21:47:09 -04:00
Javier Jardón
d3661589f4 gtk/gtkwidget.c: Use accessor functions to access GtkWindowGroup 2010-09-11 04:25:41 +02:00
Tristan Van Berkom
a6a036ce22 Adding note to docs of gtk_widget_set_window()
gtk_widget_set_window() does not add a reference to the
owned window... this is an exception to most gtk_foo_set_bar()
functions where as it acts as if it were named gtk_widget_take_window().

Adding note to the docs to avoid people giving the window to the
widget and naturally proceeding to unref the window.
2010-09-10 03:25:21 +09:00
Benjamin Otte
6624da6393 widget: Fix SEGV when no focus widget exists 2010-09-09 18:10:04 +02:00
Tristan Van Berkom
843be48572 Moved GtkSizeRequest cache to GtkWidget->priv
Now that we have a private data installed directly on
the GtkWidget instance it makes no sense to cache the size
requests on widget qdata. This change will generally make
GTK+ memory less fragmented as well as significantly speed
up the size request process.
2010-09-09 17:19:18 +09:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Javier Jardón
a76d198508 GtkWidget: Move public members to private structure 2010-09-08 21:28:16 +02:00
Tor Lillqvist
801875b805 Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
2010-09-08 21:31:34 +03:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Tristan Van Berkom
278957a5a4 Removed x/y/x_set/y_set from GtkWidgetAuxInfo
These members of GtkWidgetAuxData can no longer be set after
the removal of deprecated gtk_widget_set_uposition(), now removed
these members completely and removed the access to them from
gtk_widget_size_allocate().
2010-09-07 16:21:44 +09:00
Stefan Kost
94420f7110 widget: more details on gtk_widget_grab_focus docs
Tell that widget needs to be mapped and realized.
2010-09-01 16:59:00 +03:00
Matthias Clasen
00438fea3d Declare the GtkWidget::window-dragging style property as readonly
This is how we generally declare style properties, and declaring
this one r/w was just an oversight.
2010-08-28 20:08:14 -04:00
Javier Jardón
2a2f7c0993 gtk/gtkwidget.c: Use accessor functions to access GtkWindow 2010-08-28 03:40:47 +02:00
Jonh Wendell
02b50d71ce Use an acessor function instead of a deprecated macro 2010-08-20 14:11:05 -03:00
Matthias Clasen
a64bd5d1f0 Fix gtk_widget_queue_draw
The draw-border removal did not get it right for !no-window widgets.
Bug 627445.
2010-08-20 08:48:07 -04:00
Matthias Clasen
501eeaff11 Remove GtkWidget::draw-border
This is a never-used style property that came out of some old
themeing experiments, and handling it has some performance
overhead. Bug 426924
2010-08-18 12:46:57 -04:00
Christian Persch
ffa07ee21e Use G_DEFINE_BOXED_TYPE
Bug #627214.
2010-08-18 15:34:47 +02:00
Philip Withnall
3eb197b51f Bug 596125 — Property string fixes 2010-08-10 09:23:49 +01:00
Matthias Clasen
61e34032ec Clarify the docs for gtk_widget_set_has_window()
The previous version of the docs did not make it clear that has-window
is the defaults. Pointed out by Magnus Hjorth, bug 615474.
2010-08-09 21:39:20 -04:00
Dan Williams
1d8aec51cc Elaborate interaction of gtk_widget_grab_default() and GtkEntry widgets 2010-08-07 23:14:47 -05:00
Benjamin Otte
5649431acb docs: Remove mention of gdk_draw_drawable()
That function is about to die.
2010-07-26 16:42:49 +02:00
Matthias Clasen
7491e9e97a Allow windows to be dragged by clicking on empty areas
Allow windows to be dragged by clicking on empty areas in menubars
and toolbars. This is under theme control, via the GtkWidget::window-dragging
style property. The idea is that it makes sense to turn this on if a
theme makes the window frame and the menubar/toolbar appear visually
contiguous.

The main patch was written by Cody Russell, with a contribution by
Ayan George. See bug 611313.
2010-07-16 01:15:47 -04:00
Javier Jardón
d4a59142ad Use accessor funtions to acces GtkInvisible 2010-07-13 19:40:48 +02:00
Javier Jardón
63f8313015 gtkcontainer: Add _gtk_container_get_reallocate_redraws internal accessor
Only used in gtkwidget
2010-07-13 19:40:46 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Javier Jardón
eaab96c066 Use GSlice for GtkRequisition
Also add gtk_requisition_new to avoid memory allocator confusions when
using GtkRequisitions.

Based on a Christian Persch patch.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=461618
2010-07-10 06:13:45 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Colin Walters
c609c4e807 Fix annotation syntax for gtk_widget_class_path 2010-07-06 15:50:07 -04:00
Benjamin Otte
300e6b84cd s/GdkRegion/cairo_region_t/ in all of gtk
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Benjamin Otte
3e96cfe8fc Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-29 16:06:38 +02:00
Javier Jardón
d35e4848a2 [docs] Fix annotations: "(allow-none): (out)" -> "(out) (allow-none)" 2010-06-24 18:10:03 +02:00
Carlos Garnacho
882fdfab78 GtkWidget: ensure device events are set on realize.
https://bugzilla.gnome.org/show_bug.cgi?id=621690
2010-06-24 02:30:54 +02:00
Tristan Van Berkom
edd57602b8 Mass api change from GtkExtendedLayout --> GtkSizeRequest
This commit makes a few massive changes to the extended layout
code:
  a.) gtkextendedlayout.c --> gtksizerequest.c
  b.) _is_height_for_width --> get_request_mode()
  c.) get_desired_size(), get_desired_width(), get_desired_height() -->
      get_size(), get_width(), get_height()

This is the first partial commit and only effects portions
of the tree that have already been merged in master (in order to
easily cherry pick this commit).

Conflicts:

	gtk/Makefile.am
	gtk/gtk.h
	gtk/gtk.symbols
	gtk/gtkextendedlayout.h
2010-06-18 00:11:26 -04:00
Carlos Garnacho
8c957ef3ef GtkWidget: Undef GDK_DISABLE_DEPRECATED
This is needed for gdk_input_set_extension_events(), used by its GTK+
counterpart.
2010-06-15 21:06:10 +02:00
Steve Frécinaux
8147019930 [gtkwidget] Add type annotations for the event signals. 2010-06-08 22:37:55 +02:00
John (J5) Palmieri
0491b409a9 add transfer-none to return value of gtk_widget_get_window 2010-06-07 18:21:21 -04:00
Matthias Clasen
6a8a2f7ef3 Remove docs about 1.2 <> 2.0 differences
These should not be kept in 3.0.
Noticed by Dan Winship in bug #619838.
2010-06-02 19:59:41 -04:00
Matthias Clasen
ee0d695a91 Fix a doc typo
See bug #620244
2010-06-02 19:56:47 -04:00
Matthias Clasen
c7a48881c6 Documentation fixes 2010-05-25 19:27:42 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Christian Dywan
82e27aede9 Explain that unmap-event may never be emitted
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=613302
2010-05-21 17:10:25 +02:00
Johan Dahlin
a81f00ff33 [GtkWidget] Add annotations
Add a couple of out/inout annotations
2010-05-12 19:53:24 -03:00
Javier Jardón
2b64a7fd54 Remove some deprecated stuff from GdkWindow
Also, substitute the deprecated functions with the correct ones
2010-05-12 04:29:55 +02:00