Compare commits

...

662 Commits

Author SHA1 Message Date
Cody Russell dd70103f39 Abstract GtkMenuProxy type module work in progress. 2010-05-06 12:38:23 +02:00
Danielle Madeley 227d59c190 Expose visible() and modify() as vcalls in class
This makes it possible to create filter subclasses by implementing the vcalls.
You can optionally chain up to the parent class' implementation, to make it
possible to have "your filter + additional custom filtering".

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604150
2010-05-04 03:42:22 +02:00
Javier Jardón 64812ce662 Added an extra validation in gdk_pixbuf_loader_set_size()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=380196
2010-05-04 00:39:46 +02:00
Wouter Bolsterlee 4fb6b9d579 Dutch translation updated by Wouter Bolsterlee 2010-05-03 23:35:18 +02:00
Javier Jardón c1d36af3e8 Do not use C99 constant INFINITY
Use G_MAXDOUBLE instead
2010-05-03 22:47:21 +02:00
Benjamin Otte ba3e997dae Make toolbutton not call functions on non-GtkMisc 2010-05-03 20:20:44 +02:00
John (J5) Palmieri 33194ff5f4 add a get_indices_with_depth method to GtkTreePath with proper GI array annotations
* get_indices does not return a length so we can not annotate it to return an
  array in bindings that use GObject Introspection
* this method is the same as get_indices except it takes an int * as the depth
  parameter which we can then use in the array annotation
* in C this function returns an integer pointer array and updates depth to the
  number of integers in the array
* in a GI binding this returns the native array type for the bound language
  (e.g. in PyGI this returns a list of integers)
2010-05-03 12:47:38 -04:00
Tor Lillqvist 5098f34234 Update the Makefile for scribble-xinput
Don't use GTK_DISABLE_DEPRECATED as scribble-xinput does use
deprecated API. Also, make the CC command line more canonical.
2010-05-03 13:49:16 +03:00
Matthias Clasen 0eaa177210 Updates 2010-05-02 23:00:55 -04:00
Javier Jardón bcfc53066a tests: Too many arguments in call to 'create_menu' 2010-05-03 02:59:35 +02:00
Reşat SABIQ dc00452d34 Updated Crimean Tatar (Crimean Turkish) translation 2010-05-02 14:07:17 -05:00
Reşat SABIQ 0a05a199c4 Updated Crimean Tatar (Crimean Turkish) translation 2010-05-02 14:07:16 -05:00
Benjamin Otte b08a6750dc filechooser: Fix a crash when removing files
The file removal code was not properly clearing the file=>array index
cache, so later lookups into that cache would return invalid array
indexes.

The easiest way to reproduce it is to create a directory with two files
and deleting both of them.

Reported-by: Javier Jardón <jjardon@gnome.org>
2010-05-02 14:34:43 +02:00
Matthias Clasen 4cf9ac5b4d Add a frame to the examples 2010-05-01 21:40:44 -04:00
Matthias Clasen 1782151092 Doc fixes
Correct some Since tags.
2010-05-01 21:40:43 -04:00
Matthias Clasen 201635a203 Fix doc typos 2010-05-01 21:40:43 -04:00
Matthias Clasen 82647f274c Integrate GtkExtendedLayout docs 2010-05-01 21:40:43 -04:00
Fran Diéguez 89a645108d Updated Galician translation 2010-05-02 00:17:01 +02:00
Fran Diéguez f3b2632731 Updated Galician translation 2010-05-02 00:10:08 +02:00
Kjartan Maraas c2ef54fa5f Updated Norwegian bokmål translation 2010-05-01 17:06:26 +02:00
Javier Jardón 1cf85176e4 Add gtk_extended_layout_get_desired_size() to gtk.symbols 2010-05-01 16:04:51 +02:00
Javier Jardón 0d85671bc9 Fix some compilation warnings 2010-05-01 03:52:03 +02:00
Matthias Clasen db76c77b81 Merge branch 'native-layout-incubator'
Conflicts:
	configure.in
	docs/reference/gtk/tmpl/gtkaction.sgml
	docs/reference/gtk/tmpl/gtkbuilder.sgml
	gdk/directfb/gdkkeys-directfb.c
	gdk/gdk.symbols
	gdk/x11/gdkwindow-x11.c
	gtk/gtkalignment.c
	gtk/gtkbox.c
	gtk/gtkbutton.c
	gtk/gtkcelleditable.c
	gtk/gtkfilechooser.c
	gtk/gtkframe.c
	gtk/gtkinvisible.c
	gtk/gtklabel.c
	gtk/gtkscrolledwindow.c
	gtk/gtksearchenginetracker.c
	gtk/gtktextview.c
	gtk/gtktoolbutton.c
	gtk/gtktooltip.c
	gtk/gtkviewport.c
	gtk/gtkwidget.c
	gtk/gtkwindow.c
	po-properties/ca@valencia.po
	po-properties/es.po
	po-properties/kn.po
	po-properties/mr.po
	po/ca.po
	po/ca@valencia.po
	po/el.po
	po/es.po
	po/gl.po
	po/id.po
	po/kn.po
	po/lv.po
	po/mr.po
	po/th.po
2010-04-30 17:56:50 -04:00
Jorge González 6ea712fe09 Updated Spanish translation 2010-04-30 07:56:20 +02:00
Jorge González e50c6e5837 Updated Spanish translation 2010-04-30 07:56:15 +02:00
Matthias Clasen fc1450d55d Set an appropriate title on the folder selection dialog for print-to-file 2010-04-29 17:14:14 -04:00
Matthias Clasen 556531b16f Get symbolic colors for statusicons from systray
Uses the X property _NET_SYSTEM_TRAY_COLORS.
2010-04-29 17:01:25 -04:00
Matthias Clasen 1335275548 Add a way to set symbolic colors per-widget
The new function, gtk_widget_modify_symbolic_color() is similar
in spirit to the other gtk_widget_modify_ functions.
2010-04-29 17:01:25 -04:00
Tadej Borovšak be3a1abc04 Move documentation to inline comments: GtkBuilder
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611742

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-28 18:41:34 +02:00
Tadej Borovšak d6bc1a99dc Move documentation to inline comments: GtkButtonBox
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=612349

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-28 18:41:34 +02:00
Tadej Borovšak ef4e7b2473 Move documentation to inline comments: GtkBox
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611742

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-28 18:41:33 +02:00
Javier Jardón fa3bb041eb Fix <ulink> tag in previous commit 2010-04-28 18:41:33 +02:00
Matthias Clasen 3833ef5c35 Fix the build 2010-04-28 11:17:30 -04:00
Matthias Clasen b3dd3a89d3 Formatting tweaks 2010-04-28 11:15:15 -04:00
Matthias Clasen 5d5d93e624 Make the docs build
Grr
2010-04-28 11:10:34 -04:00
Matthias Clasen 50656c74e3 Some doc and formatting tweaks 2010-04-28 10:04:21 -04:00
Matthias Clasen 6b939d57c7 Support 'symbolic' themed icons
Add gtk_icon_info_load_symbolic() to load symbolic icons, and
theme their background/foreground colours to match the
colours used in the theme.

Adds the gtk_icon_info_load_symbolic() function, explicit
support in GtkImage and GtkCellRendererPixbuf, and test cases
for those 2 widgets.

With help from Bastien Nocera <hadess@hadess.net>

https://bugzilla.gnome.org/show_bug.cgi?id=614711
2010-04-28 12:02:05 +01:00
Matthias Clasen c8dd9895e4 Add some documentation about width-chars and max-width-chars
Explain how these properties determine the width of ellipsized
and wrapped labels.
2010-04-28 00:48:15 -04:00
Matthias Clasen 538ec4efbb Add a GtkExtendedLayout implementation for GtkFrame 2010-04-26 18:07:42 -04:00
Matthias Clasen cd45dfaa1d Tiny documentation tweak 2010-04-26 07:34:01 -04:00
Matthias Clasen a0b61a5a72 Make testellipsize work for rotating non-ellipsized labels 2010-04-25 20:58:36 -04:00
Matthias Clasen 36c3eaea81 Refer to GtkExtendedLayout from the container docs 2010-04-25 17:32:44 -04:00
Matthias Clasen f285ed1348 Treat h and v boxes the same way
...we've got the money!
2010-04-25 17:12:15 -04:00
Matthias Clasen ff267664b8 Fix a few typos 2010-04-25 16:59:13 -04:00
Matthias Clasen bcbd7cce13 Don't add padding to a pointer 2010-04-25 16:45:21 -04:00
Matthias Clasen ff0eb03201 Fix a regression in RTL flipping
This was only showing up with pack-end packing in horizontal boxes.
The RTL flipping has to be applied after moving the reference point
to the left edge of the child.
2010-04-25 16:23:01 -04:00
Matthias Clasen 148ea63dba Formatting and typo fixes 2010-04-23 21:52:55 -04:00
Tristan Van Berkom 909ca43c1a Renamed testextendedlayout2 --> extendedlayoutexample, also removed testextendedlayout and letting it reside for now in native-layout branch. 2010-04-21 04:11:55 -04:00
Tristan Van Berkom 2a5272647d Mega commit backing out everything from the native-layout branch that
is not ready for integration

This commit makes the native-layout branch into a reasonable
patch applicable to git master, it pulls out GtkCellRenderer
support, ComboBox support, the Plug/Socket api is also not ready
and is pulled out.
2010-04-21 03:42:23 -04:00
Tristan Van Berkom 9306a73dfd Added documentation, implemented gtk_extended_layout_is_height_for_width() where needed. 2010-04-21 01:32:55 -04:00
Tristan Van Berkom 504ec365a7 Improved legibility of the label parameters test. 2010-04-20 22:02:48 -04:00
Tristan Van Berkom 7db18bb726 Added test reflecting the usage of GtkLabel parameters. 2010-04-20 20:44:24 -04:00
Tristan Van Berkom a3a245ab56 Updated test for api change. 2010-04-20 20:44:11 -04:00
Tristan Van Berkom 4d06d75dce Updating test for api change. 2010-04-20 20:43:41 -04:00
Tristan Van Berkom 680d7762ba Make sure not to base the minimum size on "max-width-chars", only the natural size. 2010-04-20 20:30:10 -04:00
Tristan Van Berkom 630357beb3 Added test to demonstrate width-for-height labels. 2010-04-20 18:58:44 -04:00
Tristan Van Berkom dfd311497d Fixed GtkLabel to wrap correctly and report width-for-height correctly when vertical. 2010-04-20 18:54:50 -04:00
Tristan Van Berkom d5b31c303c Slightly reduced extended layout cache size, updated authors/copywrite year. 2010-04-20 18:53:54 -04:00
Tristan Van Berkom 17883f3ce6 Fixed GtkLabel to include GtkMisc padding when calculating height-for-width. 2010-04-20 15:23:13 -04:00
Tristan Van Berkom 80428e7745 Restore layout in get_desired_size() after guessing a wrap width
This fixes the label layout in cases where gtk_widget_size_request()
is called on a label without a following size_allocate(), for instance
when a button state changes.
2010-04-20 14:16:13 -04:00
Tristan Van Berkom 4ed5e6d526 Various updates to follow new gtk_extended_layout_get_desired_size added argument. 2010-04-20 01:30:56 -04:00
Tristan Van Berkom b7a05d1832 Fixed missing return from get_desired_width/height in GtkViewport (causing testgtk to have a small width). 2010-04-20 01:27:32 -04:00
Tristan Van Berkom c927f5e60d Split up width and height queries so that they make more sense (extended-layout) 2010-04-20 01:26:58 -04:00
Tristan Van Berkom 0330658a7f Added request_natural argument to get_desired_size()
Currently get_desired_size() is more of an emulation of
gtk_widget_size_request() for the minimum size as it bases the
contextual request on the minimum preferred size; this argument
lets you do the request with the natural preferred size as well.
2010-04-20 01:24:51 -04:00
Tristan Van Berkom 3a9ab87489 GtkAlignment now tries to allocate natural size to the child if available and does the height-for-width calculation depending on allocation. 2010-04-20 01:22:31 -04:00
Tristan Van Berkom 0b92348077 Fixed acces of child->requisition; call gtk_widget_get_child_requisition instead.
This fixes squished pathbar issue (as access to ->requisition is really
not supported anymore).
2010-04-20 00:33:20 -04:00
Tristan Van Berkom b0fc43e958 Reduced natural request padding for rotating ellipsizing labels
After fixing height requests this works much smoother, although in
some places pango seems to ellipsize a rotated label when given
the width it requested.
2010-04-19 21:50:55 -04:00
Tristan Van Berkom 8ae5e01225 Fixed another caching bug in extended layout
Was confusing width/height REQUEST_NEEDED flags, this caused
the volumebutton test to not re-request the height properly
when changing orientations.
2010-04-19 21:37:44 -04:00
Tristan Van Berkom de4a8f8ddc Unconditionally return the height for the minimum width when doing get_desired_height()
This is the correct support for the opposing orientation for widgets
that support height-for-width, in an interface that was realized as
width-for-height, a height-for-width supporting widget should return
the minimum height for the minimum width when the initial
get_desired_height() is run.
2010-04-19 20:43:19 -04:00
Tristan Van Berkom ee8db39393 Fixed height-for-width cache
Fixed the cache to be cleared when flagged with WIDTH/HEIGHT_REQUEST_NEEDED.
This error was causing some widgets to not be sized correctly (the stock and
icon browser in the demo for instance).
2010-04-19 20:41:23 -04:00
Tristan Van Berkom 119267d7c8 Removing old comments in gtkbin.c 2010-04-19 20:40:04 -04:00
Tristan Van Berkom 3783a0a54f Fixed computation of sizegroups when no explicit request is set.
My previous commit to GtkSizeGroup made sure that when
gtk_widget_set_size_request() is set on a widget, it will be
taken into account when computing the widget's own request,
this commit fixes the case where there is no explicit size
request.
2010-04-19 14:46:28 -04:00
Tristan Van Berkom e9e3725ee7 Fixed testellipsize 2010-04-19 14:04:20 -04:00
Tristan Van Berkom a141c66253 Added testextendedlayout2.c to tests.
This test is a collection of builder files which demonstrate the
added features of natural sizes and height-for-width geometry; so
far it only contains 3 cases, more to come...
2010-04-19 01:07:20 -04:00
Tristan Van Berkom 0dff033a64 Fixed GtkSpinner to request 12x12 at init time instead of at expose time.
This should not change the space taken by the spinner when hidden,
and it should only set the minimum size not the actual size (i.e. code
in place was conditionally setting it if not allocated 12x12, which
doesnt really make sense)... This fixes spinners showing at the correct size
in gtk-demo.
2010-04-18 20:46:30 -04:00
Tristan Van Berkom 4c1fa76520 Fixed _gtk_size_group_bump_requisition() to properly handle values specified by gtk_widget_set_size_request() 2010-04-18 20:45:42 -04:00
Tristan Van Berkom e997ac37a7 Added GTK_DEBUG_EXTENDED_LAYOUT flag and use that for debuggin in gtkextendedlayout.c 2010-04-18 20:14:13 -04:00
Tristan Van Berkom 6dc5cdb981 Implemented GtkExtendedLayout on GtkWindow. 2010-04-18 20:13:46 -04:00
Tristan Van Berkom fe257d23dd Fixed GtkAssistant to not access ->requisition of children directly.
This was causing a 0 height action-area because a GtkBox does not
generally update ->requisition with anything useful
(call gtk_widget_get_child_requisition() here instead).
2010-04-18 20:11:43 -04:00
Tristan Van Berkom 3cbd9e9313 Further fixed base outputs of GtkLabel desired geometries.
Now (when wrapping), if no "width-chars" was specified for a minimum
width, default to the width guessed by gtk_label_ensure_layout(), small
specified widths will otherwise result in very large height requests.
2010-04-18 18:13:56 -04:00
Tristan Van Berkom da318411dc Fixed bug in gtk_extended_get_desired_size().
gtk_extended_get_desired_size() was mixing up orientations based
on the preference, considering ditching the preference anyway.
Also slightly enhanced debug prints.
2010-04-18 18:12:30 -04:00
Tristan Van Berkom 35cc52f418 Compute the collective heights for the width of a horizontal box.
Introduce an algorithm to allocate children some virtual widths based on
their base widths returned by ->get_desired_width(), then return the
collective desired heights for each or thier virtually allocated width.

This will only work in the horizontal orientation.
2010-04-18 18:09:40 -04:00
Tristan Van Berkom 33039c1452 Fixed extended layout test to compile without the gtk_label_set_fullsize() api. 2010-04-18 17:56:58 -04:00
Tristan Van Berkom e8a365ce36 Restore functionality where ellipsizing label *minimum* size grows to "max-char-width". 2010-04-17 23:06:24 -04:00
Tristan Van Berkom 64e23c42bd Fixed GtkLabel reported minimum and natural sizes
This commit makes GtkLabel use "max-width-chars" to determine the
desired natural width for wrapping labels as well as all around refactoring
the initially reported values in get_desired_width/height. this also
addresses some issues with rotating ellipsizing text.
2010-04-17 22:54:29 -04:00
Tristan Van Berkom 8b57ad94c0 Now gtk_extended_layout_get_desired_size() returns a minimum for minimum in the minimum requisition and a natural for minimum in the natural. 2010-04-17 22:52:27 -04:00
Tristan Van Berkom b30445c927 Make GtkWindow use the generic smallest size for the requisition again 2010-04-17 22:51:35 -04:00
Tristan Van Berkom 19ff8cb026 Fixed test to call the extended layout api instead of consulting ->requisition 2010-04-17 22:50:12 -04:00
Tristan Van Berkom 9247bc8d6d Fixed GtkExtendedLayout interaction with sizegroups plus cleanups
Fixed GtkExtendedLayout to interact with sizegroups, "size-requsts"
and caching the values all in the same code segment.

Migrated the cache code to be internal to gtkextendedlayout.c
2010-04-17 01:51:10 -04:00
Tristan Van Berkom 46fe9c3f00 Disabling natural sizes of labels.
Since GtkLabel is returning invalid natural sizes for now,
in order to test regressions well with the new width-for-height
api, I've temporarily disabled the natural values.
2010-04-17 01:49:35 -04:00
Tristan Van Berkom caba7992b8 Refactored GtkSizeGroup for GtkExtendedLayout
Removed _gtk_size_group_compute_requisition and
_gtk_size_group_get_child_requisition in favor of
_gtk_size_group_bump_requisition() which does an orientation
contextual computation of the size group and returns the
collective value in one pass.
2010-04-17 01:46:59 -04:00
Tristan Van Berkom 8432f54c51 Added _gtk_size_group_bump_requisition()
Added a function to update sizegroups in multiple passes, this
way the width and height can be updated in the sizegroups after
querying the extended layout implementor for these.

Implemented this in GtkExtendedLayout, sizegroups should be working reasonably now.
2010-04-14 18:07:27 -04:00
Tristan Van Berkom d2c35ec62a Mega commit to change ->get_desired_size() for ->get_desired_width/height().
This commit changes gtk_extended_layout_get_desired_size() for
per dimension variants. Furthermore this commit reverts the actions
done in size-groups for now as it needs a different approach.

The natural width/height parameters added to aux_info have been changed
for a per width cache for heights and a per height cache for widths.

gtk-demo is still working, currently sizegroups are not taken
into account as mentioned above - size groups need to be alerted both
when the widths and heights are updated independantly and then that
information needs to repropagate also to other extended layout implementors.
2010-04-12 22:21:46 -04:00
Tristan Van Berkom 1b2be80f10 Constrain the window to the minimum width for the natural height
GtkWindow now requests the minimum width for the natural height
of its child, or the opposite; depending on ->get_height_for_width.
Currently its not done for GTK_WINDOW_POPUP windows as the menushells
aren't working right yet.
2010-04-10 22:48:13 -04:00
Tristan Van Berkom 6b89f05a99 Implemented gtk_extended_layout_is_height_for_width() and added another guess algorithm
This patch adds another commented algorythm to find the collective
minimum and natural height for a said width of a horizontally oriented
box (or the opposite). The algorithm works quite well and can be optimized
a bit more - currently its commented because GtkLabel cannot effectively
do width-for-height calculations (doh).

Further, this patch returns an is_height_for_width() preference depending
on the boxes orientation (vertical boxes are width-for-height).
2010-04-10 22:39:11 -04:00
Tristan Van Berkom 639e396147 Fixed gtkbin.c:parent_extended_layout_iface to be static. 2010-04-10 22:38:47 -04:00
Tristan Van Berkom 24950ec144 Added gtk_extended_layout_is_height_for_width()
Added an indicator telling whether a widget prefers to be allocated
as height-for-width or width-for-height. Usually this depends on the
orientation of a container or the nature of a content widget like GtkLabel.

This indicator is only used in the seldom case where a parent is allocating
free space to the child and the child can flow in either direction, GtkWindow
and GtkScrolledWindow are users of this api.
2010-04-10 22:32:55 -04:00
Tristan Van Berkom 629bb5a265 Fixed warnings due to missing GTK_WIDGET (cellview) casting. 2010-04-10 22:31:52 -04:00
Tristan Van Berkom c0e950f17b Fixed wrapping labels to show up correctly aligned inside their allocations. 2010-04-10 22:30:42 -04:00
Tristan Van Berkom c67559ad03 Adding tests ported over from the old branch by Matthias. 2010-04-10 22:03:20 -04:00
Tristan Van Berkom 1041a186c7 Added get_height_for_width/get_width_for_height implementation to GtkBox.
In order for natural size information to cascade correctly up through
the ancestry GtkBox needs to report height-for-width and width-for-height,
this patch includes an implementation for both in both orientations, one
of them is commented for now as its much too cpu intensive to actually use.
2010-04-09 21:50:33 -04:00
Tristan Van Berkom 35e2dfce08 Fixing height-for-width wrapping of GtkLabel
Merged in fixes from the old branch in a patch prepared by Matthias Clasen,
added some fixes of my own to make sure that label wrapping follows allocation
and not requisition at show time (allocate time).
2010-04-09 21:47:25 -04:00
Tristan Van Berkom 73056e92d8 Reimplemented GtkExtendedLayout on GtkBin
Instead of implementing ->get_desired_size() on GtkBin, which
cant really be done because border widths are in the domain of
the concrete subclasses; here we implement only the get_height_for_width
and get_width_for_height apis - GtkBin subclasses whom might have a
variable border width depending on allocations need to write their
own height-for-width implementations.
2010-04-09 00:19:42 -04:00
Tristan Van Berkom b3303727ad Fixed regression in GtkImage size requests
Fixed gtksizegroup.c:do_size_request() to never force an initial requisition
as some widgets expect it to remain unchanged across resizes (GtkImage
with pixbufs/filenames assigned is one of these cases).
2010-04-08 22:05:36 -04:00
Tristan Van Berkom 7304e4227f Fixed gtk_box_size_allocate() for homogeneous boxes
gtk_box_size_allocate() was forgetting to fetch the minimum
size for children when allocating in homogeneous mode and then
accessing the uninitialized allocated values in that case, fixed.
2010-04-08 21:45:07 -04:00
Tristan Van Berkom ffffa7361c Implemented GtkExtendedLayout on GtkComboBox.
With this commit it is possible to use ellipsizing text
in the combobox's cell renderers and have them desire to
expand to natural size when placed in a GtkBox.
2010-04-08 18:54:47 -04:00
Tristan Van Berkom 531b449580 Deprecated gtk_widget_size_request and gtk_widget_get_child_requisition()
Ever since size groups gtk_widget_size_request() can be used in place
of gtk_widget_get_child_requisition(), deprecating both now in favor
of gtk_extended_layout_get_desired_size().
2010-04-08 18:53:23 -04:00
Tristan Van Berkom 99425f15f5 Added assertions
Added assersions that gtk_extended_layout_get_height_for_width()
methods return minimum sizes lesser than the natural size.
2010-04-08 18:52:12 -04:00
Tristan Van Berkom 1706608de3 Simplified code in GtkSizeGroup, fixes minimum natural size.
collapse get_fast_child_requisition && get_fast_natural_size into
a single get_fast_size() function which uses the possibly hard coded
minimum request as a minimum value for the returned desired size
(this fixes cases where widgets unwarily return height-for-width
with minimum size > natural size).
2010-04-08 18:49:34 -04:00
Tristan Van Berkom 36ef655061 Added gtk_cell_view_get_size_of_row() to gtk.symbols 2010-04-08 18:48:42 -04:00
Tristan Van Berkom 143660eff6 GtkCellView refactoring for extended layout
Added gtk_cell_view_get_desired_size_of_row() to report full
extended layout information for a said row, this obsoletes
gtk_cell_view_get_size_of_row(). Also make GtkCellView queue
a resize on itself when cell renderers are added/removed.
2010-04-08 18:46:19 -04:00
Tristan Van Berkom b10f2fc001 Some extended layout fixes for GtkCellView
Fixed GtkCellView to use the new GtkExtendedCell interface to get
natural size from cells and factored out the old size_request() method.
2010-04-07 01:27:15 -04:00
Tristan Van Berkom 51ffd59884 Implement GtkExtendedLayout on GtkButton
GtkButton as a content type of widget needs to forward natural size information
to parent containers in order to be resized naturally.
2010-04-06 20:48:41 -04:00
Tristan Van Berkom 85a55b2921 Implement GtkExtendedLayout on Alignment
GtkAlignment is already using the height for width api to align
the child in the cases where space is available, but also needed
to implement the extended layout in order to reflect natural sizes
to parent widgets.
2010-04-06 20:47:15 -04:00
Tristan Van Berkom 388ad4090c Implemented GtkExtendedLayout on GtkViewport 2010-04-06 17:15:50 -04:00
Tristan Van Berkom a17e12c87d Implement GtkExtendedCell on GtkCellRendererText 2010-04-06 03:05:52 -04:00
Tristan Van Berkom 59dafa77dc Use new gtk_tree_view_column_get_desired_size() 2010-04-06 03:05:20 -04:00
Tristan Van Berkom 3128bd0937 Added gtk_tree_view_column_get_desired_size() as its a corner case
that does not fall under the two categories.
2010-04-06 03:03:55 -04:00
Tristan Van Berkom bb86e61171 Added GtkExtendedCell interface (last commit) 2010-04-06 03:03:03 -04:00
Tristan Van Berkom 7beb83cea4 Add new GtkExtendedCell interface
Added a new interface to extend layout information of GtkCellRenderers,
GtkCellRenderer is a prerequisite of GtkExtendedCellIface and provides
a base implementation of ->get_desired_size() with ->get_size().

Note that the api for GtkExtendedCell differs from GtkExtendedLayout
since the cells need to be passed an additional widget to calculate
sizes contextual to the widget/screen (fonts etc).
2010-04-06 02:59:21 -04:00
Tristan Van Berkom 8263633478 Remove gtk_widget_get_desired_size() 2010-04-06 02:56:20 -04:00
Tristan Van Berkom 68c38e0ffd Fixed classes to call gtk_extended_layout_get_desired_size_again()
The previous patch removes the ambiguous gtk_widget_get_desired_size().
2010-04-06 02:55:07 -04:00
Tristan Van Berkom ef32192329 Call the ->get_desired_size() method directly on the vtable
This commit is a mistake, it should have been included with the last
commit.
2010-04-06 02:53:51 -04:00
Tristan Van Berkom 92309019e5 Make GtkWidget a prerequisite of extended layout
As it is not allowed to called gtk_extended_layout_get_desired_size()
on a GtkWidget directly; gtk_widget_get_desired_size() was really an
ambiguous api. This patch removes the added GtkWidget api, calls
the appropriate sizegroup code which in turn envokes the interface
vtable, this patch also accordingly makes GtkWidget a prerequisite
of GtkExtendedLayout (the api doesnt work for cell renderers anyway,
patch comming...).
2010-04-06 02:47:20 -04:00
Tristan Van Berkom 52eabce3c4 Revert "Implement extended layout for GtkBin"
This reverts commit 5e8045b14d.

Conflicts:

	gtk/gtkbin.c
2010-04-05 18:10:41 -04:00
Tristan Van Berkom 24ed2f8aa1 Fixed 2 bugs in gtk_box_size_allocate()
This commit fixes the loop to take into consideration the
child->padding that will be allocated to the child while calculating
full available size. Additionally it fixes the initial positioning
of child widgets when packed at the end (a special case because the
x position used starts from the end of the box).
2010-04-05 18:01:56 -04:00
Tristan Van Berkom eb537a6773 Fixed do_size_request() to start with a 0 base requisition instead of -1 2010-04-05 17:57:06 -04:00
Tristan Van Berkom 4b1315cedc Changed initial values for requisition from -1 to 0.
When doing size-requests and get_natural_size() calls, use 0 as
the base value instead of -1, because size_request code assumes
that widget->requesition is initialized at 0.
2010-04-04 16:38:36 -04:00
Tristan Van Berkom 75b8f7d3ae Fixed GtkBox to not call get_desired_size() on a child when no child is present. 2010-04-04 16:37:06 -04:00
Tristan Van Berkom 1212f263c3 Making function private in gtktreeviewcolumn to pass the abi test. 2010-04-03 21:37:42 -04:00
Tristan Van Berkom ae2c0b02c3 Refixed merge conflicts for GTK_WIDGET_MAPPED/GTK_WIDGET_VISIBLE 2010-04-03 21:35:18 -04:00
Tristan Van Berkom 5d83f5eba5 Fixed internal native layout algorythm wrt size-request singals/implementations.
Because "size-request" signal can be handled by signal connections as well
as by third party derived classes it is necessary to always fire the
"size-request" signal for every recalculation of the widget requisition,
now gtksizegroup.c:do_size_request() fires the signal first and allows it
to overflow the minimum/natural sizes returned by extended layout
implementations.

GtkWidget->get_natural_size() is now left assigning default -1 values to
ensure they both get overridden by the size-request handling.
2010-04-03 20:59:28 -04:00
Tristan Van Berkom a33053db74 Fixed extended layout implementors to not call ->get_desired_size() directly
Getting the desired size of a GtkWidget must always be done with
gtk_widget_get_desired_size() and never with
gtk_extended_layout_get_desired_size() directly as the former passes
through size group logic and updates the widget->requisition cache.
2010-04-03 20:59:28 -04:00
Tristan Van Berkom 8413f22d90 Removed casing of GTK_IS_EXTENDED_LAYOUT() from GtkViewport. 2010-04-03 20:59:28 -04:00
Tristan Van Berkom 61fab15139 Fixed invalid pointer access in gtk_tree_view_column_get_desired_size() 2010-04-03 20:59:28 -04:00
Tristan Van Berkom 22de1a7c65 Partially fixed GtkTreeview for extended layout
Removed the size_request() handling on the class and calculate
minimum size from get_desired_size(); base the natural width on
either the minimum of column headers, or a greater natural request
of the columns renderers.
2010-04-03 20:59:28 -04:00
Tristan Van Berkom a18af0b980 Applied Jan Arne Petersen's patch for GtkScrolledWindow
Applied patch to add height-for-width/width-for-height suppot
to GtkScrolledWindow plus modifications to use gtk_widget_get_desired_size()
to query children sized instead of directly calling the layout api, plus
removed the ->size_request() implementation interfering with the mess.
2010-04-03 20:59:28 -04:00
Tristan Van Berkom 894e887370 Fixed GtkCellRendererText invalid pointer access.
Fixed get_desired_size() to not access parameters when NULL and
also not to access priv->object if it hasnt yet been assigned.
2010-04-03 20:59:27 -04:00
Jan Arne Petersen 0fbdb3c73f Take extended layout into account in viewport
Make sure the right height is used in GtkViewPort.
2010-04-03 20:59:27 -04:00
Matthias Clasen c4dec47536 Don't use gio-unix on win32
We only need gio-unix when building the x11 backend.
Reported by Yevgen Muntyan in bug 614540.
2010-04-03 20:59:27 -04:00
Inaki Larranaga Murgoitio f48299c86e Updated Basque language 2010-04-03 20:59:27 -04:00
Inaki Larranaga Murgoitio 67eccabfca Updated Basque language 2010-04-03 20:59:27 -04:00
Inaki Larranaga Murgoitio 923e37e908 Updated Basque language 2010-04-03 20:59:27 -04:00
Kenneth Nielsen 829cfe21e1 Updated Danish translation 2010-04-03 20:59:26 -04:00
Runa Bhattacharjee 65a322c94d Updated Bengali India Translation 2010-04-03 20:59:26 -04:00
Runa Bhattacharjee 93df7c133e Updated Bengali India Translation 2010-04-03 20:59:26 -04:00
Jordi Serratosa 299cd7fec1 Fixes to Catalan translation 2010-04-03 20:59:26 -04:00
Tristan Van Berkom 523283bb36 Fixed possible devision by zero in size negotiations
Fixed GtkToolItemGroup to avoid deviding by zero when all children
are invisible or there are no children. bgo #613974.
2010-04-03 20:59:26 -04:00
Tristan Van Berkom 9fe9898045 Added missing default events in realize() implementations
Added gtk_widget_get_events() to the event masks declared by
GtkToolPalette & GtkToolItemGroup.
2010-04-03 20:59:26 -04:00
Tristan Van Berkom 96793999df Added missing break statement to mutator: gtk_tool_item_group_set_property() 2010-04-03 20:59:26 -04:00
Benjamin Otte 80efec2a8c Fix error case in filesystem model
We should not unref the model here, it might not even exist anymore.
Instead check if it exists and only use it if it does.
The unref was leftover from a previous fix in
ba9f53397f.

Spotted by Matthias Clasen in
https://bugzilla.gnome.org/show_bug.cgi?id=614099
2010-04-03 20:59:25 -04:00
David Planella 9441d96620 Updated Catalan translation with a couple of fixes 2010-04-03 20:59:25 -04:00
David Planella 0df8e5e3f0 Updated Catalan translation 2010-04-03 20:59:25 -04:00
Jamil Ahmed a4a0019586 Updated Bengali translation 2010-04-03 20:59:25 -04:00
Christian Dywan 69b241c66d Fix a misspelling in gtk_cell_view_new_with_markup
This fixes bug 613887.
2010-04-03 20:59:25 -04:00
Ask H. Larsen e8f9085426 Updated Danish translation 2010-04-03 20:59:25 -04:00
Maxim V. Dziumanenko 5559cbeb70 Updated Ukrainian translation 2010-04-03 20:59:25 -04:00
Maxim V. Dziumanenko 8e0088dcea Updated Ukrainian translation 2010-04-03 20:59:24 -04:00
Jamil Ahmed 839a347db1 Updated Bengali translation 2010-04-03 20:59:24 -04:00
Jamil Ahmed b19d76a156 Updated Bengali translation 2010-04-03 20:59:24 -04:00
Hiroyuki Ikezoe d995132ca5 [directfb] Fix compile error on DirectFB backend.
Add a stub for gdk_keymap_map_virtual_modifiers.
2010-04-03 20:59:24 -04:00
Hiroyuki Ikezoe 61a73b3df6 Use g_value_take_string to avoid redundant invoking g_free. 2010-04-03 20:59:24 -04:00
Javier Jardón 7ef003f7d4 Fix compilation warning: Use GtkWidget instead GtkMenuItem 2010-04-03 20:59:23 -04:00
Matthias Clasen aaf541903b Fix a 64bit issue
Thank you libpng, for typedef unsigned long png_uint_32.
2010-04-03 20:59:23 -04:00
Matthias Clasen 6af58c6208 Add notes about gobject-introspection 2010-04-03 20:59:23 -04:00
Matthias Clasen 3be389fe96 Bump version to 2.20.1 2010-04-03 20:59:23 -04:00
Matthias Clasen 5a5a24d4dc 2.20.0 2010-04-03 20:59:23 -04:00
Miloš Popović 39779813ab Updated Serbian translations 2010-04-03 20:59:20 -04:00
Matthias Clasen f743b2460a Bump required version of glib in INSTALL.in, too 2010-04-03 20:59:20 -04:00
Matthias Clasen cbfdfb8450 Set version to 2.20.0 2010-04-03 20:59:20 -04:00
Matthias Clasen 381d892079 Another small doc cleanup 2010-04-03 20:59:20 -04:00
Matthias Clasen 7431550129 Minor doc cleanup 2010-04-03 20:59:20 -04:00
Matthias Clasen a22afdb642 Updates 2010-04-03 20:59:20 -04:00
Wouter Bolsterlee 15bc2b787b Dutch translation updated by Tino Meinen 2010-04-03 20:59:20 -04:00
Sjoerd Simons 177973bdfc Prevent the destruction of the menu label on page removal
In certain cases the menu label of a notebook page will be reused after the
page was removed from the notebook, for instance when a page is dragged from
one notebook to another. For such cases make sure that the menu label isn't
destroyed as part of destroying the menu item it was in.
2010-04-03 20:59:19 -04:00
Matthias Clasen b1ca3163a6 Add a dependency for Gtk-2.0.gir on Gdk-2.0.gir
Another parallel build fix, see bug 610946.
2010-04-03 20:59:19 -04:00
Damien Lespiau 2055066d92 introspection: Fix parallel builds
One needs to add an explicit dependency between the gir files and the
.la libtool wrapper as this dependency is not added automatically by
Makefile.introspection. Not adding these breaks parallel builds as make
does not wait for the .la to be generated before launching g-ir-scanner.
2010-04-03 20:59:19 -04:00
Inaki Larranaga Murgoitio 449bc50b24 Updated Basque language 2010-04-03 20:59:19 -04:00
Clytie 69e86f56be Updated Vietnamese translation 2010-04-03 20:59:19 -04:00
Clytie 472ffe7539 Updated Vietnamese translation 2010-04-03 20:59:19 -04:00
Inaki Larranaga Murgoitio 0b0b960122 Updated Basque language 2010-04-03 20:59:19 -04:00
Sweta Kothari 99b6a3df76 Updated Gujarati translations 2010-04-03 20:59:18 -04:00
Sweta Kothari cf87932bba Updated Gujarati Translations 2010-04-03 20:59:18 -04:00
Daniel Nylander 984a16df2a Updated Swedish translation 2010-04-03 20:59:18 -04:00
Daniel Nylander deb012bd34 Updated Swedish translation 2010-04-03 20:59:18 -04:00
Daniel Nylander 5f7e8547f9 Updated Swedish translation 2010-04-03 20:59:18 -04:00
Tommi Vainikainen ad87a23ffe Updated Finnish translation 2010-04-03 20:59:18 -04:00
Chao-Hsiung Liao 637df00c87 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2010-04-03 20:59:17 -04:00
Matthias Clasen fe34ee4ff3 Avoid spurious notifications from GtkEntry
Using gtk_entry_set_buffer() in dispose() causes problematic
notifications, so just get rid of the buffer manually. See bug 613241.
2010-04-03 20:59:17 -04:00
Tomas Bzatek 95dbbe2bda search: update for tracker 0.8 API
Tracker 0.8 series (and late 0.7.xx) introduces new API based on SPARQL
query language. The queries here use fulltext search, just like with
with previous tracker versions. Old tracker 0.6 support is still maintained.
2010-04-03 20:59:17 -04:00
Fabrício Godoy e64cc4edeb Updated Brazilian Portuguese Translation 2010-04-03 20:59:17 -04:00
A S Alam 151c6c2a78 Completed Punjabi Translation by A S Alam 2010-04-03 20:59:17 -04:00
Dumitru Mișu Moldovan 036fa03550 Updated Romanian translation 2010-04-03 20:59:16 -04:00
Mattias Põldaru 291e8bd913 Estonian translation updated 2010-04-03 20:59:16 -04:00
Matthias Clasen 643c7c2060 Make menu scrolling work with auto mnemonics
The menu scrolling code is not robust against menu repositioning so
we have avoid causing unnecessary recalculations of labels in parent
menuitems.
2010-04-03 20:59:16 -04:00
Hiroyuki Ikezoe 837b998810 Fix a tiny documentation typo 2010-04-03 20:59:16 -04:00
Marek Kasik bc57726d91 Define httpGetHostname() for CUPS 1.1 and lower
Function httpGetHostname() is in CUPS since version 1.2, that is why we need
its equivalent for lower versions of CUPS (#610176).
2010-04-03 20:59:16 -04:00
Javier Jardón add084329c More uses of g_strcmp0 2010-04-03 20:59:16 -04:00
Rafal Luzynski 7a6e782184 Use g_strcmp0 where it makes sense 2010-04-03 20:59:16 -04:00
Hiroyuki Ikezoe 5f30ba46ea Don't get settings unless we need them
Pointed out in bug 613028.
2010-04-03 20:59:15 -04:00
Matthias Clasen 1f3a57691f Don't crash in DND when the X server doesn't support SHAPE
Reported in bug 612768
2010-04-03 20:59:15 -04:00
Matthias Clasen 4b7b8e513f Require a new-enough glib 2010-04-03 20:59:15 -04:00
Jan Arne Petersen ed9cff6fbb Fix notify::label emmision in GtkMenuItem
Emit notify::label in GtkMenuItem also when label is changed through GtkAction.

Refactor GtkMenuItem and remove duplicated code for GtkLabel creation. Reset
the accel-widget back to the GtkMenuItem itself when there is no action related
to the GtkMenuItem anymore.

Add test for notify::label emmisions.

Fixes bug 612574 - GtkMenuItem does not emit notify::label when label is
changed through GtkAction.
2010-04-03 20:59:15 -04:00
Tristan Van Berkom c8ee1927a5 Refixed patch for bug 612505.
New patch makes sure to update the display even when
the GtkEntry's buffer is set to NULL, it also breaks the
reference to the buffer in ->dispose() instead of ->finalize().
2010-04-03 20:59:15 -04:00
Matthias Clasen 56c488e690 Improve the behaviour of automatic mnemonics
With this change, key events continue to go to an open menu even
when the pointer is moved over a non-selectable menuitem. The mnemonics
are shown and hidden accordingly.
2010-04-03 20:59:15 -04:00
Matthias Clasen 5b20892a3d Update release notes
Add a warning about the change in GtkBuilders id/name handling.
2010-04-03 20:59:15 -04:00
Colin Walters a0508bc64c [startup notification] Set APPLICATION_ID
http://lists.freedesktop.org/archives/xdg/2010-February/011321.html

In addition to ICON, BINARY_NAME etc., it's very helpful if launcher
programs include the name of the .desktop file they're launching.
This is APPLICATION_ID.

https://bugzilla.gnome.org/show_bug.cgi?id=611118
2010-04-03 20:59:14 -04:00
Fran Diéguez d240b649e7 Update Galician translation 2010-04-03 20:59:14 -04:00
Luca Ferretti 0f90c49440 Updated Italian translation 2010-04-03 20:59:14 -04:00
Matthias Clasen de1b75aabb Fix tests 2010-04-03 20:59:14 -04:00
Luca Ferretti 908915c9da Updated Italian translation 2010-04-03 20:59:14 -04:00
Matthias Clasen 9408915114 Recompute label contents when the buffer changes
Also reset cursor positions to avoid assertions.
This fixes bug 612505, patch by Tristan Van Berkom.
2010-04-03 20:59:14 -04:00
Matthias Clasen df95db7649 Fix gdk_window_set_icon_name
A typo kept this from working on toplevel windows.
Reported in bug 612346.
2010-04-03 20:59:14 -04:00
Matthias Clasen b04186d272 updates 2010-04-03 20:59:13 -04:00
Christian Dywan f909f3866f Remove most G_OBJECT casts in the tutorial
This fixes bug 605333.
2010-04-03 20:59:13 -04:00
Christian Dywan 1b61e9dc2b Reword explanation of delete-event and destroy 2010-04-03 20:59:13 -04:00
Christian Dywan e85b9b3523 Spell delete-event with hyphen and don't cast to G_OBJECT 2010-04-03 20:59:13 -04:00
Christian Dywan 63d03344f9 Improve docs of gtk_notebook_set_tab_label_packing
Use the term tab label rather than bookmark and point out
that packing type is deprecated.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=612575
2010-04-03 20:59:13 -04:00
Tor Lillqvist 2b1ec1b227 Check for __MINGW64__ and not __MINGW64
Should fix bug #612308.
2010-04-03 20:59:12 -04:00
Javier Jardón 74c7588040 Improve GTK_WIDGET_FLAGS() deprecation documentation
Also, use GTK_OBJECT_FLAGS() instead.
Note that some internal code still uses GTK_WIDGET_FLAGS().

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:12 -04:00
Christian Dywan 08bce451b7 Fix definition of GTK_VOLUME_BUTTON_CLASS cast
There is an extra 'e' there.
2010-04-03 20:59:12 -04:00
Alan Knowles 48cc791fb2 Fix introspection on return value transfer for gtk_clipboard_get*
ownership transfer set to none for clipboard get methods
2010-04-03 20:59:12 -04:00
Alan Knowles 2e00e16650 Fix gtk_text_tag_table_lookup transfer introspection notes
transfer should be none for return value of gtk_text_tag_table_lookup
2010-04-03 20:59:12 -04:00
Jorge González 68e833dc1b Updated Spanish translation 2010-04-03 20:59:12 -04:00
Jorge González 8cc486ace5 Updated Spanish translation 2010-04-03 20:59:12 -04:00
David Planella b447f59fe0 Updated Catalan translation 2010-04-03 20:59:12 -04:00
Matthias Clasen c470e592a3 Bump version 2010-04-03 20:59:11 -04:00
Matthias Clasen 167413e7c3 2.19.7 2010-04-03 20:59:11 -04:00
Matthias Clasen 07f2bb0b84 Updates 2010-04-03 20:59:08 -04:00
Javier Jardón 6750ffebc8 Fix compilation warning: use entry var correctly initilized
The warning was added in
commit c744594b20
2010-04-03 20:59:08 -04:00
Matthias Clasen 7b7f8f1e5d Remove conflicting legacy compose sequences in favour of X.org sequences
Patch by Jeroen Hoek. See bug 557420 for a prolonged discussion.
Quick summary of the removed sequences:

<Multi_key> <asciicircum> <0>
Consistency. <Multi_key> <asciicircum> [1..9] gives the superscript digit,
legacy sequence for zero is inconsistent.

<Multi_key> <c> <o>
<Multi_key> <c> <O>
Consistency. <Multi_key> <c> [:letter:] already gives vowel plus caron, legacy
sequence for c is inconsistent.

<Multi_key> <comma> <e>
<Multi_key> <comma> <E>
Consistency. <Multi_key> <comma> [:letter:] is for letter with cedilla,
<Multi_key> <semicolon> [:letter:] is for letter with ogolek

<Multi_key> <C> <slash>
<Multi_key> <slash> <C>
Unintuitive. ¢ is visually a vertical bar through a lowercase c, not a slash
through an uppercase C. ₡ has no alternatives, whilst ¢ can be typed as
<Multi_key> <bar> <c>.

<Multi_key> <d> <minus>
đ can be input through <Multi_key> <minus> <d>. <Multi_key> <d> <minus> is used
for ₫.

<Multi_key> <equal> <L>
<Multi_key> <L> <equal>
Unintuitive. ₤ has two dashes, £ one; therefore L + = > ₤, and L + - = £.

<Multi_key> <exclam> <s>
<Multi_key> <exclam> <S>
Consistency. <Multi_key> <exclam> [:letter:] is used for letter with dot below.
§ can be input using <Multi_key> <o> <s>.

<Multi_key> <period> <period>
Might need an alternative for ˙, but … (upstream) has no alternative either.

<Multi_key> <underscore> <a>
<Multi_key> <underscore> <A>
<Multi_key> <underscore> <o>
<Multi_key> <underscore> <O>
Consistency. <Multi_key> <underscore> [:vowel:] gives vowel with macron for ȳ ū
ī ē too.

<Multi_key> <minus> <d>
<Multi_key> <minus> <D>
<Multi_key> <o> <e>
<Multi_key> <O> <E>
Redundant. In upstream as is.
2010-04-03 20:59:08 -04:00
Matthias Clasen 04fd3f14ac Regenerated compose tables
Now without non-BMP keysyms.
2010-04-03 20:59:08 -04:00
Matthias Clasen 040d8d1414 Updates to the compose-parse.py script
Get gdkkeysyms.h from git, instead of the outdated copy from svn.
Get Unicode 5.2.0 data. Fix a few issues with missing keysyms in
keysyms.txt. Make the filtering of non-BMP keysyms work.
2010-04-03 20:59:08 -04:00
Matthias Clasen d50cd83fd0 Add some keysyms missing from keysyms.txt 2010-04-03 20:59:07 -04:00
Matthias Clasen 94e80bbbed fix file permissions 2010-04-03 20:59:07 -04:00
Matthias Clasen f185967ba1 Add some more annotation to the DND api 2010-04-03 20:59:07 -04:00
Matthias Clasen 57a3de1bcd Fix file chooser refcounting issues
This was reported in bug 600992.
2010-04-03 20:59:07 -04:00
Matthias Clasen b229aa8d5e Add missing colons 2010-04-03 20:59:07 -04:00
Christian Dywan 4c86b6112e Document the use of NULL in gtk_window_set_transient_for
This fixes bug 611319.
2010-04-03 20:59:07 -04:00
Matthias Clasen 870fefbfaf Minor doc clarification for gdk_drag_begin
Mention that targets is a list of atoms. Bug 611317.
2010-04-03 20:59:07 -04:00
Javier Jardón 8ea37e551b Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:06 -04:00
Matthias Clasen ca43e7d3be Remove obsolete translator comments
Reported in bug 611217
2010-04-03 20:59:06 -04:00
Matthias Clasen f77c10b0b0 Add accessible alternatives to entry icon functionality
Inspired by the complaint in bug 611051.
2010-04-03 20:59:06 -04:00
Matthias Clasen e566c96137 Add introspection annotations to gtk_drag_(source|dest)_set
Also move docs inline at the same time. Bug 610905.
2010-04-03 20:59:05 -04:00
Ryan Lortie 313e1b9c2f Update release HOWTO
- 'cvs' -> 'git'
- gnome-hackers is now closed.  Reply-to: desktop-devel-list instead.
2010-04-03 20:59:05 -04:00
Matthias Clasen ba4695e8e5 Don't scroll to insert after middle-click paste
Patch by Ignacio Casal Quinteiro, bug 612119.
2010-04-03 20:59:05 -04:00
Matthias Clasen 0a12113d9d Fix an infinite loop in gtk_dialog_map()
The new focus handling with links in labels tripped up the code
that tries to avoid focussing labels. Bug 612066
2010-04-03 20:59:05 -04:00
Nils-Christoph Fiedler 248719c771 Updated LowGerman translation 2010-04-03 20:59:05 -04:00
Nils-Christoph Fiedler 9a19752da4 Updated LowGerman translation 2010-04-03 20:59:05 -04:00
Nils-Christoph Fiedler 39ff3a4822 Updated LowGerman translation 2010-04-03 20:59:05 -04:00
Alexander Shopov 6b1126ab54 Updated Bulgarian translation 2010-04-03 20:59:04 -04:00
Michael Natterer 7eedb7a0b3 gtk: remove begin-user-action/end-user-action around copying
Copying to the clipboard is not a buffer mutation, so calling
gtk_text_buffer_begin_user_action() and _end_user_action() is only
confusing apps which connect to these signals in order to build undo
stacks or otherwise track buffer changes. Most likely, these apps
either didn't notice the bugus undo step or simply work around it.
2010-04-03 20:59:04 -04:00
Jennie Petoumenou f000d83f00 Updated Greek translation. 2010-04-03 20:59:04 -04:00
Jennie Petoumenou 8411cd3282 Updated Greek translation. 2010-04-03 20:59:04 -04:00
Claude Paroz 92c6be8ac0 Updated French translation 2010-04-03 20:59:04 -04:00
Javier Jardón 1931a8db5d Don't use GTK_WIDGET_SET_FLAGS() in gtk_widget_init() 2010-04-03 20:59:04 -04:00
Javier Jardón bbf5e95c41 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_PARENT_SENSITIVE)
https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:03 -04:00
Javier Jardón 9f3d23a900 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_RC_STYLE)
https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:03 -04:00
Javier Jardón 5c2c742c8d Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_APP_PAINTABLE)
https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:03 -04:00
Javier Jardón a602ff82eb Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_MAPPED)
Use new API instead: gtk_widget_set_mapped ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:03 -04:00
Javier Jardón e082783fbb Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)
Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:03 -04:00
Javier Jardón e2f79c33ff Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:59:02 -04:00
Daniel Nylander e5aca4ac88 Updated Swedish translation 2010-04-03 20:59:02 -04:00
Daniel Nylander 01bb46fefe Updated Swedish translation 2010-04-03 20:59:01 -04:00
Joanmarie Diggs 70d2c392ca Add/Remove ATK_STATE_SENSITIVE according to cells' state.
Bug #569042.
2010-04-03 20:59:01 -04:00
Patrick Bernaud fe0a89e251 Move documentation to inline comments: GtkPlug
https://bugzilla.gnome.org/show_bug.cgi?id=611707

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:59:01 -04:00
Steven Harms 09e4738682 Move documentation to inline comments: GtkVBox
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611831
2010-04-03 20:59:01 -04:00
Fran Diéguez 190096f41e Update Galician translation 2010-04-03 20:59:01 -04:00
Friedel Wolff 8ad3276a77 Update Afrikaans translation 2010-04-03 20:59:01 -04:00
Li Yuan 828c4f7aa5 Return FALSE in signal handlers to make the signals be propagated
Bug #611686.
2010-04-03 20:59:00 -04:00
Steven Harms 0cdcfcca9f Move documentation to inline comments: GtkVSeparator
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611662
2010-04-03 20:59:00 -04:00
Steven Harms ba22b91e31 Move documentation to inline comments: GtkVScrollbar
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=611658
2010-04-03 20:59:00 -04:00
Gabor Kelemen 83430719d1 Updated Hungarian translation 2010-04-03 20:59:00 -04:00
Steven Harms 15a797e8e9 Update gtkvscale documentation for in code comments. Removed template document 2010-04-03 20:59:00 -04:00
Inaki Larranaga Murgoitio a0441bcb4c Updated Basque language 2010-04-03 20:59:00 -04:00
Javier Jardón cb4f39c7a8 Add version info about the deprecation of GTK_WIDGET_SENSITIVE
This completes the patch of
commit 64f526d34e
2010-04-03 20:59:00 -04:00
Inaki Larranaga Murgoitio fa934294a7 Updated Basque language 2010-04-03 20:59:00 -04:00
Javier Jardón ee0bf98769 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:58:59 -04:00
Javier Jardón e53efb120a Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:58:58 -04:00
Nils-Christoph Fiedler 8c1f5dbc03 Updated LowGerman translation 2010-04-03 20:58:24 -04:00
Nils-Christoph Fiedler 2bb5e9e75a Updated Low German translation 2010-04-03 20:58:24 -04:00
Nils-Christoph Fiedler 289948f1d3 Updated Low German translation 2010-04-03 20:58:23 -04:00
Kjartan Maraas 3ffee3e6e5 Updated Norwegian bokmål translation 2010-04-03 20:58:23 -04:00
Javier Jardón 2dc372a657 Fix gtk_widget_is_sensitive() function. Second try
Use GTK_PARENT_SENSITIVE flag instead
gtk_widget_get_sensitive(widget->parent)
2010-04-03 20:58:23 -04:00
Gabor Kelemen 6d8fee9879 Updated Hungarian translation 2010-04-03 20:58:23 -04:00
Javier Jardón 2dd2650215 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_SHOW_ALL) 2010-04-03 20:58:23 -04:00
Javier Jardón e6572c0939 Fix gtk_widget_is_sensitive() function
The bug was introduced in
commit a27d5a2c9e
2010-04-03 20:58:23 -04:00
Javier Jardón ec20658b51 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
Use new API instead: gtk_widget_set_can_default ()
2010-04-03 20:58:22 -04:00
Javier Jardón 76943117be Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_FOCUS)
Use new API instead: gtk_widget_set_can_focus ()
2010-04-03 20:58:22 -04:00
Gabor Kelemen 6379f64a37 Updated Hungarian translation 2010-04-03 20:58:21 -04:00
Petr Kovar aabe0b16cf Update Czech translation 2010-04-03 20:58:21 -04:00
Javier Jardón 2d96f39335 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_SENSITIVE) 2010-04-03 20:58:21 -04:00
Javier Jardón 5d4af6ca80 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_DOUBLE_BUFFERED)
Use new API instead: gtk_widget_set_double_buffered ()
2010-04-03 20:58:21 -04:00
Javier Jardón 3ebbee6958 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_RECEIVES_DEFAULT)
Use new API instead: gtk_widget_set_receives_default ()
2010-04-03 20:58:21 -04:00
Javier Jardón 08d42ed8fe Deprecate widget flag: GTK_WIDGET_PARENT_SENSITIVE
Use gtk_widget_get_sensitive() on the parent widget instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:58:21 -04:00
Javier Jardón edc65ce1d2 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:58:20 -04:00
Javier Jardón eb90ec7513 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:56:30 -04:00
Javier Jardón c3f8b4226d Deprecate widget flag: GTK_WIDGET_SENSITIVE
Use gtk_widget_get_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:56:30 -04:00
Javier Jardón c44c026ee9 Don't use GTK_WIDGET_NO_WINDOW in internal code anymore
Use gtk_widget_get_has_window() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:56:30 -04:00
Javier Jardón e7127daf84 Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:56:29 -04:00
Javier Jardón 04aba4bde2 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:56:29 -04:00
Mario Blättermann 126133a927 Updated German translation 2010-04-03 20:56:28 -04:00
Nils-Christoph Fiedler 9a33ab970f Updated LowGerman translation 2010-04-03 20:56:28 -04:00
Nils-Christoph Fiedler 79453a952f Updated LowGerman translation 2010-04-03 20:56:28 -04:00
Florian Müllner f5aa0fad6c Add introspection annotation for gtk_builder_get_object 2010-04-03 20:56:28 -04:00
Nils-Christoph Fiedler 2e78caa5a2 Updated LowGerman translation 2010-04-03 20:56:28 -04:00
Piotr Drąg 7044a9d027 Updated Polish translation 2010-04-03 20:56:28 -04:00
Piotr Drąg fe2cb223ea Updated Polish translation 2010-04-03 20:56:27 -04:00
Leonid Kanter 9dd2609525 Update Russian translation 2010-04-03 20:56:27 -04:00
Leonid Kanter 1d34e445e9 Update Russian translation 2010-04-03 20:56:27 -04:00
Nils-Christoph Fiedler d3db379573 Updated LowGerman translation 2010-04-03 20:56:27 -04:00
Duarte Loreto 4e8d4ead22 Updated Portuguese translation 2010-04-03 20:56:27 -04:00
Duarte Loreto 87e7f3c0c1 Updated Portuguese translation 2010-04-03 20:56:27 -04:00
Khaled Hosny 9c054e3029 Updated Arabic translation 2010-04-03 20:56:26 -04:00
Bruce Cowan 7c9f3072eb Updated British English translation 2010-04-03 20:56:26 -04:00
Matej Urbančič 109ca57aa8 Updated Slovenian translation 2010-04-03 20:56:26 -04:00
Nils-Christoph Fiedler af51a093fe Updated LowGerman translation 2010-04-03 20:56:26 -04:00
Nils-Christoph Fiedler 599d6f0a2c Updated LowGerman translation 2010-04-03 20:56:26 -04:00
Alexander Shopov 4e3c3baac2 Updated Bulgarian translation 2010-04-03 20:56:26 -04:00
Gintautas Miliauskas f8cd486871 Updated Lithuanian translation. 2010-04-03 20:56:25 -04:00
Gintautas Miliauskas 0fa5fb2894 Updated Lithuanian translation. 2010-04-03 20:56:25 -04:00
Ask H. Larsen 76a752b69d Updated Danish translation 2010-04-03 20:56:25 -04:00
Ask H. Larsen 9889445169 Updated Danish translation 2010-04-03 20:56:25 -04:00
Matthias Clasen 83518ec77c Bump version 2010-04-03 20:56:25 -04:00
Matthias Clasen b51edbe745 2.19.6 2010-04-03 20:56:25 -04:00
Jorge González 468a947285 Updated Spanish translation 2010-04-03 20:56:23 -04:00
Matthias Clasen daf00f6f94 Updates 2010-04-03 20:56:23 -04:00
Matthias Clasen 53bebef4bf Some forgotten docs 2010-04-03 20:56:23 -04:00
Matthias Clasen b23c114b95 Add some missing docs 2010-04-03 20:56:22 -04:00
Matthias Clasen 3fe334c3a8 doc fixes 2010-04-03 20:56:22 -04:00
Jorge González f5d67c8b44 Updated Spanish translation 2010-04-03 20:56:22 -04:00
Matthias Clasen 462a491fa7 Add 2.20 index for gdk docs 2010-04-03 20:56:22 -04:00
Matthias Clasen 21b1a03e1e Init gdk in the same order as other backends
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen d1babc7775 Fix a memory leak in gdk_display_open in the directfb backend
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen db0faed54c Simplify the DirectFBInit call
Patch by Andre Draszik, bug 609172
2010-04-03 20:56:22 -04:00
Matthias Clasen f6a173d302 Catch directfb errors in gdk_colormap_new
Patch by Andre Draszik, bug 609172.
2010-04-03 20:56:22 -04:00
Matthias Clasen 938795f922 Fix a crash at startup in the directfb backend
Patch by André Draszik, bug 600789
2010-04-03 20:56:22 -04:00
Matthias Clasen 9160cf1af7 Fix gdk_windowing_window_at_pointer in the directfb backend
Patch by Hiroyuki Ikezoe, see bug 604799.
2010-04-03 20:56:21 -04:00
Matthias Clasen 28dda32acc Correct annotations for gtk_tree_view_get_path_at_pos
Patch by Alan Knowles, bug 609514.
2010-04-03 20:56:21 -04:00
Matthias Clasen c5dc38c142 Protect against X errors when clearing the DND cache
This was reported as a problem in bug 609952.
2010-04-03 20:56:21 -04:00
Mario Blättermann 4815119eab Updated German translation 2010-04-03 20:56:21 -04:00
Matthias Clasen df32ea9960 Prevent a crash in the TGA loader
Reported in bug 609744.
2010-04-03 20:56:21 -04:00
Matthias Clasen 624ac853ba Handle out-of-bounds parameters in gtk_assistant_get_nth_page
Better do what the docs say...fix by Tadej Borovšak, bug 610141.
2010-04-03 20:56:21 -04:00
Matthias Clasen d405d997bd Fix a segfault in gtk_assistant_set_current_page
Reported by Tadej Borovšak in bug 610184
2010-04-03 20:56:21 -04:00
Matthias Clasen f90b880ce8 Clarify the docs for gtk_info_bar_set_default_response
According to bug 610632
2010-04-03 20:56:20 -04:00
Matthias Clasen d316798685 Add some padding in tool buttons
The default value of the icon-spacing style property was 0, which
is just not good. Themes are of course free to change this anyway.
Bug 610381.
2010-04-03 20:56:20 -04:00
Matthias Clasen 2f772399ce Only look at x11 backend for gtk-doc comments for now
See followup discussion in bug 610701
2010-04-03 20:56:20 -04:00
Mario Blättermann dc8965f9ea Updated German translation 2010-04-03 20:56:20 -04:00
Matej Urbančič 2eab767d4c Updated Slovenian translation 2010-04-03 20:56:20 -04:00
Alexander Shopov 5781ea200b Updated Bulgarian translation 2010-04-03 20:56:20 -04:00
Matthias Clasen 2c6b8680c3 Fix incorrect string
String change. See bug 610235.
2010-04-03 20:56:20 -04:00
Matthias Clasen 9414dc2cf6 Add some missing introspection annotations 2010-04-03 20:56:19 -04:00
Johan Dahlin 087ff5f220 [build] Include all target source files
Include all target source files when buildin the gir

https://bugzilla.gnome.org/show_bug.cgi?id=610701
2010-04-03 20:56:19 -04:00
Matthias Clasen 12b8b8bf7c Add a missing introspection annotation for gdk_screen_get_default_colormap 2010-04-03 20:56:19 -04:00
Rimas Kudelis f773c8975d Updated Lithuanian translation 2010-04-03 20:56:17 -04:00
Carlos Garcia Campos 7edbc6b6ee [docs] Fix GtkPlug::embedded signal documentation
See bug #609650.
2010-04-03 20:56:17 -04:00
Carlos Garcia Campos 576f2770c7 Emit GtkPlug::embedded signal when plug/socket are in the same process too
Fixes bug #609650.
2010-04-03 20:56:17 -04:00
Masato Hashimoto 7835a51040 Updated Japanese translation.
Translator: Masato Hashimoto <cabezon.hashimoto@gmail.com>
Reviewed by: 	Nishibori Kiyotaka <ml.nishibori.kiyotaka@gmail.com>
2010-04-03 20:56:17 -04:00
Khaled Hosny 7a8a188b4c Updated Arabic translation 2010-04-03 20:56:17 -04:00
Alexander Shopov 3394c2fbe5 Updated Bulgarian translation 2010-04-03 20:56:17 -04:00
Lucian Adrian Grijincu d170fb7983 Updated Romanian translation 2010-04-03 20:56:16 -04:00
Piotr Drąg 87fb3d9e08 Updated Polish translation 2010-04-03 20:56:16 -04:00
Piotr Drąg c393ce993f Updated Polish translation 2010-04-03 20:56:16 -04:00
Jorge González 54f851b5b5 Updated Spanish translation 2010-04-03 20:56:16 -04:00
Viktor Pracht 62a5e11483 [Annotations] Add array length for GtkTreeStore
https://bugzilla.gnome.org/show_bug.cgi?id=603923
2010-04-03 20:56:16 -04:00
Johan Dahlin 71df0c45ba [annotations] Add allow-none for gtk_menu_popup 2010-04-03 20:56:16 -04:00
Johan Dahlin eee7bb2b2e [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-04-03 20:56:15 -04:00
Michael Natterer 87334d465c Bug 548026 - No accessor for GtkWidget.requisition
Add gtk_widget_get_requisition().
2010-04-03 20:56:15 -04:00
Matej Urbančič 91302444cc Updated Slovenian translation 2010-04-03 20:56:14 -04:00
Manoj Kumar Giri 58d7a0e2d7 Updated Oriya Translation 2010-04-03 20:56:14 -04:00
Mattias Põldaru 3d71d992a6 Estonian translation updated 2010-04-03 20:56:14 -04:00
Mario Blättermann 998591adf6 Updated German translation 2010-04-03 20:56:14 -04:00
Javier Jardón 2140a5b107 [gdk/x11] Change the name of the functions in the header file
_gdk_keymap_add_virtual_modifiers() changed to
_gdk_keymap_add_virtual_modifiers_compat() in
commit 13d69e552d
This patch change the header name too.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=610063
2010-04-03 20:56:14 -04:00
Changwoo Ryu f148059b7b Update Korean translation 2010-04-03 20:56:14 -04:00
Matej Urbančič 94480795c7 Updated Slovenian translation 2010-04-03 20:56:14 -04:00
Matej Urbančič 9cd074b663 Updated Slovenian translation 2010-04-03 20:56:13 -04:00
Stefan Kost 4b8a91bb85 widget: ensure boolean before comparing
Ensure boolean value like done elsewhere.
2010-04-03 20:56:13 -04:00
Stefan Kost 100c6dc513 widget: don't check before setting to avoid costly type checks
There are no side effect of setting these flags and we don't fire g_object
notifies also. Thus set/unset right away without costly check of current state.
2010-04-03 20:56:13 -04:00
Javier Jardón 501f327b56 Revert "Drop duplicate declarations"
The issue is already fixed in f9a3ce06cc

This reverts commit 6f566057e8.
2010-04-03 20:56:13 -04:00
Matthias Clasen 29efd9a753 Fix a compatibility problem
It turns out that my attempt at handling Super, Hyper and Meta better
is causing problems, mostly because Alt and Meta are commonly colocated
in the modmap, and apps do a check for the Alt modifier regularly.

See e.g bug 607697.
2010-04-03 20:56:13 -04:00
Matthias Clasen 966b619705 Drop duplicate declarations 2010-04-03 20:56:13 -04:00
Christian Dywan ce07f4403b Remove duplicate definitions of gtk_widget_set/get_realized/mapped 2010-04-03 20:56:13 -04:00
Michael Natterer 800fbc513f Allow calling gtk_widget_style_attach() only when realized 2010-04-03 20:56:12 -04:00
Petr Kovar 42f920c77b Update Czech translation 2010-04-03 20:56:12 -04:00
Javier Jardón fc246a9305 Fix compilation warning: return FALSE instead NULL 2010-04-03 20:56:12 -04:00
Javier Jardón c59386ba1d Fix compilation warning: cast to GCompareFunc 2010-04-03 20:56:12 -04:00
Kjartan Maraas 92b1c9150d Updated Norwegian bokmål translation 2010-04-03 20:56:12 -04:00
Jorge González 78b42c67e6 Updated Spanish translation 2010-04-03 20:56:12 -04:00
Matthias Clasen 5eccd0d20e bump version 2010-04-03 20:56:11 -04:00
Matthias Clasen 11788b71e1 2.19.5 2010-04-03 20:56:11 -04:00
Matthias Clasen 96e42fb1ee Updates 2010-04-03 20:56:09 -04:00
Matthias Clasen 5438a7b608 Add some more goddamn accessors 2010-04-03 20:56:09 -04:00
Matthias Clasen d154b115e5 Avoid overlap of scale marks
This was reported to be a problem in bug 608807.
2010-04-03 20:56:08 -04:00
Matthias Clasen 9983f2e551 Avoid a crash when setting a tooltip on a GtkCalendar
The details code was assuming that it controls ::has-tooltip.
Reported by Bill Nottingham, bug 607344.
2010-04-03 20:56:08 -04:00
Matthias Clasen 6247ef7a32 Fix a refcounting issues in GtkPlug
When the foreign window already has a GdkWindow, we forget to take
an extra references, leading to crashes later on. Patch by
Karl Tomlinson, bug 607061.
2010-04-03 20:56:08 -04:00
Matthias Clasen 2c53b675c3 Allow running without any im context
Setting GtkSettings::im-module to gtk-im-context-none will make
GtkIMMultiContext just pass through.
2010-04-03 20:56:08 -04:00
Alan Knowles 7485d64249 Add introspection annotations for gtk_tree_model_get_path+gtk_tree_store_newv 2010-04-03 20:56:08 -04:00
Christian Persch a4186b6aa5 Correctly clone the toolbutton's icon-name image widget
Bug #608162.
2010-04-03 20:56:08 -04:00
Alejandro Piñeiro b6139abb37 Solve a wrong reference on gdk_keymap_translate_keyboard_state
Solves https://bugzilla.gnome.org/show_bug.cgi?id=608345
2010-04-03 20:56:08 -04:00
Tor Lillqvist 067cce5d63 Use correct processorArchitecture for x86_64 in manifest file 2010-04-03 20:56:07 -04:00
Javier Jardón 541448732d Move documentation to inline comments: GtkAccelLabel
https://bugzilla.gnome.org/show_bug.cgi?id=403485
2010-04-03 20:56:07 -04:00
Javier Jardón 239570abdd [tests] Not use GtkOptionMenu deprecate widget.
Replace GtkOptionMenu with GtkComboBox.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=606288
2010-04-03 20:56:07 -04:00
Theppitak Karoonboonyanan 8633c6ffc6 Updated Thai translation. 2010-04-03 20:56:07 -04:00
André Draszik 935a3f7b65 gdk/directfb: cursor size is artificially limited
Cursor sizes in DirectFB can be large (4095x4095), limit to 128x128
though, because the x11 backend has this limit, too - for max.
compatibility.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609201

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik 987256968b gdk/directfb: convert gdkgc-directfb to using G_DEFINE_TYPE
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609199

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik 9bc658f6ed gdk/directfb: gdkdnd-directfb's private data is used uninitialized
Use G_TYPE_INSTANCE_GET_PRIVATE() instead

In the process, convert to using G_DEFINE_TYPE, too.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609195

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik 2e9a0028fb gdk/directfb: convert gdkcolor-directfb to using G_DEFINE_TYPE
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=609191

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:07 -04:00
André Draszik 442f7a9d26 gdk/directfb: fix _gdk_windowing_pointer_grab()
Fix for bgo #609188

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:06 -04:00
Steffen Macke 029b7b6361 Fix menu bar problem in ms-windows theme engine on Windows 7
Patch from bug #591186. It won't have any effect in this branch as the
whole XP-and-later theming code is broken and disabled, but when/if
that is fixed, then this patch should help.
2010-04-03 20:56:06 -04:00
Christian Dywan 931ed06beb [gtk] Deprecate GtkCurveType enum
It's only used by already deprecated GtkCurve and GtkGammaCurve

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=556263

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:56:06 -04:00
Claude Paroz cc895cc924 Updated French translation 2010-04-03 20:56:06 -04:00
Michael Natterer ca9e029838 gtk: fix crash in _gtk_rbtree_find_offset() called from update_prelight()
Move the check for tree_view->priv->tree being NULL into update_prelight()
so the function will never call _gtk_rbtree_find_offset() on a NULL rbtree.
2010-04-03 20:56:06 -04:00
Jonh Wendell e9d53fd675 Updated Brazilian Portuguese translation 2010-04-03 20:56:06 -04:00
Jonh Wendell d0c4e2d762 Updated Brazilian Portuguese translation 2010-04-03 20:56:05 -04:00
Matthias Clasen fe7af7a9e5 Make DND work better with shaped windows
If mouse clicks go through, drag-and-drop should too...
Fixes bug 608615.
2010-04-03 20:56:05 -04:00
Cody Russell bc01a0cbcf Bug 554420 - Seal GtkTextTag
Seal GtkTextTag.
2010-04-03 20:56:05 -04:00
Petr Kovar 2194ee02e3 Update Czech properties translation 2010-04-03 20:56:05 -04:00
Petr Kovar b6d139f954 Update Czech translation 2010-04-03 20:56:05 -04:00
Michael Natterer 9dfadca46c Bug 608993 - Add gtk_widget_style_attach()
As replacement for:
widget->style = gtk_style_attach (widget->style, widget->window);
2010-04-03 20:56:05 -04:00
Pavol Šimo 0a037fa4fe Updated Slovak translation 2010-04-03 20:55:30 -04:00
Javier Jardón 4b85311951 [docs] Add anchor for keybinding signals 2010-04-03 20:55:30 -04:00
Mattias Põldaru e193b20d50 Updating Estonian translation 2010-04-03 20:55:30 -04:00
Mattias Põldaru a9f0710686 Updating Estonian translation 2010-04-03 20:55:30 -04:00
Mattias Põldaru fb0c247e30 Updating Estonian translation 2010-04-03 20:55:30 -04:00
Kjartan Maraas b802beb0b1 Updated Norwegian bokmål translation 2010-04-03 20:55:30 -04:00
Jorge González 686efe8145 Updated Spanish translation 2010-04-03 20:55:29 -04:00
Kristian Rietveld a86bbf759f Improve enter/motion notify semantics
On X11 we receive enter notify and motion notify events for a window
regardless of its focus state.  On Mac OS X this is not the case.  This
commit improves the semantics to overcome this difference.  It improves
on my earlier patch that sent a motion notify event when a window became
main.

Instead of sending a motion notify when a window becomes main, we now
send one when a window becomes key, which comes closest to a window
getting focus in X11.  This motion notify is needed because Mac OS X does
not send motion events when an application is inactive (none of its
windows have focus), these events are sent in X11.  This dummy motion
notify event (with current coordinates of the mouse cursor) allows an
application to get its prelight and other state right when it gets focus
and thus user attention.

Another change is to send an enter notify event when updating the
tracking rectangle of a GdkQuartView and the mouse cursor is currently in
this rectangle.  This rectangle is at least updated on window creation.
This enter notify event is important for the case where a new window
appears right below the mouse cursor.  The window has to receive an enter
notify event for the subsequent events to be processed correctly.  Mac
OS X does not send one in this case, so we generate it ourselves.

Both of these synthesized events have to go through
_gdk_windowing_got_event() for updating statekeeping, etc.
append_event() has a boolean flag now to make this convenient.
2010-04-03 20:55:29 -04:00
Jorge González 453ac4a2ec Updated Spanish translation 2010-04-03 20:55:29 -04:00
Jorge González 39945324bc Updated Spanish translation 2010-04-03 20:55:29 -04:00
Jorge González a622ca52a0 Updated Spanish translation 2010-04-03 20:55:29 -04:00
Andre Klapper 05bc895378 Add missing files to POTFILES.in to make l10n.gnome.org happy 2010-04-03 20:55:29 -04:00
Cody Russell 1ae55844f7 Remove existing signal connections in gtk_drag_dest_unset().
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=608370
2010-04-03 20:55:29 -04:00
Christian Dywan 21ef8f9ad9 Implement gtk_paned_get_handle_window
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=607885
2010-04-03 20:55:28 -04:00
Christian Dywan bffcae28d7 Do not update paned position if it's already at the given value
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=561816
2010-04-03 20:55:28 -04:00
Theppitak Karoonboonyanan 36b1586f86 Updated Thai translation. 2010-04-03 20:55:28 -04:00
Li Yuan 5067f69ff1 Bug #608410. Set cursor position after inserting text. 2010-04-03 20:55:28 -04:00
Jamil Ahmed 8a9dabd683 Updated Bengali translation 2010-04-03 20:55:28 -04:00
Jamil Ahmed 47c66ad3bc Updated Bengali translation 2010-04-03 20:55:28 -04:00
Jamil Ahmed 7e978d3447 Updated Bengali translation 2010-04-03 20:55:28 -04:00
Javier Jardón d8453e7826 [docs] Fix GtkOffscreenWindow documentation 2010-04-03 20:55:27 -04:00
Matthias Clasen 4343bc8d0a Bump version 2010-04-03 20:55:27 -04:00
Matthias Clasen 539545688c 2.19.4 2010-04-03 20:55:27 -04:00
Matthias Clasen c51d3805a7 Doc additions 2010-04-03 20:55:25 -04:00
Matthias Clasen a7e91ca4ca Minor doc fix 2010-04-03 20:55:24 -04:00
Matthias Clasen a17acc0572 Updates 2010-04-03 20:55:24 -04:00
Jamil Ahmed 30101c195c Updated Bengali translation 2010-04-03 20:55:24 -04:00
Alexander Shopov 2bd8ea3084 Updated Bulgarian translation 2010-04-03 20:55:24 -04:00
Alexander Shopov 6d84afc2f5 Updated Bulgarian translation 2010-04-03 20:55:24 -04:00
Christian Dywan 8f49f935df Remove the destination file if trying to save a pixbuf failed
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=591102
2010-04-03 20:55:24 -04:00
Javier Jardón bb7ff7b586 [test] Fix some typos 2010-04-03 20:55:23 -04:00
Paul Davis 1c9cc0acf0 Small memory fix 2010-04-03 20:55:23 -04:00
Michael Natterer 88977f73eb Bug 607778 - Add accessors for GtkEntry's windows
Add gtk_entry_get_text_window() and get_icon_window() so we can
distinguigh them in expose-event callbacks.
2010-04-03 20:55:23 -04:00
Michael Natterer 5585335dd9 Bug 607082 - Add accessors for sealed GtkRange members
Add accessors for range->range_rect, range->slider_range,
range->slider_size_fixed and range->min_slider_size. Didn't add
properties for any of them because thir purpose is mostly to enable
proper subclassing.
2010-04-03 20:55:23 -04:00
Claudio Saavedra 189a35fe59 GtkTreeView: plug a leaking GtkTreeRowReference
This is exposed by overshooting in a HildonPannableArea. Leaking
a GtkTreeRowReference also means leaking the whole model, since
the GtkTreeModel reference count is increased for each row
reference.

Fixes bug #607770 - Leak in GtkTreeView with HildonPannableArea
2010-04-03 20:55:23 -04:00
Alexander Larsson b8a0ff9e04 Avoid integer overflow in gdk_rectangle_intersect
If e.g. the right edge of the leftmost rectangle is near MIN_INT, and
the left edge of the rightmost rectangle is large then subtracting these
can lead to an integer overflow, making the resultant "width" falsely
positive, thus returning a very wide result instead of the expected
no-intersection result.

We avoid the overflow by not doing the subtraction unless we know the
result will be positive. There are still risks for overflow if x + width
or y + width is larger than MAXINT, but we won't ever overflow for valid
rects now.

This may fix #607687
2010-04-03 20:55:23 -04:00
Matthias Clasen c81131ff21 Add a way to set wm_class on statusicons
Since the shell uses wm_class for sorting statusicons.
2010-04-03 20:55:22 -04:00
Alexander Larsson b26536162c When native window requests button presses request other button related events
We need to do this because otherwise the implicit button grab for this
(native) window will not deliver the button events not selected for
by this window. This is a problem because non-native child windows may
select using a wider event mask, and we can't emulate these events if we
don't get the native events.

Fixes bug #607508
2010-04-03 20:55:22 -04:00
Javier Jardón 06eb74410d Fix some compilation warnings
The warnings was introduced with the changes in commit
a491091e29
2010-04-03 20:55:22 -04:00
Alexander Larsson 8f125f9b93 Drop outstanding cairo surfaces when window is made native
Any old cairo_surface referencing the old impl window will be wrong
when we make a window native, so drop it.

This fixes bug #599511
2010-04-03 20:55:22 -04:00
Alexander Larsson 26d5674b65 Move common gdkwindow.c code into function gdk_window_drop_cairo_surface
This code is duplicated in several places, and more to come, so put
it all in one place.
2010-04-03 20:55:22 -04:00
Russell Kyaw 3dcb9d4bfc Added Burmese translation for gtk+ properties 2010-04-03 20:55:22 -04:00
Russell Kyaw 23d870de2f Added Burmese translation 2010-04-03 20:55:22 -04:00
Simos Xenitellis 2de67d907b Added Burmese (my) to po/LINGUAS 2010-04-03 20:55:21 -04:00
Alexander Larsson e9da5b95de Track direct window cairo access and avoid tricks when used
When a cairo surface is requested for direct window access (i.e. not
when double-buffering) we can't really track when the actual drawing happens
as cairo drawing is not virtualized. This means we can't properly flush
any outstanding window moves or implicit paints.

This actually causes problems with e.g. abiword (bug #606009) where they
draw without double-buffering. If you press down it scrolls the window
and then draws the caret, but the caret drawing does not flush the
outstanding move from the scroll, so the caret gets drawn on the wrong
screen.

We fix this by never allowing either implicit paints or outstanding window
moves on impl-windows where any windows related to it has an outstanding
direct cairo surface. Luckily this is not very common so in practice this
doesn't matter much.
2010-04-03 20:55:21 -04:00
Kjartan Maraas 4aa4093b6e Updated Norwegian bokmål translation 2010-04-03 20:55:21 -04:00
Kjartan Maraas 04bc35f060 Updated Norwegian bokmål translation 2010-04-03 20:55:21 -04:00
Kjartan Maraas c8fdec0419 Updated Norwegian bokmål translation 2010-04-03 20:55:21 -04:00
Murray Cumming 2a762bf6ca GtkToolPalette: Fix a compiler warning introduced in my last commit. 2010-04-03 20:55:21 -04:00
Javier Jardón ef3dc5fd42 Add gtk_widget_has_rc_style() accessor
Add gtk_widget_has_rc_style() as accessor for sealed
GTK_WIDGET_RC_STYLE widget flag.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:55:21 -04:00
Kristian Rietveld 9743d2e83c Bug 607322 - Double-click doesn't work if the item is selected in...
Slight correction to fix for #596473.
2010-04-03 20:55:20 -04:00
Murray Cumming eed0dd0944 GtkToolPalette: Change gtk_tool_palette_get_drop_group() return.
* gtk/gtktoolpalette.[h|cc]: gtk_tool_palette_get_drop_group():
  Change the return type from GtkWidget* to GtkToolItemGroup*,
  for consistency with other parts of GTK+, such as GtkToolbar.
2010-04-03 20:55:20 -04:00
Matthias Clasen 2091807b24 Fix some issues with action widgets
We need to hide/show them depending on show_tabs, and we should
not grow the notebooks requisition unless we have to. Reported
in bug 601412.
2010-04-03 20:55:20 -04:00
Matthias Clasen c31f02b455 Fix declaration of gtk_print_job_set_status
The problem was reported in bug 606698.
2010-04-03 20:55:20 -04:00
Matthias Clasen b5061249e7 Reset effective_attrs when necessary
This fixes both bug 607217 and bug 607269.
2010-04-03 20:55:19 -04:00
Matthias Clasen 58956ad7e2 Fix a few C99isms
Reported in bug 606761.
2010-04-03 20:55:19 -04:00
Daniel Nylander 38c309869d Updated Swedish translation 2010-04-03 20:55:19 -04:00
Matej Urbančič ac4d89113b Updated Slovenian translation 2010-04-03 20:55:19 -04:00
Alexander Larsson 51b774f59a Avoid drawing implicit paints to destroyed windows
It may happen that a window gets destroyed during painting, if so
we should not draw the implicit paint double-buffered pixmap to it
as that will cause a BadDrawable X error.

This fixes bug 600865
2010-04-03 20:55:19 -04:00
Xandru Armesto Fernandez 07d3c79945 Updated asturian translation 2010-04-03 20:55:19 -04:00
Xandru Armesto Fernandez 84c77b7ca5 Updated asturian translations 2010-04-03 20:55:19 -04:00
Xandru Armesto Fernandez 0d0f3a1e4c Updated asturian translations 2010-04-03 20:55:18 -04:00
Murray Cumming 18b7ad4182 GtkToolPalette: Use GtkToolItemGroup* instead of GtkWidget* for setter parameters.
See Bug #567729
2010-04-03 20:55:18 -04:00
Michael Natterer 27f81d8918 Some fixes in gtkoffscreenwindow.h
- use (void) not () for void functions
- disallow individual inclusion unconditionally
2010-04-03 20:55:18 -04:00
Inaki Larranaga Murgoitio e40dcff11b Updated Basque language 2010-04-03 20:55:18 -04:00
Inaki Larranaga Murgoitio 4f37e160af Updated Basque language 2010-04-03 20:55:18 -04:00
Javier Jardón 905edf9478 [docs] Use the correct GTK-doc syntax to refer to GTK+ properties 2010-04-03 20:55:18 -04:00
Jorge González 74a104d73a Updated Spanish translation 2010-04-03 20:55:18 -04:00
Javier Jardón 149f5891fa [docs] Use the correct GTK-doc syntax to refer to GTK+ property 2010-04-03 20:55:17 -04:00
Javier Jardón 29e8460604 [docs] Remove GTK+ 1.2 tutorial from master
The tutorial it's still inside the gtk-1-2 branch if It's needed
2010-04-03 20:55:17 -04:00
Khaled Hosny eaac92f621 Updated Arabic translation 2010-04-03 20:55:17 -04:00
Javier Jardón f01e0670f8 [docs] Fix documentation build warnings
Fix issues when using GI annotations so the xslt does a
fallback if the local links do not exist.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604876
2010-04-03 20:55:17 -04:00
Matthias Clasen c0d7fe2ad4 Correct PRC6 and PRC9 envelope sizes
See bug 603144 for the full story.
2010-04-03 20:55:17 -04:00
Matthias Clasen e3cf8611b2 Bump version 2010-04-03 20:55:17 -04:00
Matthias Clasen f0d57f40f5 2.19.3 2010-04-03 20:55:16 -04:00
Matthias Clasen 82956742c0 Dco updates 2010-04-03 20:55:14 -04:00
Matthias Clasen 57ca68d591 Updates 2010-04-03 20:55:14 -04:00
Christian Persch cf9edf9ff7 Implement property editor for GdkColor properties
Bug #606434.
2010-04-03 20:55:14 -04:00
Christian Dywan 4285f21b3b Limit GtkContainer::border-width to 65535
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=605199
2010-04-03 20:55:13 -04:00
Matthias Clasen 6860f86724 Plug a pixmap leak
We were getting our refcounts tangled up when setting drawable clips on
GCs with CSW, leading to a pretty bad pixmap leak. See bug 606143.
2010-04-03 20:55:13 -04:00
Christian Dywan 43572af86e Implement "preedit-changed" in GtkEntry and GtkTextView
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=602284
2010-04-03 20:55:13 -04:00
Christian Dywan cad18bbfe3 Use const gchar* in gtk_window_get_icon_name implementation
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=597100
2010-04-03 20:55:13 -04:00
Christian Dywan 174c126b6e Document GtkWidget::state-changed signal properly
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=598383
2010-04-03 20:55:13 -04:00
Javier Jardón a821df1577 [docs] Add missing "Deprecated: 2.x" to the api doc comments 2010-04-03 20:55:13 -04:00
Daniel Nylander 99e2f97f30 Updated Swedish translation 2010-04-03 20:55:12 -04:00
Daniel Nylander 4f0619de15 Updated Swedish translation 2010-04-03 20:55:12 -04:00
Christian Persch 66882103cc Allow NULL iter in gtk_combo_box_set_active_iter to unset
Bug #606230.
2010-04-03 20:55:12 -04:00
Matthias Clasen 7673c45fec Try a little harder to survive close to OOM 2010-04-03 20:55:12 -04:00
Matthias Clasen 675ead1d82 Avoid an FPE for ludicrous scale values
...just bail out early.
2010-04-03 20:55:12 -04:00
Javier Jardón b3e06e8302 Use g_strcmp0() instead custom safe_strcmp()
Reported by Rafal Luzynski in
https://bugzilla.gnome.org/show_bug.cgi?id=606415
2010-04-03 20:55:12 -04:00
Xandru Armesto Fernandez e9d18c8e07 Updated asturian language 2010-04-03 20:55:11 -04:00
Javier Jardón 01a3ad45b8 Fix links in GtkComboBox migration guide
Some link to GTK+ classes are not gererated because the ":" near
the class name; solution: "#GtkComboBox<!---->:"
Also, added some links to the proper signals

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=606291
2010-04-03 20:55:11 -04:00
Jean Brefort 694bf7230e fix critical in gtk_editable_insert_text 2010-04-03 20:55:11 -04:00
Javier Jardón f8d1cf58af Deprecate widget flag: GTK_WIDGET_CAN_FOCUS
https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:55:11 -04:00
Javier Jardón 69de358b38 Deprecate some widget flags
Deprecate the following:
GTK_WIDGET_APP_PAINTABLE
GTK_WIDGET_CAN_DEFAULT
GTK_WIDGET_DOUBLE_BUFFERED
GTK_WIDGET_HAS_DEFAULT
GTK_WIDGET_HAS_GRAB
GTK_WIDGET_RECEIVES_DEFAULT

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:55:10 -04:00
Shankar Prasad 312263233f Made couple of translation changes in kn.po 2010-04-03 20:55:10 -04:00
Matthias Clasen bd5431e620 Setup libjpeg error handlers early enough
See bug 606068 for details.
2010-04-03 20:55:10 -04:00
Jorge González 95ccaa02de Updated Spanish translation 2010-04-03 20:55:10 -04:00
Timo Jyrinki 9d7ef2875d One-line fix to a noticiable translation bug. 2010-04-03 20:55:10 -04:00
Matej Urbančič 6972375688 Updated Slovenian translation 2010-04-03 20:55:10 -04:00
Maxim V. Dziumanenko e4d9e5dd63 Update Ukrainian translation 2010-04-03 20:55:10 -04:00
Kjartan Maraas bfadb65fb0 Updated Norwegian bokmål translation. 2010-04-03 20:55:09 -04:00
Inaki Larranaga Murgoitio 5c35215457 Updated Basque language 2010-04-03 20:55:09 -04:00
Javier Jardón 02b2810a0e Fix compilation warning: use const *gchar variable
https://bugzilla.gnome.org/show_bug.cgi?id=605090
2010-04-03 20:55:09 -04:00
Javier Jardón 7ed2cbcfce Fix compilation warning: use the correct conversion specifier
Use G_GSIZE_FORMAT instead of %i

The warning was added in
commit ba651d4022
2010-04-03 20:55:08 -04:00
Christian Dywan 4b03789551 Don't use GTK_WIDGET_NO_WINDOW in GtkEventBox 2010-04-03 20:55:08 -04:00
Christian Dywan 5db40e41b3 No GTK_WIDGET_NO_WINDOW in GtkFixed and deprecate gtk_fixed_set_has_window 2010-04-03 20:55:08 -04:00
Christian Dywan bcb255593d Don't use GTK_WIDGET_NO_WINDOW in GtkContainer 2010-04-03 20:55:08 -04:00
Christian Dywan fc2cbf960c Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-04-03 20:55:07 -04:00
Christian Dywan 20dcd8a723 Fix missing GTK_WIDGET cast on printer option widget in construct_widgets 2010-04-03 20:53:49 -04:00
Christian Dywan ea7bd00e92 Fix missing GTK_WINDOW cast in _gtk_menu_shell_update_mnemonics 2010-04-03 20:53:49 -04:00
Benjamin Otte d3e91fbba6 Document missing signal parameter 2010-04-03 20:53:49 -04:00
Javier Jardón 54573f1582 [docs] Add documentation for GdkWindow 'cursor' property
Reported by Rafal Luzynski here:
https://bugzilla.gnome.org/show_bug.cgi?id=604821
2010-04-03 20:53:49 -04:00
Theppitak Karoonboonyanan 62a2dd6c78 Updated Thai translation. 2010-04-03 20:53:49 -04:00
Hiroyuki Ikezoe 699fc85a67 Use CAIRO_VERSION instead of CAIRO_VERSION_CODE
Cairo does not have CAIRO_VERSION_CODE macro.
Fix for bug #605472.
2010-04-03 20:53:49 -04:00
Matthias Clasen e337bd8583 Make mnemonic hiding work in all cases
Both gtk-enable-mnemonics and gtk-auto-mnemonis did not work with
gtk_label_set_markup_with_mnemonic(). Also, fix gtk_label_set_pattern().
2010-04-03 20:53:49 -04:00
Matthias Clasen facb5e7d60 Update dependency information 2010-04-03 20:53:48 -04:00
Matthias Clasen 37e71e4e28 Don't use string concatentation in translated strings
gettext can't handle it, and there is no real need to use G_GSIZE_FORMAT
here anyway.
2010-04-03 20:53:48 -04:00
Matej Urbančič 1566b3af8a Updated Slovenian translation 2010-04-03 20:53:48 -04:00
Matej Urbančič 3dca3822fb Updated Slovenian translation 2010-04-03 20:53:48 -04:00
Kristian Rietveld 51f9ce390f Plug leaks in quartz implementation of gtk_drag_begin_idle() 2010-04-03 20:53:48 -04:00
Kristian Rietveld 91663e0791 Rework a previous commit to not crash in addition to fixing leaks
The target list/entry to pasteboard entry conversions return a NSSet
now instead of NSArray.
2010-04-03 20:53:48 -04:00
Murray Cumming b2d6bf1526 GtkToolPalette: docs: Minor English corrections. 2010-04-03 20:53:48 -04:00
Johan Dahlin 3871291ba3 Make sure Gdk-2.0.gir is installed
Fixes a variable name typo
2010-04-03 20:53:47 -04:00
Johan Dahlin 9242d1414d Avoid warnings when introspetion is not available
-include is the same as include but will never warn if the
file is not available
2010-04-03 20:53:47 -04:00
Johan Dahlin e4ac9609a2 Fix build with system install of introspection
Or redo it properly and remove previous hack by Matthias.
2010-04-03 20:53:47 -04:00
Kristian Rietveld 753e30667f Fix compiler warning 2010-04-03 20:53:47 -04:00
Kristian Rietveld 80a015529d Fix memory management of types array
Also add autorelease pool to gtk_drag_begin_idle().
2010-04-03 20:53:47 -04:00
Kristian Rietveld b48c8318a1 Do not leak the NSMutableSet 2010-04-03 20:53:47 -04:00
Kristian Rietveld b8fa675a6a Release view after setting it as contentView
Fixes GdkQuartzView being leaked.
2010-04-03 20:53:47 -04:00
Kristian Rietveld 969ff4c863 Fix memleak in get_nsscreen_for_point()
One codepath did not go through GDK_QUARTZ_RELEASE_POOL, refactored
the code to fix this.
2010-04-03 20:53:47 -04:00
Kristian Rietveld 81cf73ae8a Fix memory leak in GdkQuartzView
Should remove the tracking rect in dealloc.
2010-04-03 20:53:46 -04:00
Kristian Rietveld 8273349eca Use CGFLOAT_DEFINED, don't rely on NSINTEGER_DEFINED for this 2010-04-03 20:53:46 -04:00
Kristian Rietveld 50c7d672c1 Unset expander_column when expander column is removed from tree view 2010-04-03 20:53:46 -04:00
Kristian Rietveld 0d51400b29 Add gdk_keymap_map_virtual_modifiers() to Quartz backend 2010-04-03 20:53:46 -04:00
Kristian Rietveld f7daeec10f Start using CGFloat
Fixes a bunch of compiler warnings.  Since CGFloat does not exist on
Tiger and earlier, we have added a typedef likewise as was done for
NSInteger.
2010-04-03 20:53:46 -04:00
Kristian Rietveld 5d3e414994 Fix compile warning in gdk_cursor_new_from_pixmap 2010-04-03 20:53:46 -04:00
Kristian Rietveld b86b00b387 initWithContentRect: has a NSUInteger parameter now
The typedef in place for Tiger and earlier systems should change this
to unsigned int without problems.
2010-04-03 20:53:46 -04:00
Cody Russell 1fa4359218 Add GtkOffscreenWindow to gtk-sections.txt 2010-04-03 20:53:46 -04:00
Cody Russell a739d9fb80 Documentation changes. 2010-04-03 20:53:45 -04:00
Cody Russell 2831ef6b19 Add 'Since 2.20' documentation. 2010-04-03 20:53:45 -04:00
Cody Russell b7fd519822 Add documentation note for GtkOffscreenWindow emission of damage-event. 2010-04-03 20:53:45 -04:00
Cody Russell 4c14a043eb Add gtk-doc section for GtkOffscreenWindow 2010-04-03 20:53:45 -04:00
Cody Russell a078bd09b0 Add gtk_offscreen_window_get_{pixmap,pixbuf} to gtk.symbols 2010-04-03 20:53:45 -04:00
Cody Russell da2d84c0bf Add gtkoffscreenwindow.sgml 2010-04-03 20:53:45 -04:00
Cody Russell 4c4f795da9 Add gtk_offscreen_window_get_pixmap() and gtk_offscreen_window_get_pixbuf(), some API docs. 2010-04-03 20:53:45 -04:00
Cody Russell e0e2c768dd Add headers 2010-04-03 20:53:45 -04:00
Cody Russell f76e9f5804 Add offscreen window symbols to gtk.symbols 2010-04-03 20:53:44 -04:00
Cody Russell cab66c128c Add gtk_offscreen_window_new() prototype to gtkoffscreenwindow.h 2010-04-03 20:53:44 -04:00
Cody Russell 6b9924db1c Add delete-event callback to window, use gtk_widget_queue_draw() instead of gtk_widget_draw() 2010-04-03 20:53:44 -04:00
Cody Russell 87487cea62 GtkOffscreenWindow implementation for #604901 2010-04-03 20:53:44 -04:00
Jorge González ddf4cde3af Updated Spanish translation 2010-04-03 20:53:44 -04:00
Kristian Rietveld e9b593c2e6 Start using NSInteger and NSUInteger
These have been introduced in Leopard and default to int and unsigned int.
In 64-bit Snow Leopard they are long and unsigned long.  This caused issues
with the getRectsBeingDrawn message which needs a pointer to a NSInteger
(long on 64-bit!) but we passed in an integer.  Surprisingly this problem
was visible when compiling with -O0 (segfault), but *not* when compiling
with -O1.  Other messages were NSInteger is now needed have also been
adapted.

Since NSInteger and NSUInteger are not available on Tiger, a define
has been added to add typedefs for these when they have not been defined
by the system headers.
2010-04-03 20:53:44 -04:00
Ivar Smolin 324c3e4ced Updating Estonian translation 2010-04-03 20:53:44 -04:00
Iestyn Pryce f099bf1f58 Updated Welsh translation 2010-04-03 20:53:44 -04:00
Iestyn Pryce 1d3707ca56 Updated Welsh translation 2010-04-03 20:53:43 -04:00
Kristian Rietveld 3e9dabbdb8 Fix call to update_prelight()
Seems like some minus signs sneaked in while diffing and reapplying...
Fixes regression noted in 480065.
2010-04-03 20:53:43 -04:00
Theppitak Karoonboonyanan fa60b41c52 Updated Thai translation. 2010-04-03 20:53:43 -04:00
Jonh Wendell 3750e4fb67 Fix a memory leak in gtk_label_compose_effective_attrs() 2010-04-03 20:53:43 -04:00
Matthias Clasen 8928fd096e Forgotten news 2010-04-03 20:53:42 -04:00
Matthias Clasen 33a021868a Bump version and add dist-bzip2 2010-04-03 20:53:42 -04:00
Matthias Clasen 1de99c2c95 2.19.2 2010-04-03 20:53:42 -04:00
Kristian Rietveld a763546c8f Correct problems with earlier fix for bug #480065
Initialize event_last_[xy] to out of range coordinates and also update
these values in enter and leave notify.  Fix up calls to
update_prelight() from size allocate.  Unconditionally doing these calls
caused problems with hover selection.  Now we only do this call when
the "width before the expander column" has changed.  (Which might be
awkward, but it is the best heuristic I could come up with so far).
2010-04-03 20:53:38 -04:00
Kristian Rietveld 0cbf76ed47 Bug 480065 - wrong tree collapsed (or expanded) after having scrolled
Commit again after revert.

Store (x, y) of last motion event.  From
gtk_tree_view_adjustment_changed(), call prelight_or_select() so that
the prelight is recalculated.  We do the same from
gtk_tree_view_size_allocate() for the case that clicking on an expander
shows new rows that resize the column(s) left of the expander.  This
means that the expander is moved horizontally, in such a case the
prelight also has to be reconsidered.
2010-04-03 20:53:38 -04:00
Matthias Clasen 00ec5fcd7a Updates 2010-04-03 20:53:38 -04:00
Tor Lillqvist a75065a458 Add gdk_keymap_map_virtual_modifiers() implementation 2010-04-03 20:53:38 -04:00
Matthias Clasen afbc052916 Fix a think in the CSW input extension handling
This was causing stack overflow due to an obvious infinite recursion.
See e.g. RH #548849.
2010-04-03 20:53:38 -04:00
Matthias Clasen 58f7b084b5 Fix make check 2010-04-03 20:53:37 -04:00
Matthias Clasen a8fcc1c482 Improve selection/arrow key behaviour in GtkTextView
This patch makes the text view behave more similar to entries.
Patch by Michael Natterer, see bug 50942
2010-04-03 20:53:37 -04:00
Matthias Clasen 87075b3b97 Add a release note about virtual modifiers 2010-04-03 20:53:37 -04:00
Matthias Clasen d1c3745b07 Try harder to handle accelerators involving virtual modifiers
This patch changes GDK to add all matching virtual modifiers in
the state field of the key event. The corresponding GTK+ change makes
use of a new GdkKeymap function to map virtual modifiers back to
real modifiers and detect conflicts while doing so.

This should fix bug 603190 and bug 427409.
2010-04-03 20:53:37 -04:00
Richard Hughes 94f6a09585 Add icc-profile option to gdk-pixbuf for the TIFF image format 2010-04-03 20:53:37 -04:00
Javier Jardón af09dd08c1 Move documentation to inline comments: GtkMountOperation
https://bugzilla.gnome.org/show_bug.cgi?id=597865
2010-04-03 20:53:37 -04:00
Javier Jardón dab1cacba7 Move documentation to inline comments: GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=597865
2010-04-03 20:53:37 -04:00
Javier Jardón f746afc794 Move documentation to inline comments: GtkFileChooser
Also, use Gtk-Doc markup to improve documentation
cross-references.

https://bugzilla.gnome.org/show_bug.cgi?id=597865
2010-04-03 20:53:37 -04:00
Benjamin Otte 9889c4db88 Build adds not-yet-built libgtk-x11-2.0.la into the linker flags
Commit 9e7c91bf83 added a bit too many
LDFLAGS to the build of gtk-update-icon-cache, revert it to only use the
required ones. Bug 605036
2010-04-03 20:53:36 -04:00
Matthias Clasen 1f50800129 Make mnemonic hiding work for printer option widgets
By making the widget itself insensitive.
2010-04-03 20:53:36 -04:00
Matthias Clasen 132276fa75 More auto-mnemonics tweaks
When auto-mnemonics are on, hide mnemonics with insensitive target.
2010-04-03 20:53:36 -04:00
Matthias Clasen 779d3d58ea Some improvements to the auto-mnemonics code 2010-04-03 20:53:36 -04:00
Matthias Clasen 9de876c222 Handle reading the create-folders property 2010-04-03 20:53:36 -04:00
Javier Jardón 2abf1056c9 Fix compilation warning: cast to GTK_WIDGET() 2010-04-03 20:53:36 -04:00
Javier Jardón 14724073a4 Fix compilation warning: use the correct conversion specifier
Use G_GSIZE_FORMAT instead of %d
2010-04-03 20:53:36 -04:00
Jorge González c12194feae Updated Spanish translation 2010-04-03 20:53:35 -04:00
Matthias Clasen d68d78de81 Only show the mnemonic underline when pressing Alt
...and show them in menus when navigating the menu with the keyboard.
This is similar to what other platforms do, and reduces visual clutter.
There is a setting to control this. Most of the work on this patch was
done by Thomas Wood. See bug 588554.
2010-04-03 20:53:35 -04:00
Matthias Clasen ce9c3df4c8 Small documentation correction 2010-04-03 20:51:58 -04:00
Matthias Clasen 4bc8dcede8 Properly free damage events
This was reported in bug 605008
2010-04-03 20:51:57 -04:00
Benjamin Otte 3659db3a4a Fix up linker flags
This adds LDFLAGS everywhere where they were previously pulled in via
other libraries. This is however unsupported by modern linkers.
You can trigger these failures by building with gold (or, I'm told, with
very new ld).
2010-04-03 20:51:57 -04:00
Benjamin Otte 71d7b97a90 Disconnect signal handlers on adjustment in destroy handler
Not removing the signal handler caused crashes if the adjustment
survived longer than the scrolled window and still emitted signals. This
could happen inside WebKit.
2010-04-03 20:51:57 -04:00
Jorge González 7545e7211c Updated Spanish translation 2010-04-03 20:51:57 -04:00
Carlos Garcia Campos acca24e9c1 Fix a crash on print preview
There's no printer when doing print preview so it's not possible to get
its hard margins.
2010-04-03 20:51:57 -04:00
Dan Winship 507bf6a85f Change GtkIconSize to int in params/return values
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.

https://bugzilla.gnome.org/show_bug.cgi?id=604895
2010-04-03 20:51:56 -04:00
Dan Winship 750a96e4cc Fix out/transfer annotations on GtkImage getters
https://bugzilla.gnome.org/show_bug.cgi?id=604895
2010-04-03 20:51:56 -04:00
Matthias Clasen b68bbbb892 Fix doc typos
Reported in bug 604902.
2010-04-03 20:51:56 -04:00
Javier Jardón 1abc649b8c [docs] Cast to GFunc in gtk_tree_selection_get_selected_rows() example code
Reported by Diego Escalante Urrelo here:
https://bugzilla.gnome.org/show_bug.cgi?id=502266
2010-04-03 20:51:56 -04:00
Hiroyuki Ikezoe f8b8bb4bf9 [gtk] GtkCellEditable::editing-cancelled should be writable
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604881

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:51:56 -04:00
Matthias Clasen 360820e9bf Fix a thinko in computing damage for segments
The code was not taking the endpoint of the first segment into account.
This was reported in bug 604747.
2010-04-03 20:51:56 -04:00
Matthias Clasen 214d5efdd4 Ensure native windows in gdk_property_change
Using X properties on non-toplevel windows is somewhat exotic,
but some people seem to do it, so better to keep it working.
See bug 604787.
2010-04-03 20:51:55 -04:00
Torsten Schoenfeld 600ae2db92 [docs] Add some 'Since: 2.4' tags
This patch adds Since: 2.4 tags to gtk_bindings_activate_event,
gtk_window_propagate_key_event and gtk_window_activate_key.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604859

Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-04-03 20:51:55 -04:00
Hiroyuki Ikezoe 5cb043d5dd Use g_value_dup_string instead.
g_value_get_string and g_strdup should be replaced by
g_value_dup_string.
2010-04-03 20:51:55 -04:00
Richard Hughes f289f667e7 Add color management support to gdk_pixbuf_save
This patch adds an icc-profile option to a GdkPixbuf which can
be used to read or write an embedded ICC profile.

Add PNG support for now, but other image formats are awaiting
review.
2010-04-03 20:51:55 -04:00
Alexander Larsson 89ac81e767 Actually send exposes from gdk_window_clear_area_e 2010-04-03 20:51:55 -04:00
Javier Jardón 0c991c5645 Add 'Since: 2.18' tag
Add missing 'Since:' tag in gdk_window_get_root_coords() and
gdk_window_is_destroyed()

Reported by Rafal Luzynski in
https://bugzilla.gnome.org/show_bug.cgi?id=604821
2010-04-03 20:51:55 -04:00
Nguyễn Thái Ngọc Duy 901aa0d645 vi.po: Updated Vietnamese translation 2010-04-03 20:51:54 -04:00
Christian Dywan 2336ebca5c Use gtk_widget_get_tooltip_text for gtk_tooltips_data_get in Gail 2010-04-03 20:51:54 -04:00
Tor Lillqvist 9d4e82a0dc Make the OLE2 DND code selectable at run-time instead of compile-time
(It still doesn't work, though.)
2010-04-03 20:51:54 -04:00
Johan Dahlin b0e01bee7f Make sure dist check includes introspection 2010-04-03 20:51:54 -04:00
Johan Dahlin 944bf11cee Bump the required introspection version
Makefile.introspection was added in 0.6.7
2010-04-03 20:51:54 -04:00
Johan Dahlin 3a4f027074 Use Makefile.introspection
Use the new fancy rules from the Makefile.introspection, it makes
the rules prettier and avoids quite a bit of duplication
2010-04-03 20:51:54 -04:00
Johan Dahlin a8bf73cfa7 Update introspection.m4
This one includes the INTROSPECTION_MAKEFILE variable
which we will include in all Makefiles which are going
to build introspection girs/typelibs
2010-04-03 20:51:54 -04:00
Johan Dahlin 4330bd6e52 Bump required introspection version to 0.6.6 2010-04-03 20:51:54 -04:00
Johan Dahlin 6c9bfc5f39 Make sure dist check works with introspection
We need to prepend the srcdir to all variables
passed into the scanner as it runs with srcdir != builddir during
distcheck.
2010-04-03 20:51:53 -04:00
Johan Dahlin 9d4674a5ec Re-add accidentially removed gtkintl header 2010-04-03 20:51:53 -04:00
Johan Dahlin cd50594db8 Add no-portability option to automake
We require GNU Make and has done so for a while already
2010-04-03 20:51:53 -04:00
Colin Walters fcbbd763cd [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2010-04-03 20:51:53 -04:00
Johan Dahlin 99de88c452 Bump the required version of autoconf to 2.62
It's need by the new introspection macro.
2010-04-03 20:51:52 -04:00
Johan Dahlin 7c0624aa92 Separate private from public gdk headers
We don't want to parse the private gdk headers when
creating the GIR.
2010-04-03 20:51:52 -04:00
Johan Dahlin b1397c64e4 Add an m4 directory and a introspection.m4
So we don't need the introspection.m4 file
to create a dist of gtk+
2010-04-03 20:51:52 -04:00
Tomeu Vizoso 1ba7e8eb15 Add a few more annotations to GtkIconTheme 2010-04-03 20:51:51 -04:00
Colin Walters f584679cfa Merge in Gdk-custom.c introspection annotations
The Gdk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GDK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.

https://bugzilla.gnome.org/show_bug.cgi?id=592279
2010-04-03 20:51:51 -04:00
Colin Walters 41342b23e5 Build introspection data for gdk-pixbuf, gdk, and gtk
Generate .gir and .typelib files for gdk-pixbuf, gdk, and gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=592279
2010-04-03 20:51:51 -04:00
Tor Lillqvist 3546feb389 Add copyright note and comment for merged old code 2010-04-03 20:51:51 -04:00
Tor Lillqvist af37f76bc6 Work on OLE2-based generic DND
Intermediate commit of work in progress on integrating the old code
for OLE2-based generic drag and drop from Arhaeopteryx Software, from
a long time ago in the GTK+ 1.3 timeframe. Does still not work and is
as before not compiled in unless OLE2_DND is defined in
gdkdnd-win32.c. (Thus, for inter-process DND, still only WM_DROPFILES
style dropping of files on GTK+ apps works.)

Related slight refactoring of other code that shouldn't change how it
works. Add more global variables for run-time constants (once
initialized) representing well-known GdkAtoms and registered Windows
clipboard formats, as they with the generic DND code will be needed in
several source files. Some improved debugging output.
2010-04-03 20:51:51 -04:00
Tor Lillqvist e5b4a51b6b Make more GdkAtom variables visible in all gdk/win32 files
Make the GdkAtoms for the image formats extern and usable from all
gdk/win32 files.
2010-04-03 20:51:51 -04:00
Tor Lillqvist 750fa5398e Make the gdk/win32 event debug printing function non-static
Make print_event() extern and rename it to _gdk_win32_print_event() so
it can be used from all gdk/win32 source files.
2010-04-03 20:51:51 -04:00
Tor Lillqvist e70ef71c3a Remove unused functions and variables 2010-04-03 20:51:50 -04:00
Benjamin Otte fb0968a99f Revert dd511e825a
The patch completely breaks entry completion - as can be seen when using
epiphany. Bug 480065 has been reopened.
2010-04-03 20:51:50 -04:00
Javier Jardón 4f0f6243c9 Add info about single includes when compiling GTK+ apps
gtk.h, gdk.h, gdk-pixbuf.h. are the recommended includes.
But there are some exceptions: gdkkeysyms.h, gdkx.h and
gtkunixprint.h

https://bugzilla.gnome.org/show_bug.cgi?id=604117
2010-04-03 20:51:49 -04:00
Matthew Barnes 52e84a9ecc Bug 602099 - Actions can be activatable too
Add a couple type checks in gtk_activatable_do_set_related_action() to
allow both GtkWidgets and GtkActions to implement GtkActivatable.  Bug
602099 describes a use case for this.

Also add a GObject prerequisite to the GtkActivatable interface.
2010-04-03 20:51:49 -04:00
Matthias Clasen a2a990aa0b Fix a typo 2009-12-19 13:12:16 -05:00
Matthias Clasen d99742e1cb implement extended layout for GtkCellRendererText 2009-12-19 10:31:16 -05:00
Matthias Clasen 5e62f81196 implement extended layout for GtkCellView 2009-12-19 10:23:58 -05:00
Matthias Clasen d4b1f0cadf implement extended layout for GtkTreeView and GtkTreeViewColumn 2009-12-19 02:07:51 -05:00
Matthias Clasen 56edab3553 Implement extended layout for plug/socket 2009-12-19 01:23:58 -05:00
Matthias Clasen 9a48091064 Implement extended layout for GtkScrolledWindow 2009-12-19 00:57:49 -05:00
Matthias Clasen 5e8045b14d Implement extended layout for GtkBin 2009-12-19 00:34:04 -05:00
Matthias Clasen 7a69bdc5f0 Make it compile 2009-12-18 23:44:43 -05:00
Johannes Schmid 21ebf5df86 native-layout: Change test-case so that it is more obvious that the algorithm tries to show as many
widgets with full size as possible.
2009-12-14 17:24:52 +01:00
Johannes Schmid 24c1a4f24b native-layout: Fix typo that brakes layout completely 2009-12-14 17:16:21 +01:00
Johannes Schmid 462dc0643b native-layout: Bump version of GtkExtendedLayout gtk-doc comments to 2.20 2009-12-14 16:30:26 +01:00
Johannes Schmid 9724366289 native-layout: Don't expose extra gtk_widget_* function that are similar to the GtkExtendedLayout interface 2009-12-14 16:28:56 +01:00
Johannes Schmid c659d1a505 Merge branch 'master' into native-layout 2009-12-14 15:36:22 +01:00
Johannes Schmmid e08d04b561 native-layout: Introduce GtkExtendedLayout interface. 2009-12-14 15:32:49 +01:00
Johannes Schmid a8ec02c930 gtknotebook: Avoid drawing artifacts with action widgets and long tab labels (bgo#603245) 2009-12-02 09:36:53 +01:00
80 changed files with 13452 additions and 9366 deletions
+8
View File
@@ -1,3 +1,11 @@
Overview of Changes from GTK+ 2.20.x to 2.90.0
==============================================
* GtkExtendedLayout: Width-for-height geometry management
* gtk_icon_theme_load_symbolic: Support for 'symbolic' icons
Overview of Changes from GTK+ 2.19.7 to 2.20.0
==============================================
+21
View File
@@ -317,6 +317,7 @@ do_images (GtkWidget *do_widget)
GtkWidget *align;
GtkWidget *button;
GdkPixbuf *pixbuf;
GIcon *gicon;
GError *error = NULL;
char *filename;
@@ -415,6 +416,26 @@ do_images (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (frame), image);
/* Symbolic icon */
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
"<u>Symbolic themed icon</u>");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
/* The alignment keeps the frame from growing when users resize
* the window
*/
align = gtk_alignment_new (0.5, 0.5, 0, 0);
gtk_container_add (GTK_CONTAINER (align), frame);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
gicon = g_themed_icon_new_with_default_fallbacks ("battery-critical-charging-symbolic");
image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG);
gtk_container_add (GTK_CONTAINER (frame), image);
/* Progressive */
+30
View File
@@ -29,7 +29,9 @@ enum
COLUMN_SEVERITY,
COLUMN_DESCRIPTION,
COLUMN_PULSE,
COLUMN_ICON,
COLUMN_ACTIVE,
COLUMN_SENSITIVE,
NUM_COLUMNS
};
@@ -92,11 +94,24 @@ create_model (void)
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_UINT,
G_TYPE_STRING,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN);
/* add data to the list store */
for (i = 0; i < G_N_ELEMENTS (data); i++)
{
gchar *icon_name;
gboolean sensitive;
if (i == 1 || i == 3)
icon_name = "battery-critical-charging-symbolic";
else
icon_name = NULL;
if (i == 3)
sensitive = FALSE;
else
sensitive = TRUE;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_FIXED, data[i].fixed,
@@ -104,7 +119,9 @@ create_model (void)
COLUMN_SEVERITY, data[i].severity,
COLUMN_DESCRIPTION, data[i].description,
COLUMN_PULSE, 0,
COLUMN_ICON, icon_name,
COLUMN_ACTIVE, FALSE,
COLUMN_SENSITIVE, sensitive,
-1);
}
@@ -199,6 +216,19 @@ add_columns (GtkTreeView *treeview)
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_PULSE);
gtk_tree_view_append_column (treeview, column);
/* column for symbolic icon */
renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
renderer,
"icon-name",
COLUMN_ICON,
"sensitive",
COLUMN_SENSITIVE,
NULL);
gtk_tree_view_column_set_sort_column_id (column, COLUMN_ICON);
gtk_tree_view_append_column (treeview, column);
}
static gboolean
+9
View File
@@ -294,6 +294,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/gtktable.xml" />
<xi:include href="xml/gtkexpander.xml" />
<xi:include href="xml/gtkorientable.xml" />
<xi:include href="xml/gtkextendedlayout.xml" />
</chapter>
<chapter id="Ornaments">
@@ -500,6 +501,14 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<title>Index of new symbols in 2.20</title>
<xi:include href="xml/api-index-2.20.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-2-22" role="2.22">
<title>Index of new symbols in 2.20</title>
<xi:include href="xml/api-index-2.22.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-0" role="3.0">
<title>Index of new symbols in 3.0</title>
<xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+52 -1
View File
@@ -154,6 +154,7 @@ gtk_accel_label_accelerator_width
<TITLE>GtkAccessible</TITLE>
GtkAccessible
gtk_accessible_connect_widget_destroyed
gtk_accessible_get_widget
<SUBSECTION Standard>
GTK_ACCESSIBLE
@@ -1374,7 +1375,9 @@ GTK_ENTRY_BUFFER_CLASS
GTK_IS_ENTRY_BUFFER_CLASS
GTK_ENTRY_BUFFER_GET_CLASS
GTK_ENTRY_BUFFER_MAX_SIZE
<SUBSECTION Private>
GtkEntryBufferPrivate
gtk_entry_buffer_get_type
</SECTION>
@@ -2658,8 +2661,8 @@ GTK_IS_INFO_BAR_CLASS
GTK_INFO_BAR_GET_CLASS
<SUBSECTION Private>
GtkInfoBarPrivate
gtk_info_bar_get_type
GtkMessageAreaPrivate
</SECTION>
<SECTION>
@@ -3618,6 +3621,7 @@ GtkSpinner
gtk_spinner_new
gtk_spinner_start
gtk_spinner_stop
<SUBSECTION Standard>
GTK_SPINNER
GTK_IS_SPINNER
@@ -3625,7 +3629,10 @@ GTK_TYPE_SPINNER
GTK_SPINNER_CLASS
GTK_IS_SPINER_CLASS
GTK_SPINNER_GET_CLASS
GTK_IS_SPINNER_CLASS
<SUBSECTION Private>
GtkSpinnerPrivate
gtk_spinner_get_type
</SECTION>
@@ -4063,6 +4070,8 @@ gtk_text_view_new
gtk_text_view_new_with_buffer
gtk_text_view_set_buffer
gtk_text_view_get_buffer
gtk_text_view_get_hadjustment
gtk_text_view_get_vadjustment
gtk_text_view_scroll_to_mark
gtk_text_view_scroll_to_iter
gtk_text_view_scroll_mark_onscreen
@@ -4512,6 +4521,7 @@ gtk_tool_item_group_set_item_position
gtk_tool_item_group_set_label
gtk_tool_item_group_set_label_widget
gtk_tool_item_group_set_header_relief
<SUBSECTION Standard>
GtkToolItemGroupClass
GTK_TOOL_ITEM_GROUP
@@ -4520,7 +4530,9 @@ GTK_TYPE_TOOL_ITEM_GROUP
GTK_TOOL_ITEM_GROUP_CLASS
GTK_IS_TOOL_ITEM_GROUP_CLASS
GTK_TOOL_ITEM_GROUP_GET_CLASS
<SUBSECTION Private>
GtkToolItemGroupPrivate
gtk_tool_item_group_get_type
</SECTION>
@@ -4663,6 +4675,7 @@ gtk_tree_path_append_index
gtk_tree_path_prepend_index
gtk_tree_path_get_depth
gtk_tree_path_get_indices
gtk_tree_path_get_indices_with_depth
gtk_tree_path_free
gtk_tree_path_copy
gtk_tree_path_compare
@@ -5661,6 +5674,7 @@ gtk_widget_modify_text
gtk_widget_modify_base
gtk_widget_modify_font
gtk_widget_modify_cursor
gtk_widget_modify_symbolic_color
gtk_widget_create_pango_context
gtk_widget_get_pango_context
gtk_widget_create_pango_layout
@@ -6684,6 +6698,7 @@ gtk_icon_info_get_base_size
gtk_icon_info_get_filename
gtk_icon_info_get_builtin_pixbuf
gtk_icon_info_load_icon
gtk_icon_info_load_symbolic
gtk_icon_info_set_raw_coordinates
gtk_icon_info_get_embedded_rect
gtk_icon_info_get_attach_points
@@ -6829,6 +6844,8 @@ GTK_IS_PRINT_OPERATION_PREVIEW
GTK_PRINT_OPERATION_PREVIEW
GTK_PRINT_OPERATION_PREVIEW_GET_IFACE
GTK_TYPE_PRINT_OPERATION_PREVIEW
GtkPrintOperationClass
GtkPrintOperationPreviewIface
<SUBSECTION Private>
gtk_print_error_quark
@@ -7089,10 +7106,20 @@ gtk_paper_size_to_key_file
<SUBSECTION Standard>
GTK_TYPE_PAPER_SIZE
GTK_CUSTOM_PAPER_UNIX_DIALOG
GTK_CUSTOM_PAPER_UNIX_DIALOG_CLASS
GTK_CUSTOM_PAPER_UNIX_DIALOG_GET_CLASS
GTK_IS_CUSTOM_PAPER_UNIX_DIALOG
GTK_IS_CUSTOM_PAPER_UNIX_DIALOG_CLASS
GTK_TYPE_CUSTOM_PAPER_UNIX_DIALOG
GtkCustomPaperUnixDialog
GtkCustomPaperUnixDialogClass
<SUBSECTION Private>
gtk_paper_size_get_type
gtk_custom_paper_unix_dialog_get_type
GtkCustomPaperUnixDialogPrivate
</SECTION>
@@ -7260,6 +7287,7 @@ GTK_MOUNT_OPERATION_CLASS
GTK_MOUNT_OPERATION_GET_CLASS
GTK_TYPE_MOUNT_OPERATION
<SUBSECTION Private>
GtkMountOperationLookupContext
gtk_mount_operation_get_type
GtkMountOperationPrivate
</SECTION>
@@ -7283,3 +7311,26 @@ GTK_TYPE_ORIENTABLE
<SUBSECTION Private>
gtk_orientable_get_type
</SECTION>
<SECTION>
<FILE>gtkextendedlayout</FILE>
<TITLE>GtkExtendedLayout</TITLE>
GtkExtendedLayout
GtkExtendedLayoutIface
gtk_extended_layout_get_desired_height
gtk_extended_layout_get_desired_size
gtk_extended_layout_get_desired_width
gtk_extended_layout_get_height_for_width
gtk_extended_layout_get_width_for_height
gtk_extended_layout_is_height_for_width
<SUBSECTION Standard>
GTK_EXTENDED_LAYOUT
GTK_EXTENDED_LAYOUT_CLASS
GTK_EXTENDED_LAYOUT_GET_IFACE
GTK_IS_EXTENDED_LAYOUT
GTK_TYPE_EXTENDED_LAYOUT
<SUBSECTION Private>
gtk_extended_layout_get_type
</SECTION>
+1
View File
@@ -54,6 +54,7 @@ gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_box_get_type
gtk_expander_get_type
gtk_extended_layout_get_type
gtk_file_chooser_button_get_type
gtk_file_chooser_dialog_get_type
gtk_file_chooser_get_type
+3
View File
@@ -1,3 +1,6 @@
gtkbbox.sgml
gtkbox.sgml
gtkbuilder.sgml
gtkhbox.sgml
gtkmessagedialog.sgml
gtktesting.sgml
-210
View File
@@ -1,210 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkButtonBox
<!-- ##### SECTION Short_Description ##### -->
Base class for GtkHButtonBox and GtkVButtonBox
<!-- ##### SECTION Long_Description ##### -->
<para>
The primary purpose of this class is to keep track of the various properties
of #GtkHButtonBox and #GtkVButtonBox widgets.
</para>
<para>
gtk_button_box_get_child_size() retrieves the minimum width and height
for widgets in a given button box.
</para>
<para>
The internal padding of buttons can be retrieved and changed per button box using
gtk_button_box_get_child_ipadding() and gtk_button_box_set_child_ipadding()
respectively.
</para>
<para>
gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and
change default number of pixels between buttons, respectively.
</para>
<para>
gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and alter the method
used to spread the buttons in a button box across the container, respectively.
</para>
<para>
The main purpose of GtkButtonBox is to make sure the children have all the same size.
Therefore it ignores the homogeneous property which it inherited from GtkBox, and always
behaves as if homogeneous was %TRUE.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkVButtonBox</term>
<listitem><para>Vertical sub-class of #GtkButtonBox.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkHButtonBox</term>
<listitem><para>Horizontal sub-class of #GtkButtonBox.</para></listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkButtonBox ##### -->
<para>
This is a read-only struct; no members should be modified directly.
</para>
<!-- ##### ARG GtkButtonBox:layout-style ##### -->
<para>
</para>
<!-- ##### ARG GtkButtonBox:secondary ##### -->
<para>
</para>
<!-- ##### ARG GtkButtonBox:child-internal-pad-x ##### -->
<para>
</para>
<!-- ##### ARG GtkButtonBox:child-internal-pad-y ##### -->
<para>
</para>
<!-- ##### ARG GtkButtonBox:child-min-height ##### -->
<para>
</para>
<!-- ##### ARG GtkButtonBox:child-min-width ##### -->
<para>
</para>
<!-- ##### MACRO GTK_BUTTONBOX_DEFAULT ##### -->
<para>
Used internally only.
</para>
<!-- ##### MACRO gtk_button_box_get_spacing ##### -->
<para>
Retrieves how much space a button box is placing between each child button.
</para>
@b: a #GtkButtonBox
@Returns: the current spacing applied to the buttons in @widget
@Deprecated: Use gtk_box_get_spacing() instead.
<!-- ##### FUNCTION gtk_button_box_get_layout ##### -->
<para>
Retrieves the method being used to arrange the buttons in a button box.
</para>
@widget: a #GtkButtonBox.
@Returns: the method used to layout buttons in @widget.
<!-- ##### FUNCTION gtk_button_box_get_child_size ##### -->
<para>
Retrieves the current width and height of all child widgets in a button box.
@min_width and @min_height are filled with those values, respectively.
</para>
@widget: a #GtkButtonBox.
@min_width: the width of the buttons contained by @widget.
@min_height: the height of the buttons contained by @widget.
@Deprecated: Use the style properties
<literal>"child-min-width/-height"</literal> instead.
<!-- ##### FUNCTION gtk_button_box_get_child_ipadding ##### -->
<para>
Gets the default number of pixels that pad the buttons in a given button box.
</para>
@widget: a #GtkButtonBox.
@ipad_x: the horizontal padding used by buttons in @widget.
@ipad_y: the vertical padding used by buttons in @widget.
@Deprecated: Use the style properties
"<link linkend="GtkButtonBox--s-child-internal-pad-x">child-internal-pad-x</link>"
and
"<link linkend="GtkButtonBox--s-child-internal-pad-y">child-internal-pad-y</link>"
instead.
<!-- ##### FUNCTION gtk_button_box_get_child_secondary ##### -->
<para>
</para>
@widget:
@child:
@Returns:
<!-- ##### MACRO gtk_button_box_set_spacing ##### -->
<para>
Sets the amount of spacing between buttons in a given button box.
</para>
@b: a #GtkButtonBox
@s: the number of pixels of spacing
@Deprecated: Use gtk_box_set_spacing() instead.
<!-- ##### FUNCTION gtk_button_box_set_layout ##### -->
<para>
Changes the way buttons are arranged in their container.
</para>
@widget: a #GtkButtonBox.
@layout_style: the new layout style.
<!-- ##### FUNCTION gtk_button_box_set_child_size ##### -->
<para>
Sets a new default size for the children of a given button box.
</para>
@widget: a #GtkButtonBox
@min_width: a default width for buttons in @widget
@min_height: a default height for buttons in @widget
@Deprecated: This is not supported anymore and can only be set through the theme
changing the style properties:
"<link linkend="GtkButtonBox--s-child-min-width">child-min-width</link>"
and
"<link linkend="GtkButtonBox--s-child-min-height">child-min-height</link>"
instead.
<!-- ##### FUNCTION gtk_button_box_set_child_ipadding ##### -->
<para>
Changes the amount of internal padding used by all buttons in a given button
box.
</para>
@widget: a #GtkButtonBox.
@ipad_x: the horizontal padding that should be used by each button in @widget.
@ipad_y: the vertical padding that should be used by each button in @widget.
@Deprecated: Use the style properties
<literal>"child-internal-pad-x/-y"</literal> instead.
<!-- ##### FUNCTION gtk_button_box_set_child_secondary ##### -->
<para>
</para>
@widget:
@child:
@is_secondary:
-291
View File
@@ -1,291 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkBox
<!-- ##### SECTION Short_Description ##### -->
Base class for box containers
<!-- ##### SECTION Long_Description ##### -->
<para>
GtkBox is an abstract widget which encapsulates functionality for a
particular kind of container, one that organizes a variable number of
widgets into a rectangular area. GtkBox has a number of derived
classes, e.g. #GtkHBox and #GtkVBox.
</para>
<para>
The rectangular area of a GtkBox is organized into either a single row
or a single column of child widgets depending upon whether the box is
of type #GtkHBox or #GtkVBox, respectively. Thus, all children of a
GtkBox are allocated one dimension in common, which is the height of a
row, or the width of a column.
</para>
<para>
GtkBox uses a notion of <emphasis>packing</emphasis>. Packing refers to
adding widgets with reference to a particular position in a
#GtkContainer. For a GtkBox, there are two reference positions: the
<emphasis>start</emphasis> and the <emphasis>end</emphasis> of the box.
For a #GtkVBox, the start is defined as the top of the box and the end is
defined as the bottom. For a #GtkHBox the start is defined as the
left side and the end is defined as the right side.
</para>
<para>
Use repeated calls to gtk_box_pack_start() to pack widgets into a
GtkBox from start to end. Use gtk_box_pack_end() to add widgets from
end to start. You may intersperse these calls and add widgets from
both ends of the same GtkBox.
</para>
<para>
Use gtk_box_pack_start_defaults() or gtk_box_pack_end_defaults()
to pack widgets into a GtkBox if you do not need to specify the
#GtkBox:expand, #GtkBox:fill, or #GtkBox:padding child properties
for the child to be added.
</para>
<para>
Because GtkBox is a #GtkContainer, you may also use
gtk_container_add() to insert widgets into the box, and they will be
packed as if with gtk_box_pack_start_defaults(). Use
gtk_container_remove() to remove widgets from the GtkBox.
</para>
<para>
Use gtk_box_set_homogeneous() to specify whether or not all children
of the GtkBox are forced to get the same amount of space.
</para>
<para>
Use gtk_box_set_spacing() to determine how much space will be
minimally placed between all children in the GtkBox.
</para>
<para>
Use gtk_box_reorder_child() to move a GtkBox child to a different
place in the box.
</para>
<para>
Use gtk_box_set_child_packing() to reset the #GtkBox:expand,
#GtkBox:fill and #GtkBox:padding child properties.
Use gtk_box_query_child_packing() to query these fields.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkHBox</term>
<listitem><para>a derived class that organizes widgets into a row.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkVBox</term>
<listitem><para>a derived class that organizes widgets into a column.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkFrame</term>
<listitem><para>a #GtkWidget useful for drawing a border around a GtkBox.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkTable</term>
<listitem><para>a #GtkContainer for organizing widgets into a grid,
rather than independent rows or columns.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkLayout</term>
<listitem><para>a #GtkContainer for organizing widgets into arbitrary
layouts.</para></listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkBox ##### -->
<para>
The #GtkBox-struct describes an instance of GtkBox and contains the
following fields. (These fields should be considered read-only.
They should never be set by an application.)
</para>
<!-- ##### ARG GtkBox:homogeneous ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:spacing ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:expand ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:fill ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:pack-type ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:padding ##### -->
<para>
</para>
<!-- ##### ARG GtkBox:position ##### -->
<para>
</para>
<!-- ##### STRUCT GtkBoxChild ##### -->
<para>
The #GtkBoxChild-struct holds a child widget of GtkBox and describes
how the child is to be packed into the GtkBox. Use
gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
and reset the <structfield>padding</structfield>,
<structfield>expand</structfield>, <structfield>fill</structfield>,
and <structfield>pack</structfield> fields.
</para>
<para>
#GtkBoxChild-struct contains the following fields. (These fields
should be considered read-only. They should never be directly set by an
application.)
</para>
@widget: the child widget, packed into the GtkBox.
@padding: the number of extra pixels to put between this child and its
neighbors, set when packed, zero by default.
@expand: flag indicates whether extra space should be given to this
child. Any extra space given to the parent GtkBox is divided up
among all children with this attribute set to %TRUE; set when packed,
%TRUE by default.
@fill: flag indicates whether any extra space given to this child due
to its @expand attribute being set is actually allocated to the child,
rather than being used as padding around the widget; set when packed,
%TRUE by default.
@pack: one of #GtkPackType indicating whether the child is packed with
reference to the start (top/left) or end (bottom/right) of the GtkBox.
@is_secondary: %TRUE if the child is secondary
<!-- ##### FUNCTION gtk_box_pack_start ##### -->
<para>
</para>
@box:
@child:
@expand:
@box
@fill:
@padding:
<!-- ##### FUNCTION gtk_box_pack_end ##### -->
<para>
</para>
@box:
@child:
@expand:
@fill:
@padding:
<!-- ##### FUNCTION gtk_box_pack_start_defaults ##### -->
<para>
</para>
@box:
@widget:
<!-- ##### FUNCTION gtk_box_pack_end_defaults ##### -->
<para>
</para>
@box:
@widget:
<!-- ##### FUNCTION gtk_box_get_homogeneous ##### -->
<para>
</para>
@box:
@Returns:
<!-- ##### FUNCTION gtk_box_set_homogeneous ##### -->
<para>
</para>
@box:
@homogeneous:
<!-- ##### FUNCTION gtk_box_get_spacing ##### -->
<para>
</para>
@box:
@Returns:
<!-- ##### FUNCTION gtk_box_set_spacing ##### -->
<para>
</para>
@box:
@spacing:
<!-- ##### FUNCTION gtk_box_reorder_child ##### -->
<para>
</para>
@box:
@child:
@position:
<!-- ##### FUNCTION gtk_box_query_child_packing ##### -->
<para>
</para>
@box:
@child:
@expand:
@fill:
@padding:
@pack_type:
<!-- ##### FUNCTION gtk_box_set_child_packing ##### -->
<para>
</para>
@box:
@child:
@expand:
@fill:
@padding:
@pack_type:
-462
View File
@@ -1,462 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkBuilder
<!-- ##### SECTION Short_Description ##### -->
Build an interface from an XML UI definition
<!-- ##### SECTION Long_Description ##### -->
<para>
A GtkBuilder is an auxiliary object that reads textual descriptions
of a user interface and instantiates the described objects. To pass a
description to a GtkBuilder, call gtk_builder_add_from_file() or
gtk_builder_add_from_string(). These functions can be called multiple
times; the builder merges the content of all descriptions.
</para>
<para>
A GtkBuilder holds a reference to all objects that it has constructed
and drops these references when it is finalized. This finalization can
cause the destruction of non-widget objects or widgets which are not
contained in a toplevel window. For toplevel windows constructed by a
builder, it is the responsibility of the user to call gtk_widget_destroy()
to get rid of them and all the widgets they contain.
</para>
<para>
The functions gtk_builder_get_object() and gtk_builder_get_objects()
can be used to access the widgets in the interface by the names assigned
to them inside the UI description. Toplevel windows returned by these
functions will stay around until the user explicitly destroys them
with gtk_widget_destroy(). Other widgets will either be part of a
larger hierarchy constructed by the builder (in which case you should
not have to worry about their lifecycle), or without a parent, in which
case they have to be added to some container to make use of them.
Non-widget objects need to be reffed with g_object_ref() to keep them
beyond the lifespan of the builder.
</para>
<para>
The function gtk_builder_connect_signals() and variants thereof can be
used to connect handlers to the named signals in the description.
</para>
<refsect2 id="BUILDER-UI"><title>GtkBuilder UI Definitions</title>
<para>
GtkBuilder parses textual descriptions of user interfaces which
are specified in an XML format which can be roughly described
by the DTD below. We refer to these descriptions as
<firstterm>GtkBuilder UI definitions</firstterm> or just
<firstterm>UI definitions</firstterm> if the context is clear.
Do not confuse GtkBuilder UI Definitions with
<link linkend="XML-UI">GtkUIManager UI Definitions</link>,
which are more limited in scope.
</para>
<para>
<programlisting><![CDATA[
<!ELEMENT interface (requires|object)* >
<!ELEMENT object (property|signal|child|ANY)* >
<!ELEMENT property PCDATA >
<!ELEMENT signal EMPTY >
<!ELEMENT requires EMPTY >
<!ELEMENT child (object|ANY*) >
<!ATTLIST interface domain #IMPLIED >
<!ATTLIST object id #REQUIRED
class #REQUIRED
type-func #IMPLIED
constructor #IMPLIED >
<!ATTLIST requires lib #REQUIRED
version #REQUIRED >
<!ATTLIST property name #REQUIRED
translatable #IMPLIED
comments #IMPLIED
context #IMPLIED >
<!ATTLIST signal name #REQUIRED
handler #REQUIRED
after #IMPLIED
swapped #IMPLIED
object #IMPLIED
last_modification_time #IMPLIED >
<!ATTLIST child type #IMPLIED
internal-child #IMPLIED >
]]></programlisting>
</para>
<para>
The toplevel element is &lt;interface&gt;.
It optionally takes a "domain" attribute, which will make
the builder look for translated strings using dgettext() in the
domain specified. This can also be done by calling
gtk_builder_set_translation_domain() on the builder.
Objects are described by &lt;object&gt; elements, which can
contain &lt;property&gt; elements to set properties, &lt;signal&gt;
elements which connect signals to handlers, and &lt;child&gt;
elements, which describe child objects (most often widgets
inside a container, but also e.g. actions in an action group,
or columns in a tree model). A &lt;child&gt; element contains
an &lt;object&gt; element which describes the child object.
The target toolkit version(s) are described by &lt;requires&gt;
elements, the "lib" attribute specifies the widget library in
question (currently the only supported value is "gtk+") and the "version"
attribute specifies the target version in the form "&lt;major&gt;.&lt;minor&gt;".
The builder will error out if the version requirements are not met.
</para>
<para>
Typically, the specific kind of object represented by an
&lt;object&gt; element is specified by the "class" attribute.
If the type has not been loaded yet, GTK+ tries to find the
<function>_get_type()</function> from the class name by applying
heuristics. This works in most cases, but if necessary, it is
possible to specify the name of the <function>_get_type()</function>
explictly with the "type-func" attribute. As a special case,
GtkBuilder allows to use an object that has been constructed
by a #GtkUIManager in another part of the UI definition by
specifying the id of the #GtkUIManager in the "constructor"
attribute and the name of the object in the "id" attribute.
</para>
<para>
Objects must be given a name with the "id" attribute, which
allows the application to retrieve them from the builder with
gtk_builder_get_object(). An id is also necessary to use the
object as property value in other parts of the UI definition.
</para>
<note><para>Prior to 2.20, GtkBuilder was setting the "name"
property of constructed widgets to the "id" attribute. In GTK+
2.20 or newer, you have to use gtk_buildable_get_name() instead
of gtk_widget_get_name() to obtain the "id", or set the "name"
property in your UI definition.
</para></note>
<para>
Setting properties of objects is pretty straightforward with
the &lt;property&gt; element: the "name" attribute specifies
the name of the property, and the content of the element
specifies the value. If the "translatable" attribute is
set to a true value, GTK+ uses gettext() (or dgettext() if
the builder has a translation domain set) to find a translation
for the value. This happens before the value is parsed, so
it can be used for properties of any type, but it is probably
most useful for string properties. It is also possible to
specify a context to disambiguate short strings, and comments
which may help the translators.
</para>
<para>
GtkBuilder can parse textual representations for the most
common property types: characters, strings, integers, floating-point
numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are
interpreted as %TRUE, strings like "FALSE, "f", "no", "n", "0" are
interpreted as %FALSE), enumerations (can be specified by their
name, nick or integer value), flags (can be specified by their name,
nick, integer value, optionally combined with "|", e.g.
"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
gdk_color_parse()). Objects can be referred to by their name.
Pixbufs can be specified as a filename of an image file to load.
In general, GtkBuilder allows forward references to objects &mdash;
an object doesn't have to constructed before it can be referred to.
The exception to this rule is that an object has to be constructed
before it can be used as the value of a construct-only property.
</para>
<para>
Signal handlers are set up with the &lt;signal&gt; element.
The "name" attribute specifies the name of the signal, and the
"handler" attribute specifies the function to connect to the signal.
By default, GTK+ tries to find the handler using g_module_symbol(),
but this can be changed by passing a custom #GtkBuilderConnectFunc
to gtk_builder_connect_signals_full(). The remaining attributes,
"after", "swapped" and "object", have the same meaning as the
corresponding parameters of the g_signal_connect_object() or
g_signal_connect_data() functions. A "last_modification_time" attribute
is also allowed, but it does not have a meaning to the builder.
</para>
<para>
Sometimes it is necessary to refer to widgets which have implicitly
been constructed by GTK+ as part of a composite widget, to set
properties on them or to add further children (e.g. the @vbox
of a #GtkDialog). This can be achieved by setting the "internal-child"
propery of the &lt;child&gt; element to a true value. Note that
GtkBuilder still requires an &lt;object&gt; element for the internal
child, even if it has already been constructed.
</para>
<para>
A number of widgets have different places where a child can be
added (e.g. tabs vs. page content in notebooks). This can be reflected
in a UI definition by specifying the "type" attribute on a &lt;child&gt;
The possible values for the "type" attribute are described in
the sections describing the widget-specific portions of UI definitions.
</para>
<example>
<title>A GtkBuilder UI Definition</title>
<programlisting><![CDATA[
<interface>
<object class="GtkDialog" id="dialog1">
<child internal-child="vbox">
<object class="GtkVBox" id="vbox1">
<property name="border-width">10</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="border-width">20</property>
<child>
<object class="GtkButton" id="ok_button">
<property name="label">gtk-ok</property>
<property name="use-stock">TRUE</property>
<signal name="clicked" handler="ok_button_clicked"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
]]></programlisting>
</example>
<para>
Beyond this general structure, several object classes define
their own XML DTD fragments for filling in the ANY placeholders
in the DTD above. Note that a custom element in a &lt;child&gt;
element gets parsed by the custom tag handler of the parent
object, while a custom element in an &lt;object&gt; element
gets parsed by the custom tag handler of the object.
</para>
<para>
These XML fragments are explained in the documentation of the
respective objects, see
<link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
<link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
<link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
<link linkend="GtkContainer-BUILDER-UI">GtkContainer</link>,
<link linkend="GtkDialog-BUILDER-UI">GtkDialog</link>,
<link linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link>,
<link linkend="GtkColorSelectionDialog-BUILDER-UI">GtkColorSelectionDialog</link>,
<link linkend="GtkFontSelectionDialog-BUILDER-UI">GtkFontSelectionDialog</link>,
<link linkend="GtkComboBoxEntry-BUILDER-UI">GtkComboBoxEntry</link>,
<link linkend="GtkExpander-BUILDER-UI">GtkExpander</link>,
<link linkend="GtkFrame-BUILDER-UI">GtkFrame</link>,
<link linkend="GtkListStore-BUILDER-UI">GtkListStore</link>,
<link linkend="GtkTreeStore-BUILDER-UI">GtkTreeStore</link>,
<link linkend="GtkNotebook-BUILDER-UI">GtkNotebook</link>,
<link linkend="GtkSizeGroup-BUILDER-UI">GtkSizeGroup</link>,
<link linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>,
<link linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>,
<link linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>.
<link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
<link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
<link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkBuilder ##### -->
<para>
</para>
<!-- ##### ARG GtkBuilder:translation-domain ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkBuilderConnectFunc ##### -->
<para>
</para>
@builder:
@object:
@signal_name:
@handler_name:
@connect_object:
@flags:
@user_data:
<!-- ##### ENUM GtkBuilderError ##### -->
<para>
Error codes that identify various errors that can occur while
using #GtkBuilder.
</para>
@GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name
a function that returns a #GType.
@GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder
can't handle.
@GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by
#GtkBuilder was missing.
@GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that
it doesn't understand.
@GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that
it doesn't understand.
@GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was
missing.
@GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse
some attribute value.
@GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
of GTK+.
@GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
<!-- ##### FUNCTION gtk_builder_new ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gtk_builder_add_from_file ##### -->
<para>
</para>
@builder:
@filename:
@error:
@Returns:
<!-- ##### FUNCTION gtk_builder_add_from_string ##### -->
<para>
</para>
@builder:
@buffer:
@length:
@error:
@Returns:
<!-- ##### FUNCTION gtk_builder_add_objects_from_file ##### -->
<para>
</para>
@builder:
@filename:
@object_ids:
@error:
@Returns:
<!-- ##### FUNCTION gtk_builder_add_objects_from_string ##### -->
<para>
</para>
@builder:
@buffer:
@length:
@object_ids:
@error:
@Returns:
<!-- ##### FUNCTION gtk_builder_get_object ##### -->
<para>
</para>
@builder:
@name:
@Returns:
<!-- ##### FUNCTION gtk_builder_get_objects ##### -->
<para>
</para>
@builder:
@Returns:
<!-- ##### FUNCTION gtk_builder_connect_signals ##### -->
<para>
</para>
@builder:
@user_data:
<!-- ##### FUNCTION gtk_builder_connect_signals_full ##### -->
<para>
</para>
@builder:
@func:
@user_data:
<!-- ##### FUNCTION gtk_builder_set_translation_domain ##### -->
<para>
</para>
@builder:
@domain:
<!-- ##### FUNCTION gtk_builder_get_translation_domain ##### -->
<para>
</para>
@builder:
@Returns:
<!-- ##### FUNCTION gtk_builder_get_type_from_name ##### -->
<para>
</para>
@builder:
@type_name:
@Returns:
<!-- ##### FUNCTION gtk_builder_value_from_string ##### -->
<para>
</para>
@builder:
@pspec:
@string:
@value:
@error:
@Returns:
<!-- ##### FUNCTION gtk_builder_value_from_string_type ##### -->
<para>
</para>
@builder:
@type:
@string:
@value:
@error:
@Returns:
<!-- ##### MACRO GTK_BUILDER_WARN_INVALID_CHILD_TYPE ##### -->
<para>
This macro should be used to emit a warning about and unexpected
@type value in a #GtkBuildable add_child implementation.
</para>
@object: the #GtkBuildable on which the warning ocurred
@type: the unexpected type value
<!-- ##### MACRO GTK_BUILDER_ERROR ##### -->
<para>
The #GError quark for #GtkBuilder errors
</para>
+151 -144
View File
@@ -6,100 +6,107 @@ Base class for widgets which contain other widgets
<!-- ##### SECTION Long_Description ##### -->
<para>
A GTK+ user interface is constructed by nesting widgets inside widgets.
Container widgets are the inner nodes in the resulting tree of widgets:
they contain other widgets. So, for example, you might have a #GtkWindow
containing a #GtkFrame containing a GtkLabel. If you wanted an image instead
of a textual label inside the frame, you might replace the #GtkLabel widget
A GTK+ user interface is constructed by nesting widgets inside widgets.
Container widgets are the inner nodes in the resulting tree of widgets:
they contain other widgets. So, for example, you might have a #GtkWindow
containing a #GtkFrame containing a GtkLabel. If you wanted an image instead
of a textual label inside the frame, you might replace the #GtkLabel widget
with a #GtkImage widget.
</para>
<para>
There are two major kinds of container widgets in GTK+. Both are subclasses
There are two major kinds of container widgets in GTK+. Both are subclasses
of the abstract #GtkContainer base class.
</para>
<para>
The first type of container widget has a single child widget and derives
from #GtkBin. These containers are <firstterm>decorators</firstterm>, which
add some kind of functionality to the child. For example, a #GtkButton makes
its child into a clickable button; a #GtkFrame draws a frame around its child
The first type of container widget has a single child widget and derives
from #GtkBin. These containers are <firstterm>decorators</firstterm>, which
add some kind of functionality to the child. For example, a #GtkButton makes
its child into a clickable button; a #GtkFrame draws a frame around its child
and a #GtkWindow places its child widget inside a top-level window.
</para>
<para>
The second type of container can have more than one child; its purpose is to
manage <firstterm>layout</firstterm>. This means that these containers assign
sizes and positions to their children. For example, a #GtkHBox arranges its
children in a horizontal row, and a #GtkTable arranges the widgets it contains
in a two-dimensional grid.
The second type of container can have more than one child; its purpose is to
manage <firstterm>layout</firstterm>. This means that these containers assign
sizes and positions to their children. For example, a #GtkHBox arranges its
children in a horizontal row, and a #GtkTable arranges the widgets it contains
in a two-dimensional grid.
</para>
<para>
To fulfill its task, a layout container must negotiate the size requirements
with its parent and its children. This negotiation is carried out in two
phases, <firstterm>size requisition</firstterm> and <firstterm>size
allocation</firstterm>.
To fulfill its task, a layout container must negotiate the size requirements
with its parent and its children. The basic form of this negotiation is
carried out in two phases, <firstterm>size requisition</firstterm> and
<firstterm>size allocation</firstterm>, which are implemented by the
size_request() and size_allocate() virtual functions in #GtkWidget.
</para>
<para>
GTK+ also supports a more complicated form of size negotiation called
<firstterm>width-for-height</firstterm> (and its dual
<firstterm>height-for-width</firstterm>). See #GtkExtendedLayout
to learn more about width-for-height geometry management.
</para>
<refsect2 id="size-requisition"><title>Size Requisition</title>
<para>
The size requisition of a widget is it's desired width and height.
The size requisition of a widget is it's desired width and height.
This is represented by a #GtkRequisition.
</para>
<para>
How a widget determines its desired size depends on the widget.
A #GtkLabel, for example, requests enough space to display all its text.
Container widgets generally base their size request on the requisitions
of their children.
How a widget determines its desired size depends on the widget.
A #GtkLabel, for example, requests enough space to display all its text.
Container widgets generally base their size request on the requisitions
of their children.
</para>
<para>
The size requisition phase of the widget layout process operates top-down.
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
asks its child for its size requisition by calling gtk_widget_size_request().
To determine its requisition, the child asks its own children for their
requisitions and so on. Finally, the top-level widget will get a requisition
back from its child.
The size requisition phase of the widget layout process operates top-down.
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
asks its child for its size requisition by calling gtk_widget_size_request().
To determine its requisition, the child asks its own children for their
requisitions and so on. Finally, the top-level widget will get a requisition
back from its child.
</para>
</refsect2>
<refsect2 id="size-allocation"><title>Size Allocation</title>
<para>
When the top-level widget has determined how much space its child would like
to have, the second phase of the size negotiation, size allocation, begins.
Depending on its configuration (see gtk_window_set_resizable()), the top-level
widget may be able to expand in order to satisfy the size request or it may
have to ignore the size request and keep its fixed size. It then tells its
child widget how much space it gets by calling gtk_widget_size_allocate().
The child widget divides the space among its children and tells each child
how much space it got, and so on. Under normal circumstances, a #GtkWindow
When the top-level widget has determined how much space its child would like
to have, the second phase of the size negotiation, size allocation, begins.
Depending on its configuration (see gtk_window_set_resizable()), the top-level
widget may be able to expand in order to satisfy the size request or it may
have to ignore the size request and keep its fixed size. It then tells its
child widget how much space it gets by calling gtk_widget_size_allocate().
The child widget divides the space among its children and tells each child
how much space it got, and so on. Under normal circumstances, a #GtkWindow
will always give its child the amount of space the child requested.
</para>
<para>
A child's size allocation is represented by a #GtkAllocation. This struct
contains not only a width and height, but also a position (i.e. X and Y
A child's size allocation is represented by a #GtkAllocation. This struct
contains not only a width and height, but also a position (i.e. X and Y
coordinates), so that containers can tell their children not only how much
space they have gotten, but also where they are positioned inside the space
available to the container.
space they have gotten, but also where they are positioned inside the space
available to the container.
</para>
<para>
Widgets are required to honor the size allocation they receive; a size
Widgets are required to honor the size allocation they receive; a size
request is only a request, and widgets must be able to cope with any size.
</para>
</refsect2>
<refsect2 id="child-properties"><title>Child properties</title>
<para>
<structname>GtkContainer</structname> introduces <firstterm>child
<structname>GtkContainer</structname> introduces <firstterm>child
properties</firstterm> - these are object properties that are not specific
to either the container or the contained widget, but rather to their relation.
Typical examples of child properties are the position or pack-type of a widget
which is contained in a #GtkBox.</para>
<para>
Use gtk_container_class_install_child_property() to install child properties
Use gtk_container_class_install_child_property() to install child properties
for a container class and gtk_container_class_find_child_property() or
gtk_container_class_list_child_properties() to get information about existing
child properties.
</para>
<para>
To set the value of a child property, use gtk_container_child_set_property(),
gtk_container_child_set() or gtk_container_child_set_valist().
To obtain the value of a child property, use
To set the value of a child property, use gtk_container_child_set_property(),
gtk_container_child_set() or gtk_container_child_set_valist().
To obtain the value of a child property, use
gtk_container_child_get_property(), gtk_container_child_get() or
gtk_container_child_get_valist(). To emit notification about child property
gtk_container_child_get_valist(). To emit notification about child property
changes, use gtk_widget_child_notify().
</para>
</refsect2>
@@ -107,7 +114,7 @@ changes, use gtk_widget_child_notify().
<refsect2 id="GtkContainer-BUILDER-UI">
<title>GtkContainer as GtkBuildable</title>
<para>
The GtkContainer implementation of the GtkBuildable interface
The GtkContainer implementation of the GtkBuildable interface
supports a &lt;packing&gt; element for children, which can
contain multiple &lt;property&gt; elements that specify
child properties for the child.
@@ -152,7 +159,7 @@ for regular properties.
</para>
@container: the object which received the signal.
@widget:
@widget:
<!-- ##### SIGNAL GtkContainer::check-resize ##### -->
<para>
@@ -167,7 +174,7 @@ for regular properties.
</para>
@container: the object which received the signal.
@widget:
@widget:
<!-- ##### SIGNAL GtkContainer::set-focus-child ##### -->
<para>
@@ -175,7 +182,7 @@ for regular properties.
</para>
@container: the object which received the signal.
@widget:
@widget:
<!-- ##### ARG GtkContainer:border-width ##### -->
<para>
@@ -197,7 +204,7 @@ for regular properties.
</para>
@widget:
@widget:
<!-- ##### MACRO GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID ##### -->
@@ -206,7 +213,7 @@ This macro should be used to emit a standard warning about unexpected
properties in set_child_property() and get_child_property() implementations.
</para>
@object: the #GObject on which set_child_property() or get_child_property()
@object: the #GObject on which set_child_property() or get_child_property()
was called
@property_id: the numeric id of the property
@pspec: the #GParamSpec of the property
@@ -225,8 +232,8 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@widget:
@container:
@widget:
<!-- ##### FUNCTION gtk_container_remove ##### -->
@@ -234,8 +241,8 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@widget:
@container:
@widget:
<!-- ##### FUNCTION gtk_container_add_with_properties ##### -->
@@ -243,10 +250,10 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@widget:
@first_prop_name:
@Varargs:
@container:
@widget:
@first_prop_name:
@Varargs:
<!-- ##### FUNCTION gtk_container_get_resize_mode ##### -->
@@ -254,8 +261,8 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_resize_mode ##### -->
@@ -263,8 +270,8 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@resize_mode:
@container:
@resize_mode:
<!-- ##### FUNCTION gtk_container_check_resize ##### -->
@@ -272,7 +279,7 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@container:
<!-- ##### FUNCTION gtk_container_foreach ##### -->
@@ -280,9 +287,9 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@callback:
@callback_data:
@container:
@callback:
@callback_data:
<!-- ##### FUNCTION gtk_container_foreach_full ##### -->
@@ -290,11 +297,11 @@ Does the same as gtk_container_set_border_width().
</para>
@container:
@callback:
@marshal:
@callback_data:
@notify:
@container:
@callback:
@marshal:
@callback_data:
@notify:
@Deprecated: Use gtk_container_foreach() instead.
@@ -311,8 +318,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_reallocate_redraws ##### -->
@@ -320,8 +327,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@needs_redraws:
@container:
@needs_redraws:
<!-- ##### FUNCTION gtk_container_get_focus_child ##### -->
@@ -329,8 +336,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_focus_child ##### -->
@@ -338,8 +345,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@container:
@child:
<!-- ##### FUNCTION gtk_container_get_focus_vadjustment ##### -->
@@ -347,8 +354,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_focus_vadjustment ##### -->
@@ -356,8 +363,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@adjustment:
@container:
@adjustment:
<!-- ##### FUNCTION gtk_container_get_focus_hadjustment ##### -->
@@ -365,8 +372,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_focus_hadjustment ##### -->
@@ -374,8 +381,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@adjustment:
@container:
@adjustment:
<!-- ##### FUNCTION gtk_container_resize_children ##### -->
@@ -383,7 +390,7 @@ Does the same as gtk_container_get_children().
</para>
@container:
@container:
<!-- ##### FUNCTION gtk_container_child_type ##### -->
@@ -391,8 +398,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_child_get ##### -->
@@ -400,10 +407,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@first_prop_name:
@Varargs:
@container:
@child:
@first_prop_name:
@Varargs:
<!-- ##### FUNCTION gtk_container_child_set ##### -->
@@ -411,10 +418,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@first_prop_name:
@Varargs:
@container:
@child:
@first_prop_name:
@Varargs:
<!-- ##### FUNCTION gtk_container_child_get_property ##### -->
@@ -422,10 +429,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@property_name:
@value:
@container:
@child:
@property_name:
@value:
<!-- ##### FUNCTION gtk_container_child_set_property ##### -->
@@ -433,10 +440,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@property_name:
@value:
@container:
@child:
@property_name:
@value:
<!-- ##### FUNCTION gtk_container_child_get_valist ##### -->
@@ -444,10 +451,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@first_property_name:
@var_args:
@container:
@child:
@first_property_name:
@var_args:
<!-- ##### FUNCTION gtk_container_child_set_valist ##### -->
@@ -455,10 +462,10 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@first_property_name:
@var_args:
@container:
@child:
@first_property_name:
@var_args:
<!-- ##### FUNCTION gtk_container_forall ##### -->
@@ -466,9 +473,9 @@ Does the same as gtk_container_get_children().
</para>
@container:
@callback:
@callback_data:
@container:
@callback:
@callback_data:
<!-- ##### FUNCTION gtk_container_get_border_width ##### -->
@@ -476,8 +483,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@Returns:
@container:
@Returns:
<!-- ##### FUNCTION gtk_container_set_border_width ##### -->
@@ -485,8 +492,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@border_width:
@container:
@border_width:
<!-- ##### FUNCTION gtk_container_propagate_expose ##### -->
@@ -494,9 +501,9 @@ Does the same as gtk_container_get_children().
</para>
@container:
@child:
@event:
@container:
@child:
@event:
<!-- ##### FUNCTION gtk_container_get_focus_chain ##### -->
@@ -504,9 +511,9 @@ Does the same as gtk_container_get_children().
</para>
@container:
@focusable_widgets:
@Returns:
@container:
@focusable_widgets:
@Returns:
<!-- ##### FUNCTION gtk_container_set_focus_chain ##### -->
@@ -514,8 +521,8 @@ Does the same as gtk_container_get_children().
</para>
@container:
@focusable_widgets:
@container:
@focusable_widgets:
<!-- ##### FUNCTION gtk_container_unset_focus_chain ##### -->
@@ -523,7 +530,7 @@ Does the same as gtk_container_get_children().
</para>
@container:
@container:
<!-- ##### FUNCTION gtk_container_class_find_child_property ##### -->
@@ -531,9 +538,9 @@ Does the same as gtk_container_get_children().
</para>
@cclass:
@property_name:
@Returns:
@cclass:
@property_name:
@Returns:
<!-- ##### FUNCTION gtk_container_class_install_child_property ##### -->
@@ -541,9 +548,9 @@ Does the same as gtk_container_get_children().
</para>
@cclass:
@property_id:
@pspec:
@cclass:
@property_id:
@pspec:
<!-- ##### FUNCTION gtk_container_class_list_child_properties ##### -->
@@ -551,8 +558,8 @@ Does the same as gtk_container_get_children().
</para>
@cclass:
@n_properties:
@Returns:
@cclass:
@n_properties:
@Returns:
+16 -4
View File
@@ -141,7 +141,7 @@ the clipboard. Only labels that contain useful-to-copy information
</para>
</refsect2>
<refsect2>
<refsect2 id="label-text-layout">
<title>Text layout</title>
<para>
@@ -155,11 +155,23 @@ Labels can automatically wrap text if you call
gtk_label_set_line_wrap().
</para>
<para>
gtk_label_set_justify() sets how the lines in a label align
with one another. If you want to set how the label as a whole
gtk_label_set_justify() sets how the lines in a label align
with one another. If you want to set how the label as a whole
aligns in its available space, see gtk_misc_set_alignment().
</para>
<para>
The #GtkLabel:width-chars and #GtkLabel:max-width-chars properties
can be used to control the size allocation of ellipsized or wrapped
labels. For ellipsizing labels, if either is specified (and less
than the actual text size), it is used as the minimum width, and the actual
text size is used as the natural width of the label. For wrapping labels,
width-chars is used as the minimum width, if specified, and max-width-chars
is used as the natural width. Even if max-width-chars specified, wrapping
labels will be rewrapped to use all of the available width.
</para>
<note><para>Note that the interpretation of #GtkLabel:width-chars and
#GtkLabel:max-width-chars has changed a bit with the introduction of
width-for-height geometry management and #GtkExtendedLayout.</para></note>
</refsect2>
<refsect2>
+10
View File
@@ -412,6 +412,16 @@ compatibility reasons.
@Returns:
<!-- ##### FUNCTION gtk_tree_path_get_indices_with_depth ##### -->
<para>
</para>
@path:
@depth:
@Returns:
<!-- ##### FUNCTION gtk_tree_path_free ##### -->
<para>
+2 -3
View File
@@ -4,11 +4,10 @@ CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED
scribble-xinput: scribble-xinput.c
$(CC) scribble-xinput.c -o scribble-xinput $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` scribble-xinput.c -o scribble-xinput $(LDFLAGS) `pkg-config --libs gtk+-2.0`
clean:
rm -f *.o scribble-xinput
+5 -1
View File
@@ -221,9 +221,13 @@ gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader,
gint width,
gint height)
{
GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
GdkPixbufLoaderPrivate *priv;
g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader));
g_return_if_fail (width >= 0 && height >= 0);
priv = GDK_PIXBUF_LOADER (loader)->priv;
if (!priv->size_fixed)
{
priv->width = width;
+6
View File
@@ -212,6 +212,7 @@ gtk_public_h_sources = \
gtkenums.h \
gtkeventbox.h \
gtkexpander.h \
gtkextendedlayout.h \
gtkfilechooser.h \
gtkfilechooserbutton.h \
gtkfilechooserdialog.h \
@@ -251,6 +252,8 @@ gtk_public_h_sources = \
gtkmenu.h \
gtkmenubar.h \
gtkmenuitem.h \
gtkmenuproxy.h \
gtkmenuproxymodule.h \
gtkmenushell.h \
gtkmenutoolbutton.h \
gtkmessagedialog.h \
@@ -466,6 +469,7 @@ gtk_base_c_sources = \
gtkentrycompletion.c \
gtkeventbox.c \
gtkexpander.c \
gtkextendedlayout.c \
gtkfilechooser.c \
gtkfilechooserbutton.c \
gtkfilechooserdefault.c \
@@ -518,6 +522,8 @@ gtk_base_c_sources = \
gtkmenu.c \
gtkmenubar.c \
gtkmenuitem.c \
gtkmenuproxy.c \
gtkmenuproxymodule.c \
gtkmenushell.c \
gtkmenutoolbutton.c \
gtkmessagedialog.c \
+3
View File
@@ -65,6 +65,8 @@
#include <gtk/gtkcellview.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkmenuproxy.h>
#include <gtk/gtkmenuproxymodule.h>
#include <gtk/gtkclipboard.h>
#include <gtk/gtkcolorbutton.h>
#include <gtk/gtkcolorsel.h>
@@ -83,6 +85,7 @@
#include <gtk/gtkenums.h>
#include <gtk/gtkeventbox.h>
#include <gtk/gtkexpander.h>
#include <gtk/gtkextendedlayout.h>
#include <gtk/gtkfixed.h>
#include <gtk/gtkfilechooser.h>
#include <gtk/gtkfilechooserbutton.h>
+15
View File
@@ -1504,6 +1504,18 @@ gtk_expander_set_use_underline
#endif
#endif
#if IN_HEADER(__GTK_EXTENDED_LAYOUT_H__)
#if IN_FILE(__GTK_EXTENDED_LAYOUT_C__)
gtk_extended_layout_get_type G_GNUC_CONST
gtk_extended_layout_get_desired_height
gtk_extended_layout_get_desired_size
gtk_extended_layout_get_desired_width
gtk_extended_layout_get_height_for_width
gtk_extended_layout_get_width_for_height
gtk_extended_layout_is_height_for_width
#endif
#endif
#if IN_HEADER(__GTK_FILE_CHOOSER_H__)
#if IN_FILE(__GTK_FILE_CHOOSER_C__)
gtk_file_chooser_add_filter
@@ -1965,6 +1977,7 @@ gtk_icon_info_get_filename_utf8
#endif
gtk_icon_info_get_type G_GNUC_CONST
gtk_icon_info_load_icon
gtk_icon_info_load_symbolic
gtk_icon_info_set_raw_coordinates
gtk_icon_theme_add_builtin_icon
#ifndef _WIN64
@@ -4658,6 +4671,7 @@ gtk_tree_path_down
gtk_tree_path_free
gtk_tree_path_get_depth
gtk_tree_path_get_indices
gtk_tree_path_get_indices_with_depth
gtk_tree_path_get_type G_GNUC_CONST
gtk_tree_path_is_ancestor
gtk_tree_path_is_descendant
@@ -5169,6 +5183,7 @@ gtk_widget_modify_cursor
gtk_widget_modify_font
gtk_widget_modify_style
gtk_widget_modify_text
gtk_widget_modify_symbolic_color
gtk_widget_new
gtk_widget_path
gtk_widget_pop_colormap
+112 -40
View File
@@ -45,6 +45,7 @@
#include "config.h"
#include "gtkalignment.h"
#include "gtkextendedlayout.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
@@ -73,8 +74,6 @@ struct _GtkAlignmentPrivate
guint padding_right;
};
static void gtk_alignment_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_alignment_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_alignment_set_property (GObject *object,
@@ -86,7 +85,17 @@ static void gtk_alignment_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN)
static void gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_alignment_extended_layout_init))
static void
gtk_alignment_class_init (GtkAlignmentClass *class)
@@ -100,7 +109,6 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
gobject_class->set_property = gtk_alignment_set_property;
gobject_class->get_property = gtk_alignment_get_property;
widget_class->size_request = gtk_alignment_size_request;
widget_class->size_allocate = gtk_alignment_size_allocate;
g_object_class_install_property (gobject_class,
@@ -462,34 +470,6 @@ gtk_alignment_set (GtkAlignment *alignment,
}
static void
gtk_alignment_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkBin *bin;
GtkAlignmentPrivate *priv;
bin = GTK_BIN (widget);
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
requisition->width = GTK_CONTAINER (widget)->border_width * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
/* Request extra space for the padding: */
requisition->width += (priv->padding_left + priv->padding_right);
requisition->height += (priv->padding_top + priv->padding_bottom);
}
}
static void
gtk_alignment_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -497,7 +477,6 @@ gtk_alignment_size_allocate (GtkWidget *widget,
GtkAlignment *alignment;
GtkBin *bin;
GtkAllocation child_allocation;
GtkRequisition child_requisition;
gint width, height;
gint border_width;
gint padding_horizontal, padding_vertical;
@@ -512,7 +491,10 @@ gtk_alignment_size_allocate (GtkWidget *widget,
if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_get_child_requisition (bin->child, &child_requisition);
GtkExtendedLayout *layout = GTK_EXTENDED_LAYOUT (bin->child);
gint child_nat_width;
gint child_nat_height;
gint child_width, child_height;
border_width = GTK_CONTAINER (alignment)->border_width;
@@ -522,16 +504,37 @@ gtk_alignment_size_allocate (GtkWidget *widget,
width = MAX (1, allocation->width - padding_horizontal - 2 * border_width);
height = MAX (1, allocation->height - padding_vertical - 2 * border_width);
if (width > child_requisition.width)
child_allocation.width = (child_requisition.width *
if (gtk_extended_layout_is_height_for_width (layout))
{
gtk_extended_layout_get_desired_width (layout, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
gtk_extended_layout_get_height_for_width (layout, child_width, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
}
else
{
gtk_extended_layout_get_desired_height (layout, NULL, &child_nat_height);
child_height = MIN (height, child_nat_height);
gtk_extended_layout_get_width_for_height (layout, child_height, NULL, &child_nat_width);
child_width = MIN (width, child_nat_width);
}
if (width > child_width)
child_allocation.width = (child_width *
(1.0 - alignment->xscale) +
width * alignment->xscale);
else
child_allocation.width = width;
if (height > child_requisition.height)
child_allocation.height = (child_requisition.height *
if (height > child_height)
child_allocation.height = (child_height *
(1.0 - alignment->yscale) +
height * alignment->yscale);
else
@@ -548,6 +551,75 @@ gtk_alignment_size_allocate (GtkWidget *widget,
}
}
static void
gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_alignment_get_desired_width;
iface->get_desired_height = gtk_alignment_get_desired_height;
}
static void
gtk_alignment_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkWidget *child;
GtkAlignmentPrivate *priv;
gint minimum, natural;
priv = GTK_ALIGNMENT_GET_PRIVATE (layout);
natural = minimum = GTK_CONTAINER (layout)->border_width * 2;
if ((child = gtk_bin_get_child (GTK_BIN (layout))) && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
/* Request extra space for the padding: */
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum += (priv->padding_left + priv->padding_right);
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
}
else
{
minimum += (priv->padding_top + priv->padding_bottom);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
}
natural = minimum;
minimum += child_min;
natural += child_nat;
}
if (minimum_size)
*minimum_size = minimum;
if (natural_size)
*natural_size = natural;
}
static void
gtk_alignment_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_alignment_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
/**
* gtk_alignment_set_padding:
* @alignment: a #GtkAlignment
+10 -5
View File
@@ -1167,13 +1167,14 @@ gtk_assistant_size_request (GtkWidget *widget,
requisition->height = height;
}
static void
gtk_assistant_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkAssistant *assistant = GTK_ASSISTANT (widget);
GtkAssistantPrivate *priv = assistant->priv;
GtkRequisition header_requisition;
GtkRequisition header_requisition, action_requisition, sidebar_requisition;
GtkAllocation child_allocation, header_allocation;
gint header_padding, content_padding;
gboolean rtl;
@@ -1200,24 +1201,28 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (priv->header_image, &header_allocation);
/* Action area */
gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
child_allocation.x = GTK_CONTAINER (widget)->border_width;
child_allocation.y = allocation->height -
GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height;
GTK_CONTAINER (widget)->border_width - action_requisition.height;
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
child_allocation.height = priv->action_area->requisition.height;
child_allocation.height = action_requisition.height;
gtk_widget_size_allocate (priv->action_area, &child_allocation);
/* Sidebar */
gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
if (rtl)
child_allocation.x = allocation->width -
GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width;
GTK_CONTAINER (widget)->border_width - sidebar_requisition.width;
else
child_allocation.x = GTK_CONTAINER (widget)->border_width;
child_allocation.y = GTK_CONTAINER (widget)->border_width +
priv->header_image->allocation.height + 2 * header_padding;
child_allocation.width = priv->sidebar_image->requisition.width;
child_allocation.width = sidebar_requisition.width;
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
priv->header_image->allocation.height - 2 * header_padding - priv->action_area->allocation.height;
+96
View File
@@ -24,6 +24,34 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/**
* SECTION:gtkbbox
* @Short_description: Base class for GtkHButtonBox and GtkVButtonBox
* @Title: GtkButtonBox
* @See_also: #GtkVButtonBox, #GtkHButtonBox
*
* The primary purpose of this class is to keep track of the various properties
* of #GtkHButtonBox and #GtkVButtonBox widgets.
*
* gtk_button_box_get_child_size() retrieves the minimum width and height
* for widgets in a given button box.
*
* The internal padding of buttons can be retrieved and changed per button box
* using gtk_button_box_get_child_ipadding() and
* gtk_button_box_set_child_ipadding() respectively.
*
* gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and
* change default number of pixels between buttons, respectively.
*
* gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and
* alter the method used to spread the buttons in a button box across the
* container, respectively.
*
* The main purpose of GtkButtonBox is to make sure the children have all the
* same size. Therefore it ignores the homogeneous property which it inherited
* from GtkBox, and always behaves as if homogeneous was %TRUE.
*/
#include "config.h"
#include "gtkbbox.h"
#include "gtkhbbox.h"
@@ -236,6 +264,21 @@ gtk_button_box_get_child_property (GtkContainer *container,
/* set per widget values for spacing, child size and child internal padding */
/**
* gtk_button_box_set_child_size:
* @widget: a #GtkButtonBox
* @min_width: a default width for buttons in @widget
* @min_height: a default height for buttons in @widget
*
* Sets a new default size for the children of a given button box.
*
* Deprecated: This is not supported anymore and can only be set through the
* theme changing the style properties:
* "<link linkend="GtkButtonBox--s-child-min-width">child-min-width</link>"
* and
* "<link linkend="GtkButtonBox--s-child-min-height">child-min-height</link>"
* instead.
*/
void
gtk_button_box_set_child_size (GtkButtonBox *widget,
gint width, gint height)
@@ -246,6 +289,18 @@ gtk_button_box_set_child_size (GtkButtonBox *widget,
widget->child_min_height = height;
}
/**
* gtk_button_box_set_child_ipadding:
* @widget: a #GtkButtonBox
* @ipad_x: the horizontal padding that should be used by each button in @widget
* @ipad_y: the vertical padding that should be used by each button in @widget
*
* Changes the amount of internal padding used by all buttons in a given button
* box.
*
* Deprecated: Use the style properties
* <literal>"child-internal-pad-x/-y"</literal> instead.
*/
void
gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
gint ipad_x, gint ipad_y)
@@ -256,6 +311,13 @@ gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
widget->child_ipad_y = ipad_y;
}
/**
* gtk_button_box_set_layout:
* @widget: a #GtkButtonBox
* @layout_style: the new layout style
*
* Changes the way buttons are arranged in their container.
*/
void
gtk_button_box_set_layout (GtkButtonBox *widget,
GtkButtonBoxStyle layout_style)
@@ -275,6 +337,18 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
/* get per widget values for spacing, child size and child internal padding */
/**
* gtk_button_box_get_child_size:
* @widget: a #GtkButtonBox
* @min_width: the width of the buttons contained by @widget
* @min_height: the height of the buttons contained by @widget
*
* Retrieves the current width and height of all child widgets in a button box.
* @min_width and @min_height are filled with those values, respectively.
*
* Deprecated: Use the style properties
* <literal>"child-min-width/-height"</literal> instead.
*/
void
gtk_button_box_get_child_size (GtkButtonBox *widget,
gint *width, gint *height)
@@ -287,6 +361,20 @@ gtk_button_box_get_child_size (GtkButtonBox *widget,
*height = widget->child_min_height;
}
/**
* gtk_button_box_get_child_ipadding:
* @widget: a #GtkButtonBox
* @ipad_x: the horizontal padding used by buttons in @widget
* @ipad_y: the vertical padding used by buttons in @widget
*
* Gets the default number of pixels that pad the buttons in a given button box.
*
* Deprecated: Use the style properties
* "<link linkend="GtkButtonBox--s-child-internal-pad-x">child-internal-pad-x</link>"
* and
* "<link linkend="GtkButtonBox--s-child-internal-pad-y">child-internal-pad-y</link>"
* instead.
*/
void
gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
gint* ipad_x, gint *ipad_y)
@@ -299,6 +387,14 @@ gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
*ipad_y = widget->child_ipad_y;
}
/**
* gtk_button_box_get_layout:
* @widget: a #GtkButtonBox
*
* Retrieves the method being used to arrange the buttons in a button box.
*
* Returns: the method used to layout buttons in @widget.
*/
GtkButtonBoxStyle
gtk_button_box_get_layout (GtkButtonBox *widget)
{
+19
View File
@@ -77,7 +77,26 @@ void gtk_button_box_set_child_secondary (GtkButtonBox *widget,
gboolean is_secondary);
#ifndef GTK_DISABLE_DEPRECATED
/**
* gtk_button_box_set_spacing:
* @b: a #GtkButtonBox
* @s: the number of pixels of spacing
*
* Sets the amount of spacing between buttons in a given button box.
*
* Deprecated: Use gtk_box_set_spacing() instead.
*/
#define gtk_button_box_set_spacing(b,s) gtk_box_set_spacing (GTK_BOX (b), s)
/**
* gtk_button_box_get_spacing:
* @b: a #GtkButtonBox
*
* Retrieves how much space a button box is placing between each child button.
*
* Deprecated: Use gtk_box_get_spacing() instead.
* Returns: the current spacing applied to the buttons in @widget
*/
#define gtk_button_box_get_spacing(b) gtk_box_get_spacing (GTK_BOX (b))
void gtk_button_box_set_child_size (GtkButtonBox *widget,
+120 -1
View File
@@ -39,6 +39,7 @@
#include "config.h"
#include "gtkbin.h"
#include "gtkextendedlayout.h"
#include "gtkintl.h"
#include "gtkalias.h"
@@ -53,7 +54,22 @@ static void gtk_bin_forall (GtkContainer *container,
static GType gtk_bin_child_type (GtkContainer *container);
G_DEFINE_ABSTRACT_TYPE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
static void gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface);
static gboolean gtk_bin_is_height_for_width (GtkExtendedLayout *layout);
static void gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width);
static void gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
static GtkExtendedLayoutIface *parent_extended_layout_iface;
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_bin_extended_layout_init))
static void
gtk_bin_class_init (GtkBinClass *class)
@@ -141,6 +157,109 @@ gtk_bin_forall (GtkContainer *container,
(* callback) (bin->child, callback_data);
}
/* GtkBin widgets define the padding and borders independantly so
* we cannot provide a generic get_desired_size() for the same reason
* we never implemented size_request() here.
*
* But for cases where the GtkBin class's padding is constant and
* does not vary based on allocation (most cases), we can at least
* deduce a common code path for the get_width_for_height()/get_height_for_width()
* cases by using the delta of the base size requsts.
*/
static void
gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface)
{
parent_extended_layout_iface = g_type_interface_peek_parent (iface);
iface->is_height_for_width = gtk_bin_is_height_for_width;
iface->get_width_for_height = gtk_bin_get_width_for_height;
iface->get_height_for_width = gtk_bin_get_height_for_width;
}
static gboolean
gtk_bin_is_height_for_width (GtkExtendedLayout *layout)
{
GtkBin *bin = GTK_BIN (layout);
if (bin->child)
return gtk_extended_layout_is_height_for_width (GTK_EXTENDED_LAYOUT (bin->child));
return TRUE;
}
static void
get_child_padding_delta (GtkBin *bin,
gint *delta_h,
gint *delta_v)
{
gint hmin, vmin, child_hmin, child_vmin;
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin), &hmin, NULL);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin), &vmin, NULL);
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), &child_hmin, NULL);
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), &child_vmin, NULL);
*delta_h = hmin - child_hmin;
*delta_v = vmin - child_vmin;
}
static void
gtk_bin_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
{
GtkBin *bin = GTK_BIN (layout);
gint hdelta, vdelta, child_min, child_nat;
if (bin->child)
{
get_child_padding_delta (bin, &hdelta, &vdelta);
gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child),
height - vdelta,
&child_min, &child_nat);
if (minimum_width)
*minimum_width = child_min + hdelta;
if (natural_width)
*natural_width = child_nat + hdelta;
}
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
}
static void
gtk_bin_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
{
GtkBin *bin = GTK_BIN (layout);
gint hdelta, vdelta, child_min, child_nat;
if (bin->child)
{
get_child_padding_delta (bin, &hdelta, &vdelta);
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
width - hdelta,
&child_min, &child_nat);
if (minimum_height)
*minimum_height = child_min + vdelta;
if (natural_height)
*natural_height = child_nat + vdelta;
}
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
}
/**
* gtk_bin_get_child:
* @bin: a #GtkBin
+773 -293
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -65,6 +65,28 @@ struct _GtkBoxClass
GtkContainerClass parent_class;
};
/**
* GtkBoxChild:
* @widget: the child widget, packed into the GtkBox.
* @padding: the number of extra pixels to put between this child and its
* neighbors, set when packed, zero by default.
* @expand: flag indicates whether extra space should be given to this child.
* Any extra space given to the parent GtkBox is divided up among all children
* with this attribute set to %TRUE; set when packed, %TRUE by default.
* @fill: flag indicates whether any extra space given to this child due to its
* @expand attribute being set is actually allocated to the child, rather than
* being used as padding around the widget; set when packed, %TRUE by default.
* @pack: one of #GtkPackType indicating whether the child is packed with
* reference to the start (top/left) or end (bottom/right) of the GtkBox.
* @is_secondary: %TRUE if the child is secondary
*
* The #GtkBoxChild holds a child widget of #GtkBox and describes how the child
* is to be packed into the #GtkBox. All fields of this #GtkBoxChild should be
* considered read-only and they should never be set directly by an application.
* Use gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
* and set the #GtkBoxChild.padding, #GtkBoxChild.expand, #GtkBoxChild.fill and
* #GtkBoxChild.pack fields.
*/
struct _GtkBoxChild
{
GtkWidget *widget;
+218
View File
@@ -20,6 +20,224 @@
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION:gtkbuilder
* @Short_description: Build an interface from an XML UI definition
* @Title: GtkBuilder
*
* A GtkBuilder is an auxiliary object that reads textual descriptions
* of a user interface and instantiates the described objects. To pass a
* description to a GtkBuilder, call gtk_builder_add_from_file() or
* gtk_builder_add_from_string(). These functions can be called multiple
* times; the builder merges the content of all descriptions.
*
* A GtkBuilder holds a reference to all objects that it has constructed
* and drops these references when it is finalized. This finalization can
* cause the destruction of non-widget objects or widgets which are not
* contained in a toplevel window. For toplevel windows constructed by a
* builder, it is the responsibility of the user to call gtk_widget_destroy()
* to get rid of them and all the widgets they contain.
*
* The functions gtk_builder_get_object() and gtk_builder_get_objects()
* can be used to access the widgets in the interface by the names assigned
* to them inside the UI description. Toplevel windows returned by these
* functions will stay around until the user explicitly destroys them
* with gtk_widget_destroy(). Other widgets will either be part of a
* larger hierarchy constructed by the builder (in which case you should
* not have to worry about their lifecycle), or without a parent, in which
* case they have to be added to some container to make use of them.
* Non-widget objects need to be reffed with g_object_ref() to keep them
* beyond the lifespan of the builder.
*
* The function gtk_builder_connect_signals() and variants thereof can be
* used to connect handlers to the named signals in the description.
*
* <refsect2 id="BUILDER-UI">
* <title>GtkBuilder UI Definitions</title>
* <para>
* GtkBuilder parses textual descriptions of user interfaces which are specified
* in an XML format which can be roughly described by the DTD below. We refer to
* these descriptions as <firstterm>GtkBuilder UI definitions</firstterm> or
* just <firstterm>UI definitions</firstterm> if the context is clear. Do not
* confuse GtkBuilder UI Definitions with
* <link linkend="XML-UI">GtkUIManager UI Definitions</link>, which are more
* limited in scope.
* </para>
* <programlisting><![CDATA[
* <!ELEMENT interface (requires|object)* >
* <!ELEMENT object (property|signal|child|ANY)* >
* <!ELEMENT property PCDATA >
* <!ELEMENT signal EMPTY >
* <!ELEMENT requires EMPTY >
* <!ELEMENT child (object|ANY*) >
*
* <!ATTLIST interface domain #IMPLIED >
* <!ATTLIST object id #REQUIRED
* class #REQUIRED
* type-func #IMPLIED
* constructor #IMPLIED >
* <!ATTLIST requires lib #REQUIRED
* version #REQUIRED >
* <!ATTLIST property name #REQUIRED
* translatable #IMPLIED
* comments #IMPLIED
* context #IMPLIED >
* <!ATTLIST signal name #REQUIRED
* handler #REQUIRED
* after #IMPLIED
* swapped #IMPLIED
* object #IMPLIED
* last_modification_time #IMPLIED >
* <!ATTLIST child type #IMPLIED
* internal-child #IMPLIED >
* ]]></programlisting>
* <para>
* The toplevel element is &lt;interface&gt;. It optionally takes a "domain"
* attribute, which will make the builder look for translated strings using
* dgettext() in the domain specified. This can also be done by calling
* gtk_builder_set_translation_domain() on the builder. Objects are described by
* &lt;object&gt; elements, which can contain &lt;property&gt; elements to set
* properties, &lt;signal&gt; elements which connect signals to handlers, and
* &lt;child&gt; elements, which describe child objects (most often widgets
* inside a container, but also e.g. actions in an action group, or columns in a
* tree model). A &lt;child&gt; element contains an &lt;object&gt; element which
* describes the child object. The target toolkit version(s) are described by
* &lt;requires&gt; elements, the "lib" attribute specifies the widget library
* in question (currently the only supported value is "gtk+") and the "version"
* attribute specifies the target version in the form
* "&lt;major&gt;.&lt;minor&gt;". The builder will error out if the version
* requirements are not met.
*
* Typically, the specific kind of object represented by an &lt;object&gt;
* element is specified by the "class" attribute. If the type has not been
* loaded yet, GTK+ tries to find the <function>_get_type()</function> from the
* class name by applying heuristics. This works in most cases, but if
* necessary, it is possible to specify the name of the
* <function>_get_type()</function> explictly with the "type-func" attribute.
* As a special case, GtkBuilder allows to use an object that has been
* constructed by a #GtkUIManager in another part of the UI definition by
* specifying the id of the #GtkUIManager in the "constructor" attribute and the
* name of the object in the "id" attribute.
*
* Objects must be given a name with the "id" attribute, which allows the
* application to retrieve them from the builder with gtk_builder_get_object().
* An id is also necessary to use the object as property value in other parts of
* the UI definition.
* </para>
* <note><para>
* Prior to 2.20, GtkBuilder was setting the "name" property of constructed widgets to the
* "id" attribute. In GTK+ 2.20 or newer, you have to use gtk_buildable_get_name() instead
* of gtk_widget_get_name() to obtain the "id", or set the "name" property in your UI
* definition.
* </para></note>
* <para>
* Setting properties of objects is pretty straightforward with the
* &lt;property&gt; element: the "name" attribute specifies the name of the
* property, and the content of the element specifies the value. If the
* "translatable" attribute is set to a true value, GTK+ uses gettext() (or
* dgettext() if the builder has a translation domain set) to find a translation
* for the value. This happens before the value is parsed, so it can be used for
* properties of any type, but it is probably most useful for string properties.
* It is also possible to specify a context to disambiguate short strings, and
* comments which may help the translators.
*
* GtkBuilder can parse textual representations for the most common property
* types: characters, strings, integers, floating-point numbers, booleans
* (strings like "TRUE", "t", "yes", "y", "1" are interpreted as %TRUE, strings
* like "FALSE, "f", "no", "n", "0" are interpreted as %FALSE), enumerations
* (can be specified by their name, nick or integer value), flags (can be
* specified by their name, nick, integer value, optionally combined with "|",
* e.g. "GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by
* gdk_color_parse()). Objects can be referred to by their name. Pixbufs can be
* specified as a filename of an image file to load. In general, GtkBuilder
* allows forward references to objects &mdash; an object doesn't have to be
* constructed before it can be referred to. The exception to this rule is that
* an object has to be constructed before it can be used as the value of a
* construct-only property.
*
* Signal handlers are set up with the &lt;signal&gt; element. The "name"
* attribute specifies the name of the signal, and the "handler" attribute
* specifies the function to connect to the signal. By default, GTK+ tries to
* find the handler using g_module_symbol(), but this can be changed by passing
* a custom #GtkBuilderConnectFunc to gtk_builder_connect_signals_full(). The
* remaining attributes, "after", "swapped" and "object", have the same meaning
* as the corresponding parameters of the g_signal_connect_object() or
* g_signal_connect_data() functions. A "last_modification_time" attribute
* is also allowed, but it does not have a meaning to the builder.
*
* Sometimes it is necessary to refer to widgets which have implicitly been
* constructed by GTK+ as part of a composite widget, to set properties on them
* or to add further children (e.g. the @vbox of a #GtkDialog). This can be
* achieved by setting the "internal-child" propery of the &lt;child&gt; element
* to a true value. Note that GtkBuilder still requires an &lt;object&gt;
* element for the internal child, even if it has already been constructed.
*
* A number of widgets have different places where a child can be added (e.g.
* tabs vs. page content in notebooks). This can be reflected in a UI definition
* by specifying the "type" attribute on a &lt;child&gt;. The possible values
* for the "type" attribute are described in the sections describing the
* widget-specific portions of UI definitions.
* </para>
* <example>
* <title>A GtkBuilder UI Definition</title>
* <programlisting><![CDATA[
* <interface>
* <object class="GtkDialog" id="dialog1">
* <child internal-child="vbox">
* <object class="GtkVBox" id="vbox1">
* <property name="border-width">10</property>
* <child internal-child="action_area">
* <object class="GtkHButtonBox" id="hbuttonbox1">
* <property name="border-width">20</property>
* <child>
* <object class="GtkButton" id="ok_button">
* <property name="label">gtk-ok</property>
* <property name="use-stock">TRUE</property>
* <signal name="clicked" handler="ok_button_clicked"/>
* </object>
* </child>
* </object>
* </child>
* </object>
* </child>
* </object>
* </interface>
* ]]></programlisting>
* </example>
* <para>
* Beyond this general structure, several object classes define their own XML
* DTD fragments for filling in the ANY placeholders in the DTD above. Note that
* a custom element in a &lt;child&gt; element gets parsed by the custom tag
* handler of the parent object, while a custom element in an &lt;object&gt;
* element gets parsed by the custom tag handler of the object.
*
* These XML fragments are explained in the documentation of the respective
* objects, see
* <link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
* <link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
* <link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
* <link linkend="GtkContainer-BUILDER-UI">GtkContainer</link>,
* <link linkend="GtkDialog-BUILDER-UI">GtkDialog</link>,
* <link linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link>,
* <link linkend="GtkColorSelectionDialog-BUILDER-UI">GtkColorSelectionDialog</link>,
* <link linkend="GtkFontSelectionDialog-BUILDER-UI">GtkFontSelectionDialog</link>,
* <link linkend="GtkComboBoxEntry-BUILDER-UI">GtkComboBoxEntry</link>,
* <link linkend="GtkExpander-BUILDER-UI">GtkExpander</link>,
* <link linkend="GtkFrame-BUILDER-UI">GtkFrame</link>,
* <link linkend="GtkListStore-BUILDER-UI">GtkListStore</link>,
* <link linkend="GtkTreeStore-BUILDER-UI">GtkTreeStore</link>,
* <link linkend="GtkNotebook-BUILDER-UI">GtkNotebook</link>,
* <link linkend="GtkSizeGroup-BUILDER-UI">GtkSizeGroup</link>,
* <link linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>,
* <link linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>,
* <link linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>.
* <link linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
* <link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
* <link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
* </para>
* </refsect2>
*/
#include "config.h"
#include <errno.h> /* errno */
#include <stdlib.h> /* strtol, strtoul */
+31
View File
@@ -43,6 +43,29 @@ typedef struct _GtkBuilder GtkBuilder;
typedef struct _GtkBuilderClass GtkBuilderClass;
typedef struct _GtkBuilderPrivate GtkBuilderPrivate;
/**
* GtkBuilderError:
* @GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name
* a function that returns a #GType.
* @GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder
* can't handle.
* @GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by
* #GtkBuilder was missing.
* @GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that
* it doesn't understand.
* @GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that
* it doesn't understand.
* @GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was
* missing.
* @GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse
* some attribute value.
* @GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
* of GTK+.
* @GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
*
* Error codes that identify various errors that can occur while using
* #GtkBuilder.
*/
typedef enum
{
GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
@@ -135,6 +158,14 @@ gboolean gtk_builder_value_from_string_type (GtkBuilder *builder,
GValue *value,
GError **error);
/**
* GTK_BUILDER_WARN_INVALID_CHILD_TYPE:
* @object: the #GtkBuildable on which the warning ocurred
* @type: the unexpected type value
*
* This macro should be used to emit a warning about and unexpected @type value
* in a #GtkBuildable add_child implementation.
*/
#define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type) \
g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (object)))
+102 -48
View File
@@ -37,6 +37,7 @@
#include "gtkstock.h"
#include "gtkiconfactory.h"
#include "gtkactivatable.h"
#include "gtkextendedlayout.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
@@ -111,8 +112,6 @@ static void gtk_button_unrealize (GtkWidget * widget);
static void gtk_button_map (GtkWidget * widget);
static void gtk_button_unmap (GtkWidget * widget);
static void gtk_button_style_set (GtkWidget * widget, GtkStyle * prev_style);
static void gtk_button_size_request (GtkWidget * widget,
GtkRequisition * requisition);
static void gtk_button_size_allocate (GtkWidget * widget,
GtkAllocation * allocation);
static gint gtk_button_expose (GtkWidget * widget, GdkEventExpose * event);
@@ -148,7 +147,7 @@ static void gtk_button_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_button_activatable_interface_init (GtkActivatableIface *iface);
static void gtk_button_activatable_interface_init(GtkActivatableIface *iface);
static void gtk_button_update (GtkActivatable *activatable,
GtkAction *action,
const gchar *property_name);
@@ -159,11 +158,21 @@ static void gtk_button_set_related_action (GtkButton *button,
static void gtk_button_set_use_action_appearance (GtkButton *button,
gboolean use_appearance);
static void gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_button_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_button_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static guint button_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
gtk_button_activatable_interface_init))
gtk_button_activatable_interface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_button_extended_layout_init))
static void
gtk_button_class_init (GtkButtonClass *klass)
@@ -191,7 +200,6 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->map = gtk_button_map;
widget_class->unmap = gtk_button_unmap;
widget_class->style_set = gtk_button_style_set;
widget_class->size_request = gtk_button_size_request;
widget_class->size_allocate = gtk_button_size_allocate;
widget_class->expose_event = gtk_button_expose;
widget_class->button_press_event = gtk_button_button_press;
@@ -1331,49 +1339,6 @@ gtk_button_get_props (GtkButton *button,
if (interior_focus)
gtk_widget_style_get (widget, "interior-focus", interior_focus, NULL);
}
static void
gtk_button_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkButton *button = GTK_BUTTON (widget);
GtkBorder default_border;
GtkBorder inner_border;
gint focus_width;
gint focus_pad;
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
requisition->width = ((GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->xthickness) * 2 +
inner_border.left + inner_border.right);
requisition->height = ((GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->ythickness) * 2 +
inner_border.top + inner_border.bottom);
if (gtk_widget_get_can_default (widget))
{
requisition->width += default_border.left + default_border.right;
requisition->height += default_border.top + default_border.bottom;
}
if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
requisition->width += 2 * (focus_width + focus_pad);
requisition->height += 2 * (focus_width + focus_pad);
}
static void
gtk_button_size_allocate (GtkWidget *widget,
@@ -1803,6 +1768,95 @@ gtk_button_finish_activate (GtkButton *button,
gtk_button_clicked (button);
}
static void
gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_button_get_desired_width;
iface->get_desired_height = gtk_button_get_desired_height;
}
static void
gtk_button_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkButton *button = GTK_BUTTON (layout);
GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border;
gint focus_width;
gint focus_pad;
gint minimum, natural;
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (layout),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum = ((GTK_CONTAINER (layout)->border_width +
GTK_WIDGET (layout)->style->xthickness) * 2 +
inner_border.left + inner_border.right);
if (gtk_widget_get_can_default (GTK_WIDGET (layout)))
minimum += default_border.left + default_border.right;
}
else
{
minimum = ((GTK_CONTAINER (layout)->border_width +
GTK_WIDGET (layout)->style->ythickness) * 2 +
inner_border.top + inner_border.bottom);
if (gtk_widget_get_can_default (GTK_WIDGET (layout)))
minimum += default_border.top + default_border.bottom;
}
minimum += 2 * (focus_width + focus_pad);
natural = minimum;
if ((child = gtk_bin_get_child (GTK_BIN (button))) &&
gtk_widget_get_visible (child))
{
gint child_min, child_nat;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
else
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child),
&child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
if (minimum_size)
*minimum_size = minimum;
if (natural_size)
*natural_size = natural;
}
static void
gtk_button_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_button_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_button_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_button_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
/**
* gtk_button_set_label:
* @button: a #GtkButton
+140 -19
View File
@@ -497,6 +497,7 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
GtkIconTheme *icon_theme;
GtkSettings *settings;
gint width, height;
GtkIconInfo *info;
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf);
@@ -519,29 +520,140 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
}
if (priv->icon_name)
cellpixbuf->pixbuf = gtk_icon_theme_load_icon (icon_theme,
priv->icon_name,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN,
NULL);
info = gtk_icon_theme_lookup_icon (icon_theme,
priv->icon_name,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN);
else if (priv->gicon)
{
GtkIconInfo *info;
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
priv->gicon,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN);
else
info = NULL;
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
priv->gicon,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN);
if (info)
{
cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, NULL);
gtk_icon_info_free (info);
}
if (info)
{
GdkColor error_color, warning_color, success_color;
GdkColor *error_ptr, *warning_ptr, *success_ptr;
GtkStyle *style;
style = gtk_widget_get_style (GTK_WIDGET (widget));
if (!gtk_style_lookup_color (style, "error_color", &error_color))
error_ptr = NULL;
else
error_ptr = &error_color;
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
warning_ptr = NULL;
else
warning_ptr = &warning_color;
if (!gtk_style_lookup_color (style, "success_color", &success_color))
success_ptr = NULL;
else
success_ptr = &success_color;
cellpixbuf->pixbuf = gtk_icon_info_load_symbolic (info,
&style->fg[GTK_STATE_NORMAL],
success_ptr,
warning_ptr,
error_ptr,
NULL,
NULL);
gtk_icon_info_free (info);
}
g_object_notify (G_OBJECT (cellpixbuf), "pixbuf");
}
static GdkPixbuf *
create_symbolic_pixbuf (GtkCellRendererPixbuf *cellpixbuf,
GtkWidget *widget,
GdkColor *fg)
{
GtkCellRendererPixbufPrivate *priv;
GdkScreen *screen;
GtkIconTheme *icon_theme;
GtkSettings *settings;
gint width, height;
GtkIconInfo *info;
GdkPixbuf *pixbuf;
priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf);
/* Not a named symbolic icon? */
if (priv->icon_name) {
if (!g_str_has_suffix (priv->icon_name, "-symbolic"))
return NULL;
} else if (priv->gicon) {
const gchar * const *names;
if (!G_IS_THEMED_ICON (priv->gicon))
return NULL;
names = g_themed_icon_get_names (G_THEMED_ICON (priv->gicon));
if (names == NULL || !g_str_has_suffix (names[0], "-symbolic"))
return NULL;
} else {
return NULL;
}
screen = gtk_widget_get_screen (GTK_WIDGET (widget));
icon_theme = gtk_icon_theme_get_for_screen (screen);
settings = gtk_settings_get_for_screen (screen);
if (!gtk_icon_size_lookup_for_settings (settings,
priv->stock_size,
&width, &height))
{
g_warning ("Invalid icon size %u\n", priv->stock_size);
width = height = 24;
}
if (priv->icon_name)
info = gtk_icon_theme_lookup_icon (icon_theme,
priv->icon_name,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN);
else if (priv->gicon)
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
priv->gicon,
MIN (width, height),
GTK_ICON_LOOKUP_USE_BUILTIN);
else
return NULL;
if (info)
{
GdkColor error_color, warning_color, success_color;
GdkColor *error_ptr, *warning_ptr, *success_ptr;
GtkStyle *style;
style = gtk_widget_get_style (GTK_WIDGET (widget));
if (!gtk_style_lookup_color (style, "error_color", &error_color))
error_ptr = NULL;
else
error_ptr = &error_color;
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
warning_ptr = NULL;
else
warning_ptr = &warning_color;
if (!gtk_style_lookup_color (style, "success_color", &success_color))
success_ptr = NULL;
else
success_ptr = &success_color;
pixbuf = gtk_icon_info_load_symbolic (info,
fg,
success_ptr,
warning_ptr,
error_ptr,
NULL,
NULL);
gtk_icon_info_free (info);
return pixbuf;
}
return NULL;
}
static GdkPixbuf *
create_colorized_pixbuf (GdkPixbuf *src,
GdkColor *new_color)
@@ -678,6 +790,7 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
GdkPixbuf *pixbuf;
GdkPixbuf *invisible = NULL;
GdkPixbuf *colorized = NULL;
GdkPixbuf *symbolic = NULL;
GdkRectangle pix_rect;
GdkRectangle draw_rect;
cairo_t *cr;
@@ -755,10 +868,15 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
else
state = GTK_STATE_PRELIGHT;
colorized = create_colorized_pixbuf (pixbuf,
&widget->style->base[state]);
symbolic = create_symbolic_pixbuf (cellpixbuf, widget, &widget->style->fg[state]);
if (!symbolic) {
colorized = create_colorized_pixbuf (pixbuf,
&widget->style->base[state]);
pixbuf = colorized;
pixbuf = colorized;
} else {
pixbuf = symbolic;
}
}
cr = gdk_cairo_create (window);
@@ -774,6 +892,9 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
if (colorized)
g_object_unref (colorized);
if (symbolic)
g_object_unref (symbolic);
}
#define __GTK_CELL_RENDERER_PIXBUF_C__
+3
View File
@@ -1370,6 +1370,9 @@ _gtk_container_queue_resize (GtkContainer *container)
{
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
if ((resize_container && widget == GTK_WIDGET (resize_container)) ||
!widget->parent)
break;
+13 -12
View File
@@ -36,18 +36,19 @@
G_BEGIN_DECLS
typedef enum {
GTK_DEBUG_MISC = 1 << 0,
GTK_DEBUG_PLUGSOCKET = 1 << 1,
GTK_DEBUG_TEXT = 1 << 2,
GTK_DEBUG_TREE = 1 << 3,
GTK_DEBUG_UPDATES = 1 << 4,
GTK_DEBUG_KEYBINDINGS = 1 << 5,
GTK_DEBUG_MULTIHEAD = 1 << 6,
GTK_DEBUG_MODULES = 1 << 7,
GTK_DEBUG_GEOMETRY = 1 << 8,
GTK_DEBUG_ICONTHEME = 1 << 9,
GTK_DEBUG_PRINTING = 1 << 10,
GTK_DEBUG_BUILDER = 1 << 11
GTK_DEBUG_MISC = 1 << 0,
GTK_DEBUG_PLUGSOCKET = 1 << 1,
GTK_DEBUG_TEXT = 1 << 2,
GTK_DEBUG_TREE = 1 << 3,
GTK_DEBUG_UPDATES = 1 << 4,
GTK_DEBUG_KEYBINDINGS = 1 << 5,
GTK_DEBUG_MULTIHEAD = 1 << 6,
GTK_DEBUG_MODULES = 1 << 7,
GTK_DEBUG_GEOMETRY = 1 << 8,
GTK_DEBUG_ICONTHEME = 1 << 9,
GTK_DEBUG_PRINTING = 1 << 10,
GTK_DEBUG_BUILDER = 1 << 11,
GTK_DEBUG_EXTENDED_LAYOUT = 1 << 12,
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG
+535
View File
@@ -0,0 +1,535 @@
/* gtkextendedlayout.c
* Copyright (C) 2007-2010 Openismus GmbH
*
* Authors:
* Mathias Hasselmann <mathias@openismus.com>
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION:gtkextendedlayout
* @Short_Description: Height-for-width geometry management
* @Title: GtkExtendedLayout
*
* The extended layout is GTK+'s height-for-width (and width-for-height)
* geometry management system. Height-for-width means that a widget can
* change how much vertical space it needs, depending on the amount
* of horizontal space that it is given (and similar for width-for-height).
* The most common example is a label that reflows to fill up the available
* width, wraps to fewer lines, and therefore needs less height.
*
* GTK+'s traditional two-pass <link linkend="size-allocation">size-allocation</link>
* algorithm does not allow this flexibility. #GtkWidget provides a default
* implementation of the #GtkExtendedLayout interface for existing widgets,
* which always requests the same height, regardless of the available width.
*
* <refsect2>
* <title>Implementing GtkExtendedLayout</title>
* <para>
* Some important things to keep in mind when implementing
* or using the extended layout.
*
* The Extended Layout system will query a logical hierarchy in
* only one orientation at a time. When widgets are initially queried
* for their minimum sizes it is generally done in a dual pass
* in the direction chosen by the toplevel.
*
* For instance when queried in the normal height-for-width mode:
* First the default minimum and natural width for each widget
* in the interface will computed and collectively returned to
* the toplevel by way of gtk_extended_layout_get_desired_width().
* Next, the toplevel will use the minimum width to query for the
* minimum height contextual to that width using
* gtk_extended_layout_get_height_for_width(), which will also be a
* highly recursive operation. This minimum-for-minimum size can be
* used to set the minimum size constraint on the toplevel.
*
* When allocating, each container can use the minimum and natural
* sizes reported by their children to allocate natural sizes and
* expose as much content as possible with the given allocation.
*
* That means that the request operation at allocation time will
* usually fire again in contexts of different allocated sizes than
* the ones originally queried for. #GtkExtendedLayout caches a
* small number of results to avoid re-querying for the same
* allocated size in one allocation cycle.
*
* A widget that does not actually do height-for-width
* or width-for-height size negotiations only has to implement
* get_desired_width() and get_desired_height().
*
* If a widget does move content around to smartly use up the
* allocated size, then it must support the request properly in
* both orientations; even if the request only makes sense in
* one orientation.
*
* For instance, a GtkLabel that does height-for-width word wrapping
* will not expect to have get_desired_height() called because that
* call is specific to a width-for-height request, in this case the
* label must return the heights contextual to its minimum possible
* width. By following this rule any widget that handles height-for-width
* or width-for-height requests will always be allocated at least
* enough space to fit its own content.
* </para>
* </refsect2>
*/
#include <config.h>
#include "gtkextendedlayout.h"
#include "gtksizegroup.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkalias.h"
/* With extended layout, a widget may be requested
* its width for 2 or maximum 3 heights in one resize
*/
#define N_CACHED_SIZES 3
typedef struct
{
guint age;
gint for_size;
gint minimum_size;
gint natural_size;
} DesiredSize;
typedef struct {
DesiredSize desired_widths[N_CACHED_SIZES];
DesiredSize desired_heights[N_CACHED_SIZES];
guint8 cached_width_age;
guint8 cached_height_age;
} ExtendedLayoutCache;
static GQuark quark_cache = 0;
GType
gtk_extended_layout_get_type (void)
{
static GType extended_layout_type = 0;
if (G_UNLIKELY(!extended_layout_type))
{
extended_layout_type =
g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkExtendedLayout"),
sizeof (GtkExtendedLayoutIface),
NULL, 0, NULL, 0);
g_type_interface_add_prerequisite (extended_layout_type, GTK_TYPE_WIDGET);
quark_cache = g_quark_from_static_string ("gtk-extended-layout-cache");
}
return extended_layout_type;
}
/* looks for a cached size request for this for_size. If not
* found, returns the oldest entry so it can be overwritten
*
* Note that this caching code was directly derived from
* the Clutter toolkit.
*/
static gboolean
get_cached_desired_size (gint for_size,
DesiredSize *cached_sizes,
DesiredSize **result)
{
guint i;
*result = &cached_sizes[0];
for (i = 0; i < N_CACHED_SIZES; i++)
{
DesiredSize *cs;
cs = &cached_sizes[i];
if (cs->age > 0 && cs->for_size == for_size)
{
*result = cs;
return TRUE;
}
else if (cs->age < (*result)->age)
{
*result = cs;
}
}
return FALSE;
}
static void
destroy_cache (ExtendedLayoutCache *cache)
{
g_slice_free (ExtendedLayoutCache, cache);
}
static ExtendedLayoutCache *
get_cache (GtkExtendedLayout *layout,
gboolean create)
{
ExtendedLayoutCache *cache;
cache = g_object_get_qdata (G_OBJECT (layout), quark_cache);
if (!cache && create)
{
cache = g_slice_new0 (ExtendedLayoutCache);
cache->cached_width_age = 1;
cache->cached_height_age = 1;
g_object_set_qdata_full (G_OBJECT (layout), quark_cache, cache,
(GDestroyNotify)destroy_cache);
}
return cache;
}
static void
do_size_request (GtkWidget *widget)
{
if (GTK_WIDGET_REQUEST_NEEDED (widget))
{
gtk_widget_ensure_style (widget);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
g_signal_emit_by_name (widget,
"size-request",
&widget->requisition);
}
}
static void
compute_size_for_orientation (GtkExtendedLayout *layout,
GtkSizeGroupMode orientation,
gint for_size,
gint *minimum_size,
gint *natural_size)
{
ExtendedLayoutCache *cache;
DesiredSize *cached_size;
GtkWidget *widget;
gboolean found_in_cache = FALSE;
g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout));
g_return_if_fail (minimum_size != NULL || natural_size != NULL);
widget = GTK_WIDGET (layout);
cache = get_cache (layout, TRUE);
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
{
cached_size = &cache->desired_widths[0];
if (!GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout))
found_in_cache = get_cached_desired_size (for_size, cache->desired_widths, &cached_size);
else
{
memset (cache->desired_widths, 0, N_CACHED_SIZES * sizeof (DesiredSize));
cache->cached_width_age = 1;
}
}
else
{
cached_size = &cache->desired_heights[0];
if (!GTK_WIDGET_HEIGHT_REQUEST_NEEDED (layout))
found_in_cache = get_cached_desired_size (for_size, cache->desired_heights, &cached_size);
else
{
memset (cache->desired_heights, 0, N_CACHED_SIZES * sizeof (DesiredSize));
cache->cached_height_age = 1;
}
}
if (!found_in_cache)
{
gint min_size = 0, nat_size = 0;
gint group_size, requisition_size;
/* Unconditional size request runs but is often unhandled. */
do_size_request (widget);
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
{
requisition_size = widget->requisition.width;
if (for_size < 0)
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, &min_size, &nat_size);
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_width_for_height (layout, for_size, &min_size, &nat_size);
}
else
{
requisition_size = widget->requisition.height;
if (for_size < 0)
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, &min_size, &nat_size);
else
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_height_for_width (layout, for_size, &min_size, &nat_size);
}
/* Support for dangling "size-request" signals and forward derived
* classes that will not default to a ->get_desired_width() that
* returns the values in the ->requisition cache.
*/
min_size = MAX (min_size, requisition_size);
nat_size = MAX (nat_size, requisition_size);
cached_size->minimum_size = min_size;
cached_size->natural_size = nat_size;
cached_size->for_size = for_size;
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
{
cached_size->age = cache->cached_width_age;
cache->cached_width_age++;
GTK_PRIVATE_UNSET_FLAG (layout, GTK_WIDTH_REQUEST_NEEDED);
}
else
{
cached_size->age = cache->cached_height_age;
cache->cached_height_age++;
GTK_PRIVATE_UNSET_FLAG (layout, GTK_HEIGHT_REQUEST_NEEDED);
}
/* Get size groups to compute the base requisition once one
* of the values have been cached, then go ahead and update
* the cache with the sizegroup computed value.
*
* Note this is also where values from gtk_widget_set_size_request()
* are considered.
*/
group_size =
_gtk_size_group_bump_requisition (GTK_WIDGET (layout),
orientation, cached_size->minimum_size);
cached_size->minimum_size = MAX (cached_size->minimum_size, group_size);
cached_size->natural_size = MAX (cached_size->natural_size, group_size);
}
if (minimum_size)
*minimum_size = cached_size->minimum_size;
if (natural_size)
*natural_size = cached_size->natural_size;
g_assert (cached_size->minimum_size <= cached_size->natural_size);
GTK_NOTE (EXTENDED_LAYOUT,
g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n",
layout, G_OBJECT_TYPE_NAME (layout),
orientation == GTK_SIZE_GROUP_HORIZONTAL ?
"width for height" : "height for width" ,
for_size,
cached_size->minimum_size,
cached_size->natural_size,
found_in_cache ? "yes" : "no"));
}
/**
* gtk_extended_layout_is_height_for_width:
* @layout: a #GtkExtendedLayout instance
*
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout.
*
* <note><para>#GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.</para></note>
*
* Returns: %TRUE if the widget prefers height-for-width, %FALSE if
* the widget should be treated with a width-for-height preference.
*
* Since: 3.0
*/
gboolean
gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout)
{
GtkExtendedLayoutIface *iface;
g_return_val_if_fail (GTK_IS_EXTENDED_LAYOUT (layout), FALSE);
iface = GTK_EXTENDED_LAYOUT_GET_IFACE (layout);
if (iface->is_height_for_width)
return iface->is_height_for_width (layout);
/* By default widgets are height-for-width. */
return TRUE;
}
/**
* gtk_extended_layout_get_desired_width:
* @layout: a #GtkExtendedLayout instance
* @minimum_width: (allow-none): location to store the minimum width, or %NULL
* @natural_width: (allow-none): location to store the natural width, or %NULL
*
* Retrieves a widget's initial minimum and natural width.
*
* <note><para>This call is specific to height-for-width
* requests.</para></note>
*
* Since: 3.0
*/
void
gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
-1, minimum_width, natural_width);
}
/**
* gtk_extended_layout_get_desired_height:
* @layout: a #GtkExtendedLayout instance
* @minimum_height: (allow-none): location to store the minimum height, or %NULL
* @natural_height: (allow-none): location to store the natural height, or %NULL
*
* Retrieves a widget's initial minimum and natural height.
*
* <note><para>This call is specific to width-for-height requests.</para></note>
*
* Since: 3.0
*/
void
gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
-1, minimum_height, natural_height);
}
/**
* gtk_extended_layout_get_width_for_height:
* @layout: a #GtkExtendedLayout instance
* @height: the height which is available for allocation
* @minimum_width: (allow-none): location for storing the minimum width, or %NULL
* @natural_width: (allow-none): location for storing the natural width, or %NULL
*
* Retrieves a widget's desired width if it would be given
* the specified @height.
*
* Since: 3.0
*/
void
gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
height, minimum_width, natural_width);
}
/**
* gtk_extended_layout_get_height_for_width:
* @layout: a #GtkExtendedLayout instance
* @width: the width which is available for allocation
* @minimum_height: (allow-none): location for storing the minimum height, or %NULL
* @natural_height: (allow-none): location for storing the natural height, or %NULL
*
* Retrieves a widget's desired height if it would be given
* the specified @width.
*
* Since: 3.0
*/
void
gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
width, minimum_height, natural_height);
}
/**
* gtk_extended_layout_get_desired_size:
* @layout: a #GtkExtendedLayout instance
* @width: the size which is available for allocation
* @request_natural: Whether to base the contextual request off of the
* base natural or the base minimum
* @minimum_size: (allow-none): location for storing the minimum size, or %NULL
* @natural_size: (allow-none): location for storing the natural size, or %NULL
*
* Retrieves the minimum and natural size of a widget taking
* into account the widget's preference for height-for-width management.
*
* If request_natural is specified, the non-contextual natural value will
* be used to make the contextual request; otherwise the minimum will be used.
*
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement.
*
* Since: 3.0
*/
void
gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout,
gboolean request_natural,
GtkRequisition *minimum_size,
GtkRequisition *natural_size)
{
gint min_width, nat_width;
gint min_height, nat_height;
g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout));
if (gtk_extended_layout_is_height_for_width (layout))
{
gtk_extended_layout_get_desired_width (layout, &min_width, &nat_width);
gtk_extended_layout_get_height_for_width (layout,
request_natural ? nat_width : min_width,
&min_height, &nat_height);
}
else
{
gtk_extended_layout_get_desired_height (layout, &min_height, &nat_height);
gtk_extended_layout_get_width_for_height (layout,
request_natural ? nat_height : min_height,
&min_width, &nat_width);
}
if (minimum_size)
{
minimum_size->width = min_width;
minimum_size->height = min_height;
}
if (natural_size)
{
natural_size->width = nat_width;
natural_size->height = nat_height;
}
}
#define __GTK_EXTENDED_LAYOUT_C__
#include "gtkaliasdef.c"
+89
View File
@@ -0,0 +1,89 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2007-2010 Openismus GmbH
*
* Authors:
* Mathias Hasselmann <mathias@openismus.com>
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_EXTENDED_LAYOUT_H__
#define __GTK_EXTENDED_LAYOUT_H__
#include <gtk/gtkwidget.h>
G_BEGIN_DECLS
#define GTK_TYPE_EXTENDED_LAYOUT (gtk_extended_layout_get_type ())
#define GTK_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayout))
#define GTK_EXTENDED_LAYOUT_CLASS(klass) ((GtkExtendedLayoutIface*)g_type_interface_peek ((klass), GTK_TYPE_EXTENDED_LAYOUT))
#define GTK_IS_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EXTENDED_LAYOUT))
#define GTK_EXTENDED_LAYOUT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayoutIface))
typedef struct _GtkExtendedLayout GtkExtendedLayout;
typedef struct _GtkExtendedLayoutIface GtkExtendedLayoutIface;
struct _GtkExtendedLayoutIface
{
GTypeInterface g_iface;
/* virtual table */
gboolean (* is_height_for_width) (GtkExtendedLayout *layout);
void (* get_desired_width) (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width);
void (* get_desired_height) (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height);
void (* get_width_for_height) (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width);
void (* get_height_for_width) (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
};
GType gtk_extended_layout_get_type (void) G_GNUC_CONST;
gboolean gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout);
void gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width);
void gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height);
void gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width);
void gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
void gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout,
gboolean request_natural,
GtkRequisition *minimum_size,
GtkRequisition *natural_size);
G_END_DECLS
#endif /* __GTK_EXTENDED_LAYOUT_H__ */
+5 -1
View File
@@ -323,7 +323,7 @@
* </variablelist>
* <note>
* You can create your own bindings for the
* GtkFileChooserDefault::location-popup signal with custom
* #GtkFileChooserDefault::location-popup signal with custom
* <parameter>path</parameter> strings, and have a crude form
* of easily-to-type bookmarks. For example, say you access
* the path <filename>/home/username/misc</filename> very
@@ -504,7 +504,11 @@
* </listitem>
* </varlistentry>
* <varlistentry>
<<<<<<< HEAD
* <term><parameter>bookmark_indes</parameter>&nbsp;:</term>
=======
* <term><parameter>bookmark_index</parameter>&nbsp;:</term>
>>>>>>> native-layout-incubator
* <listitem>
* <simpara>
* index of the bookmark to switch to; the indices start at 0.
+1
View File
@@ -1747,6 +1747,7 @@ remove_file (GtkFileSystemModel *model,
g_object_unref (node->info);
g_array_remove_index (model->files, id);
g_hash_table_remove_all (model->file_lookup);
/* We don't need to resort, as removing a row doesn't change the sorting order */
}
+116 -42
View File
@@ -31,6 +31,7 @@
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkbuildable.h"
#include "gtkextendedlayout.h"
#include "gtkalias.h"
#define LABEL_PAD 1
@@ -58,8 +59,6 @@ static void gtk_frame_paint (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_frame_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_frame_remove (GtkContainer *container,
@@ -81,9 +80,19 @@ static void gtk_frame_buildable_add_child (GtkBuildable *buildable,
GObject *child,
const gchar *type);
static void gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_frame_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_frame_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_frame_buildable_init))
gtk_frame_buildable_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_frame_extended_layout_init))
static void
gtk_frame_class_init (GtkFrameClass *class)
@@ -150,7 +159,6 @@ gtk_frame_class_init (GtkFrameClass *class)
GTK_PARAM_READWRITE));
widget_class->expose_event = gtk_frame_expose;
widget_class->size_request = gtk_frame_size_request;
widget_class->size_allocate = gtk_frame_size_allocate;
container_class->remove = gtk_frame_remove;
@@ -601,42 +609,6 @@ gtk_frame_expose (GtkWidget *widget,
return FALSE;
}
static void
gtk_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
GtkRequisition child_requisition;
if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
{
gtk_widget_size_request (frame->label_widget, &child_requisition);
requisition->width = child_requisition.width + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
requisition->height =
MAX (0, child_requisition.height - widget->style->ythickness);
}
else
{
requisition->width = 0;
requisition->height = 0;
}
if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width = MAX (requisition->width, child_requisition.width);
requisition->height += child_requisition.height;
}
requisition->width += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->xthickness) * 2;
requisition->height += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->ythickness) * 2;
}
static void
gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -652,11 +624,15 @@ gtk_frame_size_allocate (GtkWidget *widget,
/* If the child allocation changed, that means that the frame is drawn
* in a new place, so we must redraw the entire widget.
*/
if (gtk_widget_get_mapped (widget) &&
if (gtk_widget_get_mapped (widget)
#if 0
&&
(new_allocation.x != frame->child_allocation.x ||
new_allocation.y != frame->child_allocation.y ||
new_allocation.width != frame->child_allocation.width ||
new_allocation.height != frame->child_allocation.height))
new_allocation.height != frame->child_allocation.height)
#endif
)
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
if (bin->child && gtk_widget_get_visible (bin->child))
@@ -728,5 +704,103 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
child_allocation->y += allocation->y;
}
static void
gtk_frame_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkWidget *widget = GTK_WIDGET (layout);
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
gint child_min, child_nat;
gint minimum, natural;
if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (frame->label_widget),
&child_min, &child_nat);
minimum = child_min + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
natural = child_nat + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
}
else
{
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (frame->label_widget),
&child_min, &child_nat);
minimum = MAX (0, child_min - widget->style->ythickness);
natural = MAX (0, child_nat - widget->style->ythickness);
}
}
else
{
minimum = 0;
natural = 0;
}
if (bin->child && gtk_widget_get_visible (bin->child))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child),
&child_min, &child_nat);
minimum = MAX (minimum, child_min);
natural = MAX (natural, child_nat);
}
else
{
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child),
&child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->xthickness) * 2;
natural += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->xthickness) * 2;
}
else
{
minimum += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->ythickness) * 2;
natural += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->ythickness) * 2;
}
if (minimum_size)
*minimum_size = minimum;
if (natural_size)
*natural_size = natural;
}
static void
gtk_frame_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_frame_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_frame_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_frame_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_frame_get_desired_width;
iface->get_desired_height = gtk_frame_get_desired_height;
}
#define __GTK_FRAME_C__
#include "gtkaliasdef.c"
+139
View File
@@ -3079,6 +3079,145 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
return g_object_ref (icon_info->pixbuf);
}
static gchar *
gdk_color_to_css (GdkColor *color)
{
return g_strdup_printf ("rgb(%d,%d,%d)",
color->red >> 8,
color->green >> 8,
color->blue >> 8);
}
/**
* gtk_icon_info_load_symbolic:
* @info: a #GtkIconInfo
* @fg: a #GdkColor representing the foreground color of the icon
* @success_color: (allow-none): a #GdkColor representing the warning color
* of the icon or %NULL to use the default color
* @warning_color: (allow-none): a #GdkColor representing the warning color
* of the icon or %NULL to use the default color
* @error_color: (allow-none): a #GdkColor representing the error color
* of the icon or %NULL to use the default color (allow-none)
* @was_symbolic: (allow-none): a #gboolean, returns whether the loaded icon
* was a symbolic one and whether the @fg color was applied to it.
* @error: (allow-none): location to store error information on failure,
* or %NULL.
*
* Loads an icon, modifying it to match the system colours for the foreground,
* success, warning and error colors provided. If the icon is not a symbolic
* one, the function will return the result from gtk_icon_info_load_icon().
*
* This allows loading symbolic icons that will match the system theme.
*
* Unless you are implementing a widget, you will want to use
* g_themed_icon_new_with_default_fallbacks() to load the icon.
*
* As implementation details, the icon loaded needs to be of SVG type,
* contain the "symbolic" term as the last component of the icon name,
* and use the 'fg', 'success', 'warning' and 'error' CSS styles in the
* SVG file itself.
*
* See the <ulink url="http://www.freedesktop.org/wiki/SymbolicIcons">Symbolic Icons spec</ulink>
* for more information about symbolic icons.
*
* Return value: a #GdkPixbuf representing the loaded icon
*
* Since: 3.0
**/
GdkPixbuf *
gtk_icon_info_load_symbolic (GtkIconInfo *info,
GdkColor *fg,
GdkColor *success_color,
GdkColor *warning_color,
GdkColor *error_color,
gboolean *was_symbolic,
GError **error)
{
GdkPixbuf *pixbuf;
GInputStream *stream;
gchar *data;
gchar *css_fg;
gchar *css_success;
gchar *css_warning;
gchar *css_error;
g_return_val_if_fail (fg != NULL, NULL);
if (!info->filename || !g_str_has_suffix (info->filename, "-symbolic.svg"))
{
if (was_symbolic)
*was_symbolic = FALSE;
return gtk_icon_info_load_icon (info, error);
}
if (was_symbolic)
*was_symbolic = TRUE;
css_fg = gdk_color_to_css (fg);
if (!warning_color)
{
GdkColor warning_default_color = { 0, 0xf500, 0x7900, 0x3e00 };
css_warning = gdk_color_to_css (&warning_default_color);
}
else
css_warning = gdk_color_to_css (warning_color);
if (!error_color)
{
GdkColor error_default_color = { 0, 0xcc00, 0x0000, 0x0000 };
css_error = gdk_color_to_css (&error_default_color);
}
else
css_error = gdk_color_to_css (error_color);
if (!success_color)
{
GdkColor success_default_color = { 0, 0x4e00, 0x9a00, 0x0600 };
css_success = gdk_color_to_css (&success_default_color);
}
else
css_success = gdk_color_to_css (success_color);
data = g_strconcat (
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
"<svg version=\"1.1\"\n"
" xmlns=\"http://www.w3.org/2000/svg\"\n"
" xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n"
" width=\"16\"\n"
" height=\"16\">\n"
" <style type=\"text/css\">\n"
" rect,path {\n"
" fill: ", css_fg," !important;\n"
" }\n"
" .warning {\n"
" fill: ", css_warning," !important;\n"
" }\n"
" .error {\n"
" fill: ", css_error," !important;\n"
" }\n"
" .success {\n"
" fill: ", css_success," !important;\n"
" }\n"
" </style>\n"
" <xi:include href=\"", info->filename, "\"/>\n"
"</svg>",
NULL);
g_free (css_fg);
g_free (css_warning);
g_free (css_success);
g_free (css_error);
stream = g_memory_input_stream_new_from_data (data, -1, g_free);
pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
info->desired_size,
info->desired_size,
TRUE,
NULL,
error);
g_object_unref (stream);
return pixbuf;
}
/**
* gtk_icon_info_set_raw_coordinates:
* @icon_info: a #GtkIconInfo
+7
View File
@@ -179,6 +179,13 @@ G_CONST_RETURN gchar *gtk_icon_info_get_filename (GtkIconInfo *icon_info
GdkPixbuf * gtk_icon_info_get_builtin_pixbuf (GtkIconInfo *icon_info);
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
GError **error);
GdkPixbuf * gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
GdkColor *fg,
GdkColor *success_color,
GdkColor *warning_color,
GdkColor *error_color,
gboolean *was_symbolic,
GError **error);
void gtk_icon_info_set_raw_coordinates (GtkIconInfo *icon_info,
gboolean raw_coordinates);
+122 -15
View File
@@ -134,6 +134,11 @@ struct _GtkImagePrivate
/* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */
gchar *filename;
/* a GtkStateType, with -1 meaning an invalid state,
* only used with GTK_IMAGE_GICON, GTK_IMAGE_ICON_NAME */
gint last_rendered_state;
gboolean was_symbolic;
gint pixel_size;
guint need_calc_size : 1;
};
@@ -1628,6 +1633,10 @@ animation_timeout (gpointer data)
static void
icon_theme_changed (GtkImage *image)
{
GtkImagePrivate *priv;
priv = GTK_IMAGE_GET_PRIVATE (image);
if (image->storage_type == GTK_IMAGE_ICON_NAME)
{
if (image->data.name.pixbuf)
@@ -1647,7 +1656,8 @@ icon_theme_changed (GtkImage *image)
}
static void
ensure_pixbuf_for_icon_name (GtkImage *image)
ensure_pixbuf_for_icon_name (GtkImage *image,
GtkStateType state)
{
GtkImagePrivate *priv;
GdkScreen *screen;
@@ -1655,8 +1665,8 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
GtkSettings *settings;
gint width, height;
gint *sizes, *s, dist;
GtkIconInfo *info;
GtkIconLookupFlags flags;
GError *error = NULL;
g_return_if_fail (image->storage_type == GTK_IMAGE_ICON_NAME);
@@ -1665,8 +1675,15 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
icon_theme = gtk_icon_theme_get_for_screen (screen);
settings = gtk_settings_get_for_screen (screen);
flags = GTK_ICON_LOOKUP_USE_BUILTIN;
if (image->data.name.pixbuf == NULL)
if (image->data.name.pixbuf == NULL ||
(priv->was_symbolic && priv->last_rendered_state != state))
{
priv->last_rendered_state = state;
if (image->data.name.pixbuf)
{
g_object_unref (image->data.name.pixbuf);
image->data.name.pixbuf = NULL;
}
if (priv->pixel_size != -1)
{
width = height = priv->pixel_size;
@@ -1714,24 +1731,57 @@ ensure_pixbuf_for_icon_name (GtkImage *image)
width = height = 24;
}
}
image->data.name.pixbuf =
gtk_icon_theme_load_icon (icon_theme,
image->data.name.icon_name,
MIN (width, height), flags, &error);
info = gtk_icon_theme_lookup_icon (icon_theme,
image->data.name.icon_name,
MIN (width, height), flags);
if (info)
{
GdkColor error_color, warning_color, success_color;
GdkColor *error_ptr, *warning_ptr, *success_ptr;
GtkStyle *style;
gboolean was_symbolic;
style = gtk_widget_get_style (GTK_WIDGET (image));
if (!gtk_style_lookup_color (style, "error_color", &error_color))
error_ptr = NULL;
else
error_ptr = &error_color;
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
warning_ptr = NULL;
else
warning_ptr = &warning_color;
if (!gtk_style_lookup_color (style, "success_color", &success_color))
success_ptr = NULL;
else
success_ptr = &success_color;
image->data.name.pixbuf = gtk_icon_info_load_symbolic (info,
&style->fg[state],
success_ptr,
warning_ptr,
error_ptr,
&was_symbolic,
NULL);
priv->was_symbolic = was_symbolic;
gtk_icon_info_free (info);
}
if (image->data.name.pixbuf == NULL)
{
g_error_free (error);
image->data.name.pixbuf =
gtk_widget_render_icon (GTK_WIDGET (image),
GTK_STOCK_MISSING_IMAGE,
image->icon_size,
NULL);
priv->was_symbolic = FALSE;
}
}
}
static void
ensure_pixbuf_for_gicon (GtkImage *image)
ensure_pixbuf_for_gicon (GtkImage *image,
GtkStateType state)
{
GtkImagePrivate *priv;
GdkScreen *screen;
@@ -1748,8 +1798,15 @@ ensure_pixbuf_for_gicon (GtkImage *image)
icon_theme = gtk_icon_theme_get_for_screen (screen);
settings = gtk_settings_get_for_screen (screen);
flags = GTK_ICON_LOOKUP_USE_BUILTIN;
if (image->data.gicon.pixbuf == NULL)
if (image->data.gicon.pixbuf == NULL ||
(priv->was_symbolic && priv->last_rendered_state != state))
{
priv->last_rendered_state = state;
if (image->data.gicon.pixbuf)
{
g_object_unref (image->data.gicon.pixbuf);
image->data.gicon.pixbuf = NULL;
}
if (priv->pixel_size != -1)
{
width = height = priv->pixel_size;
@@ -1773,7 +1830,33 @@ ensure_pixbuf_for_gicon (GtkImage *image)
MIN (width, height), flags);
if (info)
{
image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, NULL);
GdkColor error_color, warning_color, success_color;
GdkColor *error_ptr, *warning_ptr, *success_ptr;
GtkStyle *style;
gboolean was_symbolic;
style = gtk_widget_get_style (GTK_WIDGET (image));
if (!gtk_style_lookup_color (style, "error_color", &error_color))
error_ptr = NULL;
else
error_ptr = &error_color;
if (!gtk_style_lookup_color (style, "warning_color", &warning_color))
warning_ptr = NULL;
else
warning_ptr = &warning_color;
if (!gtk_style_lookup_color (style, "success_color", &success_color))
success_ptr = NULL;
else
success_ptr = &success_color;
image->data.gicon.pixbuf = gtk_icon_info_load_symbolic (info,
&style->fg[state],
success_ptr,
warning_ptr,
error_ptr,
&was_symbolic,
NULL);
priv->was_symbolic = was_symbolic;
gtk_icon_info_free (info);
}
@@ -1784,6 +1867,7 @@ ensure_pixbuf_for_gicon (GtkImage *image)
GTK_STOCK_MISSING_IMAGE,
image->icon_size,
NULL);
priv->was_symbolic = FALSE;
}
}
}
@@ -1845,6 +1929,7 @@ gtk_image_expose (GtkWidget *widget,
gint x, y, mask_x, mask_y;
GdkBitmap *mask;
GdkPixbuf *pixbuf;
GtkStateType state;
gboolean needs_state_transform;
image = GTK_IMAGE (widget);
@@ -2012,7 +2097,18 @@ gtk_image_expose (GtkWidget *widget,
break;
case GTK_IMAGE_ICON_NAME:
ensure_pixbuf_for_icon_name (image);
state = gtk_widget_get_state (widget);
if (state == GTK_STATE_INSENSITIVE)
{
ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL);
}
else
{
ensure_pixbuf_for_icon_name (image, state);
/* Already done by the loading function? */
if (priv->was_symbolic)
needs_state_transform = FALSE;
}
pixbuf = image->data.name.pixbuf;
if (pixbuf)
{
@@ -2023,7 +2119,18 @@ gtk_image_expose (GtkWidget *widget,
break;
case GTK_IMAGE_GICON:
ensure_pixbuf_for_gicon (image);
state = gtk_widget_get_state (widget);
if (state == GTK_STATE_INSENSITIVE)
{
ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL);
}
else
{
ensure_pixbuf_for_gicon (image, state);
/* Already done by the loading function? */
if (priv->was_symbolic)
needs_state_transform = FALSE;
}
pixbuf = image->data.gicon.pixbuf;
if (pixbuf)
{
@@ -2325,12 +2432,12 @@ gtk_image_calc_size (GtkImage *image)
NULL);
break;
case GTK_IMAGE_ICON_NAME:
ensure_pixbuf_for_icon_name (image);
ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL);
pixbuf = image->data.name.pixbuf;
if (pixbuf) g_object_ref (pixbuf);
break;
case GTK_IMAGE_GICON:
ensure_pixbuf_for_gicon (image);
ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL);
pixbuf = image->data.gicon.pixbuf;
if (pixbuf)
g_object_ref (pixbuf);
+581 -148
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -235,7 +235,8 @@ static const GDebugKey gtk_debug_keys[] = {
{"geometry", GTK_DEBUG_GEOMETRY},
{"icontheme", GTK_DEBUG_ICONTHEME},
{"printing", GTK_DEBUG_PRINTING},
{"builder", GTK_DEBUG_BUILDER}
{"builder", GTK_DEBUG_BUILDER},
{"extended-layout", GTK_DEBUG_EXTENDED_LAYOUT},
};
#endif /* G_ENABLE_DEBUG */
+133
View File
@@ -0,0 +1,133 @@
/*
* Copyright (C) 2010 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Cody Russell <bratsche@gnome.org>
*/
#include "config.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkmenuproxy.h"
#include "gtkmenuproxymodule.h"
#include "gtkmodules.h"
#include "gtkalias.h"
enum {
INSERTED,
LAST_SIGNAL
};
static guint menu_proxy_signals[LAST_SIGNAL] = { 0 };
static GObjectClass *parent_class = NULL;
static GtkMenuProxy *proxy_singleton = NULL;
static void gtk_menu_proxy_real_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position);
/* --------------------------------------------------------- */
G_DEFINE_TYPE (GtkMenuProxy, gtk_menu_proxy, G_TYPE_OBJECT)
static GObject *
gtk_menu_proxy_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
if (proxy_singleton != NULL)
{
object = g_object_ref (proxy_singleton);
}
else
{
object = G_OBJECT_CLASS (gtk_menu_proxy_parent_class)->constructor (type,
n_params,
params);
proxy_singleton = GTK_MENU_PROXY (object);
g_object_add_weak_pointer (object, (gpointer) &proxy_singleton);
}
return object;
}
static void
gtk_menu_proxy_init (GtkMenuProxy *proxy)
{
}
static void
gtk_menu_proxy_class_init (GtkMenuProxyClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
menu_proxy_signals[INSERTED] =
g_signal_new (I_("inserted"),
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkMenuProxyClass, inserted),
NULL, NULL,
_gtk_marshal_VOID__OBJECT_UINT,
G_TYPE_NONE, 2,
GTK_TYPE_WIDGET, G_TYPE_UINT);
class->insert = gtk_menu_proxy_real_insert;
object_class->constructor = gtk_menu_proxy_constructor;
}
GtkMenuProxy *
gtk_menu_proxy_get (void)
{
if (!proxy_singleton)
{
gtk_menu_proxy_module_get ();
}
return proxy_singleton;
}
static void
gtk_menu_proxy_real_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position)
{
}
void
gtk_menu_proxy_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position)
{
g_return_if_fail (GTK_IS_MENU_PROXY (proxy));
GTK_MENU_PROXY_GET_CLASS (proxy)->insert (proxy,
child,
position);
//g_signal_emit_by_name (proxy, "inserted", child, position);
}
#define __GTK_MENU_PROXY_C__
#include "gtkaliasdef.c"
+69
View File
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2010 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Cody Russell <bratsche@gnome.org>
*/
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_MENU_PROXY_H__
#define __GTK_MENU_PROXY_H__
#include <gtk/gtkwidget.h>
#include <gtk/gtktypeutils.h>
G_BEGIN_DECLS
#define GTK_TYPE_MENU_PROXY (gtk_menu_proxy_get_type ())
#define GTK_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MENU_PROXY, GtkMenuProxy))
#define GTK_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_MENU_PROXY, GtkMenuProxyClass))
#define GTK_IS_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MENU_PROXY))
#define GTK_IS_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_MENU_PROXY))
#define GTK_MENU_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MENU_PROXY, GtkMenuProxyClass))
typedef struct _GtkMenuProxy GtkMenuProxy;
typedef struct _GtkMenuProxyClass GtkMenuProxyClass;
struct _GtkMenuProxy
{
GObject parent_object;
};
struct _GtkMenuProxyClass
{
GObjectClass parent_class;
/* vtable */
void (* insert) (GtkMenuProxy *proxy, GtkWidget *child, guint position);
/* signals */
void (* inserted) (GtkMenuProxy *proxy, GtkWidget *child);
};
GType gtk_menu_proxy_get_type (void) G_GNUC_CONST;
GtkMenuProxy* gtk_menu_proxy_get (void);
void gtk_menu_proxy_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position);
G_END_DECLS
#endif /* __GTK_MENU_PROXY_H__ */
+239
View File
@@ -0,0 +1,239 @@
/*
* Copyright (C) 2010 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Cody Russell <bratsche@gnome.org>
*/
#include "config.h"
#include "gtkintl.h"
#include "gtkmenuproxy.h"
#include "gtkmenuproxymodule.h"
#include "gtkmodules.h"
#include "gtkalias.h"
enum {
PROP_0,
PROP_MODULENAME
};
static GObject *gtk_menu_proxy_module_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gtk_menu_proxy_module_finalize (GObject *object);
static gboolean gtk_menu_proxy_module_real_load (GTypeModule *gmodule);
static void gtk_menu_proxy_module_real_unload (GTypeModule *gmodule);
G_DEFINE_TYPE (GtkMenuProxyModule, gtk_menu_proxy_module, G_TYPE_TYPE_MODULE);
static GtkMenuProxyModule *proxy_module_singleton = NULL;
static void
gtk_menu_proxy_module_class_init (GtkMenuProxyModuleClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
//object_class->constructor = gtk_menu_proxy_module_constructor;
object_class->finalize = gtk_menu_proxy_module_finalize;
type_module_class->load = gtk_menu_proxy_module_real_load;
type_module_class->unload = gtk_menu_proxy_module_real_unload;
}
/*
static GObject *
gtk_menu_proxy_module_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
if (proxy_module_singleton != NULL)
{
object = g_object_ref (proxy_module_singleton);
}
else
{
object = G_OBJECT_CLASS (gtk_menu_proxy_module_parent_class)->constructor (type,
n_params,
params);
proxy_module_singleton = GTK_MENU_PROXY_MODULE (object);
g_object_add_weak_pointer (object, (gpointer) &proxy_module_singleton);
}
return object;
}
*/
static void
gtk_menu_proxy_module_init (GtkMenuProxyModule *module)
{
module->name = g_strdup (g_getenv ("GTK_MENUPROXY"));
module->library = NULL;
module->load = NULL;
module->unload = NULL;
}
static void
gtk_menu_proxy_module_finalize (GObject *object)
{
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (object);
if (module->name != NULL)
{
g_free (module->name);
}
G_OBJECT_CLASS (gtk_menu_proxy_module_parent_class)->finalize (object);
}
static gboolean
gtk_menu_proxy_module_real_load (GTypeModule *gmodule)
{
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (gmodule);
gchar *path;
if (proxy_module_singleton != NULL)
return TRUE;
if (!module->name)
{
g_warning ("Module path not set");
return FALSE;
}
path = _gtk_find_module (module->name, "menuproxies");
module->library = g_module_open (path, 0);
if (!module->library)
{
g_printerr ("%s\n", g_module_error ());
return FALSE;
}
/* Make sure that the loaded library contains the required methods */
if (!g_module_symbol (module->library,
"menu_proxy_module_load",
(gpointer *) &module->load) ||
!g_module_symbol (module->library,
"menu_proxy_module_unload",
(gpointer *) &module->unload))
{
g_printerr ("%s\n", g_module_error ());
g_module_close (module->library);
return FALSE;
}
/* Initialize the loaded module */
module->load (module);
return TRUE;
}
static void
gtk_menu_proxy_module_real_unload (GTypeModule *gmodule)
{
GtkMenuProxyModule *module = GTK_MENU_PROXY_MODULE (gmodule);
module->unload (module);
g_module_close (module->library);
module->library = NULL;
module->load = NULL;
module->unload = NULL;
}
static gboolean
is_valid_module_name (const gchar *name)
{
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
return g_str_has_prefix (name, "lib") && g_str_has_suffix (name, ".so");
#else
return g_str_has_suffix (name, ".dll");
#endif
}
static void
setup_instance (GtkMenuProxyModule *module)
{
GType *proxy_types;
guint n_proxies;
proxy_types = g_type_children (GTK_TYPE_MENU_PROXY,
&n_proxies);
if (n_proxies > 1)
{
g_warning ("There are %d child types of GtkMenuProxy, should be 0 or 1.\n",
n_proxies);
}
else if (n_proxies == 1)
{
g_object_new (proxy_types[0], NULL);
}
}
GtkMenuProxyModule *
gtk_menu_proxy_module_get (void)
{
if (!proxy_module_singleton)
{
GtkMenuProxyModule *module = NULL;
const gchar *module_name;
module_name = g_getenv ("GTK_MENUPROXY");
if (module_name != NULL)
{
if (is_valid_module_name (module_name))
{
gchar *path = _gtk_find_module (module_name, "menuproxies");
module = g_object_new (GTK_TYPE_MENU_PROXY_MODULE,
NULL);
if (!g_type_module_use (G_TYPE_MODULE (module)))
{
g_warning ("Failed to load type module: %s\n", path);
g_object_unref (module);
g_free (path);
return NULL;
}
setup_instance (module);
g_free (path);
g_type_module_unuse (G_TYPE_MODULE (module));
}
proxy_module_singleton = module;
}
}
return proxy_module_singleton;
}
#define __GTK_MENU_PROXY_MODULE_C__
#include "gtkaliasdef.c"
+69
View File
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2010 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Cody Russell <bratsche@gnome.org>
*/
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_MENU_PROXY_MODULE_H__
#define __GTK_MENU_PROXY_MODULE_H__
#include <glib-object.h>
#include <gmodule.h>
G_BEGIN_DECLS
#define GTK_TYPE_MENU_PROXY_MODULE (gtk_menu_proxy_module_get_type ())
#define GTK_MENU_PROXY_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModule))
#define GTK_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModuleClass))
#define GTK_IS_MENU_MODULE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MENU_PROXY_MODULE))
#define GTK_IS_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_MENU_PROXY_MODULE))
#define GTK_MENU_PROXY_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MENU_PROXY_MODULE, GtkMenuProxyModuleClass))
typedef struct _GtkMenuProxyModule GtkMenuProxyModule;
typedef struct _GtkMenuProxyModuleClass GtkMenuProxyModuleClass;
typedef struct _GtkMenuProxyModulePrivate GtkMenuProxyModulePrivate;
struct _GtkMenuProxyModule
{
GTypeModule parent_instance;
GtkMenuProxyModulePrivate *priv;
GModule *library;
gchar *name;
void (* load) (GtkMenuProxyModule *module);
void (* unload) (GtkMenuProxyModule *module);
};
struct _GtkMenuProxyModuleClass
{
GTypeModuleClass parent_class;
};
GType gtk_menu_proxy_module_get_type (void) G_GNUC_CONST;
GtkMenuProxyModule *gtk_menu_proxy_module_get (void);
G_END_DECLS
#endif /* __GTK_MENU_PROXY_MODULE_H__ */
+15
View File
@@ -37,6 +37,7 @@
#include "gtkmenubar.h"
#include "gtkmenuitem.h"
#include "gtkmenushell.h"
#include "gtkmenuproxy.h"
#include "gtkmnemonichash.h"
#include "gtktearoffmenuitem.h"
#include "gtkwindow.h"
@@ -135,6 +136,8 @@ struct _GtkMenuShellPrivate
GtkMnemonicHash *mnemonic_hash;
GtkKeyHash *key_hash;
GtkMenuProxy *proxy;
guint take_focus : 1;
guint activated_submenu : 1;
/* This flag is a crutch to keep mnemonics in the same menu
@@ -408,6 +411,8 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell)
priv->key_hash = NULL;
priv->take_focus = TRUE;
priv->activated_submenu = FALSE;
priv->proxy = gtk_menu_proxy_get ();
//priv->proxy = gtk_menu_proxy_factory_get_proxy ();
}
static void
@@ -483,12 +488,22 @@ gtk_menu_shell_insert (GtkMenuShell *menu_shell,
gint position)
{
GtkMenuShellClass *class;
GtkMenuShellPrivate *priv;
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
g_return_if_fail (GTK_IS_MENU_ITEM (child));
class = GTK_MENU_SHELL_GET_CLASS (menu_shell);
priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
// XXX
// insert to proxy
if (priv->proxy != NULL)
gtk_menu_proxy_insert (priv->proxy,
child,
position);
if (class->insert)
class->insert (menu_shell, child, position);
}
+20 -9
View File
@@ -461,6 +461,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
gint border_width;
gboolean need_sliders = FALSE;
gint up_slider_offset = 0;
GtkRequisition child_requisition;
widget->allocation = *allocation;
@@ -481,13 +482,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
if (path_bar->fake_root)
width = path_bar->spacing + path_bar->slider_width;
else
width = 0;
width = 0;
for (list = path_bar->button_list; list; list = list->next)
{
child = BUTTON_DATA (list->data)->button;
width += child->requisition.width + path_bar->spacing;
gtk_widget_get_child_requisition (child, &child_requisition);
width += child_requisition.width + path_bar->spacing;
if (list == path_bar->fake_root)
break;
}
@@ -515,19 +518,23 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
* button, then count backwards.
*/
/* Count down the path chain towards the end. */
width = BUTTON_DATA (first_button->data)->button->requisition.width;
gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition);
width = child_requisition.width;
list = first_button->prev;
while (list && !reached_end)
{
child = BUTTON_DATA (list->data)->button;
if (width + child->requisition.width +
gtk_widget_get_child_requisition (child, &child_requisition);
if (width + child_requisition.width +
path_bar->spacing + slider_space > allocation_width)
reached_end = TRUE;
else if (list == path_bar->fake_root)
break;
else
width += child->requisition.width + path_bar->spacing;
width += child_requisition.width + path_bar->spacing;
list = list->prev;
}
@@ -538,13 +545,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (first_button->next->data)->button;
if (width + child->requisition.width + path_bar->spacing + slider_space > allocation_width)
gtk_widget_get_child_requisition (child, &child_requisition);
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
{
reached_end = TRUE;
}
else
{
width += child->requisition.width + path_bar->spacing;
width += child_requisition.width + path_bar->spacing;
if (first_button == path_bar->fake_root)
break;
first_button = first_button->next;
@@ -582,7 +591,9 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
button_data = BUTTON_DATA (list->data);
child = button_data->button;
child_allocation.width = MIN (child->requisition.width,
gtk_widget_get_child_requisition (child, &child_requisition);
child_allocation.width = MIN (child_requisition.width,
allocation_width - (path_bar->spacing + path_bar->slider_width) * 2);
if (direction == GTK_TEXT_DIR_RTL)
@@ -601,7 +612,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
break;
}
if (child_allocation.width < child->requisition.width)
if (child_allocation.width < child_requisition.width)
{
if (!gtk_widget_get_has_tooltip (child))
gtk_widget_set_tooltip_text (child, button_data->dir_name);
+1 -1
View File
@@ -792,7 +792,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
/* TODO: make this a gtkfilechooserentry once we move to GTK */
priv->entry = gtk_entry_new ();
priv->combo = gtk_file_chooser_button_new (source->display_text,
priv->combo = gtk_file_chooser_button_new (_("Select a folder"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
g_object_set (priv->combo, "local-only", FALSE, NULL);
+32 -27
View File
@@ -35,37 +35,42 @@ G_BEGIN_DECLS
*/
typedef enum
{
PRIVATE_GTK_USER_STYLE = 1 << 0,
PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */
PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
PRIVATE_GTK_IN_REPARENT = 1 << 6,
PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */
PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */
PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */
PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */
PRIVATE_GTK_REQUEST_NEEDED = 1 << 13 /* Whether we need to call gtk_widget_size_request */
PRIVATE_GTK_USER_STYLE = 1 << 0,
PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */
PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
PRIVATE_GTK_IN_REPARENT = 1 << 6,
PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */
PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */
PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */
PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */
PRIVATE_GTK_REQUEST_NEEDED = 1 << 13, /* Whether we need to call gtk_widget_size_request */
PRIVATE_GTK_WIDTH_REQUEST_NEEDED = 1 << 14, /* Whether we need to call gtk_extended_layout_get_desired_width */
PRIVATE_GTK_HEIGHT_REQUEST_NEEDED = 1 << 15 /* Whether we need to call gtk_extended_layout_get_desired_height */
} GtkPrivateFlags;
/* Macros for extracting a widgets private_flags from GtkWidget.
*/
#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0)
#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0)
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0)
#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0)
#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0)
#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0)
#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0)
#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0)
#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0)
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0)
#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0)
#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0)
#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0)
#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0)
#define GTK_WIDGET_WIDTH_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_WIDTH_REQUEST_NEEDED) != 0)
#define GTK_WIDGET_HEIGHT_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HEIGHT_REQUEST_NEEDED) != 0)
/* Macros for setting and clearing private widget flags.
* we use a preprocessor string concatenation here for a clear
+28
View File
@@ -1334,6 +1334,34 @@ _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style)
return priv->color_hashes;
}
static void gtk_rc_style_prepend_empty_color_hash (GtkRcStyle *rc_style);
void
_gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style,
const gchar *name,
const GdkColor *color)
{
GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
GHashTable *our_hash = NULL;
if (priv->color_hashes)
our_hash = priv->color_hashes->data;
if (our_hash == NULL)
{
if (color == NULL)
return;
gtk_rc_style_prepend_empty_color_hash (rc_style);
our_hash = priv->color_hashes->data;
}
if (color)
g_hash_table_insert (our_hash, g_strdup (name), gdk_color_copy (color));
else
g_hash_table_remove (our_hash, name);
}
static gint
gtk_rc_properties_cmp (gconstpointer bsearch_node1,
gconstpointer bsearch_node2)
+4
View File
@@ -263,6 +263,10 @@ void _gtk_rc_style_unset_rc_property (GtkRcStyle *rc_style,
GSList * _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style);
void _gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style,
const gchar *name,
const GdkColor *color);
const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings);
void _gtk_rc_context_destroy (GtkSettings *settings);
+215 -96
View File
@@ -28,6 +28,7 @@
#include <math.h>
#include <gdk/gdkkeysyms.h>
#include "gtkbindings.h"
#include "gtkextendedlayout.h"
#include "gtkmarshalers.h"
#include "gtkscrolledwindow.h"
#include "gtkwindow.h"
@@ -113,8 +114,6 @@ static void gtk_scrolled_window_screen_changed (GtkWidget *widge
GdkScreen *previous_screen);
static gboolean gtk_scrolled_window_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_scrolled_window_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_scrolled_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean gtk_scrolled_window_scroll_event (GtkWidget *widget,
@@ -142,9 +141,28 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjus
static void gtk_scrolled_window_update_real_placement (GtkScrolledWindow *scrolled_window);
static void gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
static void gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height);
static guint signals[LAST_SIGNAL] = {0};
G_DEFINE_TYPE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN)
G_DEFINE_TYPE_WITH_CODE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_scrolled_window_extended_layout_init))
static void
add_scroll_binding (GtkBindingSet *binding_set,
@@ -198,7 +216,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
widget_class->screen_changed = gtk_scrolled_window_screen_changed;
widget_class->expose_event = gtk_scrolled_window_expose;
widget_class->size_request = gtk_scrolled_window_size_request;
widget_class->size_allocate = gtk_scrolled_window_size_allocate;
widget_class->scroll_event = gtk_scrolled_window_scroll_event;
widget_class->focus = gtk_scrolled_window_focus;
@@ -380,9 +397,15 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
* gtk_scrolled_window_new:
* @hadjustment: (allow-none): horizontal adjustment
* @vadjustment: (allow-none): vertical adjustment
<<<<<<< HEAD
*
* Creates a new scrolled window.
*
=======
*
* Creates a new scrolled window.
*
>>>>>>> native-layout-incubator
* The two arguments are the scrolled window's adjustments; these will be
* shared with the scrollbars and the child widget to keep the bars in sync
* with the child. Usually you want to pass %NULL for the adjustments, which
@@ -1229,98 +1252,6 @@ gtk_scrolled_window_move_focus_out (GtkScrolledWindow *scrolled_window,
g_object_unref (scrolled_window);
}
static void
gtk_scrolled_window_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkScrolledWindow *scrolled_window;
GtkBin *bin;
gint extra_width;
gint extra_height;
gint scrollbar_spacing;
GtkRequisition hscrollbar_requisition;
GtkRequisition vscrollbar_requisition;
GtkRequisition child_requisition;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
g_return_if_fail (requisition != NULL);
scrolled_window = GTK_SCROLLED_WINDOW (widget);
bin = GTK_BIN (scrolled_window);
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
extra_width = 0;
extra_height = 0;
requisition->width = 0;
requisition->height = 0;
gtk_widget_size_request (scrolled_window->hscrollbar,
&hscrollbar_requisition);
gtk_widget_size_request (scrolled_window->vscrollbar,
&vscrollbar_requisition);
if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
requisition->width += child_requisition.width;
else
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
if (aux_info && aux_info->width > 0)
{
requisition->width += aux_info->width;
extra_width = -1;
}
else
requisition->width += vscrollbar_requisition.width;
}
if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
requisition->height += child_requisition.height;
else
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
if (aux_info && aux_info->height > 0)
{
requisition->height += aux_info->height;
extra_height = -1;
}
else
requisition->height += hscrollbar_requisition.height;
}
}
if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC ||
scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
{
requisition->width = MAX (requisition->width, hscrollbar_requisition.width);
if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
extra_height = scrollbar_spacing + hscrollbar_requisition.height;
}
if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC ||
scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
{
requisition->height = MAX (requisition->height, vscrollbar_requisition.height);
if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
}
requisition->width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
requisition->height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
{
requisition->width += 2 * widget->style->xthickness;
requisition->height += 2 * widget->style->ythickness;
}
}
static void
gtk_scrolled_window_relative_allocation (GtkWidget *widget,
GtkAllocation *allocation)
@@ -1795,5 +1726,193 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window)
}
}
static void
gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_scrolled_window_get_desired_width;
iface->get_desired_height = gtk_scrolled_window_get_desired_height;
iface->get_height_for_width = gtk_scrolled_window_get_height_for_width;
iface->get_width_for_height = gtk_scrolled_window_get_width_for_height;
}
static void
gtk_scrolled_window_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkScrolledWindow *scrolled_window;
GtkBin *bin;
gint extra_width;
gint extra_height;
gint scrollbar_spacing;
GtkRequisition hscrollbar_requisition;
GtkRequisition vscrollbar_requisition;
GtkRequisition minimum_req, natural_req;
gint min_child_size, nat_child_size;
scrolled_window = GTK_SCROLLED_WINDOW (layout);
bin = GTK_BIN (scrolled_window);
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
extra_width = 0;
extra_height = 0;
minimum_req.width = 0;
minimum_req.height = 0;
natural_req.width = 0;
natural_req.height = 0;
gtk_widget_size_request (scrolled_window->hscrollbar,
&hscrollbar_requisition);
gtk_widget_size_request (scrolled_window->vscrollbar,
&vscrollbar_requisition);
if (bin->child && gtk_widget_get_visible (bin->child))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child),
&min_child_size,
&nat_child_size);
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
{
minimum_req.width += min_child_size;
natural_req.width += nat_child_size;
}
else
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
if (aux_info && aux_info->width > 0)
{
minimum_req.width += aux_info->width;
natural_req.width += aux_info->width;
extra_width = -1;
}
else
{
minimum_req.width += vscrollbar_requisition.width;
natural_req.width += vscrollbar_requisition.width;
}
}
}
else /* GTK_ORIENTATION_VERTICAL */
{
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child),
&min_child_size,
&nat_child_size);
if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
{
minimum_req.height += min_child_size;
natural_req.height += nat_child_size;
}
else
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE);
if (aux_info && aux_info->height > 0)
{
minimum_req.height += aux_info->height;
natural_req.height += aux_info->height;
extra_height = -1;
}
else
{
minimum_req.height += hscrollbar_requisition.height;
natural_req.height += hscrollbar_requisition.height;
}
}
}
}
if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC ||
scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
{
minimum_req.width = MAX (minimum_req.width, hscrollbar_requisition.width);
natural_req.width = MAX (natural_req.width, hscrollbar_requisition.width);
if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
extra_height = scrollbar_spacing + hscrollbar_requisition.height;
}
if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC ||
scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
{
minimum_req.height = MAX (minimum_req.height, vscrollbar_requisition.height);
natural_req.height = MAX (natural_req.height, vscrollbar_requisition.height);
if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
}
minimum_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width);
minimum_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height);
natural_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width);
natural_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height);
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
{
minimum_req.width += 2 * GTK_WIDGET (layout)->style->xthickness;
minimum_req.height += 2 * GTK_WIDGET (layout)->style->ythickness;
natural_req.width += 2 * GTK_WIDGET (layout)->style->xthickness;
natural_req.height += 2 * GTK_WIDGET (layout)->style->ythickness;
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
if (minimum_size)
*minimum_size = minimum_req.width;
if (natural_size)
*natural_size = natural_req.width;
}
else
{
if (minimum_size)
*minimum_size = minimum_req.height;
if (natural_size)
*natural_size = natural_req.height;
}
}
static void
gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
static void
gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
{
g_return_if_fail (GTK_IS_WIDGET (layout));
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height);
}
static void
gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
{
g_return_if_fail (GTK_IS_WIDGET (layout));
GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width);
}
#define __GTK_SCROLLED_WINDOW_C__
#include "gtkaliasdef.c"
+89 -137
View File
@@ -25,6 +25,7 @@
#include "gtkprivate.h"
#include "gtksizegroup.h"
#include "gtkbuildable.h"
#include "gtkextendedlayout.h"
#include "gtkalias.h"
enum {
@@ -71,6 +72,9 @@ static const gchar size_groups_tag[] = "gtk-size-groups";
static GQuark visited_quark;
static const gchar visited_tag[] = "gtk-size-group-visited";
static GQuark bumping_quark;
static const gchar bumping_tag[] = "gtk-size-group-bumping";
static GSList *
get_size_groups (GtkWidget *widget)
{
@@ -102,6 +106,18 @@ is_visited (gpointer object)
return g_object_get_qdata (object, visited_quark) != NULL;
}
static void
mark_bumping (gpointer object, gboolean bumping)
{
g_object_set_qdata (object, bumping_quark, bumping ? "bumping" : NULL);
}
static gboolean
is_bumping (gpointer object)
{
return g_object_get_qdata (object, bumping_quark) != NULL;
}
static void
add_group_to_closure (GtkSizeGroup *group,
GtkSizeGroupMode mode,
@@ -154,6 +170,8 @@ real_queue_resize (GtkWidget *widget)
{
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
if (widget->parent)
_gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
@@ -284,6 +302,7 @@ initialize_size_group_quarks (void)
{
size_groups_quark = g_quark_from_static_string (size_groups_tag);
visited_quark = g_quark_from_static_string (visited_tag);
bumping_quark = g_quark_from_static_string (bumping_tag);
}
}
@@ -549,7 +568,7 @@ gtk_size_group_add_widget (GtkSizeGroup *size_group,
/**
* gtk_size_group_remove_widget:
* @size_group: a #GtkSizeGrup
* @size_group: a #GtkSizeGroup
* @widget: the #GtkWidget to remove
*
* Removes a widget from a #GtkSizeGroup.
@@ -581,7 +600,7 @@ gtk_size_group_remove_widget (GtkSizeGroup *size_group,
/**
* gtk_size_group_get_widgets:
* @size_group: a #GtkSizeGrup
* @size_group: a #GtkSizeGroup
*
* Returns the list of widgets associated with @size_group.
*
@@ -607,42 +626,35 @@ get_base_dimension (GtkWidget *widget,
if (aux_info && aux_info->width > 0)
return aux_info->width;
else
return widget->requisition.width;
{
/* XXX Possibly we should be using natural values and not minimums here. */
gint width;
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (widget), &width, NULL);
return width;
}
}
else
{
if (aux_info && aux_info->height > 0)
return aux_info->height;
else
return widget->requisition.height;
{
/* XXX Possibly we should be using natural values and not minimums here. */
gint height;
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (widget), &height, NULL);
return height;
}
}
}
static void
do_size_request (GtkWidget *widget)
{
if (GTK_WIDGET_REQUEST_NEEDED (widget))
{
gtk_widget_ensure_style (widget);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
g_signal_emit_by_name (widget,
"size-request",
&widget->requisition);
}
}
static gint
compute_base_dimension (GtkWidget *widget,
GtkSizeGroupMode mode)
{
do_size_request (widget);
return get_base_dimension (widget, mode);
}
static gint
compute_dimension (GtkWidget *widget,
GtkSizeGroupMode mode)
GtkSizeGroupMode mode,
gint widget_requisition)
{
GSList *widgets = NULL;
GSList *groups = NULL;
@@ -658,7 +670,7 @@ compute_dimension (GtkWidget *widget,
if (!groups)
{
result = compute_base_dimension (widget, mode);
result = widget_requisition;
}
else
{
@@ -674,8 +686,12 @@ compute_dimension (GtkWidget *widget,
while (tmp_list)
{
GtkWidget *tmp_widget = tmp_list->data;
gint dimension;
gint dimension = compute_base_dimension (tmp_widget, mode);
if (tmp_widget == widget)
dimension = widget_requisition;
else
dimension = get_base_dimension (tmp_widget, mode);
if (gtk_widget_get_mapped (tmp_widget) || !group->ignore_hidden)
{
@@ -715,122 +731,58 @@ compute_dimension (GtkWidget *widget,
return result;
}
static gint
get_dimension (GtkWidget *widget,
GtkSizeGroupMode mode)
/**
* _gtk_size_group_bump_requisition:
* @widget: a #GtkWidget
* @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
* on the dimension in which to bump the size.
*
* Refreshes the sizegroup while returning the groups requested
* value in the dimension @mode.
*
* This function is used to update sizegroup minimum size information
* in multiple passes from the new #GtkExtendedLayout manager.
*/
gint
_gtk_size_group_bump_requisition (GtkWidget *widget,
GtkSizeGroupMode mode,
gint widget_requisition)
{
GSList *widgets = NULL;
GSList *groups = NULL;
gint result = 0;
gint result = widget_requisition;
add_widget_to_closure (widget, mode, &groups, &widgets);
g_slist_foreach (widgets, (GFunc)mark_unvisited, NULL);
g_slist_foreach (groups, (GFunc)mark_unvisited, NULL);
if (!groups)
if (!is_bumping (widget))
{
result = get_base_dimension (widget, mode);
GtkWidgetAuxInfo *aux_info =
_gtk_widget_get_aux_info (widget, FALSE);
/* Avoid recursion here */
mark_bumping (widget, TRUE);
if (get_size_groups (widget))
{
if (aux_info)
{
if (mode == GTK_SIZE_GROUP_HORIZONTAL)
result = compute_dimension (widget, mode, MAX (aux_info->width, widget_requisition));
else
result = compute_dimension (widget, mode, MAX (aux_info->height, widget_requisition));
}
else
result = compute_dimension (widget, mode, widget_requisition);
}
else if (aux_info)
{
if (mode == GTK_SIZE_GROUP_HORIZONTAL)
result = MAX (aux_info->width, widget_requisition);
else
result = MAX (aux_info->height, widget_requisition);
}
mark_bumping (widget, FALSE);
}
else
{
GtkSizeGroup *group = groups->data;
if (mode == GTK_SIZE_GROUP_HORIZONTAL && group->have_width)
result = group->requisition.width;
else if (mode == GTK_SIZE_GROUP_VERTICAL && group->have_height)
result = group->requisition.height;
}
g_slist_free (widgets);
g_slist_free (groups);
return result;
}
static void
get_fast_child_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE);
*requisition = widget->requisition;
if (aux_info)
{
if (aux_info->width > 0)
requisition->width = aux_info->width;
if (aux_info && aux_info->height > 0)
requisition->height = aux_info->height;
}
}
/**
* _gtk_size_group_get_child_requisition:
* @widget: a #GtkWidget
* @requisition: location to store computed requisition.
*
* Retrieve the "child requisition" of the widget, taking account grouping
* of the widget's requisition with other widgets.
**/
void
_gtk_size_group_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
initialize_size_group_quarks ();
if (requisition)
{
if (get_size_groups (widget))
{
requisition->width = get_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL);
requisition->height = get_dimension (widget, GTK_SIZE_GROUP_VERTICAL);
/* Only do the full computation if we actually have size groups */
}
else
get_fast_child_requisition (widget, requisition);
}
}
/**
* _gtk_size_group_compute_requisition:
* @widget: a #GtkWidget
* @requisition: location to store computed requisition.
*
* Compute the requisition of a widget taking into account grouping of
* the widget's requisition with other widgets.
**/
void
_gtk_size_group_compute_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
gint width;
gint height;
initialize_size_group_quarks ();
if (get_size_groups (widget))
{
/* Only do the full computation if we actually have size groups */
width = compute_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL);
height = compute_dimension (widget, GTK_SIZE_GROUP_VERTICAL);
if (requisition)
{
requisition->width = width;
requisition->height = height;
}
}
else
{
do_size_request (widget);
if (requisition)
get_fast_child_requisition (widget, requisition);
}
}
/**
* _gtk_size_group_queue_resize:
+6 -5
View File
@@ -100,11 +100,12 @@ void gtk_size_group_remove_widget (GtkSizeGroup *size_group,
GSList * gtk_size_group_get_widgets (GtkSizeGroup *size_group);
void _gtk_size_group_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void _gtk_size_group_compute_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void _gtk_size_group_queue_resize (GtkWidget *widget);
gint _gtk_size_group_bump_requisition (GtkWidget *widget,
GtkSizeGroupMode mode,
gint widget_requisition);
void _gtk_size_group_queue_resize (GtkWidget *widget);
G_END_DECLS
+59 -1
View File
@@ -170,6 +170,10 @@ static void gtk_status_icon_screen_changed (GtkStatusIcon *status_icon,
GdkScreen *old_screen);
static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon);
static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon);
static void gtk_status_icon_fg_changed (GtkStatusIcon *status_icon);
static void gtk_status_icon_color_changed (GtkTrayIcon *tray,
GParamSpec *pspec,
GtkStatusIcon *status_icon);
static gboolean gtk_status_icon_scroll (GtkStatusIcon *status_icon,
GdkEventScroll *event);
static gboolean gtk_status_icon_query_tooltip (GtkStatusIcon *status_icon,
@@ -827,7 +831,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
priv = G_TYPE_INSTANCE_GET_PRIVATE (status_icon, GTK_TYPE_STATUS_ICON,
GtkStatusIconPrivate);
status_icon->priv = priv;
priv->storage_type = GTK_IMAGE_EMPTY;
priv->visible = TRUE;
@@ -850,6 +854,14 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
G_CALLBACK (gtk_status_icon_embedded_changed), status_icon);
g_signal_connect_swapped (priv->tray_icon, "notify::orientation",
G_CALLBACK (gtk_status_icon_orientation_changed), status_icon);
g_signal_connect_swapped (priv->tray_icon, "notify::fg-color",
G_CALLBACK (gtk_status_icon_fg_changed), status_icon);
g_signal_connect (priv->tray_icon, "notify::error-color",
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
g_signal_connect (priv->tray_icon, "notify::warning-color",
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
g_signal_connect (priv->tray_icon, "notify::success-color",
G_CALLBACK (gtk_status_icon_color_changed), status_icon);
g_signal_connect_swapped (priv->tray_icon, "button-press-event",
G_CALLBACK (gtk_status_icon_button_press), status_icon);
g_signal_connect_swapped (priv->tray_icon, "button-release-event",
@@ -974,6 +986,10 @@ gtk_status_icon_finalize (GObject *object)
gtk_status_icon_embedded_changed, status_icon);
g_signal_handlers_disconnect_by_func (priv->tray_icon,
gtk_status_icon_orientation_changed, status_icon);
g_signal_handlers_disconnect_by_func (priv->tray_icon,
gtk_status_icon_fg_changed, status_icon);
g_signal_handlers_disconnect_by_func (priv->tray_icon,
gtk_status_icon_color_changed, status_icon);
g_signal_handlers_disconnect_by_func (priv->tray_icon,
gtk_status_icon_button_press, status_icon);
g_signal_handlers_disconnect_by_func (priv->tray_icon,
@@ -1690,6 +1706,48 @@ gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon)
g_object_notify (G_OBJECT (status_icon), "orientation");
}
static void
gtk_status_icon_fg_changed (GtkStatusIcon *status_icon)
{
GtkStatusIconPrivate *priv = status_icon->priv;
GdkColor color;
g_object_get (priv->tray_icon, "fg-color", &color, NULL);
gtk_widget_modify_fg (priv->image, GTK_STATE_NORMAL, &color);
}
static void
gtk_status_icon_color_changed (GtkTrayIcon *tray,
GParamSpec *pspec,
GtkStatusIcon *status_icon)
{
GtkStatusIconPrivate *priv = status_icon->priv;
const gchar *name;
GdkColor color;
switch (pspec->name[0])
{
case 'e':
name = "error";
break;
case 'w':
name = "warning";
break;
case 's':
name = "success";
break;
default:
name = NULL;
break;
}
if (name)
{
g_object_get (priv->tray_icon, pspec->name, &color, NULL);
gtk_widget_modify_symbolic_color (priv->image, name, &color);
}
}
static gboolean
gtk_status_icon_key_press (GtkStatusIcon *status_icon,
GdkEventKey *event)
+2 -2
View File
@@ -470,11 +470,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
gtk_widget_show (icon);
}
if (icon && text_orientation == GTK_ORIENTATION_HORIZONTAL)
if (GTK_IS_MISC (icon) && text_orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_misc_set_alignment (GTK_MISC (icon),
1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
0.5);
else if (icon)
else if (GTK_IS_MISC (icon))
gtk_misc_set_alignment (GTK_MISC (icon),
0.5,
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
+177 -5
View File
@@ -43,7 +43,11 @@
enum {
PROP_0,
PROP_ORIENTATION
PROP_ORIENTATION,
PROP_FG_COLOR,
PROP_ERROR_COLOR,
PROP_WARNING_COLOR,
PROP_SUCCESS_COLOR
};
struct _GtkTrayIconPrivate
@@ -55,11 +59,16 @@ struct _GtkTrayIconPrivate
Atom system_tray_opcode_atom;
Atom orientation_atom;
Atom visual_atom;
Atom colors_atom;
Window manager_window;
GdkVisual *manager_visual;
gboolean manager_visual_rgba;
GtkOrientation orientation;
GdkColor fg_color;
GdkColor error_color;
GdkColor warning_color;
GdkColor success_color;
};
static void gtk_tray_icon_constructed (GObject *object);
@@ -75,7 +84,7 @@ static void gtk_tray_icon_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static gboolean gtk_tray_icon_delete (GtkWidget *widget,
GdkEventAny *event);
static gboolean gtk_tray_icon_expose (GtkWidget *widget,
static gboolean gtk_tray_icon_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_tray_icon_clear_manager_window (GtkTrayIcon *icon);
@@ -113,6 +122,38 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class)
GTK_ORIENTATION_HORIZONTAL,
GTK_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_FG_COLOR,
g_param_spec_boxed ("fg-color",
P_("Foreground color"),
P_("Foreground color for symbolic icons"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_ERROR_COLOR,
g_param_spec_boxed ("error-color",
P_("Error color"),
P_("Error color for symbolic icons"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_WARNING_COLOR,
g_param_spec_boxed ("warning-color",
P_("Warning color"),
P_("Warning color for symbolic icons"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_SUCCESS_COLOR,
g_param_spec_boxed ("success-color",
P_("Success color"),
P_("Success color for symbolic icons"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
g_type_class_add_private (class, sizeof (GtkTrayIconPrivate));
}
@@ -121,9 +162,21 @@ gtk_tray_icon_init (GtkTrayIcon *icon)
{
icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, GTK_TYPE_TRAY_ICON,
GtkTrayIconPrivate);
icon->priv->stamp = 1;
icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
icon->priv->fg_color.red = 0x0000;
icon->priv->fg_color.green = 0x0000;
icon->priv->fg_color.blue = 0x0000;
icon->priv->error_color.red = 0xcc00;
icon->priv->error_color.green = 0x0000;
icon->priv->error_color.blue = 0x0000;
icon->priv->warning_color.red = 0xf500;
icon->priv->warning_color.green = 0x7900;
icon->priv->warning_color.blue = 0x3e00;
icon->priv->success_color.red = 0x4e00;
icon->priv->success_color.green = 0x9a00;
icon->priv->success_color.blue = 0x0600;
gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE);
gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
@@ -161,6 +214,10 @@ gtk_tray_icon_constructed (GObject *object)
"_NET_SYSTEM_TRAY_VISUAL",
False);
icon->priv->colors_atom = XInternAtom (xdisplay,
"_NET_SYSTEM_TRAY_COLORS",
False);
/* Add a root window filter so that we get changes on MANAGER */
gdk_window_add_filter (root_window,
gtk_tray_icon_manager_filter, icon);
@@ -212,6 +269,18 @@ gtk_tray_icon_get_property (GObject *object,
case PROP_ORIENTATION:
g_value_set_enum (value, icon->priv->orientation);
break;
case PROP_FG_COLOR:
g_value_set_boxed (value, &icon->priv->fg_color);
break;
case PROP_ERROR_COLOR:
g_value_set_boxed (value, &icon->priv->error_color);
break;
case PROP_WARNING_COLOR:
g_value_set_boxed (value, &icon->priv->warning_color);
break;
case PROP_SUCCESS_COLOR:
g_value_set_boxed (value, &icon->priv->success_color);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -372,9 +441,103 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
XFree (prop.prop);
}
static void
gtk_tray_icon_get_colors_property (GtkTrayIcon *icon)
{
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon));
GdkDisplay *display = gdk_screen_get_display (screen);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
Atom type;
int format;
union {
gulong *prop;
guchar *prop_ch;
} prop = { NULL };
gulong nitems;
gulong bytes_after;
int error, result;
g_assert (icon->priv->manager_window != None);
gdk_error_trap_push ();
type = None;
result = XGetWindowProperty (xdisplay,
icon->priv->manager_window,
icon->priv->colors_atom,
0, G_MAXLONG, FALSE,
XA_CARDINAL,
&type, &format, &nitems,
&bytes_after, &(prop.prop_ch));
error = gdk_error_trap_pop ();
if (error || result != Success)
return;
if (type == XA_CARDINAL && nitems == 12 && format == 32)
{
GdkColor color;
g_object_freeze_notify (G_OBJECT (icon));
color.red = prop.prop[0];
color.green = prop.prop[1];
color.blue = prop.prop[2];
if (!gdk_color_equal (&icon->priv->fg_color, &color))
{
icon->priv->fg_color = color;
g_object_notify (G_OBJECT (icon), "fg-color");
}
color.red = prop.prop[3];
color.green = prop.prop[4];
color.blue = prop.prop[5];
if (!gdk_color_equal (&icon->priv->error_color, &color))
{
icon->priv->error_color = color;
g_object_notify (G_OBJECT (icon), "error-color");
}
g_object_thaw_notify (G_OBJECT (icon));
color.red = prop.prop[6];
color.green = prop.prop[7];
color.blue = prop.prop[8];
if (!gdk_color_equal (&icon->priv->warning_color, &color))
{
icon->priv->warning_color = color;
g_object_notify (G_OBJECT (icon), "warning-color");
}
g_object_thaw_notify (G_OBJECT (icon));
color.red = prop.prop[9];
color.green = prop.prop[10];
color.blue = prop.prop[11];
if (!gdk_color_equal (&icon->priv->success_color, &color))
{
icon->priv->success_color = color;
g_object_notify (G_OBJECT (icon), "success-color");
}
g_object_thaw_notify (G_OBJECT (icon));
}
if (type != None)
XFree (prop.prop);
}
static GdkFilterReturn
gtk_tray_icon_manager_filter (GdkXEvent *xevent,
GdkEvent *event,
gtk_tray_icon_manager_filter (GdkXEvent *xevent,
GdkEvent *event,
gpointer user_data)
{
GtkTrayIcon *icon = user_data;
@@ -399,6 +562,14 @@ gtk_tray_icon_manager_filter (GdkXEvent *xevent,
gtk_tray_icon_get_orientation_property (icon);
}
else if (xev->xany.type == PropertyNotify &&
xev->xproperty.atom == icon->priv->colors_atom)
{
GTK_NOTE (PLUGSOCKET,
g_print ("GtkStatusIcon %p: got PropertyNotify on manager window for colors atom\n", icon));
gtk_tray_icon_get_colors_property (icon);
}
else if (xev->xany.type == DestroyNotify)
{
GTK_NOTE (PLUGSOCKET,
@@ -504,6 +675,7 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon)
gtk_tray_icon_get_orientation_property (icon);
gtk_tray_icon_get_visual_property (icon);
gtk_tray_icon_get_colors_property (icon);
if (gtk_widget_get_realized (GTK_WIDGET (icon)))
{
+1 -1
View File
@@ -69,7 +69,7 @@ void _gtk_tray_icon_cancel_message (GtkTrayIcon *icon,
guint id);
GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon);
G_END_DECLS
#endif /* __GTK_TRAY_ICON_H__ */
+25
View File
@@ -622,6 +622,31 @@ gtk_tree_path_get_indices (GtkTreePath *path)
return path->indices;
}
/**
* gtk_tree_path_get_indices_with_depth:
* @path: A #GtkTreePath.
* @depth: Number of elements returned in the integer array
*
* Returns the current indices of @path.
* This is an array of integers, each representing a node in a tree.
* It also returns the number of elements in the array.
* The array should not be freed.
*
* Return value: (array length=depth): The current indices, or %NULL.
*
* Since: 3.0
**/
gint *
gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth)
{
g_return_val_if_fail (path != NULL, NULL);
if (depth)
*depth = path->depth;
return path->indices;
}
/**
* gtk_tree_path_free:
* @path: A #GtkTreePath.
+4
View File
@@ -134,6 +134,10 @@ void gtk_tree_path_prepend_index (GtkTreePath *path,
gint index_);
gint gtk_tree_path_get_depth (GtkTreePath *path);
gint *gtk_tree_path_get_indices (GtkTreePath *path);
gint *gtk_tree_path_get_indices_with_depth (GtkTreePath *path,
gint *depth);
void gtk_tree_path_free (GtkTreePath *path);
GtkTreePath *gtk_tree_path_copy (const GtkTreePath *path);
GType gtk_tree_path_get_type (void) G_GNUC_CONST;
+55 -22
View File
@@ -234,6 +234,14 @@ static GtkTreePath *gtk_tree_model_filter_remove_root (GtkTr
static void gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter);
static void gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self,
GtkTreeModel *child_model,
GtkTreeIter *iter,
GValue *value,
gint column);
static gboolean gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter,
GtkTreeModel *child_model,
GtkTreeIter *child_iter);
static gboolean gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
GtkTreeIter *child_iter);
static void gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter,
@@ -311,6 +319,9 @@ gtk_tree_model_filter_class_init (GtkTreeModelFilterClass *filter_class)
object_class->finalize = gtk_tree_model_filter_finalize;
filter_class->visible = gtk_tree_model_filter_real_visible;
filter_class->modify = gtk_tree_model_filter_real_modify;
/* Properties -- FIXME: disabled translations for now, until I can come up with a
* better description
*/
@@ -756,12 +767,13 @@ gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter)
}
static gboolean
gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
GtkTreeIter *child_iter)
gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter,
GtkTreeModel *child_model,
GtkTreeIter *child_iter)
{
if (filter->priv->visible_func)
{
return filter->priv->visible_func (filter->priv->child_model,
return filter->priv->visible_func (child_model,
child_iter,
filter->priv->visible_data)
? TRUE : FALSE;
@@ -770,7 +782,7 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
{
GValue val = {0, };
gtk_tree_model_get_value (filter->priv->child_model, child_iter,
gtk_tree_model_get_value (child_model, child_iter,
filter->priv->visible_column, &val);
if (g_value_get_boolean (&val))
@@ -787,6 +799,14 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter,
return TRUE;
}
static gboolean
gtk_tree_model_filter_visible (GtkTreeModelFilter *self,
GtkTreeIter *child_iter)
{
return GTK_TREE_MODEL_FILTER_GET_CLASS (self)->visible (self,
self->priv->child_model, child_iter);
}
static void
gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter,
FilterLevel *level)
@@ -2383,36 +2403,49 @@ gtk_tree_model_filter_get_path (GtkTreeModel *model,
return retval;
}
static void
gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self,
GtkTreeModel *child_model,
GtkTreeIter *iter,
GValue *value,
gint column)
{
if (self->priv->modify_func)
{
g_return_if_fail (column < self->priv->modify_n_columns);
g_value_init (value, self->priv->modify_types[column]);
self->priv->modify_func (GTK_TREE_MODEL (self),
iter,
value,
column,
self->priv->modify_data);
}
else
{
GtkTreeIter child_iter;
gtk_tree_model_filter_convert_iter_to_child_iter (
GTK_TREE_MODEL_FILTER (self), &child_iter, iter);
gtk_tree_model_get_value (child_model,
&child_iter, column, value);
}
}
static void
gtk_tree_model_filter_get_value (GtkTreeModel *model,
GtkTreeIter *iter,
gint column,
GValue *value)
{
GtkTreeIter child_iter;
GtkTreeModelFilter *filter = GTK_TREE_MODEL_FILTER (model);
g_return_if_fail (GTK_IS_TREE_MODEL_FILTER (model));
g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->child_model != NULL);
g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp);
if (filter->priv->modify_func)
{
g_return_if_fail (column < filter->priv->modify_n_columns);
g_value_init (value, filter->priv->modify_types[column]);
filter->priv->modify_func (model,
iter,
value,
column,
filter->priv->modify_data);
return;
}
gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_iter, iter);
gtk_tree_model_get_value (GTK_TREE_MODEL_FILTER (model)->priv->child_model,
&child_iter, column, value);
GTK_TREE_MODEL_FILTER_GET_CLASS (model)->modify (filter,
filter->priv->child_model, iter, value, column);
}
static gboolean
+9 -2
View File
@@ -62,11 +62,18 @@ struct _GtkTreeModelFilterClass
{
GObjectClass parent_class;
gboolean (* visible) (GtkTreeModelFilter *self,
GtkTreeModel *child_model,
GtkTreeIter *iter);
void (* modify) (GtkTreeModelFilter *self,
GtkTreeModel *child_model,
GtkTreeIter *iter,
GValue *value,
gint column);
/* Padding for future expansion */
void (*_gtk_reserved0) (void);
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
};
/* base */
+88 -32
View File
@@ -26,6 +26,7 @@
#include "config.h"
#include "gtkviewport.h"
#include "gtkextendedlayout.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@@ -79,8 +80,6 @@ static gint gtk_viewport_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_viewport_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_viewport_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_viewport_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
@@ -88,7 +87,18 @@ static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
static void gtk_viewport_style_set (GtkWidget *widget,
GtkStyle *previous_style);
G_DEFINE_TYPE (GtkViewport, gtk_viewport, GTK_TYPE_BIN)
static void gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_viewport_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_viewport_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkViewport, gtk_viewport, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_viewport_extended_layout_init))
static void
gtk_viewport_class_init (GtkViewportClass *class)
@@ -111,7 +121,6 @@ gtk_viewport_class_init (GtkViewportClass *class)
widget_class->realize = gtk_viewport_realize;
widget_class->unrealize = gtk_viewport_unrealize;
widget_class->expose_event = gtk_viewport_expose;
widget_class->size_request = gtk_viewport_size_request;
widget_class->size_allocate = gtk_viewport_size_allocate;
widget_class->style_set = gtk_viewport_style_set;
@@ -436,10 +445,13 @@ viewport_set_vadjustment_values (GtkViewport *viewport,
if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
gint natural_height;
gtk_widget_get_child_requisition (bin->child, &child_requisition);
vadjustment->upper = MAX (child_requisition.height, view_allocation.height);
gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child),
view_allocation.width,
NULL,
&natural_height);
vadjustment->upper = MAX (natural_height, view_allocation.height);
}
else
vadjustment->upper = view_allocation.height;
@@ -740,31 +752,6 @@ gtk_viewport_add (GtkContainer *container,
GTK_CONTAINER_CLASS (gtk_viewport_parent_class)->add (container, child);
}
static void
gtk_viewport_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkBin *bin = GTK_BIN (widget);
GtkRequisition child_requisition;
requisition->width = GTK_CONTAINER (widget)->border_width;
requisition->height = GTK_CONTAINER (widget)->border_width;
if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE)
{
requisition->width += 2 * widget->style->xthickness;
requisition->height += 2 * widget->style->ythickness;
}
if (bin->child && gtk_widget_get_visible (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
static void
gtk_viewport_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -868,5 +855,74 @@ gtk_viewport_style_set (GtkWidget *widget,
}
}
static void
gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_viewport_get_desired_width;
iface->get_desired_height = gtk_viewport_get_desired_height;
}
static void
gtk_viewport_get_desired_size (GtkExtendedLayout *layout,
GtkOrientation orientation,
gint *minimum_size,
gint *natural_size)
{
GtkWidget *child;
gint child_min, child_nat;
gint minimum, natural;
child = gtk_bin_get_child (GTK_BIN (layout));
/* XXX This should probably be (border_width * 2); but GTK+ has
* been doing this with a single border for a while now...
*/
minimum = GTK_CONTAINER (layout)->border_width;
if (GTK_VIEWPORT (layout)->shadow_type != GTK_SHADOW_NONE)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
minimum += 2 * GTK_WIDGET (layout)->style->xthickness;
else
minimum += 2 * GTK_WIDGET (layout)->style->ythickness;
}
natural = minimum;
if (child && gtk_widget_get_visible (child))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
else
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
}
if (minimum_size)
*minimum_size = minimum;
if (natural_size)
*natural_size = natural;
}
static void
gtk_viewport_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
}
static void
gtk_viewport_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
}
#define __GTK_VIEWPORT_C__
#include "gtkaliasdef.c"
+124 -17
View File
@@ -53,6 +53,7 @@
#include "gtkinvisible.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
#include "gtkextendedlayout.h"
#include "gtkalias.h"
/**
@@ -344,6 +345,14 @@ static void gtk_widget_buildable_custom_finished (GtkBuildable
static void gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
GtkBuilder *builder);
static void gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_widget_real_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_widget_real_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_widget_queue_tooltip_query (GtkWidget *widget);
static void gtk_widget_set_usize_internal (GtkWidget *widget,
@@ -419,6 +428,13 @@ gtk_widget_get_type (void)
NULL /* interface data */
};
const GInterfaceInfo layout_info =
{
(GInterfaceInitFunc) gtk_widget_extended_layout_init,
(GInterfaceFinalizeFunc) NULL,
NULL /* interface data */
};
widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget",
&widget_info, G_TYPE_FLAG_ABSTRACT);
@@ -426,7 +442,8 @@ gtk_widget_get_type (void)
&accessibility_info) ;
g_type_add_interface_static (widget_type, GTK_TYPE_BUILDABLE,
&buildable_info) ;
g_type_add_interface_static (widget_type, GTK_TYPE_EXTENDED_LAYOUT,
&layout_info) ;
}
return widget_type;
@@ -2836,6 +2853,8 @@ gtk_widget_init (GtkWidget *widget)
GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_ON_ALLOC);
GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
widget->style = gtk_widget_get_default_style ();
@@ -3862,7 +3881,7 @@ gtk_widget_draw (GtkWidget *widget,
* Also remember that the size request is not necessarily the size
* a widget will actually be allocated.
*
* See also gtk_widget_get_child_requisition().
* Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead.
**/
void
gtk_widget_size_request (GtkWidget *widget,
@@ -3872,10 +3891,11 @@ gtk_widget_size_request (GtkWidget *widget,
#ifdef G_ENABLE_DEBUG
if (requisition == &widget->requisition)
g_warning ("gtk_widget_size_request() called on child widget with request equal\n to widget->requisition. gtk_widget_set_usize() may not work properly.");
g_warning ("gtk_widget_size_request() called on child widget with request equal\n"
"to widget->requisition. gtk_widget_set_usize() may not work properly.");
#endif /* G_ENABLE_DEBUG */
_gtk_size_group_compute_requisition (widget, requisition);
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL);
}
/**
@@ -3901,12 +3921,15 @@ gtk_widget_size_request (GtkWidget *widget,
* since the last time a resize was queued. In general, only container
* implementations have this information; applications should use
* gtk_widget_size_request().
*
*
* Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead.
**/
void
gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
_gtk_size_group_get_child_requisition (widget, requisition);
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL);
}
static gboolean
@@ -6683,6 +6706,32 @@ gtk_widget_modify_color_component (GtkWidget *widget,
gtk_widget_modify_style (widget, rc_style);
}
/**
* gtk_widget_modify_symbolic_color:
* @widget: a #GtkWidget
* @name: the name of the symbolic color to modify
* @color: (allow-none): the color to assign (does not need to be allocated),
* or %NULL to undo the effect of previous calls to
* of gtk_widget_modify_symbolic_color().
*
* Sets a symbolic color for a widget.
* All other style values are left untouched. See also
* gtk_widget_modify_style().
*
* Since: 3.0
**/
void
gtk_widget_modify_symbolic_color (GtkWidget *widget,
const gchar *name,
const GdkColor *color)
{
GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget);
_gtk_rc_style_set_symbolic_color (rc_style, name, color);
gtk_widget_modify_style (widget, rc_style);
}
/**
* gtk_widget_modify_fg:
* @widget: a #GtkWidget
@@ -9296,20 +9345,18 @@ _gtk_widget_get_aux_info (GtkWidget *widget,
aux_info = g_object_get_qdata (G_OBJECT (widget), quark_aux_info);
if (!aux_info && create)
{
aux_info = g_slice_new (GtkWidgetAuxInfo);
aux_info = g_slice_new0 (GtkWidgetAuxInfo);
aux_info->width = -1;
aux_info->height = -1;
aux_info->x = 0;
aux_info->y = 0;
aux_info->x_set = FALSE;
aux_info->y_set = FALSE;
g_object_set_qdata (G_OBJECT (widget), quark_aux_info, aux_info);
}
return aux_info;
}
/*****************************************
* gtk_widget_aux_info_destroy:
*
@@ -10155,13 +10202,13 @@ gtk_requisition_get_type (void)
* @widget: a #GtkWidget
*
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
* if no class-specific #AtkObject implementation is available for the widget
* instance in question, it will inherit an #AtkObject implementation from the
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then this #AtkObject instance may be a no-op. Likewise,
* if no class-specific #AtkObject implementation is available for the widget
* instance in question, it will inherit an #AtkObject implementation from the
* first ancestor class for which such an implementation is defined.
*
* The documentation of the <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
@@ -10742,7 +10789,67 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable,
}
}
/*
* GtkExtendedLayout implementation
*/
static void
gtk_widget_real_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
/* Set the initial values so that unimplemented classes will fall back
* on the "size-request" collected values (see gtksizegroup.c:do_size_request()).
*/
if (minimum_size)
*minimum_size = GTK_WIDGET (layout)->requisition.width;
if (natural_size)
*natural_size = GTK_WIDGET (layout)->requisition.width;
}
static void
gtk_widget_real_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
/* Set the initial values so that unimplemented classes will fall back
* on the "size-request" collected values (see gtksizegroup.c:do_size_request()).
*/
if (minimum_size)
*minimum_size = GTK_WIDGET (layout)->requisition.height;
if (natural_size)
*natural_size = GTK_WIDGET (layout)->requisition.height;
}
static void
gtk_widget_real_get_height_for_width (GtkExtendedLayout *layout,
gint width,
gint *minimum_height,
gint *natural_height)
{
gtk_extended_layout_get_desired_height (layout, minimum_height, natural_height);
}
static void
gtk_widget_real_get_width_for_height (GtkExtendedLayout *layout,
gint height,
gint *minimum_width,
gint *natural_width)
{
gtk_extended_layout_get_desired_width (layout, minimum_width, natural_width);
}
static void
gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_widget_real_get_desired_width;
iface->get_desired_height = gtk_widget_real_get_desired_height;
iface->get_width_for_height = gtk_widget_real_get_width_for_height;
iface->get_height_for_width = gtk_widget_real_get_height_for_width;
}
/**
* gtk_widget_get_clipboard:
* @widget: a #GtkWidget
+5
View File
@@ -482,6 +482,7 @@ typedef struct _GtkClipboard GtkClipboard;
typedef struct _GtkTooltip GtkTooltip;
typedef struct _GtkWindow GtkWindow;
/**
* GtkAllocation:
* @x: the X position of the widget's area relative to its parents allocation.
@@ -817,6 +818,7 @@ struct _GtkWidgetAuxInfo
gint y;
gint width;
gint height;
guint x_set : 1;
guint y_set : 1;
};
@@ -1156,6 +1158,9 @@ void gtk_widget_modify_cursor (GtkWidget *widget,
const GdkColor *secondary);
void gtk_widget_modify_font (GtkWidget *widget,
PangoFontDescription *font_desc);
void gtk_widget_modify_symbolic_color (GtkWidget *widget,
const gchar *name,
const GdkColor *color);
#ifndef GTK_DISABLE_DEPRECATED
+72 -29
View File
@@ -48,6 +48,7 @@
#include "gtkmarshalers.h"
#include "gtkplug.h"
#include "gtkbuildable.h"
#include "gtkextendedlayout.h"
#include "gtkalias.h"
#ifdef GDK_WINDOWING_X11
@@ -207,8 +208,6 @@ static void gtk_window_map (GtkWidget *widget);
static void gtk_window_unmap (GtkWidget *widget);
static void gtk_window_realize (GtkWidget *widget);
static void gtk_window_unrealize (GtkWidget *widget);
static void gtk_window_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_window_event (GtkWidget *widget,
@@ -350,9 +349,19 @@ static void gtk_window_buildable_custom_finished (GtkBuildable *buildable,
gpointer user_data);
static void gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_window_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
static void gtk_window_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_window_buildable_interface_init))
gtk_window_buildable_interface_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
gtk_window_extended_layout_init))
static void
add_tab_bindings (GtkBindingSet *binding_set,
@@ -451,7 +460,6 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->unmap = gtk_window_unmap;
widget_class->realize = gtk_window_realize;
widget_class->unrealize = gtk_window_unrealize;
widget_class->size_request = gtk_window_size_request;
widget_class->size_allocate = gtk_window_size_allocate;
widget_class->configure_event = gtk_window_configure_event;
widget_class->key_press_event = gtk_window_key_press_event;
@@ -4933,30 +4941,6 @@ gtk_window_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
}
static void
gtk_window_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWindow *window;
GtkBin *bin;
window = GTK_WINDOW (widget);
bin = GTK_BIN (window);
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
static void
gtk_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -5546,6 +5530,64 @@ gtk_window_real_set_focus (GtkWindow *window,
}
}
static void
gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface)
{
iface->get_desired_width = gtk_window_get_desired_width;
iface->get_desired_height = gtk_window_get_desired_height;
}
static void
gtk_window_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
GtkWindow *window;
GtkWidget *child;
window = GTK_WINDOW (layout);
child = gtk_bin_get_child (GTK_BIN (window));
*minimum_size = GTK_CONTAINER (window)->border_width * 2;
*natural_size = GTK_CONTAINER (window)->border_width * 2;
if (child && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
*minimum_size += child_min;
*natural_size += child_nat;
}
}
static void
gtk_window_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_size,
gint *natural_size)
{
GtkWindow *window;
GtkWidget *child;
window = GTK_WINDOW (layout);
child = gtk_bin_get_child (GTK_BIN (window));
*minimum_size = GTK_CONTAINER (window)->border_width * 2;
*natural_size = GTK_CONTAINER (window)->border_width * 2;
if (child && gtk_widget_get_visible (child))
{
gint child_min, child_nat;
gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat);
*minimum_size += child_min;
*natural_size += child_nat;
}
}
/**
* _gtk_window_unset_focus_and_default:
* @window: a #GtkWindow
@@ -8468,7 +8510,8 @@ gtk_window_get_window_type (GtkWindow *window)
return window->type;
}
/* gtk_window_get_mnemonics_visible:
/**
* gtk_window_get_mnemonics_visible:
* @window: a #GtkWindow
*
* Gets the value of the #GtkWindow:mnemonics-visible property.
+4
View File
@@ -47,6 +47,10 @@ TEST_PROGS += recentmanager
recentmanager_SOURCES = recentmanager.c
recentmanager_LDADD = $(progs_ldadd)
TEST_PROGS += menuproxy
menuproxy_SOURCES = menuproxy.c
menuproxy_LDADD = $(progs_ldadd)
TEST_PROGS += floating
floating_SOURCES = floating.c
floating_LDADD = $(progs_ldadd)
+278
View File
@@ -0,0 +1,278 @@
/*
* Copyright (C) 2009 Canonical, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Cody Russell <bratsche@gnome.org>
*/
#undef GTK_DISABLE_DEPRECATED
#include "../gtk/gtk.h"
typedef struct _TestProxy TestProxy;
typedef struct _TestProxyClass TestProxyClass;
//static GType test_proxy_type_id = 0;
//static TestProxyClass *test_proxy_parent_class = NULL;
#define TEST_TYPE_PROXY (test_proxy_type_id)
#define TEST_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_PROXY, TestProxy))
#define TEST_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_PROXY, TestProxyClass))
#define TEST_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_PROXY))
struct _TestProxy
{
GtkMenuProxy parent_object;
};
struct _TestProxyClass
{
GtkMenuProxyClass parent_class;
};
static void test_proxy_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position);
G_DEFINE_DYNAMIC_TYPE(TestProxy, test_proxy, GTK_TYPE_MENU_PROXY)
static void
test_proxy_init (TestProxy *proxy)
{
}
static void
test_proxy_class_init (TestProxyClass *class)
{
GtkMenuProxyClass *proxy_class = GTK_MENU_PROXY_CLASS (class);
test_proxy_parent_class = g_type_class_peek_parent (class);
proxy_class->insert = test_proxy_insert;
}
static void
test_proxy_class_finalize (TestProxyClass *class)
{
}
static void
test_proxy_insert (GtkMenuProxy *proxy,
GtkWidget *child,
guint position)
{
}
/* ---------------------------------------------------- */
#define TEST_TYPE_MODULE (test_module_get_type ())
#define TEST_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_MODULE, TestModule))
#define TEST_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_MODULE, TestModuleClass))
#define TEST_IS_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_MODULE))
#define TEST_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_MODULE))
#define TEST_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_MODULE, TestModuleClass))
typedef struct _TestModule TestModule;
typedef struct _TestModuleClass TestModuleClass;
struct _TestModule
{
GTypeModule parent_instance;
};
struct _TestModuleClass
{
GTypeModuleClass parent_class;
};
static gboolean
test_module_load (GTypeModule *module)
{
g_print ("registering type...\n");
g_print (" type_id = %d\n", test_proxy_type_id);
test_proxy_register_type (G_TYPE_MODULE (module));
//test_proxy_get_type (G_TYPE_MODULE (module));
g_print (" type_id = %d\n", test_proxy_type_id);
return TRUE;
}
static void
test_module_unload (GTypeModule *module)
{
}
static void
test_module_class_init (TestModuleClass *class)
{
GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
type_module_class->load = test_module_load;
type_module_class->unload = test_module_unload;
}
static void
test_module_init (TestModule *module)
{
}
G_DEFINE_TYPE (TestModule, test_module, G_TYPE_TYPE_MODULE);
TestModule *
test_module_new (void)
{
TestModule *module = g_object_new (TEST_TYPE_MODULE,
NULL);
g_print ("test_module_new(): %p\n", module);
return module;
}
/* ---------------------------------------------------- */
static void
non_null_proxy_test (void)
{
GtkMenuProxyModule *module;
/* prevent the module loader from finding a proxy module */
g_unsetenv ("GTK_MENUPROXY");
module = gtk_menu_proxy_module_get ();
test_proxy_register_type (G_TYPE_MODULE (module));
//test_proxy_get_type (G_TYPE_MODULE (module));
GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
g_object_ref_sink (widget);
g_assert (GTK_IS_MENU_BAR (widget));
//g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
g_object_unref (widget);
}
static void
null_proxy_test (void)
{
GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
g_object_ref_sink (widget);
g_assert (GTK_IS_MENU_BAR (widget));
//g_assert (GTK_MENU_SHELL (widget)->proxy == NULL);
g_object_unref (widget);
}
static gboolean inserted_called = FALSE;
static void
inserted_cb (GtkMenuProxy *proxy,
GtkWidget *child,
guint position,
gpointer data)
{
g_return_if_fail (GTK_IS_MENU_PROXY (proxy));
g_return_if_fail (GTK_IS_WIDGET (child));
inserted_called = TRUE;
}
static void
menubar_signals_proxy_test (void)
{
GtkWidget *widget = NULL;
GtkWidget *menuitem = NULL;
GtkMenuProxy *proxy;
//gtk_menu_proxy_register_type (test_proxy_get_type ());
widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
g_object_ref_sink (widget);
g_assert (GTK_IS_MENU_BAR (widget));
//g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
/*
proxy = GTK_MENU_SHELL (widget)->proxy;
g_signal_connect (proxy,
"inserted", G_CALLBACK (inserted_cb),
NULL);
*/
// insert menuitem
menuitem = gtk_menu_item_new_with_label ("Test Item");
gtk_menu_shell_append (GTK_MENU_SHELL (widget),
menuitem);
g_assert (inserted_called == TRUE);
g_object_unref (widget);
}
static void
proxy_type_exists_test (void)
{
#if 0
GtkMenuProxyModule *module;
g_unsetenv ("GTK_MENUPROXY");
module = gtk_menu_proxy_module_get ();
test_proxy_get_type (G_TYPE_MODULE (module));
#endif
g_assert (gtk_menu_proxy_get_type () != 0);
}
static void
can_instantiate_test (void)
{
TestModule *module = test_module_new ();
g_type_module_use (G_TYPE_MODULE (module));
GtkMenuProxy *proxy = gtk_menu_proxy_get ();
g_assert (proxy != NULL);
g_object_ref_sink (proxy);
g_assert (TEST_IS_PROXY (proxy));
g_assert (GTK_IS_MENU_PROXY (proxy));
g_object_unref (proxy);
}
int
main (int argc, char *argv[])
{
gtk_test_init (&argc, &argv);
g_test_add_func ("/proxy/null-proxy", null_proxy_test);
g_test_add_func ("/proxy/type-exists", proxy_type_exists_test);
g_test_add_func ("/proxy/can-instantiate", can_instantiate_test);
g_test_add_func ("/proxy/non-null-proxy", non_null_proxy_test);
g_test_add_func ("/proxy/menubar-signals-proxy", menubar_signals_proxy_test);
return g_test_run();
}
+90 -138
View File
@@ -1,15 +1,15 @@
# Qırımtatarca translation of gtk+-properties
# This file is distributed under the same license as the gtk+-properties package.
#
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009.
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009, 2010.
msgid ""
msgstr ""
"Project-Id-Version: gtk+-properties\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-22 23:35-0400\n"
"PO-Revision-Date: 2009-04-09 04:32-0500\n"
"PO-Revision-Date: 2010-05-02 13:42-0500\n"
"Last-Translator: Reşat SABIQ <tilde.birlik@gmail.com>\n"
"Language-Team: Qırımtatarca (Qırım Türkçesi) <tilde-birlik-tercime@lists."
"Language-Team: QIRIMTATARCA (Qırım Türkçesi) <tilde-birlik-tercime@lists."
"sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -18,15 +18,14 @@ msgstr ""
"X-Generator: KBabel 1.11.4\n"
#: gdk-pixbuf/gdk-pixbuf-simple-anim.c:165
#, fuzzy
msgid "Loop"
msgstr "Logo"
msgstr "İlik"
# gtk/gtkcolorsel.c:1669
# tüklü
#: gdk-pixbuf/gdk-pixbuf-simple-anim.c:166
#, fuzzy
msgid "Whether the animation should loop when it reaches the end"
msgstr "Saylamnıñ noqtacını taqip etip etmeycegi"
msgstr "Canlandırmanıñ soñuna irişken soñ ilik yapıp yapmaycağı"
#: gdk-pixbuf/gdk-pixbuf.c:89
msgid "Number of Channels"
@@ -147,9 +146,8 @@ msgstr "Ekran üzerindeki urufatlarnıñ çezinirligi"
# gtk/gtksettings.c:151
#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497
#, fuzzy
msgid "Cursor"
msgstr "İmleç Qıpması"
msgstr "İmleç"
# gtk/gtktexttag.c:198
#: gtk/gtkaboutdialog.c:298
@@ -233,7 +231,7 @@ msgstr "Sanatkârlar"
#: gtk/gtkaboutdialog.c:449
msgid "List of people who have contributed artwork to the program"
msgstr "Programğa sanat işlerinen issede bulunğanlarnıñ listesi"
msgstr "Programğa sanat işlerinen isse qoşqanlarnıñ listesi"
#: gtk/gtkaboutdialog.c:466
msgid "Translator credits"
@@ -370,14 +368,14 @@ msgstr "İşaretçik temasından işaretçikniñ ismi"
#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192
msgid "Visible when horizontal"
msgstr "Gorizontal olğanda körünir"
msgstr "Ufqiy olğanda körünir"
#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193
msgid ""
"Whether the toolbar item is visible when the toolbar is in a horizontal "
"orientation."
msgstr ""
"Alet çubuğı gorizontal yöneldirimde olğanda alet çubuğı unsurınıñ körünip "
"Alet çubuğı ufqiy yöneldirimde olğanda alet çubuğı unsurınıñ körünip "
"körünmeycegi."
#: gtk/gtkaction.c:308
@@ -486,9 +484,8 @@ msgstr "Amel zümresiniñ körünir olıp olmağanı."
# gtk/gtkprogressbar.c:187
#: gtk/gtkactivatable.c:308
#, fuzzy
msgid "Related Action"
msgstr "Amel"
msgstr "Munasebetli Amel"
#: gtk/gtkactivatable.c:309
msgid "The action this activatable will activate and receive updates from"
@@ -500,10 +497,8 @@ msgstr ""
# gtk/gtklabel.c:252
#: gtk/gtkactivatable.c:332
#, fuzzy
msgid "Whether to use the related actions appearance properties"
msgstr ""
"Etiket metniniñ bir depo menü unsurınıñ icadı içün qullanılıp qullanılmaycağı"
msgstr "Munasebetli amelniñ körüniş hasiyetleriniñ qullanılıp qullanılmaycağı"
# gtk/gtkspinbutton.c:264
#: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128
@@ -567,7 +562,7 @@ msgstr "Tadilniñ saife ölçüsi"
# gtk/gtkalignment.c:102
#: gtk/gtkalignment.c:90
msgid "Horizontal alignment"
msgstr "Gorizontal hizalama"
msgstr "Ufqiy hizalama"
# tüklü
#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270
@@ -575,8 +570,8 @@ msgid ""
"Horizontal position of child in available space. 0.0 is left aligned, 1.0 is "
"right aligned"
msgstr ""
"Faydalanılışlı fezada balanıñ gorizontal mevamı. 0.0 ise solğa, 1.0 ise "
"sağğa hizalanır"
"Faydalanışlı fezada balanıñ ufqiy mevamı. 0.0 ise solğa, 1.0 ise sağğa "
"hizalanır"
# gtk/gtkalignment.c:112
#: gtk/gtkalignment.c:100
@@ -588,13 +583,13 @@ msgid ""
"Vertical position of child in available space. 0.0 is top aligned, 1.0 is "
"bottom aligned"
msgstr ""
"Faydalanılışlı fezada balanıñ vertikal mevamı. 0.0 ise üstke, 1.0 ise altqa "
"Faydalanışlı fezada balanıñ vertikal mevamı. 0.0 ise üstke, 1.0 ise altqa "
"hizalanır"
# gtk/gtkalignment.c:121
#: gtk/gtkalignment.c:109
msgid "Horizontal scale"
msgstr "Gorizontal miqyas"
msgstr "Ufqiy miqyas"
# tüklü
#: gtk/gtkalignment.c:110
@@ -602,8 +597,8 @@ msgid ""
"If available horizontal space is bigger than needed for the child, how much "
"of it to use for the child. 0.0 means none, 1.0 means all"
msgstr ""
"Faydalanılışlı gorizontal feza bala içün kerekkenden büyük ise, onıñ ne "
"qadarınıñ bala içün qullanılacağı. 0.0 ise iç, 1.0 ise episi demektir"
"Faydalanışlı ufqiy feza bala içün kerekkenden büyük ise, onıñ ne qadarınıñ "
"bala içün qullanılacağı. 0.0 ise iç, 1.0 ise episi demektir"
# gtk/gtkalignment.c:130
#: gtk/gtkalignment.c:118
@@ -615,7 +610,7 @@ msgid ""
"If available vertical space is bigger than needed for the child, how much of "
"it to use for the child. 0.0 means none, 1.0 means all"
msgstr ""
"Faydalanılışlı vertikal feza bala içün kerekkenden büyük ise, onıñ ne "
"Faydalanışlı vertikal feza bala içün kerekkenden büyük ise, onıñ ne "
"qadarınıñ bala içün qullanılacağıdır. 0.0 ise iç, 1.0 ise episi demektir"
# tüklü
@@ -685,7 +680,7 @@ msgstr "Oq tarafından qullanılacaq fezanıñ miqdarı"
# gtk/gtkaspectframe.c:107
#: gtk/gtkaspectframe.c:79
msgid "Horizontal Alignment"
msgstr "Gorizontal Hizalama"
msgstr "Ufqiy Hizalama"
# gtk/gtkaspectframe.c:108
#: gtk/gtkaspectframe.c:80
@@ -1214,9 +1209,8 @@ msgstr "Eger DOĞRU ise, tafsilât kösterilir"
# gtk/gtktreeviewcolumn.c:179
#: gtk/gtkcelleditable.c:76
#, fuzzy
msgid "Editing Canceled"
msgstr "Tarir etüv"
msgstr "Tarir Etüvden Vazgeçildi"
#: gtk/gtkcelleditable.c:77
msgid "Indicates that editing has been canceled"
@@ -1616,9 +1610,8 @@ msgid "Whether the spinner is active (ie. shown) in the cell"
msgstr "Saylanğan urufat uslûbınıñ etikette kösterilip kösterilmeycegi"
#: gtk/gtkcellrendererspinner.c:145
#, fuzzy
msgid "Pulse of the spinner"
msgstr "Bastırıcınıñ ismi"
msgstr "Aylanıcınıñ nabzı"
# gtk/gtkwindow.c:333
#: gtk/gtkcellrendererspinner.c:159
@@ -1851,8 +1844,8 @@ msgid ""
"The preferred place to ellipsize the string, if the cell renderer does not "
"have enough room to display the entire string"
msgstr ""
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip degil "
"ise, tizgini hazıflaştırmaq içün tercih etilgen yer"
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip "
"degil ise, tizgini hazıflaştırmaq içün tercih etilgen yer"
# gtk/gtkentry.c:435
#: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421
@@ -1874,8 +1867,8 @@ msgid ""
"How to break the string into multiple lines, if the cell renderer does not "
"have enough room to display the entire string"
msgstr ""
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip degil "
"ise, tizginiñ birden fazla satırğa nasıl bölünecegi"
"Eger hüceyre qılıcısı bütün tizgini köstermek içün yeterli alanğa saip "
"degil ise, tizginiñ birden fazla satırğa nasıl bölünecegi"
# gtk/gtklayout.c:435 gtk/gtktreeviewcolumn.c:188 gtk/gtkwidget.c:424
#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685
@@ -2586,9 +2579,8 @@ msgid "Width of border around the button area at the bottom of the dialog"
msgstr "Dialog tübündeki dögme mesahasınıñ etrafındaki sıñırnıñ kenişligi"
#: gtk/gtkentry.c:634
#, fuzzy
msgid "Text Buffer"
msgstr "Bufer"
msgstr "Metin Buferi"
#: gtk/gtkentry.c:635
msgid "Text buffer object which actually stores entry text"
@@ -3021,14 +3013,12 @@ msgid "How long to show the last input character in hidden entries"
msgstr "Gizli kirildilerde soñki remizniñ ne qadar müddet kösterilecegi"
#: gtk/gtkentrybuffer.c:354
#, fuzzy
msgid "The contents of the buffer"
msgstr "Kirildiniñ mündericesi"
msgstr "Buferniñ mündericesi"
#: gtk/gtkentrybuffer.c:369
#, fuzzy
msgid "Length of the text currently in the buffer"
msgstr "Kirildideki ağımdaki metinniñ uzunlığı"
msgstr "Buferdeki ağımdaki metinniñ uzunlığı"
#: gtk/gtkentrycompletion.c:279
msgid "Completion Model"
@@ -3280,7 +3270,7 @@ msgstr "Gizlilerni Köster"
# gtk/gtkfilesel.c:510
#: gtk/gtkfilechooser.c:815
msgid "Whether the hidden files and folders should be displayed"
msgstr "Gizli dosye ve fihristlerniñ kösterilip kösterilmeycegi"
msgstr "Gizli dosye ve cilbentlerniñ kösterilip kösterilmeycegi"
#: gtk/gtkfilechooser.c:830
msgid "Do overwrite confirmation"
@@ -3296,9 +3286,8 @@ msgstr ""
# gtk/gtkfilesel.c:509
#: gtk/gtkfilechooser.c:847
#, fuzzy
msgid "Allow folders creation"
msgstr "Dosye işletimlerini köster"
msgstr "Cilbentler icat etmege izin ber"
#: gtk/gtkfilechooser.c:848
#, fuzzy
@@ -3471,7 +3460,7 @@ msgstr "Etiketniñ vertikal hizalaması"
#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167
msgid "Deprecated property, use shadow_type instead"
msgstr "Takbih etilgen hasiyet, yerine shadow_type qullanıñız"
msgstr "Taqbih etilgen hasiyet, yerine shadow_type qullanıñız"
# gtk/gtkframe.c:152
#: gtk/gtkframe.c:138
@@ -3657,9 +3646,8 @@ msgstr ""
"Unsurlar içün alet-qaranesi metinlerini ihtiva etken model içindeki sutun"
#: gtk/gtkiconview.c:772
#, fuzzy
msgid "Item Padding"
msgstr "Tüp Şilteleme"
msgstr "Unsur Şilteleme"
#: gtk/gtkiconview.c:773
msgid "Padding around icon view items"
@@ -3818,21 +3806,18 @@ msgstr "Mesajnıñ türü"
# gtk/gtkdialog.c:150
#: gtk/gtkinfobar.c:440
#, fuzzy
msgid "Width of border around the content area"
msgstr "Ana dialog mesahasınıñ etrafındaki sıñırnıñ kenişligi"
msgstr "Muhteva mesahasınıñ etrafındaki sıñırnıñ kenişligi"
# gtk/gtkscale.c:184
#: gtk/gtkinfobar.c:457
#, fuzzy
msgid "Spacing between elements of the area"
msgstr "Ana dialog mesahasınıñ unsurları arasındaki boşluqlama"
msgstr "Mesahanıñ unsurları arasındaki boşluqlama"
# gtk/gtkdialog.c:150
#: gtk/gtkinfobar.c:489
#, fuzzy
msgid "Width of border around the action area"
msgstr "Ana dialog mesahasınıñ etrafındaki sıñırnıñ kenişligi"
msgstr "Amel mesahasınıñ etrafındaki sıñırnıñ kenişligi"
#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627
msgid "The screen where this window will be displayed"
@@ -3965,15 +3950,13 @@ msgstr "Etiketniñ istengen azamiy kenişligi, remiz cınsından"
# gtk/gtkwindow.c:333
#: gtk/gtklabel.c:737
#, fuzzy
msgid "Track visited links"
msgstr "Ziyaret etilgen ilişimlerniñ tüsü"
msgstr "Ziyaret etilgen ilişimlerni taqip et"
# gtk/gtkfilesel.c:510
#: gtk/gtklabel.c:738
#, fuzzy
msgid "Whether visited links should be tracked"
msgstr "Hususiy unsurlarnıñ kösterilip kösterilmeycegi"
msgstr "Ziyaret etilgen ilişimlerniñ taqip etilip etilmeycegi"
# gtk/gtkentry.c:397
#: gtk/gtklabel.c:859
@@ -4153,7 +4136,7 @@ msgstr "Çifte Oq"
#: gtk/gtkmenu.c:651
msgid "When scrolling, always show both arrows."
msgstr "Taydırğanda, er zaman oqlarnıñ ekisi de köster."
msgstr "Taydırğanda, er zaman oqlarnıñ ekisini de köster."
#: gtk/gtkmenu.c:664
msgid "Arrow Placement"
@@ -4213,7 +4196,7 @@ msgstr ""
#: gtk/gtkmenu.c:805
msgid "Delay before submenus appear"
msgstr "Alt-menüler belirmeden evelki keçikme"
msgstr "Alt-menüler belirmezden evelki keçikme"
#: gtk/gtkmenu.c:806
msgid ""
@@ -4224,15 +4207,14 @@ msgstr ""
#: gtk/gtkmenu.c:813
msgid "Delay before hiding a submenu"
msgstr "Bir alt-menüni gizlemeden evelki keçikme"
msgstr "Bir alt-menüni gizlemezden evelki keçikme"
#: gtk/gtkmenu.c:814
msgid ""
"The time before hiding a submenu when the pointer is moving towards the "
"submenu"
msgstr ""
"Noqtacı bir alt-menüge doğru areket etkende alt-menüni gizlemeden evelki "
"vaqıt"
"İbre bir alt-menüge doğru areket etkende alt-menüni gizlemezden evelki vaqıt"
# gtk/gtktexttag.c:267
#: gtk/gtkmenubar.c:168
@@ -4271,11 +4253,11 @@ msgstr ""
#: gtk/gtkmenubar.c:210
msgid "Delay before drop down menus appear"
msgstr "Aşağı tüşken menüler belirmeden evelki keçikme"
msgstr "Aşağı tüşken menüler belirmezden evelki keçikme"
#: gtk/gtkmenubar.c:211
msgid "Delay before the submenus of a menu bar appear"
msgstr "Menü cubuğınıñ alt-menüleri belirmeden evelki keçikme"
msgstr "Menü cubuğınıñ alt-menüleri belirmezden evelki keçikme"
#: gtk/gtkmenuitem.c:257
msgid "Right Justified"
@@ -5091,9 +5073,8 @@ msgid "Label for the tab containing custom widgets."
msgstr "Şahsiyleştirilgen pencereçiklerni ihtiva etken ilmek içün etiket."
#: gtk/gtkprintoperation.c:1279 gtk/gtkprintunixdialog.c:345
#, fuzzy
msgid "Support Selection"
msgstr "Tüs Saylamı"
msgstr "Saylamnı Destekle"
#: gtk/gtkprintoperation.c:1280
msgid "TRUE if the print operation will support print of selection."
@@ -5101,9 +5082,8 @@ msgstr ""
# gtk/gtkfilesel.c:503
#: gtk/gtkprintoperation.c:1296 gtk/gtkprintunixdialog.c:353
#, fuzzy
msgid "Has Selection"
msgstr "Saylamı bar"
msgstr "Saylamı Bar"
#: gtk/gtkprintoperation.c:1297
msgid "TRUE if a selecion exists."
@@ -5111,24 +5091,21 @@ msgstr ""
# gtk/gtkruler.c:148
#: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361
#, fuzzy
msgid "Embed Page Setup"
msgstr "Saife Tesbiti"
msgstr "Saife Tesbitini İçeri Yatqız"
#: gtk/gtkprintoperation.c:1313
msgid "TRUE if page setup combos are embedded in GtkPrintDialog"
msgstr ""
#: gtk/gtkprintoperation.c:1334
#, fuzzy
msgid "Number of Pages To Print"
msgstr "Saife Sayısı"
msgstr "Bastırılacaq Saifelerniñ Sayısı"
# gtk/gtktable.c:157
#: gtk/gtkprintoperation.c:1335
#, fuzzy
msgid "The number of pages that will be printed."
msgstr "Belgedeki saife sayısı."
msgstr "Bastırılacaq olğan saifelerniñ sayısı."
#: gtk/gtkprintunixdialog.c:303
msgid "The GtkPageSetup to use"
@@ -5154,15 +5131,13 @@ msgstr ""
# gtk/gtklabel.c:252
#: gtk/gtkprintunixdialog.c:346
#, fuzzy
msgid "Whether the dialog supports selection"
msgstr "Etiketniñ saylanğan urufat ile sızılıp sızılmaycağı"
msgstr "Dialognıñ saylamnı desteklep desteklemegeni"
# gtk/gtkwidget.c:443
#: gtk/gtkprintunixdialog.c:354
#, fuzzy
msgid "Whether the application has a selection"
msgstr "Amelniñ qabilleştirilgen olıp olmağanı."
msgstr "Uyğulamanıñ bir saylamı olıp olmağanı"
#: gtk/gtkprintunixdialog.c:362
msgid "TRUE if page setup combos are embedded in GtkPrintUnixDialog"
@@ -5198,7 +5173,7 @@ msgstr "Teraqqiyatnıñ metin olaraq kösterilip kösterilmeycegi."
# gtk/gtkprogressbar.c:132
#: gtk/gtkprogressbar.c:119
msgid "The GtkAdjustment connected to the progress bar (Deprecated)"
msgstr "Teraqqiyat çubuğına bağlanğan GtkAdjustment (Takbih etilgen)"
msgstr "Teraqqiyat çubuğına bağlanğan GtkAdjustment (Taqbih etilgen)"
# gtk/gtkprogressbar.c:148
#: gtk/gtkprogressbar.c:135
@@ -5209,7 +5184,7 @@ msgstr "Çubuq uslûbı"
# gtk/gtkprogressbar.c:149
#: gtk/gtkprogressbar.c:136
msgid "Specifies the visual style of the bar in percentage mode (Deprecated)"
msgstr "Faiz tarzında çubuqnıñ körsel uslûbını belirtir (Takbih etilgen)"
msgstr "Faiz tarzında çubuqnıñ körsel uslûbını belirtir (Taqbih etilgen)"
# gtk/gtkprogressbar.c:157
#: gtk/gtkprogressbar.c:144
@@ -5220,7 +5195,7 @@ msgstr "Faaliyet Adımı"
# gtk/gtkprogressbar.c:158
#: gtk/gtkprogressbar.c:145
msgid "The increment used for each iteration in activity mode (Deprecated)"
msgstr "Faaliyet tarzında er keneleme içün qullanılğan artım (Takbih etilgen)"
msgstr "Faaliyet tarzında er keneleme içün qullanılğan artım (Taqbih etilgen)"
# gtk/gtkprogressbar.c:167
#: gtk/gtkprogressbar.c:152
@@ -5234,7 +5209,7 @@ msgid ""
"(Deprecated)"
msgstr ""
"Faaliyet tarzında teraqqiyat çubuğı mesahasına sığa bilecek blok sayısı "
"(Takbih etilgen)"
"(Taqbih etilgen)"
# tüklü
# gtk/gtkprogressbar.c:177
@@ -5967,8 +5942,8 @@ msgid ""
"Maximum distance allowed between two clicks for them to be considered a "
"double click (in pixels)"
msgstr ""
"Çifte çertme olaraq mulâaza etilüvi içün eki çertme arasındaki azamiy mesafe "
"(piksel cınsından)"
"Çifte çertme olaraq mulâaza etilüvi içün eki çertme arasındaki azamiy "
"mesafe (piksel cınsından)"
# gtk/gtksettings.c:151
#: gtk/gtksettings.c:249
@@ -6012,7 +5987,7 @@ msgid ""
"Whether two cursors should be displayed for mixed left-to-right and right-to-"
"left text"
msgstr ""
"Qarışıq soldan-sağğa hem de sağdan-solğa metin içün eki imleçniñ kösterilip "
"Qarışıq soldan-sağğa em de sağdan-solğa metin içün eki imleçniñ kösterilip "
"kösterilmeycegi"
# gtk/gtksettings.c:175
@@ -6070,7 +6045,7 @@ msgstr "Süyrekleme bosağası"
#: gtk/gtksettings.c:339
msgid "Number of pixels the cursor can move before dragging"
msgstr "Süyreklemeden evel imleçniñ areket ete bilecegi piksel sayısı"
msgstr "Süyreklemezden evel imleçniñ areket ete bilecegi piksel sayısı"
# gtk/gtkfontsel.c:185
#: gtk/gtksettings.c:347
@@ -6279,7 +6254,7 @@ msgstr "Alet-qaranesi zaman aşımı"
#: gtk/gtksettings.c:608
msgid "Timeout before tooltip is shown"
msgstr "Alet-qaranesi kösterilmeden evel keçikme"
msgstr "Alet-qaranesi kösterilmezden evel keçikme"
#: gtk/gtksettings.c:633
msgid "Tooltip browse timeout"
@@ -6288,7 +6263,7 @@ msgstr "Alet-qaranesi kezinme zaman aşımı"
#: gtk/gtksettings.c:634
msgid "Timeout before tooltip is shown when browse mode is enabled"
msgstr ""
"Kezinme tarzı qabilleştirilgen olğanda, alet-qaranesi kösterilmeden evelki "
"Kezinme tarzı qabilleştirilgen olğanda, alet-qaranesi kösterilmezden evelki "
"keçikme"
#: gtk/gtksettings.c:655
@@ -6297,7 +6272,7 @@ msgstr "Alet-qaranesi kezinme tarzı zaman aşımı"
#: gtk/gtksettings.c:656
msgid "Timeout after which browse mode is disabled"
msgstr "Kezinme tarzı ğayrı qabilleştirilmeden evelki keçikme"
msgstr "Kezinme tarzı ğayrı qabilleştirilmezden evelki keçikme"
# tüklü
#: gtk/gtksettings.c:675
@@ -6309,7 +6284,7 @@ msgstr "Ancaq Tuş Yürsetme İmleçi"
msgid "When TRUE, there are only cursor keys available to navigate widgets"
msgstr ""
"DOĞRU olğanda, pencereçikler içerisinde yürsetmek içün sadece imleç tuşları "
"faydalanılışlı olur"
"faydalanışlı olur"
# tüklü
#: gtk/gtksettings.c:693
@@ -6475,21 +6450,18 @@ msgstr ""
# gtk/gtktoolbar.c:290
#: gtk/gtksettings.c:996
#, fuzzy
msgid "Toolbar Icon Size"
msgstr "Alet çubuğı işaretçik ölçüsi"
msgstr "Alet Çubuğı İşaretçik Ölçüsi"
# gtk/gtktoolbar.c:291
#: gtk/gtksettings.c:997
#, fuzzy
msgid "The size of icons in default toolbars."
msgstr "Ög-belgilengen alet çubuqlarındaki işaretçiklerniñ ölçüsi"
msgstr "Ög-belgilengen alet çubuqlarındaki işaretçiklerniñ ölçüsi."
# gtk/gtkstock.c:267
#: gtk/gtksettings.c:1014
#, fuzzy
msgid "Auto Mnemonics"
msgstr "Hatırlatıcılarnı Qabilleştir"
msgstr "Avto Hatırlatıcılar"
#: gtk/gtksettings.c:1015
msgid ""
@@ -6592,14 +6564,12 @@ msgstr "Aylanma dögmesiniñ etrafındaki şev uslûbı"
# gtk/gtkwidget.c:443
#: gtk/gtkspinner.c:129
#, fuzzy
msgid "Whether the spinner is active"
msgstr "Birlemci işaretçikniñ faalleştirile bilip bilmegeni"
msgstr "Aylanıcınıñ faal olıp olmağanı"
#: gtk/gtkspinner.c:143
#, fuzzy
msgid "Number of steps"
msgstr "Saife Sayısı"
msgstr "Adım sayısı"
#: gtk/gtkspinner.c:144
msgid ""
@@ -6610,9 +6580,8 @@ msgstr ""
# gtk/gtkstock.c:267
#: gtk/gtkspinner.c:159
#, fuzzy
msgid "Animation duration"
msgstr "Canlandırma"
msgstr "Canlandırma süresi"
#: gtk/gtkspinner.c:160
msgid ""
@@ -6695,9 +6664,8 @@ msgstr "Bu sini işaretçigi içün alet-qaranesi mündericesi"
# gtk/gtkwindow.c:333
#: gtk/gtkstatusicon.c:425
#, fuzzy
msgid "The title of this tray icon"
msgstr "İşaretçikniñ ölçüsi"
msgstr "Bu sini işaretçiginiñ ölçüsi"
# gtk/gtktable.c:156
#: gtk/gtktable.c:129
@@ -7572,15 +7540,13 @@ msgstr ""
"çubuğı dögmeleri metinni GTK_TOOLBAR_BOTH_HORIZ tarzında kösterir"
#: gtk/gtktoolitemgroup.c:1536
#, fuzzy
msgid "The human-readable title of this item group"
msgstr "Durumnıñ insanca oqula bilgen tasviri"
msgstr "Bu unsur zümresiniñ insanca oqulabilgen serlevası"
# gtk/gtkframe.c:162
#: gtk/gtktoolitemgroup.c:1543
#, fuzzy
msgid "A widget to display in place of the usual label"
msgstr "Adetiy çerçive etiketiniñ yerinde kösterilecek bir pencereçik"
msgstr "Adetiy etiketniñ yerinde kösterilecek bir pencereçik"
#: gtk/gtktoolitemgroup.c:1549
msgid "Collapsed"
@@ -7594,9 +7560,8 @@ msgstr ""
"Bala pencereçigini ortağa çıqarmaq içün kenişleticiniñ açılğan olıp olmağanı"
#: gtk/gtktoolitemgroup.c:1556
#, fuzzy
msgid "ellipsize"
msgstr "Hazıflaştır"
msgstr "hazıflaştır"
#: gtk/gtktoolitemgroup.c:1557
msgid "Ellipsize for item group headers"
@@ -7604,9 +7569,8 @@ msgstr ""
# gtk/gtktreeview.c:489
#: gtk/gtktoolitemgroup.c:1563
#, fuzzy
msgid "Header Relief"
msgstr "Başlıq sureti"
msgstr "Başlıq Relyefi"
# gtk/gtktreeview.c:482
#: gtk/gtktoolitemgroup.c:1564
@@ -7615,27 +7579,24 @@ msgid "Relief of the group header button"
msgstr "Sutun başlığı dögmelerini köster"
#: gtk/gtktoolitemgroup.c:1579
#, fuzzy
msgid "Header Spacing"
msgstr "Başlıq Şilteleme"
msgstr "Başlıq Boşluqlaması"
# gtk/gtkoptionmenu.c:164
# tüklü
#: gtk/gtktoolitemgroup.c:1580
#, fuzzy
msgid "Spacing between expander arrow and caption"
msgstr "Kenişletici oqunıñ etrafındaki boşluq"
msgstr "Kenişletici oqu ve serlevası arasındaki boşluqlama"
# gtk/gtkbox.c:137
#: gtk/gtktoolitemgroup.c:1596
#, fuzzy
msgid "Whether the item should receive extra space when the group grows"
msgstr "Alet çubuğı büyügeni zaman unsurnıñ ziyade feza alıp almaycağı"
msgstr "Zümre büyügeni zaman unsurnıñ ziyade feza alıp almaycağı"
# gtk/gtkbox.c:137
#: gtk/gtktoolitemgroup.c:1603
#, fuzzy
msgid "Whether the item should fill the available space"
msgstr "Balalarnıñ episiniñ aynı ölçüde olıp olmaycağı"
msgstr "Unsurnıñ faydalanışlı fezanı toldurıp toldurmaycağı"
#: gtk/gtktoolitemgroup.c:1609
msgid "New Row"
@@ -7643,27 +7604,23 @@ msgstr ""
# gtk/gtkcheckmenuitem.c:115
#: gtk/gtktoolitemgroup.c:1610
#, fuzzy
msgid "Whether the item should start a new row"
msgstr "Unsurlarnıñ bir numara ile beraber kösterilip kösterilmeycegi"
msgstr "Unsurnıñ yañı bir saf başlatıp başlatmaycağı"
# gtk/gtkruler.c:139
#: gtk/gtktoolitemgroup.c:1617
#, fuzzy
msgid "Position of the item within this group"
msgstr "Cedvel üzerindeki tamğanıñ mevamı"
msgstr "Unsurnıñ zümre içerisindeki mevamı"
# gtk/gtktoolbar.c:291
#: gtk/gtktoolpalette.c:991
#, fuzzy
msgid "Size of icons in this tool palette"
msgstr "Bu alet çubuğındaki işaretçiklerniñ ölçüsi"
msgstr "Bu alet paletindeki işaretçiklerniñ ölçüsi"
# gtk/gtktoolbar.c:277
#: gtk/gtktoolpalette.c:1021
#, fuzzy
msgid "Style of items in the tool palette"
msgstr "Alet çubuğınıñ etrafındaki şevniñ uslûbı"
msgstr "Alet paletindeki unsurlarnıñ uslûbı"
#: gtk/gtktoolpalette.c:1037
msgid "Exclusive"
@@ -8075,9 +8032,8 @@ msgid "Sort direction the sort indicator should indicate"
msgstr "Sıra köstergiçiniñ kösterecegi sıra yönelişi"
#: gtk/gtktreeviewcolumn.c:341
#, fuzzy
msgid "Sort column ID"
msgstr "Metin sutunı"
msgstr "Sıralama sutunı kimligi"
#: gtk/gtktreeviewcolumn.c:342
msgid "Logical sort column ID this column sorts on when selected for sorting"
@@ -8313,15 +8269,13 @@ msgid "The widget's window if it is realized"
msgstr "Pencereçikniñ penceresi, eger cisimleştirilgen ise"
#: gtk/gtkwidget.c:774
#, fuzzy
msgid "Double Buffered"
msgstr "Bufer"
msgstr "Çifte Buferli"
# gtk/gtkwidget.c:443
#: gtk/gtkwidget.c:775
#, fuzzy
msgid "Whether or not the widget is double buffered"
msgstr "Tıqaçnıñ içeri yatqızılğan olıp olmağanı"
msgstr "Pencereçikniñ çifte buferli olıp olmağanı"
# gtk/gtkwidget.c:1068
#: gtk/gtkwidget.c:2403
@@ -8381,7 +8335,7 @@ msgid ""
"Color with which to draw the secondary insertion cursor when editing mixed "
"right-to-left and left-to-right text"
msgstr ""
"Qarışıq soldan-sağğa hem de sağdan-solğa metinni tarir etkende ekilemci "
"Qarışıq soldan-sağğa em de sağdan-solğa metinni tarir etkende ekilemci "
"qıstırma imleçiniñ sızılacağı tüs"
#: gtk/gtkwidget.c:2441
@@ -8605,15 +8559,13 @@ msgstr "Bu pencere içün işaretçik"
# gtk/gtklabel.c:258
#: gtk/gtkwindow.c:602
#, fuzzy
msgid "Mnemonics Visible"
msgstr "Hatırlatıcı tuş"
msgstr "Hatırlatıcılar Körüne"
# gtk/gtkwidget.c:485
#: gtk/gtkwindow.c:603
#, fuzzy
msgid "Whether mnemonics are currently visible in this window"
msgstr "Üst seviyeniñ al-azırda faal pencere olıp olmağanı"
msgstr "Hatırlatıcılarnıñ al-azırda bu pencerede körünip körünmegeni"
#: gtk/gtkwindow.c:619
msgid "Name of the themed icon for this window"
+1827 -1765
View File
File diff suppressed because it is too large Load Diff
+1824 -1768
View File
File diff suppressed because it is too large Load Diff
+66 -98
View File
@@ -1,15 +1,15 @@
# Translation of gtk+ to Qırımtatarca.
# This file is distributed under the same license as the gtk+ package.
#
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009.
# Reşat SABIQ <tilde.birlik@gmail.com>, 2009, 2010.
msgid ""
msgstr ""
"Project-Id-Version: gtk+ TRUNK\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-22 23:34-0400\n"
"PO-Revision-Date: 2009-04-09 03:07-0500\n"
"PO-Revision-Date: 2010-05-02 14:03-0500\n"
"Last-Translator: Reşat SABIQ <tilde.birlik@gmail.com>\n"
"Language-Team: Qırımtatarca (Qırım Türkçesi) <tilde-birlik-tercime@lists."
"Language-Team: QIRIMTATARCA (Qırım Türkçesi) <tilde-birlik-tercime@lists."
"sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -992,9 +992,8 @@ msgstr ""
# tüklü
# gdk-pixbuf/io-tiff.c:264
#: gdk-pixbuf/io-qtif.c:143
#, fuzzy
msgid "Failed to read QTIF header"
msgstr "Başlıq yazılamadı\n"
msgstr "QTIF başlığı oqulamadı"
#: gdk-pixbuf/io-qtif.c:152 gdk-pixbuf/io-qtif.c:182 gdk-pixbuf/io-qtif.c:446
#, c-format
@@ -1003,9 +1002,9 @@ msgstr ""
# gdk-pixbuf/gdk-pixdata.c:378
#: gdk-pixbuf/io-qtif.c:172
#, fuzzy, c-format
#, c-format
msgid "Failed to allocate %d bytes for file read buffer"
msgstr "%u baytlıq suret buferi tahsis etilamadı"
msgstr "%d baytlıq suret oquv buferi tahsis etilamadı"
# gdk-pixbuf/io-gif.c:218
#: gdk-pixbuf/io-qtif.c:196
@@ -1026,9 +1025,8 @@ msgstr "TGA kontekst yapısı içün hafiza tahsis etilamay"
# gdk-pixbuf/io-xbm.c:429
#: gdk-pixbuf/io-qtif.c:317
#, fuzzy
msgid "Failed to create GdkPixbufLoader object."
msgstr "Fihrist indeksi yazılamadı\n"
msgstr "GdkPixbufLoader nesnesi icat etilamadı."
# gdk-pixbuf/io-tiff.c:264
#: gdk-pixbuf/io-qtif.c:421
@@ -1037,9 +1035,8 @@ msgid "Failed to find an image data atom."
msgstr "TIFF sureti açılamadı"
#: gdk-pixbuf/io-qtif.c:602
#, fuzzy
msgid "The QTIF image format"
msgstr "TIFF suret formatı"
msgstr "QTIF suret formatı"
# gdk-pixbuf/io-bmp.c:278 gdk-pixbuf/io-bmp.c:300
#: gdk-pixbuf/io-ras.c:126
@@ -1397,9 +1394,8 @@ msgid_plural "Opening %d Items"
msgstr[0] "%d Unsur Açıla"
#: gtk/gtkaboutdialog.c:242
#, fuzzy
msgid "Could not show link"
msgstr "Liste temizlenamadı"
msgstr "İlişim kösterilamadı"
#: gtk/gtkaboutdialog.c:365 gtk/gtkaboutdialog.c:2263
msgid "License"
@@ -1520,9 +1516,9 @@ msgstr "Keri-egik-sızıq"
# gdk-pixbuf/io-xbm.c:284
#: gtk/gtkbuilderparser.c:343
#, fuzzy, c-format
#, c-format
msgid "Invalid type function on line %d: '%s'"
msgstr "Keçersiz türden funktsiya: `%s'"
msgstr "%d satrında keçersiz türden funktsiya: `%s'"
#: gtk/gtkbuilderparser.c:407
#, c-format
@@ -1635,10 +1631,9 @@ msgstr "Ğayrı qabilleştirilgen"
#. * to gtk_accelerator_valid().
#.
#: gtk/gtkcellrendereraccel.c:254
#, fuzzy
msgctxt "Accelerator"
msgid "Invalid"
msgstr "Keçersiz URI"
msgstr "Keçersiz"
#. This label is displayed in a treeview cell displaying
#. * an accelerator when the cell is clicked to change the
@@ -1677,8 +1672,8 @@ msgid ""
"Click the eyedropper, then click a color anywhere on your screen to select "
"that color."
msgstr ""
"Köz-tamçılığına çertken soñ ekranıñızda olğan er angi tüske çerterek o tüsni "
"saylay bilirsiñiz."
"Köz-tamçılığına çertken soñ ekranıñızda olğan er angi tüske çerterek o "
"tüsni saylay bilirsiñiz."
# tüklü
# gtk/gtkcolorsel.c:1796
@@ -1927,7 +1922,7 @@ msgstr "Diger..."
#: gtk/gtkfilechooserdefault.c:148
msgid "Type name of new folder"
msgstr "Yañı fihristniñ adını kirsetiñiz"
msgstr "Yañı cilbentniñ adını kirsetiñiz"
#: gtk/gtkfilechooserdefault.c:974
msgid "Could not retrieve information about the file"
@@ -1943,14 +1938,14 @@ msgstr "Saife-imi silinamadı"
#: gtk/gtkfilechooserdefault.c:1007
msgid "The folder could not be created"
msgstr "Fihrist icat etilamadı"
msgstr "Cilbent icat etilamadı"
#: gtk/gtkfilechooserdefault.c:1020
msgid ""
"The folder could not be created, as a file with the same name already "
"exists. Try using a different name for the folder, or rename the file first."
msgstr ""
"Aynı isimde bir dosye mevcut olğanı içün fihrist icat etilamadı. Fihrist "
"Aynı isimde bir dosye mevcut olğanı içün cilbent icat etilamadı. Cilbent "
"içün farqlı bir isim qullanuvnı deñeñiz ya da evelâ dosyeniñ adını "
"deñiştiriñiz."
@@ -1961,7 +1956,7 @@ msgstr "Keçersiz dosye adı"
#: gtk/gtkfilechooserdefault.c:1041
msgid "The folder contents could not be displayed"
msgstr "Fihrist mündericesi kösterilamadı"
msgstr "Cilbent mündericesi kösterilamadı"
#. Translators: the first string is a path and the second string
#. * is a hostname. Nautilus and the panel contain the same string
@@ -1987,17 +1982,17 @@ msgstr "Angi türdeki dosyelerniñ kösterilecegini saylañız"
#: gtk/gtkfilechooserdefault.c:2793
#, c-format
msgid "Add the folder '%s' to the bookmarks"
msgstr "'%s' fihristini saife-imlerine ekle"
msgstr "'%s' cilbentini saife-imlerine ekle"
#: gtk/gtkfilechooserdefault.c:2837
#, c-format
msgid "Add the current folder to the bookmarks"
msgstr "Ağımdaki fihristni saife-imlerine ekle"
msgstr "Ağımdaki cilbentni saife-imlerine ekle"
#: gtk/gtkfilechooserdefault.c:2839
#, c-format
msgid "Add the selected folders to the bookmarks"
msgstr "Saylanğan fihristlerni saife-imlerine ekle"
msgstr "Saylanğan cilbentlerni saife-imlerine ekle"
#: gtk/gtkfilechooserdefault.c:2877
#, c-format
@@ -2040,7 +2035,7 @@ msgstr "_Ekle"
#: gtk/gtkfilechooserdefault.c:3898
msgid "Add the selected folder to the Bookmarks"
msgstr "Saylanğan fihristni Saife-imlerine ekle"
msgstr "Saylanğan cilbentni Saife-imlerine ekle"
# gtk/gtkstock.c:303
#: gtk/gtkfilechooserdefault.c:3903
@@ -2091,7 +2086,7 @@ msgstr "_İsim:"
#: gtk/gtkfilechooserdefault.c:4839
msgid "_Browse for other folders"
msgstr "Diger fihristler içün _kezin"
msgstr "Diger cilbentler içün _kezin"
# gdk-pixbuf/io-xbm.c:284
#: gtk/gtkfilechooserdefault.c:5111
@@ -2101,7 +2096,7 @@ msgstr "Bir dosye adını kirsetiñiz"
#. Create Folder
#: gtk/gtkfilechooserdefault.c:5152
msgid "Create Fo_lder"
msgstr "_Fihrist İcat Et"
msgstr "_Cilbent İcat Et"
# tüklü
# gtk/gtkfilesel.c:1795
@@ -2111,22 +2106,21 @@ msgstr "_Qonum:"
#: gtk/gtkfilechooserdefault.c:5366
msgid "Save in _folder:"
msgstr "_Fihristte saqla:"
msgstr "_Cilbentte saqla:"
#: gtk/gtkfilechooserdefault.c:5368
msgid "Create in _folder:"
msgstr "_Fihristte icat et:"
msgstr "_Cilbentte icat et:"
# gtk/gtkfilesel.c:1011
#: gtk/gtkfilechooserdefault.c:6435
#, fuzzy, c-format
#, c-format
msgid "Could not read the contents of %s"
msgstr "Aqım icat etilamadı: %s"
msgstr "%s muhtevası oqulamadı"
#: gtk/gtkfilechooserdefault.c:6439
#, fuzzy
msgid "Could not read the contents of the folder"
msgstr "Tamır fihristni elde etamadım"
msgstr "Cilbentniñ muhtevası oqulamadı"
# gtk/gtkinputdialog.c:577
#: gtk/gtkfilechooserdefault.c:6532 gtk/gtkfilechooserdefault.c:6600
@@ -2144,7 +2138,7 @@ msgstr "Tünevin: %H:%M"
#: gtk/gtkfilechooserdefault.c:7215
msgid "Cannot change to folder because it is not local"
msgstr "Fihrist yerli olmağanı içün oña deñiştirilamay"
msgstr "Cilbent yerli olmağanı içün oña deñiştirilamay"
#: gtk/gtkfilechooserdefault.c:7812 gtk/gtkfilechooserdefault.c:7833
#, c-format
@@ -2194,9 +2188,8 @@ msgid "Could not send the search request"
msgstr "Qıdırma istemi yiberilamadı"
#: gtk/gtkfilechooserdefault.c:9034
#, fuzzy
msgid "Search:"
msgstr "Qıdıruv"
msgstr "Qıdırma:"
#: gtk/gtkfilechooserdefault.c:9638
#, c-format
@@ -2267,17 +2260,17 @@ msgstr "Yolçıq mevcut degil"
#: gtk/gtkfilesel.c:1360
#, c-format
msgid "Error creating folder '%s': %s"
msgstr "'%s' fihristi icat etilgende hata: %s"
msgstr "'%s' cilbenti icat etilgende hata: %s"
# gtk/gtkfilesel.c:651
#: gtk/gtkfilesel.c:694
msgid "Folders"
msgstr "Fihristler"
msgstr "Cilbentler"
# gtk/gtkfilesel.c:651
#: gtk/gtkfilesel.c:698
msgid "Fol_ders"
msgstr "_Fihristler"
msgstr "_Cilbentler"
# gtk/gtkfilesel.c:651
#: gtk/gtkfilesel.c:734
@@ -2288,7 +2281,7 @@ msgstr "_Dosyeler"
#: gtk/gtkfilesel.c:821 gtk/gtkfilesel.c:2154
#, c-format
msgid "Folder unreadable: %s"
msgstr "Fihrist oqulamaz: %s"
msgstr "Cilbent oqulamaz: %s"
#: gtk/gtkfilesel.c:905
#, c-format
@@ -2303,7 +2296,7 @@ msgstr ""
#: gtk/gtkfilesel.c:1020
msgid "_New Folder"
msgstr "_Yañı Fihrist"
msgstr "_Yañı Cilbent"
# gtk/gtkfilesel.c:762 gtk/gtkfilesel.c:1176
#: gtk/gtkfilesel.c:1031
@@ -2321,16 +2314,16 @@ msgstr "Dosyeni _Kene Adlandır"
msgid ""
"The folder name \"%s\" contains symbols that are not allowed in filenames"
msgstr ""
"\"%s\" fihrist adı, dosye isimlerinde caiz olmağan remizlerni ihtiva ete"
"\"%s\" cilbent adı, dosye isimlerinde caiz olmağan remizlerni ihtiva ete"
#: gtk/gtkfilesel.c:1394
msgid "New Folder"
msgstr "Yañı Fihrist"
msgstr "Yañı Cilbent"
# gtk/gtkfilesel.c:502
#: gtk/gtkfilesel.c:1409
msgid "_Folder name:"
msgstr "_Fihrist ismi:"
msgstr "_Cilbent ismi:"
# gtk/gtkfilesel.c:1073
#: gtk/gtkfilesel.c:1433
@@ -2536,7 +2529,6 @@ msgstr "Sistem"
# gtk/gtkinputdialog.c:514
#: gtk/gtkimmulticontext.c:573
#, fuzzy
msgctxt "input method menu"
msgid "None"
msgstr "İç biri"
@@ -2646,9 +2638,8 @@ msgstr "_Temizle"
#. Open Link
#: gtk/gtklabel.c:5685
#, fuzzy
msgid "_Open Link"
msgstr "_Aç"
msgstr "İlişimni _Aç"
#. Copy Link Address
#: gtk/gtklabel.c:5697
@@ -2780,9 +2771,8 @@ msgid "Terminal Pager"
msgstr ""
#: gtk/gtkmountoperation-x11.c:866
#, fuzzy
msgid "Top Command"
msgstr "Emir Satırı "
msgstr "Eñ Üst Buyruq"
#: gtk/gtkmountoperation-x11.c:867
msgid "Bourne Again Shell"
@@ -2813,16 +2803,12 @@ msgstr "Keçerli bir saife tesbiti dosyesi degil"
# gtk/gtkstock.c:299
#: gtk/gtkpagesetupunixdialog.c:167
#, fuzzy
msgid "Any Printer"
msgstr "Bastırıcı"
msgstr "Er Angi Bastırıcı"
#: gtk/gtkpagesetupunixdialog.c:167
#, fuzzy
msgid "For portable documents"
msgstr ""
"<b>Er Angi Bastırıcı</b>\n"
"Taşınabilir vesiqalar içün"
msgstr "Taşınabilir vesiqalar içün"
#: gtk/gtkpagesetupunixdialog.c:797
#, c-format
@@ -2878,9 +2864,8 @@ msgstr "Dosye Sistemi Tamırı"
# gtk/gtkfilesel.c:1795
#: gtk/gtkprintbackend.c:749
#, fuzzy
msgid "Authentication"
msgstr "Uyğulama"
msgstr "Sahihlenim"
#: gtk/gtkprinteroptionwidget.c:695
msgid "Not available"
@@ -2888,7 +2873,7 @@ msgstr "Namevcut"
#: gtk/gtkprinteroptionwidget.c:814
msgid "_Save in folder:"
msgstr "_Fihristte saqla:"
msgstr "_Cilbentte saqla:"
# tüklü
#. translators: this string is the default job title for print
@@ -2908,7 +2893,7 @@ msgstr "Başlanğıç durum"
#: gtk/gtkprintoperation.c:1688
msgctxt "print operation status"
msgid "Preparing to print"
msgstr "Bastırılmağa hazırlana"
msgstr "Bastırılmağa azırlana"
#: gtk/gtkprintoperation.c:1689
msgctxt "print operation status"
@@ -2949,7 +2934,7 @@ msgstr "Hatanen tamamlandı"
#: gtk/gtkprintoperation.c:2254
#, c-format
msgid "Preparing %d"
msgstr "%d hazırlana"
msgstr "%d azırlana"
# gtk/gtkstock.c:268
#: gtk/gtkprintoperation.c:2256 gtk/gtkprintoperation.c:2875
@@ -3090,7 +3075,6 @@ msgstr "_Ağımdaki Saife"
# gtk/gtkfilesel.c:1795
#: gtk/gtkprintunixdialog.c:2200
#, fuzzy
msgid "Se_lection"
msgstr "_Saylam: "
@@ -3107,9 +3091,8 @@ msgstr ""
" meselâ 1-3,7,11"
#: gtk/gtkprintunixdialog.c:2220
#, fuzzy
msgid "Pages"
msgstr "_Saifeler:"
msgstr "Saifeler"
#: gtk/gtkprintunixdialog.c:2233
msgid "Copies"
@@ -3199,14 +3182,12 @@ msgid "Right to left"
msgstr "Sağdan solğa"
#: gtk/gtkprintunixdialog.c:3059
#, fuzzy
msgid "Top to bottom"
msgstr "Yuqarıdan aşağığa, soldan sağğa"
msgstr "Yuqarıdan aşağığa"
#: gtk/gtkprintunixdialog.c:3060
#, fuzzy
msgid "Bottom to top"
msgstr "Aşağıdan yuqarığa, soldan sağğa"
msgstr "Aşağıdan yuqarığa"
#: gtk/gtkprintunixdialog.c:3300
msgid "Layout"
@@ -3269,29 +3250,24 @@ msgstr "Çıqtı _sinisi:"
# tüklü
# gtk/gtkcolorsel.c:1798
#: gtk/gtkprintunixdialog.c:3473
#, fuzzy
msgid "Or_ientation:"
msgstr "_Yöneldirim:"
# gtk/gtkstock.c:299
#. In enum order
#: gtk/gtkprintunixdialog.c:3488
#, fuzzy
msgid "Portrait"
msgstr "Portret"
#: gtk/gtkprintunixdialog.c:3489
#, fuzzy
msgid "Landscape"
msgstr "Manzara"
#: gtk/gtkprintunixdialog.c:3490
#, fuzzy
msgid "Reverse portrait"
msgstr "Ters portret"
#: gtk/gtkprintunixdialog.c:3491
#, fuzzy
msgid "Reverse landscape"
msgstr "Ters manzara"
@@ -3472,12 +3448,12 @@ msgstr "_Hususiy Çoqraqlarnı Köster"
#.
#: gtk/gtkrecentchoosermenu.c:342
msgid "No items found"
msgstr "İç bir unsur tapılamadı"
msgstr "İç bir unsur tapılmadı"
#: gtk/gtkrecentchoosermenu.c:508 gtk/gtkrecentchoosermenu.c:564
#, c-format
msgid "No recently used resource found with URI `%s'"
msgstr "'%s' URI ile içün iç bir demi qullanılğan çoqraq tapılamadı"
msgstr "'%s' URI ile iç bir demi qullanılğan çoqraq tapılmadı"
#: gtk/gtkrecentchoosermenu.c:775
#, c-format
@@ -3517,11 +3493,11 @@ msgstr "%d. %s"
msgid "Unable to find an item with URI '%s'"
msgstr "'%s' URI ile bir unsur tapılamadı"
# tüklü
#: gtk/gtkspinner.c:458
#, fuzzy
msgctxt "throbbing progress animation widget"
msgid "Spinner"
msgstr "Super"
msgstr "Aylanıcı"
#: gtk/gtkspinner.c:459
msgid "Provides visual indication of progress"
@@ -4093,7 +4069,7 @@ msgstr "%s formatı içün keri-silsileleştirme funktsiyası yoq"
#: gtk/gtktextbufferserialize.c:796 gtk/gtktextbufferserialize.c:822
#, c-format
msgid "Both \"id\" and \"name\" were found on the <%s> element"
msgstr "<%s> unsurında hem \"id\" hem \"name\" tapıldı"
msgstr "<%s> unsurında em \"id\" em \"name\" tapıldı"
#: gtk/gtktextbufferserialize.c:806 gtk/gtktextbufferserialize.c:832
#, c-format
@@ -5126,10 +5102,9 @@ msgid "prc8 Envelope"
msgstr "prc8 Zarfı"
#: gtk/paper_names_offsets.c:166
#, fuzzy
msgctxt "paper size"
msgid "prc9 Envelope"
msgstr "prc1 Zarfı"
msgstr "prc9 Zarfı"
#: gtk/paper_names_offsets.c:167
msgctxt "paper size"
@@ -5167,7 +5142,7 @@ msgstr "Heş cedveli yazılamadı\n"
#: gtk/updateiconcache.c:1386
#, c-format
msgid "Failed to write folder index\n"
msgstr "Fihrist indeksi yazılamadı\n"
msgstr "Cilbent indeksi yazılamadı\n"
# gdk-pixbuf/io-tiff.c:264
#: gtk/updateiconcache.c:1394
@@ -5250,9 +5225,9 @@ msgid "Not a valid icon cache: %s\n"
msgstr "Keçerli bir işaretçik ög-hafizası degil: %s\n"
#: gtk/updateiconcache.c:1702
#, fuzzy, c-format
#, c-format
msgid "No theme index file.\n"
msgstr "Tema indeks dosyesi yoq."
msgstr "Tema indeks dosyesi yoq.\n"
#: gtk/updateiconcache.c:1706
#, c-format
@@ -5327,16 +5302,14 @@ msgstr "X Kirdi Usulı"
# gtk/gtkfilesel.c:1351
#: modules/printbackends/cups/gtkprintbackendcups.c:809
#: modules/printbackends/cups/gtkprintbackendcups.c:1018
#, fuzzy
msgid "Username:"
msgstr "_Qullanıcı adı:"
msgstr "Qullanıcı adı:"
# gtk/gtkinputdialog.c:471
#: modules/printbackends/cups/gtkprintbackendcups.c:810
#: modules/printbackends/cups/gtkprintbackendcups.c:1027
#, fuzzy
msgid "Password:"
msgstr "_Sır-söz:"
msgstr "Sır-söz:"
#: modules/printbackends/cups/gtkprintbackendcups.c:848
#, c-format
@@ -5389,7 +5362,6 @@ msgstr ""
# gtk/gtkfilesel.c:1795
#: modules/printbackends/cups/gtkprintbackendcups.c:1012
#, fuzzy
msgid "Domain:"
msgstr "_Saa:"
@@ -5707,7 +5679,7 @@ msgstr "Postscript"
#: modules/printbackends/file/gtkprintbackendfile.c:570
msgid "SVG"
msgstr ""
msgstr "SVG"
#: modules/printbackends/file/gtkprintbackendfile.c:582
#: modules/printbackends/test/gtkprintbackendtest.c:503
@@ -5738,15 +5710,13 @@ msgstr "Emir Satırı "
# tüklü
#. SUN_BRANDING
#: modules/printbackends/papi/gtkprintbackendpapi.c:811
#, fuzzy
msgid "printer offline"
msgstr "Bastırıcı devre-tışı"
msgstr "bastırıcı devre-tışı"
#. SUN_BRANDING
#: modules/printbackends/papi/gtkprintbackendpapi.c:829
#, fuzzy
msgid "ready to print"
msgstr "Bastırılmağa hazırlana"
msgstr "bastırmağa azır"
#. SUN_BRANDING
#: modules/printbackends/papi/gtkprintbackendpapi.c:832
@@ -5756,16 +5726,14 @@ msgstr ""
# gtk/gtkstock.c:297
#. SUN_BRANDING
#: modules/printbackends/papi/gtkprintbackendpapi.c:836
#, fuzzy
msgid "paused"
msgstr "Tınışlandı"
msgstr "tınışlanğan"
# gtk/gtkinputdialog.c:577
#. SUN_BRANDING
#: modules/printbackends/papi/gtkprintbackendpapi.c:839
#, fuzzy
msgid "unknown"
msgstr "(namalüm)"
msgstr "namalüm"
#. default filename used for print-to-test
#: modules/printbackends/test/gtkprintbackendtest.c:234
+1140 -1129
View File
File diff suppressed because it is too large Load Diff
+100 -98
View File
@@ -10,21 +10,21 @@
# Ignacio Casal Quinteiro <nacho.resa@gmail.com>, 2005, 2006.
# Ignacio Casal Quinteiro <icq@svn.gnome.org>, 2008.
# Mancomún - Centro de Referencia e Servizos de Software Libre <g11n@mancomun.org>, 2009.
# Fran Diéguez <fran.dieguez@mabishu.com>, 2009.
# Antón Méixome <meixome@mancomun.org>, 2009.
# Anton Meixome <certima@certima.net>, 2009.
# Fran Dieguez <fran.dieguez@glug.es>, 2009.
# Fran Diéguez <frandieguez@ubuntu.com>, 2010.
# Antón Méixome <meixome@certima.net>, 2010.
# Francisco Diéguez <frandieguez@ubuntu.com>, 2010.
# Fran Diéguez <frandieguez@ubuntu.com>, 2009, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: gtk+-master-po-gl-77922___.merged\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-04-05 20:57+0300\n"
"PO-Revision-Date: 2010-04-05 15:17+0100\n"
"Last-Translator: Antón Méixome <meixome@certima.net>\n"
"Language-Team: Galician <proxecto@trasno.net>\n"
"POT-Creation-Date: 2010-05-02 00:12+0200\n"
"PO-Revision-Date: 2010-05-02 00:14+0200\n"
"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
"Language-Team: Galician <gnome@g11n.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -91,7 +91,7 @@ msgstr "Parámetros de depuración Gdk para activar"
#. Placeholder in --gdk-no-debug=FLAGS in --help output
#. Placeholder in --gtk-debug=FLAGS in --help output
#. Placeholder in --gtk-no-debug=FLAGS in --help output
#: ../gdk/gdk.c:165 ../gdk/gdk.c:168 ../gtk/gtkmain.c:459 ../gtk/gtkmain.c:462
#: ../gdk/gdk.c:165 ../gdk/gdk.c:168 ../gtk/gtkmain.c:460 ../gtk/gtkmain.c:463
msgid "FLAGS"
msgstr "PARÁMETROS"
@@ -422,13 +422,11 @@ msgid "Image pixel data corrupt"
msgstr "Os datos do píxel da imaxe están danados"
#: ../gdk-pixbuf/gdk-pixdata.c:432
#, fuzzy, c-format
#, c-format
msgid "failed to allocate image buffer of %u byte"
msgid_plural "failed to allocate image buffer of %u bytes"
msgstr[0] ""
"Produciuse un fallo ao asignar %d bytes para o búfer de lectura do ficheiro"
msgstr[1] ""
"Produciuse un fallo ao asignar %d bytes para o búfer de lectura do ficheiro"
msgstr[0] "Produciuse un fallo ao asignar o búfer de imaxe de %u bytes "
msgstr[1] "Produciuse un fallo ao asignar o búfer de imaxe de %u bytes"
#: ../gdk-pixbuf/io-ani.c:244
msgid "Unexpected icon chunk in animation"
@@ -1261,11 +1259,11 @@ msgid "Opening %s"
msgstr "Abrindo %s"
#: ../gdk/x11/gdkapplaunchcontext-x11.c:318
#, fuzzy, c-format
#, c-format
msgid "Opening %d Item"
msgid_plural "Opening %d Items"
msgstr[0] "Abrindo %s"
msgstr[1] "Abrindo %s"
msgstr[0] "Abrindo %d elemento"
msgstr[1] "Abrindo %d elementos"
#: ../gtk/gtkaboutdialog.c:242
msgid "Could not show link"
@@ -1728,11 +1726,11 @@ msgstr "_Dereito:"
msgid "Paper Margins"
msgstr "Marxes do papel"
#: ../gtk/gtkentry.c:8698 ../gtk/gtktextview.c:7881
#: ../gtk/gtkentry.c:8698 ../gtk/gtktextview.c:7917
msgid "Input _Methods"
msgstr "_Métodos de entrada"
#: ../gtk/gtkentry.c:8712 ../gtk/gtktextview.c:7895
#: ../gtk/gtkentry.c:8712 ../gtk/gtktextview.c:7931
msgid "_Insert Unicode Control Character"
msgstr "_Inserir un carácter de control Unicode"
@@ -1744,7 +1742,7 @@ msgstr "Bloq Maiús está activado"
msgid "Select A File"
msgstr "Seleccionar un ficheiro"
#: ../gtk/gtkfilechooserbutton.c:65 ../gtk/gtkfilechooserdefault.c:1848
#: ../gtk/gtkfilechooserbutton.c:65 ../gtk/gtkfilechooserdefault.c:1839
msgid "Desktop"
msgstr "Escritorio"
@@ -1760,23 +1758,23 @@ msgstr "Outro..."
msgid "Type name of new folder"
msgstr "Escriba o nome do cartafol novo"
#: ../gtk/gtkfilechooserdefault.c:974
#: ../gtk/gtkfilechooserdefault.c:965
msgid "Could not retrieve information about the file"
msgstr "Non foi posíbel recuperar a información sobre o ficheiro"
#: ../gtk/gtkfilechooserdefault.c:985
#: ../gtk/gtkfilechooserdefault.c:976
msgid "Could not add a bookmark"
msgstr "Non foi posíbel engadir un marcador"
#: ../gtk/gtkfilechooserdefault.c:996
#: ../gtk/gtkfilechooserdefault.c:987
msgid "Could not remove bookmark"
msgstr "Non foi posíbel eliminar o marcador"
#: ../gtk/gtkfilechooserdefault.c:1007
#: ../gtk/gtkfilechooserdefault.c:998
msgid "The folder could not be created"
msgstr "Non foi posíbel crear o cartafol"
#: ../gtk/gtkfilechooserdefault.c:1020
#: ../gtk/gtkfilechooserdefault.c:1011
msgid ""
"The folder could not be created, as a file with the same name already "
"exists. Try using a different name for the folder, or rename the file first."
@@ -1784,11 +1782,11 @@ msgstr ""
"Non foi posíbel crear o cartafol: xa existe un ficheiro co mesmo nome. Tente "
"usar un nome diferente para o cartafol ou renomee o ficheiro primeiro."
#: ../gtk/gtkfilechooserdefault.c:1031
#: ../gtk/gtkfilechooserdefault.c:1022
msgid "Invalid file name"
msgstr "O nome do ficheiro é incorrecto"
#: ../gtk/gtkfilechooserdefault.c:1041
#: ../gtk/gtkfilechooserdefault.c:1032
msgid "The folder contents could not be displayed"
msgstr "Non foi posíbel mostrar o contido do cartafol"
@@ -1796,186 +1794,186 @@ msgstr "Non foi posíbel mostrar o contido do cartafol"
#. * is a hostname. Nautilus and the panel contain the same string
#. * to translate.
#.
#: ../gtk/gtkfilechooserdefault.c:1591
#: ../gtk/gtkfilechooserdefault.c:1582
#, c-format
msgid "%1$s on %2$s"
msgstr "%1$s en %2$s"
#: ../gtk/gtkfilechooserdefault.c:1767
#: ../gtk/gtkfilechooserdefault.c:1758
msgid "Search"
msgstr "Buscar"
#: ../gtk/gtkfilechooserdefault.c:1791 ../gtk/gtkfilechooserdefault.c:9462
#: ../gtk/gtkfilechooserdefault.c:1782 ../gtk/gtkfilechooserdefault.c:9458
msgid "Recently Used"
msgstr "Usado recentemente"
#: ../gtk/gtkfilechooserdefault.c:2434
#: ../gtk/gtkfilechooserdefault.c:2422
msgid "Select which types of files are shown"
msgstr "Seleccione que tipos de ficheiros se mostran"
#: ../gtk/gtkfilechooserdefault.c:2793
#: ../gtk/gtkfilechooserdefault.c:2781
#, c-format
msgid "Add the folder '%s' to the bookmarks"
msgstr "Engadirlle o cartafol '%s' aos marcadores"
#: ../gtk/gtkfilechooserdefault.c:2837
#: ../gtk/gtkfilechooserdefault.c:2825
#, c-format
msgid "Add the current folder to the bookmarks"
msgstr "Engadirlle o cartafol actual aos marcadores"
#: ../gtk/gtkfilechooserdefault.c:2839
#: ../gtk/gtkfilechooserdefault.c:2827
#, c-format
msgid "Add the selected folders to the bookmarks"
msgstr "Engadirlle os cartafoles seleccionados aos marcadores"
#: ../gtk/gtkfilechooserdefault.c:2877
#: ../gtk/gtkfilechooserdefault.c:2865
#, c-format
msgid "Remove the bookmark '%s'"
msgstr "Eliminar o marcador '%s'"
#: ../gtk/gtkfilechooserdefault.c:2879
#: ../gtk/gtkfilechooserdefault.c:2867
#, c-format
msgid "Bookmark '%s' cannot be removed"
msgstr "O marcador '%s' non pode ser eliminado"
#: ../gtk/gtkfilechooserdefault.c:2886 ../gtk/gtkfilechooserdefault.c:3910
#: ../gtk/gtkfilechooserdefault.c:2874 ../gtk/gtkfilechooserdefault.c:3898
msgid "Remove the selected bookmark"
msgstr "Eliminar o marcador seleccionado"
#: ../gtk/gtkfilechooserdefault.c:3606
#: ../gtk/gtkfilechooserdefault.c:3594
msgid "Remove"
msgstr "Eliminar"
#: ../gtk/gtkfilechooserdefault.c:3615
#: ../gtk/gtkfilechooserdefault.c:3603
msgid "Rename..."
msgstr "Renomear..."
#. Accessible object name for the file chooser's shortcuts pane
#: ../gtk/gtkfilechooserdefault.c:3778
#: ../gtk/gtkfilechooserdefault.c:3766
msgid "Places"
msgstr "Lugares"
#. Column header for the file chooser's shortcuts pane
#: ../gtk/gtkfilechooserdefault.c:3835
#: ../gtk/gtkfilechooserdefault.c:3823
msgid "_Places"
msgstr "_Lugares"
#: ../gtk/gtkfilechooserdefault.c:3891
#: ../gtk/gtkfilechooserdefault.c:3879
msgid "_Add"
msgstr "_Engadir"
#: ../gtk/gtkfilechooserdefault.c:3898
#: ../gtk/gtkfilechooserdefault.c:3886
msgid "Add the selected folder to the Bookmarks"
msgstr "Engadir o cartafol seleccionado aos marcadores"
#: ../gtk/gtkfilechooserdefault.c:3903
#: ../gtk/gtkfilechooserdefault.c:3891
msgid "_Remove"
msgstr "_Eliminar"
#: ../gtk/gtkfilechooserdefault.c:4038
#: ../gtk/gtkfilechooserdefault.c:4026
msgid "Could not select file"
msgstr "Non foi posíbel seleccionar o ficheiro"
#: ../gtk/gtkfilechooserdefault.c:4213
#: ../gtk/gtkfilechooserdefault.c:4201
msgid "_Add to Bookmarks"
msgstr "_Engadir aos marcadores"
#: ../gtk/gtkfilechooserdefault.c:4226
#: ../gtk/gtkfilechooserdefault.c:4214
msgid "Show _Hidden Files"
msgstr "Mostrar os ficheiros _ocultos"
#: ../gtk/gtkfilechooserdefault.c:4233
#: ../gtk/gtkfilechooserdefault.c:4221
msgid "Show _Size Column"
msgstr "Mostrar a columna de _tamaño"
#: ../gtk/gtkfilechooserdefault.c:4453 ../gtk/gtkfilesel.c:730
#: ../gtk/gtkfilechooserdefault.c:4441 ../gtk/gtkfilesel.c:730
msgid "Files"
msgstr "Ficheiros"
#: ../gtk/gtkfilechooserdefault.c:4504
#: ../gtk/gtkfilechooserdefault.c:4492
msgid "Name"
msgstr "Nome"
#: ../gtk/gtkfilechooserdefault.c:4527
#: ../gtk/gtkfilechooserdefault.c:4515
msgid "Size"
msgstr "Tamaño"
#: ../gtk/gtkfilechooserdefault.c:4541
#: ../gtk/gtkfilechooserdefault.c:4529
msgid "Modified"
msgstr "Modificado"
#. Label
#: ../gtk/gtkfilechooserdefault.c:4796 ../gtk/gtkprinteroptionwidget.c:802
#: ../gtk/gtkfilechooserdefault.c:4784 ../gtk/gtkprinteroptionwidget.c:802
msgid "_Name:"
msgstr "_Nome:"
#: ../gtk/gtkfilechooserdefault.c:4839
#: ../gtk/gtkfilechooserdefault.c:4827
msgid "_Browse for other folders"
msgstr "_Buscar outros cartafoles"
#: ../gtk/gtkfilechooserdefault.c:5111
#: ../gtk/gtkfilechooserdefault.c:5099
msgid "Type a file name"
msgstr "Teclee un nome de ficheiro"
#. Create Folder
#: ../gtk/gtkfilechooserdefault.c:5152
#: ../gtk/gtkfilechooserdefault.c:5140
msgid "Create Fo_lder"
msgstr "Crear car_tafol"
#: ../gtk/gtkfilechooserdefault.c:5162
#: ../gtk/gtkfilechooserdefault.c:5150
msgid "_Location:"
msgstr "_Localización:"
#: ../gtk/gtkfilechooserdefault.c:5366
#: ../gtk/gtkfilechooserdefault.c:5354
msgid "Save in _folder:"
msgstr "Gardar no _cartafol:"
#: ../gtk/gtkfilechooserdefault.c:5368
#: ../gtk/gtkfilechooserdefault.c:5356
msgid "Create in _folder:"
msgstr "Crear no _cartafol:"
#: ../gtk/gtkfilechooserdefault.c:6435
#: ../gtk/gtkfilechooserdefault.c:6423
#, c-format
msgid "Could not read the contents of %s"
msgstr "Non foi posíbel ler os contidos do %s"
#: ../gtk/gtkfilechooserdefault.c:6439
#: ../gtk/gtkfilechooserdefault.c:6427
msgid "Could not read the contents of the folder"
msgstr "Non foi posíbel ler os contidos do cartafol"
#: ../gtk/gtkfilechooserdefault.c:6532 ../gtk/gtkfilechooserdefault.c:6600
#: ../gtk/gtkfilechooserdefault.c:6745
#: ../gtk/gtkfilechooserdefault.c:6520 ../gtk/gtkfilechooserdefault.c:6588
#: ../gtk/gtkfilechooserdefault.c:6733
msgid "Unknown"
msgstr "Descoñecido"
#: ../gtk/gtkfilechooserdefault.c:6547
#: ../gtk/gtkfilechooserdefault.c:6535
msgid "%H:%M"
msgstr "%H:%M"
#: ../gtk/gtkfilechooserdefault.c:6549
#: ../gtk/gtkfilechooserdefault.c:6537
msgid "Yesterday at %H:%M"
msgstr "Onte ás %H:%M"
#: ../gtk/gtkfilechooserdefault.c:7215
#: ../gtk/gtkfilechooserdefault.c:7203
msgid "Cannot change to folder because it is not local"
msgstr "Non é posíbel cambiar ao cartafol porque non é local"
#: ../gtk/gtkfilechooserdefault.c:7812 ../gtk/gtkfilechooserdefault.c:7833
#: ../gtk/gtkfilechooserdefault.c:7800 ../gtk/gtkfilechooserdefault.c:7821
#, c-format
msgid "Shortcut %s already exists"
msgstr "O atallo %s xa existe"
#: ../gtk/gtkfilechooserdefault.c:7923
#: ../gtk/gtkfilechooserdefault.c:7911
#, c-format
msgid "Shortcut %s does not exist"
msgstr "O atallo %s non existe"
#: ../gtk/gtkfilechooserdefault.c:8178 ../gtk/gtkprintunixdialog.c:480
#: ../gtk/gtkfilechooserdefault.c:8166 ../gtk/gtkprintunixdialog.c:480
#, c-format
msgid "A file named \"%s\" already exists. Do you want to replace it?"
msgstr "Xa existe un ficheiro con nome \"%s\". Quere substituílo?"
#: ../gtk/gtkfilechooserdefault.c:8181 ../gtk/gtkprintunixdialog.c:484
#: ../gtk/gtkfilechooserdefault.c:8169 ../gtk/gtkprintunixdialog.c:484
#, c-format
msgid ""
"The file already exists in \"%s\". Replacing it will overwrite its contents."
@@ -1983,15 +1981,15 @@ msgstr ""
"O ficheiro xa existe en \"%s\". Se o substitúe sobrescribirá os seus "
"contidos."
#: ../gtk/gtkfilechooserdefault.c:8186 ../gtk/gtkprintunixdialog.c:491
#: ../gtk/gtkfilechooserdefault.c:8174 ../gtk/gtkprintunixdialog.c:491
msgid "_Replace"
msgstr "_Substituír"
#: ../gtk/gtkfilechooserdefault.c:8830
#: ../gtk/gtkfilechooserdefault.c:8826
msgid "Could not start the search process"
msgstr "Non foi posíbel iniciar o proceso de busca"
#: ../gtk/gtkfilechooserdefault.c:8831
#: ../gtk/gtkfilechooserdefault.c:8827
msgid ""
"The program was not able to create a connection to the indexer daemon. "
"Please make sure it is running."
@@ -1999,15 +1997,15 @@ msgstr ""
"O programa non puido crear unha conexión co deamon indexador. Asegúrese de "
"que está en execución."
#: ../gtk/gtkfilechooserdefault.c:8845
#: ../gtk/gtkfilechooserdefault.c:8841
msgid "Could not send the search request"
msgstr "Non foi posíbel enviar a solicitude de busca"
#: ../gtk/gtkfilechooserdefault.c:9034
#: ../gtk/gtkfilechooserdefault.c:9030
msgid "Search:"
msgstr "Buscar:"
#: ../gtk/gtkfilechooserdefault.c:9638
#: ../gtk/gtkfilechooserdefault.c:9634
#, c-format
msgid "Could not mount %s"
msgstr "Non foi posíbel montar %s"
@@ -2397,12 +2395,12 @@ msgid "Cl_ear"
msgstr "Li_mpar"
#. Open Link
#: ../gtk/gtklabel.c:5685
#: ../gtk/gtklabel.c:6118
msgid "_Open Link"
msgstr "_Abrir a ligazón"
#. Copy Link Address
#: ../gtk/gtklabel.c:5697
#: ../gtk/gtklabel.c:6130
msgid "Copy _Link Address"
msgstr "Copiar o enderezo da _ligazón"
@@ -2415,27 +2413,27 @@ msgid "Invalid URI"
msgstr "URI incorrecto"
#. Description of --gtk-module=MODULES in --help output
#: ../gtk/gtkmain.c:452
#: ../gtk/gtkmain.c:453
msgid "Load additional GTK+ modules"
msgstr "Cargar os módulos adicionais GTK+"
#. Placeholder in --gtk-module=MODULES in --help output
#: ../gtk/gtkmain.c:453
#: ../gtk/gtkmain.c:454
msgid "MODULES"
msgstr "MÓDULOS"
#. Description of --g-fatal-warnings in --help output
#: ../gtk/gtkmain.c:455
#: ../gtk/gtkmain.c:456
msgid "Make all warnings fatal"
msgstr "Facer todos os avisos fatais"
#. Description of --gtk-debug=FLAGS in --help output
#: ../gtk/gtkmain.c:458
#: ../gtk/gtkmain.c:459
msgid "GTK+ debugging flags to set"
msgstr "Marcas de depuración GTK+ para activar"
#. Description of --gtk-no-debug=FLAGS in --help output
#: ../gtk/gtkmain.c:461
#: ../gtk/gtkmain.c:462
msgid "GTK+ debugging flags to unset"
msgstr "Marcas de depuración GTK+ para desconfigurar"
@@ -2444,20 +2442,20 @@ msgstr "Marcas de depuración GTK+ para desconfigurar"
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
#: ../gtk/gtkmain.c:713
#: ../gtk/gtkmain.c:714
msgid "default:LTR"
msgstr "default:LTR"
#: ../gtk/gtkmain.c:778
#: ../gtk/gtkmain.c:779
#, c-format
msgid "Cannot open display: %s"
msgstr "Non é posíbel abrir a pantalla: %s"
#: ../gtk/gtkmain.c:815
#: ../gtk/gtkmain.c:816
msgid "GTK+ Options"
msgstr "Opcións GTK+"
#: ../gtk/gtkmain.c:815
#: ../gtk/gtkmain.c:816
msgid "Show GTK+ Options"
msgstr "Mostrar opcións GTK+"
@@ -2603,7 +2601,7 @@ msgstr "Camiño superior"
msgid "Down Path"
msgstr "Camiño inferior"
#: ../gtk/gtkpathbar.c:1469
#: ../gtk/gtkpathbar.c:1480
msgid "File System Root"
msgstr "Sistema de ficheiros raíz"
@@ -2615,6 +2613,10 @@ msgstr "Autenticación"
msgid "Not available"
msgstr "Non dispoñíbel"
#: ../gtk/gtkprinteroptionwidget.c:795
msgid "Select a folder"
msgstr "Seleccionar un cartafol"
#: ../gtk/gtkprinteroptionwidget.c:814
msgid "_Save in folder:"
msgstr "_Gardar no cartafol:"
@@ -3086,12 +3088,12 @@ msgstr "Algunhas das configuracións do diálogo están en conflito"
msgid "Print"
msgstr "Imprimir"
#: ../gtk/gtkrc.c:2878
#: ../gtk/gtkrc.c:2906
#, c-format
msgid "Unable to find include file: \"%s\""
msgstr "Non é posíbel localizar o ficheiro 'include': \"%s\""
#: ../gtk/gtkrc.c:3508 ../gtk/gtkrc.c:3511
#: ../gtk/gtkrc.c:3536 ../gtk/gtkrc.c:3539
#, c-format
msgid "Unable to locate image file in pixmap_path: \"%s\""
msgstr "Non é posíbel localizar o ficheiro de imaxe no pixmap_path: \"%s\""
@@ -3886,39 +3888,39 @@ msgstr "Datos de carácter inesperados na liña %d carácter %d"
msgid "Empty"
msgstr "Baleiro"
#: ../gtk/gtkvolumebutton.c:73
#: ../gtk/gtkvolumebutton.c:83
msgid "Volume"
msgstr "Volume"
#: ../gtk/gtkvolumebutton.c:75
#: ../gtk/gtkvolumebutton.c:85
msgid "Turns volume down or up"
msgstr "Sobe ou baixa o volume"
#: ../gtk/gtkvolumebutton.c:78
#: ../gtk/gtkvolumebutton.c:88
msgid "Adjusts the volume"
msgstr "Axusta o volume"
#: ../gtk/gtkvolumebutton.c:81 ../gtk/gtkvolumebutton.c:84
#: ../gtk/gtkvolumebutton.c:91 ../gtk/gtkvolumebutton.c:94
msgid "Volume Down"
msgstr "Baixar o volume"
#: ../gtk/gtkvolumebutton.c:83
#: ../gtk/gtkvolumebutton.c:93
msgid "Decreases the volume"
msgstr "Abaixa o volume"
#: ../gtk/gtkvolumebutton.c:87 ../gtk/gtkvolumebutton.c:90
#: ../gtk/gtkvolumebutton.c:97 ../gtk/gtkvolumebutton.c:100
msgid "Volume Up"
msgstr "Subir o volume"
#: ../gtk/gtkvolumebutton.c:89
#: ../gtk/gtkvolumebutton.c:99
msgid "Increases the volume"
msgstr "Sobe o volume"
#: ../gtk/gtkvolumebutton.c:147
#: ../gtk/gtkvolumebutton.c:157
msgid "Muted"
msgstr "Silenciado"
#: ../gtk/gtkvolumebutton.c:151
#: ../gtk/gtkvolumebutton.c:161
msgid "Full Volume"
msgstr "Volume máximo"
@@ -3927,7 +3929,7 @@ msgstr "Volume máximo"
#. * Translate the "%d" to "%Id" if you want to use localised digits,
#. * or otherwise translate the "%d" to "%d".
#.
#: ../gtk/gtkvolumebutton.c:164
#: ../gtk/gtkvolumebutton.c:174
#, c-format
msgctxt "volume percentage"
msgid "%d %%"
+1123 -1112
View File
File diff suppressed because it is too large Load Diff
+1131 -1119
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -29,6 +29,7 @@ noinst_PROGRAMS = $(TEST_PROGS) \
simple \
flicker \
print-editor \
extendedlayoutexample \
testaccel \
testassistant \
testbbox \
@@ -112,6 +113,7 @@ endif
flicker_DEPENDENCIES = $(TEST_DEPS)
simple_DEPENDENCIES = $(TEST_DEPS)
print_editor_DEPENDENCIES = $(TEST_DEPS)
extendedlayoutexample_DEPENDENCIES = $(TEST_DEPS)
testicontheme_DEPENDENCIES = $(TEST_DEPS)
testiconview_DEPENDENCIES = $(TEST_DEPS)
testaccel_DEPENDENCIES = $(TEST_DEPS)
@@ -176,6 +178,7 @@ testwindows_DEPENDENCIES = $(TEST_DEPS)
flicker_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
print_editor_LDADD = $(LDADDS)
extendedlayoutexample_LDADD = $(LDADDS)
testaccel_LDADD = $(LDADDS)
testassistant_LDADD = $(LDADDS)
testbbox_LDADD = $(LDADDS)
+620
View File
@@ -0,0 +1,620 @@
/* extendedlayoutexample.c
* Copyright (C) 2010 Openismus GmbH
*
* Author:
* Tristan Van Berkom <tristan.van.berkom@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtk.h>
typedef struct {
const gchar *name;
const gchar *tooltip;
const gchar *interface;
GtkWidget *window;
} TestInterface;
/* These strings were generated with:
*
* IFS=""; while read line; do echo -n \"; echo -n $line | sed -e 's|\"|\\"|g'; echo \"; done < file.glade
*/
TestInterface interfaces[] = {
{
"Ellipsizing Labels",
"Demonstrates how labels will request a natural size in a horizontal space",
"<interface>"
" <requires lib=\"gtk+\" version=\"2.20\"/>"
" <!-- interface-naming-policy project-wide -->"
" <object class=\"GtkWindow\" id=\"window\">"
" <property name=\"default_width\">450</property>"
" <property name=\"default_height\">50</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox5\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label9\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Some labels do ellipsize</property>"
" <property name=\"ellipsize\">end</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#09610feefe03\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label10\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">but some</property>"
" <property name=\"ellipsize\">end</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#0000af6b0993\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label11\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">do not at all</property>"
" <attributes>"
" <attribute name=\"style\" value=\"normal\"/>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">2</property>"
" </packing>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>",
NULL
},
{
"Wrapping Label",
"Demonstrates how a wrapping label can require a height contextual to its allocated width",
"<interface>"
" <requires lib=\"gtk+\" version=\"2.18\"/>"
" <!-- interface-naming-policy project-wide -->"
" <object class=\"GtkWindow\" id=\"window\">"
" <property name=\"border_width\">12</property>"
" <property name=\"default_width\">300</property>"
" <child>"
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <child>"
" <object class=\"GtkVBox\" id=\"vbox2\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label3\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">A short static label.</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkFrame\" id=\"frame1\">"
" <property name=\"label\">Long label</property>"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This is a really long label for the purpose of testing line wrapping is working correctly in conjunction with height-for-width support in GTK+</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"max_width_chars\">30</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#18c52119f796\"/>"
" </attributes>"
" </object>"
" </child>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkButton\" id=\"button2\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <property name=\"receives_default\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label2\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">A really really long label inside a button to demonstrate height for width working inside buttons</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"max_width_chars\">25</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#1e3687ab0a52\"/>"
" </attributes>"
" </object>"
" </child>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">2</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"resize\">False</property>"
" <property name=\"shrink\">False</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label4\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This static label\n"
"can shrink.</property>"
" <property name=\"justify\">center</property>"
" <attributes>"
" <attribute name=\"style\" value=\"normal\"/>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"resize\">True</property>"
" <property name=\"shrink\">True</property>"
" </packing>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>",
NULL
},
{
"Horizontal Box",
"Demonstrates how a horizontal box can calculate the collective height for an allocated width",
"<interface>"
" <requires lib=\"gtk+\" version=\"2.20\"/>"
" <!-- interface-naming-policy project-wide -->"
" <object class=\"GtkWindow\" id=\"window\">"
" <property name=\"default_height\">200</property>"
" <property name=\"default_width\">600</property>"
" <child>"
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <child>"
" <object class=\"GtkVBox\" id=\"vbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkButton\" id=\"button1\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <property name=\"receives_default\">True</property>"
" <property name=\"use_action_appearance\">False</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label2\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">A button that wraps.</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">10</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#0000041dffff\"/>"
" </attributes>"
" </object>"
" </child>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Lets try setting up some long text to wrap up in this hbox and see if the height-for-width is gonna work !</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">30</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#07d0a9b20972\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkButton\" id=\"button2\">"
" <property name=\"label\" translatable=\"yes\">A button that expands in the vbox</property>"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <property name=\"receives_default\">True</property>"
" <property name=\"use_action_appearance\">False</property>"
" </object>"
" <packing>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"resize\">False</property>"
" <property name=\"shrink\">False</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label4\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This label is\n"
"set to shrink inside\n"
"the paned window.</property>"
" <property name=\"justify\">center</property>"
" <attributes>"
" <attribute name=\"style\" value=\"normal\"/>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"resize\">True</property>"
" <property name=\"shrink\">True</property>"
" </packing>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>",
NULL
},
{
"Vertical Labels",
"Demonstrates how a horizontal box will consider width-for-height when allocating children "
"even if the toplevel window is requested as height-for-width.",
"<interface>"
" <requires lib=\"gtk+\" version=\"2.20\"/>"
" <!-- interface-naming-policy project-wide -->"
" <object class=\"GtkWindow\" id=\"window\">"
" <property name=\"default_width\">400</property>"
" <property name=\"default_height\">300</property>"
" <child>"
" <object class=\"GtkVPaned\" id=\"vpaned1\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
" <property name=\"justify\">center</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">10</property>"
" <property name=\"angle\">90</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkFrame\" id=\"frame1\">"
" <property name=\"visible\">True</property>"
" <property name=\"label_xalign\">0</property>"
" <property name=\"shadow_type\">out</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label5\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Neither of the panes are\n"
"set to shrink.</property>"
" <property name=\"justify\">center</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" </child>"
" <child type=\"label_item\">"
" <placeholder/>"
" </child>"
" </object>"
" <packing>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"resize\">False</property>"
" <property name=\"shrink\">False</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox2\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkFrame\" id=\"frame2\">"
" <property name=\"visible\">True</property>"
" <property name=\"label_xalign\">0</property>"
" <property name=\"shadow_type\">out</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label4\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">The interface is allocated as height\n"
"for width, but the horizontal boxes\n"
"allocate in width for height mode.</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#000097970808\"/>"
" </attributes>"
" </object>"
" </child>"
" <child type=\"label_item\">"
" <placeholder/>"
" </child>"
" </object>"
" <packing>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label3\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Some long width-for-height text that wraps</property>"
" <property name=\"justify\">center</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">10</property>"
" <property name=\"angle\">270</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#03e307ddfb5f\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"resize\">False</property>"
" <property name=\"shrink\">False</property>"
" </packing>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>",
NULL
},
{
"Label Parameters",
"This test demonstrates how \"width-chars\" and \"max-width-chars\" can be used "
"to effect minimum and natural widths in wrapping labels.",
"<interface>"
" <requires lib=\"gtk+\" version=\"2.20\"/>"
" <!-- interface-naming-policy project-wide -->"
" <object class=\"GtkWindow\" id=\"window\">"
" <property name=\"default_width\">900</property>"
" <child>"
" <object class=\"GtkHPaned\" id=\"hpaned1\">"
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <child>"
" <object class=\"GtkVBox\" id=\"vbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <property name=\"visible\">True</property>"
" <property name=\"spacing\">6</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">The first 2 labels require 10 characters.</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">10</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"expand\">False</property>"
" <property name=\"fill\">False</property>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label2\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This label has a maximum natural width of 20 characters. The second two labels expand.</property>"
" <property name=\"wrap\">True</property>"
" <property name=\"width_chars\">10</property>"
" <property name=\"max_width_chars\">20</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#05c2a161134b\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"expand\">True</property>"
" <property name=\"fill\">True</property>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label3\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This label requires a default minimum size.</property>"
" <property name=\"wrap\">True</property>"
" <attributes>"
" <attribute name=\"weight\" value=\"bold\"/>"
" <attribute name=\"foreground\" value=\"#03e30758fb5f\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">2</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"position\">0</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label4\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">This test demonstrates how the \"width-chars\" and \"max-width-chars\"\n"
"properties can be used to specify the minimum requested wrap width\n"
"and the maximum natural wrap width respectively.</property>"
" <property name=\"ellipsize\">end</property>"
" <property name=\"width_chars\">30</property>"
" <attributes>"
" <attribute name=\"style\" value=\"normal\"/>"
" <attribute name=\"foreground\" value=\"#05470000abaf\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"position\">1</property>"
" </packing>"
" </child>"
" </object>"
" <packing>"
" <property name=\"resize\">False</property>"
" <property name=\"shrink\">False</property>"
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkLabel\" id=\"label5\">"
" <property name=\"visible\">True</property>"
" <property name=\"label\" translatable=\"yes\">Some static\n"
"text that shrinks.\n"
"\n"
"You will need to stretch\n"
"this window quite wide\n"
"to see the effects.</property>"
" <property name=\"justify\">center</property>"
" <attributes>"
" <attribute name=\"foreground\" value=\"#ffff00000000\"/>"
" </attributes>"
" </object>"
" <packing>"
" <property name=\"resize\">True</property>"
" <property name=\"shrink\">True</property>"
" </packing>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>",
NULL
},
};
static void
test_clicked (GtkWidget *button,
TestInterface *interface)
{
if (!interface->window)
{
GtkBuilder *builder = gtk_builder_new ();
gtk_builder_add_from_string (builder, interface->interface, -1, NULL);
interface->window = (GtkWidget *)gtk_builder_get_object (builder, "window");
g_signal_connect (interface->window, "delete_event",
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
}
gtk_widget_show (interface->window);
}
static GtkWidget *
create_window (void)
{
GtkWidget *window, *vbox, *button;
gint i;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_widget_show (vbox);
gtk_container_add (GTK_CONTAINER (window), vbox);
for (i = 0; i < G_N_ELEMENTS (interfaces); i++)
{
button = gtk_button_new_with_label (interfaces[i].name);
gtk_widget_set_tooltip_text (button, interfaces[i].tooltip);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (test_clicked), &interfaces[i]);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
}
return window;
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = create_window ();
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_main_quit), window);
gtk_widget_show (window);
gtk_main ();
return 0;
}
+113 -8
View File
@@ -25,6 +25,21 @@
#include <gtk/gtk.h>
static void
redraw_event_box (GtkWidget *widget)
{
while (widget)
{
if (GTK_IS_EVENT_BOX (widget))
{
gtk_widget_queue_draw (widget);
break;
}
widget = gtk_widget_get_parent (widget);
}
}
static void
combo_changed_cb (GtkWidget *combo,
gpointer data)
@@ -33,33 +48,123 @@ combo_changed_cb (GtkWidget *combo,
gint active;
active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
gtk_label_set_ellipsize (GTK_LABEL (label), (PangoEllipsizeMode)active);
redraw_event_box (label);
}
static void
scale_changed_cb (GtkRange *range,
gpointer data)
{
double angle = gtk_range_get_value (range);
GtkWidget *label = GTK_WIDGET (data);
gtk_label_set_angle (GTK_LABEL (label), angle);
redraw_event_box (label);
}
static gboolean
ebox_expose_event_cb (GtkWidget *widget,
GdkEventExpose *event,
gpointer data)
{
PangoLayout *layout;
const double dashes[] = { 6, 18 };
GtkRequisition minimum_size, natural_size;
GtkWidget *label = data;
cairo_t *cr;
gint x, y;
cr = gdk_cairo_create (widget->window);
cairo_translate (cr, -0.5, -0.5);
cairo_set_line_width (cr, 1);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_rectangle (cr, 0, 0, widget->allocation.width, widget->allocation.height);
cairo_fill (cr);
gtk_widget_translate_coordinates (label, widget, 0, 0, &x, &y);
layout = gtk_widget_create_pango_layout (widget, "");
gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (label), FALSE,
&minimum_size, &natural_size);
pango_layout_set_markup (layout,
"<span color='#c33'>\342\227\217 requisition</span>\n"
"<span color='#3c3'>\342\227\217 natural size</span>\n"
"<span color='#33c'>\342\227\217 allocation</span>", -1);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
cairo_rectangle (cr,
x + 0.5 * (label->allocation.width - minimum_size.width),
y + 0.5 * (label->allocation.height - minimum_size.height),
minimum_size.width, minimum_size.height);
cairo_set_source_rgb (cr, 0.8, 0.2, 0.2);
cairo_set_dash (cr, NULL, 0, 0);
cairo_stroke (cr);
cairo_rectangle (cr, x, y, label->allocation.width, label->allocation.height);
cairo_set_source_rgb (cr, 0.2, 0.2, 0.8);
cairo_set_dash (cr, dashes, 2, 0.5);
cairo_stroke (cr);
cairo_rectangle (cr,
x + 0.5 * (label->allocation.width - natural_size.width),
y + 0.5 * (label->allocation.height - natural_size.height),
natural_size.width, natural_size.height);
cairo_set_source_rgb (cr, 0.2, 0.8, 0.2);
cairo_set_dash (cr, dashes, 2, 12.5);
cairo_stroke (cr);
cairo_destroy (cr);
return FALSE;
}
int
main (int argc, char *argv[])
{
GtkWidget *window, *vbox, *hbox, *label, *combo;
GtkWidget *window, *vbox, *label;
GtkWidget *combo, *scale, *align, *ebox;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
vbox = gtk_vbox_new (0, FALSE);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (window), vbox);
hbox = gtk_hbox_new (0, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
combo = gtk_combo_box_new_text ();
scale = gtk_hscale_new_with_range (0, 360, 1);
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "NONE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "START");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "MIDDLE");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "END");
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), label);
ebox = gtk_event_box_new ();
gtk_widget_set_app_paintable (ebox, TRUE);
gtk_container_add (GTK_CONTAINER (ebox), align);
gtk_box_pack_start (GTK_BOX (vbox), combo, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), ebox, TRUE, TRUE, 0);
g_object_set_data (G_OBJECT (label), "combo", combo);
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed_cb), label);
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed_cb), label);
g_signal_connect (ebox, "expose-event", G_CALLBACK (ebox_expose_event_cb), label);
gtk_widget_show_all (window);
+4 -4
View File
@@ -21,7 +21,7 @@
#include <gtk/gtk.h>
static GtkWidget *
create_menu (depth)
create_menu (guint depth)
{
GtkWidget *menu;
GtkWidget *menuitem;
@@ -70,19 +70,19 @@ create_menubar (GtkPackDirection pack_dir,
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_HOME, NULL);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
menu = create_menu (2, TRUE);
menu = create_menu (2);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
menuitem = gtk_menu_item_new_with_label ("foo");
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
menu = create_menu (2, TRUE);
menu = create_menu (2);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
menuitem = gtk_menu_item_new_with_label ("bar");
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
menu = create_menu (2, TRUE);
menu = create_menu (2);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
return menubar;