Compare commits

...

196 Commits

Author SHA1 Message Date
Davyd Madeley
923bf3c625 Port GtkInfoBar to RI 2009-06-16 11:47:58 +08:00
Davyd Madeley
d36604ae41 Update GtkFileChooserDefault for RI 2009-06-16 11:41:50 +08:00
Davyd Madeley
48d73e164e Merge branch 'master' into resolution-independence
Conflicts:
	demos/gtk-demo/appwindow.c
	gtk/gtk.symbols
	gtk/gtkfilechooserdefault.c
	gtk/gtkhbbox.c
	gtk/gtkprintunixdialog.c
	gtk/gtkvbbox.c
2009-06-16 11:20:09 +08:00
Matthias Clasen
09f41f5000 Bump version to 2.17.3 2009-06-15 21:48:53 -04:00
Matthias Clasen
b645bb9e02 2.17.2 2009-06-15 21:46:07 -04:00
Matthias Clasen
350757e78c Update NEWS 2009-06-15 20:46:34 -04:00
Matthias Clasen
6810564f42 Add missing GtkInfoBar functions to the docs 2009-06-15 20:07:37 -04:00
Matthias Clasen
f02dedde6d Don't export a private function 2009-06-15 20:05:49 -04:00
Matthias Clasen
f6890e3b35 Fix docs build 2009-06-15 20:05:24 -04:00
Matthias Clasen
23fa53f1bc Properly export gtk_info_bar_response
Also fix up its docs.
2009-06-15 20:04:48 -04:00
Matthias Clasen
de3cc27706 Cleanup some translation handling
Use g_*gettext functions in gdk-pixbuf instead direct gettext
calls to benefit from the maybe-dont-translate functionality
in GLib. Also, replace a hand-rolled version by g_dpgettext2
in gtkbuilderparser.c. Fixes bug 585791.
2009-06-15 18:25:04 -04:00
Matthias Clasen
362127c33c Fix the docs for gtk_recent_info_get_application_info()
The documentation for the function says that the app_exec string
should be freed, but we return a pointer to the internal string
without duplicating it. Since the app_exec string is valid as long
as the GtkRecentInfo is valid the documentation should be fixed
and the out argument should be constified. Fixes #584832.
2009-06-15 18:25:04 -04:00
Matthias Clasen
b6fc50c855 Add some more font sizes
Make 15 and 17 available in the list. See bug 585371
2009-06-15 18:25:04 -04:00
Matthias Clasen
6abc52a29d Deprecate get_cell_renderers implementations
These have been superseded by gtk_cell_layout_get_cells.
Fixes bug 562335.
2009-06-15 18:25:04 -04:00
Daniel Elstner
21594f5574 Terminate case with break in switch statement
* gtk/gtkstatusicon.c (gtk_status_icon_set_property): Add missing
break statements to unterminated case blocks inside switch.
2009-06-15 22:07:50 +02:00
Matthias Clasen
ed33a20b29 Bug 565317 - Resulting image of GtkCellRendererPixbuf depends on order of set properties
(gtk_cell_renderer_pixbuf_set_property): add back evil code that makes
sure that the current image is only unset if the new image was created
from the same property or the new property is not NULL.
2009-06-15 21:10:34 +02:00
Federico Mena Quintero
2b3de3dd75 bgo#580560 - Make Backspace work in the file chooser to to to the parent directory
GtkFileChooserDefault actually implements a binding signal for
Backspace, to make it go to the parent directory.  However,
GtkTreeView was eating our Backspace, and thus the file chooser was
not getting a chance to execute its binding signal.

GtkTreeView implements a Backspace binding itself, which it uses to
move to the parent node of the current cursor node.  However, the
binding handler would return TRUE even if there was no parent to the
current node.  Now the binding handler only returns TRUE if it
actually changed the cursor.

Additionally, gtk_tree_view_key_press() sees if no bindings handled a
key press; in that case, it re-sends the key press to the treeview's
search entry.  However, sending a Backspace to an empty entry makes
the entry beep.  Thus, we add a flag that gets set from GtkTreeView's
Backspace binding handler, to tell gtk_tree_view_key_press() when it
should *not* re-emit the key press on the search entry.  Sort of,
"yeah, I didn't handle this key press, but I don't want you to send it
to the search entry, either!".

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-15 12:37:07 -05:00
Matthias Clasen
bc42bca9dd Add entry about xdg user dir icons 2009-06-15 01:50:27 -04:00
Davyd Madeley
0532056349 Merge branch 'button-box-orientable-584598' 2009-06-15 09:48:14 +08:00
Davyd Madeley
2901695dfd Support GtkOrientable for GtkButtonBox
Edit: Update for coding style
2009-06-15 09:14:17 +08:00
Davyd Madeley
1fe7308dd1 Testcase for GtkOrientable 2009-06-15 09:14:00 +08:00
Jorge Gonzalez
b9a27c2636 Updated Spanish translation 2009-06-13 13:21:01 +02:00
Benjamin Gramlich
1d4cba6876 bgo#484922 - Remember the sort column and order in the file chooser
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 17:31:28 -05:00
Benjamin Gramlich
69a0611391 Add load/save functions for the sort column order in GtkFileChooserSettings
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 16:40:25 -05:00
Federico Mena Quintero
bb362f754a Add an --initial-folder option to testfilechooser.c
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 14:09:47 -05:00
Federico Mena Quintero
c98ebe3165 Add an --initial-filename option to testfilechooser.c
We can use this to test bugs that happen when setting a filename before the
file chooser is shown, as in bgo#161670

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 14:02:37 -05:00
Federico Mena Quintero
2accf2fd21 Fix compiler warnings
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 13:59:29 -05:00
Milan Bouchet-Valat
67632a578b bgo#562579 - Don't show errors when the initial folder does not exist
The previous patch for this bug was about the initial *file* not existing,
but this also handles the initial *folder* not existing
(such as /usr/nonexistent/nonexistent.txt).

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 13:25:26 -05:00
Milan Bouchet-Valat
d87dbd66d6 bgo#171416 - Don't create a folder with the default name 'Type name of new folder'
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 11:45:43 -05:00
Matthias Clasen
3f20ccd710 Add a missing newline
There was a missing newline in one of the g_printerr messages
in updateiconcache.c. String change.
2009-06-12 10:21:42 -04:00
Milan Bouchet-Valat
a27e748586 bgo#355851 - Hide backup files in the file chooser
Backup files are hidden along with dotfiles, just like Nautilus.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-11 19:58:51 -05:00
Milan Bouchet-Valat
de280cc5c8 bgo#486839 - The path bar's area shouldn't change vertical size to avoid the browse widgets jumping
We now use a GtkSizeGroup to control the vertical size of the various widgets
that get put in the path bar's area:  the location bar, the search entry,
the recently-used title label.

This keeps the shortcuts pane and the file list from jumping up and down
when one switches between operation modes (browse/search/recently-used).

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-11 18:50:05 -05:00
Jorge Gonzalez
b521039fc3 Updated Spanish translation 2009-06-11 09:24:31 +02:00
Jorge Gonzalez
97dc802ec3 Updated Spanish translation 2009-06-11 09:24:26 +02:00
Matthias Clasen
cf0ab196fe Add a long description for GtkSettings
Among other things, the description mentions the problem in
bug 585024, that some settings may not be available before the
widget class has been realized.
2009-06-11 01:28:39 -04:00
Manoj Kumar Giri
7b8d2096a2 Added entries for Hindi Translation updated by Rajesh Ranjan 2009-06-10 19:53:08 +05:30
Manoj Kumar Giri
766b97cf5a Updated Hindi Translation on behalf of Rajesh Ranjan 2009-06-10 19:51:40 +05:30
Kjartan Maraas
0135c33e48 Updated Norwegian bokmål translation. 2009-06-10 09:50:37 +02:00
Ivar Smolin
8eed87383d Updating Estonian translation 2009-06-09 23:00:46 +03:00
Christian Persch
a70f5ff12a Fix "srdcir" typo 2009-06-09 18:15:24 +02:00
Runa Bhattacharjee
20bc246960 Updated Bengali India Translations 2009-06-09 10:24:18 +05:30
Matthias Clasen
a01a4df697 Update docs to match actual API
Remove references to gtk_info_bar_set_contents(), and update
the example to use gtk_info_bar_get_content_area().
2009-06-08 10:16:51 -04:00
Manoj Kumar Giri
9ae398f60e Updated Oriya Translation 2009-06-08 19:35:26 +05:30
Marek Kasik
a12a583c99 Add ability to print selection
Add a new radio button "Selection" to the print dialog. Its presence
depends on calling of functions gtk_print_operation_set_support_selection()
and gtk_print_dialog_unix_set_support_selection().
Sensitivity of the radio depends on calling of
functions gtk_print_operation_set_has_selection() and
gtk_print_dialog_unix_set_has_selection().
There are new properties GtkPrintUnixDialog::support-selection,
GtkPrintUnixDialog::has-selection, GtkPrintOperation::support-selection
and GtkPrintOperation::has-selection. Corresponding getters are
gtk_print_dialog_unix_get_support_selection(),
gtk_print_dialog_unix_get_has_selection(),
gtk_print_operation_get_support_selection() and
gtk_print_operation_get_has_selection().
Application has to set number of pages to which the selection will be formated
in GtkPrintOperation::begin-print's callback by the
gtk_print_operation_set_n_pages() function (bug #344519).
There is also new property GtkPrintUnixDialog::manual-capabilities controled by
gtk_print_unix_dialog_set_manual_capabilities() and
gtk_print_unix_dialog_get_manual_capabilities().
2009-06-08 15:37:32 +02:00
Mattias Põldaru
9a4122a130 Updating Estonian translation 2009-06-08 11:52:27 +03:00
Matthias Clasen
c981ddf92f Don't grab the keyboard during DND
Instead use passive grabs for the few keys we care about.
With a corresponding metacity change, this will allow workspace
switching and focus cycling during DND, which is very useful.
Fixes bug 390312.
2009-06-07 22:19:52 -04:00
Björn Lindqvist
beb617c206 Halt configure if selected cairo backend is missing, fixes Bug 565998 2009-06-06 21:46:41 +02:00
Matthias Clasen
c7a0a513f5 Remove nonworking conditionals
Don't pretend that we care about XShape-less builds anymore.
See bug 584637.
2009-06-05 23:06:12 -04:00
Matthias Clasen
4b16b875db Avoid warnings in atom conversion
Cave in and revert to silently converting GDK_NONE to None.
Fixes bug 580511.
2009-06-05 22:36:48 -04:00
Matthias Clasen
dccfd423ca Don't unselect when resizing
This was causing problems in Epiphany. Fixes bug 584805.
2009-06-05 20:11:44 -04:00
Matthias Clasen
8da1c40d72 Update NEWS for GtkInfoBar 2009-06-05 18:00:26 -04:00
Matthias Clasen
a85fac7145 Add a message area widget
It is called GtkInfoBar. See bug 555344.
2009-06-05 18:00:26 -04:00
Denis Chertykov
4d7bbd058e bgo#327152 - Ellipsize long directory names in GtkPathBar, and better layout for the pathbar
Ellipsize labels in the Save folder's combo so they don't grow too wide.

Ellipsize labels in normal directory buttons in the pathbar, and make
their requisition's width reasonably small.  Use a tooltip for buttons
that got ellipsized.

Instead of placing the down-slider directly beside the last button in
the pathbar, use the remaining space in the pathbar for the last
button.  Use a different method to find the first visible button.
Walk down from the end, adding buttons until we use all free space.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-05 14:13:03 -05:00
Og Maciel
5bf51be576 Updated Brazilian Portuguese translaiton. Fixes b.g.o. #584922 2009-06-05 12:16:57 -04:00
Brian Cameron
3302114358 Improve Solaris Xinerama configure detection
The latest releases of Solaris now ship with the X.org Xserver, so it is
better to use the Xfree Xinerama interfaces if available.  This commit fixes
the configure script so that it first tries to use the Xfree interfaces and
only falls back to the Solaris-specific interfaces if they are not available.
This way, older releases of Solaris which do not use X.org also will work.
(Bug 580079)
2009-06-05 00:46:25 -05:00
Marek Kasik
961ab2e5c1 Print in correct order when printing 4 pages per sheet to landscape
Rotates page layout according to selected paper orientation
when printing through CUPS backend (#420335).
2009-06-04 18:49:29 +02:00
Davyd Madeley
b1277f32de Remove commas off final entries in enums for gtksize.h
It breaks some compilers
2009-06-02 21:57:39 +08:00
Praveen Arimbrathodiyil
4bcf3e59d5 important transltion fixes to undo, redo and about 2009-06-01 23:38:22 -07:00
Matthias Clasen
597a24edf6 Improve GtkMenuPositionFunc docs
Add a note about gtk_menu_set_monitor().
2009-05-30 23:26:37 -04:00
Ask H. Larsen
d2cd949ca1 Updated Danish translation 2009-05-30 22:16:31 +02:00
Matthias Clasen
64b8f4e039 Avoid assertions due to invalid page sequence
It is much nicer to handle this gracefully in compute_last_button_state.
Fixes bug 584125.
2009-05-30 02:14:03 -04:00
Cody Russell
47db0f0020 Improve GtkEntry handling of invalid stock ids
Instead of silently showing no icon, show a "missing image"
icon, like GtkImage does in the same situation. Fixes bug 579590.
2009-05-30 00:10:14 -04:00
Caolan McNamara
5964109ef3 Plug a memory leak in Xrandr code 2009-05-30 00:05:35 -04:00
Matthias Clasen
ac0ed81b6f Bump version to 2.17.2 2009-05-29 19:46:56 -04:00
Matthias Clasen
44690f17c8 2.17.1 2009-05-29 19:29:49 -04:00
Matthias Clasen
d2ac65c8ba Fix a typo in the ::update-custom-widget docs 2009-05-29 18:47:23 -04:00
Matthias Clasen
7b49379b55 Fix a typo in the docs 2009-05-29 18:40:10 -04:00
Matthias Clasen
2a87eb83d1 Update for 2.17.1 2009-05-29 17:26:32 -04:00
Eitan Isaacson
8166a0e1af Fix GtkAssistant's accessible children. Fixes bug #575319. 2009-05-29 19:25:43 +02:00
Lebedev Roman
d1f921b5bc Updated Russian translation 2009-05-26 02:49:34 +04:00
Seán de Búrca
73a9c40b51 Updated Irish translation 2009-05-25 19:50:56 +01:00
Lin Ma
d0f887ddb1 Fix GtkTooltip destroy the custom widget
Fixed 576091, Custom_widget does not get destroyed when the tooltip
goes away. Add a release note for this fix.
2009-05-25 10:01:04 +08:00
Seán de Búrca
48c8818fa2 Updated Irish translation 2009-05-25 00:33:42 +01:00
Matthias Clasen
96912b564f Avoid another case of treating None as an atom 2009-05-24 00:30:58 -04:00
Matthias Clasen
478cc88f8d Fix a formatting error in the docs
Need to replace % by %amp; in examples. This was noticed in
bug 583522.
2009-05-24 00:17:49 -04:00
Claude Paroz
1199b3f741 Updated French translation 2009-05-23 19:03:31 +02:00
Carlos Garcia Campos
7437a79b85 Fix a crash when printing with defer drawing enabled
Fixes bgo#582963
2009-05-23 11:12:56 +02:00
Matthias Clasen
e18a4fa047 Improve gtk_combo_box_get_active_text() docs
Make it more explicit that the return value needs to be freed.
Fixes bug 583050.
2009-05-23 01:20:39 -04:00
James Andrewartha
bd84d95e63 add missing include $(top_srcdir)/git.mk to modules/papi/Makefile.am
Signed-off-by: Davyd Madeley <davyd@madeley.id.au>
2009-05-21 14:45:25 +08:00
Stefan Kost
e07d8adcca docs: document the GtkUpdateType enum.
Add documentation based on the description from gtk_range_set_update_policy()
2009-05-20 14:27:36 +03:00
mark@ecs.vuw.ac.nz
1eff9aba24 Signalize that CUPS connection is available when EISCONN occurs
Add test for EISCONN error when testing whether a connection to CUPS server
is available (#576678 - patch by mark@ecs.vuw.ac.nz).

Signed-off-by: Marek Kasik <mkasik@redhat.com>
2009-05-19 16:08:21 +02:00
Davyd Madeley
3969d1b969 Add papi to DIST_SUBDIRS 2009-05-19 16:31:52 +08:00
Davyd Madeley
bcf754ea1d Merge commit 'origin/master' 2009-05-19 15:32:10 +08:00
Davyd Madeley
a746df7d37 Fix broken SGML in gtk reference.
Introduced in commit 9dbb30482b
2009-05-19 15:29:53 +08:00
Alexander Shopov
7fe8fb35b5 Updated Bulgarian translation 2009-05-19 07:54:51 +03:00
Carlos Garcia Campos
9b7fa7a904 Use nr_of_pages_to_print instead of nr_of_pages when updating printing progress
Fixes bgo#582950.
2009-05-18 09:43:13 +02:00
Matthias Clasen
122e0b40ba Improve GtkNotbook behaviour with too little space
This fixes bug 582488. The patch was provided by Morten Welinder.
2009-05-17 23:47:30 -04:00
Davyd Madeley
ffd12347be Merge commit 'origin/master' into resolution-independence 2009-05-18 10:55:52 +08:00
Davyd Madeley
f64ef8ea51 Fix broken compile: s/gtk_selection_atom/gtk_selection_atoms
Introduced in 94b63ec9b7
2009-05-18 10:48:21 +08:00
Davyd Madeley
fc2b45cb50 Fix broken compile: s/gtk_selection_atom/gtk_selection_atoms
Introduced in 94b63ec9b7
2009-05-18 10:46:42 +08:00
Davyd Madeley
79c9a7ec5e Merge commit 'origin/master' into resolution-independence 2009-05-18 10:46:31 +08:00
Matthias Clasen
94b63ec9b7 Avoid a warning when persisting clipboards
Correctly handle conversion to SAVE_TARGETS as a side-effect target
with no side-effect, by returning a zero-sized property of type NULL.
See section 2.6.3 of the ICCCM.
2009-05-17 20:41:50 -04:00
Matthias Clasen
375d19aa92 Avoid warnings when handling SelectionNotify
The property field in SelectionNotify events may be None instead
of an atom.
2009-05-17 20:41:49 -04:00
Ask H. Larsen
5133d934f6 Updated Danish translation 2009-05-18 01:54:21 +02:00
Jorge Gonzalez
7ca16dad51 Updated Spanish translation 2009-05-17 21:46:31 +02:00
Martin Nordholts
f253b6927c Avoid memory corruption on complicated confirm-overwrite logic
Dup the file chooser entry string because the string may be modified
depending on what clients do in the confirm-overwrite signal and this
corrupts the pointer.
2009-05-15 22:20:30 +02:00
Marek Kasik
91190ce281 Add ability to print in number-up mode for file backend and lpr backend
GtkPrintOperation is now able to render multiple pages per sheet by its
own. The most important changes are in these functions:
  * increment_page_sequence
  * prepare_data
  * common_render_page
  * print_pages_idle
Patch also changes set of choices for 2 pages per sheet mode when
landscape orientation is used to "Top to bottom" and "Bottom to top".
2009-05-13 18:28:42 +02:00
Federico Mena Quintero
26c10075f9 Merge fix for bgo#315462 - Make GtkLabel deal with too-small height allocations gracefully
Merge branch 'gtk-2-16'
2009-05-12 19:13:33 -05:00
Federico Mena Quintero
4134c346f9 Merge fix for bgo#463773 - Handle a NULL display in gtk_clipboard_get_for_display() so Flash won't hang 2009-05-12 13:50:45 -05:00
gheet
c57fc80465 Adding PAPI printbackend
Adding a new print backend module using libpapi detals see GNOME#382676.
(gheet)
2009-05-11 18:33:08 +01:00
Matthias Clasen
0fd185fa6d Make gtk-update-icon-cache not fall over leftover temp files
When called with the --force option, try to remove the .icon-theme.cache
file before giving up. This fixes rh#500163.
2009-05-11 12:02:06 -04:00
Tobias Mueller
dc0dde995d Removed deprecated call to gtk_scale_button_get_orientation
and use gtk_orientable_set_orientation instead.
Fixes bug 581878.
2009-05-11 13:52:16 +02:00
Tobias Mueller
ac9ea01ec9 Replaced deprecated call to gtk_action_connect_proxy with call to gtk_activatable_set_related_action
Fixes bug 581876.
2009-05-11 13:52:16 +02:00
Matthias Clasen
ae94c371d1 Add a separate keybinding signal for activating links
Keeping the keybinding signal and the regular signal separate is
cleaner and allows us to pass the uri as a parameter to the
activate-link signal.
2009-05-11 02:44:12 -04:00
Matthias Clasen
2f60e18c70 Add a migration chapter for label links 2009-05-11 02:08:32 -04:00
Matthias Clasen
563e8e8e1d Mention url label support in NEWS 2009-05-11 01:31:14 -04:00
Matthias Clasen
9dbb30482b Add link support to GtkLabel
This patch is based on SexyUrlLabel, but with significantly enhanced
functionality: keynav, tooltips, context menu, theming.
2009-05-11 01:23:13 -04:00
Matthias Clasen
141ddd99f3 Avoid unintended side-effect in gdk_window_get_events
Calling gdk_window_get_events() had the side-effect of letting
property change notification through to the application, which
was not intended. Now we keep StructureNotify and PropertyNotify
filtered out when they were before. Reported in bug 582003.
2009-05-10 02:08:41 -04:00
Matthias Clasen
4fc49fd8db Don't enforce property change events on the root window
The code in gdk_x11_window_set_events is only meant to enforce
property change events on child windows. Pointed out in bug 531490.
2009-05-10 01:54:43 -04:00
Marios Zindilis
038dfa53d0 Updated Greek translation 2009-05-09 14:15:33 +01:00
Davyd Madeley
b89a059967 RI: gtk-demo: calculate monitor DPI from reported dimensions
Add a button to set this as the DPI for the demo.
2009-05-07 12:38:36 +08:00
Davyd Madeley
fc72a20782 RI: gtk-demo: actually report monitor height rather than width 2009-05-07 12:11:17 +08:00
Davyd Madeley
6748d421b6 Add missing </SECTION> from RI rebase 2009-05-07 11:45:22 +08:00
Davyd Madeley
87a46136b3 Add new symbols from GtkStyle to docs
Also add gtksize template
2009-05-07 11:42:19 +08:00
Christian Kirbach
f2d4669ff8 Updated German translation. 2009-05-06 13:11:12 +02:00
Davyd Madeley
47c00c7ad4 RI: move GtkParamSpec[U]Size definitions into header
Otherwise GTK_PARAM_SPEC_[U]SIZE macros do not work. Though these macros are of
dubious use, since the all the interesting items are contained within the parent
class.
2009-05-06 15:35:53 +08:00
Matthias Clasen
6fc6b8b4e8 Add diagnostics for XID collisions
This should help with diagnosing crashes caused by over-eager XID
reuse in Xlib, see bug 581526.
2009-05-05 19:29:05 -04:00
Davyd Madeley
ce4382e444 [RI] Port CUPS auth backend in GtkPrintBackend to RI
Ports changes introduced by commit 2c5ae21cdc
to support resolution independence.
2009-05-05 14:29:44 +08:00
Davyd Madeley
74f03f97b1 Merge commit 'origin/master' into resolution-independence
Merge latest work from GTK+ master. GtkAssistant and GtkScale required manual
merging.
2009-05-05 12:16:26 +08:00
Behdad Esfahbod
a398c840be Add git.mk to generate .gitignore files
Add four new doc templates that were not in repository.
2009-05-04 14:29:21 -04:00
Matthias Clasen
e5702523ff Bump version to 2.17.1 2009-05-04 02:09:12 -04:00
Matthias Clasen
cc4cf97d62 GTK+ 2.17.0 2009-05-04 01:54:06 -04:00
Davyd Madeley
c0c10b993a [RI] add testri test
Currently tests RI support in GtkBuilder using 3 GtkImages
2009-05-04 13:39:39 +08:00
Matthias Clasen
ce517a4152 Bump version to 2.17.0 2009-05-04 00:43:49 -04:00
Matthias Clasen
86e5df91c1 Update NEWS for 2.17.0 2009-05-04 00:43:19 -04:00
Matthias Clasen
44c6b24fc7 Avoid double browser windows from the about dialog. 2009-05-03 23:49:24 -04:00
Tobias Mueller
4ea26a6864 Remove a deprecated call to gtk_status_icon_set_tooltip
This fixes bug 574386.
2009-05-03 23:44:01 -04:00
Matthias Clasen
4f4643207e Point to better place for git documentation 2009-05-03 23:44:01 -04:00
Matthias Clasen
b125eeae9d Make GtkAssistant keep its padding when built with GtkBuilder 2009-05-03 23:44:01 -04:00
Li Yuan
5d617ee80b Emit property-changed:accessible-name for gailcombobox
Fix bug #579741. Emit property-changed:accessible-name when selection
of combobox changed.
2009-05-04 11:38:44 +08:00
Matthias Clasen
6eb95098b1 Don't leak RequiresInfo when parsing GtkBuilder files
This fixes bug 579366.
2009-05-03 23:32:33 -04:00
Itay Perl
850965101f Fix handling of child widgets in the presence of bidi text
GtkTextLayout incorrectly assumed that pango iterates in logical
order. Fixes bug 580814.
2009-05-03 23:26:11 -04:00
Matthias Clasen
7f6a534d0f Handle translated combobox models better
Make gtk-builder-convert keep translated combobox models translated.
Fixes bug 553385.
2009-05-03 22:50:27 -04:00
Matthias Clasen
3dc395ad4e Make GtkHandleBox work on multiple displays 2009-05-03 22:27:12 -04:00
Matthias Clasen
6aa6338578 Fix handling of GDK_NONE
Don't intern "NONE" and warn if GDK_NONE is converted to an
X atom. Problem pointed out in bug 580511.
2009-05-03 21:38:54 -04:00
Matthias Clasen
e4bbfd9a4b Fix whitespace 2009-05-03 19:39:22 -04:00
Matthias Clasen
e6373738fc Forward-port a GtkAdjustment compatibility fix
We reverted GtkAdjustment to its traditional behaviour wrt. to
clamping in 2.14.3, but the fix was lost between 2.14 and 2.16.
2009-05-03 13:04:06 -04:00
Petr Kovar
46bc2ec740 Updated Czech translation 2009-05-03 18:52:07 +02:00
Matthias Clasen
dc8f36e254 Support scale marks in builder markup 2009-05-03 12:15:28 -04:00
Matthias Clasen
6e51533ec3 Fix a shadowed variable and a few other compiler warnings 2009-05-03 12:15:28 -04:00
Matthias Clasen
bc74cdb8ae Make an internal function static 2009-05-03 12:15:28 -04:00
Jorge Gonzalez
06ff893683 Updated Spanish translation 2009-05-02 12:47:29 +02:00
Mattias Põldaru
60b62e6c88 Updating Estonian translation 2009-05-02 11:10:55 +03:00
Jorge Gonzalez
c92f56531c Updated Spanish translation 2009-05-01 19:32:09 +02:00
Davyd Madeley
127e8d8a1b [RI] Update gtk-doc for Since: and cross referencing
All "Since: 2.14" have been replaced by "Since: RIMERGE". When this is finally
merged, these should be replaced with the appropriate GTK+ version and then
that patch should be squashed into this one.

Also clarified some of the entires in the doc, for pixels vs units. Added
cross references to the unit-aware versions of functions.
2009-05-01 12:42:49 +08:00
Davyd Madeley
9816a939b7 [RI] GtkTextView: update functions to match prototypes
Some setter functions were taking gint as their parameter rather than
GtkSize.
2009-05-01 11:34:11 +08:00
Davyd Madeley
1b5b4812b9 Change GtkMenu from using gtk_style_get() to gtk_style_get_units().
gtk_style_get() returns values in pixels but with no reference to the monitor
that the widget is being displayed on. Thus it shouldn't be used when accessing
sizes.
2009-05-01 10:53:00 +08:00
Davyd Madeley
b20c7555fe Add support for RI to gtk_style_get() and friends
Make gtk_style_get(), gtk_style_get_valist() and gtk_style_get_style_property()
return GtkSizes in pixels. These functions don't know what monitor the widget
is on, so they should probably be marked to produce multihead warnings.

Add gtk_style_get_unit(), gtk_style_get_unit_valist() and
gtk_style_get_style_property_unit() that preserve units.
2009-05-01 10:47:34 +08:00
Matthias Clasen
8076c8fbbf Test the new style property 2009-04-30 14:41:49 -04:00
Matthias Clasen
8f1a578ade Add a GtkEntry::invisible-char style property
Allow themes to set a preferred invisible character. GTK+ will
still fall back to other candidates if the character is not available
in the font.
2009-04-30 14:40:22 -04:00
Manoj Kumar Giri
5457956c79 Updated Oriya Translation. 2009-04-30 13:59:01 +05:30
Brian Cameron
33f4ead506 Minor fix for GTK+ mediaLib code.
After doing some performance analysis, it was found that the GTK+ mediaLib code
triggers unnecessary lazy loading of dependent libraries.  The current code
uses RTLD_DEFAULT, RTLD_PROBE, RTLD_NEXT, and RTLD_SELF.  However, RTLD_PROBE
is all that is necessary, and avoids triggering the lazy loading.  So this
commit fixes the code to just use RTLD_PROBE.  (Bug 580678)
2009-04-29 18:52:32 -05:00
Mattias Põldaru
dae20e2561 Updating Estonian translation 2009-04-29 07:50:18 +03:00
Tomasz Mon
812e129cd6 fix build for gtkdial example
Replace use of deprecated GTK_SIGNAL_FUNC with G_CALLBACK,
and add depth to blankstyle.  Fixes Bug #578634.
2009-04-28 14:34:44 -04:00
David Zeuthen
33ff8e3488 port gtk-demo to resolution independence 2009-04-28 15:21:52 +08:00
David Zeuthen
b2a5e870df port all remaining widgets to RI
This mostly consists of replacing hardcoded pixel values with usage of
the GTK_SIZE_EM_ONE_TWELFTH macro.

min/max for GtkDialog

min/max for GtkMessageDialog

fixed gtkdialog.c

fixed gtkmessagedialog.c

fix compile
2009-04-28 15:21:51 +08:00
David Zeuthen
42efae2d47 port GtkTreeView, GtkIconView, GtkComboBox and all GtkCellRenderer's to RI
min/max for GtkCellRenderer

min/max for GtkCellRendererToggle

min/max for GtkComboBox

min/max for GtkIconView

min/max for GtkTreeView

min/max for GtkTreeViewColumn

fixed gtkcellrenderer.c

fixed gtkcellrenderertoggle.c

fixed gtkcombobox.c

fixed gtkiconview.c

fixed gtktreeview.c

fixed gtktreeviewcolumn.c
2009-04-28 15:21:51 +08:00
David Zeuthen
6919f989f7 port GtkHandleBox and GtkScrolledWindow to RI 2009-04-28 15:21:51 +08:00
David Zeuthen
82e9821dd8 port GtkTextView to RI
min/max for GtkTextView

fixed gtktextview.c
2009-04-28 15:21:51 +08:00
David Zeuthen
1113402c7b port GtkHsv, GtkAssistant, GtkNotebook and GtkPaned to RI
min/max for GtkAssistant

min/max for GtkNotebook

min/max for GtkPaned

fixed gtkpaned.c

fixed gtknotebook.c

fixed gtkassistant.c
2009-04-28 15:21:50 +08:00
David Zeuthen
2d2a6d2bf4 port GtkTable to RI
min/max for GtkTable

fixed gtktable.c
2009-04-28 15:21:50 +08:00
David Zeuthen
6fb824a0b3 port GtkArrow, GtkEntry, GtkFrame, GtkStatus and GtkImage to RI
min/max for GtkImage

fixed gtkimage.c

Rebase: fix GtkArrow
2009-04-28 15:21:50 +08:00
David Zeuthen
26ae475590 port toolbar related items to RI
min/max for GtkCheckButton

min/max for GtkToolbar

min/max for GtkToolButton

fixed gtkcheckbutton.c

fixed gtktoolbar.c

fixed gtktoolbutton.c
2009-04-28 15:21:50 +08:00
David Zeuthen
3b35e523fd port menu stuff to RI
min/max for GtkCheckMenuItem

min/max for GtkMenu

min/max for GtkMenuBar

min/max for GtkMenuItem

fixed gtkcheckmenuitem.c

fixed gtkmenubar.c

fixed gtkmenu.c

fixed gtkmenuitem.c
2009-04-28 15:21:50 +08:00
David Zeuthen
6c6f1b3dcd port GtkAlignment, GtkButton and GtkLabel to RI
min/max for GtkAlignment

min/max for GtkButton

fixed gtkbutton.c

fixed gtkalignment.c
2009-04-28 15:21:49 +08:00
David Zeuthen
30c5e6fe7a port GtkExpander, GtkFixed, GtkProgressBar and GtkGamma to RI
min/max for GtkExpander

min/max for GtkFixed

min/max for GtkProgressBar

fixed gtkprogressbar.c

fixed gtkfixed.c

fixed gtkexpander.c
2009-04-28 15:21:49 +08:00
David Zeuthen
fda93a2977 port GtkMisc, GtkRange, GtkScale and GtkScaleButton to RI
min/max for GtkMisc

min/max for GtkRange

min/max for GtkScale

fixed gtkscale.c

fixed gtkrange.c

fixed gtkmisc.c
2009-04-28 15:21:49 +08:00
David Zeuthen
151e5c58a8 add "Resolution Independence" item to gtk-demo and turn on RI
Now that most core widgets support RI, add a demo so it's easy to test
RI.
2009-04-28 15:21:49 +08:00
David Zeuthen
32baa433b7 port GtkBuilder, GtkIconFactory, the rc parser, GtkSizeGroup, GtkStyle to RI 2009-04-28 15:21:49 +08:00
David Zeuthen
b00d7d6585 port GtkBox and known subclasses to RI
min/max for GtkButtonBox

use min/max for GtkBox

fixed gtkbbox.c

fixed gtkbox.c

Rebase: fix GtkBox
2009-04-28 15:21:49 +08:00
David Zeuthen
954890278f make GtkContainer use RI
Use min/max for GtkContainer

fixed gtkcontainer.c
2009-04-28 15:21:49 +08:00
David Zeuthen
c07c77a489 add core resolution independence code
gtksize.[ch]:
 - core resolution independence code

gtkwidget.[ch]:
 - use monitor number to get the Pango context
 - new ::unit-changed signal
 - port some style properties to GtkSize
 - make style getters automatically convert to units
 - provide unit preserving getters (object + style properties)

gtkwindow.[ch]:
 - port some object properties to GtkSize
 - propagate ::unit-changed from GtkSettings to all widgets
 - try and guess the monitor and use it's units in gtk_window_show()

gtksettings.c:
 - provide a new signal ::unit-changed. The code in gtksize.c will
   emit this signal; GtkSettings is just a convenient placeholder
   for the signal.

add minimum and maximum to param spec constructors

use min/max for GtkWidget

use min/max for GtkWindow

fixed gtkwidget.c

fixed gtkwindow.c

fixed gtksize.c
2009-04-28 15:21:48 +08:00
David Zeuthen
85641efa08 make GtkWindow track the monitor number 2009-04-28 15:21:48 +08:00
David Zeuthen
c43a02ba55 make resolution and font options per monitor
For now, only add API and ignore the monitor number. An actual
implementation will depend on defining new X Settings.
2009-04-28 15:21:48 +08:00
Maxim V. Dziumanenko
09607127d4 Update Ukrainian translation 2009-04-26 16:42:14 +03:00
Brian Cameron
fa00f3e50a Fix casting problem in gmodule code.
This fixes bug 579884.  Previously the return value of g_slist_find_custom was
being recasted as type (GtkModuleInfo *).  This patch sets the return value
to a temporary variable of type (GSList *), and sets info to temp->data.  This
avoids a crashing problem.
2009-04-24 17:20:03 -05:00
Jorge Gonzalez
459b6a2e72 Updated Spanish translation 2009-04-24 20:36:13 +02:00
Mike Gorse
3f00129e17 Fix Selectable state for gailButton
Only remove Selectable state from a GailButton if it is not Focusable (ie,
a TreeView column header); do not add Selectable for all focusable
buttons.  Fixes a bug introduced with the fix to 433324.
2009-04-23 14:36:51 +01:00
Manoj Kumar Giri
5b4855d40e Updated Oriya Translations 2009-04-23 17:58:12 +05:30
Manoj Kumar Giri
1632d64a51 Updated Oriya Translation 2009-04-23 17:58:12 +05:30
Vladimir Melo
aa6045b137 Updated Brazilian Portuguese translation. 2009-04-22 20:52:02 -03:00
Daniel Nylander
24b8f2dfec Updated sv translation 2009-04-21 14:52:43 +02:00
Marek Kasik
2c5ae21cdc Adds authentication support of CUPS backend
Adds authentication support of CUPS backend against CUPS server.
Print dialog is now capable to ask user for password and pass it
to the CUPS server. It is also possible to authenticate user
through Kerberos (GSS-API) (#384940).
2009-04-21 14:24:32 +02:00
Marek Kasik
6e121ee85e Allow the custom widget to actualize on a printer change
Passes print settings and page setup to the custom widget
through a new "update-custom-widget" signal (#564854).
2009-04-21 13:06:49 +02:00
Christian Persch
4059557491 Add default URL and Email hooks to GtkAboutDialog
Adds default URL and Email hooks which use gtk_show_uri(). It is still
possible to provide one's own hooks, and one can disable the default
hooks by setting NULL hooks. Bug #577793.
2009-04-20 14:55:13 +02:00
Christian Persch
45d076fcc2 Display invalid accelerators as "Invalid" in GTK mode.
When in GTK_CELL_RENDERER_ACCEL_MODE_GTK, display accelerator key
combinations that don't pass gtk_accelerator_valid() as "Invalid".
Bug #572799.
2009-04-20 14:54:59 +02:00
Christian Persch
0e99a5849e Allow unsetting the icon title set with gdk_window_set_icon_name
Change gdk_window_set_icon_name to allow using NULL to unset a
previously set icon title, so that the icon title tracks the normal
title again. Bug #535557.
2009-04-20 14:53:51 +02:00
Khaled Hosny
dcc506aa6e Updated Arabic translation 2009-04-19 19:58:00 +02:00
Claudio Saavedra
a982cea9ce Deselect all other selected items when clicking a selected one
When clicking on an GtkIconView item inside a selection, deselect
all other selected items. (#506862)
2009-04-18 18:47:07 +03:00
Luca Ferretti
cf68d7f1d5 Updated Italian translation
Completed Italian translation

Signed-off-by: Milo Casagrande <milo@ubuntu.com>
2009-04-18 14:35:07 +02:00
Claudio Saavedra
3c9e7c73bf Allow GdkPixbufSimpleAnim to loop
Add a GdkPixbufSimpleAnim:loop boolean property and its accessors.
Based on a patch by Tim Evans. (#561139)
2009-04-18 15:16:22 +03:00
David Planella
09602ccff7 Updated Catalan translation 2009-04-18 11:37:32 +02:00
Deng Xiyue
5d1a16b74e Updated zh_CN translation 2009-04-18 07:41:45 +02:00
Matthias Clasen
cedc4415b4 Add a GtkBuildable implementation to GtkAssistant
Expose the action area as internal child, and support child
properties.
2009-04-18 01:23:20 -04:00
Runa Bhattacharjee
24fde41c85 Committing the Pashto Translations as per request made by Zabeeh Khan on the gnome-i18n list 2009-04-17 11:01:49 +05:30
Gabor Kelemen
7ecf03e84a Hungarian translation updated 2009-04-16 11:50:00 +02:00
489 changed files with 91492 additions and 64092 deletions

View File

@@ -118,6 +118,26 @@ EXTRA_DIST += \
examples/spinbutton/spinbutton.c \
examples/spinbutton/Makefile \
examples/find-examples.sh
MAINTAINERCLEANFILES = \
$(srcdir)/INSTALL \
$(srcdir)/README \
$(srcdir)/aclocal.m4 \
$(srcdir)/autoscan.log \
$(srcdir)/compile \
$(srcdir)/config.guess \
$(srcdir)/config.h.in \
$(srcdir)/config.sub \
$(srcdir)/configure.scan \
$(srcdir)/depcomp \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/omf.make \
$(srcdir)/xmldocs.make \
$(srcdir)/gtk-doc.make \
$(srcdir)/ChangeLog \
`find "$(srcdir)" -type f -name Makefile.in -print`
GDKTARGET=@gdktarget@
@@ -156,7 +176,7 @@ DISTCLEANFILES = \
config.lt
distclean-local:
if test $(srdcir) = .; then :; else \
if test "$(srcdir)" = "."; then :; else \
rm -f ChangeLog; \
fi
@@ -223,3 +243,15 @@ snapshot:
$(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"`
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-rebuilds
GITIGNOREFILES = \
po-properties/Makefile.in.in \
po-properties/Makefile.in \
po-properties/Makefile \
po-properties/*.gmo \
po-properties/*.mo \
po-properties/POTFILES \
po-properties/stamp-it \
po-properties/.intltool-merge-cache
-include $(top_srcdir)/git.mk

171
NEWS
View File

@@ -1,3 +1,174 @@
Overview of Changes from GTK+ 2.17.1 to 2.17.2
==============================================
* GtkInfoBar: A new widget to show a transient 'message area'
inside a content pane. The API is similar to GtkDialog and
supports theming for different message types (warnings,
errors, etc)
* GtkFileChooser:
- Improve path bar by ellipsizing long names and preventing
vertical size changes
- Backup files are now hidden by default
- GTK+ remembers the file chooser sorting state now
* GtkButtonBox: Implements the GtkOrientable interface now.
* Printing:
- GTK+ supports printing an application-defined 'selection' now,
in addition to usual page ranges.
* Changes that are relevant for theme authors:
- The new GtkInfoBar widget uses symbolic colors for theming
its background color depending on the message type. By default,
it uses the same background color as tooltips. This can be turned
off with style property.
- The GTK+ file chooser (as well as nautilus and other users of GIO
icon information) can now show different icons for xdg user dirs.
The icon names are folder-documents, folder-download, folder-music,
folder-pictures, folder-publicshare, folder-templates, folder-videos,
with an automatic fallback to the standard folder icon.
* Bugs fixed:
584021 titchy leak
579590 gtk_entry_set_icon_from_stock should warn when invalid st...
584125 GtkAssistant asserts if last page is GTK_ASSISTANT_PAGE_C...
171416 Resume editing if name of new folder is "Type name of new...
420335 Page assignment when printing 4 pages to a sheet
161670 Bad behaviour from gtk_file_chooser_set_filename
327152 Long names in the FileChooserDialog directory buttons sho...
355851 File Dialog shows Backup Files
390312 Gtk grabs keyboard on DND
486839 Filechooser 'Places' items should not move up and down th...
562335 Deprecate gtk_tree_view_column_get_cell_renderers and gtk...
565317 Resulting image of GtkCellRendererPixbuf depends on order...
565998 configure script doesn't check for cairo-xlib.pc
580079 Better configure detection of Xinerama on Solaris
580511 gdk_x11_atom_to_xatom_for_display translates GDK_NONE as ...
580560 Backspace key does not go to the parent directory
584598 GtkButtonBox silently ignores gtk_orientable_set_orientation
584637 Missing conditionals for X11 shape extension in GdkWindow
584805 GtkEntryCompletion selection reset when calling gtk_entry...
584832 Duplicate the exec string returned by gtk_recent_info_get...
585024 some gtksettings properties need extra initialisation
585371 Add additional sizes to the font selector
585791 use g_*gettext instead of *gettext directly
562579 [Patch] Remove error dialog when directory does not exist
344519 custom print ranges
484922 Should remember the sort state of columns
555344 consider adding a message area widget
* Updated translations:
Danish
Brazilian Portuguese
Estonian
Oriya
Bengali India
Norwegian bokmål
Hindi
Spanish
Overview of Changes from GTK+ 2.17.0 to 2.17.1
==============================================
* GtkLabel:
- GtkLabel can show embedded URLs, much like SexyUrlLabel
* Printing:
- GTK+ includes a print backend that works with the PAPI
printing service.
- The file and lpr backends can print multiple pages per sheet.
* Changes that are relevant for theme authors:
- The URL support in GtkLabel uses the link-color / visited-link-color
style properties
* Bugs fixed:
576091 GtkTooltip destroy the custom widget
315462 GtkButton doesn't center its child when the child is too ...
390331 "Pages per sheet" does not work for LPR printing
531490 gdk_window_set_events (0) will _ADD_ events to the root w...
574386 Remove deprecated call to gtk_status_icon_set_tooltip in ...
576678 cups printbackend doesn't list printers on NetBSD
579366 gtkbuilderparser leaks RequiresInfo objects.
579884 casting problem in gmodule
580511 gdk_x11_atom_to_xatom_for_display translates GDK_NONE as ...
581876 Remove deprecated call to gtk_action_connect_proxy in tes...
581878 Remove deprecated call to gtk_scale_button_get_orientatio...
582003 Calling gdk_window_get_events() changes the event mask, b...
582488 GtkNotebook behaves poorly when allocated less than reque...
582950 Use number of pages to print when showing printing progress
582963 Crash when printing from a thread
583050 unclear disposition of function gtk_combo_box_get_active...
583522 Trivial error in GtkBuilder migration documentation
535557 gdk_window_set_icon_name should accept NULL to unset
549859 "file" printer doesn't support n-up
* Updated translations:
Arabic
British English
Catalan
Czech
Danish
Estonian
French
German
Greek
Hungarian
Irish
Italian
Kannada
Portuguese
Russian
Slovenian
Spanish
Ukrainian
Simplified Chinese
Overview of Changes from GTK+ 2.16.x to 2.17.0
==============================================
* GtkBuilder:
- Scale marks can now be specified in builder markup
- GtkAssistant action widgets can be added in builder markup
* Changes that are relevant for theme authors
- GtkEntry now has a ::invisible-char style property that allows
themes to set the preferred invisible character
* Printing:
- GTK+ supports authentication of users against CUPS servers now.
* Bugs fixed:
578634 gtkdial example fails to compile
580678 Minor improvement to GTK+ mediaLib code
580511 gdk_x11_atom_to_xatom_for_display translates GDK_NONE...
581110 Handlebox widget uses static variables, crashes in multi...
553385 gtk-builder-convert creates untranslated combobox models
580814 GtkTextLayout incorrectly assumes pango iterates in logi...
579366 gtkbuilderparser leaks RequiresInfo objects
579741 gailcombox should emit property-changed:accessible-name...
574386 Remove deprecated call to gtk_status_icon_set_tooltip...
384940 handle rejecting jobs and authentication meaningfully
* Updated translations
Arabic
Brazilian Portuguese
British English
Catalan
Czech
Estonian
Italian
Kannada
Oriya
Simplified Chinese
Slovenian
Spanish
Ukrainian
Overview of Changes from GTK+ 2.16.0 to 2.16.1
==============================================

View File

@@ -27,6 +27,14 @@ Installation
See the file 'INSTALL'
Release notes for 2.18
======================
* gtk_tooltip_set_custom now accept a NULL custom_widget to unset the
old custom_widget. Custom_widget does not get destroyed when the
tooltip goes away.
Release notes for 2.16
======================

View File

@@ -11,9 +11,9 @@ AC_PREREQ(2.54)
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [16])
m4_define([gtk_micro_version], [2])
m4_define([gtk_interface_age], [2])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -378,6 +378,19 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
pango >= pango_required_version dnl
cairo >= cairo_required_version])
## In addition to checking that cairo is present, we also need to
## check that the correct cairo backend is there. E.g. if the GDK
## target is win32 we need the cairo-win32 backend and so on.
cairo_backend=$gdktarget
# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
# backend names are identical.
if test "x$cairo_backend" = "xx11"; then
cairo_backend=xlib
fi
PKG_CHECK_MODULES(CAIRO_BACKEND,
[cairo-$cairo_backend >= cairo_required_version])
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
@@ -1424,9 +1437,8 @@ if test "x$gdktarget" = "xx11"; then
# Check for shaped window extension
AC_CHECK_FUNC(XShapeCombineMask,
AC_DEFINE(HAVE_SHAPE_EXT, 1,
[Define to 1 if the XShape extension is available]))
AC_CHECK_FUNC(XShapeCombineMask, :,
[AC_MSG_ERROR([Shape extension not found, check your development headers])])
# X SYNC check
gtk_save_CFLAGS="$CFLAGS"
@@ -1492,54 +1504,55 @@ if test "x$gdktarget" = "xx11"; then
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $x_cflags"
case "$host" in
*-*-solaris*)
# Check for solaris
AC_MSG_CHECKING(for Xinerama support on Solaris)
# Check for XFree
AC_MSG_CHECKING(for Xinerama support on XFree86)
have_solaris_xinerama=false
AC_CHECK_FUNC(XineramaGetInfo,
[AC_CHECK_HEADER(X11/extensions/xinerama.h,
[have_solaris_xinerama=true], :,
[#include <X11/Xlib.h>])])
if $have_solaris_xinerama ; then
AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
[Define to 1 if solaris xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 if xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
;;
*)
# Check for XFree
AC_MSG_CHECKING(for Xinerama support on XFree86)
have_xfree_xinerama=false
if $PKG_CONFIG --exists xinerama ; then
have_xfree_xinerama=true
X_PACKAGES="$X_PACKAGES xinerama"
else
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
[GTK_ADD_LIB(x_extra_libs,Xinerama)
have_xfree_xinerama=true], :,
[#include <X11/Xlib.h>])])
fi
have_xfree_xinerama=false
if $PKG_CONFIG --exists xinerama ; then
have_xfree_xinerama=true
X_PACKAGES="$X_PACKAGES xinerama"
else
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
[GTK_ADD_LIB(x_extra_libs,Xinerama)
have_xfree_xinerama=true], :,
[#include <X11/Xlib.h>])])
fi
if $have_xfree_xinerama ; then
AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
[Define to 1 if XFree Xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 is Xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
;;
esac
if $have_xfree_xinerama ; then
AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
[Define to 1 if XFree Xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 is Xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
case "$host" in
*-*-solaris*)
# Check for solaris
AC_MSG_CHECKING(for Xinerama support on Solaris)
have_solaris_xinerama=false
AC_CHECK_FUNC(XineramaGetInfo,
[AC_CHECK_HEADER(X11/extensions/xinerama.h,
[have_solaris_xinerama=true], :,
[#include <X11/Xlib.h>])])
if $have_solaris_xinerama ; then
AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
[Define to 1 if solaris xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 if xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
;;
*)
;;
esac
fi
fi
# set up things for XInput
@@ -1645,18 +1658,7 @@ if test "x$gdktarget" = "xdirectfb"; then
DIRECTFB_REQUIRED_VERSION=1.0.0
AC_MSG_CHECKING(for DirectFB)
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb && $PKG_CONFIG --exists cairo-directfb ; then
AC_MSG_RESULT(found)
GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags cairo-directfb` $GDK_EXTRA_CFLAGS"
GDK_EXTRA_LIBS="`$PKG_CONFIG --libs cairo-directfb` $GDK_EXTRA_LIBS"
else
AC_MSG_ERROR([
*** DirectFB $DIRECTFB_REQUIRED_VERSION or newer and the cairo backend
*** are required. The latest version of DirectFB is always available
*** from http://www.directfb.org/.
])
fi
PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DIRECTFB_REQUIRED_VERSION])
AM_CONDITIONAL(USE_DIRECTFB, true)
else
AM_CONDITIONAL(USE_DIRECTFB, false)
@@ -1700,13 +1702,9 @@ fi
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0"
if test "x$gdktarget" = "xx11"; then
GDK_PACKAGES="$GDK_PACKAGES $X_PACKAGES cairo-xlib"
fi
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 $X_PACKAGES cairo-$cairo_backend"
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
#
# If we aren't writing explicit dependencies, then don't put the extra libraries we need
# into the pkg-config files
@@ -1879,6 +1877,28 @@ else
AM_CONDITIONAL(HAVE_CUPS, false)
fi
# Checks to see if we should compile with PAPI backend for GTK+
#
AC_ARG_ENABLE(papi,
[AC_HELP_STRING([--disable-papi]
[disable papi print backend])],,
[enable_papi=auto])
if test "x$enable_papi" = "xauto"
then
AC_MSG_CHECKING(libpapi)
AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
if test $have_papi = yes; then
AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
fi
AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
else
AM_CONDITIONAL(HAVE_PAPI, false)
fi
AM_CONDITIONAL(HAVE_PAPI_CUPS, test $have_papi = yes && test "x$CUPS_CONFIG" != "xno")
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
@@ -2107,6 +2127,7 @@ modules/printbackends/Makefile
modules/printbackends/cups/Makefile
modules/printbackends/lpr/Makefile
modules/printbackends/file/Makefile
modules/printbackends/papi/Makefile
modules/printbackends/test/Makefile
perf/Makefile
contrib/Makefile

View File

@@ -4,3 +4,5 @@ SUBDIRS =
if USE_X11
SUBDIRS += gdk-pixbuf-xlib
endif
-include $(top_srcdir)/git.mk

View File

@@ -38,3 +38,5 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdk-pixbuf-xlib-2.0.pc
EXTRA_DIST += gdk-pixbuf-xlib-2.0.pc.in
-include $(top_srcdir)/git.mk

View File

@@ -82,3 +82,5 @@ EXTRA_DIST += \
gnu-keys.png
DISTCLEANFILES = test-inline-pixbufs.h
-include $(top_srcdir)/git.mk

View File

@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.decl
democodedir=$(datadir)/gtk-2.0/demo
## These should be in the order you want them to appear in the
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos = \
appwindow.c \
@@ -23,12 +23,14 @@ demos = \
iconview.c \
iconview_edit.c \
images.c \
links.c \
list_store.c \
menus.c \
panes.c \
pickers.c \
pixbufs.c \
printing.c \
resolution_independence.c \
rotated_text.c \
search_entry.c \
sizegroup.c \
@@ -96,3 +98,5 @@ IMAGEFILES= alphatest.png \
democode_DATA = $(demos) $(IMAGEFILES) demo.ui
DISTCLEANFILES = demos.h
-include $(top_srcdir)/git.mk

View File

@@ -8,6 +8,8 @@
#include "demo-common.h"
static GtkWidget *window = NULL;
static GtkWidget *infobar = NULL;
static GtkWidget *messagelabel = NULL;
static void
activate_action (GtkAction *action)
@@ -16,7 +18,7 @@ activate_action (GtkAction *action)
const gchar *typename = G_OBJECT_TYPE_NAME (action);
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
@@ -29,7 +31,7 @@ activate_action (GtkAction *action)
"response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_widget_show (dialog);
}
@@ -41,37 +43,32 @@ activate_radio_action (GtkAction *action, GtkRadioAction *current)
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current));
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
if (active)
if (active)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
"You activated radio action: \"%s\" of type \"%s\".\n"
"Current value: %d",
name, typename, value);
gchar *text;
/* Close dialog on user response */
g_signal_connect (dialog,
"response",
G_CALLBACK (gtk_widget_destroy),
NULL);
gtk_widget_show (dialog);
text = g_strdup_printf ("You activated radio action: \"%s\" of type \"%s\".\n"
"Current value: %d",
name, typename, value);
gtk_label_set_text (GTK_LABEL (messagelabel), text);
gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), (GtkMessageType)value);
gtk_widget_show (infobar);
g_free (text);
}
}
static void
static void
activate_email (GtkAboutDialog *about,
const gchar *link,
gpointer data)
{
g_print ("send mail to %s\n", link);
gchar *text;
text = g_strdup_printf ("send mail to %s", link);
g_print ("%s\n", text);
g_free (text);
}
static void
static void
activate_url (GtkAboutDialog *about,
const gchar *link,
gpointer data)
@@ -147,12 +144,12 @@ about_cb (GtkAction *action,
g_object_unref (transparent);
}
typedef struct
typedef struct
{
GtkAction action;
} ToolMenuAction;
typedef struct
typedef struct
{
GtkActionClass parent_class;
} ToolMenuActionClass;
@@ -179,30 +176,30 @@ static GtkActionEntry entries[] = {
{ "HelpMenu", NULL, "_Help" }, /* name, stock id, label */
{ "New", GTK_STOCK_NEW, /* name, stock id */
"_New", "<control>N", /* label, accelerator */
"Create a new file", /* tooltip */
G_CALLBACK (activate_action) },
"Create a new file", /* tooltip */
G_CALLBACK (activate_action) },
{ "File1", NULL, /* name, stock id */
"File1", NULL, /* label, accelerator */
"File1", NULL, /* label, accelerator */
"Open first file", /* tooltip */
G_CALLBACK (activate_action) },
G_CALLBACK (activate_action) },
{ "Save", GTK_STOCK_SAVE, /* name, stock id */
"_Save","<control>S", /* label, accelerator */
"_Save","<control>S", /* label, accelerator */
"Save current file", /* tooltip */
G_CALLBACK (activate_action) },
{ "SaveAs", GTK_STOCK_SAVE, /* name, stock id */
"Save _As...", NULL, /* label, accelerator */
"Save _As...", NULL, /* label, accelerator */
"Save to a file", /* tooltip */
G_CALLBACK (activate_action) },
{ "Quit", GTK_STOCK_QUIT, /* name, stock id */
"_Quit", "<control>Q", /* label, accelerator */
"_Quit", "<control>Q", /* label, accelerator */
"Quit", /* tooltip */
G_CALLBACK (activate_action) },
{ "About", NULL, /* name, stock id */
"_About", "<control>A", /* label, accelerator */
"About", /* tooltip */
"_About", "<control>A", /* label, accelerator */
"About", /* tooltip */
G_CALLBACK (about_cb) },
{ "Logo", "demo-gtk-logo", /* name, stock id */
NULL, NULL, /* label, accelerator */
NULL, NULL, /* label, accelerator */
"GTK+", /* tooltip */
G_CALLBACK (activate_action) },
};
@@ -211,9 +208,9 @@ static guint n_entries = G_N_ELEMENTS (entries);
static GtkToggleActionEntry toggle_entries[] = {
{ "Bold", GTK_STOCK_BOLD, /* name, stock id */
"_Bold", "<control>B", /* label, accelerator */
"_Bold", "<control>B", /* label, accelerator */
"Bold", /* tooltip */
G_CALLBACK (activate_action),
G_CALLBACK (activate_action),
TRUE }, /* is_active */
};
static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
@@ -226,13 +223,13 @@ enum {
static GtkRadioActionEntry color_entries[] = {
{ "Red", NULL, /* name, stock id */
"_Red", "<control>R", /* label, accelerator */
"_Red", "<control>R", /* label, accelerator */
"Blood", COLOR_RED }, /* tooltip, value */
{ "Green", NULL, /* name, stock id */
"_Green", "<control>G", /* label, accelerator */
"_Green", "<control>G", /* label, accelerator */
"Grass", COLOR_GREEN }, /* tooltip, value */
{ "Blue", NULL, /* name, stock id */
"_Blue", "<control>B", /* label, accelerator */
"_Blue", "<control>B", /* label, accelerator */
"Sky", COLOR_BLUE }, /* tooltip, value */
};
static guint n_color_entries = G_N_ELEMENTS (color_entries);
@@ -245,18 +242,18 @@ enum {
static GtkRadioActionEntry shape_entries[] = {
{ "Square", NULL, /* name, stock id */
"_Square", "<control>S", /* label, accelerator */
"_Square", "<control>S", /* label, accelerator */
"Square", SHAPE_SQUARE }, /* tooltip, value */
{ "Rectangle", NULL, /* name, stock id */
"_Rectangle", "<control>R", /* label, accelerator */
"_Rectangle", "<control>R", /* label, accelerator */
"Rectangle", SHAPE_RECTANGLE }, /* tooltip, value */
{ "Oval", NULL, /* name, stock id */
"_Oval", "<control>O", /* label, accelerator */
"Egg", SHAPE_OVAL }, /* tooltip, value */
"_Oval", "<control>O", /* label, accelerator */
"Egg", SHAPE_OVAL }, /* tooltip, value */
};
static guint n_shape_entries = G_N_ELEMENTS (shape_entries);
static const gchar *ui_info =
static const gchar *ui_info =
"<ui>"
" <menubar name='MenuBar'>"
" <menu action='FileMenu'>"
@@ -288,7 +285,7 @@ static const gchar *ui_info =
" <toolitem action='Open'>"
" <menu action='OpenMenu'>"
" <menuitem action='File1'/>"
" </menu>"
" </menu>"
" </toolitem>"
" <toolitem action='Quit'/>"
" <separator action='Sep1'/>"
@@ -308,7 +305,7 @@ static void
register_stock_icons (void)
{
static gboolean registered = FALSE;
if (!registered)
{
GdkPixbuf *pixbuf;
@@ -320,12 +317,12 @@ register_stock_icons (void)
"_GTK!",
0, 0, NULL }
};
registered = TRUE;
/* Register our stock items */
gtk_stock_add (items, G_N_ELEMENTS (items));
/* Add our custom icon factory to the list of defaults */
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
@@ -350,7 +347,7 @@ register_stock_icons (void)
/* The gtk-logo-rgb icon has a white background, make it transparent */
transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
icon_set = gtk_icon_set_new_from_pixbuf (transparent);
gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
gtk_icon_set_unref (icon_set);
@@ -359,7 +356,7 @@ register_stock_icons (void)
}
else
g_warning ("failed to load GTK logo for toolbar");
/* Drop our reference to the factory, GTK will hold a reference. */
g_object_unref (factory);
}
@@ -373,9 +370,9 @@ update_statusbar (GtkTextBuffer *buffer,
gint row, col;
gint count;
GtkTextIter iter;
gtk_statusbar_pop (statusbar, 0); /* clear any previous message,
* underflow is allowed
gtk_statusbar_pop (statusbar, 0); /* clear any previous message,
* underflow is allowed
*/
count = gtk_text_buffer_get_char_count (buffer);
@@ -409,21 +406,21 @@ update_resize_grip (GtkWidget *widget,
GdkEventWindowState *event,
GtkStatusbar *statusbar)
{
if (event->changed_mask & (GDK_WINDOW_STATE_MAXIMIZED |
if (event->changed_mask & (GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_FULLSCREEN))
{
gboolean maximized;
maximized = event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED |
maximized = event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_FULLSCREEN);
gtk_statusbar_set_has_resize_grip (statusbar, !maximized);
}
}
GtkWidget *
do_appwindow (GtkWidget *do_widget)
{
{
if (!window)
{
GtkWidget *table;
@@ -438,10 +435,10 @@ do_appwindow (GtkWidget *do_widget)
GError *error = NULL;
register_stock_icons ();
/* Create the toplevel window
*/
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
@@ -453,15 +450,15 @@ do_appwindow (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
table = gtk_table_new (1, 4, FALSE);
table = gtk_table_new (1, 5, FALSE);
gtk_container_add (GTK_CONTAINER (window), table);
/* Create the menubar and toolbar
*/
action_group = gtk_action_group_new ("AppWindowActions");
open_action = g_object_new (tool_menu_action_get_type (),
open_action = g_object_new (tool_menu_action_get_type (),
"name", "Open",
"label", "_Open",
"tooltip", "Open a file",
@@ -469,30 +466,30 @@ do_appwindow (GtkWidget *do_widget)
NULL);
gtk_action_group_add_action (action_group, open_action);
g_object_unref (open_action);
gtk_action_group_add_actions (action_group,
entries, n_entries,
gtk_action_group_add_actions (action_group,
entries, n_entries,
window);
gtk_action_group_add_toggle_actions (action_group,
toggle_entries, n_toggle_entries,
gtk_action_group_add_toggle_actions (action_group,
toggle_entries, n_toggle_entries,
NULL);
gtk_action_group_add_radio_actions (action_group,
color_entries, n_color_entries,
gtk_action_group_add_radio_actions (action_group,
color_entries, n_color_entries,
COLOR_RED,
G_CALLBACK (activate_radio_action),
G_CALLBACK (activate_radio_action),
NULL);
gtk_action_group_add_radio_actions (action_group,
shape_entries, n_shape_entries,
gtk_action_group_add_radio_actions (action_group,
shape_entries, n_shape_entries,
SHAPE_SQUARE,
G_CALLBACK (activate_radio_action),
G_CALLBACK (activate_radio_action),
NULL);
merge = gtk_ui_manager_new ();
g_object_set_data_full (G_OBJECT (window), "ui-manager", merge,
g_object_set_data_full (G_OBJECT (window), "ui-manager", merge,
g_object_unref);
gtk_ui_manager_insert_action_group (merge, action_group, 0);
gtk_window_add_accel_group (GTK_WINDOW (window),
gtk_window_add_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group (merge));
if (!gtk_ui_manager_add_ui_from_string (merge, ui_info, -1, &error))
{
g_message ("building menus failed: %s", error->message);
@@ -502,7 +499,7 @@ do_appwindow (GtkWidget *do_widget)
bar = gtk_ui_manager_get_widget (merge, "/MenuBar");
gtk_widget_show (bar);
gtk_table_attach (GTK_TABLE (table),
bar,
bar,
/* X direction */ /* Y direction */
0, 1, 0, 1,
GTK_EXPAND | GTK_FILL, 0,
@@ -511,7 +508,7 @@ do_appwindow (GtkWidget *do_widget)
bar = gtk_ui_manager_get_widget (merge, "/ToolBar");
gtk_widget_show (bar);
gtk_table_attach (GTK_TABLE (table),
bar,
bar,
/* X direction */ /* Y direction */
0, 1, 1, 2,
GTK_EXPAND | GTK_FILL, 0,
@@ -520,6 +517,25 @@ do_appwindow (GtkWidget *do_widget)
/* Create document
*/
infobar = gtk_info_bar_new ();
gtk_widget_set_no_show_all (infobar, TRUE);
messagelabel = gtk_label_new ("");
gtk_widget_show (messagelabel);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar))),
messagelabel,
TRUE, TRUE, 0);
gtk_info_bar_add_button (GTK_INFO_BAR (infobar),
GTK_STOCK_OK, GTK_RESPONSE_OK);
g_signal_connect (infobar, "response",
G_CALLBACK (gtk_widget_hide), NULL);
gtk_table_attach (GTK_TABLE (table),
infobar,
/* X direction */ /* Y direction */
0, 1, 2, 3,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@@ -528,20 +544,21 @@ do_appwindow (GtkWidget *do_widget)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_table_attach (GTK_TABLE (table),
sw,
/* X direction */ /* Y direction */
0, 1, 2, 3,
0, 1, 3, 4,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
0, 0);
gtk_window_set_default_size (GTK_WINDOW (window),
200, 200);
GTK_SIZE_ONE_TWELFTH_EM (200),
GTK_SIZE_ONE_TWELFTH_EM (200));
contents = gtk_text_view_new ();
gtk_widget_grab_focus (contents);
gtk_container_add (GTK_CONTAINER (sw),
contents);
@@ -551,7 +568,7 @@ do_appwindow (GtkWidget *do_widget)
gtk_table_attach (GTK_TABLE (table),
statusbar,
/* X direction */ /* Y direction */
0, 1, 3, 4,
0, 1, 4, 5,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
@@ -570,12 +587,12 @@ do_appwindow (GtkWidget *do_widget)
statusbar,
0);
g_signal_connect_object (window,
"window_state_event",
g_signal_connect_object (window,
"window_state_event",
G_CALLBACK (update_resize_grip),
statusbar,
0);
update_statusbar (buffer, GTK_STATUSBAR (statusbar));
}
@@ -584,9 +601,11 @@ do_appwindow (GtkWidget *do_widget)
gtk_widget_show_all (window);
}
else
{
{
gtk_widget_destroy (window);
window = NULL;
infobar = NULL;
messagelabel = NULL;
}
return window;

View File

@@ -58,14 +58,32 @@ on_entry_changed (GtkWidget *widget, gpointer data)
gtk_assistant_set_page_complete (assistant, current_page, FALSE);
}
static void
on_unit_changed (GtkWidget *assistant,
gpointer user_data)
{
int n;
GdkPixbuf *pixbuf;
GtkWidget *page;
/* update icons on all pages */
for (n = 0; n < 3; n++)
{
page = gtk_assistant_get_nth_page (GTK_ASSISTANT (assistant), n);
pixbuf = gtk_widget_render_icon (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, NULL);
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), page, pixbuf);
g_object_unref (pixbuf);
}
}
static void
create_page1 (GtkWidget *assistant)
{
GtkWidget *box, *label, *entry;
GdkPixbuf *pixbuf;
box = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
box = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (10));
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
@@ -91,8 +109,8 @@ create_page2 (GtkWidget *assistant)
GtkWidget *box, *checkbutton;
GdkPixbuf *pixbuf;
box = gtk_vbox_new (12, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
box = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (10));
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
@@ -134,7 +152,7 @@ do_assistant (GtkWidget *do_widget)
{
assistant = gtk_assistant_new ();
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300);
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, GTK_SIZE_ONE_TWELFTH_EM (300));
gtk_window_set_screen (GTK_WINDOW (assistant),
gtk_widget_get_screen (do_widget));
@@ -151,6 +169,10 @@ do_assistant (GtkWidget *do_widget)
G_CALLBACK (on_assistant_apply), NULL);
g_signal_connect (G_OBJECT (assistant), "prepare",
G_CALLBACK (on_assistant_prepare), NULL);
/* need to reset the header pixbufs to correct size when the units change */
g_signal_connect (G_OBJECT (assistant), "unit-changed",
G_CALLBACK (on_unit_changed), NULL);
}
if (!GTK_WIDGET_VISIBLE (assistant))

View File

@@ -6,10 +6,10 @@
#include <gtk/gtk.h>
static GtkWidget *
create_bbox (gint horizontal,
char *title,
gint spacing,
gint layout)
create_bbox (gint horizontal,
char *title,
GtkSize spacing,
gint layout)
{
GtkWidget *frame;
GtkWidget *bbox;
@@ -22,7 +22,7 @@ create_bbox (gint horizontal,
else
bbox = gtk_vbutton_box_new ();
gtk_container_set_border_width (GTK_CONTAINER (bbox), 5);
gtk_container_set_border_width (GTK_CONTAINER (bbox), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (frame), bbox);
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
@@ -61,56 +61,56 @@ do_button_box (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
main_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
frame_horz = gtk_frame_new ("Horizontal Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (10));
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD),
create_bbox (TRUE, "Spread", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
create_bbox (TRUE, "Edge", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_EDGE),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
create_bbox (TRUE, "Start", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_START),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (vbox),
create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
create_bbox (TRUE, "End", GTK_SIZE_ONE_TWELFTH_EM (40), GTK_BUTTONBOX_END),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
frame_vert = gtk_frame_new ("Vertical Button Boxes");
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10);
gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (10));
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Spread", 30, GTK_BUTTONBOX_SPREAD),
create_bbox (FALSE, "Spread", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_SPREAD),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Edge", 30, GTK_BUTTONBOX_EDGE),
TRUE, TRUE, 5);
create_bbox (FALSE, "Edge", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_EDGE),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "Start", 30, GTK_BUTTONBOX_START),
TRUE, TRUE, 5);
create_bbox (FALSE, "Start", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_START),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (hbox),
create_bbox (FALSE, "End", 30, GTK_BUTTONBOX_END),
TRUE, TRUE, 5);
create_bbox (FALSE, "End", GTK_SIZE_ONE_TWELFTH_EM (30), GTK_BUTTONBOX_END),
TRUE, TRUE, GTK_SIZE_ONE_TWELFTH_EM (5));
}
if (!GTK_WIDGET_VISIBLE (window))

View File

@@ -354,8 +354,8 @@ create_frame (ChangeDisplayInfo *info,
*frame = gtk_frame_new (title);
hbox = gtk_hbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (*frame), hbox);
scrollwin = gtk_scrolled_window_new (NULL, NULL);
@@ -372,7 +372,7 @@ create_frame (ChangeDisplayInfo *info,
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (*tree_view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
*button_vbox = gtk_vbox_new (FALSE, 5);
*button_vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (hbox), *button_vbox, FALSE, FALSE, 0);
if (!info->size_group)
@@ -611,15 +611,15 @@ do_changedisplay (GtkWidget *do_widget)
"Change", GTK_RESPONSE_OK,
NULL);
gtk_window_set_default_size (GTK_WINDOW (info->window), 300, 400);
gtk_window_set_default_size (GTK_WINDOW (info->window), GTK_SIZE_ONE_TWELFTH_EM (300), GTK_SIZE_ONE_TWELFTH_EM (400));
g_signal_connect (info->window, "response",
G_CALLBACK (response_cb), info);
g_signal_connect (info->window, "destroy",
G_CALLBACK (destroy_cb), &info);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->window)->vbox), vbox,
TRUE, TRUE, 0);

View File

@@ -207,7 +207,7 @@ do_clipboard (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
@@ -215,8 +215,8 @@ do_clipboard (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
/* Create the first entry */
@@ -232,8 +232,8 @@ do_clipboard (GtkWidget *do_widget)
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
/* Create the second entry */
@@ -249,8 +249,8 @@ do_clipboard (GtkWidget *do_widget)
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
/* Create the first image */

View File

@@ -87,10 +87,10 @@ do_colorsel (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
@@ -108,7 +108,7 @@ do_colorsel (GtkWidget *do_widget)
G_CALLBACK (expose_event_callback), NULL);
/* set a minimum size */
gtk_widget_set_size_request (da, 200, 200);
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (200), GTK_SIZE_ONE_TWELFTH_EM (200));
/* set the color */
gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &color);

View File

@@ -11,8 +11,10 @@
enum
{
PIXBUF_COL,
TEXT_COL
STOCK_ID_COL,
TEXT_COL,
NUM_COLUMNS,
};
static gchar *
@@ -50,7 +52,6 @@ create_stock_icon_store (void)
};
GtkStockItem item;
GdkPixbuf *pixbuf;
GtkWidget *cellview;
GtkTreeIter iter;
GtkListStore *store;
@@ -59,29 +60,25 @@ create_stock_icon_store (void)
cellview = gtk_cell_view_new ();
store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
for (i = 0; i < G_N_ELEMENTS (stock_id); i++)
{
if (stock_id[i])
{
pixbuf = gtk_widget_render_icon (cellview, stock_id[i],
GTK_ICON_SIZE_BUTTON, NULL);
gtk_stock_lookup (stock_id[i], &item);
gtk_stock_lookup (stock_id[i], &item);
label = strip_underscore (item.label);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
PIXBUF_COL, pixbuf,
STOCK_ID_COL, stock_id[i],
TEXT_COL, label,
-1);
g_object_unref (pixbuf);
g_free (label);
}
else
{
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
PIXBUF_COL, NULL,
TEXT_COL, "separator",
-1);
}
@@ -343,9 +340,9 @@ do_combobox (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
vbox = gtk_vbox_new (FALSE, 2);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (2));
gtk_container_add (GTK_CONTAINER (window), vbox);
/* A combobox demonstrating cell renderers, separators and
@@ -355,7 +352,7 @@ do_combobox (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (frame), box);
model = create_stock_icon_store ();
@@ -366,7 +363,7 @@ do_combobox (GtkWidget *do_widget)
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"pixbuf", PIXBUF_COL,
"stock-id", STOCK_ID_COL,
NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo),
@@ -396,7 +393,7 @@ do_combobox (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (frame), box);
model = create_capital_store ();
@@ -425,7 +422,7 @@ do_combobox (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
gtk_container_set_border_width (GTK_CONTAINER (box), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (frame), box);
combo = gtk_combo_box_entry_new_text ();

View File

@@ -148,8 +148,9 @@
</accessibility>
</object>
<object class="GtkWindow" id="window1">
<property name="default_height">250</property>
<property name="default_width">440</property>
<!-- 100 mm = 10 cm ~= 4 inches -->
<property name="default_height">100 mm</property>
<property name="default_width">36.6667em</property>
<property name="title">GtkBuilder demo</property>
<child>
<object class="GtkVBox" id="vbox1">

View File

@@ -51,16 +51,16 @@ interactive_dialog_clicked (GtkButton *button,
GTK_RESPONSE_CANCEL,
NULL);
hbox = gtk_hbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0);
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_table_attach_defaults (GTK_TABLE (table),
@@ -112,17 +112,17 @@ do_dialog (GtkWidget *do_widget)
gtk_window_set_title (GTK_WINDOW (window), "Dialogs");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
frame = gtk_frame_new ("Dialogs");
gtk_container_add (GTK_CONTAINER (window), frame);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (frame), vbox);
/* Standard message dialog */
hbox = gtk_hbox_new (FALSE, 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("_Message Dialog");
g_signal_connect (button, "clicked",
@@ -132,7 +132,7 @@ do_dialog (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
/* Interactive dialog*/
hbox = gtk_hbox_new (FALSE, 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
vbox2 = gtk_vbox_new (FALSE, 0);
@@ -143,8 +143,8 @@ do_dialog (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic ("_Entry 1");

View File

@@ -245,10 +245,10 @@ do_drawingarea (GtkWidget *do_widget)
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
@@ -266,7 +266,7 @@ do_drawingarea (GtkWidget *do_widget)
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (100), GTK_SIZE_ONE_TWELFTH_EM (100));
gtk_container_add (GTK_CONTAINER (frame), da);
@@ -288,7 +288,7 @@ do_drawingarea (GtkWidget *do_widget)
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_widget_set_size_request (da, GTK_SIZE_ONE_TWELFTH_EM (100), GTK_SIZE_ONE_TWELFTH_EM (100));
gtk_container_add (GTK_CONTAINER (frame), da);

View File

@@ -328,11 +328,11 @@ do_editable_cells (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Shopping list");
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (5));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
@@ -365,7 +365,7 @@ do_editable_cells (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (sw), treeview);
/* some buttons */
hbox = gtk_hbox_new (TRUE, 4);
hbox = gtk_hbox_new (TRUE, GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Add item");
@@ -378,7 +378,7 @@ do_editable_cells (GtkWidget *do_widget)
G_CALLBACK (remove_item), treeview);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_window_set_default_size (GTK_WINDOW (window), 320, 200);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (320), GTK_SIZE_ONE_TWELFTH_EM (200));
}
if (!GTK_WIDGET_VISIBLE (window))

View File

@@ -58,9 +58,9 @@ do_entry_completion (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");

View File

@@ -32,9 +32,9 @@ do_expander (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
label = gtk_label_new ("Expander demo. Click on the triangle for details.");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);

View File

@@ -267,7 +267,7 @@ do_hypertext (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
GTK_SIZE_ONE_TWELFTH_EM (450), GTK_SIZE_ONE_TWELFTH_EM (450));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@@ -263,7 +263,7 @@ do_iconview (GtkWidget *do_widget)
GError *error;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (650), GTK_SIZE_ONE_TWELFTH_EM (400));
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));

View File

@@ -332,10 +332,10 @@ do_images (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (cleanup_callback), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new (NULL);

85
demos/gtk-demo/links.c Normal file
View File

@@ -0,0 +1,85 @@
/* Links
*
* GtkLabel can show hyperlinks. The default action is to call
* gtk_show_uri() on their URI, but it is possible to override
* this with a custom handler.
*/
#include <gtk/gtk.h>
static void
response_cb (GtkWidget *dialog,
gint response_id,
gpointer data)
{
gtk_widget_destroy (dialog);
}
static gboolean
activate_link (GtkWidget *label,
const gchar *uri,
gpointer data)
{
if (g_strcmp0 (uri, "keynav") == 0)
{
GtkWidget *dialog;
GtkWidget *parent;
parent = gtk_widget_get_toplevel (label);
dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"The term <i>keynav</i> is a shorthand for "
"keyboard navigation and refers to the process of using "
"a program (exclusively) via keyboard input.");
gtk_window_present (GTK_WINDOW (dialog));
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL);
return TRUE;
}
return FALSE;
}
GtkWidget *
do_links (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box;
GtkWidget *label;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
"title=\"plain text\">text</a> may be marked up\n"
"as hyperlinks, which can be clicked\n"
"or activated via <a href=\"keynav\">keynav</a>");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
gtk_container_add (GTK_CONTAINER (window), label);
gtk_widget_show (label);
}
if (!GTK_WIDGET_VISIBLE (window))
{
gtk_widget_show (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -173,9 +173,9 @@ do_list_store (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
vbox = gtk_vbox_new (FALSE, 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
@@ -206,7 +206,7 @@ do_list_store (GtkWidget *do_widget)
add_columns (GTK_TREE_VIEW (treeview));
/* finish & show */
gtk_window_set_default_size (GTK_WINDOW (window), 280, 250);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (280), GTK_SIZE_ONE_TWELFTH_EM (250));
}
if (!GTK_WIDGET_VISIBLE (window))

View File

@@ -764,9 +764,9 @@ create_text (GtkTextBuffer **buffer,
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
GTK_WRAP_WORD);
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view),
2);
GTK_SIZE_ONE_TWELFTH_EM (2));
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view),
2);
GTK_SIZE_ONE_TWELFTH_EM (2));
}
return scrolled_window;
@@ -792,7 +792,7 @@ create_tree (void)
gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
GTK_SELECTION_BROWSE);
gtk_widget_set_size_request (tree_view, 200, -1);
gtk_widget_set_size_request (tree_view, GTK_SIZE_ONE_TWELFTH_EM (200), -1);
/* this code only supports 1 level of children. If we
* want more we probably have to use a recursing function.
@@ -946,6 +946,7 @@ main (int argc, char **argv)
}
/* -- End of hack -- */
gtk_enable_resolution_independence ();
gtk_init (&argc, &argv);
setup_default_icon ();
@@ -969,7 +970,7 @@ main (int argc, char **argv)
gtk_label_new_with_mnemonic ("_Info"));
tag = gtk_text_buffer_create_tag (info_buffer, "title",
"font", "Sans 18",
"scale", PANGO_SCALE_XX_LARGE,
NULL);
g_object_unref (info_buffer);
@@ -999,9 +1000,9 @@ main (int argc, char **argv)
"weight", PANGO_WEIGHT_BOLD,
"foreground", "DarkGoldenrod4",
NULL);
g_object_unref (source_buffer);
g_object_unref (source_buffer);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (600), GTK_SIZE_ONE_TWELFTH_EM (400));
gtk_widget_show_all (window);

View File

@@ -179,8 +179,8 @@ do_menus (GtkWidget *do_widget)
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
box2 = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_set_border_width (GTK_CONTAINER (box2), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
gtk_widget_show (box2);

View File

@@ -65,7 +65,7 @@ create_pane_options (GtkPaned *paned,
GtkWidget *check_button;
frame = gtk_frame_new (frame_label);
gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
gtk_container_set_border_width (GTK_CONTAINER (frame), GTK_SIZE_ONE_TWELFTH_EM (4));
table = gtk_table_new (3, 2, TRUE);
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -138,14 +138,14 @@ do_panes (GtkWidget *do_widget)
vpaned = gtk_vpaned_new ();
gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
gtk_container_set_border_width (GTK_CONTAINER(vpaned), GTK_SIZE_ONE_TWELFTH_EM (5));
hpaned = gtk_hpaned_new ();
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_size_request (frame, 60, 60);
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (60), GTK_SIZE_ONE_TWELFTH_EM (60));
gtk_paned_add1 (GTK_PANED (hpaned), frame);
button = gtk_button_new_with_mnemonic ("_Hi there");
@@ -153,12 +153,12 @@ do_panes (GtkWidget *do_widget)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_size_request (frame, 80, 60);
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (80), GTK_SIZE_ONE_TWELFTH_EM (60));
gtk_paned_add2 (GTK_PANED (hpaned), frame);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_widget_set_size_request (frame, 60, 80);
gtk_widget_set_size_request (frame, GTK_SIZE_ONE_TWELFTH_EM (60), GTK_SIZE_ONE_TWELFTH_EM (80));
gtk_paned_add2 (GTK_PANED (vpaned), frame);
/* Now create toggle buttons to control sizing */

View File

@@ -18,19 +18,20 @@ do_pickers (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (10));
table = gtk_table_new (4, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (3));
gtk_container_add (GTK_CONTAINER (window), table);
gtk_container_set_border_width (GTK_CONTAINER (table), 10);
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (10));
label = gtk_label_new ("Color:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);

View File

@@ -0,0 +1,239 @@
/* Resolution Independence
*
* This demonstates resolution independence features available since
* version 2.14 of GTK+. Use the slider to change the effective DPI
* per monitor. Note that the changes will only affect windows from
* this process.
*/
#include <gtk/gtk.h>
#include "config.h"
#include "demo-common.h"
static GtkWidget *window = NULL;
static GtkWindowGroup *window_group = NULL;
static GtkWidget *hscale;
static GtkWidget *label;
static GtkWidget *button;
static gdouble button_dpi;
#define INCHES_TO_MM 25.4
#define MIN_DPI 24.0
#define MAX_DPI 480.0
#define STEP_DPI 1.0
static void
update (void)
{
GdkScreen *screen;
gint monitor_num;
char *plug_name;
char *s;
gdouble dpi;
char *font_name;
GtkSettings *settings;
int width_mm;
int height_mm;
GdkRectangle geometry;
plug_name = NULL;
font_name = NULL;
width_mm = -1;
height_mm = -1;
geometry.x = -1;
geometry.y = -1;
geometry.width = -1;
geometry.height = -1;
screen = gtk_window_get_screen (GTK_WINDOW (window));
monitor_num = gtk_widget_get_monitor_num (window);
if (screen != NULL && monitor_num >= 0)
{
plug_name = gdk_screen_get_monitor_plug_name (screen, monitor_num);
width_mm = gdk_screen_get_monitor_width_mm (screen, monitor_num);
height_mm = gdk_screen_get_monitor_height_mm (screen, monitor_num);
gdk_screen_get_monitor_geometry (screen, monitor_num, &geometry);
}
if (screen != NULL)
settings = gtk_settings_get_for_screen (screen);
else
settings = gtk_settings_get_default ();
g_object_get (settings, "gtk-font-name", &font_name, NULL);
s = g_strdup_printf ("Monitor %d (%s) @ %dx%d+%d+%d\n"
"%d mm x %d mm\n"
"DPI: %.1f x %.1f\n"
"Font \"%s\"\n"
"1 em -> %g pixels\n"
"1 mm -> %g pixels",
monitor_num,
plug_name != NULL ? plug_name : "unknown name",
geometry.width, geometry.height, geometry.x, geometry.y,
width_mm, height_mm,
INCHES_TO_MM * geometry.width / width_mm,
INCHES_TO_MM * geometry.height / height_mm,
font_name,
gtk_size_to_pixel_double (screen, monitor_num, gtk_size_em (1.0)),
gtk_size_to_pixel_double (screen, monitor_num, gtk_size_mm (1.0)));
gtk_label_set_text (GTK_LABEL (label), s);
g_free (s);
button_dpi = MIN (INCHES_TO_MM * geometry.width / width_mm,
INCHES_TO_MM * geometry.height / height_mm);
s = g_strdup_printf ("Set DPI to %.1f", button_dpi);
gtk_button_set_label (GTK_BUTTON (button), s);
g_free (s);
dpi = -1;
if (screen != NULL)
{
dpi = gdk_screen_get_resolution_for_monitor (screen, monitor_num);
gtk_range_set_value (GTK_RANGE (hscale), dpi);
}
g_free (plug_name);
g_free (font_name);
}
static void
window_mapped (GtkWidget *widget, gpointer user_data)
{
update ();
}
static void
unit_changed (GtkWidget *widget, gpointer user_data)
{
update ();
}
static void
monitor_num_notify (GtkWindow *window, GParamSpec *psec, gpointer user_data)
{
g_debug ("notify::monitor-num");
update ();
}
static void
update_value (void)
{
gdouble slider_value;
slider_value = gtk_range_get_value (GTK_RANGE (hscale));
if (slider_value >= MIN_DPI && slider_value <= MAX_DPI)
{
GdkScreen *screen;
gint monitor_num;
screen = gtk_window_get_screen (GTK_WINDOW (window));
monitor_num = gtk_widget_get_monitor_num (window);
if (screen != NULL && monitor_num >= 0)
{
gdk_screen_set_resolution_for_monitor (screen, monitor_num, slider_value);
g_signal_emit_by_name (screen, "monitors-changed");
}
}
}
static gboolean is_pressed = FALSE;
static gboolean
hscale_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
is_pressed = TRUE;
return FALSE;
}
static gboolean
hscale_button_release_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
is_pressed = FALSE;
update_value ();
return FALSE;
}
static void
hscale_value_changed (GtkRange *range, gpointer user_data)
{
if (!is_pressed)
update_value ();
}
static char *
hscale_format_value (GtkScale *scale, gdouble value, gpointer user_data)
{
return g_strdup_printf ("%g DPI", value);
}
static void
dpi_button_clicked (GtkButton *button, gpointer user_data)
{
gtk_range_set_value (GTK_RANGE (hscale), button_dpi);
}
GtkWidget *
do_resolution_independence (GtkWidget *do_widget)
{
GtkWidget *vbox;
if (window != NULL)
goto have_window;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Resolution Independence");
gtk_window_set_icon_name (GTK_WINDOW (window), "gtk-fullscreen");
g_signal_connect (G_OBJECT (window), "map", G_CALLBACK (window_mapped), NULL);
g_signal_connect (G_OBJECT (window), "notify::monitor-num", G_CALLBACK (monitor_num_notify), NULL);
g_signal_connect (G_OBJECT (window), "unit-changed", G_CALLBACK (unit_changed), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
vbox = gtk_vbox_new (FALSE, gtk_size_em (1));
label = gtk_label_new (NULL);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
hscale = gtk_hscale_new_with_range (MIN_DPI, MAX_DPI, STEP_DPI);
gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (hscale), "value-changed", G_CALLBACK (hscale_value_changed), NULL);
g_signal_connect (G_OBJECT (hscale), "button-press-event", G_CALLBACK (hscale_button_press_event), NULL);
g_signal_connect (G_OBJECT (hscale), "button-release-event", G_CALLBACK (hscale_button_release_event), NULL);
g_signal_connect (G_OBJECT (hscale), "format-value", G_CALLBACK (hscale_format_value), NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_set_border_width (GTK_CONTAINER (window), gtk_size_em (1));
gtk_widget_set_size_request (window, GTK_SIZE_ONE_TWELFTH_EM (500), -1);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
button = gtk_button_new ();
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (dpi_button_clicked), NULL);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
/* avoid dialogs (e.g. printing) grabbing focus from us */
if (window_group == NULL)
window_group = gtk_window_group_new ();
gtk_window_group_add_window (window_group, GTK_WINDOW (window));
/* make sure we're on top */
gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
have_window:
if (!GTK_WIDGET_VISIBLE (window))
{
gtk_widget_show_all (window);
}
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}

View File

@@ -189,7 +189,8 @@ do_rotated_text (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
gtk_window_set_default_size (GTK_WINDOW (window),
gtk_size_em ((4 * RADIUS)), gtk_size_em ((4 * RADIUS)));
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
box = gtk_hbox_new (TRUE, 0);
@@ -207,7 +208,6 @@ do_rotated_text (GtkWidget *do_widget)
G_CALLBACK (rotated_text_expose_event), NULL);
/* And a label */
label = gtk_label_new (text);
gtk_container_add (GTK_CONTAINER (box), label);

View File

@@ -115,9 +115,9 @@ do_sizegroup (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -127,9 +127,9 @@ do_sizegroup (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_add (GTK_CONTAINER (frame), table);
add_row (GTK_TABLE (table), 0, size_group, "_Foreground", color_options);
@@ -141,9 +141,9 @@ do_sizegroup (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
gtk_container_set_border_width (GTK_CONTAINER (table), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_table_set_row_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_table_set_col_spacings (GTK_TABLE (table), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_add (GTK_CONTAINER (frame), table);
add_row (GTK_TABLE (table), 0, size_group, "_Dashing", dash_options);

View File

@@ -420,12 +420,12 @@ do_stock_browser (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Stock Icons and Items");
gtk_window_set_default_size (GTK_WINDOW (window), -1, 500);
gtk_window_set_default_size (GTK_WINDOW (window), -1, GTK_SIZE_ONE_TWELFTH_EM (500));
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_container_set_border_width (GTK_CONTAINER (window), GTK_SIZE_ONE_TWELFTH_EM (8));
hbox = gtk_hbox_new (FALSE, 8);
hbox = gtk_hbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), hbox);
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -494,8 +494,8 @@ do_stock_browser (GtkWidget *do_widget)
frame = gtk_frame_new ("Selected Item");
gtk_container_add (GTK_CONTAINER (align), frame);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (4));
gtk_container_add (GTK_CONTAINER (frame), vbox);
display = g_new (StockItemDisplay, 1);

View File

@@ -182,9 +182,9 @@ do_textscroll (GtkWidget *do_widget)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (600), GTK_SIZE_ONE_TWELFTH_EM (400));
hbox = gtk_hbox_new (TRUE, 6);
hbox = gtk_hbox_new (TRUE, GTK_SIZE_ONE_TWELFTH_EM (6));
gtk_container_add (GTK_CONTAINER (window), hbox);
create_text_view (hbox, TRUE);

View File

@@ -114,7 +114,7 @@ create_tags (GtkTextBuffer *buffer)
"justification", GTK_JUSTIFY_RIGHT, NULL);
gtk_text_buffer_create_tag (buffer, "wide_margins",
"left_margin", 50, "right_margin", 50,
"left_margin", GTK_SIZE_ONE_TWELFTH_EM (50), "right_margin", GTK_SIZE_ONE_TWELFTH_EM (50),
NULL);
gtk_text_buffer_create_tag (buffer, "strikethrough",
@@ -139,9 +139,9 @@ create_tags (GtkTextBuffer *buffer)
gtk_text_buffer_create_tag (buffer, "rtl_quote",
"wrap_mode", GTK_WRAP_WORD,
"direction", GTK_TEXT_DIR_RTL,
"indent", 30,
"left_margin", 20,
"right_margin", 20,
"indent", GTK_SIZE_ONE_TWELFTH_EM (30),
"left_margin", GTK_SIZE_ONE_TWELFTH_EM (20),
"right_margin", GTK_SIZE_ONE_TWELFTH_EM (20),
NULL);
}
@@ -173,7 +173,10 @@ insert_text (GtkTextBuffer *buffer)
exit (1);
}
scaled = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR);
scaled = gdk_pixbuf_scale_simple (pixbuf,
gtk_size_to_pixel (NULL, 0, GTK_SIZE_ONE_TWELFTH_EM (32)),
gtk_size_to_pixel (NULL, 0, GTK_SIZE_ONE_TWELFTH_EM (32)),
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
pixbuf = scaled;
@@ -409,7 +412,7 @@ attach_widgets (GtkTextView *text_view)
{
widget = gtk_hscale_new (NULL);
gtk_range_set_range (GTK_RANGE (widget), 0, 100);
gtk_widget_set_size_request (widget, 70, -1);
gtk_widget_set_size_request (widget, GTK_SIZE_ONE_TWELFTH_EM (70), -1);
}
else if (i == 3)
{
@@ -454,7 +457,7 @@ do_textview (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
GTK_SIZE_ONE_TWELFTH_EM (450), GTK_SIZE_ONE_TWELFTH_EM (450));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
@@ -463,7 +466,7 @@ do_textview (GtkWidget *do_widget)
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
vpaned = gtk_vpaned_new ();
gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5);
gtk_container_set_border_width (GTK_CONTAINER(vpaned), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_container_add (GTK_CONTAINER (window), vpaned);
/* For convenience, we just use the autocreated buffer from
@@ -534,7 +537,7 @@ recursive_attach_view (int depth,
gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &color);
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_container_set_border_width (GTK_CONTAINER (align), 1);
gtk_container_set_border_width (GTK_CONTAINER (align), GTK_SIZE_ONE_TWELFTH_EM (1));
gtk_container_add (GTK_CONTAINER (event_box), align);
gtk_container_add (GTK_CONTAINER (align), child_view);
@@ -590,7 +593,7 @@ easter_egg_callback (GtkWidget *button,
window_ptr = &window;
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);
gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (300), GTK_SIZE_ONE_TWELFTH_EM (400));
gtk_widget_show_all (window);
}

View File

@@ -291,7 +291,7 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* havoc column */
@@ -313,7 +313,7 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* tim column */
@@ -336,7 +336,7 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* owen column */
@@ -358,7 +358,7 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* dave column */
@@ -380,7 +380,7 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), GTK_SIZE_ONE_TWELFTH_EM (50));
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
}
@@ -402,8 +402,8 @@ do_tree_store (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
@@ -435,7 +435,7 @@ do_tree_store (GtkWidget *do_widget)
/* expand all rows after the treeview widget has been realized */
g_signal_connect (treeview, "realize",
G_CALLBACK (gtk_tree_view_expand_all), NULL);
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
gtk_window_set_default_size (GTK_WINDOW (window), GTK_SIZE_ONE_TWELFTH_EM (50), GTK_SIZE_ONE_TWELFTH_EM (400));
}
if (!GTK_WIDGET_VISIBLE (window))

View File

@@ -204,7 +204,7 @@ do_ui_manager (GtkWidget *do_widget)
FALSE, FALSE, 0);
label = gtk_label_new ("Type\n<alt>\nto start");
gtk_widget_set_size_request (label, 200, 200);
gtk_widget_set_size_request (label, GTK_SIZE_ONE_TWELFTH_EM (200), GTK_SIZE_ONE_TWELFTH_EM (200));
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (box1), label, TRUE, TRUE, 0);
@@ -213,8 +213,8 @@ do_ui_manager (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
box2 = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_container_set_border_width (GTK_CONTAINER (box2), GTK_SIZE_ONE_TWELFTH_EM (10));
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");

View File

@@ -19,3 +19,5 @@ EXTRA_DIST += \
generation.txt \
gtkdocs_fix \
RELEASE-HOWTO
-include $(top_srcdir)/git.mk

View File

@@ -38,3 +38,5 @@ dist-hook:
endif
.PHONY: html
-include $(top_srcdir)/git.mk

View File

@@ -3,3 +3,6 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = gdk-pixbuf gdk gtk libgail-util
GITIGNOREFILES = */*.1
-include $(top_srcdir)/git.mk

View File

@@ -95,3 +95,5 @@ dist-hook-local: $(BUILT_EXTRA_DIST)
for f in $$files; do \
if test -f $$f; then d=.; else d=$(srcdir); fi; \
cp $$d/$$f $(distdir) || exit 1; done
-include $(top_srcdir)/git.mk

View File

@@ -136,6 +136,8 @@ gdk_pixbuf_animation_iter_get_pixbuf
GdkPixbufSimpleAnim
gdk_pixbuf_simple_anim_new
gdk_pixbuf_simple_anim_add_frame
gdk_pixbuf_simple_anim_set_loop
gdk_pixbuf_simple_anim_get_loop
<SUBSECTION Standard>
GDK_PIXBUF_ANIMATION

View File

@@ -172,3 +172,21 @@ An opaque struct representing a simple animation.
@pixbuf:
<!-- ##### FUNCTION gdk_pixbuf_simple_anim_set_loop ##### -->
<para>
</para>
@animation:
@loop:
<!-- ##### FUNCTION gdk_pixbuf_simple_anim_get_loop ##### -->
<para>
</para>
@animation:
@Returns:

View File

@@ -152,3 +152,5 @@ include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
-include $(top_srcdir)/git.mk

View File

@@ -225,8 +225,12 @@ gdk_screen_broadcast_client_message
gdk_screen_get_setting
gdk_screen_get_font_options
gdk_screen_set_font_options
gdk_screen_get_font_options_for_monitor
gdk_screen_set_font_options_for_monitor
gdk_screen_get_resolution
gdk_screen_set_resolution
gdk_screen_get_resolution_for_monitor
gdk_screen_set_resolution_for_monitor
gdk_screen_get_active_window
gdk_screen_get_window_stack
<SUBSECTION Spawning>
@@ -874,6 +878,7 @@ gdk_pango_renderer_set_stipple
gdk_pango_renderer_set_override_color
gdk_pango_context_get
gdk_pango_context_get_for_screen
gdk_pango_context_get_for_screen_for_monitor
gdk_pango_context_set_colormap
GdkPangoAttrEmbossed
GdkPangoAttrEmbossColor

View File

@@ -129,17 +129,18 @@ content_files = \
drawing-model.xml \
glossary.xml \
migrating-checklist.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkAction.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkColorButton.sgml \
migrating-GtkComboBox.sgml \
migrating-GtkEntry-icons.sgml \
migrating-GtkFileChooser.sgml \
migrating-GtkIconView.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkColorButton.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkLabel-links.sgml \
migrating-GtkLinkButton.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkTooltip.sgml \
objects_grouped.sgml \
osx.sgml \
@@ -344,7 +345,10 @@ HTML_IMAGES = \
$(srcdir)/images/layout-rlbt.png \
$(srcdir)/images/layout-rltb.png \
$(srcdir)/images/layout-tblr.png \
$(srcdir)/images/layout-tbrl.png
$(srcdir)/images/layout-tbrl.png \
$(srcdir)/images/gtk-ri-file-chooser-size-6.png \
$(srcdir)/images/gtk-ri-file-chooser-size-12.png \
$(srcdir)/images/gtk-ri-file-chooser-size-24.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html \
@@ -377,3 +381,5 @@ dist-hook-local: $(BUILT_EXTRA_DIST)
for f in $$files; do \
if test -f $$f; then d=.; else d=$(srcdir); fi; \
cp $$d/$$f $(distdir) || exit 1; done
-include $(top_srcdir)/git.mk

View File

@@ -126,6 +126,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/gtktypeutils.xml" />
<xi:include href="xml/gtktesting.xml" />
<xi:include href="xml/filesystem.xml" />
<xi:include href="xml/gtksize.xml" />
</part>
<part id="gtkobjects">
@@ -159,6 +160,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/gtklabel.xml" />
<xi:include href="xml/gtkprogressbar.xml" />
<xi:include href="xml/gtkstatusbar.xml" />
<xi:include href="xml/gtkinfobar.xml" />
<xi:include href="xml/gtkstatusicon.xml" />
</chapter>
@@ -432,6 +434,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<xi:include href="xml/migrating-GtkBuilder.sgml" />
<xi:include href="xml/migrating-GtkTooltip.sgml" />
<xi:include href="xml/migrating-GtkEntry-icons.sgml" />
<xi:include href="xml/migrating-GtkLabel-links.sgml" />
</part>
<part>
@@ -483,4 +486,8 @@ that is, GUI components such as #GtkButton or #GtkTextView.
<title>Index of new symbols in 2.16</title>
<xi:include href="xml/api-index-2.16.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-2-18" role="2.18">
<title>Index of new symbols in 2.18</title>
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
</index>
</book>

View File

@@ -328,6 +328,7 @@ GtkAlignment
gtk_alignment_new
gtk_alignment_set
gtk_alignment_get_padding
gtk_alignment_get_padding_unit
gtk_alignment_set_padding
<SUBSECTION Standard>
GTK_ALIGNMENT
@@ -471,9 +472,11 @@ gtk_box_pack_end_defaults
gtk_box_get_homogeneous
gtk_box_set_homogeneous
gtk_box_get_spacing
gtk_box_get_spacing_unit
gtk_box_set_spacing
gtk_box_reorder_child
gtk_box_query_child_packing
gtk_box_query_child_packing_unit
gtk_box_set_child_packing
<SUBSECTION Standard>
GTK_BOX
@@ -1033,6 +1036,7 @@ gtk_container_unset_focus_chain
gtk_container_class_find_child_property
gtk_container_class_install_child_property
gtk_container_class_list_child_properties
gtk_container_get_border_width_unit
<SUBSECTION Standard>
GTK_CONTAINER
GTK_IS_CONTAINER
@@ -1414,6 +1418,7 @@ gtk_expander_set_expanded
gtk_expander_get_expanded
gtk_expander_set_spacing
gtk_expander_get_spacing
gtk_expander_get_spacing_unit
gtk_expander_set_label
gtk_expander_get_label
gtk_expander_set_use_underline
@@ -1931,14 +1936,19 @@ gtk_icon_view_set_columns
gtk_icon_view_get_columns
gtk_icon_view_set_item_width
gtk_icon_view_get_item_width
gtk_icon_view_get_item_width_unit
gtk_icon_view_set_spacing
gtk_icon_view_get_spacing
gtk_icon_view_get_spacing_unit
gtk_icon_view_set_row_spacing
gtk_icon_view_get_row_spacing
gtk_icon_view_get_row_spacing_unit
gtk_icon_view_set_column_spacing
gtk_icon_view_get_column_spacing
gtk_icon_view_get_column_spacing_unit
gtk_icon_view_set_margin
gtk_icon_view_get_margin
gtk_icon_view_get_margin_unit
gtk_icon_view_select_path
gtk_icon_view_unselect_path
gtk_icon_view_path_is_selected
@@ -2016,6 +2026,7 @@ gtk_image_set
gtk_image_get
gtk_image_set_pixel_size
gtk_image_get_pixel_size
gtk_image_get_pixel_size_unit
<SUBSECTION Standard>
GTK_IMAGE
GTK_IS_IMAGE
@@ -2274,6 +2285,7 @@ gtk_label_set_use_markup
gtk_label_set_use_underline
gtk_label_set_single_line_mode
gtk_label_set_angle
gtk_label_get_current_uri
<SUBSECTION Standard>
GTK_LABEL
GTK_IS_LABEL
@@ -2587,6 +2599,37 @@ GTK_MESSAGE_DIALOG_GET_CLASS
gtk_message_dialog_get_type
</SECTION>
<SECTION>
<FILE>gtkinfobar</FILE>
<TITLE>GtkInfoBar</TITLE>
GtkInfoBar
gtk_info_bar_new
gtk_info_bar_new_with_buttons
gtk_info_bar_set_contents
gtk_info_bar_add_action_widget
gtk_info_bar_add_button
gtk_info_bar_add_buttons
gtk_info_bar_set_response_sensitive
gtk_info_bar_set_default_response
gtk_info_bar_response
gtk_info_bar_set_message_type
gtk_info_bar_get_message_type
gtk_info_bar_get_action_area
gtk_info_bar_get_content_area
<SUBSECTION Standard>
GTK_TYPE_INFO_BAR
GTK_INFO_BAR
GTK_INFO_BAR_CLASS
GTK_IS_INFO_BAR
GTK_IS_INFO_BAR_CLASS
GTK_INFO_BAR_GET_CLASS
<SUBSECTION Private>
gtk_info_bar_get_type
GtkMessageAreaPrivate
</SECTION>
<SECTION>
<FILE>gtkmisc</FILE>
<TITLE>GtkMisc</TITLE>
@@ -2595,6 +2638,7 @@ gtk_misc_set_alignment
gtk_misc_set_padding
gtk_misc_get_alignment
gtk_misc_get_padding
gtk_misc_get_padding_unit
<SUBSECTION Standard>
GTK_MISC
GTK_IS_MISC
@@ -3598,10 +3642,14 @@ gtk_table_set_row_spacings
gtk_table_set_col_spacings
gtk_table_set_homogeneous
gtk_table_get_default_row_spacing
gtk_table_get_default_row_spacing_unit
gtk_table_get_homogeneous
gtk_table_get_row_spacing
gtk_table_get_row_spacing_unit
gtk_table_get_col_spacing
gtk_table_get_col_spacing_unit
gtk_table_get_default_col_spacing
gtk_table_get_default_col_spacing_unit
<SUBSECTION Standard>
GTK_TABLE
GTK_IS_TABLE
@@ -3981,18 +4029,24 @@ gtk_text_view_set_overwrite
gtk_text_view_get_overwrite
gtk_text_view_set_pixels_above_lines
gtk_text_view_get_pixels_above_lines
gtk_text_view_get_pixels_above_lines_unit
gtk_text_view_set_pixels_below_lines
gtk_text_view_get_pixels_below_lines
gtk_text_view_get_pixels_below_lines_unit
gtk_text_view_set_pixels_inside_wrap
gtk_text_view_get_pixels_inside_wrap
gtk_text_view_get_pixels_inside_wrap_unit
gtk_text_view_set_justification
gtk_text_view_get_justification
gtk_text_view_set_left_margin
gtk_text_view_get_left_margin
gtk_text_view_get_left_margin_unit
gtk_text_view_set_right_margin
gtk_text_view_get_right_margin
gtk_text_view_get_right_margin_unit
gtk_text_view_set_indent
gtk_text_view_get_indent
gtk_text_view_get_indent_unit
gtk_text_view_set_tabs
gtk_text_view_get_tabs
gtk_text_view_set_accepts_tab
@@ -4717,6 +4771,7 @@ gtk_tree_view_column_set_cell_data_func
gtk_tree_view_column_clear_attributes
gtk_tree_view_column_set_spacing
gtk_tree_view_column_get_spacing
gtk_tree_view_column_get_spacing_unit
gtk_tree_view_column_set_visible
gtk_tree_view_column_get_visible
gtk_tree_view_column_set_resizable
@@ -4725,11 +4780,14 @@ gtk_tree_view_column_set_sizing
gtk_tree_view_column_get_sizing
gtk_tree_view_column_get_width
gtk_tree_view_column_get_fixed_width
gtk_tree_view_column_get_fixed_width_unit
gtk_tree_view_column_set_fixed_width
gtk_tree_view_column_set_min_width
gtk_tree_view_column_get_min_width
gtk_tree_view_column_get_min_width_unit
gtk_tree_view_column_set_max_width
gtk_tree_view_column_get_max_width
gtk_tree_view_column_get_max_width_unit
gtk_tree_view_column_clicked
gtk_tree_view_column_set_title
gtk_tree_view_column_get_title
@@ -4778,6 +4836,7 @@ GtkTreeViewMappingFunc
GtkTreeViewSearchEqualFunc
gtk_tree_view_new
gtk_tree_view_get_level_indentation
gtk_tree_view_get_level_indentation_unit
gtk_tree_view_get_show_expanders
gtk_tree_view_set_level_indentation
gtk_tree_view_set_show_expanders
@@ -4952,13 +5011,17 @@ GtkCellRendererMode
GtkCellRenderer
GtkCellRendererClass
gtk_cell_renderer_get_size
gtk_cell_renderer_get_size_unit
gtk_cell_renderer_render
gtk_cell_renderer_activate
gtk_cell_renderer_start_editing
gtk_cell_renderer_editing_canceled
gtk_cell_renderer_stop_editing
gtk_cell_renderer_get_fixed_size
gtk_cell_renderer_get_fixed_size_unit
gtk_cell_renderer_set_fixed_size
gtk_cell_renderer_get_tree_view_column
gtk_cell_renderer_get_tree_view
<SUBSECTION Standard>
GTK_CELL_RENDERER
@@ -5493,6 +5556,15 @@ gtk_widget_set_has_tooltip
gtk_widget_trigger_tooltip_query
gtk_widget_get_snapshot
gtk_widget_get_window
gtk_widget_get_monitor_num
gtk_widget_get_size_request_unit
gtk_widget_size_to_pixel
gtk_widget_size_to_pixel_double
gtk_widget_style_get_property_unit
gtk_widget_style_get_unit_valist
gtk_widget_style_get_unit
gtk_widget_get_unit_valist
gtk_widget_get_unit
<SUBSECTION>
gtk_requisition_copy
gtk_requisition_free
@@ -5579,6 +5651,7 @@ gtk_window_get_deletable
gtk_window_get_default_icon_list
gtk_window_get_default_icon_name
gtk_window_get_default_size
gtk_window_get_default_size_unit
gtk_window_get_destroy_with_parent
gtk_window_get_frame_dimensions
gtk_window_get_has_frame
@@ -5614,6 +5687,7 @@ gtk_window_set_icon_name
gtk_window_set_auto_startup_notification
gtk_window_get_opacity
gtk_window_set_opacity
gtk_window_get_monitor_num
<SUBSECTION Standard>
GTK_WINDOW
GTK_IS_WINDOW
@@ -5782,6 +5856,9 @@ gtk_style_set_font
gtk_style_get_style_property
gtk_style_get_valist
gtk_style_get
gtk_style_get_style_property_unit
gtk_style_get_unit_valist
gtk_style_get_unit
gtk_draw_hline
gtk_draw_vline
gtk_draw_shadow
@@ -6458,7 +6535,10 @@ gtk_icon_set_ref
gtk_icon_set_render_icon
gtk_icon_set_unref
gtk_icon_size_lookup
gtk_icon_size_lookup_unit
gtk_icon_size_lookup_for_settings
gtk_icon_size_lookup_for_settings_for_monitor
gtk_icon_size_lookup_for_settings_unit
gtk_icon_size_register
gtk_icon_size_register_alias
gtk_icon_size_from_name
@@ -6532,6 +6612,10 @@ gtk_print_operation_set_defer_drawing
gtk_print_operation_get_status
gtk_print_operation_get_status_string
gtk_print_operation_is_finished
gtk_print_operation_set_support_selection
gtk_print_operation_get_support_selection
gtk_print_operation_set_has_selection
gtk_print_operation_get_has_selection
gtk_print_run_page_setup_dialog
GtkPageSetupDoneFunc
gtk_print_run_page_setup_dialog_async
@@ -6576,8 +6660,13 @@ gtk_print_unix_dialog_set_settings
gtk_print_unix_dialog_get_settings
gtk_print_unix_dialog_get_selected_printer
gtk_print_unix_dialog_add_custom_tab
gtk_print_unix_dialog_set_support_selection
gtk_print_unix_dialog_get_support_selection
gtk_print_unix_dialog_set_has_selection
gtk_print_unix_dialog_get_has_selection
GtkPrintCapabilities
gtk_print_unix_dialog_set_manual_capabilities
gtk_print_unix_dialog_get_manual_capabilities
<SUBSECTION Standard>
GTK_TYPE_PRINT_UNIX_DIALOG
@@ -6995,3 +7084,31 @@ GTK_TYPE_ORIENTABLE
<SUBSECTION Private>
gtk_orientable_get_type
</SECTION>
<SECTION>
<TITLE>Units</TITLE>
<FILE>gtksize</FILE>
GtkSize
GtkUSize
GtkSizeUnit
gtk_size_em
gtk_size_mm
gtk_size_get_em
gtk_size_get_mm
GTK_SIZE_ONE_TWELFTH_EM
GTK_SIZE_MAXPIXEL
GTK_SIZE_MINPIXEL
gtk_size_get_unit
gtk_size_to_pixel
gtk_size_to_pixel_double
gtk_size_to_string
gtk_param_spec_size
gtk_value_set_size
gtk_value_get_size
gtk_value_size_skip_conversion
gtk_param_spec_usize
gtk_value_set_usize
gtk_value_get_usize
gtk_value_usize_skip_conversion
gtk_enable_resolution_independence
</SECTION>

View File

@@ -81,6 +81,7 @@ gtk_image_menu_item_get_type
gtk_im_context_get_type
gtk_im_context_simple_get_type
gtk_im_multicontext_get_type
gtk_info_bar_get_type
gtk_input_dialog_get_type
gtk_invisible_get_type
gtk_item_factory_get_type

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -53,7 +53,7 @@ GError* error = NULL;
GtkBuilder* builder = gtk_builder_new (<!-- -->);
if (!gtk_builder_add_from_file (builder, FILE, &amp;error))
{
g_warning ("Couldn't load builder file: %s", error->message);
g_warning ("Couldn't load builder file: %amp;s", error->message);
g_error_free (error);
}
</screen>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<chapter id="gtk-migrating-label-links">
<title>Migrating from SexyUrlLabel to GtkLabel</title>
<para>
GTK+ 2.18 supports showing links inside a #GtkLabel, similar to
SexyUrlLabel. Porting from SexyUrlLabel to GtkLabel is relatively
straightforward. GtkLabel accepts links in the markup using the
same HTML <tag>a</tag> notation that SexyUrlLabel uses. In addition
to the href attribute, GtkLabel accepts a title attribute that
is displayed as a tooltip on the link. Instead of
sexy_url_label_set_markup(), just call gtk_label_set_markup().
</para>
<para>
One difference between the two APIs is that the ::url-activated signal
from SexyUrlLabel has been replaced by the #GtkLabel::activate-link
signal. The need for connecting to this signal is greatly reduced,
since GtkLabel has a default handler that calls gtk_show_uri().
</para>
</chapter>

View File

@@ -0,0 +1,106 @@
<!-- ##### SECTION Title ##### -->
Filesystem utilities
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkMountOperation ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:is-showing ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:parent ##### -->
<para>
</para>
<!-- ##### ARG GtkMountOperation:screen ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_mount_operation_new ##### -->
<para>
</para>
@parent:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_is_showing ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_set_parent ##### -->
<para>
</para>
@op:
@parent:
<!-- ##### FUNCTION gtk_mount_operation_get_parent ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_mount_operation_set_screen ##### -->
<para>
</para>
@op:
@screen:
<!-- ##### FUNCTION gtk_mount_operation_get_screen ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_show_uri ##### -->
<para>
</para>
@screen:
@uri:
@timestamp:
@error:
@Returns:

View File

@@ -24,16 +24,20 @@ recognized by looking for <literal>http://url</literal>, with
<literal>url</literal> extending to the next space, tab or line break.
</para>
<para id="gtk-about-dialog-hook-setup">
When setting the website and email hooks for the #GtkAboutDialog widget,
you should remember that the order is important: you should set the hook
functions before setting the website and email URL properties, like this:
Since 2.18 #GtkAboutDialog provides default website and email hooks that use
gtk_show_uri().
</para>
<para>
If you want provide your own hooks overriding the default ones, it is important
to do so before setting the website and email URL properties, like this:
</para>
<informalexample><programlisting>
gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL);
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url);
</programlisting></informalexample>
<para>
Otherwise the GtkAboutDialog widget will not display the website and the
To disable the default hooks, you can pass %NULL as the hook func. Then,
the #GtkAboutDialog widget will not display the website or the
email addresses as clickable.
</para>
<para>

View File

@@ -0,0 +1,98 @@
<!-- ##### SECTION Title ##### -->
GtkActivatable
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkActivatable ##### -->
<para>
</para>
<!-- ##### ARG GtkActivatable:related-action ##### -->
<para>
</para>
<!-- ##### ARG GtkActivatable:use-action-appearance ##### -->
<para>
</para>
<!-- ##### STRUCT GtkActivatableIface ##### -->
<para>
</para>
@g_iface:
@update:
@sync_action_properties:
<!-- ##### FUNCTION gtk_activatable_do_set_related_action ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_get_related_action ##### -->
<para>
</para>
@activatable:
@Returns:
<!-- ##### FUNCTION gtk_activatable_get_use_action_appearance ##### -->
<para>
</para>
@activatable:
@Returns:
<!-- ##### FUNCTION gtk_activatable_sync_action_properties ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_set_related_action ##### -->
<para>
</para>
@activatable:
@action:
<!-- ##### FUNCTION gtk_activatable_set_use_action_appearance ##### -->
<para>
</para>
@activatable:
@use_appearance:

View File

@@ -10,6 +10,16 @@ A #GtkAssistant is a widget used to represent a generally complex
operation splitted in several steps, guiding the user through its pages
and controlling the page flow to collect the necessary data.
</para>
<refsect2 id="GtkAssistant-BUILDER-UI"><title>GtkAssistant as GtkBuildable</title>
<para>
The GtkAssistant implementation of the GtkBuildable interface exposes the
@action_area as internal children with the name "action_area".
</para>
<para>
To add pages to an assistant in GtkBuilder, simply add it as a &lt;child&gt;
to the GtkAssistant object, and set its child properties as necessary.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>

View File

@@ -7,46 +7,46 @@ 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
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.
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()
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
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
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.
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.
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
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.
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[
@@ -65,7 +65,7 @@ which are more limited in scope.
<!ATTLIST requires lib #REQUIRED
version #REQUIRED >
<!ATTLIST property name #REQUIRED
translatable #IMPLIED
translatable #IMPLIED
comments #IMPLIED
context #IMPLIED >
<!ATTLIST signal name #REQUIRED
@@ -93,7 +93,7 @@ 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"
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>
@@ -101,28 +101,28 @@ 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
<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,
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
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>
<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
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
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
@@ -134,16 +134,16 @@ 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.
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;
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.
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.
@@ -152,25 +152,25 @@ The "name" attribute specifies the name of the signal, and the
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
"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
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
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 possible values for the "type" attribute are described in
the sections describing the widget-specific portions of UI definitions.
</para>
<example>
@@ -205,11 +205,11 @@ 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.
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
respective objects, see
<link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>,
<link linkend="GtkLabel-BUILDER-UI">GtkLabel</link>,
<link linkend="GtkWindow-BUILDER-UI">GtkWindow</link>,
@@ -228,7 +228,9 @@ respective objects, see
<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="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>,
<link linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>,
<link linkend="GtkScale-BUILDER-UI">GtkScale</link>.
</para>
</refsect2>

View File

@@ -378,6 +378,11 @@ The #GtkEntry-struct struct contains only private data.
</para>
<!-- ##### ARG GtkEntry:invisible-char ##### -->
<para>
</para>
<!-- ##### ARG GtkEntry:progress-border ##### -->
<para>

View File

@@ -433,12 +433,12 @@ other, rather than vertically stacked
<!-- ##### ENUM GtkUpdateType ##### -->
<para>
Used by #GtkRange to control the policy for notifying value changes.
</para>
@GTK_UPDATE_CONTINUOUS:
@GTK_UPDATE_DISCONTINUOUS:
@GTK_UPDATE_DELAYED:
@GTK_UPDATE_CONTINUOUS: Notify updates whenever the value changed
@GTK_UPDATE_DISCONTINUOUS: Notify updates when the mouse button has been released
@GTK_UPDATE_DELAYED: Space out updates with a small timeout
<!-- ##### ENUM GtkVisibility ##### -->
<para>

View File

@@ -0,0 +1,210 @@
<!-- ##### SECTION Title ##### -->
GtkIMContext
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkIMContext ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkIMContext::commit ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkIMContext::delete-surrounding ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@arg1:
@arg2:
@Returns:
<!-- ##### SIGNAL GtkIMContext::preedit-changed ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::preedit-end ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::preedit-start ##### -->
<para>
</para>
@imcontext: the object which received the signal.
<!-- ##### SIGNAL GtkIMContext::retrieve-surrounding ##### -->
<para>
</para>
@imcontext: the object which received the signal.
@Returns:
<!-- ##### STRUCT GtkIMContextClass ##### -->
<para>
</para>
@preedit_start:
@preedit_end:
@preedit_changed:
@commit:
@retrieve_surrounding:
@delete_surrounding:
@set_client_window:
@get_preedit_string:
@filter_keypress:
@focus_in:
@focus_out:
@reset:
@set_cursor_location:
@set_use_preedit:
@set_surrounding:
@get_surrounding:
<!-- ##### STRUCT GtkIMContextInfo ##### -->
<para>
</para>
@context_id:
@context_name:
@domain:
@domain_dirname:
@default_locales:
<!-- ##### FUNCTION gtk_im_context_set_client_window ##### -->
<para>
</para>
@context:
@window:
<!-- ##### FUNCTION gtk_im_context_get_preedit_string ##### -->
<para>
</para>
@context:
@str:
@attrs:
@cursor_pos:
<!-- ##### FUNCTION gtk_im_context_filter_keypress ##### -->
<para>
</para>
@context:
@event:
@Returns:
<!-- ##### FUNCTION gtk_im_context_focus_in ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_focus_out ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_reset ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION gtk_im_context_set_cursor_location ##### -->
<para>
</para>
@context:
@area:
<!-- ##### FUNCTION gtk_im_context_set_use_preedit ##### -->
<para>
</para>
@context:
@use_preedit:
<!-- ##### FUNCTION gtk_im_context_set_surrounding ##### -->
<para>
</para>
@context:
@text:
@len:
@cursor_index:
<!-- ##### FUNCTION gtk_im_context_get_surrounding ##### -->
<para>
</para>
@context:
@text:
@cursor_index:
@Returns:
<!-- ##### FUNCTION gtk_im_context_delete_surrounding ##### -->
<para>
</para>
@context:
@offset:
@n_chars:
@Returns:

View File

@@ -162,6 +162,24 @@ aligns in its available space, see gtk_misc_set_alignment().
</refsect2>
<refsect2>
<title>Links</title>
<para>
Since 2.18, GTK+ supports markup for clickable hyperlinks in addition
to regular Pango markup. The markup for links is borrowed from HTML, using the
<tag>a</tag> with href and title attributes. GTK+ renders links similar to the
way they appear in web browsers, with colored, underlined text. The title
attribute is displayed as a tooltip on the link. An example looks like this:
<informalexample><programlisting>
gtk_label_set_markup (label, "Go to the &lt;a href=\"http://www.gtk.org\" title=\"&amp;lt;i&amp;gt;Our&amp;/i&amp;gt; website\"&gt;GTK+ website&lt;/a&gt; for more...");
</programlisting></informalexample>
It is possible to implement custom handling for links and their tooltips with
the #GtkLabel::activate-link signal and the gtk_label_get_current_uri() function.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>
@@ -177,6 +195,22 @@ described below.
</para>
<!-- ##### SIGNAL GtkLabel::activate-current-link ##### -->
<para>
</para>
@label: the object which received the signal.
<!-- ##### SIGNAL GtkLabel::activate-link ##### -->
<para>
</para>
@label: the object which received the signal.
@arg1:
@Returns:
<!-- ##### SIGNAL GtkLabel::copy-clipboard ##### -->
<para>
@@ -703,3 +737,12 @@ Sets the text within the GtkLabel widget.
@angle:
<!-- ##### FUNCTION gtk_label_get_current_uri ##### -->
<para>
</para>
@label:
@Returns:

View File

@@ -449,6 +449,8 @@ Returns the #GtkWidget that the menu is attached to.
A user function supplied when calling gtk_menu_popup() which controls the
positioning of the menu when it is displayed. The function sets the @x
and @y parameters to the coordinates where the menu is to be drawn.
To make the menu appear on a different monitor than the mouse pointer,
gtk_menu_set_monitor() must be called.
</para>
@menu: a #GtkMenu.

View File

@@ -178,6 +178,16 @@ Printing support was added in GTK+ 2.10.
@printoperation: the object which received the signal.
<!-- ##### SIGNAL GtkPrintOperation::update-custom-widget ##### -->
<para>
</para>
@printoperation: the object which received the signal.
@widget:
@arg1:
@arg2:
<!-- ##### ARG GtkPrintOperation:allow-async ##### -->
<para>
@@ -203,6 +213,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:has-selection ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:job-name ##### -->
<para>
@@ -233,6 +248,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:support-selection ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:track-print-status ##### -->
<para>
@@ -520,6 +540,42 @@ The #GQuark used for #GtkPrintError errors.
@Returns:
<!-- ##### FUNCTION gtk_print_operation_set_support_selection ##### -->
<para>
</para>
@op:
@support_selection:
<!-- ##### FUNCTION gtk_print_operation_get_support_selection ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_print_operation_set_has_selection ##### -->
<para>
</para>
@op:
@has_selection:
<!-- ##### FUNCTION gtk_print_operation_get_has_selection ##### -->
<para>
</para>
@op:
@Returns:
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog ##### -->
<para>

View File

@@ -717,6 +717,7 @@ multiple pages per sheet.
@GTK_PRINT_PAGES_ALL:
@GTK_PRINT_PAGES_CURRENT:
@GTK_PRINT_PAGES_RANGES:
@GTK_PRINT_PAGES_SELECTION:
<!-- ##### MACRO GTK_PRINT_SETTINGS_PRINT_PAGES ##### -->
<para>

View File

@@ -90,6 +90,16 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
</para>
<!-- ##### ARG GtkPrintUnixDialog:has-selection ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintUnixDialog:manual-capabilities ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintUnixDialog:page-setup ##### -->
<para>
@@ -105,6 +115,11 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
</para>
<!-- ##### ARG GtkPrintUnixDialog:support-selection ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_print_unix_dialog_new ##### -->
<para>
@@ -188,6 +203,42 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its
@tab_label:
<!-- ##### FUNCTION gtk_print_unix_dialog_set_support_selection ##### -->
<para>
</para>
@dialog:
@support_selection:
<!-- ##### FUNCTION gtk_print_unix_dialog_get_support_selection ##### -->
<para>
</para>
@dialog:
@Returns:
<!-- ##### FUNCTION gtk_print_unix_dialog_set_has_selection ##### -->
<para>
</para>
@dialog:
@has_selection:
<!-- ##### FUNCTION gtk_print_unix_dialog_get_has_selection ##### -->
<para>
</para>
@dialog:
@Returns:
<!-- ##### ENUM GtkPrintCapabilities ##### -->
<para>
An enum for specifying which features the print dialog should offer.
@@ -220,3 +271,12 @@ formats are supported.
@capabilities:
<!-- ##### FUNCTION gtk_print_unix_dialog_get_manual_capabilities ##### -->
<para>
</para>
@dialog:
@Returns:

View File

@@ -7,18 +7,29 @@ Base class for GtkHScale and GtkVScale
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkScale is a slider control used to select a numeric value.
To use it, you'll probably want to investigate the methods on
To use it, you'll probably want to investigate the methods on
its base class, #GtkRange, in addition to the methods for #GtkScale itself.
To set the value of a scale, you would normally use gtk_range_set_value().
To detect changes to the value, you would normally use the "value_changed"
To set the value of a scale, you would normally use gtk_range_set_value().
To detect changes to the value, you would normally use the "value_changed"
signal.
</para>
<para>
The #GtkScale widget is an abstract class, used only for deriving the
subclasses #GtkHScale and #GtkVScale. To create a scale widget,
subclasses #GtkHScale and #GtkVScale. To create a scale widget,
call gtk_hscale_new_with_range() or gtk_vscale_new_with_range().
</para>
<refsect2 id="GtkScale-BUILDER-UI"><title>GtkScale as GtkBuildable</title>
<para>
GtkScale supports a custom &lt;marks&gt; element, which
can contain multiple &lt;mark&gt; elements. The "value" and "position"
attributes have the same meaning as gtk_scale_add_mark() parameters of the
same name. If the element is not empty, its content is taken as the markup
to show at the mark. It can be translated with the usual "translatable and
"context" attributes.
</para>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>

View File

@@ -6,7 +6,35 @@ Sharing settings between applications
<!-- ##### SECTION Long_Description ##### -->
<para>
GtkSettings provide a mechanism to share global settings between applications.
On the X window system, this sharing is realized by an <ulink href="http://www.freedesktop.org/wiki/Specifications/xsettings-spec">XSettings</ulink>
manager that is usually part of the desktop environment, along with utilities
that let the user change these settings. In the absence of an Xsettings manager,
settings can also be specified in RC files.
</para>
<para>
Applications can override system-wide settings with gtk_settings_set_string_property(),
gtk_settings_set_long_property(), etc. This should be restricted to special
cases though; GtkSettings are not meant as an application configuration
facility. When doing so, you need to be aware that settings that are specific
to individual widgets may not be available before the widget type has been
realized at least once. The following example demonstrates a way to do this:
<informalexample><programlisting>
gtk_init (&amp;argc, &amp;argv);
/&ast; make sure the type is realized &ast/
g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
g_object_set (gtk_settings_get_default (), "gtk-menu-images", FALSE, NULL);
</programlisting></informalexample>
</para>
<para>
There is one GtkSettings instance per screen. It can be obtained with
gtk_settings_get_for_screen(), but in many cases, it is more convenient
to use gtk_widget_get_settings(). gtk_settings_get_default() returns the
GtkSettings instance for the default screen.
</para>
<!-- ##### SECTION See_Also ##### -->

View File

@@ -0,0 +1,229 @@
<!-- ##### SECTION Title ##### -->
Units
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF GtkSize ##### -->
<para>
</para>
<!-- ##### TYPEDEF GtkUSize ##### -->
<para>
</para>
<!-- ##### ENUM GtkSizeUnit ##### -->
<para>
</para>
@GTK_SIZE_UNIT_PIXEL:
@GTK_SIZE_UNIT_EM:
@GTK_SIZE_UNIT_MM:
<!-- ##### FUNCTION gtk_size_em ##### -->
<para>
</para>
@em:
@Returns:
<!-- ##### FUNCTION gtk_size_mm ##### -->
<para>
</para>
@mm:
@Returns:
<!-- ##### FUNCTION gtk_size_get_em ##### -->
<para>
</para>
@size:
@Returns:
<!-- ##### FUNCTION gtk_size_get_mm ##### -->
<para>
</para>
@size:
@Returns:
<!-- ##### MACRO GTK_SIZE_ONE_TWELFTH_EM ##### -->
<para>
</para>
@value:
<!-- ##### MACRO GTK_SIZE_MAXPIXEL ##### -->
<para>
</para>
<!-- ##### MACRO GTK_SIZE_MINPIXEL ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_size_get_unit ##### -->
<para>
</para>
@size:
@Returns:
<!-- ##### FUNCTION gtk_size_to_pixel ##### -->
<para>
</para>
@screen:
@monitor_num:
@size:
@Returns:
<!-- ##### FUNCTION gtk_size_to_pixel_double ##### -->
<para>
</para>
@screen:
@monitor_num:
@size:
@Returns:
<!-- ##### FUNCTION gtk_size_to_string ##### -->
<para>
</para>
@size:
@Returns:
<!-- ##### FUNCTION gtk_param_spec_size ##### -->
<para>
</para>
@name:
@nick:
@blurb:
@minimum:
@maximum:
@default_value:
@flags:
@Returns:
<!-- ##### FUNCTION gtk_value_set_size ##### -->
<para>
</para>
@value:
@v_size:
@widget:
<!-- ##### FUNCTION gtk_value_get_size ##### -->
<para>
</para>
@value:
@Returns:
<!-- ##### FUNCTION gtk_value_size_skip_conversion ##### -->
<para>
</para>
@value:
<!-- ##### FUNCTION gtk_param_spec_usize ##### -->
<para>
</para>
@name:
@nick:
@blurb:
@minimum:
@maximum:
@default_value:
@flags:
@Returns:
<!-- ##### FUNCTION gtk_value_set_usize ##### -->
<para>
</para>
@value:
@v_size:
@widget:
<!-- ##### FUNCTION gtk_value_get_usize ##### -->
<para>
</para>
@value:
@Returns:
<!-- ##### FUNCTION gtk_value_usize_skip_conversion ##### -->
<para>
</para>
@value:
<!-- ##### FUNCTION gtk_enable_resolution_independence ##### -->
<para>
</para>

View File

@@ -0,0 +1,80 @@
<!-- ##### SECTION Title ##### -->
GtkToolShell
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GtkToolShell ##### -->
<para>
</para>
<!-- ##### STRUCT GtkToolShellIface ##### -->
<para>
</para>
@get_icon_size:
@get_orientation:
@get_style:
@get_relief_style:
@rebuild_menu:
<!-- ##### FUNCTION gtk_tool_shell_get_icon_size ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_orientation ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_relief_style ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_get_style ##### -->
<para>
</para>
@shell:
@Returns:
<!-- ##### FUNCTION gtk_tool_shell_rebuild_menu ##### -->
<para>
</para>
@shell:

View File

@@ -32,3 +32,5 @@ content_files =
HTML_IMAGES =
include $(top_srcdir)/gtk-doc.make
-include $(top_srcdir)/git.mk

View File

@@ -40,3 +40,5 @@ clean-local:
*) rm -f $$file ;; \
esac ; \
done
-include $(top_srcdir)/git.mk

View File

@@ -72,3 +72,5 @@ dist-hook:
echo "***"
endif
-include $(top_srcdir)/git.mk

View File

@@ -190,11 +190,11 @@ gtk_dial_set_adjustment (GtkDial *dial,
dial->adjustment = adjustment;
g_object_ref (GTK_OBJECT (dial->adjustment));
g_signal_connect (GTK_OBJECT (adjustment), "changed",
GTK_SIGNAL_FUNC (gtk_dial_adjustment_changed),
g_signal_connect (G_OBJECT (adjustment), "changed",
G_CALLBACK (gtk_dial_adjustment_changed),
(gpointer) dial);
g_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (gtk_dial_adjustment_value_changed),
g_signal_connect (G_OBJECT (adjustment), "value_changed",
G_CALLBACK (gtk_dial_adjustment_value_changed),
(gpointer) dial);
dial->old_value = adjustment->value;
@@ -333,6 +333,8 @@ gtk_dial_expose( GtkWidget *widget,
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->black_gc =
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->depth =
gdk_drawable_get_depth( GDK_DRAWABLE (widget->window));
gtk_paint_polygon (blankstyle,
widget->window,

View File

@@ -718,3 +718,5 @@ gdk-pixbuf.loaders:
echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
touch gdk-pixbuf.loaders;
endif
-include $(top_srcdir)/git.mk

View File

@@ -2459,7 +2459,7 @@ gdk_pixbuf_format_get_description (GdkPixbufFormat *format)
domain = format->domain;
else
domain = GETTEXT_PACKAGE;
description = dgettext (domain, format->description);
description = g_dgettext (domain, format->description);
return g_strdup (description);
}

View File

@@ -25,9 +25,12 @@
* Havoc Pennington <hp@redhat.com>
*/
#include "config.h"
#include <glib.h>
#define GDK_PIXBUF_C_COMPILATION
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-simple-anim.h"
#include "gdk-pixbuf-alias.h"
@@ -109,6 +112,21 @@ static GdkPixbufAnimationIter *get_iter (GdkPixbufAnimation *anim,
const GTimeVal *start_time);
static void gdk_pixbuf_simple_anim_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gdk_pixbuf_simple_anim_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
enum
{
PROP_0,
PROP_LOOP
};
G_DEFINE_TYPE (GdkPixbufSimpleAnim, gdk_pixbuf_simple_anim, GDK_TYPE_PIXBUF_ANIMATION)
static void
@@ -124,13 +142,30 @@ gdk_pixbuf_simple_anim_class_init (GdkPixbufSimpleAnimClass *klass)
object_class = G_OBJECT_CLASS (klass);
anim_class = GDK_PIXBUF_ANIMATION_CLASS (klass);
object_class->set_property = gdk_pixbuf_simple_anim_set_property;
object_class->get_property = gdk_pixbuf_simple_anim_get_property;
object_class->finalize = gdk_pixbuf_simple_anim_finalize;
anim_class->is_static_image = is_static_image;
anim_class->get_static_image = get_static_image;
anim_class->get_size = get_size;
anim_class->get_iter = get_iter;
/**
* GdkPixbufSimpleAnim:loop:
*
* Whether the animation should loop when it reaches the end.
*
* Since: 2.18
*/
g_object_class_install_property (object_class,
PROP_LOOP,
g_param_spec_boolean ("loop",
P_("Loop"),
P_("Whether the animation should loop when it reaches the end"),
FALSE,
G_PARAM_READWRITE));
}
static void
@@ -277,7 +312,7 @@ advance (GdkPixbufAnimationIter *anim_iter,
{
GdkPixbufSimpleAnimIter *iter;
gint elapsed;
gint loop;
gint loop_count;
GList *tmp;
GList *old;
@@ -302,13 +337,13 @@ advance (GdkPixbufAnimationIter *anim_iter,
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
loop = elapsed / iter->simple_anim->total_time;
loop_count = elapsed / iter->simple_anim->total_time;
elapsed = elapsed % iter->simple_anim->total_time;
iter->position = elapsed;
/* Now move to the proper frame */
if (loop < 1)
if (loop_count < 1 || iter->simple_anim->loop)
tmp = iter->simple_anim->frames;
else
tmp = NULL;
@@ -437,6 +472,82 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
animation->frames = g_list_append (animation->frames, frame);
}
static void
gdk_pixbuf_simple_anim_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GdkPixbufSimpleAnim *animation = GDK_PIXBUF_SIMPLE_ANIM (object);
switch (prop_id) {
case PROP_LOOP:
g_value_set_boolean (value,
gdk_pixbuf_simple_anim_get_loop (animation));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gdk_pixbuf_simple_anim_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GdkPixbufSimpleAnim *animation = GDK_PIXBUF_SIMPLE_ANIM (object);
switch (prop_id) {
case PROP_LOOP:
gdk_pixbuf_simple_anim_set_loop (animation,
g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/**
* gdk_pixbuf_simple_anim_set_loop:
* @animation: a #GdkPixbufSimpleAnim
* @loop: whether to loop the animation
*
* Sets whether @animation should loop indefinitely when it reaches the end.
*
* Since: 2.18
**/
void
gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation,
gboolean loop)
{
g_return_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation));
if (loop != animation->loop) {
animation->loop = loop;
g_object_notify (G_OBJECT (animation), "loop");
}
}
/**
* gdk_pixbuf_simple_anim_get_loop:
* @animation: a #GdkPixbufSimpleAnim
*
* Gets whether @animation should loop indefinitely when it reaches the end.
*
* Returns: %TRUE if the animation loops forever, %FALSE otherwise
*
* Since: 2.18
**/
gboolean
gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation)
{
g_return_val_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation), FALSE);
return animation->loop;
}
#define __GDK_PIXBUF_SIMPLE_ANIM_C__
#include "gdk-pixbuf-aliasdef.c"

View File

@@ -51,6 +51,9 @@ GdkPixbufSimpleAnim *gdk_pixbuf_simple_anim_new (gint width,
gfloat rate);
void gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
GdkPixbuf *pixbuf);
void gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation,
gboolean loop);
gboolean gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation);
G_END_DECLS

View File

@@ -133,6 +133,8 @@ gdk_pixbuf_simple_anim_get_type G_GNUC_CONST
gdk_pixbuf_simple_anim_iter_get_type G_GNUC_CONST
gdk_pixbuf_simple_anim_new
gdk_pixbuf_simple_anim_add_frame
gdk_pixbuf_simple_anim_set_loop
gdk_pixbuf_simple_anim_get_loop
#endif
#endif

View File

@@ -428,9 +428,10 @@ gdk_pixbuf_from_pixdata (const GdkPixdata *pixdata,
{
g_set_error (error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
ngettext("failed to allocate image buffer of %u byte",
"failed to allocate image buffer of %u bytes",
pixdata->rowstride * pixdata->height),
g_dngettext(GETTEXT_PACKAGE,
"failed to allocate image buffer of %u byte",
"failed to allocate image buffer of %u bytes",
pixdata->rowstride * pixdata->height),
pixdata->rowstride * pixdata->height);
return NULL;
}

View File

@@ -30,3 +30,5 @@ EXTRA_DIST += \
DETAILS \
pixbuf-transform-math.ltx \
makefile.msc
-include $(top_srcdir)/git.mk

View File

@@ -217,10 +217,7 @@ _pixops_use_medialib ()
* For x86 processors use of libumem conflicts with
* mediaLib, so avoid using it.
*/
if ((dlsym (RTLD_DEFAULT, "umem_alloc") != NULL) ||
(dlsym (RTLD_PROBE, "umem_alloc") != NULL) ||
(dlsym (RTLD_NEXT, "umem_alloc") != NULL) ||
(dlsym (RTLD_SELF, "umem_alloc") != NULL))
if (dlsym (RTLD_PROBE, "umem_alloc") != NULL)
{
use_medialib = FALSE;
return;

View File

@@ -303,3 +303,5 @@ files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
-include $(top_srcdir)/git.mk

View File

@@ -56,3 +56,5 @@ libgdkinclude_HEADERS = \
EXTRA_DIST += AUTHORS README TODO
-include $(top_srcdir)/git.mk

View File

@@ -889,6 +889,7 @@ gdk_pango_attr_embossed_new
gdk_pango_attr_stipple_new
gdk_pango_context_get
gdk_pango_context_get_for_screen
gdk_pango_context_get_for_screen_for_monitor
#ifndef GDK_DISABLE_DEPRECATED
gdk_pango_context_set_colormap
#endif
@@ -1008,8 +1009,12 @@ gdk_screen_get_monitor_at_point
gdk_screen_get_monitor_at_window
gdk_screen_set_font_options
gdk_screen_get_font_options
gdk_screen_set_font_options_for_monitor
gdk_screen_get_font_options_for_monitor
gdk_screen_set_resolution
gdk_screen_get_resolution
gdk_screen_get_resolution_for_monitor
gdk_screen_set_resolution_for_monitor
#endif
#endif

View File

@@ -104,10 +104,7 @@ _gdk_use_medialib (void)
* For x86 processors use of libumem conflicts with
* mediaLib, so avoid using it.
*/
if ((dlsym (RTLD_DEFAULT, "umem_alloc") != NULL) ||
(dlsym (RTLD_PROBE, "umem_alloc") != NULL) ||
(dlsym (RTLD_NEXT, "umem_alloc") != NULL) ||
(dlsym (RTLD_SELF, "umem_alloc") != NULL))
if (dlsym (RTLD_PROBE, "umem_alloc") != NULL)
{
return FALSE;
}

View File

@@ -1496,5 +1496,41 @@ gdk_pango_context_get_for_screen (GdkScreen *screen)
return context;
}
/**
* gdk_pango_context_get_for_screen_for_monitor:
* @screen: the #GdkScreen for which the context is to be created.
* @monitor_num: monitor number or -1 to use default monitor
*
* Like gdk_pango_context_get_for_screen() but also takes a monitor
* number.
*
* Return value: a new #PangoContext for @screen
*
* Since: RIMERGE
**/
PangoContext *
gdk_pango_context_get_for_screen_for_monitor (GdkScreen *screen,
gint monitor_num)
{
PangoFontMap *fontmap;
PangoContext *context;
const cairo_font_options_t *options;
double dpi;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
fontmap = pango_cairo_font_map_get_default ();
context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
options = gdk_screen_get_font_options_for_monitor (screen, monitor_num);
pango_cairo_context_set_font_options (context, options);
dpi = gdk_screen_get_resolution_for_monitor (screen, monitor_num);
pango_cairo_context_set_resolution (context, dpi);
return context;
}
#define __GDK_PANGO_C__
#include "gdkaliasdef.c"

View File

@@ -104,6 +104,9 @@ void gdk_pango_renderer_set_override_color (GdkPangoRenderer *gdk_renderer,
/************************************************************************/
PangoContext *gdk_pango_context_get_for_screen_for_monitor (GdkScreen *screen,
gint monitor_num);
PangoContext *gdk_pango_context_get_for_screen (GdkScreen *screen);
#ifndef GDK_MULTIHEAD_SAFE
PangoContext *gdk_pango_context_get (void);

View File

@@ -428,6 +428,25 @@ gdk_screen_set_font_options (GdkScreen *screen,
}
}
/**
* gdk_screen_set_font_options_for_monitor:
* @screen: a #GdkScreen
* @options: a #cairo_font_options_t, or %NULL to unset any
* previously set default font options.
*
* Like gdk_screen_set_font_options() but per monitor.
*
* Since: RIMERGE
**/
void
gdk_screen_set_font_options_for_monitor (GdkScreen *screen,
gint monitor_num,
const cairo_font_options_t *options)
{
/* TODO: need to implement per-monitor font options */
return gdk_screen_set_font_options (screen, options);
}
/**
* gdk_screen_get_font_options:
* @screen: a #GdkScreen
@@ -447,6 +466,26 @@ gdk_screen_get_font_options (GdkScreen *screen)
return screen->font_options;
}
/**
* gdk_screen_get_font_options_for_monitor:
* @screen: a #GdkScreen
* @monitor_num: monitor number or -1 for default monitor
*
* Like gdk_screen_get_font_options() but per monitor.
*
* Return value: the current font options, or %NULL if no default
* font options have been set.
*
* Since: RIMERGE
**/
const cairo_font_options_t *
gdk_screen_get_font_options_for_monitor (GdkScreen *screen,
gint monitor_num)
{
/* TODO: need to implement per-monitor font options */
return gdk_screen_get_font_options (screen);
}
/**
* gdk_screen_set_resolution:
* @screen: a #GdkScreen
@@ -497,6 +536,50 @@ gdk_screen_get_resolution (GdkScreen *screen)
return screen->resolution;
}
/**
* gdk_screen_get_resolution_for_monitor:
* @screen: a #GdkScreen
* @monitor_num: monitor number or -1 for default monitor
*
* Like gdk_screen_get_resolution() but per monitor.
*
* Returns: the current resolution or -1 if no resolution has been
* set.
*
* Since: RIMERGE
**/
gdouble
gdk_screen_get_resolution_for_monitor (GdkScreen *screen,
gint monitor_num)
{
#if 0
/* Nifty trick to test RI - monitor 0 will have 3 times the user configured DPI */
return (monitor_num == 0 ? 3.0 : 1.0) * gdk_screen_get_resolution (screen);
#endif
/* TODO: need to implement per-monitor resolution */
return gdk_screen_get_resolution (screen);
}
/**
* gdk_screen_set_resolution_for_monitor:
* @screen: a #GdkScreen
* @monitor_num: monitor number
* @dpi: the resolution in "dots per inch". (Physical inches aren't actually
* involved; the terminology is conventional.)
*
* Like gdk_screen_set_resolution() but per monitor.
*
* Since: RIMERGE
**/
void
gdk_screen_set_resolution_for_monitor (GdkScreen *screen,
gint monitor_num,
gdouble dpi)
{
/* TODO: need to implement per-monitor resolution */
gdk_screen_set_resolution (screen, dpi);
}
static void
gdk_screen_get_property (GObject *object,
guint prop_id,

View File

@@ -118,10 +118,23 @@ void gdk_screen_set_font_options (GdkScreen
const cairo_font_options_t *options);
const cairo_font_options_t *gdk_screen_get_font_options (GdkScreen *screen);
void gdk_screen_set_font_options_for_monitor (GdkScreen *screen,
gint monitor_num,
const cairo_font_options_t *options);
const cairo_font_options_t *gdk_screen_get_font_options_for_monitor (GdkScreen *screen,
gint monitor_num);
void gdk_screen_set_resolution (GdkScreen *screen,
gdouble dpi);
gdouble gdk_screen_get_resolution (GdkScreen *screen);
gdouble gdk_screen_get_resolution_for_monitor (GdkScreen *screen,
gint monitor_num);
void gdk_screen_set_resolution_for_monitor (GdkScreen *screen,
gint monitor_num,
gdouble dpi);
GdkWindow *gdk_screen_get_active_window (GdkScreen *screen);
GList *gdk_screen_get_window_stack (GdkScreen *screen);

View File

@@ -57,3 +57,5 @@ libgdk_quartz_la_SOURCES = \
libgdkinclude_HEADERS = \
gdkquartz.h
-include $(top_srcdir)/git.mk

View File

@@ -25,3 +25,5 @@ check_gdk_cairo_LDADD=\
CLEANFILES = \
cairosurface.png \
gdksurface.png
-include $(top_srcdir)/git.mk

View File

@@ -63,3 +63,5 @@ libgdk_win32_la_SOURCES = \
libgdkinclude_HEADERS = \
gdkwin32.h
-include $(top_srcdir)/git.mk

View File

@@ -11,3 +11,5 @@ endif
gdk-win32-res.o : gdk.rc gtk.ico
$(WINDRES) gdk.rc $@
-include $(top_srcdir)/git.mk

View File

@@ -82,3 +82,5 @@ EXTRA_DIST += \
gdkinput-xfree.c \
gdkinput-none.c \
gdksettings.c
-include $(top_srcdir)/git.mk

View File

@@ -312,10 +312,10 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
else if (files_count == 1)
description = g_strdup_printf (_("Opening %s"), get_display_name (files->data));
else
description = g_strdup_printf (dngettext (GETTEXT_PACKAGE,
"Opening %d Item",
"Opening %d Items",
files_count), files_count);
description = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
"Opening %d Item",
"Opening %d Items",
files_count), files_count);
icon_name = NULL;
if (priv->icon_name)

View File

@@ -50,9 +50,7 @@
#include <X11/extensions/Xfixes.h>
#endif
#ifdef HAVE_SHAPE_EXT
#include <X11/extensions/shape.h>
#endif
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
@@ -161,10 +159,8 @@ gdk_display_open (const gchar *display_name)
XClassHint *class_hint;
gulong pid;
gint i;
#if defined(HAVE_XFIXES) || defined(HAVE_SHAPE_EXT)
gint ignore;
gint maj, min;
#endif
xdisplay = XOpenDisplay (display_name);
if (!xdisplay)
@@ -282,7 +278,7 @@ gdk_display_open (const gchar *display_name)
display_x11->have_shapes = FALSE;
display_x11->have_input_shapes = FALSE;
#ifdef HAVE_SHAPE_EXT
if (XShapeQueryExtension (GDK_DISPLAY_XDISPLAY (display), &ignore, &ignore))
{
display_x11->have_shapes = TRUE;
@@ -291,7 +287,6 @@ gdk_display_open (const gchar *display_name)
display_x11->have_input_shapes = (maj == 1 && min >= 1);
#endif
}
#endif
display_x11->trusted_client = TRUE;
{

View File

@@ -1919,9 +1919,14 @@ static GdkDragAction
xdnd_action_from_atom (GdkDisplay *display,
Atom xatom)
{
GdkAtom atom = gdk_x11_xatom_to_atom_for_display (display, xatom);
GdkAtom atom;
gint i;
if (xatom == None)
return 0;
atom = gdk_x11_xatom_to_atom_for_display (display, xatom);
if (!xdnd_actions_initialized)
xdnd_initialize_actions();

Some files were not shown because too many files have changed in this diff Show More