Compare commits

...

181 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
67e0a44100 bgo#315462 - Make GtkLabel deal with too-small height allocations gracefully
Previously we would always align the top of the text with the label's allocation-plus-padding.
However, this makes a single-line label inside a GtkButton look badly clipped when the button
has a smaller allocation than its requisition.  So, for single-line labels we respect the
alignment even if it doesn't fit within the label's allocation.  But for multi-line labels, we
give preference to showing the first line, to give the user some context.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-05-12 19:12:55 -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
Federico Mena Quintero
e2bce0d630 bgo#463773 - Handle a NULL display in gtk_clipboard_get_for_display() so Flash won't hang 2009-05-12 13:44:04 -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
52325ccd66 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-11 12:14:04 -04:00
Matthias Clasen
5d8a4f78ab 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-11 12:13:50 -04:00
Matthias Clasen
2e9385efe2 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:05:35 -04: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
7cfda03395 Updated Greek translation 2009-05-09 14:16:28 +01:00
Marios Zindilis
038dfa53d0 Updated Greek translation 2009-05-09 14:15:33 +01:00
Ivar Smolin
e4d97d9652 Updating Estonian translation 2009-05-08 20:17:25 +03: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
556fb4dd5f Updated German translation. 2009-05-06 13:33:31 +02:00
Christian Kirbach
f2d4669ff8 Updated German translation. 2009-05-06 13:11:12 +02:00
Christian Kirbach
9426ba2735 Updated German translation. 2009-05-06 13:07:30 +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
339298b638 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:31:57 -04: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
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
00524901e1 Make GtkHandleBox work on multiple displays 2009-05-03 22:31:44 -04:00
Matthias Clasen
d183f44748 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:41:33 -04:00
Matthias Clasen
832be659b7 Fix whitespace 2009-05-03 13:00:30 -04:00
Matthias Clasen
1fe0b8e906 Warn if the adjustment has nonzero page size.
2008-09-23  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkspinbutton.c: Warn if the adjustment has nonzero page size.

svn path=/branches/gtk-2-14/; revision=21500
2009-05-03 13:00:30 -04:00
Matthias Clasen
5325959fe2 Update to explain the situation.
2008-09-23  Matthias Clasen  <mclasen@redhat.com>

        * README.in: Update to explain the situation.

        * gtk/gtkadjustment.c: Revert to the old behaviour of allowing
        values in the range [lower, upper]. Relying on the possibility
        to set values in the [upper - page_size, upper] subrange is
        considered deprecated, though, and will trigger a warning.

        * gtk/gtkcombobox.c:
        * gtk/gtkiconview.c:
        * gtk/gtkrange.c:
        * gtk/gtkscrolledwindow.c:
        * gtk/gtktreeview.c: Add the CLAMPing back that was removed after
        the GtkAdjustment behaviour change.

svn path=/branches/gtk-2-14/; revision=21499

Conflicts:

	ChangeLog.pre-2-14
2009-05-03 13:00:30 -04:00
Petr Kovar
49e1700bb2 Updated Czech translation 2009-05-03 18:46:22 +02:00
Jorge Gonzalez
01946b5120 Updated Spanish translation 2009-05-02 12:49:28 +02:00
Jorge Gonzalez
098a5b0500 Updated Spanish translation 2009-05-01 20:26:29 +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
637252af65 Avoid double browser windows from the about dialog. 2009-04-30 14:55:55 -04:00
Shankar Prasad
70d0129f48 Updated Kannada transltion 2009-04-28 13:52:01 +05:30
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
Gabor Kelemen
2266d16148 Updated Hungarian translation 2009-04-27 12:26:40 +02:00
Maxim V. Dziumanenko
b0b636ca85 Updated Ukrainian translation 2009-04-27 01:02:02 +03:00
Brian Cameron
f43a78a892 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 18:16:15 -05:00
Vladimir Melo
28a6068eb9 Updated Brazilian Portuguese translation. 2009-04-22 20:49:58 -03:00
Matej Urban
b33db85956 Updated Slovenian translation 2009-04-22 12:07:53 +02:00
Christian Persch
f1bb36c9d7 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:57:06 +02:00
Tobias Mueller
3c625fed07 Remove a deprecated call to gtk_status_icon_set_tooltip
This fixes bug 574386.
2009-04-20 01:45:10 +02:00
Khaled Hosny
39eb2c618e Updated Arabic translation 2009-04-19 20:00:33 +02:00
Matthias Clasen
61af085938 Point to better place for git documentation 2009-04-18 15:18:10 -04:00
Matthias Clasen
11adc5a0d3 Don't leak RequiresInfo when parsing GtkBuilder files
This fixes bug 579366.
2009-04-18 14:53:00 -04:00
Matthias Clasen
c28fabe3f6 Make GtkAssistant keep its padding when built with GtkBuilder 2009-04-18 14:43:52 -04:00
Luca Ferretti
553523048a Updated Italian translation
Completed Italian translation for 2.16
2009-04-18 17:32:57 +02:00
Philip Withnall
db1e138952 Updated British English translation 2009-04-18 16:29:24 +01:00
David Planella
ec0dd9f1ab Updated Catalan translation 2009-04-18 11:45:56 +02:00
Deng Xiyue
fbfea09f37 Updated zh_CN translation 2009-04-18 07:44:44 +02:00
470 changed files with 51048 additions and 33383 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

129
NEWS
View File

@@ -1,3 +1,132 @@
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
==============================================

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

@@ -12,7 +12,7 @@ AC_PREREQ(2.54)
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [17])
m4_define([gtk_micro_version], [0])
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)])
@@ -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

@@ -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

@@ -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

@@ -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

@@ -213,6 +213,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:has-selection ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:job-name ##### -->
<para>
@@ -243,6 +248,11 @@ Printing support was added in GTK+ 2.10.
</para>
<!-- ##### ARG GtkPrintOperation:support-selection ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintOperation:track-print-status ##### -->
<para>
@@ -530,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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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();

View File

@@ -1985,7 +1985,10 @@ gdk_event_translate (GdkDisplay *display,
event->selection.window = window;
event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.selection);
event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.target);
event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property);
if (xevent->xselection.property == None)
event->selection.property = GDK_NONE;
else
event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property);
event->selection.time = xevent->xselection.time;
break;

View File

@@ -173,37 +173,40 @@ lookup_cached_xatom (GdkDisplay *display,
/**
* gdk_x11_atom_to_xatom_for_display:
* @display: A #GdkDisplay
* @atom: A #GdkAtom
*
* @atom: A #GdkAtom, or %GDK_NONE
*
* Converts from a #GdkAtom to the X atom for a #GdkDisplay
* with the same string value.
*
* Return value: the X atom corresponding to @atom.
* with the same string value. The special value %GDK_NONE
* is converted to %None.
*
* Return value: the X atom corresponding to @atom, or %None
*
* Since: 2.2
**/
Atom
gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
GdkAtom atom)
gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
GdkAtom atom)
{
Atom xatom = None;
g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
g_return_val_if_fail (atom != GDK_NONE, None);
if (atom == GDK_NONE)
return None;
if (display->closed)
return None;
xatom = lookup_cached_xatom (display, atom);
if (!xatom)
{
char *name;
g_return_val_if_fail (ATOM_TO_INDEX (atom) < virtual_atom_array->len, None);
name = g_ptr_array_index (virtual_atom_array, ATOM_TO_INDEX (atom));
xatom = XInternAtom (GDK_DISPLAY_XDISPLAY (display), name, FALSE);
insert_atom_pair (display, atom, xatom);
}

View File

@@ -736,7 +736,10 @@ init_randr13 (GdkScreen *screen)
randr12_compat |= !g_strcmp0(output->name, "default");
if (output->connection == RR_Disconnected)
continue;
{
XRRFreeOutputInfo (output);
continue;
}
if (output->crtc)
{

View File

@@ -57,9 +57,7 @@
#include <string.h>
#ifdef HAVE_SHAPE_EXT
#include <X11/extensions/shape.h>
#endif
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
@@ -2285,7 +2283,7 @@ gdk_window_set_modal_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (modal, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_MODAL"),
NULL);
GDK_NONE);
}
/**
@@ -2319,8 +2317,8 @@ gdk_window_set_skip_taskbar_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_taskbar, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
NULL);
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
GDK_NONE);
}
/**
@@ -2357,7 +2355,7 @@ gdk_window_set_skip_pager_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_pager, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"),
NULL);
GDK_NONE);
}
/**
@@ -3538,18 +3536,20 @@ gdk_window_x11_get_events (GdkWindow *window)
{
XWindowAttributes attrs;
GdkEventMask event_mask;
GdkEventMask filtered;
if (GDK_WINDOW_DESTROYED (window))
return 0;
else
{
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (window),
&attrs);
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
/* if property change was filtered out before, keep it filtered out */
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
GDK_WINDOW_OBJECT (window)->event_mask = event_mask & ((GDK_WINDOW_OBJECT (window)->event_mask & filtered) | ~filtered);
return event_mask;
}
}
@@ -3557,13 +3557,14 @@ static void
gdk_window_x11_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
long xevent_mask;
long xevent_mask = 0;
int i;
if (!GDK_WINDOW_DESTROYED (window))
{
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
xevent_mask = StructureNotifyMask | PropertyChangeMask;
if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window))
xevent_mask = StructureNotifyMask | PropertyChangeMask;
for (i = 0; i < _gdk_nenvent_masks; i++)
{
if (event_mask & (1 << (i + 1)))
@@ -3638,8 +3639,7 @@ do_shape_combine_mask (GdkWindow *window,
GdkWindowObject *private = (GdkWindowObject *)window;
Pixmap pixmap;
gint xoffset, yoffset;
#ifdef HAVE_SHAPE_EXT
if (GDK_WINDOW_DESTROYED (window))
return;
@@ -3677,7 +3677,6 @@ do_shape_combine_mask (GdkWindow *window,
pixmap,
ShapeSet);
}
#endif /* HAVE_SHAPE_EXT */
}
static void
@@ -3736,8 +3735,7 @@ do_shape_combine_region (GdkWindow *window,
{
GdkWindowObject *private = (GdkWindowObject *)window;
gint xoffset, yoffset;
#ifdef HAVE_SHAPE_EXT
if (GDK_WINDOW_DESTROYED (window))
return;
@@ -3779,7 +3777,6 @@ do_shape_combine_region (GdkWindow *window,
g_free (xrects);
}
#endif /* HAVE_SHAPE_EXT */
}
static void
@@ -4350,7 +4347,7 @@ gdk_window_stick (GdkWindow *window)
/* Request stick during viewport scroll */
gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
NULL);
GDK_NONE);
/* Request desktop 0xFFFFFFFF */
memset (&xclient, 0, sizeof (xclient));
@@ -4401,7 +4398,7 @@ gdk_window_unstick (GdkWindow *window)
/* Request unstick from viewport */
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern_static_string ("_NET_WM_STATE_STICKY"),
NULL);
GDK_NONE);
move_to_current_desktop (window);
}
@@ -4901,8 +4898,6 @@ gdk_window_set_functions (GdkWindow *window,
gdk_window_set_mwm_hints (window, &hints);
}
#ifdef HAVE_SHAPE_EXT
/*
* propagate the shapes from all child windows of a GDK window to the parent
* window. Shamelessly ripped from Enlightenment's code
@@ -5216,13 +5211,10 @@ gdk_propagate_shapes (Display *disp,
g_free (spans);
}
#endif /* HAVE_SHAPE_EXT */
static inline void
do_child_shapes (GdkWindow *window,
gboolean merge)
{
#ifdef HAVE_SHAPE_EXT
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
{
@@ -5231,7 +5223,6 @@ do_child_shapes (GdkWindow *window,
merge,
ShapeBounding);
}
#endif
}
static void
@@ -5250,7 +5241,7 @@ static inline void
do_child_input_shapes (GdkWindow *window,
gboolean merge)
{
#if defined(HAVE_SHAPE_EXT) && defined(ShapeInput)
#if defined(ShapeInput)
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
{

View File

@@ -47,16 +47,19 @@ _gdk_xid_table_insert (GdkDisplay *display,
gpointer data)
{
GdkDisplayX11 *display_x11;
g_return_if_fail (xid != NULL);
g_return_if_fail (GDK_IS_DISPLAY (display));
display_x11 = GDK_DISPLAY_X11 (display);
if (!display_x11->xid_ht)
display_x11->xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
(GEqualFunc) gdk_xid_equal);
if (g_hash_table_lookup (display_x11->xid_ht, xid))
g_warning ("XID collision, trouble ahead");
g_hash_table_insert (display_x11->xid_ht, xid, data);
}
@@ -65,11 +68,11 @@ _gdk_xid_table_remove (GdkDisplay *display,
XID xid)
{
GdkDisplayX11 *display_x11;
g_return_if_fail (GDK_IS_DISPLAY (display));
display_x11 = GDK_DISPLAY_X11 (display);
if (display_x11->xid_ht)
g_hash_table_remove (display_x11->xid_ht, &xid);
}

182
git.mk Normal file
View File

@@ -0,0 +1,182 @@
# git.mk
#
# Copyright 2009, Red Hat, Inc.
# Written by Behdad Esfahbod
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
#
# The canonical source for this file is pango/git.mk, or whereever the
# header of pango/git.mk suggests in the future.
#
# To use in your project, import this file in your git repo's toplevel,
# then do "make -f git.mk". This modifies all Makefile.am files in
# your project to include git.mk.
#
# This enables automatic .gitignore generation. If you need to ignore
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
# But think twice before doing that. If a file has to be in .gitignore,
# chances are very high that it's a generated file and should be in one
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
#
# The only case that you need to manually add a file to GITIGNOREFILES is
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
# or maintainer-clean-local.
#
# Note that for files like editor backup, etc, there are better places to
# ignore them. See "man gitignore".
#
# If "make maintainer-clean" removes the files but they are not recognized
# by this script (that is, if "git status" shows untracked files still), send
# me the output of "git status" as well as your Makefile.am and Makefile for
# the directories involved.
#
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
# pango/Makefile.am.
#
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
# not tarballs. It serves no useful purpose in tarballs and clutters the
# build dir.
#
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
# gnome-doc-utils, intltool.
#
#
# KNOWN ISSUES:
#
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
# submodule doesn't find us. If you have configure.{in,ac} files in
# subdirs, add a proxy git.mk file in those dirs that simply does:
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
# And add those files to git. See vte/gnome-pty-helper/git.mk for
# example.
#
git-all: git-mk-install
git-mk-install:
@echo Installing git makefile
@any_failed=; find $(top_srcdir) -name Makefile.am | while read x; do \
if grep 'include .*/git.mk' $$x >/dev/null; then \
echo $$x already includes git.mk; \
else \
failed=; \
echo "Updating $$x"; \
{ cat $$x; \
echo ''; \
echo '-include $$(top_srcdir)/git.mk'; \
} > $$x.tmp || failed=1; \
if test x$$failed = x; then \
mv $$x.tmp $$x || failed=1; \
fi; \
if test x$$failed = x; then : else \
echo Failed updating $$x; >&2 \
any_failed=1; \
fi; \
fi; done; test -z "$$any_failed"
.PHONY: git-all git-mk-install
### .gitignore generation
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
@echo Generating $@; \
{ \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
for x in \
$(DOC_MODULE)-decl-list.txt \
$(DOC_MODULE)-decl.txt \
tmpl/$(DOC_MODULE)-unused.sgml \
"tmpl/*.bak" \
xml html \
; do echo /$$x; done; \
fi; \
if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
for x in \
$(_DOC_C_DOCS) \
$(_DOC_LC_DOCS) \
$(_DOC_OMF_ALL) \
$(_DOC_DSK_ALL) \
$(_DOC_HTML_ALL) \
$(_DOC_POFILES) \
"*/.xml2po.mo" \
"*/*.omf.out" \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/po/Makefile.in.in; then \
for x in \
po/Makefile.in.in \
po/Makefile.in \
po/Makefile \
po/POTFILES \
po/stamp-it \
po/.intltool-merge-cache \
"po/*.gmo" \
"po/*.mo" \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
; do echo /$$x; done; \
fi; \
if test -f $(srcdir)/configure; then \
for x in \
autom4te.cache \
configure \
config.h \
stamp-h1 \
libtool \
config.lt \
; do echo /$$x; done; \
fi; \
for x in \
.gitignore \
$(GITIGNOREFILES) \
$(CLEANFILES) \
$(PROGRAMS) \
$(EXTRA_PROGRAMS) \
$(LTLIBRARIES) \
so_locations \
.libs _libs \
$(MOSTLYCLEANFILES) \
"*.$(OBJEXT)" \
"*.lo" \
$(DISTCLEANFILES) \
$(am__CONFIG_DISTCLEAN_FILES) \
$(CONFIG_CLEAN_FILES) \
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
"*.tab.c" \
$(MAINTAINERCLEANFILES) \
$(BUILT_SOURCES) \
$(DEPDIR) \
Makefile \
Makefile.in \
"*.orig" \
"*.rej" \
"*.bak" \
"*~" \
".*.sw[nop]" \
; do echo /$$x; done; \
} | \
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
sed 's@/[.]/@/@g' | \
LANG=C sort | uniq > $@.tmp && \
mv $@.tmp $@;
all: $(srcdir)/.gitignore gitignore-recurse-maybe
gitignore-recurse-maybe:
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
fi;
gitignore-recurse:
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse); \
done
gitignore: $(srcdir)/.gitignore gitignore-recurse
maintainer-clean: gitignore-clean
gitignore-clean:
-rm -f $(srcdir)/.gitignore
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe

View File

@@ -10,11 +10,19 @@ endif
SUBDIRS = theme-bits . tests
DIST_SUBDIRS=theme-bits tests
if HAVE_PAPI_CUPS
GTK_PRINT_BACKENDS=file,papi,cups
else
if HAVE_CUPS
GTK_PRINT_BACKENDS=file,cups
else
if HAVE_PAPI
GTK_PRINT_BACKENDS=file,papi
else
GTK_PRINT_BACKENDS=file,lpr
endif
endif
endif
INCLUDES = \
-DG_LOG_DOMAIN=\"Gtk\" \
@@ -222,6 +230,7 @@ gtk_public_h_sources = \
gtkimcontextsimple.h \
gtkimmodule.h \
gtkimmulticontext.h \
gtkinfobar.h \
gtkinputdialog.h \
gtkinvisible.h \
gtkitem.h \
@@ -276,6 +285,7 @@ gtk_public_h_sources = \
gtkseparatortoolitem.h \
gtkshow.h \
gtksettings.h \
gtksize.h \
gtksizegroup.h \
gtksocket.h \
gtkspinbutton.h \
@@ -478,6 +488,7 @@ gtk_base_c_sources = \
gtkimcontextsimple.c \
gtkimmodule.c \
gtkimmulticontext.c \
gtkinfobar.c \
gtkinputdialog.c \
gtkinvisible.c \
gtkitem.c \
@@ -539,6 +550,7 @@ gtk_base_c_sources = \
gtkseparatormenuitem.c \
gtkseparatortoolitem.c \
gtksettings.c \
gtksize.c \
gtksizegroup.c \
gtkshow.c \
gtksocket.c \
@@ -778,7 +790,7 @@ gtk_extra_sources = \
#
# setup GTK+ sources and their dependencies
#
MAINTAINERCLEANFILES = $(gtk_built_sources) $(stamp_files) $(GENERATED_ICONS)
MAINTAINERCLEANFILES = $(gtk_built_sources) $(stamp_files) $(GENERATED_ICONS) stock-icons/icon-theme.cache
EXTRA_HEADERS =
EXTRA_DIST += $(gtk_private_h_sources) $(gtk_extra_sources)
EXTRA_DIST += $(gtk_built_sources)
@@ -1286,3 +1298,5 @@ EXTRA_DIST += \
install-data-local:
-include $(top_srcdir)/git.mk

View File

@@ -110,6 +110,7 @@
#include <gtk/gtkimcontext.h>
#include <gtk/gtkimcontextsimple.h>
#include <gtk/gtkimmulticontext.h>
#include <gtk/gtkinfobar.h>
#include <gtk/gtkinputdialog.h>
#include <gtk/gtkinvisible.h>
#include <gtk/gtkitem.h>
@@ -163,6 +164,7 @@
#include <gtk/gtkseparatortoolitem.h>
#include <gtk/gtksettings.h>
#include <gtk/gtkshow.h>
#include <gtk/gtksize.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksocket.h>
#include <gtk/gtkspinbutton.h>

View File

@@ -266,6 +266,7 @@ gtk_adjustment_value_changed
#if IN_HEADER(__GTK_ALIGNMENT_H__)
#if IN_FILE(__GTK_ALIGNMENT_C__)
gtk_alignment_get_padding
gtk_alignment_get_padding_unit
gtk_alignment_get_type G_GNUC_CONST
gtk_alignment_new
gtk_alignment_set
@@ -470,6 +471,7 @@ gtk_bin_get_type G_GNUC_CONST
#if IN_FILE(__GTK_BOX_C__)
gtk_box_get_homogeneous
gtk_box_get_spacing
gtk_box_get_spacing_unit
gtk_box_get_type G_GNUC_CONST
gtk_box_pack_end
gtk_box_pack_start
@@ -478,6 +480,7 @@ gtk_box_pack_end_defaults
gtk_box_pack_start_defaults
#endif
gtk_box_query_child_packing
gtk_box_query_child_packing_unit
gtk_box_reorder_child
gtk_box_set_child_packing
gtk_box_set_homogeneous
@@ -625,12 +628,16 @@ gtk_cell_renderer_activate
gtk_cell_renderer_editing_canceled
#endif
gtk_cell_renderer_get_fixed_size
gtk_cell_renderer_get_fixed_size_unit
gtk_cell_renderer_get_size
gtk_cell_renderer_get_size_unit
gtk_cell_renderer_get_type G_GNUC_CONST
gtk_cell_renderer_render
gtk_cell_renderer_set_fixed_size
gtk_cell_renderer_start_editing
gtk_cell_renderer_stop_editing
gtk_cell_renderer_get_tree_view_column
gtk_cell_renderer_get_tree_view
#endif
#endif
@@ -690,7 +697,9 @@ gtk_cell_renderer_toggle_set_radio
#if IN_HEADER(__GTK_CELL_VIEW_H__)
#if IN_FILE(__GTK_CELL_VIEW_C__)
#ifndef GTK_DISABLE_DEPRECATED
gtk_cell_view_get_cell_renderers
#endif
gtk_cell_view_get_displayed_row
gtk_cell_view_get_model
gtk_cell_view_get_size_of_row
@@ -1006,6 +1015,7 @@ gtk_container_set_focus_vadjustment
gtk_container_set_reallocate_redraws
gtk_container_set_resize_mode
gtk_container_unset_focus_chain
gtk_container_get_border_width_unit
#endif
#endif
@@ -1432,6 +1442,7 @@ gtk_expander_get_expanded
gtk_expander_get_label
gtk_expander_get_label_widget
gtk_expander_get_spacing
gtk_expander_get_spacing_unit
gtk_expander_get_type G_GNUC_CONST
gtk_expander_get_use_markup
gtk_expander_get_use_underline
@@ -1814,6 +1825,7 @@ gtk_hseparator_new
#if IN_FILE(__GTK_HSV_C__)
gtk_hsv_get_color
gtk_hsv_get_metrics
gtk_hsv_get_metrics_unit
gtk_hsv_get_type G_GNUC_CONST
gtk_hsv_is_adjusting
gtk_hsv_new
@@ -1836,7 +1848,10 @@ gtk_icon_factory_remove_default
gtk_icon_size_from_name
gtk_icon_size_get_name
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_set_add_source
@@ -1950,10 +1965,13 @@ gtk_icon_theme_set_search_path_utf8
#if IN_HEADER(__GTK_ICON_VIEW_H__)
#if IN_FILE(__GTK_ICON_VIEW_C__)
gtk_icon_view_get_column_spacing
gtk_icon_view_get_column_spacing_unit
gtk_icon_view_get_columns
gtk_icon_view_get_cursor
gtk_icon_view_get_item_width
gtk_icon_view_get_item_width_unit
gtk_icon_view_get_margin
gtk_icon_view_get_margin_unit
gtk_icon_view_get_markup_column
gtk_icon_view_get_model
gtk_icon_view_get_orientation
@@ -1962,9 +1980,11 @@ gtk_icon_view_get_item_at_pos
gtk_icon_view_convert_widget_to_bin_window_coords
gtk_icon_view_get_pixbuf_column
gtk_icon_view_get_row_spacing
gtk_icon_view_get_row_spacing_unit
gtk_icon_view_get_selected_items
gtk_icon_view_get_selection_mode
gtk_icon_view_get_spacing
gtk_icon_view_get_spacing_unit
gtk_icon_view_get_text_column
gtk_icon_view_get_type G_GNUC_CONST
gtk_icon_view_get_visible_range
@@ -2022,6 +2042,7 @@ gtk_image_get_icon_set
gtk_image_get_image
gtk_image_get_pixbuf
gtk_image_get_pixel_size
gtk_image_get_pixel_size_unit
gtk_image_get_pixmap
gtk_image_get_stock
gtk_image_get_gicon
@@ -2210,6 +2231,7 @@ gtk_label_set_text_with_mnemonic
gtk_label_set_use_markup
gtk_label_set_use_underline
gtk_label_set_width_chars
gtk_label_get_current_uri
#endif
#endif
@@ -2532,6 +2554,7 @@ gtk_message_dialog_get_image
#if IN_FILE(__GTK_MISC_C__)
gtk_misc_get_alignment
gtk_misc_get_padding
gtk_misc_get_padding_unit
gtk_misc_get_type G_GNUC_CONST
gtk_misc_set_alignment
gtk_misc_set_padding
@@ -2985,6 +3008,10 @@ gtk_print_operation_is_finished
gtk_print_operation_cancel
gtk_print_operation_draw_page_finish
gtk_print_operation_set_defer_drawing
gtk_print_operation_set_support_selection
gtk_print_operation_get_support_selection
gtk_print_operation_set_has_selection
gtk_print_operation_get_has_selection
#endif
#endif
@@ -3109,6 +3136,11 @@ 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_manual_capabilities
gtk_print_unix_dialog_get_manual_capabilities
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
#endif
#endif
#endif
@@ -3761,10 +3793,14 @@ gtk_stock_set_translate_func
gtk_table_attach
gtk_table_attach_defaults
gtk_table_get_col_spacing
gtk_table_get_col_spacing_unit
gtk_table_get_default_col_spacing
gtk_table_get_default_col_spacing_unit
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_type G_GNUC_CONST
gtk_table_new
gtk_table_resize
@@ -4112,18 +4148,24 @@ gtk_text_view_get_cursor_visible
gtk_text_view_get_default_attributes
gtk_text_view_get_editable
gtk_text_view_get_indent
gtk_text_view_get_indent_unit
gtk_text_view_get_iter_at_location
gtk_text_view_get_iter_at_position
gtk_text_view_get_iter_location
gtk_text_view_get_justification
gtk_text_view_get_left_margin
gtk_text_view_get_left_margin_unit
gtk_text_view_get_line_at_y
gtk_text_view_get_line_yrange
gtk_text_view_get_overwrite
gtk_text_view_get_pixels_above_lines
gtk_text_view_get_pixels_above_lines_unit
gtk_text_view_get_pixels_below_lines
gtk_text_view_get_pixels_below_lines_unit
gtk_text_view_get_pixels_inside_wrap
gtk_text_view_get_pixels_inside_wrap_unit
gtk_text_view_get_right_margin
gtk_text_view_get_right_margin_unit
gtk_text_view_get_tabs
gtk_text_view_get_type G_GNUC_CONST
gtk_text_view_get_visible_rect
@@ -4592,12 +4634,17 @@ gtk_tree_view_column_clear_attributes
gtk_tree_view_column_clicked
gtk_tree_view_column_focus_cell
gtk_tree_view_column_get_alignment
#ifndef GTK_DISABLE_DEPRECATED
gtk_tree_view_column_get_cell_renderers
#endif
gtk_tree_view_column_get_clickable
gtk_tree_view_column_get_expand
gtk_tree_view_column_get_fixed_width
gtk_tree_view_column_get_fixed_width_unit
gtk_tree_view_column_get_max_width
gtk_tree_view_column_get_max_width_unit
gtk_tree_view_column_get_min_width
gtk_tree_view_column_get_min_width_unit
gtk_tree_view_column_get_reorderable
gtk_tree_view_column_get_resizable
gtk_tree_view_column_get_sizing
@@ -4605,6 +4652,7 @@ gtk_tree_view_column_get_sort_column_id
gtk_tree_view_column_get_sort_indicator
gtk_tree_view_column_get_sort_order
gtk_tree_view_column_get_spacing
gtk_tree_view_column_get_spacing_unit
gtk_tree_view_column_get_title
gtk_tree_view_column_get_tree_view
gtk_tree_view_column_get_type G_GNUC_CONST
@@ -4673,6 +4721,7 @@ gtk_tree_view_get_headers_visible
gtk_tree_view_get_hover_expand
gtk_tree_view_get_hover_selection
gtk_tree_view_get_level_indentation
gtk_tree_view_get_level_indentation_unit
gtk_tree_view_get_model
gtk_tree_view_get_path_at_pos
gtk_tree_view_get_reorderable
@@ -5019,6 +5068,15 @@ gtk_widget_unmap
gtk_widget_unparent
gtk_widget_unrealize
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
#endif
#endif
@@ -5041,6 +5099,7 @@ gtk_window_get_default_widget
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_focus
gtk_window_get_focus_on_map
@@ -5143,6 +5202,7 @@ gtk_window_stick
gtk_window_unfullscreen
gtk_window_unmaximize
gtk_window_unstick
gtk_window_get_monitor_num
#endif
#endif
@@ -5154,6 +5214,48 @@ gtk_win32_embed_widget_get_type G_GNUC_CONST
#endif
#endif
#if IN_HEADER(__GTK_SIZE_H__)
#if IN_FILE(__GTK_SIZE_C__)
gtk_enable_resolution_independence
gtk_size_em
gtk_size_mm
gtk_size_get_unit
gtk_size_get_em
gtk_size_get_mm
gtk_size_to_pixel
gtk_size_to_pixel_double
gtk_size_to_string
gtk_param_size_get_type G_GNUC_CONST
gtk_param_spec_size
gtk_value_set_size
gtk_value_get_size
gtk_value_size_skip_conversion
gtk_param_usize_get_type G_GNUC_CONST
gtk_param_spec_usize
gtk_value_set_usize
gtk_value_get_usize
gtk_value_usize_skip_conversion
#endif
#endif
#if IN_HEADER(__GTK_INFO_BAR_H__)
#if IN_FILE(__GTK_INFO_BAR_C__)
gtk_info_bar_get_type G_GNUC_CONST
gtk_info_bar_new
gtk_info_bar_new_with_buttons
gtk_info_bar_get_action_area
gtk_info_bar_get_content_area
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
#endif
#endif
#ifdef INCLUDE_VARIABLES
gtk_binary_age
gtk_interface_age

View File

@@ -489,15 +489,15 @@ gtk_about_dialog_init (GtkAboutDialog *about)
priv->wrap_license = FALSE;
gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
gtk_container_set_border_width (GTK_CONTAINER (dialog), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_set_spacing (GTK_BOX (dialog->vbox), GTK_SIZE_ONE_TWELFTH_EM (2)); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), GTK_SIZE_ONE_TWELFTH_EM (5));
/* Widgets */
gtk_widget_push_composite_child ();
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
vbox = gtk_vbox_new (FALSE, GTK_SIZE_ONE_TWELFTH_EM (8));
gtk_container_set_border_width (GTK_CONTAINER (vbox), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (dialog->vbox), vbox, TRUE, TRUE, 0);
priv->logo_image = gtk_image_new ();
@@ -2127,12 +2127,12 @@ display_credits_dialog (GtkWidget *button,
NULL);
credits_dialog = GTK_DIALOG (dialog);
gtk_dialog_set_has_separator (credits_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (credits_dialog), 5);
gtk_box_set_spacing (GTK_BOX (credits_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (credits_dialog->action_area), 5);
gtk_container_set_border_width (GTK_CONTAINER (credits_dialog), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_set_spacing (GTK_BOX (credits_dialog->vbox), GTK_SIZE_ONE_TWELFTH_EM (2)); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (credits_dialog->action_area), GTK_SIZE_ONE_TWELFTH_EM (5));
priv->credits_dialog = dialog;
gtk_window_set_default_size (GTK_WINDOW (dialog), 360, 260);
gtk_window_set_default_size (GTK_WINDOW (dialog), GTK_SIZE_ONE_TWELFTH_EM (360), GTK_SIZE_ONE_TWELFTH_EM (260));
gtk_dialog_set_default_response (credits_dialog, GTK_RESPONSE_CANCEL);
gtk_window_set_modal (GTK_WINDOW (dialog),
@@ -2145,7 +2145,7 @@ display_credits_dialog (GtkWidget *button,
&(priv->credits_dialog));
notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
gtk_container_set_border_width (GTK_CONTAINER (notebook), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0);
if (priv->authors != NULL)
@@ -2204,12 +2204,12 @@ display_license_dialog (GtkWidget *button,
NULL);
licence_dialog = GTK_DIALOG (dialog);
gtk_dialog_set_has_separator (licence_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (licence_dialog), 5);
gtk_box_set_spacing (GTK_BOX (licence_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (licence_dialog->action_area), 5);
gtk_container_set_border_width (GTK_CONTAINER (licence_dialog), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_box_set_spacing (GTK_BOX (licence_dialog->vbox), GTK_SIZE_ONE_TWELFTH_EM (2)); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (licence_dialog->action_area), GTK_SIZE_ONE_TWELFTH_EM (5));
priv->license_dialog = dialog;
gtk_window_set_default_size (GTK_WINDOW (dialog), 420, 320);
gtk_window_set_default_size (GTK_WINDOW (dialog), GTK_SIZE_ONE_TWELFTH_EM (420), GTK_SIZE_ONE_TWELFTH_EM (320));
gtk_dialog_set_default_response (licence_dialog, GTK_RESPONSE_CANCEL);
gtk_window_set_modal (GTK_WINDOW (dialog),
@@ -2222,7 +2222,7 @@ display_license_dialog (GtkWidget *button,
&(priv->license_dialog));
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (sw), 5);
gtk_container_set_border_width (GTK_CONTAINER (sw), GTK_SIZE_ONE_TWELFTH_EM (5));
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@@ -2303,7 +2303,7 @@ gtk_about_dialog_set_email_hook (GtkAboutDialogActivateLinkFunc func,
* Installs a global function to be called whenever the user activates a
* URL link in an about dialog.
*
* Since 2.18 here exists a default function which uses gtk_show_uri(). To
* Since 2.18 there exists a default function which uses gtk_show_uri(). To
* deactivate it, you can pass %NULL for @func.
*
* Return value: the previous URL hook.

View File

@@ -48,10 +48,10 @@ enum {
struct _GtkAlignmentPrivate
{
guint padding_top;
guint padding_bottom;
guint padding_left;
guint padding_right;
GtkUSize padding_top;
GtkUSize padding_bottom;
GtkUSize padding_left;
GtkUSize padding_right;
};
static void gtk_alignment_size_request (GtkWidget *widget,
@@ -132,13 +132,11 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
*/
g_object_class_install_property (gobject_class,
PROP_TOP_PADDING,
g_param_spec_uint("top-padding",
P_("Top Padding"),
P_("The padding to insert at the top of the widget."),
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
gtk_param_spec_usize("top-padding",
P_("Top Padding"),
P_("The padding to insert at the top of the widget."),
0, G_MAXINT, 0,
GTK_PARAM_READWRITE));
/**
* GtkAlignment:bottom-padding:
@@ -149,13 +147,11 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
*/
g_object_class_install_property (gobject_class,
PROP_BOTTOM_PADDING,
g_param_spec_uint("bottom-padding",
P_("Bottom Padding"),
P_("The padding to insert at the bottom of the widget."),
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
gtk_param_spec_usize("bottom-padding",
P_("Bottom Padding"),
P_("The padding to insert at the bottom of the widget."),
0, G_MAXINT, 0,
GTK_PARAM_READWRITE));
/**
* GtkAlignment:left-padding:
@@ -166,13 +162,11 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
*/
g_object_class_install_property (gobject_class,
PROP_LEFT_PADDING,
g_param_spec_uint("left-padding",
P_("Left Padding"),
P_("The padding to insert at the left of the widget."),
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
gtk_param_spec_usize("left-padding",
P_("Left Padding"),
P_("The padding to insert at the left of the widget."),
0, G_MAXINT, 0,
GTK_PARAM_READWRITE));
/**
* GtkAlignment:right-padding:
@@ -183,13 +177,11 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
*/
g_object_class_install_property (gobject_class,
PROP_RIGHT_PADDING,
g_param_spec_uint("right-padding",
P_("Right Padding"),
P_("The padding to insert at the right of the widget."),
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
gtk_param_spec_usize("right-padding",
P_("Right Padding"),
P_("The padding to insert at the right of the widget."),
0, G_MAXINT, 0,
GTK_PARAM_READWRITE));
g_type_class_add_private (gobject_class, sizeof (GtkAlignmentPrivate));
}
@@ -279,7 +271,7 @@ gtk_alignment_set_property (GObject *object,
/* Padding: */
case PROP_TOP_PADDING:
gtk_alignment_set_padding (alignment,
g_value_get_uint (value),
gtk_value_get_usize (value),
priv->padding_bottom,
priv->padding_left,
priv->padding_right);
@@ -287,7 +279,7 @@ gtk_alignment_set_property (GObject *object,
case PROP_BOTTOM_PADDING:
gtk_alignment_set_padding (alignment,
priv->padding_top,
g_value_get_uint (value),
gtk_value_get_usize (value),
priv->padding_left,
priv->padding_right);
break;
@@ -295,7 +287,7 @@ gtk_alignment_set_property (GObject *object,
gtk_alignment_set_padding (alignment,
priv->padding_top,
priv->padding_bottom,
g_value_get_uint (value),
gtk_value_get_usize (value),
priv->padding_right);
break;
case PROP_RIGHT_PADDING:
@@ -303,7 +295,7 @@ gtk_alignment_set_property (GObject *object,
priv->padding_top,
priv->padding_bottom,
priv->padding_left,
g_value_get_uint (value));
gtk_value_get_usize (value));
break;
default:
@@ -341,16 +333,16 @@ gtk_alignment_get_property (GObject *object,
/* Padding: */
case PROP_TOP_PADDING:
g_value_set_uint (value, priv->padding_top);
gtk_value_set_usize (value, priv->padding_top, alignment);
break;
case PROP_BOTTOM_PADDING:
g_value_set_uint (value, priv->padding_bottom);
gtk_value_set_usize (value, priv->padding_bottom, alignment);
break;
case PROP_LEFT_PADDING:
g_value_set_uint (value, priv->padding_left);
gtk_value_set_usize (value, priv->padding_left, alignment);
break;
case PROP_RIGHT_PADDING:
g_value_set_uint (value, priv->padding_right);
gtk_value_set_usize (value, priv->padding_right, alignment);
break;
default:
@@ -431,8 +423,8 @@ gtk_alignment_size_request (GtkWidget *widget,
requisition->height += child_requisition.height;
/* Request extra space for the padding: */
requisition->width += (priv->padding_left + priv->padding_right);
requisition->height += (priv->padding_top + priv->padding_bottom);
requisition->width += (gtk_widget_size_to_pixel (widget, priv->padding_left) + gtk_widget_size_to_pixel (widget, priv->padding_right));
requisition->height += (gtk_widget_size_to_pixel (widget, priv->padding_top) + gtk_widget_size_to_pixel (widget, priv->padding_bottom));
}
}
@@ -463,8 +455,8 @@ gtk_alignment_size_allocate (GtkWidget *widget,
border_width = GTK_CONTAINER (alignment)->border_width;
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
padding_horizontal = priv->padding_left + priv->padding_right;
padding_vertical = priv->padding_top + priv->padding_bottom;
padding_horizontal = gtk_widget_size_to_pixel (widget, priv->padding_left) + gtk_widget_size_to_pixel (widget, priv->padding_right);
padding_vertical = gtk_widget_size_to_pixel (widget, priv->padding_top) + gtk_widget_size_to_pixel (widget, priv->padding_bottom);
width = MAX (1, allocation->width - padding_horizontal - 2 * border_width);
height = MAX (1, allocation->height - padding_vertical - 2 * border_width);
@@ -484,11 +476,11 @@ gtk_alignment_size_allocate (GtkWidget *widget,
child_allocation.height = height;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
child_allocation.x = (1.0 - alignment->xalign) * (width - child_allocation.width) + allocation->x + border_width + priv->padding_right;
child_allocation.x = (1.0 - alignment->xalign) * (width - child_allocation.width) + allocation->x + border_width + gtk_widget_size_to_pixel (widget, priv->padding_right);
else
child_allocation.x = alignment->xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left;
child_allocation.x = alignment->xalign * (width - child_allocation.width) + allocation->x + border_width + gtk_widget_size_to_pixel (widget, priv->padding_left);
child_allocation.y = alignment->yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top;
child_allocation.y = alignment->yalign * (height - child_allocation.height) + allocation->y + border_width + gtk_widget_size_to_pixel (widget, priv->padding_top);
gtk_widget_size_allocate (bin->child, &child_allocation);
}
@@ -511,10 +503,10 @@ gtk_alignment_size_allocate (GtkWidget *widget,
*/
void
gtk_alignment_set_padding (GtkAlignment *alignment,
guint padding_top,
guint padding_bottom,
guint padding_left,
guint padding_right)
GtkUSize padding_top,
GtkUSize padding_bottom,
GtkUSize padding_left,
GtkUSize padding_right)
{
GtkAlignmentPrivate *priv;
@@ -562,8 +554,9 @@ gtk_alignment_set_padding (GtkAlignment *alignment,
* @padding_left: location to store the padding for the left of the widget, or %NULL
* @padding_right: location to store the padding for the right of the widget, or %NULL
*
* Gets the padding on the different sides of the widget.
* See gtk_alignment_set_padding ().
* Gets the padding in pixels on the different sides of the widget.
* See gtk_alignment_set_padding (). Use gtk_alignment_get_padding_unit() to
* preserve units.
*
* Since: 2.4
*/
@@ -578,6 +571,40 @@ gtk_alignment_get_padding (GtkAlignment *alignment,
g_return_if_fail (GTK_IS_ALIGNMENT (alignment));
priv = GTK_ALIGNMENT_GET_PRIVATE (alignment);
if(padding_top)
*padding_top = gtk_widget_size_to_pixel (alignment, priv->padding_top);
if(padding_bottom)
*padding_bottom = gtk_widget_size_to_pixel (alignment, priv->padding_bottom);
if(padding_left)
*padding_left = gtk_widget_size_to_pixel (alignment, priv->padding_left);
if(padding_right)
*padding_right = gtk_widget_size_to_pixel (alignment, priv->padding_right);
}
/**
* gtk_alignment_get_padding_unit:
* @alignment: a #GtkAlignment
* @padding_top: location to store the padding for the top of the widget, or %NULL
* @padding_bottom: location to store the padding for the bottom of the widget, or %NULL
* @padding_left: location to store the padding for the left of the widget, or %NULL
* @padding_right: location to store the padding for the right of the widget, or %NULL
*
* Like gtk_alignment_get_padding() but preserves the unit.
*
* Since: RIMERGE
*/
void
gtk_alignment_get_padding_unit (GtkAlignment *alignment,
GtkUSize *padding_top,
GtkUSize *padding_bottom,
GtkUSize *padding_left,
GtkUSize *padding_right)
{
GtkAlignmentPrivate *priv;
g_return_if_fail (GTK_IS_ALIGNMENT (alignment));
priv = GTK_ALIGNMENT_GET_PRIVATE (alignment);
if(padding_top)
*padding_top = priv->padding_top;

View File

@@ -77,10 +77,10 @@ void gtk_alignment_set (GtkAlignment *alignment,
gfloat yscale);
void gtk_alignment_set_padding (GtkAlignment *alignment,
guint padding_top,
guint padding_bottom,
guint padding_left,
guint padding_right);
GtkUSize padding_top,
GtkUSize padding_bottom,
GtkUSize padding_left,
GtkUSize padding_right);
void gtk_alignment_get_padding (GtkAlignment *alignment,
guint *padding_top,
@@ -88,6 +88,12 @@ void gtk_alignment_get_padding (GtkAlignment *alignment,
guint *padding_left,
guint *padding_right);
void gtk_alignment_get_padding_unit (GtkAlignment *alignment,
GtkUSize *padding_top,
GtkUSize *padding_bottom,
GtkUSize *padding_left,
GtkUSize *padding_right);
G_END_DECLS

View File

@@ -31,7 +31,7 @@
#include "gtkintl.h"
#include "gtkalias.h"
#define MIN_ARROW_SIZE 15
#define MIN_ARROW_SIZE GTK_SIZE_ONE_TWELFTH_EM(15)
enum {
PROP_0,
@@ -50,7 +50,8 @@ static void gtk_arrow_get_property (GObject *object,
GParamSpec *pspec);
static gboolean gtk_arrow_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_arrow_size_request (GtkWidget *widget,
GtkRequisition *requisition);
G_DEFINE_TYPE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
@@ -68,6 +69,7 @@ gtk_arrow_class_init (GtkArrowClass *class)
gobject_class->get_property = gtk_arrow_get_property;
widget_class->expose_event = gtk_arrow_expose;
widget_class->size_request = gtk_arrow_size_request;
g_object_class_install_property (gobject_class,
PROP_ARROW_TYPE,
@@ -148,9 +150,6 @@ gtk_arrow_init (GtkArrow *arrow)
{
GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
arrow->arrow_type = GTK_ARROW_RIGHT;
arrow->shadow_type = GTK_SHADOW_OUT;
}
@@ -200,6 +199,14 @@ gtk_arrow_set (GtkArrow *arrow,
}
}
static void
gtk_arrow_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkArrow *arrow = GTK_ARROW (widget);
requisition->width = gtk_widget_size_to_pixel (arrow, MIN_ARROW_SIZE) + GTK_MISC (arrow)->xpad * 2;
requisition->height = gtk_widget_size_to_pixel (arrow, MIN_ARROW_SIZE) + GTK_MISC (arrow)->ypad * 2;
}
static gboolean
gtk_arrow_expose (GtkWidget *widget,

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