Compare commits
352 Commits
filesystem
...
GTK_2_8_10
Author | SHA1 | Date | |
---|---|---|---|
|
8f34c4566a | ||
|
1694f20422 | ||
|
610e9628e0 | ||
|
9bddf4d83b | ||
|
90c910e244 | ||
|
7aeb1bb515 | ||
|
98179253db | ||
|
1583ef9c21 | ||
|
445bee04e3 | ||
|
4a784ff2f9 | ||
|
cc346bfdb4 | ||
|
a3e8e32299 | ||
|
9ddec60c3a | ||
|
42edcf8a77 | ||
|
a9be5ddf14 | ||
|
826ee8cf39 | ||
|
1a51d66459 | ||
|
01cc3a42ca | ||
|
a0ae4d95fd | ||
|
de25ca5ebc | ||
|
11a1ada618 | ||
|
91c83ea4f0 | ||
|
fdbf1f36a5 | ||
|
41b718b24d | ||
|
01c32828f0 | ||
|
aa79f10539 | ||
|
5acd528ee6 | ||
|
e1e6c7ddf1 | ||
|
7a33528133 | ||
|
5a3c267b79 | ||
|
dad73781b7 | ||
|
3750d5da6b | ||
|
280769a542 | ||
|
bd3c206d76 | ||
|
147d53a883 | ||
|
05abc38a5c | ||
|
38a4720d7a | ||
|
29f78aaaa2 | ||
|
cd7dee798b | ||
|
80732f59bf | ||
|
ea7f2b23d0 | ||
|
4bdac8d5fb | ||
|
5176fa307f | ||
|
b0b106dbe0 | ||
|
0979f16b36 | ||
|
0de720551c | ||
|
8c877d6688 | ||
|
2d5b575ea0 | ||
|
5cfa6eece0 | ||
|
077d0fe81f | ||
|
d564a49fc2 | ||
|
da3d56fc1a | ||
|
928a0da8d2 | ||
|
4e40304798 | ||
|
2da547c535 | ||
|
7881702108 | ||
|
31fe7a4f10 | ||
|
5a6c501d30 | ||
|
5b8d9bfc84 | ||
|
fc5a193edf | ||
|
ee9f3aed90 | ||
|
e0e19dd998 | ||
|
9eb8b2af91 | ||
|
e0ee2c256f | ||
|
c3624ad401 | ||
|
dca0fb1fa2 | ||
|
d70a7476cd | ||
|
f1e45e5fc2 | ||
|
05c3415a5b | ||
|
0aebad6b4b | ||
|
37fd53219d | ||
|
869351ad8a | ||
|
0ba88e0fb0 | ||
|
61b892d23e | ||
|
3584677939 | ||
|
b7b750b05b | ||
|
e6a5410fb5 | ||
|
241fd6dda6 | ||
|
34e5c8510c | ||
|
3fac9f99fc | ||
|
7b799ca14d | ||
|
fb3555ebd6 | ||
|
be436ea53f | ||
|
afd5ed8095 | ||
|
13ed5fef8d | ||
|
0d4a99ded5 | ||
|
02cadc9196 | ||
|
e608c86f0e | ||
|
bca63a5d33 | ||
|
7207dfbc0b | ||
|
de18baa285 | ||
|
431a722cb4 | ||
|
f335d53a02 | ||
|
d302080656 | ||
|
baa523023c | ||
|
0c0fdf8b28 | ||
|
5aeb56f131 | ||
|
b8d74ef097 | ||
|
f30b10304b | ||
|
a37fe60d98 | ||
|
b4ad37ae12 | ||
|
4722decd6e | ||
|
6eda5e1af1 | ||
|
902c39b5f0 | ||
|
8e09a1bb42 | ||
|
774619c619 | ||
|
6808084c98 | ||
|
0f99673e3c | ||
|
fda53249fb | ||
|
2ee022a9b8 | ||
|
1d12b20ec0 | ||
|
5f53d6068b | ||
|
e5f4c9cb68 | ||
|
f692b06467 | ||
|
b2d939f980 | ||
|
12064bf08a | ||
|
b46e6f72c2 | ||
|
e2c897c6b2 | ||
|
34e15cf5e4 | ||
|
e74d5138da | ||
|
f03ee0eae7 | ||
|
21b6ed0024 | ||
|
f0470f324f | ||
|
a513619a93 | ||
|
a7c6f4b12f | ||
|
cb6fc02331 | ||
|
b12b6a1c0c | ||
|
35f2ae1b04 | ||
|
caf17bae51 | ||
|
4e83fe3789 | ||
|
e25fac892f | ||
|
d3558f7ed0 | ||
|
03928c314d | ||
|
0c1868687b | ||
|
dfe3abc6bb | ||
|
592d066f47 | ||
|
96469e5c58 | ||
|
a60f34aa64 | ||
|
7c559c84bd | ||
|
6659bc7689 | ||
|
856280b3a2 | ||
|
9ea1a43096 | ||
|
4b2738a1f9 | ||
|
76f0399c32 | ||
|
35da76eb76 | ||
|
e2db438a36 | ||
|
b3a1c4cdb7 | ||
|
fa490ed236 | ||
|
828f8f1790 | ||
|
9e33d2fdb2 | ||
|
9a48d49800 | ||
|
ef3d6268cb | ||
|
18c9a83f6a | ||
|
6c34731239 | ||
|
a30defcfb7 | ||
|
1cc736c580 | ||
|
a7b56ed43a | ||
|
0c5a240d95 | ||
|
7bff1ab7f1 | ||
|
5e70dc2195 | ||
|
d4dd35cc91 | ||
|
a0dd1f6422 | ||
|
d25d08df51 | ||
|
60a234502d | ||
|
4aebc900bf | ||
|
a57007f3dc | ||
|
3e2b7e6e73 | ||
|
1e5c150247 | ||
|
29a894798f | ||
|
fe44a57d85 | ||
|
8fbbb83346 | ||
|
16ce403888 | ||
|
458838db34 | ||
|
d3600de92b | ||
|
4e8c9fd5f8 | ||
|
b57b98d90a | ||
|
93e373f0b4 | ||
|
38cdac231c | ||
|
14355e7c80 | ||
|
012d8d6db4 | ||
|
1df7de983e | ||
|
141e5c5822 | ||
|
a74a80316c | ||
|
3c1fc24f61 | ||
|
72ccf58edd | ||
|
e127a96aec | ||
|
ea9d754c98 | ||
|
0e041a4ec8 | ||
|
08575ff7da | ||
|
82e6e840eb | ||
|
e71e55d9a4 | ||
|
0f7f6be8e9 | ||
|
0339de7d61 | ||
|
24fec1aa10 | ||
|
b4f7784a84 | ||
|
ea93a69ab0 | ||
|
b9200e9fc5 | ||
|
6562773a5a | ||
|
f5562e56e0 | ||
|
5480e6df2f | ||
|
e34eab22da | ||
|
1caa77bff2 | ||
|
f6acde711b | ||
|
ad8b4aa0a3 | ||
|
1cd1200389 | ||
|
52d4111e05 | ||
|
029c0c57fb | ||
|
b14bb6fab7 | ||
|
2765a5dc29 | ||
|
69f8c2e191 | ||
|
fdf7779855 | ||
|
8336011a85 | ||
|
5c99c4191d | ||
|
af408222c8 | ||
|
d4cc6b28e3 | ||
|
3b055b39f2 | ||
|
3c7e718b50 | ||
|
61d98323eb | ||
|
f681b064bf | ||
|
85b1a31c26 | ||
|
1f8e9d3940 | ||
|
8bca0c3613 | ||
|
38ed5b667b | ||
|
cd718e6e36 | ||
|
f1585b7a71 | ||
|
49cbd0eed8 | ||
|
f6fbddcfe9 | ||
|
2c3c209251 | ||
|
298c435472 | ||
|
730f0f6f3c | ||
|
4fc5f91b8b | ||
|
61a352d098 | ||
|
283bfba565 | ||
|
45029c6757 | ||
|
3dac77f834 | ||
|
4f17bf78b3 | ||
|
d11badd3e7 | ||
|
55a7c31665 | ||
|
8d0574f9cf | ||
|
2216c39e7b | ||
|
d28b8f4088 | ||
|
fd5394784a | ||
|
eed718e4e6 | ||
|
db1593b8be | ||
|
9f3677418b | ||
|
9c4dd6ae2d | ||
|
46136af6dc | ||
|
96d8e1a1bf | ||
|
68e7f35d09 | ||
|
e85e700956 | ||
|
115784bb38 | ||
|
d097228c65 | ||
|
e5a2f7918b | ||
|
75732772a8 | ||
|
baace30f74 | ||
|
ab468d6f14 | ||
|
25715c3e29 | ||
|
88de2b3ec7 | ||
|
ca488d49a1 | ||
|
a7f47a40cf | ||
|
e735139d68 | ||
|
b3aa6a8cac | ||
|
8fb41e93d3 | ||
|
1b7d3176f5 | ||
|
596dbc3ce8 | ||
|
cd90db1183 | ||
|
897cf3b056 | ||
|
099eec9a9f | ||
|
834e201312 | ||
|
3504894d6e | ||
|
0d74b72f3e | ||
|
8ef635d70f | ||
|
1cfa260e5f | ||
|
9fe8aa7720 | ||
|
2a0d8d75d6 | ||
|
77ddd7a36c | ||
|
10e0f1987d | ||
|
8c4c96adc7 | ||
|
61011d78f4 | ||
|
59bfd418f8 | ||
|
76759f3410 | ||
|
74da02e12e | ||
|
e4c92bc39d | ||
|
bd3c57680e | ||
|
e02da6db6e | ||
|
18f28738c3 | ||
|
44a2993b28 | ||
|
d479089f90 | ||
|
6648dc472c | ||
|
22ee9e6c58 | ||
|
d18a438c0c | ||
|
878c63a65f | ||
|
51c6946dfb | ||
|
bd327b904e | ||
|
922f4b758d | ||
|
10b0e1f552 | ||
|
477dc904aa | ||
|
afb3753cee | ||
|
2220844829 | ||
|
b308f4bb7f | ||
|
dd82bb711d | ||
|
8e4ed16d9d | ||
|
7d5a80c6e6 | ||
|
3ddd8080e4 | ||
|
18f9b50665 | ||
|
b3549a7813 | ||
|
73060c73fa | ||
|
3500552ac9 | ||
|
4e0391e73f | ||
|
e2573ade4f | ||
|
01635ceb4b | ||
|
d64ae9b682 | ||
|
b45279ee5b | ||
|
b199e7e7de | ||
|
38aec4a63e | ||
|
9dfc161c87 | ||
|
1c705dd477 | ||
|
c9e6506fa0 | ||
|
be1977f4ea | ||
|
7e6a27464a | ||
|
fd065333eb | ||
|
3d74f1d64b | ||
|
17267663ad | ||
|
48817f35e3 | ||
|
6823afb03d | ||
|
3d52e58cdd | ||
|
f16215fd66 | ||
|
1d1b02b9a4 | ||
|
9d6836145a | ||
|
3ed761f3ba | ||
|
20816d91eb | ||
|
47daaa2e88 | ||
|
bd60a8f839 | ||
|
767cd6abd9 | ||
|
045b188be0 | ||
|
84db15f503 | ||
|
2feb926544 | ||
|
a915d5b34d | ||
|
017eceaad2 | ||
|
15a7fbbb12 | ||
|
b9e87239a8 | ||
|
a37a5febe8 | ||
|
50221cc0ea | ||
|
c8c087e2fe | ||
|
4586870479 | ||
|
1dd674cfbb | ||
|
86c3f0ed56 | ||
|
b33b49d6fb | ||
|
3c0ca31948 | ||
|
70bce53b8e | ||
|
ebc47dba8d | ||
|
1cfd18662b |
37
.cvsignore
Normal file
37
.cvsignore
Normal file
@@ -0,0 +1,37 @@
|
||||
*.lo
|
||||
config.log
|
||||
config.h
|
||||
config.h.in
|
||||
libtool
|
||||
config.status
|
||||
stamp-h
|
||||
stamp-h1
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
configure
|
||||
config.h.win32
|
||||
gtk-config-2.0
|
||||
config.cache
|
||||
ABOUT-NLS
|
||||
intl
|
||||
stamp-h.in
|
||||
gtk+.spec
|
||||
gtk+-2.0.pc
|
||||
gtk+-2.0-uninstalled.pc
|
||||
gtk+-linux-fb-2.0.pc
|
||||
gtk+-nanox-2.0.pc
|
||||
gtk+-x11-2.0.pc
|
||||
gdk-2.0.pc
|
||||
gdk-2.0-uninstalled.pc
|
||||
gdk-linux-fb-2.0.pc
|
||||
gdk-nanox-2.0.pc
|
||||
gdk-x11-2.0.pc
|
||||
gdk-pixbuf-2.0.pc
|
||||
gdk-pixbuf-2.0-uninstalled.pc
|
||||
gtk-zip.sh
|
||||
missing
|
||||
install-sh
|
||||
mkinstalldirs
|
||||
sgml
|
||||
autom4te.cache
|
20
AUTHORS
20
AUTHORS
@@ -1,12 +1,12 @@
|
||||
Please do not mail any of the authors listed here
|
||||
asking questions about this version of GTK+.
|
||||
|
||||
Original Authors
|
||||
----------------
|
||||
Peter Mattis <petm@xcf.berkeley.edu>
|
||||
Spencer Kimball <spencer@xcf.berkeley.edu>
|
||||
Josh MacDonald <jmacd@xcf.berkeley.edu>
|
||||
|
||||
Please do not mail the original authors asking questions about this
|
||||
version of GTK+.
|
||||
|
||||
The GTK+ Team (in alphabetical order)
|
||||
-------------------------------------
|
||||
Shawn T. Amundson <amundson@gtk.org>
|
||||
@@ -32,7 +32,7 @@ There are many others who have contributed patches; we thank them,
|
||||
GTK+ is much better because of them.
|
||||
|
||||
|
||||
Over time, GTK+ has incorporated some pieces of software which
|
||||
Over time, TK+ has incorporated some pieces of software which
|
||||
started as independent projects. We list the original authors here:
|
||||
|
||||
|
||||
@@ -51,15 +51,3 @@ IME input method
|
||||
----------------
|
||||
Takuro Ashie
|
||||
Kazuki IWAMOTO
|
||||
|
||||
|
||||
Mac OS X backend
|
||||
----------------
|
||||
Anders Carlsson
|
||||
|
||||
|
||||
DirectFB backend
|
||||
----------------
|
||||
Denis Oliver Kropp
|
||||
Sven Neumann
|
||||
Mike Emmel
|
||||
|
@@ -1,514 +0,0 @@
|
||||
2006-04-30 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.[ch] (gtk_file_info_render_icon): remove the
|
||||
caching code,
|
||||
(gtk_file_info_get_icon_name): new function,
|
||||
(gtk_file_system_volume_get_icon_name): new function,
|
||||
(gtk_file_system_volume_render_icon): refactor to use
|
||||
get_icon_name() and render the icon on the fly.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_render_icon),
|
||||
(gtk_file_system_unix_volume_get_icon_name): reflect updates in
|
||||
file system interface,
|
||||
(get_fallback_icon): remove, along with icon caching code.
|
||||
|
||||
* gtk/gtk.symbols: updated.
|
||||
|
||||
2006-04-30 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (got_root_folder_cb), (ref_path_cb),
|
||||
(get_children_get_folder_cb): don't leak the handle,
|
||||
(got_root_folder_cb), (get_children_get_folder_cb): emit
|
||||
row-inserted for the newly added nodes.
|
||||
|
||||
2006-04-30 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (file_list_drag_data_select_uris),
|
||||
(file_list_drag_data_received_get_info_cb),
|
||||
(file_list_drag_data_received_cb): refactor code for selecting
|
||||
multiple uris into file_list_drag_data_select_uris().
|
||||
|
||||
2006-04-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (dnd_select_folder_get_info_cb): don't
|
||||
leak handle,
|
||||
(change_icon_theme_get_info_cb), (set_info_get_info_cb),
|
||||
(model_add_special_get_info_cb), (update_label_get_info_cb): ditto.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (shortcuts_reload_icons_get_info_cb):
|
||||
don't leak the handle,
|
||||
(get_file_info_finished), (edited_idle_create_folder_cb),
|
||||
(file_list_drag_data_received_get_info_cb),
|
||||
(show_and_select_paths_get_folder_cb),
|
||||
(update_current_folder_get_info_cb), (add_shortcut_get_info_cb),
|
||||
(confirmation_confirm_get_info_cb), (action_create_folder_cb),
|
||||
(save_entry_get_info_cb), (shortcuts_activate_volume_mount_cb),
|
||||
(shortcuts_activate_get_info_cb), (update_from_entry_get_info_cb):
|
||||
ditto.
|
||||
|
||||
* gtk/gtkfilechooserentry.c (load_directory_get_folder_callback):
|
||||
don't leak the handle.
|
||||
|
||||
* gtk/gtkpathbar.c (set_button_image_get_info_cb),
|
||||
(gtk_path_bar_get_info_callback): don't leak the handle.
|
||||
|
||||
2006-04-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
Review.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (shortcuts_reload_icons_get_info_cb):
|
||||
don't forget to unref data->impl at the end.
|
||||
|
||||
2006-04-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
Review, continued.
|
||||
|
||||
* gtk/gtkfilechooserdialog.c (response_cb): set response_requested
|
||||
to FALSE after stopping emission of the response signal.
|
||||
|
||||
2006-03-16 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
More review work.
|
||||
|
||||
* gtk/gtkfilechooserprivate.h: remove idle_finished_loading_source
|
||||
from GtkFileSystemModel.
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): remove
|
||||
idle_finished_loading_source,
|
||||
(idle_finished_loading_cb), (queue_finished_loading): removed,
|
||||
(got_root_folder_cb): save a list walk, immediately emit
|
||||
finished-loading and don't queue it, since we are already in an
|
||||
idle here, always list_children() so the children the folder already
|
||||
has are returned,
|
||||
(_gtk_file_system_model_new): handle the case where NULL is
|
||||
returned by _get_folder(),
|
||||
(_gtk_file_system_model_path_do): remove comment, and append the
|
||||
new handle to the list, don't try to remove,
|
||||
(get_children_get_folder_cb): save a list walk, remove the dummy
|
||||
child if the _get_folder() call fails or is cancelled.
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
More suggestions from Federico.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
|
||||
remove check for filename_is_root(), since we never hit that code
|
||||
and else mkdir will fail anyway,
|
||||
(gtk_file_system_unix_create_folder): fixup parent folder refresh
|
||||
code.
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemunix.c (read_hidden_file), (fill_in_hidden),
|
||||
(get_is_hidden_for_file): factor out g_file_get_contents() code
|
||||
in read_hidden_file(). (Federico Mena Quintero).
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
Icon name code suggestions by Federico Mena Quintero.
|
||||
|
||||
* gtk/gtkfilesystemunix.c: add GTK_FILE_INFO_ICON to
|
||||
STAT_NEEDED_MASK,
|
||||
(get_fallback_icon_name), (get_fallback_icon),
|
||||
(get_icon_name_for_directory), (get_special_icon_name): get rid
|
||||
of strdups,
|
||||
(get_icon_type_from_path): add a statbuf argument and use the
|
||||
statbuf when folder_unix is NULL,
|
||||
(create_file_info): adapt to work with above changes.
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): path
|
||||
is NULL is an error here (gtk_file_system_get_info() already guards
|
||||
path = NULL),
|
||||
(gtk_file_system_unix_get_info): move basename creation to just
|
||||
before create_file_info(). (Federico Mena Quintero).
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemunix.c (struct _GtkFileFolderUnix): add
|
||||
load_folder_id field,
|
||||
(load_folder): add thread enter/leave construct, set load_folder_id
|
||||
to zero since we have the idle removed when we return,
|
||||
(gtk_file_system_unix_get_folder): initialize load_folder_id to 0
|
||||
and store the source id of the load_folder idle,
|
||||
(gtk_file_folder_unix_finalize): remove the load_folder idle
|
||||
if necessary. (Federico Mena Quintero).
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooser.c (gtk_file_chooser_get_current_folder): return
|
||||
NULL if there is no current folder path.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_map): we
|
||||
reload the current folder if there is one, else we continue the
|
||||
still pending load.
|
||||
|
||||
2006-03-14 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
Couple of fixes from Markku Vire.
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_info_copy): also strdup icon_name
|
||||
and display_key.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
|
||||
initialize error to NULL,
|
||||
(gtk_file_folder_unix_list_children): return an empty list for now if
|
||||
we couldn't read the directory.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb),
|
||||
(gtk_file_chooser_default_update_current_folder): set and unset
|
||||
busy cursor while checking whether the given path is a folder.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.h: change the GtkFileInfo argument of the
|
||||
GetInfoCallback to be const.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c, gtk/gtkfilechooserdefault.c,
|
||||
gtk/gtkpathbar.c: changes functions to reflect the above change.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c, gtk/gtkfilechooserprivate.h: keep track
|
||||
of handles, cancel all pending operations on dispose.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserprivate.h (struct _GtkFileSystemModel): add
|
||||
pending_handles field,
|
||||
(struct _FileModelNode): add load_pending flag.
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (gtk_file_system_model_dispose): introduce,
|
||||
cancel all pending operations here,
|
||||
(got_root_folder_cb), (_gtk_file_system_model_new), (ref_path_cb),
|
||||
(_gtk_file_system_model_path_do): keep track of all pending
|
||||
operations, handle cancelled operations.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_finalize),
|
||||
(gtk_file_chooser_button_destroy): move all handle cancellations
|
||||
and object unrefs to destroy.
|
||||
|
||||
* gtk/gtkpathbar.c (gtk_path_bar_finalize), (gtk_path_bar_dispose):
|
||||
likewise.
|
||||
|
||||
* gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_class_init):
|
||||
add dispose,
|
||||
(gtk_file_chooser_entry_dispose): cancel handles and unrefs
|
||||
objects here instead of finalize.
|
||||
|
||||
2005-12-23 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (get_cached_icon): check if "name" is an
|
||||
absolute path, if so load the icon from that file.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder): fix
|
||||
the build.
|
||||
|
||||
2005-12-21 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder): remove
|
||||
the FIXME since it doesn't make sense, when we return a cached
|
||||
folder we won't emit finished-loading either,
|
||||
(gtk_file_system_unix_create_folder): remove unused variable,
|
||||
(gtk_file_folder_unix_list_children): remove unused code,
|
||||
(get_is_hidden_for_file): new function,
|
||||
(create_file_info): also handle getting is_hidden when called
|
||||
without a folder unix (from _system_get_info() for example).
|
||||
|
||||
2005-12-20 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (check_is_folder): fully removed!
|
||||
woo!,
|
||||
(check_save_entry): add is_folder argument,
|
||||
(gtk_file_chooser_default_get_paths): update check_save_entry() call,
|
||||
(get_display_name_for_folder): removed,
|
||||
(confirmation_confirm_get_info_cb): new function which will
|
||||
handle the confirmation dialog now we have all information for it,
|
||||
(should_respond_after_confirm_overwrite): replace the call to
|
||||
get_display_name_for_folder() with an asynchronous solution,
|
||||
(action_create_folder_cb): request dialog response on successfull
|
||||
folder creation,
|
||||
(gtk_file_chooser_default_should_respond): update call to
|
||||
check_save_entry(); replace the check is folder call for "path"
|
||||
by just using the is_folder return value from check_save_entry();
|
||||
replaced the check is folder call for "parent_path" with an
|
||||
asynchronous setup, remainder of that work is now done in
|
||||
save_entry_get_info_cb(),
|
||||
(save_entry_get_info_cb): new function.
|
||||
|
||||
* gtk/gtkfilechoosermebed.[ch]: add response-requested signal.
|
||||
|
||||
* gtk/gtkfilechooserdialog.c, gtk/gtkfilechooserprivate.h: handle
|
||||
response_requested signal.
|
||||
|
||||
* gtk/gtkfilechooserentry.[ch]
|
||||
(_gtk_file_chooser_entry_get_is_folder): new function.
|
||||
|
||||
2005-12-20 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (ref_path_cb): when called with
|
||||
!folder, check if node is the node we are looking for (can be
|
||||
triggered when we call ref_path_cb ourselves after a find_child_node),
|
||||
(_gtk_file_system_model_path_do): introduce parent_node field;
|
||||
after finding a child node in a loaded parent node, don't forget
|
||||
to call ref_path_cb,
|
||||
(get_children_get_folder_cb): don't forget to set data->node->folder
|
||||
to the newly acquired folder.
|
||||
|
||||
2005-12-20 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (show_and_select_paths_get_folder_cb):
|
||||
handle case where the folder we get already finished loading.
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (ref_path_cb),
|
||||
(_gtk_file_system_model_path_do): make this work.
|
||||
|
||||
2005-12-19 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (shortcuts_update_count): modify
|
||||
in such a way that it can also negatively update the count on
|
||||
failures,
|
||||
(get_file_info_finished): handle failures, update save folder
|
||||
combo box on success,
|
||||
(shortcuts_insert_path): change the boolean return value into a
|
||||
void one, also refilter the model and update the save folder combo
|
||||
box for the non-asynchronous case,
|
||||
(shortcuts_append_home), (shortcuts_append_desktop),
|
||||
(shortcuts_add_volumes), (shortcuts_add_current_folder),
|
||||
(add_shortcuts_get_info_cb): adapt to shortcuts_insert_path() updates.
|
||||
|
||||
2005-12-19 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkpathbar.[ch]: add handle fields to ButtonData and
|
||||
GtkPathBar; do correct handle bookkeeping.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (load_folder),
|
||||
(gtk_file_system_unix_get_folder),
|
||||
(gtk_file_folder_unix_is_finished_loading): add is_finished_loading
|
||||
field to GtkFileFolderUnix, which is set to true once we are
|
||||
really finished with loading (previous assumption that we are
|
||||
always finshed loading is not true anymore).
|
||||
|
||||
* gtk/gtkfilesystemmodel.c (got_root_folder_cb): if the folder is
|
||||
finished loading, list the children and update the root level.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
|
||||
handle cancellation.
|
||||
|
||||
2005-12-16 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystemunix.c: always call the callback, even when
|
||||
cancelled; ref handles passed to the callback queue functions;
|
||||
don't set cancelled to TRUE in _cancel_operation(), since operations
|
||||
in this backend are always completed,
|
||||
(get_special_icon_name): don't strdup the value of
|
||||
get_icon_name_for_directory() again.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c: adapt to new cancellation policy;
|
||||
reference all objects which are passed as callback arguments; in the
|
||||
callback check if the handles match.
|
||||
|
||||
* gtk/gtkfilechooserentry.c: likewise.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: likewise. Also changed the shortcut
|
||||
loading code to be more like the code in GtkFileChooserButton, where
|
||||
we store all handles in the model and have model_row_free_data
|
||||
cancel any pending operations,
|
||||
(shortcuts_model_create): copy the error.
|
||||
|
||||
* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault): remove
|
||||
loading_volumes and loading_bookmarks fields.
|
||||
|
||||
* gtk/gtkfilesystem.c (gtk_file_info_free): free icon_name here...
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (edited_idle_create_folder_cb): fix
|
||||
thinko.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (dispatch_create_folder_callback),
|
||||
(queue_create_folder_callback): need to copy/free the path,
|
||||
(gtk_file_system_unix_create_folder): put the "reget folder" hack
|
||||
back in, though it's working different now.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_finalize),
|
||||
(dnd_select_folder_get_info_cb), (gtk_file_chooser_drag_data_received),
|
||||
(change_icon_theme_get_info_cb), (change_icon_theme),
|
||||
(model_add_special_get_info_cb), (model_add_special),
|
||||
(update_label_get_info_cb), (update_label_and_image): cancel existing
|
||||
operations, if any; added apprioriate fields to
|
||||
GtkFileChooserButtonPrivate.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_finalize): if
|
||||
there's a folder loading, cancel the operation,
|
||||
(load_directory_get_folder_callback): set the loading folder handle
|
||||
to NULL,
|
||||
(load_directory_callback): cancel any currently loading folders
|
||||
before starting a new get folder operation.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): don't overwrite
|
||||
data if it's already set (for example by the "is volume" case).
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (set_info_get_info_cb),
|
||||
(set_info_for_path_at_iter): store a row reference in the temporary
|
||||
data structure and not an iter,
|
||||
(model_add_special), (model_update_current_folder),
|
||||
(gtk_file_chooser_button_add_shorcut_folder): remove unused pixbuf
|
||||
variable.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (get_file_info_finished),
|
||||
(shortcuts_insert_path): replace gtk_file_system_render_icon() call
|
||||
with gtk_file_system_get_file_info(),
|
||||
(gtk_file_chooser_default_add_shortcut_folder),
|
||||
(gtk_file_chooser_default_remove_shortcut_folder): handle shortcuts
|
||||
which are still loading.
|
||||
|
||||
* gtk/gtkfilechooserprivate.h: add shortcuts_loading field to
|
||||
struct _GtkFileChooserDefault.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (set_info_get_info_cb),
|
||||
(set_info_for_path_at_iter), (model_free_row_data): keep handle
|
||||
and path together; now supports adding/removing shortcuts
|
||||
which are still loading.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.c: make the cancelled field an GObject property.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.h: make the GError argument in the callbacks
|
||||
const.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c: update callbacks,
|
||||
* gtk/gtkfilechooserentry.c: likewise,
|
||||
* gtk/gtkfilechooserdefault.c: likewise,
|
||||
* gtk/gtkfilesystemmodel.c: likewise,
|
||||
* gtk/gtkpathbar.c: likewise.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (edited_idle_create_folder_cb): copy
|
||||
the error which will be passed to error_creating_folder_dialog(),
|
||||
(action_create_folder_cb): likewise,
|
||||
(file_list_drag_data_received_get_info_cb): add forgotten GError
|
||||
declaration.
|
||||
|
||||
2005-12-13 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkpathbar.c (get_button_image), (set_button_image),
|
||||
(set_button_image_get_info_cb),
|
||||
(gtk_path_bar_update_button_appearance): update to new icon
|
||||
rendering call.
|
||||
|
||||
2005-12-09 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (file_list_drag_data_received),
|
||||
(gtk_file_chooser_default_add_shortcut_folder),
|
||||
(shortcuts_activate_get_info_cb): replace synchronous check_is_folder
|
||||
calls with an async gtk_file_system_get_info() solution.
|
||||
|
||||
2005-12-09 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilesystem.c (icon_cache_element_free), (icon_theme_changed),
|
||||
(get_cached_icon), (gtk_file_info_render_icon): implement pixbuf
|
||||
caching as found in the file system backends.
|
||||
|
||||
2005-12-09 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtk.symbols: updated.
|
||||
|
||||
* gtk/gtkfilesystem.[ch] (struct GtkFileInfo): added icon_name field,
|
||||
(enum GtkFileInfoType): added GTK_FILE_INFO_ICON,
|
||||
(gtk_file_info_set_icon_name): new function,
|
||||
(gtk_file_info_render_icon): new function,
|
||||
(gtk_file_system_render_icon): removed.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_render_icon): removed,
|
||||
(create_file_info): fill icon_name field if required,
|
||||
(get_*_icon): modified to suit create_file_info() better.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c: modified to use
|
||||
gtk_file_info_render_icon() instead of gtk_file_system_render_icon().
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: likewise.
|
||||
|
||||
2005-12-06 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (get_file_info_finished),
|
||||
(update_current_folder_get_info_cb): fix mem leaks.
|
||||
|
||||
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_info): ditto.
|
||||
|
||||
* gtk/gtkpathbar.c (gtk_path_bar_set_path_finish): ditto.
|
||||
|
||||
2005-12-06 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserbutton.c (dnd_select_folder_get_info_cb),
|
||||
(gtk_file_chooser_button_drag_data_received): make asynchronous,
|
||||
(update_label_and_image): remove unused variable.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c
|
||||
(gtk_file_chooser_default_update_current_folder): split in two
|
||||
functions, so we can have the is_folder check back.
|
||||
* gtk/gtkfilechooserprivate.h: add update_current_folder_handle
|
||||
field.
|
||||
|
||||
2005-12-06 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (show_and_select_paths): fixed a typo.
|
||||
|
||||
2005-12-05 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
(merge from HEAD)
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (trap_activate_cb): "event->state &
|
||||
modifiers", not "event->state && modifiers". Patch by Sadrul
|
||||
Habib Chowdhury <imadil@gmail.com>. Fixes bug #323073.
|
||||
|
||||
2005-12-06 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
Beginnings of an asynchronous file chooser.
|
||||
|
||||
* gtk/gtkfilechooserbutton.c: display name and the is folder property
|
||||
are now asynchronously set using set_info_for_at_path_iter(), the
|
||||
is folder property is now also stored in the tree model.
|
||||
|
||||
* gtk/gtkfilechooserdefault.c: lots of changes to the shortcuts
|
||||
model code to make it operate asynchronously, check_is_folder() has
|
||||
been "disabled" for now, all other synchronous calls were
|
||||
replaced with asychronous ones.
|
||||
|
||||
* gtk/gtkfilechooserentry.c: update call to
|
||||
gtk_file_system_get_folder().
|
||||
|
||||
* gtk/gtkfilechooserprivate.h: added two fields.
|
||||
|
||||
* gtk/gtkfilesystem.[ch]: for about 85% changed to the changes
|
||||
outlined in the proposal discussed on gtk-devel-list.
|
||||
|
||||
* gtk/gtkfilesystemmodel.[ch]: updated all asynchronous calls,
|
||||
_gtk_file_system_model_path_do() basically had to be rewritten
|
||||
(and I still need to finish that).
|
||||
|
||||
* gtk/gtkfilesystemunix.c: changed to be compatible with the new
|
||||
GtkFileSystem interface.
|
||||
|
||||
* gtk/gtkpathbar.c (button_clicked_cb): block/unblock the
|
||||
button_clicked_cb callback around the call to
|
||||
gtk_toggle_button_set_active(), avoids button_clicked_cb getting
|
||||
called twice.
|
||||
(_gtk_path_bar_set_path): refactored to be asynchronous.
|
@@ -1,500 +0,0 @@
|
||||
2006-04-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* docs/tools/widgets.c (get_all_widgets): Add print dialog
|
||||
and page setup dialog.
|
||||
|
||||
2006-04-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkpapersize.c (gtk_paper_size_get_display_name):
|
||||
Call gettext on the standard paper names.
|
||||
|
||||
2006-04-11 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/gdk.symbols:
|
||||
* gdk/win32/gdkevents-win32.c:
|
||||
* gdk/win32/gdkwin32.h:
|
||||
Add gdk_win32_set_modal_dialog_libgtk_only that we
|
||||
need for handling the mainloop in the print dialogs.
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Pump the gtk+ mainloop when needed in the print dialogs.
|
||||
This means gtk+ windows will redraw while the print dialogs
|
||||
are up.
|
||||
|
||||
2006-04-10 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Better size handling.
|
||||
Save win32-specific settings in additions to the generic ones
|
||||
if the generic one is lossy.
|
||||
|
||||
2006-04-10 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Finish implementing run_page_setup_dialog.
|
||||
|
||||
* gtk/gtkpagesetup.h:
|
||||
* gtk/gtkpapersize.h:
|
||||
* gtk/gtkprint-win32.h:
|
||||
* gtk/gtkprintcontext.h:
|
||||
* gtk/gtkprinter-private.h:
|
||||
* gtk/gtkprintoperation-private.h:
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
* gtk/gtkprintoperation.h:
|
||||
* gtk/gtkprintsettings.h:
|
||||
s/EGG/GTK/
|
||||
|
||||
2006-04-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk+-unix-print-2.0.pc.in: Fix a typo (#337698)
|
||||
|
||||
2006-04-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/paper_names_offsets.c:
|
||||
* gtk/gen-paper-names.c: Correct the suffix/duplicate optimizations.
|
||||
|
||||
2006-04-07 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Initial work on gtk_print_run_page_setup_dialog.
|
||||
Not reading margins yet.
|
||||
|
||||
2006-04-07 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/Makefile.am:
|
||||
Link to winspool
|
||||
|
||||
* gtk/gtk.symbols:
|
||||
* gtk/gtkprintoperation-private.h:
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
* gtk/gtkprintoperation.[ch]:
|
||||
Add gtk_print_operation_get_status_string() and status
|
||||
string to _gtk_print_operation_set_status.
|
||||
Rename GTK_PRINT_STATUS_PROCESSING to GTK_PRINT_STATUS_PRINTING.
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Poll for status updates
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
Rename GTK_PRINT_STATUS_PROCESSING to GTK_PRINT_STATUS_PRINTING.
|
||||
|
||||
* tests/print-editor.c:
|
||||
Show print status string
|
||||
|
||||
2006-04-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/paper_names_offsets.c:
|
||||
* gtk/gtkpapersize.c: Save 4K of .data by converting
|
||||
the array of paper names to offsets.
|
||||
|
||||
* gtk/gen-paper-names.c: Utility used to create
|
||||
paper_names_offsets.c from paper_names.c.
|
||||
|
||||
* gtk/Makefile.am: Necessary glue.
|
||||
|
||||
2006-04-06 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Use glib base64 code.
|
||||
Set up manual_* vars fully.
|
||||
|
||||
2006-04-06 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/Makefile.am:
|
||||
Add -lcomdlg32 on win32
|
||||
|
||||
* gtk/gtkprint-win32.h:
|
||||
Move WINVER define to .c files
|
||||
|
||||
* gtk/gtk.symbols:
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
Add empty gtk_print_run_page_setup win implementation
|
||||
Move WINVER define to this file
|
||||
|
||||
* modules/Makefile.am:
|
||||
Only build print backends on unix
|
||||
|
||||
2006-04-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
* gtk/gtkprintoperation-unix.c: Use GTK_RESPONSE_CANCEL/OK
|
||||
instead of GTK_RESPONSE_REJECT/ACCEPT, to make Esc close
|
||||
the dialog, and to not use values which are documented
|
||||
as reserved for apps.
|
||||
|
||||
2006-04-05 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||
Don't hardcode lpr command, expose full commandline.
|
||||
|
||||
2006-04-05 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Don't check for printer changes after dialog is dead.
|
||||
|
||||
* gtk/gtkprintbackend.c: (gtk_print_backend_load_modules):
|
||||
Strip whitespace from backend strings
|
||||
|
||||
* gtk/gtkprintbackend.h:
|
||||
Add private printer functions
|
||||
|
||||
* gtk/gtkprinter-private.h:
|
||||
Move GtkPrinterPrivate into gtkprinter.c
|
||||
|
||||
* gtk/gtkprinter.[ch]:
|
||||
Move GtkPrinterPrivate into gtkprinter.c
|
||||
Add new construct properties.
|
||||
Add setter functions.
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
* modules/printbackends/cups/gtkprintercups.[ch]:
|
||||
Update to new APIs.
|
||||
|
||||
* modules/printbackends/lpr/Makefile.am:
|
||||
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||
* modules/printbackends/lpr/gtkprinterlpr.[ch]
|
||||
Update to new APIs.
|
||||
Remove GtkPrinterLPR.
|
||||
Read/Save command line option in settings
|
||||
|
||||
* modules/printbackends/pdf/Makefile.am:
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
* modules/printbackends/pdf/gtkprinterpdf.[ch]:
|
||||
Update to new APIs.
|
||||
Remove GtkPrinterPDF.
|
||||
|
||||
2006-04-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintoperation.h: Add missing standard
|
||||
GObject macros. (#337277, Yevgen Muntyan)
|
||||
|
||||
2006-04-04 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprinteroption.[ch]:
|
||||
Add gtk_printer_option_has_choice.
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
Add support for "print at time".
|
||||
|
||||
2006-04-04 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpapersize.c:
|
||||
Handle ppd names with ".Transverse" suffix
|
||||
Don't force width < height
|
||||
|
||||
* gtk/gtkprinteroption.c:
|
||||
Make sure that value is never NULL.
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
Add some HP whitelist names
|
||||
Remove spew from ignored options.
|
||||
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
Fix warnings
|
||||
|
||||
* gtk/gtkprinter-private.h:
|
||||
* gtk/gtkprinter.[ch]:
|
||||
Add gtk_printer_is_default.
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Use gtk_printer_is_default.
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
Get default printer info
|
||||
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
Fix warning.
|
||||
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
* modules/printbackends/pdf/gtkprinterpdf.[ch]:
|
||||
Correctly read/write/use the output filename setting.
|
||||
|
||||
2006-04-03 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
Disable margin from printers if there are no printers.
|
||||
|
||||
* gtk/gtkpapersize.c:
|
||||
Fix build.
|
||||
|
||||
2006-04-01 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtk.symbols: protect unix-only symbols by
|
||||
G_OS_UNIX (#336819, Yevgen Muntyan)
|
||||
|
||||
* gtk/gtkpapersize.c: Win32 fixes. (#336806, Yevgen Muntyan)
|
||||
|
||||
2006-03-30 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtk.symbols:
|
||||
Update
|
||||
|
||||
* gtk/gtkprintbackend.[ch]:
|
||||
Add dnotify to gtk_print_backend_print_stream
|
||||
|
||||
* gtk/gtkprinter-private.h:
|
||||
Declare gtk_print_job_set_status
|
||||
|
||||
* gtk/gtkprinter.[ch]:
|
||||
Remove gtk_printer_prepare_job.
|
||||
|
||||
* gtk/gtkprintjob.[ch]:
|
||||
Now you create print job directly with gtk_print_job_new() and
|
||||
they'll be prepared automatically.
|
||||
Add status_changed signal and get_status.
|
||||
Add gtk_print_job_set_source_file to allow sending a file.
|
||||
|
||||
* gtk/gtkprintoperation-private.h:
|
||||
Add destroy notify for platform_data.
|
||||
Declare _gtk_print_operation_set_status.
|
||||
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
Hook up status change handling.
|
||||
Use the new way to get a print job.
|
||||
|
||||
* gtk/gtkprintoperation.[ch]:
|
||||
Add status_changed signal and get_status/is_finished.
|
||||
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
Update to use new APIs and set status on the job.
|
||||
Cups polls for the status.
|
||||
|
||||
* tests/print-editor.c:
|
||||
Track the print operations in the status bar.
|
||||
|
||||
2006-03-30 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/Makefile.am:
|
||||
* gtk/gtkprintbackend.c:
|
||||
Default to "pdf,cups" if we found cups, and
|
||||
"pdf,lpr" otherwise.
|
||||
|
||||
2006-03-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* modules/printbackends/Makefile.am:
|
||||
* configure.in: Don't build the cups backend
|
||||
if cups is not there.
|
||||
|
||||
2006-03-29 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtk.symbols:
|
||||
gtk_printer_prep_job -> gtk_printer_prepare_job
|
||||
gtk_print_job_prep -> gtk_print_job_prepare
|
||||
|
||||
* gtk/gtkprintbackend.h:
|
||||
* gtk/gtkprinter-private.h:
|
||||
* gtk/gtkprinter.[ch]:
|
||||
Add print_job argument to printer_prepare_for_print
|
||||
gtk_printer_prep_job -> gtk_printer_prepare_job
|
||||
|
||||
* gtk/gtkprintjob.[ch]:
|
||||
Add manual rendering settings to GtkPrintJob.
|
||||
gtk_print_job_prep -> gtk_print_job_prepare
|
||||
|
||||
* gtk/gtkprintoperation-private.h:
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
* gtk/gtkprintoperation.c:
|
||||
Get more manual_* settings working.
|
||||
Run mainloop after each printed page.
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Save page ranges.
|
||||
|
||||
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||
Now put the manual_* settings inside the PrintJob in
|
||||
prepare_for_print.
|
||||
|
||||
2006-03-29 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Make sure we remember the format-for printer.
|
||||
Also, use it as the default if set.
|
||||
|
||||
2006-03-28 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Remove unnecessary padding under list.
|
||||
|
||||
2006-03-28 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
More HIGy layout.
|
||||
|
||||
2006-03-28 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
HIG conformance of spacing and titles.
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Use standard constructor form print button too.
|
||||
|
||||
2006-03-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* modules/printbackends/*/Makefile.am: Fix
|
||||
a problem with builddir != srcdir builds.
|
||||
(#335915, Yevgen Muntyan)
|
||||
|
||||
2006-03-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintbackend.c: Simply the syntax
|
||||
of the setting to "cups,pdf", and get rid
|
||||
of the GScanner used to parse it.
|
||||
|
||||
2006-03-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
Reorder print list so status is at the end.
|
||||
Ellipsize the status column.
|
||||
|
||||
2006-03-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
Handle removed printers and status-changed.
|
||||
Handle NULL printer location.
|
||||
|
||||
2006-03-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/Makefile.am:
|
||||
* gtk/stock-icons/24/gtk-orientation-landscape.png:
|
||||
* gtk/stock-icons/24/gtk-orientation-portrait.png:
|
||||
* gtk/stock-icons/24/gtk-orientation-reverse-landscape.png:
|
||||
* gtk/gtkiconfactory.c: (get_default_icons):
|
||||
* gtk/gtkstock.h:
|
||||
Add orientation stock icons.
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
Use the orientation icons.
|
||||
|
||||
2006-03-27 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* gtk/gtkpagesetupunixdialog.c:
|
||||
* gtk/gtkprintjob.c:
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
* gtk/gtkprintunixdialog.c:
|
||||
s/impl/dialog/
|
||||
Don't prefix static functions with _
|
||||
|
||||
2006-03-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkprintunixdialog.c: Don't use _(""). (#335898,
|
||||
Christian Persch)
|
||||
|
||||
* modules/printbackends/*: Don't use G_DEFINE_TYPE
|
||||
in modules.
|
||||
|
||||
* gtk/gtkprintbackend.c: Remove an unused static function.
|
||||
|
||||
2006-03-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtk.symbols: Add printing symbols
|
||||
|
||||
* gtk/gtkpapersize.[hc]:
|
||||
* gtk/gtkpage*.[hc]:
|
||||
* gtk/gtkprint*.[hc]: Add aliasing, #include cleanups.
|
||||
|
||||
* gtk/gtkprintcontext.h:
|
||||
* gtk/gtkprintoperation.h:
|
||||
* gtk/gtkprintsettings.h: Make get_type function const.
|
||||
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.c: Remove
|
||||
C99ism.
|
||||
|
||||
* modules/printbackends/cups/gtkcupsutils.c: Use unsigned
|
||||
integers for bitfields.
|
||||
|
||||
2006-03-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtknotebook.c: Fix docs
|
||||
|
||||
* gtk/Makefile.am (EXTRA_DIST): Add the stock icons here.
|
||||
|
||||
* gdk/directfb/Makefile.am (EXTRA_DIST): Remove ChangeLog,
|
||||
to make make dist happier.
|
||||
|
||||
2006-03-24 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* configure.in:
|
||||
* gtk/gtkprintbackend.c:
|
||||
* modules/printbackends/Makefile.am:
|
||||
* modules/printbackends/cups/Makefile.am:
|
||||
* modules/printbackends/lpr/Makefile.am:
|
||||
* modules/printbackends/lpr/gtkprintbackendlpr.[ch]:
|
||||
* modules/printbackends/lpr/gtkprinterlpr.[ch]:
|
||||
* modules/printbackends/pdf/Makefile.am:
|
||||
* modules/printbackends/pdf/gtkprintbackendpdf.[ch]:
|
||||
* modules/printbackends/pdf/gtkprinterpdf.[ch]:
|
||||
Import pdf and lpr backend
|
||||
|
||||
2006-03-24 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
Import print-operation into gtk+
|
||||
|
||||
* .cvsignore:
|
||||
* Makefile.am:
|
||||
* gtk+-unix-print-2.0.pc.in:
|
||||
Add gtk+-unix-print-2.0.pc
|
||||
|
||||
* configure.in:
|
||||
Look for cups
|
||||
Look for various _NL_* extensions
|
||||
Output new makefiles and .pc.in
|
||||
|
||||
* gtk/Makefile.am:
|
||||
Add new files
|
||||
|
||||
* gtk/gtk.h:
|
||||
Include gtkprintoperation.h
|
||||
|
||||
* gtk/gtkenums.h:
|
||||
Add printing enums
|
||||
|
||||
* gtk/gtkmarshalers.list:
|
||||
Add required new marshallers
|
||||
|
||||
* gtk/gtkpagesetup.[ch]:
|
||||
* gtk/gtkpagesetupunixdialog.[ch]:
|
||||
* gtk/gtkpagesetupunixdialog.h:
|
||||
* gtk/gtkpapersize.[ch]:
|
||||
* gtk/gtkprint-win32.[ch]:
|
||||
* gtk/gtkprintbackend.[ch]:
|
||||
* gtk/gtkprintcontext.[ch]:
|
||||
* gtk/gtkprinter-private.h:
|
||||
* gtk/gtkprinter.[ch]:
|
||||
* gtk/gtkprinteroption.[ch]:
|
||||
* gtk/gtkprinteroptionset.[ch]:
|
||||
* gtk/gtkprinteroptionwidget.[ch]:
|
||||
* gtk/gtkprintjob.[ch]:
|
||||
* gtk/gtkprintoperation-private.h:
|
||||
* gtk/gtkprintoperation-unix.c:
|
||||
* gtk/gtkprintoperation-win32.c:
|
||||
* gtk/gtkprintoperation.[ch]:
|
||||
* gtk/gtkprintsettings.[ch]:
|
||||
* gtk/gtkprintunixdialog.[ch]:
|
||||
* gtk/paper_names.c:
|
||||
Generic printing support
|
||||
|
||||
* modules/Makefile.am:
|
||||
* modules/printbackends/Makefile.am:
|
||||
* modules/printbackends/cups/Makefile.am:
|
||||
* modules/printbackends/cups/gtkcupsutils.[ch]:
|
||||
* modules/printbackends/cups/gtkprintbackendcups.[ch]:
|
||||
* modules/printbackends/cups/gtkprintercups.[ch]:
|
||||
Cups backend
|
||||
|
||||
* tests/.cvsignore:
|
||||
* tests/Makefile.am:
|
||||
* tests/print-editor.c:
|
||||
Add printing test app
|
||||
|
@@ -7981,7 +7981,7 @@ Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
|
||||
* gtk/gtkwidget.h:
|
||||
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
|
||||
the emission of the "add-accelerator" signal on a widget. this is
|
||||
useful to prevent accelerator installation on certain widgets.
|
||||
usefull to prevent accelerator installation on certain widgets.
|
||||
|
||||
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
|
||||
labels left justified, by setting their alignment. stop accelerator
|
||||
|
@@ -17108,7 +17108,7 @@ Tue Jan 16 13:13:13 GMT 2001 Tony Gale <gale@gtk.org>
|
||||
Use fb_mem, fb_stride, fb_width, fb_height.
|
||||
Added recompute_rowstride to reset the rowstride of all windows.
|
||||
Added gdk_fb_recompute_all() which recomputes rootwindow size,
|
||||
window abs positions and window rowstrides. Useful when the
|
||||
window abs positions and window rowstrides. Usefull when the
|
||||
rotation has changed.
|
||||
|
||||
Thu Jan 11 13:16:50 GMT 2001 Tony Gale <gale@gtk.org>
|
||||
|
8078
ChangeLog.pre-2-10
8078
ChangeLog.pre-2-10
File diff suppressed because it is too large
Load Diff
8912
ChangeLog.pre-2-12
8912
ChangeLog.pre-2-12
File diff suppressed because it is too large
Load Diff
9588
ChangeLog.pre-2-14
9588
ChangeLog.pre-2-14
File diff suppressed because it is too large
Load Diff
3959
ChangeLog.pre-2-16
3959
ChangeLog.pre-2-16
File diff suppressed because it is too large
Load Diff
79
HACKING
79
HACKING
@@ -1,64 +1,55 @@
|
||||
If you want to hack on the GTK+ project, you'll need to have
|
||||
the following packages installed:
|
||||
|
||||
- GNU autoconf 2.54
|
||||
- GNU automake 1.7
|
||||
- GNU libtool 1.4
|
||||
- indent (GNU indent 1.9.1 is known good)
|
||||
- GNU gettext 10.40
|
||||
- GNU autoconf 2.52
|
||||
- GNU automake 1.4
|
||||
- GNU libtool 1.4
|
||||
- indent (GNU indent 1.9.1 is known good)
|
||||
- GNU gettext 10.40
|
||||
|
||||
These should be available by ftp from ftp.gnu.org or any of the
|
||||
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
|
||||
|
||||
Up-to-date instructions about developing GNOME applications and libraries
|
||||
can be found here:
|
||||
|
||||
http://developer.gnome.org
|
||||
|
||||
Information about using git with GNOME can be found here:
|
||||
|
||||
http://live.gnome.org/Git
|
||||
|
||||
In order to get GIT gtk+ installed on your system, you need to have
|
||||
the most recent GIT versions of glib, pango, and atk installed as well.
|
||||
In order to get CVS gtk+ installed on your system, you need to have
|
||||
the most recent CVS version of glib, pango, and atk installed as well.
|
||||
The installation process of these libraries is similar to that of gtk+, but
|
||||
needs to be fulfilled prior to installation of gtk+.
|
||||
|
||||
If at all possible, please use GIT to get the latest development version of
|
||||
gtk+ and glib. You can do the following to get glib and gtk+ from GIT:
|
||||
|
||||
$ git clone git://git.gnome.org/glib
|
||||
$ git clone git://git.gnome.org/pango
|
||||
$ git clone git://git.gnome.org/atk
|
||||
$ git clone git://git.gnome.org/gtk+
|
||||
|
||||
Note: if you plan to push changes to back to the master repository and
|
||||
have a gnome account, you want to use the following instead:
|
||||
|
||||
$ git clone ssh://<username>@git.gnome.org/git/gtk+
|
||||
|
||||
To compile the GIT version of gtk+ on your system, you will need to take
|
||||
To compile a CVS version of gtk+ on your system, you will need to take
|
||||
several steps to setup the tree for compilation. You can do all these
|
||||
steps at once by running:
|
||||
|
||||
gtk+$ ./autogen.sh
|
||||
|
||||
cvsroot/gtk+# ./autogen.sh
|
||||
|
||||
Basically this does the following for you:
|
||||
|
||||
gtk+$ aclocal; automake; autoconf
|
||||
cvsroot/gtk+# aclocal; automake; autoconf
|
||||
|
||||
The above commands create the `configure' script. Now you
|
||||
run the `configure' script in `gtk+/' to create all Makefiles.
|
||||
More information about that in `INSTALL'.
|
||||
The above commands create the "configure" script. Now you
|
||||
can run the configure script in cvsroot/gtk+ to create all
|
||||
the Makefiles.
|
||||
|
||||
Before running `autogen.sh' or `configure', make sure you have libtool
|
||||
in your path.
|
||||
Before running autogen.sh or configure, make sure you have libtool
|
||||
in your path.
|
||||
|
||||
Note that autogen.sh runs configure for you. If you wish to pass
|
||||
options like `--prefix=/usr' to `configure' you can give those options
|
||||
to `autogen.sh' and they will be passed on to `configure'.
|
||||
options like --prefix=/usr to configure you can give those options
|
||||
to autogen.sh and they will be passed on to configure.
|
||||
|
||||
If at all possible, please use CVS to get the latest development version of
|
||||
gtk+ and glib. You can do the following to get glib and gtk+ from cvs:
|
||||
|
||||
$ export CVSROOT=':pserver:anonymous@cvs.gnome.org:/cvs/gnome'
|
||||
$ cvs login
|
||||
(there is no password, just hit return)
|
||||
$ cvs -z3 checkout glib
|
||||
$ cvs -z3 checkout pango
|
||||
$ cvs -z3 checkout atk
|
||||
$ cvs -z3 checkout gtk+
|
||||
|
||||
For information about submitting patches and commiting changes
|
||||
to CVS, see the README and README.cvs-commits files. In particular,
|
||||
don't, under any circumstances, commit anything to CVS before
|
||||
reading and understanding README.cvs-commmits.
|
||||
|
||||
|
||||
For information about submitting patches and pushing changes
|
||||
to GIT, see the `README' and `README.commits' files. In particular,
|
||||
don't, under any circumstances, push anything to GIT before
|
||||
reading and understanding `README.commmits'.
|
||||
|
39
INSTALL
Normal file
39
INSTALL
Normal file
@@ -0,0 +1,39 @@
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
GTK+ requires the following packages:
|
||||
|
||||
- The GLib, Pango, and Atk libraries, available at the same location as GTK+
|
||||
(Either Pango-1.0 or Pango-1.2 can be used with GTK+-2.2;
|
||||
Pango-1.2 is recommended.)
|
||||
|
||||
- The TIFF, PNG, and JPEG image loading libraries. You most
|
||||
likely have these installed on your system already. If not
|
||||
these libraries are available from:
|
||||
|
||||
http://www.libtiff.org/
|
||||
http://www.libpng.org/
|
||||
http://www.ijg.org/
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.8.10.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.8.10 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK
|
||||
|
||||
The Details
|
||||
===========
|
||||
|
||||
Complete information about installing GTK+ and related libraries can be found
|
||||
in the file:
|
||||
|
||||
docs/reference/gtk/html/gtk-building.html
|
||||
|
||||
Or online at:
|
||||
|
||||
http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html
|
||||
|
12
INSTALL.in
12
INSTALL.in
@@ -3,9 +3,9 @@ Prerequisites
|
||||
|
||||
GTK+ requires the following packages:
|
||||
|
||||
- The GLib, Pango, ATK and cairo libraries, available at the same
|
||||
location as GTK+. GTK+ @GTK_VERSION@ requires at least GLib 2.17.6,
|
||||
Pango 1.20, ATK 1.13.0 and cairo 1.6.0.
|
||||
- The GLib, Pango, and Atk libraries, available at the same location as GTK+
|
||||
(Either Pango-1.0 or Pango-1.2 can be used with GTK+-2.2;
|
||||
Pango-1.2 is recommended.)
|
||||
|
||||
- The TIFF, PNG, and JPEG image loading libraries. You most
|
||||
likely have these installed on your system already. If not
|
||||
@@ -15,17 +15,15 @@ GTK+ requires the following packages:
|
||||
http://www.libpng.org/
|
||||
http://www.ijg.org/
|
||||
|
||||
libtiff must be version 3.6.0 or higher.
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK+
|
||||
% make install # install GTK
|
||||
|
||||
The Details
|
||||
===========
|
||||
|
12
MAINTAINERS
12
MAINTAINERS
@@ -1,12 +0,0 @@
|
||||
Matthias Clasen
|
||||
E-mail: mclasen@redhat.com
|
||||
Userid: matthiasc
|
||||
|
||||
Tim Janik
|
||||
E-mail: timj@gtk.org
|
||||
Userid: timj
|
||||
|
||||
Note that a lot of people are contributing to GTK+, and some parts of it
|
||||
are technically maintained by other people. The people listed above are
|
||||
meant as contacts for administrative questions such as cvs accounts. Other
|
||||
questions are best directed to the mailing list gtk-devel-list@gnome.org.
|
78
Makefile.am
78
Makefile.am
@@ -1,5 +1,4 @@
|
||||
## Makefile.am for GTK+
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros
|
||||
@@ -7,7 +6,7 @@ SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros
|
||||
# require automake 1.4
|
||||
AUTOMAKE_OPTIONS = 1.7
|
||||
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
HACKING \
|
||||
makecopyright \
|
||||
NEWS.pre-1-0 \
|
||||
@@ -17,14 +16,7 @@ EXTRA_DIST += \
|
||||
ChangeLog.pre-2-2 \
|
||||
ChangeLog.pre-2-4 \
|
||||
ChangeLog.pre-2-6 \
|
||||
ChangeLog.pre-2-8 \
|
||||
ChangeLog.pre-2-10 \
|
||||
ChangeLog.pre-2-12 \
|
||||
ChangeLog.pre-2-14 \
|
||||
ChangeLog.pre-2-16 \
|
||||
ChangeLog.gtk-async-file-chooser \
|
||||
ChangeLog.gtk-printing \
|
||||
README.commits \
|
||||
README.cvs-commits \
|
||||
README.win32 \
|
||||
config.h.win32 \
|
||||
makefile.msc \
|
||||
@@ -118,26 +110,6 @@ 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@
|
||||
|
||||
@@ -159,40 +131,13 @@ gdk-$(GDKTARGET)-2.0-uninstalled.pc: gdk-2.0-uninstalled.pc
|
||||
cp gdk-2.0-uninstalled.pc gdk-$(GDKTARGET)-2.0-uninstalled.pc
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc gail.pc
|
||||
|
||||
if OS_UNIX
|
||||
pkgconfig_DATA += gtk+-unix-print-2.0.pc
|
||||
endif
|
||||
pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc
|
||||
|
||||
DISTCLEANFILES = \
|
||||
gtk+-unix-print-2.0.pc \
|
||||
gtk+-$(GDKTARGET)-2.0.pc \
|
||||
gdk-$(GDKTARGET)-2.0.pc \
|
||||
gail.pc \
|
||||
gtk+-$(GDKTARGET)-2.0-uninstalled.pc \
|
||||
gdk-$(GDKTARGET)-2.0-uninstalled.pc \
|
||||
gail-uninstalled.pc \
|
||||
config.lt
|
||||
|
||||
distclean-local:
|
||||
if test "$(srcdir)" = "."; then :; else \
|
||||
rm -f ChangeLog; \
|
||||
fi
|
||||
|
||||
ChangeLog:
|
||||
@echo Creating $@
|
||||
@if test -d "$(srcdir)/.git"; then \
|
||||
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log GTK_2_16_0^^.. --stat) | fmt --split-only > $@.tmp \
|
||||
&& mv -f $@.tmp $@ \
|
||||
|| ($(RM) $@.tmp; \
|
||||
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
|
||||
(test -f $@ || echo git-log is required to generate this file >> $@)); \
|
||||
else \
|
||||
test -f $@ || \
|
||||
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
|
||||
echo A git checkout and git-log is required to generate this file >> $@); \
|
||||
fi
|
||||
gdk-$(GDKTARGET)-2.0-uninstalled.pc
|
||||
|
||||
## copy the default target for this platform to gdk-2.0.pc and gtk+-2.0.pc
|
||||
DEFAULT_GDKTARGET=x11
|
||||
@@ -218,7 +163,7 @@ dist-hook:
|
||||
&& cp INSTALL README $(distdir) ; \
|
||||
fi
|
||||
|
||||
.PHONY: files release sanity snapshot ChangeLog
|
||||
.PHONY: files release sanity snapshot
|
||||
|
||||
files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
@@ -242,16 +187,5 @@ sanity:
|
||||
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
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
|
||||
|
@@ -1,82 +0,0 @@
|
||||
# GTK+ - The GIMP Toolkit
|
||||
|
||||
GTESTER = gtester # in $PATH for non-GLIB packages
|
||||
GTESTER_REPORT = gtester-report # in $PATH for non-GLIB packages
|
||||
|
||||
# initialize variables for unconditional += appending
|
||||
EXTRA_DIST =
|
||||
TEST_PROGS =
|
||||
|
||||
### testing rules
|
||||
|
||||
# Xvfb based test rules
|
||||
XVFB = Xvfb -ac -noreset -screen 0 800x600x16
|
||||
XIDS = 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 \
|
||||
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 \
|
||||
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 \
|
||||
1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 \
|
||||
9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 \
|
||||
9995 9996 9997 9998 9999
|
||||
SKIP_GDKTARGET = \
|
||||
test "$(gdktarget)" != "x11" \
|
||||
&& echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
|
||||
XVFB_START = \
|
||||
${XVFB} -help 2>/dev/null 1>&2 \
|
||||
&& XID=`for id in $(XIDS) ; do test -e /tmp/.X$$id-lock || { echo $$id; exit 0; }; done; exit 1` \
|
||||
&& { ${XVFB} :$$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & \
|
||||
trap "kill -15 $$! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } \
|
||||
|| { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } \
|
||||
&& DISPLAY=:$$XID && export DISPLAY
|
||||
# call as: $(XVFB_START) && someprogram
|
||||
|
||||
# test: run all tests in cwd and subdirs
|
||||
test: ${TEST_PROGS}
|
||||
@$(SKIP_GDKTARGET) || test -z "${TEST_PROGS}" || { \
|
||||
$(XVFB_START) && { set -e; ${GTESTER} --verbose ${TEST_PROGS}; }; \
|
||||
}
|
||||
@ for subdir in $(SUBDIRS) ; do \
|
||||
test "$$subdir" = "." -o "$$subdir" = "po" -o "$$subdir" = "po-properties" || \
|
||||
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
|
||||
done
|
||||
# test-report: run tests in subdirs and generate report
|
||||
# perf-report: run tests in subdirs with -m perf and generate report
|
||||
# full-report: like test-report: with -m perf and -m slow
|
||||
test-report perf-report full-report: ${TEST_PROGS}
|
||||
@ ignore_logdir=true ; \
|
||||
if test -z "$$GTESTER_LOGDIR" ; then \
|
||||
GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
|
||||
ignore_logdir=false ; \
|
||||
fi ; \
|
||||
for subdir in $(SUBDIRS) ; do \
|
||||
test "$$subdir" = "." -o "$$subdir" = "po" -o "$$subdir" = "po-properties" || \
|
||||
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
|
||||
done ; \
|
||||
$(SKIP_GDKTARGET) || test -z "${TEST_PROGS}" || { \
|
||||
case $@ in \
|
||||
test-report) test_options="-k";; \
|
||||
perf-report) test_options="-k -m=perf";; \
|
||||
full-report) test_options="-k -m=perf -m=slow";; \
|
||||
esac ; \
|
||||
$(XVFB_START) && { \
|
||||
set -e; \
|
||||
if test -z "$$GTESTER_LOGDIR" ; then \
|
||||
${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
|
||||
elif test -n "${TEST_PROGS}" ; then \
|
||||
${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
|
||||
fi ; \
|
||||
}; \
|
||||
}; \
|
||||
$$ignore_logdir || { \
|
||||
echo '<?xml version="1.0"?>' > $@.xml ; \
|
||||
echo '<report-collection>' >> $@.xml ; \
|
||||
for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
|
||||
sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
|
||||
done ; \
|
||||
echo >> $@.xml ; \
|
||||
echo '</report-collection>' >> $@.xml ; \
|
||||
rm -rf "$$GTESTER_LOGDIR"/ ; \
|
||||
${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
|
||||
}
|
||||
.PHONY: test test-report perf-report full-report
|
||||
# run make test as part of make check
|
||||
check-local: test
|
158
README
Normal file
158
README
Normal file
@@ -0,0 +1,158 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.8.10. GTK+ is a multi-platform toolkit for
|
||||
creating graphical user interfaces. Offering a complete set of widgets,
|
||||
GTK+ is suitable for projects ranging from small one-off projects to
|
||||
complete application suites.
|
||||
|
||||
GTK+ is free software and part of the GNU Project. However, the
|
||||
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
|
||||
developers, including those developing proprietary software, without any
|
||||
license fees or royalties.
|
||||
|
||||
The official ftp site is:
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
|
||||
The official web site is:
|
||||
http://www.gtk.org/
|
||||
|
||||
Information about mailing lists can be found at
|
||||
http://www.gtk.org/mailinglists.html
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
See the file 'INSTALL'
|
||||
|
||||
Release notes
|
||||
=============
|
||||
|
||||
* GTK+ 2.6 supports clipboard persistency. To make use of this feature,
|
||||
a clipboard manager following the specification at
|
||||
http://www.freedesktop.org/wiki/Standards/clipboard-manager-spec
|
||||
must be running. A sample implementation of such a clipboard manager
|
||||
is available at
|
||||
http://people.imendio.com/andersca/archives/clipboard-manager-0.3.tar.gz
|
||||
Applications can use the function gdk_display_supports_clipboard_persistence()
|
||||
to find out if clipboard persistence is available.
|
||||
|
||||
* Notification on clipboard ownership changes via GdkOwnerChange events
|
||||
requires the XFIXES X extension. Applications can use the function
|
||||
gdk_display_supports_selection_notification() to find out if ownerchip
|
||||
change notification is available.
|
||||
|
||||
* The icon theme code in GTK+ 2.6 follows the freedesktop.org icon theme
|
||||
specification. Setting the XDG_DATA_DIRS environtment variable may be
|
||||
necessary if your icons aren't installed in the default location
|
||||
/usr/share/icons.
|
||||
|
||||
* The icon theme code in GTK+ 2.6 can make use of mmap()able cache files
|
||||
to avoid a lot of disk searching overhead. GTK+ includes a utility named
|
||||
gtk-update-icon-cache to generate these cache files. For further details,
|
||||
see the gtk-update-icon-cache man page or the GTK+ documentation.
|
||||
|
||||
* To reduce code size and improve efficiency, GTK+, when compiled
|
||||
with the GNU toolchain, has separate internal and external entry
|
||||
points for exported functions. The internal names, which begin with
|
||||
IA__, may be seen when debugging a GTK+ program.
|
||||
|
||||
* The following functions have been deprecated in GTK+ 2.6:
|
||||
gdk_pango_context_set_colormap
|
||||
gtk_cell_renderer_editing_canceled
|
||||
|
||||
* The new GtkFileChooser widget emphasizes simplicity and thus does
|
||||
not provide a navigation entry by default when opening files.
|
||||
Experienced command line users will likely want to make heavy use of
|
||||
the location dialog brought up by the Control-L key shortcut.
|
||||
|
||||
* The GTK+ libraries use an '_' prefix to indicate private symbols that
|
||||
must not be used by applications. On some platforms, symbols beginning
|
||||
with prefixes such as _gtk, _gdk, and _pango will be exported
|
||||
from the library, on others not. In no case can applications
|
||||
use these private symbols. In addition to that, GTK+ 2.6 makes several
|
||||
symbols private which were not in any installed header files and
|
||||
were never intended to be exported.
|
||||
|
||||
* The gdk_pixbuf_xlib library included in the contrib/ directory
|
||||
and the framebuffer GDK backend included in the gdk/linux-fb directory
|
||||
of GTK+ are provided on an as-is basis and have not been tested at all.
|
||||
No guarantees about the degree of workingness or about future
|
||||
compatibility are provided.
|
||||
|
||||
* On Unix, the assumption of GLib and GTK+ by default is that filenames on
|
||||
the filesystem are encoded in UTF-8 rather than the encoding of the locale;
|
||||
the GTK+ developers consider that having filenames whose interpretation
|
||||
depends on the current locale is fundamentally a bad idea.
|
||||
|
||||
If you have filenames encoded in the encoding of your locale, then you
|
||||
may want to set the G_FILENAME_ENCODING environment variable:
|
||||
|
||||
G_FILENAME_ENCODING=@locale
|
||||
export G_FILENAME_ENCODING
|
||||
|
||||
(Earlier versions of GLib 2.x required a different environment variable
|
||||
setting; G_BROKEN_FILENAMES=1 to achieve the same effect; this
|
||||
is still supported, but G_FILENAME_ENCODING is preferred.)
|
||||
Best integration of GTK+ 2.6 with the environment is achieved by
|
||||
using a UTF-8 locale.
|
||||
|
||||
On Windows, filenames passed to GTK+ should always be in UTF-8, as
|
||||
in GLib 2.6. This is different than in previous versions of GTK+
|
||||
where the system codepage was used. As in GLib, for DLL ABI
|
||||
stability, applications built against previous versions of GTK+ will
|
||||
use entry points providing the old semantics.
|
||||
|
||||
When compiling against GTK+ 2.6, applications intended to be
|
||||
portable to Windows must take the UTF-8 file name encoding into
|
||||
consideration, and use the gstdio wrappers to access files whose
|
||||
names have been constructed from strings returned from GTK+ or GLib.
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
Bugs should be reported to the GNOME bug tracking system.
|
||||
(http://bugzilla.gnome.org, product gtk+.) You will need to create an
|
||||
account for yourself.
|
||||
|
||||
In the bug report please include:
|
||||
|
||||
* Information about your system. For instance:
|
||||
|
||||
- What operating system and version
|
||||
- What version of X
|
||||
- For Linux, what version of the C library
|
||||
|
||||
And anything else you think is relevant.
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
If you can reproduce it with one of the tests or demos built with GTK+,
|
||||
such as demos/gtk-demo/gtk-demo, that would be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior. As a
|
||||
last resort, you can also provide a pointer to a larger piece of software
|
||||
that can be downloaded.
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out when the
|
||||
crash occured.
|
||||
|
||||
* Further information such as stack traces may be useful, but is not
|
||||
necessary. If you do send a stack trace, and the error is an X error,
|
||||
it will be more useful if the stacktrace is produced running the test
|
||||
program with the --sync command line option.
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Patches should also be submitted to bugzilla.gnome.org. If the patch
|
||||
fixes an existing bug, add the patch as an attachment to that bug
|
||||
report.
|
||||
|
||||
Otherwise, enter a new bug report that describes the patch, and attach
|
||||
the patch to that bug report.
|
||||
|
||||
Bug reports containing patches should include the PATCH keyword in their
|
||||
keyword fields. If the patch adds to or changes the GTK+ programming
|
||||
interface, the API keyword should also be included.
|
||||
|
||||
Patches should be in unified diff form. (The -u option to GNU diff.)
|
@@ -1,72 +0,0 @@
|
||||
GTK+ is part of the GNOME git repository. At the current time, any
|
||||
person with write access to the GNOME repository, can make changes to
|
||||
GTK+. This is a good thing, in that it encourages many people to work
|
||||
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
|
||||
large and complicated package that many other things depend on, so to
|
||||
avoid unnecessary breakage, and to take advantage of the knowledge
|
||||
about GTK+ that has been built up over the years, we'd like to ask
|
||||
people committing to GTK+ to follow a few rules:
|
||||
|
||||
0) Ask first. If your changes are major, or could possibly break existing
|
||||
code, you should always ask. If your change is minor and you've
|
||||
been working on GTK+ for a while it probably isn't necessary
|
||||
to ask. But when in doubt, ask. Even if your change is correct,
|
||||
somebody may know a better way to do things.
|
||||
|
||||
If you are making changes to GTK+, you should be subscribed
|
||||
to gtk-devel-list@gnome.org. (Subscription address:
|
||||
gtk-devel-list-request@gnome.org.) This is a good place to ask
|
||||
about intended changes.
|
||||
|
||||
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
|
||||
is also a good place to find GTK+ developers to discuss changes with,
|
||||
however, email to gtk-devel-list is the most certain and preferred
|
||||
method.
|
||||
|
||||
1) Ask _first_.
|
||||
|
||||
2) With git, we no longer maintain a ChangeLog file, but you are expected
|
||||
to produce a meaningful commit message. Changes without a sufficient
|
||||
commit message will be reverted. See below for the expected format
|
||||
of commit messages.
|
||||
|
||||
Notes:
|
||||
|
||||
* When developing larger features or complicated bug fixes, it is
|
||||
advisable to work in a branch in your own cloned GTK+ repository.
|
||||
You may even consider making your repository publically available
|
||||
so that others can easily test and review your changes.
|
||||
|
||||
* The expected format for git commit messages is as follows:
|
||||
|
||||
=== begin example commit ===
|
||||
Short explanation of the commit
|
||||
|
||||
Longer explanation explaining exactly what's changed, whether any
|
||||
external or private interfaces changed, what bugs were fixed (with bug
|
||||
tracker reference if applicable) and so forth. Be concise but not too brief.
|
||||
=== end example commit ===
|
||||
|
||||
- Always add a brief description of the commit to the _first_ line of
|
||||
the commit and terminate by two newlines (it will work without the
|
||||
second newline, but that is not nice for the interfaces).
|
||||
|
||||
- First line (the brief description) must only be one sentence and
|
||||
should start with a capital letter unless it starts with a lowercase
|
||||
symbol or identifier. Don't use a trailing period either. Don't exceed
|
||||
72 characters.
|
||||
|
||||
- The main description (the body) is normal prose and should use normal
|
||||
punctuation and capital letters where appropriate. Normally, for patches
|
||||
sent to a mailing list it's copied from there.
|
||||
|
||||
- When committing code on behalf of others use the --author option, e.g.
|
||||
git commit -a --author "Joe Coder <joe@coder.org>" and --signoff.
|
||||
|
||||
|
||||
Owen Taylor
|
||||
13 Aug 1998
|
||||
17 Apr 2001
|
||||
|
||||
Matthias Clasen
|
||||
31 Mar 2009
|
54
README.cvs-commits
Normal file
54
README.cvs-commits
Normal file
@@ -0,0 +1,54 @@
|
||||
GTK+ is part of the GNOME CVS repository. At the current time, any
|
||||
person with write access to the GNOME repository, can make changes to
|
||||
GTK+. This is a good thing, in that it encourages many people to work
|
||||
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
|
||||
large and complicated package that many other things depend on, so to
|
||||
avoid unnecessary breakage, and to take advantage of the knowledge
|
||||
about GTK+ that has been built up over the last 4 years, we'd like
|
||||
to ask people commiting to GTK+ to follow a few rules:
|
||||
|
||||
0) Ask first. If your changes are major, or could possibly break existing
|
||||
code, you should always ask. If your change is minor and you've
|
||||
been working on GTK+ for a while it probably isn't necessary
|
||||
to ask. But when in doubt, ask. Even if your change is correct,
|
||||
somebody may know a better way to do things.
|
||||
|
||||
If you are making changes to GTK+, you should be subscribed
|
||||
to gtk-devel-list@gnome.org. (Subscription address:
|
||||
gtk-devel-list-request@gnome.org.) This is a good place to ask
|
||||
about intended changes.
|
||||
|
||||
#gtk+ on GIMPNet (irc.gimp.org, irc.us.gimp.org, irc.eu.gimp.org, ...)
|
||||
is also a good place to find GTK+ developers to discuss changes with,
|
||||
however, email to gtk-devel-list is the most certain and preferred
|
||||
method.
|
||||
|
||||
1) Ask _first_.
|
||||
|
||||
2) There must be a ChangeLog for every commit. (If you discover that
|
||||
you only committed half the files you meant to and need to fix that
|
||||
up, or something, you don't need a new ChangeLog entry. But in general,
|
||||
ChangeLog entries are mandatory.) Changes with out ChangeLog entries
|
||||
will be reverted.
|
||||
|
||||
3) There _must_ be a ChangeLog for every commit.
|
||||
|
||||
Notes:
|
||||
|
||||
* If you are going to be changing many files in an experimental fashion,
|
||||
it probably is a good idea to create a separate branch for your changes.
|
||||
|
||||
* The ChangeLog entries should preferrably match in date format
|
||||
with the existing entries. You can set how emacs does this
|
||||
by using customize mode:
|
||||
|
||||
- M-x customize
|
||||
- set Programming/Tools/ChangeLog/Add Log Time Format to
|
||||
'Old Format'
|
||||
|
||||
Or, set the add-log-time-format to 'current-time-string in
|
||||
your .emacs file.
|
||||
|
||||
Owen Taylor
|
||||
13 Aug 1998
|
||||
17 Apr 2001
|
301
README.in
301
README.in
@@ -20,302 +20,13 @@ The official web site is:
|
||||
Information about mailing lists can be found at
|
||||
http://www.gtk.org/mailinglists.html
|
||||
|
||||
|
||||
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.
|
||||
|
||||
* JPEG2000 support is no longer enabled by default. It must be
|
||||
explicitly turned on, by passing --with-libjasper to configure.
|
||||
|
||||
* GDK has been reworked to implement 'client-side windows'. This offers
|
||||
exciting new possibilities, such as transformed, offscreen rendering,
|
||||
but it breaks some long-standing assumptions that applications may
|
||||
have about GDK windows. Setting the environment variable
|
||||
GDK_NATIVE_WINDOWS makes GDK create a native X11 window for each
|
||||
GDK window, which might make problematic applications work better.
|
||||
|
||||
* GTK+ calls signal (SIGPIPE, SIG_IGN) during initialization, to ignore
|
||||
SIGPIPE signals, since these are almost never wanted in graphical
|
||||
applications. If you do need to handle SIGPIPE for some reason, reset
|
||||
the handler after gtk_init(), but notice that other libraries (e.g.
|
||||
libdbus or gvfs) might do similar things.
|
||||
|
||||
Release notes for 2.16
|
||||
======================
|
||||
|
||||
* Password entries now display a caps-lock warning. This can be turned off
|
||||
with the caps-lock-warning property.
|
||||
|
||||
* Various orientation-related functions have been deprecated in favour
|
||||
of the new GtkOrientable interface: gtk_scale_button_get_orientation,
|
||||
gtk_scale_button_set_orientation, gtk_toolbar_set_orientation.
|
||||
|
||||
* The action-proxy interaction has been changed. Widgets that operate as
|
||||
proxies have to implement the GtkActivatable interface now. GtkActivatable
|
||||
implementation are responsible for syncing their appearance with the
|
||||
action and for activating the action. All GTK+ widgets that are commonly
|
||||
used as proxies implement the GtkActivatable interface.
|
||||
|
||||
* The handling of keyboard shortcuts has been changed, to help with a
|
||||
longstanding complaint about the way GTK+ handles multiple layouts. GTK+
|
||||
now only uses keys from groups other than the current group if they are
|
||||
not present in the current group.
|
||||
|
||||
Release notes for 2.14
|
||||
======================
|
||||
|
||||
* gtkitemfactory.h is now completely deprecated.
|
||||
As gtkactiongroup.h and gtkstock.h no longer include the gtkitemfactory.h
|
||||
header, this might break application using gtk_item_factory_* symbols
|
||||
without including gtkitemfactory.h - even though this behaviour has never
|
||||
been supported in the first place.
|
||||
|
||||
* The GtkFileSystem semi-private interface has been removed.
|
||||
The GTK+ filechooser implementation now uses GIO directly, which has
|
||||
rendered external filesystem implementations unnecessary. Consequently,
|
||||
the GtkFileSystem interface is no longer available, nor the filechooser
|
||||
will load any GtkFileSystem implementation.
|
||||
|
||||
* GtkComboBox now renders the popdown button insensitive when
|
||||
the model is empty. Applications which want to populate the list
|
||||
only before displaying it can set gtk_combo_box_set_button_sensitivity
|
||||
to GTK_SENSITIVITY_ON, so that the button is always sensitive or
|
||||
GTK_SENSITIVITY_OFF to make it insensitive respectively.
|
||||
|
||||
* In the early 2.14.x releases, GtkAdjustment was changed to enforce
|
||||
that values are restricted to the range [lower, upper - page_size].
|
||||
This has always been the documented behaviour, and the recommended
|
||||
practice is to set page_size to 0 when using adjustments for simple
|
||||
scalar values, like in a slider or spin button.
|
||||
Due to the large number of applications that are affected by this
|
||||
change, the behaviour has been reverted to the old behaviour in
|
||||
2.14.3, with an explicit warning that this change will be
|
||||
reintroduced in 2.90.
|
||||
|
||||
* gdk-pixbuf will use GIO for mime type detection if possible. For
|
||||
this to work, shared-mime-info needs to be installed and XDG_DATA_DIRS
|
||||
set accordingly at configure time. Otherwise, gdk-pixbuf falls
|
||||
back to its built-in sniffing implementation.
|
||||
|
||||
Release notes for 2.12
|
||||
======================
|
||||
|
||||
* gtk_about_dialog_get/set_name() were deprecated in favour of
|
||||
gtk_about_dialog_get/set_program_name(), the GtkAboutDialog now uses the
|
||||
"program-name" property instead of the conflicting "name" property.
|
||||
|
||||
* The gdk-pixbuf tiff loader now requires libtiff 3.6.0 or later.
|
||||
|
||||
* Support for Windows 9x/ME has officially been removed. It hasn't worked
|
||||
since 2.6 anyway.
|
||||
|
||||
* The GtkTextBufferTargetInfo enumeration values have been changed from
|
||||
G_MAXUINT-0, G_MAXUINT-1, G_MAXUINT-2, etc, to -1, -2, -3 to stay within
|
||||
ANSI C limits.
|
||||
|
||||
* A change in the handling of _NET_WM_USER_TIME properties on toplevel
|
||||
windows can cause deadlock problems with window managers that are using
|
||||
GDK for drawing decorations. In particular, metacity <= 2.18.0 is affected
|
||||
by this. The problem has been fixed in metacity 2.18.1.
|
||||
|
||||
* Semi-private GtkTextLayout api has changed: new GtkTextLayout method
|
||||
invalidate_cursors(), and new functions gtk_text_layout_invalidate_cursors()
|
||||
and gtk_text_layout_cursors_changed(), which should be used in place of
|
||||
gtk_text_layout_invalidate() and gtk_text_layout_changed() if invalidation
|
||||
is due to marks moved or changed selection; new GtkTextLineDisplay structure
|
||||
member. Source compatibility is preserved; binary compatibility may break
|
||||
only if GtkTextLineDisplay structure was created on stack or as a part
|
||||
of another structure (in particular GnomeCanvas and its clones do not need
|
||||
recompiling).
|
||||
|
||||
* Another new signal has been added to GtkNotebook. The new signal
|
||||
is called create-window, so this name can no longer be used for signals
|
||||
in objects derived from GtkNotebook.
|
||||
|
||||
* The gtk_notebook_set/get_group_id() functions were found to be insufficient
|
||||
and have been deprecated in favour of gtk_notebook_set/get_group().
|
||||
|
||||
* The move-focus signal has been moved to GtkWidget, to unify the
|
||||
various implementations of this signal in specific widgets. Great care
|
||||
has been taken to make sure that all code using this signal continues
|
||||
to work.
|
||||
|
||||
* An unused and hardly visible GtkFrame has been removed from the menu
|
||||
widget hierarchy when GtkComboBox::appears-as-list style property is
|
||||
set. Any RC file applying a different style to any widget below the
|
||||
widget path "gtk-combobox-popup-window.GtkFrame" should take into
|
||||
account that the frame no longer exists.
|
||||
|
||||
* The external print preview application used by GtkPrintOperationPreview
|
||||
is now passed the print settings on the command line with the
|
||||
--print-settings parameter pointing to a temp file containing the
|
||||
settings. The preview application assumes ownership of the file and
|
||||
should delete it once it does not need it anymore. The --print-settings
|
||||
commandline option is understood by Evince 0.9.0 and newer. To use a
|
||||
different print preview application, change the gtk-print-preview-command
|
||||
setting in your gtkrc file, e.g. gtk-print-preview-command = "ggv %f"
|
||||
|
||||
* GtkMenuShell is now defined as an abstract type. It was already
|
||||
documented as an abstract class, and there is little reason to
|
||||
instantiate it.
|
||||
|
||||
* The GtkTooltips struct (this is the old tooltips API) is now considered
|
||||
private. Code that used to access this struct, in particular the
|
||||
tips_data_list field, will need to change. All of the old tooltips
|
||||
API has been deprecated in favour of a new implementation and
|
||||
API. This affects all of the gtk_tooltips_ functions, and functions
|
||||
which take a GtkTooltips argument, such as gtk_tool_item_set_tooltip()
|
||||
and gtk_menu_tool_button_set_arrow_tooltip().
|
||||
|
||||
* The memory management of the GtkRecentManager object has been changed,
|
||||
as using the screen didn't guarantee that the singleton instance was
|
||||
correctly destroyed. The screen-related functions have been deprecated,
|
||||
and should not be used anymore; the GtkRecentManager instance returned by
|
||||
the gtk_recent_manager_get_default() function is guaranteed to be valid
|
||||
for the entire lifetime of an application.
|
||||
|
||||
* A number of interfaces that have been superseded by newer interfaces for
|
||||
a long time have finally been deprecated. This includes
|
||||
gtk_widget_ref/unref(), gtk_rc_style_ref/unref() and the old file selector.
|
||||
|
||||
* The various coordinate systems in use in GtkTreeView widgets have
|
||||
been clarified in the documentation, and in the cause of doing so,
|
||||
the functions gtk_tree_view_widget_to_tree_coords() and
|
||||
gtk_tree_view_tree_to_widget_coords() have been deprecated in
|
||||
favour of a new family of gtk_tree_view_convert_ functions.
|
||||
|
||||
* gtk_menu_item_remove_submenu() has been deprecated in favour of
|
||||
gtk_menu_item_set_submenu (..., NULL).
|
||||
|
||||
* gtk_default_draw_check() has been fixed to really decrease the
|
||||
indicator size by one pixel to ensure an odd size instead of
|
||||
accidentially increasing it.
|
||||
Consequently, gtk_cell_renderer_toggle_render() could be fixed to
|
||||
not subtract 1 from the size passed to gtk_paint_option(), which
|
||||
was just a workaround for above off-by-two for even sizes (theme
|
||||
engines now get the real indicator size passed).
|
||||
The default toggle size of GtkCheckMenuItem and GtkCellRendererToggle
|
||||
has been changed to 13 to be consistent with GtkCheckButton.
|
||||
The only visible change with default settings is that the indicator in
|
||||
GtkCellRendererToggle has changed its size from 11 to 13 and is now
|
||||
consistent with menus and toggle buttons.
|
||||
|
||||
* GTK+ has always required that gtk_init() (or a variant thereof) is
|
||||
called before any other GTK+ function. Some applications call functions
|
||||
like gtk_clipboard_get() to check if they need to call gtk_init(),
|
||||
anyway. A change in GLib 2.14 has recently broken this unsupported
|
||||
practise. It is worth pointing out that calling gtk_init() twice
|
||||
does no harm.
|
||||
|
||||
|
||||
Release notes for 2.10
|
||||
======================
|
||||
|
||||
* The hexadecimal Unicode input feature has been reworked. It no longer
|
||||
blocks the use of the sixteen Ctrl-Shift-<hex digit> key sequences. Now
|
||||
it only uses Ctrl-Shift-u.
|
||||
|
||||
* A memory leak in GtkStyle handling has been fixed. This may expose bugs
|
||||
in third-party widgets which forget to call gtk_style_attach() in their
|
||||
realize functions.
|
||||
|
||||
* Range widgets like GtkScrollbar now render their arrows insensitive
|
||||
when the slider is at the end. Applications which react to arrow
|
||||
clicks even if the slider is at the end may want to use the new
|
||||
gtk_range_set_[upper/lower]_stepper_sensitivity() functions to
|
||||
prevent the arrows from being rendered insensitive.
|
||||
|
||||
* GtkObject now uses the "floating reference" support in GObject.
|
||||
GTK_OBJECT_IS_FLOATING() will still work, but direct checking
|
||||
of the GTK_FLOATING flag will no longer detect the floating
|
||||
reference. Details about floating references can be found in the docs:
|
||||
http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#floating-ref
|
||||
|
||||
* Accelerators like (_F) are now stripped from labels when they are
|
||||
displayed in toolbars. If this is not wanted, the feature can be
|
||||
suppressed by inserting a Unicode control character, e.g ZWNJ.
|
||||
|
||||
* The pixbuf theme engine can now customize expanders (in GtkTreeView
|
||||
and GtkExpander) and resize grips, using the new EXPANDER and
|
||||
RESIZE_GRIP function values.
|
||||
|
||||
* Dialogs created by gtk_about_dialog_new() no longer hide automatically
|
||||
when the user clicks close. It is the applications responsibility to
|
||||
hide or destroy the dialog.
|
||||
|
||||
* Several new signals have been added to GtkNotebook. Care has been taken
|
||||
to choose signal names which do not collide with signals added by well-known
|
||||
derived classes. The names which can no longer be used for signals in
|
||||
objects derived from GtkNotebook are page-reordered, page-removed and
|
||||
page-added.
|
||||
|
||||
* Due to the interface changes in the file chooser backend interface,
|
||||
the GTK+ ABI version has been bumped to 2.10.0. Third-party filesystem
|
||||
backends have to be ported to the new interface, other modules, such as
|
||||
theme engines, input method modules or pixbuf loaders have to be rebuilt
|
||||
so that they are installed in the right place for GTK+ to find them.
|
||||
|
||||
|
||||
Release notes for 2.8
|
||||
=====================
|
||||
|
||||
* GTK+ 2.8 and Pango 1.10 require the cairo library.
|
||||
|
||||
* The default theme has been renamed to "Raleigh". Existing configurations
|
||||
specifying the "Default" theme name should still work.
|
||||
|
||||
* The GtkTreeView::enable-search property has been changed to control
|
||||
only typeahead search, not the C-f keybinding to start an interactive
|
||||
search. To turn off interactive searching completely, you have to
|
||||
set GtkTreeView::search-column to -1.
|
||||
|
||||
* The restriction on using the same cell renderer in multiple columns
|
||||
of a GtkTreeView is now more strictly enforced.
|
||||
|
||||
* In GTK+ 2.8, GtkCalendar uses nl_langinfo() (if available) to determine
|
||||
the first day of the week. Thus, it is possible to select the first day
|
||||
of the week independently from the language, by setting LC_TIME.
|
||||
|
||||
* In GTK+ 2.8, the gtk-update-icon-cache utility includes image data
|
||||
in the icon caches, which will make the icon cache files larger than
|
||||
the one produced by GTK+ 2.6. This change will reduce the memory
|
||||
overhead of icon themes at runtime, since all GTK+ applications can
|
||||
share the image data in memory.
|
||||
|
||||
* In 2.8, GDK emits GdkEventGrabBroken events when a keyboard or pointer
|
||||
grab is broken. On X11, this can happen if the same application grabs
|
||||
again, or if the window used for the grab becomes unviewable. It happens
|
||||
more often on Win32. Applications which use grabs should pay attention
|
||||
to these events and do the necessary cleanups when the grab is lost.
|
||||
* The GIOChannel code for sockets on win32 has been rewritten.
|
||||
Applications who make non-trivial use of GIOChannels on win32 should
|
||||
be watched for possible problems.
|
||||
|
||||
* GLib 2.8 uses atomic operations to implement reference counting, thus
|
||||
g_object_ref/unref, g_closure_ref/sink/unref and g_iochannel_ref/unref
|
||||
can be used without locking in multithreaded applications. Note that
|
||||
other modifications, like concurrent setting of properties still require
|
||||
locking.
|
||||
|
||||
* g_convert() and related character set conversion functions have been
|
||||
fixed to emit pending shift states and to not cache iconv descriptors
|
||||
across multiple calls, since that is problematic for some encodings.
|
||||
Note that these functions are not suitable for streaming conversions;
|
||||
use g_iconv() to do streaming conversion.
|
||||
|
||||
|
||||
Release notes for 2.6
|
||||
=====================
|
||||
Release notes
|
||||
=============
|
||||
|
||||
* GTK+ 2.6 supports clipboard persistency. To make use of this feature,
|
||||
a clipboard manager following the specification at
|
||||
@@ -397,7 +108,6 @@ Release notes for 2.6
|
||||
consideration, and use the gstdio wrappers to access files whose
|
||||
names have been constructed from strings returned from GTK+ or GLib.
|
||||
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
@@ -431,7 +141,6 @@ In the bug report please include:
|
||||
it will be more useful if the stacktrace is produced running the test
|
||||
program with the --sync command line option.
|
||||
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
@@ -442,4 +151,8 @@ report.
|
||||
Otherwise, enter a new bug report that describes the patch, and attach
|
||||
the patch to that bug report.
|
||||
|
||||
Patches should be in unified diff form. (The -up option to GNU diff.)
|
||||
Bug reports containing patches should include the PATCH keyword in their
|
||||
keyword fields. If the patch adds to or changes the GTK+ programming
|
||||
interface, the API keyword should also be included.
|
||||
|
||||
Patches should be in unified diff form. (The -u option to GNU diff.)
|
||||
|
277
README.win32
277
README.win32
@@ -1,184 +1,93 @@
|
||||
The Win32 backend in GTK+ is not as stable or correct as the X11 one.
|
||||
|
||||
For prebuilt runtime and developer packages see
|
||||
http://ftp.gnome.org/pub/gnome/binaries/win32/
|
||||
|
||||
Building GTK+ on Win32
|
||||
======================
|
||||
|
||||
First you obviously need developer packages for the compile-time
|
||||
dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,
|
||||
zlib, libtiff at least. See
|
||||
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
|
||||
|
||||
After installing the dependencies, there are two ways to build GTK+
|
||||
for win32.
|
||||
|
||||
1) GNU tools, ./configure && make install
|
||||
-----------------------------------------
|
||||
|
||||
This requires you have mingw and MSYS.
|
||||
|
||||
Use the configure script, and the resulting Makefiles (which use
|
||||
libtool and gcc to do the compilation). I use this myself, but it can
|
||||
be hard to setup correctly.
|
||||
|
||||
The full script I run to build GTK+ 2.16 unpacked from a source
|
||||
distribution is as below. This is from bulding GTK+ 2.16.5. I don't
|
||||
use any script like this to build the development branch, as I don't
|
||||
distribute any binaries from development branches.
|
||||
|
||||
# This is a shell script that calls functions and scripts from
|
||||
# tml@iki.fi's personal work env<6E>ronment. It is not expected to be
|
||||
# usable unmodified by others, and is included only for reference.
|
||||
|
||||
MOD=gtk+
|
||||
VER=2.16.5
|
||||
REV=1
|
||||
ARCH=win32
|
||||
|
||||
THIS=${MOD}_${VER}-${REV}_${ARCH}
|
||||
|
||||
RUNZIP=${MOD}_${VER}-${REV}_${ARCH}.zip
|
||||
DEVZIP=${MOD}-dev_${VER}-${REV}_${ARCH}.zip
|
||||
|
||||
HEX=`echo $THIS | md5sum | cut -d' ' -f1`
|
||||
TARGET=c:/devel/target/$HEX
|
||||
|
||||
usedev
|
||||
usemsvs6
|
||||
|
||||
(
|
||||
|
||||
set -x
|
||||
|
||||
DEPS=`latest --arch=${ARCH} glib atk cairo pango libpng zlib libtiff jpeg`
|
||||
PROXY_LIBINTL=`latest --arch=${ARCH} proxy-libintl`
|
||||
|
||||
PKG_CONFIG_PATH=
|
||||
for D in $DEPS; do
|
||||
PATH=/devel/dist/${ARCH}/$D/bin:$PATH
|
||||
[ -d /devel/dist/${ARCH}/$D/lib/pkgconfig ] && PKG_CONFIG_PATH=/devel/dist/${ARCH}/$D/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||
done
|
||||
|
||||
LIBPNG=`latest --arch=${ARCH} libpng`
|
||||
ZLIB=`latest --arch=${ARCH} zlib`
|
||||
LIBTIFF=`latest --arch=${ARCH} libtiff`
|
||||
JPEG=`latest --arch=${ARCH} jpeg`
|
||||
|
||||
patch -p0 <<'EOF'
|
||||
EOF
|
||||
|
||||
lt_cv_deplibs_check_method='pass_all' \
|
||||
CC='gcc -mtune=pentium3 -mthreads' \
|
||||
CPPFLAGS="-I/devel/dist/${ARCH}/${LIBPNG}/include \
|
||||
-I/devel/dist/${ARCH}/${ZLIB}/include \
|
||||
-I/devel/dist/${ARCH}/${LIBTIFF}/include \
|
||||
-I/devel/dist/${ARCH}/${JPEG}/include \
|
||||
-I/devel/dist/${ARCH}/${PROXY_LIBINTL}/include" \
|
||||
LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
|
||||
-L/devel/dist/${ARCH}/${ZLIB}/lib \
|
||||
-L/devel/dist/${ARCH}/${LIBTIFF}/lib \
|
||||
-L/devel/dist/${ARCH}/${JPEG}/lib \
|
||||
-L/devel/dist/${ARCH}/${PROXY_LIBINTL}/lib -Wl,--exclude-libs=libintl.a \
|
||||
-Wl,--enable-auto-image-base" \
|
||||
LIBS=-lintl \
|
||||
CFLAGS=-O2 \
|
||||
./configure \
|
||||
--with-gdktarget=win32 \
|
||||
--disable-gdiplus \
|
||||
--with-included-immodules \
|
||||
--without-libjasper \
|
||||
--enable-debug=yes \
|
||||
--enable-explicit-deps=no \
|
||||
--disable-gtk-doc \
|
||||
--disable-static \
|
||||
--prefix=$TARGET &&
|
||||
|
||||
libtoolcacheize &&
|
||||
rm gtk/gtk.def &&
|
||||
(PATH="$PWD/gdk-pixbuf/.libs:/devel/target/$HEX/bin:$PATH" make -j3 install || (rm .libtool-cache* && PATH="/devel/target/$HEX/bin:$PATH" make -j3 install)) &&
|
||||
|
||||
PATH="/devel/target/$HEX/bin:$PATH" gdk-pixbuf-query-loaders >/devel/target/$HEX/etc/gtk-2.0/gdk-pixbuf.loaders &&
|
||||
|
||||
grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
|
||||
mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
|
||||
grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
|
||||
mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&
|
||||
|
||||
./gtk-zip.sh &&
|
||||
|
||||
mv /tmp/${MOD}-${VER}.zip /tmp/$RUNZIP &&
|
||||
mv /tmp/${MOD}-dev-${VER}.zip /tmp/$DEVZIP
|
||||
|
||||
) 2>&1 | tee /devel/src/tml/packaging/$THIS.log
|
||||
|
||||
(cd /devel && zip /tmp/$DEVZIP src/tml/packaging/$THIS.{sh,log}) &&
|
||||
manifestify /tmp/$RUNZIP /tmp/$DEVZIP
|
||||
|
||||
You should not just copy the above blindly. There are some things in
|
||||
the script that are very specific to *my* build setup on *my* current
|
||||
machine. For instance the "latest" command, the "usedev" and
|
||||
"usemsvs6" shell functions, the /devel/dist folder. The above script
|
||||
is really just meant for reference, to give an idea. You really need
|
||||
to understand what things like PKG_CONFIG_PATH are and set them up
|
||||
properly after installing the dependencies before building GTK+.
|
||||
|
||||
As you see above, after running configure, one can just say "make
|
||||
install", like on Unix. A post-build fix is needed, running
|
||||
gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
|
||||
file.
|
||||
|
||||
For a 64-bit build you need to remove the gtk/gtk.def file and let it
|
||||
be regenerated by the makefilery. This is because the 64-bit GTK dll
|
||||
has a slightly different list of exported function names. This is on
|
||||
purpose and not a bug. The API is the same at the source level, and
|
||||
the same #defines of some function names to actually have a _utf8
|
||||
suffix is used (just to keep the header simpler). But the
|
||||
corresponding non-suffixed function to maintain ABI stability are not
|
||||
needed in the 64-bit case (because there are no older EXEs around that
|
||||
would require such for ABI stability).
|
||||
|
||||
|
||||
2) Microsoft's tools
|
||||
--------------------
|
||||
|
||||
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
|
||||
makefile.msc in gdk and gtk. Be prepared to manually edit various
|
||||
makefile.msc files, and the makefile snippets in build/win32.
|
||||
|
||||
Alternative 1 also generates Microsoft import libraries (.lib), if you
|
||||
have lib.exe available. It might also work for cross-compilation from
|
||||
Unix.
|
||||
|
||||
I use method 1 myself. Hans Breuer has been taking care of the MSVC
|
||||
makefiles. At times, we disagree a bit about various issues, and for
|
||||
instance the makefile.msc files might not produce identically named
|
||||
DLLs and import libraries as the "autoconfiscated" makefiles and
|
||||
libtool do. If this bothers you, you will have to fix the makefiles.
|
||||
|
||||
Using GTK+ on Win32
|
||||
===================
|
||||
|
||||
To use GTK+ on Win32, you also need either one of the above mentioned
|
||||
compilers. Other compilers might work, but don't count on it. Look for
|
||||
prebuilt developer packages (DLLs, import libraries, headers) on the
|
||||
above website.
|
||||
|
||||
Multi-threaded use of GTK+ on Win32
|
||||
===================================
|
||||
|
||||
Multi-threaded GTK+ programs might work on Windows in special simple
|
||||
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
|
||||
in the same thread, it might work. Otherwise, probably not at
|
||||
all. Possible ways to fix this are being investigated.
|
||||
|
||||
Wintab
|
||||
======
|
||||
|
||||
The tablet support uses the Wintab API. The Wintab development kit is
|
||||
no longer required. The wintab.h header file is bundled with GTK+
|
||||
sources. Unfortunately it seems that only Wacom tablets come with
|
||||
support for the Wintab API nowadays.
|
||||
|
||||
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
|
||||
The Win32 backend in GTK+ is not as stable or correct as the X11
|
||||
one.
|
||||
|
||||
For prebuilt runtime and developer packages see
|
||||
http://www.gimp.org/win32/downloads.html .
|
||||
|
||||
There is also a gtk-1-3-win32-production branch of GTK+ that was
|
||||
branched off from before the addition of the no-flicker and other
|
||||
functionality that was new in GTK+ 2.0.0. The vesion number used for
|
||||
that branch is 1.3.0. It corresponds most closely to GTK 1.2.7 on
|
||||
Unix. For new code, you shouldn't be using that.
|
||||
|
||||
Building GTK+ on Win32
|
||||
======================
|
||||
|
||||
There are two ways to build GTK+ for win32.
|
||||
|
||||
1) Use the autoconf-generated configure script, and the resulting
|
||||
Makefiles (which use libtool and gcc to do the compilation). I use
|
||||
this myself, but it can be hard to setup correctly.
|
||||
|
||||
Personally I run configure with:
|
||||
CC='gcc -mpentium -fnative-struct' CPPFLAGS='-I/target/include' CFLAGS=-O2 LDFLAGS='-L/target/lib' ./configure --disable-static --prefix=/target --with-gdktarget=win32 --with-wintab=/src/wtkit126 --with-ie55=/src/workshop/ie55_lib --host=i386-pc-mingw32
|
||||
|
||||
Then, in theory, you can just say "make", like on Unix. In reality,
|
||||
there are a few hickups that require manual intervention, and it's
|
||||
best to run make separately in each subdirectory. At least for me,
|
||||
when libtool creates an .exe file, it puts the real .exe in the .libs
|
||||
directory, and leaves a wrapper .exe in the work directory. For some
|
||||
reason that wrapper doesn't work for me, it doesn't do anything. So, I
|
||||
always do a "cp .libs/*.exe ." after running a make that has produced
|
||||
some exes.
|
||||
|
||||
Another issue is with the gdk-pixbuf.loaders file. It's probably best
|
||||
to do a "make install" in the gdk-pixbuf directory, and let that set
|
||||
up a mostly correct gdk-pixbuf.loaders in the target directory. Then
|
||||
copy that back to the source directory. It's needed in gtk/stock-icons
|
||||
where make runs gdk-pixbuf-csource.
|
||||
|
||||
Etc, you get the idea. It can be a bit of a pain.
|
||||
|
||||
2) Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
|
||||
makefile.msc in gdk and gtk. Be prepared to manually edit various
|
||||
makefile.msc files, and the makefile snippets in build/win32.
|
||||
|
||||
Alternative 1 also generates Microsoft import libraries (.lib), if you
|
||||
have lib.exe available. It might also work for cross-compilation from
|
||||
Unix.
|
||||
|
||||
Note that I use method 1 myself. Hans Breuer has been taking care of
|
||||
the MSVC makefiles. At times, we disagree a bit about various issues,
|
||||
and for instance the makefile.msc files will not produce identically
|
||||
named DLLs and import libraries as the "autoconfiscated" makefiles and
|
||||
libtool do. If this bothers you, you will have to fix the makefiles.
|
||||
|
||||
Using GTK+ on Win32
|
||||
===================
|
||||
|
||||
To use GTK+ on Win32, you also need either one of the above mentioned
|
||||
compilers. Other compilers might work, but don't count on it. Look for
|
||||
prebuilt developer packages (DLLs, import libraries, headers) on the
|
||||
above website.
|
||||
|
||||
Multi-threaded use of GTK+ on Win32
|
||||
===================================
|
||||
|
||||
Multi-threaded GTK+ programs might work on Windows in special simple
|
||||
cases, but not in general. Sorry. If you have all GTK+ and GDK calls
|
||||
in the same thread, it might work. Otherwise, probably not at
|
||||
all. Possible ways to fix this are being investigated.
|
||||
|
||||
Wintab
|
||||
======
|
||||
|
||||
The tablet support uses the Wintab API. The Wintab development kit can
|
||||
be downloaded from http://www.pointing.com. Pass the --with-wintab
|
||||
flag to configure if you use that. If you use nmake and you don't care
|
||||
for Wintab, undefine HAVE_WINTAB in config.h.win32 and remove
|
||||
references to the wntab32x library from the makefile before building.
|
||||
|
||||
ActiveIMM
|
||||
=========
|
||||
|
||||
If you want to build a GTK+ that supports ActiveIMM (the Input Method
|
||||
Manager for non-EastAsia locales that can be used on Win9x/NT4), you
|
||||
need the dimm.h header file. That is somewhat difficult to find, but
|
||||
http://msdn.microsoft.com/downloads/samples/internet/wizard/ seems to
|
||||
be a good place to look nowadays. If you use "autoconfiscated" build,
|
||||
pass the --with-ie55 flag to configure specifying the location of the
|
||||
ie55_lib directory created by downloading the IE5.5 headers and libs
|
||||
from the above URL.
|
||||
|
||||
--Tor Lillqvist <tml@iki.fi>
|
||||
|
78
acconfig.h
Normal file
78
acconfig.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
/* Other stuff */
|
||||
#undef ENABLE_NLS
|
||||
#undef GTK_COMPILED_WITH_DEBUGGING
|
||||
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_DIMM_H
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_IPC_H
|
||||
#undef HAVE_LC_MESSAGES
|
||||
#undef HAVE_PROGRESSIVE_JPEG
|
||||
#undef HAVE_PWD_H
|
||||
#undef HAVE_SHM_H
|
||||
#undef HAVE_STPCPY
|
||||
#undef HAVE_XSHM_H
|
||||
#undef HAVE_SHAPE_EXT
|
||||
#undef HAVE_SOLARIS_XINERAMA
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
#undef HAVE_SYS_TIME_H
|
||||
#undef HAVE_XFREE_XINERAMA
|
||||
#undef HAVE_XINERAMA
|
||||
#undef HAVE_WINTAB
|
||||
#undef HAVE_XCONVERTCASE
|
||||
#undef HAVE_XFT
|
||||
|
||||
#undef HAVE_SIGSETJMP
|
||||
|
||||
#undef NO_FD_SET
|
||||
|
||||
#undef RESOURCE_BASE
|
||||
|
||||
#undef USE_GMODULE
|
||||
#undef USE_MMX
|
||||
|
||||
/* Define to use XKB extension */
|
||||
#undef HAVE_XKB
|
||||
|
||||
/* Define to use shadowfb in the linux-fb port */
|
||||
#undef ENABLE_SHADOW_FB
|
||||
|
||||
/* Define to use a fb manager in the linux-fb port */
|
||||
#undef ENABLE_FB_MANAGER
|
||||
|
||||
#undef XINPUT_NONE
|
||||
#undef XINPUT_GXI
|
||||
#undef XINPUT_XFREE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Most machines will be happy with int or void. IRIX requires '...' */
|
||||
#undef SIGNAL_ARG_TYPE
|
||||
|
||||
#undef GETTEXT_PACKAGE
|
||||
|
||||
/* #undef PACKAGE */
|
||||
/* #undef VERSION */
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
24
autogen.sh
24
autogen.sh
@@ -14,12 +14,9 @@ DIE=0
|
||||
|
||||
have_libtool=false
|
||||
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
|
||||
libtool_version=`libtoolize --version |
|
||||
head -1 |
|
||||
sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \
|
||||
-e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
|
||||
libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
|
||||
case $libtool_version in
|
||||
1.4*|1.5*|2.2*)
|
||||
1.4*|1.5*)
|
||||
have_libtool=true
|
||||
;;
|
||||
esac
|
||||
@@ -48,24 +45,16 @@ fi
|
||||
DIE=1
|
||||
}
|
||||
|
||||
if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
AUTOMAKE=automake-1.11
|
||||
ACLOCAL=aclocal-1.11
|
||||
else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
AUTOMAKE=automake-1.10
|
||||
ACLOCAL=aclocal-1.10
|
||||
else if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
|
||||
AUTOMAKE=automake-1.7
|
||||
ACLOCAL=aclocal-1.7
|
||||
else
|
||||
echo
|
||||
echo "You must have automake 1.7.x, 1,10.x or 1.11.x installed to compile $PROJECT."
|
||||
echo "You must have automake 1.7.x installed to compile $PROJECT."
|
||||
echo "Install the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
|
||||
DIE=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
@@ -104,11 +93,6 @@ fi
|
||||
|
||||
rm -rf autom4te.cache
|
||||
|
||||
# README and INSTALL are required by automake, but may be deleted by clean
|
||||
# up rules. to get automake to work, simply touch these here, they will be
|
||||
# regenerated from their corresponding *.in files by ./configure anyway.
|
||||
touch README INSTALL
|
||||
|
||||
$ACLOCAL $ACLOCAL_FLAGS || exit $?
|
||||
|
||||
libtoolize --force || exit $?
|
||||
|
@@ -1,176 +1,238 @@
|
||||
/* config.h.win32.in. Merged from two versions generated by configure for gcc and MSVC. */
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
/* Other stuff */
|
||||
#define ENABLE_NLS 1
|
||||
#define GTK_COMPILED_WITH_DEBUGGING "yes"
|
||||
|
||||
/* #undef HAVE_CATGETS */
|
||||
/* #undef HAVE_DIMM_H */
|
||||
#define HAVE_GETTEXT 1
|
||||
/* #undef HAVE_IPC_H */
|
||||
/* #undef HAVE_LC_MESSAGES */
|
||||
#define HAVE_PROGRESSIVE_JPEG 1
|
||||
/* #undef HAVE_PWD_H */
|
||||
/* #undef HAVE_SHM_H */
|
||||
/* #undef HAVE_STPCPY */
|
||||
/* #undef HAVE_XSHM_H */
|
||||
/* #undef HAVE_SHAPE_EXT */
|
||||
/* #undef HAVE_SYS_SELECT_H */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
#endif /* _MSC_VER */
|
||||
#define HAVE_WINSOCK_H 1
|
||||
#define HAVE_WINTAB 1
|
||||
/* #undef HAVE_XCONVERTCASE */
|
||||
/* #undef HAVE_XFT */
|
||||
|
||||
/* #undef HAVE_SIGSETJMP */
|
||||
|
||||
#define NO_FD_SET 1
|
||||
|
||||
/* #undef RESOURCE_BASE */
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define USE_GMODULE 1
|
||||
#define USE_MMX 1
|
||||
#endif
|
||||
|
||||
/* Define to use X11R6 additions to XIM */
|
||||
/* #undef USE_X11R6_XIM */
|
||||
|
||||
/* Define to use XKB extension */
|
||||
/* #undef HAVE_XKB */
|
||||
|
||||
/* Define to use shadowfb in the linux-fb port */
|
||||
/* #undef ENABLE_SHADOW_FB */
|
||||
|
||||
/* Define to use a fb manager in the linux-fb port */
|
||||
/* #undef ENABLE_FB_MANAGER */
|
||||
|
||||
/* #undef XINPUT_NONE */
|
||||
/* #undef XINPUT_GXI */
|
||||
/* #undef XINPUT_XFREE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Most machines will be happy with int or void. IRIX requires '...' */
|
||||
/* #undef SIGNAL_ARG_TYPE */
|
||||
|
||||
#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
|
||||
|
||||
/* #undef PACKAGE */
|
||||
/* #undef VERSION */
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define if using `alloca.c'. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* always defined to indicate that i18n is enabled */
|
||||
#define ENABLE_NLS 1
|
||||
|
||||
/* The prefix for our gettext translation domains. */
|
||||
#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
|
||||
/* Define if you have `alloca', as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if debugging is enabled */
|
||||
#define GTK_COMPILED_WITH_DEBUGGING "yes"
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define the location where the catalogs will be installed */
|
||||
#define GTK_LOCALEDIR "c:/devel/target/HEAD/share/locale"
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
/* #undef HAVE_ARGZ_H */
|
||||
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
/* Define if you have the `bind_textdomain_codeset' function. */
|
||||
/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */
|
||||
|
||||
/* Is the wctype implementation broken */
|
||||
/* #undef HAVE_BROKEN_WCTYPE */
|
||||
|
||||
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||
/* #undef HAVE_CRT_EXTERNS_H */
|
||||
|
||||
/* Define to 1 if CUPS 1.2 API is available */
|
||||
/* #undef HAVE_CUPS_API_1_2 */
|
||||
|
||||
/* Define to 1 if you have the `dcgettext' function. */
|
||||
/* Define if you have the `dcgettext' function. */
|
||||
#define HAVE_DCGETTEXT 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
/* #undef HAVE_DLFCN_H */
|
||||
|
||||
/* Define to 1 if you have the `flockfile' function. */
|
||||
/* #undef HAVE_FLOCKFILE */
|
||||
/* Define if you have the `getcwd' function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define to 1 if you have the <ftw.h> header file. */
|
||||
/* #undef HAVE_FTW_H */
|
||||
|
||||
/* Define to 1 if you have the `getc_unlocked' function. */
|
||||
/* #undef HAVE_GETC_UNLOCKED */
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
/* Define if you have the `getpagesize' function. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
#else
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_GETPAGESIZE */
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Define to 1 if you have the `getresuid' function. */
|
||||
/* Define if you have the `getresuid' function. */
|
||||
/* #undef HAVE_GETRESUID */
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#define HAVE_GETTEXT 1
|
||||
|
||||
/* Have GNU ftw */
|
||||
/* #undef HAVE_GNU_FTW */
|
||||
|
||||
/* Define to 1 if you have the `httpGetAuthString' function. */
|
||||
/* #undef HAVE_HTTPGETAUTHSTRING */
|
||||
|
||||
/* Define if cups http_t authstring field is accessible */
|
||||
/* #undef HAVE_HTTP_AUTHSTRING */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#else
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
/* #undef HAVE_INTTYPES_H */
|
||||
#endif
|
||||
|
||||
/* Define to 1 if ipc.h is available */
|
||||
/* #undef HAVE_IPC_H */
|
||||
|
||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||
/* #undef HAVE_LC_MESSAGES */
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
/* #undef HAVE_LOCALTIME_R */
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
/* Define if you have the `lstat' function. */
|
||||
/* #undef HAVE_LSTAT */
|
||||
|
||||
/* Define to 1 if you have the `mallinfo' function. */
|
||||
/* #undef HAVE_MALLINFO */
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
/* Define if you have the `mkstemp' function. */
|
||||
/* #undef HAVE_MKSTEMP */
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define to 1 is libjpeg supports progressive JPEG */
|
||||
/* #undef HAVE_PROGRESSIVE_JPEG */
|
||||
/* Define if you have the `munmap' function. */
|
||||
/* #undef HAVE_MUNMAP */
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
/* #undef HAVE_NL_TYPES_H */
|
||||
|
||||
/* Define if you have the `putenv' function. */
|
||||
#define HAVE_PUTENV 1
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
/* #undef HAVE_PWD_H */
|
||||
|
||||
/* Have the Xrandr extension library */
|
||||
/* #undef HAVE_RANDR */
|
||||
/* Define if you have the `setenv' function. */
|
||||
/* #undef HAVE_SETENV */
|
||||
|
||||
/* Define to 1 if the XShape extension is available */
|
||||
/* #undef HAVE_SHAPE_EXT */
|
||||
/* Define if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if shm.h is available */
|
||||
/* #undef HAVE_SHM_H */
|
||||
|
||||
/* Define to 1 if sigsetjmp is available */
|
||||
/* #undef HAVE_SIGSETJMP */
|
||||
|
||||
/* Have the sockaddr_un.sun_len member */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
/* Define to 1 if solaris xinerama is available */
|
||||
/* #undef HAVE_SOLARIS_XINERAMA */
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_STDINT_H 1
|
||||
#else
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_STDINT_H */
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
/* Define if you have the `strcasecmp' function. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_STRCASECMP 1
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
/* Define if you have the `strchr' function. */
|
||||
#define HAVE_STRCHR 1
|
||||
|
||||
/* Define if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
/* #undef HAVE_STRINGS_H */
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if sys/select.h is available */
|
||||
/* #undef HAVE_SYS_SELECT_H */
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if sys/sysinfo.h is available */
|
||||
/* #undef HAVE_SYS_SYSINFO_H */
|
||||
|
||||
/* Define to 1 if sys/systeminfo.h is available */
|
||||
/* #undef HAVE_SYS_SYSTEMINFO_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_UNISTD_H 1
|
||||
#else
|
||||
#else /* _MSC_VER */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
#endif
|
||||
|
||||
/* Have uxtheme.h include file */
|
||||
#define HAVE_UXTHEME_H 1
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Have wchar.h include file */
|
||||
#define HAVE_WCHAR_H 1
|
||||
@@ -178,123 +240,50 @@
|
||||
/* Have wctype.h include file */
|
||||
#define HAVE_WCTYPE_H 1
|
||||
|
||||
/* Define if we have X11R6 */
|
||||
/* #undef HAVE_X11R6 */
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#define HAVE_WINSOCK_H 1
|
||||
|
||||
/* Have the XCOMPOSITE X extension */
|
||||
/* #undef HAVE_XCOMPOSITE */
|
||||
/* Define if you have the `__argz_count' function. */
|
||||
/* #undef HAVE___ARGZ_COUNT */
|
||||
|
||||
/* Define to 1 if you have the `XConvertCase' function. */
|
||||
/* #undef HAVE_XCONVERTCASE */
|
||||
/* Define if you have the `__argz_next' function. */
|
||||
/* #undef HAVE___ARGZ_NEXT */
|
||||
|
||||
/* Have the Xcursor library */
|
||||
/* #undef HAVE_XCURSOR */
|
||||
|
||||
/* Have the XDAMAGE X extension */
|
||||
/* #undef HAVE_XDAMAGE */
|
||||
|
||||
/* Have the XFIXES X extension */
|
||||
/* #undef HAVE_XFIXES */
|
||||
|
||||
/* Define to 1 if XFree Xinerama is available */
|
||||
/* #undef HAVE_XFREE_XINERAMA */
|
||||
|
||||
/* Define to 1 is Xinerama is available */
|
||||
/* #undef HAVE_XINERAMA */
|
||||
|
||||
/* Define to 1 if you have the `XInternAtoms' function. */
|
||||
/* #undef HAVE_XINTERNATOMS */
|
||||
|
||||
/* Define to use XKB extension */
|
||||
/* #undef HAVE_XKB */
|
||||
|
||||
/* Define to 1 if xshm.h is available */
|
||||
/* #undef HAVE_XSHM_H */
|
||||
|
||||
/* Have the SYNC extension library */
|
||||
/* #undef HAVE_XSYNC */
|
||||
|
||||
/* Define if _NL_MEASUREMENT_MEASUREMENT is available */
|
||||
/* #undef HAVE__NL_MEASUREMENT_MEASUREMENT */
|
||||
|
||||
/* Define if _NL_PAPER_HEIGHT is available */
|
||||
/* #undef HAVE__NL_PAPER_HEIGHT */
|
||||
|
||||
/* Define if _NL_PAPER_WIDTH is available */
|
||||
/* #undef HAVE__NL_PAPER_WIDTH */
|
||||
|
||||
/* Define if _NL_TIME_FIRST_WEEKDAY is available */
|
||||
/* #undef HAVE__NL_TIME_FIRST_WEEKDAY */
|
||||
|
||||
/* Define to 1 if you have the `_NSGetEnviron' function. */
|
||||
/* #undef HAVE__NSGETENVIRON */
|
||||
|
||||
/* Define if <X11/extensions/XIproto.h> needed for xReply */
|
||||
/* #undef NEED_XIPROTO_H_FOR_XREPLY */
|
||||
|
||||
/* Define to 1 if fd_set is not available */
|
||||
#define NO_FD_SET 1
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "gtk+"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "gtk+ @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "gtk+"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "@GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@"
|
||||
/* Define if you have the `__argz_stringify' function. */
|
||||
/* #undef HAVE___ARGZ_STRINGIFY */
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if gmodule works and should be used */
|
||||
#define USE_GMODULE 1
|
||||
|
||||
/* Whether to load modules via .la files rather than directly */
|
||||
/* #undef USE_LA_MODULES */
|
||||
|
||||
/* Define to 1 if medialib is available and should be used */
|
||||
/* #undef USE_MEDIALIB */
|
||||
|
||||
/* Define to 1 if medialib 2.5 is available */
|
||||
/* #undef USE_MEDIALIB25 */
|
||||
|
||||
/* Define to 1 if XXM is available and should be used */
|
||||
#ifndef _MSC_VER
|
||||
# define USE_MMX 1
|
||||
#else
|
||||
# undef USE_MMX
|
||||
#endif
|
||||
|
||||
/* Define to 1 if no XInput should be used */
|
||||
/* #undef XINPUT_NONE */
|
||||
|
||||
/* Define to 1 if XFree XInput should be used */
|
||||
/* #undef XINPUT_XFREE */
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
/* Define if the X Window System is missing or not being used. */
|
||||
/* #undef X_DISPLAY_MISSING */
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define gid_t int
|
||||
|
||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||
if it is not supported. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define uid_t int
|
||||
|
1042
configure.in
1042
configure.in
File diff suppressed because it is too large
Load Diff
2
contrib/.cvsignore
Normal file
2
contrib/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
@@ -1,8 +1,5 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS =
|
||||
if USE_X11
|
||||
SUBDIRS += gdk-pixbuf-xlib
|
||||
endif
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
7
contrib/gdk-pixbuf-xlib/.cvsignore
Normal file
7
contrib/gdk-pixbuf-xlib/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.la
|
||||
*.lo
|
||||
.libs
|
||||
.deps
|
||||
gdk-pixbuf-xlib-2.0.pc
|
@@ -1,158 +1,14 @@
|
||||
=== ChangeLog discontinued ===
|
||||
2006-01-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
With the move to git, GTK+ is switching from a ChangeLog file
|
||||
to relying on commit messages to provide change history. Please
|
||||
see README.commits for guidance on the expected message format.
|
||||
|
||||
2009-03-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.16.0 ===
|
||||
|
||||
2009-03-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.5 ===
|
||||
|
||||
2009-02-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.4 ===
|
||||
|
||||
2009-02-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.3 ===
|
||||
|
||||
2009-01-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.2 ===
|
||||
|
||||
2009-01-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.1 ===
|
||||
|
||||
2009-01-01 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.15.0 ===
|
||||
|
||||
2008-09-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.14.2 ===
|
||||
|
||||
2008-09-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.14.1 ===
|
||||
|
||||
2008-09-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.14.0 ===
|
||||
|
||||
2008-08-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* ==== Released 2.13.7 ===
|
||||
|
||||
2008-08-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.6 ===
|
||||
|
||||
2008-07-21 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.5 ===
|
||||
|
||||
2008-07-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.4 ===
|
||||
|
||||
2008-06-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.3 ===
|
||||
|
||||
2008-06-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.2 ===
|
||||
|
||||
2008-05-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.1 ===
|
||||
|
||||
2008-05-26 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
* gdk-pixbuf-xlib.h
|
||||
* gdk-pixbuf-xlibrgb.h: use G_BEGIN/END_DECLS.
|
||||
|
||||
2008-02-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.13.0 ===
|
||||
|
||||
2007-10-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.1 ===
|
||||
|
||||
2007-09-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.0 ===
|
||||
|
||||
2007-07-21 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.6 ===
|
||||
|
||||
2007-07-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.5 ===
|
||||
|
||||
2007-06-19 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.4 ===
|
||||
|
||||
2007-06-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.3 ===
|
||||
|
||||
2007-06-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.2 ===
|
||||
|
||||
2007-06-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.1 ===
|
||||
|
||||
2007-05-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.11.0 ===
|
||||
|
||||
2006-10-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-xlib.c: Apply a cleanup patch by
|
||||
Kjartan Maraas (#341812)
|
||||
|
||||
2006-08-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.10.2 ===
|
||||
|
||||
2006-07-23 Matthias Clasen <mclasen@redhat.com>
|
||||
* === Released 2.8.10 ===
|
||||
|
||||
* === Released 2.10.1 ===
|
||||
|
||||
2006-07-02 Matthias Clasen <mclasen@redhat.com>
|
||||
2005-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.10.0 ===
|
||||
* === Released 2.8.9 ===
|
||||
|
||||
2006-06-21 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.9.4 ===
|
||||
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
2006-06-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.9.3 ===
|
||||
|
||||
2006-06-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.9.2 ===
|
||||
|
||||
2006-05-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.9.1 ====
|
||||
|
||||
2006-05-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.9.0 ===
|
||||
* === Released 2.8.8 ===
|
||||
|
||||
2005-11-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
@@ -160,11 +16,31 @@
|
||||
* gdk-pixbuf-xlibrgb.c: const correctness fixes
|
||||
found by Arjan van de Ven and gcc.
|
||||
|
||||
2005-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.7 ===
|
||||
|
||||
2005-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-xlib-2.0.pc.in (Requires): Require
|
||||
gmodule-no-export-2.0 instead of gmodule-2.0
|
||||
|
||||
2005-10-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.6 ===
|
||||
|
||||
2005-10-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.5 ===
|
||||
|
||||
2005-09-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.4 ===
|
||||
|
||||
2005-08-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.3 ===
|
||||
|
||||
2005-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.2 ===
|
||||
|
@@ -1,20 +1,15 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
if PLATFORM_WIN32
|
||||
no_undefined = -no-undefined
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES=libgdk_pixbuf_xlib-2.0.la
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) -I$(top_builddir) \
|
||||
-I$(top_srcdir)/gdk-pixbuf \
|
||||
-I$(top_srcdir)/contrib \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
$(GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
||||
libgdk_pixbuf_xlib_2_0_la_LDFLAGS = \
|
||||
-export-dynamic \
|
||||
$(no_undefined) \
|
||||
-version-info $(LT_VERSION_INFO)
|
||||
|
||||
libgdk_pixbuf_xlib_2_0_la_LIBADD = \
|
||||
@@ -37,6 +32,4 @@ libgdk_pixbuf_xlibinclude_HEADERS = \
|
||||
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
|
||||
EXTRA_DIST = gdk-pixbuf-xlib-2.0.pc.in
|
||||
|
@@ -26,7 +26,7 @@
|
||||
/* Ported to Xlib by John Harper <john@dcs.warwick.ac.uk> */
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf-private.h>
|
||||
@@ -152,6 +152,7 @@ rgb1 (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap)
|
||||
int xx, yy;
|
||||
int width, height;
|
||||
int bpl;
|
||||
guint8 *s;
|
||||
register guint8 data;
|
||||
guint8 *o;
|
||||
guint8 *srow = image->data, *orow = pixels;
|
||||
@@ -166,6 +167,7 @@ rgb1 (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap)
|
||||
bpl = image->bytes_per_line;
|
||||
|
||||
for (yy = 0; yy < height; yy++) {
|
||||
s = srow;
|
||||
o = orow;
|
||||
|
||||
for (xx = 0; xx < width; xx ++) {
|
||||
@@ -189,6 +191,7 @@ rgb1a (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap)
|
||||
int xx, yy;
|
||||
int width, height;
|
||||
int bpl;
|
||||
guint8 *s;
|
||||
register guint8 data;
|
||||
guint8 *o;
|
||||
guint8 *srow = image->data, *orow = pixels;
|
||||
@@ -218,6 +221,7 @@ rgb1a (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap)
|
||||
}
|
||||
|
||||
for (yy = 0; yy < height; yy++) {
|
||||
s = srow;
|
||||
o = orow;
|
||||
|
||||
for (xx = 0; xx < width; xx ++) {
|
||||
@@ -984,6 +988,7 @@ convert_real_slow (XImage *image, guchar *pixels, int rowstride, xlib_colormap *
|
||||
int width, height;
|
||||
int bpl;
|
||||
guint8 *srow = image->data, *orow = pixels;
|
||||
guint8 *s;
|
||||
guint8 *o;
|
||||
guint32 pixel;
|
||||
Visual *v;
|
||||
@@ -1006,6 +1011,7 @@ convert_real_slow (XImage *image, guchar *pixels, int rowstride, xlib_colormap *
|
||||
red_prec, green_prec, blue_prec));
|
||||
|
||||
for (yy = 0; yy < height; yy++) {
|
||||
s = srow;
|
||||
o = orow;
|
||||
for (xx = 0; xx < width; xx++) {
|
||||
pixel = XGetPixel (image, xx, yy);
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
/* Trivially ported to Xlib(RGB) by John Harper. */
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include "gdk-pixbuf-private.h"
|
||||
#include "gdk-pixbuf-xlib-private.h"
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf-private.h>
|
||||
#include "gdk-pixbuf-xlib-private.h"
|
||||
|
@@ -21,11 +21,12 @@
|
||||
#ifndef GDK_PIXBUF_XLIB_H
|
||||
#define GDK_PIXBUF_XLIB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gdk-pixbuf-xlib/gdk-pixbuf-xlibrgb.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
|
||||
@@ -82,6 +83,9 @@ GdkPixbuf *gdk_pixbuf_xlib_get_from_drawable (GdkPixbuf *dest,
|
||||
int dest_x, int dest_y,
|
||||
int width, int height);
|
||||
|
||||
G_END_DECLS
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* GDK_PIXBUF_XLIB_H */
|
||||
|
@@ -51,13 +51,15 @@
|
||||
#ifndef __XLIB_RGB_H__
|
||||
#define __XLIB_RGB_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
typedef struct _XlibRgbCmap XlibRgbCmap;
|
||||
|
||||
struct _XlibRgbCmap {
|
||||
@@ -183,6 +185,9 @@ xlib_rgb_get_display (void);
|
||||
Screen *
|
||||
xlib_rgb_get_screen (void);
|
||||
|
||||
G_END_DECLS
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __XLIB_RGB_H__ */
|
||||
|
11
demos/.cvsignore
Normal file
11
demos/.cvsignore
Normal file
@@ -0,0 +1,11 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
.libs
|
||||
.deps
|
||||
testanimation
|
||||
test-inline-pixbufs.h
|
||||
testpixbuf-drawable
|
||||
testpixbuf-scale
|
||||
testpixbuf-save
|
||||
testpixbuf
|
||||
pixbuf-demo
|
@@ -1,14 +1,15 @@
|
||||
## Makefile.am for gtk+/demos
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS = gtk-demo
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
DEPS = \
|
||||
@@ -70,7 +71,7 @@ testpixbuf_scale_SOURCES = testpixbuf-scale.c pixbuf-init.c
|
||||
testanimation_SOURCES = testanimation.c pixbuf-init.c
|
||||
pixbuf_demo_SOURCES = pixbuf-demo.c pixbuf-init.c
|
||||
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
apple-red.png \
|
||||
background.jpg \
|
||||
gnome-applets.png \
|
||||
@@ -82,5 +83,3 @@ EXTRA_DIST += \
|
||||
gnu-keys.png
|
||||
|
||||
DISTCLEANFILES = test-inline-pixbufs.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
7
demos/gtk-demo/.cvsignore
Normal file
7
demos/gtk-demo/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
.libs
|
||||
.deps
|
||||
gtk-demo
|
||||
demos.h
|
||||
geninclude.pl
|
@@ -1,14 +1,11 @@
|
||||
## Makefile.am for gtk+/demos
|
||||
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 \
|
||||
assistant.c \
|
||||
builder.c \
|
||||
button_box.c \
|
||||
changedisplay.c \
|
||||
clipboard.c \
|
||||
@@ -17,39 +14,33 @@ demos = \
|
||||
dialog.c \
|
||||
drawingarea.c \
|
||||
editable_cells.c \
|
||||
entry_buffer.c \
|
||||
entry_completion.c \
|
||||
expander.c \
|
||||
hypertext.c \
|
||||
iconview.c \
|
||||
iconview_edit.c \
|
||||
images.c \
|
||||
infobar.c \
|
||||
links.c \
|
||||
list_store.c \
|
||||
menus.c \
|
||||
offscreen_window.c \
|
||||
offscreen_window2.c \
|
||||
panes.c \
|
||||
pickers.c \
|
||||
pixbufs.c \
|
||||
printing.c \
|
||||
rotated_text.c \
|
||||
search_entry.c \
|
||||
sizegroup.c \
|
||||
stock_browser.c \
|
||||
textview.c \
|
||||
textscroll.c \
|
||||
tree_store.c \
|
||||
ui_manager.c
|
||||
|
||||
INCLUDES = \
|
||||
-DDEMOCODEDIR="\"$(democodedir)\"" \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
-DDEMOCODEDIR="\"$(democodedir)\"" \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
DEPS = \
|
||||
@@ -66,9 +57,8 @@ bin_PROGRAMS = gtk-demo
|
||||
|
||||
BUILT_SOURCES = demos.h
|
||||
|
||||
EXTRA_DIST += \
|
||||
$(IMAGEFILES) \
|
||||
demo.ui
|
||||
EXTRA_DIST = \
|
||||
$(IMAGEFILES)
|
||||
|
||||
demos.h: @REBUILD@ $(demos) geninclude.pl
|
||||
(here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h
|
||||
@@ -81,7 +71,6 @@ gtk_demo_SOURCES = \
|
||||
|
||||
gtk_demo_DEPENDENCIES = $(DEPS)
|
||||
gtk_demo_LDADD = $(LDADDS)
|
||||
gtk_demo_LDFLAGS = -export-dynamic
|
||||
|
||||
IMAGEFILES= alphatest.png \
|
||||
apple-red.png \
|
||||
@@ -98,8 +87,6 @@ IMAGEFILES= alphatest.png \
|
||||
gnu-keys.png \
|
||||
gtk-logo-rgb.gif
|
||||
|
||||
democode_DATA = $(demos) $(IMAGEFILES) demo.ui
|
||||
democode_DATA = $(demos) $(IMAGEFILES)
|
||||
|
||||
DISTCLEANFILES = demos.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -8,8 +8,6 @@
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *infobar = NULL;
|
||||
static GtkWidget *messagelabel = NULL;
|
||||
|
||||
static void
|
||||
activate_action (GtkAction *action)
|
||||
@@ -18,7 +16,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,
|
||||
@@ -31,7 +29,7 @@ activate_action (GtkAction *action)
|
||||
"response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
NULL);
|
||||
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@@ -43,32 +41,37 @@ 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)
|
||||
{
|
||||
gchar *text;
|
||||
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);
|
||||
|
||||
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);
|
||||
/* Close dialog on user response */
|
||||
g_signal_connect (dialog,
|
||||
"response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
NULL);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
activate_email (GtkAboutDialog *about,
|
||||
const gchar *link,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *text;
|
||||
text = g_strdup_printf ("send mail to %s", link);
|
||||
g_print ("%s\n", text);
|
||||
g_free (text);
|
||||
g_print ("send mail to %s\n", link);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
activate_url (GtkAboutDialog *about,
|
||||
const gchar *link,
|
||||
gpointer data)
|
||||
@@ -129,32 +132,31 @@ about_cb (GtkAction *action,
|
||||
gtk_about_dialog_set_email_hook (activate_email, NULL, NULL);
|
||||
gtk_about_dialog_set_url_hook (activate_url, NULL, NULL);
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"program-name", "GTK+ Code Demos",
|
||||
"name", "GTK+ Code Demos",
|
||||
"version", PACKAGE_VERSION,
|
||||
"copyright", "(C) 1997-2009 The GTK+ Team",
|
||||
"copyright", "(C) 1997-2005 The GTK+ Team",
|
||||
"license", license,
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to demonstrate GTK+ functions.",
|
||||
"authors", authors,
|
||||
"documenters", documentors,
|
||||
"logo", transparent,
|
||||
"title", "About GTK+ Code Demos",
|
||||
NULL);
|
||||
|
||||
g_object_unref (transparent);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
GtkAction action;
|
||||
} ToolMenuAction;
|
||||
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
GtkActionClass parent_class;
|
||||
} ToolMenuActionClass;
|
||||
|
||||
G_DEFINE_TYPE(ToolMenuAction, tool_menu_action, GTK_TYPE_ACTION)
|
||||
G_DEFINE_TYPE(ToolMenuAction, tool_menu_action, GTK_TYPE_ACTION);
|
||||
|
||||
static void
|
||||
tool_menu_action_class_init (ToolMenuActionClass *class)
|
||||
@@ -176,30 +178,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) },
|
||||
};
|
||||
@@ -208,9 +210,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);
|
||||
@@ -223,13 +225,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);
|
||||
@@ -242,18 +244,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'>"
|
||||
@@ -285,7 +287,7 @@ static const gchar *ui_info =
|
||||
" <toolitem action='Open'>"
|
||||
" <menu action='OpenMenu'>"
|
||||
" <menuitem action='File1'/>"
|
||||
" </menu>"
|
||||
" </menu>"
|
||||
" </toolitem>"
|
||||
" <toolitem action='Quit'/>"
|
||||
" <separator action='Sep1'/>"
|
||||
@@ -305,7 +307,7 @@ static void
|
||||
register_stock_icons (void)
|
||||
{
|
||||
static gboolean registered = FALSE;
|
||||
|
||||
|
||||
if (!registered)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
@@ -317,17 +319,17 @@ 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);
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -347,7 +349,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);
|
||||
@@ -356,7 +358,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);
|
||||
}
|
||||
@@ -370,9 +372,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);
|
||||
@@ -406,21 +408,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;
|
||||
@@ -435,10 +437,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));
|
||||
@@ -450,46 +452,45 @@ do_appwindow (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
table = gtk_table_new (1, 5, FALSE);
|
||||
|
||||
table = gtk_table_new (1, 4, 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",
|
||||
"stock-id", GTK_STOCK_OPEN,
|
||||
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);
|
||||
@@ -499,16 +500,17 @@ 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,
|
||||
0, 0);
|
||||
|
||||
bar = gtk_ui_manager_get_widget (merge, "/ToolBar");
|
||||
gtk_toolbar_set_tooltips (GTK_TOOLBAR (bar), TRUE);
|
||||
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,
|
||||
@@ -517,25 +519,6 @@ 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),
|
||||
@@ -544,20 +527,20 @@ 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, 3, 4,
|
||||
0, 1, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
200, 200);
|
||||
|
||||
|
||||
contents = gtk_text_view_new ();
|
||||
gtk_widget_grab_focus (contents);
|
||||
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (sw),
|
||||
contents);
|
||||
|
||||
@@ -567,7 +550,7 @@ do_appwindow (GtkWidget *do_widget)
|
||||
gtk_table_attach (GTK_TABLE (table),
|
||||
statusbar,
|
||||
/* X direction */ /* Y direction */
|
||||
0, 1, 4, 5,
|
||||
0, 1, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL, 0,
|
||||
0, 0);
|
||||
|
||||
@@ -586,12 +569,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));
|
||||
}
|
||||
|
||||
@@ -600,11 +583,9 @@ do_appwindow (GtkWidget *do_widget)
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
infobar = NULL;
|
||||
messagelabel = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
|
@@ -1,165 +0,0 @@
|
||||
/* Assistant
|
||||
*
|
||||
* Demonstrates a sample multistep assistant. Assistants are used to divide
|
||||
* an operation into several simpler sequential steps, and to guide the user
|
||||
* through these steps.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *assistant = NULL;
|
||||
|
||||
static void
|
||||
on_assistant_apply (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
/* Apply here changes, this is a fictional
|
||||
example, so we just do nothing here */
|
||||
}
|
||||
|
||||
static void
|
||||
on_assistant_close_cancel (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget **assistant = (GtkWidget **) data;
|
||||
|
||||
gtk_widget_destroy (*assistant);
|
||||
*assistant = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data)
|
||||
{
|
||||
gint current_page, n_pages;
|
||||
gchar *title;
|
||||
|
||||
current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget));
|
||||
n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget));
|
||||
|
||||
title = g_strdup_printf ("Sample assistant (%d of %d)", current_page + 1, n_pages);
|
||||
gtk_window_set_title (GTK_WINDOW (widget), title);
|
||||
g_free (title);
|
||||
}
|
||||
|
||||
static void
|
||||
on_entry_changed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkAssistant *assistant = GTK_ASSISTANT (data);
|
||||
GtkWidget *current_page;
|
||||
gint page_number;
|
||||
const gchar *text;
|
||||
|
||||
page_number = gtk_assistant_get_current_page (assistant);
|
||||
current_page = gtk_assistant_get_nth_page (assistant, page_number);
|
||||
text = gtk_entry_get_text (GTK_ENTRY (widget));
|
||||
|
||||
if (text && *text)
|
||||
gtk_assistant_set_page_complete (assistant, current_page, TRUE);
|
||||
else
|
||||
gtk_assistant_set_page_complete (assistant, current_page, FALSE);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
label = gtk_label_new ("You must fill out this entry to continue:");
|
||||
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0);
|
||||
g_signal_connect (G_OBJECT (entry), "changed",
|
||||
G_CALLBACK (on_entry_changed), assistant);
|
||||
|
||||
gtk_widget_show_all (box);
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
|
||||
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 1");
|
||||
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), box, GTK_ASSISTANT_PAGE_INTRO);
|
||||
|
||||
pixbuf = gtk_widget_render_icon (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, NULL);
|
||||
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), box, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
create_page2 (GtkWidget *assistant)
|
||||
{
|
||||
GtkWidget *box, *checkbutton;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
box = gtk_vbox_new (12, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
|
||||
|
||||
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
|
||||
"even if you do not check this");
|
||||
gtk_box_pack_start (GTK_BOX (box), checkbutton, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (box);
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
|
||||
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE);
|
||||
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 2");
|
||||
|
||||
pixbuf = gtk_widget_render_icon (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, NULL);
|
||||
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), box, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
create_page3 (GtkWidget *assistant)
|
||||
{
|
||||
GtkWidget *label;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes");
|
||||
|
||||
gtk_widget_show (label);
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
|
||||
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM);
|
||||
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
|
||||
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, "Confirmation");
|
||||
|
||||
pixbuf = gtk_widget_render_icon (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG, NULL);
|
||||
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), label, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
do_assistant (GtkWidget *do_widget)
|
||||
{
|
||||
if (!assistant)
|
||||
{
|
||||
assistant = gtk_assistant_new ();
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300);
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (assistant),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
|
||||
create_page1 (assistant);
|
||||
create_page2 (assistant);
|
||||
create_page3 (assistant);
|
||||
|
||||
g_signal_connect (G_OBJECT (assistant), "cancel",
|
||||
G_CALLBACK (on_assistant_close_cancel), &assistant);
|
||||
g_signal_connect (G_OBJECT (assistant), "close",
|
||||
G_CALLBACK (on_assistant_close_cancel), &assistant);
|
||||
g_signal_connect (G_OBJECT (assistant), "apply",
|
||||
G_CALLBACK (on_assistant_apply), NULL);
|
||||
g_signal_connect (G_OBJECT (assistant), "prepare",
|
||||
G_CALLBACK (on_assistant_prepare), NULL);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (assistant))
|
||||
gtk_widget_show (assistant);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (assistant);
|
||||
assistant = NULL;
|
||||
}
|
||||
|
||||
return assistant;
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
/* Builder
|
||||
*
|
||||
* Demonstrates an interface loaded from a XML description.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkBuilder *builder;
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
quit_activate (GtkAction *action)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_widget_destroy (window);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
about_activate (GtkAction *action)
|
||||
{
|
||||
GtkWidget *about_dlg;
|
||||
|
||||
about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
|
||||
gtk_dialog_run (GTK_DIALOG (about_dlg));
|
||||
gtk_widget_hide (about_dlg);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_builder (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GError *err = NULL;
|
||||
gchar *filename;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
builder = gtk_builder_new ();
|
||||
filename = demo_find_file ("demo.ui", NULL);
|
||||
gtk_builder_add_from_file (builder, filename, &err);
|
||||
g_free (filename);
|
||||
if (err)
|
||||
{
|
||||
g_error ("ERROR: %s\n", err->message);
|
||||
return NULL;
|
||||
}
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/* Change Display
|
||||
*
|
||||
*
|
||||
* Demonstrates migrating a window between different displays and
|
||||
* screens. A display is a mouse and keyboard with some number of
|
||||
* associated monitors. A screen is a set of monitors grouped
|
||||
@@ -21,7 +21,7 @@
|
||||
* - Changing the screen for a window
|
||||
*
|
||||
* - Letting the user choose a window by clicking on it
|
||||
*
|
||||
*
|
||||
* - Using GtkListStore and GtkTreeView
|
||||
*
|
||||
* - Using GtkDialog
|
||||
@@ -45,7 +45,7 @@ struct _ChangeDisplayInfo
|
||||
GtkTreeModel *display_model;
|
||||
GtkTreeModel *screen_model;
|
||||
GtkTreeSelection *screen_selection;
|
||||
|
||||
|
||||
GdkDisplay *current_display;
|
||||
GdkScreen *current_screen;
|
||||
};
|
||||
@@ -81,11 +81,7 @@ find_toplevel_at_pointer (GdkDisplay *display)
|
||||
* to the widget that created it.
|
||||
*/
|
||||
if (pointer_window)
|
||||
{
|
||||
gpointer widget_ptr;
|
||||
gdk_window_get_user_data (pointer_window, &widget_ptr);
|
||||
widget = widget_ptr;
|
||||
}
|
||||
gdk_window_get_user_data (pointer_window, (gpointer*) &widget);
|
||||
|
||||
return widget ? gtk_widget_get_toplevel (widget) : NULL;
|
||||
}
|
||||
@@ -111,23 +107,23 @@ query_for_toplevel (GdkScreen *screen,
|
||||
GtkWidget *popup, *label, *frame;
|
||||
GdkCursor *cursor;
|
||||
GtkWidget *toplevel = NULL;
|
||||
|
||||
|
||||
popup = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_screen (GTK_WINDOW (popup), screen);
|
||||
gtk_window_set_modal (GTK_WINDOW (popup), TRUE);
|
||||
gtk_window_set_position (GTK_WINDOW (popup), GTK_WIN_POS_CENTER);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
||||
gtk_container_add (GTK_CONTAINER (popup), frame);
|
||||
|
||||
|
||||
label = gtk_label_new (prompt);
|
||||
gtk_misc_set_padding (GTK_MISC (label), 10, 10);
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
|
||||
|
||||
gtk_widget_show_all (popup);
|
||||
cursor = gdk_cursor_new_for_display (display, GDK_CROSSHAIR);
|
||||
|
||||
|
||||
if (gdk_pointer_grab (popup->window, FALSE,
|
||||
GDK_BUTTON_RELEASE_MASK,
|
||||
NULL,
|
||||
@@ -135,26 +131,26 @@ query_for_toplevel (GdkScreen *screen,
|
||||
GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
gboolean clicked = FALSE;
|
||||
|
||||
|
||||
g_signal_connect (popup, "button-release-event",
|
||||
G_CALLBACK (button_release_event_cb), &clicked);
|
||||
|
||||
|
||||
/* Process events until clicked is set by button_release_event_cb.
|
||||
* We pass in may_block=TRUE since we want to wait if there
|
||||
* are no events currently.
|
||||
*/
|
||||
while (!clicked)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
|
||||
toplevel = find_toplevel_at_pointer (gdk_screen_get_display (screen));
|
||||
if (toplevel == popup)
|
||||
toplevel = NULL;
|
||||
}
|
||||
|
||||
|
||||
gdk_cursor_unref (cursor);
|
||||
gtk_widget_destroy (popup);
|
||||
gdk_flush (); /* Really release the grab */
|
||||
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
@@ -188,12 +184,12 @@ fill_screens (ChangeDisplayInfo *info)
|
||||
{
|
||||
gint n_screens = gdk_display_get_n_screens (info->current_display);
|
||||
gint i;
|
||||
|
||||
|
||||
for (i = 0; i < n_screens; i++)
|
||||
{
|
||||
GdkScreen *screen = gdk_display_get_screen (info->current_display, i);
|
||||
GtkTreeIter iter;
|
||||
|
||||
|
||||
gtk_list_store_append (GTK_LIST_STORE (info->screen_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE (info->screen_model), &iter,
|
||||
SCREEN_COLUMN_NUMBER, i,
|
||||
@@ -234,7 +230,7 @@ open_display_cb (GtkWidget *button,
|
||||
GtkWidget *dialog_label;
|
||||
gchar *new_screen_name = NULL;
|
||||
GdkDisplay *result = NULL;
|
||||
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ("Open Display",
|
||||
GTK_WINDOW (info->window),
|
||||
GTK_DIALOG_MODAL,
|
||||
@@ -253,13 +249,13 @@ open_display_cb (GtkWidget *button,
|
||||
|
||||
gtk_widget_grab_focus (display_entry);
|
||||
gtk_widget_show_all (GTK_BIN (dialog)->child);
|
||||
|
||||
|
||||
while (!result)
|
||||
{
|
||||
gint response_id = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
if (response_id != GTK_RESPONSE_OK)
|
||||
break;
|
||||
|
||||
|
||||
new_screen_name = gtk_editable_get_chars (GTK_EDITABLE (display_entry),
|
||||
0, -1);
|
||||
|
||||
@@ -278,7 +274,7 @@ open_display_cb (GtkWidget *button,
|
||||
g_free (new_screen_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
@@ -304,8 +300,6 @@ display_changed_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (info->current_display)
|
||||
g_object_unref (info->current_display);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
gtk_tree_model_get (model, &iter,
|
||||
DISPLAY_COLUMN_DISPLAY, &info->current_display,
|
||||
@@ -326,8 +320,6 @@ screen_changed_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (info->current_screen)
|
||||
g_object_unref (info->current_screen);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
gtk_tree_model_get (model, &iter,
|
||||
SCREEN_COLUMN_SCREEN, &info->current_screen,
|
||||
@@ -351,7 +343,7 @@ create_frame (ChangeDisplayInfo *info,
|
||||
GtkTreeSelection *selection;
|
||||
GtkWidget *scrollwin;
|
||||
GtkWidget *hbox;
|
||||
|
||||
|
||||
*frame = gtk_frame_new (title);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 8);
|
||||
@@ -377,7 +369,7 @@ create_frame (ChangeDisplayInfo *info,
|
||||
|
||||
if (!info->size_group)
|
||||
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
|
||||
gtk_size_group_add_widget (GTK_SIZE_GROUP (info->size_group), *button_vbox);
|
||||
}
|
||||
|
||||
@@ -413,7 +405,7 @@ create_display_frame (ChangeDisplayInfo *info)
|
||||
button = left_align_button_new ("_Open...");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
|
||||
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
button = left_align_button_new ("_Close");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
|
||||
gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0);
|
||||
@@ -484,7 +476,7 @@ display_closed_cb (GdkDisplay *display,
|
||||
valid = gtk_tree_model_iter_next (info->display_model, &iter))
|
||||
{
|
||||
GdkDisplay *tmp_display;
|
||||
|
||||
|
||||
gtk_tree_model_get (info->display_model, &iter,
|
||||
DISPLAY_COLUMN_DISPLAY, &tmp_display,
|
||||
-1);
|
||||
@@ -506,7 +498,7 @@ add_display (ChangeDisplayInfo *info,
|
||||
{
|
||||
const gchar *name = gdk_display_get_name (display);
|
||||
GtkTreeIter iter;
|
||||
|
||||
|
||||
gtk_list_store_append (GTK_LIST_STORE (info->display_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE (info->display_model), &iter,
|
||||
DISPLAY_COLUMN_NAME, name,
|
||||
@@ -514,7 +506,7 @@ add_display (ChangeDisplayInfo *info,
|
||||
-1);
|
||||
|
||||
g_signal_connect (display, "closed",
|
||||
G_CALLBACK (display_closed_cb), info);
|
||||
G_CALLBACK (display_closed_cb), info);
|
||||
}
|
||||
|
||||
/* Called when a new display is opened
|
||||
@@ -543,7 +535,7 @@ initialize_displays (ChangeDisplayInfo *info)
|
||||
|
||||
g_slist_free (tmp_list);
|
||||
|
||||
g_signal_connect (manager, "display-opened",
|
||||
g_signal_connect (manager, "display_opened",
|
||||
G_CALLBACK (display_opened_cb), info);
|
||||
}
|
||||
|
||||
@@ -566,18 +558,10 @@ destroy_info (ChangeDisplayInfo *info)
|
||||
g_signal_handlers_disconnect_by_func (tmp_list->data,
|
||||
display_closed_cb,
|
||||
info);
|
||||
|
||||
|
||||
g_slist_free (tmp_list);
|
||||
|
||||
g_object_unref (info->size_group);
|
||||
g_object_unref (info->display_model);
|
||||
g_object_unref (info->screen_model);
|
||||
|
||||
if (info->current_display)
|
||||
g_object_unref (info->current_display);
|
||||
if (info->current_screen)
|
||||
g_object_unref (info->current_screen);
|
||||
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
@@ -605,7 +589,7 @@ do_changedisplay (GtkWidget *do_widget)
|
||||
info = g_new0 (ChangeDisplayInfo, 1);
|
||||
|
||||
info->window = gtk_dialog_new_with_buttons ("Change Screen or display",
|
||||
GTK_WINDOW (do_widget),
|
||||
GTK_WINDOW (do_widget),
|
||||
GTK_DIALOG_NO_SEPARATOR,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
"Change", GTK_RESPONSE_OK,
|
||||
@@ -620,13 +604,13 @@ do_changedisplay (GtkWidget *do_widget)
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->window)->vbox), vbox,
|
||||
TRUE, TRUE, 0);
|
||||
|
||||
frame = create_display_frame (info);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
frame = create_screen_frame (info);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* Clipboard
|
||||
*
|
||||
* GtkClipboard is used for clipboard handling. This demo shows how to
|
||||
* copy and paste text to and from the clipboard.
|
||||
* copy and paste text to and from the clipboard.
|
||||
*
|
||||
* It also shows how to transfer images via the clipboard or via
|
||||
* It also shows how to transfer images via the clipboard or via
|
||||
* drag-and-drop, and how to make clipboard contents persist after
|
||||
* the application exits. Clipboard persistence requires a clipboard
|
||||
* manager to run.
|
||||
@@ -22,7 +22,7 @@ copy_button_clicked (GtkWidget *button,
|
||||
GtkClipboard *clipboard;
|
||||
|
||||
entry = GTK_WIDGET (user_data);
|
||||
|
||||
|
||||
/* Get the clipboard object */
|
||||
clipboard = gtk_widget_get_clipboard (entry,
|
||||
GDK_SELECTION_CLIPBOARD);
|
||||
@@ -39,7 +39,7 @@ paste_received (GtkClipboard *clipboard,
|
||||
GtkWidget *entry;
|
||||
|
||||
entry = GTK_WIDGET (user_data);
|
||||
|
||||
|
||||
/* Set the entry text */
|
||||
if(text)
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), text);
|
||||
@@ -53,7 +53,7 @@ paste_button_clicked (GtkWidget *button,
|
||||
GtkClipboard *clipboard;
|
||||
|
||||
entry = GTK_WIDGET (user_data);
|
||||
|
||||
|
||||
/* Get the clipboard object */
|
||||
clipboard = gtk_widget_get_clipboard (entry,
|
||||
GDK_SELECTION_CLIPBOARD);
|
||||
@@ -80,7 +80,7 @@ get_image_pixbuf (GtkImage *image)
|
||||
return gtk_widget_render_icon (GTK_WIDGET (image),
|
||||
stock_id, size, NULL);
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
return NULL;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ drag_begin (GtkWidget *widget,
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
drag_data_get (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkSelectionData *selection_data,
|
||||
@@ -171,12 +171,12 @@ button_press (GtkWidget *widget,
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *item;
|
||||
|
||||
|
||||
if (button->button != 3)
|
||||
return FALSE;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
|
||||
|
||||
item = gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, NULL);
|
||||
g_signal_connect (item, "activate", G_CALLBACK (copy_image), data);
|
||||
gtk_widget_show (item);
|
||||
@@ -201,22 +201,18 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GtkWidget *entry, *button;
|
||||
GtkWidget *ebox, *image;
|
||||
GtkClipboard *clipboard;
|
||||
|
||||
|
||||
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), "Clipboard demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
|
||||
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
@@ -226,7 +222,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
/* Create the first entry */
|
||||
entry = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
/* Create the button */
|
||||
button = gtk_button_new_from_stock (GTK_STOCK_COPY);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
@@ -243,13 +239,13 @@ do_clipboard (GtkWidget *do_widget)
|
||||
/* Create the second entry */
|
||||
entry = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
/* Create the button */
|
||||
button = gtk_button_new_from_stock (GTK_STOCK_PASTE);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (paste_button_clicked), entry);
|
||||
|
||||
|
||||
label = gtk_label_new ("Images can be transferred via the clipboard, too");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
@@ -258,7 +254,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the first image */
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
ebox = gtk_event_box_new ();
|
||||
gtk_container_add (GTK_CONTAINER (ebox), image);
|
||||
@@ -267,24 +263,24 @@ do_clipboard (GtkWidget *do_widget)
|
||||
/* make ebox a drag source */
|
||||
gtk_drag_source_set (ebox, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (ebox);
|
||||
g_signal_connect (ebox, "drag-begin",
|
||||
g_signal_connect (ebox, "drag_begin",
|
||||
G_CALLBACK (drag_begin), image);
|
||||
g_signal_connect (ebox, "drag-data-get",
|
||||
g_signal_connect (ebox, "drag_data_get",
|
||||
G_CALLBACK (drag_data_get), image);
|
||||
|
||||
|
||||
/* accept drops on ebox */
|
||||
gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL,
|
||||
gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL,
|
||||
NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_dest_add_image_targets (ebox);
|
||||
g_signal_connect (ebox, "drag-data-received",
|
||||
g_signal_connect (ebox, "drag_data_received",
|
||||
G_CALLBACK (drag_data_received), image);
|
||||
|
||||
|
||||
/* context menu on ebox */
|
||||
g_signal_connect (ebox, "button-press-event",
|
||||
g_signal_connect (ebox, "button_press_event",
|
||||
G_CALLBACK (button_press), image);
|
||||
|
||||
/* Create the second image */
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_STOP,
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_STOP,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
ebox = gtk_event_box_new ();
|
||||
gtk_container_add (GTK_CONTAINER (ebox), image);
|
||||
@@ -293,22 +289,22 @@ do_clipboard (GtkWidget *do_widget)
|
||||
/* make ebox a drag source */
|
||||
gtk_drag_source_set (ebox, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (ebox);
|
||||
g_signal_connect (ebox, "drag-begin",
|
||||
g_signal_connect (ebox, "drag_begin",
|
||||
G_CALLBACK (drag_begin), image);
|
||||
g_signal_connect (ebox, "drag-data-get",
|
||||
g_signal_connect (ebox, "drag_data_get",
|
||||
G_CALLBACK (drag_data_get), image);
|
||||
|
||||
|
||||
/* accept drops on ebox */
|
||||
gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL,
|
||||
gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL,
|
||||
NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_dest_add_image_targets (ebox);
|
||||
g_signal_connect (ebox, "drag-data-received",
|
||||
g_signal_connect (ebox, "drag_data_received",
|
||||
G_CALLBACK (drag_data_received), image);
|
||||
|
||||
|
||||
/* context menu on ebox */
|
||||
g_signal_connect (ebox, "button-press-event",
|
||||
g_signal_connect (ebox, "button_press_event",
|
||||
G_CALLBACK (button_press), image);
|
||||
|
||||
|
||||
/* tell the clipboard manager to make the data persistent */
|
||||
clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
|
||||
gtk_clipboard_set_can_store (clipboard, NULL, 0);
|
||||
|
@@ -15,9 +15,7 @@ static GtkWidget *frame;
|
||||
/* Expose callback for the drawing area
|
||||
*/
|
||||
static gboolean
|
||||
expose_event_callback (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
if (widget->window)
|
||||
{
|
||||
|
@@ -74,7 +74,6 @@ create_stock_icon_store (void)
|
||||
PIXBUF_COL, pixbuf,
|
||||
TEXT_COL, label,
|
||||
-1);
|
||||
g_object_unref (pixbuf);
|
||||
g_free (label);
|
||||
}
|
||||
else
|
||||
@@ -246,87 +245,11 @@ fill_combo_entry (GtkWidget *entry)
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (entry), "Three");
|
||||
}
|
||||
|
||||
|
||||
/* A simple validating entry */
|
||||
|
||||
#define TYPE_MASK_ENTRY (mask_entry_get_type ())
|
||||
#define MASK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MASK_ENTRY, MaskEntry))
|
||||
#define MASK_ENTRY_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TYPE_MASK_ENTRY, MaskEntryClass))
|
||||
#define IS_MASK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MASK_ENTRY))
|
||||
#define IS_MASK_ENTRY_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TYPE_MASK_ENTRY))
|
||||
#define MASK_ENTRY_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TYPE_MASK_ENTRY, MaskEntryClass))
|
||||
|
||||
|
||||
typedef struct _MaskEntry MaskEntry;
|
||||
struct _MaskEntry
|
||||
{
|
||||
GtkEntry entry;
|
||||
gchar *mask;
|
||||
};
|
||||
|
||||
typedef struct _MaskEntryClass MaskEntryClass;
|
||||
struct _MaskEntryClass
|
||||
{
|
||||
GtkEntryClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
static void mask_entry_editable_init (GtkEditableClass *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
mask_entry_editable_init));
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_set_background (MaskEntry *entry)
|
||||
{
|
||||
static const GdkColor error_color = { 0, 65535, 60000, 60000 };
|
||||
|
||||
if (entry->mask)
|
||||
{
|
||||
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
|
||||
{
|
||||
gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, &error_color);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_changed (GtkEditable *editable)
|
||||
{
|
||||
mask_entry_set_background (MASK_ENTRY (editable));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_init (MaskEntry *entry)
|
||||
{
|
||||
entry->mask = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_class_init (MaskEntryClass *klass)
|
||||
{ }
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_editable_init (GtkEditableClass *iface)
|
||||
{
|
||||
iface->changed = mask_entry_changed;
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *
|
||||
do_combobox (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *vbox, *frame, *box, *combo, *entry;
|
||||
GtkWidget *vbox, *frame, *box, *combo;
|
||||
GtkTreeModel *model;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkTreePath *path;
|
||||
@@ -419,7 +342,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_tree_path_free (path);
|
||||
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter);
|
||||
|
||||
/* A GtkComboBoxEntry with validation.
|
||||
/* A GtkComboBoxEntry
|
||||
*/
|
||||
frame = gtk_frame_new ("Editable");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
@@ -432,12 +355,6 @@ do_combobox (GtkWidget *do_widget)
|
||||
fill_combo_entry (combo);
|
||||
gtk_container_add (GTK_CONTAINER (box), combo);
|
||||
|
||||
entry = g_object_new (TYPE_MASK_ENTRY, NULL);
|
||||
MASK_ENTRY (entry)->mask = "^([0-9]*|One|Two|2\302\275|Three)$";
|
||||
|
||||
gtk_container_remove (GTK_CONTAINER (combo), GTK_BIN (combo)->child);
|
||||
gtk_container_add (GTK_CONTAINER (combo), entry);
|
||||
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
@@ -1,258 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<interface domain="gtk20">
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gint"/>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<data>
|
||||
<row>
|
||||
<col id="0" translatable="yes">John</col>
|
||||
<col id="1" translatable="yes">Doe</col>
|
||||
<col id="2">25</col>
|
||||
<col id="3" translatable="yes">This is the John Doe row</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Mary</col>
|
||||
<col id="1" translatable="yes">Unknown</col>
|
||||
<col id="2">50</col>
|
||||
<col id="3" translatable="yes">This is the Mary Unknown row</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GtkUIManager" id="uimanager">
|
||||
<child>
|
||||
<object class="GtkActionGroup" id="DefaultActions">
|
||||
<child>
|
||||
<object class="GtkAction" id="Copy">
|
||||
<property name="name">Copy</property>
|
||||
<property name="tooltip" translatable="yes">Copy selected object into the clipboard</property>
|
||||
<property name="stock_id">gtk-copy</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="Cut">
|
||||
<property name="name">Cut</property>
|
||||
<property name="tooltip" translatable="yes">Cut selected object into the clipboard</property>
|
||||
<property name="stock_id">gtk-cut</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="EditMenu">
|
||||
<property name="name">EditMenu</property>
|
||||
<property name="label" translatable="yes">_Edit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="FileMenu">
|
||||
<property name="name">FileMenu</property>
|
||||
<property name="label" translatable="yes">_File</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="New">
|
||||
<property name="name">New</property>
|
||||
<property name="tooltip" translatable="yes">Create a new file</property>
|
||||
<property name="stock_id">gtk-new</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="Open">
|
||||
<property name="name">Open</property>
|
||||
<property name="tooltip" translatable="yes">Open a file</property>
|
||||
<property name="stock_id">gtk-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="Paste">
|
||||
<property name="name">Paste</property>
|
||||
<property name="tooltip" translatable="yes">Paste object from the Clipboard</property>
|
||||
<property name="stock_id">gtk-paste</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="Quit">
|
||||
<property name="name">Quit</property>
|
||||
<property name="tooltip" translatable="yes">Quit the program</property>
|
||||
<property name="stock_id">gtk-quit</property>
|
||||
<signal handler="quit_activate" name="activate"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="Save">
|
||||
<property name="name">Save</property>
|
||||
<property name="is_important">True</property>
|
||||
<property name="tooltip" translatable="yes">Save a file</property>
|
||||
<property name="stock_id">gtk-save</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="SaveAs">
|
||||
<property name="name">SaveAs</property>
|
||||
<property name="tooltip" translatable="yes">Save with a different name</property>
|
||||
<property name="stock_id">gtk-save-as</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="HelpMenu">
|
||||
<property name="name">HelpMenu</property>
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAction" id="About">
|
||||
<property name="name">About</property>
|
||||
<property name="stock_id">gtk-about</property>
|
||||
<signal handler="about_activate" name="activate"/>
|
||||
</object>
|
||||
<accelerator key="F1"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<ui>
|
||||
<menubar name="menubar1">
|
||||
<menu action="FileMenu" name="FileMenu">
|
||||
<menuitem action="New" name="New"/>
|
||||
<menuitem action="Open" name="Open"/>
|
||||
<menuitem action="Save" name="Save"/>
|
||||
<menuitem action="SaveAs" name="SaveAs"/>
|
||||
<separator/>
|
||||
<menuitem action="Quit" name="Quit"/>
|
||||
</menu>
|
||||
<menu action="EditMenu">
|
||||
<menuitem action="Copy" name="Copy"/>
|
||||
<menuitem action="Cut" name="Cut"/>
|
||||
<menuitem action="Paste" name="Paste"/>
|
||||
</menu>
|
||||
<menu action="HelpMenu" name="HelpMenu">
|
||||
<menuitem action="About" name="About"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
<toolbar name="toolbar1">
|
||||
<toolitem action="New" name="New"/>
|
||||
<toolitem action="Open" name="Open"/>
|
||||
<toolitem action="Save" name="Save"/>
|
||||
<separator/>
|
||||
<toolitem action="Copy" name="Copy"/>
|
||||
<toolitem action="Cut" name="Cut"/>
|
||||
<toolitem action="Paste" name="Paste"/>
|
||||
</toolbar>
|
||||
</ui>
|
||||
</object>
|
||||
<object class="GtkAboutDialog" id="aboutdialog1">
|
||||
<property name="program-name" translatable="yes">GtkBuilder demo</property>
|
||||
<accessibility>
|
||||
<relation target="window1" type="subwindow-of"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="default_height">250</property>
|
||||
<property name="default_width">440</property>
|
||||
<property name="title">GtkBuilder demo</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object constructor="uimanager" class="GtkMenuBar" id="menubar1">
|
||||
<property name="visible">True</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-menubar">
|
||||
<property name="AtkObject::accessible-name">The menubar</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object constructor="uimanager" class="GtkToolbar" id="toolbar1">
|
||||
<property name="visible">True</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-toolbar">
|
||||
<property name="AtkObject::accessible-name">The toolbar</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="visible">True</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="tooltip-column">3</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-treeview">
|
||||
<property name="AtkObject::accessible-name">Name list</property>
|
||||
<property name="AtkObject::accessible-description">
|
||||
A list of person with name, surname and age columns
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="column1">
|
||||
<property name="title">Name</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="renderer1"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="column2">
|
||||
<property name="title">Surname</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="renderer2"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="column3">
|
||||
<property name="title">Age</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="renderer3"/>
|
||||
<attributes>
|
||||
<attribute name="text">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<accessibility>
|
||||
<action action_name="move-cursor" description="Move the cursor to select another person."/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="statusbar1">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -21,25 +21,25 @@ static GdkPixmap *pixmap = NULL;
|
||||
|
||||
/* Create a new pixmap of the appropriate size to store our scribbles */
|
||||
static gboolean
|
||||
scribble_configure_event (GtkWidget *widget,
|
||||
GdkEventConfigure *event,
|
||||
gpointer data)
|
||||
scribble_configure_event (GtkWidget *widget,
|
||||
GdkEventConfigure *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (pixmap)
|
||||
g_object_unref (pixmap);
|
||||
|
||||
pixmap = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
|
||||
/* Initialize the pixmap to white */
|
||||
gdk_draw_rectangle (pixmap,
|
||||
widget->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
widget->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
|
||||
/* We've handled the configure event, no need for further processing. */
|
||||
return TRUE;
|
||||
@@ -48,30 +48,30 @@ scribble_configure_event (GtkWidget *widget,
|
||||
/* Redraw the screen from the pixmap */
|
||||
static gboolean
|
||||
scribble_expose_event (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
/* We use the "foreground GC" for the widget since it already exists,
|
||||
* but honestly any GC would work. The only thing to worry about
|
||||
* is whether the GC has an inappropriate clip region set.
|
||||
*/
|
||||
|
||||
|
||||
gdk_draw_drawable (widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
/* Only copy the area that was exposed. */
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
/* Only copy the area that was exposed. */
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Draw a rectangle on the screen */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
GdkRectangle update_rect;
|
||||
|
||||
@@ -82,25 +82,25 @@ draw_brush (GtkWidget *widget,
|
||||
|
||||
/* Paint to the pixmap, where we store our state */
|
||||
gdk_draw_rectangle (pixmap,
|
||||
widget->style->black_gc,
|
||||
TRUE,
|
||||
update_rect.x, update_rect.y,
|
||||
update_rect.width, update_rect.height);
|
||||
widget->style->black_gc,
|
||||
TRUE,
|
||||
update_rect.x, update_rect.y,
|
||||
update_rect.width, update_rect.height);
|
||||
|
||||
/* Now invalidate the affected region of the drawing area. */
|
||||
gdk_window_invalidate_rect (widget->window,
|
||||
&update_rect,
|
||||
FALSE);
|
||||
&update_rect,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
scribble_button_press_event (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
scribble_button_press_event (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (pixmap == NULL)
|
||||
return FALSE; /* paranoia check, in case we haven't gotten a configure event */
|
||||
|
||||
|
||||
if (event->button == 1)
|
||||
draw_brush (widget, event->x, event->y);
|
||||
|
||||
@@ -109,9 +109,9 @@ scribble_button_press_event (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
scribble_motion_notify_event (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data)
|
||||
scribble_motion_notify_event (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data)
|
||||
{
|
||||
int x, y;
|
||||
GdkModifierType state;
|
||||
@@ -129,9 +129,9 @@ scribble_motion_notify_event (GtkWidget *widget,
|
||||
* we avoid getting a huge number of events faster than we
|
||||
* can cope.
|
||||
*/
|
||||
|
||||
|
||||
gdk_window_get_pointer (event->window, &x, &y, &state);
|
||||
|
||||
|
||||
if (state & GDK_BUTTON1_MASK)
|
||||
draw_brush (widget, x, y);
|
||||
|
||||
@@ -141,17 +141,17 @@ scribble_motion_notify_event (GtkWidget *widget,
|
||||
|
||||
|
||||
static gboolean
|
||||
checkerboard_expose (GtkWidget *da,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
checkerboard_expose (GtkWidget *da,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
gint i, j, xcount, ycount;
|
||||
GdkGC *gc1, *gc2;
|
||||
GdkColor color;
|
||||
|
||||
|
||||
#define CHECK_SIZE 10
|
||||
#define SPACING 2
|
||||
|
||||
|
||||
/* At the start of an expose handler, a clip region of event->area
|
||||
* is set on the window, and event->area has been cleared to the
|
||||
* widget's background color. The docs for
|
||||
@@ -174,7 +174,7 @@ checkerboard_expose (GtkWidget *da,
|
||||
color.green = 65535;
|
||||
color.blue = 65535;
|
||||
gdk_gc_set_rgb_fg_color (gc2, &color);
|
||||
|
||||
|
||||
xcount = 0;
|
||||
i = SPACING;
|
||||
while (i < da->allocation.width)
|
||||
@@ -182,52 +182,42 @@ checkerboard_expose (GtkWidget *da,
|
||||
j = SPACING;
|
||||
ycount = xcount % 2; /* start with even/odd depending on row */
|
||||
while (j < da->allocation.height)
|
||||
{
|
||||
GdkGC *gc;
|
||||
{
|
||||
GdkGC *gc;
|
||||
|
||||
if (ycount % 2)
|
||||
gc = gc1;
|
||||
else
|
||||
gc = gc2;
|
||||
|
||||
if (ycount % 2)
|
||||
gc = gc1;
|
||||
else
|
||||
gc = gc2;
|
||||
/* If we're outside event->area, this will do nothing.
|
||||
* It might be mildly more efficient if we handled
|
||||
* the clipping ourselves, but again we're feeling lazy.
|
||||
*/
|
||||
gdk_draw_rectangle (da->window,
|
||||
gc,
|
||||
TRUE,
|
||||
i, j,
|
||||
CHECK_SIZE,
|
||||
CHECK_SIZE);
|
||||
|
||||
/* If we're outside event->area, this will do nothing.
|
||||
* It might be mildly more efficient if we handled
|
||||
* the clipping ourselves, but again we're feeling lazy.
|
||||
*/
|
||||
gdk_draw_rectangle (da->window,
|
||||
gc,
|
||||
TRUE,
|
||||
i, j,
|
||||
CHECK_SIZE,
|
||||
CHECK_SIZE);
|
||||
|
||||
j += CHECK_SIZE + SPACING;
|
||||
++ycount;
|
||||
}
|
||||
j += CHECK_SIZE + SPACING;
|
||||
++ycount;
|
||||
}
|
||||
|
||||
i += CHECK_SIZE + SPACING;
|
||||
++xcount;
|
||||
}
|
||||
|
||||
|
||||
g_object_unref (gc1);
|
||||
g_object_unref (gc2);
|
||||
|
||||
|
||||
/* return TRUE because we've handled this event, so no
|
||||
* further processing is required.
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
close_window (void)
|
||||
{
|
||||
window = NULL;
|
||||
|
||||
if (pixmap)
|
||||
g_object_unref (pixmap);
|
||||
pixmap = NULL;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_drawingarea (GtkWidget *do_widget)
|
||||
{
|
||||
@@ -235,15 +225,15 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *da;
|
||||
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_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
|
||||
@@ -254,38 +244,38 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
/*
|
||||
* Create the checkerboard area
|
||||
*/
|
||||
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Checkerboard pattern</u>");
|
||||
"<u>Checkerboard pattern</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (checkerboard_expose), NULL);
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (checkerboard_expose), NULL);
|
||||
|
||||
/*
|
||||
* Create the scribble area
|
||||
*/
|
||||
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Scribble area</u>");
|
||||
"<u>Scribble area</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
@@ -293,35 +283,40 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
/* Signals used to handle backing pixmap */
|
||||
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (scribble_expose_event), NULL);
|
||||
g_signal_connect (da,"configure-event",
|
||||
G_CALLBACK (scribble_configure_event), NULL);
|
||||
|
||||
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (scribble_expose_event), NULL);
|
||||
g_signal_connect (da,"configure_event",
|
||||
G_CALLBACK (scribble_configure_event), NULL);
|
||||
|
||||
/* Event signals */
|
||||
|
||||
g_signal_connect (da, "motion-notify-event",
|
||||
G_CALLBACK (scribble_motion_notify_event), NULL);
|
||||
g_signal_connect (da, "button-press-event",
|
||||
G_CALLBACK (scribble_button_press_event), NULL);
|
||||
|
||||
g_signal_connect (da, "motion_notify_event",
|
||||
G_CALLBACK (scribble_motion_notify_event), NULL);
|
||||
g_signal_connect (da, "button_press_event",
|
||||
G_CALLBACK (scribble_button_press_event), NULL);
|
||||
|
||||
|
||||
/* Ask to receive events the drawing area doesn't normally
|
||||
* subscribe to
|
||||
*/
|
||||
gtk_widget_set_events (da, gtk_widget_get_events (da)
|
||||
| GDK_LEAVE_NOTIFY_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
| GDK_LEAVE_NOTIFY_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
@@ -121,10 +121,7 @@ create_numbers_model (void)
|
||||
/* add numbers */
|
||||
for (i = 0; i < N_NUMBERS; i++)
|
||||
{
|
||||
char str[2];
|
||||
|
||||
str[0] = '0' + i;
|
||||
str[1] = '\0';
|
||||
char str[2] = { '0' + i, '\0' };
|
||||
|
||||
gtk_list_store_append (model, &iter);
|
||||
|
||||
|
@@ -1,65 +0,0 @@
|
||||
/* Entry/Entry Buffer
|
||||
*
|
||||
* GtkEntryBuffer provides the text content in a GtkEntry.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_entry_buffer (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
GtkEntryBuffer *buffer;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_dialog_new_with_buttons ("GtkEntryBuffer",
|
||||
GTK_WINDOW (do_widget),
|
||||
0,
|
||||
GTK_STOCK_CLOSE,
|
||||
GTK_RESPONSE_NONE,
|
||||
NULL);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label), "Entries share a buffer. Typing in one is reflected in the other.");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
/* Create a buffer */
|
||||
buffer = gtk_entry_buffer_new (NULL, 0);
|
||||
|
||||
/* Create our first entry */
|
||||
entry = gtk_entry_new_with_buffer (buffer);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the second entry */
|
||||
entry = gtk_entry_new_with_buffer (buffer);
|
||||
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
|
||||
|
||||
g_object_unref (buffer);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Entry/Entry Completion
|
||||
/* Entry Completion
|
||||
*
|
||||
* GtkEntryCompletion provides a mechanism for adding support for
|
||||
* completion in GtkEntry.
|
||||
|
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
static void
|
||||
insert_link (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
gchar *text,
|
||||
gint page)
|
||||
GtkTextIter *iter,
|
||||
gchar *text,
|
||||
gint page)
|
||||
{
|
||||
GtkTextTag *tag;
|
||||
|
||||
tag = gtk_text_buffer_create_tag (buffer, NULL,
|
||||
"foreground", "blue",
|
||||
"underline", PANGO_UNDERLINE_SINGLE,
|
||||
NULL);
|
||||
"foreground", "blue",
|
||||
"underline", PANGO_UNDERLINE_SINGLE,
|
||||
NULL);
|
||||
g_object_set_data (G_OBJECT (tag), "page", GINT_TO_POINTER (page));
|
||||
gtk_text_buffer_insert_with_tags (buffer, iter, text, -1, tag, NULL);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ insert_link (GtkTextBuffer *buffer,
|
||||
*/
|
||||
static void
|
||||
show_page (GtkTextBuffer *buffer,
|
||||
gint page)
|
||||
gint page)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
|
||||
@@ -52,12 +52,12 @@ show_page (GtkTextBuffer *buffer,
|
||||
else if (page == 2)
|
||||
{
|
||||
gtk_text_buffer_insert (buffer, &iter,
|
||||
"A tag is an attribute that can be applied to some range of text. "
|
||||
"For example, a tag might be called \"bold\" and make the text inside "
|
||||
"the tag bold. However, the tag concept is more general than that; "
|
||||
"tags don't have to affect appearance. They can instead affect the "
|
||||
"behavior of mouse and key presses, \"lock\" a range of text so the "
|
||||
"user can't edit it, or countless other things.\n", -1);
|
||||
"A tag is an attribute that can be applied to some range of text. "
|
||||
"For example, a tag might be called \"bold\" and make the text inside "
|
||||
"the tag bold. However, the tag concept is more general than that; "
|
||||
"tags don't have to affect appearance. They can instead affect the "
|
||||
"behavior of mouse and key presses, \"lock\" a range of text so the "
|
||||
"user can't edit it, or countless other things.\n", -1);
|
||||
insert_link (buffer, &iter, "Go back", 1);
|
||||
}
|
||||
else if (page == 3)
|
||||
@@ -65,12 +65,12 @@ show_page (GtkTextBuffer *buffer,
|
||||
GtkTextTag *tag;
|
||||
|
||||
tag = gtk_text_buffer_create_tag (buffer, NULL,
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
NULL);
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
NULL);
|
||||
gtk_text_buffer_insert_with_tags (buffer, &iter, "hypertext:\n", -1, tag, NULL);
|
||||
gtk_text_buffer_insert (buffer, &iter,
|
||||
"machine-readable text that is not sequential but is organized "
|
||||
"so that related items of information are connected.\n", -1);
|
||||
"machine-readable text that is not sequential but is organized "
|
||||
"so that related items of information are connected.\n", -1);
|
||||
insert_link (buffer, &iter, "Go back", 1);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ show_page (GtkTextBuffer *buffer,
|
||||
*/
|
||||
static void
|
||||
follow_if_link (GtkWidget *text_view,
|
||||
GtkTextIter *iter)
|
||||
GtkTextIter *iter)
|
||||
{
|
||||
GSList *tags = NULL, *tagp = NULL;
|
||||
|
||||
@@ -93,8 +93,8 @@ follow_if_link (GtkWidget *text_view,
|
||||
|
||||
if (page != 0)
|
||||
{
|
||||
show_page (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)), page);
|
||||
break;
|
||||
show_page (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)), page);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ follow_if_link (GtkWidget *text_view,
|
||||
*/
|
||||
static gboolean
|
||||
key_press_event (GtkWidget *text_view,
|
||||
GdkEventKey *event)
|
||||
GdkEventKey *event)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
GtkTextBuffer *buffer;
|
||||
@@ -132,7 +132,7 @@ key_press_event (GtkWidget *text_view,
|
||||
*/
|
||||
static gboolean
|
||||
event_after (GtkWidget *text_view,
|
||||
GdkEvent *ev)
|
||||
GdkEvent *ev)
|
||||
{
|
||||
GtkTextIter start, end, iter;
|
||||
GtkTextBuffer *buffer;
|
||||
@@ -165,9 +165,9 @@ event_after (GtkWidget *text_view,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean hovering_over_link = FALSE;
|
||||
static GdkCursor *hand_cursor = NULL;
|
||||
static GdkCursor *regular_cursor = NULL;
|
||||
gboolean hovering_over_link = FALSE;
|
||||
GdkCursor *hand_cursor = NULL;
|
||||
GdkCursor *regular_cursor = NULL;
|
||||
|
||||
/* Looks at all tags covering the position (x, y) in the text view,
|
||||
* and if one of them is a link, change the cursor to the "hands" cursor
|
||||
@@ -179,9 +179,12 @@ set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
gint y)
|
||||
{
|
||||
GSList *tags = NULL, *tagp = NULL;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
gboolean hovering = FALSE;
|
||||
|
||||
buffer = gtk_text_view_get_buffer (text_view);
|
||||
|
||||
gtk_text_view_get_iter_at_location (text_view, &iter, x, y);
|
||||
|
||||
tags = gtk_text_iter_get_tags (&iter);
|
||||
@@ -215,7 +218,7 @@ set_cursor_if_appropriate (GtkTextView *text_view,
|
||||
*/
|
||||
static gboolean
|
||||
motion_notify_event (GtkWidget *text_view,
|
||||
GdkEventMotion *event)
|
||||
GdkEventMotion *event)
|
||||
{
|
||||
gint x, y;
|
||||
|
||||
@@ -234,7 +237,7 @@ motion_notify_event (GtkWidget *text_view,
|
||||
*/
|
||||
static gboolean
|
||||
visibility_notify_event (GtkWidget *text_view,
|
||||
GdkEventVisibility *event)
|
||||
GdkEventVisibility *event)
|
||||
{
|
||||
gint wx, wy, bx, by;
|
||||
|
||||
@@ -265,12 +268,12 @@ do_hypertext (GtkWidget *do_widget)
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
450, 450);
|
||||
450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hypertext");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
|
||||
@@ -278,20 +281,20 @@ do_hypertext (GtkWidget *do_widget)
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
|
||||
g_signal_connect (view, "key-press-event",
|
||||
G_CALLBACK (key_press_event), NULL);
|
||||
G_CALLBACK (key_press_event), NULL);
|
||||
g_signal_connect (view, "event-after",
|
||||
G_CALLBACK (event_after), NULL);
|
||||
G_CALLBACK (event_after), NULL);
|
||||
g_signal_connect (view, "motion-notify-event",
|
||||
G_CALLBACK (motion_notify_event), NULL);
|
||||
G_CALLBACK (motion_notify_event), NULL);
|
||||
g_signal_connect (view, "visibility-notify-event",
|
||||
G_CALLBACK (visibility_notify_event), NULL);
|
||||
G_CALLBACK (visibility_notify_event), NULL);
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_container_add (GTK_CONTAINER (window), sw);
|
||||
gtk_container_add (GTK_CONTAINER (sw), view);
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* Icon View/Icon View Basics
|
||||
*
|
||||
* The GtkIconView widget is used to display and manipulate icons.
|
||||
* It uses a GtkTreeModel for data storage, so the list store
|
||||
* The GtkIconView widget is used to display and manipulate icons.
|
||||
* It uses a GtkTreeModel for data storage, so the list store
|
||||
* example might be helpful.
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ load_pixbufs (GError **error)
|
||||
if (file_pixbuf)
|
||||
return TRUE; /* already loaded earlier */
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -47,10 +47,10 @@ load_pixbufs (GError **error)
|
||||
|
||||
file_pixbuf = gdk_pixbuf_new_from_file (filename, error);
|
||||
g_free (filename);
|
||||
|
||||
|
||||
if (!file_pixbuf)
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
|
||||
|
||||
filename = demo_find_file (FOLDER_NAME, error);
|
||||
if (!filename)
|
||||
return FALSE; /* note that "error" was filled in and returned */
|
||||
@@ -67,7 +67,7 @@ fill_store (GtkListStore *store)
|
||||
GDir *dir;
|
||||
const gchar *name;
|
||||
GtkTreeIter iter;
|
||||
|
||||
|
||||
/* First clear the store */
|
||||
gtk_list_store_clear (store);
|
||||
|
||||
@@ -82,14 +82,14 @@ fill_store (GtkListStore *store)
|
||||
{
|
||||
gchar *path, *display_name;
|
||||
gboolean is_dir;
|
||||
|
||||
|
||||
/* We ignore hidden files that start with a '.' */
|
||||
if (name[0] != '.')
|
||||
{
|
||||
path = g_build_filename (parent, name, NULL);
|
||||
|
||||
is_dir = g_file_test (path, G_FILE_TEST_IS_DIR);
|
||||
|
||||
|
||||
display_name = g_filename_to_utf8 (name, -1, NULL, NULL, NULL);
|
||||
|
||||
gtk_list_store_append (store, &iter);
|
||||
@@ -103,7 +103,7 @@ fill_store (GtkListStore *store)
|
||||
g_free (display_name);
|
||||
}
|
||||
|
||||
name = g_dir_read_name (dir);
|
||||
name = g_dir_read_name (dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ sort_func (GtkTreeModel *model,
|
||||
* folders before files.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
gtk_tree_model_get (model, a,
|
||||
COL_IS_DIRECTORY, &is_dir_a,
|
||||
COL_DISPLAY_NAME, &name_a,
|
||||
@@ -153,12 +153,12 @@ create_store (void)
|
||||
GtkListStore *store;
|
||||
|
||||
store = gtk_list_store_new (NUM_COLS,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
GDK_TYPE_PIXBUF,
|
||||
G_TYPE_BOOLEAN);
|
||||
|
||||
/* Set sort column and function */
|
||||
/* Set sort column and function */
|
||||
gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
|
||||
sort_func,
|
||||
NULL, NULL);
|
||||
@@ -178,7 +178,7 @@ item_activated (GtkIconView *icon_view,
|
||||
gchar *path;
|
||||
GtkTreeIter iter;
|
||||
gboolean is_dir;
|
||||
|
||||
|
||||
store = GTK_LIST_STORE (user_data);
|
||||
|
||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (store),
|
||||
@@ -193,7 +193,7 @@ item_activated (GtkIconView *icon_view,
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Replace parent with path and re-fill the model*/
|
||||
g_free (parent);
|
||||
parent = path;
|
||||
@@ -215,7 +215,7 @@ up_clicked (GtkToolItem *item,
|
||||
|
||||
dir_name = g_path_get_dirname (parent);
|
||||
g_free (parent);
|
||||
|
||||
|
||||
parent = dir_name;
|
||||
|
||||
fill_store (store);
|
||||
@@ -243,34 +243,22 @@ home_clicked (GtkToolItem *item,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
static void close_window(void)
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
|
||||
g_object_unref (file_pixbuf);
|
||||
file_pixbuf = NULL;
|
||||
|
||||
g_object_unref (folder_pixbuf);
|
||||
folder_pixbuf = NULL;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_iconview (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GError *error;
|
||||
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkIconView demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (close_window), NULL);
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
error = NULL;
|
||||
if (!load_pixbufs (&error))
|
||||
@@ -299,13 +287,13 @@ do_iconview (GtkWidget *do_widget)
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *tool_bar;
|
||||
GtkToolItem *home_button;
|
||||
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
tool_bar = gtk_toolbar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
up_button = gtk_tool_button_new_from_stock (GTK_STOCK_GO_UP);
|
||||
gtk_tool_item_set_is_important (up_button, TRUE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE);
|
||||
@@ -314,17 +302,17 @@ do_iconview (GtkWidget *do_widget)
|
||||
home_button = gtk_tool_button_new_from_stock (GTK_STOCK_HOME);
|
||||
gtk_tool_item_set_is_important (home_button, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), home_button, -1);
|
||||
|
||||
|
||||
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
|
||||
|
||||
|
||||
/* Create the store and fill it with the contents of '/' */
|
||||
parent = g_strdup ("/");
|
||||
store = create_store ();
|
||||
@@ -334,7 +322,7 @@ do_iconview (GtkWidget *do_widget)
|
||||
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
|
||||
GTK_SELECTION_MULTIPLE);
|
||||
g_object_unref (store);
|
||||
|
||||
|
||||
/* Connect to the "clicked" signal of the "Up" tool button */
|
||||
g_signal_connect (up_button, "clicked",
|
||||
G_CALLBACK (up_clicked), store);
|
||||
@@ -342,22 +330,22 @@ do_iconview (GtkWidget *do_widget)
|
||||
/* Connect to the "clicked" signal of the "Home" tool button */
|
||||
g_signal_connect (home_button, "clicked",
|
||||
G_CALLBACK (home_clicked), store);
|
||||
|
||||
|
||||
/* We now set which model columns that correspond to the text
|
||||
* and pixbuf of each item
|
||||
*/
|
||||
gtk_icon_view_set_text_column (GTK_ICON_VIEW (icon_view), COL_DISPLAY_NAME);
|
||||
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icon_view), COL_PIXBUF);
|
||||
|
||||
/* Connect to the "item-activated" signal */
|
||||
g_signal_connect (icon_view, "item-activated",
|
||||
/* Connect to the "item_activated" signal */
|
||||
g_signal_connect (icon_view, "item_activated",
|
||||
G_CALLBACK (item_activated), store);
|
||||
gtk_container_add (GTK_CONTAINER (sw), icon_view);
|
||||
|
||||
gtk_widget_grab_focus (icon_view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
|
@@ -63,7 +63,6 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
(color.red >> 8) << 24 |
|
||||
(color.green >> 8) << 16 |
|
||||
(color.blue >> 8) << 8;
|
||||
|
||||
g_free (text);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
|
||||
|
@@ -31,14 +31,14 @@ progressive_prepared_callback (GdkPixbufLoader *loader,
|
||||
GtkWidget *image;
|
||||
|
||||
image = GTK_WIDGET (data);
|
||||
|
||||
|
||||
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
|
||||
|
||||
/* Avoid displaying random memory contents, since the pixbuf
|
||||
* isn't filled in yet.
|
||||
*/
|
||||
gdk_pixbuf_fill (pixbuf, 0xaaaaaaff);
|
||||
|
||||
|
||||
gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *image;
|
||||
|
||||
|
||||
image = GTK_WIDGET (data);
|
||||
|
||||
/* We know the pixbuf inside the GtkImage has changed, but the image
|
||||
@@ -61,7 +61,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
|
||||
* the pixbuf on the display, then we could queue a draw for only
|
||||
* the updated area of the image.
|
||||
*/
|
||||
|
||||
|
||||
gtk_widget_queue_draw (image);
|
||||
}
|
||||
|
||||
@@ -71,24 +71,24 @@ progressive_timeout (gpointer data)
|
||||
GtkWidget *image;
|
||||
|
||||
image = GTK_WIDGET (data);
|
||||
|
||||
|
||||
/* This shows off fully-paranoid error handling, so looks scary.
|
||||
* You could factor out the error handling code into a nice separate
|
||||
* function to make things nicer.
|
||||
*/
|
||||
|
||||
|
||||
if (image_stream)
|
||||
{
|
||||
size_t bytes_read;
|
||||
guchar buf[256];
|
||||
GError *error = NULL;
|
||||
|
||||
|
||||
bytes_read = fread (buf, 1, 256, image_stream);
|
||||
|
||||
if (ferror (image_stream))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
@@ -103,7 +103,7 @@ progressive_timeout (gpointer data)
|
||||
image_stream = NULL;
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
|
||||
load_timeout = 0;
|
||||
|
||||
return FALSE; /* uninstall the timeout */
|
||||
@@ -114,7 +114,7 @@ progressive_timeout (gpointer data)
|
||||
&error))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
@@ -123,13 +123,13 @@ progressive_timeout (gpointer data)
|
||||
error->message);
|
||||
|
||||
g_error_free (error);
|
||||
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
fclose (image_stream);
|
||||
image_stream = NULL;
|
||||
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
load_timeout = 0;
|
||||
@@ -151,29 +151,29 @@ progressive_timeout (gpointer data)
|
||||
&error))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failed to load image: %s",
|
||||
error->message);
|
||||
|
||||
|
||||
g_error_free (error);
|
||||
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
g_object_unref (pixbuf_loader);
|
||||
pixbuf_loader = NULL;
|
||||
|
||||
|
||||
load_timeout = 0;
|
||||
|
||||
|
||||
return FALSE; /* uninstall the timeout */
|
||||
}
|
||||
|
||||
|
||||
g_object_unref (pixbuf_loader);
|
||||
pixbuf_loader = NULL;
|
||||
}
|
||||
@@ -182,9 +182,9 @@ progressive_timeout (gpointer data)
|
||||
{
|
||||
gchar *filename;
|
||||
gchar *error_message = NULL;
|
||||
GError *error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -207,7 +207,7 @@ progressive_timeout (gpointer data)
|
||||
if (image_stream == NULL)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
@@ -217,7 +217,7 @@ progressive_timeout (gpointer data)
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
load_timeout = 0;
|
||||
@@ -231,13 +231,13 @@ progressive_timeout (gpointer data)
|
||||
g_object_unref (pixbuf_loader);
|
||||
pixbuf_loader = NULL;
|
||||
}
|
||||
|
||||
|
||||
pixbuf_loader = gdk_pixbuf_loader_new ();
|
||||
|
||||
g_signal_connect (pixbuf_loader, "area-prepared",
|
||||
|
||||
g_signal_connect (pixbuf_loader, "area_prepared",
|
||||
G_CALLBACK (progressive_prepared_callback), image);
|
||||
|
||||
g_signal_connect (pixbuf_loader, "area-updated",
|
||||
|
||||
g_signal_connect (pixbuf_loader, "area_updated",
|
||||
G_CALLBACK (progressive_updated_callback), image);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ start_progressive_loading (GtkWidget *image)
|
||||
* The timeout simply simulates a slow data source by inserting
|
||||
* pauses in the reading process.
|
||||
*/
|
||||
load_timeout = gdk_threads_add_timeout (150,
|
||||
load_timeout = g_timeout_add (150,
|
||||
progressive_timeout,
|
||||
image);
|
||||
}
|
||||
@@ -269,7 +269,7 @@ cleanup_callback (GtkObject *object,
|
||||
g_source_remove (load_timeout);
|
||||
load_timeout = 0;
|
||||
}
|
||||
|
||||
|
||||
if (pixbuf_loader)
|
||||
{
|
||||
gdk_pixbuf_loader_close (pixbuf_loader, NULL);
|
||||
@@ -289,7 +289,7 @@ toggle_sensitivity_callback (GtkWidget *togglebutton,
|
||||
GtkContainer *container = user_data;
|
||||
GList *list;
|
||||
GList *tmp;
|
||||
|
||||
|
||||
list = gtk_container_get_children (container);
|
||||
|
||||
tmp = list;
|
||||
@@ -299,13 +299,13 @@ toggle_sensitivity_callback (GtkWidget *togglebutton,
|
||||
if (GTK_WIDGET (tmp->data) != togglebutton)
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (tmp->data),
|
||||
!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton)));
|
||||
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
g_list_free (list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
GtkWidget *
|
||||
do_images (GtkWidget *do_widget)
|
||||
@@ -319,7 +319,7 @@ do_images (GtkWidget *do_widget)
|
||||
GdkPixbuf *pixbuf;
|
||||
GError *error = NULL;
|
||||
char *filename;
|
||||
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
@@ -342,7 +342,7 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Image loaded from a file</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
/* The alignment keeps the frame from growing when users resize
|
||||
@@ -352,7 +352,7 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (align), frame);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -373,7 +373,7 @@ do_images (GtkWidget *do_widget)
|
||||
* be displayed instead.
|
||||
*/
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
@@ -381,13 +381,13 @@ do_images (GtkWidget *do_widget)
|
||||
"Unable to open image file 'gtk-logo-rgb.gif': %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
|
||||
image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
@@ -399,7 +399,7 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Animation loaded from a file</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
/* The alignment keeps the frame from growing when users resize
|
||||
@@ -414,16 +414,16 @@ do_images (GtkWidget *do_widget)
|
||||
g_free (filename);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
||||
|
||||
|
||||
/* Progressive */
|
||||
|
||||
|
||||
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
"<u>Progressive image loading</u>");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
/* The alignment keeps the frame from growing when users resize
|
||||
|
@@ -1,104 +0,0 @@
|
||||
/* Info bar
|
||||
*
|
||||
* Info bar widgets are used to report important messages to the user.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
on_bar_response (GtkInfoBar *info_bar,
|
||||
gint response_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"You clicked a button on an info bar");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
"Your response has id %d", response_id);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_infobar (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *bar;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *vbox2;
|
||||
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_window_set_title (GTK_WINDOW (window), "Info Bars");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new_with_buttons (GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
|
||||
g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
|
||||
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
|
||||
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
|
||||
|
||||
frame = gtk_frame_new ("Info bars");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 8);
|
||||
|
||||
vbox2 = gtk_vbox_new (FALSE, 8);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
||||
|
||||
/* Standard message dialog */
|
||||
label = gtk_label_new ("An example of different info bars");
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
{
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
/* 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;
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_links (GtkWidget *do_widget)
|
||||
{
|
||||
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_window_set_title (GTK_WINDOW (window), "Links");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
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;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include "demos.h"
|
||||
#include <demos.h>
|
||||
|
||||
static GtkTextBuffer *info_buffer;
|
||||
static GtkTextBuffer *source_buffer;
|
||||
@@ -19,7 +19,7 @@ enum {
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
STYLE_COLUMN,
|
||||
ITALIC_COLUMN,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ get_democodedir (void)
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
result = g_win32_get_package_installation_directory_of_module (NULL);
|
||||
result = g_win32_get_package_installation_directory (NULL, NULL);
|
||||
if (result == NULL)
|
||||
result = "unknown-location";
|
||||
|
||||
@@ -94,15 +94,15 @@ window_closed_cb (GtkWidget *window, gpointer data)
|
||||
{
|
||||
CallbackData *cbdata = data;
|
||||
GtkTreeIter iter;
|
||||
PangoStyle style;
|
||||
gboolean italic;
|
||||
|
||||
gtk_tree_model_get_iter (cbdata->model, &iter, cbdata->path);
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (cbdata->model), &iter,
|
||||
STYLE_COLUMN, &style,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
if (style == PANGO_STYLE_ITALIC)
|
||||
if (italic)
|
||||
gtk_tree_store_set (GTK_TREE_STORE (cbdata->model), &iter,
|
||||
STYLE_COLUMN, PANGO_STYLE_NORMAL,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
|
||||
gtk_tree_path_free (cbdata->path);
|
||||
@@ -195,12 +195,11 @@ static gchar *types[] =
|
||||
"const ",
|
||||
"void",
|
||||
"gint",
|
||||
" int ",
|
||||
" char ",
|
||||
"int ",
|
||||
"char ",
|
||||
"gchar ",
|
||||
"gfloat",
|
||||
"float",
|
||||
"double",
|
||||
"gint8",
|
||||
"gint16",
|
||||
"gint32",
|
||||
@@ -235,87 +234,6 @@ static gchar *types[] =
|
||||
"GdkPixbuf ",
|
||||
"GError",
|
||||
"size_t",
|
||||
"GtkAboutDialog ",
|
||||
"GtkAction ",
|
||||
"GtkActionEntry ",
|
||||
"GtkRadioActionEntry ",
|
||||
"GtkIconFactory ",
|
||||
"GtkStockItem ",
|
||||
"GtkIconSet ",
|
||||
"GtkTextBuffer ",
|
||||
"GtkStatusbar ",
|
||||
"GtkTextIter ",
|
||||
"GtkTextMark ",
|
||||
"GdkEventWindowState ",
|
||||
"GtkActionGroup ",
|
||||
"GtkUIManager ",
|
||||
"GtkRadioAction ",
|
||||
"GtkActionClass ",
|
||||
"GtkToggleActionEntry ",
|
||||
"GtkAssistant ",
|
||||
"GtkBuilder ",
|
||||
"GtkSizeGroup ",
|
||||
"GtkTreeModel ",
|
||||
"GtkTreeSelection ",
|
||||
"GdkDisplay ",
|
||||
"GdkScreen ",
|
||||
"GdkWindow ",
|
||||
"GdkEventButton ",
|
||||
"GdkCursor ",
|
||||
"GtkTreeIter ",
|
||||
"GtkTreeViewColumn ",
|
||||
"GdkDisplayManager ",
|
||||
"GtkClipboard ",
|
||||
"GtkIconSize ",
|
||||
"GtkImage ",
|
||||
"GdkDragContext ",
|
||||
"GtkSelectionData ",
|
||||
"GtkDialog ",
|
||||
"GtkMenuItem ",
|
||||
"GtkListStore ",
|
||||
"GtkCellLayout ",
|
||||
"GtkCellRenderer ",
|
||||
"GtkTreePath ",
|
||||
"GtkTreeStore ",
|
||||
"GtkEntry ",
|
||||
"GtkEditable ",
|
||||
"GtkEditableClass ",
|
||||
"GdkPixmap ",
|
||||
"GdkEventConfigure ",
|
||||
"GdkEventMotion ",
|
||||
"GdkModifierType ",
|
||||
"GtkEntryCompletion ",
|
||||
"GtkToolItem ",
|
||||
"GDir ",
|
||||
"GtkIconView ",
|
||||
"GtkCellRendererText ",
|
||||
"GtkContainer ",
|
||||
"GtkAccelGroup ",
|
||||
"GtkPaned ",
|
||||
"GtkPrintOperation ",
|
||||
"GtkPrintContext ",
|
||||
"cairo_t ",
|
||||
"PangoLayout "
|
||||
"PangoFontDescription ",
|
||||
"PangoRenderer ",
|
||||
"PangoMatrix ",
|
||||
"PangoContext ",
|
||||
"PangoLayout ",
|
||||
"GtkTable ",
|
||||
"GtkToggleButton ",
|
||||
"GString ",
|
||||
"GtkIconSize ",
|
||||
"GtkTreeView ",
|
||||
"GtkTextTag ",
|
||||
"GdkEvent ",
|
||||
"GdkEventKey ",
|
||||
"GtkTextView ",
|
||||
"GdkEventVisibility ",
|
||||
"GdkBitmap ",
|
||||
"GtkTextChildAnchor ",
|
||||
"GArray ",
|
||||
"GtkCellEditable ",
|
||||
"GtkCellRendererToggle ",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -390,8 +308,7 @@ parse_chars (gchar *text,
|
||||
}
|
||||
/* check for types */
|
||||
for (i = 0; types[i] != NULL; i++)
|
||||
if (!strncmp (text, types[i], strlen (types[i])) ||
|
||||
(start && types[i][0] == ' ' && !strncmp (text, types[i] + 1, strlen (types[i]) - 1)))
|
||||
if (!strncmp (text, types[i], strlen (types[i])))
|
||||
{
|
||||
*end_ptr = text + strlen (types[i]);
|
||||
*tag = "type";
|
||||
@@ -658,8 +575,6 @@ load_file (const gchar *filename)
|
||||
}
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
|
||||
fontify ();
|
||||
|
||||
g_string_free (buffer, TRUE);
|
||||
@@ -671,7 +586,7 @@ row_activated_cb (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
PangoStyle style;
|
||||
gboolean italic;
|
||||
GDoDemoFunc func;
|
||||
GtkWidget *window;
|
||||
GtkTreeModel *model;
|
||||
@@ -682,14 +597,14 @@ row_activated_cb (GtkTreeView *tree_view,
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
STYLE_COLUMN, &style,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
|
||||
if (func)
|
||||
{
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
STYLE_COLUMN, (style == PANGO_STYLE_ITALIC ? PANGO_STYLE_NORMAL : PANGO_STYLE_ITALIC),
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
window = (func) (gtk_widget_get_toplevel (GTK_WIDGET (tree_view)));
|
||||
|
||||
@@ -785,7 +700,7 @@ create_tree (void)
|
||||
|
||||
Demo *d = testgtk_demos;
|
||||
|
||||
model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_INT);
|
||||
model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
tree_view = gtk_tree_view_new ();
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
@@ -808,7 +723,7 @@ create_tree (void)
|
||||
TITLE_COLUMN, d->title,
|
||||
FILENAME_COLUMN, d->filename,
|
||||
FUNC_COLUMN, d->func,
|
||||
STYLE_COLUMN, PANGO_STYLE_NORMAL,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
|
||||
d++;
|
||||
@@ -827,7 +742,7 @@ create_tree (void)
|
||||
TITLE_COLUMN, children->title,
|
||||
FILENAME_COLUMN, children->filename,
|
||||
FUNC_COLUMN, children->func,
|
||||
STYLE_COLUMN, PANGO_STYLE_NORMAL,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
|
||||
children++;
|
||||
@@ -836,10 +751,14 @@ create_tree (void)
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
|
||||
g_object_set (cell,
|
||||
"style", PANGO_STYLE_ITALIC,
|
||||
NULL);
|
||||
|
||||
column = gtk_tree_view_column_new_with_attributes ("Widget (double click for demo)",
|
||||
cell,
|
||||
"text", TITLE_COLUMN,
|
||||
"style", STYLE_COLUMN,
|
||||
"style_set", ITALIC_COLUMN,
|
||||
NULL);
|
||||
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
|
||||
@@ -867,8 +786,6 @@ create_tree (void)
|
||||
|
||||
gtk_widget_grab_focus (tree_view);
|
||||
|
||||
g_object_unref (model);
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
@@ -952,7 +869,7 @@ main (int argc, char **argv)
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GTK+ Code Demos");
|
||||
g_signal_connect_after (window, "destroy",
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
@@ -968,18 +885,16 @@ main (int argc, char **argv)
|
||||
create_text (&info_buffer, FALSE),
|
||||
gtk_label_new_with_mnemonic ("_Info"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title",
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
g_object_unref (info_buffer);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&source_buffer, TRUE),
|
||||
gtk_label_new_with_mnemonic ("_Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title",
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (source_buffer, "comment",
|
||||
"foreground", "DodgerBlue",
|
||||
"foreground", "red",
|
||||
NULL);
|
||||
tag = gtk_text_buffer_create_tag (source_buffer, "type",
|
||||
"foreground", "ForestGreen",
|
||||
@@ -999,7 +914,6 @@ main (int argc, char **argv)
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
"foreground", "DarkGoldenrod4",
|
||||
NULL);
|
||||
g_object_unref (source_buffer);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
@@ -2,10 +2,10 @@
|
||||
*
|
||||
* There are several widgets involved in displaying menus. The
|
||||
* GtkMenuBar widget is a menu bar, which normally appears horizontally
|
||||
* at the top of an application, but can also be layed out vertically.
|
||||
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
|
||||
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
|
||||
* menu items (GtkMenuItem). Each menu item contains text and/or images
|
||||
* at the top of an application, but can also be layed out vertically.
|
||||
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
|
||||
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
|
||||
* menu items (GtkMenuItem). Each menu item contains text and/or images
|
||||
* and can be selected by the user.
|
||||
*
|
||||
* There are several kinds of menu item, including plain GtkMenuItem,
|
||||
@@ -22,6 +22,7 @@
|
||||
* GtkUIManager provides a higher-level interface for creating menu bars
|
||||
* and menus; while you can construct menus manually, most people don't
|
||||
* do that. There's a separate demo for GtkUIManager.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
@@ -117,35 +118,37 @@ change_orientation (GtkWidget *button,
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_menus (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *box;
|
||||
GtkWidget *box1;
|
||||
GtkWidget *box2;
|
||||
GtkWidget *button;
|
||||
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *menubar;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
GtkAccelGroup *accel_group;
|
||||
|
||||
|
||||
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), "Menus");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK(gtk_widget_destroyed), &window);
|
||||
|
||||
g_signal_connect (window, "delete-event",
|
||||
G_CALLBACK (gtk_true), NULL);
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "menus");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
|
||||
|
||||
|
||||
|
||||
box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
gtk_widget_show (box);
|
||||
@@ -153,18 +156,18 @@ do_menus (GtkWidget *do_widget)
|
||||
box1 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), box1);
|
||||
gtk_widget_show (box1);
|
||||
|
||||
|
||||
menubar = gtk_menu_bar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0);
|
||||
gtk_widget_show (menubar);
|
||||
|
||||
|
||||
menu = create_menu (2, TRUE);
|
||||
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("test\nline2");
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
gtk_widget_show (menuitem);
|
||||
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("foo");
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (3, TRUE));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
@@ -175,7 +178,7 @@ do_menus (GtkWidget *do_widget)
|
||||
gtk_menu_item_set_right_justified (GTK_MENU_ITEM (menuitem), TRUE);
|
||||
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);
|
||||
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
|
||||
|
@@ -1,579 +0,0 @@
|
||||
/* Offscreen windows/Rotated button
|
||||
*
|
||||
* Offscreen windows can be used to transform parts of a widget
|
||||
* hierarchy. Note that the rotated button is fully functional.
|
||||
*/
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define GTK_TYPE_ROTATED_BIN (gtk_rotated_bin_get_type ())
|
||||
#define GTK_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBin))
|
||||
#define GTK_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
|
||||
#define GTK_IS_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ROTATED_BIN))
|
||||
#define GTK_IS_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ROTATED_BIN))
|
||||
#define GTK_ROTATED_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass))
|
||||
|
||||
typedef struct _GtkRotatedBin GtkRotatedBin;
|
||||
typedef struct _GtkRotatedBinClass GtkRotatedBinClass;
|
||||
|
||||
struct _GtkRotatedBin
|
||||
{
|
||||
GtkContainer container;
|
||||
|
||||
GtkWidget *child;
|
||||
GdkWindow *offscreen_window;
|
||||
gdouble angle;
|
||||
};
|
||||
|
||||
struct _GtkRotatedBinClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
};
|
||||
|
||||
GType gtk_rotated_bin_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget* gtk_rotated_bin_new (void);
|
||||
void gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
|
||||
gdouble angle);
|
||||
|
||||
/*** implementation ***/
|
||||
|
||||
static void gtk_rotated_bin_realize (GtkWidget *widget);
|
||||
static void gtk_rotated_bin_unrealize (GtkWidget *widget);
|
||||
static void gtk_rotated_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_rotated_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static gboolean gtk_rotated_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *offscreen);
|
||||
|
||||
static void gtk_rotated_bin_add (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
static void gtk_rotated_bin_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_rotated_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static GType gtk_rotated_bin_child_type (GtkContainer *container);
|
||||
|
||||
G_DEFINE_TYPE (GtkRotatedBin, gtk_rotated_bin, GTK_TYPE_CONTAINER);
|
||||
|
||||
static void
|
||||
to_child (GtkRotatedBin *bin,
|
||||
double widget_x,
|
||||
double widget_y,
|
||||
double *x_out,
|
||||
double *y_out)
|
||||
{
|
||||
GtkAllocation child_area;
|
||||
double x, y, xr, yr;
|
||||
double c, s;
|
||||
double w, h;
|
||||
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
child_area = bin->child->allocation;
|
||||
|
||||
w = c * child_area.width + s * child_area.height;
|
||||
h = s * child_area.width + c * child_area.height;
|
||||
|
||||
x = widget_x;
|
||||
y = widget_y;
|
||||
|
||||
x -= (w - child_area.width) / 2;
|
||||
y -= (h - child_area.height) / 2;
|
||||
|
||||
x -= child_area.width / 2;
|
||||
y -= child_area.height / 2;
|
||||
|
||||
xr = x * c + y * s;
|
||||
yr = y * c - x * s;
|
||||
x = xr;
|
||||
y = yr;
|
||||
|
||||
x += child_area.width / 2;
|
||||
y += child_area.height / 2;
|
||||
|
||||
*x_out = x;
|
||||
*y_out = y;
|
||||
}
|
||||
|
||||
static void
|
||||
to_parent (GtkRotatedBin *bin,
|
||||
double offscreen_x,
|
||||
double offscreen_y,
|
||||
double *x_out,
|
||||
double *y_out)
|
||||
{
|
||||
GtkAllocation child_area;
|
||||
double x, y, xr, yr;
|
||||
double c, s;
|
||||
double w, h;
|
||||
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
child_area = bin->child->allocation;
|
||||
|
||||
w = c * child_area.width + s * child_area.height;
|
||||
h = s * child_area.width + c * child_area.height;
|
||||
|
||||
x = offscreen_x;
|
||||
y = offscreen_y;
|
||||
|
||||
x -= child_area.width / 2;
|
||||
y -= child_area.height / 2;
|
||||
|
||||
xr = x * c - y * s;
|
||||
yr = x * s + y * c;
|
||||
x = xr;
|
||||
y = yr;
|
||||
|
||||
x += child_area.width / 2;
|
||||
y += child_area.height / 2;
|
||||
|
||||
x -= (w - child_area.width) / 2;
|
||||
y -= (h - child_area.height) / 2;
|
||||
|
||||
*x_out = x;
|
||||
*y_out = y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
|
||||
|
||||
widget_class->realize = gtk_rotated_bin_realize;
|
||||
widget_class->unrealize = gtk_rotated_bin_unrealize;
|
||||
widget_class->size_request = gtk_rotated_bin_size_request;
|
||||
widget_class->size_allocate = gtk_rotated_bin_size_allocate;
|
||||
widget_class->expose_event = gtk_rotated_bin_expose;
|
||||
|
||||
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
|
||||
GTK_TYPE_ROTATED_BIN,
|
||||
g_cclosure_new (G_CALLBACK (gtk_rotated_bin_damage),
|
||||
NULL, NULL));
|
||||
|
||||
container_class->add = gtk_rotated_bin_add;
|
||||
container_class->remove = gtk_rotated_bin_remove;
|
||||
container_class->forall = gtk_rotated_bin_forall;
|
||||
container_class->child_type = gtk_rotated_bin_child_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_init (GtkRotatedBin *bin)
|
||||
{
|
||||
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_rotated_bin_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_ROTATED_BIN, NULL);
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
pick_offscreen_child (GdkWindow *offscreen_window,
|
||||
double widget_x,
|
||||
double widget_y,
|
||||
GtkRotatedBin *bin)
|
||||
{
|
||||
GtkAllocation child_area;
|
||||
double x, y;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
to_child (bin, widget_x, widget_y, &x, &y);
|
||||
|
||||
child_area = bin->child->allocation;
|
||||
|
||||
if (x >= 0 && x < child_area.width &&
|
||||
y >= 0 && y < child_area.height)
|
||||
return bin->offscreen_window;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
offscreen_window_to_parent (GdkWindow *offscreen_window,
|
||||
double offscreen_x,
|
||||
double offscreen_y,
|
||||
double *parent_x,
|
||||
double *parent_y,
|
||||
GtkRotatedBin *bin)
|
||||
{
|
||||
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
|
||||
}
|
||||
|
||||
static void
|
||||
offscreen_window_from_parent (GdkWindow *window,
|
||||
double parent_x,
|
||||
double parent_y,
|
||||
double *offscreen_x,
|
||||
double *offscreen_y,
|
||||
GtkRotatedBin *bin)
|
||||
{
|
||||
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
gint border_width;
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
|
||||
border_width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
attributes.x = widget->allocation.x + border_width;
|
||||
attributes.y = widget->allocation.y + border_width;
|
||||
attributes.width = widget->allocation.width - 2 * border_width;
|
||||
attributes.height = widget->allocation.height - 2 * border_width;
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.event_mask = gtk_widget_get_events (widget)
|
||||
| GDK_EXPOSURE_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
| GDK_SCROLL_MASK
|
||||
| GDK_ENTER_NOTIFY_MASK
|
||||
| GDK_LEAVE_NOTIFY_MASK;
|
||||
|
||||
attributes.visual = gtk_widget_get_visual (widget);
|
||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
|
||||
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (widget->window, widget);
|
||||
g_signal_connect (widget->window, "pick-embedded-child",
|
||||
G_CALLBACK (pick_offscreen_child), bin);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_OFFSCREEN;
|
||||
|
||||
child_requisition.width = child_requisition.height = 0;
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
attributes.width = bin->child->allocation.width;
|
||||
attributes.height = bin->child->allocation.height;
|
||||
}
|
||||
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (bin->offscreen_window, widget);
|
||||
if (bin->child)
|
||||
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
|
||||
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
|
||||
g_signal_connect (bin->offscreen_window, "to-embedder",
|
||||
G_CALLBACK (offscreen_window_to_parent), bin);
|
||||
g_signal_connect (bin->offscreen_window, "from-embedder",
|
||||
G_CALLBACK (offscreen_window_from_parent), bin);
|
||||
|
||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
||||
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
|
||||
gdk_window_show (bin->offscreen_window);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
|
||||
gdk_window_set_user_data (bin->offscreen_window, NULL);
|
||||
gdk_window_destroy (bin->offscreen_window);
|
||||
bin->offscreen_window = NULL;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_rotated_bin_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static GType
|
||||
gtk_rotated_bin_child_type (GtkContainer *container)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
|
||||
|
||||
if (bin->child)
|
||||
return G_TYPE_NONE;
|
||||
|
||||
return GTK_TYPE_WIDGET;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_add (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
|
||||
|
||||
if (!bin->child)
|
||||
{
|
||||
gtk_widget_set_parent_window (widget, bin->offscreen_window);
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
|
||||
bin->child = widget;
|
||||
}
|
||||
else
|
||||
g_warning ("GtkRotatedBin cannot have more than one child\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_remove (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
|
||||
gboolean was_visible;
|
||||
|
||||
was_visible = GTK_WIDGET_VISIBLE (widget);
|
||||
|
||||
if (bin->child == widget)
|
||||
{
|
||||
gtk_widget_unparent (widget);
|
||||
|
||||
bin->child = NULL;
|
||||
|
||||
if (was_visible && GTK_WIDGET_VISIBLE (container))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (container));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (container);
|
||||
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
if (bin->child)
|
||||
(*callback) (bin->child, callback_data);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_rotated_bin_set_angle (GtkRotatedBin *bin,
|
||||
gdouble angle)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ROTATED_BIN (bin));
|
||||
|
||||
bin->angle = angle;
|
||||
gtk_widget_queue_resize (GTK_WIDGET (bin));
|
||||
|
||||
gdk_window_geometry_changed (bin->offscreen_window);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
GtkRequisition child_requisition;
|
||||
double s, c;
|
||||
double w, h;
|
||||
|
||||
child_requisition.width = 0;
|
||||
child_requisition.height = 0;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
w = c * child_requisition.width + s * child_requisition.height;
|
||||
h = s * child_requisition.width + c * child_requisition.height;
|
||||
|
||||
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
|
||||
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
gint border_width;
|
||||
gint w, h;
|
||||
gdouble s, c;
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
border_width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
w = allocation->width - border_width * 2;
|
||||
h = allocation->height - border_width * 2;
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (widget->window,
|
||||
allocation->x + border_width,
|
||||
allocation->y + border_width,
|
||||
w, h);
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
child_allocation.x = 0;
|
||||
child_allocation.y = 0;
|
||||
child_allocation.height = child_requisition.height;
|
||||
if (c == 0.0)
|
||||
child_allocation.width = h / s;
|
||||
else if (s == 0.0)
|
||||
child_allocation.width = w / c;
|
||||
else
|
||||
child_allocation.width = MIN ((w - s * child_allocation.height) / c,
|
||||
(h - c * child_allocation.height) / s);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (bin->offscreen_window,
|
||||
child_allocation.x,
|
||||
child_allocation.y,
|
||||
child_allocation.width,
|
||||
child_allocation.height);
|
||||
|
||||
child_allocation.x = child_allocation.y = 0;
|
||||
gtk_widget_size_allocate (bin->child, &child_allocation);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_rotated_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_rotated_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
gint width, height;
|
||||
gdouble s, c;
|
||||
gdouble w, h;
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
if (event->window == widget->window)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
GtkAllocation child_area;
|
||||
cairo_t *cr;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
|
||||
child_area = bin->child->allocation;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
|
||||
/* transform */
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
w = c * child_area.width + s * child_area.height;
|
||||
h = s * child_area.width + c * child_area.height;
|
||||
|
||||
cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2);
|
||||
cairo_translate (cr, child_area.width / 2, child_area.height / 2);
|
||||
cairo_rotate (cr, bin->angle);
|
||||
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
|
||||
|
||||
/* clip */
|
||||
gdk_drawable_get_size (pixmap, &width, &height);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_clip (cr);
|
||||
/* paint */
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
else if (event->window == bin->offscreen_window)
|
||||
{
|
||||
gtk_paint_flat_box (widget->style, event->window,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
&event->area, widget, "blah",
|
||||
0, 0, -1, -1);
|
||||
|
||||
if (bin->child)
|
||||
gtk_container_propagate_expose (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
event);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*** ***/
|
||||
|
||||
static void
|
||||
scale_changed (GtkRange *range,
|
||||
GtkRotatedBin *bin)
|
||||
{
|
||||
gtk_rotated_bin_set_angle (bin, gtk_range_get_value (range));
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_offscreen_window (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *bin, *vbox, *scale, *button;
|
||||
GdkColor black;
|
||||
|
||||
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), "Rotated widget");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gdk_color_parse ("black", &black);
|
||||
gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &black);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_vbox_new (0, FALSE);
|
||||
scale = gtk_hscale_new_with_range (0, G_PI/2, 0.01);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
|
||||
|
||||
button = gtk_button_new_with_label ("A Button");
|
||||
bin = gtk_rotated_bin_new ();
|
||||
|
||||
g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed), bin);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (bin), button);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
@@ -1,500 +0,0 @@
|
||||
/* Offscreen windows/Effects
|
||||
*
|
||||
* Offscreen windows can be used to render elements multiple times to achieve
|
||||
* various effects.
|
||||
*/
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define GTK_TYPE_MIRROR_BIN (gtk_mirror_bin_get_type ())
|
||||
#define GTK_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBin))
|
||||
#define GTK_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
|
||||
#define GTK_IS_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MIRROR_BIN))
|
||||
#define GTK_IS_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MIRROR_BIN))
|
||||
#define GTK_MIRROR_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass))
|
||||
|
||||
typedef struct _GtkMirrorBin GtkMirrorBin;
|
||||
typedef struct _GtkMirrorBinClass GtkMirrorBinClass;
|
||||
|
||||
struct _GtkMirrorBin
|
||||
{
|
||||
GtkContainer container;
|
||||
|
||||
GtkWidget *child;
|
||||
GdkWindow *offscreen_window;
|
||||
};
|
||||
|
||||
struct _GtkMirrorBinClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
};
|
||||
|
||||
GType gtk_mirror_bin_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget* gtk_mirror_bin_new (void);
|
||||
|
||||
/*** implementation ***/
|
||||
|
||||
static void gtk_mirror_bin_realize (GtkWidget *widget);
|
||||
static void gtk_mirror_bin_unrealize (GtkWidget *widget);
|
||||
static void gtk_mirror_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_mirror_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static gboolean gtk_mirror_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *offscreen);
|
||||
|
||||
static void gtk_mirror_bin_add (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
static void gtk_mirror_bin_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_mirror_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static GType gtk_mirror_bin_child_type (GtkContainer *container);
|
||||
|
||||
G_DEFINE_TYPE (GtkMirrorBin, gtk_mirror_bin, GTK_TYPE_CONTAINER);
|
||||
|
||||
static void
|
||||
to_child (GtkMirrorBin *bin,
|
||||
double widget_x,
|
||||
double widget_y,
|
||||
double *x_out,
|
||||
double *y_out)
|
||||
{
|
||||
*x_out = widget_x;
|
||||
*y_out = widget_y;
|
||||
}
|
||||
|
||||
static void
|
||||
to_parent (GtkMirrorBin *bin,
|
||||
double offscreen_x,
|
||||
double offscreen_y,
|
||||
double *x_out,
|
||||
double *y_out)
|
||||
{
|
||||
*x_out = offscreen_x;
|
||||
*y_out = offscreen_y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
|
||||
|
||||
widget_class->realize = gtk_mirror_bin_realize;
|
||||
widget_class->unrealize = gtk_mirror_bin_unrealize;
|
||||
widget_class->size_request = gtk_mirror_bin_size_request;
|
||||
widget_class->size_allocate = gtk_mirror_bin_size_allocate;
|
||||
widget_class->expose_event = gtk_mirror_bin_expose;
|
||||
|
||||
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
|
||||
GTK_TYPE_MIRROR_BIN,
|
||||
g_cclosure_new (G_CALLBACK (gtk_mirror_bin_damage),
|
||||
NULL, NULL));
|
||||
|
||||
container_class->add = gtk_mirror_bin_add;
|
||||
container_class->remove = gtk_mirror_bin_remove;
|
||||
container_class->forall = gtk_mirror_bin_forall;
|
||||
container_class->child_type = gtk_mirror_bin_child_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_init (GtkMirrorBin *bin)
|
||||
{
|
||||
GTK_WIDGET_UNSET_FLAGS (bin, GTK_NO_WINDOW);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_mirror_bin_new (void)
|
||||
{
|
||||
return g_object_new (GTK_TYPE_MIRROR_BIN, NULL);
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
pick_offscreen_child (GdkWindow *offscreen_window,
|
||||
double widget_x,
|
||||
double widget_y,
|
||||
GtkMirrorBin *bin)
|
||||
{
|
||||
GtkAllocation child_area;
|
||||
double x, y;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
to_child (bin, widget_x, widget_y, &x, &y);
|
||||
|
||||
child_area = bin->child->allocation;
|
||||
|
||||
if (x >= 0 && x < child_area.width &&
|
||||
y >= 0 && y < child_area.height)
|
||||
return bin->offscreen_window;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
offscreen_window_to_parent (GdkWindow *offscreen_window,
|
||||
double offscreen_x,
|
||||
double offscreen_y,
|
||||
double *parent_x,
|
||||
double *parent_y,
|
||||
GtkMirrorBin *bin)
|
||||
{
|
||||
to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y);
|
||||
}
|
||||
|
||||
static void
|
||||
offscreen_window_from_parent (GdkWindow *window,
|
||||
double parent_x,
|
||||
double parent_y,
|
||||
double *offscreen_x,
|
||||
double *offscreen_y,
|
||||
GtkMirrorBin *bin)
|
||||
{
|
||||
to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
gint border_width;
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
|
||||
border_width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
attributes.x = widget->allocation.x + border_width;
|
||||
attributes.y = widget->allocation.y + border_width;
|
||||
attributes.width = widget->allocation.width - 2 * border_width;
|
||||
attributes.height = widget->allocation.height - 2 * border_width;
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.event_mask = gtk_widget_get_events (widget)
|
||||
| GDK_EXPOSURE_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
| GDK_SCROLL_MASK
|
||||
| GDK_ENTER_NOTIFY_MASK
|
||||
| GDK_LEAVE_NOTIFY_MASK;
|
||||
|
||||
attributes.visual = gtk_widget_get_visual (widget);
|
||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
|
||||
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (widget->window, widget);
|
||||
g_signal_connect (widget->window, "pick-embedded-child",
|
||||
G_CALLBACK (pick_offscreen_child), bin);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_OFFSCREEN;
|
||||
|
||||
child_requisition.width = child_requisition.height = 0;
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
attributes.width = bin->child->allocation.width;
|
||||
attributes.height = bin->child->allocation.height;
|
||||
}
|
||||
bin->offscreen_window = gdk_window_new (gtk_widget_get_root_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (bin->offscreen_window, widget);
|
||||
if (bin->child)
|
||||
gtk_widget_set_parent_window (bin->child, bin->offscreen_window);
|
||||
gdk_offscreen_window_set_embedder (bin->offscreen_window, widget->window);
|
||||
g_signal_connect (bin->offscreen_window, "to-embedder",
|
||||
G_CALLBACK (offscreen_window_to_parent), bin);
|
||||
g_signal_connect (bin->offscreen_window, "from-embedder",
|
||||
G_CALLBACK (offscreen_window_from_parent), bin);
|
||||
|
||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
||||
gtk_style_set_background (widget->style, bin->offscreen_window, GTK_STATE_NORMAL);
|
||||
gdk_window_show (bin->offscreen_window);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
|
||||
gdk_window_set_user_data (bin->offscreen_window, NULL);
|
||||
gdk_window_destroy (bin->offscreen_window);
|
||||
bin->offscreen_window = NULL;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_mirror_bin_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static GType
|
||||
gtk_mirror_bin_child_type (GtkContainer *container)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
|
||||
|
||||
if (bin->child)
|
||||
return G_TYPE_NONE;
|
||||
|
||||
return GTK_TYPE_WIDGET;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_add (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
|
||||
|
||||
if (!bin->child)
|
||||
{
|
||||
gtk_widget_set_parent_window (widget, bin->offscreen_window);
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (bin));
|
||||
bin->child = widget;
|
||||
}
|
||||
else
|
||||
g_warning ("GtkMirrorBin cannot have more than one child\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_remove (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
|
||||
gboolean was_visible;
|
||||
|
||||
was_visible = GTK_WIDGET_VISIBLE (widget);
|
||||
|
||||
if (bin->child == widget)
|
||||
{
|
||||
gtk_widget_unparent (widget);
|
||||
|
||||
bin->child = NULL;
|
||||
|
||||
if (was_visible && GTK_WIDGET_VISIBLE (container))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (container));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (container);
|
||||
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
if (bin->child)
|
||||
(*callback) (bin->child, callback_data);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
child_requisition.width = 0;
|
||||
child_requisition.height = 0;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
|
||||
requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
gint border_width;
|
||||
gint w, h;
|
||||
widget->allocation = *allocation;
|
||||
|
||||
border_width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
w = allocation->width - border_width * 2;
|
||||
h = allocation->height - border_width * 2;
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (widget->window,
|
||||
allocation->x + border_width,
|
||||
allocation->y + border_width,
|
||||
w, h);
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
child_allocation.x = 0;
|
||||
child_allocation.y = 0;
|
||||
child_allocation.height = child_requisition.height;
|
||||
child_allocation.width = child_requisition.width;
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (bin->offscreen_window,
|
||||
allocation->x + border_width,
|
||||
allocation->y + border_width,
|
||||
child_allocation.width, child_allocation.height);
|
||||
gtk_widget_size_allocate (bin->child, &child_allocation);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_mirror_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_mirror_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
gint width, height;
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
if (event->window == widget->window)
|
||||
{
|
||||
GdkPixmap *pixmap;
|
||||
cairo_t *cr;
|
||||
cairo_matrix_t matrix;
|
||||
cairo_pattern_t *mask;
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
||||
{
|
||||
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
|
||||
gdk_drawable_get_size (pixmap, &width, &height);
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_clip (cr);
|
||||
|
||||
/* paint the offscreen child */
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0);
|
||||
cairo_matrix_scale (&matrix, 1.0, -1.0);
|
||||
cairo_matrix_translate (&matrix, -10, - 3 * height - 10);
|
||||
cairo_transform (cr, &matrix);
|
||||
|
||||
cairo_rectangle (cr, 0, height, width, height);
|
||||
cairo_clip (cr);
|
||||
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, height);
|
||||
|
||||
/* create linear gradient as mask-pattern to fade out the source */
|
||||
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
/* paint the reflection */
|
||||
cairo_mask (cr, mask);
|
||||
|
||||
cairo_pattern_destroy (mask);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
else if (event->window == bin->offscreen_window)
|
||||
{
|
||||
gtk_paint_flat_box (widget->style, event->window,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
&event->area, widget, "blah",
|
||||
0, 0, -1, -1);
|
||||
|
||||
if (bin->child)
|
||||
gtk_container_propagate_expose (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
event);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*** ***/
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_offscreen_window2 (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *bin, *vbox;
|
||||
GtkWidget *hbox, *entry, *applybutton, *backbutton;
|
||||
GtkSizeGroup *group;
|
||||
|
||||
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), "Effects");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_vbox_new (0, FALSE);
|
||||
|
||||
bin = gtk_mirror_bin_new ();
|
||||
|
||||
group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
backbutton = gtk_button_new ();
|
||||
gtk_container_add (GTK_CONTAINER (backbutton),
|
||||
gtk_image_new_from_stock (GTK_STOCK_GO_BACK, 4));
|
||||
gtk_size_group_add_widget (group, backbutton);
|
||||
entry = gtk_entry_new ();
|
||||
gtk_size_group_add_widget (group, entry);
|
||||
applybutton = gtk_button_new ();
|
||||
gtk_size_group_add_widget (group, applybutton);
|
||||
gtk_container_add (GTK_CONTAINER (applybutton),
|
||||
gtk_image_new_from_stock (GTK_STOCK_APPLY, 4));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (bin), hbox);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
@@ -24,13 +24,13 @@ toggle_resize (GtkWidget *widget,
|
||||
resize = is_child1 ? paned->child1_resize : paned->child2_resize;
|
||||
shrink = is_child1 ? paned->child1_shrink : paned->child2_shrink;
|
||||
|
||||
g_object_ref (child);
|
||||
gtk_widget_ref (child);
|
||||
gtk_container_remove (GTK_CONTAINER (child->parent), child);
|
||||
if (is_child1)
|
||||
gtk_paned_pack1 (paned, child, !resize, shrink);
|
||||
else
|
||||
gtk_paned_pack2 (paned, child, !resize, shrink);
|
||||
g_object_unref (child);
|
||||
gtk_widget_unref (child);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -44,13 +44,13 @@ toggle_shrink (GtkWidget *widget,
|
||||
resize = is_child1 ? paned->child1_resize : paned->child2_resize;
|
||||
shrink = is_child1 ? paned->child1_shrink : paned->child2_shrink;
|
||||
|
||||
g_object_ref (child);
|
||||
gtk_widget_ref (child);
|
||||
gtk_container_remove (GTK_CONTAINER (child->parent), child);
|
||||
if (is_child1)
|
||||
gtk_paned_pack1 (paned, child, resize, !shrink);
|
||||
else
|
||||
gtk_paned_pack2 (paned, child, resize, !shrink);
|
||||
g_object_unref (child);
|
||||
gtk_widget_unref (child);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
@@ -61,7 +61,7 @@ load_pixbufs (GError **error)
|
||||
if (background)
|
||||
return TRUE; /* already loaded earlier */
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -82,13 +82,13 @@ load_pixbufs (GError **error)
|
||||
{
|
||||
filename = demo_find_file (image_names[i], error);
|
||||
if (!filename)
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
|
||||
images[i] = gdk_pixbuf_new_from_file (filename, error);
|
||||
g_free (filename);
|
||||
|
||||
if (!images[i])
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -96,9 +96,9 @@ load_pixbufs (GError **error)
|
||||
|
||||
/* Expose callback for the drawing area */
|
||||
static gint
|
||||
expose_cb (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
expose_cb (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
guchar *pixels;
|
||||
int rowstride;
|
||||
@@ -108,12 +108,12 @@ expose_cb (GtkWidget *widget,
|
||||
pixels = gdk_pixbuf_get_pixels (frame) + rowstride * event->area.y + event->area.x * 3;
|
||||
|
||||
gdk_draw_rgb_image_dithalign (widget->window,
|
||||
widget->style->black_gc,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
pixels, rowstride,
|
||||
event->area.x, event->area.y);
|
||||
widget->style->black_gc,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
pixels, rowstride,
|
||||
event->area.x, event->area.y);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ timeout (gpointer data)
|
||||
double radius;
|
||||
|
||||
gdk_pixbuf_copy_area (background, 0, 0, back_width, back_height,
|
||||
frame, 0, 0);
|
||||
frame, 0, 0);
|
||||
|
||||
f = (double) (frame_num % CYCLE_LEN) / CYCLE_LEN;
|
||||
|
||||
@@ -175,21 +175,19 @@ timeout (gpointer data)
|
||||
r2.height = back_height;
|
||||
|
||||
if (gdk_rectangle_intersect (&r1, &r2, &dest))
|
||||
gdk_pixbuf_composite (images[i],
|
||||
frame,
|
||||
dest.x, dest.y,
|
||||
dest.width, dest.height,
|
||||
xpos, ypos,
|
||||
k, k,
|
||||
GDK_INTERP_NEAREST,
|
||||
((i & 1)
|
||||
? MAX (127, fabs (255 * sin (f * 2.0 * G_PI)))
|
||||
: MAX (127, fabs (255 * cos (f * 2.0 * G_PI)))));
|
||||
gdk_pixbuf_composite (images[i],
|
||||
frame,
|
||||
dest.x, dest.y,
|
||||
dest.width, dest.height,
|
||||
xpos, ypos,
|
||||
k, k,
|
||||
GDK_INTERP_NEAREST,
|
||||
((i & 1)
|
||||
? MAX (127, fabs (255 * sin (f * 2.0 * G_PI)))
|
||||
: MAX (127, fabs (255 * cos (f * 2.0 * G_PI)))));
|
||||
}
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
gtk_widget_queue_draw (da);
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
frame_num++;
|
||||
return TRUE;
|
||||
@@ -199,7 +197,7 @@ static guint timeout_id;
|
||||
|
||||
static void
|
||||
cleanup_callback (GtkObject *object,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
@@ -214,50 +212,48 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (cleanup_callback), NULL);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (cleanup_callback), NULL);
|
||||
|
||||
|
||||
error = NULL;
|
||||
if (!load_pixbufs (&error))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failed to load an image: %s",
|
||||
error->message);
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failed to load an image: %s",
|
||||
error->message);
|
||||
|
||||
g_error_free (error);
|
||||
g_error_free (error);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_size_request (window, back_width, back_height);
|
||||
{
|
||||
gtk_widget_set_size_request (window, back_width, back_height);
|
||||
|
||||
frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height);
|
||||
frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
}
|
||||
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
@@ -1,211 +0,0 @@
|
||||
/* Printing
|
||||
*
|
||||
* GtkPrintOperation offers a simple API to support printing
|
||||
* in a cross-platform way.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* In points */
|
||||
#define HEADER_HEIGHT (10*72/25.4)
|
||||
#define HEADER_GAP (3*72/25.4)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar *filename;
|
||||
gdouble font_size;
|
||||
|
||||
gint lines_per_page;
|
||||
gchar **lines;
|
||||
gint num_lines;
|
||||
gint num_pages;
|
||||
} PrintData;
|
||||
|
||||
static void
|
||||
begin_print (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gpointer user_data)
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
char *contents;
|
||||
int i;
|
||||
double height;
|
||||
|
||||
height = gtk_print_context_get_height (context) - HEADER_HEIGHT - HEADER_GAP;
|
||||
|
||||
data->lines_per_page = floor (height / data->font_size);
|
||||
|
||||
g_file_get_contents (data->filename, &contents, NULL, NULL);
|
||||
|
||||
data->lines = g_strsplit (contents, "\n", 0);
|
||||
g_free (contents);
|
||||
|
||||
i = 0;
|
||||
while (data->lines[i] != NULL)
|
||||
i++;
|
||||
|
||||
data->num_lines = i;
|
||||
data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1;
|
||||
|
||||
gtk_print_operation_set_n_pages (operation, data->num_pages);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_page (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gint page_nr,
|
||||
gpointer user_data)
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
cairo_t *cr;
|
||||
PangoLayout *layout;
|
||||
gint text_width, text_height;
|
||||
gdouble width;
|
||||
gint line, i;
|
||||
PangoFontDescription *desc;
|
||||
gchar *page_str;
|
||||
|
||||
cr = gtk_print_context_get_cairo_context (context);
|
||||
width = gtk_print_context_get_width (context);
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT);
|
||||
|
||||
cairo_set_source_rgb (cr, 0.8, 0.8, 0.8);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
|
||||
layout = gtk_print_context_create_pango_layout (context);
|
||||
|
||||
desc = pango_font_description_from_string ("sans 14");
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
pango_layout_set_text (layout, data->filename, -1);
|
||||
pango_layout_get_pixel_size (layout, &text_width, &text_height);
|
||||
|
||||
if (text_width > width)
|
||||
{
|
||||
pango_layout_set_width (layout, width);
|
||||
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_START);
|
||||
pango_layout_get_pixel_size (layout, &text_width, &text_height);
|
||||
}
|
||||
|
||||
cairo_move_to (cr, (width - text_width) / 2, (HEADER_HEIGHT - text_height) / 2);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
|
||||
page_str = g_strdup_printf ("%d/%d", page_nr + 1, data->num_pages);
|
||||
pango_layout_set_text (layout, page_str, -1);
|
||||
g_free (page_str);
|
||||
|
||||
pango_layout_set_width (layout, -1);
|
||||
pango_layout_get_pixel_size (layout, &text_width, &text_height);
|
||||
cairo_move_to (cr, width - text_width - 4, (HEADER_HEIGHT - text_height) / 2);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
|
||||
g_object_unref (layout);
|
||||
|
||||
layout = gtk_print_context_create_pango_layout (context);
|
||||
|
||||
desc = pango_font_description_from_string ("monospace");
|
||||
pango_font_description_set_size (desc, data->font_size * PANGO_SCALE);
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP);
|
||||
line = page_nr * data->lines_per_page;
|
||||
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
|
||||
{
|
||||
pango_layout_set_text (layout, data->lines[line], -1);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
cairo_rel_move_to (cr, 0, data->font_size);
|
||||
line++;
|
||||
}
|
||||
|
||||
g_object_unref (layout);
|
||||
}
|
||||
|
||||
static void
|
||||
end_print (GtkPrintOperation *operation,
|
||||
GtkPrintContext *context,
|
||||
gpointer user_data)
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
|
||||
g_free (data->filename);
|
||||
g_strfreev (data->lines);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *
|
||||
do_printing (GtkWidget *do_widget)
|
||||
{
|
||||
GtkPrintOperation *operation;
|
||||
GtkPrintSettings *settings;
|
||||
PrintData *data;
|
||||
gchar *uri, *dir, *ext;
|
||||
GError *error = NULL;
|
||||
|
||||
operation = gtk_print_operation_new ();
|
||||
data = g_new0 (PrintData, 1);
|
||||
data->filename = demo_find_file ("printing.c", NULL);
|
||||
data->font_size = 12.0;
|
||||
|
||||
g_signal_connect (G_OBJECT (operation), "begin-print",
|
||||
G_CALLBACK (begin_print), data);
|
||||
g_signal_connect (G_OBJECT (operation), "draw-page",
|
||||
G_CALLBACK (draw_page), data);
|
||||
g_signal_connect (G_OBJECT (operation), "end-print",
|
||||
G_CALLBACK (end_print), data);
|
||||
|
||||
gtk_print_operation_set_use_full_page (operation, FALSE);
|
||||
gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);
|
||||
gtk_print_operation_set_embed_page_setup (operation, TRUE);
|
||||
|
||||
settings = gtk_print_settings_new ();
|
||||
dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
|
||||
if (dir == NULL)
|
||||
dir = g_get_home_dir ();
|
||||
if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "ps") == 0)
|
||||
ext = ".ps";
|
||||
else if (g_strcmp0 (gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT), "svg") == 0)
|
||||
ext = ".svg";
|
||||
else
|
||||
ext = ".pdf";
|
||||
|
||||
uri = g_strconcat ("file://", dir, "/", "gtk-demo", ext, NULL);
|
||||
gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri);
|
||||
gtk_print_operation_set_print_settings (operation, settings);
|
||||
|
||||
gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error);
|
||||
|
||||
g_object_unref (operation);
|
||||
g_object_unref (settings);
|
||||
g_free (uri);
|
||||
|
||||
if (error)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (do_widget),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"%s", error->message);
|
||||
g_error_free (error);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
@@ -1,173 +1,101 @@
|
||||
/* Rotated Text
|
||||
*
|
||||
* This demo shows how to use PangoCairo to draw rotated and transformed
|
||||
* text. The right pane shows a rotated GtkLabel widget.
|
||||
* This demo shows how to use GDK and Pango to draw rotated and transformed
|
||||
* text. The use of GdkPangoRenderer in this example is a somewhat advanced
|
||||
* technique; most applications can simply use gdk_draw_layout(). We use
|
||||
* it here mostly because that allows us to work in user coordinates - that is,
|
||||
* coordinates prior to the application of the transformation matrix, rather
|
||||
* than device coordinates.
|
||||
*
|
||||
* In both cases, a custom PangoCairo shape renderer is installed to draw
|
||||
* a red heard using cairo drawing operations instead of the Unicode heart
|
||||
* character.
|
||||
* As of GTK+-2.6, the ability to draw transformed and anti-aliased graphics
|
||||
* as shown in this example is only present for text. With GTK+-2.8, a new
|
||||
* graphics system called "Cairo" will be introduced that provides these
|
||||
* capabilities and many more for all types of graphics.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
#define HEART "♥"
|
||||
const char text[] = "I ♥ GTK+";
|
||||
|
||||
static void
|
||||
fancy_shape_renderer (cairo_t *cr,
|
||||
PangoAttrShape *attr,
|
||||
gboolean do_path,
|
||||
gpointer data)
|
||||
{
|
||||
double x, y;
|
||||
cairo_get_current_point (cr, &x, &y);
|
||||
cairo_translate (cr, x, y);
|
||||
|
||||
cairo_scale (cr,
|
||||
(double) attr->ink_rect.width / PANGO_SCALE,
|
||||
(double) attr->ink_rect.height / PANGO_SCALE);
|
||||
|
||||
switch (GPOINTER_TO_UINT (attr->data))
|
||||
{
|
||||
case 0x2665: /* U+2665 BLACK HEART SUIT */
|
||||
{
|
||||
cairo_move_to (cr, .5, .0);
|
||||
cairo_line_to (cr, .9, -.4);
|
||||
cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5);
|
||||
cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4);
|
||||
cairo_close_path (cr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!do_path) {
|
||||
cairo_set_source_rgb (cr, 1., 0., 0.);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
}
|
||||
|
||||
PangoAttrList *
|
||||
create_fancy_attr_list_for_layout (PangoLayout *layout)
|
||||
{
|
||||
PangoAttrList *attrs;
|
||||
PangoFontMetrics *metrics;
|
||||
int ascent;
|
||||
PangoRectangle ink_rect, logical_rect;
|
||||
const char *p;
|
||||
|
||||
/* Get font metrics and prepare fancy shape size */
|
||||
metrics = pango_context_get_metrics (pango_layout_get_context (layout),
|
||||
pango_layout_get_font_description (layout),
|
||||
NULL);
|
||||
ascent = pango_font_metrics_get_ascent (metrics);
|
||||
logical_rect.x = 0;
|
||||
logical_rect.width = ascent;
|
||||
logical_rect.y = -ascent;
|
||||
logical_rect.height = ascent;
|
||||
ink_rect = logical_rect;
|
||||
pango_font_metrics_unref (metrics);
|
||||
|
||||
/* Set fancy shape attributes for all hearts */
|
||||
attrs = pango_attr_list_new ();
|
||||
for (p = text; (p = strstr (p, HEART)); p += strlen (HEART))
|
||||
{
|
||||
PangoAttribute *attr;
|
||||
|
||||
attr = pango_attr_shape_new_with_data (&ink_rect,
|
||||
&logical_rect,
|
||||
GUINT_TO_POINTER (g_utf8_get_char (p)),
|
||||
NULL, NULL);
|
||||
|
||||
attr->start_index = p - text;
|
||||
attr->end_index = attr->start_index + strlen (HEART);
|
||||
|
||||
pango_attr_list_insert (attrs, attr);
|
||||
}
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
rotated_text_expose_event (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
#define RADIUS 150
|
||||
#define N_WORDS 5
|
||||
#define FONT "Serif 18"
|
||||
|
||||
#define N_WORDS 10
|
||||
#define FONT "Sans Bold 27"
|
||||
|
||||
PangoRenderer *renderer;
|
||||
PangoMatrix matrix = PANGO_MATRIX_INIT;
|
||||
PangoContext *context;
|
||||
PangoLayout *layout;
|
||||
PangoFontDescription *desc;
|
||||
|
||||
cairo_t *cr;
|
||||
cairo_pattern_t *pattern;
|
||||
|
||||
PangoAttrList *attrs;
|
||||
|
||||
int width = widget->allocation.width;
|
||||
int height = widget->allocation.height;
|
||||
double device_radius;
|
||||
int i;
|
||||
|
||||
/* Create a cairo context and set up a transformation matrix so that the user
|
||||
* space coordinates for the centered square where we draw are [-RADIUS, RADIUS],
|
||||
* [-RADIUS, RADIUS].
|
||||
* We first center, then change the scale. */
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
/* Get the default renderer for the screen, and set it up for drawing */
|
||||
renderer = gdk_pango_renderer_get_default (gtk_widget_get_screen (widget));
|
||||
gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), widget->window);
|
||||
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), widget->style->black_gc);
|
||||
|
||||
/* Set up a transformation matrix so that the user space coordinates for
|
||||
* the centered square where we draw are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
|
||||
* We first center, then change the scale */
|
||||
device_radius = MIN (width, height) / 2.;
|
||||
cairo_translate (cr,
|
||||
device_radius + (width - 2 * device_radius) / 2,
|
||||
device_radius + (height - 2 * device_radius) / 2);
|
||||
cairo_scale (cr, device_radius / RADIUS, device_radius / RADIUS);
|
||||
pango_matrix_translate (&matrix,
|
||||
device_radius + (width - 2 * device_radius) / 2,
|
||||
device_radius + (height - 2 * device_radius) / 2);
|
||||
pango_matrix_scale (&matrix, device_radius / RADIUS, device_radius / RADIUS);
|
||||
|
||||
/* Create and a subtle gradient source and use it. */
|
||||
pattern = cairo_pattern_create_linear (-RADIUS, -RADIUS, RADIUS, RADIUS);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 0., .5, .0, .0);
|
||||
cairo_pattern_add_color_stop_rgb (pattern, 1., .0, .0, .5);
|
||||
cairo_set_source (cr, pattern);
|
||||
|
||||
/* Create a PangoContext and set up our shape renderer */
|
||||
/* Create a PangoLayout, set the font and text */
|
||||
context = gtk_widget_create_pango_context (widget);
|
||||
pango_cairo_context_set_shape_renderer (context,
|
||||
fancy_shape_renderer,
|
||||
NULL, NULL);
|
||||
|
||||
/* Create a PangoLayout, set the text, font, and attributes */
|
||||
layout = pango_layout_new (context);
|
||||
pango_layout_set_text (layout, text, -1);
|
||||
pango_layout_set_text (layout, "Text", -1);
|
||||
desc = pango_font_description_from_string (FONT);
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
|
||||
attrs = create_fancy_attr_list_for_layout (layout);
|
||||
pango_layout_set_attributes (layout, attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
/* Draw the layout N_WORDS times in a circle */
|
||||
for (i = 0; i < N_WORDS; i++)
|
||||
{
|
||||
GdkColor color;
|
||||
PangoMatrix rotated_matrix = matrix;
|
||||
int width, height;
|
||||
double angle = (360. * i) / N_WORDS;
|
||||
|
||||
/* Inform Pango to re-layout the text with the new transformation matrix */
|
||||
pango_cairo_update_layout (cr, layout);
|
||||
/* Gradient from red at angle == 60 to blue at angle == 300 */
|
||||
color.red = 65535 * (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
|
||||
color.green = 0;
|
||||
color.blue = 65535 - color.red;
|
||||
|
||||
pango_layout_get_pixel_size (layout, &width, &height);
|
||||
cairo_move_to (cr, - width / 2, - RADIUS * .9);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
gdk_pango_renderer_set_override_color (GDK_PANGO_RENDERER (renderer),
|
||||
PANGO_RENDER_PART_FOREGROUND, &color);
|
||||
|
||||
pango_matrix_rotate (&rotated_matrix, angle);
|
||||
|
||||
/* Rotate for the next turn */
|
||||
cairo_rotate (cr, G_PI*2 / N_WORDS);
|
||||
pango_context_set_matrix (context, &rotated_matrix);
|
||||
|
||||
/* Inform Pango to re-layout the text with the new transformation matrix */
|
||||
pango_layout_context_changed (layout);
|
||||
|
||||
pango_layout_get_size (layout, &width, &height);
|
||||
pango_renderer_draw_layout (renderer, layout,
|
||||
- width / 2, - RADIUS * PANGO_SCALE);
|
||||
}
|
||||
|
||||
/* Clean up default renderer, since it is shared */
|
||||
gdk_pango_renderer_set_override_color (GDK_PANGO_RENDERER (renderer),
|
||||
PANGO_RENDER_PART_FOREGROUND, NULL);
|
||||
gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), NULL);
|
||||
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), NULL);
|
||||
|
||||
/* free the objects we created */
|
||||
pango_font_description_free (desc);
|
||||
g_object_unref (layout);
|
||||
g_object_unref (context);
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -175,30 +103,21 @@ rotated_text_expose_event (GtkWidget *widget,
|
||||
GtkWidget *
|
||||
do_rotated_text (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *drawing_area;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *label;
|
||||
PangoLayout *layout;
|
||||
PangoAttrList *attrs;
|
||||
|
||||
const GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
|
||||
|
||||
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), "Rotated Text");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_hbox_new (TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
/* Add a drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box), drawing_area);
|
||||
gtk_container_add (GTK_CONTAINER (window), drawing_area);
|
||||
|
||||
/* This overrides the background color from the theme */
|
||||
gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &white);
|
||||
@@ -206,21 +125,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
g_signal_connect (drawing_area, "expose-event",
|
||||
G_CALLBACK (rotated_text_expose_event), NULL);
|
||||
|
||||
/* And a label */
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
|
||||
gtk_label_set_angle (GTK_LABEL (label), 45);
|
||||
|
||||
/* Set up fancy stuff on the label */
|
||||
layout = gtk_label_get_layout (GTK_LABEL (label));
|
||||
pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout),
|
||||
fancy_shape_renderer,
|
||||
NULL, NULL);
|
||||
attrs = create_fancy_attr_list_for_layout (layout);
|
||||
gtk_label_set_attributes (GTK_LABEL (label), attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 2 * RADIUS, 2 * RADIUS);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
|
@@ -1,283 +0,0 @@
|
||||
/* Entry/Search Entry
|
||||
*
|
||||
* GtkEntry allows to display icons and progress information.
|
||||
* This demo shows how to use these features in a search entry.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *menu = NULL;
|
||||
static GtkWidget *notebook = NULL;
|
||||
|
||||
static guint search_progress_id = 0;
|
||||
static guint finish_search_id = 0;
|
||||
|
||||
static void
|
||||
show_find_button (void)
|
||||
{
|
||||
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
show_cancel_button (void)
|
||||
{
|
||||
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
search_progress (gpointer data)
|
||||
{
|
||||
gtk_entry_progress_pulse (GTK_ENTRY (data));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
search_progress_done (GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_progress_fraction (entry, 0.0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
finish_search (GtkButton *button)
|
||||
{
|
||||
show_find_button ();
|
||||
g_source_remove (search_progress_id);
|
||||
search_progress_id = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
start_search_feedback (gpointer data)
|
||||
{
|
||||
search_progress_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 100,
|
||||
(GSourceFunc)search_progress, data,
|
||||
(GDestroyNotify)search_progress_done);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
start_search (GtkButton *button,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
show_cancel_button ();
|
||||
search_progress_id = g_timeout_add_seconds (1, (GSourceFunc)start_search_feedback, entry);
|
||||
finish_search_id = g_timeout_add_seconds (15, (GSourceFunc)finish_search, button);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
stop_search (GtkButton *button,
|
||||
gpointer data)
|
||||
{
|
||||
g_source_remove (finish_search_id);
|
||||
finish_search (button);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_press_cb (GtkEntry *entry,
|
||||
gint position,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (position == GTK_ENTRY_ICON_PRIMARY)
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
else
|
||||
gtk_entry_set_text (entry, "");
|
||||
}
|
||||
|
||||
static void
|
||||
text_changed_cb (GtkEntry *entry,
|
||||
GParamSpec *pspec,
|
||||
GtkWidget *button)
|
||||
{
|
||||
gboolean has_text;
|
||||
|
||||
has_text = gtk_entry_get_text_length (entry) > 0;
|
||||
gtk_entry_set_icon_sensitive (entry,
|
||||
GTK_ENTRY_ICON_SECONDARY,
|
||||
has_text);
|
||||
gtk_widget_set_sensitive (button, has_text);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_cb (GtkEntry *entry,
|
||||
GtkButton *button)
|
||||
{
|
||||
if (search_progress_id != 0)
|
||||
return;
|
||||
|
||||
start_search (button, entry);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
search_by_name (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_icon_from_stock (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
GTK_STOCK_FIND);
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by name\n"
|
||||
"Click here to change the search type");
|
||||
}
|
||||
|
||||
static void
|
||||
search_by_description (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_icon_from_stock (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
GTK_STOCK_EDIT);
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by description\n"
|
||||
"Click here to change the search type");
|
||||
}
|
||||
|
||||
static void
|
||||
search_by_file (GtkWidget *item,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
gtk_entry_set_icon_from_stock (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
GTK_STOCK_OPEN);
|
||||
gtk_entry_set_icon_tooltip_text (entry,
|
||||
GTK_ENTRY_ICON_PRIMARY,
|
||||
"Search by file name\n"
|
||||
"Click here to change the search type");
|
||||
}
|
||||
|
||||
static void
|
||||
search_entry_destroyed (GtkWidget *widget)
|
||||
{
|
||||
if (finish_search_id != 0)
|
||||
g_source_remove (finish_search_id);
|
||||
|
||||
if (search_progress_id != 0)
|
||||
g_source_remove (search_progress_id);
|
||||
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *
|
||||
do_search_entry (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
GtkWidget *item;
|
||||
GtkWidget *image;
|
||||
GtkWidget *find_button;
|
||||
GtkWidget *cancel_button;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_dialog_new_with_buttons ("Search Entry",
|
||||
GTK_WINDOW (do_widget),
|
||||
0,
|
||||
GTK_STOCK_CLOSE,
|
||||
GTK_RESPONSE_NONE,
|
||||
NULL);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (search_entry_destroyed), &window);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 5);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label), "Search entry demo");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
||||
|
||||
/* Create our entry */
|
||||
entry = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
|
||||
|
||||
/* Create the find and cancel buttons */
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
|
||||
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, FALSE, FALSE, 0);
|
||||
|
||||
find_button = gtk_button_new_with_label ("Find");
|
||||
g_signal_connect (find_button, "clicked",
|
||||
G_CALLBACK (start_search), entry);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), find_button, NULL);
|
||||
gtk_widget_show (find_button);
|
||||
|
||||
cancel_button = gtk_button_new_with_label ("Cancel");
|
||||
g_signal_connect (cancel_button, "clicked",
|
||||
G_CALLBACK (stop_search), NULL);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cancel_button, NULL);
|
||||
gtk_widget_show (cancel_button);
|
||||
|
||||
/* Set up the search icon */
|
||||
search_by_name (NULL, GTK_ENTRY (entry));
|
||||
|
||||
/* Set up the clear icon */
|
||||
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
|
||||
GTK_ENTRY_ICON_SECONDARY,
|
||||
GTK_STOCK_CLEAR);
|
||||
text_changed_cb (GTK_ENTRY (entry), NULL, find_button);
|
||||
|
||||
g_signal_connect (entry, "icon-press",
|
||||
G_CALLBACK (icon_press_cb), NULL);
|
||||
g_signal_connect (entry, "notify::text",
|
||||
G_CALLBACK (text_changed_cb), find_button);
|
||||
g_signal_connect (entry, "activate",
|
||||
G_CALLBACK (activate_cb), NULL);
|
||||
|
||||
/* Create the menu */
|
||||
menu = gtk_menu_new ();
|
||||
gtk_menu_attach_to_widget (GTK_MENU (menu), entry, NULL);
|
||||
|
||||
item = gtk_image_menu_item_new_with_label ("Search by name");
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
|
||||
g_signal_connect (item, "activate", G_CALLBACK (search_by_name), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
item = gtk_image_menu_item_new_with_label ("Search by description");
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
|
||||
g_signal_connect (item, "activate", G_CALLBACK (search_by_description), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
item = gtk_image_menu_item_new_with_label ("Search by file name");
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
|
||||
g_signal_connect (item, "activate", G_CALLBACK (search_by_file), entry);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
gtk_widget_show_all (menu);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (menu);
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
@@ -1,200 +0,0 @@
|
||||
/* Text Widget/Automatic scrolling
|
||||
*
|
||||
* This example demonstrates how to use the gravity of
|
||||
* GtkTextMarks to keep a text view scrolled to the bottom
|
||||
* while appending text.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* Scroll to the end of the buffer.
|
||||
*/
|
||||
static gboolean
|
||||
scroll_to_end (GtkTextView *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
GtkTextMark *mark;
|
||||
char *spaces;
|
||||
static int count;
|
||||
|
||||
buffer = gtk_text_view_get_buffer (textview);
|
||||
|
||||
/* Get "end" mark. It's located at the end of buffer because
|
||||
* of right gravity
|
||||
*/
|
||||
mark = gtk_text_buffer_get_mark (buffer, "end");
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark);
|
||||
|
||||
/* and insert some text at its position, the iter will be
|
||||
* revalidated after insertion to point to the end of inserted text
|
||||
*/
|
||||
spaces = g_strnfill (count++, ' ');
|
||||
gtk_text_buffer_insert (buffer, &iter, "\n", -1);
|
||||
gtk_text_buffer_insert (buffer, &iter, spaces, -1);
|
||||
gtk_text_buffer_insert (buffer, &iter,
|
||||
"Scroll to end scroll to end scroll "
|
||||
"to end scroll to end ",
|
||||
-1);
|
||||
g_free (spaces);
|
||||
|
||||
/* Now scroll the end mark onscreen.
|
||||
*/
|
||||
gtk_text_view_scroll_mark_onscreen (textview, mark);
|
||||
|
||||
/* Emulate typewriter behavior, shift to the left if we
|
||||
* are far enough to the right.
|
||||
*/
|
||||
if (count > 150)
|
||||
count = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Scroll to the bottom of the buffer.
|
||||
*/
|
||||
static gboolean
|
||||
scroll_to_bottom (GtkTextView *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
GtkTextMark *mark;
|
||||
char *spaces;
|
||||
static int count;
|
||||
|
||||
buffer = gtk_text_view_get_buffer (textview);
|
||||
|
||||
/* Get end iterator */
|
||||
gtk_text_buffer_get_end_iter (buffer, &iter);
|
||||
|
||||
/* and insert some text at it, the iter will be revalidated
|
||||
* after insertion to point to the end of inserted text
|
||||
*/
|
||||
spaces = g_strnfill (count++, ' ');
|
||||
gtk_text_buffer_insert (buffer, &iter, "\n", -1);
|
||||
gtk_text_buffer_insert (buffer, &iter, spaces, -1);
|
||||
gtk_text_buffer_insert (buffer, &iter,
|
||||
"Scroll to bottom scroll to bottom scroll "
|
||||
"to bottom scroll to bottom",
|
||||
-1);
|
||||
g_free (spaces);
|
||||
|
||||
/* Move the iterator to the beginning of line, so we don't scroll
|
||||
* in horizontal direction
|
||||
*/
|
||||
gtk_text_iter_set_line_offset (&iter, 0);
|
||||
|
||||
/* and place the mark at iter. the mark will stay there after we
|
||||
* insert some text at the end because it has right gravity.
|
||||
*/
|
||||
mark = gtk_text_buffer_get_mark (buffer, "scroll");
|
||||
gtk_text_buffer_move_mark (buffer, mark, &iter);
|
||||
|
||||
/* Scroll the mark onscreen.
|
||||
*/
|
||||
gtk_text_view_scroll_mark_onscreen (textview, mark);
|
||||
|
||||
/* Shift text back if we got enough to the right.
|
||||
*/
|
||||
if (count > 40)
|
||||
count = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static guint
|
||||
setup_scroll (GtkTextView *textview,
|
||||
gboolean to_end)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
|
||||
buffer = gtk_text_view_get_buffer (textview);
|
||||
gtk_text_buffer_get_end_iter (buffer, &iter);
|
||||
|
||||
if (to_end)
|
||||
{
|
||||
/* If we want to scroll to the end, including horizontal scrolling,
|
||||
* then we just create a mark with right gravity at the end of the
|
||||
* buffer. It will stay at the end unless explicitely moved with
|
||||
* gtk_text_buffer_move_mark.
|
||||
*/
|
||||
gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE);
|
||||
|
||||
/* Add scrolling timeout. */
|
||||
return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we want to scroll to the bottom, but not scroll horizontally,
|
||||
* then an end mark won't do the job. Just create a mark so we can
|
||||
* use it with gtk_text_view_scroll_mark_onscreen, we'll position it
|
||||
* explicitely when needed. Use left gravity so the mark stays where
|
||||
* we put it after inserting new text.
|
||||
*/
|
||||
gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE);
|
||||
|
||||
/* Add scrolling timeout. */
|
||||
return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remove_timeout (GtkWidget *window,
|
||||
gpointer timeout)
|
||||
{
|
||||
g_source_remove (GPOINTER_TO_UINT (timeout));
|
||||
}
|
||||
|
||||
static void
|
||||
create_text_view (GtkWidget *hbox,
|
||||
gboolean to_end)
|
||||
{
|
||||
GtkWidget *swindow;
|
||||
GtkWidget *textview;
|
||||
guint timeout;
|
||||
|
||||
swindow = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0);
|
||||
textview = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (swindow), textview);
|
||||
|
||||
timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end);
|
||||
|
||||
/* Remove the timeout in destroy handler, so we don't try to
|
||||
* scroll destroyed widget.
|
||||
*/
|
||||
g_signal_connect (textview, "destroy",
|
||||
G_CALLBACK (remove_timeout),
|
||||
GUINT_TO_POINTER (timeout));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_textscroll (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *hbox;
|
||||
|
||||
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);
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
create_text_view (hbox, TRUE);
|
||||
create_text_view (hbox, FALSE);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -155,7 +155,7 @@ insert_text (GtkTextBuffer *buffer)
|
||||
GtkTextChildAnchor *anchor;
|
||||
char *filename;
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
/* demo_find_file() looks in the the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
@@ -350,7 +350,7 @@ insert_text (GtkTextBuffer *buffer)
|
||||
anchor = gtk_text_buffer_create_child_anchor (buffer, &iter);
|
||||
gtk_text_buffer_insert (buffer, &iter, ".\n", -1);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, "\n\nThis demo doesn't demonstrate all the GtkTextBuffer features; it leaves out, for example: invisible/hidden text, tab stops, application-drawn areas on the sides of the widget for displaying breakpoints and such...", -1);
|
||||
gtk_text_buffer_insert (buffer, &iter, "\n\nThis demo doesn't demonstrate all the GtkTextBuffer features; it leaves out, for example: invisible/hidden text (doesn't work in GTK 2, but planned), tab stops, application-drawn areas on the sides of the widget for displaying breakpoints and such...", -1);
|
||||
|
||||
/* Apply word_wrap tag to whole buffer */
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
@@ -549,7 +549,6 @@ easter_egg_callback (GtkWidget *button,
|
||||
gpointer data)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
gpointer window_ptr;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkWidget *view;
|
||||
GtkTextIter iter;
|
||||
@@ -587,8 +586,8 @@ easter_egg_callback (GtkWidget *button,
|
||||
gtk_container_add (GTK_CONTAINER (window), sw);
|
||||
gtk_container_add (GTK_CONTAINER (sw), view);
|
||||
|
||||
window_ptr = &window;
|
||||
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);
|
||||
g_object_add_weak_pointer (G_OBJECT (window),
|
||||
(gpointer *) &window);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
|
||||
|
||||
|
@@ -183,12 +183,10 @@ do_ui_manager (GtkWidget *do_widget)
|
||||
|
||||
ui = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui, actions, 0);
|
||||
g_object_unref (actions);
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window),
|
||||
gtk_ui_manager_get_accel_group (ui));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "UI Manager");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
|
||||
|
||||
|
||||
if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, &error))
|
||||
{
|
||||
@@ -225,7 +223,6 @@ do_ui_manager (GtkWidget *do_widget)
|
||||
gtk_widget_grab_default (button);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
g_object_unref (ui);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <math.h>
|
||||
@@ -225,7 +225,7 @@ main (int argc, char **argv)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
timeout_id = gdk_threads_add_timeout (FRAME_DELAY, timeout, NULL);
|
||||
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
gtk_main ();
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -301,7 +301,7 @@ start_progressive_loading (GtkWidget *image)
|
||||
* The timeout simply simulates a slow data source by inserting
|
||||
* pauses in the reading process.
|
||||
*/
|
||||
lc->load_timeout = gdk_threads_add_timeout (100,
|
||||
lc->load_timeout = g_timeout_add (100,
|
||||
progressive_timeout,
|
||||
image);
|
||||
}
|
||||
|
@@ -1,392 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <demos.h>
|
||||
|
||||
static GtkTextBuffer *info_buffer;
|
||||
static GtkTextBuffer *source_buffer;
|
||||
|
||||
static gchar *current_file = NULL;
|
||||
|
||||
enum {
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
ITALIC_COLUMN,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
gboolean
|
||||
read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
flockfile (stream);
|
||||
|
||||
g_string_truncate (str, 0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = getc_unlocked (stream);
|
||||
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
else
|
||||
n_read++;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
int next_c = getc_unlocked (stream);
|
||||
|
||||
if (!(next_c == EOF ||
|
||||
(c == '\r' && next_c == '\n') ||
|
||||
(c == '\n' && next_c == '\r')))
|
||||
ungetc (next_c, stream);
|
||||
|
||||
goto done;
|
||||
}
|
||||
default:
|
||||
g_string_append_c (str, c);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
funlockfile (stream);
|
||||
|
||||
return n_read > 0;
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const gchar *filename)
|
||||
{
|
||||
FILE *file;
|
||||
GtkTextIter start, end;
|
||||
GString *buffer = g_string_new (NULL);
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
|
||||
if (current_file && !strcmp (current_file, filename))
|
||||
return;
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (filename);
|
||||
|
||||
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (info_buffer, &start, &end);
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
|
||||
file = fopen (filename, "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
{
|
||||
gchar *p = buffer->str;
|
||||
gchar *q;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
/* Reading title */
|
||||
while (*p == '/' || *p == '*' || isspace (*p))
|
||||
p++;
|
||||
q = p + strlen (p);
|
||||
while (q > p && isspace (*(q - 1)))
|
||||
q--;
|
||||
|
||||
if (q > p)
|
||||
{
|
||||
int len_chars = g_utf8_pointer_to_offset (p, q);
|
||||
|
||||
end = start;
|
||||
|
||||
g_assert (strlen (p) >= q - p);
|
||||
gtk_text_buffer_insert (info_buffer, &end, p, q - p);
|
||||
start = end;
|
||||
|
||||
gtk_text_iter_backward_chars (&start, len_chars);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "title", &start, &end);
|
||||
|
||||
start = end;
|
||||
|
||||
state++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
/* Reading body of info section */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p == '*' && *(p + 1) == '/')
|
||||
{
|
||||
gtk_text_buffer_get_iter_at_offset (source_buffer, &start, 0);
|
||||
state++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
while (*p == '*' || isspace (*p))
|
||||
p++;
|
||||
|
||||
len = strlen (p);
|
||||
while (isspace (*(p + len - 1)))
|
||||
len--;
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
if (in_para)
|
||||
gtk_text_buffer_insert (info_buffer, &start, " ", 1);
|
||||
|
||||
g_assert (strlen (p) >= len);
|
||||
gtk_text_buffer_insert (info_buffer, &start, p, len);
|
||||
in_para = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
in_para = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* Skipping blank lines */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
p = buffer->str;
|
||||
state++;
|
||||
/* Fall through */
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "source", &start, &end);
|
||||
fclose (file);
|
||||
}
|
||||
|
||||
gboolean
|
||||
button_press_event_cb (GtkTreeView *tree_view,
|
||||
GdkEventButton *event,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
if (event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
GtkTreePath *path = NULL;
|
||||
|
||||
gtk_tree_view_get_path_at_pos (tree_view,
|
||||
event->window,
|
||||
event->x,
|
||||
event->y,
|
||||
&path,
|
||||
NULL);
|
||||
|
||||
if (path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean italic;
|
||||
GVoidFunc func;
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_store_get (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
(func) ();
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
g_signal_stop_emission_by_name (tree_view, "button-press-event");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GValue value = {0, };
|
||||
|
||||
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get_value (model, &iter,
|
||||
FILENAME_COLUMN,
|
||||
&value);
|
||||
load_file (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_text (GtkTextBuffer **buffer,
|
||||
gboolean is_source)
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
text_view = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
|
||||
*buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
font_desc = pango_font_description_from_string ("Courier 10");
|
||||
gtk_widget_modify_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
}
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), !is_source);
|
||||
|
||||
return scrolled_window;
|
||||
}
|
||||
|
||||
/* Technically a list, but if we do go to 80 demos, we may want to move to a tree */
|
||||
static GtkWidget *
|
||||
create_tree (void)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkCellRenderer *cell;
|
||||
GtkWidget *tree_view;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeStore *model;
|
||||
GtkTreeIter iter;
|
||||
gint i;
|
||||
|
||||
model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
|
||||
gtk_tree_selection_set_type (GTK_TREE_SELECTION (selection),
|
||||
GTK_TREE_SELECTION_SINGLE);
|
||||
gtk_widget_set_usize (tree_view, 200, -1);
|
||||
|
||||
for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
|
||||
{
|
||||
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
TITLE_COLUMN, testgtk_demos[i].title,
|
||||
FILENAME_COLUMN, testgtk_demos[i].filename,
|
||||
FUNC_COLUMN, testgtk_demos[i].func,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
}
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Widget",
|
||||
cell,
|
||||
"text", TITLE_COLUMN,
|
||||
"italic", ITALIC_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
|
||||
GTK_TREE_VIEW_COLUMN (column));
|
||||
|
||||
g_signal_connect (selection, "selection-changed", selection_cb, model);
|
||||
g_signal_connect (tree_view, "button-press-event", G_CALLBACK (button_press_event_cb), model);
|
||||
|
||||
return tree_view;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *tree;
|
||||
GtkTextTag *tag;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
tree = create_tree ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), tree, FALSE, FALSE, 0);
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&info_buffer, FALSE),
|
||||
gtk_label_new ("Info"));
|
||||
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&source_buffer, TRUE),
|
||||
gtk_label_new ("Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "source");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
load_file (testgtk_demos[0].filename);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
int
|
||||
@@ -66,7 +66,7 @@ configure_cb (GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
extern void pixbuf_init (void);
|
||||
extern void pixbuf_init ();
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -17,13 +17,13 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
|
||||
|
||||
#include "test-inline-pixbufs.h"
|
||||
|
||||
@@ -358,11 +358,11 @@ expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data)
|
||||
static void
|
||||
config_func (GtkWidget *drawing_area, GdkEventConfigure *event, gpointer data)
|
||||
{
|
||||
#if 0
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
pixbuf = (GdkPixbuf *)g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
|
||||
|
||||
#if 0
|
||||
if (((event->width) != gdk_pixbuf_get_width (pixbuf)) ||
|
||||
((event->height) != gdk_pixbuf_get_height (pixbuf)))
|
||||
gdk_pixbuf_scale (pixbuf, event->width, event->height);
|
||||
@@ -383,7 +383,7 @@ new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
|
||||
w = gdk_pixbuf_get_width (pixbuf);
|
||||
h = gdk_pixbuf_get_height (pixbuf);
|
||||
|
||||
window = g_object_new (gtk_window_get_type (),
|
||||
window = gtk_widget_new (gtk_window_get_type (),
|
||||
"GtkObject::user_data", NULL,
|
||||
"GtkWindow::type", GTK_WINDOW_TOPLEVEL,
|
||||
"GtkWindow::title", title ? title : "testrgb",
|
||||
@@ -504,7 +504,7 @@ progressive_updated_callback (GdkPixbufLoader* loader, guint x, guint y, guint w
|
||||
|
||||
static int readlen = 4096;
|
||||
|
||||
extern void pixbuf_init (void);
|
||||
extern void pixbuf_init ();
|
||||
|
||||
void size_func (GdkPixbufLoader *loader, gint width, gint height, gpointer data)
|
||||
{
|
||||
@@ -628,7 +628,7 @@ main (int argc, char **argv)
|
||||
|
||||
status.readlen = readlen;
|
||||
|
||||
status.timeout = gdk_threads_add_timeout (100, update_timeout, &status);
|
||||
status.timeout = g_timeout_add (100, update_timeout, &status);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
21
docs/.cvsignore
Normal file
21
docs/.cvsignore
Normal file
@@ -0,0 +1,21 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.html
|
||||
*.dvi
|
||||
*.ps
|
||||
*.pg
|
||||
*.ky
|
||||
*.cp
|
||||
*.fn
|
||||
*.tp
|
||||
*.vr
|
||||
*.log
|
||||
*.aux
|
||||
*.toc
|
||||
*.cps
|
||||
*.fns
|
||||
*.vrs
|
||||
html
|
||||
text
|
||||
texinfo.tex
|
||||
gtk-config.1
|
@@ -1,9 +1,8 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS = tutorial faq reference tools
|
||||
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
defsformat.txt \
|
||||
developers.txt \
|
||||
dnd_internals.txt \
|
||||
@@ -19,5 +18,3 @@ EXTRA_DIST += \
|
||||
generation.txt \
|
||||
gtkdocs_fix \
|
||||
RELEASE-HOWTO
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
157
docs/README.linux-fb
Normal file
157
docs/README.linux-fb
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
|
||||
|
||||
|
||||
THIS FILE IS OBSOLETE - use docs/reference/gtk/framebuffer.sgml
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
About GtkFB:
|
||||
------------
|
||||
The linux-fb port of Gtk+, also known as GtkFB is an implementation of
|
||||
gdk (and therefor gtk) that runs on the linux framebuffer. It runs in
|
||||
a single process that doesn't need X. It should run most Gtk+ programs
|
||||
without any changes to the source.
|
||||
|
||||
Build requirements:
|
||||
-------------------
|
||||
To run GtkFB programs you will need glib, pango and gtk from cvs
|
||||
HEAD. Make sure you update these at the same time, since changes to
|
||||
glib and pango often forces changes in gtk+. Pango optionally depends
|
||||
on libfribidi, but for normal GtkFB usage that can be ignored.
|
||||
|
||||
You also need freetype 2, I recommend that you use freetype 2.0.1 or
|
||||
later, as there was some problems with freetype-config in 2.0.
|
||||
Make sure that you install freetype before pango, since pango also
|
||||
needs it.
|
||||
Freetype can be found at ftp://ftp.freetype.org
|
||||
|
||||
Hardware requirements:
|
||||
----------------------
|
||||
You need a graphics card with an availible framebuffer driver that can
|
||||
run in 8, 16, 24 or 32 bpp. I use the matroxfb driver, but i.e. vesafb
|
||||
should work too. You also need a supported mouse. Currently supported
|
||||
is ps2 mouse, ms serial mouse and fidmour touchscreen.
|
||||
|
||||
Building and installing:
|
||||
------------------------
|
||||
First build and install glib and pango as usual, in that order.
|
||||
|
||||
Then configure Gtk by running configure (or autogen.sh if running from
|
||||
cvs) with --with-gdktarget=linux-fb.
|
||||
|
||||
Then compile as ususal: make; make install
|
||||
|
||||
Fonts:
|
||||
------
|
||||
Since GtkFB uses freetype 2 to render fonts it can render truetype and
|
||||
postscript type 1 antialiased fonts.
|
||||
|
||||
At startup it scans some directories looking for fonts. By default
|
||||
it looks in $prefix/lib/ft2fonts, and if you want to change this you
|
||||
must add something like:
|
||||
|
||||
[PangoFT2]
|
||||
FontPath = /usr/share/fonts/default/Type1:/usr/share/fonts/default/TrueType
|
||||
|
||||
To your $prefix/etc/pango/pangorc or ~/.pangorc.
|
||||
|
||||
You must also set up font aliases for the fonts Sans, Serif and Monotype.
|
||||
This is done by creating a $prefix/etc/pango/pangoft2.aliases or
|
||||
~/.pangoft2_aliases file. You can also set the name of this file using the
|
||||
key AliasFiles in the PangoFT2 section in pangorc.
|
||||
|
||||
An example of a font alias file for the urw fontset is:
|
||||
sans normal normal normal normal "urw gothic l"
|
||||
serif normal normal normal normal "urw palladio l"
|
||||
monospace normal normal normal normal "nimbus mono l"
|
||||
|
||||
And one using the Windows truetype fonts is:
|
||||
sans normal normal normal normal "arial"
|
||||
serif normal normal normal normal "times new roman"
|
||||
monospace normal normal normal normal "courier new"
|
||||
|
||||
A more detailed example can be found in examples/pangoft2.aliases in the
|
||||
pango distribution.
|
||||
|
||||
Running:
|
||||
--------
|
||||
To run a program you should only need to start it, but there are some
|
||||
things that can cause problems, and some things that can be controlled
|
||||
by environment variables. Try testgtk distributed with gtk+ to test
|
||||
if things work.
|
||||
|
||||
If you use a ps2 mouse, make sure that /dev/psaux is readable and
|
||||
writable.
|
||||
|
||||
Make sure gpm is not running.
|
||||
|
||||
If you don't specify anything GtkFB will start up in the current
|
||||
virtual console in the current resolution and bit-depth. This can be
|
||||
changed by specifying environment variables:
|
||||
|
||||
GDK_VT:
|
||||
unset means open on the current VT.
|
||||
0-9: open on the specified VT. Make sure you have read/write rights
|
||||
there.
|
||||
new: Allocate a new VT after the last currently used one.
|
||||
|
||||
GDK_DISPLAY_MODE:
|
||||
Specifies the name of a mode in /etc/fb.modes that you want to use.
|
||||
|
||||
GDK_DISPLAY_DEPTH:
|
||||
Specify the desired bit depth of the framebuffer.
|
||||
|
||||
GDK_DISPLAY_WIDTH:
|
||||
Specify the desired width of the framebuffer.
|
||||
|
||||
GDK_DISPLAY_HEIGHT:
|
||||
Specify the desired height of the framebuffer.
|
||||
|
||||
GDK_DISPLAY:
|
||||
Specify the framebuffer device to use. Default is /dev/fb0
|
||||
|
||||
GDK_MOUSE_TYPE:
|
||||
Specify mouse type. Currently supported is:
|
||||
ps2 - PS/2 mouse
|
||||
imps2 - PS/2 intellimouse (wheelmouse)
|
||||
ms - Microsoft serial mouse
|
||||
fidmour - touch screen
|
||||
Default is ps2.
|
||||
|
||||
GDK_KEYBOARD_TYPE:
|
||||
Specify keyboard type. Currently suppored is
|
||||
xlate - normal tty mode keyboard.
|
||||
Quite limited, cannot detect key up/key down events. Doesn't
|
||||
handle ctrl/alt/shift for all keys. This is the default driver,
|
||||
but should not be used in "production" use.
|
||||
raw - read from the tty in RAW mode.
|
||||
Sets the keyboard in RAW mode and handles all the keycodes. This
|
||||
gives correct handling of modifiers and key up/down events. You
|
||||
must be root to use this. If you use this for development or
|
||||
debugging it is recommended to enable magic sysrq handling in the
|
||||
kernel. Then you can use ALT-SysRQ-r to turn the keyboard back to
|
||||
normal mode.
|
||||
Default is xlate.
|
||||
|
||||
HACKING:
|
||||
--------
|
||||
|
||||
Pressing Ctrl-Alt-Return repaints the whole screen.
|
||||
Unfortunately this cannot be pressed when using the xlate keyboard
|
||||
driver, so instead you can use shift-F1 instead when using this
|
||||
driver.
|
||||
|
||||
Pressing Ctrl-Alt-BackSpace kills the GtkFB program. (Can't be pressed
|
||||
in the xlate driver.
|
||||
|
||||
More to be written.
|
||||
|
||||
- Alexander Larsson <alexl@redhat.com>
|
||||
2000/12/06
|
||||
|
||||
|
@@ -1,107 +1,45 @@
|
||||
How to do a GTK+ release?
|
||||
=========================
|
||||
|
||||
Make sure you have suitable versions of autoconf and libtool.
|
||||
Make sure you have Owen's special autoconf and libtool RPMs, available at:
|
||||
http://people.redhat.com/otaylor/gtk/autotools/.
|
||||
|
||||
Also make sure you have the following packages installed with all their
|
||||
dependencies:
|
||||
dependencies (I used the RPM package names from RedHat 9):
|
||||
* gtk-doc
|
||||
* linuxdoc-tools
|
||||
* docbook-utils
|
||||
|
||||
Without those packages make distcheck will *not* pass.
|
||||
|
||||
|
||||
0) Go back to a pristine working directory. With git, this works:
|
||||
|
||||
git clean -f -x
|
||||
|
||||
1) autogen and build it, make sure to enable docs by specifying
|
||||
--enable-gtk-doc --enable-man
|
||||
|
||||
2) Update NEWS based on the content of git log; follow the format
|
||||
of prior entries. This includes finding noteworthy new features,
|
||||
collecting summaries for all the fixed bugs that are referenced
|
||||
and collecting all updated translations.
|
||||
Also collect the names of all contributors that are mentioned.
|
||||
We don't discriminate between bug reporters, patch writers,
|
||||
committers, etc. Anybody who is mentioned in ChangeLog gets
|
||||
credits, but only real names, not email addresses or nicknames.
|
||||
|
||||
3) In particular, if this is a major, stable, release, verify that
|
||||
README.in contains the relevant release notes and that the
|
||||
required versions of dependencies in INSTALL.in are in sync
|
||||
with configure.in.
|
||||
|
||||
4) Verify that the version in configure.in has been bumped after the last
|
||||
release. (Note that this is critical, a slip-up here will cause the
|
||||
soname to change).
|
||||
|
||||
5) Make sure that make check is happy (If you don't do it here, make distcheck
|
||||
will also catch it, but it is kind of disheartening to see make distcheck
|
||||
fail due to an extraneous symbol after watching it build the docs for an
|
||||
hour...).
|
||||
Typical problems to expect here (depending on whether this is a devel
|
||||
snapshot or a stable release):
|
||||
* forgotten source files
|
||||
* new symbols missing from .symbols files
|
||||
* symbols that are exported by should be private (static or _-prefixed)
|
||||
* symbols that cause PLT entries. This is either caused by using
|
||||
a in the same library function without including the header or by
|
||||
using a function from a different library, which is not yet allowed
|
||||
by the filter in pltcheck.sh
|
||||
|
||||
6) If this is a devel release, make sure that the docs for new symbols
|
||||
are in good shape. Look at the -unused.txt files and add stuff found
|
||||
there to the corresponding -sections.txt file. Look at the
|
||||
-undocumented.txt files and see if there is anything in there that
|
||||
should be documented. If it is, this may be due to typos in the doc
|
||||
comments in the source. Make sure that all new symbols have proper
|
||||
Since: tags, and that there is an index in the main -docs.sgml for
|
||||
the next stable version.
|
||||
|
||||
7) make distcheck
|
||||
|
||||
8) Fix broken stuff found by 7), repeat
|
||||
|
||||
9) Commit all changes: git commit -a. You will have a bunch of po file
|
||||
changes, NEWS and maybe some doc changes too
|
||||
|
||||
10) Now you've got the tarball. Check that the tarball size looks
|
||||
reasonable compared to previous releases. If the size goes down
|
||||
a lot, likely the docs went missing for some reason. Or the translations.
|
||||
If the size goes up by a lot, something else may be wrong.
|
||||
|
||||
11) Tag the release. The git command for doing that looks like
|
||||
|
||||
git tag -m "GTK+ 2.12.10" 2.12.10
|
||||
|
||||
12) Push the tagged commit upstream. The git command for doing that is
|
||||
|
||||
git push origin refs/tags/2.12.10
|
||||
|
||||
13) Bump the version number in configure.in and commit and push this change
|
||||
|
||||
14) Upload the tarball to master.gnome.org and run install-module to transfer
|
||||
it to download.gnome.org. If you don't have an account on master.gnome.org,
|
||||
find someone who can do it for you. The command for this looks like
|
||||
|
||||
scp gtk+-2.12.10.tar.gz matthiasc@master.gnome.org:
|
||||
ssh matthiasc@master.gnome.org
|
||||
install-module gtk+-2.12.10.tar.gz
|
||||
|
||||
15) Get the .bz2 tarball and the .md5sum files back from master.gnome.org
|
||||
You can probably also create it locally, but I've experienced md5
|
||||
mismatches when doing so.
|
||||
|
||||
16) Upload the .gz and .bz2 tarballs and checksums to ftp.gtk.org and put
|
||||
them in the right directory below /ftp/pub. Pay attention to correct
|
||||
ownership, and don't forget to update the LATEST file in the directory.
|
||||
|
||||
17) Go to the gnome-announce list archives, find the last announce message,
|
||||
create a new message in the same form, replacing version numbers,
|
||||
commentary at the top about "what this release is about" and the
|
||||
summary of changes.
|
||||
|
||||
18) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
gtk-devel-list. Set reply-to to gnome-hackers.
|
||||
|
||||
19) Add a link to the release announcement to www.gtk.org which lives
|
||||
in the gtk-web cvs module.
|
||||
0) Blow away your gtk+ directory, check a new version out
|
||||
1) autogen and build it, make sure to enable docs.
|
||||
2) Update NEWS based on the various ChangeLog files
|
||||
3) Verify that the version in configure.in has been bumped after the last
|
||||
release. (Note that this is critical, a slip-up here will cause the soname
|
||||
to change).
|
||||
4) Make sure that make check is happy (If you don't do it here, make distcheck
|
||||
will also catch it, but it is kind of disheartening to see make distcheck fail
|
||||
due to an extraneous symbol after watching it build the docs for an hour...)
|
||||
5) Add === Released 2.x.y === at the top of all ChangeLog files
|
||||
6) make distcheck
|
||||
7) Fix broken stuff found by 5) repeat
|
||||
8) cvs commit; you'll have a bunch of po file changes, and maybe some
|
||||
doc changes too (NOTE: be sure to use cvs with compression, else you'll
|
||||
end up waiting for a long time :).
|
||||
9) If 7) fails because someone else committed inbetween, curse, cvs up,
|
||||
fix conflicts and go to 5)
|
||||
10) type 'cvs tag GTK_2_x_y' in the toplevel directory
|
||||
11) You now have the tarball, and the CVS tag, now upload the tarball to
|
||||
gnome.org and gtk.org
|
||||
12) Go to the gnome-announce list archives, find the last announce message,
|
||||
create a new message in the same form, replacing version numbers, commentary
|
||||
at the top about "what this release is about" and the Summary of changes.
|
||||
13) Send it to gnome-announce-list, gtk-list, gtk-app-devel-list and
|
||||
gtk-devel-list. Set reply-to to gnome-hackers.
|
||||
14) Bump the version number in configure.in.
|
||||
15) Create a new milestone in bugzilla and move the remaining bugs from the
|
||||
2.x.y milestone over to the new one.
|
||||
16) Add a link to the release announcement to www.gtk.org which lives in
|
||||
the gtk-web cvs module.
|
||||
|
@@ -6,7 +6,7 @@ programming for/with Gtk, having the spirit of a developers FAQ.
|
||||
It is also the correct place to list up things that programmers should
|
||||
care about in general.
|
||||
|
||||
In the hope that this text might be useful to someone,
|
||||
In the hope that this text might be usefull to someone,
|
||||
|
||||
- Tim Janik <timj@gimp.org>
|
||||
1998/02/11
|
||||
@@ -43,7 +43,7 @@ GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
|
||||
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
|
||||
GtkWidget::focus_out_event
|
||||
|
||||
Events that are assured to have a valid GdkEvent.any.window field are
|
||||
Events that are asured to have a valid GdkEvent.any.window field are
|
||||
|
||||
GDK_EXPOSE GtkWidget::expose_event
|
||||
|
||||
@@ -61,7 +61,7 @@ Writing Gdk functions
|
||||
---------------------
|
||||
|
||||
When writing Gdk functions that operate on GdkWindow structures in any
|
||||
meaningful sense, that is casting to a GdkWindowPrivate structure for
|
||||
maeningfull sense, that is casting to a GdkWindowPrivate structure for
|
||||
access to fields other then GdkWindow.user_data, the programmer is
|
||||
recommended to check for the GdkWindowPrivate.destroyed field to be ==
|
||||
FALSE, especially if the GdkWindowPrivate.xwindow field is used.
|
||||
|
@@ -112,7 +112,7 @@ Retrieves the selection that will be used to communicate
|
||||
the data for the drag context (valid on both source
|
||||
and dest sides)
|
||||
|
||||
Cursors and window hierarchies
|
||||
Cursors and window heirarchies
|
||||
==============================
|
||||
|
||||
The DND code, when possible (and it isn't possible over
|
||||
@@ -123,7 +123,7 @@ the cursor is in _ourselves_ so we can ignore the
|
||||
drag icon properly. (Oh for OutputOnly windows!)
|
||||
|
||||
To avoid obscene amounts of server traffic (which are only
|
||||
slightly observable locally, but would really kill a
|
||||
slighly observerable locally, but would really kill a
|
||||
session over a slow link), the code in GDK does
|
||||
XGetWindowAttributes for every child of the root window at
|
||||
the beginning of the drag, then selects with
|
||||
|
19
docs/faq/.cvsignore
Normal file
19
docs/faq/.cvsignore
Normal file
@@ -0,0 +1,19 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.html
|
||||
*.dvi
|
||||
*.ps
|
||||
*.pg
|
||||
*.ky
|
||||
*.cp
|
||||
*.fn
|
||||
*.tp
|
||||
*.vr
|
||||
*.log
|
||||
*.aux
|
||||
*.toc
|
||||
*.cps
|
||||
*.fns
|
||||
*.vrs
|
||||
html
|
||||
text
|
@@ -1,6 +1,4 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
gtk-faq.sgml
|
||||
|
||||
if HAVE_DOCBOOK
|
||||
@@ -38,5 +36,3 @@ dist-hook:
|
||||
endif
|
||||
|
||||
.PHONY: html
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -429,7 +429,7 @@ in which they need to be installed:</para>
|
||||
|
||||
<itemizedlist spacing=compact>
|
||||
<listitem><simpara> pkg-config
|
||||
(<ulink url="http://pkg-config.freedesktop.org/wiki">
|
||||
(<ulink url="http://www.freedesktop.org/software/pkgconfig">
|
||||
pkg-config Site</ulink>)</simpara>
|
||||
</listitem>
|
||||
|
||||
@@ -789,7 +789,8 @@ disgrace to the widget set will gladly be included.</para>
|
||||
<para>The new widgets that get added to GTK+ are generally either
|
||||
replacements for existing widgets that are no longer
|
||||
deemed to be adequate, or have been developed externally to GTK+ but
|
||||
have been widely tested.
|
||||
have been widely tested. One possible avenue for this is via
|
||||
<ulink url="http://cvs.gnome.org/lxr/source/libegg/">libegg</ulink>.</para>
|
||||
|
||||
<para>Before you spend months of your valuable time implementing your
|
||||
revolutionary widget, it is highly recommended that you get some
|
||||
@@ -824,8 +825,8 @@ However, bindings for many other languages are available.</para>
|
||||
<para>So, after you have installed GTK+ there are a couple of
|
||||
things that can ease you into developing applications with
|
||||
it. There is the GTK+ Tutorial <ulink
|
||||
url="http://library.gnome.org/devel/gtk-tutorial/stable/">
|
||||
http://library.gnome.org/devel/gtk-tutorial/stable/</ulink>, which is undergoing
|
||||
url="http://www.gtk.org/tutorial/">
|
||||
http://www.gtk.org/tutorial/</ulink>, which is undergoing
|
||||
development. This will introduce you to writing applications
|
||||
using C.</para>
|
||||
|
||||
@@ -1635,7 +1636,7 @@ int main(int argc, char *argv[])
|
||||
gtk_container_set_border_width(GTK_CONTAINER (window), 10);
|
||||
#endif
|
||||
|
||||
/* add a button to do something useful */
|
||||
/* add a button to do something usefull */
|
||||
button = gtk_button_new_with_label("Fork me!");
|
||||
|
||||
g_signal_connect(G_OBJECT (button), "clicked",
|
||||
@@ -2814,7 +2815,7 @@ the Label widget, which can be done using:</para>
|
||||
GtkTooltips in itself is not a GtkWidget (though a GtkObject)
|
||||
and as such is not attempted to match any widget styles.</para>
|
||||
|
||||
<para>So, your resource file should look something like:</para>
|
||||
<para>So, you resource file should look something like:</para>
|
||||
|
||||
<programlisting role="C">
|
||||
style "postie"
|
||||
|
2982
docs/faq/gtkfaq.sgml
Normal file
2982
docs/faq/gtkfaq.sgml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -97,7 +97,7 @@ F2, F3: together these are exactly the cases where we get
|
||||
|
||||
F4: we get an LeaveNotify with the focus flag set. An
|
||||
LeaveNotify with a focus flag set will also be sent if
|
||||
F==W, so we have to to explicitly test for that case
|
||||
F==W, so we have to to explicity test for that case
|
||||
using has_focus_window(W).
|
||||
|
||||
|
||||
|
@@ -107,7 +107,7 @@ makeenums.pl can be run into two modes:
|
||||
|
||||
2) Generate the enumeration portion of gtk.defs.
|
||||
|
||||
The enumeration portion is added to the boxed type
|
||||
The enumearation portion is added to the boxed type
|
||||
declarations in gtk-boxed.defs to create gtk.defs.
|
||||
|
||||
The makeetypes.awk program takes the gtk.defs file, and
|
||||
@@ -162,7 +162,7 @@ The possible types are:
|
||||
GtkDestroyNotify Notify)
|
||||
|
||||
Some of these types map to multiple return values - these
|
||||
are marked above with the return types in parentheses.
|
||||
are marked above with the return types in parantheses.
|
||||
|
||||
NOTES
|
||||
=====
|
||||
@@ -170,7 +170,7 @@ NOTES
|
||||
When autogenerating GTK+ files, the autogenerated
|
||||
files are often rebuild resulting in the same result.
|
||||
|
||||
To prevent unnecessary rebuilds of the entire directory, some files
|
||||
To prevent unecessary rebuilds of the entire directory, some files
|
||||
that multiple other source files depend on are not actually written
|
||||
to directly. Instead, an intermediate file is written, which
|
||||
is then compared to the old file, and only if it is different
|
||||
|
@@ -1,7 +1,7 @@
|
||||
CONFIGURING PACKAGES TO WORK WITH GTK
|
||||
-------------------------------------
|
||||
|
||||
Compiling a program successfully against the GTK, GDK, and GLIB
|
||||
Compiling a program succesfully against the GTK, GDK, and GLIB
|
||||
libraries can require a large number of command line options
|
||||
to your compiler and linker that are hard to guess correctly.
|
||||
The additional libraries required may, for example, depend on the
|
||||
|
@@ -22,10 +22,10 @@ GtkObjects also provide the following functions:
|
||||
GdkWindow
|
||||
---------
|
||||
|
||||
A GdkWindow has to be explicitly destroyed with gdk_window_destroy.
|
||||
A GdkWindow has to be explicitely destroyed with gdk_window_destroy.
|
||||
This will send out a request to destroy this window and all its
|
||||
children, and will decrement the ref_count of the GdkWindow by one.
|
||||
Thus, it releases the initial reference created by gdk_window_new.
|
||||
Thus, it releases the inital reference created by gdk_window_new.
|
||||
|
||||
All GdkWindows are kept in a hash table to translate from their XId to
|
||||
the actual structure and the pointer in the hash table is reflected in
|
||||
@@ -62,7 +62,7 @@ GdkVisual
|
||||
---------
|
||||
|
||||
There are no *_new or *_destroy functions and the *_ref and *_unref
|
||||
functions are no-ops. GdkVisuals are static structures and thus do not
|
||||
functions are noops. GdkVisuals are static structures and thus do not
|
||||
need reference counting. The ref counting functions are only there
|
||||
for extra defensive programming.
|
||||
|
||||
@@ -220,13 +220,13 @@ Then, when the user wants to get rid of the window:
|
||||
/* The GdkWindow of `window' and all its child GdkWindows are
|
||||
* destroyed.
|
||||
*
|
||||
* window is unregistered from the toplevel list and its ref_count
|
||||
* drops to zero. The destroy code of `window' destroys `option_menu'.
|
||||
* window is unregistered from the loplevel list and its ref_count
|
||||
* drops to zero. The destroy code of `window' destroyes `option_menu'.
|
||||
*
|
||||
* The destroy code of `option_menu' causes the `menu' to be detached
|
||||
* from it and its reference count drops to zero.
|
||||
*
|
||||
* The destroy code of `menu' destroys `menu_item'.
|
||||
* The destroy code of `menu' destroyes `menu_item'.
|
||||
*
|
||||
* The destruction of `menu_item' removes it from its parent, the
|
||||
* menu_item->ref_count drops to zero and `menu_item' is finalized (freed).
|
||||
@@ -241,7 +241,7 @@ Taking care of proper referencing
|
||||
|
||||
There are some cases where referencing of widgets from outside the toolkit
|
||||
(on the application side) is needed.
|
||||
Once the application performs an operation on a widget that will cause
|
||||
Once the application performes an operation on a widget that will cause
|
||||
its reference count to drop, if it wants to take further actions on the
|
||||
widget, it needs to hold a reference to it.
|
||||
|
||||
|
2
docs/reference/.cvsignore
Normal file
2
docs/reference/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,4 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS = gdk-pixbuf gdk gtk libgail-util
|
||||
SUBDIRS = gdk-pixbuf gdk gtk
|
||||
|
||||
GITIGNOREFILES = */*.1
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
18
docs/reference/gdk-pixbuf/.cvsignore
Normal file
18
docs/reference/gdk-pixbuf/.cvsignore
Normal file
@@ -0,0 +1,18 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
gdk-pixbuf-decl-list.txt
|
||||
gdk-pixbuf-decl.txt
|
||||
gdk-pixbuf-undocumented.txt
|
||||
gdk-pixbuf-unused.txt
|
||||
gdk-pixbuf.args
|
||||
gdk-pixbuf.hierarchy
|
||||
gdk-pixbuf.interfaces
|
||||
gdk-pixbuf.prerequisites
|
||||
gdk-pixbuf.signals
|
||||
deprecated
|
||||
html
|
||||
xml
|
||||
*.stamp
|
||||
*.lo
|
||||
.libs
|
||||
version.xml
|
@@ -1,5 +1,4 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.6
|
||||
|
||||
@@ -47,7 +46,7 @@ GTKDOC_LIBS = \
|
||||
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb
|
||||
MKDB_OPTIONS=--main-sgml-file=$(DOC_MAIN_SGML_FILE) --sgml-mode --source-dir=../../../contrib/gdk-pixbuf-xlib --output-format=xml --name-space=gdk_pixbuf
|
||||
MKDB_OPTIONS=--main-sgml-file=$(DOC_MAIN_SGML_FILE) --sgml-mode --source-dir=../../../contrib/gdk-pixbuf-xlib --output-format=xml
|
||||
|
||||
# Extra SGML files that are included by DOC_MAIN_SGML_FILE
|
||||
content_files = \
|
||||
@@ -63,9 +62,7 @@ content_files = \
|
||||
HTML_IMAGES = composite.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS= --extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/gobject \
|
||||
--extra-dir=$(GLIB_PREFIX)/share/gtk-doc/html/glib
|
||||
|
||||
FIXXREF_OPTIONS=
|
||||
|
||||
include $(top_srcdir)/gtk-doc.make
|
||||
|
||||
@@ -79,21 +76,19 @@ EXTRA_DIST += version.xml.in \
|
||||
|
||||
########################################################################
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
man_MANS = gdk-pixbuf-csource.1 gdk-pixbuf-query-loaders.1
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
%.1 : %.xml
|
||||
@XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
BUILT_EXTRA_DIST = $(man_MANS)
|
||||
|
||||
endif
|
||||
|
||||
BUILT_EXTRA_DIST = $(man_MANS)
|
||||
|
||||
dist-hook-local: $(BUILT_EXTRA_DIST)
|
||||
files='$(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
|
||||
|
118
docs/reference/gdk-pixbuf/gdk-pixbuf-csource.1
Normal file
118
docs/reference/gdk-pixbuf/gdk-pixbuf-csource.1
Normal file
@@ -0,0 +1,118 @@
|
||||
.\"Generated by db2man.xsl. Don't modify this, modify the source.
|
||||
.de Sh \" Subsection
|
||||
.br
|
||||
.if t .Sp
|
||||
.ne 5
|
||||
.PP
|
||||
\fB\\$1\fR
|
||||
.PP
|
||||
..
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Ip \" List item
|
||||
.br
|
||||
.ie \\n(.$>=3 .ne \\$3
|
||||
.el .ne 3
|
||||
.IP "\\$1" \\$2
|
||||
..
|
||||
.TH "GDK-PIXBUF-CSOURCE" 1 "" "" ""
|
||||
.SH NAME
|
||||
gdk-pixbuf-csource \- C code generation utility for GdkPixbuf images
|
||||
.SH "SYNOPSIS"
|
||||
.ad l
|
||||
.hy 0
|
||||
.HP 19
|
||||
\fBgdk\-pixbuf\-csource\fR [options] [image]
|
||||
.ad
|
||||
.hy
|
||||
.ad l
|
||||
.hy 0
|
||||
.HP 19
|
||||
\fBgdk\-pixbuf\-csource\fR [options] \-\-build\-list [[name]\ [image]...]
|
||||
.ad
|
||||
.hy
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBgdk\-pixbuf\-csource\fR is a small utility that generates C code containing images, useful for compiling images directly into programs\&.
|
||||
|
||||
.SH "INVOCATION"
|
||||
|
||||
.PP
|
||||
\fBgdk\-pixbuf\-csource\fR either takes as input one image file name to generate code for, or, using the \fB\-\-build\-list\fR option, a list of (\fIname\fR, \fIimage\fR) pairs to generate code for a list of images into named variables\&.
|
||||
|
||||
.SS "Options"
|
||||
|
||||
.TP
|
||||
\fB\-\-stream\fR
|
||||
Generate pixbuf data stream (a single string containing a serialized GdkPixdata structure in network byte order)\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-struct\fR
|
||||
Generate GdkPixdata structure (needs the GdkPixdata structure definition from \fIgdk\-pixdata\&.h\fR)\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-macros\fR
|
||||
Generate *_ROWSTRIDE, *_WIDTH, *_HEIGHT, *_BYTES_PER_PIXEL and *_RLE_PIXEL_DATA or *_PIXEL_DATA macro definitions for the image\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-rle\fR
|
||||
Enables run\-length encoding for the generated pixel data (default)\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-raw\fR
|
||||
Disables run\-length encoding for the generated pixel data\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-extern\fR
|
||||
Generate extern symbols\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-static\fR
|
||||
Generate static symbols (default)\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-decoder\fR
|
||||
Provide a *_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) macro definition to decode run\-length encoded image data\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-name=identifier\fR
|
||||
Specifies the identifier name (prefix) for the generated variables or macros (useful only if \fB\-\-build\-list\fR was not specified)\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-build\-list\fR
|
||||
Enables (\fIname\fR, \fIimage\fR) pair parsing mode\&.
|
||||
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Print brief help and exit\&.
|
||||
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Print version and exit\&.
|
||||
|
||||
.TP
|
||||
\fB\-\-g\-fatal\-warnings\fR
|
||||
Make warnings fatal (causes the program to abort)\&.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
.PP
|
||||
The GdkPixbuf documentation, shipped with the Gtk+ distribution, available from www\&.gtk\&.org: \fIhttp://www.gtk.org\fR\&.
|
||||
|
||||
.SH "BUGS"
|
||||
|
||||
.PP
|
||||
The runlength encoder gets out of sync with the pixel boundaries, since it includes the rowstride padding in the encoded stream\&. Furthermore, it generates pixbufs with suboptimal rowstride in some cases\&.
|
||||
|
||||
.SH "AUTHOR"
|
||||
|
||||
.PP
|
||||
\fBgdk\-pixbuf\-csource\fR was written by Tim Janik <timj@gtk\&.org>\&.
|
||||
|
||||
.PP
|
||||
This manual page was provided by Tim Janik <timj@gtk\&.org>\&.
|
||||
|
@@ -1,7 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gdk-pixbuf-csource">
|
||||
|
||||
<refmeta>
|
||||
|
@@ -1,7 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gdk-pixbuf-gdk-pixbuf-from-drawables">
|
||||
<refmeta>
|
||||
<refentrytitle>Drawables to Pixbufs</refentrytitle>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user