Compare commits
563 Commits
wip/css-tr
...
wip/frame-
Author | SHA1 | Date | |
---|---|---|---|
|
96829e4f40 | ||
|
eee365964a | ||
|
11b8600a15 | ||
|
7bd133c9b8 | ||
|
9db6a6aea0 | ||
|
0d0d587fd1 | ||
|
3e79f7cbfa | ||
|
0e75a5cabb | ||
|
2d0505968c | ||
|
ff395d35a7 | ||
|
7f59f34003 | ||
|
bc390a7e1a | ||
|
fcb7822a65 | ||
|
b0c18211c8 | ||
|
f2ab3ad474 | ||
|
b9837bb8f9 | ||
|
4faf94d677 | ||
|
05dc350048 | ||
|
63bc508071 | ||
|
d69dc91f41 | ||
|
74aaa1ddc8 | ||
|
517344f56e | ||
|
11302c12ff | ||
|
2ddf61ab6f | ||
|
43679422a5 | ||
|
459944ef7e | ||
|
90eb0a9195 | ||
|
c6966f00ce | ||
|
439f52937c | ||
|
fb3facb0b2 | ||
|
91cb469af2 | ||
|
3591cc0ece | ||
|
7a0db9999e | ||
|
ffba7c0161 | ||
|
5431431931 | ||
|
ecd953efa0 | ||
|
d4fd6820ed | ||
|
5e1ec6dd5b | ||
|
08ed370d1c | ||
|
4dfe25aa35 | ||
|
59bb3d3a8c | ||
|
ed835e738d | ||
|
377fbd1d84 | ||
|
04088e7b81 | ||
|
5f9fb32b0c | ||
|
5fda1e49bf | ||
|
30f5599163 | ||
|
48e82e8b12 | ||
|
4856eb0c90 | ||
|
68559ee790 | ||
|
1a0f5e8aaa | ||
|
8b9254c8a7 | ||
|
bfd7137ffb | ||
|
8568d66a73 | ||
|
a8862727c9 | ||
|
8d5d9c50b1 | ||
|
134230ed91 | ||
|
283c974680 | ||
|
154a144cf6 | ||
|
7319f2934f | ||
|
0b1f8a5c4b | ||
|
ba1f2ae3fc | ||
|
0795237bb2 | ||
|
2379445c1d | ||
|
fbb1ee02bc | ||
|
fc27f0737e | ||
|
417e88819b | ||
|
434f07944b | ||
|
4fe1effb36 | ||
|
656cc63c75 | ||
|
97c235405d | ||
|
366b4db791 | ||
|
7d21ec23f6 | ||
|
ebb84e8d19 | ||
|
b57a2c8341 | ||
|
fa8b71450c | ||
|
3d4cd4db3e | ||
|
4d3c77f920 | ||
|
ada6d81247 | ||
|
f6383ebf9e | ||
|
2935b97b31 | ||
|
6657479c72 | ||
|
4f6d535626 | ||
|
69ac91b4b3 | ||
|
1568204159 | ||
|
03d405e484 | ||
|
898d577675 | ||
|
b43d36d43d | ||
|
93c3fec125 | ||
|
69e9ecf90a | ||
|
a34d27d3ea | ||
|
5a8675686f | ||
|
4e04319d7c | ||
|
2204f12083 | ||
|
bdb66189fc | ||
|
cb539841a4 | ||
|
b166a6bb0e | ||
|
5ee054c42e | ||
|
67a18b7cf9 | ||
|
dd28fd8a10 | ||
|
0162e92aba | ||
|
2ae8a27b4a | ||
|
f8050c90fa | ||
|
935d458fa1 | ||
|
b396e37b96 | ||
|
594b752080 | ||
|
b08c15d986 | ||
|
9bb25c7f95 | ||
|
1e85e0f017 | ||
|
a1de67f438 | ||
|
edd1c66041 | ||
|
001f3219e0 | ||
|
377997f704 | ||
|
8099f864c3 | ||
|
bed3193e13 | ||
|
d559ed0ce9 | ||
|
717c28e12d | ||
|
9a1235bf0d | ||
|
e335a3fd31 | ||
|
e437016a65 | ||
|
363eea659c | ||
|
ac3a50bfe6 | ||
|
3493814ead | ||
|
cd98eb15cb | ||
|
ad70142d2c | ||
|
ce869921ab | ||
|
7c1c7cb728 | ||
|
9efa28591c | ||
|
5f41eb74a5 | ||
|
48777cb656 | ||
|
3aa43f0f17 | ||
|
261ef5b383 | ||
|
fae1da8ec9 | ||
|
09dc62050f | ||
|
96708eb8ad | ||
|
ab71224021 | ||
|
5271ea34d1 | ||
|
e975f10c7f | ||
|
ee6e7d6433 | ||
|
f9b79f2095 | ||
|
d1f9adad08 | ||
|
cf1eecca6b | ||
|
e6b3cbe7d2 | ||
|
b2e1b1124f | ||
|
e3cd958e36 | ||
|
18ca907c4c | ||
|
6348ded15d | ||
|
5607a2125f | ||
|
bc473257c7 | ||
|
b3d1121d78 | ||
|
ba24f39d95 | ||
|
80fc684dd8 | ||
|
4e41577b46 | ||
|
dcba7afd35 | ||
|
92f0c5c384 | ||
|
f44eec0f6b | ||
|
ad69528bde | ||
|
a6bf34e292 | ||
|
75937d925c | ||
|
0866772819 | ||
|
73e203b290 | ||
|
aaab99bb4d | ||
|
7acf6296f4 | ||
|
159dabd0a5 | ||
|
68ee7c6848 | ||
|
d1c642d1f5 | ||
|
a4749d4f3a | ||
|
32903fc753 | ||
|
8bdfd35d9c | ||
|
cf6a40830c | ||
|
4f93194039 | ||
|
704fc3724f | ||
|
39d198cd5a | ||
|
a0e68bec52 | ||
|
05abba3acb | ||
|
c4ccfa6009 | ||
|
eacdaf28a6 | ||
|
c4183405fe | ||
|
843e5f9cb3 | ||
|
5f1c792567 | ||
|
2ec28c5c6f | ||
|
7a9553cfb5 | ||
|
a687cbaae8 | ||
|
9d659d8a77 | ||
|
002ac992d1 | ||
|
e340049eb8 | ||
|
99828efa50 | ||
|
2397521d29 | ||
|
142cc90927 | ||
|
f35075bccf | ||
|
68e89da010 | ||
|
22bad6a240 | ||
|
ce6b77c25b | ||
|
885b43dd3a | ||
|
63d87cac44 | ||
|
e26031e0c7 | ||
|
c83a7a13e1 | ||
|
af176efc0f | ||
|
d579b412d4 | ||
|
18938b7fcf | ||
|
19af1f2682 | ||
|
bce43b3dae | ||
|
7d9751130c | ||
|
dac6a76ef2 | ||
|
54dc823d67 | ||
|
e57de53108 | ||
|
2d479ee5cc | ||
|
cca05d1dc8 | ||
|
d2919c1c89 | ||
|
86f024ba0d | ||
|
c1aeab0859 | ||
|
e2b60f2997 | ||
|
154204e891 | ||
|
78d91aaf9b | ||
|
b112a85395 | ||
|
a38309474d | ||
|
cbb719822a | ||
|
01c0dd9182 | ||
|
2b9f0b4817 | ||
|
db986ddc4f | ||
|
dc8b67de92 | ||
|
9bdc970f8d | ||
|
131a68259e | ||
|
879367ca43 | ||
|
82e12cbf24 | ||
|
dd3ff6187f | ||
|
ecf2a9471b | ||
|
8c5762bbf0 | ||
|
91b17c269d | ||
|
2d676f32b1 | ||
|
c752cfe6a5 | ||
|
2d820defef | ||
|
7d30e601de | ||
|
b12d7dfcd6 | ||
|
a9ba4488bd | ||
|
ce15472955 | ||
|
88ed5af5e4 | ||
|
cbce906228 | ||
|
c7169e119e | ||
|
a84f244dc0 | ||
|
dcc412c88e | ||
|
85d1dbcc0a | ||
|
5845b269b5 | ||
|
96d4eb5411 | ||
|
d887c54172 | ||
|
7614bf3ced | ||
|
e5ff670475 | ||
|
36b090d0c0 | ||
|
ed3eaf6e50 | ||
|
d4a9863e19 | ||
|
46cc2d825e | ||
|
bb10561450 | ||
|
f8f5ba3353 | ||
|
ba1e27d13a | ||
|
e84ed710a2 | ||
|
2c3b9a89a9 | ||
|
1d410ec960 | ||
|
ce7d29aa89 | ||
|
b4b42ba54d | ||
|
5162751f6c | ||
|
c1e0317824 | ||
|
11e78d9d9f | ||
|
104be175fc | ||
|
bef1a5d720 | ||
|
b5887bd26e | ||
|
3210cd6511 | ||
|
a763738f15 | ||
|
301e22121a | ||
|
b60478bb49 | ||
|
993e3f715f | ||
|
0050d469b5 | ||
|
6d53c2339f | ||
|
9b6661a0bf | ||
|
16195adc92 | ||
|
d0e0e48942 | ||
|
9194993453 | ||
|
199ecc1202 | ||
|
940971bd2b | ||
|
2adf1a4966 | ||
|
8d81b1a4cd | ||
|
065f9529ce | ||
|
cdaa6e036e | ||
|
af805e9cb6 | ||
|
cba4156ef6 | ||
|
97ba4b1b8e | ||
|
aa77cd6501 | ||
|
376e8d568e | ||
|
e946cc52b6 | ||
|
8a1c1d16f6 | ||
|
f260affbb8 | ||
|
1205e3b043 | ||
|
ced451b09a | ||
|
fff4c8e841 | ||
|
974f8dfc71 | ||
|
a4db4d1f88 | ||
|
a2dc30ca8b | ||
|
bc675d46f1 | ||
|
2fcbe3a9b4 | ||
|
246438812a | ||
|
88b247f0ba | ||
|
213b82e87e | ||
|
1aabfbaae8 | ||
|
ada20f475d | ||
|
da8ff82df5 | ||
|
2e76e5a543 | ||
|
53083ea7b4 | ||
|
befde1f7de | ||
|
b39cfb304a | ||
|
e8f5bf0b30 | ||
|
e8224d138d | ||
|
5708e2bc2c | ||
|
d5812de2e6 | ||
|
35c295da89 | ||
|
8e686357c4 | ||
|
4d7b822059 | ||
|
f72d1a8d2b | ||
|
6f910e5e02 | ||
|
c83d35d1df | ||
|
71e7912940 | ||
|
ad723bd9a9 | ||
|
b495ce5446 | ||
|
9be7e3e2d8 | ||
|
da100207b3 | ||
|
33e690a9ad | ||
|
b867970bf4 | ||
|
cd67593c9f | ||
|
5509bf2872 | ||
|
212a21026f | ||
|
8a644e4f16 | ||
|
15129ae170 | ||
|
7114e63cee | ||
|
00795e8d05 | ||
|
7ace438166 | ||
|
d2c6a6bdfe | ||
|
f48e9b1d20 | ||
|
5474259dea | ||
|
fa1dc252df | ||
|
c50bcf5891 | ||
|
6b9b925add | ||
|
3e979d911b | ||
|
b068b18c78 | ||
|
cc986fdc1c | ||
|
b39bb4400e | ||
|
02b440b466 | ||
|
6a229fe50a | ||
|
5adecf183b | ||
|
4d4b6a8658 | ||
|
ec45d2f8c7 | ||
|
e00bc73de8 | ||
|
6410a43b76 | ||
|
aac4a027eb | ||
|
9555478b9e | ||
|
f84df03513 | ||
|
63b6c07fe0 | ||
|
75ee72f2ac | ||
|
3558e655b4 | ||
|
59830a9001 | ||
|
329372a343 | ||
|
5ee8b69418 | ||
|
8b9ccf4ee9 | ||
|
e801d06229 | ||
|
20b79b06ee | ||
|
3005f1b844 | ||
|
fc96ef51d7 | ||
|
4addb2108e | ||
|
9aa36d8d0d | ||
|
95a0c055da | ||
|
58e96f6cbd | ||
|
6bc2a2da48 | ||
|
38963870eb | ||
|
12f9b81b1e | ||
|
9e9824a0a1 | ||
|
d198ea6296 | ||
|
5fa4232404 | ||
|
c3577c66e5 | ||
|
07a00d5939 | ||
|
d2944ce633 | ||
|
4cd806ff0c | ||
|
651241b685 | ||
|
221ac71278 | ||
|
e4b5e94eb9 | ||
|
853b5e5fa2 | ||
|
20c12b0570 | ||
|
70a5718b15 | ||
|
4f2da634f1 | ||
|
308971cc2e | ||
|
a70e85702f | ||
|
81fa183b79 | ||
|
cd5fdc1e74 | ||
|
751a330ad8 | ||
|
3dfce49032 | ||
|
dfbabfbd6d | ||
|
9e65be6c48 | ||
|
54714cb228 | ||
|
9c3cd49abd | ||
|
0a808bea54 | ||
|
3824376afc | ||
|
05240be589 | ||
|
cf712c462d | ||
|
821a675013 | ||
|
6f86e57c4f | ||
|
52768ee6ec | ||
|
a73cc55e02 | ||
|
1bf3de223a | ||
|
f239edaf9c | ||
|
26186c74c6 | ||
|
94b65032a2 | ||
|
a612956ed5 | ||
|
8e4228bf12 | ||
|
eecb9607a5 | ||
|
33e5866b6f | ||
|
b85ae11e0e | ||
|
f229945dab | ||
|
5bee1a994f | ||
|
df1d331713 | ||
|
e9aeb2fbca | ||
|
099a2b04a2 | ||
|
597dc649e1 | ||
|
5e12aafacd | ||
|
4cfd1f51c0 | ||
|
f770e9ac1e | ||
|
531d0dc32a | ||
|
ebf9b9a0e7 | ||
|
4e60107c30 | ||
|
6e85a64cf6 | ||
|
343f1706bd | ||
|
17a3325b2d | ||
|
3782cf77c3 | ||
|
9dc4c5ce73 | ||
|
444a92d6d8 | ||
|
656ec39c29 | ||
|
0cb714fe62 | ||
|
4594e0fd34 | ||
|
ea479e6bb9 | ||
|
1c05915f51 | ||
|
796ae50064 | ||
|
a3e4fa3809 | ||
|
d8fae21b1c | ||
|
a1ee2b7b82 | ||
|
089eafb468 | ||
|
eb4667b6e1 | ||
|
03c626bb15 | ||
|
57e1e0de94 | ||
|
fb312af979 | ||
|
549a0af12b | ||
|
f1532993eb | ||
|
26ea8e710a | ||
|
b855e91f7a | ||
|
9d31a04d12 | ||
|
34318b9163 | ||
|
736ccb6ce1 | ||
|
4ca293e006 | ||
|
fd964ca178 | ||
|
6dfee46cdb | ||
|
e6de45964d | ||
|
bf35c2f044 | ||
|
53e08b58aa | ||
|
9ae9649188 | ||
|
82a6106920 | ||
|
1b1f4da5c7 | ||
|
055b5d83d5 | ||
|
7747910b9d | ||
|
a405c9917c | ||
|
fbbb66ae7d | ||
|
732e89e4f3 | ||
|
f79cd24937 | ||
|
6e2dec0344 | ||
|
7ee5e7af70 | ||
|
a61b359498 | ||
|
4dabc8ba84 | ||
|
cd016ef8e3 | ||
|
d3377e9d7a | ||
|
faaae520c9 | ||
|
47714f55ee | ||
|
c3e9112f7f | ||
|
7ec33e63c0 | ||
|
afc1a143a4 | ||
|
5833b8495e | ||
|
b4767ea9da | ||
|
85d8f3c51e | ||
|
c1e9d46c64 | ||
|
6f69a0fef6 | ||
|
f08fc12741 | ||
|
c74d79bb55 | ||
|
907447c72d | ||
|
9bf091e2ac | ||
|
1460487635 | ||
|
d8306aaeb3 | ||
|
1688403ae6 | ||
|
5942099f00 | ||
|
891a4ab347 | ||
|
a23bc88557 | ||
|
1a61e1ea23 | ||
|
0d9d576172 | ||
|
1dd3ee6b59 | ||
|
3ff7f1fd43 | ||
|
41f8ba3c35 | ||
|
fe61e6b3fe | ||
|
be53513954 | ||
|
fc67f0d4f8 | ||
|
0c12a6ffcb | ||
|
35362337ec | ||
|
8560ff88cd | ||
|
e0586e3680 | ||
|
66d22f101d | ||
|
a5770cef36 | ||
|
4ccb8e5d33 | ||
|
cc0b493216 | ||
|
3c279b1492 | ||
|
9eea724e3b | ||
|
f619f91a8f | ||
|
e36f80f0ef | ||
|
3c421db473 | ||
|
2dbeabdc58 | ||
|
528e6032ae | ||
|
42716cb60f | ||
|
d69c6fff7a | ||
|
c10a0962cf | ||
|
fd4712590a | ||
|
9b989a1427 | ||
|
146b6f3a93 | ||
|
3d5e8f98ec | ||
|
6bec577771 | ||
|
f678827918 | ||
|
6b85db7555 | ||
|
69feabd139 | ||
|
0ede06d229 | ||
|
d6932dd823 | ||
|
63cb467e06 | ||
|
1bfa6593c8 | ||
|
daefb12a23 | ||
|
16f2b20f96 | ||
|
3b4040d619 | ||
|
cfdc68db5c | ||
|
92e904a257 | ||
|
e75860e466 | ||
|
5b9c687595 | ||
|
b3b83545c4 | ||
|
c5c7323942 | ||
|
52af9aede6 | ||
|
4557e4d7a5 | ||
|
9ba32fec6e | ||
|
6400eeba35 | ||
|
a7ed598d37 | ||
|
3519226c5a | ||
|
bf26d46cb2 | ||
|
ce6f43a522 | ||
|
5230cfe805 | ||
|
256f168525 | ||
|
50acce4074 | ||
|
149de71624 | ||
|
709f12b9ac | ||
|
e2144fbb7e | ||
|
fd301e7847 | ||
|
4d0ca91c72 | ||
|
29c8420746 | ||
|
7f3595a6be | ||
|
ea415cd350 | ||
|
1a79ee4d3e | ||
|
01dc23cdec | ||
|
a69619edbc | ||
|
d3051ca79c | ||
|
9ac005abee |
182
NEWS
182
NEWS
@@ -1,3 +1,185 @@
|
||||
Overview of Changes in GTK+ 3.7.8
|
||||
=================================
|
||||
|
||||
* GtkTreeView and GtkIconView allow single-click activation
|
||||
|
||||
* GtkImage can be set from a resource
|
||||
|
||||
* GdkWaylandDisplay is now public
|
||||
|
||||
* gdk_window_set_fullscreen_mode: new function to let windows
|
||||
be fullscreened across multiple monitors
|
||||
|
||||
* Bugs fixed:
|
||||
345023 Single-click in treeview and iconview
|
||||
687025 iconhelper: Treat empty string as NULL stock-id
|
||||
691572 Touch: strengthen synthesized touch crossing events ...
|
||||
691592 the signal handler "gtk_spin_button_accessible_value...
|
||||
691639 introspection: gtk_widget_set_tooltip_text accepts NULL
|
||||
691751 Better column resizing for GtkTreeView
|
||||
691842 /TreeView/scrolling/specific/bug-111500 fails since ...
|
||||
691856 Add support for _NET_WM_FULLSCREEN_MONITORS
|
||||
692163 file chooser: give GSettings schema a path
|
||||
692188 Backspace should not be used for navigation
|
||||
692203 applicationwindow: fix mem leak
|
||||
692467 x11: Add "support" for XI2.3
|
||||
692481 gtkimage: Add GtkImage::resource property
|
||||
692605 Optimize gdk_x11_screen_get_setting()
|
||||
692659 migrating-2to3: Add more words about GSEAL_ENABLE is...
|
||||
692766 textlayout: respect preedit color attribute
|
||||
692844 Incorrect (out) annotation on gtk_tree_drag_source_d...
|
||||
692934 Defer cairo surface creation for image URLs in CSS t...
|
||||
682824 Don't build gtk-launch when gio-unix is not available
|
||||
692637 Only build native-update-icon-cache when no external...
|
||||
692823 GdkDeviceCore should be public as GdkWaylandDevice
|
||||
692899 global_remove handler is missing
|
||||
693015 Deprecate gtk_scrolled_window_add_with_viewport()
|
||||
693066 GTK notification code attempts to create an X notifi...
|
||||
525226 All actions' names and descriptions should be transl...
|
||||
553334 gailrange exposes an action which does nothing
|
||||
658148 The pop-up window in a GtkEntryCompletion lacks an a...
|
||||
680048 Prefer symbolic icons for the default message dialog...
|
||||
687825 weight-set in GtkCellRendererText not working
|
||||
693050 GtkTextView focus handler doesn't honor can-focus pr...
|
||||
|
||||
* Translation updates:
|
||||
Aragonese
|
||||
Assamese
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Dutch
|
||||
German
|
||||
Hebrew
|
||||
Hungarian
|
||||
Polish
|
||||
Portuguese
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Uyghur
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.6
|
||||
=================================
|
||||
|
||||
* We now use state flags for text direction: GTK_STATE_FLAG_LTR/RTL.
|
||||
gtk_style_context_set_direction() has been deprecated.
|
||||
|
||||
* We install headers for accessible implementations of GTK+ widgets.
|
||||
This makes it possible to implement accessibility for third-party
|
||||
widgets by subclassing the proper GTK+ implementation. To do this,
|
||||
include gtk/gtk-a11y.h.
|
||||
|
||||
* Invisible widgets now return a size of 0x0. This is an experimental
|
||||
change that makes GtkWidget::visible essentially behave the same way
|
||||
that "display: none" does in CSS. If you want the effect of CSS's
|
||||
"visibility: hidden", you can use a GtkNotebook with an empty page.
|
||||
|
||||
* GtkFrame now draws a background.
|
||||
|
||||
* The Broadway backend now installs a separate server: broadwayd.
|
||||
|
||||
* Bug fixes:
|
||||
687025 iconhelper: Treat empty string as NULL stock-id
|
||||
687633 gtk_color_chooser_get_rgba: wrong annotations, broke bind...
|
||||
688140 Add missing annotation for gtk_combo_box_text_get_active_...
|
||||
688362 GtkApplication: Fix memory leak
|
||||
689810 Include guard optimization
|
||||
690305 Typo in SECTION:gtkbuildable : (thier -> their)
|
||||
691186 Gtk+ 3.6.3 crashes when opening printing dialog: segfault...
|
||||
691301 Better support for cross-compiling
|
||||
691515 Insufficient checks for EWMH support
|
||||
691677 Gtk Scale (slider) does not react in clicks outside the c...
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
Bulgarian
|
||||
Estonian
|
||||
Galician
|
||||
Hungarian
|
||||
Kazakh
|
||||
Latvian
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Persian
|
||||
Portuguese
|
||||
Slovenian
|
||||
Tamil
|
||||
Thai
|
||||
Uyghur
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.4
|
||||
=================================
|
||||
|
||||
* GtkBuilder now lets you refer to external objects from a ui
|
||||
file if the objects have been exported with the new function
|
||||
gtk_builder_expose_object()
|
||||
|
||||
* Font handling has been improved:
|
||||
- The default font is no longer handled like a custom style sheet
|
||||
that overrides everything, but as the initial value. This is the
|
||||
same behavior as in web browsers.
|
||||
- It is now possible to set font-family and font-size like other
|
||||
CSS properties, and relative font sizes are supported. Font
|
||||
sizes in CSS can be specified as numbers or with keywords
|
||||
like xx-small, medium, smaller, larger,...
|
||||
|
||||
* GTK+ now uses proper Unicode ellipses in strings.
|
||||
|
||||
* The releases includes several noticable performance improvements:
|
||||
- Size allocation has been optimized, by avoiding excessive
|
||||
resizing in various situations.
|
||||
- The performance of size groups has been improved.
|
||||
- Text rendering in GtkLabel and other widgets has been optimized
|
||||
to avoid excessive recreation of Pango layouts.
|
||||
- Icon loading overhead was reduced by caching of GtkIconInfo.
|
||||
- The CSS is now keeping a tree of selectors to speed up matchinh.
|
||||
|
||||
* Deprecations and removals:
|
||||
- Custom CSS properties have been deprecated
|
||||
- Support for color schemes has been removed
|
||||
- gtk_style_provider_get_style, gtk_style_provider_get_icon_factory
|
||||
- GtkGradient and GtkSymbolicColor
|
||||
- All the padding style properties in menus
|
||||
|
||||
* Bugs closed:
|
||||
132333 Can't add a palette to the dialog of a color button
|
||||
371034 Doc for gtk_file_chooser_get_filename: Is the resulting path...
|
||||
447972 Add a way to specify user_data sent to signals
|
||||
548793 funny pattern for iterating GtkTreeModel
|
||||
595615 Use proper ellipses
|
||||
626499 GtkClipboard unnotified on change of OS X pasteboard owner
|
||||
668239 texts disappear when notebook switch page at zh_CN locate!
|
||||
677339 GTK+ 3 documentation wrong about GtkWidget scroll-event signal
|
||||
680065 treemodelfilter: Make the constructor binding friendly
|
||||
687065 InstallableOptions is not filtered in cups backend
|
||||
687816 GtkTreeView does not draw correctly since commit aaedc7b6
|
||||
688710 [PATCH] Splash screens shouldn't stay on top of all applicat...
|
||||
688744 Don't use gtk_style_context_set_background() to render icon/...
|
||||
688884 Typo in gtk_tree_view_set_tooltip_column documentation
|
||||
689012 "Copy file's location" menu item in file chooser dialog uses...
|
||||
689047 Obtain the recent files max age setting from xsettings
|
||||
689081 No caching of icons
|
||||
689168 Deprecate some menu style properties
|
||||
689401 xi2: Abort early if we don't have a proper GDK window
|
||||
689584 Add summary and description to "show-hidden" key
|
||||
689847 Add fast repeated typename -> GType resolver
|
||||
689923 Missing null-check in GtkEntryAccessible
|
||||
690099 GtkScrolledWindow with NEVER policy don't resize with children
|
||||
690266 Freeze with F10/Shift-F10 on submenus
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
British English
|
||||
Dutch
|
||||
German
|
||||
Hebrew
|
||||
Polish
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.2
|
||||
=================================
|
||||
|
||||
|
@@ -2,3 +2,5 @@ include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS = \
|
||||
win32
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -3,3 +3,5 @@ include $(top_srcdir)/Makefile.decl
|
||||
SUBDIRS = \
|
||||
vs9 \
|
||||
vs10
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -23,3 +23,5 @@ EXTRA_DIST += \
|
||||
gailutil.vcxproj \
|
||||
gailutil.vcxproj.filters \
|
||||
install.vcxproj
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@@ -127,6 +127,10 @@ mkdir $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -287,8 +291,6 @@ copy ..\..\..\gtk\gtkfontchooserwidget.h $(CopyDir)\include\gtk-$(GtkApiVersion)
|
||||
|
||||
copy ..\..\..\gtk\gtkframe.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkgradient.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkiconfactory.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -453,8 +455,6 @@ copy ..\..\..\gtk\gtkstyleprovider.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkswitch.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtksymboliccolor.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtktestutils.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtktextattributes.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -546,6 +546,8 @@ copy ..\..\..\gtk\deprecated\gtkcolorseldialog.h $(CopyDir)\include\gtk-$(GtkApi
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtkfontsel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtkgradient.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtkhandlebox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtkhbbox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
@@ -566,6 +568,8 @@ copy ..\..\..\gtk\deprecated\gtkrc.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtkstyle.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtksymboliccolor.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtktable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
copy ..\..\..\gtk\deprecated\gtktearoffmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
@@ -583,6 +587,97 @@ copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(GtkApiVers
|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated
|
||||
|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(GtkApiVersion)\a11y
|
||||
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcellaccessibleparent.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcheckmenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcomboboxaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcontaineraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkcontainercellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkentryaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkexpanderaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkframeaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkiconviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkimageaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkimagecellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtklabelaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtklinkbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtklockbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkmenuaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkmenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkmenushellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtknotebookaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtknotebookpageaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkpanedaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkprogressbaraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkradiobuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkradiomenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkrangeaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkrenderercellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkscaleaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkscalebuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkscrolledwindowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkspinbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkspinneraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkstatusbaraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkswitchaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtktextcellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtktextviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtktogglebuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtktoplevelaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtktreeviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkwidgetaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkwindowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y
|
||||
|
||||
|
||||
|
||||
mkdir $(CopyDir)\include\gail-$(GtkApiVersion)\libgail-util
|
||||
|
||||
copy ..\..\..\libgail-util\gail-util.h $(CopyDir)\include\gail-$(GtkApiVersion)\libgail-util
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk-win32", "gdk-win32.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk", "gdk.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}"
|
||||
|
@@ -29,18 +29,22 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -63,7 +67,6 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@@ -28,19 +28,23 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -62,9 +66,6 @@
|
||||
<Import Project="gtk+.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
|
@@ -14,3 +14,5 @@ EXTRA_DIST += \
|
||||
libgail.vcprojin \
|
||||
gailutil.vcproj \
|
||||
install.vcproj
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -127,6 +127,8 @@ copy ..\..\..\gdk\win32\gdkwin32window.h $(CopyDir)\include\gtk-$(GtkApiVersion)
|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtk.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkx.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtk-a11y.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkaboutdialog.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkaccelgroup.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkaccelgroupprivate.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
@@ -207,7 +209,6 @@ copy ..\..\..\gtk\gtkfontchooser.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#
|
||||
copy ..\..\..\gtk\gtkfontchooserdialog.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkfontchooserwidget.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkframe.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkgradient.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkiconfactory.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkicontheme.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
@@ -290,7 +291,6 @@ copy ..\..\..\gtk\gtkstylecontext.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&
|
||||
copy ..\..\..\gtk\gtkstyleproperties.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkstyleprovider.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtkswitch.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtksymboliccolor.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktestutils.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextattributes.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextbuffer.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
@@ -338,6 +338,7 @@ mkdir $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkcolorsel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkcolorseldialog.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkfontsel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkgradient.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkhandlebox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkhbbox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkhbox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
@@ -348,6 +349,7 @@ copy ..\..\..\gtk\deprecated\gtkhscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVers
|
||||
copy ..\..\..\gtk\deprecated\gtkhseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkrc.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkstyle.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtksymboliccolor.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtktable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtktearoffmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkvbbox.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
@@ -357,6 +359,52 @@ copy ..\..\..\gtk\deprecated\gtkvscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVers
|
||||
copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\deprecated

|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(GtkApiVersion)\a11y

|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcellaccessibleparent.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcheckmenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcomboboxaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcontaineraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkcontainercellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkentryaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkexpanderaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkframeaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkiconviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkimageaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkimagecellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtklabelaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtklinkbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtklockbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkmenuaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkmenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkmenushellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtknotebookaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtknotebookpageaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkpanedaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkprogressbaraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkradiobuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkradiomenuitemaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkrangeaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkrenderercellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkscaleaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkscalebuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkscrolledwindowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkspinbuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkspinneraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkstatusbaraccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkswitchaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtktextcellaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtktextviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtktogglebuttonaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtktoplevelaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtktreeviewaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkwidgetaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkwindowaccessible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk\a11y

|
||||
|
||||
mkdir $(CopyDir)\include\gail-$(GtkApiVersion)\libgail-util

|
||||
copy ..\..\..\libgail-util\gail-util.h $(CopyDir)\include\gail-$(GtkApiVersion)\libgail-util

|
||||
copy ..\..\..\libgail-util\gailmisc.h $(CopyDir)\include\gail-$(GtkApiVersion)\libgail-util

|
||||
|
@@ -8,12 +8,12 @@
|
||||
/* define to enable packagekit */
|
||||
/* #undef ENABLE_PACKAGEKIT */
|
||||
|
||||
/* Whether to use EGL in Wayland backend */
|
||||
/* #undef GDK_WAYLAND_USE_EGL */
|
||||
|
||||
/* The prefix for our gettext translation domains. */
|
||||
#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
|
||||
|
||||
/* Disable deprecation warnings from glib */
|
||||
/* #undef GLIB_DISABLE_DEPRECATION_WARNINGS */
|
||||
|
||||
/* Define if debugging is enabled */
|
||||
#define GTK_COMPILED_WITH_DEBUGGING "yes"
|
||||
|
||||
@@ -50,15 +50,9 @@
|
||||
/* Define to 1 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 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. */
|
||||
#ifndef _MSC_VER
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
@@ -296,11 +290,6 @@
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
/* #undef X_DISPLAY_MISSING */
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
|
75
configure.ac
75
configure.ac
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [7])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_micro_version], [9])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -24,11 +24,14 @@ AC_INIT([gtk+], [gtk_version],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
|
||||
[gtk+])
|
||||
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([gdk/gdktypes.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
# Define a string for the earliest version that this release has
|
||||
# backwards binary compatibility with for all interfaces a module
|
||||
# might. Unless we add module-only API with lower stability
|
||||
@@ -39,11 +42,11 @@ AC_CONFIG_AUX_DIR([build-aux])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.35.0])
|
||||
m4_define([pango_required_version], [1.30.0])
|
||||
m4_define([atk_required_version], [2.5.3])
|
||||
m4_define([glib_required_version], [2.35.3])
|
||||
m4_define([pango_required_version], [1.32.4])
|
||||
m4_define([atk_required_version], [2.7.5])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.26.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.27.1])
|
||||
m4_define([introspection_required_version], [1.32.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
@@ -123,8 +126,8 @@ AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AX_PROG_CC_FOR_BUILD
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_CC_STDC
|
||||
AC_PROG_MKDIR_P
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
@@ -135,8 +138,6 @@ AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
[The prefix for our gettext translation domains.])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
MATH_LIB=-lm
|
||||
AC_MSG_CHECKING([for native Win32])
|
||||
LIB_EXE_MACHINE_FLAG=X86
|
||||
@@ -321,12 +322,6 @@ AC_ARG_ENABLE(quartz-relocation,
|
||||
[enable bundle-based relocation functions])],
|
||||
[quartz_relocation=yes])
|
||||
|
||||
AC_ARG_ENABLE(wayland-cairo-gl,
|
||||
AS_HELP_STRING([--enable-wayland-cairo-gl],
|
||||
[enable the use of Cairo GL in the Wayland backend]),
|
||||
[enable_wayland_cairo_gl=yes])
|
||||
|
||||
|
||||
cairo_backends=
|
||||
backend_immodules=
|
||||
have_gio_unix=no
|
||||
@@ -386,6 +381,7 @@ AC_SUBST(DISABLE_ON_QUARTZ)
|
||||
if test "x$enable_broadway_backend" = xyes; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS broadway"
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_BROADWAY"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lz"
|
||||
@@ -395,22 +391,13 @@ else
|
||||
fi
|
||||
|
||||
if test "x$enable_wayland_backend" = "xyes"; then
|
||||
if test "x$enable_wayland_cairo_gl" = "xyes"; then
|
||||
# Wayland can use cairo-gl
|
||||
cairo_backends="$cairo_backends cairo-gl"
|
||||
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
|
||||
else
|
||||
# For the cairo image backend
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
fi
|
||||
# For the cairo image backend
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_BACKENDS="$GDK_BACKENDS wayland"
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WAYLAND"
|
||||
WAYLAND_PACKAGES="wayland-client >= 1.0.0 xkbcommon >= 0.2.0 wayland-cursor"
|
||||
if test "x$enable_wayland_cairo_gl" = "xyes"; then
|
||||
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
|
||||
fi
|
||||
AM_CONDITIONAL(USE_WAYLAND, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
@@ -573,7 +560,7 @@ if test "x$enable_rebuilds" = "xyes" && \
|
||||
fi
|
||||
AC_SUBST(REBUILD)
|
||||
|
||||
AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked)
|
||||
AC_CHECK_FUNCS(lstat mkstemp)
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
|
||||
# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
|
||||
@@ -905,14 +892,32 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
|
||||
|
||||
if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
|
||||
AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
|
||||
if test x$GTK_UPDATE_ICON_CACHE = xno; then
|
||||
REBUILD_PNGS=#
|
||||
fi
|
||||
fi
|
||||
AS_IF([test "x$enable_gtk2_dependency" = xyes],
|
||||
[AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
|
||||
if test x$GTK_UPDATE_ICON_CACHE = xno; then
|
||||
REBUILD_PNGS=#
|
||||
fi],
|
||||
|
||||
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
|
||||
[test "x$cross_compiling" = xyes],
|
||||
[# If no GTK+2 dependency and cross compiling, we need to find a host gdk-pixbuf.
|
||||
# pkg.m4 blocks all variable starting with PKG, so allow this one
|
||||
m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
|
||||
|
||||
AS_IF([test x$PKG_CONFIG_FOR_BUILD = x],
|
||||
[AC_MSG_ERROR([You must define PKG_CONFIG_FOR_BUILD when cross compiling])])
|
||||
|
||||
AC_MSG_CHECKING([for native gdk-pixbuf])
|
||||
AS_IF([AC_RUN_LOG([$PKG_CONFIG_FOR_BUILD --exists --print-errors gdk-pixbuf-2.0])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_ERROR([native gdk-pixbuf not found])])
|
||||
|
||||
NATIVE_GDKPIXBUF_CFLAGS=`$PKG_CONFIG_FOR_BUILD --cflags gdk-pixbuf-2.0`
|
||||
NATIVE_GDKPIXBUF_LIBS=`$PKG_CONFIG_FOR_BUILD --libs gdk-pixbuf-2.0`
|
||||
AC_SUBST(NATIVE_GDKPIXBUF_CFLAGS)
|
||||
AC_SUBST(NATIVE_GDKPIXBUF_LIBS)]
|
||||
)
|
||||
|
||||
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$enable_gtk2_dependency" = xyes])
|
||||
|
||||
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
|
||||
|
||||
@@ -1234,6 +1239,7 @@ if test "$have_gio_unix" = "yes"; then
|
||||
else
|
||||
GDK_GIO_PACKAGE=gio-2.0
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GIO_UNIX, test "$have_gio_unix" = "yes")
|
||||
|
||||
# Check for Pango flags
|
||||
|
||||
@@ -1787,6 +1793,7 @@ gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
gtk/a11y/Makefile
|
||||
gtk/native/Makefile
|
||||
gtk/tests/Makefile
|
||||
libgail-util/Makefile
|
||||
modules/Makefile
|
||||
|
@@ -1,8 +1,6 @@
|
||||
## Makefile.am for gtk+/demos
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
democodedir=$(datadir)/gtk-$(GTK_API_VERSION)/demo
|
||||
|
||||
## These should be in the order you want them to appear in the
|
||||
## demo app, which means alphabetized by demo title, not filename
|
||||
demos = \
|
||||
@@ -49,14 +47,12 @@ demos = \
|
||||
textview.c \
|
||||
textscroll.c \
|
||||
theming_style_classes.c \
|
||||
theming_custom_css.c \
|
||||
toolpalette.c \
|
||||
transparent.c \
|
||||
tree_store.c \
|
||||
ui_manager.c
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DDEMOCODEDIR="\"$(democodedir)\"" \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
@@ -79,7 +75,6 @@ BUILT_SOURCES = demos.h demo_resources.c
|
||||
|
||||
EXTRA_DIST += \
|
||||
$(IMAGEFILES) \
|
||||
demo.ui \
|
||||
demo.gresource.xml \
|
||||
$(RESOURCES) \
|
||||
org.gtk.Demo.gschema.xml
|
||||
@@ -94,7 +89,6 @@ demos.h: @REBUILD@ $(demos) geninclude.pl
|
||||
|
||||
gtk3_demo_SOURCES = \
|
||||
$(demos) \
|
||||
demo-common.h \
|
||||
demo_resources.c \
|
||||
main.c \
|
||||
demos.h
|
||||
@@ -112,41 +106,35 @@ gtk3_demo_application_LDADD = $(LDADDS)
|
||||
demo_resources.c: demo.gresource.xml $(RESOURCES)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/demo.gresource.xml
|
||||
|
||||
RESOURCES= application.ui \
|
||||
RESOURCES= $(demos) \
|
||||
application.ui \
|
||||
demo.ui \
|
||||
menus.ui \
|
||||
theming.ui \
|
||||
alphatest.png \
|
||||
apple-red.png \
|
||||
background.jpg \
|
||||
floppybuddy.gif \
|
||||
gnome-applets.png \
|
||||
gnome-calendar.png \
|
||||
gnome-foot.png \
|
||||
gnome-fs-directory.png \
|
||||
gnome-fs-regular.png \
|
||||
gnome-gimp.png \
|
||||
gnome-gmush.png \
|
||||
gnome-gsame.png \
|
||||
gnu-keys.png \
|
||||
gtk-logo-24.png \
|
||||
gtk-logo-48.png \
|
||||
gtk-logo-old.png \
|
||||
css_accordion.css \
|
||||
css_basics.css \
|
||||
css_multiplebgs.css \
|
||||
css_pixbufs.css \
|
||||
css_shadows.css \
|
||||
cssview.css \
|
||||
fancy.css \
|
||||
reset.css
|
||||
|
||||
IMAGEFILES= alphatest.png \
|
||||
apple-red.png \
|
||||
background.jpg \
|
||||
floppybuddy.gif \
|
||||
gnome-applets.png \
|
||||
gnome-calendar.png \
|
||||
gnome-fs-directory.png \
|
||||
gnome-fs-regular.png \
|
||||
gnome-foot.png \
|
||||
gnome-gimp.png \
|
||||
gnome-gmush.png \
|
||||
gnome-gsame.png \
|
||||
gnu-keys.png \
|
||||
gtk-logo-rgb.gif
|
||||
|
||||
democode_DATA = \
|
||||
$(demos) \
|
||||
$(IMAGEFILES) \
|
||||
$(RESOURCES) \
|
||||
demo.ui
|
||||
|
||||
DISTCLEANFILES = demos.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Application class :: menus.ui application.ui
|
||||
/* Application class
|
||||
*
|
||||
* Demonstrates a simple application.
|
||||
*
|
||||
@@ -113,7 +113,7 @@ activate_about (GSimpleAction *action,
|
||||
NULL
|
||||
};
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/application/logos/gtk-logo-48.png", NULL);
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/application/gtk-logo-48.png", NULL);
|
||||
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"program-name", "GTK+ Code Demos",
|
||||
@@ -177,7 +177,7 @@ register_stock_icons (void)
|
||||
factory = gtk_icon_factory_new ();
|
||||
gtk_icon_factory_add_default (factory);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/application/logos/gtk-logo-24.png", NULL);
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/application/gtk-logo-24.png", NULL);
|
||||
|
||||
icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
|
||||
gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
|
||||
@@ -295,7 +295,7 @@ startup (GApplication *app)
|
||||
GMenuModel *menubar;
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_resource (builder, "/application/ui/menus.ui", NULL);
|
||||
gtk_builder_add_from_resource (builder, "/application/menus.ui", NULL);
|
||||
|
||||
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
|
||||
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
|
||||
@@ -331,7 +331,7 @@ activate (GApplication *app)
|
||||
window);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_resource (builder, "/application/ui/application.ui", NULL);
|
||||
gtk_builder_add_from_resource (builder, "/application/application.ui", NULL);
|
||||
|
||||
grid = (GtkWidget *)gtk_builder_get_object (builder, "grid");
|
||||
contents = (GtkWidget *)gtk_builder_get_object (builder, "contents");
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *infobar = NULL;
|
||||
@@ -81,8 +80,7 @@ static void
|
||||
about_cb (GtkAction *action,
|
||||
GtkWidget *window)
|
||||
{
|
||||
GdkPixbuf *pixbuf, *transparent;
|
||||
gchar *filename;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
const gchar *authors[] = {
|
||||
"Peter Mattis",
|
||||
@@ -100,16 +98,9 @@ about_cb (GtkAction *action,
|
||||
NULL
|
||||
};
|
||||
|
||||
pixbuf = NULL;
|
||||
transparent = NULL;
|
||||
filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
|
||||
if (filename)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_free (filename);
|
||||
transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-old.png", NULL);
|
||||
/* We asser the existence of the pixbuf as we load it from a custom resource. */
|
||||
g_assert (pixbuf);
|
||||
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"program-name", "GTK+ Code Demos",
|
||||
@@ -124,11 +115,11 @@ about_cb (GtkAction *action,
|
||||
"comments", "Program to demonstrate GTK+ functions.",
|
||||
"authors", authors,
|
||||
"documenters", documentors,
|
||||
"logo", transparent,
|
||||
"logo", pixbuf,
|
||||
"title", "About GTK+ Code Demos",
|
||||
NULL);
|
||||
|
||||
g_object_unref (transparent);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
@@ -309,7 +300,7 @@ register_stock_icons (void)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkIconFactory *factory;
|
||||
char *filename;
|
||||
GtkIconSet *icon_set;
|
||||
|
||||
static GtkStockItem items[] = {
|
||||
{ "demo-gtk-logo",
|
||||
@@ -326,35 +317,14 @@ register_stock_icons (void)
|
||||
factory = gtk_icon_factory_new ();
|
||||
gtk_icon_factory_add_default (factory);
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
pixbuf = NULL;
|
||||
filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
|
||||
if (filename)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_free (filename);
|
||||
}
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-old.png", NULL);
|
||||
/* We assert the existence of the pixbuf as we load it from a custom resource. */
|
||||
g_assert (pixbuf);
|
||||
|
||||
/* Register icon to accompany stock item */
|
||||
if (pixbuf != NULL)
|
||||
{
|
||||
GtkIconSet *icon_set;
|
||||
GdkPixbuf *transparent;
|
||||
|
||||
/* 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);
|
||||
g_object_unref (pixbuf);
|
||||
g_object_unref (transparent);
|
||||
}
|
||||
else
|
||||
g_warning ("failed to load GTK logo for toolbar");
|
||||
icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
|
||||
gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
|
||||
gtk_icon_set_unref (icon_set);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
/* Drop our reference to the factory, GTK will hold a reference. */
|
||||
g_object_unref (factory);
|
||||
|
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *assistant = NULL;
|
||||
static GtkWidget *progress_bar = NULL;
|
||||
|
@@ -1,10 +1,9 @@
|
||||
/* Builder :: demo.ui
|
||||
/* Builder
|
||||
*
|
||||
* Demonstrates an interface loaded from a XML description.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkBuilder *builder;
|
||||
|
||||
@@ -38,14 +37,11 @@ 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);
|
||||
gtk_builder_add_from_resource (builder, "/builder/demo.ui", &err);
|
||||
if (err)
|
||||
{
|
||||
g_error ("ERROR: %s\n", err->message);
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#undef GDK_DISABLE_DEPRECATED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* The ChangeDisplayInfo structure corresponds to a toplevel window and
|
||||
* holds pointers to widgets inside the toplevel window along with other
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/CSS Accordion :: css_accordion.css
|
||||
/* CSS Theming/CSS Accordion
|
||||
*
|
||||
* A simple accordion demo written using CSS transitions and multiple backgrounds
|
||||
*
|
||||
@@ -57,7 +57,7 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (container), child);
|
||||
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
bytes = g_resources_lookup_data ("/css_accordion/gtk.css", 0, NULL);
|
||||
bytes = g_resources_lookup_data ("/css_accordion/css_accordion.css", 0, NULL);
|
||||
data = g_bytes_get_data (bytes, &data_size);
|
||||
|
||||
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
@import url("resource:///reset.css");
|
||||
@import url("reset.css");
|
||||
|
||||
* {
|
||||
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/CSS Basics :: css_basics.css
|
||||
/* CSS Theming/CSS Basics
|
||||
*
|
||||
* Gtk themes are written using CSS. Every widget is build of multiple items
|
||||
* that you can style very similarly to a regular website.
|
||||
@@ -98,7 +98,7 @@ do_css_basics (GtkWidget *do_widget)
|
||||
G_CALLBACK (css_text_changed),
|
||||
provider);
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_basics/gtk.css", 0, NULL);
|
||||
bytes = g_resources_lookup_data ("/css_basics/css_basics.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("reset.css");
|
||||
|
||||
/* Set a very futuristic style by default */
|
||||
* {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Multiple Backgrounds :: css_multiplebgs.css cssview.css
|
||||
/* CSS Theming/Multiple Backgrounds
|
||||
*
|
||||
* Gtk themes are written using CSS. Every widget is build of multiple items
|
||||
* that you can style very similarly to a regular website.
|
||||
@@ -147,7 +147,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
G_CALLBACK (css_text_changed),
|
||||
provider);
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_multiplebgs/gtk.css", 0, NULL);
|
||||
bytes = g_resources_lookup_data ("/css_multiplebgs/css_multiplebgs.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
@import url("reset.css");
|
||||
@import url("cssview.css");
|
||||
|
||||
#canvas {
|
||||
transition-property: background-color, background-image;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* CSS Theming/Animated backgrounds
|
||||
/* CSS Theming/Animated Backgrounds
|
||||
*
|
||||
* This demo is done in honour of the Pixbufs demo further down. It is done exclusively
|
||||
* with CSS as the background of the window.
|
||||
* This demo is done in honour of the Pixbufs demo further down.
|
||||
* It is done exclusively with CSS as the background of the window.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
@@ -106,6 +106,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
@import url("reset.css");
|
||||
@import url("cssview.css");
|
||||
|
||||
@keyframes move-the-image {
|
||||
0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; }
|
||||
@@ -51,15 +51,15 @@
|
||||
}
|
||||
|
||||
GtkWindow {
|
||||
background-image: url("resource:///css_pixbufs/apple-red.png"),
|
||||
url("resource:///css_pixbufs/gnome-applets.png"),
|
||||
url("resource:///css_pixbufs/gnome-calendar.png"),
|
||||
url("resource:///css_pixbufs/gnome-foot.png"),
|
||||
url("resource:///css_pixbufs/gnome-gmush.png"),
|
||||
url("resource:///css_pixbufs/gnome-gimp.png"),
|
||||
url("resource:///css_pixbufs/gnome-gsame.png"),
|
||||
url("resource:///css_pixbufs/gnu-keys.png"),
|
||||
url("resource:///css_pixbufs/background.jpg");
|
||||
background-image: url("apple-red.png"),
|
||||
url("gnome-applets.png"),
|
||||
url("gnome-calendar.png"),
|
||||
url("gnome-foot.png"),
|
||||
url("gnome-gmush.png"),
|
||||
url("gnome-gimp.png"),
|
||||
url("gnome-gsame.png"),
|
||||
url("gnu-keys.png"),
|
||||
url("background.jpg");
|
||||
background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%;
|
||||
background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
|
||||
animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s;
|
||||
|
@@ -126,6 +126,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
|
||||
bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL);
|
||||
gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
g_signal_connect (provider,
|
||||
"parsing-error",
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
@import url("reset.css");
|
||||
@import url("cssview.css");
|
||||
|
||||
/* Get a nice background for the window */
|
||||
.background {
|
||||
|
@@ -1,11 +0,0 @@
|
||||
#ifndef __DEMO_COMMON_H__
|
||||
#define __DEMO_COMMON_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gchar *demo_find_file (const gchar *base,
|
||||
GError **err);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __DEMO_COMMON_H__ */
|
@@ -1,35 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/application/logos">
|
||||
<gresource prefix="/">
|
||||
<file>gtk-logo-old.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/application">
|
||||
<file preprocess="to-pixdata">gtk-logo-24.png</file>
|
||||
<file preprocess="to-pixdata">gtk-logo-48.png</file>
|
||||
<file>application.ui</file>
|
||||
<file>menus.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/application/ui">
|
||||
<file preprocess="xml-stripblanks">application.ui</file>
|
||||
<file preprocess="xml-stripblanks">menus.ui</file>
|
||||
<gresource prefix="/appwindow">
|
||||
<file preprocess="to-pixdata">gtk-logo-old.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/">
|
||||
<gresource prefix="/builder">
|
||||
<file>demo.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_accordion">
|
||||
<file>css_accordion.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_basics">
|
||||
<file>css_basics.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_multiplebgs">
|
||||
<file>css_multiplebgs.css</file>
|
||||
<file>brick.png</file>
|
||||
<file>cssview.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_accordion">
|
||||
<file alias="gtk.css">css_accordion.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_basics">
|
||||
<file alias="gtk.css">css_basics.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_multiplebgs">
|
||||
<file alias="gtk.css">css_multiplebgs.css</file>
|
||||
<file>brick.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/theming_custom_css">
|
||||
<file alias="gtk.css">fancy.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/theming_style_classes">
|
||||
<file preprocess="xml-stripblanks">theming.ui</file>
|
||||
<file>theming.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_pixbufs">
|
||||
<file alias="gtk.css">css_pixbufs.css</file>
|
||||
<file>cssview.css</file>
|
||||
<file>reset.css</file>
|
||||
<file>background.jpg</file>
|
||||
<file>apple-red.png</file>
|
||||
<file>gnome-applets.png</file>
|
||||
@@ -42,5 +48,80 @@
|
||||
</gresource>
|
||||
<gresource prefix="/css_shadows">
|
||||
<file alias="gtk.css">css_shadows.css</file>
|
||||
<file>cssview.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/iconview">
|
||||
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
|
||||
<file preprocess="to-pixdata">gnome-fs-regular.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/images">
|
||||
<file>alphatest.png</file>
|
||||
<file>floppybuddy.gif</file>
|
||||
<file>gtk-logo-old.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/pixbufs">
|
||||
<file>apple-red.png</file>
|
||||
<file>background.jpg</file>
|
||||
<file>gnome-applets.png</file>
|
||||
<file>gnome-calendar.png</file>
|
||||
<file>gnome-foot.png</file>
|
||||
<file>gnome-gmush.png</file>
|
||||
<file>gnome-gimp.png</file>
|
||||
<file>gnome-gsame.png</file>
|
||||
<file>gnu-keys.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/sources">
|
||||
<file>application.c</file>
|
||||
<file>appwindow.c</file>
|
||||
<file>assistant.c</file>
|
||||
<file>builder.c</file>
|
||||
<file>button_box.c</file>
|
||||
<file>changedisplay.c</file>
|
||||
<file>clipboard.c</file>
|
||||
<file>colorsel.c</file>
|
||||
<file>combobox.c</file>
|
||||
<file>css_accordion.c</file>
|
||||
<file>css_basics.c</file>
|
||||
<file>css_multiplebgs.c</file>
|
||||
<file>css_pixbufs.c</file>
|
||||
<file>css_shadows.c</file>
|
||||
<file>dialog.c</file>
|
||||
<file>drawingarea.c</file>
|
||||
<file>editable_cells.c</file>
|
||||
<file>entry_buffer.c</file>
|
||||
<file>entry_completion.c</file>
|
||||
<file>expander.c</file>
|
||||
<file>hypertext.c</file>
|
||||
<file>iconview.c</file>
|
||||
<file>iconview_edit.c</file>
|
||||
<file>images.c</file>
|
||||
<file>infobar.c</file>
|
||||
<file>links.c</file>
|
||||
<file>list_store.c</file>
|
||||
<file>menus.c</file>
|
||||
<file>offscreen_window.c</file>
|
||||
<file>offscreen_window2.c</file>
|
||||
<file>overlay.c</file>
|
||||
<file>panes.c</file>
|
||||
<file>pickers.c</file>
|
||||
<file>pixbufs.c</file>
|
||||
<file>printing.c</file>
|
||||
<file>rotated_text.c</file>
|
||||
<file>search_entry.c</file>
|
||||
<file>sizegroup.c</file>
|
||||
<file>spinner.c</file>
|
||||
<file>stock_browser.c</file>
|
||||
<file>textview.c</file>
|
||||
<file>textscroll.c</file>
|
||||
<file>theming_style_classes.c</file>
|
||||
<file>toolpalette.c</file>
|
||||
<file>transparent.c</file>
|
||||
<file>tree_store.c</file>
|
||||
<file>ui_manager.c</file>
|
||||
</gresource>
|
||||
<gresource prefix="/textview">
|
||||
<file>floppybuddy.gif</file>
|
||||
<file>gtk-logo-old.png</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<interface domain="gtk20">
|
||||
<interface>
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
|
@@ -1,65 +0,0 @@
|
||||
GtkButton#fancy {
|
||||
transition: none;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(white, 0.7),
|
||||
alpha(white, 0) 30%),
|
||||
linear-gradient(to top,
|
||||
alpha(#babdb6, 0.4),
|
||||
alpha(#babdb6, 0) 50%),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec,
|
||||
white 20%,
|
||||
#d3d7cf,
|
||||
white 80%,
|
||||
#babdb6);
|
||||
color: #3465a4;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px white;
|
||||
}
|
||||
|
||||
GtkButton#fancy:hover {
|
||||
transition: all 250ms linear;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(white, 1),
|
||||
alpha(white, 0)),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec 10%,
|
||||
white 40%,
|
||||
#d3d7cf,
|
||||
white 70%,
|
||||
#babdb6);
|
||||
color: #204a87;
|
||||
}
|
||||
|
||||
GtkButton#fancy:active,
|
||||
GtkButton#fancy:active:hover {
|
||||
transition: none;
|
||||
background-image: linear-gradient(to bottom,
|
||||
alpha(#555753, 0.5),
|
||||
alpha(#babdb6, 0.3)),
|
||||
linear-gradient(135deg,
|
||||
#eeeeec,
|
||||
white 20%,
|
||||
#d3d7cf,
|
||||
white 80%,
|
||||
#babdb6);
|
||||
color: white;
|
||||
text-shadow: 0 1px black;
|
||||
}
|
||||
|
||||
GtkButton#fancy:backdrop,
|
||||
GtkButton#fancy:backdrop:hover {
|
||||
transition: none;
|
||||
background-image: linear-gradient(135deg,
|
||||
alpha(#eeeeec, 0.5) 10%,
|
||||
alpha(white, 0.5) 40%,
|
||||
alpha(#d3d7cf, 0.5),
|
||||
alpha(white, 0.5) 70%,
|
||||
alpha(#babdb6, 0.5));
|
||||
color: #babdb6;
|
||||
}
|
||||
|
||||
GtkButton#fancy * {
|
||||
/* Yeah this should be inherited by default */
|
||||
color: inherit;
|
||||
}
|
@@ -24,20 +24,13 @@ for $file (@ARGV) {
|
||||
open INFO_FILE, $file or die "Cannot open '$file'\n";
|
||||
$title = <INFO_FILE>;
|
||||
$title =~ s@^\s*/\*\s*@@;
|
||||
$extra = "";
|
||||
if ($title =~ /^(.*)::(.*)$/) {
|
||||
$title = $1;
|
||||
$extra = " $2";
|
||||
}
|
||||
$title =~ s@\s*$@@;
|
||||
$extra =~ s@^\s*@@;
|
||||
$extra =~ s@\s*$@@;
|
||||
|
||||
close INFO_FILE;
|
||||
|
||||
print "GtkWidget *do_$basename (GtkWidget *do_widget);\n";
|
||||
|
||||
push @demos, {"name" => $basename, "title" => $title, "file" => "$file $extra",
|
||||
push @demos, {"name" => $basename, "title" => $title, "file" => $file,
|
||||
"func" => "do_$basename"};
|
||||
}
|
||||
|
||||
@@ -48,7 +41,7 @@ foreach $href (@demos) {
|
||||
my $do_next = 0;
|
||||
|
||||
# parent detected
|
||||
if (defined @parents) {
|
||||
if (@parents) {
|
||||
foreach $foo (@parents) {
|
||||
if ($foo eq $parent_name) {
|
||||
$do_next = 1;
|
||||
@@ -62,7 +55,7 @@ foreach $href (@demos) {
|
||||
|
||||
push @parents, $parent_name;
|
||||
|
||||
$tmp = (defined @child_arrays)?($#child_arrays + 1):0;
|
||||
$tmp = (@child_arrays)?($#child_arrays + 1):0;
|
||||
push @child_arrays, "child$tmp";
|
||||
|
||||
push @demos, {"name" => "NULL", "title" => $parent_name, "file" => "NULL",
|
||||
@@ -70,7 +63,7 @@ foreach $href (@demos) {
|
||||
}
|
||||
}
|
||||
|
||||
if (defined @parents) {
|
||||
if (@parents) {
|
||||
$i = 0;
|
||||
for ($i = 0; $i <= $#parents; $i++) {
|
||||
$first = 1;
|
||||
@@ -81,7 +74,7 @@ if (defined @parents) {
|
||||
for ($j = 0; $j <= $#demos; $j++) {
|
||||
$href = $demos[$j];
|
||||
|
||||
if (!defined $demos[$j]) {
|
||||
if (!$demos[$j]) {
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -113,7 +106,7 @@ if (defined @parents) {
|
||||
} @demos_old;
|
||||
|
||||
# sort the child arrays
|
||||
if (defined @child_arrays) {
|
||||
if (@child_arrays) {
|
||||
for ($i = 0; $i <= $#child_arrays; $i++) {
|
||||
@foo_old = @{$child_arrays[$i]};
|
||||
|
||||
@@ -141,7 +134,7 @@ foreach $href (@demos) {
|
||||
print ", \n";
|
||||
}
|
||||
|
||||
if (defined @parents) {
|
||||
if (@parents) {
|
||||
for ($i = 0; $i <= $#parents; $i++) {
|
||||
if ($parents[$i] eq $href->{title}) {
|
||||
|
||||
|
BIN
demos/gtk-demo/gtk-logo-old.png
Normal file
BIN
demos/gtk-demo/gtk-logo-old.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB |
@@ -7,12 +7,11 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
#define FOLDER_NAME "gnome-fs-directory.png"
|
||||
#define FILE_NAME "gnome-fs-regular.png"
|
||||
#define FOLDER_NAME "/iconview/gnome-fs-directory.png"
|
||||
#define FILE_NAME "/iconview/gnome-fs-regular.png"
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -29,36 +28,18 @@ gchar *parent;
|
||||
GtkToolItem *up_button;
|
||||
|
||||
/* Loads the images for the demo and returns whether the operation succeeded */
|
||||
static gboolean
|
||||
load_pixbufs (GError **error)
|
||||
static void
|
||||
load_pixbufs (void)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
if (file_pixbuf)
|
||||
return TRUE; /* already loaded earlier */
|
||||
return; /* already loaded earlier */
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
filename = demo_find_file (FILE_NAME, error);
|
||||
if (!filename)
|
||||
return FALSE; /* note that "error" was filled in and returned */
|
||||
file_pixbuf = gdk_pixbuf_new_from_resource (FILE_NAME, NULL);
|
||||
/* resources must load successfully */
|
||||
g_assert (file_pixbuf);
|
||||
|
||||
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 */
|
||||
|
||||
folder_pixbuf = gdk_pixbuf_new_from_file (filename, error);
|
||||
g_free (filename);
|
||||
|
||||
return TRUE;
|
||||
folder_pixbuf = gdk_pixbuf_new_from_resource (FOLDER_NAME, NULL);
|
||||
g_assert (folder_pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -261,7 +242,12 @@ do_iconview (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GError *error;
|
||||
GtkWidget *sw;
|
||||
GtkWidget *icon_view;
|
||||
GtkListStore *store;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *tool_bar;
|
||||
GtkToolItem *home_button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
@@ -273,90 +259,63 @@ do_iconview (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (close_window), NULL);
|
||||
|
||||
error = NULL;
|
||||
if (!load_pixbufs (&error))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
load_pixbufs ();
|
||||
|
||||
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);
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
g_error_free (error);
|
||||
tool_bar = gtk_toolbar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
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);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidget *sw;
|
||||
GtkWidget *icon_view;
|
||||
GtkListStore *store;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *tool_bar;
|
||||
GtkToolItem *home_button;
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 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);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1);
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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 ();
|
||||
fill_store (store);
|
||||
/* Create the store and fill it with the contents of '/' */
|
||||
parent = g_strdup ("/");
|
||||
store = create_store ();
|
||||
fill_store (store);
|
||||
|
||||
icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
|
||||
GTK_SELECTION_MULTIPLE);
|
||||
g_object_unref (store);
|
||||
icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
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);
|
||||
/* Connect to the "clicked" signal of the "Up" tool button */
|
||||
g_signal_connect (up_button, "clicked",
|
||||
G_CALLBACK (up_clicked), store);
|
||||
|
||||
/* Connect to the "clicked" signal of the "Home" tool button */
|
||||
g_signal_connect (home_button, "clicked",
|
||||
G_CALLBACK (home_clicked), store);
|
||||
/* 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);
|
||||
/* 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",
|
||||
G_CALLBACK (item_activated), store);
|
||||
gtk_container_add (GTK_CONTAINER (sw), icon_view);
|
||||
/* 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);
|
||||
}
|
||||
gtk_widget_grab_focus (icon_view);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@@ -16,12 +16,11 @@
|
||||
#include <glib/gstdio.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GdkPixbufLoader *pixbuf_loader = NULL;
|
||||
static guint load_timeout = 0;
|
||||
static FILE* image_stream = NULL;
|
||||
static GInputStream * image_stream = NULL;
|
||||
|
||||
static void
|
||||
progressive_prepared_callback (GdkPixbufLoader *loader,
|
||||
@@ -79,13 +78,13 @@ progressive_timeout (gpointer data)
|
||||
|
||||
if (image_stream)
|
||||
{
|
||||
size_t bytes_read;
|
||||
gssize bytes_read;
|
||||
guchar buf[256];
|
||||
GError *error = NULL;
|
||||
|
||||
bytes_read = fread (buf, 1, 256, image_stream);
|
||||
bytes_read = g_input_stream_read (image_stream, buf, 256, NULL, &error);
|
||||
|
||||
if (ferror (image_stream))
|
||||
if (bytes_read < 0)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
@@ -94,12 +93,13 @@ progressive_timeout (gpointer data)
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failure reading image file 'alphatest.png': %s",
|
||||
g_strerror (errno));
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
fclose (image_stream);
|
||||
g_object_unref (image_stream);
|
||||
image_stream = NULL;
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
@@ -127,7 +127,7 @@ progressive_timeout (gpointer data)
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
fclose (image_stream);
|
||||
g_object_unref (image_stream);
|
||||
image_stream = NULL;
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
@@ -137,9 +137,42 @@ progressive_timeout (gpointer data)
|
||||
return FALSE; /* uninstall the timeout */
|
||||
}
|
||||
|
||||
if (feof (image_stream))
|
||||
if (bytes_read == 0)
|
||||
{
|
||||
fclose (image_stream);
|
||||
/* Errors can happen on close, e.g. if the image
|
||||
* file was truncated we'll know on close that
|
||||
* it was incomplete.
|
||||
*/
|
||||
error = NULL;
|
||||
if (!g_input_stream_close (image_stream, NULL, &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 (image_stream);
|
||||
image_stream = NULL;
|
||||
g_object_unref (pixbuf_loader);
|
||||
pixbuf_loader = NULL;
|
||||
|
||||
load_timeout = 0;
|
||||
|
||||
return FALSE; /* uninstall the timeout */
|
||||
}
|
||||
|
||||
g_object_unref (image_stream);
|
||||
image_stream = NULL;
|
||||
|
||||
/* Errors can happen on close, e.g. if the image
|
||||
@@ -180,29 +213,9 @@ progressive_timeout (gpointer data)
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *filename;
|
||||
gchar *error_message = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
filename = demo_find_file ("alphatest.png", &error);
|
||||
if (error)
|
||||
{
|
||||
error_message = g_strdup (error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
image_stream = g_fopen (filename, "rb");
|
||||
g_free (filename);
|
||||
|
||||
if (!image_stream)
|
||||
error_message = g_strdup_printf ("Unable to open image file 'alphatest.png': %s",
|
||||
g_strerror (errno));
|
||||
}
|
||||
image_stream = g_resources_open_stream ("/images/alphatest.png", 0, &error);
|
||||
|
||||
if (image_stream == NULL)
|
||||
{
|
||||
@@ -212,8 +225,8 @@ progressive_timeout (gpointer data)
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"%s", error_message);
|
||||
g_free (error_message);
|
||||
"%s", error->message);
|
||||
g_error_free (error);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
@@ -229,7 +242,6 @@ progressive_timeout (gpointer data)
|
||||
{
|
||||
gdk_pixbuf_loader_close (pixbuf_loader, NULL);
|
||||
g_object_unref (pixbuf_loader);
|
||||
pixbuf_loader = NULL;
|
||||
}
|
||||
|
||||
pixbuf_loader = gdk_pixbuf_loader_new ();
|
||||
@@ -278,8 +290,10 @@ cleanup_callback (GObject *object,
|
||||
}
|
||||
|
||||
if (image_stream)
|
||||
fclose (image_stream);
|
||||
image_stream = NULL;
|
||||
{
|
||||
g_object_unref (image_stream);
|
||||
image_stream = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -317,8 +331,6 @@ do_images (GtkWidget *do_widget)
|
||||
GtkWidget *button;
|
||||
GdkPixbuf *pixbuf;
|
||||
GIcon *gicon;
|
||||
GError *error = NULL;
|
||||
char *filename;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
@@ -349,41 +361,9 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
pixbuf = NULL;
|
||||
filename = demo_find_file ("gtk-logo-rgb.gif", &error);
|
||||
if (filename)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, &error);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
/* This code shows off error handling. You can just use
|
||||
* gtk_image_new_from_file() instead if you don't want to report
|
||||
* errors to the user. If the file doesn't load when using
|
||||
* gtk_image_new_from_file(), a "missing image" icon will
|
||||
* be displayed instead.
|
||||
*/
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"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);
|
||||
}
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/images/gtk-logo-old.png", NULL);
|
||||
/* The image loading must work, we ensure that the resources are valid. */
|
||||
g_assert (pixbuf);
|
||||
|
||||
image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
|
||||
@@ -403,9 +383,7 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
|
||||
filename = demo_find_file ("floppybuddy.gif", NULL);
|
||||
image = gtk_image_new_from_file (filename);
|
||||
g_free (filename);
|
||||
image = gtk_image_new_from_resource ("/images/floppybuddy.gif");
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
||||
@@ -427,8 +405,8 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
||||
/* Progressive */
|
||||
|
||||
/* Progressive */
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_markup (GTK_LABEL (label),
|
||||
|
@@ -17,6 +17,7 @@ static gchar *current_file = NULL;
|
||||
static GtkWidget *notebook;
|
||||
|
||||
enum {
|
||||
NAME_COLUMN,
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
@@ -31,65 +32,6 @@ struct _CallbackData
|
||||
GtkTreePath *path;
|
||||
};
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
#undef DEMOCODEDIR
|
||||
|
||||
static char *
|
||||
get_democodedir (void)
|
||||
{
|
||||
static char *result = NULL;
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
result = g_win32_get_package_installation_directory_of_module (NULL);
|
||||
if (result == NULL)
|
||||
result = "unknown-location";
|
||||
|
||||
result = g_strconcat (result, "\\share\\gtk-3.0\\demo", NULL);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#define DEMOCODEDIR get_democodedir ()
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* demo_find_file:
|
||||
* @base: base filename
|
||||
* @err: location to store error, or %NULL.
|
||||
*
|
||||
* Looks for @base first in the current directory, then in the
|
||||
* location GTK+ where it will be installed on make install,
|
||||
* returns the first file found.
|
||||
*
|
||||
* Return value: the filename, if found or %NULL
|
||||
*/
|
||||
gchar *
|
||||
demo_find_file (const char *base,
|
||||
GError **err)
|
||||
{
|
||||
g_return_val_if_fail (err == NULL || *err == NULL, NULL);
|
||||
|
||||
if (g_file_test ("gtk-logo-rgb.gif", G_FILE_TEST_EXISTS) &&
|
||||
g_file_test (base, G_FILE_TEST_EXISTS))
|
||||
return g_strdup (base);
|
||||
else
|
||||
{
|
||||
char *filename = g_build_filename (DEMOCODEDIR, base, NULL);
|
||||
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_set_error (err, G_FILE_ERROR, G_FILE_ERROR_NOENT,
|
||||
"Cannot find demo data file \"%s\"", base);
|
||||
g_free (filename);
|
||||
return NULL;
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
window_closed_cb (GtkWidget *window, gpointer data)
|
||||
{
|
||||
@@ -110,65 +52,6 @@ window_closed_cb (GtkWidget *window, gpointer data)
|
||||
g_free (cbdata);
|
||||
}
|
||||
|
||||
gboolean
|
||||
read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
flockfile (stream);
|
||||
#endif
|
||||
|
||||
g_string_truncate (str, 0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
c = getc_unlocked (stream);
|
||||
#else
|
||||
c = getc (stream);
|
||||
#endif
|
||||
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
else
|
||||
n_read++;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
int next_c = getc_unlocked (stream);
|
||||
#else
|
||||
int next_c = getc (stream);
|
||||
#endif
|
||||
|
||||
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:
|
||||
|
||||
#ifdef HAVE_FLOCKFILE
|
||||
funlockfile (stream);
|
||||
#endif
|
||||
|
||||
return n_read > 0;
|
||||
}
|
||||
|
||||
|
||||
/* Stupid syntax highlighting.
|
||||
*
|
||||
* No regex was used in the making of this highlighting.
|
||||
@@ -518,33 +401,66 @@ fontify (void)
|
||||
static GtkWidget *create_text (GtkTextBuffer **buffer, gboolean is_source);
|
||||
|
||||
static void
|
||||
add_data_tab (const gchar *filename)
|
||||
add_data_tab (const gchar *demoname)
|
||||
{
|
||||
GtkTextBuffer *buffer = NULL;
|
||||
gchar *full_filename;
|
||||
GError *err = NULL;
|
||||
gchar *text;
|
||||
gchar *resource_dir, *resource_name, *content_type;
|
||||
gchar **resources;
|
||||
GBytes *bytes;
|
||||
GtkWidget *widget, *label;
|
||||
guint i;
|
||||
|
||||
full_filename = demo_find_file (filename, &err);
|
||||
if (!full_filename ||
|
||||
!g_file_get_contents (full_filename, &text, NULL, &err))
|
||||
resource_dir = g_strconcat ("/", demoname, NULL);
|
||||
resources = g_resources_enumerate_children (resource_dir, 0, NULL);
|
||||
if (resources == NULL)
|
||||
{
|
||||
g_warning ("%s", err->message);
|
||||
g_error_free (err);
|
||||
g_free (resource_dir);
|
||||
return;
|
||||
}
|
||||
|
||||
widget = create_text (&buffer, FALSE);
|
||||
gtk_widget_show_all (widget);
|
||||
label = gtk_label_new (filename);
|
||||
gtk_widget_show (label);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||
for (i = 0; resources[i]; i++)
|
||||
{
|
||||
resource_name = g_strconcat (resource_dir, "/", resources[i], NULL);
|
||||
bytes = g_resources_lookup_data (resource_name, 0, NULL);
|
||||
g_assert (bytes);
|
||||
|
||||
gtk_text_buffer_set_text (buffer, text, -1);
|
||||
content_type = g_content_type_guess (resource_name,
|
||||
g_bytes_get_data (bytes, NULL),
|
||||
g_bytes_get_size (bytes),
|
||||
NULL);
|
||||
|
||||
g_free (full_filename);
|
||||
g_free (text);
|
||||
/* In theory we should look at all the mime types gdk-pixbuf supports
|
||||
* and go from there, but we know what file types we've added.
|
||||
*/
|
||||
if (g_content_type_is_a (content_type, "image/png") ||
|
||||
g_content_type_is_a (content_type, "image/gif") ||
|
||||
g_content_type_is_a (content_type, "image/jpeg"))
|
||||
{
|
||||
widget = gtk_image_new_from_resource (resource_name);
|
||||
}
|
||||
else if (g_content_type_is_a (content_type, "text/plain"))
|
||||
{
|
||||
widget = create_text (&buffer, FALSE);
|
||||
gtk_text_buffer_set_text (buffer, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Don't know how to display resource '%s' of type '%s'\n", resource_name, content_type);
|
||||
widget = NULL;
|
||||
}
|
||||
|
||||
gtk_widget_show_all (widget);
|
||||
label = gtk_label_new (resources[i]);
|
||||
gtk_widget_show (label);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||
|
||||
g_free (content_type);
|
||||
g_free (resource_name);
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
g_strfreev (resources);
|
||||
g_free (resource_dir);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -557,32 +473,27 @@ remove_data_tabs (void)
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const gchar *filename)
|
||||
load_file (const gchar *demoname,
|
||||
const gchar *filename)
|
||||
{
|
||||
FILE *file;
|
||||
GtkTextIter start, end;
|
||||
char *full_filename;
|
||||
char *resource_filename;
|
||||
GError *err = NULL;
|
||||
GString *buffer = g_string_new (NULL);
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
gchar **names;
|
||||
gchar **lines;
|
||||
GBytes *bytes;
|
||||
gint i;
|
||||
|
||||
if (!g_strcmp0 (current_file, filename))
|
||||
return;
|
||||
|
||||
remove_data_tabs ();
|
||||
|
||||
names = g_strsplit (filename, " ", -1);
|
||||
|
||||
for (i = 1; names[i]; i++) {
|
||||
if (strlen (names[i]) > 0)
|
||||
add_data_tab (names[i]);
|
||||
}
|
||||
|
||||
if (current_file && !strcmp (current_file, names[0]))
|
||||
goto out;
|
||||
add_data_tab (demoname);
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (names[0]);
|
||||
current_file = g_strdup (filename);
|
||||
|
||||
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (info_buffer, &start, &end);
|
||||
@@ -590,31 +501,31 @@ load_file (const gchar *filename)
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
|
||||
full_filename = demo_find_file (names[0], &err);
|
||||
if (!full_filename)
|
||||
resource_filename = g_strconcat ("/sources/", filename, NULL);
|
||||
bytes = g_resources_lookup_data (resource_filename, 0, &err);
|
||||
g_free (resource_filename);
|
||||
|
||||
if (bytes == NULL)
|
||||
{
|
||||
g_warning ("%s", err->message);
|
||||
g_warning ("Cannot open source for %s: %s\n", filename, err->message);
|
||||
g_error_free (err);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
file = g_fopen (full_filename, "r");
|
||||
|
||||
if (!file)
|
||||
g_warning ("Cannot open %s: %s\n", full_filename, g_strerror (errno));
|
||||
|
||||
g_free (full_filename);
|
||||
|
||||
if (!file)
|
||||
goto out;
|
||||
lines = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", -1);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
for (i = 0; lines[i] != NULL; i++)
|
||||
{
|
||||
gchar *p = buffer->str;
|
||||
gchar *p;
|
||||
gchar *q;
|
||||
gchar *r;
|
||||
|
||||
/* Make sure \r is stripped at the end for the poor windows people */
|
||||
lines[i] = g_strchomp (lines[i]);
|
||||
|
||||
p = lines[i];
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
@@ -703,7 +614,7 @@ load_file (const gchar *filename)
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
p = buffer->str;
|
||||
p = lines[i];
|
||||
state++;
|
||||
/* Fall through */
|
||||
}
|
||||
@@ -718,14 +629,9 @@ load_file (const gchar *filename)
|
||||
}
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
|
||||
fontify ();
|
||||
|
||||
out:
|
||||
g_string_free (buffer, TRUE);
|
||||
|
||||
g_strfreev (names);
|
||||
g_strfreev (lines);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -775,17 +681,21 @@ selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GValue value = G_VALUE_INIT;
|
||||
char *name, *filename;
|
||||
|
||||
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get_value (model, &iter,
|
||||
FILENAME_COLUMN,
|
||||
&value);
|
||||
if (g_value_get_string (&value))
|
||||
load_file (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
gtk_tree_model_get (model, &iter,
|
||||
NAME_COLUMN, &name,
|
||||
FILENAME_COLUMN, &filename,
|
||||
-1);
|
||||
|
||||
if (filename)
|
||||
load_file (name, filename);
|
||||
|
||||
g_free (name);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -804,6 +714,7 @@ create_text (GtkTextBuffer **buffer,
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
text_view = gtk_text_view_new ();
|
||||
g_object_set (text_view, "margin", 20, NULL);
|
||||
|
||||
*buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
|
||||
@@ -848,7 +759,7 @@ create_tree (void)
|
||||
|
||||
Demo *d = gtk_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_STRING, G_TYPE_POINTER, G_TYPE_INT);
|
||||
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));
|
||||
@@ -868,6 +779,7 @@ create_tree (void)
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
NAME_COLUMN, d->name,
|
||||
TITLE_COLUMN, d->title,
|
||||
FILENAME_COLUMN, d->filename,
|
||||
FUNC_COLUMN, d->func,
|
||||
@@ -887,6 +799,7 @@ create_tree (void)
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&child_iter,
|
||||
NAME_COLUMN, children->name,
|
||||
TITLE_COLUMN, children->title,
|
||||
FILENAME_COLUMN, children->filename,
|
||||
FUNC_COLUMN, children->func,
|
||||
@@ -939,53 +852,14 @@ static void
|
||||
setup_default_icon (void)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
char *filename;
|
||||
GError *err;
|
||||
|
||||
err = NULL;
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/gtk-logo-old.png", NULL);
|
||||
/* We load a resource, so we can guarantee that loading it is successful */
|
||||
g_assert (pixbuf);
|
||||
|
||||
pixbuf = NULL;
|
||||
filename = demo_find_file ("gtk-logo-rgb.gif", &err);
|
||||
if (filename)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, &err);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
/* Ignoring this error (passing NULL instead of &err above)
|
||||
* would probably be reasonable for most apps. We're just
|
||||
* showing off.
|
||||
*/
|
||||
if (err)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL, 0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failed to read icon file: %s",
|
||||
err->message);
|
||||
g_error_free (err);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
GList *list;
|
||||
GdkPixbuf *transparent;
|
||||
|
||||
/* The gtk-logo-rgb icon has a white background, make it transparent */
|
||||
transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
|
||||
|
||||
list = NULL;
|
||||
list = g_list_append (list, transparent);
|
||||
gtk_window_set_default_icon_list (list);
|
||||
g_list_free (list);
|
||||
g_object_unref (pixbuf);
|
||||
g_object_unref (transparent);
|
||||
}
|
||||
gtk_window_set_default_icon (pixbuf);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1021,6 +895,7 @@ main (int argc, char **argv)
|
||||
gtk_box_pack_start (GTK_BOX (hbox), tree, FALSE, FALSE, 0);
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
@@ -1029,6 +904,7 @@ main (int argc, char **argv)
|
||||
|
||||
gtk_text_buffer_create_tag (info_buffer, "title",
|
||||
"font", "Sans 18",
|
||||
"pixels-below-lines", 10,
|
||||
NULL);
|
||||
g_object_unref (info_buffer);
|
||||
|
||||
@@ -1063,7 +939,7 @@ main (int argc, char **argv)
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
load_file (gtk_demos[0].filename);
|
||||
load_file (gtk_demos[0].name, gtk_demos[0].filename);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
|
@@ -16,21 +16,19 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "demo-common.h"
|
||||
|
||||
#define FRAME_DELAY 50
|
||||
|
||||
#define BACKGROUND_NAME "background.jpg"
|
||||
#define BACKGROUND_NAME "/pixbufs/background.jpg"
|
||||
|
||||
static const char *image_names[] = {
|
||||
"apple-red.png",
|
||||
"gnome-applets.png",
|
||||
"gnome-calendar.png",
|
||||
"gnome-foot.png",
|
||||
"gnome-gmush.png",
|
||||
"gnome-gimp.png",
|
||||
"gnome-gsame.png",
|
||||
"gnu-keys.png"
|
||||
"/pixbufs/apple-red.png",
|
||||
"/pixbufs/gnome-applets.png",
|
||||
"/pixbufs/gnome-calendar.png",
|
||||
"/pixbufs/gnome-foot.png",
|
||||
"/pixbufs/gnome-gmush.png",
|
||||
"/pixbufs/gnome-gimp.png",
|
||||
"/pixbufs/gnome-gsame.png",
|
||||
"/pixbufs/gnu-keys.png"
|
||||
};
|
||||
|
||||
#define N_IMAGES G_N_ELEMENTS (image_names)
|
||||
@@ -56,22 +54,11 @@ static gboolean
|
||||
load_pixbufs (GError **error)
|
||||
{
|
||||
gint i;
|
||||
char *filename;
|
||||
|
||||
if (background)
|
||||
return TRUE; /* already loaded earlier */
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
filename = demo_find_file (BACKGROUND_NAME, error);
|
||||
if (!filename)
|
||||
return FALSE; /* note that "error" was filled in and returned */
|
||||
|
||||
background = gdk_pixbuf_new_from_file (filename, error);
|
||||
g_free (filename);
|
||||
|
||||
background = gdk_pixbuf_new_from_resource (BACKGROUND_NAME, error);
|
||||
if (!background)
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
|
||||
@@ -80,12 +67,7 @@ load_pixbufs (GError **error)
|
||||
|
||||
for (i = 0; i < N_IMAGES; i++)
|
||||
{
|
||||
filename = demo_find_file (image_names[i], error);
|
||||
if (!filename)
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
|
||||
images[i] = gdk_pixbuf_new_from_file (filename, error);
|
||||
g_free (filename);
|
||||
images[i] = gdk_pixbuf_new_from_resource (image_names[i], error);
|
||||
|
||||
if (!images[i])
|
||||
return FALSE; /* Note that "error" was filled with a GError */
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* In points */
|
||||
#define HEADER_HEIGHT (10*72/25.4)
|
||||
@@ -15,7 +14,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar *filename;
|
||||
gchar *resourcename;
|
||||
gdouble font_size;
|
||||
|
||||
gint lines_per_page;
|
||||
@@ -30,7 +29,7 @@ begin_print (GtkPrintOperation *operation,
|
||||
gpointer user_data)
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
char *contents;
|
||||
GBytes *bytes;
|
||||
int i;
|
||||
double height;
|
||||
|
||||
@@ -38,10 +37,10 @@ begin_print (GtkPrintOperation *operation,
|
||||
|
||||
data->lines_per_page = floor (height / data->font_size);
|
||||
|
||||
g_file_get_contents (data->filename, &contents, NULL, NULL);
|
||||
bytes = g_resources_lookup_data (data->resourcename, 0, NULL);
|
||||
|
||||
data->lines = g_strsplit (contents, "\n", 0);
|
||||
g_free (contents);
|
||||
data->lines = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
i = 0;
|
||||
while (data->lines[i] != NULL)
|
||||
@@ -86,7 +85,7 @@ draw_page (GtkPrintOperation *operation,
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
pango_layout_set_text (layout, data->filename, -1);
|
||||
pango_layout_set_text (layout, data->resourcename, -1);
|
||||
pango_layout_get_pixel_size (layout, &text_width, &text_height);
|
||||
|
||||
if (text_width > width)
|
||||
@@ -137,7 +136,7 @@ end_print (GtkPrintOperation *operation,
|
||||
{
|
||||
PrintData *data = (PrintData *)user_data;
|
||||
|
||||
g_free (data->filename);
|
||||
g_free (data->resourcename);
|
||||
g_strfreev (data->lines);
|
||||
g_free (data);
|
||||
}
|
||||
@@ -153,7 +152,7 @@ do_printing (GtkWidget *do_widget)
|
||||
|
||||
operation = gtk_print_operation_new ();
|
||||
data = g_new0 (PrintData, 1);
|
||||
data->filename = demo_find_file ("printing.c", NULL);
|
||||
data->resourcename = g_strdup ("/sources/printing.c");
|
||||
data->font_size = 12.0;
|
||||
|
||||
g_signal_connect (G_OBJECT (operation), "begin-print",
|
||||
|
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
/* Scroll to the end of the buffer.
|
||||
*/
|
||||
|
@@ -10,8 +10,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h> /* for exit() */
|
||||
|
||||
#include "demo-common.h"
|
||||
|
||||
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
||||
|
||||
static void
|
||||
@@ -132,25 +130,9 @@ insert_text (GtkTextBuffer *buffer)
|
||||
GtkTextIter start, end;
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixbuf *scaled;
|
||||
char *filename;
|
||||
|
||||
/* demo_find_file() looks in the current directory first,
|
||||
* so you can run gtk-demo without installing GTK, then looks
|
||||
* in the location where the file is installed.
|
||||
*/
|
||||
pixbuf = NULL;
|
||||
filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
|
||||
if (filename)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
if (pixbuf == NULL)
|
||||
{
|
||||
g_printerr ("Failed to load image file gtk-logo-rgb.gif\n");
|
||||
exit (1);
|
||||
}
|
||||
pixbuf = gdk_pixbuf_new_from_resource ("/textview/gtk-logo-old.png", NULL);
|
||||
g_assert (pixbuf);
|
||||
|
||||
scaled = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR);
|
||||
g_object_unref (pixbuf);
|
||||
@@ -453,9 +435,7 @@ attach_widgets (GtkTextView *text_view)
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
gchar *filename = demo_find_file ("floppybuddy.gif", NULL);
|
||||
widget = gtk_image_new_from_file (filename);
|
||||
g_free (filename);
|
||||
widget = gtk_image_new_from_resource ("/textview/floppybuddy.gif");
|
||||
}
|
||||
else if (i == 4)
|
||||
{
|
||||
|
@@ -1,66 +0,0 @@
|
||||
/* CSS Theming/Custom CSS :: fancy.css
|
||||
*
|
||||
* GTK+ uses CSS for theming. If required, applications can
|
||||
* install their own custom CSS style provider to achieve
|
||||
* special effects.
|
||||
*
|
||||
* Doing this has the downside that your application will no
|
||||
* longer react to the users theme preferences, so this should
|
||||
* be used sparingly.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_theming_custom_css (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *button;
|
||||
GtkCssProvider *provider;
|
||||
GBytes *bytes;
|
||||
|
||||
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), "Custom CSS");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 18);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
button = gtk_button_new_with_label ("Plain");
|
||||
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
|
||||
button = gtk_button_new_with_label ("Fancy");
|
||||
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
|
||||
gtk_widget_set_name (button, "fancy");
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
bytes = g_resources_lookup_data ("/theming_custom_css/gtk.css", 0, NULL);
|
||||
gtk_css_provider_load_from_data (provider, g_bytes_get_data (bytes, NULL),
|
||||
g_bytes_get_size (bytes), NULL);
|
||||
gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (do_widget),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
gtk_widget_show_all (box);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
{
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Style Classes :: theming.ui
|
||||
/* CSS Theming/Style Classes
|
||||
*
|
||||
* GTK+ uses CSS for theming. Style classes can be associated
|
||||
* with widgets to inform the theme about intended rendering.
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
|
@@ -7,7 +7,6 @@
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
@@ -576,8 +575,7 @@ do_toolpalette (GtkWidget *do_widget)
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_ALWAYS);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
contents);
|
||||
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
@@ -607,8 +605,7 @@ do_toolpalette (GtkWidget *do_widget)
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_ALWAYS);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (contents_scroller),
|
||||
contents);
|
||||
gtk_container_add (GTK_CONTAINER (contents_scroller), contents);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller,
|
||||
|
@@ -29,3 +29,5 @@ EXTRA_DIST += \
|
||||
widget-factory.ui \
|
||||
widget-factory.gresource.xml \
|
||||
gtk-logo-256.png
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -147,4 +147,11 @@ include $(top_srcdir)/gtk-doc.make
|
||||
# Other files to distribute
|
||||
EXTRA_DIST += version.xml.in
|
||||
|
||||
if ENABLE_GTK_DOC
|
||||
TESTS_ENVIRONMENT = cd $(srcdir) && \
|
||||
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
|
||||
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
|
||||
#TESTS = $(GTKDOC_CHECK)
|
||||
endif
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -355,6 +355,9 @@ gdk_window_maximize
|
||||
gdk_window_unmaximize
|
||||
gdk_window_fullscreen
|
||||
gdk_window_unfullscreen
|
||||
GdkFullscreenMode
|
||||
gdk_window_get_fullscreen_mode
|
||||
gdk_window_set_fullscreen_mode
|
||||
gdk_window_set_keep_above
|
||||
gdk_window_set_keep_below
|
||||
gdk_window_set_opacity
|
||||
@@ -517,6 +520,7 @@ GdkWindowRedirect
|
||||
gdk_window_impl_get_type
|
||||
gdk_window_freeze_toplevel_updates_libgtk_only
|
||||
gdk_window_thaw_toplevel_updates_libgtk_only
|
||||
gdk_fullscreen_mode_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@@ -21,10 +21,20 @@ CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
# Header files to ignore when scanning
|
||||
IGNORE_HFILES= \
|
||||
fnmatch.h \
|
||||
gactionmuxer.h \
|
||||
gactionobserver.h \
|
||||
gactionobservable.h \
|
||||
gtk9slice.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkdebug.h \
|
||||
gtkactionhelper.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
gtkfilechooserdefault.h \
|
||||
@@ -45,6 +55,8 @@ IGNORE_HFILES= \
|
||||
gtkmarshal.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmnemonichash.h \
|
||||
gtkmodelmenu.h \
|
||||
gtkmodelmenuitem.h \
|
||||
gtkpathbar.h \
|
||||
gtkplugprivate.h \
|
||||
gtkprintbackend.h \
|
||||
@@ -142,6 +154,7 @@ content_files = \
|
||||
gtk-query-immodules-3.0.xml \
|
||||
gtk-update-icon-cache.xml \
|
||||
gtk-launch.xml \
|
||||
broadwayd.xml \
|
||||
visual_index.xml \
|
||||
getting_started.xml \
|
||||
overview.xml
|
||||
@@ -415,7 +428,8 @@ EXTRA_DIST += version.xml.in gtk3.types.in
|
||||
man_MANS = \
|
||||
gtk-query-immodules-3.0.1 \
|
||||
gtk-update-icon-cache.1 \
|
||||
gtk-launch.1
|
||||
gtk-launch.1 \
|
||||
broadwayd.1
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
@@ -449,6 +463,13 @@ MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES)
|
||||
|
||||
EXTRA_DIST += $(man_MANS)
|
||||
|
||||
if ENABLE_GTK_DOC
|
||||
TESTS_ENVIRONMENT = cd $(srcdir) && \
|
||||
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
|
||||
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
|
||||
#TESTS = $(GTKDOC_CHECK)
|
||||
endif
|
||||
|
||||
dist-hook-local: dist-local-check-mans-enabled all-local
|
||||
|
||||
gtk-docs-clean: clean
|
||||
|
@@ -4,25 +4,25 @@
|
||||
]>
|
||||
<refentry id="gtk-broadway">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with HTML5</refentrytitle>
|
||||
<refentrytitle>Using GTK+ with Broadway</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ with HTML5</refname>
|
||||
<refname>Using GTK+ with Broadway</refname>
|
||||
<refpurpose>
|
||||
HTML-specific aspects of using GTK+
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ with HTML5</title>
|
||||
<title>Using GTK+ with Broadway</title>
|
||||
|
||||
<para>
|
||||
The GDK Broadway backend provides support for displaying GTK+
|
||||
applications using HTML5 and Web sockets. To run your application
|
||||
in this way, select the Broadway backend by setting
|
||||
applications in a web browser, using HTML5 and web sockets. To run
|
||||
your application in this way, select the Broadway backend by setting
|
||||
<literal>GDK_BACKEND=broadway</literal>. Then you can make
|
||||
your application appear in a web browser by pointing it at
|
||||
<literal>http://127.0.0.1:8080</literal>. Note that you need
|
||||
@@ -35,6 +35,37 @@ the <envar>BROADWAY_DISPLAY</envar> environment variable to the
|
||||
port that you want to use.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is also possible to use multiple GTK+ applications in the same
|
||||
web browser window, by using the Broadway server,
|
||||
<command>broadwayd</command>, that ships with GTK+.
|
||||
To use broadwayd, start it like this:
|
||||
<programlisting>
|
||||
broadwayd :5
|
||||
</programlisting>
|
||||
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
|
||||
Start your applications like this:
|
||||
<programlisting>
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<refsect2 id="broadway-envar">
|
||||
<title>Broadway-specific environment variables</title>
|
||||
|
||||
</refsect2>
|
||||
<formalpara>
|
||||
<title><envar>BROADWAY_DISPLAY</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies the Broadway display number. The default display is 1.
|
||||
The display number determines the port to use when connecting
|
||||
to a Broadway application via the following formula:
|
||||
<programlisting>
|
||||
<replaceable>port</replaceable> = 8080 + (<replaceable>display</replaceable> - 1)
|
||||
</programlisting>
|
||||
</para>
|
||||
</formalpara>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
77
docs/reference/gtk/broadwayd.xml
Normal file
77
docs/reference/gtk/broadwayd.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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="broadwayd">
|
||||
|
||||
<refentryinfo>
|
||||
<title>broadwayd</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Alexander</firstname>
|
||||
<surname>Larsson</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>broadwayd</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>broadwayd</refname>
|
||||
<refpurpose>Broadway display server</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>broadwayd</command>
|
||||
<arg choice="opt">--port <replaceable>PORT</replaceable></arg>
|
||||
<arg choice="opt">--address <replaceable>ADDRESS</replaceable></arg>
|
||||
<arg choice="opt"><replaceable>:DISPLAY</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>broadwayd</command> is a display server for the Broadway
|
||||
GDK backend. It allows multiple GTK+ applications to display their
|
||||
windows in the same web browser, by connecting to broadwayd.
|
||||
</para>
|
||||
<para>
|
||||
When using broadwayd, specify the display number to use, prefixed
|
||||
with a colon, similar to X. The default display number is 1.
|
||||
<programlisting>
|
||||
broadwayd :5
|
||||
</programlisting>
|
||||
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
|
||||
Start your applications like this:
|
||||
<programlisting>
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>--port</term>
|
||||
<listitem><para>Use <replaceable>PORT</replaceable> as the HTTP
|
||||
port, instead of the default 8080 + (<replaceable>DISPLAY</replaceable> - 1).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>--address</term>
|
||||
<listitem><para>Use <replaceable>ADDRESS</replaceable> as the HTTP
|
||||
address, instead of the default <literal>http://127.0.0.1:<replaceable>PORT</replaceable></literal>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
@@ -317,8 +317,8 @@ How to compile GTK+ itself
|
||||
<command>configure</command>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-modules</arg>
|
||||
<arg>--enable-modules</arg>
|
||||
<arg choice="plain">--disable-modules</arg>
|
||||
<arg choice="plain">--enable-modules</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
@@ -326,65 +326,81 @@ How to compile GTK+ itself
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-debug=[no/minimum/yes]</arg>
|
||||
<arg choice="plain">--enable-debug=[no/minimum/yes]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-Bsymbolic</arg>
|
||||
<arg>--enable-Bsymbolic</arg>
|
||||
<arg choice="plain">--disable-Bsymbolic</arg>
|
||||
<arg choice="plain">--enable-Bsymbolic</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-xkb</arg>
|
||||
<arg>--enable-xkb</arg>
|
||||
<arg choice="plain">--disable-xkb</arg>
|
||||
<arg choice="plain">--enable-xkb</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-xinerama</arg>
|
||||
<arg>--enable-xinerama</arg>
|
||||
<arg choice="plain">--disable-xinerama</arg>
|
||||
<arg choice="plain">--enable-xinerama</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-gtk-doc</arg>
|
||||
<arg>--enable-gtk-doc</arg>
|
||||
<arg choice="plain">--disable-gtk-doc</arg>
|
||||
<arg choice="plain">--enable-gtk-doc</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-cups</arg>
|
||||
<arg>--enable-cups</arg>
|
||||
<arg choice="plain">--disable-cups</arg>
|
||||
<arg choice="plain">--enable-cups</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-papi</arg>
|
||||
<arg>--enable-papi</arg>
|
||||
<arg choice="plain">--disable-papi</arg>
|
||||
<arg choice="plain">--enable-papi</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-xinput</arg>
|
||||
<arg>--disable-xinput</arg>
|
||||
<arg choice="plain">--enable-xinput</arg>
|
||||
<arg choice="plain">--disable-xinput</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-packagekit</arg>
|
||||
<arg>--disable-packagekit</arg>
|
||||
<arg choice="plain">--enable-packagekit</arg>
|
||||
<arg choice="plain">--disable-packagekit</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-x11-backend</arg>
|
||||
<arg>--disable-x11-backend</arg>
|
||||
<arg>--enable-win32-backend</arg>
|
||||
<arg>--disable-win32-backend</arg>
|
||||
<arg>--enable-quartz-backend</arg>
|
||||
<arg>--disable-quartz-backend</arg>
|
||||
<arg choice="plain">--enable-x11-backend</arg>
|
||||
<arg choice="plain">--disable-x11-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-introspection=[no/auto/yes]</arg>
|
||||
<arg choice="plain">--enable-win32-backend</arg>
|
||||
<arg choice="plain">--disable-win32-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-gtk2-dependency</arg>
|
||||
<arg>--disable-gtk2-dependency</arg>
|
||||
<arg choice="plain">--enable-quartz-backend</arg>
|
||||
<arg choice="plain">--disable-quartz-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-broadway-backend</arg>
|
||||
<arg choice="plain">--disable-broadway-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-wayland-backend</arg>
|
||||
<arg choice="plain">--disable-wayland-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-introspection=[no/auto/yes]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-gtk2-dependency</arg>
|
||||
<arg choice="plain">--disable-gtk2-dependency</arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
</para>
|
||||
@@ -571,7 +587,11 @@ How to compile GTK+ itself
|
||||
<systemitem>--enable-win32-backend</systemitem>,
|
||||
<systemitem>--disable-win32-backend</systemitem>,
|
||||
<systemitem>--enable-quartz-backend</systemitem>,
|
||||
and <systemitem>--disable-quartz-backend</systemitem></title>
|
||||
<systemitem>--disable-quartz-backend</systemitem>,
|
||||
<systemitem>--enable-broadway-backend</systemitem>,
|
||||
<systemitem>--disable-broadway-backend</systemitem>,
|
||||
<systemitem>--enable-wayland-backend</systemitem>, and
|
||||
<systemitem>--disable-wayland-backend</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enables specific backends for GDK. If none of these options
|
||||
|
@@ -61,13 +61,9 @@
|
||||
<xi:include href="xml/gtkstyleproperties.xml" />
|
||||
<xi:include href="xml/gtkthemingengine.xml" />
|
||||
<xi:include href="xml/gtkwidgetpath.xml" />
|
||||
<xi:include href="xml/gtksymboliccolor.xml" />
|
||||
<xi:include href="xml/gtkgradient.xml" />
|
||||
<xi:include href="xml/gtkicontheme.xml" />
|
||||
<xi:include href="xml/gtkiconfactory.xml" />
|
||||
<xi:include href="xml/gtknumerableicon.xml" />
|
||||
<xi:include href="xml/gtkrc.xml" />
|
||||
<xi:include href="xml/gtkstyle.xml" />
|
||||
</part>
|
||||
|
||||
<part id="gtkobjects">
|
||||
@@ -128,8 +124,6 @@
|
||||
<xi:include href="xml/gtkentrybuffer.xml" />
|
||||
<xi:include href="xml/gtkentrycompletion.xml" />
|
||||
<xi:include href="xml/gtkscale.xml" />
|
||||
<xi:include href="xml/gtkhscale.xml" />
|
||||
<xi:include href="xml/gtkvscale.xml" />
|
||||
<xi:include href="xml/gtkspinbutton.xml" />
|
||||
<xi:include href="xml/gtksearchentry.xml" />
|
||||
<xi:include href="xml/gtkeditable.xml" />
|
||||
@@ -188,7 +182,6 @@
|
||||
<xi:include href="xml/gtkradiomenuitem.xml" />
|
||||
<xi:include href="xml/gtkcheckmenuitem.xml" />
|
||||
<xi:include href="xml/gtkseparatormenuitem.xml" />
|
||||
<xi:include href="xml/gtktearoffmenuitem.xml" />
|
||||
<xi:include href="xml/gtktoolshell.xml" />
|
||||
<xi:include href="xml/gtktoolbar.xml" />
|
||||
<xi:include href="xml/gtktoolitem.xml" />
|
||||
@@ -218,9 +211,6 @@
|
||||
<xi:include href="xml/gtkcolorbutton.xml" />
|
||||
<xi:include href="xml/gtkcolorchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkcolorchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkcolorsel.xml" />
|
||||
<xi:include href="xml/gtkcolorseldlg.xml" />
|
||||
<xi:include href="xml/gtkhsv.xml" />
|
||||
<xi:include href="xml/gtkfilechooser.xml" />
|
||||
<xi:include href="xml/gtkfilechooserbutton.xml" />
|
||||
<xi:include href="xml/gtkfilechooserdialog.xml" />
|
||||
@@ -230,8 +220,6 @@
|
||||
<xi:include href="xml/gtkfontbutton.xml" />
|
||||
<xi:include href="xml/gtkfontchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkfontchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkfontsel.xml" />
|
||||
<xi:include href="xml/gtkfontseldlg.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="LayoutContainers">
|
||||
@@ -240,18 +228,11 @@
|
||||
<xi:include href="xml/gtkalignment.xml" />
|
||||
<xi:include href="xml/gtkaspectframe.xml" />
|
||||
<xi:include href="xml/gtkbox.xml" />
|
||||
<xi:include href="xml/gtkhbox.xml" />
|
||||
<xi:include href="xml/gtkvbox.xml" />
|
||||
<xi:include href="xml/gtkbbox.xml" />
|
||||
<xi:include href="xml/gtkhbbox.xml" />
|
||||
<xi:include href="xml/gtkvbbox.xml" />
|
||||
<xi:include href="xml/gtkfixed.xml" />
|
||||
<xi:include href="xml/gtkpaned.xml" />
|
||||
<xi:include href="xml/gtkhpaned.xml" />
|
||||
<xi:include href="xml/gtkvpaned.xml" />
|
||||
<xi:include href="xml/gtklayout.xml" />
|
||||
<xi:include href="xml/gtknotebook.xml" />
|
||||
<xi:include href="xml/gtktable.xml" />
|
||||
<xi:include href="xml/gtkexpander.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
<xi:include href="xml/gtkorientable.xml" />
|
||||
@@ -261,15 +242,11 @@
|
||||
<title>Ornaments</title>
|
||||
<xi:include href="xml/gtkframe.xml" />
|
||||
<xi:include href="xml/gtkseparator.xml" />
|
||||
<xi:include href="xml/gtkhseparator.xml" />
|
||||
<xi:include href="xml/gtkvseparator.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="ScrollingWidgets">
|
||||
<title>Scrolling</title>
|
||||
<xi:include href="xml/gtkscrollbar.xml" />
|
||||
<xi:include href="xml/gtkhscrollbar.xml" />
|
||||
<xi:include href="xml/gtkvscrollbar.xml" />
|
||||
<xi:include href="xml/gtkscrolledwindow.xml" />
|
||||
<xi:include href="xml/gtkscrollable.xml" />
|
||||
</chapter>
|
||||
@@ -350,6 +327,34 @@
|
||||
<xi:include href="xml/gtkapplicationwindow.xml" />
|
||||
<xi:include href="xml/gtkactionable.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="DeprecatedObjects">
|
||||
<title>Deprecated</title>
|
||||
<xi:include href="xml/gtksymboliccolor.xml" />
|
||||
<xi:include href="xml/gtkgradient.xml" />
|
||||
<xi:include href="xml/gtkrc.xml" />
|
||||
<xi:include href="xml/gtkstyle.xml" />
|
||||
<xi:include href="xml/gtkhscale.xml" />
|
||||
<xi:include href="xml/gtkvscale.xml" />
|
||||
<xi:include href="xml/gtktearoffmenuitem.xml" />
|
||||
<xi:include href="xml/gtkcolorsel.xml" />
|
||||
<xi:include href="xml/gtkcolorseldlg.xml" />
|
||||
<xi:include href="xml/gtkhsv.xml" />
|
||||
<xi:include href="xml/gtkfontsel.xml" />
|
||||
<xi:include href="xml/gtkfontseldlg.xml" />
|
||||
<xi:include href="xml/gtkhbox.xml" />
|
||||
<xi:include href="xml/gtkvbox.xml" />
|
||||
<xi:include href="xml/gtkhbbox.xml" />
|
||||
<xi:include href="xml/gtkvbbox.xml" />
|
||||
<xi:include href="xml/gtkhpaned.xml" />
|
||||
<xi:include href="xml/gtkvpaned.xml" />
|
||||
<xi:include href="xml/gtktable.xml" />
|
||||
<xi:include href="xml/gtkhseparator.xml" />
|
||||
<xi:include href="xml/gtkvseparator.xml" />
|
||||
<xi:include href="xml/gtkhscrollbar.xml" />
|
||||
<xi:include href="xml/gtkvscrollbar.xml" />
|
||||
</chapter>
|
||||
|
||||
</part>
|
||||
|
||||
<part id="migrating">
|
||||
@@ -378,6 +383,7 @@
|
||||
<xi:include href="gtk-query-immodules-3.0.xml" />
|
||||
<xi:include href="gtk-update-icon-cache.xml" />
|
||||
<xi:include href="gtk-launch.xml" />
|
||||
<xi:include href="broadwayd.xml" />
|
||||
</part>
|
||||
|
||||
<xi:include href="glossary.xml" />
|
||||
@@ -406,6 +412,10 @@
|
||||
<title>Index of new symbols in 3.6</title>
|
||||
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-8" role="3.8">
|
||||
<title>Index of new symbols in 3.8</title>
|
||||
<xi:include href="xml/api-index-3.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
@@ -536,6 +536,7 @@ gtk_builder_add_objects_from_string
|
||||
gtk_builder_add_objects_from_resource
|
||||
gtk_builder_get_object
|
||||
gtk_builder_get_objects
|
||||
gtk_builder_expose_object
|
||||
gtk_builder_connect_signals
|
||||
gtk_builder_connect_signals_full
|
||||
gtk_builder_set_translation_domain
|
||||
@@ -1755,6 +1756,8 @@ gtk_icon_view_set_margin
|
||||
gtk_icon_view_get_margin
|
||||
gtk_icon_view_set_item_padding
|
||||
gtk_icon_view_get_item_padding
|
||||
gtk_icon_view_set_activate_on_single_click
|
||||
gtk_icon_view_get_activate_on_single_click
|
||||
gtk_icon_view_get_cell_rect
|
||||
gtk_icon_view_select_path
|
||||
gtk_icon_view_unselect_path
|
||||
@@ -4455,6 +4458,8 @@ gtk_tree_view_get_headers_clickable
|
||||
gtk_tree_view_set_headers_clickable
|
||||
gtk_tree_view_set_rules_hint
|
||||
gtk_tree_view_get_rules_hint
|
||||
gtk_tree_view_set_activate_on_single_click
|
||||
gtk_tree_view_get_activate_on_single_click
|
||||
gtk_tree_view_append_column
|
||||
gtk_tree_view_remove_column
|
||||
gtk_tree_view_insert_column
|
||||
|
@@ -119,6 +119,46 @@
|
||||
make CFLAGS+="-DGSEAL_ENABLE"
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
While it may be painful to convert, this helps us keep API and ABI
|
||||
compatibility when we change internal interfaces. As a quick example,
|
||||
when adding GSEAL_ENABLE, if you see an error like:
|
||||
<programlisting>
|
||||
error: 'GtkToggleButton' has no member named 'active'
|
||||
</programlisting>
|
||||
this means that you are accessing the public structure of
|
||||
GtkToggleButton directly, perhaps with some code like:
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
on_toggled (GtkToggleButton *button)
|
||||
{
|
||||
if (button->active)
|
||||
frob_active ();
|
||||
else
|
||||
frob_inactive ();
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
In most cases, this can easily be replaced with the correct accessor
|
||||
method. The main rule is that if you have code like the above which
|
||||
accesses the "active" field of a "GtkToggleButton", then the accessor
|
||||
method becomes "gtk_toggle_button_get_active":
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
on_toggled (GtkToggleButton *button)
|
||||
{
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
frob_active ();
|
||||
else
|
||||
frob_inactive ();
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
In the case of setting field members directly, there's usually
|
||||
a corresponding setter method.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -1131,6 +1171,15 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
from GtkObject and makes use of the destroy functionality, you have
|
||||
to implement ::destroy yourself.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If your program used functions like gtk_object_get or gtk_object_set,
|
||||
these can be replaced directly with g_object_get or g_object_set. In
|
||||
fact, most every gtk_object_* function can be replaced with the
|
||||
corresponding g_object_ function, even in GTK+ 2 code. The one exception
|
||||
to this rule is gtk_object_destroy, which can be replaced with
|
||||
gtk_widget_destroy, again in both GTK+ 2 and GTK+ 3.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
@@ -126,7 +126,7 @@ variables like <envar>LANG</envar>, <envar>PATH</envar>, <envar>HOME</envar>
|
||||
or <envar>DISPLAY</envar>; mostly to determine paths to look for certain
|
||||
files. The <link linkend="x11-envar">X11</link>,
|
||||
<link linkend="win32-envar">Windows</link> and
|
||||
<link linkend="fb-envar">Framebuffer</link> GDK backends use some
|
||||
<link linkend="broadway-envar">Broadway</link> GDK backends use some
|
||||
additional environment variables.
|
||||
</para>
|
||||
|
||||
@@ -452,12 +452,12 @@ nevertheless.
|
||||
|
||||
<varlistentry>
|
||||
<term>broadway</term>
|
||||
<listitem><para>Selects the HTML5 backend.</para></listitem>
|
||||
<listitem><para>Selects the Broadway backend for display in web browsers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>wayland</term>
|
||||
<listitem><para>Selects the Wayland backend for connecting to Wayland display servers.</para></listitem>
|
||||
<listitem><para>Selects the Wayland backend for connecting to Wayland display servers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
@@ -465,15 +465,6 @@ nevertheless.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_SYNCHRONIZE</envar></title>
|
||||
|
||||
<para>
|
||||
If set, GDK makes all X requests synchronously. This is a useful
|
||||
option for debugging, but it will slow down the performance considerably.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>
|
||||
|
||||
|
@@ -56,6 +56,33 @@ in the <envar>DISPLAY</envar> environment variable.
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="x11-envar">
|
||||
<title>X11-specific environment variables</title>
|
||||
|
||||
<para>
|
||||
The X11 GDK backend can be influenced with some additional environment variables.
|
||||
</para>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_SYNCHRONIZE</envar></title>
|
||||
|
||||
<para>
|
||||
If set, GDK makes all X requests synchronously. This is a useful
|
||||
option for debugging, but it will slow down the performance considerably.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_CORE_DEVICE_EVENTS</envar></title>
|
||||
|
||||
<para>
|
||||
If set, GDK makes does not use the XInput extension, and only reacts
|
||||
to core X input events.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
</refsect2>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="gtk-X11-arch">
|
||||
|
@@ -1024,8 +1024,7 @@ create_scrolledwindow (void)
|
||||
scrolledwin = gtk_scrolled_window_new (NULL, NULL);
|
||||
label = gtk_label_new ("Scrolled Window");
|
||||
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolledwin),
|
||||
label);
|
||||
gtk_container_add (GTK_CONTAINER (scrolledwin), label);
|
||||
|
||||
return new_widget_info ("scrolledwindow", scrolledwin, MEDIUM);
|
||||
}
|
||||
|
@@ -61,3 +61,5 @@ noinst_PROGRAMS = \
|
||||
builder
|
||||
|
||||
EXTRA_DIST = builder.ui
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -75,11 +75,13 @@ gdk_public_h_sources = \
|
||||
gdkdisplaymanager.h \
|
||||
gdkdnd.h \
|
||||
gdkevents.h \
|
||||
gdkframetimings.h \
|
||||
gdkkeys.h \
|
||||
gdkkeysyms.h \
|
||||
gdkkeysyms-compat.h \
|
||||
gdkmain.h \
|
||||
gdkpango.h \
|
||||
gdkframeclock.h \
|
||||
gdkpixbuf.h \
|
||||
gdkprivate.h \
|
||||
gdkproperty.h \
|
||||
@@ -101,6 +103,8 @@ gdk_private_headers = \
|
||||
gdkdisplaymanagerprivate.h \
|
||||
gdkdisplayprivate.h \
|
||||
gdkdndprivate.h \
|
||||
gdkframeclockidle.h \
|
||||
gdkframeclockprivate.h \
|
||||
gdkscreenprivate.h \
|
||||
gdkinternals.h \
|
||||
gdkintl.h \
|
||||
@@ -121,10 +125,13 @@ gdk_c_sources = \
|
||||
gdkdisplaymanager.c \
|
||||
gdkdnd.c \
|
||||
gdkevents.c \
|
||||
gdkframetimings.c \
|
||||
gdkglobals.c \
|
||||
gdkkeys.c \
|
||||
gdkkeyuni.c \
|
||||
gdkoffscreenwindow.c \
|
||||
gdkframeclock.c \
|
||||
gdkframeclockidle.c \
|
||||
gdkpango.c \
|
||||
gdkpixbuf-drawable.c \
|
||||
gdkrectangle.c \
|
||||
@@ -204,7 +211,6 @@ INTROSPECTION_GIRS += Gdk-3.0.gir
|
||||
|
||||
if USE_X11
|
||||
x11_introspection_files = \
|
||||
x11/checksettings.c \
|
||||
x11/gdkapplaunchcontext-x11.c \
|
||||
x11/gdkasync.c \
|
||||
x11/gdkcursor-x11.c \
|
||||
|
@@ -15,7 +15,9 @@ AM_CPPFLAGS = \
|
||||
|
||||
LDADDS = $(GDK_DEP_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = libbroadway.la libgdk-broadway.la
|
||||
noinst_LTLIBRARIES = libgdk-broadway.la
|
||||
|
||||
bin_PROGRAMS = broadwayd
|
||||
|
||||
libgdkinclude_HEADERS = \
|
||||
gdkbroadway.h
|
||||
@@ -26,10 +28,6 @@ libgdkbroadwayinclude_HEADERS = \
|
||||
gdkbroadwaycursor.h \
|
||||
gdkbroadwayvisual.h
|
||||
|
||||
libbroadway_la_SOURCES = \
|
||||
broadway.h \
|
||||
broadway.c
|
||||
|
||||
clienthtml.h: client.html
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/client.html client_html > $@
|
||||
|
||||
@@ -73,9 +71,19 @@ libgdk_broadway_la_SOURCES = \
|
||||
gdkvisual-broadway.c \
|
||||
gdkwindow-broadway.c \
|
||||
gdkwindow-broadway.h \
|
||||
gdkprivate-broadway.h
|
||||
gdkprivate-broadway.h \
|
||||
gdkbroadway-server.h \
|
||||
gdkbroadway-server.c
|
||||
|
||||
libgdk_broadway_la_LIBADD = libbroadway.la
|
||||
broadwayd_SOURCES = \
|
||||
broadway-protocol.h \
|
||||
broadwayd.c \
|
||||
broadway-server.h \
|
||||
broadway-server.c \
|
||||
broadway-output.h \
|
||||
broadway-output.c
|
||||
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt
|
||||
|
||||
MAINTAINERCLEANFILES = $(broadway_built_sources)
|
||||
EXTRA_DIST += $(broadway_built_sources)
|
||||
|
11
gdk/broadway/TODO.broadway
Normal file
11
gdk/broadway/TODO.broadway
Normal file
@@ -0,0 +1,11 @@
|
||||
Cache surfaces that are opened via shm_open inbetween updates.
|
||||
Handle implicit grabs when in broadway-server.c
|
||||
keyboard focus handling
|
||||
Add resize handling to js WM
|
||||
Support window titles
|
||||
_gdk_broadway_server_has_client is always FALSE, so resize don't work
|
||||
Send reset events on client disconnect (button up, normal state. Maybe grab state reset?)
|
||||
rgba suport
|
||||
shift-select in gedit doesn't work
|
||||
backdrop mode
|
||||
clean up /dev/shm on abrupt client exit
|
@@ -5,7 +5,7 @@
|
||||
#include <errno.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#include "broadway.h"
|
||||
#include "broadway-output.h"
|
||||
|
||||
/************************************************************************
|
||||
* Base64 functions *
|
||||
@@ -351,12 +351,12 @@ static void
|
||||
append_uint16 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
guint8 *buf;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 2);
|
||||
buf = (guint8 *)output->buf->str + old_len;
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
}
|
||||
@@ -371,12 +371,12 @@ static void
|
||||
append_uint32 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
guint8 *buf;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 4);
|
||||
buf = (guint8 *)output->buf->str + old_len;
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
buf[2] = (v >> 16) & 0xff;
|
||||
@@ -422,7 +422,7 @@ broadway_output_copy_rectangles (BroadwayOutput *output, int id,
|
||||
{
|
||||
int i;
|
||||
|
||||
write_header (output, 'b');
|
||||
write_header (output, BROADWAY_OP_COPY_RECTANGLES);
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
@@ -441,7 +441,7 @@ broadway_output_grab_pointer (BroadwayOutput *output,
|
||||
int id,
|
||||
gboolean owner_event)
|
||||
{
|
||||
write_header (output, 'g');
|
||||
write_header (output, BROADWAY_OP_GRAB_POINTER);
|
||||
append_uint16 (output, id);
|
||||
append_bool (output, owner_event);
|
||||
}
|
||||
@@ -452,7 +452,7 @@ broadway_output_ungrab_pointer (BroadwayOutput *output)
|
||||
guint32 serial;
|
||||
|
||||
serial = output->serial;
|
||||
write_header (output, 'u');
|
||||
write_header (output, BROADWAY_OP_UNGRAB_POINTER);
|
||||
|
||||
return serial;
|
||||
}
|
||||
@@ -462,7 +462,7 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
int id, int x, int y, int w, int h,
|
||||
gboolean is_temp)
|
||||
{
|
||||
write_header (output, 's');
|
||||
write_header (output, BROADWAY_OP_NEW_SURFACE);
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
@@ -474,21 +474,21 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
void
|
||||
broadway_output_show_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'S');
|
||||
write_header (output, BROADWAY_OP_SHOW_SURFACE);
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_hide_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'H');
|
||||
write_header (output, BROADWAY_OP_HIDE_SURFACE);
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_destroy_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
write_header (output, 'd');
|
||||
write_header (output, BROADWAY_OP_DESTROY_SURFACE);
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ broadway_output_move_resize_surface (BroadwayOutput *output,
|
||||
if (!has_pos && !has_size)
|
||||
return;
|
||||
|
||||
write_header (output, 'm');
|
||||
write_header (output, BROADWAY_OP_MOVE_RESIZE);
|
||||
val = (!!has_pos) | ((!!has_size) << 1);
|
||||
append_uint16 (output, id);
|
||||
append_flags (output, val);
|
||||
@@ -529,7 +529,7 @@ broadway_output_set_transient_for (BroadwayOutput *output,
|
||||
int id,
|
||||
int parent_id)
|
||||
{
|
||||
write_header (output, 'p');
|
||||
write_header (output, BROADWAY_OP_SET_TRANSIENT_FOR);
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, parent_id);
|
||||
}
|
||||
@@ -541,7 +541,7 @@ broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y,
|
||||
{
|
||||
gsize size_start, image_start, len;
|
||||
|
||||
write_header (output, 'i');
|
||||
write_header (output, BROADWAY_OP_PUT_RGB);
|
||||
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
@@ -798,7 +798,7 @@ broadway_output_put_rgba (BroadwayOutput *output, int id, int x, int y,
|
||||
{
|
||||
guint8 *subdata;
|
||||
|
||||
write_header (output, 'i');
|
||||
write_header (output, BROADWAY_OP_PUT_RGB);
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x + rects[i].x1);
|
||||
append_uint16 (output, y + rects[i].y1);
|
||||
@@ -830,6 +830,6 @@ void
|
||||
broadway_output_surface_flush (BroadwayOutput *output,
|
||||
int id)
|
||||
{
|
||||
write_header (output, 'f');
|
||||
write_header (output, BROADWAY_OP_FLUSH);
|
||||
append_uint16 (output, id);
|
||||
}
|
@@ -1,13 +1,12 @@
|
||||
#ifndef __BROADWAY_H__
|
||||
#define __BROADWAY_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gio/gio.h>
|
||||
#include "broadway-protocol.h"
|
||||
|
||||
typedef struct BroadwayOutput BroadwayOutput;
|
||||
|
||||
typedef struct {
|
||||
int x, y;
|
||||
int width, height;
|
||||
} BroadwayRect;
|
||||
|
||||
typedef enum {
|
||||
BROADWAY_WS_CONTINUATION = 0,
|
||||
BROADWAY_WS_TEXT = 1,
|
||||
@@ -78,3 +77,5 @@ void broadway_output_grab_pointer (BroadwayOutput *output,
|
||||
gboolean owner_event);
|
||||
guint32 broadway_output_ungrab_pointer (BroadwayOutput *output);
|
||||
void broadway_output_pong (BroadwayOutput *output);
|
||||
|
||||
#endif /* __BROADWAY_H__ */
|
264
gdk/broadway/broadway-protocol.h
Normal file
264
gdk/broadway/broadway-protocol.h
Normal file
@@ -0,0 +1,264 @@
|
||||
#ifndef __BROADWAY_PROTOCOL_H__
|
||||
#define __BROADWAY_PROTOCOL_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
typedef struct {
|
||||
gint32 x, y;
|
||||
gint32 width, height;
|
||||
} BroadwayRect;
|
||||
|
||||
typedef enum {
|
||||
BROADWAY_EVENT_ENTER = 'e',
|
||||
BROADWAY_EVENT_LEAVE = 'l',
|
||||
BROADWAY_EVENT_POINTER_MOVE = 'm',
|
||||
BROADWAY_EVENT_BUTTON_PRESS = 'b',
|
||||
BROADWAY_EVENT_BUTTON_RELEASE = 'B',
|
||||
BROADWAY_EVENT_SCROLL = 's',
|
||||
BROADWAY_EVENT_KEY_PRESS = 'k',
|
||||
BROADWAY_EVENT_KEY_RELEASE = 'K',
|
||||
BROADWAY_EVENT_GRAB_NOTIFY = 'g',
|
||||
BROADWAY_EVENT_UNGRAB_NOTIFY = 'u',
|
||||
BROADWAY_EVENT_CONFIGURE_NOTIFY = 'w',
|
||||
BROADWAY_EVENT_DELETE_NOTIFY = 'W',
|
||||
BROADWAY_EVENT_SCREEN_SIZE_CHANGED = 'd'
|
||||
} BroadwayEventType;
|
||||
|
||||
typedef enum {
|
||||
BROADWAY_OP_COPY_RECTANGLES = 'b',
|
||||
BROADWAY_OP_GRAB_POINTER = 'g',
|
||||
BROADWAY_OP_UNGRAB_POINTER = 'u',
|
||||
BROADWAY_OP_NEW_SURFACE = 's',
|
||||
BROADWAY_OP_SHOW_SURFACE = 'S',
|
||||
BROADWAY_OP_HIDE_SURFACE = 'H',
|
||||
BROADWAY_OP_DESTROY_SURFACE = 'd',
|
||||
BROADWAY_OP_MOVE_RESIZE = 'm',
|
||||
BROADWAY_OP_SET_TRANSIENT_FOR = 'p',
|
||||
BROADWAY_OP_PUT_RGB = 'i',
|
||||
BROADWAY_OP_FLUSH = 'f',
|
||||
} BroadwayOpType;
|
||||
|
||||
typedef struct {
|
||||
guint32 type;
|
||||
guint32 serial;
|
||||
guint64 time;
|
||||
} BroadwayInputBaseMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
guint32 mouse_window_id; /* The real window, not taking grabs into account */
|
||||
guint32 event_window_id;
|
||||
gint32 root_x;
|
||||
gint32 root_y;
|
||||
gint32 win_x;
|
||||
gint32 win_y;
|
||||
guint32 state;
|
||||
} BroadwayInputPointerMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
guint32 mode;
|
||||
} BroadwayInputCrossingMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
guint32 button;
|
||||
} BroadwayInputButtonMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
gint32 dir;
|
||||
} BroadwayInputScrollMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
guint32 mouse_window_id; /* The real window, not taking grabs into account */
|
||||
guint32 state;
|
||||
gint32 key;
|
||||
} BroadwayInputKeyMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
gint32 res;
|
||||
} BroadwayInputGrabReply;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
gint32 id;
|
||||
gint32 x;
|
||||
gint32 y;
|
||||
gint32 width;
|
||||
gint32 height;
|
||||
} BroadwayInputConfigureNotify;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
} BroadwayInputScreenResizeNotify;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
gint32 id;
|
||||
} BroadwayInputDeleteNotify;
|
||||
|
||||
typedef union {
|
||||
BroadwayInputBaseMsg base;
|
||||
BroadwayInputPointerMsg pointer;
|
||||
BroadwayInputCrossingMsg crossing;
|
||||
BroadwayInputButtonMsg button;
|
||||
BroadwayInputScrollMsg scroll;
|
||||
BroadwayInputKeyMsg key;
|
||||
BroadwayInputGrabReply grab_reply;
|
||||
BroadwayInputConfigureNotify configure_notify;
|
||||
BroadwayInputDeleteNotify delete_notify;
|
||||
BroadwayInputScreenResizeNotify screen_resize_notify;
|
||||
} BroadwayInputMsg;
|
||||
|
||||
typedef enum {
|
||||
BROADWAY_REQUEST_NEW_WINDOW,
|
||||
BROADWAY_REQUEST_FLUSH,
|
||||
BROADWAY_REQUEST_SYNC,
|
||||
BROADWAY_REQUEST_QUERY_MOUSE,
|
||||
BROADWAY_REQUEST_DESTROY_WINDOW,
|
||||
BROADWAY_REQUEST_SHOW_WINDOW,
|
||||
BROADWAY_REQUEST_HIDE_WINDOW,
|
||||
BROADWAY_REQUEST_SET_TRANSIENT_FOR,
|
||||
BROADWAY_REQUEST_TRANSLATE,
|
||||
BROADWAY_REQUEST_UPDATE,
|
||||
BROADWAY_REQUEST_MOVE_RESIZE,
|
||||
BROADWAY_REQUEST_GRAB_POINTER,
|
||||
BROADWAY_REQUEST_UNGRAB_POINTER
|
||||
} BroadwayRequestType;
|
||||
|
||||
typedef struct {
|
||||
guint32 size;
|
||||
guint32 serial;
|
||||
guint32 type;
|
||||
} BroadwayRequestBase, BroadwayRequestFlush, BroadwayRequestSync, BroadwayRequestQueryMouse;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
} BroadwayRequestDestroyWindow, BroadwayRequestShowWindow, BroadwayRequestHideWindow;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
guint32 parent;
|
||||
} BroadwayRequestSetTransientFor;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
gint32 dx;
|
||||
gint32 dy;
|
||||
guint32 n_rects;
|
||||
BroadwayRect rects[1];
|
||||
} BroadwayRequestTranslate;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
char name[34];
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
} BroadwayRequestUpdate;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
guint32 owner_events;
|
||||
guint32 event_mask;
|
||||
guint32 time_;
|
||||
} BroadwayRequestGrabPointer;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 time_;
|
||||
} BroadwayRequestUngrabPointer;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
gint32 x;
|
||||
gint32 y;
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
guint32 is_temp;
|
||||
} BroadwayRequestNewWindow;
|
||||
|
||||
typedef struct {
|
||||
BroadwayRequestBase base;
|
||||
guint32 id;
|
||||
guint32 with_move;
|
||||
gint32 x;
|
||||
gint32 y;
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
} BroadwayRequestMoveResize;
|
||||
|
||||
typedef union {
|
||||
BroadwayRequestBase base;
|
||||
BroadwayRequestNewWindow new_window;
|
||||
BroadwayRequestFlush flush;
|
||||
BroadwayRequestSync sync;
|
||||
BroadwayRequestQueryMouse query_mouse;
|
||||
BroadwayRequestDestroyWindow destroy_window;
|
||||
BroadwayRequestShowWindow show_window;
|
||||
BroadwayRequestHideWindow hide_window;
|
||||
BroadwayRequestSetTransientFor set_transient_for;
|
||||
BroadwayRequestUpdate update;
|
||||
BroadwayRequestMoveResize move_resize;
|
||||
BroadwayRequestGrabPointer grab_pointer;
|
||||
BroadwayRequestUngrabPointer ungrab_pointer;
|
||||
BroadwayRequestTranslate translate;
|
||||
} BroadwayRequest;
|
||||
|
||||
typedef enum {
|
||||
BROADWAY_REPLY_EVENT,
|
||||
BROADWAY_REPLY_SYNC,
|
||||
BROADWAY_REPLY_QUERY_MOUSE,
|
||||
BROADWAY_REPLY_NEW_WINDOW,
|
||||
BROADWAY_REPLY_GRAB_POINTER,
|
||||
BROADWAY_REPLY_UNGRAB_POINTER
|
||||
} BroadwayReplyType;
|
||||
|
||||
typedef struct {
|
||||
guint32 size;
|
||||
guint32 in_reply_to;
|
||||
guint32 type;
|
||||
} BroadwayReplyBase, BroadwayReplySync;
|
||||
|
||||
typedef struct {
|
||||
BroadwayReplyBase base;
|
||||
guint32 id;
|
||||
} BroadwayReplyNewWindow;
|
||||
|
||||
typedef struct {
|
||||
BroadwayReplyBase base;
|
||||
guint32 status;
|
||||
} BroadwayReplyGrabPointer, BroadwayReplyUngrabPointer;
|
||||
|
||||
typedef struct {
|
||||
BroadwayReplyBase base;
|
||||
guint32 toplevel;
|
||||
gint32 root_x;
|
||||
gint32 root_y;
|
||||
guint32 mask;
|
||||
} BroadwayReplyQueryMouse;
|
||||
|
||||
typedef struct {
|
||||
BroadwayReplyBase base;
|
||||
BroadwayInputMsg msg;
|
||||
} BroadwayReplyEvent;
|
||||
|
||||
typedef union {
|
||||
BroadwayReplyBase base;
|
||||
BroadwayReplyEvent event;
|
||||
BroadwayReplyQueryMouse query_mouse;
|
||||
BroadwayReplyNewWindow new_window;
|
||||
BroadwayReplyGrabPointer grab_pointer;
|
||||
BroadwayReplyUngrabPointer ungrab_pointer;
|
||||
} BroadwayReply;
|
||||
|
||||
#endif /* __BROADWAY_PROTOCOL_H__ */
|
1840
gdk/broadway/broadway-server.c
Normal file
1840
gdk/broadway/broadway-server.c
Normal file
File diff suppressed because it is too large
Load Diff
82
gdk/broadway/broadway-server.h
Normal file
82
gdk/broadway/broadway-server.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef __BROADWAY_SERVER__
|
||||
#define __BROADWAY_SERVER__
|
||||
|
||||
#include "broadway-protocol.h"
|
||||
#include <glib-object.h>
|
||||
#include <cairo.h>
|
||||
|
||||
void broadway_events_got_input (BroadwayInputMsg *message,
|
||||
gint32 client_id);
|
||||
|
||||
typedef struct _BroadwayServer BroadwayServer;
|
||||
typedef struct _BroadwayServerClass BroadwayServerClass;
|
||||
|
||||
#define BROADWAY_TYPE_SERVER (broadway_server_get_type())
|
||||
#define BROADWAY_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BROADWAY_TYPE_SERVER, BroadwayServer))
|
||||
#define BROADWAY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BROADWAY_TYPE_SERVER, BroadwayServerClass))
|
||||
#define BROADWAY_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BROADWAY_TYPE_SERVER))
|
||||
#define BROADWAY_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BROADWAY_TYPE_SERVER))
|
||||
#define BROADWAY_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BROADWAY_TYPE_SERVER, BroadwayServerClass))
|
||||
|
||||
|
||||
BroadwayServer *broadway_server_new (char *address,
|
||||
int port,
|
||||
GError **error);
|
||||
gboolean broadway_server_has_client (BroadwayServer *server);
|
||||
void broadway_server_flush (BroadwayServer *server);
|
||||
void broadway_server_sync (BroadwayServer *server);
|
||||
void broadway_server_get_screen_size (BroadwayServer *server,
|
||||
guint32 *width,
|
||||
guint32 *height);
|
||||
guint32 broadway_server_get_next_serial (BroadwayServer *server);
|
||||
guint32 broadway_server_get_last_seen_time (BroadwayServer *server);
|
||||
gboolean broadway_server_lookahead_event (BroadwayServer *server,
|
||||
const char *types);
|
||||
void broadway_server_query_mouse (BroadwayServer *server,
|
||||
guint32 *toplevel,
|
||||
gint32 *root_x,
|
||||
gint32 *root_y,
|
||||
guint32 *mask);
|
||||
guint32 broadway_server_grab_pointer (BroadwayServer *server,
|
||||
gint client_id,
|
||||
gint id,
|
||||
gboolean owner_events,
|
||||
guint32 event_mask,
|
||||
guint32 time_);
|
||||
guint32 broadway_server_ungrab_pointer (BroadwayServer *server,
|
||||
guint32 time_);
|
||||
gint32 broadway_server_get_mouse_toplevel (BroadwayServer *server);
|
||||
guint32 broadway_server_new_window (BroadwayServer *server,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
gboolean is_temp);
|
||||
void broadway_server_destroy_window (BroadwayServer *server,
|
||||
gint id);
|
||||
gboolean broadway_server_window_show (BroadwayServer *server,
|
||||
gint id);
|
||||
gboolean broadway_server_window_hide (BroadwayServer *server,
|
||||
gint id);
|
||||
void broadway_server_window_set_transient_for (BroadwayServer *server,
|
||||
gint id,
|
||||
gint parent);
|
||||
gboolean broadway_server_window_translate (BroadwayServer *server,
|
||||
gint id,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
cairo_surface_t * broadway_server_create_surface (int width,
|
||||
int height);
|
||||
void broadway_server_window_update (BroadwayServer *server,
|
||||
gint id,
|
||||
cairo_surface_t *surface);
|
||||
gboolean broadway_server_window_move_resize (BroadwayServer *server,
|
||||
gint id,
|
||||
gboolean with_move,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
#endif /* __BROADWAY_SERVER__ */
|
@@ -132,18 +132,6 @@ function createXHR()
|
||||
return null;
|
||||
}
|
||||
|
||||
/* This resizes the window so the *inner* size is the specified size */
|
||||
function resizeBrowserWindow(window, w, h) {
|
||||
var innerW = window.innerWidth;
|
||||
var innerH = window.innerHeight;
|
||||
|
||||
var outerW = window.outerWidth;
|
||||
var outerH = window.outerHeight;
|
||||
|
||||
window.resizeTo(w + outerW - innerW,
|
||||
h + outerH - innerH);
|
||||
}
|
||||
|
||||
function resizeCanvas(canvas, w, h)
|
||||
{
|
||||
/* Canvas resize clears the data, so we need to save it first */
|
||||
@@ -163,8 +151,6 @@ function resizeCanvas(canvas, w, h)
|
||||
context.drawImage(tmpCanvas, 0, 0, tmpCanvas.width, tmpCanvas.height);
|
||||
}
|
||||
|
||||
var useToplevelWindows = false;
|
||||
var toplevelWindows = [];
|
||||
var grab = new Object();
|
||||
grab.window = null;
|
||||
grab.ownerEvents = false;
|
||||
@@ -276,121 +262,11 @@ function flushSurface(surface)
|
||||
}
|
||||
}
|
||||
|
||||
function ensureSurfaceInDocument(surface, doc)
|
||||
{
|
||||
if (surface.document != doc) {
|
||||
var oldCanvas = surface.canvas;
|
||||
var canvas = doc.importNode(oldCanvas, false);
|
||||
doc.body.appendChild(canvas);
|
||||
canvas.surface = surface;
|
||||
oldCanvas.parentNode.removeChild(oldCanvas);
|
||||
|
||||
surface.canvas = canvas;
|
||||
if (surface.toplevelElement == oldCanvas)
|
||||
surface.toplevelElement = canvas;
|
||||
surface.document = doc;
|
||||
}
|
||||
}
|
||||
|
||||
function sendConfigureNotify(surface)
|
||||
{
|
||||
sendInput("w", [surface.id, surface.x, surface.y, surface.width, surface.height]);
|
||||
}
|
||||
|
||||
var windowGeometryTimeout = null;
|
||||
|
||||
function updateBrowserWindowGeometry(win, alwaysSendConfigure) {
|
||||
if (win.closed)
|
||||
return;
|
||||
|
||||
var surface = win.surface;
|
||||
|
||||
var innerW = win.innerWidth;
|
||||
var innerH = win.innerHeight;
|
||||
|
||||
var x = surface.x;
|
||||
var y = surface.y;
|
||||
|
||||
if (win.mozInnerScreenX != undefined) {
|
||||
x = win.mozInnerScreenX;
|
||||
y = win.mozInnerScreenY;
|
||||
} else if (win.screenTop != undefined) {
|
||||
x = win.screenTop;
|
||||
y = win.screenLeft;
|
||||
} else {
|
||||
alert("No implementation to get window position");
|
||||
}
|
||||
|
||||
if (alwaysSendConfigure || x != surface.x || y != surface.y ||
|
||||
innerW != surface.width || innerH != surface.height) {
|
||||
var oldX = surface.x;
|
||||
var oldY = surface.y;
|
||||
surface.x = x;
|
||||
surface.y = y;
|
||||
if (surface.width != innerW || surface.height != innerH)
|
||||
resizeCanvas(surface.canvas, innerW, innerH);
|
||||
surface.width = innerW;
|
||||
surface.height = innerH;
|
||||
sendConfigureNotify(surface);
|
||||
for (id in surfaces) {
|
||||
var childSurface = surfaces[id];
|
||||
var transientToplevel = getTransientToplevel(childSurface);
|
||||
if (transientToplevel != null && transientToplevel == surface) {
|
||||
childSurface.x += surface.x - oldX;
|
||||
childSurface.y += surface.y - oldY;
|
||||
sendConfigureNotify(childSurface);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function browserWindowClosed(win) {
|
||||
var surface = win.surface;
|
||||
|
||||
sendInput ("W", [surface.id]);
|
||||
for (id in surfaces) {
|
||||
var childSurface = surfaces[id];
|
||||
var transientToplevel = getTransientToplevel(childSurface);
|
||||
if (transientToplevel != null && transientToplevel == surface) {
|
||||
sendInput ("W", [childSurface.id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function registerWindow(win)
|
||||
{
|
||||
toplevelWindows.push(win);
|
||||
win.onresize = function(ev) { updateBrowserWindowGeometry(ev.target, false); };
|
||||
if (!windowGeometryTimeout)
|
||||
windowGeometryTimeout = setInterval(function () {
|
||||
for (var i = 0; i < toplevelWindows.length; i++)
|
||||
updateBrowserWindowGeometry(toplevelWindows[i], false);
|
||||
}, 2000);
|
||||
win.onunload = function(ev) { browserWindowClosed(ev.target.defaultView); };
|
||||
}
|
||||
|
||||
function unregisterWindow(win)
|
||||
{
|
||||
var i = toplevelWindows.indexOf(win);
|
||||
if (i >= 0)
|
||||
toplevelWindows.splice(i, 1);
|
||||
|
||||
if (windowGeometryTimeout && toplevelWindows.length == 0) {
|
||||
clearInterval(windowGeometryTimeout);
|
||||
windowGeometryTimeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
function getTransientToplevel(surface)
|
||||
{
|
||||
while (surface && surface.transientParent != 0) {
|
||||
surface = surfaces[surface.transientParent];
|
||||
if (surface && surface.window)
|
||||
return surface;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getStyle(el, styleProp)
|
||||
{
|
||||
if (el.currentStyle) {
|
||||
@@ -440,8 +316,6 @@ function cmdCreateSurface(id, x, y, width, height, isTemp)
|
||||
surface.drawQueue = [];
|
||||
surface.transientParent = 0;
|
||||
surface.visible = false;
|
||||
surface.window = null;
|
||||
surface.document = document;
|
||||
surface.frame = null;
|
||||
|
||||
var canvas = document.createElement("canvas");
|
||||
@@ -451,7 +325,7 @@ function cmdCreateSurface(id, x, y, width, height, isTemp)
|
||||
surface.canvas = canvas;
|
||||
var toplevelElement;
|
||||
|
||||
if (useToplevelWindows || isTemp) {
|
||||
if (isTemp) {
|
||||
toplevelElement = canvas;
|
||||
document.body.appendChild(canvas);
|
||||
} else {
|
||||
@@ -476,10 +350,6 @@ function cmdCreateSurface(id, x, y, width, height, isTemp)
|
||||
|
||||
toplevelElement = frame;
|
||||
document.body.appendChild(frame);
|
||||
|
||||
surface.x = 100 + positionIndex * 10;
|
||||
surface.y = 100 + positionIndex * 10;
|
||||
positionIndex = (positionIndex + 1) % 20;
|
||||
}
|
||||
|
||||
surface.toplevelElement = toplevelElement;
|
||||
@@ -511,42 +381,10 @@ function cmdShowSurface(id)
|
||||
var xOffset = surface.x;
|
||||
var yOffset = surface.y;
|
||||
|
||||
if (useToplevelWindows) {
|
||||
var doc = document;
|
||||
if (!surface.isTemp) {
|
||||
var options =
|
||||
'width='+surface.width+',height='+surface.height+
|
||||
',location=no,menubar=no,scrollbars=no,toolbar=no';
|
||||
if (surface.positioned)
|
||||
options = options +
|
||||
',left='+surface.x+',top='+surface.y+',screenX='+surface.x+',screenY='+surface.y;
|
||||
var win = window.open('','_blank', options);
|
||||
win.surface = surface;
|
||||
registerWindow(win);
|
||||
doc = win.document;
|
||||
doc.open();
|
||||
doc.write("<body></body>");
|
||||
setupDocument(doc);
|
||||
|
||||
surface.window = win;
|
||||
xOffset = 0;
|
||||
yOffset = 0;
|
||||
} else {
|
||||
var transientToplevel = getTransientToplevel(surface);
|
||||
if (transientToplevel) {
|
||||
doc = transientToplevel.window.document;
|
||||
xOffset = surface.x - transientToplevel.x;
|
||||
yOffset = surface.y - transientToplevel.y;
|
||||
}
|
||||
}
|
||||
|
||||
ensureSurfaceInDocument(surface, doc);
|
||||
} else {
|
||||
if (surface.frame) {
|
||||
var offset = getFrameOffset(surface);
|
||||
xOffset -= offset.x;
|
||||
yOffset -= offset.y;
|
||||
}
|
||||
if (surface.frame) {
|
||||
var offset = getFrameOffset(surface);
|
||||
xOffset -= offset.x;
|
||||
yOffset -= offset.y;
|
||||
}
|
||||
|
||||
surface.toplevelElement.style["left"] = xOffset + "px";
|
||||
@@ -554,9 +392,6 @@ function cmdShowSurface(id)
|
||||
surface.toplevelElement.style["visibility"] = "visible";
|
||||
|
||||
restackWindows();
|
||||
|
||||
if (surface.window)
|
||||
updateBrowserWindowGeometry(surface.window, false);
|
||||
}
|
||||
|
||||
function cmdHideSurface(id)
|
||||
@@ -573,15 +408,6 @@ function cmdHideSurface(id)
|
||||
var element = surface.toplevelElement;
|
||||
|
||||
element.style["visibility"] = "hidden";
|
||||
|
||||
// Import the canvas into the main document
|
||||
ensureSurfaceInDocument(surface, document);
|
||||
|
||||
if (surface.window) {
|
||||
unregisterWindow(surface.window);
|
||||
surface.window.close();
|
||||
surface.window = null;
|
||||
}
|
||||
}
|
||||
|
||||
function cmdSetTransientFor(id, parentId)
|
||||
@@ -666,45 +492,30 @@ function cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h)
|
||||
resizeCanvas(surface.canvas, w, h);
|
||||
|
||||
if (surface.visible) {
|
||||
if (surface.window) {
|
||||
/* TODO: This moves the outer frame position, we really want the inner position.
|
||||
* However this isn't *strictly* invalid, as any WM could have done whatever it
|
||||
* wanted with the positioning of the window.
|
||||
*/
|
||||
if (has_pos)
|
||||
surface.window.moveTo(surface.x, surface.y);
|
||||
if (has_size)
|
||||
resizeBrowserWindow(surface.window, w, h);
|
||||
} else {
|
||||
if (has_pos) {
|
||||
var xOffset = surface.x;
|
||||
var yOffset = surface.y;
|
||||
if (has_pos) {
|
||||
var xOffset = surface.x;
|
||||
var yOffset = surface.y;
|
||||
|
||||
var transientToplevel = getTransientToplevel(surface);
|
||||
if (transientToplevel) {
|
||||
xOffset = surface.x - transientToplevel.x;
|
||||
yOffset = surface.y - transientToplevel.y;
|
||||
}
|
||||
|
||||
var element = surface.canvas;
|
||||
if (surface.frame) {
|
||||
element = surface.frame;
|
||||
var offset = getFrameOffset(surface);
|
||||
xOffset -= offset.x;
|
||||
yOffset -= offset.y;
|
||||
}
|
||||
|
||||
element.style["left"] = xOffset + "px";
|
||||
element.style["top"] = yOffset + "px";
|
||||
var transientToplevel = getTransientToplevel(surface);
|
||||
if (transientToplevel) {
|
||||
xOffset = surface.x - transientToplevel.x;
|
||||
yOffset = surface.y - transientToplevel.y;
|
||||
}
|
||||
|
||||
var element = surface.canvas;
|
||||
if (surface.frame) {
|
||||
element = surface.frame;
|
||||
var offset = getFrameOffset(surface);
|
||||
xOffset -= offset.x;
|
||||
yOffset -= offset.y;
|
||||
}
|
||||
|
||||
element.style["left"] = xOffset + "px";
|
||||
element.style["top"] = yOffset + "px";
|
||||
}
|
||||
}
|
||||
|
||||
if (surface.window) {
|
||||
updateBrowserWindowGeometry(surface.window, true);
|
||||
} else {
|
||||
sendConfigureNotify(surface);
|
||||
}
|
||||
sendConfigureNotify(surface);
|
||||
}
|
||||
|
||||
function cmdFlushSurface(id)
|
||||
@@ -985,13 +796,8 @@ function getPositionsFromAbsCoord(absX, absY, relativeId) {
|
||||
|
||||
function getPositionsFromEvent(ev, relativeId) {
|
||||
var absX, absY;
|
||||
if (useToplevelWindows) {
|
||||
absX = ev.screenX;
|
||||
absY = ev.screenY;
|
||||
} else {
|
||||
absX = ev.pageX;
|
||||
absY = ev.pageY;
|
||||
}
|
||||
absX = ev.pageX;
|
||||
absY = ev.pageY;
|
||||
var res = getPositionsFromAbsCoord(absX, absY, relativeId);
|
||||
|
||||
lastX = res.rootX;
|
||||
@@ -1020,10 +826,6 @@ function updateForEvent(ev) {
|
||||
lastState |= GDK_MOD1_MASK;
|
||||
|
||||
lastTimeStamp = ev.timeStamp;
|
||||
if (ev.target.surface && ev.target.surface.window) {
|
||||
var win = ev.target.surface.window;
|
||||
updateBrowserWindowGeometry(win, false);
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseMove (ev) {
|
||||
@@ -1036,6 +838,8 @@ function onMouseMove (ev) {
|
||||
surface.x += dx;
|
||||
surface.y += dy;
|
||||
var offset = getFrameOffset(surface);
|
||||
if (surface.y < offset.y)
|
||||
surface.y = offset.y;
|
||||
localGrab.frame.style["left"] = (surface.x - offset.x) + "px";
|
||||
localGrab.frame.style["top"] = (surface.y - offset.y) + "px";
|
||||
sendConfigureNotify(surface);
|
||||
@@ -1141,7 +945,7 @@ function onMouseDown (ev) {
|
||||
localGrab.lastX = ev.pageX;
|
||||
localGrab.lastY = ev.pageY;
|
||||
moveToTop(localGrab.frame.frameFor);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (id == 0 && ev.target.closeFor) { /* mouse click on frame */
|
||||
@@ -1153,13 +957,14 @@ function onMouseDown (ev) {
|
||||
localGrab.button = ev.target;
|
||||
localGrab.lastX = ev.pageX;
|
||||
localGrab.lastY = ev.pageY;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var pos = getPositionsFromEvent(ev, id);
|
||||
if (grab.window == null)
|
||||
doGrab (id, false, true);
|
||||
sendInput ("b", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMouseUp (ev) {
|
||||
@@ -1189,13 +994,15 @@ function onMouseUp (ev) {
|
||||
sendInput ("W", [localGrab.surface.id]);
|
||||
}
|
||||
localGrab = null;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
sendInput ("B", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
|
||||
|
||||
if (grab.window != null && grab.implicit)
|
||||
doUngrab();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Some of the keyboard handling code is from noVNC and
|
||||
@@ -2671,7 +2478,7 @@ function handleKeyDown(e) {
|
||||
// browser behaviors or it has no corresponding keyPress
|
||||
// event, then send it immediately
|
||||
if (!ignoreKeyEvent(ev))
|
||||
sendInput("k", [keysym, lastState]);
|
||||
sendInput("k", [realWindowWithMouse, keysym, lastState]);
|
||||
suppress = true;
|
||||
}
|
||||
|
||||
@@ -2716,7 +2523,7 @@ function handleKeyPress(e) {
|
||||
|
||||
// Send the translated keysym
|
||||
if (keysym > 0)
|
||||
sendInput ("k", [keysym, lastState]);
|
||||
sendInput ("k", [realWindowWithMouse, keysym, lastState]);
|
||||
|
||||
// Stop keypress events just in case
|
||||
return cancelEvent(ev);
|
||||
@@ -2735,7 +2542,7 @@ function handleKeyUp(e) {
|
||||
}
|
||||
|
||||
if (keysym > 0)
|
||||
sendInput ("K", [keysym, lastState]);
|
||||
sendInput ("K", [realWindowWithMouse, keysym, lastState]);
|
||||
return cancelEvent(ev);
|
||||
}
|
||||
|
||||
@@ -2830,8 +2637,6 @@ function connect()
|
||||
var query_string = url.split("?");
|
||||
if (query_string.length > 1) {
|
||||
var params = query_string[1].split("&");
|
||||
if (params[0].indexOf("toplevel") != -1)
|
||||
useToplevelWindows = true;
|
||||
}
|
||||
|
||||
var loc = window.location.toString().replace("http:", "ws:");
|
||||
@@ -2848,19 +2653,14 @@ function connect()
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
if (useToplevelWindows) {
|
||||
w = window.screen.width;
|
||||
h = window.screen.height;
|
||||
} else {
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
}
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
@@ -2871,8 +2671,4 @@ function connect()
|
||||
};
|
||||
|
||||
setupDocument(document);
|
||||
window.onunload = function (ev) {
|
||||
for (var i = 0; i < toplevelWindows.length; i++)
|
||||
toplevelWindows[i].close();
|
||||
};
|
||||
}
|
||||
|
636
gdk/broadway/broadwayd.c
Normal file
636
gdk/broadway/broadwayd.c
Normal file
@@ -0,0 +1,636 @@
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gio/gio.h>
|
||||
#include <gio/gunixsocketaddress.h>
|
||||
|
||||
#include "broadway-server.h"
|
||||
|
||||
BroadwayServer *server;
|
||||
GList *clients;
|
||||
|
||||
static guint32 client_id_count = 1;
|
||||
|
||||
/* Serials:
|
||||
*
|
||||
* Broadway tracks serials for all clients primarily to get the right behaviour wrt
|
||||
* grabs. Each request the client sends gets an increasing per-client serial number, starting
|
||||
* at 1. Thus, the client can now when a mouse event is seen whether the mouse event was
|
||||
* sent before or after the server saw the grab request from the client (as this affects how
|
||||
* the event is handled).
|
||||
*
|
||||
* There is only a single stream of increasing serials sent from the daemon to the web browser
|
||||
* though, called "daemon serials", so we need to map back from the daemon serials to the client
|
||||
* serials when we send an event to a client. So, each client keeps track of the mappings
|
||||
* between its serials and daemon serials for any outstanding requests.
|
||||
*
|
||||
* There is some additional complexity in that there may be multiple consecutive web browser
|
||||
* sessions, so we need to keep track of the last daemon serial used inbetween each web client
|
||||
* connection so that the daemon serials can be strictly increasing.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
guint32 client_serial;
|
||||
guint32 daemon_serial;
|
||||
} BroadwaySerialMapping;
|
||||
|
||||
typedef struct {
|
||||
guint32 id;
|
||||
GSocketConnection *connection;
|
||||
GBufferedInputStream *in;
|
||||
GSList *serial_mappings;
|
||||
GList *windows;
|
||||
guint disconnect_idle;
|
||||
} BroadwayClient;
|
||||
|
||||
static void
|
||||
client_free (BroadwayClient *client)
|
||||
{
|
||||
g_assert (client->windows == NULL);
|
||||
g_assert (client->disconnect_idle == 0);
|
||||
clients = g_list_remove (clients, client);
|
||||
g_object_unref (client->connection);
|
||||
g_object_unref (client->in);
|
||||
g_slist_free_full (client->serial_mappings, g_free);
|
||||
g_free (client);
|
||||
}
|
||||
|
||||
static void
|
||||
client_disconnected (BroadwayClient *client)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
if (client->disconnect_idle != 0)
|
||||
{
|
||||
g_source_remove (client->disconnect_idle);
|
||||
client->disconnect_idle = 0;
|
||||
}
|
||||
|
||||
for (l = client->windows; l != NULL; l = l->next)
|
||||
broadway_server_destroy_window (server,
|
||||
GPOINTER_TO_UINT (l->data));
|
||||
g_list_free (client->windows);
|
||||
client->windows = NULL;
|
||||
|
||||
broadway_server_flush (server);
|
||||
|
||||
client_free (client);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
disconnect_idle_cb (BroadwayClient *client)
|
||||
{
|
||||
client->disconnect_idle = 0;
|
||||
client_disconnected (client);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
client_disconnect_in_idle (BroadwayClient *client)
|
||||
{
|
||||
if (client->disconnect_idle == 0)
|
||||
client->disconnect_idle =
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)disconnect_idle_cb, client, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
send_reply (BroadwayClient *client,
|
||||
BroadwayRequest *request,
|
||||
BroadwayReply *reply,
|
||||
gsize size,
|
||||
guint32 type)
|
||||
{
|
||||
GOutputStream *output;
|
||||
|
||||
reply->base.size = size;
|
||||
reply->base.in_reply_to = request ? request->base.serial : 0;
|
||||
reply->base.type = type;
|
||||
|
||||
output = g_io_stream_get_output_stream (G_IO_STREAM (client->connection));
|
||||
if (!g_output_stream_write_all (output, reply, size, NULL, NULL, NULL))
|
||||
{
|
||||
g_printerr ("can't write to client");
|
||||
client_disconnect_in_idle (client);
|
||||
}
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
region_from_rects (BroadwayRect *rects, int n_rects)
|
||||
{
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t *cairo_rects;
|
||||
int i;
|
||||
|
||||
cairo_rects = g_new (cairo_rectangle_int_t, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_rects[i].x = rects[i].x;
|
||||
cairo_rects[i].y = rects[i].y;
|
||||
cairo_rects[i].width = rects[i].width;
|
||||
cairo_rects[i].height = rects[i].height;
|
||||
}
|
||||
region = cairo_region_create_rectangles (cairo_rects, n_rects);
|
||||
g_free (cairo_rects);
|
||||
return region;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} ShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_unmap (void *_data)
|
||||
{
|
||||
ShmSurfaceData *data = _data;
|
||||
munmap (data->data, data->data_size);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
open_surface (char *name, int width, int height)
|
||||
{
|
||||
ShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
gsize size;
|
||||
void *ptr;
|
||||
int fd;
|
||||
|
||||
size = width * height * sizeof (guint32);
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to shm_open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
if (ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
data = g_new0 (ShmSurfaceData, 1);
|
||||
|
||||
data->data = ptr;
|
||||
data->data_size = size;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void
|
||||
add_client_serial_mapping (BroadwayClient *client,
|
||||
guint32 client_serial,
|
||||
guint32 daemon_serial)
|
||||
{
|
||||
BroadwaySerialMapping *map;
|
||||
GSList *last;
|
||||
|
||||
last = g_slist_last (client->serial_mappings);
|
||||
|
||||
if (last != NULL)
|
||||
{
|
||||
map = last->data;
|
||||
|
||||
/* If we have no web client, don't grow forever */
|
||||
if (map->daemon_serial == daemon_serial)
|
||||
{
|
||||
map->client_serial = client_serial;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
map = g_new0 (BroadwaySerialMapping, 1);
|
||||
map->client_serial = client_serial;
|
||||
map->daemon_serial = daemon_serial;
|
||||
client->serial_mappings = g_slist_append (client->serial_mappings, map);
|
||||
}
|
||||
|
||||
/* Returns the latest seen client serial at the time we sent
|
||||
a daemon request to the browser with a specific daemon serial */
|
||||
guint32
|
||||
get_client_serial (BroadwayClient *client, guint32 daemon_serial)
|
||||
{
|
||||
BroadwaySerialMapping *map;
|
||||
GSList *l, *found;
|
||||
guint32 client_serial = 0;
|
||||
|
||||
found = NULL;
|
||||
for (l = client->serial_mappings; l != NULL; l = l->next)
|
||||
{
|
||||
map = l->data;
|
||||
|
||||
if (map->daemon_serial <= daemon_serial)
|
||||
{
|
||||
found = l;
|
||||
client_serial = map->client_serial;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Remove mappings before the found one, they will never more be used */
|
||||
while (found != NULL &&
|
||||
client->serial_mappings != found)
|
||||
{
|
||||
g_free (client->serial_mappings->data);
|
||||
client->serial_mappings =
|
||||
g_slist_delete_link (client->serial_mappings, client->serial_mappings);
|
||||
}
|
||||
|
||||
return client_serial;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
client_handle_request (BroadwayClient *client,
|
||||
BroadwayRequest *request)
|
||||
{
|
||||
BroadwayReplyNewWindow reply_new_window;
|
||||
BroadwayReplySync reply_sync;
|
||||
BroadwayReplyQueryMouse reply_query_mouse;
|
||||
BroadwayReplyGrabPointer reply_grab_pointer;
|
||||
BroadwayReplyUngrabPointer reply_ungrab_pointer;
|
||||
cairo_region_t *area;
|
||||
cairo_surface_t *surface;
|
||||
guint32 before_serial, now_serial;
|
||||
|
||||
before_serial = broadway_server_get_next_serial (server);
|
||||
|
||||
switch (request->base.type)
|
||||
{
|
||||
case BROADWAY_REQUEST_NEW_WINDOW:
|
||||
reply_new_window.id =
|
||||
broadway_server_new_window (server,
|
||||
request->new_window.x,
|
||||
request->new_window.y,
|
||||
request->new_window.width,
|
||||
request->new_window.height,
|
||||
request->new_window.is_temp);
|
||||
client->windows =
|
||||
g_list_prepend (client->windows,
|
||||
GUINT_TO_POINTER (reply_new_window.id));
|
||||
|
||||
send_reply (client, request, (BroadwayReply *)&reply_new_window, sizeof (reply_new_window),
|
||||
BROADWAY_REPLY_NEW_WINDOW);
|
||||
break;
|
||||
case BROADWAY_REQUEST_FLUSH:
|
||||
broadway_server_flush (server);
|
||||
break;
|
||||
case BROADWAY_REQUEST_SYNC:
|
||||
broadway_server_flush (server);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_sync, sizeof (reply_sync),
|
||||
BROADWAY_REPLY_SYNC);
|
||||
break;
|
||||
case BROADWAY_REQUEST_QUERY_MOUSE:
|
||||
broadway_server_query_mouse (server,
|
||||
&reply_query_mouse.toplevel,
|
||||
&reply_query_mouse.root_x,
|
||||
&reply_query_mouse.root_y,
|
||||
&reply_query_mouse.mask);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_query_mouse, sizeof (reply_query_mouse),
|
||||
BROADWAY_REPLY_QUERY_MOUSE);
|
||||
break;
|
||||
case BROADWAY_REQUEST_DESTROY_WINDOW:
|
||||
client->windows =
|
||||
g_list_remove (client->windows,
|
||||
GUINT_TO_POINTER (request->destroy_window.id));
|
||||
broadway_server_destroy_window (server, request->destroy_window.id);
|
||||
break;
|
||||
case BROADWAY_REQUEST_SHOW_WINDOW:
|
||||
broadway_server_window_show (server, request->show_window.id);
|
||||
break;
|
||||
case BROADWAY_REQUEST_HIDE_WINDOW:
|
||||
broadway_server_window_hide (server, request->hide_window.id);
|
||||
break;
|
||||
case BROADWAY_REQUEST_SET_TRANSIENT_FOR:
|
||||
broadway_server_window_set_transient_for (server,
|
||||
request->set_transient_for.id,
|
||||
request->set_transient_for.parent);
|
||||
break;
|
||||
case BROADWAY_REQUEST_TRANSLATE:
|
||||
area = region_from_rects (request->translate.rects,
|
||||
request->translate.n_rects);
|
||||
broadway_server_window_translate (server,
|
||||
request->translate.id,
|
||||
area,
|
||||
request->translate.dx,
|
||||
request->translate.dy);
|
||||
cairo_region_destroy (area);
|
||||
break;
|
||||
case BROADWAY_REQUEST_UPDATE:
|
||||
surface = open_surface (request->update.name,
|
||||
request->update.width,
|
||||
request->update.height);
|
||||
if (surface != NULL)
|
||||
{
|
||||
broadway_server_window_update (server,
|
||||
request->update.id,
|
||||
surface);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
break;
|
||||
case BROADWAY_REQUEST_MOVE_RESIZE:
|
||||
broadway_server_window_move_resize (server,
|
||||
request->move_resize.id,
|
||||
request->move_resize.with_move,
|
||||
request->move_resize.x,
|
||||
request->move_resize.y,
|
||||
request->move_resize.width,
|
||||
request->move_resize.height);
|
||||
break;
|
||||
case BROADWAY_REQUEST_GRAB_POINTER:
|
||||
reply_grab_pointer.status =
|
||||
broadway_server_grab_pointer (server,
|
||||
client->id,
|
||||
request->grab_pointer.id,
|
||||
request->grab_pointer.owner_events,
|
||||
request->grab_pointer.event_mask,
|
||||
request->grab_pointer.time_);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_grab_pointer, sizeof (reply_grab_pointer),
|
||||
BROADWAY_REPLY_GRAB_POINTER);
|
||||
break;
|
||||
case BROADWAY_REQUEST_UNGRAB_POINTER:
|
||||
reply_ungrab_pointer.status =
|
||||
broadway_server_ungrab_pointer (server,
|
||||
request->ungrab_pointer.time_);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_ungrab_pointer, sizeof (reply_ungrab_pointer),
|
||||
BROADWAY_REPLY_UNGRAB_POINTER);
|
||||
break;
|
||||
default:
|
||||
g_warning ("Unknown request of type %d\n", request->base.type);
|
||||
}
|
||||
|
||||
|
||||
now_serial = broadway_server_get_next_serial (server);
|
||||
|
||||
/* If we sent a new output request, map that this client serial to that, otherwise
|
||||
update old mapping for previously sent daemon serial */
|
||||
if (now_serial != before_serial)
|
||||
add_client_serial_mapping (client,
|
||||
request->base.serial,
|
||||
before_serial);
|
||||
else
|
||||
add_client_serial_mapping (client,
|
||||
request->base.serial,
|
||||
before_serial - 1);
|
||||
}
|
||||
|
||||
static void
|
||||
client_fill_cb (GObject *source_object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
BroadwayClient *client = user_data;
|
||||
gssize res;
|
||||
|
||||
res = g_buffered_input_stream_fill_finish (client->in, result, NULL);
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
guint32 size;
|
||||
gsize count, remaining;
|
||||
guint8 *buffer;
|
||||
BroadwayRequest request;
|
||||
|
||||
buffer = (guint8 *)g_buffered_input_stream_peek_buffer (client->in, &count);
|
||||
|
||||
remaining = count;
|
||||
while (remaining >= sizeof (guint32))
|
||||
{
|
||||
memcpy (&size, buffer, sizeof (guint32));
|
||||
|
||||
if (size <= remaining)
|
||||
{
|
||||
g_assert (size >= sizeof (BroadwayRequestBase));
|
||||
g_assert (size <= sizeof (BroadwayRequest));
|
||||
|
||||
memcpy (&request, buffer, size);
|
||||
client_handle_request (client, &request);
|
||||
|
||||
remaining -= size;
|
||||
buffer += size;
|
||||
}
|
||||
}
|
||||
|
||||
/* This is guaranteed not to block */
|
||||
g_input_stream_skip (G_INPUT_STREAM (client->in), count - remaining, NULL, NULL);
|
||||
|
||||
g_buffered_input_stream_fill_async (client->in,
|
||||
4*1024,
|
||||
0,
|
||||
NULL,
|
||||
client_fill_cb, client);
|
||||
}
|
||||
else
|
||||
{
|
||||
client_disconnected (client);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
incoming_client (GSocketService *service,
|
||||
GSocketConnection *connection,
|
||||
GObject *source_object)
|
||||
{
|
||||
BroadwayClient *client;
|
||||
GInputStream *input;
|
||||
BroadwayInputMsg ev = { {0} };
|
||||
|
||||
client = g_new0 (BroadwayClient, 1);
|
||||
client->id = client_id_count++;
|
||||
client->connection = g_object_ref (connection);
|
||||
|
||||
input = g_io_stream_get_input_stream (G_IO_STREAM (client->connection));
|
||||
client->in = (GBufferedInputStream *)g_buffered_input_stream_new (input);
|
||||
|
||||
clients = g_list_prepend (clients, client);
|
||||
|
||||
g_buffered_input_stream_fill_async (client->in,
|
||||
4*1024,
|
||||
0,
|
||||
NULL,
|
||||
client_fill_cb, client);
|
||||
|
||||
/* Send initial resize notify */
|
||||
ev.base.type = BROADWAY_EVENT_SCREEN_SIZE_CHANGED;
|
||||
ev.base.serial = broadway_server_get_next_serial (server) - 1;
|
||||
ev.base.time = broadway_server_get_last_seen_time (server);
|
||||
broadway_server_get_screen_size (server,
|
||||
&ev.screen_resize_notify.width,
|
||||
&ev.screen_resize_notify.height);
|
||||
|
||||
broadway_events_got_input (&ev,
|
||||
client->id);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GError *error = NULL;
|
||||
GOptionContext *context;
|
||||
GMainLoop *loop;
|
||||
GSocketAddress *address;
|
||||
GSocketService *listener;
|
||||
char *path, *base;
|
||||
char *http_address = NULL;
|
||||
int http_port = 0;
|
||||
int display = 1;
|
||||
const GOptionEntry entries[] = {
|
||||
{ "port", 'p', 0, G_OPTION_ARG_INT, &http_port, "Httpd port", "PORT" },
|
||||
{ "address", 'a', 0, G_OPTION_ARG_STRING, &http_address, "Ip address to bind to ", "ADDRESS" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
context = g_option_context_new ("[:DISPLAY] - broadway display daemon");
|
||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||
if (!g_option_context_parse (context, &argc, &argv, &error))
|
||||
{
|
||||
g_printerr ("option parsing failed: %s\n", error->message);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (*argv[1] != ':')
|
||||
{
|
||||
g_printerr ("Usage broadwayd [:DISPLAY]\n");
|
||||
exit (1);
|
||||
}
|
||||
display = strtol(argv[1]+1, NULL, 10);
|
||||
if (display == 0)
|
||||
{
|
||||
g_printerr ("Failed to parse display num %s\n", argv[1]);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (http_port == 0)
|
||||
http_port = 8080 + (display - 1);
|
||||
|
||||
server = broadway_server_new (http_address, http_port, &error);
|
||||
if (server == NULL)
|
||||
{
|
||||
g_printerr ("%s\n", error->message);
|
||||
return 1;
|
||||
}
|
||||
|
||||
base = g_strdup_printf ("broadway%d.socket", display);
|
||||
path = g_build_filename (g_get_user_runtime_dir (), base, NULL);
|
||||
g_free (base);
|
||||
g_print ("Listening on %s\n", path);
|
||||
address = g_unix_socket_address_new_with_type (path, -1,
|
||||
G_UNIX_SOCKET_ADDRESS_ABSTRACT);
|
||||
g_free (path);
|
||||
|
||||
listener = g_socket_service_new ();
|
||||
if (!g_socket_listener_add_address (G_SOCKET_LISTENER (listener),
|
||||
address,
|
||||
G_SOCKET_TYPE_STREAM,
|
||||
G_SOCKET_PROTOCOL_DEFAULT,
|
||||
G_OBJECT (server),
|
||||
NULL,
|
||||
&error))
|
||||
{
|
||||
g_printerr ("Can't listen: %s\n", error->message);
|
||||
return 1;
|
||||
}
|
||||
g_object_unref (address);
|
||||
|
||||
g_signal_connect (listener, "incoming", G_CALLBACK (incoming_client), NULL);
|
||||
|
||||
g_socket_service_start (G_SOCKET_SERVICE (listener));
|
||||
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (loop);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gsize
|
||||
get_event_size (int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case BROADWAY_EVENT_ENTER:
|
||||
case BROADWAY_EVENT_LEAVE:
|
||||
return sizeof (BroadwayInputCrossingMsg);
|
||||
case BROADWAY_EVENT_POINTER_MOVE:
|
||||
return sizeof (BroadwayInputPointerMsg);
|
||||
case BROADWAY_EVENT_BUTTON_PRESS:
|
||||
case BROADWAY_EVENT_BUTTON_RELEASE:
|
||||
return sizeof (BroadwayInputButtonMsg);
|
||||
case BROADWAY_EVENT_SCROLL:
|
||||
return sizeof (BroadwayInputScrollMsg);
|
||||
case BROADWAY_EVENT_KEY_PRESS:
|
||||
case BROADWAY_EVENT_KEY_RELEASE:
|
||||
return sizeof (BroadwayInputKeyMsg);
|
||||
case BROADWAY_EVENT_GRAB_NOTIFY:
|
||||
case BROADWAY_EVENT_UNGRAB_NOTIFY:
|
||||
return sizeof (BroadwayInputGrabReply);
|
||||
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
|
||||
return sizeof (BroadwayInputConfigureNotify);
|
||||
case BROADWAY_EVENT_DELETE_NOTIFY:
|
||||
return sizeof (BroadwayInputDeleteNotify);
|
||||
case BROADWAY_EVENT_SCREEN_SIZE_CHANGED:
|
||||
return sizeof (BroadwayInputScreenResizeNotify);
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
broadway_events_got_input (BroadwayInputMsg *message,
|
||||
gint32 client_id)
|
||||
{
|
||||
GList *l;
|
||||
BroadwayReplyEvent reply_event;
|
||||
gsize size;
|
||||
guint32 daemon_serial;
|
||||
|
||||
size = get_event_size (message->base.type);
|
||||
g_assert (sizeof (BroadwayReplyBase) + size <= sizeof (BroadwayReplyEvent));
|
||||
|
||||
memset (&reply_event, 0, sizeof (BroadwayReplyEvent));
|
||||
daemon_serial = message->base.serial;
|
||||
|
||||
memcpy (&reply_event.msg, message, size);
|
||||
|
||||
for (l = clients; l != NULL; l = l->next)
|
||||
{
|
||||
BroadwayClient *client = l->data;
|
||||
|
||||
if (client_id == -1 ||
|
||||
client->id == client_id)
|
||||
{
|
||||
reply_event.msg.base.serial = get_client_serial (client, daemon_serial);
|
||||
|
||||
send_reply (client, NULL, (BroadwayReply *)&reply_event,
|
||||
G_STRUCT_OFFSET (BroadwayReplyEvent, msg) + size,
|
||||
BROADWAY_REPLY_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
695
gdk/broadway/gdkbroadway-server.c
Normal file
695
gdk/broadway/gdkbroadway-server.c
Normal file
@@ -0,0 +1,695 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "gdkbroadway-server.h"
|
||||
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include <gio/gunixsocketaddress.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
typedef struct BroadwayInput BroadwayInput;
|
||||
|
||||
struct _GdkBroadwayServer {
|
||||
GObject parent_instance;
|
||||
|
||||
guint32 next_serial;
|
||||
GSocketConnection *connection;
|
||||
|
||||
guint32 recv_buffer_size;
|
||||
guint8 recv_buffer[1024];
|
||||
|
||||
guint process_input_idle;
|
||||
GList *incomming;
|
||||
|
||||
};
|
||||
|
||||
struct _GdkBroadwayServerClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static gboolean input_available_cb (gpointer stream, gpointer user_data);
|
||||
|
||||
G_DEFINE_TYPE (GdkBroadwayServer, gdk_broadway_server, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gdk_broadway_server_init (GdkBroadwayServer *server)
|
||||
{
|
||||
server->next_serial = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_server_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (gdk_broadway_server_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_server_class_init (GdkBroadwayServerClass * class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = gdk_broadway_server_finalize;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_server_lookahead_event (GdkBroadwayServer *server,
|
||||
const char *types)
|
||||
{
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gulong
|
||||
_gdk_broadway_server_get_next_serial (GdkBroadwayServer *server)
|
||||
{
|
||||
return (gulong)server->next_serial;
|
||||
}
|
||||
|
||||
GdkBroadwayServer *
|
||||
_gdk_broadway_server_new (int port, GError **error)
|
||||
{
|
||||
GdkBroadwayServer *server;
|
||||
char *basename;
|
||||
GSocketClient *client;
|
||||
GSocketConnection *connection;
|
||||
GSocketAddress *address;
|
||||
GPollableInputStream *pollable;
|
||||
GInputStream *in;
|
||||
GSource *source;
|
||||
char *path;
|
||||
|
||||
basename = g_strdup_printf ("broadway%d.socket", port);
|
||||
path = g_build_filename (g_get_user_runtime_dir (), basename, NULL);
|
||||
g_free (basename);
|
||||
|
||||
address = g_unix_socket_address_new_with_type (path, -1,
|
||||
G_UNIX_SOCKET_ADDRESS_ABSTRACT);
|
||||
g_free (path);
|
||||
|
||||
client = g_socket_client_new ();
|
||||
|
||||
error = NULL;
|
||||
connection = g_socket_client_connect (client, G_SOCKET_CONNECTABLE (address), NULL, error);
|
||||
|
||||
g_object_unref (address);
|
||||
g_object_unref (client);
|
||||
|
||||
if (connection == NULL)
|
||||
return NULL;
|
||||
|
||||
server = g_object_new (GDK_TYPE_BROADWAY_SERVER, NULL);
|
||||
server->connection = connection;
|
||||
|
||||
in = g_io_stream_get_input_stream (G_IO_STREAM (server->connection));
|
||||
pollable = G_POLLABLE_INPUT_STREAM (in);
|
||||
|
||||
source = g_pollable_input_stream_create_source (pollable, NULL);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_set_callback (source, (GSourceFunc)input_available_cb, server, NULL);
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
guint32
|
||||
_gdk_broadway_server_get_last_seen_time (GdkBroadwayServer *server)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static guint32
|
||||
gdk_broadway_server_send_message_with_size (GdkBroadwayServer *server, BroadwayRequestBase *base,
|
||||
gsize size, guint32 type)
|
||||
{
|
||||
GOutputStream *out;
|
||||
gsize written;
|
||||
|
||||
base->size = size;
|
||||
base->type = type;
|
||||
base->serial = server->next_serial++;
|
||||
|
||||
out = g_io_stream_get_output_stream (G_IO_STREAM (server->connection));
|
||||
|
||||
if (!g_output_stream_write_all (out, base, size, &written, NULL, NULL))
|
||||
{
|
||||
g_printerr ("Unable to write to server\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
g_assert (written == size);
|
||||
|
||||
return base->serial;
|
||||
}
|
||||
|
||||
#define gdk_broadway_server_send_message(_server, _msg, _type) \
|
||||
gdk_broadway_server_send_message_with_size(_server, (BroadwayRequestBase *)&_msg, sizeof (_msg), _type)
|
||||
|
||||
static void
|
||||
parse_all_input (GdkBroadwayServer *server)
|
||||
{
|
||||
guint8 *p, *end;
|
||||
guint32 size;
|
||||
BroadwayReply *reply;
|
||||
|
||||
p = server->recv_buffer;
|
||||
end = p + server->recv_buffer_size;
|
||||
|
||||
while (p + sizeof (guint32) <= end)
|
||||
{
|
||||
memcpy (&size, p, sizeof (guint32));
|
||||
if (p + size > end)
|
||||
break;
|
||||
|
||||
reply = g_memdup (p, size);
|
||||
p += size;
|
||||
|
||||
server->incomming = g_list_append (server->incomming, reply);
|
||||
}
|
||||
|
||||
if (p < end)
|
||||
memmove (server->recv_buffer, p, end - p);
|
||||
server->recv_buffer_size = end - p;
|
||||
}
|
||||
|
||||
static void
|
||||
read_some_input_blocking (GdkBroadwayServer *server)
|
||||
{
|
||||
GInputStream *in;
|
||||
gssize res;
|
||||
|
||||
in = g_io_stream_get_input_stream (G_IO_STREAM (server->connection));
|
||||
|
||||
g_assert (server->recv_buffer_size < sizeof (server->recv_buffer));
|
||||
res = g_input_stream_read (in, &server->recv_buffer[server->recv_buffer_size],
|
||||
sizeof (server->recv_buffer) - server->recv_buffer_size,
|
||||
NULL, NULL);
|
||||
|
||||
if (res <= 0)
|
||||
{
|
||||
g_printerr ("Unable to read from broadway server\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
server->recv_buffer_size += res;
|
||||
}
|
||||
|
||||
static void
|
||||
read_some_input_nonblocking (GdkBroadwayServer *server)
|
||||
{
|
||||
GInputStream *in;
|
||||
GPollableInputStream *pollable;
|
||||
gssize res;
|
||||
GError *error;
|
||||
|
||||
in = g_io_stream_get_input_stream (G_IO_STREAM (server->connection));
|
||||
pollable = G_POLLABLE_INPUT_STREAM (in);
|
||||
|
||||
g_assert (server->recv_buffer_size < sizeof (server->recv_buffer));
|
||||
error = NULL;
|
||||
res = g_pollable_input_stream_read_nonblocking (pollable, &server->recv_buffer[server->recv_buffer_size],
|
||||
sizeof (server->recv_buffer) - server->recv_buffer_size,
|
||||
NULL, &error);
|
||||
|
||||
if (res < 0 && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
|
||||
{
|
||||
g_error_free (error);
|
||||
res = 0;
|
||||
}
|
||||
else if (res <= 0)
|
||||
{
|
||||
g_printerr ("Unable to read from broadway server: %s\n", error ? error->message : "eof");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
server->recv_buffer_size += res;
|
||||
}
|
||||
|
||||
static BroadwayReply *
|
||||
find_response_by_serial (GdkBroadwayServer *server, guint32 serial)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = server->incomming; l != NULL; l = l->next)
|
||||
{
|
||||
BroadwayReply *reply = l->data;
|
||||
|
||||
if (reply->base.in_reply_to == serial)
|
||||
return reply;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
process_input_messages (GdkBroadwayServer *server)
|
||||
{
|
||||
BroadwayReply *reply;
|
||||
|
||||
if (server->process_input_idle != 0)
|
||||
{
|
||||
g_source_remove (server->process_input_idle);
|
||||
server->process_input_idle = 0;
|
||||
}
|
||||
|
||||
while (server->incomming)
|
||||
{
|
||||
reply = server->incomming->data;
|
||||
server->incomming =
|
||||
g_list_delete_link (server->incomming,
|
||||
server->incomming);
|
||||
|
||||
if (reply->base.type == BROADWAY_REPLY_EVENT)
|
||||
_gdk_broadway_events_got_input (&reply->event.msg);
|
||||
else
|
||||
g_warning ("Unhandled reply type %d\n", reply->base.type);
|
||||
g_free (reply);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
process_input_idle_cb (GdkBroadwayServer *server)
|
||||
{
|
||||
server->process_input_idle = 0;
|
||||
process_input_messages (server);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_process_input_at_idle (GdkBroadwayServer *server)
|
||||
{
|
||||
if (server->process_input_idle == 0)
|
||||
server->process_input_idle =
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)process_input_idle_cb, server, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
input_available_cb (gpointer stream, gpointer user_data)
|
||||
{
|
||||
GdkBroadwayServer *server = user_data;
|
||||
|
||||
read_some_input_nonblocking (server);
|
||||
parse_all_input (server);
|
||||
|
||||
process_input_messages (server);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static BroadwayReply *
|
||||
gdk_broadway_server_wait_for_reply (GdkBroadwayServer *server,
|
||||
guint32 serial)
|
||||
{
|
||||
BroadwayReply *reply;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
reply = find_response_by_serial (server, serial);
|
||||
if (reply)
|
||||
{
|
||||
server->incomming = g_list_remove (server->incomming, reply);
|
||||
break;
|
||||
}
|
||||
|
||||
read_some_input_blocking (server);
|
||||
parse_all_input (server);
|
||||
}
|
||||
|
||||
queue_process_input_at_idle (server);
|
||||
return reply;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_flush (GdkBroadwayServer *server)
|
||||
{
|
||||
BroadwayRequestFlush msg;
|
||||
|
||||
gdk_broadway_server_send_message(server, msg, BROADWAY_REQUEST_FLUSH);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_sync (GdkBroadwayServer *server)
|
||||
{
|
||||
BroadwayRequestSync msg;
|
||||
guint32 serial;
|
||||
BroadwayReply *reply;
|
||||
|
||||
serial = gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_SYNC);
|
||||
reply = gdk_broadway_server_wait_for_reply (server, serial);
|
||||
|
||||
g_assert (reply->base.type == BROADWAY_REPLY_SYNC);
|
||||
|
||||
g_free (reply);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_query_mouse (GdkBroadwayServer *server,
|
||||
guint32 *toplevel,
|
||||
gint32 *root_x,
|
||||
gint32 *root_y,
|
||||
guint32 *mask)
|
||||
{
|
||||
BroadwayRequestQueryMouse msg;
|
||||
guint32 serial;
|
||||
BroadwayReply *reply;
|
||||
|
||||
serial = gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_QUERY_MOUSE);
|
||||
reply = gdk_broadway_server_wait_for_reply (server, serial);
|
||||
|
||||
g_assert (reply->base.type == BROADWAY_REPLY_QUERY_MOUSE);
|
||||
|
||||
if (toplevel)
|
||||
*toplevel = reply->query_mouse.toplevel;
|
||||
if (root_x)
|
||||
*root_x = reply->query_mouse.root_x;
|
||||
if (root_y)
|
||||
*root_y = reply->query_mouse.root_y;
|
||||
if (mask)
|
||||
*mask = reply->query_mouse.mask;
|
||||
|
||||
g_free (reply);
|
||||
}
|
||||
|
||||
guint32
|
||||
_gdk_broadway_server_new_window (GdkBroadwayServer *server,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
gboolean is_temp)
|
||||
{
|
||||
BroadwayRequestNewWindow msg;
|
||||
guint32 serial, id;
|
||||
BroadwayReply *reply;
|
||||
|
||||
msg.x = x;
|
||||
msg.y = y;
|
||||
msg.width = width;
|
||||
msg.height = height;
|
||||
msg.is_temp = is_temp;
|
||||
|
||||
serial = gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_NEW_WINDOW);
|
||||
reply = gdk_broadway_server_wait_for_reply (server, serial);
|
||||
|
||||
g_assert (reply->base.type == BROADWAY_REPLY_NEW_WINDOW);
|
||||
|
||||
id = reply->new_window.id;
|
||||
|
||||
g_free (reply);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_destroy_window (GdkBroadwayServer *server,
|
||||
gint id)
|
||||
{
|
||||
BroadwayRequestDestroyWindow msg;
|
||||
|
||||
msg.id = id;
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_DESTROY_WINDOW);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_server_window_show (GdkBroadwayServer *server,
|
||||
gint id)
|
||||
{
|
||||
BroadwayRequestShowWindow msg;
|
||||
|
||||
msg.id = id;
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_SHOW_WINDOW);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_server_window_hide (GdkBroadwayServer *server,
|
||||
gint id)
|
||||
{
|
||||
BroadwayRequestHideWindow msg;
|
||||
|
||||
msg.id = id;
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_HIDE_WINDOW);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_window_set_transient_for (GdkBroadwayServer *server,
|
||||
gint id, gint parent)
|
||||
{
|
||||
BroadwayRequestSetTransientFor msg;
|
||||
|
||||
msg.id = id;
|
||||
msg.parent = parent;
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_SET_TRANSIENT_FOR);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_server_window_translate (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
BroadwayRequestTranslate *msg;
|
||||
cairo_rectangle_int_t rect;
|
||||
int i, n_rects;
|
||||
gsize msg_size;
|
||||
|
||||
n_rects = cairo_region_num_rectangles (area);
|
||||
|
||||
msg_size = sizeof (BroadwayRequestTranslate) + (n_rects-1) * sizeof (BroadwayRect);
|
||||
msg = g_malloc (msg_size);
|
||||
|
||||
msg->id = id;
|
||||
msg->dx = dx;
|
||||
msg->dy = dy;
|
||||
msg->n_rects = n_rects;
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (area, i, &rect);
|
||||
msg->rects[i].x = rect.x;
|
||||
msg->rects[i].y = rect.y;
|
||||
msg->rects[i].width = rect.width;
|
||||
msg->rects[i].height = rect.height;
|
||||
}
|
||||
|
||||
gdk_broadway_server_send_message_with_size (server, (BroadwayRequestBase *)msg, msg_size,
|
||||
BROADWAY_REQUEST_TRANSLATE);
|
||||
g_free (msg);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static char
|
||||
make_valid_fs_char (char c)
|
||||
{
|
||||
char chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
||||
|
||||
return chars[c % sizeof (chars)];
|
||||
}
|
||||
|
||||
/* name must have at least space for 34 bytes */
|
||||
static int
|
||||
create_random_shm (char *name)
|
||||
{
|
||||
guint32 r;
|
||||
int i, o, fd;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
o = 0;
|
||||
name[o++] = '/';
|
||||
name[o++] = 'b';
|
||||
name[o++] = 'd';
|
||||
name[o++] = 'w';
|
||||
name[o++] = '-';
|
||||
for (i = 0; i < 32/4 - 1; i++)
|
||||
{
|
||||
r = g_random_int ();
|
||||
name[o++] = make_valid_fs_char ((r >> 0) & 0xff);
|
||||
name[o++] = make_valid_fs_char ((r >> 8) & 0xff);
|
||||
name[o++] = make_valid_fs_char ((r >> 16) & 0xff);
|
||||
name[o++] = make_valid_fs_char ((r >> 24) & 0xff);
|
||||
}
|
||||
name[o++] = 0;
|
||||
|
||||
fd = shm_open(name, O_RDWR|O_CREAT|O_EXCL, 0600);
|
||||
if (fd >= 0)
|
||||
return fd;
|
||||
|
||||
if (errno != EEXIST)
|
||||
{
|
||||
g_printerr ("Unable to allocate shared mem for window");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t gdk_broadway_shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
char name[34];
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} BroadwayShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_destroy (void *_data)
|
||||
{
|
||||
BroadwayShmSurfaceData *data = _data;
|
||||
|
||||
munmap (data->data, data->data_size);
|
||||
shm_unlink (data->name);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
_gdk_broadway_server_create_surface (int width,
|
||||
int height)
|
||||
{
|
||||
BroadwayShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
int res;
|
||||
int fd;
|
||||
|
||||
data = g_new (BroadwayShmSurfaceData, 1);
|
||||
data->data_size = width * height * sizeof (guint32);
|
||||
|
||||
fd = create_random_shm (data->name);
|
||||
|
||||
res = ftruncate (fd, data->data_size);
|
||||
g_assert (res != -1);
|
||||
|
||||
data->data = mmap(0, data->data_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24, width, height, width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &gdk_broadway_shm_cairo_key,
|
||||
data, shm_data_destroy);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_server_window_update (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
cairo_surface_t *surface)
|
||||
{
|
||||
BroadwayRequestUpdate msg;
|
||||
BroadwayShmSurfaceData *data;
|
||||
|
||||
if (surface == NULL)
|
||||
return;
|
||||
|
||||
data = cairo_surface_get_user_data (surface, &gdk_broadway_shm_cairo_key);
|
||||
g_assert (data != NULL);
|
||||
|
||||
msg.id = id;
|
||||
memcpy (msg.name, data->name, 34);
|
||||
msg.width = cairo_image_surface_get_width (surface);
|
||||
msg.height = cairo_image_surface_get_height (surface);
|
||||
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_UPDATE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_broadway_server_window_move_resize (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
gboolean with_move,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
BroadwayRequestMoveResize msg;
|
||||
|
||||
msg.id = id;
|
||||
msg.with_move = with_move;
|
||||
msg.x = x;
|
||||
msg.y = y;
|
||||
msg.width = width;
|
||||
msg.height = height;
|
||||
|
||||
gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_MOVE_RESIZE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GdkGrabStatus
|
||||
_gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
gboolean owner_events,
|
||||
guint32 event_mask,
|
||||
guint32 time_)
|
||||
{
|
||||
BroadwayRequestGrabPointer msg;
|
||||
guint32 serial, status;
|
||||
BroadwayReply *reply;
|
||||
|
||||
msg.id = id;
|
||||
msg.owner_events = owner_events;
|
||||
msg.event_mask = event_mask;
|
||||
msg.time_ = time_;
|
||||
|
||||
serial = gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_GRAB_POINTER);
|
||||
reply = gdk_broadway_server_wait_for_reply (server, serial);
|
||||
|
||||
g_assert (reply->base.type == BROADWAY_REPLY_GRAB_POINTER);
|
||||
|
||||
status = reply->grab_pointer.status;
|
||||
|
||||
g_free (reply);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
guint32
|
||||
_gdk_broadway_server_ungrab_pointer (GdkBroadwayServer *server,
|
||||
guint32 time_)
|
||||
{
|
||||
BroadwayRequestUngrabPointer msg;
|
||||
guint32 serial, status;
|
||||
BroadwayReply *reply;
|
||||
|
||||
msg.time_ = time_;
|
||||
|
||||
serial = gdk_broadway_server_send_message (server, msg,
|
||||
BROADWAY_REQUEST_UNGRAB_POINTER);
|
||||
reply = gdk_broadway_server_wait_for_reply (server, serial);
|
||||
|
||||
g_assert (reply->base.type == BROADWAY_REPLY_UNGRAB_POINTER);
|
||||
|
||||
status = reply->ungrab_pointer.status;
|
||||
|
||||
g_free (reply);
|
||||
|
||||
return status;
|
||||
}
|
71
gdk/broadway/gdkbroadway-server.h
Normal file
71
gdk/broadway/gdkbroadway-server.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef __GDK_BROADWAY_SERVER__
|
||||
#define __GDK_BROADWAY_SERVER__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include "broadway-protocol.h"
|
||||
|
||||
typedef struct _GdkBroadwayServer GdkBroadwayServer;
|
||||
typedef struct _GdkBroadwayServerClass GdkBroadwayServerClass;
|
||||
|
||||
#define GDK_TYPE_BROADWAY_SERVER (gdk_broadway_server_get_type())
|
||||
#define GDK_BROADWAY_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SERVER, GdkBroadwayServer))
|
||||
#define GDK_BROADWAY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SERVER, GdkBroadwayServerClass))
|
||||
#define GDK_IS_BROADWAY_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SERVER))
|
||||
#define GDK_IS_BROADWAY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SERVER))
|
||||
#define GDK_BROADWAY_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SERVER, GdkBroadwayServerClass))
|
||||
|
||||
GdkBroadwayServer *_gdk_broadway_server_new (int port,
|
||||
GError **error);
|
||||
void _gdk_broadway_server_flush (GdkBroadwayServer *server);
|
||||
void _gdk_broadway_server_sync (GdkBroadwayServer *server);
|
||||
gulong _gdk_broadway_server_get_next_serial (GdkBroadwayServer *server);
|
||||
guint32 _gdk_broadway_server_get_last_seen_time (GdkBroadwayServer *server);
|
||||
gboolean _gdk_broadway_server_lookahead_event (GdkBroadwayServer *server,
|
||||
const char *types);
|
||||
void _gdk_broadway_server_query_mouse (GdkBroadwayServer *server,
|
||||
guint32 *toplevel,
|
||||
gint32 *root_x,
|
||||
gint32 *root_y,
|
||||
guint32 *mask);
|
||||
GdkGrabStatus _gdk_broadway_server_grab_pointer (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
gboolean owner_events,
|
||||
guint32 event_mask,
|
||||
guint32 time_);
|
||||
guint32 _gdk_broadway_server_ungrab_pointer (GdkBroadwayServer *server,
|
||||
guint32 time_);
|
||||
gint32 _gdk_broadway_server_get_mouse_toplevel (GdkBroadwayServer *server);
|
||||
guint32 _gdk_broadway_server_new_window (GdkBroadwayServer *server,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
gboolean is_temp);
|
||||
void _gdk_broadway_server_destroy_window (GdkBroadwayServer *server,
|
||||
gint id);
|
||||
gboolean _gdk_broadway_server_window_show (GdkBroadwayServer *server,
|
||||
gint id);
|
||||
gboolean _gdk_broadway_server_window_hide (GdkBroadwayServer *server,
|
||||
gint id);
|
||||
void _gdk_broadway_server_window_set_transient_for (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
gint parent);
|
||||
gboolean _gdk_broadway_server_window_translate (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy);
|
||||
cairo_surface_t *_gdk_broadway_server_create_surface (int width,
|
||||
int height);
|
||||
void _gdk_broadway_server_window_update (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
cairo_surface_t *surface);
|
||||
gboolean _gdk_broadway_server_window_move_resize (GdkBroadwayServer *server,
|
||||
gint id,
|
||||
gboolean with_move,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
#endif /* __GDK_BROADWAY_SERVER__ */
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_BROADWAY_CURSOR_H__
|
||||
#define __GDK_BROADWAY_CURSOR_H__
|
||||
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_BROADWAY_CURSOR_H__
|
||||
#define __GDK_BROADWAY_CURSOR_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@@ -17,13 +17,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
#define __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
|
||||
#if !defined(__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
#define __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@@ -156,7 +156,10 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GdkScreen *screen;
|
||||
gint device_root_x, device_root_y;
|
||||
gint32 device_root_x, device_root_y;
|
||||
gint32 mouse_toplevel_id;
|
||||
GdkWindow *mouse_toplevel;
|
||||
guint32 mask32;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
|
||||
return;
|
||||
@@ -173,36 +176,12 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
*root_window = gdk_screen_get_root_window (screen);
|
||||
}
|
||||
|
||||
if (broadway_display->output)
|
||||
{
|
||||
_gdk_broadway_display_consume_all_input (display);
|
||||
if (root_x)
|
||||
*root_x = broadway_display->future_root_x;
|
||||
if (root_y)
|
||||
*root_y = broadway_display->future_root_y;
|
||||
/* TODO: Should really use future_x/y when we get configure events */
|
||||
if (win_x)
|
||||
*win_x = broadway_display->future_root_x - toplevel->x;
|
||||
if (win_y)
|
||||
*win_y = broadway_display->future_root_y - toplevel->y;
|
||||
if (mask)
|
||||
*mask = broadway_display->future_state;
|
||||
if (child_window)
|
||||
{
|
||||
if (gdk_window_get_window_type (toplevel) == GDK_WINDOW_ROOT)
|
||||
*child_window =
|
||||
g_hash_table_lookup (broadway_display->id_ht,
|
||||
GINT_TO_POINTER (broadway_display->future_mouse_in_toplevel));
|
||||
else
|
||||
*child_window = toplevel; /* No native children */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fallback when unconnected */
|
||||
|
||||
device_root_x = broadway_display->last_x;
|
||||
device_root_y = broadway_display->last_y;
|
||||
_gdk_broadway_server_query_mouse (broadway_display->server,
|
||||
&mouse_toplevel_id,
|
||||
&device_root_x,
|
||||
&device_root_y,
|
||||
&mask32);
|
||||
mouse_toplevel = g_hash_table_lookup (broadway_display->id_ht, GINT_TO_POINTER (mouse_toplevel_id));
|
||||
|
||||
if (root_x)
|
||||
*root_x = device_root_x;
|
||||
@@ -213,12 +192,12 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
if (win_y)
|
||||
*win_y = device_root_y - toplevel->y;
|
||||
if (mask)
|
||||
*mask = broadway_display->last_state;
|
||||
*mask = mask32;
|
||||
if (child_window)
|
||||
{
|
||||
if (gdk_window_get_window_type (toplevel) == GDK_WINDOW_ROOT)
|
||||
{
|
||||
*child_window = broadway_display->mouse_in_toplevel;
|
||||
*child_window = mouse_toplevel;
|
||||
if (*child_window == NULL)
|
||||
*child_window = toplevel;
|
||||
}
|
||||
@@ -236,13 +215,10 @@ void
|
||||
_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkDeviceGrabInfo *grab;
|
||||
GList *devices, *d;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
/* Get all devices */
|
||||
@@ -257,8 +233,6 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
{
|
||||
grab->serial_end = grab->serial_start;
|
||||
grab->implicit_ungrab = TRUE;
|
||||
|
||||
broadway_display->pointer_grab_window = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,29 +264,11 @@ gdk_broadway_device_grab (GdkDevice *device,
|
||||
else
|
||||
{
|
||||
/* Device is a pointer */
|
||||
|
||||
if (broadway_display->pointer_grab_window != NULL &&
|
||||
time_ != 0 && broadway_display->pointer_grab_time > time_)
|
||||
return GDK_GRAB_ALREADY_GRABBED;
|
||||
|
||||
if (time_ == 0)
|
||||
time_ = broadway_display->last_seen_time;
|
||||
|
||||
broadway_display->pointer_grab_window = window;
|
||||
broadway_display->pointer_grab_owner_events = owner_events;
|
||||
broadway_display->pointer_grab_time = time_;
|
||||
|
||||
if (broadway_display->output)
|
||||
{
|
||||
broadway_output_grab_pointer (broadway_display->output,
|
||||
GDK_WINDOW_IMPL_BROADWAY (window->impl)->id,
|
||||
owner_events);
|
||||
gdk_display_flush (display);
|
||||
}
|
||||
|
||||
/* TODO: What about toplevel grab events if we're not connected? */
|
||||
|
||||
return GDK_GRAB_SUCCESS;
|
||||
return _gdk_broadway_server_grab_pointer (broadway_display->server,
|
||||
GDK_WINDOW_IMPL_BROADWAY (window->impl)->id,
|
||||
owner_events,
|
||||
event_mask,
|
||||
time_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,31 +296,17 @@ gdk_broadway_device_ungrab (GdkDevice *device,
|
||||
else
|
||||
{
|
||||
/* Device is a pointer */
|
||||
serial = _gdk_broadway_server_ungrab_pointer (broadway_display->server, time_);
|
||||
|
||||
if (broadway_display->pointer_grab_window != NULL &&
|
||||
time_ != 0 && broadway_display->pointer_grab_time > time_)
|
||||
return;
|
||||
|
||||
/* TODO: What about toplevel grab events if we're not connected? */
|
||||
|
||||
if (broadway_display->output)
|
||||
if (serial != 0)
|
||||
{
|
||||
serial = broadway_output_ungrab_pointer (broadway_display->output);
|
||||
gdk_display_flush (display);
|
||||
grab = _gdk_display_get_last_device_grab (display, device);
|
||||
if (grab &&
|
||||
(time_ == GDK_CURRENT_TIME ||
|
||||
grab->time == GDK_CURRENT_TIME ||
|
||||
!TIME_IS_LATER (grab->time, time_)))
|
||||
grab->serial_end = serial;
|
||||
}
|
||||
else
|
||||
{
|
||||
serial = broadway_display->saved_serial;
|
||||
}
|
||||
|
||||
grab = _gdk_display_get_last_device_grab (display, device);
|
||||
if (grab &&
|
||||
(time_ == GDK_CURRENT_TIME ||
|
||||
grab->time == GDK_CURRENT_TIME ||
|
||||
!TIME_IS_LATER (grab->time, time_)))
|
||||
grab->serial_end = serial;
|
||||
|
||||
broadway_display->pointer_grab_window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,7 +317,6 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
{
|
||||
gboolean res;
|
||||
GdkScreen *screen;
|
||||
GdkWindow *root_window;
|
||||
GdkWindow *window;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -27,15 +27,13 @@
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmain.h"
|
||||
#include "broadway.h"
|
||||
#include "gdkbroadway-server.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkBroadwayDisplay GdkBroadwayDisplay;
|
||||
typedef struct _GdkBroadwayDisplayClass GdkBroadwayDisplayClass;
|
||||
|
||||
typedef struct BroadwayInput BroadwayInput;
|
||||
|
||||
#define GDK_TYPE_BROADWAY_DISPLAY (gdk_broadway_display_get_type())
|
||||
#define GDK_BROADWAY_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplay))
|
||||
#define GDK_BROADWAY_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
|
||||
@@ -43,82 +41,6 @@ typedef struct BroadwayInput BroadwayInput;
|
||||
#define GDK_IS_BROADWAY_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_DISPLAY))
|
||||
#define GDK_BROADWAY_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_DISPLAY, GdkBroadwayDisplayClass))
|
||||
|
||||
typedef struct {
|
||||
char type;
|
||||
guint32 serial;
|
||||
guint64 time;
|
||||
} BroadwayInputBaseMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
guint32 mouse_window_id; /* The real window, not taking grabs into account */
|
||||
guint32 event_window_id;
|
||||
int root_x;
|
||||
int root_y;
|
||||
int win_x;
|
||||
int win_y;
|
||||
guint32 state;
|
||||
} BroadwayInputPointerMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
guint32 mode;
|
||||
} BroadwayInputCrossingMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
guint32 button;
|
||||
} BroadwayInputButtonMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputPointerMsg pointer;
|
||||
int dir;
|
||||
} BroadwayInputScrollMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
guint32 state;
|
||||
int key;
|
||||
} BroadwayInputKeyMsg;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
int res;
|
||||
} BroadwayInputGrabReply;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
int id;
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
} BroadwayInputConfigureNotify;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
int width;
|
||||
int height;
|
||||
} BroadwayInputScreenResizeNotify;
|
||||
|
||||
typedef struct {
|
||||
BroadwayInputBaseMsg base;
|
||||
int id;
|
||||
} BroadwayInputDeleteNotify;
|
||||
|
||||
typedef union {
|
||||
BroadwayInputBaseMsg base;
|
||||
BroadwayInputPointerMsg pointer;
|
||||
BroadwayInputCrossingMsg crossing;
|
||||
BroadwayInputButtonMsg button;
|
||||
BroadwayInputScrollMsg scroll;
|
||||
BroadwayInputKeyMsg key;
|
||||
BroadwayInputGrabReply grab_reply;
|
||||
BroadwayInputConfigureNotify configure_notify;
|
||||
BroadwayInputDeleteNotify delete_notify;
|
||||
BroadwayInputScreenResizeNotify screen_resize_notify;
|
||||
} BroadwayInputMsg;
|
||||
|
||||
struct _GdkBroadwayDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
@@ -129,10 +51,6 @@ struct _GdkBroadwayDisplay
|
||||
GList *toplevels;
|
||||
|
||||
GSource *event_source;
|
||||
GdkWindow *mouse_in_toplevel;
|
||||
int last_x, last_y; /* in root coords */
|
||||
guint32 last_state;
|
||||
GdkWindow *real_mouse_in_toplevel; /* Not affected by grabs */
|
||||
|
||||
/* Keyboard related information */
|
||||
GdkKeymap *keymap;
|
||||
@@ -147,24 +65,7 @@ struct _GdkBroadwayDisplay
|
||||
/* The offscreen window that has the pointer in it (if any) */
|
||||
GdkWindow *active_offscreen_window;
|
||||
|
||||
GSocketService *service;
|
||||
BroadwayOutput *output;
|
||||
guint32 saved_serial;
|
||||
guint64 last_seen_time;
|
||||
BroadwayInput *input;
|
||||
GList *input_messages;
|
||||
guint process_input_idle;
|
||||
|
||||
/* Explicit pointer grabs: */
|
||||
GdkWindow *pointer_grab_window;
|
||||
guint32 pointer_grab_time;
|
||||
gboolean pointer_grab_owner_events;
|
||||
|
||||
/* Future data, from the currently queued events */
|
||||
int future_root_x;
|
||||
int future_root_y;
|
||||
GdkModifierType future_state;
|
||||
int future_mouse_in_toplevel;
|
||||
GdkBroadwayServer *server;
|
||||
};
|
||||
|
||||
struct _GdkBroadwayDisplayClass
|
||||
|
@@ -87,9 +87,9 @@ gdk_event_source_check (GSource *source)
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
BroadwayInputMsg *message)
|
||||
_gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
GdkBroadwayDisplay *display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
GdkScreen *screen;
|
||||
GdkWindow *window;
|
||||
@@ -97,17 +97,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
GList *node;
|
||||
|
||||
switch (message->base.type) {
|
||||
case 'e': /* Enter */
|
||||
display_broadway->last_x = message->pointer.root_x;
|
||||
display_broadway->last_y = message->pointer.root_y;
|
||||
display_broadway->last_state = message->pointer.state;
|
||||
display_broadway->real_mouse_in_toplevel =
|
||||
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
|
||||
|
||||
case BROADWAY_EVENT_ENTER:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
|
||||
|
||||
/* TODO: Unset when it dies */
|
||||
display_broadway->mouse_in_toplevel = window;
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_ENTER_NOTIFY);
|
||||
@@ -134,16 +125,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
}
|
||||
break;
|
||||
case 'l': /* Leave */
|
||||
display_broadway->last_x = message->pointer.root_x;
|
||||
display_broadway->last_y = message->pointer.root_y;
|
||||
display_broadway->last_state = message->pointer.state;
|
||||
display_broadway->real_mouse_in_toplevel =
|
||||
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
|
||||
|
||||
case BROADWAY_EVENT_LEAVE:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
|
||||
|
||||
display_broadway->mouse_in_toplevel = NULL;
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_LEAVE_NOTIFY);
|
||||
@@ -170,13 +153,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
}
|
||||
break;
|
||||
case 'm': /* Mouse move */
|
||||
display_broadway->last_x = message->pointer.root_x;
|
||||
display_broadway->last_y = message->pointer.root_y;
|
||||
display_broadway->last_state = message->pointer.state;
|
||||
display_broadway->real_mouse_in_toplevel =
|
||||
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
|
||||
|
||||
case BROADWAY_EVENT_POINTER_MOVE:
|
||||
if (_gdk_broadway_moveresize_handle_event (display, message))
|
||||
break;
|
||||
|
||||
@@ -198,14 +175,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
|
||||
break;
|
||||
case 'b':
|
||||
case 'B':
|
||||
display_broadway->last_x = message->pointer.root_x;
|
||||
display_broadway->last_y = message->pointer.root_y;
|
||||
display_broadway->last_state = message->pointer.state;
|
||||
display_broadway->real_mouse_in_toplevel =
|
||||
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
|
||||
|
||||
case BROADWAY_EVENT_BUTTON_PRESS:
|
||||
case BROADWAY_EVENT_BUTTON_RELEASE:
|
||||
if (message->base.type != 'b' &&
|
||||
_gdk_broadway_moveresize_handle_event (display, message))
|
||||
break;
|
||||
@@ -229,13 +200,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
|
||||
break;
|
||||
case 's':
|
||||
display_broadway->last_x = message->pointer.root_x;
|
||||
display_broadway->last_y = message->pointer.root_y;
|
||||
display_broadway->last_state = message->pointer.state;
|
||||
display_broadway->real_mouse_in_toplevel =
|
||||
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
|
||||
|
||||
case BROADWAY_EVENT_SCROLL:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
|
||||
if (window)
|
||||
{
|
||||
@@ -254,10 +219,10 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
|
||||
break;
|
||||
case 'k':
|
||||
case 'K':
|
||||
window = display_broadway->mouse_in_toplevel;
|
||||
|
||||
case BROADWAY_EVENT_KEY_PRESS:
|
||||
case BROADWAY_EVENT_KEY_RELEASE:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht,
|
||||
GINT_TO_POINTER (message->key.mouse_window_id));
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (message->base.type == 'k' ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
@@ -269,19 +234,17 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
event->key.length = 0;
|
||||
gdk_event_set_device (event, display->core_pointer);
|
||||
|
||||
display_broadway->last_state = message->key.state;
|
||||
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'g':
|
||||
case 'u':
|
||||
case BROADWAY_EVENT_GRAB_NOTIFY:
|
||||
case BROADWAY_EVENT_UNGRAB_NOTIFY:
|
||||
_gdk_display_device_grab_update (display, display->core_pointer, NULL, message->base.serial);
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->configure_notify.id));
|
||||
if (window)
|
||||
{
|
||||
@@ -312,7 +275,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
case BROADWAY_EVENT_DELETE_NOTIFY:
|
||||
window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->delete_notify.id));
|
||||
if (window)
|
||||
{
|
||||
@@ -324,7 +287,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
case BROADWAY_EVENT_SCREEN_SIZE_CHANGED:
|
||||
screen = gdk_display_get_default_screen (display);
|
||||
window = gdk_screen_get_root_window (screen);
|
||||
window->width = message->screen_resize_notify.width;
|
||||
@@ -335,7 +298,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
break;
|
||||
|
||||
default:
|
||||
g_printerr ("Unknown input command %c\n", message->base.type);
|
||||
g_printerr ("_gdk_broadway_events_got_input - Unknown input command %c\n", message->base.type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -126,8 +126,7 @@ GList *_gdk_broadway_screen_list_visuals (GdkScreen *screen);
|
||||
void _gdk_broadway_screen_size_changed (GdkScreen *screen,
|
||||
BroadwayInputScreenResizeNotify *msg);
|
||||
|
||||
void _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
BroadwayInputMsg *message);
|
||||
void _gdk_broadway_events_got_input (BroadwayInputMsg *message);
|
||||
|
||||
void _gdk_broadway_screen_init_root_window (GdkScreen *screen);
|
||||
void _gdk_broadway_screen_init_visuals (GdkScreen *screen);
|
||||
|
@@ -83,95 +83,17 @@ G_DEFINE_TYPE (GdkWindowImplBroadway,
|
||||
gdk_window_impl_broadway,
|
||||
GDK_TYPE_WINDOW_IMPL)
|
||||
|
||||
static void
|
||||
diff_surfaces (cairo_surface_t *surface,
|
||||
cairo_surface_t *old_surface)
|
||||
{
|
||||
guint8 *data, *old_data;
|
||||
guint32 *line, *old_line;
|
||||
int w, h, stride, old_stride;
|
||||
int x, y;
|
||||
|
||||
data = cairo_image_surface_get_data (surface);
|
||||
old_data = cairo_image_surface_get_data (old_surface);
|
||||
|
||||
w = cairo_image_surface_get_width (surface);
|
||||
h = cairo_image_surface_get_height (surface);
|
||||
|
||||
stride = cairo_image_surface_get_stride (surface);
|
||||
old_stride = cairo_image_surface_get_stride (old_surface);
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
line = (guint32 *)data;
|
||||
old_line = (guint32 *)old_data;
|
||||
|
||||
for (x = 0; x < w; x++)
|
||||
{
|
||||
if ((*line & 0xffffff) == (*old_line & 0xffffff))
|
||||
*old_line = 0;
|
||||
else
|
||||
*old_line = *line | 0xff000000;
|
||||
line ++;
|
||||
old_line ++;
|
||||
}
|
||||
|
||||
data += stride;
|
||||
old_data += old_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static guint dirty_flush_id = 0;
|
||||
|
||||
static void
|
||||
window_data_send (BroadwayOutput *output, GdkWindowImplBroadway *impl)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
if (impl->surface == NULL)
|
||||
return;
|
||||
|
||||
if (impl->last_synced)
|
||||
{
|
||||
diff_surfaces (impl->surface,
|
||||
impl->last_surface);
|
||||
broadway_output_put_rgba (output, impl->id, 0, 0,
|
||||
cairo_image_surface_get_width (impl->last_surface),
|
||||
cairo_image_surface_get_height (impl->last_surface),
|
||||
cairo_image_surface_get_stride (impl->last_surface),
|
||||
cairo_image_surface_get_data (impl->last_surface));
|
||||
}
|
||||
else
|
||||
{
|
||||
impl->last_synced = TRUE;
|
||||
broadway_output_put_rgb (output, impl->id, 0, 0,
|
||||
cairo_image_surface_get_width (impl->surface),
|
||||
cairo_image_surface_get_height (impl->surface),
|
||||
cairo_image_surface_get_stride (impl->surface),
|
||||
cairo_image_surface_get_data (impl->surface));
|
||||
}
|
||||
|
||||
broadway_output_surface_flush (output, impl->id);
|
||||
|
||||
cr = cairo_create (impl->last_surface);
|
||||
cairo_set_source_surface (cr, impl->surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dirty_flush_idle (gpointer data)
|
||||
{
|
||||
GList *l;
|
||||
GdkBroadwayDisplay *display;
|
||||
BroadwayOutput *output;
|
||||
|
||||
dirty_flush_id = 0;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
output = display->output;
|
||||
if (output == NULL)
|
||||
return FALSE;
|
||||
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
@@ -180,11 +102,15 @@ dirty_flush_idle (gpointer data)
|
||||
if (impl->dirty)
|
||||
{
|
||||
impl->dirty = FALSE;
|
||||
window_data_send (display->output, impl);
|
||||
_gdk_broadway_server_window_update (display->server,
|
||||
impl->id,
|
||||
impl->surface);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_display_flush (GDK_DISPLAY (display));
|
||||
/* We sync here to ensure all references to the impl->surface memory
|
||||
is done, as we may later paint new data in them. */
|
||||
gdk_display_sync (GDK_DISPLAY (display));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -192,64 +118,10 @@ dirty_flush_idle (gpointer data)
|
||||
static void
|
||||
queue_dirty_flush (GdkBroadwayDisplay *display)
|
||||
{
|
||||
if (dirty_flush_id == 0 && display->output != NULL)
|
||||
if (dirty_flush_id == 0)
|
||||
dirty_flush_id = gdk_threads_add_idle (dirty_flush_idle, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_resync_windows (void)
|
||||
{
|
||||
GdkBroadwayDisplay *display;
|
||||
GList *l;
|
||||
|
||||
dirty_flush_id = 0;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
|
||||
/* First create all windows */
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = l->data;
|
||||
GdkWindow *window;
|
||||
|
||||
window = impl->wrapper;
|
||||
|
||||
if (impl->id == 0)
|
||||
continue; /* Skip root */
|
||||
|
||||
impl->dirty = FALSE;
|
||||
impl->last_synced = FALSE;
|
||||
broadway_output_new_surface (display->output,
|
||||
impl->id,
|
||||
window->x,
|
||||
window->y,
|
||||
window->width,
|
||||
window->height,
|
||||
window->window_type == GDK_WINDOW_TEMP);
|
||||
}
|
||||
|
||||
/* Then do everything that may reference other windows */
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = l->data;
|
||||
|
||||
if (impl->id == 0)
|
||||
continue; /* Skip root */
|
||||
|
||||
if (impl->transient_for)
|
||||
broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
|
||||
/* Can't check GDK_WINDOW_IS_MAPPED here, because that doesn't correctly handle
|
||||
withdrawn windows like menus */
|
||||
if (impl->visible)
|
||||
{
|
||||
broadway_output_show_surface (display->output, impl->id);
|
||||
window_data_send (display->output, impl);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_display_flush (GDK_DISPLAY (display));
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_impl_broadway_init (GdkWindowImplBroadway *impl)
|
||||
{
|
||||
@@ -275,12 +147,6 @@ gdk_window_impl_broadway_finalize (GObject *object)
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper));
|
||||
|
||||
if (broadway_display->mouse_in_toplevel == GDK_WINDOW (wrapper))
|
||||
{
|
||||
/* TODO: Send leave + enter event, update cursors, etc */
|
||||
broadway_display->mouse_in_toplevel = NULL;
|
||||
}
|
||||
|
||||
g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER(impl->id));
|
||||
|
||||
if (impl->cursor)
|
||||
@@ -315,6 +181,7 @@ _gdk_broadway_screen_init_root_window (GdkScreen * screen)
|
||||
|
||||
impl->screen = screen;
|
||||
impl->wrapper = window;
|
||||
impl->id = 0;
|
||||
|
||||
window->window_type = GDK_WINDOW_ROOT;
|
||||
window->depth = 24;
|
||||
@@ -341,13 +208,17 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
static int current_id = 1; /* 0 is the root window */
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
|
||||
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_BROADWAY, NULL);
|
||||
window->impl = (GdkWindowImpl *)impl;
|
||||
impl->id = current_id++;
|
||||
impl->id = _gdk_broadway_server_new_window (broadway_display->server,
|
||||
window->x,
|
||||
window->y,
|
||||
window->width,
|
||||
window->height,
|
||||
window->window_type == GDK_WINDOW_TEMP);
|
||||
g_hash_table_insert (broadway_display->id_ht, GINT_TO_POINTER(impl->id), window);
|
||||
impl->wrapper = window;
|
||||
|
||||
@@ -358,37 +229,22 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
g_assert (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT);
|
||||
|
||||
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
|
||||
|
||||
if (broadway_display->output)
|
||||
broadway_output_new_surface (broadway_display->output,
|
||||
impl->id,
|
||||
window->x,
|
||||
window->y,
|
||||
window->width,
|
||||
window->height,
|
||||
window->window_type == GDK_WINDOW_TEMP);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_resize_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
cairo_surface_t *old, *last_old;
|
||||
cairo_surface_t *old;
|
||||
|
||||
if (impl->surface)
|
||||
{
|
||||
old = impl->surface;
|
||||
last_old = impl->last_surface;
|
||||
|
||||
impl->surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
|
||||
gdk_window_get_width (impl->wrapper),
|
||||
gdk_window_get_height (impl->wrapper));
|
||||
impl->last_surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
|
||||
gdk_window_get_width (impl->wrapper),
|
||||
gdk_window_get_height (impl->wrapper));
|
||||
impl->surface = _gdk_broadway_server_create_surface (gdk_window_get_width (impl->wrapper),
|
||||
gdk_window_get_height (impl->wrapper));
|
||||
|
||||
cairo_surface_destroy (old);
|
||||
cairo_surface_destroy (last_old);
|
||||
}
|
||||
|
||||
if (impl->ref_surface)
|
||||
@@ -413,7 +269,6 @@ static cairo_surface_t *
|
||||
gdk_window_broadway_ref_cairo_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
cairo_t *cr;
|
||||
int w, h;
|
||||
|
||||
if (GDK_IS_WINDOW_IMPL_BROADWAY (window) &&
|
||||
@@ -425,22 +280,7 @@ gdk_window_broadway_ref_cairo_surface (GdkWindow *window)
|
||||
|
||||
/* Create actual backing store if missing */
|
||||
if (!impl->surface)
|
||||
{
|
||||
impl->surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, w, h);
|
||||
impl->last_surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, w, h);
|
||||
|
||||
cr = cairo_create (impl->surface);
|
||||
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
||||
cairo_rectangle (cr, 0, 0, w, h);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
|
||||
cr = cairo_create (impl->last_surface);
|
||||
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
||||
cairo_rectangle (cr, 0, 0, w, h);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
impl->surface = _gdk_broadway_server_create_surface (w, h);
|
||||
|
||||
/* Create a destroyable surface referencing the real one */
|
||||
if (!impl->ref_surface)
|
||||
@@ -485,16 +325,13 @@ _gdk_broadway_window_destroy (GdkWindow *window,
|
||||
{
|
||||
cairo_surface_destroy (impl->surface);
|
||||
impl->surface = NULL;
|
||||
cairo_surface_destroy (impl->last_surface);
|
||||
impl->last_surface = NULL;
|
||||
}
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER(impl->id));
|
||||
|
||||
if (broadway_display->output)
|
||||
broadway_output_destroy_surface (broadway_display->output,
|
||||
impl->id);
|
||||
_gdk_broadway_server_destroy_window (broadway_display->server,
|
||||
impl->id);
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
@@ -546,11 +383,9 @@ gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped)
|
||||
_gdk_make_event (GDK_WINDOW (window), GDK_MAP, NULL, FALSE);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (broadway_display->output)
|
||||
{
|
||||
broadway_output_show_surface (broadway_display->output, impl->id);
|
||||
queue_dirty_flush (broadway_display);
|
||||
}
|
||||
if (_gdk_broadway_server_window_show (broadway_display->server, impl->id))
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -569,17 +404,8 @@ gdk_window_broadway_hide (GdkWindow *window)
|
||||
_gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (broadway_display->output)
|
||||
{
|
||||
broadway_output_hide_surface (broadway_display->output, impl->id);
|
||||
queue_dirty_flush (broadway_display);
|
||||
}
|
||||
|
||||
if (broadway_display->mouse_in_toplevel == window)
|
||||
{
|
||||
/* TODO: Send leave + enter event, update cursors, etc */
|
||||
broadway_display->mouse_in_toplevel = NULL;
|
||||
}
|
||||
if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
_gdk_window_clear_update_area (window);
|
||||
}
|
||||
@@ -600,23 +426,14 @@ gdk_window_broadway_move_resize (GdkWindow *window,
|
||||
{
|
||||
GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
gboolean changed, size_changed;;
|
||||
gboolean with_resize;
|
||||
gboolean size_changed;
|
||||
|
||||
size_changed = changed = FALSE;
|
||||
size_changed = FALSE;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (with_move)
|
||||
{
|
||||
changed = TRUE;
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
}
|
||||
|
||||
with_resize = FALSE;
|
||||
if (width > 0 || height > 0)
|
||||
{
|
||||
with_resize = TRUE;
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
|
||||
@@ -626,7 +443,6 @@ gdk_window_broadway_move_resize (GdkWindow *window,
|
||||
if (width != window->width ||
|
||||
height != window->height)
|
||||
{
|
||||
changed = TRUE;
|
||||
size_changed = TRUE;
|
||||
|
||||
/* Resize clears the content */
|
||||
@@ -639,35 +455,14 @@ gdk_window_broadway_move_resize (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
GdkEvent *event;
|
||||
GList *node;
|
||||
|
||||
if (broadway_display->output != NULL)
|
||||
{
|
||||
broadway_output_move_resize_surface (broadway_display->output,
|
||||
impl->id,
|
||||
with_move, window->x, window->y,
|
||||
with_resize, window->width, window->height);
|
||||
queue_dirty_flush (broadway_display);
|
||||
if (size_changed)
|
||||
window->resize_count++;
|
||||
}
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.window = g_object_ref (window);
|
||||
event->configure.x = window->x;
|
||||
event->configure.y = window->y;
|
||||
event->configure.width = window->width;
|
||||
event->configure.height = window->height;
|
||||
|
||||
gdk_event_set_device (event, GDK_DISPLAY_OBJECT (broadway_display)->core_pointer);
|
||||
|
||||
node = _gdk_event_queue_append (GDK_DISPLAY_OBJECT (broadway_display), event);
|
||||
_gdk_windowing_got_event (GDK_DISPLAY_OBJECT (broadway_display), node, event,
|
||||
_gdk_display_get_next_serial (GDK_DISPLAY (broadway_display)) - 1);
|
||||
}
|
||||
_gdk_broadway_server_window_move_resize (broadway_display->server,
|
||||
impl->id,
|
||||
with_move,
|
||||
x, y,
|
||||
window->width, window->height);
|
||||
queue_dirty_flush (broadway_display);
|
||||
if (size_changed)
|
||||
window->resize_count++;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -787,11 +582,7 @@ gdk_broadway_window_set_transient_for (GdkWindow *window,
|
||||
impl->transient_for = parent_id;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper));
|
||||
if (display->output)
|
||||
{
|
||||
broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
|
||||
gdk_display_flush (GDK_DISPLAY (display));
|
||||
}
|
||||
_gdk_broadway_server_window_set_transient_for (display->server, impl->id, impl->transient_for);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1324,20 +1115,10 @@ moveresize_lookahead (GdkDisplay *display,
|
||||
BroadwayInputMsg *event)
|
||||
{
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
BroadwayInputMsg *message;
|
||||
GList *l;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
for (l = broadway_display->input_messages; l != NULL; l = l->next)
|
||||
{
|
||||
message = l->data;
|
||||
if (message->base.type == 'm')
|
||||
return FALSE;
|
||||
if (message->base.type == 'b')
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return !_gdk_broadway_server_lookahead_event (broadway_display->server, "mb");
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1480,8 +1261,6 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
|
||||
/* We need a connection to be able to get mouse events, if not, punt */
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (!broadway_display->output)
|
||||
return;
|
||||
|
||||
mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE);
|
||||
|
||||
@@ -1515,20 +1294,6 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window,
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_enable_synchronized_configure (GdkWindow *window)
|
||||
{
|
||||
if (!GDK_IS_WINDOW_IMPL_BROADWAY (window->impl))
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_configure_finished (GdkWindow *window)
|
||||
{
|
||||
if (!WINDOW_IS_TOPLEVEL (window))
|
||||
return;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_window_beep (GdkWindow *window)
|
||||
{
|
||||
@@ -1622,9 +1387,6 @@ _gdk_broadway_window_translate (GdkWindow *window,
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
int n_rects, i;
|
||||
BroadwayRect *rects;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
@@ -1632,26 +1394,11 @@ _gdk_broadway_window_translate (GdkWindow *window,
|
||||
{
|
||||
copy_region (impl->surface, area, dx, dy);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (GDK_WINDOW_IMPL_BROADWAY (impl)->last_synced &&
|
||||
broadway_display->output)
|
||||
{
|
||||
copy_region (impl->last_surface, area, dx, dy);
|
||||
n_rects = cairo_region_num_rectangles (area);
|
||||
rects = g_new (BroadwayRect, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (area, i, &rect);
|
||||
rects[i].x = rect.x;
|
||||
rects[i].y = rect.y;
|
||||
rects[i].width = rect.width;
|
||||
rects[i].height = rect.height;
|
||||
}
|
||||
broadway_output_copy_rectangles (broadway_display->output,
|
||||
GDK_WINDOW_IMPL_BROADWAY (impl)->id,
|
||||
rects, n_rects, dx, dy);
|
||||
queue_dirty_flush (broadway_display);
|
||||
g_free (rects);
|
||||
}
|
||||
|
||||
if (_gdk_broadway_server_window_translate (broadway_display->server,
|
||||
impl->id,
|
||||
area, dx, dy))
|
||||
queue_dirty_flush (broadway_display);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1661,8 +1408,7 @@ gdk_broadway_get_last_seen_time (GdkWindow *window)
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
_gdk_broadway_display_consume_all_input (display);
|
||||
return (guint32) GDK_BROADWAY_DISPLAY (display)->last_seen_time;
|
||||
return _gdk_broadway_server_get_last_seen_time (GDK_BROADWAY_DISPLAY (display)->server);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1739,8 +1485,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
|
||||
impl_class->set_functions = gdk_broadway_window_set_functions;
|
||||
impl_class->begin_resize_drag = gdk_broadway_window_begin_resize_drag;
|
||||
impl_class->begin_move_drag = gdk_broadway_window_begin_move_drag;
|
||||
impl_class->enable_synchronized_configure = gdk_broadway_window_enable_synchronized_configure;
|
||||
impl_class->configure_finished = gdk_broadway_window_configure_finished;
|
||||
impl_class->set_opacity = gdk_broadway_window_set_opacity;
|
||||
impl_class->set_composited = gdk_broadway_window_set_composited;
|
||||
impl_class->destroy_notify = gdk_broadway_window_destroy_notify;
|
||||
|
@@ -138,7 +138,8 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{"multihead", GDK_DEBUG_MULTIHEAD},
|
||||
{"xinerama", GDK_DEBUG_XINERAMA},
|
||||
{"draw", GDK_DEBUG_DRAW},
|
||||
{"eventloop", GDK_DEBUG_EVENTLOOP}
|
||||
{"eventloop", GDK_DEBUG_EVENTLOOP},
|
||||
{"frames", GDK_DEBUG_FRAMES}
|
||||
};
|
||||
|
||||
static gboolean
|
||||
|
@@ -188,6 +188,7 @@ gdk_events_pending
|
||||
gdk_event_type_get_type
|
||||
gdk_filter_return_get_type
|
||||
gdk_flush
|
||||
gdk_fullscreen_mode_get_type
|
||||
gdk_get_default_root_window
|
||||
gdk_get_display
|
||||
gdk_get_display_arg_name
|
||||
@@ -410,6 +411,7 @@ gdk_window_get_effective_toplevel
|
||||
gdk_window_get_events
|
||||
gdk_window_get_focus_on_map
|
||||
gdk_window_get_frame_extents
|
||||
gdk_window_get_fullscreen_mode
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_group
|
||||
gdk_window_get_height
|
||||
@@ -482,6 +484,7 @@ gdk_window_set_device_cursor
|
||||
gdk_window_set_device_events
|
||||
gdk_window_set_events
|
||||
gdk_window_set_focus_on_map
|
||||
gdk_window_set_fullscreen_mode
|
||||
gdk_window_set_functions
|
||||
gdk_window_set_geometry_hints
|
||||
gdk_window_set_group
|
||||
|
@@ -18,13 +18,13 @@
|
||||
* Author: Alexander Larsson <alexl@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
#define __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
#define __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_CAIRO_H__
|
||||
#define __GDK_CAIRO_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_CAIRO_H__
|
||||
#define __GDK_CAIRO_H__
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdkcolor.h>
|
||||
#include <gdk/gdkrgba.h>
|
||||
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_COLOR_H__
|
||||
#define __GDK_COLOR_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_COLOR_H__
|
||||
#define __GDK_COLOR_H__
|
||||
|
||||
#include <cairo.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_CURSOR_H__
|
||||
#define __GDK_CURSOR_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_CURSOR_H__
|
||||
#define __GDK_CURSOR_H__
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DEVICE_H__
|
||||
#define __GDK_DEVICE_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DEVICE_H__
|
||||
#define __GDK_DEVICE_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DEVICE_MANAGER_H__
|
||||
#define __GDK_DEVICE_MANAGER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DEVICE_MANAGER_H__
|
||||
#define __GDK_DEVICE_MANAGER_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkdevice.h>
|
||||
|
||||
|
@@ -307,7 +307,11 @@ gdk_display_get_event (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
if (display->event_pause_count > 0)
|
||||
return NULL;
|
||||
|
||||
GDK_DISPLAY_GET_CLASS (display)->queue_events (display);
|
||||
|
||||
return _gdk_event_unqueue (display);
|
||||
}
|
||||
|
||||
@@ -985,7 +989,8 @@ switch_to_pointer_grab (GdkDisplay *display,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
if (pointer_window != last_grab->window)
|
||||
if (!info->need_touch_press_enter &&
|
||||
pointer_window != last_grab->window)
|
||||
synthesize_crossing_events (display, device, source_device,
|
||||
last_grab->window, pointer_window,
|
||||
GDK_CROSSING_UNGRAB, time, serial);
|
||||
@@ -2002,6 +2007,38 @@ gdk_display_notify_startup_complete (GdkDisplay *display,
|
||||
GDK_DISPLAY_GET_CLASS (display)->notify_startup_complete (display, startup_id);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_pause_events (GdkDisplay *display)
|
||||
{
|
||||
display->event_pause_count++;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_unpause_events (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (display->event_pause_count > 0);
|
||||
|
||||
display->event_pause_count--;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_flush_events (GdkDisplay *display)
|
||||
{
|
||||
display->flushing_events = TRUE;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
GdkEvent *event = _gdk_event_unqueue (display);
|
||||
if (event == NULL)
|
||||
break;
|
||||
|
||||
_gdk_event_emit (event);
|
||||
gdk_event_free (event);
|
||||
}
|
||||
|
||||
display->flushing_events = FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *event,
|
||||
|
@@ -19,13 +19,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DISPLAY_H__
|
||||
#define __GDK_DISPLAY_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DISPLAY_H__
|
||||
#define __GDK_DISPLAY_H__
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkevents.h>
|
||||
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DISPLAY_MANAGER_H__
|
||||
#define __GDK_DISPLAY_MANAGER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DISPLAY_MANAGER_H__
|
||||
#define __GDK_DISPLAY_MANAGER_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkdisplay.h>
|
||||
|
||||
|
@@ -113,7 +113,10 @@ struct _GdkDisplay
|
||||
guint double_click_time; /* Maximum time between clicks in msecs */
|
||||
GdkDevice *core_pointer; /* Core pointer device */
|
||||
|
||||
guint event_pause_count; /* How many times events are blocked */
|
||||
|
||||
guint closed : 1; /* Whether this display has been closed */
|
||||
guint flushing_events : 1; /* Inside gdk_display_flush_events */
|
||||
|
||||
GArray *touch_implicit_grabs;
|
||||
GHashTable *device_grabs;
|
||||
@@ -296,6 +299,9 @@ void _gdk_display_pointer_info_foreach (GdkDisplay *display
|
||||
GdkDisplayPointerInfoForeach func,
|
||||
gpointer user_data);
|
||||
gulong _gdk_display_get_next_serial (GdkDisplay *display);
|
||||
void _gdk_display_pause_events (GdkDisplay *display);
|
||||
void _gdk_display_unpause_events (GdkDisplay *display);
|
||||
void _gdk_display_flush_events (GdkDisplay *display);
|
||||
void _gdk_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *event,
|
||||
GdkEvent *new_event);
|
||||
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DND_H__
|
||||
#define __GDK_DND_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_DND_H__
|
||||
#define __GDK_DND_H__
|
||||
|
||||
#include <gdk/gdktypes.h>
|
||||
#include <gdk/gdkdevice.h>
|
||||
|
||||
|
@@ -85,13 +85,27 @@ _gdk_event_emit (GdkEvent *event)
|
||||
GList*
|
||||
_gdk_event_queue_find_first (GdkDisplay *display)
|
||||
{
|
||||
GList *tmp_list = display->queued_events;
|
||||
GList *tmp_list;
|
||||
GList *pending_motion = NULL;
|
||||
|
||||
if (display->event_pause_count > 0)
|
||||
return NULL;
|
||||
|
||||
tmp_list = display->queued_events;
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkEventPrivate *event = tmp_list->data;
|
||||
if (!(event->flags & GDK_EVENT_PENDING))
|
||||
return tmp_list;
|
||||
|
||||
if (event->flags & GDK_EVENT_PENDING)
|
||||
continue;
|
||||
|
||||
if (pending_motion)
|
||||
return pending_motion;
|
||||
|
||||
if (event->event.type == GDK_MOTION_NOTIFY && !display->flushing_events)
|
||||
pending_motion = tmp_list;
|
||||
else
|
||||
return tmp_list;
|
||||
|
||||
tmp_list = g_list_next (tmp_list);
|
||||
}
|
||||
@@ -248,6 +262,61 @@ _gdk_event_unqueue (GdkDisplay *display)
|
||||
return event;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_event_queue_handle_motion_compression (GdkDisplay *display)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GList *pending_motions = NULL;
|
||||
GdkWindow *pending_motion_window = NULL;
|
||||
GdkDevice *pending_motion_device = NULL;
|
||||
|
||||
/* If the last N events in the event queue are motion notify
|
||||
* events for the same window, drop all but the last */
|
||||
|
||||
tmp_list = display->queued_tail;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkEventPrivate *event = tmp_list->data;
|
||||
|
||||
if (event->flags & GDK_EVENT_PENDING)
|
||||
break;
|
||||
|
||||
if (event->event.type != GDK_MOTION_NOTIFY)
|
||||
break;
|
||||
|
||||
if (pending_motion_window != NULL &&
|
||||
pending_motion_window != event->event.motion.window)
|
||||
break;
|
||||
|
||||
if (pending_motion_device != NULL &&
|
||||
pending_motion_device != event->event.motion.device)
|
||||
break;
|
||||
|
||||
pending_motion_window = event->event.motion.window;
|
||||
pending_motion_device = event->event.motion.device;
|
||||
pending_motions = tmp_list;
|
||||
|
||||
tmp_list = tmp_list->prev;
|
||||
}
|
||||
|
||||
while (pending_motions && pending_motions->next != NULL)
|
||||
{
|
||||
GList *next = pending_motions->next;
|
||||
display->queued_events = g_list_delete_link (display->queued_events,
|
||||
pending_motions);
|
||||
pending_motions = next;
|
||||
}
|
||||
|
||||
if (pending_motions &&
|
||||
pending_motions == display->queued_events &&
|
||||
pending_motions == display->queued_tail)
|
||||
{
|
||||
GdkFrameClock *clock = gdk_window_get_frame_clock (pending_motion_window);
|
||||
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_event_handler_set:
|
||||
* @func: the function to call to handle events from GDK.
|
||||
|
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_EVENTS_H__
|
||||
#define __GDK_EVENTS_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_EVENTS_H__
|
||||
#define __GDK_EVENTS_H__
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdkcolor.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user