Compare commits
330 Commits
3.6.0
...
wip/css-op
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90bcb52293 | ||
|
|
3b48e562dd | ||
|
|
fc12246758 | ||
|
|
ae194d14d1 | ||
|
|
c55a492ad3 | ||
|
|
b70d8c477d | ||
|
|
73c436f43e | ||
|
|
c627b22126 | ||
|
|
e677cee28f | ||
|
|
2927383b5f | ||
|
|
2d9454363f | ||
|
|
eb7bf0a2f4 | ||
|
|
4f6e1fdf16 | ||
|
|
ddceddaa84 | ||
|
|
da09447914 | ||
|
|
d0af25f12c | ||
|
|
6e3d687386 | ||
|
|
6333cd8e83 | ||
|
|
8d28e2d8e9 | ||
|
|
e5948f5713 | ||
|
|
d967500c92 | ||
|
|
4be82195e4 | ||
|
|
455a0ecc1c | ||
|
|
2d5ad5f54e | ||
|
|
352c7f5120 | ||
|
|
c3f3a82db9 | ||
|
|
b55724e3a7 | ||
|
|
f2e05e2b41 | ||
|
|
bfbb9a58ae | ||
|
|
870657d57b | ||
|
|
4bc264a514 | ||
|
|
18fdc975be | ||
|
|
ed5d7fed89 | ||
|
|
2f8c2a3244 | ||
|
|
5671a869c2 | ||
|
|
f9b2edff39 | ||
|
|
53262cf7a6 | ||
|
|
6d3b4d9382 | ||
|
|
d3143779d2 | ||
|
|
43fc428cf0 | ||
|
|
70ba973d1d | ||
|
|
fd6ea42319 | ||
|
|
0e0ee480d3 | ||
|
|
78d0ef1d0b | ||
|
|
14c8e33ab9 | ||
|
|
c08efb2b32 | ||
|
|
c98ee1ec39 | ||
|
|
4366f80aab | ||
|
|
15570dd63d | ||
|
|
10c47c0226 | ||
|
|
0a1a2ac148 | ||
|
|
aa989a637a | ||
|
|
50a09957a4 | ||
|
|
e57ecafb6b | ||
|
|
b7743430aa | ||
|
|
77c0f9d8e6 | ||
|
|
872097603f | ||
|
|
5e01a05b30 | ||
|
|
a08eb4d58a | ||
|
|
8449e05865 | ||
|
|
b0f3aa82b7 | ||
|
|
4950f68a87 | ||
|
|
5f20d909e6 | ||
|
|
c59e8de533 | ||
|
|
e8f2eeac92 | ||
|
|
aae2bf91cb | ||
|
|
10c3a66e40 | ||
|
|
42fc6ab5d3 | ||
|
|
c8de9abe98 | ||
|
|
e60c9219f1 | ||
|
|
1c4158a649 | ||
|
|
55d65571f3 | ||
|
|
77912a65e2 | ||
|
|
8a40d8fe2a | ||
|
|
c94002f8c0 | ||
|
|
f4438a1ffc | ||
|
|
3563d11fc6 | ||
|
|
7b950944b0 | ||
|
|
ffeef28dbc | ||
|
|
0d9a45d460 | ||
|
|
947fed0961 | ||
|
|
ba88174614 | ||
|
|
598f86eaf3 | ||
|
|
3cb6ae3df3 | ||
|
|
bd31bd6d63 | ||
|
|
e3f407a71d | ||
|
|
1a213679bd | ||
|
|
e063a0fdf1 | ||
|
|
cff4718e91 | ||
|
|
ffa42cb5bb | ||
|
|
f9db800713 | ||
|
|
178e072e8a | ||
|
|
b42a4e2276 | ||
|
|
5e59033eb3 | ||
|
|
58021c9e98 | ||
|
|
e9dc0e391d | ||
|
|
9876fc4f17 | ||
|
|
aa534812f5 | ||
|
|
959bfbb66e | ||
|
|
debe81b1ea | ||
|
|
cdadbb069f | ||
|
|
9ebeb4e68a | ||
|
|
8bdc2aa228 | ||
|
|
075667e927 | ||
|
|
a46368dede | ||
|
|
1beb9db7b0 | ||
|
|
5830363787 | ||
|
|
7f870abf17 | ||
|
|
7501f9770f | ||
|
|
8bdff7a564 | ||
|
|
1ef057f983 | ||
|
|
756ebea036 | ||
|
|
dd6931d1ba | ||
|
|
c3148a81d2 | ||
|
|
aba0c5cc3b | ||
|
|
f55fe7e20b | ||
|
|
035e55d1ab | ||
|
|
f48b30c13a | ||
|
|
02bc589583 | ||
|
|
1d6e896fef | ||
|
|
62f5414742 | ||
|
|
be1bde9111 | ||
|
|
48ff2fc7ed | ||
|
|
9f6067a804 | ||
|
|
c8f2328337 | ||
|
|
dbbdefe4e0 | ||
|
|
dfea266e1f | ||
|
|
a1f6887f17 | ||
|
|
8796fe6d1c | ||
|
|
8710d97945 | ||
|
|
9c6e560819 | ||
|
|
ea3a750f13 | ||
|
|
94e3d7faf1 | ||
|
|
1cee5ff0dd | ||
|
|
0306278145 | ||
|
|
4067a45aff | ||
|
|
625f8a6dd3 | ||
|
|
0bfbf39306 | ||
|
|
f39f574914 | ||
|
|
281c592ea9 | ||
|
|
86ecf54139 | ||
|
|
2e287576b4 | ||
|
|
762e2d9322 | ||
|
|
fd73c1f8d9 | ||
|
|
1e08fe8646 | ||
|
|
6821a8f7b2 | ||
|
|
5e7949c47b | ||
|
|
ba96c34787 | ||
|
|
12dec5279e | ||
|
|
e9dbfc0e06 | ||
|
|
0ccb7db245 | ||
|
|
ccaf1c2c67 | ||
|
|
ce56248930 | ||
|
|
016647edb1 | ||
|
|
a68e76e058 | ||
|
|
67302c5ee0 | ||
|
|
16677bb85a | ||
|
|
c13efbf8b0 | ||
|
|
73fe9a2acf | ||
|
|
b1ad5c8abc | ||
|
|
b41215bdea | ||
|
|
738b453c66 | ||
|
|
9c9d82f1a9 | ||
|
|
bae55eaa80 | ||
|
|
beb02a5b4b | ||
|
|
840855d401 | ||
|
|
c9d035bde3 | ||
|
|
128437cc76 | ||
|
|
e903ff8f86 | ||
|
|
21cf5a7e00 | ||
|
|
3338f6cb5b | ||
|
|
249d2a8030 | ||
|
|
dc85125737 | ||
|
|
11825afc3e | ||
|
|
99e194e7cc | ||
|
|
63c75a2384 | ||
|
|
0eb09ac0f2 | ||
|
|
f6952ceb82 | ||
|
|
237e984a52 | ||
|
|
41f29032d2 | ||
|
|
019bb37dd3 | ||
|
|
ca0662dba4 | ||
|
|
5aff66f391 | ||
|
|
6245362a52 | ||
|
|
2b7ebd93f2 | ||
|
|
b5495cd7da | ||
|
|
bec6b260b4 | ||
|
|
c51157d437 | ||
|
|
4e42bd055d | ||
|
|
f67273c579 | ||
|
|
5a497e9fb8 | ||
|
|
288ed1f920 | ||
|
|
852d4d618c | ||
|
|
42da600eb1 | ||
|
|
67fec32d27 | ||
|
|
ad22a1faf6 | ||
|
|
ef027c93d4 | ||
|
|
247bc3ad69 | ||
|
|
aa81b0db2c | ||
|
|
c2032dec6d | ||
|
|
f8c81ad788 | ||
|
|
488e124f6a | ||
|
|
f0a211a1df | ||
|
|
e5b88f1bdd | ||
|
|
7151b1a28a | ||
|
|
f75498d8e1 | ||
|
|
eda0d9ba10 | ||
|
|
15fe3038be | ||
|
|
9d1b576af6 | ||
|
|
2ad31feaaa | ||
|
|
2216a6f658 | ||
|
|
fa2ed6b8a2 | ||
|
|
4c9db15212 | ||
|
|
5e55bf1d53 | ||
|
|
e5de18cbf9 | ||
|
|
0f36b16733 | ||
|
|
7c6454246e | ||
|
|
a021b72c71 | ||
|
|
6b3416a2d7 | ||
|
|
17760bd2eb | ||
|
|
97f49c681b | ||
|
|
6fb66261ca | ||
|
|
3b7e390484 | ||
|
|
d08dfbd390 | ||
|
|
1b51f50ce0 | ||
|
|
4e09e180e4 | ||
|
|
f9dae1d526 | ||
|
|
84922d3317 | ||
|
|
9208588771 | ||
|
|
10ead8a9d7 | ||
|
|
5465d89380 | ||
|
|
d83294d313 | ||
|
|
19fc090354 | ||
|
|
dad727d41c | ||
|
|
f1594c39be | ||
|
|
d13b70f779 | ||
|
|
8b667e006a | ||
|
|
06542b2b59 | ||
|
|
8b6e962811 | ||
|
|
0ea0293356 | ||
|
|
c86628b41e | ||
|
|
f44c9dff3d | ||
|
|
9a41636988 | ||
|
|
b8e4543ff3 | ||
|
|
1ea3979864 | ||
|
|
0bbfcc2491 | ||
|
|
538c241951 | ||
|
|
4745adaeff | ||
|
|
0ad379708f | ||
|
|
978f336aa4 | ||
|
|
95f3fadcbd | ||
|
|
1dc4d2c621 | ||
|
|
5226327e11 | ||
|
|
7264a996fe | ||
|
|
1cb322e870 | ||
|
|
861a031132 | ||
|
|
a81ccff4f5 | ||
|
|
661f0f547b | ||
|
|
1e2e9e2b34 | ||
|
|
e9583d850a | ||
|
|
4f0ac15343 | ||
|
|
a5ddbaf1f8 | ||
|
|
04b412079a | ||
|
|
b1198c0f09 | ||
|
|
c7ce4b6b3d | ||
|
|
e09cf6978e | ||
|
|
7cf19c8e4a | ||
|
|
2a03d59623 | ||
|
|
588ee411ad | ||
|
|
b454fc50ed | ||
|
|
55ade04e11 | ||
|
|
f9ddfa28b8 | ||
|
|
dd3c56d783 | ||
|
|
1a1361c4b3 | ||
|
|
dd9392a58c | ||
|
|
1037398041 | ||
|
|
03f5ff20de | ||
|
|
dd99577691 | ||
|
|
101c6a05a9 | ||
|
|
12683da8f7 | ||
|
|
48c6b3b4f4 | ||
|
|
9e486139ca | ||
|
|
eddac4911f | ||
|
|
1b5dabac8b | ||
|
|
8705c59f8c | ||
|
|
4f6a55d689 | ||
|
|
046d004725 | ||
|
|
a67bf5fde4 | ||
|
|
558ffc24c2 | ||
|
|
25271fe781 | ||
|
|
83c66c9c2c | ||
|
|
d6809d050a | ||
|
|
307a1dc638 | ||
|
|
9a88a47d33 | ||
|
|
f1bae7f1ff | ||
|
|
ec829be39f | ||
|
|
1e0fe40560 | ||
|
|
db374a0a87 | ||
|
|
86bcd1c22c | ||
|
|
17aea12417 | ||
|
|
95d9b17f35 | ||
|
|
203dd8bf7a | ||
|
|
96e7ff73dd | ||
|
|
7c87684629 | ||
|
|
4943cc4c12 | ||
|
|
a31d5379a0 | ||
|
|
9138fc11cf | ||
|
|
a7d2138544 | ||
|
|
f1ad9051bd | ||
|
|
2f89505b54 | ||
|
|
a2bef8ca51 | ||
|
|
1454ba15ba | ||
|
|
0cc32eae62 | ||
|
|
448cdb0737 | ||
|
|
e2ec13c5d2 | ||
|
|
5c4fc16cd4 | ||
|
|
94c0c1542b | ||
|
|
5e1ae36b2f | ||
|
|
8f96966178 | ||
|
|
fbb4c61665 | ||
|
|
4ccf8609ab | ||
|
|
ed3f5a5db4 | ||
|
|
ecd84fac48 | ||
|
|
3c7a6581dc | ||
|
|
f9d77959a4 | ||
|
|
cd6023cd7f | ||
|
|
5bbf7ac102 | ||
|
|
ec163b1457 | ||
|
|
dcf55ec040 | ||
|
|
d6a1c9f209 |
120
NEWS
120
NEWS
@@ -1,3 +1,123 @@
|
||||
Overview of Changes in GTK+ 3.7.2
|
||||
=================================
|
||||
|
||||
* Theming:
|
||||
- Improve touch text handle theming
|
||||
- Always draw background of menuitems
|
||||
|
||||
* Geometry management
|
||||
- Size groups now handle height-for-width
|
||||
- Fix corner cases in label size allocation
|
||||
|
||||
* Accessibility
|
||||
- Make entry icons accessible
|
||||
|
||||
* Filechooser
|
||||
- Don't add duplicate bookmarks
|
||||
- Remember sidebar width
|
||||
|
||||
* Wayland: Build against wayland-client 1.0
|
||||
|
||||
* Bugs fixed:
|
||||
524295 remember the file chooser side pane's position
|
||||
577806 gtk_file_chooser_add_shortcut_folder adds duplicates...
|
||||
677609 GtkSizeGroup regression in GTK+ 3.3.20
|
||||
683896 Clean up global resources when the display is closed
|
||||
686021 spinner animation should not be subject to enable-an...
|
||||
686347 Clickable icons are not accessible as children of te...
|
||||
687059 icon-theme: support loading symbolic GFileIcons from...
|
||||
687196 filesystemmodel: invalidate nodes on file remove
|
||||
687467 Commit "Implement proper cross-fades for gradients" ...
|
||||
687842 Support partially transparent widgets
|
||||
687872 Segfault when attempting to get character extents fo...
|
||||
687977 icon-theme: Add some preconditions for NULL arguments
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
Brazilian Portuguese
|
||||
Estonian
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Gujarati
|
||||
Indonesian
|
||||
Latvian
|
||||
Lithuanian
|
||||
Marathi
|
||||
Norwegian bokmål
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.0
|
||||
=================================
|
||||
|
||||
* Add an "inverted" property to GtkLevelBar
|
||||
|
||||
* Support RTL flipping in GtkLevelBar
|
||||
|
||||
* Various memory leak fixes
|
||||
|
||||
* Wayland: Update for protocol changes
|
||||
|
||||
* Bugs fixed:
|
||||
684288 level-bar: add an "inverted" property like GtkProgr...
|
||||
684415 Fix drag-motion event handling
|
||||
684980 Improve the appearance of the dragged header
|
||||
686013 CSS: crash drawing a GtkEntry in gedit
|
||||
686152 Calls gdk_window_get_frame_extents with a potential...
|
||||
686209 memleak with "text-shadow" css
|
||||
686265 scrolledwindow: set GDK_EXPOSURE_MASK on the oversh...
|
||||
686280 GtkScrollbar and GtkScale rendering broken in gtk 3.6
|
||||
686366 Use named union for _GtkSymbolicColor in gtk/gtksym...
|
||||
|
||||
* Translation updates:
|
||||
Czech
|
||||
Estonian
|
||||
Galician
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Serbian
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.1
|
||||
=================================
|
||||
|
||||
* CSS:
|
||||
- huge refactoring to avoid computing wrong values
|
||||
- treeview: Invalidate children properly
|
||||
- treeview: Fix computing child paths
|
||||
|
||||
* Broadway:
|
||||
- use binary websockets when available
|
||||
|
||||
* Bugs fixed:
|
||||
646221 Imperfect Russian translation of 'Print preview'...
|
||||
682395 Nautilus tabs have black background
|
||||
684517 window: Delay showing auto mnemonics on focus in
|
||||
684639 GTK+ 3.5.18 makes Epiphany unusable
|
||||
684984 No focus rendering for Icon Views in SELECTION_N...
|
||||
685449 Non-uniform borders on GtkScrolledWindow break c...
|
||||
685996 trivial build fix: test uses = not ==
|
||||
Fix a multi-display problem in touch handle code
|
||||
App chooser: respect NoDisplay
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Catalan (Valencian)
|
||||
Italian
|
||||
Japanese
|
||||
Khmer
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
Slovak
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.0
|
||||
=================================
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<CopyDir>$(GlibEtcInstallRoot)</CopyDir>
|
||||
<DefDir>$(SolutionDir)$(Configuration)\$(Platform)\obj\$(ProjectName)</DefDir>
|
||||
<GtkApiVersion>3.0</GtkApiVersion>
|
||||
<GtkBinaryVersion>2.10.0</GtkBinaryVersion>
|
||||
<GtkBinaryVersion>3.0.0</GtkBinaryVersion>
|
||||
<GtkDummyPrefix>\"/dummy\"</GtkDummyPrefix>
|
||||
<GtkPrefixDefine>GTK_PREFIX="\"$(GtkDummyPrefix)\""</GtkPrefixDefine>
|
||||
<GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="\"Gdk\""</GdkDefines>
|
||||
@@ -18,24 +18,24 @@ mkdir $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
|
||||
mkdir $(CopyDir)\bin\gtk3-demo
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin\gtk3-demo
|
||||
mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo
|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo
|
||||
|
||||
|
||||
mkdir $(CopyDir)\lib
|
||||
@@ -319,6 +319,8 @@ copy ..\..\..\gtk\gtklabel.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklayout.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklevelbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtklinkbutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkliststore.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -331,6 +333,8 @@ copy ..\..\..\gtk\gtkmenu.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenubar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenubutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenuitem.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkmenushell.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
@@ -411,6 +415,8 @@ copy ..\..\..\gtk\gtkscrollbar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkscrolledwindow.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtksearchentry.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkselection.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
copy ..\..\..\gtk\gtkseparator.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
|
||||
@@ -176,6 +176,8 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_accordion.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_basics.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\dialog.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\drawingarea.c" />
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_multiplebgs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_pixbufs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\css_shadows.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\demo_resources.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -41,7 +41,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h

|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkBinaryVersion"
|
||||
Value="2.10.0"
|
||||
Value="3.0.0"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkDummyPrefix"
|
||||
@@ -69,16 +69,17 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h

|
||||
echo on

|
||||
mkdir $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
|
||||
mkdir $(CopyDir)\bin\gtk3-demo

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\bin\gtk3-demo

|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\bin\gtk3-demo

|
||||
mkdir $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
|
||||
copy ..\..\..\demos\gtk-demo\*.c $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.css $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.h $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.ui $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.jpg $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.png $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
copy ..\..\..\demos\gtk-demo\*.gif $(CopyDir)\share\gtk-$(GtkApiVersion)\demo

|
||||
|
||||
mkdir $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(CopyDir)\lib

|
||||
@@ -222,12 +223,14 @@ copy ..\..\..\gtk\gtkinfobar.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtkinvisible.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
@@ -268,6 +271,7 @@ copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk&#
|
||||
copy ..\..\..\gtk\gtkscrollable.h $(CopyDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
|
||||
@@ -171,6 +171,8 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\combobox.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_accordion.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_basics.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_pixbufs.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_shadows.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\css_multiplebgs.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\demo_resources.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\dialog.c" />
|
||||
|
||||
30
configure.ac
30
configure.ac
@@ -9,8 +9,8 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [6])
|
||||
m4_define([gtk_micro_version], [0])
|
||||
m4_define([gtk_minor_version], [7])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -39,7 +39,7 @@ 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.33.1])
|
||||
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([cairo_required_version], [1.10.0])
|
||||
@@ -383,7 +383,7 @@ else
|
||||
fi
|
||||
AC_SUBST(DISABLE_ON_QUARTZ)
|
||||
|
||||
if test "x$enable_broadway_backend" == xyes; then
|
||||
if test "x$enable_broadway_backend" = xyes; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS broadway"
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
@@ -394,8 +394,8 @@ else
|
||||
AM_CONDITIONAL(USE_BROADWAY, false)
|
||||
fi
|
||||
|
||||
if test "x$enable_wayland_backend" == "xyes"; then
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
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])
|
||||
@@ -407,8 +407,8 @@ if test "x$enable_wayland_backend" == "xyes"; then
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WAYLAND"
|
||||
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-cursor"
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
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)
|
||||
@@ -714,7 +714,6 @@ AM_PATH_GLIB_2_0(glib_required_version, :,
|
||||
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
|
||||
gobject gmodule-no-export)
|
||||
|
||||
dnl
|
||||
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
|
||||
dnl
|
||||
gtk_save_LIBS=$LIBS
|
||||
@@ -748,6 +747,19 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#
|
||||
# Disable deprecation checks for all libraries we depend on on stable branches.
|
||||
# This is so newer versions of those libraries don't cause more warnings with
|
||||
# a stable GTK version.
|
||||
# We don't ever want to turn off deprecation warnings for master however, because
|
||||
# that's where we get rid of deprecated API we use.
|
||||
#
|
||||
if test m4_eval(gtk_minor_version % 2) = 0 ; then
|
||||
AC_DEFINE_UNQUOTED(GLIB_DISABLE_DEPRECATION_WARNINGS, 1,
|
||||
[Disable deprecation warnings from glib])
|
||||
fi
|
||||
|
||||
dnl
|
||||
saved_cflags="$CFLAGS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import url("reset.css");
|
||||
@import url("resource:///reset.css");
|
||||
|
||||
* {
|
||||
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
||||
@@ -49,4 +49,4 @@ GtkWindow {
|
||||
.button:hover:active,
|
||||
.button:active {
|
||||
background-color: #993401;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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("reset.css");
|
||||
@import url("resource:///reset.css");
|
||||
|
||||
/* Set a very futuristic style by default */
|
||||
* {
|
||||
|
||||
@@ -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("reset.css");
|
||||
@import url("cssview.css");
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
|
||||
#canvas {
|
||||
transition-property: background-color, background-image;
|
||||
@@ -56,7 +56,7 @@
|
||||
/*
|
||||
#bricks-button {
|
||||
background-color: #eef;
|
||||
background-image: url('brick.png');
|
||||
background-image: url('resource:///css_multiplebgs/brick.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
@@ -133,4 +133,4 @@
|
||||
background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px),
|
||||
linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -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("reset.css");
|
||||
@import url("cssview.css");
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///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%; }
|
||||
@@ -46,20 +46,20 @@
|
||||
}
|
||||
|
||||
@keyframes size-the-image {
|
||||
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, 100% }
|
||||
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, 100% }
|
||||
0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto }
|
||||
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto }
|
||||
}
|
||||
|
||||
GtkWindow {
|
||||
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-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-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;
|
||||
|
||||
@@ -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("reset.css");
|
||||
@import url("cssview.css");
|
||||
@import url("resource:///reset.css");
|
||||
@import url("resource:///cssview.css");
|
||||
|
||||
/* Get a nice background for the window */
|
||||
.background {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</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>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
|
||||
<para>This chapter is contains some tutorial information to get you
|
||||
<para>This chapter contains some tutorial information to get you
|
||||
started with GTK+ programming. It assumes that you have GTK+, its
|
||||
dependencies and a C compiler installed and ready to use. If you
|
||||
need to build GTK+ itself first, refer to the
|
||||
|
||||
@@ -3281,6 +3281,8 @@ gtk_level_bar_set_min_value
|
||||
gtk_level_bar_get_min_value
|
||||
gtk_level_bar_set_max_value
|
||||
gtk_level_bar_get_max_value
|
||||
gtk_level_bar_set_inverted
|
||||
gtk_level_bar_get_inverted
|
||||
gtk_level_bar_add_offset_value
|
||||
gtk_level_bar_remove_offset_value
|
||||
gtk_level_bar_get_offset_value
|
||||
@@ -5289,6 +5291,7 @@ gtk_widget_get_sensitive
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_get_state
|
||||
gtk_widget_get_visible
|
||||
gtk_widget_is_visible
|
||||
gtk_widget_set_visible
|
||||
gtk_widget_set_state_flags
|
||||
gtk_widget_unset_state_flags
|
||||
@@ -5777,6 +5780,7 @@ GTK_STYLE_CLASS_ARROW
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_CLASS_LEVEL_BAR
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
|
||||
@@ -411,8 +411,6 @@ bloat_pad_new (void)
|
||||
{
|
||||
BloatPad *bloat_pad;
|
||||
|
||||
g_type_init ();
|
||||
|
||||
g_set_application_name ("Bloatpad");
|
||||
|
||||
bloat_pad = g_object_new (bloat_pad_get_type (),
|
||||
|
||||
@@ -465,8 +465,6 @@ plug_man_class_init (PlugManClass *class)
|
||||
PlugMan *
|
||||
plug_man_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (plug_man_get_type (),
|
||||
"application-id", "org.gtk.Test.plugman",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
||||
@@ -191,8 +191,6 @@ menu_button_class_init (MenuButtonClass *class)
|
||||
MenuButton *
|
||||
menu_button_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (menu_button_get_type (),
|
||||
"application-id", "org.gtk.Test.Sunny",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
||||
@@ -341,7 +341,8 @@ gdkmarshalers.h: @REBUILD@ gdkmarshalers.list
|
||||
&& mv gdkmarshalers-h.tmp gdkmarshalers.h \
|
||||
|| ( rm -f gdkmarshalers-h.tmp && exit 1)
|
||||
gdkmarshalers.c: @REBUILD@ gdkmarshalers.list
|
||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body > gdkmarshalers-c.tmp \
|
||||
$(AM_V_GEN) (echo "#include \"gdkmarshalers.h\""; \
|
||||
$(GLIB_GENMARSHAL) --prefix=_gdk_marshal $(srcdir)/gdkmarshalers.list --body) > gdkmarshalers-c.tmp \
|
||||
&& mv gdkmarshalers-c.tmp gdkmarshalers.c \
|
||||
|| ( rm -f gdkmarshalers-c.tmp && exit 1 )
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@ libbroadway_la_SOURCES = \
|
||||
broadway.c
|
||||
|
||||
clienthtml.h: client.html
|
||||
$(PERL) ./toarray.pl client.html client_html > $@
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/client.html client_html > $@
|
||||
|
||||
EXTRA_DIST += client.html
|
||||
|
||||
broadwayjs.h: broadway.js
|
||||
$(PERL) ./toarray.pl broadway.js broadway_js > $@
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/broadway.js broadway_js > $@
|
||||
|
||||
EXTRA_DIST += broadway.js
|
||||
|
||||
|
||||
@@ -57,8 +57,44 @@ base64_uint32 (guint32 v, char *c)
|
||||
* conversion of raw image data to png data: uris *
|
||||
***********************************************************/
|
||||
|
||||
static cairo_status_t
|
||||
write_png_data (void *closure,
|
||||
const unsigned char *data,
|
||||
unsigned int data_len)
|
||||
{
|
||||
GString *buf = closure;
|
||||
|
||||
g_string_append_len (buf, (char *)data, data_len);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_RGB24, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
to_png_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_ARGB32, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_data, buf);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
struct PngTarget {
|
||||
GString *url;
|
||||
GString *buf;
|
||||
int state;
|
||||
int save;
|
||||
};
|
||||
@@ -71,71 +107,73 @@ write_png_url (void *closure,
|
||||
struct PngTarget *target = closure;
|
||||
gsize res, old_len;
|
||||
|
||||
old_len = target->url->len;
|
||||
g_string_set_size (target->url,
|
||||
old_len = target->buf->len;
|
||||
g_string_set_size (target->buf,
|
||||
old_len + (data_len / 3 + 1) * 4 + 4);
|
||||
|
||||
res = g_base64_encode_step (data, data_len, FALSE,
|
||||
target->url->str + old_len,
|
||||
target->buf->str + old_len,
|
||||
&target->state, &target->save);
|
||||
|
||||
g_string_set_size (target->url, old_len + res);
|
||||
g_string_set_size (target->buf, old_len + res);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static char *
|
||||
to_png_rgb (int w, int h, int byte_stride, guint32 *data)
|
||||
static void
|
||||
to_png_url_rgb (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
struct PngTarget target;
|
||||
gsize res, old_len;
|
||||
|
||||
target.url = g_string_new ("data:image/png;base64,");
|
||||
target.buf = buf;
|
||||
target.state = 0;
|
||||
target.save = 0;
|
||||
|
||||
g_string_append (buf, "data:image/png;base64,");
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_RGB24, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_url, &target);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
old_len = target.url->len;
|
||||
old_len = buf->len;
|
||||
|
||||
g_string_set_size (target.url, old_len + 4);
|
||||
g_string_set_size (buf, old_len + 4);
|
||||
res = g_base64_encode_close (FALSE,
|
||||
target.url->str + old_len,
|
||||
buf->str + old_len,
|
||||
&target.state, &target.save);
|
||||
g_string_set_size (target.url, old_len + res);
|
||||
|
||||
return g_string_free (target.url, FALSE);
|
||||
g_string_set_size (buf, old_len + res);
|
||||
}
|
||||
|
||||
static char *
|
||||
to_png_rgba (int w, int h, int byte_stride, guint32 *data)
|
||||
static void
|
||||
to_png_url_rgba (GString *buf, int w, int h, int byte_stride, guint32 *data)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
struct PngTarget target;
|
||||
gsize res, old_len;
|
||||
|
||||
target.url = g_string_new ("data:image/png;base64,");
|
||||
target.buf = buf;
|
||||
target.state = 0;
|
||||
target.save = 0;
|
||||
|
||||
g_string_append (buf, "data:image/png;base64,");
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data,
|
||||
CAIRO_FORMAT_ARGB32, w, h, byte_stride);
|
||||
|
||||
cairo_surface_write_to_png_stream (surface, write_png_url, &target);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
old_len = target.url->len;
|
||||
old_len = buf->len;
|
||||
|
||||
g_string_set_size (target.url, old_len + 4);
|
||||
g_string_set_size (buf, old_len + 4);
|
||||
res = g_base64_encode_close (FALSE,
|
||||
target.url->str + old_len,
|
||||
buf->str + old_len,
|
||||
&target.state, &target.save);
|
||||
g_string_set_size (target.url, old_len + res);
|
||||
|
||||
return g_string_free (target.url, FALSE);
|
||||
g_string_set_size (buf, old_len + res);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -173,9 +211,11 @@ to_png_a (int w, int h, int byte_stride, guint8 *data)
|
||||
|
||||
struct BroadwayOutput {
|
||||
GOutputStream *out;
|
||||
GString *buf;
|
||||
int error;
|
||||
guint32 serial;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -212,13 +252,12 @@ broadway_output_send_cmd (BroadwayOutput *output,
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_output_sendmsg (BroadwayOutput *output,
|
||||
const void *buf, gsize count)
|
||||
broadway_output_send_cmd_pre_v7 (BroadwayOutput *output,
|
||||
const void *buf, gsize count)
|
||||
{
|
||||
if (!output->proto_v7_plus)
|
||||
g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL);
|
||||
else
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT, buf, count);
|
||||
g_output_stream_write_all (output->out, "\0", 1, NULL, NULL, NULL);
|
||||
g_output_stream_write_all (output->out, buf, count, NULL, NULL, NULL);
|
||||
g_output_stream_write_all (output->out, "\xff", 1, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
void broadway_output_pong (BroadwayOutput *output)
|
||||
@@ -227,42 +266,40 @@ void broadway_output_pong (BroadwayOutput *output)
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_CNX_PONG, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_output_sendmsg_initiate (BroadwayOutput *output)
|
||||
{
|
||||
if (!output->proto_v7_plus)
|
||||
g_output_stream_write (output->out, "\0", 1, NULL, NULL);
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
broadway_output_flush (BroadwayOutput *output)
|
||||
{
|
||||
if (output->buf->len == 0)
|
||||
return TRUE;
|
||||
|
||||
if (!output->proto_v7_plus)
|
||||
{
|
||||
broadway_output_sendmsg (output, "\xff", 1);
|
||||
broadway_output_sendmsg (output, "\0", 1);
|
||||
return !output->error;
|
||||
}
|
||||
else /* no need to flush */
|
||||
return !output->error;
|
||||
broadway_output_send_cmd_pre_v7 (output, output->buf->str, output->buf->len);
|
||||
else if (output->binary)
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_BINARY,
|
||||
output->buf->str, output->buf->len);
|
||||
else
|
||||
broadway_output_send_cmd (output, TRUE, BROADWAY_WS_TEXT,
|
||||
output->buf->str, output->buf->len);
|
||||
|
||||
g_string_set_size (output->buf, 0);
|
||||
|
||||
return !output->error;
|
||||
|
||||
}
|
||||
|
||||
BroadwayOutput *
|
||||
broadway_output_new(GOutputStream *out, guint32 serial,
|
||||
gboolean proto_v7_plus)
|
||||
broadway_output_new (GOutputStream *out, guint32 serial,
|
||||
gboolean proto_v7_plus, gboolean binary)
|
||||
{
|
||||
BroadwayOutput *output;
|
||||
|
||||
output = g_new0 (BroadwayOutput, 1);
|
||||
|
||||
output->out = g_object_ref (out);
|
||||
output->buf = g_string_new ("");
|
||||
output->serial = serial;
|
||||
output->proto_v7_plus = proto_v7_plus;
|
||||
|
||||
broadway_output_sendmsg_initiate (output);
|
||||
output->binary = binary;
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -285,32 +322,97 @@ broadway_output_get_next_serial (BroadwayOutput *output)
|
||||
* Core rendering operations *
|
||||
************************************************************************/
|
||||
|
||||
#define HEADER_LEN (1+6)
|
||||
|
||||
static void
|
||||
append_uint16 (guint32 v, char *buf, int *p)
|
||||
append_char (BroadwayOutput *output, char c)
|
||||
{
|
||||
base64_uint16 (v, &buf[*p]);
|
||||
*p += 3;
|
||||
g_string_append_c (output->buf, c);
|
||||
}
|
||||
|
||||
static void
|
||||
append_uint32 (guint32 v, char *buf, int *p)
|
||||
append_bool (BroadwayOutput *output, gboolean val)
|
||||
{
|
||||
base64_uint32 (v, &buf[*p]);
|
||||
*p += 6;
|
||||
if (output->binary)
|
||||
g_string_append_c (output->buf, val ? 1: 0);
|
||||
else
|
||||
g_string_append_c (output->buf, val ? '1': '0');
|
||||
}
|
||||
|
||||
static int
|
||||
write_header(BroadwayOutput *output, char *buf, char op)
|
||||
static void
|
||||
append_flags (BroadwayOutput *output, guint32 val)
|
||||
{
|
||||
int p;
|
||||
if (output->binary)
|
||||
g_string_append_c (output->buf, val);
|
||||
else
|
||||
g_string_append_c (output->buf, val + '0');
|
||||
}
|
||||
|
||||
p = 0;
|
||||
buf[p++] = op;
|
||||
append_uint32 (output->serial++, buf, &p);
|
||||
|
||||
return p;
|
||||
static void
|
||||
append_uint16 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 2);
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_set_size (output->buf, old_len + 3);
|
||||
base64_uint16 (v, output->buf->str + old_len);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
append_uint32 (BroadwayOutput *output, guint32 v)
|
||||
{
|
||||
gsize old_len = output->buf->len;
|
||||
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + old_len;
|
||||
|
||||
g_string_set_size (output->buf, old_len + 4);
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
buf[2] = (v >> 16) & 0xff;
|
||||
buf[3] = (v >> 24) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_set_size (output->buf, old_len + 6);
|
||||
base64_uint32 (v, output->buf->str + old_len);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
overwrite_uint32 (BroadwayOutput *output, gsize pos, guint32 v)
|
||||
{
|
||||
if (output->binary)
|
||||
{
|
||||
guint8 *buf = (guint8 *)output->buf->str + pos;
|
||||
|
||||
buf[0] = (v >> 0) & 0xff;
|
||||
buf[1] = (v >> 8) & 0xff;
|
||||
buf[2] = (v >> 16) & 0xff;
|
||||
buf[3] = (v >> 24) & 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
base64_uint32 (v, output->buf->str + pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
write_header(BroadwayOutput *output, char op)
|
||||
{
|
||||
append_char (output, op);
|
||||
append_uint32 (output, output->serial++);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -318,29 +420,20 @@ broadway_output_copy_rectangles (BroadwayOutput *output, int id,
|
||||
BroadwayRect *rects, int n_rects,
|
||||
int dx, int dy)
|
||||
{
|
||||
char *buf;
|
||||
int len, i, p;
|
||||
int i;
|
||||
|
||||
len = HEADER_LEN + 3 + 3 + 3*4*n_rects + 3 + 3;
|
||||
|
||||
buf = g_malloc (len);
|
||||
p = write_header (output, buf, 'b');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (n_rects, buf, &p);
|
||||
write_header (output, 'b');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
append_uint16 (rects[i].x, buf, &p);
|
||||
append_uint16 (rects[i].y, buf, &p);
|
||||
append_uint16 (rects[i].width, buf, &p);
|
||||
append_uint16 (rects[i].height, buf, &p);
|
||||
append_uint16 (output, rects[i].x);
|
||||
append_uint16 (output, rects[i].y);
|
||||
append_uint16 (output, rects[i].width);
|
||||
append_uint16 (output, rects[i].height);
|
||||
}
|
||||
append_uint16 (dx, buf, &p);
|
||||
append_uint16 (dy, buf, &p);
|
||||
|
||||
assert (p == len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, len);
|
||||
free (buf);
|
||||
append_uint16 (output, dx);
|
||||
append_uint16 (output, dy);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -348,31 +441,18 @@ broadway_output_grab_pointer (BroadwayOutput *output,
|
||||
int id,
|
||||
gboolean owner_event)
|
||||
{
|
||||
char buf[HEADER_LEN + 3 + 1];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'g');
|
||||
append_uint16 (id, buf, &p);
|
||||
buf[p++] = owner_event ? '1': '0';
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'g');
|
||||
append_uint16 (output, id);
|
||||
append_bool (output, owner_event);
|
||||
}
|
||||
|
||||
guint32
|
||||
broadway_output_ungrab_pointer (BroadwayOutput *output)
|
||||
{
|
||||
char buf[HEADER_LEN];
|
||||
guint32 serial;
|
||||
int p;
|
||||
|
||||
serial = output->serial;
|
||||
p = write_header (output, buf, 'u');
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'u');
|
||||
|
||||
return serial;
|
||||
}
|
||||
@@ -382,62 +462,34 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
int id, int x, int y, int w, int h,
|
||||
gboolean is_temp)
|
||||
{
|
||||
char buf[HEADER_LEN + 16];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 's');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
append_uint16 (w, buf, &p);
|
||||
append_uint16 (h, buf, &p);
|
||||
buf[p++] = is_temp ? '1' : '0';
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 's');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
append_uint16 (output, w);
|
||||
append_uint16 (output, h);
|
||||
append_bool (output, is_temp);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_show_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'S');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'S');
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_hide_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'H');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'H');
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_destroy_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'd');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'd');
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -451,31 +503,25 @@ broadway_output_move_resize_surface (BroadwayOutput *output,
|
||||
int w,
|
||||
int h)
|
||||
{
|
||||
char buf[HEADER_LEN+3+1+6+6];
|
||||
int p;
|
||||
int val;
|
||||
|
||||
if (!has_pos && !has_size)
|
||||
return;
|
||||
|
||||
p = write_header (output, buf, 'm');
|
||||
|
||||
write_header (output, 'm');
|
||||
val = (!!has_pos) | ((!!has_size) << 1);
|
||||
append_uint16 (id, buf, &p);
|
||||
buf[p++] = val + '0';
|
||||
append_uint16 (output, id);
|
||||
append_flags (output, val);
|
||||
if (has_pos)
|
||||
{
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
}
|
||||
if (has_size)
|
||||
{
|
||||
append_uint16 (w, buf, &p);
|
||||
append_uint16 (h, buf, &p);
|
||||
append_uint16 (output, w);
|
||||
append_uint16 (output, h);
|
||||
}
|
||||
assert (p <= sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, p);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -483,17 +529,9 @@ broadway_output_set_transient_for (BroadwayOutput *output,
|
||||
int id,
|
||||
int parent_id)
|
||||
{
|
||||
char buf[HEADER_LEN + 6];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'p');
|
||||
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (parent_id, buf, &p);
|
||||
|
||||
assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'p');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, parent_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -501,32 +539,26 @@ void
|
||||
broadway_output_put_rgb (BroadwayOutput *output, int id, int x, int y,
|
||||
int w, int h, int byte_stride, void *data)
|
||||
{
|
||||
gsize buf_size;
|
||||
gsize url_len;
|
||||
char *url, *buf;
|
||||
int p;
|
||||
gsize size_start, image_start, len;
|
||||
|
||||
url = to_png_rgb (w, h, byte_stride, (guint32*)data);
|
||||
url_len = strlen (url);
|
||||
write_header (output, 'i');
|
||||
|
||||
buf_size = HEADER_LEN + 15 + url_len;
|
||||
buf = g_malloc (buf_size);
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x);
|
||||
append_uint16 (output, y);
|
||||
|
||||
p = write_header (output, buf, 'i');
|
||||
size_start = output->buf->len;
|
||||
append_uint32 (output, 0);
|
||||
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x, buf, &p);
|
||||
append_uint16 (y, buf, &p);
|
||||
image_start = output->buf->len;
|
||||
if (output->binary)
|
||||
to_png_rgb (output->buf, w, h, byte_stride, (guint32*)data);
|
||||
else
|
||||
to_png_url_rgb (output->buf, w, h, byte_stride, (guint32*)data);
|
||||
|
||||
append_uint32 (url_len, buf, &p);
|
||||
len = output->buf->len - image_start;
|
||||
|
||||
g_assert (p == HEADER_LEN + 15);
|
||||
strncpy (buf + p, url, url_len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, buf_size);
|
||||
|
||||
g_free (buf);
|
||||
free (url);
|
||||
overwrite_uint32 (output, size_start, len);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -757,39 +789,38 @@ broadway_output_put_rgba (BroadwayOutput *output, int id, int x, int y,
|
||||
int w, int h, int byte_stride, void *data)
|
||||
{
|
||||
BroadwayBox *rects;
|
||||
int p, i, n_rects;
|
||||
int i, n_rects;
|
||||
gsize size_start, image_start, len;
|
||||
|
||||
rects = rgba_find_rects (data, w, h, byte_stride, &n_rects);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
gsize url_len, buf_size;
|
||||
char *buf, *url;
|
||||
guint8 *subdata;
|
||||
|
||||
write_header (output, 'i');
|
||||
append_uint16 (output, id);
|
||||
append_uint16 (output, x + rects[i].x1);
|
||||
append_uint16 (output, y + rects[i].y1);
|
||||
|
||||
size_start = output->buf->len;
|
||||
append_uint32 (output, 0);
|
||||
|
||||
image_start = output->buf->len;
|
||||
|
||||
subdata = (guint8 *)data + rects[i].x1 * 4 + rects[i].y1 * byte_stride;
|
||||
url = to_png_rgba (rects[i].x2 - rects[i].x1,
|
||||
if (output->binary)
|
||||
to_png_rgba (output->buf, rects[i].x2 - rects[i].x1,
|
||||
rects[i].y2 - rects[i].y1,
|
||||
byte_stride, (guint32*)subdata);
|
||||
else
|
||||
to_png_url_rgba (output->buf, rects[i].x2 - rects[i].x1,
|
||||
rects[i].y2 - rects[i].y1,
|
||||
byte_stride, (guint32*)subdata);
|
||||
|
||||
url_len = strlen (url);
|
||||
buf_size = HEADER_LEN + 15 + url_len;
|
||||
buf = g_malloc (buf_size);
|
||||
len = output->buf->len - image_start;
|
||||
|
||||
|
||||
p = write_header (output, buf, 'i');
|
||||
append_uint16 (id, buf, &p);
|
||||
append_uint16 (x + rects[i].x1, buf, &p);
|
||||
append_uint16 (y + rects[i].y1, buf, &p);
|
||||
|
||||
append_uint32 (url_len, buf, &p);
|
||||
g_assert (p == HEADER_LEN + 15);
|
||||
strncpy (buf + p, url, url_len);
|
||||
|
||||
broadway_output_sendmsg (output, buf, buf_size);
|
||||
|
||||
free (url);
|
||||
g_free (buf);
|
||||
overwrite_uint32 (output, size_start, len);
|
||||
}
|
||||
|
||||
free (rects);
|
||||
@@ -799,13 +830,6 @@ void
|
||||
broadway_output_surface_flush (BroadwayOutput *output,
|
||||
int id)
|
||||
{
|
||||
char buf[HEADER_LEN + 3];
|
||||
int p;
|
||||
|
||||
p = write_header (output, buf, 'f');
|
||||
append_uint16 (id, buf, &p);
|
||||
|
||||
g_assert (p == sizeof (buf));
|
||||
|
||||
broadway_output_sendmsg (output, buf, sizeof (buf));
|
||||
write_header (output, 'f');
|
||||
append_uint16 (output, id);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ typedef enum {
|
||||
|
||||
BroadwayOutput *broadway_output_new (GOutputStream *out,
|
||||
guint32 serial,
|
||||
gboolean proto_v7_plus);
|
||||
gboolean proto_v7_plus,
|
||||
gboolean binary);
|
||||
void broadway_output_free (BroadwayOutput *output);
|
||||
int broadway_output_flush (BroadwayOutput *output);
|
||||
int broadway_output_has_error (BroadwayOutput *output);
|
||||
|
||||
@@ -725,76 +725,56 @@ function cmdUngrabPointer()
|
||||
doUngrab();
|
||||
}
|
||||
|
||||
function handleCommands(cmdObj)
|
||||
function handleCommands(cmd)
|
||||
{
|
||||
var cmd = cmdObj.data;
|
||||
var i = cmdObj.pos;
|
||||
|
||||
while (i < cmd.length) {
|
||||
while (cmd.pos < cmd.length) {
|
||||
var id, x, y, w, h, q;
|
||||
var command = cmd[i++];
|
||||
lastSerial = base64_32(cmd, i);
|
||||
i = i + 6;
|
||||
var command = cmd.get_char();
|
||||
lastSerial = cmd.get_32();
|
||||
switch (command) {
|
||||
case 's': // create new surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
x = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
y = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var isTemp = cmd[i] == '1';
|
||||
i = i + 1;
|
||||
id = cmd.get_16();
|
||||
x = cmd.get_16s();
|
||||
y = cmd.get_16s();
|
||||
w = cmd.get_16();
|
||||
h = cmd.get_16();
|
||||
var isTemp = cmd.get_bool();
|
||||
cmdCreateSurface(id, x, y, w, h, isTemp);
|
||||
break;
|
||||
|
||||
case 'S': // Show a surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
id = cmd.get_16();
|
||||
cmdShowSurface(id);
|
||||
break;
|
||||
|
||||
case 'H': // Hide a surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
id = cmd.get_16();
|
||||
cmdHideSurface(id);
|
||||
break;
|
||||
|
||||
case 'p': // Set transient parent
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var parentId = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
id = cmd.get_16();
|
||||
var parentId = cmd.get_16();
|
||||
cmdSetTransientFor(id, parentId);
|
||||
break;
|
||||
|
||||
case 'd': // Delete surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
id = cmd.get_16();
|
||||
cmdDeleteSurface(id);
|
||||
break;
|
||||
|
||||
case 'm': // Move a surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var ops = cmd.charCodeAt(i++) - 48;
|
||||
id = cmd.get_16();
|
||||
var ops = cmd.get_flags();
|
||||
var has_pos = ops & 1;
|
||||
if (has_pos) {
|
||||
x = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
y = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
x = cmd.get_16s();
|
||||
y = cmd.get_16s();
|
||||
}
|
||||
var has_size = ops & 2;
|
||||
if (has_size) {
|
||||
w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
w = cmd.get_16();
|
||||
h = cmd.get_16();
|
||||
}
|
||||
cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h);
|
||||
break;
|
||||
@@ -802,67 +782,50 @@ function handleCommands(cmdObj)
|
||||
case 'i': // Put image data surface
|
||||
q = new Object();
|
||||
q.op = 'i';
|
||||
q.id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.x = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.y = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var size = base64_32(cmd, i);
|
||||
i = i + 6;
|
||||
var url = cmd.slice(i, i + size);
|
||||
i = i + size;
|
||||
q.id = cmd.get_16();
|
||||
q.x = cmd.get_16();
|
||||
q.y = cmd.get_16();
|
||||
var url = cmd.get_image_url ();
|
||||
q.img = new Image();
|
||||
q.img.src = url;
|
||||
surfaces[q.id].drawQueue.push(q);
|
||||
if (!q.img.complete) {
|
||||
cmdObj.pos = i;
|
||||
q.img.onload = function() { handleOutstanding(); };
|
||||
q.img.onload = function() { cmd.free_image_url (url); handleOutstanding(); };
|
||||
return false;
|
||||
}
|
||||
cmd.free_image_url (url);
|
||||
break;
|
||||
|
||||
case 'b': // Copy rects
|
||||
q = new Object();
|
||||
q.op = 'b';
|
||||
q.id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
|
||||
var nrects = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
q.id = cmd.get_16();
|
||||
var nrects = cmd.get_16();
|
||||
|
||||
q.rects = [];
|
||||
for (var r = 0; r < nrects; r++) {
|
||||
var rect = new Object();
|
||||
rect.x = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.y = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.w = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.h = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
rect.x = cmd.get_16();
|
||||
rect.y = cmd.get_16();
|
||||
rect.w = cmd.get_16();
|
||||
rect.h = cmd.get_16();
|
||||
q.rects.push (rect);
|
||||
}
|
||||
|
||||
q.dx = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
q.dy = base64_16s(cmd, i);
|
||||
i = i + 3;
|
||||
q.dx = cmd.get_16s();
|
||||
q.dy = cmd.get_16s();
|
||||
surfaces[q.id].drawQueue.push(q);
|
||||
break;
|
||||
|
||||
case 'f': // Flush surface
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
id = cmd.get_16();
|
||||
|
||||
cmdFlushSurface(id);
|
||||
break;
|
||||
|
||||
case 'g': // Grab
|
||||
id = base64_16(cmd, i);
|
||||
i = i + 3;
|
||||
var ownerEvents = cmd[i++] == '1';
|
||||
id = cmd.get_16();
|
||||
var ownerEvents = cmd.get_bool ();
|
||||
|
||||
cmdGrabPointer(id, ownerEvents);
|
||||
break;
|
||||
@@ -888,13 +851,103 @@ function handleOutstanding()
|
||||
}
|
||||
}
|
||||
|
||||
function TextCommands(message) {
|
||||
this.data = message;
|
||||
this.length = message.length;
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
TextCommands.prototype.get_char = function() {
|
||||
return this.data[this.pos++];
|
||||
};
|
||||
TextCommands.prototype.get_bool = function() {
|
||||
return this.get_char() == '1';
|
||||
};
|
||||
TextCommands.prototype.get_flags = function() {
|
||||
return this.get_char() - 48;
|
||||
}
|
||||
TextCommands.prototype.get_16 = function() {
|
||||
var n = base64_16(this.data, this.pos);
|
||||
this.pos = this.pos + 3;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_16s = function() {
|
||||
var n = base64_16s(this.data, this.pos);
|
||||
this.pos = this.pos + 3;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_32 = function() {
|
||||
var n = base64_32(this.data, this.pos);
|
||||
this.pos = this.pos + 6;
|
||||
return n;
|
||||
};
|
||||
TextCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
var url = this.data.slice(this.pos, this.pos + size);
|
||||
this.pos = this.pos + size;
|
||||
return url;
|
||||
};
|
||||
TextCommands.prototype.free_image_url = function(url) {
|
||||
};
|
||||
|
||||
function BinCommands(message) {
|
||||
this.arraybuffer = message;
|
||||
this.u8 = new Uint8Array(message);
|
||||
this.length = this.u8.length;
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
BinCommands.prototype.get_char = function() {
|
||||
return String.fromCharCode(this.u8[this.pos++]);
|
||||
};
|
||||
BinCommands.prototype.get_bool = function() {
|
||||
return this.u8[this.pos++] != 0;
|
||||
};
|
||||
BinCommands.prototype.get_flags = function() {
|
||||
return this.u8[this.pos++];
|
||||
}
|
||||
BinCommands.prototype.get_16 = function() {
|
||||
var v =
|
||||
this.u8[this.pos] +
|
||||
(this.u8[this.pos+1] << 8);
|
||||
this.pos = this.pos + 2;
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_16s = function() {
|
||||
var v = this.get_16 ();
|
||||
if (v > 32767)
|
||||
return v - 65536;
|
||||
else
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_32 = function() {
|
||||
var v =
|
||||
this.u8[this.pos] +
|
||||
(this.u8[this.pos+1] << 8) +
|
||||
(this.u8[this.pos+2] << 16) +
|
||||
(this.u8[this.pos+3] << 24);
|
||||
this.pos = this.pos + 4;
|
||||
return v;
|
||||
};
|
||||
BinCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
var png_blob = new Blob ([this.arraybuffer.slice (this.pos, this.pos + size)], {type:"image/png"});
|
||||
var url = URL.createObjectURL(png_blob, {oneTimeOnly: true});
|
||||
this.pos = this.pos + size;
|
||||
return url;
|
||||
};
|
||||
BinCommands.prototype.free_image_url = function(url) {
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
function handleMessage(message)
|
||||
{
|
||||
var cmdObj = {};
|
||||
cmdObj.data = message;
|
||||
cmdObj.pos = 0;
|
||||
|
||||
outstandingCommands.push(cmdObj);
|
||||
var cmd;
|
||||
if (message instanceof ArrayBuffer)
|
||||
cmd = new BinCommands(message);
|
||||
else
|
||||
cmd = new TextCommands(message);
|
||||
outstandingCommands.push(cmd);
|
||||
if (outstandingCommands.length == 1) {
|
||||
handleOutstanding();
|
||||
}
|
||||
@@ -2759,6 +2812,18 @@ function setupDocument(document)
|
||||
}
|
||||
}
|
||||
|
||||
function newWS(loc) {
|
||||
var ws = null;
|
||||
if ("WebSocket" in window) {
|
||||
ws = new WebSocket(loc, "broadway");
|
||||
} else if ("MozWebSocket" in window) { // Firefox 6
|
||||
ws = new MozWebSocket(loc);
|
||||
} else {
|
||||
alert("WebSocket not supported, broadway will not work!");
|
||||
}
|
||||
return ws;
|
||||
}
|
||||
|
||||
function connect()
|
||||
{
|
||||
var url = window.location.toString();
|
||||
@@ -2771,41 +2836,39 @@ function connect()
|
||||
|
||||
var loc = window.location.toString().replace("http:", "ws:");
|
||||
loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket";
|
||||
var ws = null;
|
||||
|
||||
if ("WebSocket" in window) {
|
||||
ws = new WebSocket(loc, "broadway");
|
||||
} else if ("MozWebSocket" in window) { // Firefox 6
|
||||
ws = new MozWebSocket(loc);
|
||||
var supports_binary = newWS (loc + "-test").binaryType == "blob";
|
||||
if (supports_binary) {
|
||||
ws = newWS (loc + "-bin");
|
||||
ws.binaryType = "arraybuffer";
|
||||
} else {
|
||||
alert("WebSocket not supported, input will not work!");
|
||||
return;
|
||||
ws = newWS (loc);
|
||||
}
|
||||
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
if (useToplevelWindows) {
|
||||
w = window.screen.width;
|
||||
h = window.screen.height;
|
||||
} else {
|
||||
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]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
}
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
|
||||
setupDocument(document);
|
||||
window.onunload = function (ev) {
|
||||
|
||||
@@ -130,7 +130,7 @@ typedef struct HttpRequest {
|
||||
GString *request;
|
||||
} HttpRequest;
|
||||
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus);
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary);
|
||||
|
||||
static void
|
||||
http_request_free (HttpRequest *request)
|
||||
@@ -149,6 +149,7 @@ struct BroadwayInput {
|
||||
gboolean seen_time;
|
||||
gint64 time_base;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -691,7 +692,7 @@ generate_handshake_response_wsietf_v7 (const gchar *key)
|
||||
}
|
||||
|
||||
static void
|
||||
start_input (HttpRequest *request)
|
||||
start_input (HttpRequest *request, gboolean binary)
|
||||
{
|
||||
char **lines;
|
||||
char *p;
|
||||
@@ -867,6 +868,7 @@ start_input (HttpRequest *request)
|
||||
input->display = request->display;
|
||||
input->connection = g_object_ref (request->connection);
|
||||
input->proto_v7_plus = proto_v7_plus;
|
||||
input->binary = binary;
|
||||
|
||||
data_buffer = g_buffered_input_stream_peek_buffer (G_BUFFERED_INPUT_STREAM (request->data), &data_buffer_size);
|
||||
input->buffer = g_byte_array_sized_new (data_buffer_size);
|
||||
@@ -874,7 +876,7 @@ start_input (HttpRequest *request)
|
||||
|
||||
broadway_display->input = input;
|
||||
|
||||
start_output (request, proto_v7_plus);
|
||||
start_output (request, proto_v7_plus, binary);
|
||||
|
||||
/* This will free and close the data input stream, but we got all the buffered content already */
|
||||
http_request_free (request);
|
||||
@@ -892,7 +894,7 @@ start_input (HttpRequest *request)
|
||||
}
|
||||
|
||||
static void
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus)
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
|
||||
{
|
||||
GSocket *socket;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
@@ -912,7 +914,7 @@ start_output (HttpRequest *request, gboolean proto_v7_plus)
|
||||
|
||||
broadway_display->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
broadway_display->saved_serial, proto_v7_plus);
|
||||
broadway_display->saved_serial, proto_v7_plus, binary);
|
||||
|
||||
_gdk_broadway_resync_windows ();
|
||||
|
||||
@@ -985,7 +987,9 @@ got_request (HttpRequest *request)
|
||||
else if (strcmp (escaped, "/broadway.js") == 0)
|
||||
send_data (request, "text/javascript", broadway_js, G_N_ELEMENTS(broadway_js) - 1);
|
||||
else if (strcmp (escaped, "/socket") == 0)
|
||||
start_input (request);
|
||||
start_input (request, FALSE);
|
||||
else if (strcmp (escaped, "/socket-bin") == 0)
|
||||
start_input (request, TRUE);
|
||||
else
|
||||
send_error (request, 404, "File not found");
|
||||
|
||||
|
||||
@@ -274,8 +274,6 @@ gdk_pre_parse_libgtk_only (void)
|
||||
_gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
|
||||
}
|
||||
|
||||
g_type_init ();
|
||||
|
||||
/* Do any setup particular to the windowing system */
|
||||
gdk_display_manager_get ();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkmain.h"
|
||||
#include "gdkwindow.h"
|
||||
|
||||
/**
|
||||
* gdk_pointer_ungrab:
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkkeys.h"
|
||||
#include "gdktypes.h"
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkscreenprivate.h"
|
||||
#include "gdkrectangle.h"
|
||||
#include "gdkwindow.h"
|
||||
|
||||
@@ -90,6 +90,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_8:
|
||||
*
|
||||
* A macro that evaluates to the 3.8 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -217,4 +227,18 @@
|
||||
# define GDK_AVAILABLE_IN_3_6
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
|
||||
# define GDK_AVAILABLE_IN_3_8 GDK_UNAVAILABLE(3, 8)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_8
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
@@ -668,6 +668,13 @@ gdk_window_has_no_impl (GdkWindow *window)
|
||||
return window->impl_window != window;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_has_alpha (GdkWindow *window)
|
||||
{
|
||||
return !gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_layered_child_area (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
@@ -695,7 +702,7 @@ remove_layered_child_area (GdkWindow *window,
|
||||
continue;
|
||||
|
||||
/* Only non-impl children with alpha add to the layered region */
|
||||
if (!child->has_alpha_background && gdk_window_has_impl (child))
|
||||
if (!gdk_window_has_alpha (child))
|
||||
continue;
|
||||
|
||||
r.x = child->x;
|
||||
@@ -797,7 +804,7 @@ remove_child_area (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (child->has_alpha_background)
|
||||
if (gdk_window_has_alpha (child))
|
||||
{
|
||||
if (layered_region != NULL)
|
||||
cairo_region_union (layered_region, child_region);
|
||||
@@ -1363,6 +1370,11 @@ gdk_window_new (GdkWindow *parent,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (attributes_mask & GDK_WA_VISUAL)
|
||||
{
|
||||
g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
|
||||
}
|
||||
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
window = _gdk_display_create_window (display);
|
||||
@@ -2984,8 +2996,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
by being drawn in back to front order. However, if implicit paints are not used, for
|
||||
instance if it was flushed due to a non-double-buffered paint in the middle of the
|
||||
expose we need to copy in the existing data here. */
|
||||
if (!gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background &&
|
||||
if (gdk_window_has_alpha (window) &&
|
||||
(!implicit_paint ||
|
||||
(implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed))))
|
||||
{
|
||||
@@ -6156,7 +6167,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
|
||||
* Everything in the old and new regions that is not copied must be
|
||||
* invalidated (including children) as this is newly exposed
|
||||
*/
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (new_region);
|
||||
@@ -6380,7 +6391,7 @@ gdk_window_scroll (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* Calculate the area that can be gotten by copying the old area */
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (window->clip_region);
|
||||
@@ -6468,7 +6479,7 @@ gdk_window_move_region (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* compute source regions */
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (region);
|
||||
|
||||
@@ -141,6 +141,38 @@
|
||||
return inMove;
|
||||
}
|
||||
|
||||
-(void)checkSendEnterNotify
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
|
||||
/* When a new window has been created, and the mouse
|
||||
* is in the window area, we will not receive an NSMouseEntered
|
||||
* event. Therefore, we synthesize an enter notify event manually.
|
||||
*/
|
||||
if (!initialPositionKnown)
|
||||
{
|
||||
initialPositionKnown = YES;
|
||||
|
||||
if (NSPointInRect ([NSEvent mouseLocation], [self frame]))
|
||||
{
|
||||
NSEvent *event;
|
||||
|
||||
event = [NSEvent enterExitEventWithType: NSMouseEntered
|
||||
location: [self mouseLocationOutsideOfEventStream]
|
||||
modifierFlags: 0
|
||||
timestamp: [[NSApp currentEvent] timestamp]
|
||||
windowNumber: [impl->toplevel windowNumber]
|
||||
context: NULL
|
||||
eventNumber: 0
|
||||
trackingNumber: [impl->view trackingRect]
|
||||
userData: nil];
|
||||
|
||||
[NSApp postEvent:event atStart:NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)windowDidMove:(NSNotification *)aNotification
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
@@ -157,6 +189,8 @@
|
||||
event->configure.height = window->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
-(void)windowDidResize:(NSNotification *)aNotification
|
||||
@@ -186,6 +220,8 @@
|
||||
event->configure.height = window->height;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
-(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag screen:(NSScreen *)screen
|
||||
@@ -283,6 +319,8 @@
|
||||
[impl->toplevel orderFront:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
|
||||
[self checkSendEnterNotify];
|
||||
}
|
||||
|
||||
- (void)hide
|
||||
@@ -293,6 +331,8 @@
|
||||
inShowOrHide = YES;
|
||||
[impl->toplevel orderOut:nil];
|
||||
inShowOrHide = NO;
|
||||
|
||||
initialPositionKnown = NO;
|
||||
}
|
||||
|
||||
- (BOOL)trackManualMove
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
@interface GdkQuartzNSWindow : NSWindow {
|
||||
BOOL inMove;
|
||||
BOOL inShowOrHide;
|
||||
BOOL initialPositionKnown;
|
||||
|
||||
/* Manually triggered move/resize (not by the window manager) */
|
||||
BOOL inManualMove;
|
||||
|
||||
@@ -81,6 +81,25 @@
|
||||
if (NSEqualRects (rect, NSZeroRect))
|
||||
return;
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (gdk_window))
|
||||
{
|
||||
/* If the window is not yet mapped, clip_region_with_children
|
||||
* will be empty causing the usual code below to draw nothing.
|
||||
* To not see garbage on the screen, we draw an aesthetic color
|
||||
* here. The garbage would be visible if any widget enabled
|
||||
* the NSView's CALayer in order to add sublayers for custom
|
||||
* native rendering.
|
||||
*/
|
||||
[NSGraphicsContext saveGraphicsState];
|
||||
|
||||
[[NSColor windowBackgroundColor] setFill];
|
||||
[NSBezierPath fillRect:rect];
|
||||
|
||||
[NSGraphicsContext restoreGraphicsState];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Clear our own bookkeeping of regions that need display */
|
||||
if (impl->needs_display_region)
|
||||
{
|
||||
@@ -148,15 +167,6 @@
|
||||
owner:self
|
||||
userData:nil
|
||||
assumeInside:NO];
|
||||
|
||||
if (NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect))
|
||||
{
|
||||
/* When a new window (and thus view) has been created, and the mouse
|
||||
* is in the window area, we will not receive an NSMouseEntered
|
||||
* event. Therefore, we synthesize an enter notify event manually.
|
||||
*/
|
||||
_gdk_quartz_events_send_enter_notify_event (gdk_window);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewDidMoveToWindow
|
||||
|
||||
@@ -401,34 +401,89 @@ get_window_point_from_screen_point (GdkWindow *window,
|
||||
*y = window->height - point.y;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_mouse_button_press_event (NSEventType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case NSLeftMouseDown:
|
||||
case NSRightMouseDown:
|
||||
case NSOtherMouseDown:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
get_toplevel_from_ns_event (NSEvent *nsevent,
|
||||
NSPoint *screen_point,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
GdkWindow *toplevel;
|
||||
GdkWindow *toplevel = NULL;
|
||||
|
||||
if ([nsevent window])
|
||||
{
|
||||
GdkQuartzView *view;
|
||||
NSPoint point;
|
||||
NSPoint point, view_point;
|
||||
NSRect view_frame;
|
||||
|
||||
view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
|
||||
toplevel = [view gdkWindow];
|
||||
|
||||
point = [nsevent locationInWindow];
|
||||
*screen_point = [[nsevent window] convertBaseToScreen:point];
|
||||
view_point = [view convertPoint:point fromView:nil];
|
||||
view_frame = [view frame];
|
||||
|
||||
*x = point.x;
|
||||
*y = toplevel->height - point.y;
|
||||
/* NSEvents come in with a window set, but with window coordinates
|
||||
* out of window bounds. For e.g. moved events this is fine, we use
|
||||
* this information to properly handle enter/leave notify and motion
|
||||
* events. For mouse button press/release, we want to avoid forwarding
|
||||
* these events however, because the window they relate to is not the
|
||||
* window set in the event. This situation appears to occur when button
|
||||
* presses come in just before (or just after?) a window is resized and
|
||||
* also when a button press occurs on the OS X window titlebar.
|
||||
*
|
||||
* By setting toplevel to NULL, we do another attempt to get the right
|
||||
* toplevel window below.
|
||||
*/
|
||||
if (is_mouse_button_press_event ([nsevent type]) &&
|
||||
(view_point.x < view_frame.origin.x ||
|
||||
view_point.x >= view_frame.origin.x + view_frame.size.width ||
|
||||
view_point.y < view_frame.origin.y ||
|
||||
view_point.y >= view_frame.origin.y + view_frame.size.height))
|
||||
{
|
||||
toplevel = NULL;
|
||||
|
||||
/* This is a hack for button presses to break all grabs. E.g. if
|
||||
* a menu is open and one clicks on the title bar (or anywhere
|
||||
* out of window bounds), we really want to pop down the menu (by
|
||||
* breaking the grabs) before OS X handles the action of the title
|
||||
* bar button.
|
||||
*
|
||||
* Because we cannot ingest this event into GDK, we have to do it
|
||||
* here, not very nice.
|
||||
*/
|
||||
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
}
|
||||
else
|
||||
{
|
||||
*screen_point = [[nsevent window] convertBaseToScreen:point];
|
||||
|
||||
*x = point.x;
|
||||
*y = toplevel->height - point.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!toplevel)
|
||||
{
|
||||
/* Fallback used when no NSWindow set. This happens e.g. when
|
||||
* we allow motion events without a window set in gdk_event_translate()
|
||||
* that occur immediately after the main menu bar was clicked/used.
|
||||
* This fallback will not return coordinates contained in a window's
|
||||
* titlebar.
|
||||
*/
|
||||
*screen_point = [NSEvent mouseLocation];
|
||||
toplevel = find_toplevel_under_pointer (_gdk_display,
|
||||
@@ -475,7 +530,7 @@ generate_motion_event (GdkWindow *window)
|
||||
|
||||
event->any.type = GDK_MOTION_NOTIFY;
|
||||
event->motion.window = window;
|
||||
event->motion.time = GDK_CURRENT_TIME;
|
||||
event->motion.time = get_time_from_ns_event ([NSApp currentEvent]);
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
event->motion.x_root = x_root;
|
||||
@@ -534,39 +589,6 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_events_send_enter_notify_event (GdkWindow *window)
|
||||
{
|
||||
NSPoint screen_point;
|
||||
GdkEvent *event;
|
||||
gint x, y, x_root, y_root;
|
||||
|
||||
event = gdk_event_new (GDK_ENTER_NOTIFY);
|
||||
event->any.window = NULL;
|
||||
event->any.send_event = FALSE;
|
||||
|
||||
screen_point = [NSEvent mouseLocation];
|
||||
|
||||
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
|
||||
get_window_point_from_screen_point (window, screen_point, &x, &y);
|
||||
|
||||
event->crossing.window = window;
|
||||
event->crossing.subwindow = NULL;
|
||||
event->crossing.time = GDK_CURRENT_TIME;
|
||||
event->crossing.x = x;
|
||||
event->crossing.y = y;
|
||||
event->crossing.x_root = x_root;
|
||||
event->crossing.y_root = y_root;
|
||||
event->crossing.mode = GDK_CROSSING_NORMAL;
|
||||
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
||||
event->crossing.state = _gdk_quartz_events_get_current_keyboard_modifiers () |
|
||||
_gdk_quartz_events_get_current_mouse_modifiers ();
|
||||
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
|
||||
append_event (event, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_events_send_map_event (GdkWindow *window)
|
||||
{
|
||||
@@ -600,6 +622,18 @@ find_toplevel_under_pointer (GdkDisplay *display,
|
||||
if (toplevel && WINDOW_IS_TOPLEVEL (toplevel))
|
||||
get_window_point_from_screen_point (toplevel, screen_point, x, y);
|
||||
|
||||
if (toplevel)
|
||||
{
|
||||
/* If the coordinates are out of window bounds, this toplevel is not
|
||||
* under the pointer and we thus return NULL. This can occur when
|
||||
* toplevel under pointer has not yet been updated due to a very recent
|
||||
* window resize. Alternatively, we should no longer be relying on
|
||||
* the toplevel_under_pointer value which is maintained in gdkwindow.c.
|
||||
*/
|
||||
if (*x < 0 || *y < 0 || *x >= toplevel->width || *y >= toplevel->height)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
@@ -772,6 +806,8 @@ find_window_for_ns_event (NSEvent *nsevent,
|
||||
view = (GdkQuartzView *)[[nsevent window] contentView];
|
||||
|
||||
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
|
||||
if (!toplevel)
|
||||
return NULL;
|
||||
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root);
|
||||
|
||||
event_type = [nsevent type];
|
||||
@@ -1085,8 +1121,9 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
switch ([nsevent type])
|
||||
{
|
||||
case NSMouseEntered:
|
||||
/* Enter events are considered always to be from the root window as we
|
||||
* can't know for sure from what window we enter.
|
||||
/* Enter events are considered always to be from another toplevel
|
||||
* window, this shouldn't negatively affect any app or gtk code,
|
||||
* and is the only way to make GtkMenu work. EEK EEK EEK.
|
||||
*/
|
||||
if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK))
|
||||
return FALSE;
|
||||
@@ -1096,14 +1133,11 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
x_root, y_root,
|
||||
GDK_ENTER_NOTIFY,
|
||||
GDK_CROSSING_NORMAL,
|
||||
GDK_NOTIFY_ANCESTOR);
|
||||
GDK_NOTIFY_NONLINEAR);
|
||||
return TRUE;
|
||||
|
||||
case NSMouseExited:
|
||||
/* Exited always is to the root window as far as we are concerned,
|
||||
* since there is no way to reliably get information about what new
|
||||
* window is entered when exiting one.
|
||||
*/
|
||||
/* See above */
|
||||
if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK))
|
||||
return FALSE;
|
||||
|
||||
@@ -1112,7 +1146,7 @@ synthesize_crossing_event (GdkWindow *window,
|
||||
x_root, y_root,
|
||||
GDK_LEAVE_NOTIFY,
|
||||
GDK_CROSSING_NORMAL,
|
||||
GDK_NOTIFY_ANCESTOR);
|
||||
GDK_NOTIFY_NONLINEAR);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
@@ -1309,9 +1343,9 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
|
||||
/* Also when in a manual resize, we ignore events so that these are
|
||||
* pushed to GdkQuartzWindow's sendEvent handler.
|
||||
* pushed to GdkQuartzNSWindow's sendEvent handler.
|
||||
*/
|
||||
if ([(GdkQuartzWindow *)nswindow isInManualResize])
|
||||
if ([(GdkQuartzNSWindow *)nswindow isInManualResize])
|
||||
return FALSE;
|
||||
|
||||
/* Find the right GDK window to send the event to, taking grabs and
|
||||
@@ -1439,7 +1473,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
if (dx != 0.0 || dy != 0.0)
|
||||
{
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION &[nsevent hasPreciseScrollingDeltas])
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_LION &&
|
||||
[nsevent hasPreciseScrollingDeltas])
|
||||
{
|
||||
GdkEvent *emulated_event;
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ const static struct {
|
||||
{ 67, GDK_KEY_asterisk, GDK_KEY_KP_Multiply },
|
||||
{ 69, GDK_KEY_plus, GDK_KEY_KP_Add },
|
||||
{ 75, GDK_KEY_slash, GDK_KEY_KP_Divide },
|
||||
{ 76, 0x01000003, GDK_KEY_KP_Enter },
|
||||
{ 76, GDK_KEY_Return, GDK_KEY_KP_Enter },
|
||||
{ 78, GDK_KEY_minus, GDK_KEY_KP_Subtract },
|
||||
{ 81, GDK_KEY_equal, GDK_KEY_KP_Equal },
|
||||
{ 82, GDK_KEY_0, GDK_KEY_KP_0 },
|
||||
|
||||
@@ -64,7 +64,6 @@ void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
||||
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
|
||||
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
|
||||
|
||||
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
|
||||
void _gdk_quartz_events_break_all_grabs (guint32 time);
|
||||
|
||||
/* Event loop */
|
||||
|
||||
@@ -2315,28 +2315,31 @@ gdk_quartz_window_focus (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
gint window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
static gint
|
||||
window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
{
|
||||
/* the order in this switch statement corresponds to the actual
|
||||
* stacking order: the first group is top, the last group is bottom
|
||||
*/
|
||||
switch (hint)
|
||||
{
|
||||
case GDK_WINDOW_TYPE_HINT_DOCK:
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
return NSFloatingWindowLevel;
|
||||
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
|
||||
case GDK_WINDOW_TYPE_HINT_COMBO:
|
||||
case GDK_WINDOW_TYPE_HINT_DND:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return NSPopUpMenuWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
return NSStatusWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
|
||||
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */
|
||||
return NSTornOffMenuWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return NSStatusWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
|
||||
case GDK_WINDOW_TYPE_HINT_COMBO:
|
||||
case GDK_WINDOW_TYPE_HINT_DND:
|
||||
return NSPopUpMenuWindowLevel;
|
||||
case GDK_WINDOW_TYPE_HINT_DOCK:
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
return NSFloatingWindowLevel;
|
||||
|
||||
case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */
|
||||
case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */
|
||||
@@ -2351,7 +2354,7 @@ gint window_type_hint_to_level (GdkWindowTypeHint hint)
|
||||
return NSNormalWindowLevel;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static gboolean
|
||||
window_type_hint_to_shadow (GdkWindowTypeHint hint)
|
||||
{
|
||||
switch (hint)
|
||||
@@ -2381,13 +2384,31 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
|
||||
{
|
||||
switch (hint)
|
||||
{
|
||||
case GDK_WINDOW_TYPE_HINT_UTILITY:
|
||||
case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
|
||||
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
|
||||
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
|
||||
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
GdkWindowTypeHint hint)
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL (window))
|
||||
return;
|
||||
@@ -2402,6 +2423,7 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
|
||||
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (hint)];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
|
||||
}
|
||||
|
||||
static GdkWindowTypeHint
|
||||
@@ -2619,6 +2641,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
defer:NO];
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
|
||||
[impl->toplevel setContentView:old_view];
|
||||
}
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
x, y);
|
||||
wl_surface_attach (wd->pointer_surface, buffer, 0, 0);
|
||||
wl_surface_damage (wd->pointer_surface, 0, 0, w, h);
|
||||
wl_surface_commit(wd->pointer_surface);
|
||||
|
||||
g_object_unref (cursor);
|
||||
}
|
||||
@@ -1240,14 +1241,14 @@ static GdkModifierType
|
||||
get_modifier (struct xkb_state *state)
|
||||
{
|
||||
GdkModifierType modifiers = 0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_EFFECTIVE) > 0)?GDK_LOCK_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD1_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD2_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD3_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_EFFECTIVE) > 0)?GDK_MOD4_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_EFFECTIVE) > 0)?GDK_MOD5_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_SHIFT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_SHIFT_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CAPS, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_LOCK_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_CTRL, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_CONTROL_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_ALT, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD1_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod2", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD2_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod3", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD3_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, XKB_MOD_NAME_LOGO, XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD4_MASK:0;
|
||||
modifiers |= (xkb_state_mod_name_is_active (state, "Mod5", XKB_STATE_MODS_EFFECTIVE) > 0)?GDK_MOD5_MASK:0;
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
@@ -1324,16 +1325,11 @@ deliver_key_event(GdkWaylandDevice *device,
|
||||
struct xkb_state *xkb_state;
|
||||
GdkKeymap *keymap;
|
||||
xkb_keysym_t sym;
|
||||
uint32_t num_syms;
|
||||
const xkb_keysym_t *syms;
|
||||
|
||||
keymap = device->keymap;
|
||||
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
|
||||
|
||||
num_syms = xkb_key_get_syms (xkb_state, key, &syms);
|
||||
sym = XKB_KEY_NoSymbol;
|
||||
if (num_syms == 1)
|
||||
sym = syms[0];
|
||||
sym = xkb_state_key_get_one_sym (xkb_state, key);
|
||||
|
||||
device->time = time;
|
||||
device->modifiers = get_modifier (xkb_state);
|
||||
|
||||
@@ -96,7 +96,8 @@ static void
|
||||
output_handle_geometry(void *data,
|
||||
struct wl_output *wl_output,
|
||||
int x, int y, int physical_width, int physical_height,
|
||||
int subpixel, const char *make, const char *model)
|
||||
int subpixel, const char *make, const char *model,
|
||||
int32_t transform)
|
||||
{
|
||||
/*
|
||||
g_signal_emit_by_name (screen, "monitors-changed");
|
||||
@@ -119,8 +120,8 @@ static const struct wl_output_listener output_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
const char *interface, uint32_t version, void *data)
|
||||
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
|
||||
const char *interface, uint32_t version)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
@@ -128,27 +129,29 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
|
||||
if (strcmp(interface, "wl_compositor") == 0) {
|
||||
display_wayland->compositor =
|
||||
wl_display_bind(display, id, &wl_compositor_interface);
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, 1);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm = wl_display_bind(display, id, &wl_shm_interface);
|
||||
display_wayland->shm =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme(display_wayland);
|
||||
} else if (strcmp(interface, "wl_shell") == 0) {
|
||||
display_wayland->shell = wl_display_bind(display, id, &wl_shell_interface);
|
||||
display_wayland->shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shell_interface, 1);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
display_wayland->output =
|
||||
wl_display_bind(display, id, &wl_output_interface);
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, 1);
|
||||
wl_output_add_listener(display_wayland->output,
|
||||
&output_listener, display_wayland);
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
seat = wl_display_bind (display, id, &wl_seat_interface);
|
||||
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 1);
|
||||
_gdk_wayland_device_manager_add_device (gdk_display->device_manager,
|
||||
seat);
|
||||
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
|
||||
display_wayland->data_device_manager =
|
||||
wl_display_bind(display, id,
|
||||
&wl_data_device_manager_interface);
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
&wl_data_device_manager_interface, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,6 +213,10 @@ gdk_display_init_egl(GdkDisplay *display)
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
gdk_registry_handle_global
|
||||
};
|
||||
|
||||
GdkDisplay *
|
||||
_gdk_wayland_display_open (const gchar *display_name)
|
||||
{
|
||||
@@ -231,14 +238,13 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
display->device_manager = _gdk_wayland_device_manager_new (display);
|
||||
|
||||
/* Set up listener so we'll catch all events. */
|
||||
wl_display_add_global_listener(display_wayland->wl_display,
|
||||
gdk_display_handle_global, display_wayland);
|
||||
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
|
||||
wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
gdk_display_init_egl(display);
|
||||
#else
|
||||
wl_display_iterate(wl_display, WL_DISPLAY_READABLE);
|
||||
wl_display_roundtrip(wl_display);
|
||||
wl_display_dispatch(display_wayland->wl_display);
|
||||
#endif
|
||||
|
||||
display_wayland->event_source =
|
||||
@@ -351,8 +357,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (!display->closed)
|
||||
_gdk_wayland_display_flush (display,
|
||||
GDK_WAYLAND_DISPLAY (display)->event_source);
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -76,6 +76,7 @@ struct _GdkWaylandDisplay
|
||||
|
||||
/* Wayland fields below */
|
||||
struct wl_display *wl_display;
|
||||
struct wl_registry *wl_registry;
|
||||
struct wl_compositor *compositor;
|
||||
struct wl_shm *shm;
|
||||
struct wl_shell *shell;
|
||||
|
||||
@@ -136,7 +136,7 @@ gdk_wayland_display_manager_lookup_keyval (GdkDisplayManager *manager,
|
||||
{
|
||||
g_return_val_if_fail (keyval_name != NULL, 0);
|
||||
|
||||
return xkb_keysym_from_name(keyval_name);
|
||||
return xkb_keysym_from_name (keyval_name, 0);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
|
||||
@@ -44,8 +44,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
if (_gdk_event_queue_find_first (source->display) != NULL)
|
||||
return TRUE;
|
||||
|
||||
while (source->mask & WL_DISPLAY_WRITABLE)
|
||||
wl_display_iterate(display->wl_display, WL_DISPLAY_WRITABLE);
|
||||
wl_display_flush(display->wl_display);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -97,16 +96,6 @@ static GSourceFuncs wl_glib_source_funcs = {
|
||||
gdk_event_source_finalize
|
||||
};
|
||||
|
||||
static int
|
||||
gdk_event_source_update(uint32_t mask, void *data)
|
||||
{
|
||||
GdkWaylandEventSource *source = data;
|
||||
|
||||
source->mask = mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
|
||||
{
|
||||
@@ -134,8 +123,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
wl_source->display = display;
|
||||
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display,
|
||||
gdk_event_source_update, source);
|
||||
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display);
|
||||
wl_source->pfd.events = G_IO_IN | G_IO_ERR;
|
||||
g_source_add_poll(source, &wl_source->pfd);
|
||||
|
||||
@@ -148,16 +136,6 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
return source;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_flush (GdkDisplay *display, GSource *source)
|
||||
{
|
||||
GdkWaylandEventSource *wayland_source = (GdkWaylandEventSource *) source;
|
||||
|
||||
while (wayland_source->mask & WL_DISPLAY_WRITABLE)
|
||||
wl_display_iterate(GDK_WAYLAND_DISPLAY (display)->wl_display,
|
||||
WL_DISPLAY_WRITABLE);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
@@ -166,10 +144,9 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
source = (GdkWaylandEventSource *) display_wayland->event_source;
|
||||
|
||||
if (source->pfd.revents)
|
||||
{
|
||||
wl_display_iterate(display_wayland->wl_display, WL_DISPLAY_READABLE);
|
||||
source->pfd.revents = 0;
|
||||
wl_display_dispatch(display_wayland->wl_display);
|
||||
source->pfd.revents = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ _gdk_wayland_keymap_new ()
|
||||
names.layout = "us";
|
||||
names.variant = "";
|
||||
names.options = "";
|
||||
keymap->xkb_keymap = xkb_map_new_from_names(context, &names, XKB_MAP_COMPILE_PLACEHOLDER);
|
||||
keymap->xkb_keymap = xkb_keymap_new_from_names (context, &names, 0);
|
||||
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
|
||||
xkb_context_unref (context);
|
||||
|
||||
@@ -246,7 +246,7 @@ _gdk_wayland_keymap_new_from_fd (uint32_t format,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
keymap->xkb_keymap = xkb_map_new_from_string (context, map_str, format, XKB_MAP_COMPILE_PLACEHOLDER);
|
||||
keymap->xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
|
||||
munmap (map_str, size);
|
||||
close (fd);
|
||||
keymap->xkb_state = xkb_state_new (keymap->xkb_keymap);
|
||||
|
||||
@@ -137,7 +137,6 @@ GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
|
||||
void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event);
|
||||
GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display);
|
||||
void _gdk_wayland_display_queue_events (GdkDisplay *display);
|
||||
void _gdk_wayland_display_flush (GdkDisplay *display, GSource *source);
|
||||
|
||||
GdkAppLaunchContext *_gdk_wayland_display_get_app_launch_context (GdkDisplay *display);
|
||||
|
||||
|
||||
@@ -1563,6 +1563,7 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
wl_surface_damage (impl->surface,
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
wl_surface_commit(impl->surface);
|
||||
}
|
||||
|
||||
_gdk_window_process_updates_recurse (window, region);
|
||||
|
||||
@@ -1459,7 +1459,6 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
_gdk_x11_screen_setup (display_x11->screens[i]);
|
||||
|
||||
g_signal_emit_by_name (display, "opened");
|
||||
g_signal_emit_by_name (gdk_display_manager_get (), "display-opened", display);
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,13 @@ gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display;
|
||||
|
||||
display = _gdk_x11_display_open (name);
|
||||
if (manager_x11->default_display == NULL && display != NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
if (display != NULL)
|
||||
{
|
||||
if (manager_x11->default_display == NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
|
||||
g_signal_emit_by_name (manager, "display-opened", display);
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
@@ -311,6 +311,10 @@ void _gdk_x11_cursor_display_finalize (GdkDisplay *display);
|
||||
|
||||
void _gdk_x11_window_register_dnd (GdkWindow *window);
|
||||
|
||||
GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GList *targets);
|
||||
|
||||
gboolean _gdk_x11_get_xft_setting (GdkScreen *screen,
|
||||
const gchar *name,
|
||||
GValue *value);
|
||||
|
||||
@@ -4858,6 +4858,11 @@ _gdk_x11_display_before_process_all_updates (GdkDisplay *display)
|
||||
void
|
||||
_gdk_x11_display_after_process_all_updates (GdkDisplay *display)
|
||||
{
|
||||
/* Sync after all drawing, otherwise the client can get "ahead" of
|
||||
the server rendering during animations, such that we fill up
|
||||
the Xserver pipes with sync rendering ops not letting other
|
||||
clients (including the VM) do anything. */
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
|
||||
}
|
||||
|
||||
static Bool
|
||||
@@ -4948,10 +4953,6 @@ gdk_x11_window_get_xid (GdkWindow *window)
|
||||
return GDK_WINDOW_IMPL_X11 (window->impl)->xid;
|
||||
}
|
||||
|
||||
extern GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
GList *targets);
|
||||
|
||||
static void
|
||||
gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
|
||||
{
|
||||
|
||||
@@ -431,6 +431,7 @@ gtk_private_h_sources = \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscomputedvaluesprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
@@ -477,6 +478,8 @@ gtk_private_h_sources = \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkgradientprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
@@ -516,6 +519,7 @@ gtk_private_h_sources = \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
@@ -652,6 +656,7 @@ gtk_base_c_sources = \
|
||||
gtkcssarrayvalue.c \
|
||||
gtkcssbgsizevalue.c \
|
||||
gtkcssbordervalue.c \
|
||||
gtkcsscolorvalue.c \
|
||||
gtkcsscomputedvalues.c \
|
||||
gtkcsscornervalue.c \
|
||||
gtkcsscustomproperty.c \
|
||||
@@ -718,6 +723,7 @@ gtk_base_c_sources = \
|
||||
gtkframe.c \
|
||||
gtkgradient.c \
|
||||
gtkgrid.c \
|
||||
gtkhsla.c \
|
||||
gtkiconcache.c \
|
||||
gtkiconcachevalidator.c \
|
||||
gtkiconfactory.c \
|
||||
@@ -803,6 +809,7 @@ gtk_base_c_sources = \
|
||||
gtksettings.c \
|
||||
gtksizegroup.c \
|
||||
gtksizerequest.c \
|
||||
gtksizerequestcache.c \
|
||||
gtkshow.c \
|
||||
gtkspinbutton.c \
|
||||
gtkspinner.c \
|
||||
|
||||
@@ -6,7 +6,6 @@ gail_c_sources = \
|
||||
gail.c \
|
||||
gtkarrowaccessible.c \
|
||||
gtkbooleancellaccessible.c \
|
||||
gtkboxaccessible.c \
|
||||
gtkbuttonaccessible.c \
|
||||
gtkcellaccessible.c \
|
||||
gtkcellaccessibleparent.c \
|
||||
@@ -54,9 +53,9 @@ gail_c_sources = \
|
||||
gailmisc.c
|
||||
|
||||
gail_private_h_sources = \
|
||||
gail.h \
|
||||
gtkarrowaccessible.h \
|
||||
gtkbooleancellaccessible.h \
|
||||
gtkboxaccessible.h \
|
||||
gtkbuttonaccessible.h \
|
||||
gtkcellaccessible.h \
|
||||
gtkcellaccessibleparent.h \
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gail.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* GAIL - The GNOME Accessibility Implementation Library
|
||||
* Copyright 2004 Sun Microsystems Inc.
|
||||
* Copyright 2001 Sun Microsystems Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -15,31 +15,16 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef __GTK_GAIL_H__
|
||||
#define __GTK_GAIL_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkboxaccessible.h"
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_DEFINE_TYPE (GtkBoxAccessible, _gtk_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
|
||||
void _gtk_accessibility_shutdown (void);
|
||||
void _gtk_accessibility_init (void);
|
||||
|
||||
static void
|
||||
gtk_box_accessible_initialize (AtkObject *accessible,
|
||||
gpointer data)
|
||||
{
|
||||
ATK_OBJECT_CLASS (_gtk_box_accessible_parent_class)->initialize (accessible, data);
|
||||
accessible->role = ATK_ROLE_FILLER;
|
||||
}
|
||||
G_END_DECLS
|
||||
|
||||
static void
|
||||
_gtk_box_accessible_class_init (GtkBoxAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->initialize = gtk_box_accessible_initialize;
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_box_accessible_init (GtkBoxAccessible *scale)
|
||||
{
|
||||
}
|
||||
#endif /* __GTK_GAIL_H__ */
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void _gail_util_install (void);
|
||||
void _gail_util_install (void);
|
||||
void _gail_util_uninstall (void);
|
||||
|
||||
gboolean _gail_util_key_snooper (GtkWidget *the_widget,
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkarrowaccessible.h"
|
||||
|
||||
struct _GtkArrowAccessiblePrivate
|
||||
{
|
||||
gchar *image_description;
|
||||
};
|
||||
|
||||
static void atk_image_interface_init (AtkImageIface *iface);
|
||||
|
||||
@@ -40,7 +44,7 @@ gtk_arrow_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (object);
|
||||
|
||||
g_free (arrow->image_description);
|
||||
g_free (arrow->priv->image_description);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_arrow_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -54,12 +58,16 @@ _gtk_arrow_accessible_class_init (GtkArrowAccessibleClass *klass)
|
||||
atk_object_class->initialize = gtk_arrow_accessible_initialize;
|
||||
|
||||
gobject_class->finalize = gtk_arrow_accessible_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkArrowAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_arrow_accessible_init (GtkArrowAccessible *arrow)
|
||||
{
|
||||
arrow->image_description = NULL;
|
||||
arrow->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow,
|
||||
GTK_TYPE_ARROW_ACCESSIBLE,
|
||||
GtkArrowAccessiblePrivate);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
@@ -67,7 +75,7 @@ gtk_arrow_accessible_get_image_description (AtkImage *obj)
|
||||
{
|
||||
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
|
||||
|
||||
return arrow->image_description;
|
||||
return arrow->priv->image_description;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -76,8 +84,8 @@ gtk_arrow_accessible_set_image_description (AtkImage *obj,
|
||||
{
|
||||
GtkArrowAccessible *arrow = GTK_ARROW_ACCESSIBLE (obj);
|
||||
|
||||
g_free (arrow->image_description);
|
||||
arrow->image_description = g_strdup (description);
|
||||
g_free (arrow->priv->image_description);
|
||||
arrow->priv->image_description = g_strdup (description);
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
||||
@@ -29,14 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_ARROW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ARROW_ACCESSIBLE))
|
||||
#define GTK_ARROW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ARROW_ACCESSIBLE, GtkArrowAccessibleClass))
|
||||
|
||||
typedef struct _GtkArrowAccessible GtkArrowAccessible;
|
||||
typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass;
|
||||
typedef struct _GtkArrowAccessible GtkArrowAccessible;
|
||||
typedef struct _GtkArrowAccessibleClass GtkArrowAccessibleClass;
|
||||
typedef struct _GtkArrowAccessiblePrivate GtkArrowAccessiblePrivate;
|
||||
|
||||
struct _GtkArrowAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
gchar *image_description;
|
||||
GtkArrowAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkArrowAccessibleClass
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkbooleancellaccessible.h"
|
||||
|
||||
struct _GtkBooleanCellAccessiblePrivate
|
||||
{
|
||||
gboolean cell_value;
|
||||
gboolean cell_sensitive;
|
||||
};
|
||||
|
||||
static AtkActionIface *parent_action_iface;
|
||||
|
||||
static gint
|
||||
@@ -82,10 +88,10 @@ gtk_boolean_cell_accessible_ref_state_set (AtkObject *accessible)
|
||||
|
||||
state_set = ATK_OBJECT_CLASS (_gtk_boolean_cell_accessible_parent_class)->ref_state_set (accessible);
|
||||
|
||||
if (cell->cell_value)
|
||||
if (cell->priv->cell_value)
|
||||
atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
|
||||
|
||||
if (cell->cell_sensitive)
|
||||
if (cell->priv->cell_sensitive)
|
||||
atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
|
||||
else
|
||||
atk_state_set_remove_state (state_set, ATK_STATE_SENSITIVE);
|
||||
@@ -99,22 +105,25 @@ gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell)
|
||||
GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell);
|
||||
gboolean active;
|
||||
gboolean sensitive;
|
||||
GtkCellRenderer *renderer;
|
||||
|
||||
g_object_get (G_OBJECT (GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer),
|
||||
g_object_get (cell, "renderer", &renderer, NULL);
|
||||
g_object_get (renderer,
|
||||
"active", &active,
|
||||
"sensitive", &sensitive,
|
||||
NULL);
|
||||
g_object_unref (renderer);
|
||||
|
||||
if (boolean_cell->cell_value != active)
|
||||
if (boolean_cell->priv->cell_value != active)
|
||||
{
|
||||
boolean_cell->cell_value = !boolean_cell->cell_value;
|
||||
boolean_cell->priv->cell_value = !boolean_cell->priv->cell_value;
|
||||
|
||||
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
|
||||
}
|
||||
|
||||
if (boolean_cell->cell_sensitive != sensitive)
|
||||
if (boolean_cell->priv->cell_sensitive != sensitive)
|
||||
{
|
||||
boolean_cell->cell_sensitive = !boolean_cell->cell_sensitive;
|
||||
boolean_cell->priv->cell_sensitive = !boolean_cell->priv->cell_sensitive;
|
||||
|
||||
atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, sensitive);
|
||||
}
|
||||
@@ -129,10 +138,15 @@ _gtk_boolean_cell_accessible_class_init (GtkBooleanCellAccessibleClass *klass)
|
||||
atkobject_class->ref_state_set = gtk_boolean_cell_accessible_ref_state_set;
|
||||
|
||||
cell_class->update_cache = gtk_boolean_cell_accessible_update_cache;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkBooleanCellAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_boolean_cell_accessible_init (GtkBooleanCellAccessible *cell)
|
||||
{
|
||||
cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
|
||||
GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE,
|
||||
GtkBooleanCellAccessiblePrivate);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_BOOLEAN_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE))
|
||||
#define GTK_BOOLEAN_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE, GtkBooleanCellAccessibleClass))
|
||||
|
||||
typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
|
||||
typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
|
||||
typedef struct _GtkBooleanCellAccessible GtkBooleanCellAccessible;
|
||||
typedef struct _GtkBooleanCellAccessibleClass GtkBooleanCellAccessibleClass;
|
||||
typedef struct _GtkBooleanCellAccessiblePrivate GtkBooleanCellAccessiblePrivate;
|
||||
|
||||
struct _GtkBooleanCellAccessible
|
||||
{
|
||||
GtkRendererCellAccessible parent;
|
||||
gboolean cell_value;
|
||||
gboolean cell_sensitive;
|
||||
|
||||
GtkBooleanCellAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkBooleanCellAccessibleClass
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/* GAIL - The GNOME Accessibility Implementation Library
|
||||
* Copyright 2004 Sun Microsystems Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_BOX_ACCESSIBLE_H__
|
||||
#define __GTK_BOX_ACCESSIBLE_H__
|
||||
|
||||
#include "gtkcontaineraccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_BOX_ACCESSIBLE (_gtk_box_accessible_get_type ())
|
||||
#define GTK_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
|
||||
#define GTK_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
|
||||
#define GTK_IS_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX_ACCESSIBLE))
|
||||
#define GTK_IS_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX_ACCESSIBLE))
|
||||
#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
|
||||
|
||||
typedef struct _GtkBoxAccessible GtkBoxAccessible;
|
||||
typedef struct _GtkBoxAccessibleClass GtkBoxAccessibleClass;
|
||||
|
||||
struct _GtkBoxAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
};
|
||||
|
||||
struct _GtkBoxAccessibleClass
|
||||
{
|
||||
GtkContainerAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GType _gtk_box_accessible_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_BOX_ACCESSIBLE_H__ */
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE))
|
||||
#define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
|
||||
|
||||
typedef struct _GtkButtonAccessible GtkButtonAccessible;
|
||||
typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
|
||||
typedef struct _GtkButtonAccessible GtkButtonAccessible;
|
||||
typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
|
||||
typedef struct _GtkButtonAccessiblePrivate GtkButtonAccessiblePrivate;
|
||||
|
||||
struct _GtkButtonAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkButtonAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkButtonAccessibleClass
|
||||
|
||||
@@ -83,7 +83,7 @@ gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
|
||||
|
||||
parent = atk_object_get_parent (obj);
|
||||
if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
|
||||
return g_list_index (GTK_CONTAINER_CELL_ACCESSIBLE (parent)->children, obj);
|
||||
return g_list_index (_gtk_container_cell_accessible_get_children (GTK_CONTAINER_CELL_ACCESSIBLE (parent)), obj);
|
||||
|
||||
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
|
||||
if (parent == NULL)
|
||||
|
||||
@@ -30,12 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_ACCESSIBLE))
|
||||
#define GTK_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_ACCESSIBLE, GtkCellAccessibleClass))
|
||||
|
||||
typedef struct _GtkCellAccessible GtkCellAccessible;
|
||||
typedef struct _GtkCellAccessibleClass GtkCellAccessibleClass;
|
||||
typedef struct _GtkCellAccessible GtkCellAccessible;
|
||||
typedef struct _GtkCellAccessibleClass GtkCellAccessibleClass;
|
||||
typedef struct _GtkCellAccessiblePrivate GtkCellAccessiblePrivate;
|
||||
|
||||
struct _GtkCellAccessible
|
||||
{
|
||||
GtkAccessible parent;
|
||||
|
||||
GtkCellAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkCellAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_CHECK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE))
|
||||
#define GTK_CHECK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessibleClass))
|
||||
|
||||
typedef struct _GtkCheckMenuItemAccessible GtkCheckMenuItemAccessible;
|
||||
typedef struct _GtkCheckMenuItemAccessibleClass GtkCheckMenuItemAccessibleClass;
|
||||
typedef struct _GtkCheckMenuItemAccessible GtkCheckMenuItemAccessible;
|
||||
typedef struct _GtkCheckMenuItemAccessibleClass GtkCheckMenuItemAccessibleClass;
|
||||
typedef struct _GtkCheckMenuItemAccessiblePrivate GtkCheckMenuItemAccessiblePrivate;
|
||||
|
||||
struct _GtkCheckMenuItemAccessible
|
||||
{
|
||||
GtkMenuItemAccessible parent;
|
||||
|
||||
GtkCheckMenuItemAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkCheckMenuItemAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_COLOR_SWATCH_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE))
|
||||
#define GTK_COLOR_SWATCH_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SWATCH_ACCESSIBLE, GtkColorSwatchAccessibleClass))
|
||||
|
||||
typedef struct _GtkColorSwatchAccessible GtkColorSwatchAccessible;
|
||||
typedef struct _GtkColorSwatchAccessibleClass GtkColorSwatchAccessibleClass;
|
||||
typedef struct _GtkColorSwatchAccessible GtkColorSwatchAccessible;
|
||||
typedef struct _GtkColorSwatchAccessibleClass GtkColorSwatchAccessibleClass;
|
||||
typedef struct _GtkColorSwatchAccessiblePrivate GtkColorSwatchAccessiblePrivate;
|
||||
|
||||
struct _GtkColorSwatchAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
GtkColorSwatchAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkColorSwatchAccessibleClass
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkcomboboxaccessible.h"
|
||||
|
||||
struct _GtkComboBoxAccessiblePrivate
|
||||
{
|
||||
gchar *name;
|
||||
gint old_selection;
|
||||
gboolean popup_set;
|
||||
};
|
||||
|
||||
static void atk_action_interface_init (AtkActionIface *iface);
|
||||
static void atk_selection_interface_init (AtkSelectionIface *iface);
|
||||
@@ -41,9 +47,9 @@ changed_cb (GtkWidget *widget)
|
||||
index = gtk_combo_box_get_active (combo_box);
|
||||
obj = gtk_widget_get_accessible (widget);
|
||||
accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
|
||||
if (accessible->old_selection != index)
|
||||
if (accessible->priv->old_selection != index)
|
||||
{
|
||||
accessible->old_selection = index;
|
||||
accessible->priv->old_selection = index;
|
||||
g_object_notify (G_OBJECT (obj), "accessible-name");
|
||||
g_signal_emit_by_name (obj, "selection-changed");
|
||||
}
|
||||
@@ -63,13 +69,13 @@ gtk_combo_box_accessible_initialize (AtkObject *obj,
|
||||
accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);
|
||||
|
||||
g_signal_connect (combo_box, "changed", G_CALLBACK (changed_cb), NULL);
|
||||
accessible->old_selection = gtk_combo_box_get_active (combo_box);
|
||||
accessible->priv->old_selection = gtk_combo_box_get_active (combo_box);
|
||||
|
||||
popup = gtk_combo_box_get_popup_accessible (combo_box);
|
||||
if (popup)
|
||||
{
|
||||
atk_object_set_parent (popup, obj);
|
||||
accessible->popup_set = TRUE;
|
||||
accessible->priv->popup_set = TRUE;
|
||||
}
|
||||
if (gtk_combo_box_get_has_entry (combo_box))
|
||||
atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj);
|
||||
@@ -82,7 +88,7 @@ gtk_combo_box_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkComboBoxAccessible *combo_box = GTK_COMBO_BOX_ACCESSIBLE (object);
|
||||
|
||||
g_free (combo_box->name);
|
||||
g_free (combo_box->priv->name);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_combo_box_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -120,8 +126,8 @@ gtk_combo_box_accessible_get_name (AtkObject *obj)
|
||||
gtk_tree_model_get_value (model, &iter, i, &value);
|
||||
if (G_VALUE_HOLDS_STRING (&value))
|
||||
{
|
||||
g_free (accessible->name);
|
||||
accessible->name = g_strdup (g_value_get_string (&value));
|
||||
g_free (accessible->priv->name);
|
||||
accessible->priv->name = g_strdup (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
break;
|
||||
}
|
||||
@@ -129,7 +135,7 @@ gtk_combo_box_accessible_get_name (AtkObject *obj)
|
||||
g_value_unset (&value);
|
||||
}
|
||||
}
|
||||
return accessible->name;
|
||||
return accessible->priv->name;
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -165,10 +171,10 @@ gtk_combo_box_accessible_ref_child (AtkObject *obj,
|
||||
{
|
||||
child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget));
|
||||
box = GTK_COMBO_BOX_ACCESSIBLE (obj);
|
||||
if (box->popup_set == FALSE)
|
||||
if (!box->priv->popup_set)
|
||||
{
|
||||
atk_object_set_parent (child, obj);
|
||||
box->popup_set = TRUE;
|
||||
box->priv->popup_set = TRUE;
|
||||
}
|
||||
}
|
||||
else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
|
||||
@@ -195,14 +201,19 @@ _gtk_combo_box_accessible_class_init (GtkComboBoxAccessibleClass *klass)
|
||||
class->get_n_children = gtk_combo_box_accessible_get_n_children;
|
||||
class->ref_child = gtk_combo_box_accessible_ref_child;
|
||||
class->initialize = gtk_combo_box_accessible_initialize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkComboBoxAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_combo_box_accessible_init (GtkComboBoxAccessible *combo_box)
|
||||
{
|
||||
combo_box->old_selection = -1;
|
||||
combo_box->name = NULL;
|
||||
combo_box->popup_set = FALSE;
|
||||
combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
|
||||
GTK_TYPE_COMBO_BOX_ACCESSIBLE,
|
||||
GtkComboBoxAccessiblePrivate);
|
||||
combo_box->priv->old_selection = -1;
|
||||
combo_box->priv->name = NULL;
|
||||
combo_box->priv->popup_set = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -29,16 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_COMBO_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO_BOX_ACCESSIBLE))
|
||||
#define GTK_COMBO_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO_BOX_ACCESSIBLE, GtkComboBoxAccessibleClass))
|
||||
|
||||
typedef struct _GtkComboBoxAccessible GtkComboBoxAccessible;
|
||||
typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass;
|
||||
typedef struct _GtkComboBoxAccessible GtkComboBoxAccessible;
|
||||
typedef struct _GtkComboBoxAccessibleClass GtkComboBoxAccessibleClass;
|
||||
typedef struct _GtkComboBoxAccessiblePrivate GtkComboBoxAccessiblePrivate;
|
||||
|
||||
struct _GtkComboBoxAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
gchar *name;
|
||||
gint old_selection;
|
||||
gboolean popup_set;
|
||||
GtkComboBoxAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkComboBoxAccessibleClass
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkcontaineraccessible.h"
|
||||
|
||||
struct _GtkContainerAccessiblePrivate
|
||||
{
|
||||
GList *children;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkContainerAccessible, _gtk_container_accessible, GTK_TYPE_WIDGET_ACCESSIBLE)
|
||||
|
||||
@@ -34,7 +38,7 @@ gtk_container_accessible_get_n_children (AtkObject* obj)
|
||||
if (widget == NULL)
|
||||
return 0;
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER(widget));
|
||||
children = gtk_container_get_children (GTK_CONTAINER (widget));
|
||||
count = g_list_length (children);
|
||||
g_list_free (children);
|
||||
|
||||
@@ -115,9 +119,9 @@ gtk_container_accessible_real_add_gtk (GtkContainer *container,
|
||||
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
|
||||
|
||||
g_object_notify (G_OBJECT (atk_child), "accessible-parent");
|
||||
g_list_free (accessible->children);
|
||||
accessible->children = gtk_container_get_children (container);
|
||||
index = g_list_index (accessible->children, widget);
|
||||
g_list_free (accessible->priv->children);
|
||||
accessible->priv->children = gtk_container_get_children (container);
|
||||
index = g_list_index (accessible->priv->children, widget);
|
||||
g_signal_emit_by_name (atk_parent, "children-changed::add", index, atk_child, NULL);
|
||||
|
||||
return 1;
|
||||
@@ -140,10 +144,10 @@ gtk_container_accessible_real_remove_gtk (GtkContainer *container,
|
||||
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
|
||||
|
||||
g_object_notify (G_OBJECT (atk_child), "accessible-parent");
|
||||
index = g_list_index (accessible->children, widget);
|
||||
g_list_free (accessible->children);
|
||||
accessible->children = gtk_container_get_children (container);
|
||||
if (index >= 0 && index <= g_list_length (accessible->children))
|
||||
index = g_list_index (accessible->priv->children, widget);
|
||||
g_list_free (accessible->priv->children);
|
||||
accessible->priv->children = gtk_container_get_children (container);
|
||||
if (index >= 0 && index <= g_list_length (accessible->priv->children))
|
||||
g_signal_emit_by_name (atk_parent, "children-changed::remove", index, atk_child, NULL);
|
||||
|
||||
return 1;
|
||||
@@ -157,7 +161,7 @@ gtk_container_accessible_real_initialize (AtkObject *obj,
|
||||
|
||||
ATK_OBJECT_CLASS (_gtk_container_accessible_parent_class)->initialize (obj, data);
|
||||
|
||||
accessible->children = gtk_container_get_children (GTK_CONTAINER (data));
|
||||
accessible->priv->children = gtk_container_get_children (GTK_CONTAINER (data));
|
||||
|
||||
g_signal_connect (data, "add", G_CALLBACK (gtk_container_accessible_add_gtk), obj);
|
||||
g_signal_connect (data, "remove", G_CALLBACK (gtk_container_accessible_remove_gtk), obj);
|
||||
@@ -170,7 +174,7 @@ gtk_container_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkContainerAccessible *accessible = GTK_CONTAINER_ACCESSIBLE (object);
|
||||
|
||||
g_list_free (accessible->children);
|
||||
g_list_free (accessible->priv->children);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_container_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -189,10 +193,14 @@ _gtk_container_accessible_class_init (GtkContainerAccessibleClass *klass)
|
||||
|
||||
klass->add_gtk = gtk_container_accessible_real_add_gtk;
|
||||
klass->remove_gtk = gtk_container_accessible_real_remove_gtk;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkContainerAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_container_accessible_init (GtkContainerAccessible *container)
|
||||
{
|
||||
container->priv = G_TYPE_INSTANCE_GET_PRIVATE (container,
|
||||
GTK_TYPE_CONTAINER_ACCESSIBLE,
|
||||
GtkContainerAccessiblePrivate);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_CONTAINER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_ACCESSIBLE))
|
||||
#define GTK_CONTAINER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_ACCESSIBLE, GtkContainerAccessibleClass))
|
||||
|
||||
typedef struct _GtkContainerAccessible GtkContainerAccessible;
|
||||
typedef struct _GtkContainerAccessibleClass GtkContainerAccessibleClass;
|
||||
typedef struct _GtkContainerAccessible GtkContainerAccessible;
|
||||
typedef struct _GtkContainerAccessibleClass GtkContainerAccessibleClass;
|
||||
typedef struct _GtkContainerAccessiblePrivate GtkContainerAccessiblePrivate;
|
||||
|
||||
struct _GtkContainerAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
GList *children;
|
||||
GtkContainerAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkContainerAccessibleClass
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkcontainercellaccessible.h"
|
||||
|
||||
struct _GtkContainerCellAccessiblePrivate
|
||||
{
|
||||
GList *children;
|
||||
gint n_children;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkContainerCellAccessible, _gtk_container_cell_accessible, GTK_TYPE_CELL_ACCESSIBLE)
|
||||
|
||||
@@ -29,7 +34,7 @@ gtk_container_cell_accessible_finalize (GObject *obj)
|
||||
{
|
||||
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
|
||||
|
||||
g_list_free_full (container->children, g_object_unref);
|
||||
g_list_free_full (container->priv->children, g_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_container_cell_accessible_parent_class)->finalize (obj);
|
||||
}
|
||||
@@ -40,7 +45,7 @@ gtk_container_cell_accessible_get_n_children (AtkObject *obj)
|
||||
{
|
||||
GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
|
||||
|
||||
return cell->NChildren;
|
||||
return cell->priv->n_children;
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
@@ -50,7 +55,7 @@ gtk_container_cell_accessible_ref_child (AtkObject *obj,
|
||||
GtkContainerCellAccessible *cell = GTK_CONTAINER_CELL_ACCESSIBLE (obj);
|
||||
GList *l;
|
||||
|
||||
l = g_list_nth (cell->children, child);
|
||||
l = g_list_nth (cell->priv->children, child);
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -63,7 +68,7 @@ gtk_container_cell_accessible_update_cache (GtkCellAccessible *cell)
|
||||
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (cell);
|
||||
GList *l;
|
||||
|
||||
for (l = container->children; l; l = l->next)
|
||||
for (l = container->priv->children; l; l = l->next)
|
||||
{
|
||||
_gtk_cell_accessible_update_cache (l->data);
|
||||
}
|
||||
@@ -75,7 +80,7 @@ gtk_container_cell_widget_set (GtkAccessible *accessible)
|
||||
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
|
||||
GList *l;
|
||||
|
||||
for (l = container->children; l; l = l->next)
|
||||
for (l = container->priv->children; l; l = l->next)
|
||||
{
|
||||
gtk_accessible_set_widget (l->data, gtk_accessible_get_widget (accessible));
|
||||
}
|
||||
@@ -89,7 +94,7 @@ gtk_container_cell_widget_unset (GtkAccessible *accessible)
|
||||
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (accessible);
|
||||
GList *l;
|
||||
|
||||
for (l = container->children; l; l = l->next)
|
||||
for (l = container->priv->children; l; l = l->next)
|
||||
{
|
||||
gtk_accessible_set_widget (l->data, NULL);
|
||||
}
|
||||
@@ -114,31 +119,28 @@ _gtk_container_cell_accessible_class_init (GtkContainerCellAccessibleClass *klas
|
||||
accessible_class->widget_unset = gtk_container_cell_widget_unset;
|
||||
|
||||
cell_class->update_cache = gtk_container_cell_accessible_update_cache;
|
||||
|
||||
g_type_class_add_private (g_object_class, sizeof (GtkContainerCellAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_container_cell_accessible_init (GtkContainerCellAccessible *cell)
|
||||
{
|
||||
cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
|
||||
GTK_TYPE_CONTAINER_CELL_ACCESSIBLE,
|
||||
GtkContainerCellAccessiblePrivate);
|
||||
}
|
||||
|
||||
GtkContainerCellAccessible *
|
||||
_gtk_container_cell_accessible_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *atk_object;
|
||||
GtkContainerCellAccessible *container;
|
||||
|
||||
object = g_object_new (GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, NULL);
|
||||
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
ATK_OBJECT (object)->role = ATK_ROLE_TABLE_CELL;
|
||||
|
||||
atk_object = ATK_OBJECT (object);
|
||||
atk_object->role = ATK_ROLE_TABLE_CELL;
|
||||
|
||||
container = GTK_CONTAINER_CELL_ACCESSIBLE (object);
|
||||
container->children = NULL;
|
||||
container->NChildren = 0;
|
||||
return container;
|
||||
return GTK_CONTAINER_CELL_ACCESSIBLE (object);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -148,8 +150,8 @@ _gtk_container_cell_accessible_add_child (GtkContainerCellAccessible *container,
|
||||
g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
|
||||
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
|
||||
|
||||
container->NChildren++;
|
||||
container->children = g_list_append (container->children, child);
|
||||
container->priv->n_children++;
|
||||
container->priv->children = g_list_append (container->priv->children, child);
|
||||
atk_object_set_parent (ATK_OBJECT (child), ATK_OBJECT (container));
|
||||
}
|
||||
|
||||
@@ -159,8 +161,16 @@ _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *contain
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container));
|
||||
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (child));
|
||||
g_return_if_fail (container->NChildren > 0);
|
||||
g_return_if_fail (container->priv->n_children > 0);
|
||||
|
||||
container->children = g_list_remove (container->children, child);
|
||||
container->NChildren--;
|
||||
container->priv->children = g_list_remove (container->priv->children, child);
|
||||
container->priv->n_children--;
|
||||
}
|
||||
|
||||
GList *
|
||||
_gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CONTAINER_CELL_ACCESSIBLE (container), NULL);
|
||||
|
||||
return container->priv->children;
|
||||
}
|
||||
|
||||
@@ -30,14 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_CONTAINER_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE))
|
||||
#define GTK_CONTAINER_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER_CELL_ACCESSIBLE, GtkContainerCellAccessibleClass))
|
||||
|
||||
typedef struct _GtkContainerCellAccessible GtkContainerCellAccessible;
|
||||
typedef struct _GtkContainerCellAccessibleClass GtkContainerCellAccessibleClass;
|
||||
typedef struct _GtkContainerCellAccessible GtkContainerCellAccessible;
|
||||
typedef struct _GtkContainerCellAccessibleClass GtkContainerCellAccessibleClass;
|
||||
typedef struct _GtkContainerCellAccessiblePrivate GtkContainerCellAccessiblePrivate;
|
||||
|
||||
struct _GtkContainerCellAccessible
|
||||
{
|
||||
GtkCellAccessible parent;
|
||||
GList *children;
|
||||
gint NChildren;
|
||||
|
||||
GtkContainerCellAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkContainerCellAccessibleClass
|
||||
@@ -52,6 +53,7 @@ void _gtk_container_cell_accessible_add_child (GtkCont
|
||||
GtkCellAccessible *child);
|
||||
void _gtk_container_cell_accessible_remove_child (GtkContainerCellAccessible *container,
|
||||
GtkCellAccessible *child);
|
||||
GList *_gtk_container_cell_accessible_get_children (GtkContainerCellAccessible *container);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -17,12 +17,351 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkpango.h"
|
||||
#include "gtkentryaccessible.h"
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtkcomboboxaccessible.h"
|
||||
|
||||
#define GTK_TYPE_ENTRY_ICON_ACCESSIBLE (_gtk_entry_icon_accessible_get_type ())
|
||||
#define GTK_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
|
||||
#define GTK_IS_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE))
|
||||
|
||||
struct _GtkEntryAccessiblePrivate
|
||||
{
|
||||
gint cursor_position;
|
||||
gint selection_bound;
|
||||
AtkObject *icons[2];
|
||||
};
|
||||
|
||||
typedef struct _GtkEntryIconAccessible GtkEntryIconAccessible;
|
||||
typedef struct _GtkEntryIconAccessibleClass GtkEntryIconAccessibleClass;
|
||||
|
||||
struct _GtkEntryIconAccessible
|
||||
{
|
||||
AtkObject parent;
|
||||
|
||||
GtkEntryAccessible *entry;
|
||||
GtkEntryIconPosition pos;
|
||||
};
|
||||
|
||||
struct _GtkEntryIconAccessibleClass
|
||||
{
|
||||
AtkObjectClass parent_class;
|
||||
};
|
||||
|
||||
static void atk_action_interface_init (AtkActionIface *iface);
|
||||
|
||||
static void icon_atk_action_interface_init (AtkActionIface *iface);
|
||||
static void icon_atk_component_interface_init (AtkComponentIface *iface);
|
||||
|
||||
GType _gtk_entry_icon_accessible_get_type (void);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkEntryIconAccessible, _gtk_entry_icon_accessible, ATK_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, icon_atk_action_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, icon_atk_component_interface_init))
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_remove_entry (gpointer data, GObject *obj)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = data;
|
||||
|
||||
if (icon->entry)
|
||||
{
|
||||
icon->entry = NULL;
|
||||
g_object_notify (G_OBJECT (icon), "accessible-parent");
|
||||
atk_object_notify_state_change (ATK_OBJECT (icon), ATK_STATE_DEFUNCT, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_icon_accessible_new (GtkEntryAccessible *entry,
|
||||
GtkEntryIconPosition pos)
|
||||
{
|
||||
GtkEntryIconAccessible *icon;
|
||||
AtkObject *accessible;
|
||||
|
||||
icon = g_object_new (_gtk_entry_icon_accessible_get_type (), NULL);
|
||||
icon->entry = entry;
|
||||
g_object_weak_ref (G_OBJECT (entry),
|
||||
gtk_entry_icon_accessible_remove_entry,
|
||||
icon);
|
||||
icon->pos = pos;
|
||||
|
||||
accessible = ATK_OBJECT (icon);
|
||||
atk_object_initialize (accessible, NULL);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_icon_accessible_init (GtkEntryIconAccessible *icon)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_initialize (AtkObject *obj,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (obj);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
const gchar *name;
|
||||
gchar *text;
|
||||
|
||||
ATK_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->initialize (obj, data);
|
||||
atk_object_set_role (obj, ATK_ROLE_ICON);
|
||||
|
||||
name = gtk_entry_get_icon_name (gtk_entry, icon->pos);
|
||||
if (name)
|
||||
atk_object_set_name (obj, name);
|
||||
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry, icon->pos);
|
||||
if (text)
|
||||
{
|
||||
atk_object_set_description (obj, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
atk_object_set_parent (obj, ATK_OBJECT (icon->entry));
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_icon_accessible_get_parent (AtkObject *accessible)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
|
||||
|
||||
return ATK_OBJECT (icon->entry);
|
||||
}
|
||||
|
||||
static AtkStateSet *
|
||||
gtk_entry_icon_accessible_ref_state_set (AtkObject *accessible)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
|
||||
AtkStateSet *set = atk_state_set_new ();
|
||||
AtkStateSet *entry_set;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *gtk_entry;
|
||||
|
||||
if (!icon->entry)
|
||||
{
|
||||
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
|
||||
return set;
|
||||
}
|
||||
|
||||
entry_set = atk_object_ref_state_set (ATK_OBJECT (icon->entry));
|
||||
if (!entry_set || atk_state_set_contains_state (entry_set, ATK_STATE_DEFUNCT))
|
||||
{
|
||||
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
|
||||
g_clear_object (&entry_set);
|
||||
return set;
|
||||
}
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_ENABLED))
|
||||
atk_state_set_add_state (set, ATK_STATE_ENABLED);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_SENSITIVE))
|
||||
atk_state_set_add_state (set, ATK_STATE_SENSITIVE);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_SHOWING))
|
||||
atk_state_set_add_state (set, ATK_STATE_SHOWING);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_VISIBLE))
|
||||
atk_state_set_add_state (set, ATK_STATE_VISIBLE);
|
||||
|
||||
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos))
|
||||
atk_state_set_remove_state (set, ATK_STATE_SENSITIVE);
|
||||
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
atk_state_set_remove_state (set, ATK_STATE_ENABLED);
|
||||
|
||||
g_object_unref (entry_set);
|
||||
return set;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_invalidate (GtkEntryIconAccessible *icon)
|
||||
{
|
||||
if (!icon->entry)
|
||||
return;
|
||||
g_object_weak_unref (G_OBJECT (icon->entry),
|
||||
gtk_entry_icon_accessible_remove_entry,
|
||||
icon);
|
||||
gtk_entry_icon_accessible_remove_entry (icon, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (object);
|
||||
|
||||
gtk_entry_icon_accessible_invalidate (icon);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_icon_accessible_class_init (GtkEntryIconAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
atk_class->initialize = gtk_entry_icon_accessible_initialize;
|
||||
atk_class->get_parent = gtk_entry_icon_accessible_get_parent;
|
||||
atk_class->ref_state_set = gtk_entry_icon_accessible_ref_state_set;
|
||||
|
||||
gobject_class->finalize = gtk_entry_icon_accessible_finalize;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_entry_icon_accessible_do_action (AtkAction *action,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = (GtkEntryIconAccessible *)action;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *gtk_entry;
|
||||
GdkEvent event;
|
||||
GdkRectangle icon_area;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (i != 0)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
|
||||
return FALSE;
|
||||
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos) ||
|
||||
!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
return FALSE;
|
||||
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
memset (&event, 0, sizeof (event));
|
||||
event.button.type = GDK_BUTTON_PRESS;
|
||||
event.button.window = gtk_widget_get_window (widget);
|
||||
event.button.button = 1;
|
||||
event.button.send_event = TRUE;
|
||||
event.button.time = GDK_CURRENT_TIME;
|
||||
event.button.x = icon_area.x;
|
||||
event.button.y = icon_area.y;
|
||||
|
||||
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, &event);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_entry_icon_accessible_get_n_actions (AtkAction *action)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
return (gtk_entry_get_icon_activatable (gtk_entry, icon->pos) ? 1 : 0);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gtk_entry_icon_accessible_get_name (AtkAction *action,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (i != 0)
|
||||
return NULL;
|
||||
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
return NULL;
|
||||
|
||||
return "activate";
|
||||
}
|
||||
|
||||
static void
|
||||
icon_atk_action_interface_init (AtkActionIface *iface)
|
||||
{
|
||||
iface->do_action = gtk_entry_icon_accessible_do_action;
|
||||
iface->get_n_actions = gtk_entry_icon_accessible_get_n_actions;
|
||||
iface->get_name = gtk_entry_icon_accessible_get_name;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_extents (AtkComponent *component,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height,
|
||||
AtkCoordType coord_type)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
*x = G_MININT;
|
||||
atk_component_get_extents (ATK_COMPONENT (icon->entry), x, y, width, height,
|
||||
coord_type);
|
||||
if (*x == G_MININT)
|
||||
return;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*width = icon_area.width;
|
||||
*height = icon_area.height;
|
||||
*x += icon_area.x;
|
||||
*y += icon_area.y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_position (AtkComponent *component,
|
||||
gint *x,
|
||||
gint *y,
|
||||
AtkCoordType coord_type)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
*x = G_MININT;
|
||||
atk_component_get_position (ATK_COMPONENT (icon->entry), x, y, coord_type);
|
||||
if (*x == G_MININT)
|
||||
return;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*x += icon_area.x;
|
||||
*y += icon_area.y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_size (AtkComponent *component,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*width = icon_area.width;
|
||||
*height = icon_area.height;
|
||||
}
|
||||
|
||||
static void
|
||||
icon_atk_component_interface_init (AtkComponentIface *iface)
|
||||
{
|
||||
iface->get_extents = gtk_entry_icon_accessible_get_extents;
|
||||
iface->get_size = gtk_entry_icon_accessible_get_size;
|
||||
iface->get_position = gtk_entry_icon_accessible_get_position;
|
||||
}
|
||||
|
||||
/* Callbacks */
|
||||
|
||||
static void insert_text_cb (GtkEditable *editable,
|
||||
@@ -109,10 +448,9 @@ gtk_entry_accessible_initialize (AtkObject *obj,
|
||||
gtk_entry_accessible = GTK_ENTRY_ACCESSIBLE (obj);
|
||||
|
||||
entry = GTK_ENTRY (data);
|
||||
gtk_editable_get_selection_bounds (GTK_EDITABLE (entry),
|
||||
&start_pos, &end_pos);
|
||||
gtk_entry_accessible->cursor_position = end_pos;
|
||||
gtk_entry_accessible->selection_bound = start_pos;
|
||||
gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos);
|
||||
gtk_entry_accessible->priv->cursor_position = end_pos;
|
||||
gtk_entry_accessible->priv->selection_bound = start_pos;
|
||||
|
||||
/* Set up signal callbacks */
|
||||
g_signal_connect (entry, "insert-text", G_CALLBACK (insert_text_cb), NULL);
|
||||
@@ -132,11 +470,13 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
|
||||
AtkObject* atk_obj;
|
||||
GtkEntry* gtk_entry;
|
||||
GtkEntryAccessible* entry;
|
||||
GtkEntryAccessiblePrivate *priv;
|
||||
|
||||
widget = GTK_WIDGET (obj);
|
||||
atk_obj = gtk_widget_get_accessible (widget);
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
entry = GTK_ENTRY_ACCESSIBLE (atk_obj);
|
||||
priv = entry->priv;
|
||||
|
||||
if (g_strcmp0 (pspec->name, "cursor-position") == 0)
|
||||
{
|
||||
@@ -146,7 +486,7 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
|
||||
* The entry cursor position has moved so generate the signal.
|
||||
*/
|
||||
g_signal_emit_by_name (atk_obj, "text-caret-moved",
|
||||
entry->cursor_position);
|
||||
entry->priv->cursor_position);
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "selection-bound") == 0)
|
||||
{
|
||||
@@ -169,6 +509,119 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
|
||||
new_role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT;
|
||||
atk_object_set_role (atk_obj, new_role);
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-storage-type") == 0)
|
||||
{
|
||||
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
g_signal_emit_by_name (entry, "children-changed::add", 0,
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
|
||||
}
|
||||
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_PRIMARY]));
|
||||
g_signal_emit_by_name (entry, "children-changed::remove", 0,
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-storage-type") == 0)
|
||||
{
|
||||
gint index = (priv->icons[GTK_ENTRY_ICON_PRIMARY] ? 1 : 0);
|
||||
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
g_signal_emit_by_name (entry, "children-changed::add", index,
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
|
||||
}
|
||||
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_SECONDARY]));
|
||||
g_signal_emit_by_name (entry, "children-changed::remove", index,
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-name") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
const gchar *name;
|
||||
name = gtk_entry_get_icon_name (gtk_entry,
|
||||
GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_PRIMARY], name);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-name") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
const gchar *name;
|
||||
name = gtk_entry_get_icon_name (gtk_entry,
|
||||
GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_SECONDARY], name);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-tooltip-text") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gchar *text;
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
|
||||
GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
text);
|
||||
g_free (text);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-tooltip-text") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gchar *text;
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
|
||||
GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
text);
|
||||
g_free (text);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-activatable") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
ATK_STATE_ENABLED, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-activatable") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
ATK_STATE_ENABLED, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-sensitive") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
ATK_STATE_SENSITIVE, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-sensitive") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
ATK_STATE_SENSITIVE, on);
|
||||
}
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_entry_accessible_parent_class)->notify_gtk (obj, pspec);
|
||||
}
|
||||
@@ -187,25 +640,109 @@ gtk_entry_accessible_get_index_in_parent (AtkObject *accessible)
|
||||
return ATK_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->get_index_in_parent (accessible);
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_entry_accessible_get_n_children (AtkObject* obj)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkEntry *entry;
|
||||
gint count = 0;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return 0;
|
||||
|
||||
entry = GTK_ENTRY (widget);
|
||||
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
|
||||
count++;
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_accessible_ref_child (AtkObject *obj,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryAccessible *accessible = GTK_ENTRY_ACCESSIBLE (obj);
|
||||
GtkEntryAccessiblePrivate *priv = accessible->priv;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *entry;
|
||||
GtkEntryIconPosition pos;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
entry = GTK_ENTRY (widget);
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
|
||||
pos = GTK_ENTRY_ICON_PRIMARY;
|
||||
else if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
|
||||
pos = GTK_ENTRY_ICON_SECONDARY;
|
||||
else
|
||||
return NULL;
|
||||
break;
|
||||
case 1:
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY)
|
||||
return NULL;
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
|
||||
return NULL;
|
||||
pos = GTK_ENTRY_ICON_SECONDARY;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!priv->icons[pos])
|
||||
priv->icons[pos] = gtk_entry_icon_accessible_new (accessible, pos);
|
||||
return g_object_ref (priv->icons[pos]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkEntryAccessible *entry = GTK_ENTRY_ACCESSIBLE (object);
|
||||
GtkEntryAccessiblePrivate *priv = entry->priv;
|
||||
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
class->ref_state_set = gtk_entry_accessible_ref_state_set;
|
||||
class->get_index_in_parent = gtk_entry_accessible_get_index_in_parent;
|
||||
class->initialize = gtk_entry_accessible_initialize;
|
||||
class->get_attributes = gtk_entry_accessible_get_attributes;
|
||||
class->get_n_children = gtk_entry_accessible_get_n_children;
|
||||
class->ref_child = gtk_entry_accessible_ref_child;
|
||||
|
||||
widget_class->notify_gtk = gtk_entry_accessible_notify_gtk;
|
||||
|
||||
gobject_class->finalize = gtk_entry_accessible_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkEntryAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_accessible_init (GtkEntryAccessible *entry)
|
||||
{
|
||||
entry->cursor_position = 0;
|
||||
entry->selection_bound = 0;
|
||||
entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (entry,
|
||||
GTK_TYPE_ENTRY_ACCESSIBLE,
|
||||
GtkEntryAccessiblePrivate);
|
||||
entry->priv->cursor_position = 0;
|
||||
entry->priv->selection_bound = 0;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
@@ -889,8 +1426,8 @@ check_for_selection_change (GtkEntryAccessible *accessible,
|
||||
|
||||
if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
|
||||
{
|
||||
if (end != accessible->cursor_position ||
|
||||
start != accessible->selection_bound)
|
||||
if (end != accessible->priv->cursor_position ||
|
||||
start != accessible->priv->selection_bound)
|
||||
/*
|
||||
* This check is here as this function can be called
|
||||
* for notification of selection_bound and current_pos.
|
||||
@@ -903,11 +1440,11 @@ check_for_selection_change (GtkEntryAccessible *accessible,
|
||||
else
|
||||
{
|
||||
/* We had a selection */
|
||||
ret_val = (accessible->cursor_position != accessible->selection_bound);
|
||||
ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
|
||||
}
|
||||
|
||||
accessible->cursor_position = end;
|
||||
accessible->selection_bound = start;
|
||||
accessible->priv->cursor_position = end;
|
||||
accessible->priv->selection_bound = start;
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_ACCESSIBLE))
|
||||
#define GTK_ENTRY_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_ACCESSIBLE, GtkEntryAccessibleClass))
|
||||
|
||||
typedef struct _GtkEntryAccessible GtkEntryAccessible;
|
||||
typedef struct _GtkEntryAccessibleClass GtkEntryAccessibleClass;
|
||||
typedef struct _GtkEntryAccessible GtkEntryAccessible;
|
||||
typedef struct _GtkEntryAccessibleClass GtkEntryAccessibleClass;
|
||||
typedef struct _GtkEntryAccessiblePrivate GtkEntryAccessiblePrivate;
|
||||
|
||||
struct _GtkEntryAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
gint cursor_position;
|
||||
gint selection_bound;
|
||||
GtkEntryAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkEntryAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_EXPANDER_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_EXPANDER_ACCESSIBLE))
|
||||
#define GTK_EXPANDER_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_EXPANDER_ACCESSIBLE, GtkExpanderAccessibleClass))
|
||||
|
||||
typedef struct _GtkExpanderAccessible GtkExpanderAccessible;
|
||||
typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass;
|
||||
typedef struct _GtkExpanderAccessible GtkExpanderAccessible;
|
||||
typedef struct _GtkExpanderAccessibleClass GtkExpanderAccessibleClass;
|
||||
typedef struct _GtkExpanderAccessiblePrivate GtkExpanderAccessiblePrivate;
|
||||
|
||||
struct _GtkExpanderAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkExpanderAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkExpanderAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_FRAME_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FRAME_ACCESSIBLE))
|
||||
#define GTK_FRAME_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FRAME_ACCESSIBLE, GtkFrameAccessibleClass))
|
||||
|
||||
typedef struct _GtkFrameAccessible GtkFrameAccessible;
|
||||
typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
|
||||
typedef struct _GtkFrameAccessible GtkFrameAccessible;
|
||||
typedef struct _GtkFrameAccessibleClass GtkFrameAccessibleClass;
|
||||
typedef struct _GtkFrameAccessiblePrivate GtkFrameAccessiblePrivate;
|
||||
|
||||
struct _GtkFrameAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkFrameAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkFrameAccessibleClass
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
#define GTK_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, GtkIconViewItemAccessible))
|
||||
#define GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE))
|
||||
|
||||
struct _GtkIconViewAccessiblePrivate
|
||||
{
|
||||
GList *items;
|
||||
GtkTreeModel *model;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
AtkObject parent;
|
||||
@@ -51,6 +57,8 @@ typedef struct
|
||||
|
||||
} GtkIconViewItemAccessibleClass;
|
||||
|
||||
GType _gtk_icon_view_item_accessible_get_type (void);
|
||||
|
||||
static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item);
|
||||
|
||||
static void atk_component_item_interface_init (AtkComponentIface *iface);
|
||||
@@ -866,7 +874,7 @@ gtk_icon_view_item_accessible_info_new (AtkObject *accessible,
|
||||
info->item = item;
|
||||
info->index = index;
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
while (items)
|
||||
{
|
||||
tmp_info = items->data;
|
||||
@@ -874,7 +882,7 @@ gtk_icon_view_item_accessible_info_new (AtkObject *accessible,
|
||||
break;
|
||||
items = items->next;
|
||||
}
|
||||
view->items = g_list_insert_before (view->items, items, info);
|
||||
view->priv->items = g_list_insert_before (view->priv->items, items, info);
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -900,7 +908,7 @@ gtk_icon_view_accessible_find_child (AtkObject *accessible,
|
||||
GtkIconViewItemAccessibleInfo *info;
|
||||
GList *items;
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
|
||||
while (items)
|
||||
{
|
||||
@@ -964,7 +972,7 @@ gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *view,
|
||||
GtkIconViewItemAccessible *item;
|
||||
GList *items;
|
||||
|
||||
if (view->items)
|
||||
if (view->priv->items)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
gboolean act_on_item;
|
||||
@@ -973,7 +981,7 @@ gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *view,
|
||||
if (widget == NULL)
|
||||
return;
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
|
||||
act_on_item = (list == NULL);
|
||||
|
||||
@@ -1062,7 +1070,7 @@ gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
tmp_list = NULL;
|
||||
while (items)
|
||||
{
|
||||
@@ -1105,7 +1113,7 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
tmp_list = NULL;
|
||||
deleted_item = NULL;
|
||||
info = NULL;
|
||||
@@ -1134,7 +1142,7 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
|
||||
gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
|
||||
g_signal_emit_by_name (atk_obj, "children-changed::remove",
|
||||
index, NULL, NULL);
|
||||
view->items = g_list_remove_link (view->items, deleted_item);
|
||||
view->priv->items = g_list_remove_link (view->priv->items, deleted_item);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
@@ -1174,7 +1182,7 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
|
||||
for (i = 0; i < length; i++)
|
||||
order [new_order[i]] = i;
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
while (items)
|
||||
{
|
||||
info = items->data;
|
||||
@@ -1184,8 +1192,8 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
|
||||
items = items->next;
|
||||
}
|
||||
g_free (order);
|
||||
view->items = g_list_sort (view->items,
|
||||
(GCompareFunc)gtk_icon_view_accessible_item_compare);
|
||||
view->priv->items = g_list_sort (view->priv->items,
|
||||
(GCompareFunc)gtk_icon_view_accessible_item_compare);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1229,7 +1237,7 @@ gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *view)
|
||||
GtkIconViewItemAccessibleInfo *info;
|
||||
GList *items;
|
||||
|
||||
items = view->items;
|
||||
items = view->priv->items;
|
||||
while (items)
|
||||
{
|
||||
info = (GtkIconViewItemAccessibleInfo *) items->data;
|
||||
@@ -1237,8 +1245,8 @@ gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *view)
|
||||
g_free (items->data);
|
||||
items = items->next;
|
||||
}
|
||||
g_list_free (view->items);
|
||||
view->items = NULL;
|
||||
g_list_free (view->priv->items);
|
||||
view->priv->items = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1255,20 +1263,20 @@ gtk_icon_view_accessible_notify_gtk (GObject *obj,
|
||||
widget = GTK_WIDGET (obj);
|
||||
atk_obj = gtk_widget_get_accessible (widget);
|
||||
view = (GtkIconViewAccessible*)atk_obj;
|
||||
if (view->model)
|
||||
if (view->priv->model)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (view->model),
|
||||
(gpointer *)&view->model);
|
||||
gtk_icon_view_accessible_disconnect_model_signals (view->model, widget);
|
||||
g_object_remove_weak_pointer (G_OBJECT (view->priv->model),
|
||||
(gpointer *)&view->priv->model);
|
||||
gtk_icon_view_accessible_disconnect_model_signals (view->priv->model, widget);
|
||||
}
|
||||
gtk_icon_view_accessible_clear_cache (view);
|
||||
|
||||
icon_view = GTK_ICON_VIEW (obj);
|
||||
view->model = icon_view->priv->model;
|
||||
view->priv->model = icon_view->priv->model;
|
||||
/* If there is no model the GtkIconView is probably being destroyed */
|
||||
if (view->model)
|
||||
if (view->priv->model)
|
||||
{
|
||||
g_object_add_weak_pointer (G_OBJECT (view->model), (gpointer *)&view->model);
|
||||
g_object_add_weak_pointer (G_OBJECT (view->priv->model), (gpointer *)&view->priv->model);
|
||||
gtk_icon_view_accessible_connect_model_signals (icon_view);
|
||||
}
|
||||
}
|
||||
@@ -1292,10 +1300,10 @@ gtk_icon_view_accessible_initialize (AtkObject *accessible,
|
||||
g_signal_connect (data, "notify",
|
||||
G_CALLBACK (gtk_icon_view_accessible_notify_gtk), NULL);
|
||||
|
||||
view->model = icon_view->priv->model;
|
||||
if (view->model)
|
||||
view->priv->model = icon_view->priv->model;
|
||||
if (view->priv->model)
|
||||
{
|
||||
g_object_add_weak_pointer (G_OBJECT (view->model), (gpointer *)&view->model);
|
||||
g_object_add_weak_pointer (G_OBJECT (view->priv->model), (gpointer *)&view->priv->model);
|
||||
gtk_icon_view_accessible_connect_model_signals (icon_view);
|
||||
}
|
||||
|
||||
@@ -1326,11 +1334,16 @@ _gtk_icon_view_accessible_class_init (GtkIconViewAccessibleClass *klass)
|
||||
atk_class->get_n_children = gtk_icon_view_accessible_get_n_children;
|
||||
atk_class->ref_child = gtk_icon_view_accessible_ref_child;
|
||||
atk_class->initialize = gtk_icon_view_accessible_initialize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkIconViewAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_icon_view_accessible_init (GtkIconViewAccessible *accessible)
|
||||
{
|
||||
accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
|
||||
GTK_TYPE_ICON_VIEW_ACCESSIBLE,
|
||||
GtkIconViewAccessiblePrivate);
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
|
||||
@@ -30,15 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_ICON_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW_ACCESSIBLE))
|
||||
#define GTK_ICON_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE, GtkIconViewAccessibleClass))
|
||||
|
||||
typedef struct _GtkIconViewAccessible GtkIconViewAccessible;
|
||||
typedef struct _GtkIconViewAccessibleClass GtkIconViewAccessibleClass;
|
||||
typedef struct _GtkIconViewAccessible GtkIconViewAccessible;
|
||||
typedef struct _GtkIconViewAccessibleClass GtkIconViewAccessibleClass;
|
||||
typedef struct _GtkIconViewAccessiblePrivate GtkIconViewAccessiblePrivate;
|
||||
|
||||
struct _GtkIconViewAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GList *items;
|
||||
GtkTreeModel *model;
|
||||
GtkIconViewAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkIconViewAccessibleClass
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkimageaccessible.h"
|
||||
|
||||
struct _GtkImageAccessiblePrivate
|
||||
{
|
||||
gchar *image_description;
|
||||
gchar *stock_name;
|
||||
};
|
||||
|
||||
static void atk_image_interface_init (AtkImageIface *iface);
|
||||
|
||||
@@ -41,8 +46,8 @@ gtk_image_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkImageAccessible *aimage = GTK_IMAGE_ACCESSIBLE (object);
|
||||
|
||||
g_free (aimage->image_description);
|
||||
g_free (aimage->stock_name);
|
||||
g_free (aimage->priv->image_description);
|
||||
g_free (aimage->priv->stock_name);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_image_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -68,8 +73,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
|
||||
image = GTK_IMAGE (widget);
|
||||
image_accessible = GTK_IMAGE_ACCESSIBLE (accessible);
|
||||
|
||||
g_free (image_accessible->stock_name);
|
||||
image_accessible->stock_name = NULL;
|
||||
g_free (image_accessible->priv->stock_name);
|
||||
image_accessible->priv->stock_name = NULL;
|
||||
|
||||
if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK)
|
||||
return NULL;
|
||||
@@ -81,8 +86,8 @@ gtk_image_accessible_get_name (AtkObject *accessible)
|
||||
if (!gtk_stock_lookup (stock_id, &stock_item))
|
||||
return NULL;
|
||||
|
||||
image_accessible->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
|
||||
return image_accessible->stock_name;
|
||||
image_accessible->priv->stock_name = _gtk_toolbar_elide_underscores (stock_item.label);
|
||||
return image_accessible->priv->stock_name;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -94,11 +99,16 @@ _gtk_image_accessible_class_init (GtkImageAccessibleClass *klass)
|
||||
gobject_class->finalize = gtk_image_accessible_finalize;
|
||||
class->initialize = gtk_image_accessible_initialize;
|
||||
class->get_name = gtk_image_accessible_get_name;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkImageAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_image_accessible_init (GtkImageAccessible *image)
|
||||
{
|
||||
image->priv = G_TYPE_INSTANCE_GET_PRIVATE (image,
|
||||
GTK_TYPE_IMAGE_ACCESSIBLE,
|
||||
GtkImageAccessiblePrivate);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
@@ -106,7 +116,7 @@ gtk_image_accessible_get_image_description (AtkImage *image)
|
||||
{
|
||||
GtkImageAccessible *accessible = GTK_IMAGE_ACCESSIBLE (image);
|
||||
|
||||
return accessible->image_description;
|
||||
return accessible->priv->image_description;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -187,8 +197,8 @@ gtk_image_accessible_set_image_description (AtkImage *image,
|
||||
{
|
||||
GtkImageAccessible* accessible = GTK_IMAGE_ACCESSIBLE (image);
|
||||
|
||||
g_free (accessible->image_description);
|
||||
accessible->image_description = g_strdup (description);
|
||||
g_free (accessible->priv->image_description);
|
||||
accessible->priv->image_description = g_strdup (description);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_IMAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE_ACCESSIBLE))
|
||||
#define GTK_IMAGE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE_ACCESSIBLE, GtkImageAccessibleClass))
|
||||
|
||||
typedef struct _GtkImageAccessible GtkImageAccessible;
|
||||
typedef struct _GtkImageAccessibleClass GtkImageAccessibleClass;
|
||||
typedef struct _GtkImageAccessible GtkImageAccessible;
|
||||
typedef struct _GtkImageAccessibleClass GtkImageAccessibleClass;
|
||||
typedef struct _GtkImageAccessiblePrivate GtkImageAccessiblePrivate;
|
||||
|
||||
struct _GtkImageAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
gchar* image_description;
|
||||
gchar* stock_name;
|
||||
GtkImageAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkImageAccessibleClass
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkimagecellaccessible.h"
|
||||
|
||||
struct _GtkImageCellAccessiblePrivate
|
||||
{
|
||||
gchar *image_description;
|
||||
};
|
||||
|
||||
static void atk_image_interface_init (AtkImageIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkImageCellAccessible, _gtk_image_cell_accessible, GTK_TYPE_RENDERER_CELL_ACCESSIBLE,
|
||||
@@ -30,7 +35,7 @@ gtk_image_cell_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (object);
|
||||
|
||||
g_free (image_cell->image_description);
|
||||
g_free (image_cell->priv->image_description);
|
||||
G_OBJECT_CLASS (_gtk_image_cell_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -40,12 +45,16 @@ _gtk_image_cell_accessible_class_init (GtkImageCellAccessibleClass *klass)
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = gtk_image_cell_accessible_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkImageCellAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_image_cell_accessible_init (GtkImageCellAccessible *image_cell)
|
||||
{
|
||||
image_cell->image_description = NULL;
|
||||
image_cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (image_cell,
|
||||
GTK_TYPE_IMAGE_CELL_ACCESSIBLE,
|
||||
GtkImageCellAccessiblePrivate);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
@@ -53,7 +62,7 @@ gtk_image_cell_accessible_get_image_description (AtkImage *image)
|
||||
{
|
||||
GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
|
||||
|
||||
return image_cell->image_description;
|
||||
return image_cell->priv->image_description;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -62,10 +71,10 @@ gtk_image_cell_accessible_set_image_description (AtkImage *image,
|
||||
{
|
||||
GtkImageCellAccessible *image_cell = GTK_IMAGE_CELL_ACCESSIBLE (image);
|
||||
|
||||
g_free (image_cell->image_description);
|
||||
image_cell->image_description = g_strdup (description);
|
||||
g_free (image_cell->priv->image_description);
|
||||
image_cell->priv->image_description = g_strdup (description);
|
||||
|
||||
if (image_cell->image_description)
|
||||
if (image_cell->priv->image_description)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -92,10 +101,11 @@ gtk_image_cell_accessible_get_image_size (AtkImage *image,
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
|
||||
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
|
||||
g_object_get (cell, "renderer", &cell_renderer, NULL);
|
||||
g_object_get (cell_renderer,
|
||||
"pixbuf", &pixbuf,
|
||||
NULL);
|
||||
g_object_unref (cell_renderer);
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
|
||||
@@ -30,15 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_IMAGE_CELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE_CELL_ACCESSIBLE))
|
||||
#define GTK_IMAGE_CELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE_CELL_ACCESSIBLE, GtkImageCellAccessibleClass))
|
||||
|
||||
typedef struct _GtkImageCellAccessible GtkImageCellAccessible;
|
||||
typedef struct _GtkImageCellAccessibleClass GtkImageCellAccessibleClass;
|
||||
typedef struct _GtkImageCellAccessible GtkImageCellAccessible;
|
||||
typedef struct _GtkImageCellAccessibleClass GtkImageCellAccessibleClass;
|
||||
typedef struct _GtkImageCellAccessiblePrivate GtkImageCellAccessiblePrivate;
|
||||
|
||||
struct _GtkImageCellAccessible
|
||||
{
|
||||
GtkRendererCellAccessible parent;
|
||||
|
||||
gchar *image_description;
|
||||
gint x, y;
|
||||
GtkImageCellAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkImageCellAccessibleClass
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
#include <gtk/gtkpango.h>
|
||||
#include "gtklabelaccessible.h"
|
||||
|
||||
struct _GtkLabelAccessiblePrivate
|
||||
{
|
||||
gchar *text;
|
||||
gint cursor_position;
|
||||
gint selection_bound;
|
||||
};
|
||||
|
||||
static void atk_text_interface_init (AtkTextIface *iface);
|
||||
|
||||
@@ -30,6 +36,9 @@ G_DEFINE_TYPE_WITH_CODE (GtkLabelAccessible, _gtk_label_accessible, GTK_TYPE_WID
|
||||
static void
|
||||
_gtk_label_accessible_init (GtkLabelAccessible *label)
|
||||
{
|
||||
label->priv = G_TYPE_INSTANCE_GET_PRIVATE (label,
|
||||
GTK_TYPE_LABEL_ACCESSIBLE,
|
||||
GtkLabelAccessiblePrivate);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -45,7 +54,7 @@ gtk_label_accessible_initialize (AtkObject *obj,
|
||||
|
||||
widget = GTK_WIDGET (data);
|
||||
|
||||
accessible->text = g_strdup (gtk_label_get_text (GTK_LABEL (widget)));
|
||||
accessible->priv->text = g_strdup (gtk_label_get_text (GTK_LABEL (widget)));
|
||||
|
||||
/*
|
||||
* Check whether ancestor of GtkLabel is a GtkButton and if so
|
||||
@@ -73,17 +82,17 @@ check_for_selection_change (GtkLabelAccessible *accessible,
|
||||
|
||||
if (gtk_label_get_selection_bounds (label, &start, &end))
|
||||
{
|
||||
if (end != accessible->cursor_position ||
|
||||
start != accessible->selection_bound)
|
||||
if (end != accessible->priv->cursor_position ||
|
||||
start != accessible->priv->selection_bound)
|
||||
ret_val = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_val = (accessible->cursor_position != accessible->selection_bound);
|
||||
ret_val = (accessible->priv->cursor_position != accessible->priv->selection_bound);
|
||||
}
|
||||
|
||||
accessible->cursor_position = end;
|
||||
accessible->selection_bound = start;
|
||||
accessible->priv->cursor_position = end;
|
||||
accessible->priv->selection_bound = start;
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
@@ -105,18 +114,18 @@ gtk_label_accessible_notify_gtk (GObject *obj,
|
||||
const gchar *text;
|
||||
|
||||
text = gtk_label_get_text (GTK_LABEL (widget));
|
||||
if (g_strcmp0 (accessible->text, text) == 0)
|
||||
if (g_strcmp0 (accessible->priv->text, text) == 0)
|
||||
return;
|
||||
|
||||
/* Create a delete text and an insert text signal */
|
||||
length = g_utf8_strlen (accessible->text, -1);
|
||||
length = g_utf8_strlen (accessible->priv->text, -1);
|
||||
if (length > 0)
|
||||
g_signal_emit_by_name (atk_obj, "text-changed::delete", 0, length);
|
||||
|
||||
g_free (accessible->text);
|
||||
accessible->text = g_strdup (text);
|
||||
g_free (accessible->priv->text);
|
||||
accessible->priv->text = g_strdup (text);
|
||||
|
||||
length = g_utf8_strlen (accessible->text, -1);
|
||||
length = g_utf8_strlen (accessible->priv->text, -1);
|
||||
if (length > 0)
|
||||
g_signal_emit_by_name (atk_obj, "text-changed::insert", 0, length);
|
||||
|
||||
@@ -147,7 +156,7 @@ gtk_label_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkLabelAccessible *accessible = GTK_LABEL_ACCESSIBLE (object);
|
||||
|
||||
g_free (accessible->text);
|
||||
g_free (accessible->priv->text);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_label_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -277,6 +286,8 @@ _gtk_label_accessible_class_init (GtkLabelAccessibleClass *klass)
|
||||
class->ref_state_set = gtk_label_accessible_ref_state_set;
|
||||
class->ref_relation_set = gtk_label_accessible_ref_relation_set;
|
||||
class->initialize = gtk_label_accessible_initialize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkLabelAccessiblePrivate));
|
||||
}
|
||||
|
||||
/* atktext.h */
|
||||
|
||||
@@ -29,16 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_LABEL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LABEL_ACCESSIBLE))
|
||||
#define GTK_LABEL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LABEL_ACCESSIBLE, GtkLabelAccessibleClass))
|
||||
|
||||
typedef struct _GtkLabelAccessible GtkLabelAccessible;
|
||||
typedef struct _GtkLabelAccessibleClass GtkLabelAccessibleClass;
|
||||
typedef struct _GtkLabelAccessible GtkLabelAccessible;
|
||||
typedef struct _GtkLabelAccessibleClass GtkLabelAccessibleClass;
|
||||
typedef struct _GtkLabelAccessiblePrivate GtkLabelAccessiblePrivate;
|
||||
|
||||
struct _GtkLabelAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
gchar *text;
|
||||
gint cursor_position;
|
||||
gint selection_bound;
|
||||
GtkLabelAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkLabelAccessibleClass
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
typedef struct _GtkLinkButtonAccessibleLink GtkLinkButtonAccessibleLink;
|
||||
typedef struct _GtkLinkButtonAccessibleLinkClass GtkLinkButtonAccessibleLinkClass;
|
||||
|
||||
struct _GtkLinkButtonAccessiblePrivate
|
||||
{
|
||||
AtkHyperlink *link;
|
||||
};
|
||||
|
||||
struct _GtkLinkButtonAccessibleLink
|
||||
{
|
||||
AtkHyperlink parent;
|
||||
@@ -37,6 +42,8 @@ struct _GtkLinkButtonAccessibleLinkClass
|
||||
|
||||
static void atk_action_interface_init (AtkActionIface *iface);
|
||||
|
||||
GType _gtk_link_button_accessible_link_get_type (void);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessibleLink, _gtk_link_button_accessible_link, ATK_TYPE_HYPERLINK,
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
|
||||
|
||||
@@ -178,14 +185,14 @@ gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
|
||||
{
|
||||
GtkLinkButtonAccessible *button = GTK_LINK_BUTTON_ACCESSIBLE (impl);
|
||||
|
||||
if (!button->link)
|
||||
if (!button->priv->link)
|
||||
{
|
||||
button->link = gtk_link_button_accessible_link_new (button);
|
||||
button->priv->link = gtk_link_button_accessible_link_new (button);
|
||||
g_signal_connect (gtk_accessible_get_widget (GTK_ACCESSIBLE (button)),
|
||||
"activate-link", G_CALLBACK (activate_link), button->link);
|
||||
"activate-link", G_CALLBACK (activate_link), button->priv->link);
|
||||
}
|
||||
|
||||
return g_object_ref (button->link);
|
||||
return g_object_ref (button->priv->link);
|
||||
}
|
||||
|
||||
static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface);
|
||||
@@ -196,6 +203,9 @@ G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, _gtk_link_button_accessible, G
|
||||
static void
|
||||
_gtk_link_button_accessible_init (GtkLinkButtonAccessible *button)
|
||||
{
|
||||
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
|
||||
GTK_TYPE_LINK_BUTTON_ACCESSIBLE,
|
||||
GtkLinkButtonAccessiblePrivate);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -203,8 +213,8 @@ gtk_link_button_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkLinkButtonAccessible *button = GTK_LINK_BUTTON_ACCESSIBLE (object);
|
||||
|
||||
if (button->link)
|
||||
g_object_unref (button->link);
|
||||
if (button->priv->link)
|
||||
g_object_unref (button->priv->link);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_link_button_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -213,6 +223,8 @@ static void
|
||||
_gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
|
||||
{
|
||||
G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkLinkButtonAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -29,14 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_LINK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LINK_BUTTON_ACCESSIBLE))
|
||||
#define GTK_LINK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LINK_BUTTON_ACCESSIBLE, GtkLinkButtonAccessibleClass))
|
||||
|
||||
typedef struct _GtkLinkButtonAccessible GtkLinkButtonAccessible;
|
||||
typedef struct _GtkLinkButtonAccessibleClass GtkLinkButtonAccessibleClass;
|
||||
typedef struct _GtkLinkButtonAccessible GtkLinkButtonAccessible;
|
||||
typedef struct _GtkLinkButtonAccessibleClass GtkLinkButtonAccessibleClass;
|
||||
typedef struct _GtkLinkButtonAccessiblePrivate GtkLinkButtonAccessiblePrivate;
|
||||
|
||||
struct _GtkLinkButtonAccessible
|
||||
{
|
||||
GtkButtonAccessible parent;
|
||||
|
||||
AtkHyperlink *link;
|
||||
GtkLinkButtonAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkLinkButtonAccessibleClass
|
||||
|
||||
@@ -30,12 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_LOCK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE))
|
||||
#define GTK_LOCK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LOCK_BUTTON_ACCESSIBLE, GtkLockButtonAccessibleClass))
|
||||
|
||||
typedef struct _GtkLockButtonAccessible GtkLockButtonAccessible;
|
||||
typedef struct _GtkLockButtonAccessibleClass GtkLockButtonAccessibleClass;
|
||||
typedef struct _GtkLockButtonAccessible GtkLockButtonAccessible;
|
||||
typedef struct _GtkLockButtonAccessibleClass GtkLockButtonAccessibleClass;
|
||||
typedef struct _GtkLockButtonAccessiblePrivate GtkLockButtonAccessiblePrivate;
|
||||
|
||||
struct _GtkLockButtonAccessible
|
||||
{
|
||||
GtkButtonAccessible parent;
|
||||
|
||||
GtkLockButtonAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkLockButtonAccessibleClass
|
||||
|
||||
@@ -31,7 +31,7 @@ gtk_menu_accessible_initialize (AtkObject *obj,
|
||||
|
||||
obj->role = ATK_ROLE_MENU;
|
||||
|
||||
GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_POPUP;
|
||||
_gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
|
||||
@@ -30,12 +30,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_MENU_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ACCESSIBLE))
|
||||
#define GTK_MENU_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ACCESSIBLE, GtkMenuAccessibleClass))
|
||||
|
||||
typedef struct _GtkMenuAccessible GtkMenuAccessible;
|
||||
typedef struct _GtkMenuAccessibleClass GtkMenuAccessibleClass;
|
||||
typedef struct _GtkMenuAccessible GtkMenuAccessible;
|
||||
typedef struct _GtkMenuAccessibleClass GtkMenuAccessibleClass;
|
||||
typedef struct _GtkMenuAccessiblePrivate GtkMenuAccessiblePrivate;
|
||||
|
||||
struct _GtkMenuAccessible
|
||||
{
|
||||
GtkMenuShellAccessible parent;
|
||||
|
||||
GtkMenuAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkMenuAccessibleClass
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
#include "gtkmenuitemaccessible.h"
|
||||
#include "gtk/gtkmenuitemprivate.h"
|
||||
|
||||
struct _GtkMenuItemAccessiblePrivate
|
||||
{
|
||||
gchar *text;
|
||||
};
|
||||
|
||||
#define KEYBINDING_SEPARATOR ";"
|
||||
|
||||
static void menu_item_select (GtkMenuItem *item);
|
||||
@@ -67,7 +72,7 @@ gtk_menu_item_accessible_initialize (AtkObject *obj,
|
||||
atk_object_set_parent (obj, gtk_widget_get_accessible (parent_widget));
|
||||
}
|
||||
|
||||
GTK_WIDGET_ACCESSIBLE (obj)->layer = ATK_LAYER_POPUP;
|
||||
_gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
|
||||
|
||||
obj->role = ATK_ROLE_MENU_ITEM;
|
||||
|
||||
@@ -193,10 +198,10 @@ gtk_menu_item_accessible_get_name (AtkObject *obj)
|
||||
accessible = GTK_MENU_ITEM_ACCESSIBLE (obj);
|
||||
label = get_label_from_container (widget);
|
||||
|
||||
g_free (accessible->text);
|
||||
accessible->text = get_text_from_label_widget (label);
|
||||
g_free (accessible->priv->text);
|
||||
accessible->priv->text = get_text_from_label_widget (label);
|
||||
|
||||
return accessible->text;
|
||||
return accessible->priv->text;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -204,7 +209,7 @@ gtk_menu_item_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkMenuItemAccessible *accessible = GTK_MENU_ITEM_ACCESSIBLE (object);
|
||||
|
||||
g_free (accessible->text);
|
||||
g_free (accessible->priv->text);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_menu_item_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -244,11 +249,16 @@ _gtk_menu_item_accessible_class_init (GtkMenuItemAccessibleClass *klass)
|
||||
class->initialize = gtk_menu_item_accessible_initialize;
|
||||
class->get_name = gtk_menu_item_accessible_get_name;
|
||||
class->get_role = gtk_menu_item_accessible_get_role;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkMenuItemAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_menu_item_accessible_init (GtkMenuItemAccessible *menu_item)
|
||||
{
|
||||
menu_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (menu_item,
|
||||
GTK_TYPE_MENU_ITEM_ACCESSIBLE,
|
||||
GtkMenuItemAccessiblePrivate);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -811,26 +821,14 @@ menu_item_add_gtk (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *parent_widget;
|
||||
AtkObject *atk_parent;
|
||||
AtkObject *atk_child;
|
||||
GtkContainerAccessible *container_accessible;
|
||||
gint index;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_MENU (container), 1);
|
||||
|
||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (container));
|
||||
if (GTK_IS_MENU_ITEM (parent_widget))
|
||||
{
|
||||
atk_parent = gtk_widget_get_accessible (parent_widget);
|
||||
atk_child = gtk_widget_get_accessible (widget);
|
||||
GTK_CONTAINER_ACCESSIBLE_CLASS (_gtk_menu_item_accessible_parent_class)->add_gtk (container, widget, gtk_widget_get_accessible (parent_widget));
|
||||
|
||||
g_object_notify (G_OBJECT (atk_child), "accessible-parent");
|
||||
container_accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
|
||||
g_list_free (container_accessible->children);
|
||||
container_accessible->children = gtk_container_get_children (container);
|
||||
index = g_list_index (container_accessible->children, widget);
|
||||
g_signal_emit_by_name (atk_parent, "children-changed::add",
|
||||
index, atk_child, NULL);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -840,30 +838,13 @@ menu_item_remove_gtk (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *parent_widget;
|
||||
AtkObject *atk_parent;
|
||||
AtkObject *atk_child;
|
||||
GtkContainerAccessible *container_accessible;
|
||||
gint index;
|
||||
gint list_length;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_MENU (container), 1);
|
||||
|
||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (container));
|
||||
if (GTK_IS_MENU_ITEM (parent_widget))
|
||||
{
|
||||
atk_parent = gtk_widget_get_accessible (parent_widget);
|
||||
atk_child = gtk_widget_get_accessible (widget);
|
||||
|
||||
g_object_notify (G_OBJECT (atk_child), "accessible-parent");
|
||||
|
||||
container_accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
|
||||
index = g_list_index (container_accessible->children, widget);
|
||||
list_length = g_list_length (container_accessible->children);
|
||||
g_list_free (container_accessible->children);
|
||||
container_accessible->children = gtk_container_get_children (container);
|
||||
if (index >= 0 && index <= list_length)
|
||||
g_signal_emit_by_name (atk_parent, "children-changed::remove",
|
||||
index, atk_child, NULL);
|
||||
GTK_CONTAINER_ACCESSIBLE_CLASS (_gtk_menu_item_accessible_parent_class)->remove_gtk (container, widget, gtk_widget_get_accessible (parent_widget));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -29,14 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM_ACCESSIBLE))
|
||||
#define GTK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM_ACCESSIBLE, GtkMenuItemAccessibleClass))
|
||||
|
||||
typedef struct _GtkMenuItemAccessible GtkMenuItemAccessible;
|
||||
typedef struct _GtkMenuItemAccessibleClass GtkMenuItemAccessibleClass;
|
||||
typedef struct _GtkMenuItemAccessible GtkMenuItemAccessible;
|
||||
typedef struct _GtkMenuItemAccessibleClass GtkMenuItemAccessibleClass;
|
||||
typedef struct _GtkMenuItemAccessiblePrivate GtkMenuItemAccessiblePrivate;
|
||||
|
||||
struct _GtkMenuItemAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
gchar *text;
|
||||
GtkMenuItemAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkMenuItemAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_MENU_SHELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL_ACCESSIBLE))
|
||||
#define GTK_MENU_SHELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessibleClass))
|
||||
|
||||
typedef struct _GtkMenuShellAccessible GtkMenuShellAccessible;
|
||||
typedef struct _GtkMenuShellAccessibleClass GtkMenuShellAccessibleClass;
|
||||
typedef struct _GtkMenuShellAccessible GtkMenuShellAccessible;
|
||||
typedef struct _GtkMenuShellAccessibleClass GtkMenuShellAccessibleClass;
|
||||
typedef struct _GtkMenuShellAccessiblePrivate GtkMenuShellAccessiblePrivate;
|
||||
|
||||
struct _GtkMenuShellAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkMenuShellAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkMenuShellAccessibleClass
|
||||
|
||||
@@ -22,6 +22,19 @@
|
||||
#include "gtknotebookaccessible.h"
|
||||
#include "gtknotebookpageaccessible.h"
|
||||
|
||||
struct _GtkNotebookAccessiblePrivate
|
||||
{
|
||||
/*
|
||||
* page_cache maintains a list of pre-ref'd Notebook Pages.
|
||||
* This cache is queried by gtk_notebook_accessible_ref_child().
|
||||
* If the page is found in the list then a new page does not
|
||||
* need to be created
|
||||
*/
|
||||
GHashTable * pages;
|
||||
gint selected_page;
|
||||
gint focus_tab_page;
|
||||
guint idle_focus_id;
|
||||
};
|
||||
|
||||
static void atk_selection_interface_init (AtkSelectionIface *iface);
|
||||
|
||||
@@ -44,14 +57,14 @@ check_focus_tab (gpointer data)
|
||||
return FALSE;
|
||||
notebook = GTK_NOTEBOOK (widget);
|
||||
|
||||
accessible->idle_focus_id = 0;
|
||||
accessible->priv->idle_focus_id = 0;
|
||||
|
||||
focus_page_num = gtk_notebook_get_current_page (notebook);
|
||||
if (focus_page_num == -1)
|
||||
return FALSE;
|
||||
|
||||
old_focus_page_num = accessible->focus_tab_page;
|
||||
accessible->focus_tab_page = focus_page_num;
|
||||
old_focus_page_num = accessible->priv->focus_tab_page;
|
||||
accessible->priv->focus_tab_page = focus_page_num;
|
||||
if (old_focus_page_num != focus_page_num)
|
||||
{
|
||||
AtkObject *obj;
|
||||
@@ -75,8 +88,8 @@ focus_cb (GtkWidget *widget,
|
||||
{
|
||||
case GTK_DIR_LEFT:
|
||||
case GTK_DIR_RIGHT:
|
||||
if (accessible->idle_focus_id == 0)
|
||||
accessible->idle_focus_id = gdk_threads_add_idle (check_focus_tab, atk_obj);
|
||||
if (accessible->priv->idle_focus_id == 0)
|
||||
accessible->priv->idle_focus_id = gdk_threads_add_idle (check_focus_tab, atk_obj);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -93,7 +106,7 @@ create_notebook_page_accessible (GtkNotebookAccessible *accessible,
|
||||
AtkObject *obj;
|
||||
|
||||
obj = _gtk_notebook_page_accessible_new (accessible, child);
|
||||
g_hash_table_insert (accessible->pages, child, obj);
|
||||
g_hash_table_insert (accessible->priv->pages, child, obj);
|
||||
atk_object_set_parent (obj, ATK_OBJECT (accessible));
|
||||
g_signal_emit_by_name (accessible, "children-changed::add", page_num, obj, NULL);
|
||||
}
|
||||
@@ -123,12 +136,12 @@ page_removed_cb (GtkNotebook *notebook,
|
||||
|
||||
accessible = GTK_NOTEBOOK_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (notebook)));
|
||||
|
||||
obj = g_hash_table_lookup (accessible->pages, widget);
|
||||
obj = g_hash_table_lookup (accessible->priv->pages, widget);
|
||||
g_return_if_fail (obj);
|
||||
g_signal_emit_by_name (accessible, "children-changed::remove",
|
||||
page_num, obj, NULL);
|
||||
_gtk_notebook_page_accessible_invalidate (GTK_NOTEBOOK_PAGE_ACCESSIBLE (obj));
|
||||
g_hash_table_remove (accessible->pages, widget);
|
||||
g_hash_table_remove (accessible->priv->pages, widget);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +164,7 @@ gtk_notebook_accessible_initialize (AtkObject *obj,
|
||||
gtk_notebook_get_nth_page (notebook, i),
|
||||
i);
|
||||
}
|
||||
accessible->selected_page = gtk_notebook_get_current_page (notebook);
|
||||
accessible->priv->selected_page = gtk_notebook_get_current_page (notebook);
|
||||
|
||||
g_signal_connect (notebook, "focus",
|
||||
G_CALLBACK (focus_cb), NULL);
|
||||
@@ -168,10 +181,10 @@ gtk_notebook_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkNotebookAccessible *accessible = GTK_NOTEBOOK_ACCESSIBLE (object);
|
||||
|
||||
g_hash_table_destroy (accessible->pages);
|
||||
g_hash_table_destroy (accessible->priv->pages);
|
||||
|
||||
if (accessible->idle_focus_id)
|
||||
g_source_remove (accessible->idle_focus_id);
|
||||
if (accessible->priv->idle_focus_id)
|
||||
g_source_remove (accessible->priv->idle_focus_id);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_notebook_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -192,7 +205,7 @@ gtk_notebook_accessible_ref_child (AtkObject *obj,
|
||||
accessible = GTK_NOTEBOOK_ACCESSIBLE (obj);
|
||||
notebook = GTK_NOTEBOOK (widget);
|
||||
|
||||
child = g_hash_table_lookup (accessible->pages,
|
||||
child = g_hash_table_lookup (accessible->priv->pages,
|
||||
gtk_notebook_get_nth_page (notebook, i));
|
||||
/* can return NULL when i >= n_children */
|
||||
|
||||
@@ -224,11 +237,11 @@ gtk_notebook_accessible_notify_gtk (GObject *obj,
|
||||
notebook = GTK_NOTEBOOK (widget);
|
||||
|
||||
/* Notify SELECTED state change for old and new page */
|
||||
old_page_num = accessible->selected_page;
|
||||
old_page_num = accessible->priv->selected_page;
|
||||
page_num = gtk_notebook_get_current_page (notebook);
|
||||
accessible->selected_page = page_num;
|
||||
accessible->focus_tab_page = page_num;
|
||||
old_focus_page_num = accessible->focus_tab_page;
|
||||
accessible->priv->selected_page = page_num;
|
||||
accessible->priv->focus_tab_page = page_num;
|
||||
old_focus_page_num = accessible->priv->focus_tab_page;
|
||||
|
||||
if (page_num != old_page_num)
|
||||
{
|
||||
@@ -249,10 +262,10 @@ gtk_notebook_accessible_notify_gtk (GObject *obj,
|
||||
atk_object_notify_state_change (child, ATK_STATE_SELECTED, TRUE);
|
||||
g_object_unref (child);
|
||||
/*
|
||||
* The page which is being displayed has changed but there is
|
||||
* no need to tell the focus tracker as the focus page will also
|
||||
* change or a widget in the page will receive focus if the
|
||||
* Notebook does not have tabs.
|
||||
* The page which is being displayed has changed but there
|
||||
* is no need to tell the focus tracker as the focus page
|
||||
* will also change or a widget in the page will receive
|
||||
* focus if the notebook does not have tabs.
|
||||
*/
|
||||
}
|
||||
g_signal_emit_by_name (atk_obj, "selection-changed");
|
||||
@@ -261,9 +274,9 @@ gtk_notebook_accessible_notify_gtk (GObject *obj,
|
||||
if (gtk_notebook_get_show_tabs (notebook) &&
|
||||
(focus_page_num != old_focus_page_num))
|
||||
{
|
||||
if (accessible->idle_focus_id)
|
||||
g_source_remove (accessible->idle_focus_id);
|
||||
accessible->idle_focus_id = gdk_threads_add_idle (check_focus_tab, atk_obj);
|
||||
if (accessible->priv->idle_focus_id)
|
||||
g_source_remove (accessible->priv->idle_focus_id);
|
||||
accessible->priv->idle_focus_id = gdk_threads_add_idle (check_focus_tab, atk_obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -299,7 +312,6 @@ _gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
|
||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
||||
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
|
||||
|
||||
|
||||
gobject_class->finalize = gtk_notebook_accessible_finalize;
|
||||
|
||||
class->ref_child = gtk_notebook_accessible_ref_child;
|
||||
@@ -310,18 +322,23 @@ _gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
|
||||
/* we listen to page-added/-removed, so we don't care about these */
|
||||
container_class->add_gtk = NULL;
|
||||
container_class->remove_gtk = NULL;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkNotebookAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_notebook_accessible_init (GtkNotebookAccessible *notebook)
|
||||
{
|
||||
notebook->pages = g_hash_table_new_full (g_direct_hash,
|
||||
g_direct_equal,
|
||||
NULL,
|
||||
g_object_unref);
|
||||
notebook->selected_page = -1;
|
||||
notebook->focus_tab_page = -1;
|
||||
notebook->idle_focus_id = 0;
|
||||
notebook->priv = G_TYPE_INSTANCE_GET_PRIVATE (notebook,
|
||||
GTK_TYPE_NOTEBOOK_ACCESSIBLE,
|
||||
GtkNotebookAccessiblePrivate);
|
||||
notebook->priv->pages = g_hash_table_new_full (g_direct_hash,
|
||||
g_direct_equal,
|
||||
NULL,
|
||||
g_object_unref);
|
||||
notebook->priv->selected_page = -1;
|
||||
notebook->priv->focus_tab_page = -1;
|
||||
notebook->priv->idle_focus_id = 0;
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
|
||||
@@ -29,23 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_NOTEBOOK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_ACCESSIBLE))
|
||||
#define GTK_NOTEBOOK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessibleClass))
|
||||
|
||||
typedef struct _GtkNotebookAccessible GtkNotebookAccessible;
|
||||
typedef struct _GtkNotebookAccessibleClass GtkNotebookAccessibleClass;
|
||||
typedef struct _GtkNotebookAccessible GtkNotebookAccessible;
|
||||
typedef struct _GtkNotebookAccessibleClass GtkNotebookAccessibleClass;
|
||||
typedef struct _GtkNotebookAccessiblePrivate GtkNotebookAccessiblePrivate;
|
||||
|
||||
struct _GtkNotebookAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
/*
|
||||
* page_cache maintains a list of pre-ref'd Notebook Pages.
|
||||
* This cache is queried by gtk_notebook_accessible_ref_child().
|
||||
* If the page is found in the list then a new page does not
|
||||
* need to be created
|
||||
*/
|
||||
GHashTable * pages;
|
||||
gint selected_page;
|
||||
gint focus_tab_page;
|
||||
guint idle_focus_id;
|
||||
GtkNotebookAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkNotebookAccessibleClass
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
#include "gtknotebookpageaccessible.h"
|
||||
|
||||
|
||||
struct _GtkNotebookPageAccessiblePrivate
|
||||
{
|
||||
GtkAccessible *notebook;
|
||||
GtkWidget *child;
|
||||
};
|
||||
|
||||
static void atk_component_interface_init (AtkComponentIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkNotebookPageAccessible, _gtk_notebook_page_accessible, ATK_TYPE_OBJECT,
|
||||
@@ -62,14 +68,14 @@ get_label_from_notebook_page (GtkNotebookPageAccessible *page)
|
||||
GtkWidget *child;
|
||||
GtkNotebook *notebook;
|
||||
|
||||
notebook = GTK_NOTEBOOK (gtk_accessible_get_widget (page->notebook));
|
||||
notebook = GTK_NOTEBOOK (gtk_accessible_get_widget (page->priv->notebook));
|
||||
if (!notebook)
|
||||
return NULL;
|
||||
|
||||
if (!gtk_notebook_get_show_tabs (notebook))
|
||||
return NULL;
|
||||
|
||||
child = gtk_notebook_get_tab_label (notebook, page->child);
|
||||
child = gtk_notebook_get_tab_label (notebook, page->priv->child);
|
||||
|
||||
if (GTK_IS_LABEL (child))
|
||||
return child;
|
||||
@@ -102,7 +108,7 @@ gtk_notebook_page_accessible_get_parent (AtkObject *accessible)
|
||||
|
||||
page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
|
||||
|
||||
return ATK_OBJECT (page->notebook);
|
||||
return ATK_OBJECT (page->priv->notebook);
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -122,10 +128,10 @@ gtk_notebook_page_accessible_ref_child (AtkObject *accessible,
|
||||
return NULL;
|
||||
|
||||
page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
|
||||
if (!page->child)
|
||||
if (!page->priv->child)
|
||||
return NULL;
|
||||
|
||||
child_obj = gtk_widget_get_accessible (page->child);
|
||||
child_obj = gtk_widget_get_accessible (page->priv->child);
|
||||
g_object_ref (child_obj);
|
||||
|
||||
return child_obj;
|
||||
@@ -180,11 +186,11 @@ gtk_notebook_page_accessible_get_index_in_parent (AtkObject *accessible)
|
||||
GtkNotebookPageAccessible *page;
|
||||
|
||||
page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible);
|
||||
if (!page->child)
|
||||
if (!page->priv->child)
|
||||
return -1;
|
||||
|
||||
return gtk_notebook_page_num (GTK_NOTEBOOK (gtk_accessible_get_widget (page->notebook)),
|
||||
page->child);
|
||||
return gtk_notebook_page_num (GTK_NOTEBOOK (gtk_accessible_get_widget (page->priv->notebook)),
|
||||
page->priv->child);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -198,11 +204,16 @@ _gtk_notebook_page_accessible_class_init (GtkNotebookPageAccessibleClass *klass)
|
||||
class->ref_child = gtk_notebook_page_accessible_ref_child;
|
||||
class->ref_state_set = gtk_notebook_page_accessible_ref_state_set;
|
||||
class->get_index_in_parent = gtk_notebook_page_accessible_get_index_in_parent;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkNotebookPageAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_notebook_page_accessible_init (GtkNotebookPageAccessible *page)
|
||||
{
|
||||
page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page,
|
||||
GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE,
|
||||
GtkNotebookPageAccessiblePrivate);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -229,8 +240,8 @@ _gtk_notebook_page_accessible_new (GtkNotebookAccessible *notebook,
|
||||
object = g_object_new (GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, NULL);
|
||||
|
||||
page = GTK_NOTEBOOK_PAGE_ACCESSIBLE (object);
|
||||
page->notebook = GTK_ACCESSIBLE (notebook);
|
||||
page->child = child;
|
||||
page->priv->notebook = GTK_ACCESSIBLE (notebook);
|
||||
page->priv->child = child;
|
||||
|
||||
atk_object = ATK_OBJECT (page);
|
||||
atk_object->role = ATK_ROLE_PAGE_TAB;
|
||||
@@ -238,7 +249,7 @@ _gtk_notebook_page_accessible_new (GtkNotebookAccessible *notebook,
|
||||
|
||||
atk_object_set_parent (gtk_widget_get_accessible (child), atk_object);
|
||||
|
||||
g_signal_connect (gtk_accessible_get_widget (page->notebook),
|
||||
g_signal_connect (gtk_accessible_get_widget (page->priv->notebook),
|
||||
"child-notify::tab-label",
|
||||
G_CALLBACK (notify_tab_label), page);
|
||||
|
||||
@@ -251,15 +262,15 @@ _gtk_notebook_page_accessible_invalidate (GtkNotebookPageAccessible *page)
|
||||
AtkObject *obj = ATK_OBJECT (page);
|
||||
GtkWidget *notebook;
|
||||
|
||||
notebook = gtk_accessible_get_widget (page->notebook);
|
||||
notebook = gtk_accessible_get_widget (page->priv->notebook);
|
||||
if (notebook)
|
||||
g_signal_handlers_disconnect_by_func (notebook, notify_tab_label, page);
|
||||
|
||||
atk_object_notify_state_change (obj, ATK_STATE_DEFUNCT, TRUE);
|
||||
atk_object_set_parent (obj, NULL);
|
||||
page->notebook = NULL;
|
||||
atk_object_set_parent (gtk_widget_get_accessible (page->child), NULL);
|
||||
page->child = NULL;
|
||||
page->priv->notebook = NULL;
|
||||
atk_object_set_parent (gtk_widget_get_accessible (page->priv->child), NULL);
|
||||
page->priv->child = NULL;
|
||||
}
|
||||
|
||||
static AtkObject*
|
||||
|
||||
@@ -29,15 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_NOTEBOOK_PAGE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE))
|
||||
#define GTK_NOTEBOOK_PAGE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_PAGE_ACCESSIBLE, GtkNotebookPageAccessibleClass))
|
||||
|
||||
typedef struct _GtkNotebookPageAccessible GtkNotebookPageAccessible;
|
||||
typedef struct _GtkNotebookPageAccessibleClass GtkNotebookPageAccessibleClass;
|
||||
typedef struct _GtkNotebookPageAccessible GtkNotebookPageAccessible;
|
||||
typedef struct _GtkNotebookPageAccessibleClass GtkNotebookPageAccessibleClass;
|
||||
typedef struct _GtkNotebookPageAccessiblePrivate GtkNotebookPageAccessiblePrivate;
|
||||
|
||||
struct _GtkNotebookPageAccessible
|
||||
{
|
||||
AtkObject parent;
|
||||
|
||||
GtkAccessible *notebook;
|
||||
GtkWidget *child;
|
||||
GtkNotebookPageAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkNotebookPageAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_PANED_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PANED_ACCESSIBLE))
|
||||
#define GTK_PANED_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PANED_ACCESSIBLE, GtkPanedAccessibleClass))
|
||||
|
||||
typedef struct _GtkPanedAccessible GtkPanedAccessible;
|
||||
typedef struct _GtkPanedAccessibleClass GtkPanedAccessibleClass;
|
||||
typedef struct _GtkPanedAccessible GtkPanedAccessible;
|
||||
typedef struct _GtkPanedAccessibleClass GtkPanedAccessibleClass;
|
||||
typedef struct _GtkPanedAccessiblePrivate GtkPanedAccessiblePrivate;
|
||||
|
||||
struct _GtkPanedAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkPanedAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkPanedAccessibleClass
|
||||
|
||||
@@ -29,12 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_PROGRESS_BAR_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE))
|
||||
#define GTK_PROGRESS_BAR_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PROGRESS_BAR_ACCESSIBLE, GtkProgressBarAccessibleClass))
|
||||
|
||||
typedef struct _GtkProgressBarAccessible GtkProgressBarAccessible;
|
||||
typedef struct _GtkProgressBarAccessibleClass GtkProgressBarAccessibleClass;
|
||||
typedef struct _GtkProgressBarAccessible GtkProgressBarAccessible;
|
||||
typedef struct _GtkProgressBarAccessibleClass GtkProgressBarAccessibleClass;
|
||||
typedef struct _GtkProgressBarAccessiblePrivate GtkProgressBarAccessiblePrivate;
|
||||
|
||||
struct _GtkProgressBarAccessible
|
||||
{
|
||||
GtkWidgetAccessible parent;
|
||||
|
||||
GtkProgressBarAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkProgressBarAccessibleClass
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkradiobuttonaccessible.h"
|
||||
|
||||
struct _GtkRadioButtonAccessiblePrivate
|
||||
{
|
||||
GSList *old_group;
|
||||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkRadioButtonAccessible, _gtk_radio_button_accessible, GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE)
|
||||
|
||||
@@ -51,7 +56,7 @@ gtk_radio_button_accessible_ref_relation_set (AtkObject *obj)
|
||||
/* If the radio button'group has changed remove the relation */
|
||||
list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget));
|
||||
|
||||
if (radio_button->old_group != list)
|
||||
if (radio_button->priv->old_group != list)
|
||||
{
|
||||
AtkRelation *relation;
|
||||
|
||||
@@ -64,7 +69,7 @@ gtk_radio_button_accessible_ref_relation_set (AtkObject *obj)
|
||||
/*
|
||||
* Get the members of the button group
|
||||
*/
|
||||
radio_button->old_group = list;
|
||||
radio_button->priv->old_group = list;
|
||||
if (list)
|
||||
{
|
||||
AtkObject **accessible_array;
|
||||
@@ -104,10 +109,14 @@ _gtk_radio_button_accessible_class_init (GtkRadioButtonAccessibleClass *klass)
|
||||
|
||||
class->initialize = gtk_radio_button_accessible_initialize;
|
||||
class->ref_relation_set = gtk_radio_button_accessible_ref_relation_set;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkRadioButtonAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_radio_button_accessible_init (GtkRadioButtonAccessible *radio_button)
|
||||
{
|
||||
radio_button->old_group = NULL;
|
||||
radio_button->priv = G_TYPE_INSTANCE_GET_PRIVATE (radio_button,
|
||||
GTK_TYPE_RADIO_BUTTON_ACCESSIBLE,
|
||||
GtkRadioButtonAccessiblePrivate);
|
||||
}
|
||||
|
||||
@@ -29,14 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_RADIO_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE))
|
||||
#define GTK_RADIO_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RADIO_BUTTON_ACCESSIBLE, GtkRadioButtonAccessibleClass))
|
||||
|
||||
typedef struct _GtkRadioButtonAccessible GtkRadioButtonAccessible;
|
||||
typedef struct _GtkRadioButtonAccessibleClass GtkRadioButtonAccessibleClass;
|
||||
typedef struct _GtkRadioButtonAccessible GtkRadioButtonAccessible;
|
||||
typedef struct _GtkRadioButtonAccessibleClass GtkRadioButtonAccessibleClass;
|
||||
typedef struct _GtkRadioButtonAccessiblePrivate GtkRadioButtonAccessiblePrivate;
|
||||
|
||||
struct _GtkRadioButtonAccessible
|
||||
{
|
||||
GtkToggleButtonAccessible parent;
|
||||
|
||||
GSList *old_group;
|
||||
GtkRadioButtonAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkRadioButtonAccessibleClass
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkradiomenuitemaccessible.h"
|
||||
|
||||
struct _GtkRadioMenuItemAccessiblePrivate
|
||||
{
|
||||
GSList *old_group;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkRadioMenuItemAccessible, _gtk_radio_menu_item_accessible, GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE)
|
||||
|
||||
@@ -43,7 +47,7 @@ gtk_radio_menu_item_accessible_ref_relation_set (AtkObject *obj)
|
||||
/* If the radio menu_item's group has changed remove the relation */
|
||||
list = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
|
||||
|
||||
if (radio_menu_item->old_group != list)
|
||||
if (radio_menu_item->priv->old_group != list)
|
||||
{
|
||||
AtkRelation *relation;
|
||||
|
||||
@@ -54,7 +58,7 @@ gtk_radio_menu_item_accessible_ref_relation_set (AtkObject *obj)
|
||||
if (!atk_relation_set_contains (relation_set, ATK_RELATION_MEMBER_OF))
|
||||
{
|
||||
/* Get the members of the menu_item group */
|
||||
radio_menu_item->old_group = list;
|
||||
radio_menu_item->priv->old_group = list;
|
||||
if (list)
|
||||
{
|
||||
AtkObject **accessible_array;
|
||||
@@ -102,10 +106,14 @@ _gtk_radio_menu_item_accessible_class_init (GtkRadioMenuItemAccessibleClass *kla
|
||||
|
||||
class->ref_relation_set = gtk_radio_menu_item_accessible_ref_relation_set;
|
||||
class->initialize = gtk_radio_menu_item_accessible_initialize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkRadioMenuItemAccessiblePrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_radio_menu_item_accessible_init (GtkRadioMenuItemAccessible *radio_menu_item)
|
||||
{
|
||||
radio_menu_item->old_group = NULL;
|
||||
radio_menu_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (radio_menu_item,
|
||||
GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE,
|
||||
GtkRadioMenuItemAccessiblePrivate);
|
||||
}
|
||||
|
||||
@@ -29,14 +29,15 @@ G_BEGIN_DECLS
|
||||
#define GTK_IS_RADIO_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE))
|
||||
#define GTK_RADIO_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE, GtkRadioMenuItemAccessibleClass))
|
||||
|
||||
typedef struct _GtkRadioMenuItemAccessible GtkRadioMenuItemAccessible;
|
||||
typedef struct _GtkRadioMenuItemAccessibleClass GtkRadioMenuItemAccessibleClass;
|
||||
typedef struct _GtkRadioMenuItemAccessible GtkRadioMenuItemAccessible;
|
||||
typedef struct _GtkRadioMenuItemAccessibleClass GtkRadioMenuItemAccessibleClass;
|
||||
typedef struct _GtkRadioMenuItemAccessiblePrivate GtkRadioMenuItemAccessiblePrivate;
|
||||
|
||||
struct _GtkRadioMenuItemAccessible
|
||||
{
|
||||
GtkCheckMenuItemAccessible parent;
|
||||
|
||||
GSList *old_group;
|
||||
GtkRadioMenuItemAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkRadioMenuItemAccessibleClass
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user