Compare commits
559 Commits
SNAP_19971
...
GTK_0_99_8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a544b8912 | ||
|
|
75a00da8d1 | ||
|
|
38614a78b6 | ||
|
|
b44ec526b6 | ||
|
|
177354df02 | ||
|
|
2a2fff763d | ||
|
|
3c03a6787d | ||
|
|
f9739e8343 | ||
|
|
85d4cd0f43 | ||
|
|
e648c2d68f | ||
|
|
467e4e73c1 | ||
|
|
b141619b50 | ||
|
|
3f04c019cd | ||
|
|
3872c32d4a | ||
|
|
df0b05ef2b | ||
|
|
70b3b3e6e1 | ||
|
|
a783d668f1 | ||
|
|
a6e2c24b60 | ||
|
|
8a0d67391c | ||
|
|
63955ec2e2 | ||
|
|
077b5109a4 | ||
|
|
444c9529db | ||
|
|
600eaaea09 | ||
|
|
60c008eb99 | ||
|
|
27c086bd95 | ||
|
|
c91f2c0cfa | ||
|
|
3f4411ed52 | ||
|
|
f8170cbd7c | ||
|
|
8ecd7ef5ae | ||
|
|
0ac28d23a4 | ||
|
|
ced74f4435 | ||
|
|
16c6ee03ae | ||
|
|
eac28852ed | ||
|
|
f87ee7e51a | ||
|
|
9ce0cb6037 | ||
|
|
85764dad33 | ||
|
|
9addd8da2c | ||
|
|
bfc969f697 | ||
|
|
e8a447e002 | ||
|
|
8fa6f19aa2 | ||
|
|
85dd78b7d8 | ||
|
|
bc8e40387b | ||
|
|
566a13a6c0 | ||
|
|
9280285954 | ||
|
|
135cdd43a9 | ||
|
|
6e7f4a99e9 | ||
|
|
cfd3a51369 | ||
|
|
ab4fed04fe | ||
|
|
c86bf9bae2 | ||
|
|
b8e7ea1f11 | ||
|
|
54a9eb416d | ||
|
|
f9ad283402 | ||
|
|
8cde2c5c21 | ||
|
|
bc98ea9ce1 | ||
|
|
294cfcdb22 | ||
|
|
3ef2c37a83 | ||
|
|
78290be1c0 | ||
|
|
c31eb969ba | ||
|
|
68fcbef5a1 | ||
|
|
cc4dc8339d | ||
|
|
c57f1e318e | ||
|
|
bd9ddcb231 | ||
|
|
6acde3e1ce | ||
|
|
3832600822 | ||
|
|
fa107ded2a | ||
|
|
8eb77dfea2 | ||
|
|
9c8ed97e83 | ||
|
|
c8e5c809ed | ||
|
|
9b4919dcb8 | ||
|
|
96a7435911 | ||
|
|
7c698ad46c | ||
|
|
9a9070c26d | ||
|
|
aebd3d2df2 | ||
|
|
affaf4f9d2 | ||
|
|
4f3495f955 | ||
|
|
d19d3c5dca | ||
|
|
a8afd462c0 | ||
|
|
093dfedf74 | ||
|
|
48a15b7349 | ||
|
|
59436967d5 | ||
|
|
c5327ecc31 | ||
|
|
617a879dfe | ||
|
|
b7a6cd6750 | ||
|
|
ffc1084029 | ||
|
|
5724801800 | ||
|
|
309d7377e7 | ||
|
|
2ff460a6c8 | ||
|
|
3573f8b5f3 | ||
|
|
e583ab045f | ||
|
|
3d7c2d6634 | ||
|
|
47933b73db | ||
|
|
1432078569 | ||
|
|
6cfdaaa740 | ||
|
|
d94b21a8df | ||
|
|
cfda5f0035 | ||
|
|
5d6fe2d05f | ||
|
|
fb66cb05df | ||
|
|
5d5bbd1a21 | ||
|
|
c45ab2b2d6 | ||
|
|
4a4f0aedf3 | ||
|
|
db51126e3b | ||
|
|
2737494599 | ||
|
|
e9e7e4c86b | ||
|
|
7f17ced74b | ||
|
|
8f8b0f68ff | ||
|
|
f9e5e12bcc | ||
|
|
cb6412978c | ||
|
|
120df3b8b7 | ||
|
|
fabfc17d93 | ||
|
|
4db2561dd5 | ||
|
|
355e74fce4 | ||
|
|
c5e729b4bc | ||
|
|
1f39582f3f | ||
|
|
23a7e9c93e | ||
|
|
0db2549361 | ||
|
|
100775d091 | ||
|
|
8532799aaa | ||
|
|
2f50a3044e | ||
|
|
990bddfe16 | ||
|
|
239a12d0d1 | ||
|
|
2ab3ec6cbd | ||
|
|
d187183161 | ||
|
|
2a8d32a760 | ||
|
|
19a80b7695 | ||
|
|
7b721e200b | ||
|
|
c9f7f2a0f8 | ||
|
|
d894d2dc0c | ||
|
|
2b3f8baf86 | ||
|
|
ab30a02e5f | ||
|
|
85f1364922 | ||
|
|
e60864761c | ||
|
|
829936fd6f | ||
|
|
6eca1a93c0 | ||
|
|
77ff63f7e7 | ||
|
|
5fa1bfcf45 | ||
|
|
76d01a826c | ||
|
|
2395ed0826 | ||
|
|
de1262dcc1 | ||
|
|
124d1e5caa | ||
|
|
640c75216d | ||
|
|
a328473d1b | ||
|
|
1941bf4cbf | ||
|
|
761549b968 | ||
|
|
16f8b9f627 | ||
|
|
2095c552f8 | ||
|
|
3033d6b47a | ||
|
|
2a4c36a73d | ||
|
|
4a35f24c47 | ||
|
|
47f7073e28 | ||
|
|
6c9e2cf195 | ||
|
|
be3ad53c49 | ||
|
|
1ac59c103d | ||
|
|
ba55b3f94b | ||
|
|
793a130520 | ||
|
|
f5c00ed917 | ||
|
|
c6a2248e98 | ||
|
|
12f1b7858e | ||
|
|
3eac46a981 | ||
|
|
3cbeacaf58 | ||
|
|
818ea9d84b | ||
|
|
395ccd366a | ||
|
|
3362281802 | ||
|
|
9eb0ce778a | ||
|
|
5b51a9f7f1 | ||
|
|
558c5f5040 | ||
|
|
1e5d354127 | ||
|
|
68a8537266 | ||
|
|
f6f1ce01c6 | ||
|
|
80fd0a0c00 | ||
|
|
d1f5f06082 | ||
|
|
172d6433a7 | ||
|
|
6ef73ebac0 | ||
|
|
ade3020098 | ||
|
|
af18ab4305 | ||
|
|
3fb589b2ff | ||
|
|
b7056ea129 | ||
|
|
60870d3407 | ||
|
|
afe08d63e3 | ||
|
|
2a9e933d90 | ||
|
|
16da0508af | ||
|
|
f222bd77bb | ||
|
|
2630943eb3 | ||
|
|
9205edae41 | ||
|
|
d491547e86 | ||
|
|
91c1c8dddb | ||
|
|
68a90caf45 | ||
|
|
c4c1c1ea55 | ||
|
|
6d3ef70d1e | ||
|
|
fa26673f49 | ||
|
|
8a19c2a157 | ||
|
|
7ad17f7b08 | ||
|
|
b2e6c9723a | ||
|
|
693fa02b83 | ||
|
|
a36ffb12a5 | ||
|
|
50cc709f77 | ||
|
|
473c1d4d7b | ||
|
|
a597dd9473 | ||
|
|
95efae09a7 | ||
|
|
6c2818881d | ||
|
|
3cdf88be4d | ||
|
|
777159913b | ||
|
|
97bbc97bb2 | ||
|
|
cf01747701 | ||
|
|
82d7ac35ed | ||
|
|
203476915a | ||
|
|
c88ea382d2 | ||
|
|
635d54c091 | ||
|
|
d3607d5465 | ||
|
|
7add75fba5 | ||
|
|
86a97f7835 | ||
|
|
f6f927d227 | ||
|
|
1b656e0dde | ||
|
|
7c99ffb891 | ||
|
|
84335371b1 | ||
|
|
9a0687a673 | ||
|
|
5861dfb9f8 | ||
|
|
06d19fb68d | ||
|
|
e00c0594a3 | ||
|
|
75a8405430 | ||
|
|
800afc55d7 | ||
|
|
a8d6f14c2d | ||
|
|
f97dd05d5a | ||
|
|
782dcc834b | ||
|
|
4c0ca9b968 | ||
|
|
7983856239 | ||
|
|
53a595f448 | ||
|
|
005f39e02e | ||
|
|
75fbe1adae | ||
|
|
6ff27c34f1 | ||
|
|
7cb1030d32 | ||
|
|
22a9a454af | ||
|
|
62dba86c81 | ||
|
|
2fbc8c20c1 | ||
|
|
132f17fa37 | ||
|
|
10474e6a73 | ||
|
|
c87244dd75 | ||
|
|
0ef453b82c | ||
|
|
a4b322cccc | ||
|
|
fc7e845c8f | ||
|
|
3d4cc2f904 | ||
|
|
8923d60dba | ||
|
|
9ad922290c | ||
|
|
7e3692b99f | ||
|
|
83e3008d35 | ||
|
|
1410a8a003 | ||
|
|
825aa9501b | ||
|
|
b5cb66dc35 | ||
|
|
a303493882 | ||
|
|
9f96d18eb1 | ||
|
|
7b399a225c | ||
|
|
d91da80871 | ||
|
|
04c520bad9 | ||
|
|
afcc0ad3b2 | ||
|
|
27575aa216 | ||
|
|
fa10f1361f | ||
|
|
a589338a7f | ||
|
|
623f7d9772 | ||
|
|
3c7f5af2a5 | ||
|
|
c3fc26bb9d | ||
|
|
041983a776 | ||
|
|
888470ee29 | ||
|
|
dd07df15c1 | ||
|
|
39e26262a5 | ||
|
|
c43a50fe36 | ||
|
|
9dee8ee4e4 | ||
|
|
31a238b6b6 | ||
|
|
c305397fca | ||
|
|
f747f3b2cd | ||
|
|
ed848ac41e | ||
|
|
2090cc650c | ||
|
|
13179d42a0 | ||
|
|
6898536a02 | ||
|
|
f98686da85 | ||
|
|
6246db9288 | ||
|
|
38fac1be63 | ||
|
|
7a3af96d84 | ||
|
|
289f6a38fe | ||
|
|
e105a87144 | ||
|
|
c763748dd1 | ||
|
|
75cd57b6cb | ||
|
|
dca018206e | ||
|
|
89107cb751 | ||
|
|
edad08addd | ||
|
|
5b597c65c7 | ||
|
|
d3c3333735 | ||
|
|
9258a7aecb | ||
|
|
f82814760e | ||
|
|
4b86717650 | ||
|
|
8d2bb0f43e | ||
|
|
23a13fd4a5 | ||
|
|
64ca527ecb | ||
|
|
3b0de24a7b | ||
|
|
5842311062 | ||
|
|
b45cd0430c | ||
|
|
a8629917ae | ||
|
|
febe6498f2 | ||
|
|
fc86f630a6 | ||
|
|
b239e3c941 | ||
|
|
6b5e983f3d | ||
|
|
eeaefdf04f | ||
|
|
8822bde131 | ||
|
|
c3154703d0 | ||
|
|
57bae55574 | ||
|
|
58df302b15 | ||
|
|
35ba1ac7ef | ||
|
|
eef38289b2 | ||
|
|
81fe36047e | ||
|
|
b0de5e73f5 | ||
|
|
1522f2ae59 | ||
|
|
a11062b2d9 | ||
|
|
01200282da | ||
|
|
4ef94fd74e | ||
|
|
b38b6f5f0f | ||
|
|
db628b3ca0 | ||
|
|
015c1052ae | ||
|
|
ce4263f901 | ||
|
|
4af33fa24d | ||
|
|
ee7038f9fd | ||
|
|
7922f34318 | ||
|
|
ac492cfab6 | ||
|
|
1ff162c445 | ||
|
|
38bffa52d3 | ||
|
|
db6a8d4a8a | ||
|
|
22388cfc07 | ||
|
|
b5b1534b10 | ||
|
|
89a5c21c07 | ||
|
|
4fb20bdbcc | ||
|
|
7b2f9afe4c | ||
|
|
bad1cb0f37 | ||
|
|
4cb6dec331 | ||
|
|
d43c0de3f4 | ||
|
|
a9f866f4ca | ||
|
|
8f355e26ef | ||
|
|
3cefe524dc | ||
|
|
918f7d484d | ||
|
|
2c4b378455 | ||
|
|
347a06e3d0 | ||
|
|
f734007af4 | ||
|
|
63f6c689ff | ||
|
|
edf9e176db | ||
|
|
33f3f4a2ae | ||
|
|
6f7faf9df2 | ||
|
|
3942cb76af | ||
|
|
6365ebc9ea | ||
|
|
36b2a2ebcd | ||
|
|
3779493d17 | ||
|
|
01f66785cb | ||
|
|
5cb62b4561 | ||
|
|
d64570b781 | ||
|
|
fb48f5a356 | ||
|
|
b2140a2322 | ||
|
|
0b372cfb3a | ||
|
|
2d42cb955e | ||
|
|
10be064561 | ||
|
|
b533c32dd4 | ||
|
|
3dca445763 | ||
|
|
5e517e426c | ||
|
|
325dc92ad4 | ||
|
|
d1da1a45a0 | ||
|
|
06f64ff941 | ||
|
|
4c2931aab5 | ||
|
|
3ae8c300bb | ||
|
|
18ee22d93b | ||
|
|
3b95a7a2b1 | ||
|
|
275d8a2696 | ||
|
|
0dae051ddd | ||
|
|
a7a7e430bf | ||
|
|
839be1dfdb | ||
|
|
53ac2efcad | ||
|
|
73386d5761 | ||
|
|
79f69b1676 | ||
|
|
1a8765e6ce | ||
|
|
0c6a6baa08 | ||
|
|
9dcce18815 | ||
|
|
67e6757069 | ||
|
|
2dd1106130 | ||
|
|
59ff297c24 | ||
|
|
f424cd83a9 | ||
|
|
4628759d3b | ||
|
|
11d37c5067 | ||
|
|
1e34b9ba8d | ||
|
|
1e764e1b41 | ||
|
|
e35fb5486f | ||
|
|
40808fa050 | ||
|
|
3f44ca9487 | ||
|
|
84cf918177 | ||
|
|
443648028c | ||
|
|
2e99581612 | ||
|
|
8d721e5b75 | ||
|
|
8dc9cd53ff | ||
|
|
c44ba4b377 | ||
|
|
a6252a3297 | ||
|
|
582a3f433c | ||
|
|
97f11c694c | ||
|
|
aed02304eb | ||
|
|
8e1fb2cccd | ||
|
|
2d5a6055e8 | ||
|
|
dd77b5db5a | ||
|
|
18681dc653 | ||
|
|
f91efadd4f | ||
|
|
880c62eec1 | ||
|
|
72da1d3e02 | ||
|
|
4da8e492f7 | ||
|
|
139026de73 | ||
|
|
284882b8c7 | ||
|
|
dfc3630c8c | ||
|
|
8bb622a983 | ||
|
|
24cfae7295 | ||
|
|
75b20f2eaf | ||
|
|
839b480391 | ||
|
|
6d33a0791a | ||
|
|
00000538ed | ||
|
|
f873f58d5b | ||
|
|
1d58a2e291 | ||
|
|
84e1ee4bac | ||
|
|
5eee6416f5 | ||
|
|
4ccc005197 | ||
|
|
52d5af4d7e | ||
|
|
82da232b12 | ||
|
|
51a481d9e8 | ||
|
|
d2aa891c8e | ||
|
|
ad5466ca6e | ||
|
|
33a9119c22 | ||
|
|
1f07d39e23 | ||
|
|
49517ca835 | ||
|
|
be68a5dacb | ||
|
|
23db1522f6 | ||
|
|
0e3e5eed78 | ||
|
|
957bd9d9c0 | ||
|
|
65d015d813 | ||
|
|
0eedb30ce8 | ||
|
|
25995faa6c | ||
|
|
621e1dd4c2 | ||
|
|
8eb36ebbd5 | ||
|
|
39f02b638b | ||
|
|
7a2073bf64 | ||
|
|
948a3620cf | ||
|
|
303c8f03a8 | ||
|
|
06dc220d64 | ||
|
|
9dadde735c | ||
|
|
dc4e9e2fe1 | ||
|
|
0e9ff02e85 | ||
|
|
c3a5564894 | ||
|
|
2b65feb5a5 | ||
|
|
af9e316ce6 | ||
|
|
92610dafdb | ||
|
|
26c35927f7 | ||
|
|
f7443e0e85 | ||
|
|
e2f5eb1c3e | ||
|
|
0f6d9f0ffc | ||
|
|
36d360aa98 | ||
|
|
0516fcead1 | ||
|
|
f872397c0c | ||
|
|
aacb5bd1e3 | ||
|
|
fb51b7a6c5 | ||
|
|
b8e57550b7 | ||
|
|
2d8acc12f3 | ||
|
|
a5fa0b03c0 | ||
|
|
d02a42db34 | ||
|
|
4c23b890c4 | ||
|
|
7c21169e72 | ||
|
|
ad1a805810 | ||
|
|
6ceea7e635 | ||
|
|
ed11431bdb | ||
|
|
ee489eafb0 | ||
|
|
104f72cf95 | ||
|
|
7bac5c59eb | ||
|
|
7c726a1e3e | ||
|
|
2b2667e791 | ||
|
|
e3956c289a | ||
|
|
b44565f3e4 | ||
|
|
4da7b2f2ef | ||
|
|
0a81bbf58f | ||
|
|
162795e983 | ||
|
|
81a58c413c | ||
|
|
1b6fb00808 | ||
|
|
32fbb7b821 | ||
|
|
67180c87e1 | ||
|
|
24b21a5d84 | ||
|
|
01eda653ee | ||
|
|
61124945c0 | ||
|
|
e9f322e2f0 | ||
|
|
f7b1fa3aed | ||
|
|
8d0318387f | ||
|
|
1cf3f510d1 | ||
|
|
6824581335 | ||
|
|
fde815eb54 | ||
|
|
05cf0f3203 | ||
|
|
73e9b6b205 | ||
|
|
555aa2baf9 | ||
|
|
26be2f7003 | ||
|
|
d5d01a5af9 | ||
|
|
65e63db01e | ||
|
|
4de2665e8c | ||
|
|
865eab2445 | ||
|
|
f9bfb8462a | ||
|
|
9c5d32799d | ||
|
|
4c530ae5bc | ||
|
|
134466992b | ||
|
|
585dc6d781 | ||
|
|
ad5083714e | ||
|
|
fce69b5a4f | ||
|
|
a97e3501c8 | ||
|
|
d55ed5449d | ||
|
|
4d724c25c7 | ||
|
|
92c316606b | ||
|
|
3103106ba7 | ||
|
|
ebce1f7954 | ||
|
|
da9a8aee9e | ||
|
|
4bb8907c2b | ||
|
|
c3fe09e069 | ||
|
|
19096ebdfd | ||
|
|
d30343b9d9 | ||
|
|
30e8968f3b | ||
|
|
bb698f73f4 | ||
|
|
8a6dea2d55 | ||
|
|
68269a3f2a | ||
|
|
244e4fe4c7 | ||
|
|
2e943b280e | ||
|
|
d6b0c35739 | ||
|
|
ef7a3aa2ff | ||
|
|
79f532177f | ||
|
|
56aae058fc | ||
|
|
37f6b421f2 | ||
|
|
7e4ee8cb4f | ||
|
|
0219b8b6b4 | ||
|
|
4d6f11a6ce | ||
|
|
a51d944e25 | ||
|
|
a7f427d7d9 | ||
|
|
59af5a46f0 | ||
|
|
a8cd23de73 | ||
|
|
bb1aa22b63 | ||
|
|
28de9c69b3 | ||
|
|
ef3f373172 | ||
|
|
4b4c6aff91 | ||
|
|
c3ac6c80a6 | ||
|
|
6653fcf391 | ||
|
|
1ce708c570 | ||
|
|
8fc5d3586a | ||
|
|
a95ad0a897 | ||
|
|
1e4243e40b | ||
|
|
60ec6d4638 | ||
|
|
b50a9f760b | ||
|
|
ebdcd27f15 | ||
|
|
8d073b0232 | ||
|
|
64fd713042 | ||
|
|
fbc9ee9fba | ||
|
|
519a4bc24e | ||
|
|
b04290fe58 | ||
|
|
15f51f0eb6 | ||
|
|
763c529be0 | ||
|
|
dd34bcca5e | ||
|
|
e522ad46ba | ||
|
|
aedb8717f1 | ||
|
|
33b9431580 | ||
|
|
c82e82dafc | ||
|
|
ba1d51293c | ||
|
|
63bf68c991 | ||
|
|
c320a8d858 |
@@ -5,6 +5,9 @@ libtool
|
||||
config.status
|
||||
stamp-h
|
||||
Makefile
|
||||
gtk+.xconfig
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
configure
|
||||
gtk-config
|
||||
config.cache
|
||||
|
||||
|
||||
3048
ChangeLog.pre-2-0
3048
ChangeLog.pre-2-0
File diff suppressed because it is too large
Load Diff
3048
ChangeLog.pre-2-10
3048
ChangeLog.pre-2-10
File diff suppressed because it is too large
Load Diff
3048
ChangeLog.pre-2-2
3048
ChangeLog.pre-2-2
File diff suppressed because it is too large
Load Diff
3048
ChangeLog.pre-2-4
3048
ChangeLog.pre-2-4
File diff suppressed because it is too large
Load Diff
3048
ChangeLog.pre-2-6
3048
ChangeLog.pre-2-6
File diff suppressed because it is too large
Load Diff
3048
ChangeLog.pre-2-8
3048
ChangeLog.pre-2-8
File diff suppressed because it is too large
Load Diff
50
HACKING
Normal file
50
HACKING
Normal file
@@ -0,0 +1,50 @@
|
||||
If you want to hack on the Gtk+ project, it will make you life easier
|
||||
to have the following packages installed:
|
||||
|
||||
- GNU autoconf 2.12
|
||||
- GNU automake 1.2d
|
||||
Available in ftp://ftp.cygnus.com/pub/tromey
|
||||
- GNU libtool 1.0h
|
||||
Available in ftp://alpha.gnu.org/gnu/
|
||||
|
||||
These should be available by ftp from prep.ai.mit.edu or any of the
|
||||
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
|
||||
|
||||
If you are accessing gtk+ via CVS, then you will need to take several
|
||||
steps to get it to compile. You can do all these steps at once
|
||||
by running:
|
||||
|
||||
cvsroot/gtk+# ./autogen.sh
|
||||
|
||||
Basically this does the following for you:
|
||||
|
||||
cvsroot/gtk+# aclocal; automake; autoconf
|
||||
cvsroot/gtk+/glib# aclocal; automake; autoconf
|
||||
|
||||
The above commands create the "configure" script. Now you
|
||||
can run the configure script in cvsroot/gtk+ to create all
|
||||
the Makefiles. You only need to call "configure" in cvsroot/gtk+
|
||||
as the one in glib will be invoked automatically.
|
||||
|
||||
Before running autogen.sh or configure, make sure you have libtool
|
||||
in your path.
|
||||
|
||||
Note that autogen.sh runs configure for you. If you wish to pass
|
||||
options like --prefix=/usr to configure you can give those options
|
||||
to autogen.sh and they will be passed on to configure.
|
||||
|
||||
If at all possible, please use CVS to get the latest development version of
|
||||
gtk+. You can do the following to get gtk+ from cvs:
|
||||
|
||||
$ export CVSROOT=':pserver:anonymous@cvs.gimp.org:/debian/home/gnomecvs'
|
||||
$ cvs login
|
||||
(there is no password, just hit return)
|
||||
$ cvs -z9 checkout gtk+
|
||||
|
||||
Please submit patches to the gtk-list@redhat.com mailing list (you must
|
||||
subscribe before you post, e-mail gtk-list-request@redhat.com with a
|
||||
subject of "subscribe"). All kinds of contributions are accepted.
|
||||
Patches that you wish to go into the distribution should also be uploaded
|
||||
to ftp://ftp.gimp.org/incoming. Follow the rules there for naming your
|
||||
patches.
|
||||
|
||||
36
INSTALL
36
INSTALL
@@ -0,0 +1,36 @@
|
||||
The 'configure' script can be given a number of options to
|
||||
enable and disable various features. For a complete list,
|
||||
type:
|
||||
./configure --help
|
||||
|
||||
* --enable-xim support XIM [default=yes]
|
||||
|
||||
Specifying --disable-xim will disable support for entering
|
||||
internationalized text using X Input Methods. This will give
|
||||
some slight savings in speed and memory use and might be necessary
|
||||
with older versions of X.
|
||||
|
||||
* --with-locale=LOCALE locale name you want to use
|
||||
|
||||
The --with-locale options is used to determine if your operating
|
||||
system has support for the locale you will be using. If not, X's built
|
||||
in locale support will be used.
|
||||
|
||||
Because of bugs in autoconf, it is necessary to specify this option
|
||||
even if your LANG environment variable is correctly set.
|
||||
|
||||
This option does not determine which locale GTK will use at
|
||||
runtime. That will be determined from the usual environment variables.
|
||||
If you will be using multiple locales with GTK, specify the one
|
||||
for which your operating system has the worst support for the
|
||||
--with-locale option.
|
||||
|
||||
|
||||
Note for using XIM support with kinput2
|
||||
---------------------------------------
|
||||
|
||||
There is a bug in older versions of kinput2 that will cause
|
||||
GTK to hang when destroying a text entry. The latest versions
|
||||
of kinput is available from:
|
||||
|
||||
ftp://ftp.sra.co.jp/pub/x11/kinput2
|
||||
|
||||
11
Makefile.am
11
Makefile.am
@@ -3,7 +3,16 @@
|
||||
SRC_SUBDIRS = glib gdk gtk
|
||||
SUBDIRS = $(SRC_SUBDIRS) docs
|
||||
|
||||
EXTRA_DIST = gtk+.prj makecopyright TODO
|
||||
bin_SCRIPTS = gtk-config
|
||||
|
||||
EXTRA_DIST = \
|
||||
gtk+.prj \
|
||||
gtk.m4 \
|
||||
makecopyright \
|
||||
TODO
|
||||
|
||||
m4datadir = $(datadir)/aclocal
|
||||
m4data_DATA = gtk.m4
|
||||
|
||||
.PHONY: files populate checkin release
|
||||
|
||||
|
||||
353
Makefile.in
Normal file
353
Makefile.in
Normal file
@@ -0,0 +1,353 @@
|
||||
# Makefile.in generated automatically by automake 1.2c from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = true
|
||||
PRE_INSTALL = true
|
||||
POST_INSTALL = true
|
||||
NORMAL_UNINSTALL = true
|
||||
PRE_UNINSTALL = true
|
||||
POST_UNINSTALL = true
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
LD = @LD@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
x_cflags = @x_cflags@
|
||||
x_includes = @x_includes@
|
||||
x_ldflags = @x_ldflags@
|
||||
x_libs = @x_libs@
|
||||
xinput_progs = @xinput_progs@
|
||||
|
||||
SRC_SUBDIRS = glib gdk gtk
|
||||
SUBDIRS = $(SRC_SUBDIRS) docs
|
||||
|
||||
EXTRA_DIST = gtk+.prj makecopyright TODO REFCOUNTING BUGS
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = gtk+.xconfig
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure configure.in gtk+.xconfig.in install-sh ltconfig \
|
||||
ltmain.sh missing mkinstalldirs stamp-h.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): @MAINT@ configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@:
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h
|
||||
$(srcdir)/config.h.in: @MAINT@$(srcdir)/stamp-h.in
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
gtk+.xconfig: $(top_builddir)/config.status gtk+.xconfig.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
for subdir in $(SUBDIRS); do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
rev=''; for subdir in $(SUBDIRS); do rev="$$subdir $$rev"; done; \
|
||||
for subdir in $$rev; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
(cd $$subdir && $(MAKE) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES)
|
||||
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
done; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& $(MAKE) install \
|
||||
&& $(MAKE) installcheck \
|
||||
&& $(MAKE) dist
|
||||
-rm -rf $(distdir)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
done
|
||||
info: info-recursive
|
||||
dvi: dvi-recursive
|
||||
check: all-am
|
||||
$(MAKE) check-recursive
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) all-recursive
|
||||
|
||||
all-am: Makefile config.h
|
||||
|
||||
install-exec: install-exec-recursive
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-data-recursive
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-recursive
|
||||
@:
|
||||
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
all: all-recursive-am all-am
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs: installdirs-recursive
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
|
||||
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||
|
||||
clean: clean-recursive clean-am
|
||||
|
||||
distclean: distclean-recursive distclean-am
|
||||
-rm -f config.status
|
||||
-rm -f libtool
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||
maintainer-clean-hdr install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
|
||||
installcheck all-recursive-am all-am install-exec install-data install \
|
||||
uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
|
||||
.PHONY: files populate checkin release
|
||||
|
||||
files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
echo $$p; \
|
||||
done
|
||||
@for subdir in $(SUBDIRS); do \
|
||||
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
|
||||
for file in $$files; do \
|
||||
echo $$subdir/$$file; \
|
||||
done; \
|
||||
done
|
||||
|
||||
populate:
|
||||
@echo "populating project"
|
||||
@files=`$(MAKE) files | grep -v "make\[[1-9]\]"`; prcs populate -d gtk+.prj $$files
|
||||
|
||||
checkin: populate
|
||||
@echo "checking in project"
|
||||
@prcs checkin
|
||||
|
||||
release:
|
||||
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
105
NEWS
105
NEWS
@@ -0,0 +1,105 @@
|
||||
Overview of Changes in GTK+ 0.99.8:
|
||||
|
||||
* Compilation and configuration fixes
|
||||
* DND Fixes
|
||||
* New test in testgtk: cursors
|
||||
* Tutorial updates/additions
|
||||
* Few more FAQ additions
|
||||
* More prep for 1.0
|
||||
|
||||
Overview of Changes in GTK+ 0.99.7:
|
||||
|
||||
* This release is mainly because 0.99.6 did not compile completely
|
||||
due to a missing file.
|
||||
* Fixes to Gtk's quit handlers.
|
||||
|
||||
Overview of Changes in GTK+ 0.99.6:
|
||||
|
||||
* Intermediate release to become 1.0.
|
||||
* More signedness corrections for handler functions in gtkmain.h.
|
||||
* Semantics of GtkWidget::delete_event changed.
|
||||
* Documentation updates.
|
||||
* Inclusion of Gtk tutorial.
|
||||
* Implementation of a new shutdown method for GtkObject's executed prior to
|
||||
actual destruction. WARNING: this breaks binary compatibility, programs using
|
||||
Gtk need to be recompiled.
|
||||
* Clean ups due to compiler warnings.
|
||||
* Various widget fixes.
|
||||
|
||||
Overview of Fixes in GTK+ 0.99.5:
|
||||
|
||||
* Signal signedness and naming corrections
|
||||
* rc/style fixes
|
||||
* text, entry widget fixes
|
||||
* gtkeditable fixes
|
||||
* scrollbar flickering fixed
|
||||
* check casts are more descriptive
|
||||
* DND fixes
|
||||
* FAQ updates
|
||||
* Bug fixes
|
||||
|
||||
Overview of Changes in GTK+ 0.99.4:
|
||||
|
||||
* Reference counting revolution integrated.
|
||||
Refer to docs/refcounting.txt on this issue.
|
||||
* Implementation of a decent debugging system, you would want
|
||||
to export GTK_DEBUG=objects if you are going to develop gtk applications,
|
||||
refer to docs/debugging.txt for further information.
|
||||
* Additions on the signal code for querying information about certain signals,
|
||||
and pending handlers of signals.
|
||||
* Support for user signals, and major changes to internal signal handler
|
||||
handling for proper signal removal and invokation of after signals.
|
||||
* Additional signals for various widgets e.g, GtkHandleBox::child_attached,
|
||||
GtkHandleBox::child_detached, GtkWidget::style_set, GtkWidget::parent_set.
|
||||
* GtkTooltips became a true descendant of GtkObject via derivation from
|
||||
GtkData and facilitates an extra tip string which can be used as e.g. an
|
||||
index into context help.
|
||||
* Split up of the widget/object flags into a private and a public portion,
|
||||
consult docs/widget_system.txt on this.
|
||||
* Support for hot keys on gtk programs via gtk_key_snooper_install().
|
||||
* Reimplementation of the *_interp functions as *_full functions to provide
|
||||
simple callback functions as well.
|
||||
* Idle functions are now prioritized.
|
||||
* Many enhancements to GtkNotebook.
|
||||
* New widget GtkSpinButton, check out testgtk.
|
||||
* New widget GtkTipsQuery for letting the user query tooltips of widgets.
|
||||
* Addition of GtkEditable base widget to encapsulate selection and
|
||||
clipboard handling. (GtkEntry and GtkText use this)
|
||||
* Text widget more complete.
|
||||
* Additions to GtkStatusBar to make it complete.
|
||||
* Gdk now supports regions.
|
||||
* Access masks for widget arguments (GTK_ARG_READABLE/GTK_ARG_WRITABLE).
|
||||
* Function replacements:
|
||||
g_string_hash() -> g_str_hash()
|
||||
g_string_equal() -> g_str_equal()
|
||||
gtk_tooltips_set_tips() -> gtk_tooltips_set_tip()
|
||||
* Support for quit handlers in gtk_main().
|
||||
* Motif window mangaer hints support.
|
||||
* Widget arguments are now flagged for readability/writability.
|
||||
* Additions to documentation.
|
||||
* Various FAQ updates. (FAQ now included)
|
||||
* Clean ups and many many bug fixes by a lot of people all over the place.
|
||||
* New, long and descriptive ChangeLog entries for bored readers ;)
|
||||
|
||||
Overview of Changes in GTK+ 0.99.3:
|
||||
|
||||
* Filesel enhancement / stability changes
|
||||
* New widget, gtkcombo
|
||||
* Widgets in the toolbar do not get the focus
|
||||
* New widget, gtkstatusbar (still in-progress)
|
||||
* g_string_equal renamed g_str_equal
|
||||
* g_string_hash renamed g_str_hash
|
||||
* new gtkbox functions to allow modification of the child
|
||||
linkage after the widget tree is setup
|
||||
* gtk_*_get_arg() and gtk_*_set_arg() fixes and implementations
|
||||
* DND changes/fixes
|
||||
* Entry widget now has set_max_length function
|
||||
* Handlebox widget changes/fixes
|
||||
* Some work on text widget (still in-progress)
|
||||
* Now the toolbar supports arbitrary widgets as well
|
||||
* CList has resizable columns again
|
||||
* CList now looks consistant with scrolled windows
|
||||
* Remove flickering from entry widget
|
||||
* Added switch_page signal to notebook widget
|
||||
* Documentation additions
|
||||
* Other bug fixes...
|
||||
|
||||
11
README
11
README
@@ -1,15 +1,16 @@
|
||||
|
||||
This is GTK+ version 0.99.8. GTK, which stands for the Gimp ToolKit,
|
||||
is a library for creating graphical user interfaces.
|
||||
|
||||
The official ftp site is:
|
||||
ftp://ftp.gimp.org/pub/gtk
|
||||
|
||||
The official web site is:
|
||||
http://www.gimp.org/gtk
|
||||
|
||||
Patches can be uploaded to:
|
||||
ftp://ftp.gimp.org/incoming
|
||||
|
||||
Anonymous CVS access for gtk+ (as well as 'gimp', 'gimp-data', and
|
||||
'gnome') is available via
|
||||
CVSROOT=:pserver:anonymous@cvs.gnome.org:/home/cvs
|
||||
with an empty password.
|
||||
|
||||
A mailing list is located at:
|
||||
gtk-list@redhat.com
|
||||
|
||||
|
||||
230
TODO
230
TODO
@@ -1,36 +1,224 @@
|
||||
Now
|
||||
---
|
||||
TODO BEFORE GTK 1.0
|
||||
-------------------
|
||||
|
||||
3. Fix focus activation of list items. Does list item activation have to be
|
||||
completely reorganized?
|
||||
Bugs:
|
||||
* pasting into a GtkEntry that already has a very long string,
|
||||
causes the app to hang.
|
||||
|
||||
* scrolled windows get cought in an endless reallocation loop under
|
||||
certain (rare) circumstances.
|
||||
|
||||
4. Lists should scroll to center the recently selected item if it isn't
|
||||
* Widget redrawing when the window resizes sometimes messes up.
|
||||
GtkLabels sometimes redraw without clearing up the underlying background on
|
||||
window resizes.
|
||||
|
||||
* Are there still some GtkCList changes outstanding? (Jay Painter)
|
||||
GtkCList is derived from GtkContainer but doesn't implement the
|
||||
need_resize, focus, add and remove methods from containers.
|
||||
it should at least issue a warning upon invokation of not supported
|
||||
member functions.
|
||||
|
||||
* GtkTree and GtkList should express in their *_add implementations,
|
||||
that they expect GtkListItems/GtkTreeItems as children. Similar
|
||||
things might apply to other containers.
|
||||
|
||||
* delay dnd settings to take effect once a widget is realized, this is
|
||||
to avoid force realizations. i think this goes along with owens dnd
|
||||
changes?
|
||||
-timj
|
||||
The way DND data types are set in GtkWidget really needs to be fixed.
|
||||
This is pretty high on my priority list, and I'll get to it as soon as
|
||||
the column list widget is done. The correct way dnd data needs to be set
|
||||
is to have a additional keyed data type with GtkWidget, which is applied to
|
||||
the widget's window upon realize.
|
||||
There also needs to be a way to set dnd-data on widget windows which are
|
||||
not the main window (for widgets that create more than one window).
|
||||
-Jay Painter
|
||||
DnD seems to work for me, but yes, there needs to be some sort of
|
||||
gtk_widget layer that makes it easier... Also, adding support for drop
|
||||
zones might be nice.
|
||||
-Elliot
|
||||
This one is reproducabel for me:
|
||||
testgtk --sync
|
||||
popup colorselection
|
||||
drag/drop works
|
||||
start up preview color
|
||||
drag works but not dropping
|
||||
end preview color
|
||||
drag/drop works
|
||||
start up prewiev color
|
||||
segfault in malloc
|
||||
-timj
|
||||
|
||||
* Change bitfields to guints from enums for C++ ?
|
||||
|
||||
* Force paned window handle to be kept on screen
|
||||
|
||||
Additions:
|
||||
* GScanner: it might be good to ues stdio and getch() instead of 1-character
|
||||
reads. so one can take advantage of buffering. Currently each read() takes
|
||||
a separate syscall.
|
||||
|
||||
* implement gtk_default_draw_oval
|
||||
|
||||
* Lists should scroll to center the recently selected item if it isn't
|
||||
visible.
|
||||
|
||||
* enforce invariants on *_RESIZE* and *_REDRAW* flags.
|
||||
|
||||
The Future
|
||||
----------
|
||||
* asure that child widgets are really get gtk_widget_destroy()ed in their
|
||||
parents destroy handler, and not just unparented or somesuch.
|
||||
|
||||
-Documentation
|
||||
* GtkToolTips:
|
||||
allocate GtkTooltipsData from memchunks
|
||||
look into incorporation of outdated/gtk-dairiki-971208-[01].patch.gz
|
||||
|
||||
* Make widget attributes configurable after the widget is created (timj).
|
||||
|
||||
-Tree widget
|
||||
* Change gtk_widget_propagate_default_style() mechanism to
|
||||
void gtk_rc_string_export (const gchar *rc_additions,
|
||||
gboolean override_rc_styles);
|
||||
|
||||
-Text widget (needs to be finished)
|
||||
* Configure events for windows that no longer exist fail in
|
||||
XTranslateCoordinates
|
||||
|
||||
TODO AFTER GTK 1.0
|
||||
------------------
|
||||
|
||||
-Widget redrawing when the window resizes sometimes messes up.
|
||||
* Make all widget attributes configurable after the widget is created (timj).
|
||||
|
||||
-Make sure a widget added to a list is a list item and a widget added
|
||||
to a menu is a menu item, etc...
|
||||
* Seperate GtkObject and signaling system from Gdk dependancies?
|
||||
|
||||
* move *_input_add (wrappers for select(2)) mechanism into glib.
|
||||
|
||||
-More dialogs? Print, font, etc?
|
||||
* Make sure a widget added to a list is a list item and a widget added
|
||||
to a menu is a menu item, etc. GTK_BASIC was a first attempt at this,
|
||||
but it fails with subsequent container_add()s. maybe have another
|
||||
GTK_PARENT_BASIC (similar to GTK_PARENT_SENSITIVE) flag, to prevent
|
||||
tree iterations upon every container addition.
|
||||
|
||||
-Multiple document interface (MDI)?
|
||||
* gdk_expose_compress: ala-Xt, this would really help for opaque moves and
|
||||
such
|
||||
|
||||
-Support another widget style? Should be possible using GtkStyle's, but
|
||||
there may be some work needed to remove any style dependencies in widget
|
||||
code. Maybe GtkStyle's should have 'draw_push_button', 'draw_check_button',
|
||||
etc, functions to draw the various widgets.
|
||||
* Entry should have a password mode (and it should show stars
|
||||
for user feedback).
|
||||
|
||||
-OffiX drag and drop support
|
||||
* More dialogs: Print, GtkFontSelector, maybe others...
|
||||
|
||||
-Make all widget attributes configurable after the widget is created.
|
||||
* Multiple document interface (MDI)?
|
||||
|
||||
* Support another widget style? Should be possible using GtkStyle's, but
|
||||
there may be some work needed to remove any style dependencies in widget
|
||||
code. Maybe GtkStyle's should have 'draw_push_button', 'draw_check_button',
|
||||
etc, functions to draw the various widgets.
|
||||
This will be covered by upcoming themability, raster is working on it.
|
||||
|
||||
* make the gtk_main callbacks consistent in their add/remove behaviour.
|
||||
|
||||
* More work on Documentation
|
||||
|
||||
* Check return values on all calls to XIC[Get/Set]Values
|
||||
|
||||
* Rewrite the interface to the i18n stuff so GTK widgets don't need to
|
||||
retrieve X values, and so they don't have to know the value of the
|
||||
XNxxx character constants.
|
||||
|
||||
* The "-geometry" option should be supported
|
||||
|
||||
- Having gdk_init() parse the geometry option. (putting it into
|
||||
GDK means you can use XParseGeometry() without wrapping it)
|
||||
|
||||
- Add a call gdk_get_geometry() that retrieves the results
|
||||
in a form like that returned by XParseGeometry()
|
||||
|
||||
- The application then can modify the results (as would gemvt)
|
||||
then call a routine gtk_window_set_geometry() on whatever
|
||||
it considers to be its main window.
|
||||
|
||||
- Then in some manner GtkWindow takes that into account when
|
||||
setting its hints. (Probably it uses the size and position
|
||||
as the current uposition and usize, and modulates that
|
||||
be the equivalents of the X flags
|
||||
|
||||
XValue, YValue, WidthValue, HeightValue, XNegative, or YNegative
|
||||
|
||||
( You'd have to extend gdk_window_set_hints to accept the
|
||||
window gravity option to get it right. )
|
||||
|
||||
* Text/Edit widget: (some of these might be bugs that should be fixed now)
|
||||
|
||||
Bugs:
|
||||
|
||||
- Who knows?
|
||||
|
||||
Improvements:
|
||||
|
||||
- Unify the key binding support in some fashion between the
|
||||
Entry and Text widget widgets (???)
|
||||
|
||||
- Figure out a way not to recompute the geometry on insertions/deletions
|
||||
which are large, but not a significant fraction of the
|
||||
entire text. (e.g., compute the changes as when the widget
|
||||
is not frozen, but without the actual scrolling)
|
||||
|
||||
- Prune the line start cache. But since it is only 68 bytes
|
||||
per line, and it is a lot faster when lines are in the cache,
|
||||
it may be better not to, at least for now.
|
||||
|
||||
- Show the non-editable state by changing colors. (Use the
|
||||
style entries for insensitive?)
|
||||
|
||||
- Multibyte support for the Text widget.
|
||||
|
||||
- Unicode support to do the multi-byte right.
|
||||
|
||||
- Support an .inputrc. (The readline one doesn't really work,
|
||||
unless it is extended because it can't represent X keysyms,
|
||||
just terminal type input)
|
||||
|
||||
- A vi mode
|
||||
|
||||
- Word wrap, instead of line folding. (Should the continuation
|
||||
characters be shown?)
|
||||
|
||||
- Horizontal scrolling
|
||||
|
||||
- Disable pasting compound text
|
||||
|
||||
- When showing background pixmap (not editable) actually set
|
||||
the background pixmap as the windows bg pixmap, to improve
|
||||
appearance on exposes. But this would require using another
|
||||
window to get the origins.
|
||||
|
||||
? Allow moving the separator for paned widgets by dragging
|
||||
it directly instead of using the handle.
|
||||
|
||||
? Mark public use of gtk_tree_remove_item as deprecated - it should be used
|
||||
as:
|
||||
gtk_container_remove (GTK_CONTAINER(tree), widget);
|
||||
|
||||
* Standardize that all strings should be passed as gchar *, not
|
||||
guchar *. But what about non-string data? (gdk_property_change,
|
||||
gtk_selection_data_set) X makes these sort of things guchar...
|
||||
|
||||
* Check into XAddConnectionWatch - is this needed for XIM?
|
||||
|
||||
* Places where a _full variant is needed:
|
||||
|
||||
gtk_clist_set_row_data
|
||||
gtk_init_add
|
||||
gtk_menu_popup
|
||||
gtk_toolbar_prepend_element
|
||||
gtk_toolbar_insert_element
|
||||
gtk_widget_dnd_data_set (should be guchar * with a copy?
|
||||
shouldn't be there at all...)
|
||||
??? GtkDrawingarea.draw_data
|
||||
|
||||
* gtk_rc_add_[name/class]_style are broken for bg pixmaps, because
|
||||
styles are broken for bg pixmaps, and RC styles only hack around
|
||||
that.
|
||||
|
||||
* Try to rationally deal with someone else deleting one of our
|
||||
windows??? This would mean keeping track of our window heirarchy
|
||||
ourselves, for one thing, and will never be safe, because of
|
||||
race conditions.
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
#undef XINPUT_GXI
|
||||
#undef XINPUT_XFREE
|
||||
|
||||
#undef GTK_MAJOR_VERSION
|
||||
#undef GTK_MINOR_VERSION
|
||||
#undef GTK_MICRO_VERSION
|
||||
#undef GTK_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
|
||||
395
aclocal.m4
vendored
395
aclocal.m4
vendored
@@ -1,395 +0,0 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.2
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AM_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
|
||||
AM_SANITY_CHECK
|
||||
AC_ARG_PROGRAM
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_PROG_MAKE_SET])
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
||||
AC_SUBST(INSTALL_SCRIPT)dnl
|
||||
])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "$@" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
|
||||
# serial 17 AM_PROG_LIBTOOL
|
||||
AC_DEFUN(AM_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_PROG_RANLIB])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AM_PROG_LD])
|
||||
AC_REQUIRE([AM_PROG_NM])
|
||||
AC_REQUIRE([AC_PROG_LN_S])
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)
|
||||
|
||||
dnl Allow the --disable-shared flag to stop us from building shared libs.
|
||||
AC_ARG_ENABLE(shared,
|
||||
[ --enable-shared build shared libraries [default=yes]],
|
||||
[if test "$enableval" = no; then
|
||||
libtool_enable_shared=no
|
||||
else
|
||||
libtool_enable_shared=yes
|
||||
fi])
|
||||
test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
|
||||
libtool_shared=
|
||||
test "$enable_shared" = no && libtool_shared=" --disable-shared"
|
||||
|
||||
dnl Allow the --disable-static flag to stop us from building static libs.
|
||||
AC_ARG_ENABLE(static,
|
||||
[ --enable-static build static libraries [default=yes]],
|
||||
[if test "$enableval" = no; then
|
||||
libtool_enable_static=no
|
||||
else
|
||||
libtool_enable_static=yes
|
||||
fi])
|
||||
test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
|
||||
libtool_static=
|
||||
test "$enable_static" = no && libtool_static=" --disable-static"
|
||||
|
||||
libtool_flags="$libtool_shared$libtool_static"
|
||||
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
[case "$host" in
|
||||
*-*-irix6*)
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
flag_passed=no
|
||||
for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
|
||||
case "$f" in
|
||||
ABI)
|
||||
test -n "$SGI_ABI" && flag_passed=yes
|
||||
if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
|
||||
# Choose the ABI flag according to GCC's specs.
|
||||
if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[ ]-32' >/dev/null; then
|
||||
LD="${LD-ld} -32"
|
||||
else
|
||||
LD="${LD-ld} -n32"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
|
||||
flag_passed=yes
|
||||
LD="${LD-ld} $f"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
;;
|
||||
esac]
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
])
|
||||
|
||||
# AM_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AM_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
/*)
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_SUBST(LD)
|
||||
AM_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AM_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AM_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[case "$NM" in
|
||||
/*)
|
||||
ac_cv_path_NM="$NM" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in /usr/ucb $PATH /bin; do
|
||||
test -z "$ac_dir" && dir=.
|
||||
if test -f $ac_dir/nm; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
else
|
||||
ac_cv_path_NM="$ac_dir/nm"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
;;
|
||||
esac])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||
if test $USE_MAINTAINER_MODE = yes; then
|
||||
MAINT=
|
||||
else
|
||||
MAINT='#M#'
|
||||
fi
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
# @defmac AC_PROG_CC_STDC
|
||||
# @maindex PROG_CC_STDC
|
||||
# @ovindex CC
|
||||
# If the C compiler in not in ANSI C mode by default, try to add an option
|
||||
# to output variable @code{CC} to make it so. This macro tries various
|
||||
# options that select ANSI C on some system or another. It considers the
|
||||
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
|
||||
# handles function prototypes correctly.
|
||||
#
|
||||
# If you use this macro, you should check after calling it whether the C
|
||||
# compiler has been set to accept ANSI C; if not, the shell variable
|
||||
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
||||
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
||||
# program @code{ansi2knr}, which comes with Ghostscript.
|
||||
# @end defmac
|
||||
|
||||
AC_DEFUN(AM_PROG_CC_STDC,
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_BEFORE([$0], [AC_C_INLINE])
|
||||
AC_BEFORE([$0], [AC_C_CONST])
|
||||
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
||||
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
||||
[am_cv_prog_cc_stdc=no
|
||||
ac_save_CC="$CC"
|
||||
# Don't try gcc -ansi; that turns off useful extensions and
|
||||
# breaks some systems' header files.
|
||||
# AIX -qlanglvl=ansi
|
||||
# Ultrix and OSF/1 -std1
|
||||
# HP-UX -Aa -D_HPUX_SOURCE
|
||||
# SVR4 -Xc -D__EXTENSIONS__
|
||||
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
|
||||
do
|
||||
CC="$ac_save_CC $ac_arg"
|
||||
AC_TRY_COMPILE(
|
||||
[#if !defined(__STDC__) || __STDC__ != 1
|
||||
choke me
|
||||
#endif
|
||||
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
], [
|
||||
int test (int i, double x);
|
||||
struct s1 {int (*f) (int a);};
|
||||
struct s2 {int (*f) (double a);};],
|
||||
[am_cv_prog_cc_stdc="$ac_arg"; break])
|
||||
done
|
||||
CC="$ac_save_CC"
|
||||
])
|
||||
if test -z "$am_cv_prog_cc_stdc"; then
|
||||
AC_MSG_RESULT([none needed])
|
||||
else
|
||||
AC_MSG_RESULT($am_cv_prog_cc_stdc)
|
||||
fi
|
||||
case "x$am_cv_prog_cc_stdc" in
|
||||
x|xno) ;;
|
||||
*) CC="$CC $am_cv_prog_cc_stdc" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
52
autogen.sh
Executable file
52
autogen.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
DIE=0
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have autoconf installed to compile GTK+."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have libtool installed to compile GTK+."
|
||||
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have automake installed to compile GTK+."
|
||||
echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(test -d gtk && test -d glib) || {
|
||||
echo "You must run this script in the top-level GTK+ directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
|
||||
for i in glib .
|
||||
do
|
||||
echo processing $i
|
||||
(cd $i; aclocal; automake; autoconf)
|
||||
done
|
||||
./configure "$@"
|
||||
|
||||
echo
|
||||
echo "Now type 'make' to compile GTK+."
|
||||
18
config.h.in
18
config.h.in
@@ -3,6 +3,12 @@
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
@@ -29,8 +35,16 @@
|
||||
#undef XINPUT_GXI
|
||||
#undef XINPUT_XFREE
|
||||
|
||||
#undef GTK_MAJOR_VERSION
|
||||
#undef GTK_MINOR_VERSION
|
||||
#undef GTK_MICRO_VERSION
|
||||
#undef GTK_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* #undef PACKAGE */
|
||||
/* #undef VERSION */
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
100
configure.in
100
configure.in
@@ -1,11 +1,26 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(gdk/gdktypes.h)
|
||||
|
||||
# Save this value here, since automake will set cflags later
|
||||
cflags_set=${CFLAGS+set}
|
||||
|
||||
GTK_MAJOR_VERSION=0
|
||||
GTK_MINOR_VERSION=99
|
||||
GTK_MICRO_VERSION=8
|
||||
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
|
||||
|
||||
# For automake.
|
||||
VERSION=$GTK_VERSION
|
||||
PACKAGE=gtk+
|
||||
|
||||
# Configure glib
|
||||
AC_CONFIG_SUBDIRS(glib)
|
||||
|
||||
# Save this value here, since automake will set cflags later
|
||||
cflags_set=${CFLAGS+set}
|
||||
|
||||
dnl Initialize automake stuff
|
||||
AM_INIT_AUTOMAKE(gtk+, 971109)
|
||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
|
||||
|
||||
# Specify a configuration file
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
@@ -20,19 +35,24 @@ AC_CANONICAL_HOST
|
||||
|
||||
AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
|
||||
echo $enable_shm, enable_shm="yes")
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
|
||||
if eval "test x$enable_debug = xyes"; then
|
||||
DEBUGFLAG="-g"
|
||||
fi)
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
|
||||
AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
|
||||
, enable_ansi=no)
|
||||
AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
|
||||
echo $enable_xim, enable_xim="yes")
|
||||
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
|
||||
|
||||
AC_ARG_WITH(xinput, [ --with-xinput[=no/gxi/xfree] support XInput ])
|
||||
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
|
||||
|
||||
if test -n "$DEBUGFLAG"; then
|
||||
CFLAGS="$DEBUGFLAG"
|
||||
if test "x$enable_debug" = "xyes"; then
|
||||
test "$cflags_set" = set || CFLAGS="-g"
|
||||
CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
|
||||
else
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
if test "x$enable_debug" = "xno"; then
|
||||
CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DGTK_NO_CHECK_CASTS"
|
||||
else
|
||||
CFLAGS="$CFLAGS -DGTK_NO_CHECK_CASTS"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build time sanity check...
|
||||
@@ -44,25 +64,31 @@ AM_PROG_CC_STDC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
if eval "test x$GCC = xyes"; then
|
||||
test `echo "$CFLAGS" | grep "\-Wall" > /dev/null 2> /dev/null`
|
||||
if test ! $?; then
|
||||
if test "x$GCC" = "xyes"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
|
||||
if eval "test x$enable_ansi = xyes"; then
|
||||
test `echo "$CFLAGS" | grep "\-ansi" > /dev/null 2> /dev/null`
|
||||
if test ! $?; then
|
||||
if test "x$enable_ansi" = "xyes"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
fi
|
||||
|
||||
test `echo "$CFLAGS" | grep "\-pedantic" > /dev/null 2> /dev/null`
|
||||
if test ! $?; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -pedantic"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_xim" = "xyes"; then
|
||||
CFLAGS="$CFLAGS -DUSE_XIM"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(GTK_MAJOR_VERSION, $GTK_MAJOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED(GTK_MINOR_VERSION, $GTK_MINOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED(GTK_MICRO_VERSION, $GTK_MICRO_VERSION)
|
||||
AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
|
||||
|
||||
# Find the X11 include and library directories
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
@@ -81,7 +107,7 @@ LDFLAGS="$X_LDFLAGS $X_LIBS"
|
||||
# Check for the X11 library
|
||||
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", no_x11_lib=yes, $X_EXTRA_LIBS)
|
||||
|
||||
if eval "test x$enable_shm = xyes"; then
|
||||
if test "x$enable_shm" = "xyes"; then
|
||||
# Check for the Xext library (needed for XShm extention)
|
||||
AC_CHECK_LIB(Xext, XShmAttach, x_libs="-lXext $x_libs", no_xext_lib=yes, $x_libs)
|
||||
fi
|
||||
@@ -91,28 +117,28 @@ x_ldflags="$X_LDFLAGS $X_LIBS"
|
||||
|
||||
# set up things for XInput
|
||||
|
||||
if eval "test x$with_xinput = xgxi -o x$with_xinput = xyes"; then
|
||||
if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
|
||||
AC_DEFINE(XINPUT_GXI)
|
||||
xinput_progs=gxid
|
||||
x_libs="-lXi $x_libs"
|
||||
elif eval "test x$with_xinput = xxfree"; then
|
||||
elif test "x$with_xinput" = "xxfree"; then
|
||||
AC_DEFINE(XINPUT_XFREE)
|
||||
x_libs="-lXi $x_libs"
|
||||
else
|
||||
AC_DEFINE(XINPUT_NONE)
|
||||
fi
|
||||
|
||||
|
||||
AC_SUBST(x_cflags)
|
||||
AC_SUBST(x_includes)
|
||||
AC_SUBST(x_ldflags)
|
||||
AC_SUBST(x_libs)
|
||||
AC_SUBST(xinput_progs)
|
||||
AC_SUBST(GTK_VERSION)
|
||||
|
||||
CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
if eval "test x$enable_shm = xyes"; then
|
||||
if test "x$enable_shm" = "xyes"; then
|
||||
# Check for shared memory
|
||||
AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
|
||||
AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
|
||||
@@ -151,11 +177,11 @@ if eval "test x$enable_shm = xyes"; then
|
||||
|
||||
# Check for the X shared memory extension header file
|
||||
AC_MSG_CHECKING(X11/extensions/XShm.h)
|
||||
if eval "test x$no_ext_lib = xyes"; then
|
||||
if test "x$no_xext_lib" = "xyes"; then
|
||||
AC_MSG_RESULT(no)
|
||||
no_xshm=yes
|
||||
else
|
||||
if eval "test -f $x_includes/X11/extensions/XShm.h"; then
|
||||
if test -f "$x_includes/X11/extensions/XShm.h"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XSHM_H)
|
||||
else
|
||||
@@ -186,14 +212,37 @@ gtk_cv_display_resource_base="private3")])
|
||||
AC_MSG_RESULT($gtk_cv_display_resource_base)
|
||||
AC_DEFINE_UNQUOTED(RESOURCE_BASE, gdk_display->$gtk_cv_display_resource_base)
|
||||
|
||||
# Check if X_LOCALE definition is necessary
|
||||
|
||||
AC_MSG_CHECKING(need -DX_LOCALE)
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return setlocale (LC_ALL, "${with_locale}") == NULL;
|
||||
}],
|
||||
need_x_locale=no,
|
||||
need_x_locale=yes)
|
||||
AC_MSG_RESULT($need_x_locale)
|
||||
|
||||
if test $need_x_locale = yes; then
|
||||
CFLAGS="$CFLAGS -DX_LOCALE"
|
||||
fi
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
|
||||
# Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_MMAP
|
||||
|
||||
# Check for sys/select.h
|
||||
|
||||
@@ -211,4 +260,5 @@ if test $gtk_ok = no; then
|
||||
AC_DEFINE(NO_FD_SET)
|
||||
fi
|
||||
|
||||
AC_OUTPUT(Makefile gtk+.xconfig docs/Makefile gdk/Makefile gtk/Makefile)
|
||||
AC_OUTPUT([Makefile gtk-config docs/Makefile gdk/Makefile gtk/Makefile],
|
||||
[chmod +x gtk-config])
|
||||
|
||||
@@ -1 +1,18 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.html
|
||||
*.info*
|
||||
*.dvi
|
||||
*.ps
|
||||
*.pg
|
||||
*.ky
|
||||
*.cp
|
||||
*.fn
|
||||
*.tp
|
||||
*.vr
|
||||
*.log
|
||||
*.aux
|
||||
*.toc
|
||||
*.cps
|
||||
*.fns
|
||||
*.vrs
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
info_TEXINFOS = gdk.texi gtk.texi
|
||||
info_TEXINFOS = gdk.texi gtk.texi glib.texi
|
||||
|
||||
EXTRA_DIST = texinfo.tex macros.texi
|
||||
EXTRA_DIST = \
|
||||
texinfo.tex \
|
||||
macros.texi \
|
||||
Makefile.sgml \
|
||||
gtkdocs_fix \
|
||||
gtkfaq.sgml \
|
||||
gtk-config.txt \
|
||||
gtk_tut.sgml \
|
||||
gtk_tut_it.sgml \
|
||||
debugging.txt \
|
||||
developers.txt \
|
||||
refcounting.txt \
|
||||
styles.txt \
|
||||
text_widget.txt \
|
||||
widget_system.txt \
|
||||
gtk_tut_packbox1.gif \
|
||||
gtk_tut_packbox2.gif \
|
||||
gtk_tut_table.gif
|
||||
|
||||
|
||||
|
||||
files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
|
||||
294
docs/Makefile.in
Normal file
294
docs/Makefile.in
Normal file
@@ -0,0 +1,294 @@
|
||||
# Makefile.in generated automatically by automake 1.2c from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = true
|
||||
PRE_INSTALL = true
|
||||
POST_INSTALL = true
|
||||
NORMAL_UNINSTALL = true
|
||||
PRE_UNINSTALL = true
|
||||
POST_UNINSTALL = true
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
LD = @LD@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
x_cflags = @x_cflags@
|
||||
x_includes = @x_includes@
|
||||
x_ldflags = @x_ldflags@
|
||||
x_libs = @x_libs@
|
||||
xinput_progs = @xinput_progs@
|
||||
|
||||
info_TEXINFOS = gdk.texi gtk.texi
|
||||
|
||||
EXTRA_DIST = texinfo.tex macros.texi Makefile.gtkfaq gtkfaq.sgml gtkfaq_fix
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
||||
INFO_DEPS = gdk.info gtk.info
|
||||
DVIS = gdk.dvi gtk.dvi
|
||||
TEXINFOS = gdk.texi gtk.texi
|
||||
DIST_COMMON = Makefile.am Makefile.in texinfo.tex
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
gdk.info: gdk.texi
|
||||
gdk.dvi: gdk.texi
|
||||
|
||||
|
||||
gtk.info: gtk.texi
|
||||
gtk.dvi: gtk.texi
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
.texi.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.texi:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
d=$(srcdir); \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
uninstall-info:
|
||||
$(PRE_UNINSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
ii=yes; \
|
||||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
|
||||
done
|
||||
$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
for base in $(INFO_DEPS); do \
|
||||
d=$(srcdir); \
|
||||
for file in `cd $$d && eval echo $$base*`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done; \
|
||||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -f gdk.aux gdk.cp gdk.cps gdk.dvi gdk.fn gdk.fns gdk.ky gdk.kys \
|
||||
gdk.ps gdk.log gdk.pg gdk.toc gdk.tp gdk.tps gdk.vr gdk.vrs \
|
||||
gdk.op gdk.tr gdk.cv gdk.cn gtk.aux gtk.cp gtk.cps gtk.dvi \
|
||||
gtk.fn gtk.fns gtk.ky gtk.kys gtk.ps gtk.log gtk.pg gtk.toc \
|
||||
gtk.tp gtk.tps gtk.vr gtk.vrs gtk.op gtk.tr gtk.cv gtk.cn
|
||||
|
||||
clean-aminfo:
|
||||
|
||||
distclean-aminfo:
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
for i in $(INFO_DEPS); do \
|
||||
rm -f $$i; \
|
||||
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
|
||||
rm -f $$i-[0-9]*; \
|
||||
fi; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = docs
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu docs/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
info: $(INFO_DEPS)
|
||||
dvi: $(DVIS)
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-info-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-info
|
||||
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-aminfo mostlyclean-generic
|
||||
|
||||
clean: clean-aminfo clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-aminfo distclean-generic clean
|
||||
-rm -f config.status
|
||||
-rm -f libtool
|
||||
|
||||
maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
|
||||
distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
|
||||
distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
|
||||
dvi installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
echo $$p; \
|
||||
done
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
23
docs/Makefile.sgml
Normal file
23
docs/Makefile.sgml
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# To use this makefile, do:
|
||||
# make -f Makefile.gtkfaq
|
||||
#
|
||||
# This is not done by default because you might
|
||||
# not have sgml2html installed... Perhaps we could
|
||||
# detect that in the future and combine it in with
|
||||
# the automake stuff...
|
||||
#
|
||||
|
||||
all: html
|
||||
|
||||
html: faq tut italian_tut
|
||||
perl gtkdocs_fix gtkfaq*.html gtk_tut*.html
|
||||
|
||||
faq:
|
||||
sgml2html gtkfaq.sgml
|
||||
|
||||
tut:
|
||||
sgml2html gtk_tut.sgml
|
||||
|
||||
italian_tut:
|
||||
sgml2html gtk_tut_it.sgml
|
||||
98
docs/debugging.txt
Normal file
98
docs/debugging.txt
Normal file
@@ -0,0 +1,98 @@
|
||||
The GLIB, GDK, and GTK libraries have extensive support for
|
||||
debugging the library and your programs.
|
||||
|
||||
The amount of debugging being done can be determined both
|
||||
at run time and compile time.
|
||||
|
||||
COMPILE TIME OPTIONS
|
||||
--------------------
|
||||
|
||||
At compile time, the amount of debugging support included is
|
||||
determined by four macros:
|
||||
|
||||
G_ENABLE_DEBUG
|
||||
If set, enable support for runtime checking.
|
||||
|
||||
G_DISABLE_ASSERT
|
||||
If set, disable g_assert macros
|
||||
|
||||
G_DISABLE_CHECKS
|
||||
If set, disable the g_return_if_fail and g_return_val_if_fail macros
|
||||
|
||||
GTK_NO_CHECK_CASTS
|
||||
If set, don't check casts between different object types
|
||||
|
||||
|
||||
Whether these macros are defined is controlled at configuration
|
||||
time by the --enable-debug option.
|
||||
|
||||
--enable-debug=minimum [default]
|
||||
Enable only inexpensive sanity checking
|
||||
sets GTK_NO_CHECK_CASTS
|
||||
|
||||
--enable-debug=yes
|
||||
Enable all debugging support
|
||||
sets G_ENABLE_DEBUG
|
||||
|
||||
--enable-debug=no (or --disable-debug)
|
||||
Disable all debugging support (fastest)
|
||||
sets G_DISABLE_ASSERT, G_DISABLE_CHECKS, and GTK_NO_CHECK_CASTS
|
||||
|
||||
|
||||
RUN TIME OPTIONS
|
||||
----------------
|
||||
|
||||
At run time, if GTK+ was compiled with debugging enabled, different
|
||||
types of debugging information can be printed out. This is controlled
|
||||
by the:
|
||||
|
||||
GTK_DEBUG and GDK_DEBUG environment variables
|
||||
--gtk-debug and --gdk-debug command line options
|
||||
--gtk-no-debug and --gdk-no-debug command line options
|
||||
|
||||
First the environment variables are applied, then the command line
|
||||
options are applied in the order given on the command line.
|
||||
|
||||
Each of these can either be the special value ALL, or a sequence of
|
||||
':' separated options. (Note, case is significant). The environment
|
||||
variables and the --gtk-debug and --gdk-debug options add debugging
|
||||
options and the --gtk-no-debug and --gdk-no-debug options remove
|
||||
them.
|
||||
|
||||
As noted below, some of these are useful in application debugging, but
|
||||
most are only interested to those debugging the libraries
|
||||
|
||||
For instance:
|
||||
|
||||
GDK_DEBUG_FLAGS=misc:dnd testgtk --gdk-no-debug dnd --gdk-debug events
|
||||
|
||||
runs testgtk with the 'misc' and 'events' debugging options.
|
||||
|
||||
GTK_DEBUG
|
||||
---------
|
||||
|
||||
Application relevant options:
|
||||
|
||||
'objects' - Trace the creation and destruction of objects, print
|
||||
out a summary at program termination
|
||||
|
||||
Options only interesting to library maintainers:
|
||||
|
||||
GDK_DEBUG
|
||||
---------
|
||||
|
||||
Application relevant options:
|
||||
|
||||
'events' - Show all events received by GTK
|
||||
|
||||
Options only interesting to library maintainers:
|
||||
|
||||
'misc' - Miscellaneous information
|
||||
'dnd' - Information about drag-and-drop
|
||||
'color-context' - Information about the internal workings of
|
||||
GdkColorContext
|
||||
'xim' - Information about X Input Method support
|
||||
|
||||
|
||||
- Owen Taylor <owt1@cornell.edu>
|
||||
98/02/19
|
||||
69
docs/developers.txt
Normal file
69
docs/developers.txt
Normal file
@@ -0,0 +1,69 @@
|
||||
Things to care about when using/programing for GTK+
|
||||
===================================================
|
||||
|
||||
This file is meant to collect some frequently triggered failures when
|
||||
programming for/with Gtk, having the spirit of a developers FAQ.
|
||||
It is also the correct place to list up things that programmers should
|
||||
care about in general.
|
||||
|
||||
In the hope that this text might be usefull to someone,
|
||||
|
||||
- Tim Janik <timj@gimp.org>
|
||||
1998/02/11
|
||||
|
||||
|
||||
Automatic destruction of widgets on removal from parent
|
||||
-------------------------------------------------------
|
||||
|
||||
This is a reference counting issue, you would want to refer
|
||||
to refcounting.txt on it.
|
||||
|
||||
|
||||
What are all the widget flags about?
|
||||
------------------------------------
|
||||
|
||||
Refer to the file widget_system.txt which covers widget flags and the
|
||||
resulting invariants in a detailed way.
|
||||
|
||||
|
||||
GdkWindow pointers may be NULL in GdkEvents
|
||||
-------------------------------------------
|
||||
|
||||
The notification nature of the signal mechanism might cause events to
|
||||
be emitted that have their GdkWindow pointer set to NULL.
|
||||
This is due to the fact that certain events need to be emitted after the
|
||||
real GdkWindow of a widget is not any longer pertinent.
|
||||
It's up to the signal handling function (application) to check for the
|
||||
window field of the event structure to be != NULL, if it is going to
|
||||
perform any operations through Gdk calls on it.
|
||||
Events that a likely to trigger a missing check for the window pointer
|
||||
currently are (and correspond to the trailing signals):
|
||||
|
||||
GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
|
||||
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
|
||||
GtkWidget::focus_out_event
|
||||
|
||||
Events that are asured to have a valid GdkEvent.any.window field are
|
||||
|
||||
GDK_EXPOSE GtkWidget::expose_event
|
||||
|
||||
|
||||
gtk_widget_ref() vs. gtk_object_ref()
|
||||
-------------------------------------
|
||||
|
||||
The widget referencing functions gtk_widget_ref() and gtk_widget_unref()
|
||||
are currently just wrappers about the corresponding referencing functions
|
||||
for objects. Still you should use the widget referencing functions if you
|
||||
are sure the referenced object is of type GTK_WIDGET_TYPE.
|
||||
|
||||
|
||||
Writing Gdk functions
|
||||
---------------------
|
||||
|
||||
When writing Gdk functions that operate on GdkWindow structures in any
|
||||
maeningfull sense, that is casting to a GdkWindowPrivate structure for
|
||||
access to fields other then GdkWindow.user_data, the programmer is
|
||||
recommended to check for the GdkWindowPrivate.destroyed field to be ==
|
||||
FALSE, especially if the GdkWindowPrivate.xwindow field is used.
|
||||
Silent abortion of the Gdk function is the correct behaviour if this
|
||||
condition isn't met.
|
||||
913
docs/faq/gtkfaq.sgml
Normal file
913
docs/faq/gtkfaq.sgml
Normal file
@@ -0,0 +1,913 @@
|
||||
<!doctype linuxdoc system>
|
||||
|
||||
<article>
|
||||
|
||||
<!-- Title information -->
|
||||
|
||||
<title>GTK+ FAQ
|
||||
|
||||
<!-- NOTE: Use only one author tag, otherwise sgml2txt barfs - TRG -->
|
||||
<author>Nathan Froyd, Tony Gale, Shawn T. Amundson.
|
||||
<date>March 13th 1998
|
||||
<abstract>
|
||||
This document is intended to answer questions that are likely to be
|
||||
frequently asked by programmers using GTK+ or people who are just
|
||||
looking at using GTK+.
|
||||
</abstract>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<toc>
|
||||
|
||||
<!-- Begin the document -->
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>General Information
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Authors
|
||||
<p>
|
||||
The authors of GTK+ are:
|
||||
|
||||
<itemize>
|
||||
<item>Peter Mattis (petm@xcf.berkeley.edu)
|
||||
<item>Spencer Kimball (spencer@xcf.berkeley.edu)
|
||||
<item>Josh MacDonald (jmacd@xcf.berkeley.edu)
|
||||
</itemize>
|
||||
GTK+ is distributed under the GNU Library General Public License
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is GTK+?
|
||||
<p>
|
||||
GTK+ is a small and efficient widget set designed with the general look
|
||||
and feel of Motif. In reality, it looks much better than Motif. It
|
||||
contains common widgets and some more complex widgets such as a file
|
||||
selection, and color selection widgets.
|
||||
|
||||
GTK+ provides some unique features. (At least, I know of no other widget
|
||||
library which provides them). For
|
||||
example, a button does not contain a label, it contains a child widget,
|
||||
which in most instances will be a label.
|
||||
However, the child widget can also be a pixmap, image or any combination
|
||||
possible the programmer desires.
|
||||
This flexibility is adhered to throughout the library.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is the + in GTK+?
|
||||
<P>
|
||||
Peter Mattis informed the gtk mailing list that:
|
||||
<quote>
|
||||
"I originally wrote gtk which included the three libraries, libglib,
|
||||
libgdk and libgtk. It featured a flat widget hierarchy. That is, you
|
||||
couldn't derive a new widget from an existing one. And it contained
|
||||
a more standard callback mechanism instead of the signal mechanism now
|
||||
present in gtk+. The + was added to distinguish between the original
|
||||
version of gtk and the new version. You can think of it as being an
|
||||
enhancement to the original gtk that adds object oriented features."
|
||||
</quote>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Does the G in GTK+ stand for General, Gimp, or GNU?
|
||||
<p>
|
||||
Peter Mattis informed the gtk mailing list that:
|
||||
<quote>
|
||||
"I think the last time Spencer and I talked about it we decided on
|
||||
GTK = Gimp ToolKit. But I don't know for sure. Its definately not
|
||||
GNU, though."
|
||||
</quote>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Where is the documentation for GTK+?
|
||||
<p>
|
||||
In the GTK+ distribution's doc/ directory you will find the
|
||||
reference material for both GTK and GDK, this FAQ and the
|
||||
GTK Tutorial.
|
||||
|
||||
In addition, you can find links to HTML versions of these documents
|
||||
by going to
|
||||
<htmlurl url="http://www.gtk.org/"
|
||||
name="http://www.gtk.org/">.
|
||||
|
||||
The Tutorial and FAQ can also be found at
|
||||
<htmlurl url="http://www.geocities.com/ResearchTriangle/Lab/4299/"
|
||||
name="http://www.geocities.com/ResearchTriangle/Lab/4299/">.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is there a mailing list (or mailing list archive) for GTK+?
|
||||
<p>
|
||||
There are two mailing lists:
|
||||
<itemize>
|
||||
<item>A mailing list for discussion of development of GTK based applications
|
||||
is hosted at gtk-app-devel-list@redhat.com. To subscribe send an
|
||||
email message to <htmlurl url="mailto:gtk-app-devel-list-request@redhat.com"
|
||||
name="gtk-app-devel-list-request@redhat.com">
|
||||
with <em>subscribe</em> in the <bf>subject</bf>.
|
||||
<p>
|
||||
<item>A mailing list for discussion of development of GTK is hosted
|
||||
at gtk-list@redhat.com. To subscribe send an
|
||||
email message to <htmlurl url="mailto:gtk-list-request@redhat.com"
|
||||
name="gtk-list-request@redhat.com">
|
||||
with <em>subscribe</em> in the <bf>subject</bf>.
|
||||
<p>
|
||||
A searchable archive of the mailing list can be found at <htmlurl url="http://archive.redhat.com/gtk-list" name="http://archive.redhat.com/gtk-list">
|
||||
</itemize>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>The gtk-list hasn't had any traffic for days, is it dead?
|
||||
<p>
|
||||
No, everyone's just busy coding.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How to get help with GTK+
|
||||
<p>
|
||||
First, make sure your question isn't answered in the documentation, this
|
||||
FAQ or the tutorial. Done that? You're sure you've done that, right? In
|
||||
that case, the best place to post questions is to the GTK+ mailing list.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How to report bugs in GTK+
|
||||
<p>
|
||||
Bug reports should be sent to the GTK+ mailing list.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What applications have been written with GTK+?
|
||||
<p>
|
||||
Some applications which use GTK+ are:
|
||||
<itemize>
|
||||
<item>GIMP (<htmlurl url="http://www.XCF.Berkeley.EDU/~gimp/"
|
||||
name="http://www.XCF.Berkeley.EDU/~gimp/"> ),
|
||||
an image manipulation program
|
||||
<item>Gsumi (<htmlurl url="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html"
|
||||
name="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html">),
|
||||
a fun B+W doodling program with XInput support.
|
||||
<item>GUBI (<htmlurl url="http://www.SoftHome.net/pub/users/timj/gubi/index.htm"
|
||||
name="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">),
|
||||
a user interface builder
|
||||
<item>Gzilla (<htmlurl url="http://www.levien.com/gzilla/" name="http://www.levien.com/gzilla/">),
|
||||
a web browser
|
||||
<item>SANE (<htmlurl url="http://www.azstarnet.com/~axplinux/sane/" name="http://www.azstarnet.com/~axplinux/sane/"> ),
|
||||
a universal scanner interface
|
||||
<item>XQF (<htmlurl url="http://www.botik.ru/~roma/quake/" name="http://www.botik.ru/~roma/quake/">),
|
||||
a QuakeWorld/Quake2 server browser and launcher
|
||||
<item>ElectricEyes (<htmlurl url="http://www.labs.redhat.com/ee.shtml" name="http://www.labs.redhat.com/ee.shtml">),
|
||||
an image viewer that aims to be a free replacement for xv
|
||||
<item>GPK - the General Proxy Kit (<htmlurl url="http://www.humanfactor.com/gpk/" name="http://www.humanfactor.com/gpk/">),
|
||||
an add-on library to permit thread-safe access to GTK+
|
||||
<item>GCK - the General Convenience Kit (<htmlurl url="http://www.ii.uib.no/~tomb/gck.html" name="http://www.ii.uib.no/~tomb/gck.html">),
|
||||
miscellaneous functions intended to ease color handling, UI construction,
|
||||
vector operations, and math functions
|
||||
<item>GDK Imlib (<htmlurl url="http://www.labs.redhat.com/imlib/" name="http://www.labs.redhat.com/imlib/">),
|
||||
a fast image loading and manipulation library for GDK
|
||||
</itemize>
|
||||
<p>
|
||||
In addition to the above, the GNOME project (<htmlurl url="http://www.gnome.org"
|
||||
name="http://www.gnome.org">)
|
||||
is using GTK+ to build a free desktop for Linux. Many more programs can be found
|
||||
there.
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>How to find, configure, install, and troubleshoot GTK+
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What do I need to run GTK+?
|
||||
<p>
|
||||
To compile GTK+, all you need is a C compiler (gcc) and the X Window System
|
||||
and associated libraries on your system.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Where can I get GTK+?
|
||||
<p>
|
||||
The canonical site is:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
</verb>
|
||||
Of course, any mirrors of ftp.gtk.org should have the latest version, too.
|
||||
|
||||
<sect1>How do I configure/compile GTK+?
|
||||
<p>
|
||||
Generally, all you will need to do is issue the commands:
|
||||
<verb>
|
||||
./configure
|
||||
make
|
||||
</verb>
|
||||
in the gtk+-version/ directory.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>When compiling GTK+ I get an error like:
|
||||
<tt/make: file `Makefile' line 456: Syntax error/
|
||||
<p>
|
||||
Make sure that you are using GNU make (use <tt/make -v/ to check). There are
|
||||
many weird and wonderful versions of make out there, and not all of them
|
||||
handle the automatically generated Makefiles.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
|
||||
<sect1>I've compiled and installed GTK+, but I can't get any programs to link
|
||||
with it!
|
||||
<p>
|
||||
This problem is most often encountered when the GTK+ libraries can't be
|
||||
found or are the wrong version. Generally, the compiler will complain about an
|
||||
'unresolved symbol'. There are two things you need to check:
|
||||
<itemize>
|
||||
<item>Make sure that the libraries can be found. You want to edit
|
||||
/etc/ld.so.conf to include /usr/local/lib (or whereever you installed GTK+),
|
||||
so it looks something like:
|
||||
<verb>
|
||||
/usr/X11R6/lib
|
||||
/usr/local/lib
|
||||
</verb>
|
||||
Then you need to run /sbin/ldconfig as root.
|
||||
<p>
|
||||
<item>Make sure the linker is finding the correct set of libraries. If you
|
||||
have a Linux distribution that installs GTK+ (e.g. RedHat 5.0) then this
|
||||
older version may be used. Now (assuming you have a RedHat
|
||||
system), issue the command
|
||||
<verb>
|
||||
rpm -e gtk gtk-devel
|
||||
</verb>
|
||||
You may also want to remove the packages that depend on gtk (rpm will tell you
|
||||
which ones they are). If you don't have a RedHat Linux system, check to make sure
|
||||
that neither <verb>/usr/lib</verb> or <verb>/usr/local/lib</verb> contain any of
|
||||
the libraries libgtk, libgdk, libglib, or libgck. If they do exist, remove them
|
||||
(and any gtk include files, such as /usr/include/gtk and /usr/include/gdk)
|
||||
and reinstall gtk+.
|
||||
</itemize>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>Development of GTK+
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Whats this CVS thing that everyone keeps talking about, and how do I access it?
|
||||
<p>
|
||||
CVS is the Concurent Version System and is a very popular mean of
|
||||
version control for software projects. It is designed to allow multiple
|
||||
authors to be able to simultanously operate on the same source tree.
|
||||
This source tree is centrally maintained, but each developer has a
|
||||
local mirror of this repository that they make there changes to.
|
||||
|
||||
The GTK+ developers use a CVS repository to store the master copy of
|
||||
the current development version of GTK+. As such, people wishing to
|
||||
contribute patches to GTK+ should generate them against the CVS version.
|
||||
Normal people should use the packaged releases.
|
||||
|
||||
The CVS toolset is available as RPM packages from the usual RedHat sites.
|
||||
The latest version is available at
|
||||
<htmlurl url="http://download.cyclic.com/pub/"
|
||||
name="<http://download.cyclic.com/pub/>">
|
||||
|
||||
Anyone can download the latest CVS version of GTK+ by using anonymous access
|
||||
using the following steps:
|
||||
<itemize>
|
||||
<item> In a bourne shell descendant (e.g. bash) type:
|
||||
<verb>
|
||||
export CVSROOT=':pserver:anonymous@cvs.gimp.org:/debian/home/gnomecvs'
|
||||
</verb>
|
||||
<item>Next, the first time the source tree is checked out, a cvs login
|
||||
is needed.
|
||||
<verb>
|
||||
cvs login
|
||||
</verb>
|
||||
This will ask you for a password. There is no password for cvs.gimp.org,
|
||||
so just enter a carriage return.
|
||||
<item>To get the tree and place it in a subdir of your current working directory, issue the command:
|
||||
<verb>
|
||||
cvs -z9 get gtk+
|
||||
</verb>
|
||||
</itemize>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I contribute to GTK+?
|
||||
<p>
|
||||
It's simple. If something doesn't work like you think it should in a program,
|
||||
check the documentation to make sure you're not missing something. If it is a
|
||||
true bug or missing feature, track it down in the GTK+ source, change it,
|
||||
and then generate a patch in the form of a 'context diff'. This can be done
|
||||
using a command such as <tt/diff -ru <oldfile> <newfile>/.
|
||||
Then upload the patchfile to:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/incoming
|
||||
</verb>
|
||||
along with a README file. Make sure you follow the naming conventions or your
|
||||
patch will just be deleted! The filenames should be of this form:
|
||||
<verb>
|
||||
gtk-<username>-<date yymmdd-n>.patch.gz
|
||||
gtk-<username>-<date yymmdd-n>.patch.README
|
||||
</verb>
|
||||
The "n" in the date indicates a unique number (starting from 0)
|
||||
of patches you uploaded that day. It should be 0, unless you
|
||||
upload more than one patch in the same day.
|
||||
|
||||
Example:
|
||||
<verb>
|
||||
gtk-gale-982701-0.patch.gz
|
||||
gtk-gale-982701-0.patch.README
|
||||
</verb>
|
||||
Once you upload <em>anything</em>, send the README to ftp-admin@gtk.org
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I know if my patch got applied, and if not, why not?
|
||||
<p>
|
||||
Uploaded patches will be moved to <tt>ftp://ftp.gtk.org/pub/gtk/patches</tt>
|
||||
where one of the GTK+ development team will pick them up. If applied, they
|
||||
will be moved to <tt>/pub/gtk/patches/old</tt>.
|
||||
|
||||
Patches that aren't applied, for whatever reason, are moved to
|
||||
<tt>/pub/gtk/patches/unapplied</tt> or <tt>/pub/gtk/patches/outdated</tt>.
|
||||
At this point you can ask on the <tt/gtk-list/ mailing list why your patch
|
||||
wasn't applied. There are many possible reasons why patches may not be
|
||||
applied, ranging from it doesn't apply cleanly, to it isn't right. Don't
|
||||
be put off if your patch didn't make it first time round.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is the policy on incorporating new widgets into the library?
|
||||
<p>
|
||||
This is up to the authors, so you will have to ask them once you
|
||||
are done with your widget. As a general guideline, widgets that are
|
||||
generally useful, work, and are not a disgrace to the widget set will
|
||||
gladly be included.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is anyone working on bindings for languages other than C?
|
||||
<p>
|
||||
Yes. There is
|
||||
<itemize>
|
||||
<item>a C++ wrapper for GTK+ called gtk--. You can find the home page at:
|
||||
<verb>
|
||||
http://www.cs.tut.fi/~p150650/gtk/gtk--.html
|
||||
</verb>
|
||||
The FTP site is:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/gtk--/
|
||||
</verb>
|
||||
<p>
|
||||
|
||||
<item>There are two Objective-c bindings currently in development:
|
||||
|
||||
<itemize>
|
||||
|
||||
<item>The <htmlurl url="http://www.gnome.org/" name="GNOME project's"> package
|
||||
of choice is obgtk. Objgtk is based on the Object class and is maintained by
|
||||
<htmlurl url="mailto:sopwith@cuc.edu" name="Elliot Lee">. Apparently, objgtk
|
||||
is being accepted as the `standard' Objective-C binding for GTK+.
|
||||
|
||||
<item>If you are more inclined towards the
|
||||
<htmlurl url="http://www.gnustep.org/" name="GNUstep project">,
|
||||
you may want to check out GTKKit by
|
||||
<htmlurl url="mailto:helge@mdlink.de" name="Helge Heß">.
|
||||
The intention is to setup a GTK+ binding using the FoundationKit.
|
||||
GTKKit includes nicities like writing a XML-type template file to
|
||||
construct a GTK+ interface.
|
||||
|
||||
</itemize>
|
||||
<p>
|
||||
<item>Perl bindings
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/perl
|
||||
</verb>
|
||||
|
||||
<item>Guile bindings. The home page is at:
|
||||
<verb>
|
||||
http://www.ping.de/sites/zagadka/guile-gtk/
|
||||
</verb>
|
||||
By the way, Guile is the GNU Project's implemention of R4RS Scheme (the
|
||||
standard). If you like Scheme, you may want to take a look at this.
|
||||
<p>
|
||||
|
||||
<item>David Monniaux reports:
|
||||
<quote>I've started a gtk-O'Caml binding system.
|
||||
The basics of the system, including callbacks, work fine.
|
||||
|
||||
The current development is in
|
||||
http://www.ens-lyon.fr/~dmonniau/arcs/
|
||||
</quote>
|
||||
|
||||
<item>
|
||||
Several python-gtk interfaces have been done. python-gtk is at:
|
||||
<verb>
|
||||
http://www.acs.ucalgary.cs/~nashceme/python-gtk/
|
||||
</verb>
|
||||
If you try python-gtk and don't like it, there's also pygtk located at:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/python/
|
||||
</verb>
|
||||
|
||||
<item>
|
||||
There's a OpenGL/Mesa widget available for GTK+. Grab it at:
|
||||
<verb>
|
||||
http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html
|
||||
</verb>
|
||||
|
||||
</itemize>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>Development with GTK+
|
||||
<!-- ***************************************************************** -->
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I get started?
|
||||
<p>
|
||||
So, after you have installed GTK+ there are a couple of things that can
|
||||
ease you into developing applications with it. There is the
|
||||
GTK+ Tutorial <htmlurl url="http://www.gtk.org/tutorial/"
|
||||
name="<http://www.gtk.org/tutorial/>">, which is undergoing
|
||||
development. This will introduce you to writing applications using C.
|
||||
|
||||
The Tutorial doesn't (yet) contain information on all of the widgets
|
||||
that are in GTK+. For example code on how to use the basics of all the
|
||||
GTK+ widgets you should look at the file gtk/testgtk.c (and associated
|
||||
source files) within the GTK+ distribution. Looking at these exmaples will
|
||||
give you a good grounding on what the widgets can do.
|
||||
|
||||
<sect1>What widgets are in GTK?
|
||||
<p>
|
||||
The GTK+ Tutorial lists the following widgets:
|
||||
<verb>
|
||||
GtkObject
|
||||
+GtkData
|
||||
| +GtkAdjustment
|
||||
| `GtkTooltips
|
||||
`GtkWidget
|
||||
+GtkContainer
|
||||
| +GtkBin
|
||||
| | +GtkAlignment
|
||||
| | +GtkEventBox
|
||||
| | +GtkFrame
|
||||
| | | `GtkAspectFrame
|
||||
| | +GtkHandleBox
|
||||
| | +GtkItem
|
||||
| | | +GtkListItem
|
||||
| | | +GtkMenuItem
|
||||
| | | | `GtkCheckMenuItem
|
||||
| | | | `GtkRadioMenuItem
|
||||
| | | `GtkTreeItem
|
||||
| | +GtkViewport
|
||||
| | `GtkWindow
|
||||
| | +GtkColorSelectionDialog
|
||||
| | +GtkDialog
|
||||
| | | `GtkInputDialog
|
||||
| | `GtkFileSelection
|
||||
| +GtkBox
|
||||
| | +GtkButtonBox
|
||||
| | | +GtkHButtonBox
|
||||
| | | `GtkVButtonBox
|
||||
| | +GtkHBox
|
||||
| | | +GtkCombo
|
||||
| | | `GtkStatusbar
|
||||
| | `GtkVBox
|
||||
| | +GtkColorSelection
|
||||
| | `GtkGammaCurve
|
||||
| +GtkButton
|
||||
| | +GtkOptionMenu
|
||||
| | `GtkToggleButton
|
||||
| | `GtkCheckButton
|
||||
| | `GtkRadioButton
|
||||
| +GtkCList
|
||||
| +GtkFixed
|
||||
| +GtkList
|
||||
| +GtkMenuShell
|
||||
| | +GtkMenuBar
|
||||
| | `GtkMenu
|
||||
| +GtkNotebook
|
||||
| +GtkPaned
|
||||
| | +GtkHPaned
|
||||
| | `GtkVPaned
|
||||
| +GtkScrolledWindow
|
||||
| +GtkTable
|
||||
| +GtkToolbar
|
||||
| `GtkTree
|
||||
+GtkDrawingArea
|
||||
| `GtkCurve
|
||||
+GtkEditable
|
||||
| +GtkEntry
|
||||
| | `GtkSpinButton
|
||||
| `GtkText
|
||||
+GtkMisc
|
||||
| +GtkArrow
|
||||
| +GtkImage
|
||||
| +GtkLabel
|
||||
| | `GtkTipsQuery
|
||||
| `GtkPixmap
|
||||
+GtkPreview
|
||||
+GtkProgressBar
|
||||
+GtkRange
|
||||
| +GtkScale
|
||||
| | +GtkHScale
|
||||
| | `GtkVScale
|
||||
| `GtkScrollbar
|
||||
| +GtkHScrollbar
|
||||
| `GtkVScrollbar
|
||||
+GtkRuler
|
||||
| +GtkHRuler
|
||||
| `GtkVRuler
|
||||
`GtkSeparator
|
||||
+GtkHSeparator
|
||||
`GtkVSeparator
|
||||
</verb>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I prevent redrawing and resizing while I change multiple widgets?
|
||||
<p>
|
||||
Use gtk_container_disable_resize and gtk_container_enable_resize around the
|
||||
code where you are changing a lot of stuff. This will result in much faster
|
||||
speed since it will prevent resizing of the entire widget hierarchy.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I catch a double click event in a list widget?
|
||||
<p>
|
||||
Tim Janik wrote to gtk-list (slightly modified):
|
||||
|
||||
Define a signal handler:
|
||||
|
||||
<tscreen><verb>
|
||||
gint
|
||||
signal_handler_event(GtkWiget *widget, GdkEvenButton *event, gpointer func_data)
|
||||
{
|
||||
if (GTK_IS_LIST_ITEM(widget) &&
|
||||
(event->type==GDK_2BUTTON_PRESS ||
|
||||
event->type==GDK_3BUTTON_PRESS) ) {
|
||||
printf("I feel %s clicked on button %d\",
|
||||
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
|
||||
event->button);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
And connect the handler to your object:
|
||||
|
||||
<tscreen><verb>
|
||||
{
|
||||
/* list, list item init stuff */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_press_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* and/or */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_release_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* something else */
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I find out about the selection of a GtkList?
|
||||
<p>
|
||||
|
||||
Get the selection something like this:
|
||||
<tscreen><verb>
|
||||
GList *sel;
|
||||
sel = GTK_LIST(list)->selection;
|
||||
</verb></tscreen>
|
||||
|
||||
This is how GList is defined (quoting glist.h):
|
||||
<tscreen><verb>
|
||||
typedef struct _GList GList;
|
||||
|
||||
struct _GList
|
||||
{
|
||||
gpointer data;
|
||||
GList *next;
|
||||
GList *prev;
|
||||
};
|
||||
</verb></tscreen>
|
||||
|
||||
A GList structure is just a simple structure for doubly linked lists.
|
||||
there exist several g_list_*() functions to modify a linked list in
|
||||
glib.h. However the GTK_LIST(MyGtkList)->selection is maintained
|
||||
by the gtk_list_*() functions and should not be modified.
|
||||
|
||||
The selection_mode of the GtkList determines the selection
|
||||
facilities of a GtkList and therefore the contents
|
||||
of GTK_LIST(AnyGtkList)->selection:
|
||||
|
||||
<verb>
|
||||
selection_mode GTK_LIST()->selection contents
|
||||
------------------------------------------------------
|
||||
|
||||
GTK_SELECTION_SINGLE) selection is either NULL
|
||||
or contains a GList* pointer
|
||||
for a single selected item.
|
||||
|
||||
GTK_SELECTION_BROWSE) selection is NULL if the list
|
||||
contains no widgets, otherwise
|
||||
it contains a GList* pointer
|
||||
for one GList structure.
|
||||
GTK_SELECTION_MULTIPLE) selection is NULL if no listitems
|
||||
are selected or a a GList* pointer
|
||||
for the first selected item. that
|
||||
in turn points to a GList structure
|
||||
for the second selected item and so
|
||||
on
|
||||
|
||||
GTK_SELECTION_EXTENDED) selection is NULL.
|
||||
</verb>
|
||||
|
||||
The data field of the GList structure GTK_LIST(MyGtkList)->selection points
|
||||
to the first GtkListItem that is selected. So if you would like to determine
|
||||
which listitems are selected you should go like this:
|
||||
|
||||
Upon Initialization:
|
||||
<tscreen><verb>
|
||||
{
|
||||
gchar *list_items[]={
|
||||
"Item0",
|
||||
"Item1",
|
||||
"foo",
|
||||
"last Item",
|
||||
};
|
||||
guint nlist_items=sizeof(list_items)/sizeof(list_items[0]);
|
||||
GtkWidget *list_item;
|
||||
guint i;
|
||||
|
||||
list=gtk_list_new();
|
||||
gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_MULTIPLE);
|
||||
gtk_container_add(GTK_CONTAINER(AnyGtkContainer), list);
|
||||
gtk_widget_show (list);
|
||||
|
||||
for (i = 0; i < nlist_items; i++)
|
||||
{
|
||||
list_item=gtk_list_item_new_with_label(list_items[i]);
|
||||
gtk_object_set_user_data(GTK_OBJECT(list_item), (gpointer)i);
|
||||
gtk_container_add(GTK_CONTAINER(list), list_item);
|
||||
gtk_widget_show(list_item);
|
||||
}
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
To get known about the selection:
|
||||
<tscreen><verb>
|
||||
{
|
||||
GList *items;
|
||||
|
||||
items=GTK_LIST(list)->selection;
|
||||
|
||||
printf("Selected Items: ");
|
||||
while (items) {
|
||||
if (GTK_IS_LIST_ITEM(items->data))
|
||||
printf("%d ", (guint)
|
||||
gtk_object_get_user_data(items->data));
|
||||
items=items->next;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
</verb></tscreen>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is it possible to get some text displayed which is truncated to fit inside its allocation?
|
||||
<p>
|
||||
GTK's behavior (no clipping) is a consequence of its attempts to
|
||||
conserve X resources. Label widgets (among others) don't get their own
|
||||
X window - they just draw their contents on their parent's window.
|
||||
While it might be possible to have clipping occur by setting the clip
|
||||
mask before drawing the text, this would probably cause a substantial
|
||||
performance penalty.
|
||||
|
||||
Its possible that, in the long term, the best solution to such
|
||||
problems might be just to change gtk to give labels X windows.
|
||||
A short term workaround is to put the label widget inside another
|
||||
widget that does get it's own window - one possible candidate would
|
||||
be the viewport widget.
|
||||
|
||||
<tscreen><verb>
|
||||
viewport = gtk_viewport (NULL, NULL);
|
||||
gtk_widget_set_usize (viewport, 50, 25);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show(viewport);
|
||||
|
||||
label = gtk_label ("a really long label that won't fit");
|
||||
gtk_container_add (GTK_CONTAINER(viewport), label);
|
||||
gtk_widget_show (label);
|
||||
</verb></tscreen>
|
||||
|
||||
If you were doing this for a bunch of widgets, you might want to
|
||||
copy gtkviewport.c and strip out the adjustment and shadow
|
||||
functionality (perhaps you could call it GtkClipper).
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why don't the contents of a button move when the button is pressed? Here's a patch to make it work that way...
|
||||
<p>
|
||||
From: Peter Mattis
|
||||
|
||||
The reason buttons don't move their child down and to the right when
|
||||
they are depressed is because I don't think that's what is happening
|
||||
visually. My view of buttons is that you are looking at them straight
|
||||
on. That is, the user interface lies in a plane and you're above it
|
||||
looking straight at it. When a button gets pressed it moves directly
|
||||
away from you. To be absolutely correct I guess the child should
|
||||
actually shrink a tiny amount. But I don't see why the child should
|
||||
shift down and to the left. Remember, the child is supposed to be
|
||||
attached to the buttons surface. Its not good for it to appear like
|
||||
the child is slipping on the surface of the button.
|
||||
|
||||
On a more practical note, I did implement this at one point and
|
||||
determined it didn't look good and removed it.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I define a separation line in a menu?
|
||||
<p>
|
||||
See the <htmlurl url="http://www.gtk.org/tutorial/"
|
||||
name="Tutorial"> for information on how to create menus.
|
||||
However, to create a separation line in a menu, just insert an
|
||||
empty menu item:
|
||||
|
||||
<tscreen><verb>
|
||||
menuitem = gtk_menu_item_new();
|
||||
gtk_menu_append(GTK_MENU(menu), menuitem);
|
||||
gtk_widget_show(menuitem);
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I right justify a menu, such as Help, when using the MenuFactory?
|
||||
<p>
|
||||
Use something like the following:
|
||||
|
||||
<tscreen><verb>
|
||||
menu_path = gtk_menu_factory_find (factory, "<MyApp>/Help");
|
||||
gtk_menu_item_right_justify(menu_path->widget);
|
||||
</verb></tscreen>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I make my window modal? / How do I make a single window active?
|
||||
<p>
|
||||
After you create your window, do gtk_grab_add(my_window). And after
|
||||
closing the window do gtk_grab_remove(my_window).
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why doesn't my progressbar update?
|
||||
<p>
|
||||
|
||||
You are probably doing all the progressbar changes within a function
|
||||
without returning control to gtk_main. Most drawing updates are only
|
||||
placed on a queue, which is processed within gtk_main. You can
|
||||
force the drawing queue to be processed using something like:
|
||||
|
||||
<tscreen><verb>
|
||||
while (gtk_events_pending())
|
||||
gtk_main_iteration();
|
||||
</verb></tscreen>
|
||||
|
||||
inside you're function that changes the progress bar.
|
||||
|
||||
What the above snippet does is run all pending events and high priority
|
||||
idle functions, then return immediately (the drawing is done in a
|
||||
high priority idle function).
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>About gdk
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is gdk?
|
||||
<p>
|
||||
gdk is basically a wrapper around the standard Xlib function calls. If you are
|
||||
at all familiar with Xlib, a lot of the functions in gdk will require little
|
||||
or no getting used to. All functions are written to provide an easy way
|
||||
to access Xlib functions in an easier an slightly more intuitive manner.
|
||||
In addition, since gdk uses glib (see below), it will be more portable
|
||||
and safer to use on multiple platforms.
|
||||
|
||||
<!-- Examples, anybody? I've been mulling some over. NF -->
|
||||
|
||||
<sect1>How do I use color allocation?
|
||||
<p>
|
||||
One of the nice things about GDK is that it's based on top of Xlib; this is
|
||||
also a problem, especially in the area of color management. If you want
|
||||
to use color in your program (drawing a rectangle or such, your code
|
||||
should look something like this:
|
||||
<tscreen>
|
||||
<verb>
|
||||
{
|
||||
GdkColor *color;
|
||||
int width, height;
|
||||
GtkWidget *widget;
|
||||
GdkGC *gc;
|
||||
|
||||
...
|
||||
|
||||
/* first, create a GC to draw on */
|
||||
gc = gdk_gc_new(widget->window);
|
||||
|
||||
/* find proper dimensions for rectangle */
|
||||
gdk_window_get_size(widget->window, &width, &height);
|
||||
|
||||
/* the color we want to use */
|
||||
color = (GdkColor *)malloc(sizeof(GdkColor));
|
||||
|
||||
/* red, green, and blue are passed values, indicating the RGB triple
|
||||
* of the color we want to draw. Note that the values of the RGB components
|
||||
* within the GdkColor are taken from 0 to 65535, not 0 to 255.
|
||||
*/
|
||||
color->red = red * (65535/255);
|
||||
color->green = green * (65535/255);
|
||||
color->blue = blue * (65535/255);
|
||||
|
||||
/* the pixel value indicates the index in the colormap of the color.
|
||||
* it is simply a combination of the RGB values we set earlier
|
||||
*/
|
||||
color->pixel = (gulong)(red*65536 + green*256 + blue);
|
||||
|
||||
/* However, the pixel valule is only truly valid on 24-bit (TrueColor)
|
||||
* displays. Therefore, this call is required so that GDK and X can
|
||||
* give us the closest color available in the colormap
|
||||
*/
|
||||
gdk_color_alloc(gtk_widget_get_colormap(widget), color);
|
||||
|
||||
/* set the foreground to our color */
|
||||
gdk_gc_set_foreground(gc, color);
|
||||
|
||||
/* draw the rectangle */
|
||||
gdk_draw_rectangle(widget->window, gc, 1, 0, 0, width, height);
|
||||
|
||||
...
|
||||
}
|
||||
</verb>
|
||||
</tscreen>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>About glib
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is glib?
|
||||
<p>
|
||||
glib is a library of useful functions and definitions available for use
|
||||
when creating GDK and GTK applications. It provides replacements for some
|
||||
standard libc functions, such as malloc, which are buggy on some systems.
|
||||
<p>
|
||||
It also provides routines for handling:
|
||||
<itemize>
|
||||
<item>Doubly Linked Lists
|
||||
<item>Singly Linked Lists
|
||||
<item>Timers
|
||||
<item>String Handling
|
||||
<item>A Lexical Scanner
|
||||
<item>Error Functions
|
||||
</itemize>
|
||||
|
||||
<!-- Some Examples might be useful here! NF -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why use g_print, g_malloc, g_strdup and fellow glib functions ?
|
||||
<p>
|
||||
Thanks to Tim Janik who wrote to gtk-list: (slightly modified)
|
||||
<quote>
|
||||
Regarding g_malloc(), g_free() and siblings, these functions are much safer
|
||||
than thier libc equivalences. For example, g_free() just returns if called
|
||||
with NULL. Also, if USE_DMALLOC is defined, the definition for these
|
||||
functions changes (in glib.h) to use MALLOC(), FREE() etc... If MEM_PROFILE
|
||||
or MEM_CHECK are defined, there are even small statistics made counting
|
||||
the used block sizes (shown by g_mem_profile() / g_mem_check()).
|
||||
<p>
|
||||
Considering the fact that glib provides an interface for memory chunks
|
||||
to save space if you have lots of blocks that are always the same size
|
||||
and to mark them ALLOC_ONLY if needed, it is just straight forward to
|
||||
create a small saver (debug able) wrapper around the normal malloc/free
|
||||
stuff as well - just like gdk covers Xlib. ;)
|
||||
<p>
|
||||
Using g_error() and g_warning() inside of applications like the GIMP
|
||||
that fully rely on gtk even gives the opportunity to pop up a window
|
||||
showing the messages inside of a gtk window with your own handler
|
||||
(by using g_set_error_handler()) along the lines of gtk_print()
|
||||
(inside of gtkmain.c).
|
||||
</quote>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>GTK+ FAQ Contributions, Maintainers and Copyright
|
||||
<p>
|
||||
If you would like to make a contribution to the FAQ, send either one of us
|
||||
an e-mail message with the exact text you think should be included (question and
|
||||
answer). With your help, this document can grow and become more useful!
|
||||
|
||||
This document is maintained by Nathan Froyd
|
||||
<htmlurl url="mailto:maestrox@geocities.com" name="<maestrox@geocities.com>">
|
||||
and Tony Gale <htmlurl url="mailto:gale@gimp.org" name="<gale@gimp.org>">.
|
||||
This FAQ was created by Shawn T. Amundson <htmlurl url="mailto:amundson@gimp.org"
|
||||
name="<amundson@gimp.org>">who continues to provide support.
|
||||
|
||||
The GTK+ FAQ is Copyright (C) 1997,1998 by Shawn T. Amundson, Nathan Froyd and Tony Gale.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this manual provided the
|
||||
copyright notice and this permission notice are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this document under the conditions
|
||||
for verbatim copying, provided that this copyright notice is included exactly as in the original,
|
||||
and that the entire resulting derived work is distributed under the terms of a permission
|
||||
notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this document into another language,
|
||||
under the above conditions for modified versions.
|
||||
|
||||
If you are intending to incorporate this document into a published work, please contact one of
|
||||
the maintainers, and we will make an effort to ensure that you have the most up to date
|
||||
information available.
|
||||
|
||||
There is no guarentee that this document lives up to its intended
|
||||
purpose. This is simply provided as a free resource. As such,
|
||||
the authors and maintainers of the information provided within can
|
||||
not make any guarentee that the information is even accurate.
|
||||
|
||||
</article>
|
||||
@@ -324,3 +324,11 @@ handle_event ()
|
||||
@summarycontents
|
||||
@contents
|
||||
@bye
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
455
docs/glib.texi
Normal file
455
docs/glib.texi
Normal file
@@ -0,0 +1,455 @@
|
||||
\input texinfo @c -*-texinfo-*-
|
||||
@c %**start of header
|
||||
@setfilename glib.info
|
||||
@settitle GLIB
|
||||
@setchapternewpage odd
|
||||
|
||||
@set edition 1.0
|
||||
@set update-date 3 Feburary 1998
|
||||
@set update-month Feburary 1998
|
||||
@c %**end of header
|
||||
|
||||
@ifinfo
|
||||
This file documents GLIB, A library of useful routines for C programming
|
||||
|
||||
Copyright (C) 1998 Gregory A McLean
|
||||
|
||||
Permission is granted to make and distributed verbatim copies of this
|
||||
manual, provided the copyright notice and this permission notice are
|
||||
preserved on all copies.
|
||||
|
||||
@ignore
|
||||
Permission is granted to process this file throught TeX and print the
|
||||
results, provided the printed document carries copying permission notice
|
||||
identical to this one except for the removal of this paragraph (this
|
||||
paragraph not being relevant to the printed manual).
|
||||
|
||||
@end ignore
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a translation
|
||||
approved by Gregory McLean.
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@title GLIB, Useful routines for C programming
|
||||
@subtitle Version 1.0
|
||||
@subtitle @value{update-month}
|
||||
@author by Gregory McLean
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1998 Gregory McLean
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided the copyright notice and this permission notice are
|
||||
preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a translation
|
||||
approved by Gregory McLean.
|
||||
@end titlepage
|
||||
|
||||
@dircategory Library of useful routines for 'C' programing
|
||||
@direntry
|
||||
* GLIB: (glib). useful routines for 'C' programming
|
||||
@end direntry
|
||||
|
||||
@node Top, Copying, (dir), (dir)
|
||||
@top useful routines for 'C' programming
|
||||
@ifinfo
|
||||
This is edition @value{edition} of the GLIB documentation,
|
||||
@w{@value{update-date}}.
|
||||
@end ifinfo
|
||||
|
||||
@menu
|
||||
* Copying:: Your rights.
|
||||
* Overview:: What is GLIB?
|
||||
* Doubly linked lists:: Doubly linked lists
|
||||
* Signly linked lists:: Singly linked lists
|
||||
* List allocators:: List Allocators
|
||||
* Hash tables:: Hash tables
|
||||
* Caches:: Cache handling
|
||||
* Trees:: Tree handling
|
||||
* Memory:: Memory handling
|
||||
* Timers:: Timer functions
|
||||
* Output:: Output handling
|
||||
* Utilities:: Utilitiy functions
|
||||
* Errors:: Error handling
|
||||
* String Chunks:: String Chunks
|
||||
* Strings:: String handling
|
||||
* Resizable arrays:: Resizeable arrays
|
||||
* GScanner:: Flexible lexical scanner
|
||||
* Miscellany:: Other stuff
|
||||
* Function Index:: Index of functions
|
||||
* Concept Index:: Index of concepts
|
||||
@end menu
|
||||
|
||||
@node Copying, Overview, Top, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Copying
|
||||
|
||||
@node Overview, Doubly linked lists, Copying, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter What is GLIB
|
||||
|
||||
@node Doubly linked lists, Signly linked lists, Overview, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Doubly linked lists
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GList* g_list_alloc (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_list_free (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_list_free_1 (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_append (GList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_prepend (GList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_insert (GList *@var{list}, gpointer @var{data}, gint @var{position})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_insert_sorted (GList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_concat (GList *@var{list1}, GList *@var{list2})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_remove (GList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_remove_link (GList *@var{list}, GList *@var{link})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_reverse (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_nth (GList *@var{list}, gint @var{n})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_find (GList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_last (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GList* g_list_first (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gint g_list_length (GList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_list_foreach (GList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
|
||||
@end deftypefun
|
||||
|
||||
@node Signly linked lists, List allocators, Doubly linked lists, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Signly linked lists
|
||||
|
||||
@subsection Functions
|
||||
@deftypefun GSList* g_slist_alloc (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_slist_free (GSList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_slist_free_1 (GSList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_append (GSList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_prepend (GSList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_insert (GSList *@var{list}, gpointer @var{data}, gint @var{position})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_insert_sorted (GSList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_concat (GSList *@var{list1}, GSList *@var{list2})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_remove (GSList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_remove_link (GSList *@var{list}, GSList *@var{link})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_reverse (GSList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_nth (GSList *@var{list}, gint @var{n})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_find (GSList *@var{list}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GSList* g_slist_last (GSList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gint g_slist_length (GSList *@var{list})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_slist_foreach (GSList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
|
||||
@end deftypefun
|
||||
|
||||
@node List allocators, Hash tables, Signly linked lists, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter List allocators
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GListAllocator* g_list_allocator_new (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_list_allocator_free (GListAllocator *@var{allocator})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GListAllocator* g_slist_set_allocator (GListAllocator *@var{allocator})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GListAllocator* g_list_set_allocator (GListAllocator *@var{allocator})
|
||||
@end deftypefun
|
||||
|
||||
@node Hash tables, Caches, List allocators, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Hash tables
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GHashTable* g_hash_table_new (GHashFunc @var{hash_func}, GCompareFunc @var{key_compare_func})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_destroy (GHashTable *@var{hash_table})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_insert (GHashTable *@var{hash_table}, gpointer @var{key}, gpointer @var{value})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_remove (GHashTable *@var{hash_table}, gpointer @var{key})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_hash_table_lookup (GHashTable *@var{hash_table}, gpointer @var{key})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_freeze (GHashTable *@var{hash_table})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_thaw (GHashTable *@var{hash_table})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_hash_table_foreach (GHashTable *@var{hash_table}, GHFunc @var{func}, gpointer @var{user_data})
|
||||
@end deftypefun
|
||||
|
||||
@node Caches, Trees, Hash tables, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Cache handling
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GCache* g_cache_new (GCacheNewFunc @var{value_new_func}, GCacheDestroyFunc @var{value_destroy_func}, GCacheDupFunc @var{key_dup_func}, GCacheDestroyFunc @var{key_destroy_func}, GHashFunc @var{hash_key_func}, GHashFunc @var{hash_value_func}, GCompareFunc @var{key_compare_func})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_cache_destroy (GCache *@var{cache})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_cache_insert (GCache *@var{cache}, gpointer @var{key})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_cache_remove (GCache *@var{cache}, gpointer @var{key})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_cache_key_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_cache_value_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
|
||||
@end deftypefun
|
||||
|
||||
@node Trees, Memory, Caches, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Tree handling
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GTree* g_tree_new (GCompareFunc @var{key_compare_func})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_tree_destroy (GTree *@var{tree})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_tree_remove (GTree *@var{tree}, gpointer @var{key}, gpointer @var{value})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_tree_lookup (GTree *@var{tree}, gpointer @var{key})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_tree_traverse (GTree *@var{tree}, GTraverseFunc @var{traverse_func}, GTraverseType @var{traverse_type}, gpointer @var{data}
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_tree_search (GTree *@var{tree}, GSearchFunc @var{search_func}, gpointer @var{data})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gint g_tree_height (GTree *@var{tree})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gint g_tree_nnodes (GTree *@var{tree})
|
||||
@end deftypefun
|
||||
|
||||
@node Memory, Timers, Trees, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Memory handling
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun gpointer g_malloc (gulong @var{size})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_malloc0 (gulong @var{size})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_realloc (gpointer @var{mem}, gulong @var{size})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_profile (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_check (gpointer @var{mem})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun GMemChunk* g_mem_chunk_new (gchar *@var{name}, gint @var{atom_size}, gulong @var{area_size}, gint @var{type})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_destroy (GMemChunk *@var{mem_chunk})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpointer g_mem_chunk_alloc (GMemChunk *@var{mem_chunk})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_free (GMemChunk *@var{mem_chunk}, gpointer @var{mem})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_clean (GMemChunk *@var{mem_chunk})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_reset (GMemChunk *@var{mem_chunk})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_print (GMemChunk *@var{mem_chunk})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_mem_chunk_info (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_blow_chunks (void)
|
||||
Not what you might be thinking, @code{g_blow_chunks()} simply compresses all
|
||||
the chunks. This operation consists of freeing every memory area that should
|
||||
be freed (but which we haven't gotten around to doing yet).
|
||||
@end deftypefun
|
||||
|
||||
@node Timers, Output, Memory, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Timer functions
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun GTimer* g_timer_new (void)
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_timer_destroy (GTimer *@var{timer})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_timer_start (GTimer *@var{timer})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_timer_stop (GTimer *@var{timer})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_timer_reset (GTimer *@var{timer})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gdouble g_timer_elapsed (GTimer *@var{timer}, gulong *@var{microseconds})
|
||||
@end deftypefun
|
||||
|
||||
@node Output, Utilities, Timers, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Output functions
|
||||
|
||||
@subsection Functions
|
||||
|
||||
@deftypefun void g_error (gchar *@var{format}, @dots{})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_warning (gchar *@var{format}, @dots{})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_message (gchar *@var{format}, @dots{})
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void g_print (gchar *@var{format}, @dots{})
|
||||
@end deftypefun
|
||||
|
||||
@node Utilities, Errors, Output, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Utility functions
|
||||
|
||||
@node Errors, String Chunks, Utilities, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Error handling
|
||||
|
||||
@node String Chunks, Strings, Errors, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter String chunks
|
||||
|
||||
@node Strings, Resizable arrays, String Chunks, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter String handling
|
||||
|
||||
@node Resizable arrays, GScanner, Strings, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Resizable arrays
|
||||
|
||||
@node GScanner, Miscellany, Resizable arrays, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Flexible lexical scanner
|
||||
|
||||
@node Miscellany, Function Index, GScanner, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Other stuff
|
||||
|
||||
@node Function Index, Concept Index, Miscellany, Top
|
||||
@comment node-name, next, previous, up
|
||||
@unnumbered Function Index
|
||||
|
||||
@printindex fn
|
||||
|
||||
@node Concept Index, , Function Index, Top
|
||||
@comment node-name, next, previous, up
|
||||
@unnumbered Concept Index
|
||||
|
||||
@printindex cp
|
||||
|
||||
@summarycontents
|
||||
@contents
|
||||
@bye
|
||||
|
||||
193
docs/gtk-config.txt
Normal file
193
docs/gtk-config.txt
Normal file
@@ -0,0 +1,193 @@
|
||||
CONFIGURING PACKAGES TO WORK WITH GTK
|
||||
-------------------------------------
|
||||
|
||||
Compiling a program succesfully against the GTK, GDK, and GLIB
|
||||
libraries can require a large number of command line options
|
||||
to your compiler and linker that are hard to guess correctly.
|
||||
The additional libraries required may, for example, depend on the
|
||||
manner which GTK was configured
|
||||
|
||||
Several tools are included in this package to make process
|
||||
easier.
|
||||
|
||||
First, there is the shell script 'gtk-config' (installed in
|
||||
$exec_prefix/bin):
|
||||
|
||||
Invoking gtk-config
|
||||
-------------------
|
||||
|
||||
gtk-config can be invoked in one of three forms:
|
||||
|
||||
gtk-config --version
|
||||
Prints out the version of GTK installed
|
||||
|
||||
gtk-config --cflags
|
||||
Prints '-I' flags pointing to the installed d
|
||||
|
||||
gtk-config --libs
|
||||
Prints out the linker flags necessary to link a program against GTK
|
||||
|
||||
|
||||
Example of using gtk-config
|
||||
---------------------------
|
||||
|
||||
Typically, gtk-config will be used within a configure script,
|
||||
as described below. It, however, can also be used directly
|
||||
from the command line to compile a simple program. For example:
|
||||
|
||||
cc -o simple `gtk-config --cflags` simple.c `gtk-config --libs`
|
||||
|
||||
This command line might expand to (for example):
|
||||
|
||||
cc -o simple -I/usr/local/lib/glib/include -I/usr/local/include \
|
||||
-I/usr/X11R6/include simple.c -L/usr/local/lib -L/usr/X11R6/lib \
|
||||
-lgtk -lgdk -lglib -lXi -lXext -lX11 -lm
|
||||
|
||||
Not only is the form using gtk-config easier to type, it will
|
||||
work on any system, no matter how GTK was configured.
|
||||
|
||||
|
||||
AM_PATH_GTK
|
||||
-----------
|
||||
|
||||
For packages configured using GNU automake, GTK also provides
|
||||
a macro to automate the process of running GTK.
|
||||
|
||||
AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
|
||||
This macro:
|
||||
|
||||
* Determines the location of GTK using gtk-config, which is either
|
||||
found in the user's path, or from the environment variable
|
||||
GTK_CONFIG
|
||||
|
||||
* Tests the installed libraries to make sure that there version
|
||||
is later than MINIMUM-VERSION. (A default version will be used
|
||||
if not specified)
|
||||
|
||||
* If the required version was found, sets the GTK_CFLAGS variable to
|
||||
the output of `gtk-config --cflags` and the GTK_LIBS variable to
|
||||
the output of `gtk-config --libs`, and calls AC_SUBST() for these
|
||||
variables so they can be used in generated makefiles, and then
|
||||
executes ACTION-IF-FOUND.
|
||||
|
||||
* If the required version was not found, sets GTK_CFLAGS and GTK_LIBS
|
||||
to empty strings, and executes ACTION-IF-NOT-FOUND.
|
||||
|
||||
This macro is in file 'gtk.m4' which is installed in $datadir/aclocal.
|
||||
Note that if automake was installed with a different --prefix than
|
||||
GTK, you will either have to manually move gtk.m4 to automake's
|
||||
$datadir/aclocal, or give aclocal the -I option when running it.
|
||||
|
||||
|
||||
Configuring a package that uses AM_PATH_GTK
|
||||
-------------------------------------------
|
||||
|
||||
Simply make sure that gtk-config is in your path, and run
|
||||
the configure script.
|
||||
|
||||
Notes:
|
||||
|
||||
* You can also specify a gtk-config not in your path by
|
||||
setting the GTK_CONFIG environment variable to the
|
||||
name of the executable
|
||||
|
||||
* If you move the GTK package from its installed location,
|
||||
you will need either need to modify gtk-config script
|
||||
manually to point to the new location or rebuild GTK.
|
||||
|
||||
[ As a future enhancement AM_PATH_GTK should support options
|
||||
to override the default locations found in gtk-config ]
|
||||
|
||||
|
||||
Example of a package using AM_PATH_GTK
|
||||
--------------------------------------
|
||||
|
||||
The following shows how to build a simple package using automake
|
||||
and the AM_PATH_GTK macro. The program used here is the testinput.c
|
||||
|
||||
You should first read the introductory portions of the automake
|
||||
Manual, if you are not already familiar with it.
|
||||
|
||||
Two files are needed, 'configure.in', which is used to build the
|
||||
configure script:
|
||||
|
||||
==configure.in===
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(testinput.c)
|
||||
|
||||
AM_INIT_AUTOMAKE(testinput.c, 1.0.0)
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AM_PATH_GTK(0.99.5,
|
||||
[LIBS="$LIBS $GTK_LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"],
|
||||
AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
=================
|
||||
|
||||
The only command in this which is not standard for automake
|
||||
is the AM_PATH_GTK() macro.
|
||||
|
||||
That command does the following:
|
||||
|
||||
If a GTK version greater than 0.99.5 is found, adds $GTK_LIBS to
|
||||
$LIBS and $GTK_CFLAGS to $CFLAGS. Otherwise, dies with the error
|
||||
message "Cannot find GTK: Is gtk-config in path?"
|
||||
|
||||
And the 'Makefile.am', which will be used to build the Makefile.
|
||||
|
||||
== Makefile.am ==
|
||||
bin_PROGRAMS = testinput
|
||||
testinput_SOURCES = testinput.c
|
||||
=================
|
||||
|
||||
This Makefile.am, says that we are building a single executable,
|
||||
from a single sourcefile 'testinput.c'. Since every program
|
||||
we are building uses GTK we simply added the GTK options
|
||||
to $LIBS and $CFLAGS, but in other circumstances, we might
|
||||
want to specify them on a per-program basis: for instance by
|
||||
adding the lines:
|
||||
|
||||
testinput_LDADD = $(GTK_LIBS)
|
||||
INCLUDES = $(GTK_CFLAGS)
|
||||
|
||||
to the Makefile.am.
|
||||
|
||||
To try this example out, create a new directory, add the two
|
||||
files above two it, and copy the testinput.c file from
|
||||
the gtk/ subdirectory to the new directory. Edit the line:
|
||||
|
||||
#include "gtk.h"
|
||||
|
||||
in testgtk.c, to read:
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
Now execute the following commands:
|
||||
|
||||
automake --add-missing
|
||||
aclocal
|
||||
autoconf
|
||||
|
||||
You now have a package that can be built in the normal fashion
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
* If you are converting a package that used a pre-1.0 version of
|
||||
GTK, you should remove the autoconf tests for X. The results
|
||||
of these tests are included in gtk-config and will be added
|
||||
to GTK_LIBS and GTK_CFLAGS by the AM_PATH_GTK macro.
|
||||
|
||||
Owen Taylor
|
||||
14 Mar 1997
|
||||
2062
docs/gtk.texi
2062
docs/gtk.texi
File diff suppressed because it is too large
Load Diff
9383
docs/gtk_tut.sgml
Normal file
9383
docs/gtk_tut.sgml
Normal file
File diff suppressed because it is too large
Load Diff
8340
docs/gtk_tut_it.sgml
Normal file
8340
docs/gtk_tut_it.sgml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
docs/gtk_tut_packbox1.gif
Normal file
BIN
docs/gtk_tut_packbox1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
BIN
docs/gtk_tut_packbox2.gif
Normal file
BIN
docs/gtk_tut_packbox2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
BIN
docs/gtk_tut_table.gif
Normal file
BIN
docs/gtk_tut_table.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
11
docs/gtkdocs_fix
Executable file
11
docs/gtkdocs_fix
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# Stupid script to fix look of html files created with sgml2html...
|
||||
|
||||
foreach (@ARGV) {
|
||||
print "Fixing... $_\n";
|
||||
system("mv $_ $_.orig");
|
||||
system("sed -e 's/<BODY>/<BODY BGCOLOR=\"#FFFFFF\">/g' -e 's/<HR>/<HR NOSHADE>/g' $_.orig > $_");
|
||||
unlink("$_.orig");
|
||||
}
|
||||
|
||||
913
docs/gtkfaq.sgml
Normal file
913
docs/gtkfaq.sgml
Normal file
@@ -0,0 +1,913 @@
|
||||
<!doctype linuxdoc system>
|
||||
|
||||
<article>
|
||||
|
||||
<!-- Title information -->
|
||||
|
||||
<title>GTK+ FAQ
|
||||
|
||||
<!-- NOTE: Use only one author tag, otherwise sgml2txt barfs - TRG -->
|
||||
<author>Nathan Froyd, Tony Gale, Shawn T. Amundson.
|
||||
<date>March 13th 1998
|
||||
<abstract>
|
||||
This document is intended to answer questions that are likely to be
|
||||
frequently asked by programmers using GTK+ or people who are just
|
||||
looking at using GTK+.
|
||||
</abstract>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<toc>
|
||||
|
||||
<!-- Begin the document -->
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>General Information
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Authors
|
||||
<p>
|
||||
The authors of GTK+ are:
|
||||
|
||||
<itemize>
|
||||
<item>Peter Mattis (petm@xcf.berkeley.edu)
|
||||
<item>Spencer Kimball (spencer@xcf.berkeley.edu)
|
||||
<item>Josh MacDonald (jmacd@xcf.berkeley.edu)
|
||||
</itemize>
|
||||
GTK+ is distributed under the GNU Library General Public License
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is GTK+?
|
||||
<p>
|
||||
GTK+ is a small and efficient widget set designed with the general look
|
||||
and feel of Motif. In reality, it looks much better than Motif. It
|
||||
contains common widgets and some more complex widgets such as a file
|
||||
selection, and color selection widgets.
|
||||
|
||||
GTK+ provides some unique features. (At least, I know of no other widget
|
||||
library which provides them). For
|
||||
example, a button does not contain a label, it contains a child widget,
|
||||
which in most instances will be a label.
|
||||
However, the child widget can also be a pixmap, image or any combination
|
||||
possible the programmer desires.
|
||||
This flexibility is adhered to throughout the library.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is the + in GTK+?
|
||||
<P>
|
||||
Peter Mattis informed the gtk mailing list that:
|
||||
<quote>
|
||||
"I originally wrote gtk which included the three libraries, libglib,
|
||||
libgdk and libgtk. It featured a flat widget hierarchy. That is, you
|
||||
couldn't derive a new widget from an existing one. And it contained
|
||||
a more standard callback mechanism instead of the signal mechanism now
|
||||
present in gtk+. The + was added to distinguish between the original
|
||||
version of gtk and the new version. You can think of it as being an
|
||||
enhancement to the original gtk that adds object oriented features."
|
||||
</quote>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Does the G in GTK+ stand for General, Gimp, or GNU?
|
||||
<p>
|
||||
Peter Mattis informed the gtk mailing list that:
|
||||
<quote>
|
||||
"I think the last time Spencer and I talked about it we decided on
|
||||
GTK = Gimp ToolKit. But I don't know for sure. Its definately not
|
||||
GNU, though."
|
||||
</quote>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Where is the documentation for GTK+?
|
||||
<p>
|
||||
In the GTK+ distribution's doc/ directory you will find the
|
||||
reference material for both GTK and GDK, this FAQ and the
|
||||
GTK Tutorial.
|
||||
|
||||
In addition, you can find links to HTML versions of these documents
|
||||
by going to
|
||||
<htmlurl url="http://www.gtk.org/"
|
||||
name="http://www.gtk.org/">.
|
||||
|
||||
The Tutorial and FAQ can also be found at
|
||||
<htmlurl url="http://www.geocities.com/ResearchTriangle/Lab/4299/"
|
||||
name="http://www.geocities.com/ResearchTriangle/Lab/4299/">.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is there a mailing list (or mailing list archive) for GTK+?
|
||||
<p>
|
||||
There are two mailing lists:
|
||||
<itemize>
|
||||
<item>A mailing list for discussion of development of GTK based applications
|
||||
is hosted at gtk-app-devel-list@redhat.com. To subscribe send an
|
||||
email message to <htmlurl url="mailto:gtk-app-devel-list-request@redhat.com"
|
||||
name="gtk-app-devel-list-request@redhat.com">
|
||||
with <em>subscribe</em> in the <bf>subject</bf>.
|
||||
<p>
|
||||
<item>A mailing list for discussion of development of GTK is hosted
|
||||
at gtk-list@redhat.com. To subscribe send an
|
||||
email message to <htmlurl url="mailto:gtk-list-request@redhat.com"
|
||||
name="gtk-list-request@redhat.com">
|
||||
with <em>subscribe</em> in the <bf>subject</bf>.
|
||||
<p>
|
||||
A searchable archive of the mailing list can be found at <htmlurl url="http://archive.redhat.com/gtk-list" name="http://archive.redhat.com/gtk-list">
|
||||
</itemize>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>The gtk-list hasn't had any traffic for days, is it dead?
|
||||
<p>
|
||||
No, everyone's just busy coding.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How to get help with GTK+
|
||||
<p>
|
||||
First, make sure your question isn't answered in the documentation, this
|
||||
FAQ or the tutorial. Done that? You're sure you've done that, right? In
|
||||
that case, the best place to post questions is to the GTK+ mailing list.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How to report bugs in GTK+
|
||||
<p>
|
||||
Bug reports should be sent to the GTK+ mailing list.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What applications have been written with GTK+?
|
||||
<p>
|
||||
Some applications which use GTK+ are:
|
||||
<itemize>
|
||||
<item>GIMP (<htmlurl url="http://www.XCF.Berkeley.EDU/~gimp/"
|
||||
name="http://www.XCF.Berkeley.EDU/~gimp/"> ),
|
||||
an image manipulation program
|
||||
<item>Gsumi (<htmlurl url="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html"
|
||||
name="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html">),
|
||||
a fun B+W doodling program with XInput support.
|
||||
<item>GUBI (<htmlurl url="http://www.SoftHome.net/pub/users/timj/gubi/index.htm"
|
||||
name="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">),
|
||||
a user interface builder
|
||||
<item>Gzilla (<htmlurl url="http://www.levien.com/gzilla/" name="http://www.levien.com/gzilla/">),
|
||||
a web browser
|
||||
<item>SANE (<htmlurl url="http://www.azstarnet.com/~axplinux/sane/" name="http://www.azstarnet.com/~axplinux/sane/"> ),
|
||||
a universal scanner interface
|
||||
<item>XQF (<htmlurl url="http://www.botik.ru/~roma/quake/" name="http://www.botik.ru/~roma/quake/">),
|
||||
a QuakeWorld/Quake2 server browser and launcher
|
||||
<item>ElectricEyes (<htmlurl url="http://www.labs.redhat.com/ee.shtml" name="http://www.labs.redhat.com/ee.shtml">),
|
||||
an image viewer that aims to be a free replacement for xv
|
||||
<item>GPK - the General Proxy Kit (<htmlurl url="http://www.humanfactor.com/gpk/" name="http://www.humanfactor.com/gpk/">),
|
||||
an add-on library to permit thread-safe access to GTK+
|
||||
<item>GCK - the General Convenience Kit (<htmlurl url="http://www.ii.uib.no/~tomb/gck.html" name="http://www.ii.uib.no/~tomb/gck.html">),
|
||||
miscellaneous functions intended to ease color handling, UI construction,
|
||||
vector operations, and math functions
|
||||
<item>GDK Imlib (<htmlurl url="http://www.labs.redhat.com/imlib/" name="http://www.labs.redhat.com/imlib/">),
|
||||
a fast image loading and manipulation library for GDK
|
||||
</itemize>
|
||||
<p>
|
||||
In addition to the above, the GNOME project (<htmlurl url="http://www.gnome.org"
|
||||
name="http://www.gnome.org">)
|
||||
is using GTK+ to build a free desktop for Linux. Many more programs can be found
|
||||
there.
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>How to find, configure, install, and troubleshoot GTK+
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What do I need to run GTK+?
|
||||
<p>
|
||||
To compile GTK+, all you need is a C compiler (gcc) and the X Window System
|
||||
and associated libraries on your system.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Where can I get GTK+?
|
||||
<p>
|
||||
The canonical site is:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
</verb>
|
||||
Of course, any mirrors of ftp.gtk.org should have the latest version, too.
|
||||
|
||||
<sect1>How do I configure/compile GTK+?
|
||||
<p>
|
||||
Generally, all you will need to do is issue the commands:
|
||||
<verb>
|
||||
./configure
|
||||
make
|
||||
</verb>
|
||||
in the gtk+-version/ directory.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>When compiling GTK+ I get an error like:
|
||||
<tt/make: file `Makefile' line 456: Syntax error/
|
||||
<p>
|
||||
Make sure that you are using GNU make (use <tt/make -v/ to check). There are
|
||||
many weird and wonderful versions of make out there, and not all of them
|
||||
handle the automatically generated Makefiles.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
|
||||
<sect1>I've compiled and installed GTK+, but I can't get any programs to link
|
||||
with it!
|
||||
<p>
|
||||
This problem is most often encountered when the GTK+ libraries can't be
|
||||
found or are the wrong version. Generally, the compiler will complain about an
|
||||
'unresolved symbol'. There are two things you need to check:
|
||||
<itemize>
|
||||
<item>Make sure that the libraries can be found. You want to edit
|
||||
/etc/ld.so.conf to include /usr/local/lib (or whereever you installed GTK+),
|
||||
so it looks something like:
|
||||
<verb>
|
||||
/usr/X11R6/lib
|
||||
/usr/local/lib
|
||||
</verb>
|
||||
Then you need to run /sbin/ldconfig as root.
|
||||
<p>
|
||||
<item>Make sure the linker is finding the correct set of libraries. If you
|
||||
have a Linux distribution that installs GTK+ (e.g. RedHat 5.0) then this
|
||||
older version may be used. Now (assuming you have a RedHat
|
||||
system), issue the command
|
||||
<verb>
|
||||
rpm -e gtk gtk-devel
|
||||
</verb>
|
||||
You may also want to remove the packages that depend on gtk (rpm will tell you
|
||||
which ones they are). If you don't have a RedHat Linux system, check to make sure
|
||||
that neither <verb>/usr/lib</verb> or <verb>/usr/local/lib</verb> contain any of
|
||||
the libraries libgtk, libgdk, libglib, or libgck. If they do exist, remove them
|
||||
(and any gtk include files, such as /usr/include/gtk and /usr/include/gdk)
|
||||
and reinstall gtk+.
|
||||
</itemize>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>Development of GTK+
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Whats this CVS thing that everyone keeps talking about, and how do I access it?
|
||||
<p>
|
||||
CVS is the Concurent Version System and is a very popular mean of
|
||||
version control for software projects. It is designed to allow multiple
|
||||
authors to be able to simultanously operate on the same source tree.
|
||||
This source tree is centrally maintained, but each developer has a
|
||||
local mirror of this repository that they make there changes to.
|
||||
|
||||
The GTK+ developers use a CVS repository to store the master copy of
|
||||
the current development version of GTK+. As such, people wishing to
|
||||
contribute patches to GTK+ should generate them against the CVS version.
|
||||
Normal people should use the packaged releases.
|
||||
|
||||
The CVS toolset is available as RPM packages from the usual RedHat sites.
|
||||
The latest version is available at
|
||||
<htmlurl url="http://download.cyclic.com/pub/"
|
||||
name="<http://download.cyclic.com/pub/>">
|
||||
|
||||
Anyone can download the latest CVS version of GTK+ by using anonymous access
|
||||
using the following steps:
|
||||
<itemize>
|
||||
<item> In a bourne shell descendant (e.g. bash) type:
|
||||
<verb>
|
||||
export CVSROOT=':pserver:anonymous@cvs.gimp.org:/debian/home/gnomecvs'
|
||||
</verb>
|
||||
<item>Next, the first time the source tree is checked out, a cvs login
|
||||
is needed.
|
||||
<verb>
|
||||
cvs login
|
||||
</verb>
|
||||
This will ask you for a password. There is no password for cvs.gimp.org,
|
||||
so just enter a carriage return.
|
||||
<item>To get the tree and place it in a subdir of your current working directory, issue the command:
|
||||
<verb>
|
||||
cvs -z9 get gtk+
|
||||
</verb>
|
||||
</itemize>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I contribute to GTK+?
|
||||
<p>
|
||||
It's simple. If something doesn't work like you think it should in a program,
|
||||
check the documentation to make sure you're not missing something. If it is a
|
||||
true bug or missing feature, track it down in the GTK+ source, change it,
|
||||
and then generate a patch in the form of a 'context diff'. This can be done
|
||||
using a command such as <tt/diff -ru <oldfile> <newfile>/.
|
||||
Then upload the patchfile to:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/incoming
|
||||
</verb>
|
||||
along with a README file. Make sure you follow the naming conventions or your
|
||||
patch will just be deleted! The filenames should be of this form:
|
||||
<verb>
|
||||
gtk-<username>-<date yymmdd-n>.patch.gz
|
||||
gtk-<username>-<date yymmdd-n>.patch.README
|
||||
</verb>
|
||||
The "n" in the date indicates a unique number (starting from 0)
|
||||
of patches you uploaded that day. It should be 0, unless you
|
||||
upload more than one patch in the same day.
|
||||
|
||||
Example:
|
||||
<verb>
|
||||
gtk-gale-982701-0.patch.gz
|
||||
gtk-gale-982701-0.patch.README
|
||||
</verb>
|
||||
Once you upload <em>anything</em>, send the README to ftp-admin@gtk.org
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I know if my patch got applied, and if not, why not?
|
||||
<p>
|
||||
Uploaded patches will be moved to <tt>ftp://ftp.gtk.org/pub/gtk/patches</tt>
|
||||
where one of the GTK+ development team will pick them up. If applied, they
|
||||
will be moved to <tt>/pub/gtk/patches/old</tt>.
|
||||
|
||||
Patches that aren't applied, for whatever reason, are moved to
|
||||
<tt>/pub/gtk/patches/unapplied</tt> or <tt>/pub/gtk/patches/outdated</tt>.
|
||||
At this point you can ask on the <tt/gtk-list/ mailing list why your patch
|
||||
wasn't applied. There are many possible reasons why patches may not be
|
||||
applied, ranging from it doesn't apply cleanly, to it isn't right. Don't
|
||||
be put off if your patch didn't make it first time round.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is the policy on incorporating new widgets into the library?
|
||||
<p>
|
||||
This is up to the authors, so you will have to ask them once you
|
||||
are done with your widget. As a general guideline, widgets that are
|
||||
generally useful, work, and are not a disgrace to the widget set will
|
||||
gladly be included.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is anyone working on bindings for languages other than C?
|
||||
<p>
|
||||
Yes. There is
|
||||
<itemize>
|
||||
<item>a C++ wrapper for GTK+ called gtk--. You can find the home page at:
|
||||
<verb>
|
||||
http://www.cs.tut.fi/~p150650/gtk/gtk--.html
|
||||
</verb>
|
||||
The FTP site is:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/gtk--/
|
||||
</verb>
|
||||
<p>
|
||||
|
||||
<item>There are two Objective-c bindings currently in development:
|
||||
|
||||
<itemize>
|
||||
|
||||
<item>The <htmlurl url="http://www.gnome.org/" name="GNOME project's"> package
|
||||
of choice is obgtk. Objgtk is based on the Object class and is maintained by
|
||||
<htmlurl url="mailto:sopwith@cuc.edu" name="Elliot Lee">. Apparently, objgtk
|
||||
is being accepted as the `standard' Objective-C binding for GTK+.
|
||||
|
||||
<item>If you are more inclined towards the
|
||||
<htmlurl url="http://www.gnustep.org/" name="GNUstep project">,
|
||||
you may want to check out GTKKit by
|
||||
<htmlurl url="mailto:helge@mdlink.de" name="Helge Heß">.
|
||||
The intention is to setup a GTK+ binding using the FoundationKit.
|
||||
GTKKit includes nicities like writing a XML-type template file to
|
||||
construct a GTK+ interface.
|
||||
|
||||
</itemize>
|
||||
<p>
|
||||
<item>Perl bindings
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/perl
|
||||
</verb>
|
||||
|
||||
<item>Guile bindings. The home page is at:
|
||||
<verb>
|
||||
http://www.ping.de/sites/zagadka/guile-gtk/
|
||||
</verb>
|
||||
By the way, Guile is the GNU Project's implemention of R4RS Scheme (the
|
||||
standard). If you like Scheme, you may want to take a look at this.
|
||||
<p>
|
||||
|
||||
<item>David Monniaux reports:
|
||||
<quote>I've started a gtk-O'Caml binding system.
|
||||
The basics of the system, including callbacks, work fine.
|
||||
|
||||
The current development is in
|
||||
http://www.ens-lyon.fr/~dmonniau/arcs/
|
||||
</quote>
|
||||
|
||||
<item>
|
||||
Several python-gtk interfaces have been done. python-gtk is at:
|
||||
<verb>
|
||||
http://www.acs.ucalgary.cs/~nashceme/python-gtk/
|
||||
</verb>
|
||||
If you try python-gtk and don't like it, there's also pygtk located at:
|
||||
<verb>
|
||||
ftp://ftp.gtk.org/pub/gtk/python/
|
||||
</verb>
|
||||
|
||||
<item>
|
||||
There's a OpenGL/Mesa widget available for GTK+. Grab it at:
|
||||
<verb>
|
||||
http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html
|
||||
</verb>
|
||||
|
||||
</itemize>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>Development with GTK+
|
||||
<!-- ***************************************************************** -->
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I get started?
|
||||
<p>
|
||||
So, after you have installed GTK+ there are a couple of things that can
|
||||
ease you into developing applications with it. There is the
|
||||
GTK+ Tutorial <htmlurl url="http://www.gtk.org/tutorial/"
|
||||
name="<http://www.gtk.org/tutorial/>">, which is undergoing
|
||||
development. This will introduce you to writing applications using C.
|
||||
|
||||
The Tutorial doesn't (yet) contain information on all of the widgets
|
||||
that are in GTK+. For example code on how to use the basics of all the
|
||||
GTK+ widgets you should look at the file gtk/testgtk.c (and associated
|
||||
source files) within the GTK+ distribution. Looking at these exmaples will
|
||||
give you a good grounding on what the widgets can do.
|
||||
|
||||
<sect1>What widgets are in GTK?
|
||||
<p>
|
||||
The GTK+ Tutorial lists the following widgets:
|
||||
<verb>
|
||||
GtkObject
|
||||
+GtkData
|
||||
| +GtkAdjustment
|
||||
| `GtkTooltips
|
||||
`GtkWidget
|
||||
+GtkContainer
|
||||
| +GtkBin
|
||||
| | +GtkAlignment
|
||||
| | +GtkEventBox
|
||||
| | +GtkFrame
|
||||
| | | `GtkAspectFrame
|
||||
| | +GtkHandleBox
|
||||
| | +GtkItem
|
||||
| | | +GtkListItem
|
||||
| | | +GtkMenuItem
|
||||
| | | | `GtkCheckMenuItem
|
||||
| | | | `GtkRadioMenuItem
|
||||
| | | `GtkTreeItem
|
||||
| | +GtkViewport
|
||||
| | `GtkWindow
|
||||
| | +GtkColorSelectionDialog
|
||||
| | +GtkDialog
|
||||
| | | `GtkInputDialog
|
||||
| | `GtkFileSelection
|
||||
| +GtkBox
|
||||
| | +GtkButtonBox
|
||||
| | | +GtkHButtonBox
|
||||
| | | `GtkVButtonBox
|
||||
| | +GtkHBox
|
||||
| | | +GtkCombo
|
||||
| | | `GtkStatusbar
|
||||
| | `GtkVBox
|
||||
| | +GtkColorSelection
|
||||
| | `GtkGammaCurve
|
||||
| +GtkButton
|
||||
| | +GtkOptionMenu
|
||||
| | `GtkToggleButton
|
||||
| | `GtkCheckButton
|
||||
| | `GtkRadioButton
|
||||
| +GtkCList
|
||||
| +GtkFixed
|
||||
| +GtkList
|
||||
| +GtkMenuShell
|
||||
| | +GtkMenuBar
|
||||
| | `GtkMenu
|
||||
| +GtkNotebook
|
||||
| +GtkPaned
|
||||
| | +GtkHPaned
|
||||
| | `GtkVPaned
|
||||
| +GtkScrolledWindow
|
||||
| +GtkTable
|
||||
| +GtkToolbar
|
||||
| `GtkTree
|
||||
+GtkDrawingArea
|
||||
| `GtkCurve
|
||||
+GtkEditable
|
||||
| +GtkEntry
|
||||
| | `GtkSpinButton
|
||||
| `GtkText
|
||||
+GtkMisc
|
||||
| +GtkArrow
|
||||
| +GtkImage
|
||||
| +GtkLabel
|
||||
| | `GtkTipsQuery
|
||||
| `GtkPixmap
|
||||
+GtkPreview
|
||||
+GtkProgressBar
|
||||
+GtkRange
|
||||
| +GtkScale
|
||||
| | +GtkHScale
|
||||
| | `GtkVScale
|
||||
| `GtkScrollbar
|
||||
| +GtkHScrollbar
|
||||
| `GtkVScrollbar
|
||||
+GtkRuler
|
||||
| +GtkHRuler
|
||||
| `GtkVRuler
|
||||
`GtkSeparator
|
||||
+GtkHSeparator
|
||||
`GtkVSeparator
|
||||
</verb>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I prevent redrawing and resizing while I change multiple widgets?
|
||||
<p>
|
||||
Use gtk_container_disable_resize and gtk_container_enable_resize around the
|
||||
code where you are changing a lot of stuff. This will result in much faster
|
||||
speed since it will prevent resizing of the entire widget hierarchy.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I catch a double click event in a list widget?
|
||||
<p>
|
||||
Tim Janik wrote to gtk-list (slightly modified):
|
||||
|
||||
Define a signal handler:
|
||||
|
||||
<tscreen><verb>
|
||||
gint
|
||||
signal_handler_event(GtkWiget *widget, GdkEvenButton *event, gpointer func_data)
|
||||
{
|
||||
if (GTK_IS_LIST_ITEM(widget) &&
|
||||
(event->type==GDK_2BUTTON_PRESS ||
|
||||
event->type==GDK_3BUTTON_PRESS) ) {
|
||||
printf("I feel %s clicked on button %d\",
|
||||
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
|
||||
event->button);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
And connect the handler to your object:
|
||||
|
||||
<tscreen><verb>
|
||||
{
|
||||
/* list, list item init stuff */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_press_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* and/or */
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list_item),
|
||||
"button_release_event",
|
||||
GTK_SIGNAL_FUNC(signal_handler_event),
|
||||
NULL);
|
||||
|
||||
/* something else */
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I find out about the selection of a GtkList?
|
||||
<p>
|
||||
|
||||
Get the selection something like this:
|
||||
<tscreen><verb>
|
||||
GList *sel;
|
||||
sel = GTK_LIST(list)->selection;
|
||||
</verb></tscreen>
|
||||
|
||||
This is how GList is defined (quoting glist.h):
|
||||
<tscreen><verb>
|
||||
typedef struct _GList GList;
|
||||
|
||||
struct _GList
|
||||
{
|
||||
gpointer data;
|
||||
GList *next;
|
||||
GList *prev;
|
||||
};
|
||||
</verb></tscreen>
|
||||
|
||||
A GList structure is just a simple structure for doubly linked lists.
|
||||
there exist several g_list_*() functions to modify a linked list in
|
||||
glib.h. However the GTK_LIST(MyGtkList)->selection is maintained
|
||||
by the gtk_list_*() functions and should not be modified.
|
||||
|
||||
The selection_mode of the GtkList determines the selection
|
||||
facilities of a GtkList and therefore the contents
|
||||
of GTK_LIST(AnyGtkList)->selection:
|
||||
|
||||
<verb>
|
||||
selection_mode GTK_LIST()->selection contents
|
||||
------------------------------------------------------
|
||||
|
||||
GTK_SELECTION_SINGLE) selection is either NULL
|
||||
or contains a GList* pointer
|
||||
for a single selected item.
|
||||
|
||||
GTK_SELECTION_BROWSE) selection is NULL if the list
|
||||
contains no widgets, otherwise
|
||||
it contains a GList* pointer
|
||||
for one GList structure.
|
||||
GTK_SELECTION_MULTIPLE) selection is NULL if no listitems
|
||||
are selected or a a GList* pointer
|
||||
for the first selected item. that
|
||||
in turn points to a GList structure
|
||||
for the second selected item and so
|
||||
on
|
||||
|
||||
GTK_SELECTION_EXTENDED) selection is NULL.
|
||||
</verb>
|
||||
|
||||
The data field of the GList structure GTK_LIST(MyGtkList)->selection points
|
||||
to the first GtkListItem that is selected. So if you would like to determine
|
||||
which listitems are selected you should go like this:
|
||||
|
||||
Upon Initialization:
|
||||
<tscreen><verb>
|
||||
{
|
||||
gchar *list_items[]={
|
||||
"Item0",
|
||||
"Item1",
|
||||
"foo",
|
||||
"last Item",
|
||||
};
|
||||
guint nlist_items=sizeof(list_items)/sizeof(list_items[0]);
|
||||
GtkWidget *list_item;
|
||||
guint i;
|
||||
|
||||
list=gtk_list_new();
|
||||
gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_MULTIPLE);
|
||||
gtk_container_add(GTK_CONTAINER(AnyGtkContainer), list);
|
||||
gtk_widget_show (list);
|
||||
|
||||
for (i = 0; i < nlist_items; i++)
|
||||
{
|
||||
list_item=gtk_list_item_new_with_label(list_items[i]);
|
||||
gtk_object_set_user_data(GTK_OBJECT(list_item), (gpointer)i);
|
||||
gtk_container_add(GTK_CONTAINER(list), list_item);
|
||||
gtk_widget_show(list_item);
|
||||
}
|
||||
}
|
||||
</verb></tscreen>
|
||||
|
||||
To get known about the selection:
|
||||
<tscreen><verb>
|
||||
{
|
||||
GList *items;
|
||||
|
||||
items=GTK_LIST(list)->selection;
|
||||
|
||||
printf("Selected Items: ");
|
||||
while (items) {
|
||||
if (GTK_IS_LIST_ITEM(items->data))
|
||||
printf("%d ", (guint)
|
||||
gtk_object_get_user_data(items->data));
|
||||
items=items->next;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
</verb></tscreen>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Is it possible to get some text displayed which is truncated to fit inside its allocation?
|
||||
<p>
|
||||
GTK's behavior (no clipping) is a consequence of its attempts to
|
||||
conserve X resources. Label widgets (among others) don't get their own
|
||||
X window - they just draw their contents on their parent's window.
|
||||
While it might be possible to have clipping occur by setting the clip
|
||||
mask before drawing the text, this would probably cause a substantial
|
||||
performance penalty.
|
||||
|
||||
Its possible that, in the long term, the best solution to such
|
||||
problems might be just to change gtk to give labels X windows.
|
||||
A short term workaround is to put the label widget inside another
|
||||
widget that does get it's own window - one possible candidate would
|
||||
be the viewport widget.
|
||||
|
||||
<tscreen><verb>
|
||||
viewport = gtk_viewport (NULL, NULL);
|
||||
gtk_widget_set_usize (viewport, 50, 25);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show(viewport);
|
||||
|
||||
label = gtk_label ("a really long label that won't fit");
|
||||
gtk_container_add (GTK_CONTAINER(viewport), label);
|
||||
gtk_widget_show (label);
|
||||
</verb></tscreen>
|
||||
|
||||
If you were doing this for a bunch of widgets, you might want to
|
||||
copy gtkviewport.c and strip out the adjustment and shadow
|
||||
functionality (perhaps you could call it GtkClipper).
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why don't the contents of a button move when the button is pressed? Here's a patch to make it work that way...
|
||||
<p>
|
||||
From: Peter Mattis
|
||||
|
||||
The reason buttons don't move their child down and to the right when
|
||||
they are depressed is because I don't think that's what is happening
|
||||
visually. My view of buttons is that you are looking at them straight
|
||||
on. That is, the user interface lies in a plane and you're above it
|
||||
looking straight at it. When a button gets pressed it moves directly
|
||||
away from you. To be absolutely correct I guess the child should
|
||||
actually shrink a tiny amount. But I don't see why the child should
|
||||
shift down and to the left. Remember, the child is supposed to be
|
||||
attached to the buttons surface. Its not good for it to appear like
|
||||
the child is slipping on the surface of the button.
|
||||
|
||||
On a more practical note, I did implement this at one point and
|
||||
determined it didn't look good and removed it.
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I define a separation line in a menu?
|
||||
<p>
|
||||
See the <htmlurl url="http://www.gtk.org/tutorial/"
|
||||
name="Tutorial"> for information on how to create menus.
|
||||
However, to create a separation line in a menu, just insert an
|
||||
empty menu item:
|
||||
|
||||
<tscreen><verb>
|
||||
menuitem = gtk_menu_item_new();
|
||||
gtk_menu_append(GTK_MENU(menu), menuitem);
|
||||
gtk_widget_show(menuitem);
|
||||
</verb></tscreen>
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How can I right justify a menu, such as Help, when using the MenuFactory?
|
||||
<p>
|
||||
Use something like the following:
|
||||
|
||||
<tscreen><verb>
|
||||
menu_path = gtk_menu_factory_find (factory, "<MyApp>/Help");
|
||||
gtk_menu_item_right_justify(menu_path->widget);
|
||||
</verb></tscreen>
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>How do I make my window modal? / How do I make a single window active?
|
||||
<p>
|
||||
After you create your window, do gtk_grab_add(my_window). And after
|
||||
closing the window do gtk_grab_remove(my_window).
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why doesn't my progressbar update?
|
||||
<p>
|
||||
|
||||
You are probably doing all the progressbar changes within a function
|
||||
without returning control to gtk_main. Most drawing updates are only
|
||||
placed on a queue, which is processed within gtk_main. You can
|
||||
force the drawing queue to be processed using something like:
|
||||
|
||||
<tscreen><verb>
|
||||
while (gtk_events_pending())
|
||||
gtk_main_iteration();
|
||||
</verb></tscreen>
|
||||
|
||||
inside you're function that changes the progress bar.
|
||||
|
||||
What the above snippet does is run all pending events and high priority
|
||||
idle functions, then return immediately (the drawing is done in a
|
||||
high priority idle function).
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>About gdk
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is gdk?
|
||||
<p>
|
||||
gdk is basically a wrapper around the standard Xlib function calls. If you are
|
||||
at all familiar with Xlib, a lot of the functions in gdk will require little
|
||||
or no getting used to. All functions are written to provide an easy way
|
||||
to access Xlib functions in an easier an slightly more intuitive manner.
|
||||
In addition, since gdk uses glib (see below), it will be more portable
|
||||
and safer to use on multiple platforms.
|
||||
|
||||
<!-- Examples, anybody? I've been mulling some over. NF -->
|
||||
|
||||
<sect1>How do I use color allocation?
|
||||
<p>
|
||||
One of the nice things about GDK is that it's based on top of Xlib; this is
|
||||
also a problem, especially in the area of color management. If you want
|
||||
to use color in your program (drawing a rectangle or such, your code
|
||||
should look something like this:
|
||||
<tscreen>
|
||||
<verb>
|
||||
{
|
||||
GdkColor *color;
|
||||
int width, height;
|
||||
GtkWidget *widget;
|
||||
GdkGC *gc;
|
||||
|
||||
...
|
||||
|
||||
/* first, create a GC to draw on */
|
||||
gc = gdk_gc_new(widget->window);
|
||||
|
||||
/* find proper dimensions for rectangle */
|
||||
gdk_window_get_size(widget->window, &width, &height);
|
||||
|
||||
/* the color we want to use */
|
||||
color = (GdkColor *)malloc(sizeof(GdkColor));
|
||||
|
||||
/* red, green, and blue are passed values, indicating the RGB triple
|
||||
* of the color we want to draw. Note that the values of the RGB components
|
||||
* within the GdkColor are taken from 0 to 65535, not 0 to 255.
|
||||
*/
|
||||
color->red = red * (65535/255);
|
||||
color->green = green * (65535/255);
|
||||
color->blue = blue * (65535/255);
|
||||
|
||||
/* the pixel value indicates the index in the colormap of the color.
|
||||
* it is simply a combination of the RGB values we set earlier
|
||||
*/
|
||||
color->pixel = (gulong)(red*65536 + green*256 + blue);
|
||||
|
||||
/* However, the pixel valule is only truly valid on 24-bit (TrueColor)
|
||||
* displays. Therefore, this call is required so that GDK and X can
|
||||
* give us the closest color available in the colormap
|
||||
*/
|
||||
gdk_color_alloc(gtk_widget_get_colormap(widget), color);
|
||||
|
||||
/* set the foreground to our color */
|
||||
gdk_gc_set_foreground(gc, color);
|
||||
|
||||
/* draw the rectangle */
|
||||
gdk_draw_rectangle(widget->window, gc, 1, 0, 0, width, height);
|
||||
|
||||
...
|
||||
}
|
||||
</verb>
|
||||
</tscreen>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>About glib
|
||||
<!-- ***************************************************************** -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>What is glib?
|
||||
<p>
|
||||
glib is a library of useful functions and definitions available for use
|
||||
when creating GDK and GTK applications. It provides replacements for some
|
||||
standard libc functions, such as malloc, which are buggy on some systems.
|
||||
<p>
|
||||
It also provides routines for handling:
|
||||
<itemize>
|
||||
<item>Doubly Linked Lists
|
||||
<item>Singly Linked Lists
|
||||
<item>Timers
|
||||
<item>String Handling
|
||||
<item>A Lexical Scanner
|
||||
<item>Error Functions
|
||||
</itemize>
|
||||
|
||||
<!-- Some Examples might be useful here! NF -->
|
||||
|
||||
<!-- ----------------------------------------------------------------- -->
|
||||
<sect1>Why use g_print, g_malloc, g_strdup and fellow glib functions ?
|
||||
<p>
|
||||
Thanks to Tim Janik who wrote to gtk-list: (slightly modified)
|
||||
<quote>
|
||||
Regarding g_malloc(), g_free() and siblings, these functions are much safer
|
||||
than thier libc equivalences. For example, g_free() just returns if called
|
||||
with NULL. Also, if USE_DMALLOC is defined, the definition for these
|
||||
functions changes (in glib.h) to use MALLOC(), FREE() etc... If MEM_PROFILE
|
||||
or MEM_CHECK are defined, there are even small statistics made counting
|
||||
the used block sizes (shown by g_mem_profile() / g_mem_check()).
|
||||
<p>
|
||||
Considering the fact that glib provides an interface for memory chunks
|
||||
to save space if you have lots of blocks that are always the same size
|
||||
and to mark them ALLOC_ONLY if needed, it is just straight forward to
|
||||
create a small saver (debug able) wrapper around the normal malloc/free
|
||||
stuff as well - just like gdk covers Xlib. ;)
|
||||
<p>
|
||||
Using g_error() and g_warning() inside of applications like the GIMP
|
||||
that fully rely on gtk even gives the opportunity to pop up a window
|
||||
showing the messages inside of a gtk window with your own handler
|
||||
(by using g_set_error_handler()) along the lines of gtk_print()
|
||||
(inside of gtkmain.c).
|
||||
</quote>
|
||||
|
||||
<!-- ***************************************************************** -->
|
||||
<sect>GTK+ FAQ Contributions, Maintainers and Copyright
|
||||
<p>
|
||||
If you would like to make a contribution to the FAQ, send either one of us
|
||||
an e-mail message with the exact text you think should be included (question and
|
||||
answer). With your help, this document can grow and become more useful!
|
||||
|
||||
This document is maintained by Nathan Froyd
|
||||
<htmlurl url="mailto:maestrox@geocities.com" name="<maestrox@geocities.com>">
|
||||
and Tony Gale <htmlurl url="mailto:gale@gimp.org" name="<gale@gimp.org>">.
|
||||
This FAQ was created by Shawn T. Amundson <htmlurl url="mailto:amundson@gimp.org"
|
||||
name="<amundson@gimp.org>">who continues to provide support.
|
||||
|
||||
The GTK+ FAQ is Copyright (C) 1997,1998 by Shawn T. Amundson, Nathan Froyd and Tony Gale.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this manual provided the
|
||||
copyright notice and this permission notice are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this document under the conditions
|
||||
for verbatim copying, provided that this copyright notice is included exactly as in the original,
|
||||
and that the entire resulting derived work is distributed under the terms of a permission
|
||||
notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this document into another language,
|
||||
under the above conditions for modified versions.
|
||||
|
||||
If you are intending to incorporate this document into a published work, please contact one of
|
||||
the maintainers, and we will make an effort to ensure that you have the most up to date
|
||||
information available.
|
||||
|
||||
There is no guarentee that this document lives up to its intended
|
||||
purpose. This is simply provided as a free resource. As such,
|
||||
the authors and maintainers of the information provided within can
|
||||
not make any guarentee that the information is even accurate.
|
||||
|
||||
</article>
|
||||
315
docs/refcounting.txt
Normal file
315
docs/refcounting.txt
Normal file
@@ -0,0 +1,315 @@
|
||||
The Reference Counting Scheme of GDK an GTK+
|
||||
============================================
|
||||
|
||||
Each data structure that provides reference counting offers a bunch of
|
||||
functions that follow these conventions:
|
||||
|
||||
*_new: Create a new structure with a reference count of 1.
|
||||
*_ref: Increase ref count by one.
|
||||
*_unref: Decrease ref count by one. If the count drops to zero,
|
||||
run appropriate finalization code and free the memory.
|
||||
For data structures with a _destroy function, it will be
|
||||
invoked at this point, if the data structure is not
|
||||
already in a destroyed state.
|
||||
|
||||
GtkObjects also provide the following functions:
|
||||
|
||||
*_destroy: Render an object `unusable', but as long as there are
|
||||
references to it, it's allocated memory will not be freed.
|
||||
*_sink: Clear a GtkObjects `floating' state and decrement the
|
||||
reference count by 1.
|
||||
|
||||
GdkWindow
|
||||
---------
|
||||
|
||||
A GdkWindow has to be explicitely destroyed with gdk_window_destroy.
|
||||
This will send out a request to destroy this window and all its
|
||||
children, and will decrement the ref_count of the GdkWindow by one.
|
||||
Thus, it releases the inital reference created by gdk_window_new.
|
||||
|
||||
All GdkWindows are kept in a hash table to translate from their XId to
|
||||
the actual structure and the pointer in the hash table is reflected in
|
||||
the reference count. When a DestroyNotify event is received for a
|
||||
particular GdkWindow, it is removed from the hash table and the
|
||||
ref_count is updated accordingly.
|
||||
|
||||
You can call gdk_window_destroy more than once on a particular
|
||||
GdkWindow, it will only be destroyed when it hasn't been yet. The
|
||||
ref_count is *always* decremented, tho. Be careful.
|
||||
|
||||
Remark: When writing NO_WINDOW widgets, care should be taken about
|
||||
proper referencing/unreferencing of the parent's GdkWindow
|
||||
that is used by the widget.
|
||||
|
||||
GdkPixmap
|
||||
---------
|
||||
|
||||
There is no gdk_pixmap_destroy function. The Pixmap is destroyed when
|
||||
the last reference to it vanishes.
|
||||
|
||||
GdkPixmaps are kept in the same hash table as GdkWindows but the
|
||||
pointer in the hash table is *not* reflected in the ref_count.
|
||||
|
||||
This works only when Pixmaps never get XEvents. I'm not sure if this
|
||||
is the case.
|
||||
|
||||
GdkBitmap
|
||||
---------
|
||||
|
||||
A GdkBitmap is only another name for a special use of GdkPixmap.
|
||||
|
||||
GdkVisual
|
||||
---------
|
||||
|
||||
There are no *_new or *_destroy functions and the *_ref and *_unref
|
||||
functions are noops. GdkVisuals are static structures and thus do not
|
||||
need reference counting. The ref counting functions are only there
|
||||
for extra defensive programming.
|
||||
|
||||
GdkColormap
|
||||
-----------
|
||||
|
||||
Nothing special. There is no gdk_colormap_destroy function.
|
||||
|
||||
GdkFont / GdkFontSet
|
||||
--------------------
|
||||
|
||||
GdkFont and GdkFontSet are equivalent as far as ref counting is
|
||||
concerned. Use gdk_font_ref and gdk_font_unref for both.
|
||||
|
||||
There is no gdk_font_free or gdk_fontset_free function.
|
||||
|
||||
GtkAcceleratorTable
|
||||
-------------------
|
||||
|
||||
There is no gtk_accelerator_table_destroy function.
|
||||
|
||||
GtkTooltips
|
||||
-----------
|
||||
|
||||
There is no gtk_tooltips_destroy function.
|
||||
|
||||
GtkStyle
|
||||
--------
|
||||
|
||||
There is no gtk_style_destroy function.
|
||||
|
||||
GtkObject
|
||||
---------
|
||||
|
||||
GtkObjects follow the usual ref_counting strategy, but with a twist.
|
||||
|
||||
They are created with a ref_count of 1. GtkObjects are able to
|
||||
run finalization code when the ref_count drops to zero but you cannot
|
||||
register arbitrary signal handlers to run at finalization time.
|
||||
|
||||
There is also the old gtk_object_destroy function and the "destroy"
|
||||
signal but they are somewhat independent from finalization. Just as
|
||||
stated at the top of this text, gtk_object_destroy merely renders an
|
||||
object unusable. When the object is a container widget for example,
|
||||
it unrealizes that widget, removes all children and disconnects all
|
||||
signal handlers. The finalization code is different, it would for
|
||||
example free associated memory for text strings and release the
|
||||
attached style.
|
||||
|
||||
This is the biggest change. Every widget must be revised to have a
|
||||
proper "destroy" function, etc. Such a destroy function will only
|
||||
be called once and is expected to leave the widget in a minimal but
|
||||
consistent state. Widgets that have been "destroyed" but not yet
|
||||
finalized are flagged with GTK_DESTROY. The "finalization" function
|
||||
is new and should perform last-minute cleanup actions, in contrast
|
||||
to the destroy function it will not be emitted as signal though.
|
||||
It can assume that the "destroy" function has been called as the
|
||||
last function on this widget.
|
||||
|
||||
Essentially, the old "destroy" function has been split into a
|
||||
"finalize" plus a "destroy" function.
|
||||
|
||||
It is not possible to create GtkObjects with a ref_count of 0
|
||||
because the first ref/unref pair will destroy it unintentionally.
|
||||
|
||||
To be mostly backward compatible with existing practice, a GtkObject
|
||||
leads a more complicated life than the other reference counted structures.
|
||||
|
||||
When a GtkObject is created, it starts out in a special state called
|
||||
"floating" (this is the twist). This means that it is alive and has a
|
||||
reference to it, but the `owner' of this reference is not known.
|
||||
There are certain `potential owners' that will adopt a floating
|
||||
GtkObject. For GtkWidgets the most common adopters are the parent
|
||||
widget.
|
||||
|
||||
When you want to adopt a possibly floating GtkObject, you call
|
||||
gtk_object_sink on it. This clears the floating state of the
|
||||
GtkObject and decrements the ref_count by one, if it has been floating
|
||||
previously. Once the floating state has been cleared, it will never
|
||||
be set again.
|
||||
|
||||
All widgets that are part of the display are linked into a
|
||||
parent/child tree. The link from the parent to a child is reflected
|
||||
in the ref_count of the child, but the link from the child to the
|
||||
parent is not reflected in the ref_count of the parent.
|
||||
|
||||
Like a GtkObject, a GtkWidget is created with a ref_count of 1 and
|
||||
initially flagged as `floating'. As soon as it is added as a child to
|
||||
a parent, the `floating' flag is cleared and never will be set again.
|
||||
Not even when it is later unparented. The act of clearing the
|
||||
`floating' flag also decrements the ref_count of the widget by one.
|
||||
|
||||
When the widget is unparented, its underlying GdkWindow is destroyed
|
||||
(when it has one), it loses its reference from the parent and
|
||||
naturally the ref_count is decremented.
|
||||
|
||||
It is considered a bug if a widget still has a GdkWindow when it is
|
||||
being freed.
|
||||
|
||||
Toplevel widgets, which don't have a `natural' parent, are adopted by
|
||||
special registering functions. Because the of the reference count that
|
||||
is set by the registering functions, toplevel widgets will have to be
|
||||
explicitly destroyed, with the exception of GtkMenus. GtkMenus are a
|
||||
special case of toplevel widgets in that they will be `attached' to and
|
||||
`detached' from other widgets. The act of attaching a GtkMenu to a
|
||||
widget will be reflected in its reference count. The act of detaching
|
||||
a GtkMenu will revert that. Therefore GtkMenus naturally get destroyed
|
||||
and finalized once they are detached from their reference holder.
|
||||
|
||||
So, the typical career of a GtkWindow a GtMenu attached to a
|
||||
GtkOptionMenu looks like this:
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
/* window is created with ref_count == 1. It is not flagged as
|
||||
* `floating' because it has already been registered as a toplevel
|
||||
* widget.
|
||||
*/
|
||||
|
||||
option_menu = gtk_option_menu_new ();
|
||||
/* option_menu->ref_count == 1 and it is flagged as `floating'.
|
||||
*/
|
||||
|
||||
gtk_container_add (window, option_menu);
|
||||
/* option_menu->ref_count still == 1, but it is no longer `floating'.
|
||||
*/
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
/* menu->ref_count == 1 and it is flagged as `floating'.
|
||||
*/
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ("Choose Me");
|
||||
/* menu_item->ref_count == 1 and it is flagged as `floating'.
|
||||
*/
|
||||
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
/* menu_item->ref_count still == 1, but it is no longer `floating'.
|
||||
*/
|
||||
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
/* menu->ref_count still == 1, but it is no longer `floating'.
|
||||
*/
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_widget_show (option_menu);
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* The widgets get their GdkWindows, nothing significant happens to
|
||||
* the ref_counts.
|
||||
*/
|
||||
|
||||
Then, when the user wants to get rid of the window:
|
||||
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
/* The GdkWindow of `window' and all its child GdkWindows are
|
||||
* destroyed.
|
||||
*
|
||||
* window is unregistered from the loplevel list and its ref_count
|
||||
* drops to zero. The destroy code of `window' destroyes `option_menu'.
|
||||
*
|
||||
* The destroy code of `option_menu' causes the `menu' to be detached
|
||||
* from it and its reference count drops to zero.
|
||||
*
|
||||
* The destroy code of `menu' destroyes `menu_item'.
|
||||
*
|
||||
* The destruction of `menu_item' removes it from its parent, the
|
||||
* menu_item->ref_count drops to zero and `menu_item' is finalized (freed).
|
||||
*
|
||||
* Now `menu', `option_menu' and `window' will be destroyed and finalized,
|
||||
* in this order, since the reference count of each is zero.
|
||||
*/
|
||||
|
||||
|
||||
Taking care of proper referencing
|
||||
---------------------------------
|
||||
|
||||
There are some cases where referencing of widgets from outside the toolkit
|
||||
(on the application side is needed).
|
||||
Once the application performes an operation on a widget that will cause
|
||||
its reference count to drop, if it wants to take further actions on the
|
||||
widget, it needs to hold a reference to it.
|
||||
|
||||
Example code sequences that require reference wraps:
|
||||
|
||||
/* gtk_container_remove() will unparent the child and therefore
|
||||
* cause it's reference count to be decremented by one.
|
||||
*/
|
||||
gtk_widget_ref (widget);
|
||||
gtk_container_remove (container, widget);
|
||||
/* without the reference count, the widget would have been destroyed here.
|
||||
*/
|
||||
gtk_container_add (container, widget);
|
||||
gtk_widget_unref (widget);
|
||||
|
||||
|
||||
/* all items in item_list need to be referenced
|
||||
* before gtk_list_remove_items() is invoked.
|
||||
* this is somewhat tricky as gtk_list_append_items/gtk_list_prepend_items/
|
||||
* gtk_list_insert_items will take over the lists nodes.
|
||||
* we therefore have an extra GSList `*slist' for later unreferencing.
|
||||
*/
|
||||
slist = NULL;
|
||||
for (list = item_list; list; list = list->next)
|
||||
{
|
||||
gtk_widget_ref (GTK_WIDGET (list->data));
|
||||
slist = g_slist_prepend (slist, list->data);
|
||||
}
|
||||
gtk_list_remove_items (list, item_list);
|
||||
gtk_list_append_items (other_list, item_list);
|
||||
/* gtk_list_prepend_items (other_list, item_list); */
|
||||
/* gtk_list_insert_items (other_list, item_list, 3); */
|
||||
while (slist)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
tmp = slist;
|
||||
slist = slist->next;
|
||||
gtk_widget_unref (GTK_WIDGET (tmp->data));
|
||||
g_slist_free_1 (tmp);
|
||||
}
|
||||
|
||||
/* Alternatively to the removal above you could just use
|
||||
* gtk_list_remove_items_no_unref() which will add the additional
|
||||
* reference count to the widget.
|
||||
*/
|
||||
gtk_list_remove_items_no_unref (list, item_list);
|
||||
gtk_list_prepend_items (other_list, item_list);
|
||||
|
||||
|
||||
Now a (hopefully) complete list of functions that require
|
||||
wrappers similar to the examples above:
|
||||
|
||||
void gtk_container_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
void gtk_list_remove_items (GtkList *list,
|
||||
GList *items);
|
||||
void gtk_tree_remove_items (GtkTree *tree,
|
||||
GList *items);
|
||||
void gtk_tree_item_remove_subtree (GtkTreeItem *tree_item);
|
||||
void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item);
|
||||
void gtk_option_menu_remove_menu (GtkOptionMenu *option_menu);
|
||||
|
||||
|
||||
|
||||
Initial proposal:
|
||||
- Marius Vollmer <mvo@zagadka.ping.de>
|
||||
|
||||
Some modifications/additions, "Taking care of proper referencing" and
|
||||
reference counting solution for GtkMenus:
|
||||
- Tim Janik <timj@gimp.org>
|
||||
104
docs/styles.txt
Normal file
104
docs/styles.txt
Normal file
@@ -0,0 +1,104 @@
|
||||
HANDLING WIDGET STYLES
|
||||
======================
|
||||
|
||||
|
||||
A widget gets created with a default style.
|
||||
The global default style can be affected by gtk_widget_set_default_style()
|
||||
and can be queried by gtk_widget_get_default_style().
|
||||
The initial style that is assigned to a widget as default style upon
|
||||
creation can be affected by wrapping the widget's creation as follows:
|
||||
gtk_widget_push_style (my_style);
|
||||
widget = gtk_type_new (gtk_button_get_type ());
|
||||
gtk_widget_pop_style ();
|
||||
|
||||
There are certain functions to affect widget styles after a widget's
|
||||
creation:
|
||||
|
||||
gtk_widget_set_style ()
|
||||
Save the default style and set a user style.
|
||||
This will override a previously set user style or
|
||||
previously set rc styles.
|
||||
|
||||
gtk_widget_set_rc_style ()
|
||||
Set GTK_RC_STYLE to indicate that an rc lookup has been performed.
|
||||
If there is an rc style for a widget, set it and save the default style,
|
||||
restore the default style otherwise.
|
||||
This will override a previously set user style or rc style.
|
||||
|
||||
gtk_widget_restore_default_style ()
|
||||
Reset the widget's style to the default style, this is only usefull if
|
||||
the widgets default style had been saved by previous calls to
|
||||
gtk_widget_set_style() or gtk_widget_set_rc_style().
|
||||
|
||||
gtk_widget_ensure_style ()
|
||||
Ensure taht the widget either has a user style set, or an rc lookup
|
||||
has been performed.
|
||||
|
||||
gtk_rc_get_style ()
|
||||
Return an rc style for a widget if there is one.
|
||||
|
||||
gtk_widget_set_name ()
|
||||
Change widget name, and perform a new rc lookup if no user style
|
||||
is set.
|
||||
|
||||
gtk_widget_realize ()
|
||||
Besides realizing the widget this function will:
|
||||
- perform an rc lookup if neccessary,
|
||||
- attach a widget's style.
|
||||
|
||||
gtk_widget_get_style ()
|
||||
Return a widgets style, this function will perform an rc lookup
|
||||
if neccessary.
|
||||
|
||||
gtk_widget_set_parent ()
|
||||
This function will perform rc lookups recursively for all widgets
|
||||
that do not have a user style set.
|
||||
|
||||
gtk_style_copy ()
|
||||
This function can be used to copy a widgets style.
|
||||
The style can subsequntly be changed (e.g., by modifications to the
|
||||
red/green/blue values of a certain color) and then be applied to the
|
||||
widget via gtk_widget_set_style().
|
||||
|
||||
|
||||
GtkWidget::style_set
|
||||
This signal will be emitted for a widget once its style changes with
|
||||
an additional argument previous_style wich will hold the widget->style
|
||||
avlue from a previous emission.
|
||||
The initial emission of this signal is guaranteed to happen prior
|
||||
to any GtkWidget::size_request emission, and will have the previous_style
|
||||
argument set to NULL.
|
||||
The GtkWidgetClass implements a default handler for this signal that
|
||||
will set the widget's window's background of widgets that provide their
|
||||
own windows according to the new style.
|
||||
Derived widgets need to overide this default handler, if:
|
||||
- their size requisition depends on the current style.
|
||||
(e.g., on the style's fonts)
|
||||
- they set the background of widget->window to something other than.
|
||||
style->bg. (e.g., GtkListItem)
|
||||
- the widget provides windows other than widget->window.
|
||||
- the widget has any other stored dependencies on the style.
|
||||
|
||||
|
||||
|
||||
Flag indications:
|
||||
|
||||
!GTK_RC_STYLE && !GTK_USER_STYLE:
|
||||
The widget has it's default style set, no rc lookup has been
|
||||
performed, the widget has not been size requested yet and is
|
||||
therefore not yet realized.
|
||||
|
||||
GTK_USER_STYLE:
|
||||
GTK_RC_STYLE is not set.
|
||||
The widget has a user style assigned, and it's default style has been
|
||||
saved.
|
||||
|
||||
GTK_RC_STYLE:
|
||||
GTK_USER_STYLE is not set.
|
||||
If the widget has a saved default style, it has been assigned an
|
||||
rc style. If the widget does not have a saved default style, it still
|
||||
has its default style but an rc lookup has already been performed.
|
||||
|
||||
|
||||
- Tim Janik <timj@gimp.org>
|
||||
1998/02/27
|
||||
487
docs/text_widget.txt
Normal file
487
docs/text_widget.txt
Normal file
@@ -0,0 +1,487 @@
|
||||
Date: Sun, 14 Sep 1997 20:17:06 -0700 (PDT)
|
||||
From: Josh MacDonald <jmacd@CS.Berkeley.EDU>
|
||||
To: gnome@athena.nuclecu.unam.mx, gtk-list@redhat.com
|
||||
Subject: [gtk-list] gtktext widget internal documentation
|
||||
|
||||
|
||||
Pete convinced me to just write up the text widget and let someone else
|
||||
finish it. I'm pretty busy and have other commitments now. Sorry. I think
|
||||
I'm not the most qualified for some of the remaining work anyway, because I
|
||||
don't really know Gtk and it's event model very well. Most of the work so
|
||||
far was possible without knowing Gtk all that well, it was simply a data
|
||||
structure exercise (though after reading this you might say it was a fairly
|
||||
complicated data structure exercise). I'm happy to answer questions.
|
||||
|
||||
-josh
|
||||
|
||||
|
||||
High level description:
|
||||
|
||||
There are several layers of data structure to the widget. They are
|
||||
seperated from each other as much as possible. The first is a gapped
|
||||
text segment similar to the data structure Emacs uses for representing
|
||||
text. Then there is a property list, which stores text properties for
|
||||
various ranges of text. There is no direct relation between the text
|
||||
property list and the gapped text segment. Finally there is a drawn
|
||||
line parameter cache to speed calculations when drawing and redrawing
|
||||
lines on screen. In addition to these data structures, there are
|
||||
structures to help iterate over text in the buffer.
|
||||
|
||||
The gapped text segment is quite simple. It's parameters are (all
|
||||
parameters I mention here are in the structure GtkText):
|
||||
|
||||
guchar* text;
|
||||
guint text_len;
|
||||
guint gap_position;
|
||||
guint gap_size;
|
||||
guint text_end;
|
||||
|
||||
TEXT is the buffer, TEXT_LEN is its allocated length. TEXT_END is the
|
||||
length of the text, including the gap. GAP_POSITION is the start of
|
||||
the gap, and GAP_SIZE is the gap's length. Therefore, TEXT_END -
|
||||
GAP_SIZE is the length of the text in the buffer. The macro
|
||||
TEXT_LENGTH returns this value. To get the value of a character in
|
||||
the buffer, use the macro TEXT_INDEX(TEXT,INDEX). This macro tests
|
||||
whether the index is less than the GAP_POSITION and returns
|
||||
TEXT[INDEX] or returns TEXT[GAP_SIZE+INDEX]. The function
|
||||
MOVE_GAP_TO_POINT positions the gap to a particular index. The
|
||||
function MAKE_FORWARD_SPACE lengthens the gap to provide room for a
|
||||
certain number of characters.
|
||||
|
||||
The property list is a doubly linked list (GList) of text property
|
||||
data for each contiguous set of characters with similar properties.
|
||||
The data field of the GList points to a TextProperty structure, which
|
||||
contains:
|
||||
|
||||
TextFont* font;
|
||||
GdkColor* back_color;
|
||||
GdkColor* fore_color;
|
||||
guint length;
|
||||
|
||||
Currently, only font and color data are contained in the property
|
||||
list, but it can be extended by modifying the INSERT_TEXT_PROPERTY,
|
||||
TEXT_PROPERTIES_EQUAL, and a few other procedures. The text property
|
||||
structure does not contain an absolute offset, only a length. As a
|
||||
result, inserting a character into the buffer simply requires moving
|
||||
the gap to the correct position, making room in the buffer, and either
|
||||
inserting a new property or extending the old one. This logic is done
|
||||
by INSERT_TEXT_PROPERTY. A similar procedure exists to delete from
|
||||
the text property list, DELETE_TEXT_PROPERTY. Since the property
|
||||
structure doesn't contain an offset, insertion into the list is an
|
||||
O(1) operation. All such operations act on the insertion point, which
|
||||
is the POINT field of the GtkText structure.
|
||||
|
||||
The GtkPropertyMark structure is used for keeping track of the mapping
|
||||
between absolute buffer offsets and positions in the property list.
|
||||
These will be referred to as property marks. Generally, there are
|
||||
four property marks the system keeps track of. Two are trivial, the
|
||||
beginning and the end of the buffer are easy to find. The other two
|
||||
are the insertion point (POINT) and the cursor point (CURSOR_MARK).
|
||||
All operations on the text buffer are done using a property mark as a
|
||||
sort of cursor to keep track of the alignment of the property list and
|
||||
the absolute buffer offset. The GtkPropertyMark structure contains:
|
||||
|
||||
GList* property;
|
||||
guint offset;
|
||||
guint index;
|
||||
|
||||
PROPERTY is a pointer at the current property list element. INDEX is
|
||||
the absolute buffer index, and OFFSET is the offset of INDEX from the
|
||||
beginning of PROPERTY. It is essential to keep property marks valid,
|
||||
or else you will have the wrong text properties at each property mark
|
||||
transition. An important point is that all property marks are invalid
|
||||
after a buffer modification unless care is taken to keep them
|
||||
accurate. That is the difficulty of the insert and delete operations,
|
||||
because as the next section describes, line data is cached and by
|
||||
neccesity contains text property marks. The functions for operating
|
||||
and computing property marks are:
|
||||
|
||||
void advance_mark (GtkPropertyMark* mark);
|
||||
void decrement_mark (GtkPropertyMark* mark);
|
||||
void advance_mark_n (GtkPropertyMark* mark, gint n);
|
||||
void decrement_mark_n (GtkPropertyMark* mark, gint n);
|
||||
void move_mark_n (GtkPropertyMark* mark, gint n);
|
||||
|
||||
GtkPropertyMark find_mark (GtkText* text, guint mark_position);
|
||||
GtkPropertyMark find_mark_near (GtkText* text, guint mark_position,
|
||||
const GtkPropertyMark* near);
|
||||
|
||||
ADVANCE_MARK and DECREMENT_MARK modify the mark by plus or minus one
|
||||
buffer index. ADVANCE_MARK_N and DECREMENT_MARK_N modify the mark by
|
||||
plus or minus N indices. MOVE_MARK_N accepts a positive or negative
|
||||
argument. FIND_MARK returns a mark at MARK_POSITION using a linear
|
||||
search from the nearest known property mark (the beginning, the end,
|
||||
the point, etc). FIND_MARK_NEAR also does a linear search, but
|
||||
searches from the NEAR argument. A number of macros exist at the top
|
||||
of the file for doing things like getting the current text property,
|
||||
or some component of the current property. See the MARK_* macros.
|
||||
|
||||
Next there is a LineParams structure which contains all the
|
||||
information neccesary to draw one line of text on screen. When I say
|
||||
"line" here, I do not mean one line of text seperated by newlines,
|
||||
rather I mean one row of text on screen. It is a matter of policy how
|
||||
visible lines are chosen and there are currently two policies,
|
||||
line-wrap and no-line-wrap. I suspect it would not be difficult to
|
||||
implement new policies for doing such things as justification. The
|
||||
LineParams structure includes the following fields:
|
||||
|
||||
guint font_ascent;
|
||||
guint font_descent;
|
||||
guint pixel_width;
|
||||
guint displayable_chars;
|
||||
guint wraps : 1;
|
||||
|
||||
PrevTabCont tab_cont;
|
||||
PrevTabCont tab_cont_next;
|
||||
|
||||
GtkPropertyMark start;
|
||||
GtkPropertyMark end;
|
||||
|
||||
FONT_ASCENT and FONT_DESCENT are the maximum ascent and descent of any
|
||||
character in the line. PIXEL_WIDTH is the number of pixels wide the
|
||||
drawn region is, though I don't think it's actually being used
|
||||
currently. You may wish to remove this field, eventually, though I
|
||||
suspect it will come in handy implementing horizontal scrolling.
|
||||
DISPLAYABLE_CHARS is the number of characters in the line actually
|
||||
drawn. This may be less than the number of characters in the line
|
||||
when line wrapping is off (see below). The bitflag WRAPS tells
|
||||
whether the next line is a continuation of this line. START and END
|
||||
are the marks at the beginning and end of the line. Note that END is
|
||||
the actual last character, not one past it, so the smallest line
|
||||
(containing, for example, one newline) has START == END. TAB_CONT and
|
||||
TAB_CONT_NEXT are for computation of tab positions. I will discuss
|
||||
them later.
|
||||
|
||||
A point about the end of the buffer. You may be tempted to consider
|
||||
working with the buffer as an array of length TEXT_LENGTH(TEXT), but
|
||||
you have to be careful that the editor allows you to position your
|
||||
cursor at the last index of the buffer, one past the last character.
|
||||
The macro LAST_INDEX(TEXT, MARK) returns true if MARK is positioned at
|
||||
this index. If you see or add a special case in the code for this
|
||||
end-of-buffer case, make sure to use LAST_INDEX if you can. Very
|
||||
often, the last index is treated as a newline.
|
||||
|
||||
[ One way the last index is special is that, although it is always
|
||||
part of some property, it will never be part of a property of
|
||||
length 1 unless there are no other characters in the text. That
|
||||
is, its properties are always that of the preceding character,
|
||||
if any.
|
||||
|
||||
There is a fair bit of special case code to mantain this condition -
|
||||
which is needed so that user has control over the properties of
|
||||
characters inserted at the last position. OWT 2/9/98 ]
|
||||
|
||||
Tab stops are variable width. A list of tab stops is contained in the
|
||||
GtkText structure:
|
||||
|
||||
GList *tab_stops;
|
||||
gint default_tab_width;
|
||||
|
||||
The elements of tab_stops are integers casted to gpointer. This is a
|
||||
little bogus, but works. For example:
|
||||
|
||||
text->default_tab_width = 4;
|
||||
text->tab_stops = NULL;
|
||||
text->tab_stops = g_list_prepend (text->tab_stops, (void*)8);
|
||||
text->tab_stops = g_list_prepend (text->tab_stops, (void*)8);
|
||||
|
||||
is how these fields are initialized, currently. This means that the
|
||||
first two tabs occur at 8 and 16, and every 4 characters thereafter.
|
||||
Tab stops are used in the computation of line geometry (to fill in a
|
||||
LineParams structure), and the width of the space character in the
|
||||
current font is used. The PrevTabCont structure, of which two are
|
||||
stored per line, is used to compute the geometry of lines which may
|
||||
have wrapped and carried part of a tab with them:
|
||||
|
||||
guint pixel_offset;
|
||||
TabStopMark tab_start;
|
||||
|
||||
PIXEL_OFFSET is the number of pixels at which the line should start,
|
||||
and tab_start is a tab stop mark, which is similar to a property mark,
|
||||
only it keeps track of the mapping between line position (column) and
|
||||
the next tab stop. A TabStopMark contains:
|
||||
|
||||
GList* tab_stops;
|
||||
gint to_next_tab;
|
||||
|
||||
TAB_STOPS is a pointer into the TAB_STOPS field of the GtkText
|
||||
structure. TO_NEXT_TAB is the number of characters before the next
|
||||
tab. The functions ADVANCE_TAB_MARK and ADVANCE_TAB_MARK_N advance
|
||||
these marks. The LineParams structure contains two PrevTabCont
|
||||
structures, which each contain a tab stop. The first (TAB_CONT) is
|
||||
for computing the beginning pixel offset, as mentioned above. The
|
||||
second (TAB_CONT_NEXT) is used to initialize the TAB_CONT field of the
|
||||
next line if it wraps.
|
||||
|
||||
Since computing the parameters of a line are fairly complicated, I
|
||||
have one interface that should be all you ever need to figure out
|
||||
something about a line. The function FIND_LINE_PARAMS computes the
|
||||
parameters of a single line. The function LINE_PARAMS_ITERATE is used
|
||||
for computing the properties of some number (> 0) of sequential lines.
|
||||
|
||||
void
|
||||
line_params_iterate (GtkText* text,
|
||||
const GtkPropertyMark* mark0,
|
||||
const PrevTabCont* tab_mark0,
|
||||
gboolean alloc,
|
||||
gpointer data,
|
||||
LineIteratorFunction iter);
|
||||
|
||||
where LineIteratorFunction is:
|
||||
|
||||
typedef gint (*LineIteratorFunction) (GtkText* text,
|
||||
LineParams* lp,
|
||||
gpointer data);
|
||||
|
||||
The arguments are a text widget (TEXT), the property mark at the
|
||||
beginning of the first line (MARK0), the tab stop mark at the
|
||||
beginning of that line (TAB_MARK0), whether to heap-allocate the
|
||||
LineParams structure (ALLOC), some client data (DATA), and a function
|
||||
to call with the parameters of each line. TAB_MARK0 may be NULL, but
|
||||
if so MARK0 MUST BE A REAL LINE START (not a continued line start; it
|
||||
is preceded by a newline). If TAB_MARK0 is not NULL, MARK0 may be any
|
||||
line start (continued or not). See the code for examples. The
|
||||
function ITER is called with each LineParams computed. If ALLOC was
|
||||
true, LINE_PARAMS_ITERATE heap-allocates the LineParams and does not
|
||||
free them. Otherwise, no storage is permanently allocated. ITER
|
||||
should return TRUE when it wishes to continue no longer.
|
||||
|
||||
There are currently two uses of LINE_PARAMS_ITERATE:
|
||||
|
||||
* Compute the total buffer height for setting the parameters of the
|
||||
scroll bars. This is done in SET_VERTICAL_SCROLL each time the
|
||||
window is resized. When horizontal scrolling is added, depending on
|
||||
the policy chosen, the max line width can be computed here as well.
|
||||
|
||||
* Computing geometry of some pixel height worth of lines. This is
|
||||
done in FETCH_LINES, FETCH_LINES_BACKWARD, FETCH_LINES_FORWARD, etc.
|
||||
|
||||
The GtkText structure contains a cache of the LineParams data for all
|
||||
visible lines:
|
||||
|
||||
GList *current_line;
|
||||
GList *line_start_cache;
|
||||
|
||||
guint first_line_start_index;
|
||||
guint first_cut_pixels;
|
||||
guint first_onscreen_hor_pixel;
|
||||
guint first_onscreen_ver_pixel;
|
||||
|
||||
LINE_START_CACHE is a doubly linked list of LineParams. CURRENT_LINE
|
||||
is a transient piece of data which is set in varoius places such as
|
||||
the mouse click code. Generally, it is the line on which the cursor
|
||||
property mark CURSOR_MARK is on. LINE_START_CACHE points to the first
|
||||
visible line and may contain PREV pointers if the cached data of
|
||||
offscreen lines is kept around. I haven't come up with a policy. The
|
||||
cache can keep more lines than are visible if desired, but the result
|
||||
is that inserts and deletes will then become slower as the entire
|
||||
cache has to be "corrected". Right now it doesn't delete from the
|
||||
cache (it should). As a result, scrolling through the whole buffer
|
||||
once will fill the cache with an entry for each line, and subsequent
|
||||
modifications will be slower than they should
|
||||
be. FIRST_LINE_START_INDEX is the index of the *REAL* line start of
|
||||
the first line. That is, if the first visible line is a continued
|
||||
line, this is the index of the real line start (preceded by a
|
||||
newline). FIRST_CUT_PIXELS is the number of pixels which are not
|
||||
drawn on the first visible line. If FIRST_CUT_PIXELS is zero, the
|
||||
whole line is visible. FIRST_ONSCREEN_HOR_PIXEL is not used.
|
||||
FIRST_ONSCREEN_VER_PIXEL is the absolute pixel which starts the
|
||||
visible region. This is used for setting the vertical scroll bar.
|
||||
|
||||
Other miscellaneous things in the GtkText structure:
|
||||
|
||||
Gtk specific things:
|
||||
|
||||
GtkWidget widget;
|
||||
|
||||
GdkWindow *text_area;
|
||||
|
||||
GtkAdjustment *hadj;
|
||||
GtkAdjustment *vadj;
|
||||
|
||||
GdkGC *gc;
|
||||
|
||||
GdkPixmap* line_wrap_bitmap;
|
||||
GdkPixmap* line_arrow_bitmap;
|
||||
|
||||
These are pretty self explanatory, especially if you know Gtk.
|
||||
LINE_WRAP_BITMAP and LINE_ARROW_BITMAP are two bitmaps used to
|
||||
indicate that a line wraps and is continued offscreen, respectively.
|
||||
|
||||
Some flags:
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_editable : 1;
|
||||
guint line_wrap : 1;
|
||||
guint freeze : 1;
|
||||
guint has_selection : 1;
|
||||
guint own_selection : 1;
|
||||
|
||||
HAS_CURSOR is true iff the cursor is visible. IS_EDITABLE is true iff
|
||||
the user is allowed to modify the buffer. If IS_EDITABLE is false,
|
||||
HAS_CURSOR is guaranteed to be false. If IS_EDITABLE is true,
|
||||
HAS_CURSOR starts out false and is set to true the first time the user
|
||||
clicks in the window. LINE_WRAP is where the line-wrap policy is
|
||||
set. True means wrap lines, false means continue lines offscreen,
|
||||
horizontally.
|
||||
|
||||
The text properties list:
|
||||
|
||||
GList *text_properties;
|
||||
GList *text_properties_end;
|
||||
|
||||
A scratch area used for constructing a contiguous piece of the buffer
|
||||
which may otherwise span the gap. It is not strictly neccesary
|
||||
but simplifies the drawing code because it does not need to deal with
|
||||
the gap.
|
||||
|
||||
guchar* scratch_buffer;
|
||||
guint scratch_buffer_len;
|
||||
|
||||
The last vertical scrollbar position. Currently this looks the same
|
||||
as FIRST_ONSCREEN_VER_PIXEL. I can't remember why I have two values.
|
||||
Perhaps someone should clean this up.
|
||||
|
||||
gint last_ver_value;
|
||||
|
||||
The cursor:
|
||||
|
||||
gint cursor_pos_x;
|
||||
gint cursor_pos_y;
|
||||
GtkPropertyMark cursor_mark;
|
||||
gchar cursor_char;
|
||||
gchar cursor_char_offset;
|
||||
gint cursor_virtual_x;
|
||||
gint cursor_drawn_level;
|
||||
|
||||
CURSOR_POS_X and CURSOR_POS_Y are the screen coordinates of the
|
||||
cursor. CURSOR_MARK is the buffer position. CURSOR_CHAR is
|
||||
TEXT_INDEX (TEXT, CURSOR_MARK.INDEX) if a drawable character, or 0 if
|
||||
it is whitespace, which is treated specially. CURSOR_CHAR_OFFSET is
|
||||
the pixel offset above the base of the line at which it should be
|
||||
drawn. Note that the base of the line is not the "baseline" in the
|
||||
traditional font metric sense. A line (LineParams) is
|
||||
FONT_ASCENT+FONT_DESCENT high (use the macro LINE_HEIGHT). The
|
||||
"baseline" is FONT_DESCENT below the base of the line. I think this
|
||||
requires a drawing.
|
||||
|
||||
0 AAAAAAA
|
||||
1 AAAAAAA
|
||||
2 AAAAAAAAA
|
||||
3 AAAAAAAAA
|
||||
4 AAAAA AAAAA
|
||||
5 AAAAA AAAAA
|
||||
6 AAAAA AAAAA
|
||||
7 AAAAA AAAAA
|
||||
8 AAAAA AAAAA
|
||||
9 AAAAAAAAAAAAAAAAA
|
||||
10 AAAAAAAAAAAAAAAAA
|
||||
11 AAAAA AAAAA
|
||||
12 AAAAA AAAAA
|
||||
13 AAAAAA AAAAAA
|
||||
14______________AAAAA___________AAAAA__________________________________
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
|
||||
This line is 20 pixels high, has FONT_ASCENT=14, FONT_DESCENT=6. It's
|
||||
"base" is at y=20. Characters are drawn at y=14. The LINE_START
|
||||
macro returns the pixel height. The LINE_CONTAINS macro is true if
|
||||
the line contains a certain buffer index. The LINE_STARTS_AT macro is
|
||||
true if the line starts at a certain buffer index. The
|
||||
LINE_START_PIXEL is the pixel offset the line should be drawn at,
|
||||
according the the tab continuation of the previous line.
|
||||
|
||||
Exposure and drawing:
|
||||
|
||||
Exposure is handled from the EXPOSE_TEXT function. It assumes that
|
||||
the LINE_START_CACHE and all it's parameters are accurate and simply
|
||||
exposes any line which is in the exposure region. It calls the
|
||||
CLEAR_AREA function to clear the background and/or lay down a pixmap
|
||||
background. The text widget has a scrollable pixmap background, which
|
||||
is implemented in CLEAR_AREA. CLEAR_AREA does the math to figure out
|
||||
how to tile the pixmap itself so that it can scroll the text with a
|
||||
copy area call. If the CURSOR argument to EXPOSE_TEXT is true, it
|
||||
also draws the cursor.
|
||||
|
||||
The function DRAW_LINE draws a single line, doing all the tab and
|
||||
color computations neccesary. The function DRAW_LINE_WRAP draws the
|
||||
line wrap bitmap at the end of the line if it wraps. TEXT_EXPOSE will
|
||||
expand the cached line data list if it has to by calling
|
||||
FETCH_LINES_FORWARD. The functions DRAW_CURSOR and UNDRAW_CURSOR draw
|
||||
and undraw the cursor. They count the number of draws and undraws so
|
||||
that the cursor may be undrawn even if the cursor is already undrawn
|
||||
and the re-draw will not occur too early. This is useful in handling
|
||||
scrolling.
|
||||
|
||||
Handling of the cursor is a little messed up, I should add. It has to
|
||||
be undrawn and drawn at various places. Something better needs to be
|
||||
done about this, because it currently doesn't do the right thing in
|
||||
certain places. I can't remember where very well. Look for the calls
|
||||
to DRAW_CURSOR and UNDRAW_CURSOR.
|
||||
|
||||
RECOMPUTE_GEOMETRY is called when the geometry of the window changes
|
||||
or when it is first drawn. This is probably not done right. My
|
||||
biggest weakness in writing this code is that I've never written a
|
||||
widget before so I got most of the event handling stuff wrong as far
|
||||
as Gtk is concerned. Fortunatly, most of the code is unrelated and
|
||||
simply an exercise in data structure manipulation.
|
||||
|
||||
Scrolling:
|
||||
|
||||
Scrolling is fairly straighforward. It looks at the top line, and
|
||||
advances it pixel by pixel until the FIRST_CUT_PIXELS equals the line
|
||||
height and then advances the LINE_START_CACHE. When it runs out of
|
||||
lines it fetches more. The function SCROLL_INT is used to scroll from
|
||||
inside the code, it calls the appropriate functions and handles
|
||||
updating the scroll bars. It dispatches a change event which causes
|
||||
Gtk to call the correct scroll action, which then enters SCROLL_UP or
|
||||
SCROLL_DOWN. Careful with the cursor during these changes.
|
||||
|
||||
Insertion, deletion:
|
||||
|
||||
There's some confusion right now over what to do with the cursor when
|
||||
it's offscreen due to scrolling. This is a policy decision. I don't
|
||||
know what's best. Spencer criticized me for forcing it to stay
|
||||
onscreen. It shouldn't be hard to make stuff work with the cursor
|
||||
offscreen.
|
||||
|
||||
Currently I've got functions to do insertion and deletion of a single
|
||||
character. It's fairly complicated. In order to do efficient pasting
|
||||
into the buffer, or write code that modifies the buffer while the
|
||||
buffer is drawn, it needs to do multiple characters at at time. This
|
||||
is the hardest part of what remains. Currently, gtk_text_insert does
|
||||
not reexpose the modified lines. It needs to. Pete did this wrong at
|
||||
one point and I disabled modification completely, I don't know what
|
||||
the current state of things are. The functions
|
||||
INSERT_CHAR_LINE_EXPOSE and DELETE_CHAR_LINE_EXPOSE do the work.
|
||||
Here's pseudo code for insert. Delete is quite similar.
|
||||
|
||||
insert character into the buffer
|
||||
update the text property list
|
||||
move the point
|
||||
undraw the cursor
|
||||
correct all LineParams cache entries after the insertion point
|
||||
compute the new height of the modified line
|
||||
compare with the old height of the modified line
|
||||
remove the old LineParams from the cache
|
||||
insert the new LineParams into the cache
|
||||
if the lines are of different height, do a copy area to move the
|
||||
area below the insertion down
|
||||
expose the current line
|
||||
update the cursor mark
|
||||
redraw the cursor
|
||||
|
||||
What needs to be done:
|
||||
|
||||
Horizintal scrolling, robustness, testing, selection handling. If you
|
||||
want to work in the text widget pay attention to the debugging
|
||||
facilities I've written at the end of gtktext.c. I'm sorry I waited
|
||||
so long to try and pass this off. I'm super busy with school and
|
||||
work, and when I have free time my highest priority is another version
|
||||
of PRCS.
|
||||
|
||||
Feel free to ask me questions.
|
||||
9383
docs/tutorial/gtk_tut.sgml
Normal file
9383
docs/tutorial/gtk_tut.sgml
Normal file
File diff suppressed because it is too large
Load Diff
8340
docs/tutorial/gtk_tut_it.sgml
Normal file
8340
docs/tutorial/gtk_tut_it.sgml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
docs/tutorial/gtk_tut_packbox1.gif
Normal file
BIN
docs/tutorial/gtk_tut_packbox1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
BIN
docs/tutorial/gtk_tut_packbox2.gif
Normal file
BIN
docs/tutorial/gtk_tut_packbox2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
BIN
docs/tutorial/gtk_tut_table.gif
Normal file
BIN
docs/tutorial/gtk_tut_table.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
493
docs/widget_system.txt
Normal file
493
docs/widget_system.txt
Normal file
@@ -0,0 +1,493 @@
|
||||
Notes about the inner workings of the widget system of GTK+
|
||||
===========================================================
|
||||
|
||||
This file contains some notes as to how the widget system does
|
||||
and should work. It consists of three parts:
|
||||
|
||||
I) A description of the meaning of the various flags
|
||||
|
||||
II) A list of invariants about the states of the widgets.
|
||||
(Throughout this document, we refer to the states of the
|
||||
widgets by referring to the flags for GtkWidget)
|
||||
|
||||
III) Some notes about the ways that a widget changes states
|
||||
|
||||
IV) A list of responsibilities of various widget signals when
|
||||
the states change.
|
||||
|
||||
Any action necessary to maintain the invariants in II which is not
|
||||
explicitly mentioned in IV), is the responsibility of the core GTK
|
||||
code, which is roughly defined as:
|
||||
|
||||
gtkobject.c
|
||||
gtkwidget.c
|
||||
gtkcontainer.c
|
||||
gtkmain.c
|
||||
gtksignal.c
|
||||
|
||||
Section II is mostly of interest to those maintaining GTK, the
|
||||
other sections may also be interesting to people writing
|
||||
new widgets.
|
||||
|
||||
Main outline:
|
||||
- Owen Taylor <owt1@cornell.edu>
|
||||
1998/02/03
|
||||
|
||||
Flag descriptions:
|
||||
- Tim Janik <timj@gimp.org>
|
||||
1998/02/04
|
||||
|
||||
I. Flags
|
||||
--------
|
||||
|
||||
GtkObject:
|
||||
|
||||
GTK_DESTROYED:
|
||||
This flagged is set for a GtkObject right before its
|
||||
destruction code is executed. Its main use is the
|
||||
prevention of multiple destruction invokations.
|
||||
|
||||
GTK_FLOATING:
|
||||
This flag reflects the fact that the holder of the
|
||||
initial reference count is unknown. Refer to refcounting.txt
|
||||
for further details.
|
||||
|
||||
GTK_RESERVED_1:
|
||||
GTK_RESERVED_2:
|
||||
Reserved flags.
|
||||
|
||||
|
||||
GtkWidget, public flags:
|
||||
|
||||
GTK_TOPLEVEL:
|
||||
Widgets without a real parent, as there are GtkWindows and
|
||||
GtkMenus have this flag set throughout their lifetime.
|
||||
Toplevel widgets always contain their own GdkWindow.
|
||||
|
||||
GTK_NO_WINDOW:
|
||||
This flag is indicative for a widget that does not provide
|
||||
its own GdkWindow. Visible action (e.g. drawing) is performed
|
||||
on the parent's GdkWindow.
|
||||
|
||||
GTK_REALIZED:
|
||||
Set by gtk_widget_realize, unset by gtk_widget_unrealize.
|
||||
Relies on ((widget->parent && widget->parent->window)
|
||||
|| GTK_WIDGET_TOPLEVEL (widget));
|
||||
Means: widget has an associated GdkWindow (XWindow).
|
||||
|
||||
GTK_MAPPED:
|
||||
Set by gtk_widget_map, unset by gtk_widget_unmap.
|
||||
May only be set if GTK_WIDGET_REALIZED (widget).
|
||||
Means: gdk_window_show() has been called on the widgets window(s).
|
||||
|
||||
GTK_VISIBLE:
|
||||
Set by gtk_widget_show.
|
||||
Implies that a widget will be flagged GTK_MAPPED as soon as its
|
||||
parent is mapped.
|
||||
!GTK_VISIBLE:
|
||||
Set by gtk_widget_hide.
|
||||
Implies that a widget is not onscreen, therefore !GTK_MAPPED.
|
||||
|
||||
GTK_SENSITIVE:
|
||||
Set and unset by gtk_widget_set_sensitive.
|
||||
The sensitivity of a widget determines whether it will receive
|
||||
certain events (e.g. button or key presses). One premise for
|
||||
the widgets sensitivity is to have GTK_SENSITIVE set.
|
||||
|
||||
GTK_PARENT_SENSITIVE:
|
||||
Set and unset by gtk_widget_set_sensitive operations on the
|
||||
parents of the widget.
|
||||
This is the second premise for the widgets sensitivity. Once
|
||||
it has GTK_SENSITIVE and GTK_PARENT_SENSITIVE set, its state is
|
||||
effectively sensitive. This is expressed (and can be examined) by
|
||||
the GTK_WIDGET_IS_SENSITIVE macro.
|
||||
|
||||
GTK_CAN_FOCUS:
|
||||
There are no directly corresponding functions for setting/unsetting
|
||||
this flag, but it can be affected by the GtkWidget::has_focus argument
|
||||
via gtk_widget_set_arg.
|
||||
This flag determines whether a widget is able to handle focus grabs.
|
||||
|
||||
GTK_HAS_FOCUS:
|
||||
This flag will be set by gtk_widget_grab_focus for widgets that also
|
||||
have GTK_CAN_FOCUS set. The flag will be unset once another widget
|
||||
grabs the focus.
|
||||
|
||||
GTK_CAN_DEFAULT:
|
||||
GTK_HAS_DEFAULT:
|
||||
These two flags are mostly equal in functionality to their *_FOCUS
|
||||
counterparts, but for the default widget.
|
||||
|
||||
GTK_HAS_GRAB:
|
||||
Set by gtk_grab_add, unset by gtk_grab_remove.
|
||||
Means: widget is in the grab_widgets stack, and will be the preferred
|
||||
one for receiving events other than ones of cosmetic value.
|
||||
|
||||
GTK_BASIC:
|
||||
The GTK_BASIC flag is an attempt at making a distinction
|
||||
between widgets that handle user input e.g. key/button presses
|
||||
and those that don't. Subsequent parent<->child relation ships
|
||||
of non `basic' widgets should be avoided. The checking for
|
||||
this is currently not properly enforced in the code. For
|
||||
example GtkButton is a non `basic' widget, that will therefore
|
||||
disallow to act as a container for another GtkButton. Now the
|
||||
gnit is, one can add a GtkHBox (which is a `basic' widget) to
|
||||
the first button, and put the second into the box.
|
||||
|
||||
GTK_RESERVED_3:
|
||||
|
||||
GTK_RC_STYLE:
|
||||
This flag indicates that its style has been looked up through
|
||||
the rc mechanism. It does not imply that the widget actually
|
||||
had a style defined through the rc mechanism.
|
||||
|
||||
|
||||
GtkWidget, private flags:
|
||||
|
||||
GTK_USER_STYLE:
|
||||
A widget is flagged to have a user style, once gtk_widget_set_style
|
||||
has been invoked for it. The use of this flag is to tell widgets
|
||||
wich share a global user style from the ones which got a certain
|
||||
style assign from outside the toolkit.
|
||||
|
||||
GTK_REDRAW_PENDING:
|
||||
Relies on GTK_WIDGET_MAPPED (widget).
|
||||
[FIXME: this is not really enforced throughout the code, but should
|
||||
be. it only requires a few checks for GTK_WIDGET_MAPPED and
|
||||
minor changes to gtk_widget_unmap, we can then remove the check
|
||||
in gtk_widget_real_destroy]
|
||||
Means: there is an idle handler waiting for the widget, that
|
||||
will cause a full redraw (gtk_widget_draw (widget, NULL)).
|
||||
|
||||
GTK_RESIZE_PENDING:
|
||||
First, this is only valid for GtkContainers.
|
||||
[some of the code should move to gtkcontainer.c therefore]
|
||||
Relies on GTK_WIDGET_REALIZED(widget)
|
||||
[this is not really enforced throughout the code, but should
|
||||
be. it only requires a few checks for GTK_WIDGET_RELIZED and
|
||||
minor changes to gtk_widget_unrealize, we can then remove the check
|
||||
in gtk_widget_real_destroy]
|
||||
Means: there is an idle handler waiting for the container to
|
||||
resize it.
|
||||
|
||||
GTK_RESIZE_NEEDED:
|
||||
Relies on GTK_WIDGET_REALIZED(widget)
|
||||
[this is not really enforced throughout the code, but should
|
||||
be. once this is done special checking in gtk_widget_real_destroy
|
||||
can be avoided]
|
||||
Means: a widget has been added to the resize_widgets list of
|
||||
its _toplevel_ container (keep this in mind for GtkViewport).
|
||||
Remark: this flag is also used internaly by gtkwindow.c during
|
||||
the evaluation of resizing worthy widgets.
|
||||
|
||||
GTK_LEAVE_PENDING:
|
||||
A widget is flagged as such if there is a leave_notify event
|
||||
pending for it. It will receive this event regardless of a grab
|
||||
through another widget or its current sensitivity.
|
||||
[this should be made relying on GTK_REALIZED]
|
||||
|
||||
GTK_HAS_SHAPE_MASK:
|
||||
Set by gtk_widget_shape_combine_mask if a widget got a shape mask
|
||||
assigned (making use of the X11 shaped window extension).
|
||||
|
||||
GTK_IN_REPARENT:
|
||||
During the act of reparentation widgets which are already
|
||||
realized and will be added to an already realized parent need
|
||||
to have this flag set to prevent natural unrealization on the
|
||||
process of getting unparented.
|
||||
|
||||
Related Macros:
|
||||
|
||||
GTK_WIDGET_DRAWABLE:
|
||||
This macro examines whether a widget is flagged as GTK_WIDGET_VISIBLE
|
||||
and GTK_WIDGET_MAPPED.
|
||||
Means: it _makes sense_ to draw in a widgets window.
|
||||
|
||||
GTK_WIDGET_IS_SENSITIVE:
|
||||
This macro tells the real sensitivity state of a widget. It returns
|
||||
whether both the widget and all its parents are in sensitive state.
|
||||
|
||||
|
||||
II. Invariants:
|
||||
---------------
|
||||
|
||||
This section describes various constraints on the states of
|
||||
the widget:
|
||||
|
||||
In the following
|
||||
|
||||
A => B means if A is true, than B is true
|
||||
A <=> B means A is true, if and only if B is true
|
||||
(equivalent to A => B and A <= B)
|
||||
|
||||
|
||||
1) GTK_WIDGET_DESTROYED (widget) => !GTK_WIDGET_REALIZED (widget)
|
||||
=> !GTK_WIDGET_VISIBLE (widget)
|
||||
[ The latter is not currently in place, but it should be ]
|
||||
|
||||
2) GTK_WIDGET_MAPPED (widget) => GTK_WIDGET_REALIZED (widget)
|
||||
|
||||
3) if GTK_WIDGET_TOPLEVEL (widget):
|
||||
GTK_WIDGET_VISIBLE (widget) <=> GTK_WIDGET_MAPPED (widget)
|
||||
|
||||
4) if !GTK_WIDGET_TOPLEVEL (widget):
|
||||
widget->parent && GTK_WIDGET_REALIZED (widget->parent) <=>
|
||||
GTK_WIDGET_REALIZED (widget)
|
||||
|
||||
5) if !GTK_WIDGET_TOPLEVEL (widget):
|
||||
|
||||
GTK_WIDGET_MAPPED (widget) => GTK_WIDGET_VISIBLE (widget)
|
||||
=> GTK_WIDGET_REALIZED (widget)
|
||||
|
||||
widget->parent && GTK_WIDGET_MAPPED (widget->parent) &&
|
||||
GTK_WIDGET_VISIBLE (widget) => GTK_WIDGET_MAPPED (widget)
|
||||
|
||||
Note:, the definition
|
||||
|
||||
[ GTK_WIDGET_DRAWABLE = GTK_WIDGET_VISIBLE && GTK_WIDGET_MAPPED
|
||||
is made in gtkwidget.c, but by 3) and 5),
|
||||
|
||||
GTK_WIDGET_MAPPED => GTK_WIDGET_VISIBLE
|
||||
]
|
||||
|
||||
6) GTK_REDRAW_PENDING => GTK_WIDGET_REALIZED
|
||||
GTK_RESIZE_PENDING => "
|
||||
GTK_LEAVE_PENDING => "
|
||||
GTK_RESIZE_NEEDED => "
|
||||
|
||||
III. How states are changed:
|
||||
----------------------------
|
||||
|
||||
How can the user control the state of a widget:
|
||||
-----------------------------------------------
|
||||
|
||||
(In the following, set flag means set the flag, do appropriate
|
||||
actions, and enforce above invariants)
|
||||
|
||||
gtk_widget_show:
|
||||
if !GTK_DESTROYED sets GTK_VISIBLE
|
||||
|
||||
gtk_widget_hide:
|
||||
if !GTK_VISIBLE for widget
|
||||
|
||||
gtk_widget_destroy:
|
||||
sets GTK_DESTROYED
|
||||
For a top-level widget
|
||||
|
||||
gtk_widget_realize:
|
||||
if !GTK_DESTROYED sets GTK_REALIZED
|
||||
- Calling gtk_widget_realize when the widget is not a descendent
|
||||
of a toplevel is an ERROR.
|
||||
|
||||
gtk_container_add (container, widget) [ and container-specific variants ]
|
||||
Sets widget->parent
|
||||
|
||||
gtk_container_remove (container, widget)
|
||||
unsets widget->parent
|
||||
|
||||
gtk_widget_reparent (widget, new_parent)
|
||||
Equivalent to removing widget from old parent and adding it to
|
||||
the new parent, except that the widget will not be temporarily
|
||||
unrealized if both the old parent and the new parent are realized.
|
||||
|
||||
|
||||
gtk_widget_unrealize
|
||||
gtk_widget_map
|
||||
gtk_widget_unmap
|
||||
|
||||
These functions are not meant to be used by applications - they
|
||||
are used only by GTK and widgets to enforce invariants on the
|
||||
state.
|
||||
|
||||
When The X window corresponding to a GTK window is destroyed:
|
||||
-------------------------------------------------------------
|
||||
|
||||
gtk_widget_destroy is called (as above).
|
||||
|
||||
|
||||
|
||||
IV. Responsibilities of widgets
|
||||
--------------------------------
|
||||
|
||||
Adding to a container
|
||||
---------------------
|
||||
|
||||
When a widget is added to a container, the container:
|
||||
|
||||
1) calls gtk_widget_set_parent (widget, container)
|
||||
2) calls gtk_widget_set_parent_window (widget, window) if
|
||||
the widget is being added to something other than container->window
|
||||
3) if container is realized, and not widget, realizes widget
|
||||
4) if container is mapped, and not widget and widget is GTK_VISIBLE,
|
||||
maps widget
|
||||
5) Queues a resize if the widget is mapped
|
||||
|
||||
Note: It would be nice to remove 3) and 4) out of widget specific code
|
||||
since they are of the invariant-enforcing nature, but it is
|
||||
a bit hard, since they can't be done until after 2)
|
||||
|
||||
|
||||
Removing from a container
|
||||
-------------------------
|
||||
|
||||
When a widget is removed to a container, the container:
|
||||
|
||||
1) Calls gtk_widget_unparent (widget)
|
||||
2) Sets widget->parent to NULL
|
||||
3) Queues a resize.
|
||||
|
||||
Notes:
|
||||
|
||||
gtk_widget_unparent unrealizes the widget except in the
|
||||
special case GTK_IN_REPARENT is set.
|
||||
|
||||
|
||||
At widget creation
|
||||
------------------
|
||||
|
||||
Widgets are created in an unrealized state.
|
||||
|
||||
1) The widget should allocate and initialize needed data structures
|
||||
|
||||
|
||||
The Realize signal
|
||||
------------------
|
||||
|
||||
When a widget recieves the "realize" signal it should:
|
||||
|
||||
NO_WINDOW widgets: (probably OK to use default handler)
|
||||
|
||||
1) set the realized flag
|
||||
2) set widget->window
|
||||
widget->window = gtk_widget_get_parent_window (widget);
|
||||
gdk_window_ref (widget->window);
|
||||
3) attach the widget's style
|
||||
|
||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
|
||||
widget with window(s)
|
||||
|
||||
1) set the REALIZED flag
|
||||
2) create windows with the parent obtained from
|
||||
gtk_widget_get_parent_window (widget);
|
||||
3) attach the widget's style
|
||||
4) set the background color for the new window based on the style
|
||||
|
||||
The Map signal
|
||||
--------------
|
||||
|
||||
1) Set the MAPPED flag
|
||||
2) If the widget has any windows, gdk_window_show those windows
|
||||
3) call gtk_widget_map for all child windows that are
|
||||
VISIBLE and !MAPPED.
|
||||
3) Do any other functions related to putting the widget onscreen.
|
||||
(for instance, showing extra popup windows...)
|
||||
|
||||
The Unmap signal
|
||||
----------------
|
||||
|
||||
When a widget receives the unmap signal, it must:
|
||||
|
||||
1) If the widget has a window, gdk_window_hide that window,
|
||||
2) If the widget does not have a window, unmap all child widgets
|
||||
3) Do any other functions related to taking the widget offscreen
|
||||
(for instance, removing popup windows...)
|
||||
3) Unset GTK_MAPPED
|
||||
|
||||
|
||||
The Unrealize signal
|
||||
--------------------
|
||||
|
||||
When a widget receives the unrealize signal, it must
|
||||
|
||||
1) For any windows other than widget->window do:
|
||||
|
||||
gdk_window_set_user_data (window, NULL);
|
||||
gdk_window_destroy (window);
|
||||
|
||||
2) Call the parent's unrealize handler
|
||||
|
||||
|
||||
The Widget class unrealize handler will take care of unrealizing
|
||||
all children if necessary. [should this be made consistent with
|
||||
unmap???]
|
||||
|
||||
|
||||
The Destroy Signal
|
||||
------------------
|
||||
|
||||
Commentary:
|
||||
|
||||
The destroy signal probably shouldn't exist at all. A widget
|
||||
should merely be unrealized and removed from its parent
|
||||
when the user calls gtk_widget_destroy or a GDK_DESTROY event
|
||||
is received. However, a large body of code depends on
|
||||
getting a definitive signal when a widget goes away.
|
||||
|
||||
That could be put in the finalization step, but, especially
|
||||
with language bindings, the cleanup step may need to refer
|
||||
back to the widget. (To use gtk_widget_get_data, for instance)
|
||||
If it does so via a pointer in a closure (natural for
|
||||
Scheme, or Perl), then the finalization procedure will never
|
||||
be called.
|
||||
|
||||
Also, if we made that the finalization step, we would have
|
||||
to propagate the GDK_DESTROY event in any case, since it is
|
||||
at that point at which user-visible actions need to be taken.
|
||||
|
||||
|
||||
When a widget receives the destroy signal, it must:
|
||||
|
||||
1) If the widget "owns" any widgets other than its child
|
||||
widgets, (for instance popup windows) it should
|
||||
call gtk_widget_destroy () for them.
|
||||
|
||||
2) Call the parent class's destroy handler.
|
||||
|
||||
|
||||
The "destroy" signal will only be received once. A widget
|
||||
will never receive any other signals after the destroy
|
||||
signal (but see the sectionalize on "Finalize" below)
|
||||
|
||||
The widget must handle calls to all publically accessible
|
||||
functions in an innocuous manner even after a "destroy"
|
||||
signal. (A widget can assume that it will not be realized
|
||||
after a "destroy" signal is received, which may simplify
|
||||
handling this requirement)
|
||||
|
||||
|
||||
The Finalize Pseudo-signal
|
||||
--------------------------
|
||||
|
||||
The finalize pseudo-signal is received after all references
|
||||
to the widget have been removed. The finalize callback
|
||||
cannot make any GTK calls with the widget as a parameter.
|
||||
|
||||
1) Free any memory allocated by the widget. (But _not_
|
||||
the widget structure itself.
|
||||
|
||||
2) Call the parent class's finalize signal
|
||||
|
||||
|
||||
A note on chaining "destroy" signals and finalize signals:
|
||||
---------------------------------------------------------
|
||||
|
||||
This is done by code like:
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
|
||||
It may not be completely obvious why this works. Note
|
||||
that parent_class is a static variable on a per-class
|
||||
basis. So say: we have
|
||||
|
||||
GtkFoo <- GtkBar <- GtkWidget <-GtkObject
|
||||
|
||||
And that Foo, Widget, and Object all have destructors, but
|
||||
not Bar.
|
||||
|
||||
Then gtk_foo_destroy will call gtk_widget_destroy (because
|
||||
it was not overridden in the Bar class structure) and
|
||||
gtk_widget_destroy will call gtk_object_destroy because
|
||||
the parent_class variable referenced by gtk_foo_destroy is the
|
||||
static variable in gtkwidget.c: GtkObjectClass.
|
||||
@@ -1,6 +1,9 @@
|
||||
*.lo
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
_libs
|
||||
.libs
|
||||
libgdk.la
|
||||
|
||||
gdkcursors.h
|
||||
gdkkeysyms.h
|
||||
|
||||
@@ -6,21 +6,32 @@ lib_LTLIBRARIES = libgdk.la
|
||||
|
||||
libgdk_la_SOURCES = \
|
||||
gdk.c \
|
||||
gdkcc.c \
|
||||
gdkcolor.c \
|
||||
gdkcursor.c \
|
||||
gdkdnd.c \
|
||||
gdkdraw.c \
|
||||
gdkfont.c \
|
||||
gdkgc.c \
|
||||
gdkglobals.c \
|
||||
gdkimage.c \
|
||||
gdkinput.c \
|
||||
gdkinput.h \
|
||||
gdkinputnone.h \
|
||||
gdkinputcommon.h\
|
||||
gdkinputgxi.h \
|
||||
gdkinputxfree.h \
|
||||
gdkpixmap.c \
|
||||
gdkproperty.c \
|
||||
gdkrectangle.c \
|
||||
gdkregion.c \
|
||||
gdkselection.c \
|
||||
gdkvisual.c \
|
||||
gdkwindow.c \
|
||||
gdkxid.c \
|
||||
MwmUtil.h \
|
||||
gxid_lib.h \
|
||||
gxid_proto.h \
|
||||
gxid_lib.c
|
||||
## this last one is ifdef'd out unless XINPUT_GXI is defined
|
||||
## It's easier than trying to get automake to handle compiling
|
||||
@@ -29,22 +40,16 @@ libgdk_la_SOURCES = \
|
||||
gdkinclude_HEADERS = \
|
||||
gdk.h \
|
||||
gdkcursors.h \
|
||||
gdki18n.h \
|
||||
gdkkeysyms.h \
|
||||
gdkprivate.h \
|
||||
gdktypes.h \
|
||||
gdkinput.h \
|
||||
gdkinputnone.h \
|
||||
gdkinputcommon.h\
|
||||
gdkinputgxi.h \
|
||||
gdkinputxfree.h \
|
||||
gxid_lib.h \
|
||||
gxid_proto.h \
|
||||
gdkx.h
|
||||
|
||||
libgdk_la_LDFLAGS = -version-info 1:0:0 \
|
||||
@x_ldflags@ @x_libs@
|
||||
|
||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib @x_cflags@
|
||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -I../glib @x_cflags@
|
||||
|
||||
EXTRA_PROGRAMS = gxid
|
||||
|
||||
@@ -53,19 +58,19 @@ bin_PROGRAMS = @xinput_progs@
|
||||
gxid_SOURCES = gxid.c
|
||||
|
||||
gxid_LDADD = \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm
|
||||
|
||||
BUILT_SOURCES = gdkcursors.h gdkkeysyms.h
|
||||
|
||||
EXTRA_DIST = makecursors makecursors.sed makekeysyms makekeysyms.sed
|
||||
EXTRA_DIST = makecursors.awk makekeysyms.awk
|
||||
|
||||
gdkcursors.h:
|
||||
$(srcdir)/makecursors @x_includes@/X11/cursorfont.h > $@
|
||||
awk -f $(srcdir)/makecursors.awk @x_includes@/X11/cursorfont.h > $@
|
||||
|
||||
gdkkeysyms.h:
|
||||
$(srcdir)/makekeysyms @x_includes@/X11/keysymdef.h > $@
|
||||
awk -f $(srcdir)/makekeysyms.awk @x_includes@/X11/keysymdef.h > $@
|
||||
|
||||
.PHONY: files
|
||||
|
||||
@@ -73,3 +78,5 @@ files:
|
||||
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
|
||||
echo $$p; \
|
||||
done
|
||||
|
||||
$(DEP_FILES) : $(BUILT_SOURCES)
|
||||
|
||||
131
gdk/MwmUtil.h
Normal file
131
gdk/MwmUtil.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of the GNU LessTif Library.
|
||||
*
|
||||
* 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, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef MWMUTIL_H_INCLUDED
|
||||
#define MWMUTIL_H_INCLUDED
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 input_mode;
|
||||
CARD32 status;
|
||||
} MotifWmHints, MwmHints;
|
||||
|
||||
#define MWM_HINTS_FUNCTIONS (1L << 0)
|
||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||
#define MWM_HINTS_INPUT_MODE (1L << 2)
|
||||
#define MWM_HINTS_STATUS (1L << 3)
|
||||
|
||||
#define MWM_FUNC_ALL (1L << 0)
|
||||
#define MWM_FUNC_RESIZE (1L << 1)
|
||||
#define MWM_FUNC_MOVE (1L << 2)
|
||||
#define MWM_FUNC_MINIMIZE (1L << 3)
|
||||
#define MWM_FUNC_MAXIMIZE (1L << 4)
|
||||
#define MWM_FUNC_CLOSE (1L << 5)
|
||||
|
||||
#define MWM_DECOR_ALL (1L << 0)
|
||||
#define MWM_DECOR_BORDER (1L << 1)
|
||||
#define MWM_DECOR_RESIZEH (1L << 2)
|
||||
#define MWM_DECOR_TITLE (1L << 3)
|
||||
#define MWM_DECOR_MENU (1L << 4)
|
||||
#define MWM_DECOR_MINIMIZE (1L << 5)
|
||||
#define MWM_DECOR_MAXIMIZE (1L << 6)
|
||||
|
||||
#define MWM_INPUT_MODELESS 0
|
||||
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
|
||||
#define MWM_INPUT_SYSTEM_MODAL 2
|
||||
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
|
||||
#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
|
||||
|
||||
#define MWM_TEAROFF_WINDOW (1L<<0)
|
||||
|
||||
/*
|
||||
* atoms
|
||||
*/
|
||||
#define _XA_MOTIF_BINDINGS "_MOTIF_BINDINGS"
|
||||
#define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
|
||||
#define _XA_MOTIF_WM_MESSAGES "_MOTIF_WM_MESSAGES"
|
||||
#define _XA_MOTIF_WM_OFFSET "_MOTIF_WM_OFFSET"
|
||||
#define _XA_MOTIF_WM_MENU "_MOTIF_WM_MENU"
|
||||
#define _XA_MOTIF_WM_INFO "_MOTIF_WM_INFO"
|
||||
#define _XA_MWM_HINTS _XA_MOTIF_WM_HINTS
|
||||
#define _XA_MWM_MESSAGES _XA_MOTIF_WM_MESSAGES
|
||||
#define _XA_MWM_MENU _XA_MOTIF_WM_MENU
|
||||
#define _XA_MWM_INFO _XA_MOTIF_WM_INFO
|
||||
|
||||
|
||||
/*
|
||||
* _MWM_INFO property
|
||||
*/
|
||||
typedef struct {
|
||||
long flags;
|
||||
Window wm_window;
|
||||
} MotifWmInfo;
|
||||
|
||||
typedef MotifWmInfo MwmInfo;
|
||||
|
||||
#define MWM_INFO_STARTUP_STANDARD (1L<<0)
|
||||
#define MWM_INFO_STARTUP_CUSTOM (1L<<1)
|
||||
|
||||
/*
|
||||
* _MWM_HINTS property
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 inputMode;
|
||||
CARD32 status;
|
||||
} PropMotifWmHints;
|
||||
|
||||
typedef PropMotifWmHints PropMwmHints;
|
||||
|
||||
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
|
||||
#define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS
|
||||
|
||||
/*
|
||||
* _MWM_INFO property, slight return
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 wmWindow;
|
||||
} PropMotifWmInfo;
|
||||
|
||||
typedef PropMotifWmInfo PropMwmInfo;
|
||||
|
||||
#define PROP_MOTIF_WM_INFO_ELEMENTS 2
|
||||
#define PROP_MWM_INFO_ELEMENTS PROP_MOTIF_WM_INFO_ELEMENTS
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MWMUTIL_H_INCLUDED */
|
||||
1724
gdk/gdkcc.c
Normal file
1724
gdk/gdkcc.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@ static void gdk_colormap_remove (GdkColormap *cmap);
|
||||
static guint gdk_colormap_hash (Colormap *cmap);
|
||||
static gint gdk_colormap_cmp (Colormap *a,
|
||||
Colormap *b);
|
||||
static void gdk_colormap_real_destroy (GdkColormap *colormap);
|
||||
|
||||
static GHashTable *colormap_hash = NULL;
|
||||
|
||||
@@ -117,7 +118,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
return colormap;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_colormap_real_destroy (GdkColormap *colormap)
|
||||
{
|
||||
GdkColormapPrivate *private = (GdkColormapPrivate*) colormap;
|
||||
@@ -132,12 +133,6 @@ gdk_colormap_real_destroy (GdkColormap *colormap)
|
||||
g_free (colormap);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_colormap_destroy (GdkColormap *colormap)
|
||||
{
|
||||
gdk_colormap_unref (colormap);
|
||||
}
|
||||
|
||||
GdkColormap*
|
||||
gdk_colormap_ref (GdkColormap *cmap)
|
||||
{
|
||||
@@ -179,22 +174,27 @@ gdk_colormap_get_system (void)
|
||||
private->next_color = 0;
|
||||
private->ref_count = 1;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
if ((private->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
||||
(private->visual->type == GDK_VISUAL_PSEUDO_COLOR))
|
||||
{
|
||||
xpalette[i].pixel = i;
|
||||
xpalette[i].red = 0;
|
||||
xpalette[i].green = 0;
|
||||
xpalette[i].blue = 0;
|
||||
}
|
||||
|
||||
XQueryColors (gdk_display, private->xcolormap, xpalette, 256);
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
colormap->colors[i].pixel = xpalette[i].pixel;
|
||||
colormap->colors[i].red = xpalette[i].red;
|
||||
colormap->colors[i].green = xpalette[i].green;
|
||||
colormap->colors[i].blue = xpalette[i].blue;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
xpalette[i].pixel = i;
|
||||
xpalette[i].red = 0;
|
||||
xpalette[i].green = 0;
|
||||
xpalette[i].blue = 0;
|
||||
}
|
||||
|
||||
XQueryColors (gdk_display, private->xcolormap, xpalette,
|
||||
MIN (private->visual->colormap_size, 256));
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
colormap->colors[i].pixel = xpalette[i].pixel;
|
||||
colormap->colors[i].red = xpalette[i].red;
|
||||
colormap->colors[i].green = xpalette[i].green;
|
||||
colormap->colors[i].blue = xpalette[i].blue;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_colormap_add (colormap);
|
||||
|
||||
@@ -38,6 +38,37 @@ gdk_cursor_new (GdkCursorType cursor_type)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, gint x, gint y)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
Pixmap source_pixmap, mask_pixmap;
|
||||
Cursor xcursor;
|
||||
XColor xfg, xbg;
|
||||
|
||||
source_pixmap = ((GdkPixmapPrivate *) source)->xwindow;
|
||||
mask_pixmap = ((GdkPixmapPrivate *) mask)->xwindow;
|
||||
|
||||
xfg.pixel = fg->pixel;
|
||||
xfg.red = fg->red;
|
||||
xfg.blue = fg->blue;
|
||||
xfg.green = fg->green;
|
||||
xbg.pixel = bg->pixel;
|
||||
xbg.red = bg->red;
|
||||
xbg.blue = bg->blue;
|
||||
xbg.green = bg->green;
|
||||
|
||||
xcursor = XCreatePixmapCursor (gdk_display, source_pixmap, mask_pixmap, &xfg, &xbg, x, y);
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->xdisplay = gdk_display;
|
||||
private->xcursor = xcursor;
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_cursor_destroy (GdkCursor *cursor)
|
||||
{
|
||||
|
||||
95
gdk/gdkcursors.h
Normal file
95
gdk/gdkcursors.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
GDK_NUM_GLYPHS = 154,
|
||||
GDK_X_CURSOR = 0,
|
||||
GDK_ARROW = 2,
|
||||
GDK_BASED_ARROW_DOWN = 4,
|
||||
GDK_BASED_ARROW_UP = 6,
|
||||
GDK_BOAT = 8,
|
||||
GDK_BOGOSITY = 10,
|
||||
GDK_BOTTOM_LEFT_CORNER = 12,
|
||||
GDK_BOTTOM_RIGHT_CORNER = 14,
|
||||
GDK_BOTTOM_SIDE = 16,
|
||||
GDK_BOTTOM_TEE = 18,
|
||||
GDK_BOX_SPIRAL = 20,
|
||||
GDK_CENTER_PTR = 22,
|
||||
GDK_CIRCLE = 24,
|
||||
GDK_CLOCK = 26,
|
||||
GDK_COFFEE_MUG = 28,
|
||||
GDK_CROSS = 30,
|
||||
GDK_CROSS_REVERSE = 32,
|
||||
GDK_CROSSHAIR = 34,
|
||||
GDK_DIAMOND_CROSS = 36,
|
||||
GDK_DOT = 38,
|
||||
GDK_DOTBOX = 40,
|
||||
GDK_DOUBLE_ARROW = 42,
|
||||
GDK_DRAFT_LARGE = 44,
|
||||
GDK_DRAFT_SMALL = 46,
|
||||
GDK_DRAPED_BOX = 48,
|
||||
GDK_EXCHANGE = 50,
|
||||
GDK_FLEUR = 52,
|
||||
GDK_GOBBLER = 54,
|
||||
GDK_GUMBY = 56,
|
||||
GDK_HAND1 = 58,
|
||||
GDK_HAND2 = 60,
|
||||
GDK_HEART = 62,
|
||||
GDK_ICON = 64,
|
||||
GDK_IRON_CROSS = 66,
|
||||
GDK_LEFT_PTR = 68,
|
||||
GDK_LEFT_SIDE = 70,
|
||||
GDK_LEFT_TEE = 72,
|
||||
GDK_LEFTBUTTON = 74,
|
||||
GDK_LL_ANGLE = 76,
|
||||
GDK_LR_ANGLE = 78,
|
||||
GDK_MAN = 80,
|
||||
GDK_MIDDLEBUTTON = 82,
|
||||
GDK_MOUSE = 84,
|
||||
GDK_PENCIL = 86,
|
||||
GDK_PIRATE = 88,
|
||||
GDK_PLUS = 90,
|
||||
GDK_QUESTION_ARROW = 92,
|
||||
GDK_RIGHT_PTR = 94,
|
||||
GDK_RIGHT_SIDE = 96,
|
||||
GDK_RIGHT_TEE = 98,
|
||||
GDK_RIGHTBUTTON = 100,
|
||||
GDK_RTL_LOGO = 102,
|
||||
GDK_SAILBOAT = 104,
|
||||
GDK_SB_DOWN_ARROW = 106,
|
||||
GDK_SB_H_DOUBLE_ARROW = 108,
|
||||
GDK_SB_LEFT_ARROW = 110,
|
||||
GDK_SB_RIGHT_ARROW = 112,
|
||||
GDK_SB_UP_ARROW = 114,
|
||||
GDK_SB_V_DOUBLE_ARROW = 116,
|
||||
GDK_SHUTTLE = 118,
|
||||
GDK_SIZING = 120,
|
||||
GDK_SPIDER = 122,
|
||||
GDK_SPRAYCAN = 124,
|
||||
GDK_STAR = 126,
|
||||
GDK_TARGET = 128,
|
||||
GDK_TCROSS = 130,
|
||||
GDK_TOP_LEFT_ARROW = 132,
|
||||
GDK_TOP_LEFT_CORNER = 134,
|
||||
GDK_TOP_RIGHT_CORNER = 136,
|
||||
GDK_TOP_SIDE = 138,
|
||||
GDK_TOP_TEE = 140,
|
||||
GDK_TREK = 142,
|
||||
GDK_UL_ANGLE = 144,
|
||||
GDK_UMBRELLA = 146,
|
||||
GDK_UR_ANGLE = 148,
|
||||
GDK_WATCH = 150,
|
||||
GDK_XTERM = 152,
|
||||
144
gdk/gdkdnd.c
Normal file
144
gdk/gdkdnd.c
Normal file
@@ -0,0 +1,144 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <string.h>
|
||||
#include "gdkx.h"
|
||||
#include "gdk.h"
|
||||
|
||||
/* Nothing much here now, but we have to make a start some time ;-) */
|
||||
|
||||
void
|
||||
gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, GdkCursor *goahead_cursor)
|
||||
{
|
||||
gdk_dnd.c->gdk_cursor_dragdefault =
|
||||
((GdkCursorPrivate *)default_cursor)->xcursor;
|
||||
gdk_dnd.c->gdk_cursor_dragok = ((GdkCursorPrivate *)goahead_cursor)->xcursor;
|
||||
|
||||
if(gdk_dnd.dnd_grabbed)
|
||||
{
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
/* We were displaying pixmaps for the drag */
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_default);
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_default);
|
||||
if(gdk_dnd.c->drag_pm_ok)
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_ok);
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
|
||||
}
|
||||
gdk_dnd.c->drag_pm_default = gdk_dnd.c->drag_pm_ok = NULL;
|
||||
g_list_free(gdk_dnd.c->xids);
|
||||
gdk_dnd.c->xids = NULL;
|
||||
}
|
||||
gdk_dnd_display_drag_cursor(-1, -1,
|
||||
gdk_dnd.dnd_drag_target?TRUE:FALSE,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
|
||||
GdkPoint *default_hotspot,
|
||||
GdkWindow *goahead_pixmapwin,
|
||||
GdkPoint *goahead_hotspot)
|
||||
{
|
||||
g_return_if_fail(default_pixmapwin != NULL);
|
||||
|
||||
g_list_free(gdk_dnd.c->xids); gdk_dnd.c->xids = NULL;
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_default);
|
||||
if(gdk_dnd.c->drag_pm_ok)
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
|
||||
|
||||
gdk_dnd.c->drag_pm_ok = NULL;
|
||||
|
||||
gdk_window_ref(default_pixmapwin);
|
||||
gdk_dnd.c->drag_pm_default = default_pixmapwin;
|
||||
gdk_dnd.c->default_hotspot = *default_hotspot;
|
||||
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)default_pixmapwin)->xwindow);
|
||||
if(goahead_pixmapwin)
|
||||
{
|
||||
gdk_window_ref(goahead_pixmapwin);
|
||||
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)goahead_pixmapwin)->xwindow);
|
||||
gdk_dnd.c->drag_pm_ok = goahead_pixmapwin;
|
||||
gdk_dnd.c->ok_hotspot = *goahead_hotspot;
|
||||
}
|
||||
|
||||
if(gdk_dnd.dnd_grabbed)
|
||||
{
|
||||
gdk_dnd_display_drag_cursor(-1, -1,
|
||||
gdk_dnd.dnd_drag_target?TRUE:FALSE,
|
||||
TRUE);
|
||||
XChangeActivePointerGrab (gdk_display,
|
||||
ButtonMotionMask |
|
||||
ButtonPressMask |
|
||||
ButtonReleaseMask |
|
||||
EnterWindowMask | LeaveWindowMask,
|
||||
None,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
|
||||
gboolean change_made)
|
||||
{
|
||||
if(!gdk_dnd.dnd_grabbed)
|
||||
return;
|
||||
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
{
|
||||
/* We're doing pixmaps here... */
|
||||
GdkWindow *mypix, *opix;
|
||||
GdkPoint *myhotspot;
|
||||
gint itmp;
|
||||
guint masktmp;
|
||||
Window wtmp;
|
||||
|
||||
if(x == -2 && y == -2) /* Hide the cursors */
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_ok);
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_default);
|
||||
return;
|
||||
}
|
||||
|
||||
if(x == -1 && y == -1) /* We're supposed to find it out for ourselves */
|
||||
XQueryPointer(gdk_display, gdk_root_window,
|
||||
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &masktmp);
|
||||
|
||||
if(drag_ok)
|
||||
{
|
||||
mypix = gdk_dnd.c->drag_pm_ok;
|
||||
opix = gdk_dnd.c->drag_pm_default;
|
||||
myhotspot = &gdk_dnd.c->ok_hotspot;
|
||||
}
|
||||
else
|
||||
{
|
||||
mypix = gdk_dnd.c->drag_pm_default;
|
||||
opix = gdk_dnd.c->drag_pm_ok;
|
||||
myhotspot = &gdk_dnd.c->default_hotspot;
|
||||
}
|
||||
if(change_made)
|
||||
{
|
||||
gdk_window_hide(opix);
|
||||
gdk_window_show(mypix); /* There ought to be a way to know if
|
||||
a window is already mapped etc. */
|
||||
}
|
||||
gdk_window_move(mypix, x - myhotspot->x, y - myhotspot->y);
|
||||
}
|
||||
else if(change_made)
|
||||
{
|
||||
Cursor c;
|
||||
/* Move cursors around */
|
||||
if(drag_ok)
|
||||
c = gdk_dnd.c->gdk_cursor_dragok;
|
||||
else
|
||||
c = gdk_dnd.c->gdk_cursor_dragdefault;
|
||||
XChangeActivePointerGrab (gdk_display,
|
||||
ButtonMotionMask |
|
||||
ButtonPressMask |
|
||||
ButtonReleaseMask |
|
||||
EnterWindowMask | LeaveWindowMask,
|
||||
c,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,8 @@ gdk_draw_point (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawPoint (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
@@ -55,6 +57,8 @@ gdk_draw_line (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
@@ -77,6 +81,8 @@ gdk_draw_rectangle (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (width == -1)
|
||||
@@ -110,6 +116,8 @@ gdk_draw_arc (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (width == -1)
|
||||
@@ -134,11 +142,16 @@ gdk_draw_polygon (GdkDrawable *drawable,
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
GdkPoint *local_points = points;
|
||||
gint local_npoints = npoints;
|
||||
gint local_alloc = 0;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (filled)
|
||||
@@ -148,14 +161,24 @@ gdk_draw_polygon (GdkDrawable *drawable,
|
||||
}
|
||||
else
|
||||
{
|
||||
XDrawLines (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, (XPoint*) points, npoints, CoordModeOrigin);
|
||||
|
||||
if ((points[0].x != points[npoints-1].x) ||
|
||||
(points[0].y != points[npoints-1].y))
|
||||
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc, points[npoints-1].x, points[npoints-1].y,
|
||||
points[0].x, points[0].y);
|
||||
(points[0].y != points[npoints-1].y))
|
||||
{
|
||||
local_alloc = 1;
|
||||
++local_npoints;
|
||||
local_points = (GdkPoint*) g_malloc (local_npoints * sizeof(GdkPoint));
|
||||
memcpy (local_points, points, npoints * sizeof(GdkPoint));
|
||||
local_points[npoints].x = points[0].x;
|
||||
local_points[npoints].y = points[0].y;
|
||||
}
|
||||
|
||||
XDrawLines (drawable_private->xdisplay, drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint*) local_points, local_npoints,
|
||||
CoordModeOrigin);
|
||||
|
||||
if (local_alloc)
|
||||
g_free (local_points);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +206,8 @@ gdk_draw_string (GdkDrawable *drawable,
|
||||
g_return_if_fail (string != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
@@ -237,6 +262,8 @@ gdk_draw_text (GdkDrawable *drawable,
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
@@ -286,6 +313,8 @@ gdk_draw_pixmap (GdkDrawable *drawable,
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
src_private = (GdkWindowPrivate*) src;
|
||||
if (drawable_private->destroyed || src_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (width == -1)
|
||||
@@ -346,6 +375,8 @@ gdk_draw_points (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawPoints (drawable_private->xdisplay,
|
||||
@@ -373,6 +404,8 @@ gdk_draw_segments (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawSegments (drawable_private->xdisplay,
|
||||
@@ -381,3 +414,30 @@ gdk_draw_segments (GdkDrawable *drawable,
|
||||
(XSegment *) segs,
|
||||
nsegs);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_draw_lines (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
GdkPoint *points,
|
||||
gint npoints)
|
||||
{
|
||||
GdkWindowPrivate *drawable_private;
|
||||
GdkGCPrivate *gc_private;
|
||||
|
||||
if (npoints <= 0)
|
||||
return;
|
||||
|
||||
g_return_if_fail (drawable != NULL);
|
||||
g_return_if_fail (points != NULL);
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
XDrawLines (drawable_private->xdisplay,
|
||||
drawable_private->xwindow,
|
||||
gc_private->xgc,
|
||||
(XPoint *) points,
|
||||
npoints,
|
||||
CoordModeOrigin);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ gdk_font_load (const gchar *font_name)
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_fontset_load(gchar *fontset_name)
|
||||
gdk_fontset_load (gchar *fontset_name)
|
||||
{
|
||||
GdkFont *font;
|
||||
GdkFontPrivate *private;
|
||||
@@ -93,40 +93,6 @@ gdk_fontset_load(gchar *fontset_name)
|
||||
}
|
||||
return font;
|
||||
}
|
||||
void
|
||||
gdk_font_free (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
|
||||
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_fontset_free (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_font_ref (GdkFont *font)
|
||||
@@ -140,6 +106,35 @@ gdk_font_ref (GdkFont *font)
|
||||
return font;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_font_unref (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
|
||||
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
|
||||
break;
|
||||
default:
|
||||
g_error ("unknown font type.");
|
||||
break;
|
||||
}
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_font_id (GdkFont *font)
|
||||
{
|
||||
|
||||
176
gdk/gdkgc.c
176
gdk/gdkgc.c
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
@@ -28,21 +28,29 @@ gdk_gc_new (GdkWindow *window)
|
||||
}
|
||||
|
||||
GdkGC*
|
||||
gdk_gc_new_with_values (GdkWindow *window,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
gdk_gc_new_with_values (GdkWindow *window,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
GdkGC *gc;
|
||||
GdkGCPrivate *private;
|
||||
Window xwindow;
|
||||
XGCValues xvalues;
|
||||
unsigned long xvalues_mask;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
private = g_new (GdkGCPrivate, 1);
|
||||
gc = (GdkGC*) private;
|
||||
|
||||
xwindow = ((GdkWindowPrivate*) window)->xwindow;
|
||||
private->xdisplay = ((GdkWindowPrivate*) window)->xdisplay;
|
||||
xwindow = window_private->xwindow;
|
||||
private->xdisplay = window_private->xdisplay;
|
||||
private->ref_count = 1;
|
||||
|
||||
xvalues.function = GXcopy;
|
||||
xvalues.fill_style = FillSolid;
|
||||
@@ -141,11 +149,13 @@ gdk_gc_new_with_values (GdkWindow *window,
|
||||
xvalues.clip_y_origin = values->clip_y_origin;
|
||||
xvalues_mask |= GCClipYOrigin;
|
||||
}
|
||||
|
||||
if (values_mask & GDK_GC_EXPOSURES)
|
||||
{
|
||||
xvalues.graphics_exposures = values->graphics_exposures;
|
||||
xvalues_mask |= GCGraphicsExposures;
|
||||
}
|
||||
xvalues.graphics_exposures = values->graphics_exposures;
|
||||
else
|
||||
xvalues.graphics_exposures = False;
|
||||
xvalues_mask |= GCGraphicsExposures;
|
||||
|
||||
if (values_mask & GDK_GC_LINE_WIDTH)
|
||||
{
|
||||
xvalues.line_width = values->line_width;
|
||||
@@ -211,15 +221,35 @@ gdk_gc_new_with_values (GdkWindow *window,
|
||||
void
|
||||
gdk_gc_destroy (GdkGC *gc)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
gdk_gc_unref (gc);
|
||||
}
|
||||
|
||||
GdkGC *
|
||||
gdk_gc_ref (GdkGC *gc)
|
||||
{
|
||||
GdkGCPrivate *private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_val_if_fail (gc != NULL, NULL);
|
||||
private->ref_count += 1;
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_unref (GdkGC *gc)
|
||||
{
|
||||
GdkGCPrivate *private = (GdkGCPrivate*) gc;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
XFreeGC (private->xdisplay, private->xgc);
|
||||
|
||||
memset (gc, 0, sizeof (GdkGCPrivate));
|
||||
g_free (gc);
|
||||
|
||||
if (private->ref_count > 1)
|
||||
private->ref_count -= 1;
|
||||
else
|
||||
{
|
||||
XFreeGC (private->xdisplay, private->xgc);
|
||||
memset (gc, 0, sizeof (GdkGCPrivate));
|
||||
g_free (gc);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -336,7 +366,7 @@ gdk_gc_get_values (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_foreground (GdkGC *gc,
|
||||
gdk_gc_set_foreground (GdkGC *gc,
|
||||
GdkColor *color)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -349,7 +379,7 @@ gdk_gc_set_foreground (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_background (GdkGC *gc,
|
||||
gdk_gc_set_background (GdkGC *gc,
|
||||
GdkColor *color)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -362,7 +392,7 @@ gdk_gc_set_background (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_font (GdkGC *gc,
|
||||
gdk_gc_set_font (GdkGC *gc,
|
||||
GdkFont *font)
|
||||
{
|
||||
GdkGCPrivate *gc_private;
|
||||
@@ -371,15 +401,18 @@ gdk_gc_set_font (GdkGC *gc,
|
||||
g_return_if_fail (gc != NULL);
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
XSetFont (gc_private->xdisplay, gc_private->xgc,
|
||||
((XFontStruct *) font_private->xfont)->fid);
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
{
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
font_private = (GdkFontPrivate*) font;
|
||||
|
||||
XSetFont (gc_private->xdisplay, gc_private->xgc,
|
||||
((XFontStruct *) font_private->xfont)->fid);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_function (GdkGC *gc,
|
||||
gdk_gc_set_function (GdkGC *gc,
|
||||
GdkFunction function)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -397,13 +430,13 @@ gdk_gc_set_function (GdkGC *gc,
|
||||
XSetFunction (private->xdisplay, private->xgc, GXinvert);
|
||||
break;
|
||||
case GDK_XOR:
|
||||
XSetFunction (private->xdisplay, private->xgc, GXor);
|
||||
XSetFunction (private->xdisplay, private->xgc, GXxor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_fill (GdkGC *gc,
|
||||
gdk_gc_set_fill (GdkGC *gc,
|
||||
GdkFill fill)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -430,7 +463,7 @@ gdk_gc_set_fill (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_tile (GdkGC *gc,
|
||||
gdk_gc_set_tile (GdkGC *gc,
|
||||
GdkPixmap *tile)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -502,28 +535,35 @@ gdk_gc_set_clip_origin (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
gdk_gc_set_clip_mask (GdkGC *gc,
|
||||
GdkBitmap *mask)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
Pixmap xmask;
|
||||
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
|
||||
if (mask)
|
||||
xmask = ((GdkWindowPrivate*) mask)->xwindow;
|
||||
{
|
||||
GdkWindowPrivate *mask_private;
|
||||
|
||||
mask_private = (GdkWindowPrivate*) mask;
|
||||
if (mask_private->destroyed)
|
||||
return;
|
||||
xmask = mask_private->xwindow;
|
||||
}
|
||||
else
|
||||
xmask = None;
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
XSetClipMask (private->xdisplay, private->xgc, xmask);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
GdkRectangle *rectangle)
|
||||
gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
GdkRectangle *rectangle)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
XRectangle xrectangle;
|
||||
@@ -532,18 +572,44 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
xrectangle.x = rectangle->x;
|
||||
xrectangle.y = rectangle->y;
|
||||
xrectangle.width = rectangle->width;
|
||||
xrectangle.height = rectangle->height;
|
||||
|
||||
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
|
||||
&xrectangle, 1, Unsorted);
|
||||
if (rectangle)
|
||||
{
|
||||
xrectangle.x = rectangle->x;
|
||||
xrectangle.y = rectangle->y;
|
||||
xrectangle.width = rectangle->width;
|
||||
xrectangle.height = rectangle->height;
|
||||
|
||||
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
|
||||
&xrectangle, 1, Unsorted);
|
||||
}
|
||||
else
|
||||
XSetClipMask (private->xdisplay, private->xgc, None);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode)
|
||||
gdk_gc_set_clip_region (GdkGC *gc,
|
||||
GdkRegion *region)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
private = (GdkGCPrivate*) gc;
|
||||
|
||||
if (region)
|
||||
{
|
||||
GdkRegionPrivate *region_private;
|
||||
|
||||
region_private = (GdkRegionPrivate*) region;
|
||||
XSetRegion (private->xdisplay, private->xgc, region_private->xregion);
|
||||
}
|
||||
else
|
||||
XSetClipMask (private->xdisplay, private->xgc, None);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_subwindow (GdkGC *gc,
|
||||
GdkSubwindowMode mode)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
|
||||
@@ -568,10 +634,10 @@ gdk_gc_set_exposures (GdkGC *gc,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
gint line_width,
|
||||
gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
gint line_width,
|
||||
GdkLineStyle line_style,
|
||||
GdkCapStyle cap_style,
|
||||
GdkCapStyle cap_style,
|
||||
GdkJoinStyle join_style)
|
||||
{
|
||||
GdkGCPrivate *private;
|
||||
@@ -634,3 +700,15 @@ gdk_gc_set_line_attributes (GdkGC *gc,
|
||||
XSetLineAttributes (private->xdisplay, private->xgc, line_width,
|
||||
xline_style, xcap_style, xjoin_style);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
|
||||
{
|
||||
GdkGCPrivate *dst_private, *src_private;
|
||||
|
||||
src_private = (GdkGCPrivate *) src_gc;
|
||||
dst_private = (GdkGCPrivate *) dst_gc;
|
||||
|
||||
XCopyGC (src_private->xdisplay, src_private->xgc, ~((~1) << GCLastBit),
|
||||
dst_private->xgc);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
#include "gdktypes.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
gint gdk_debug_level = 0;
|
||||
gint gdk_show_events = FALSE;
|
||||
guint gdk_debug_flags = 0;
|
||||
gint gdk_use_xshm = TRUE;
|
||||
gchar *gdk_display_name = NULL;
|
||||
Display *gdk_display = NULL;
|
||||
@@ -34,14 +33,22 @@ Atom gdk_wm_take_focus;
|
||||
Atom gdk_wm_protocols;
|
||||
Atom gdk_wm_window_protocols[2];
|
||||
Atom gdk_selection_property;
|
||||
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
|
||||
{0,0}, {0,0}, NULL};
|
||||
GdkDndGlobals gdk_dnd = {None,None,None,
|
||||
None,None,None,
|
||||
None,
|
||||
None,None,
|
||||
&gdk_dnd_cursorinfo,
|
||||
NULL,
|
||||
0, 0,
|
||||
{0,0}};
|
||||
0,
|
||||
FALSE, FALSE, FALSE,
|
||||
None,
|
||||
{0,0},
|
||||
{0,0}, {0,0},
|
||||
{0,0,0,0}, NULL, None, 0};
|
||||
gchar *gdk_progname = NULL;
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
GList *gdk_default_filters = NULL;
|
||||
|
||||
160
gdk/gdki18n.h
Normal file
160
gdk/gdki18n.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_I18N_H__
|
||||
#define __GDK_I18N_H__
|
||||
|
||||
/* GDK uses "glib". (And so does GTK).
|
||||
*/
|
||||
#include <glib.h>
|
||||
|
||||
/* international string support */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef X_LOCALE
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Xosdefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern int _Xmblen (
|
||||
#if NeedFunctionPrototypes
|
||||
const char *s, size_t n
|
||||
#endif
|
||||
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern int _Xmbtowc (
|
||||
#if NeedFunctionPrototypes
|
||||
wchar_t *wstr, const char *str, size_t len
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern int _Xwctomb (
|
||||
#if NeedFunctionPrototypes
|
||||
char *str, wchar_t wc
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern size_t _Xmbstowcs (
|
||||
#if NeedFunctionPrototypes
|
||||
wchar_t *wstr, const char *str, size_t len
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern size_t _Xwcstombs (
|
||||
#if NeedFunctionPrototypes
|
||||
char *str, const wchar_t *wstr, size_t len
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern size_t _Xwcslen (
|
||||
#if NeedFunctionPrototypes
|
||||
const wchar_t *wstr
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern wchar_t* _Xwcscpy (
|
||||
#if NeedFunctionPrototypes
|
||||
wchar_t *wstr1, const wchar_t *wstr2
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern wchar_t* _Xwcsncpy (
|
||||
#if NeedFunctionPrototypes
|
||||
wchar_t *wstr1, const wchar_t *wstr2, size_t len
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern int _Xwcscmp (
|
||||
#if NeedFunctionPrototypes
|
||||
const wchar_t *wstr1, const wchar_t *wstr2
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
extern int _Xwcsncmp (
|
||||
#if NeedFunctionPrototypes
|
||||
const wchar_t *wstr1, const wchar_t *wstr2, size_t len
|
||||
#endif
|
||||
);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
/*
|
||||
* mblen, mbtowc, and mbstowcs of the locale "ja_JP.eucJP" are buggy.
|
||||
*/
|
||||
|
||||
#ifdef MB_CUR_MAX
|
||||
# undef MB_CUR_MAX
|
||||
#endif
|
||||
#define MB_CUR_MAX 4
|
||||
extern int _g_mbtowc (wchar_t *wstr, const char *str, size_t len);
|
||||
|
||||
/* #define mblen _Xmblen */
|
||||
/* #define mbtowc _Xmbtowc */
|
||||
#define mblen(a,b) _g_mbtowc ((wchar_t *)(NULL), (a), (b))
|
||||
#define mbtowc(a,b,c) _g_mbtowc ((a),(b),(c))
|
||||
|
||||
#define wctomb(a,b) _Xwctomb ((a),(b))
|
||||
#define mbstowcs(a,b,c) _Xmbstowcs ((a),(b),(c))
|
||||
#define wcstombs(a,b,c) _Xwcstombs ((a),(b),(c))
|
||||
#define wcslen(a) _Xwcslen ((a))
|
||||
#define wcscpy(a,b) _Xwcscpy ((a),(b))
|
||||
#define wcsncpy(a,b,c) _Xwcsncpy ((a),(b),(c))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* X_LOCALE */
|
||||
|
||||
#if !defined(HAVE_BROKEN_WCTYPE) && (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) && !defined(X_LOCALE)
|
||||
# ifdef HAVE_WCTYPE_H
|
||||
# include <wctype.h>
|
||||
# else
|
||||
# ifdef HAVE_WCHAR_H
|
||||
# include <wchar.h>
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_I18N_H__ */
|
||||
@@ -136,7 +136,6 @@ gdk_image_init ()
|
||||
{
|
||||
if (!gdk_image_check_xshm (gdk_display))
|
||||
{
|
||||
g_warning ("MIT-SHM Extension not availible on server");
|
||||
gdk_use_xshm = False;
|
||||
}
|
||||
}
|
||||
@@ -213,7 +212,6 @@ gdk_image_new (GdkImageType type,
|
||||
g_free (private->x_shm_info);
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
gdk_use_xshm = False;
|
||||
return NULL;
|
||||
}
|
||||
@@ -249,8 +247,7 @@ gdk_image_new (GdkImageType type,
|
||||
gdk_error_warnings = 1;
|
||||
if (gdk_error_code == -1)
|
||||
{
|
||||
g_warning ("XShmAttach failed!");
|
||||
|
||||
/* this is the common failure case so omit warning */
|
||||
XDestroyImage (private->ximage);
|
||||
shmdt (x_shm_info->shmaddr);
|
||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||
@@ -330,6 +327,8 @@ gdk_image_get (GdkWindow *window,
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
win_private = (GdkWindowPrivate *) window;
|
||||
if (win_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
image = (GdkImage*) private;
|
||||
@@ -447,6 +446,8 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
@@ -478,6 +479,8 @@ gdk_image_put_shared (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
|
||||
@@ -102,6 +102,15 @@ gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
gdk_input_vtable.set_axes (deviceid, axes);
|
||||
}
|
||||
|
||||
void gdk_input_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
{
|
||||
if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_key)
|
||||
gdk_input_vtable.set_key (deviceid, index, keyval, modifiers);
|
||||
}
|
||||
|
||||
GdkTimeCoord *
|
||||
gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
@@ -109,14 +118,20 @@ gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 stop,
|
||||
gint *nevents_return)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
XTimeCoord *xcoords;
|
||||
GdkTimeCoord *coords;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
if (deviceid == GDK_CORE_POINTER)
|
||||
{
|
||||
xcoords = XGetMotionEvents (gdk_display,
|
||||
((GdkWindowPrivate *)window)->xwindow,
|
||||
window_private->xwindow,
|
||||
start, stop, nevents_return);
|
||||
if (xcoords)
|
||||
{
|
||||
@@ -195,10 +210,14 @@ void
|
||||
gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
GdkExtensionMode mode)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
GList *tmp_list;
|
||||
GdkInputWindow *iw;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return;
|
||||
|
||||
if (mode == GDK_EXTENSION_EVENTS_NONE)
|
||||
mask = 0;
|
||||
@@ -215,7 +234,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
iw->grabbed = FALSE;
|
||||
|
||||
gdk_input_windows = g_list_append(gdk_input_windows,iw);
|
||||
((GdkWindowPrivate *)window)->extension_events = mask;
|
||||
window_private->extension_events = mask;
|
||||
|
||||
/* Add enter window events to the event mask */
|
||||
/* FIXME, this is not needed for XINPUT_NONE */
|
||||
@@ -232,7 +251,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
g_free(iw);
|
||||
}
|
||||
|
||||
((GdkWindowPrivate *)window)->extension_events = 0;
|
||||
window_private->extension_events = 0;
|
||||
}
|
||||
|
||||
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)
|
||||
@@ -258,7 +277,7 @@ gdk_input_window_destroy (GdkWindow *window)
|
||||
input_window = gdk_input_window_find (window);
|
||||
g_return_if_fail (input_window != NULL);
|
||||
|
||||
gdk_input_windows = g_list_remove(gdk_input_windows,input_window);
|
||||
gdk_input_windows = g_list_remove (gdk_input_windows,input_window);
|
||||
g_free(input_window);
|
||||
}
|
||||
|
||||
@@ -280,6 +299,7 @@ gdk_input_exit (void)
|
||||
g_free(gdkdev->axes);
|
||||
#endif
|
||||
g_free(gdkdev->info.axes);
|
||||
g_free(gdkdev->info.keys);
|
||||
g_free(gdkdev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ typedef struct _GdkInputWindow GdkInputWindow;
|
||||
struct _GdkInputVTable {
|
||||
gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
|
||||
void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
|
||||
void (*set_key) (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
|
||||
GdkTimeCoord* (*motion_events) (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
guint32 start,
|
||||
@@ -93,8 +98,12 @@ struct _GdkDevicePrivate {
|
||||
/* Information about XInput device */
|
||||
XDevice *xdevice;
|
||||
|
||||
int buttonpress_type, buttonrelease_type, motionnotify_type,
|
||||
proximityin_type, proximityout_type, changenotify_type;
|
||||
/* minimum key code for device */
|
||||
gint min_keycode;
|
||||
|
||||
int buttonpress_type, buttonrelease_type, keypress_type,
|
||||
keyrelease_type, motionnotify_type, proximityin_type,
|
||||
proximityout_type, changenotify_type;
|
||||
|
||||
/* true if we need to select a different set of events, but
|
||||
can't because this is the core pointer */
|
||||
@@ -140,4 +149,4 @@ extern gint gdk_input_ignore_core;
|
||||
|
||||
void gdk_input_window_destroy (GdkWindow *window);
|
||||
|
||||
#endif __GDK_INPUT_H__
|
||||
#endif /* __GDK_INPUT_H__ */
|
||||
|
||||
@@ -59,6 +59,8 @@ static void gdk_input_common_get_pointer (GdkWindow *window,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
|
||||
#define GDK_MAX_DEVICE_CLASSES 13
|
||||
|
||||
/* Global variables */
|
||||
|
||||
static gint gdk_input_root_width;
|
||||
@@ -70,9 +72,11 @@ gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_
|
||||
{
|
||||
Window root,parent;
|
||||
Window *children;
|
||||
int nchildren;
|
||||
int x,y,width,height;
|
||||
int xc,yc,widthc,heightc,border_widthc,depthc;
|
||||
guint nchildren;
|
||||
gint x,y;
|
||||
guint width, height;
|
||||
gint xc,yc;
|
||||
guint widthc,heightc,border_widthc,depthc;
|
||||
|
||||
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
|
||||
if (children) XFree(children);
|
||||
@@ -156,6 +160,8 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
/* step through the classes */
|
||||
|
||||
gdkdev->info.num_axes = 0;
|
||||
gdkdev->info.num_keys = 0;
|
||||
gdkdev->info.keys = NULL;
|
||||
gdkdev->axes = 0;
|
||||
gdkdev->info.has_cursor = 0;
|
||||
gdkdev->needs_update = FALSE;
|
||||
@@ -168,6 +174,32 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
switch (class->class) {
|
||||
case ButtonClass:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case KeyClass:
|
||||
{
|
||||
XKeyInfo *xki = (XKeyInfo *)class;
|
||||
/* Hack to catch XFree86 3.3.1 bug. Other devices better
|
||||
* not have exactly 25 keys...
|
||||
*/
|
||||
if ((xki->min_keycode == 8) && (xki->max_keycode == 32))
|
||||
{
|
||||
gdkdev->info.num_keys = 32;
|
||||
gdkdev->min_keycode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdkdev->info.num_keys = xki->max_keycode - xki->min_keycode + 1;
|
||||
gdkdev->min_keycode = xki->min_keycode;
|
||||
}
|
||||
gdkdev->info.keys = g_new (GdkDeviceKey, gdkdev->info.num_keys);
|
||||
|
||||
for (j=0; j<gdkdev->info.num_keys; j++)
|
||||
{
|
||||
gdkdev->info.keys[j].keyval = 0;
|
||||
gdkdev->info.keys[j].modifiers = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ValuatorClass:
|
||||
@@ -218,12 +250,45 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
g_free(gdkdev->info.name);
|
||||
if (gdkdev->axes)
|
||||
g_free(gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free(gdkdev->info.keys);
|
||||
g_free(gdkdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (device->use != IsXPointer)
|
||||
{
|
||||
int error_warn = gdk_error_warnings;
|
||||
|
||||
gdk_error_warnings = 0;
|
||||
gdk_error_code = 0;
|
||||
gdkdev->xdevice = XOpenDevice(gdk_display, gdkdev->info.deviceid);
|
||||
gdk_error_warnings = error_warn;
|
||||
|
||||
/* return NULL if device is not ready */
|
||||
if (gdk_error_code)
|
||||
{
|
||||
g_free (gdkdev->info.name);
|
||||
if (gdkdev->axes)
|
||||
g_free (gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free (gdkdev->info.keys);
|
||||
if (gdkdev->info.axes)
|
||||
g_free (gdkdev->info.axes);
|
||||
g_free (gdkdev);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gdkdev->buttonpress_type = 0;
|
||||
gdkdev->buttonrelease_type = 0;
|
||||
gdkdev->keypress_type = 0;
|
||||
gdkdev->keyrelease_type = 0;
|
||||
gdkdev->motionnotify_type = 0;
|
||||
gdkdev->proximityin_type = 0;
|
||||
gdkdev->proximityout_type = 0;
|
||||
gdkdev->changenotify_type = 0;
|
||||
|
||||
return gdkdev;
|
||||
}
|
||||
@@ -240,11 +305,15 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
|
||||
i = 0;
|
||||
/* We have to track press and release events in pairs to keep
|
||||
track of button state correctly and implement grabbing */
|
||||
track of button state correctly and implement grabbing for
|
||||
the gxi support */
|
||||
if (mask & GDK_BUTTON_PRESS_MASK || mask & GDK_BUTTON_RELEASE_MASK)
|
||||
{
|
||||
DeviceButtonPress (gdkdev->xdevice, gdkdev->buttonpress_type,
|
||||
class);
|
||||
DeviceButtonPress (gdkdev->xdevice, gdkdev->buttonpress_type,
|
||||
class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
DeviceButtonPressGrab (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
DeviceButtonRelease (gdkdev->xdevice, gdkdev->buttonrelease_type,
|
||||
@@ -258,6 +327,38 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
else
|
||||
if (mask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
|
||||
GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
|
||||
GDK_POINTER_MOTION_HINT_MASK))
|
||||
{
|
||||
/* Make sure gdkdev->motionnotify_type is set */
|
||||
DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class);
|
||||
}
|
||||
if (mask & GDK_BUTTON1_MOTION_MASK)
|
||||
{
|
||||
DeviceButton1Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON2_MOTION_MASK)
|
||||
{
|
||||
DeviceButton2Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON3_MOTION_MASK)
|
||||
{
|
||||
DeviceButton3Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON_MOTION_MASK)
|
||||
{
|
||||
DeviceButtonMotion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_POINTER_MOTION_HINT_MASK)
|
||||
{
|
||||
/* We'll get into trouble if the macros change, but at least we'll
|
||||
@@ -266,6 +367,18 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_KEY_PRESS_MASK)
|
||||
{
|
||||
DeviceKeyPress (gdkdev->xdevice, gdkdev->keypress_type, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_KEY_RELEASE_MASK)
|
||||
{
|
||||
DeviceKeyRelease (gdkdev->xdevice, gdkdev->keyrelease_type, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_PROXIMITY_IN_MASK)
|
||||
{
|
||||
ProximityIn (gdkdev->xdevice, gdkdev->proximityin_type, class);
|
||||
@@ -286,7 +399,7 @@ static void
|
||||
gdk_input_common_select_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
XEventClass classes[6];
|
||||
XEventClass classes[GDK_MAX_DEVICE_CLASSES];
|
||||
gint num_classes;
|
||||
|
||||
if (gdkdev->info.mode == GDK_MODE_DISABLED)
|
||||
@@ -492,9 +605,77 @@ gdk_input_common_other_event (GdkEvent *event,
|
||||
event->button.state = gdk_input_translate_state(xdbe->state,xdbe->device_state);
|
||||
event->button.button = xdbe->button;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("button %s:\t\twindow: %ld device: %ld x,y: %f %f button: %d\n",
|
||||
(event->button.type == GDK_BUTTON_PRESS) ? "press" : "release",
|
||||
xdbe->window,
|
||||
xdbe->deviceid,
|
||||
event->button.x, event->button.y,
|
||||
xdbe->button));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((xevent->type == gdkdev->keypress_type) ||
|
||||
(xevent->type == gdkdev->keyrelease_type))
|
||||
{
|
||||
XDeviceKeyEvent *xdke = (XDeviceKeyEvent *)(xevent);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("device key %s:\twindow: %ld device: %ld keycode: %d\n",
|
||||
(event->key.type == GDK_KEY_PRESS) ? "press" : "release",
|
||||
xdke->window,
|
||||
xdke->deviceid,
|
||||
xdke->keycode));
|
||||
|
||||
if (xdke->keycode < gdkdev->min_keycode ||
|
||||
xdke->keycode >= gdkdev->min_keycode + gdkdev->info.num_keys)
|
||||
{
|
||||
g_warning ("Invalid device key code received");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
event->key.keyval = gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].keyval;
|
||||
|
||||
if (event->key.keyval == 0)
|
||||
{
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("\t\ttranslation - NONE\n"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
event->key.type = (xdke->type == gdkdev->keypress_type) ?
|
||||
GDK_KEY_PRESS : GDK_KEY_RELEASE;
|
||||
|
||||
event->key.window = input_window->window;
|
||||
event->key.time = xdke->time;
|
||||
|
||||
event->key.state = gdk_input_translate_state(xdke->state, xdke->device_state)
|
||||
| gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].modifiers;
|
||||
|
||||
/* Add a string translation for the key event */
|
||||
if ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xFF))
|
||||
{
|
||||
event->key.length = 1;
|
||||
event->key.string = g_new (gchar, 2);
|
||||
event->key.string[0] = (gchar)event->key.keyval;
|
||||
event->key.string[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->key.length = 0;
|
||||
event->key.string = g_new0 (gchar, 1);
|
||||
}
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("\t\ttranslation - keyval: %d modifiers: %#x\n",
|
||||
event->key.keyval,
|
||||
event->key.state));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (xevent->type == gdkdev->motionnotify_type)
|
||||
{
|
||||
XDeviceMotionEvent *xdme = (XDeviceMotionEvent *)(xevent);
|
||||
@@ -511,15 +692,17 @@ gdk_input_common_other_event (GdkEvent *event,
|
||||
event->motion.deviceid = xdme->deviceid;
|
||||
event->motion.state = gdk_input_translate_state(xdme->state,
|
||||
xdme->device_state);
|
||||
event->motion.is_hint = xdme->is_hint;
|
||||
event->motion.source = gdkdev->info.source;
|
||||
event->motion.deviceid = xdme->deviceid;
|
||||
|
||||
if (gdk_show_events)
|
||||
g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f hint: %s\n",
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f state %#4x hint: %s\n",
|
||||
xdme->window,
|
||||
xdme->deviceid,
|
||||
event->motion.x, event->motion.y,
|
||||
(xevent->xmotion.is_hint) ? "true" : "false");
|
||||
event->motion.state,
|
||||
(xdme->is_hint) ? "true" : "false"));
|
||||
|
||||
|
||||
return TRUE;
|
||||
@@ -562,6 +745,21 @@ gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
}
|
||||
}
|
||||
|
||||
void gdk_input_common_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
{
|
||||
GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid);
|
||||
|
||||
gdkdev = gdk_input_find_device (deviceid);
|
||||
g_return_if_fail (gdkdev != NULL);
|
||||
g_return_if_fail (index < gdkdev->info.num_keys);
|
||||
|
||||
gdkdev->info.keys[index].keyval = keyval;
|
||||
gdkdev->info.keys[index].modifiers = modifiers;
|
||||
}
|
||||
|
||||
static GdkTimeCoord *
|
||||
gdk_input_common_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
@@ -658,24 +856,21 @@ gdk_input_common_get_pointer (GdkWindow *window,
|
||||
switch (input_class->class)
|
||||
{
|
||||
case ValuatorClass:
|
||||
gdk_input_translate_coordinates(gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
x, y, pressure,
|
||||
xtilt, ytilt);
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
x, y, pressure,
|
||||
xtilt, ytilt);
|
||||
|
||||
|
||||
break;
|
||||
case ButtonClass:
|
||||
if (mask)
|
||||
{
|
||||
*mask &= ~(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
|
||||
GDK_BUTTON3_MASK | GDK_BUTTON4_MASK |
|
||||
GDK_BUTTON5_MASK);
|
||||
for (i=0; i < ((XButtonState *)input_class)->num_buttons; i++)
|
||||
{
|
||||
if (((XButtonState *)input_class)->buttons[i])
|
||||
*mask |= GDK_BUTTON1_MASK << i;
|
||||
}
|
||||
*mask &= 0xFF;
|
||||
if (((XButtonState *)input_class)->num_buttons > 0)
|
||||
*mask |= ((XButtonState *)input_class)->buttons[0] << 7;
|
||||
/* GDK_BUTTON1_MASK = 1 << 8, and button n is stored
|
||||
* in bit 1<<(n%8) in byte n/8. n = 1,2,... */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,8 @@ gdk_input_init(void)
|
||||
GList *tmp_list;
|
||||
|
||||
gdk_input_vtable.set_mode = gdk_input_gxi_set_mode;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_key = gdk_input_common_set_key;
|
||||
gdk_input_vtable.motion_events = gdk_input_gxi_motion_events;
|
||||
gdk_input_vtable.get_pointer = gdk_input_gxi_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = gdk_input_gxi_grab_pointer;
|
||||
|
||||
@@ -32,6 +32,7 @@ gdk_input_init ()
|
||||
{
|
||||
gdk_input_vtable.set_mode = NULL;
|
||||
gdk_input_vtable.set_axes = NULL;
|
||||
gdk_input_vtable.set_key = NULL;
|
||||
gdk_input_vtable.motion_events = NULL;
|
||||
gdk_input_vtable.get_pointer = gdk_input_none_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = NULL;
|
||||
|
||||
@@ -44,7 +44,8 @@ void
|
||||
gdk_input_init(void)
|
||||
{
|
||||
gdk_input_vtable.set_mode = gdk_input_xfree_set_mode;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_key = gdk_input_common_set_key;
|
||||
gdk_input_vtable.motion_events = gdk_input_common_motion_events;
|
||||
gdk_input_vtable.get_pointer = gdk_input_common_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = gdk_input_xfree_grab_pointer;
|
||||
@@ -229,33 +230,6 @@ gdk_input_xfree_other_event (GdkEvent *event,
|
||||
gdk_input_ignore_core)
|
||||
gdk_input_check_proximity();
|
||||
|
||||
/* Do a passive button grab. We have to be careful not to release
|
||||
an explicit grab, if any. Doubling the grab should be harmless,
|
||||
but we check anyways. */
|
||||
|
||||
/* FIXME, finding the proper events here is going to be SLOW - but
|
||||
we might have different sets for each window/device combination */
|
||||
|
||||
if (return_val> 0 && !input_window->grabbed)
|
||||
{
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
XEventClass event_classes[6];
|
||||
gint num_classes;
|
||||
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
((GdkWindowPrivate *)window)->extension_events,
|
||||
event_classes, &num_classes);
|
||||
|
||||
XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
TRUE, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, event->button.time);
|
||||
}
|
||||
else if (event->type == GDK_BUTTON_RELEASE)
|
||||
XUngrabDevice( GDK_DISPLAY(), gdkdev->xdevice, event->button.time);
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
@@ -284,8 +258,9 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
GdkInputWindow *input_window, *new_window;
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GList *tmp_list;
|
||||
XEventClass event_classes[6];
|
||||
XEventClass event_classes[GDK_MAX_DEVICE_CLASSES];
|
||||
gint num_classes;
|
||||
gint result;
|
||||
|
||||
tmp_list = gdk_input_windows;
|
||||
new_window = NULL;
|
||||
@@ -296,15 +271,12 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
return AlreadyGrabbed;
|
||||
|
||||
if (input_window->window == window)
|
||||
{
|
||||
new_window = input_window;
|
||||
break;
|
||||
}
|
||||
new_window = input_window;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
g_return_if_fail (new_window == NULL);
|
||||
g_return_val_if_fail (new_window != NULL, Success); /* shouldn't happen */
|
||||
|
||||
new_window->grabbed = TRUE;
|
||||
|
||||
@@ -313,17 +285,21 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
{
|
||||
gdkdev = (GdkDevicePrivate *)tmp_list->data;
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER &&
|
||||
gdkdev->xdevice && !gdkdev->button_state)
|
||||
gdkdev->xdevice)
|
||||
{
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
((GdkWindowPrivate *)window)->extension_events,
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
event_mask,
|
||||
event_classes, &num_classes);
|
||||
|
||||
/* FIXME: we should do something on failure */
|
||||
XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
TRUE, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, time);
|
||||
result = XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
owner_events, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, time);
|
||||
|
||||
/* FIXME: if failure occurs on something other than the first
|
||||
device, things will be badly inconsistent */
|
||||
if (result != Success)
|
||||
return result;
|
||||
}
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
@@ -355,11 +331,9 @@ gdk_input_xfree_ungrab_pointer (guint32 time)
|
||||
while (tmp_list)
|
||||
{
|
||||
gdkdev = (GdkDevicePrivate *)tmp_list->data;
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER &&
|
||||
gdkdev->xdevice && !gdkdev->button_state)
|
||||
{
|
||||
XUngrabDevice( gdk_display, gdkdev->xdevice, time);
|
||||
}
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER && gdkdev->xdevice)
|
||||
XUngrabDevice( gdk_display, gdkdev->xdevice, time);
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
1316
gdk/gdkkeysyms.h
Normal file
1316
gdk/gdkkeysyms.h
Normal file
File diff suppressed because it is too large
Load Diff
199
gdk/gdkpixmap.c
199
gdk/gdkpixmap.c
@@ -19,6 +19,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
/* Needed for SEEK_END in SunOS */
|
||||
#include <unistd.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include "gdk.h"
|
||||
@@ -41,17 +43,21 @@ gdk_pixmap_new (GdkWindow *window,
|
||||
GdkWindowPrivate *private;
|
||||
GdkWindowPrivate *window_private;
|
||||
|
||||
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) &gdk_root_parent;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
if (depth == -1)
|
||||
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
|
||||
|
||||
private = g_new (GdkWindowPrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
private->xdisplay = window_private->xdisplay;
|
||||
private->window_type = GDK_WINDOW_PIXMAP;
|
||||
private->xwindow = XCreatePixmap (private->xdisplay, window_private->xwindow,
|
||||
@@ -85,11 +91,13 @@ gdk_bitmap_create_from_data (GdkWindow *window,
|
||||
if (!window)
|
||||
window = (GdkWindow*) &gdk_root_parent;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
private = g_new (GdkWindowPrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
private->parent = NULL;
|
||||
private->xdisplay = window_private->xdisplay;
|
||||
private->window_type = GDK_WINDOW_PIXMAP;
|
||||
@@ -126,18 +134,21 @@ gdk_pixmap_create_from_data (GdkWindow *window,
|
||||
g_return_val_if_fail (data != NULL, NULL);
|
||||
g_return_val_if_fail (fg != NULL, NULL);
|
||||
g_return_val_if_fail (bg != NULL, NULL);
|
||||
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) &gdk_root_parent;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
if (depth == -1)
|
||||
gdk_window_get_geometry (window, NULL, NULL, NULL, NULL, &depth);
|
||||
|
||||
private = g_new (GdkWindowPrivate, 1);
|
||||
pixmap = (GdkPixmap*) private;
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
private->parent = NULL;
|
||||
private->xdisplay = window_private->xdisplay;
|
||||
private->window_type = GDK_WINDOW_PIXMAP;
|
||||
@@ -216,10 +227,10 @@ gdk_pixmap_seek_char (FILE *infile,
|
||||
gint
|
||||
gdk_pixmap_read_string (FILE *infile,
|
||||
gchar **buffer,
|
||||
int *buffer_size)
|
||||
guint *buffer_size)
|
||||
{
|
||||
gchar c;
|
||||
gint cnt = 0;
|
||||
guint cnt = 0;
|
||||
|
||||
if ((*buffer) == NULL)
|
||||
{
|
||||
@@ -309,8 +320,7 @@ gdk_pixmap_extract_color (gchar *buffer)
|
||||
return NULL;
|
||||
else if (ptr[0] == '#')
|
||||
{
|
||||
retcol = g_new(gchar, strlen (ptr) + 1);
|
||||
strcpy (retcol, ptr);
|
||||
retcol = g_strdup (ptr);
|
||||
return retcol;
|
||||
}
|
||||
|
||||
@@ -335,33 +345,43 @@ gdk_pixmap_extract_color (gchar *buffer)
|
||||
}
|
||||
}
|
||||
|
||||
retcol = g_new(gchar, strlen (color) + 1);
|
||||
strcpy (retcol, color);
|
||||
retcol = g_strdup (color);
|
||||
return retcol;
|
||||
}
|
||||
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename)
|
||||
gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename)
|
||||
{
|
||||
FILE *infile = NULL;
|
||||
GdkPixmap *pixmap = NULL;
|
||||
GdkImage *image = NULL;
|
||||
GdkColormap *colormap;
|
||||
GdkVisual *visual;
|
||||
GdkGC *gc;
|
||||
GdkColor tmp_color;
|
||||
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt;
|
||||
gchar *buffer = NULL, *color_name = NULL, pixel_str[32];
|
||||
gchar *buffer = NULL, pixel_str[32];
|
||||
guint buffer_size = 0;
|
||||
_GdkPixmapColor *colors = NULL, *color = NULL;
|
||||
gulong index;
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) &gdk_root_parent;
|
||||
if ((window == NULL) && (colormap == NULL))
|
||||
g_warning ("Creating pixmap from xpm with NULL window and colormap");
|
||||
|
||||
if (window == NULL)
|
||||
window = (GdkWindow *)&gdk_root_parent;
|
||||
|
||||
if (colormap == NULL)
|
||||
{
|
||||
colormap = gdk_window_get_colormap (window);
|
||||
visual = gdk_window_get_visual (window);
|
||||
}
|
||||
else
|
||||
visual = ((GdkColormapPrivate *)colormap)->visual;
|
||||
|
||||
infile = fopen (filename, "rb");
|
||||
if (infile != NULL)
|
||||
@@ -378,9 +398,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
|
||||
colors = g_new(_GdkPixmapColor, num_cols);
|
||||
|
||||
colormap = gdk_window_get_colormap (window);
|
||||
visual = gdk_window_get_visual (window);
|
||||
|
||||
if (transparent_color == NULL)
|
||||
{
|
||||
gdk_color_white (colormap, &tmp_color);
|
||||
@@ -389,6 +406,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
|
||||
for (cnt = 0; cnt < num_cols; cnt++)
|
||||
{
|
||||
gchar *color_name;
|
||||
|
||||
gdk_pixmap_seek_char (infile, '"');
|
||||
fseek (infile, -1, SEEK_CUR);
|
||||
gdk_pixmap_read_string (infile, &buffer, &buffer_size);
|
||||
@@ -399,9 +418,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
colors[cnt].color_string[n] = 0;
|
||||
colors[cnt].transparent = FALSE;
|
||||
|
||||
if (color_name != NULL)
|
||||
g_free (color_name);
|
||||
|
||||
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
|
||||
|
||||
if (color_name != NULL)
|
||||
@@ -418,6 +434,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
colors[cnt].transparent = TRUE;
|
||||
}
|
||||
|
||||
g_free (color_name);
|
||||
|
||||
gdk_color_alloc (colormap, &colors[cnt].color);
|
||||
}
|
||||
|
||||
@@ -427,15 +445,21 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
gc = NULL;
|
||||
if (mask)
|
||||
{
|
||||
/* The pixmap mask is just a bits pattern.
|
||||
* Color 0 is used for background and 1 for foreground.
|
||||
* We don't care about the colormap, we just need 0 and 1.
|
||||
*/
|
||||
GdkColor mask_pattern;
|
||||
|
||||
*mask = gdk_pixmap_new (window, width, height, 1);
|
||||
gc = gdk_gc_new (*mask);
|
||||
|
||||
gdk_color_black (colormap, &tmp_color);
|
||||
gdk_gc_set_foreground (gc, &tmp_color);
|
||||
|
||||
mask_pattern.pixel = 0;
|
||||
gdk_gc_set_foreground (gc, &mask_pattern);
|
||||
gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
|
||||
|
||||
gdk_color_white (colormap, &tmp_color);
|
||||
gdk_gc_set_foreground (gc, &tmp_color);
|
||||
|
||||
mask_pattern.pixel = 1;
|
||||
gdk_gc_set_foreground (gc, &mask_pattern);
|
||||
}
|
||||
|
||||
for (ycnt = 0; ycnt < height; ycnt++)
|
||||
@@ -499,24 +523,46 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
}
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data)
|
||||
gdk_pixmap_create_from_xpm (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
const gchar *filename)
|
||||
{
|
||||
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
|
||||
transparent_color, filename);
|
||||
}
|
||||
|
||||
|
||||
GdkPixmap*
|
||||
gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
|
||||
GdkColormap *colormap,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data)
|
||||
{
|
||||
GdkPixmap *pixmap = NULL;
|
||||
GdkImage *image = NULL;
|
||||
GdkColormap *colormap;
|
||||
GdkVisual *visual;
|
||||
GdkGC *gc;
|
||||
GdkColor tmp_color;
|
||||
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt, i;
|
||||
gchar *buffer, *color_name = NULL, pixel_str[32];
|
||||
gchar *buffer, pixel_str[32];
|
||||
_GdkPixmapColor *colors = NULL, *color = NULL;
|
||||
gulong index;
|
||||
|
||||
if (!window)
|
||||
window = (GdkWindow*) &gdk_root_parent;
|
||||
if ((window == NULL) && (colormap == NULL))
|
||||
g_warning ("Creating pixmap from xpm with NULL window and colormap");
|
||||
|
||||
if (window == NULL)
|
||||
window = (GdkWindow *)&gdk_root_parent;
|
||||
|
||||
if (colormap == NULL)
|
||||
{
|
||||
colormap = gdk_window_get_colormap (window);
|
||||
visual = gdk_window_get_visual (window);
|
||||
}
|
||||
else
|
||||
visual = ((GdkColormapPrivate *)colormap)->visual;
|
||||
|
||||
i = 0;
|
||||
buffer = data[i++];
|
||||
@@ -524,9 +570,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
|
||||
colors = g_new(_GdkPixmapColor, num_cols);
|
||||
|
||||
colormap = gdk_window_get_colormap (window);
|
||||
visual = gdk_window_get_visual (window);
|
||||
|
||||
if (transparent_color == NULL)
|
||||
{
|
||||
gdk_color_white (colormap, &tmp_color);
|
||||
@@ -535,6 +578,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
|
||||
for (cnt = 0; cnt < num_cols; cnt++)
|
||||
{
|
||||
gchar *color_name;
|
||||
|
||||
buffer = data[i++];
|
||||
|
||||
colors[cnt].color_string = g_new(gchar, cpp + 1);
|
||||
@@ -543,9 +588,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
colors[cnt].color_string[n] = 0;
|
||||
colors[cnt].transparent = FALSE;
|
||||
|
||||
if (color_name != NULL)
|
||||
g_free (color_name);
|
||||
|
||||
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
|
||||
|
||||
if (color_name != NULL)
|
||||
@@ -562,6 +604,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
colors[cnt].transparent = TRUE;
|
||||
}
|
||||
|
||||
g_free (color_name);
|
||||
|
||||
gdk_color_alloc (colormap, &colors[cnt].color);
|
||||
}
|
||||
|
||||
@@ -571,15 +615,21 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
gc = NULL;
|
||||
if (mask)
|
||||
{
|
||||
/* The pixmap mask is just a bits pattern.
|
||||
* Color 0 is used for background and 1 for foreground.
|
||||
* We don't care about the colormap, we just need 0 and 1.
|
||||
*/
|
||||
GdkColor mask_pattern;
|
||||
|
||||
*mask = gdk_pixmap_new (window, width, height, 1);
|
||||
gc = gdk_gc_new (*mask);
|
||||
|
||||
gdk_color_black (colormap, &tmp_color);
|
||||
gdk_gc_set_foreground (gc, &tmp_color);
|
||||
mask_pattern.pixel = 0;
|
||||
gdk_gc_set_foreground (gc, &mask_pattern);
|
||||
gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
|
||||
|
||||
gdk_color_white (colormap, &tmp_color);
|
||||
gdk_gc_set_foreground (gc, &tmp_color);
|
||||
mask_pattern.pixel = 1;
|
||||
gdk_gc_set_foreground (gc, &mask_pattern);
|
||||
}
|
||||
|
||||
for (ycnt = 0; ycnt < height; ycnt++)
|
||||
@@ -636,22 +686,49 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pixmap_destroy (GdkPixmap *pixmap)
|
||||
GdkPixmap*
|
||||
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
|
||||
GdkBitmap **mask,
|
||||
GdkColor *transparent_color,
|
||||
gchar **data)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
return gdk_pixmap_colormap_create_from_xpm_d (window, NULL, mask,
|
||||
transparent_color, data);
|
||||
}
|
||||
|
||||
g_return_if_fail (pixmap != NULL);
|
||||
GdkPixmap*
|
||||
gdk_pixmap_ref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
|
||||
g_return_val_if_fail (pixmap != NULL, NULL);
|
||||
|
||||
private = (GdkPixmapPrivate*) pixmap;
|
||||
if (private->ref_count <= 0)
|
||||
private->ref_count += 1;
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pixmap_unref (GdkPixmap *pixmap)
|
||||
{
|
||||
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
|
||||
g_return_if_fail(pixmap != NULL);
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
XFreePixmap (private->xdisplay, private->xwindow);
|
||||
gdk_xid_table_remove (private->xwindow);
|
||||
g_free (pixmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
private->ref_count -= 1;
|
||||
g_free (private);
|
||||
}
|
||||
}
|
||||
|
||||
GdkBitmap *
|
||||
gdk_bitmap_ref (GdkBitmap *bitmap)
|
||||
{
|
||||
return (GdkBitmap *)gdk_pixmap_ref ((GdkPixmap *)bitmap);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_bitmap_unref (GdkBitmap *bitmap)
|
||||
{
|
||||
gdk_pixmap_unref ((GdkPixmap *)bitmap);
|
||||
}
|
||||
|
||||
214
gdk/gdkprivate.h
214
gdk/gdkprivate.h
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
@@ -25,9 +25,9 @@
|
||||
|
||||
#define DND_PROTOCOL_VERSION 0
|
||||
|
||||
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
|
||||
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -35,14 +35,17 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
typedef struct _GdkWindowPrivate GdkWindowPrivate;
|
||||
typedef struct _GdkWindowPrivate GdkPixmapPrivate;
|
||||
typedef struct _GdkImagePrivate GdkImagePrivate;
|
||||
typedef struct _GdkGCPrivate GdkGCPrivate;
|
||||
typedef struct _GdkColormapPrivate GdkColormapPrivate;
|
||||
typedef struct _GdkVisualPrivate GdkVisualPrivate;
|
||||
typedef struct _GdkFontPrivate GdkFontPrivate;
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
typedef struct _GdkWindowPrivate GdkWindowPrivate;
|
||||
typedef struct _GdkWindowPrivate GdkPixmapPrivate;
|
||||
typedef struct _GdkImagePrivate GdkImagePrivate;
|
||||
typedef struct _GdkGCPrivate GdkGCPrivate;
|
||||
typedef struct _GdkColormapPrivate GdkColormapPrivate;
|
||||
typedef struct _GdkVisualPrivate GdkVisualPrivate;
|
||||
typedef struct _GdkFontPrivate GdkFontPrivate;
|
||||
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
||||
typedef struct _GdkEventFilter GdkEventFilter;
|
||||
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
|
||||
typedef struct _GdkRegionPrivate GdkRegionPrivate;
|
||||
|
||||
|
||||
struct _GdkWindowPrivate
|
||||
@@ -56,10 +59,10 @@ struct _GdkWindowPrivate
|
||||
guint16 width;
|
||||
guint16 height;
|
||||
guint8 resize_count;
|
||||
guint8 ref_count;
|
||||
guint8 window_type;
|
||||
guint8 destroyed : 2;
|
||||
guint8 dnd_drag_enabled : 1,
|
||||
guint ref_count;
|
||||
guint destroyed : 2;
|
||||
guint dnd_drag_enabled : 1,
|
||||
dnd_drag_datashow : 1,
|
||||
dnd_drag_destructive_op : 1,
|
||||
dnd_drag_accepted : 1,
|
||||
@@ -75,6 +78,8 @@ struct _GdkWindowPrivate
|
||||
/* need to allow custom drag/drop cursors */
|
||||
|
||||
gint extension_events;
|
||||
|
||||
GList *filters;
|
||||
};
|
||||
|
||||
struct _GdkImagePrivate
|
||||
@@ -85,14 +90,14 @@ struct _GdkImagePrivate
|
||||
gpointer x_shm_info;
|
||||
|
||||
void (*image_put) (GdkDrawable *window,
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
GdkGC *gc,
|
||||
GdkImage *image,
|
||||
gint xsrc,
|
||||
gint ysrc,
|
||||
gint xdest,
|
||||
gint ydest,
|
||||
gint width,
|
||||
gint height);
|
||||
};
|
||||
|
||||
struct _GdkGCPrivate
|
||||
@@ -100,6 +105,7 @@ struct _GdkGCPrivate
|
||||
GdkGC gc;
|
||||
GC xgc;
|
||||
Display *xdisplay;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
struct _GdkColormapPrivate
|
||||
@@ -110,7 +116,7 @@ struct _GdkColormapPrivate
|
||||
GdkVisual *visual;
|
||||
gint private_val;
|
||||
gint next_color;
|
||||
gint ref_count;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
struct _GdkVisualPrivate
|
||||
@@ -126,7 +132,7 @@ struct _GdkFontPrivate
|
||||
/* generic pointer point to XFontStruct or XFontSet */
|
||||
gpointer xfont;
|
||||
Display *xdisplay;
|
||||
gint ref_count;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
struct _GdkCursorPrivate
|
||||
@@ -136,18 +142,72 @@ struct _GdkCursorPrivate
|
||||
Display *xdisplay;
|
||||
};
|
||||
|
||||
struct _GdkDndCursorInfo {
|
||||
Cursor gdk_cursor_dragdefault, gdk_cursor_dragok;
|
||||
GdkWindow *drag_pm_default, *drag_pm_ok;
|
||||
GdkPoint default_hotspot, ok_hotspot;
|
||||
GList *xids;
|
||||
};
|
||||
typedef struct _GdkDndCursorInfo GdkDndCursorInfo;
|
||||
|
||||
struct _GdkDndGlobals {
|
||||
GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest;
|
||||
GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel;
|
||||
GdkAtom gdk_XdeTypelist;
|
||||
Cursor gdk_cursor_dragdefault, gdk_cursor_dragok;
|
||||
GdkWindow **drag_startwindows;
|
||||
guint drag_numwindows;
|
||||
guint8 drag_really;
|
||||
GdkPoint drag_dropcoords;
|
||||
GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest;
|
||||
GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel;
|
||||
GdkAtom gdk_XdeTypelist;
|
||||
|
||||
GdkDndCursorInfo *c;
|
||||
GdkWindow **drag_startwindows;
|
||||
guint drag_numwindows;
|
||||
gboolean drag_really, drag_perhaps, dnd_grabbed;
|
||||
Window dnd_drag_target;
|
||||
GdkPoint drag_dropcoords;
|
||||
|
||||
GdkPoint dnd_drag_start, dnd_drag_oldpos;
|
||||
GdkRectangle dnd_drag_dropzone;
|
||||
GdkWindowPrivate *real_sw;
|
||||
Window dnd_drag_curwin;
|
||||
Time last_drop_time; /* An incredible hack, sosumi miguel */
|
||||
};
|
||||
typedef struct _GdkDndGlobals GdkDndGlobals;
|
||||
|
||||
struct _GdkEventFilter {
|
||||
GdkFilterFunc function;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
#ifdef USE_XIM
|
||||
|
||||
struct _GdkICPrivate
|
||||
{
|
||||
XIC xic;
|
||||
GdkIMStyle style;
|
||||
};
|
||||
|
||||
typedef struct _GdkICPrivate GdkICPrivate;
|
||||
|
||||
#endif /* USE_XIM */
|
||||
|
||||
struct _GdkColorContextPrivate
|
||||
{
|
||||
GdkColorContext color_context;
|
||||
Display *xdisplay;
|
||||
XStandardColormap std_cmap;
|
||||
};
|
||||
|
||||
struct _GdkRegionPrivate
|
||||
{
|
||||
GdkRegion region;
|
||||
Region xregion;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
GDK_DEBUG_MISC = 1<<0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
GDK_DEBUG_DND = 1<<2,
|
||||
GDK_DEBUG_COLOR_CONTEXT = 1<<3,
|
||||
GDK_DEBUG_XIM = 1<<4
|
||||
} GdkDebugFlag;
|
||||
|
||||
void gdk_window_init (void);
|
||||
void gdk_visual_init (void);
|
||||
|
||||
@@ -155,38 +215,72 @@ void gdk_image_init (void);
|
||||
void gdk_image_exit (void);
|
||||
|
||||
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
|
||||
GdkVisual* gdk_visual_lookup (Visual *xvisual);
|
||||
GdkVisual* gdk_visual_lookup (Visual *xvisual);
|
||||
|
||||
void gdk_window_real_destroy (GdkWindow *window);
|
||||
void gdk_window_add_colormap_windows (GdkWindow *window);
|
||||
void gdk_window_destroy_notify (GdkWindow *window);
|
||||
|
||||
void gdk_xid_table_insert (XID *xid,
|
||||
gpointer data);
|
||||
void gdk_xid_table_remove (XID xid);
|
||||
gpointer gdk_xid_table_lookup (XID xid);
|
||||
void gdk_xid_table_insert (XID *xid,
|
||||
gpointer data);
|
||||
void gdk_xid_table_remove (XID xid);
|
||||
gpointer gdk_xid_table_lookup (XID xid);
|
||||
|
||||
gint gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
|
||||
XEvent *event_send);
|
||||
|
||||
extern gint gdk_debug_level;
|
||||
extern gint gdk_show_events;
|
||||
extern gint gdk_use_xshm;
|
||||
extern gint gdk_stack_trace;
|
||||
extern gchar *gdk_display_name;
|
||||
extern Display *gdk_display;
|
||||
extern gint gdk_screen;
|
||||
extern Window gdk_root_window;
|
||||
extern Window gdk_leader_window;
|
||||
extern GdkWindowPrivate gdk_root_parent;
|
||||
extern Atom gdk_wm_delete_window;
|
||||
extern Atom gdk_wm_take_focus;
|
||||
extern Atom gdk_wm_protocols;
|
||||
extern Atom gdk_wm_window_protocols[];
|
||||
extern Atom gdk_selection_property;
|
||||
extern GdkDndGlobals gdk_dnd;
|
||||
extern GdkWindow *selection_owner[];
|
||||
extern gchar *gdk_progname;
|
||||
extern gchar *gdk_progclass;
|
||||
extern gint gdk_error_code;
|
||||
extern gint gdk_error_warnings;
|
||||
/* If you pass x = y = -1, it queries the pointer
|
||||
to find out where it currently is.
|
||||
If you pass x = y = -2, it does anything necessary
|
||||
to know that the drag is ending.
|
||||
*/
|
||||
void gdk_dnd_display_drag_cursor(gint x,
|
||||
gint y,
|
||||
gboolean drag_ok,
|
||||
gboolean change_made);
|
||||
|
||||
/* Please see gdkwindow.c for comments on how to use */
|
||||
Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, GList *excludes, gboolean excl_child);
|
||||
Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child);
|
||||
|
||||
extern gint gdk_debug_level;
|
||||
extern gint gdk_show_events;
|
||||
extern gint gdk_use_xshm;
|
||||
extern gint gdk_stack_trace;
|
||||
extern gchar *gdk_display_name;
|
||||
extern Display *gdk_display;
|
||||
extern gint gdk_screen;
|
||||
extern Window gdk_root_window;
|
||||
extern Window gdk_leader_window;
|
||||
extern GdkWindowPrivate gdk_root_parent;
|
||||
extern Atom gdk_wm_delete_window;
|
||||
extern Atom gdk_wm_take_focus;
|
||||
extern Atom gdk_wm_protocols;
|
||||
extern Atom gdk_wm_window_protocols[];
|
||||
extern Atom gdk_selection_property;
|
||||
extern GdkDndGlobals gdk_dnd;
|
||||
extern GdkWindow *selection_owner[];
|
||||
extern gchar *gdk_progname;
|
||||
extern gchar *gdk_progclass;
|
||||
extern gint gdk_error_code;
|
||||
extern gint gdk_error_warnings;
|
||||
extern gint gdk_null_window_warnings;
|
||||
extern GList *gdk_default_filters;
|
||||
|
||||
/* Debugging support */
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
#define GDK_NOTE(type,action) G_STMT_START { \
|
||||
if (gdk_debug_flags & GDK_DEBUG_##type) \
|
||||
{ action; }; } G_STMT_END
|
||||
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
|
||||
#define GDK_NOTE(type,action)
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
extern guint gdk_debug_flags;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -39,6 +39,7 @@ gdk_atom_name (GdkAtom atom)
|
||||
we take precautions */
|
||||
|
||||
gdk_error_warnings = 0;
|
||||
gdk_error_code = 0;
|
||||
t = XGetAtomName (gdk_display, atom);
|
||||
gdk_error_warnings = 1;
|
||||
|
||||
@@ -67,7 +68,6 @@ gdk_property_get (GdkWindow *window,
|
||||
gint *actual_length,
|
||||
guchar **data)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
Atom ret_prop_type;
|
||||
@@ -79,7 +79,12 @@ gdk_property_get (GdkWindow *window,
|
||||
|
||||
if (window)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return FALSE;
|
||||
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
@@ -95,17 +100,23 @@ gdk_property_get (GdkWindow *window,
|
||||
&ret_nitems, &ret_bytes_after,
|
||||
&ret_data);
|
||||
|
||||
if ((ret_prop_type == None) && (ret_format == 0))
|
||||
if ((ret_prop_type == None) && (ret_format == 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (actual_property_type)
|
||||
*actual_property_type = ret_prop_type;
|
||||
if (actual_format_type)
|
||||
*actual_format_type = ret_format;
|
||||
|
||||
if (ret_prop_type != property)
|
||||
if (ret_prop_type != type)
|
||||
{
|
||||
gchar *rn, *pn;
|
||||
XFree (ret_data);
|
||||
rn = gdk_atom_name(ret_prop_type);
|
||||
pn = gdk_atom_name(type);
|
||||
g_warning("Couldn't match property type %s to %s\n", rn, pn);
|
||||
g_free(rn); g_free(pn);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -150,13 +161,17 @@ gdk_property_change (GdkWindow *window,
|
||||
guchar *data,
|
||||
gint nelements)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
if (window)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
@@ -174,13 +189,17 @@ void
|
||||
gdk_property_delete (GdkWindow *window,
|
||||
GdkAtom property)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
if (window)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) window;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
|
||||
268
gdk/gdkregion.c
Normal file
268
gdk/gdkregion.c
Normal file
@@ -0,0 +1,268 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
|
||||
|
||||
|
||||
GdkRegion*
|
||||
gdk_region_new (void)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
GdkRegion *region;
|
||||
Region xregion;
|
||||
|
||||
xregion = XCreateRegion();
|
||||
private = g_new (GdkRegionPrivate, 1);
|
||||
private->xregion = xregion;
|
||||
region = (GdkRegion*) private;
|
||||
region->user_data = NULL;
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_region_destroy (GdkRegion *region)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
|
||||
g_return_if_fail (region != NULL);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
XDestroyRegion (private->xregion);
|
||||
|
||||
g_free (private);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_region_empty (GdkRegion *region)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
|
||||
g_return_val_if_fail (region != NULL, 0);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
return XEmptyRegion (private->xregion);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_region_equal (GdkRegion *region1,
|
||||
GdkRegion *region2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
|
||||
g_return_val_if_fail (region1 != NULL, 0);
|
||||
g_return_val_if_fail (region2 != NULL, 0);
|
||||
|
||||
private1 = (GdkRegionPrivate *) region1;
|
||||
private2 = (GdkRegionPrivate *) region2;
|
||||
|
||||
return XEqualRegion (private1->xregion, private2->xregion);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_region_point_in (GdkRegion *region,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
|
||||
g_return_val_if_fail (region != NULL, 0);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
return XPointInRegion (private->xregion, x, y);
|
||||
}
|
||||
|
||||
GdkOverlapType
|
||||
gdk_region_rect_in (GdkRegion *region,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
int res;
|
||||
|
||||
g_return_val_if_fail (region != NULL, 0);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
res = XRectInRegion (private->xregion, rect->x, rect->y, rect->width, rect->height);
|
||||
|
||||
switch (res)
|
||||
{
|
||||
case RectangleIn: return GDK_OVERLAP_RECTANGLE_IN;
|
||||
case RectangleOut: return GDK_OVERLAP_RECTANGLE_OUT;
|
||||
case RectanglePart: return GDK_OVERLAP_RECTANGLE_PART;
|
||||
}
|
||||
|
||||
return GDK_OVERLAP_RECTANGLE_OUT; /*what else ? */
|
||||
}
|
||||
|
||||
void
|
||||
gdk_region_offset (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
|
||||
g_return_if_fail (region != NULL);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
XOffsetRegion (private->xregion, dx, dy);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_region_shrink (GdkRegion *region,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
|
||||
g_return_if_fail (region != NULL);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
XShrinkRegion (private->xregion, dx, dy);
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_region_union_with_rect (GdkRegion *region,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
GdkRegionPrivate *private;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
XRectangle xrect;
|
||||
|
||||
g_return_val_if_fail (region != NULL, NULL);
|
||||
|
||||
private = (GdkRegionPrivate *) region;
|
||||
|
||||
xrect.x = rect->x;
|
||||
xrect.y = rect->y;
|
||||
xrect.width = rect->width;
|
||||
xrect.height = rect->height;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
XUnionRectWithRegion (&xrect, private->xregion, res_private->xregion);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_intersect (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
XIntersectRegion (private1->xregion, private2->xregion, res_private->xregion);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_union (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
XUnionRegion (private1->xregion, private2->xregion, res_private->xregion);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_subtract (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
XSubtractRegion (private1->xregion, private2->xregion, res_private->xregion);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
GdkRegion*
|
||||
gdk_regions_xor (GdkRegion *source1,
|
||||
GdkRegion *source2)
|
||||
{
|
||||
GdkRegionPrivate *private1;
|
||||
GdkRegionPrivate *private2;
|
||||
GdkRegion *res;
|
||||
GdkRegionPrivate *res_private;
|
||||
|
||||
g_return_val_if_fail (source1 != NULL, NULL);
|
||||
g_return_val_if_fail (source2 != NULL, NULL);
|
||||
|
||||
private1 = (GdkRegionPrivate *) source1;
|
||||
private2 = (GdkRegionPrivate *) source2;
|
||||
|
||||
res = gdk_region_new ();
|
||||
res_private = (GdkRegionPrivate *) res;
|
||||
|
||||
XXorRegion (private1->xregion, private2->xregion, res_private->xregion);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <string.h>
|
||||
#include "gdk.h"
|
||||
#include "gdkprivate.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
|
||||
gint
|
||||
@@ -28,13 +29,17 @@ gdk_selection_owner_set (GdkWindow *owner,
|
||||
guint32 time,
|
||||
gint send_event)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
Display *xdisplay;
|
||||
Window xwindow;
|
||||
|
||||
if (owner)
|
||||
{
|
||||
GdkWindowPrivate *private;
|
||||
|
||||
private = (GdkWindowPrivate*) owner;
|
||||
if (private->destroyed)
|
||||
return FALSE;
|
||||
|
||||
xdisplay = private->xdisplay;
|
||||
xwindow = private->xwindow;
|
||||
}
|
||||
@@ -72,6 +77,8 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
g_return_if_fail (requestor != NULL);
|
||||
|
||||
private = (GdkWindowPrivate*) requestor;
|
||||
if (private->destroyed)
|
||||
return;
|
||||
|
||||
XConvertSelection (private->xdisplay, selection, target,
|
||||
gdk_selection_property, private->xwindow, time);
|
||||
@@ -98,6 +105,8 @@ gdk_selection_property_get (GdkWindow *requestor,
|
||||
moderate length, to avoid two round trips to the server */
|
||||
|
||||
private = (GdkWindowPrivate*) requestor;
|
||||
if (private->destroyed)
|
||||
return 0;
|
||||
|
||||
XGetWindowProperty (private->xdisplay, private->xwindow,
|
||||
gdk_selection_property, 0, 0, False,
|
||||
@@ -166,3 +175,71 @@ gdk_selection_send_notify (guint32 requestor,
|
||||
|
||||
XSendEvent (gdk_display, requestor, False, NoEventMask, (XEvent*) &xevent);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_text_property_to_text_list (GdkAtom encoding, gint format,
|
||||
guchar *text, gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
XTextProperty property;
|
||||
gint count = 0;
|
||||
gint res;
|
||||
|
||||
if (!list)
|
||||
return 0;
|
||||
|
||||
property.value = text;
|
||||
property.encoding = encoding;
|
||||
property.format = format;
|
||||
property.nitems = length;
|
||||
res = XmbTextPropertyToTextList (GDK_DISPLAY(), &property, list, &count);
|
||||
|
||||
if (res == XNoMemory || res == XLocaleNotSupported ||
|
||||
res == XConverterNotFound)
|
||||
return 0;
|
||||
else
|
||||
return count;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_free_text_list (gchar **list)
|
||||
{
|
||||
XFreeStringList (list);
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_string_to_compound_text (gchar *str,
|
||||
GdkAtom *encoding, gint *format,
|
||||
guchar **ctext, gint *length)
|
||||
{
|
||||
gint res;
|
||||
XTextProperty property;
|
||||
|
||||
res = XmbTextListToTextProperty (GDK_DISPLAY(),
|
||||
&str, 1, XCompoundTextStyle,
|
||||
&property);
|
||||
if (res != Success)
|
||||
{
|
||||
property.encoding = None;
|
||||
property.format = None;
|
||||
property.value = NULL;
|
||||
property.nitems = 0;
|
||||
}
|
||||
|
||||
if (encoding)
|
||||
*encoding = property.encoding;
|
||||
if (format)
|
||||
*format = property.format;
|
||||
if (ctext)
|
||||
*ctext = property.value;
|
||||
if (length)
|
||||
*length = property.nitems;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void gdk_free_compound_text (guchar *ctext)
|
||||
{
|
||||
if (ctext)
|
||||
XFree (ctext);
|
||||
}
|
||||
|
||||
613
gdk/gdktypes.h
613
gdk/gdktypes.h
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
#define GDK_NONE 0L
|
||||
#define GDK_NONE 0L
|
||||
#define GDK_CURRENT_TIME 0L
|
||||
#define GDK_PARENT_RELATIVE 1L
|
||||
|
||||
@@ -40,67 +40,77 @@ extern "C" {
|
||||
/* Type definitions for the basic structures.
|
||||
*/
|
||||
|
||||
typedef gulong GdkAtom;
|
||||
typedef struct _GdkColor GdkColor;
|
||||
typedef struct _GdkColormap GdkColormap;
|
||||
typedef struct _GdkVisual GdkVisual;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkWindow GdkPixmap;
|
||||
typedef struct _GdkWindow GdkBitmap;
|
||||
typedef struct _GdkWindow GdkDrawable;
|
||||
typedef struct _GdkImage GdkImage;
|
||||
typedef struct _GdkGCValues GdkGCValues;
|
||||
typedef struct _GdkGC GdkGC;
|
||||
typedef struct _GdkPoint GdkPoint;
|
||||
typedef struct _GdkRectangle GdkRectangle;
|
||||
typedef struct _GdkSegment GdkSegment;
|
||||
typedef struct _GdkFont GdkFont;
|
||||
typedef struct _GdkCursor GdkCursor;
|
||||
typedef gulong GdkAtom;
|
||||
typedef struct _GdkColor GdkColor;
|
||||
typedef struct _GdkColormap GdkColormap;
|
||||
typedef struct _GdkVisual GdkVisual;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkWindow GdkPixmap;
|
||||
typedef struct _GdkWindow GdkBitmap;
|
||||
typedef struct _GdkWindow GdkDrawable;
|
||||
typedef struct _GdkImage GdkImage;
|
||||
typedef struct _GdkGCValues GdkGCValues;
|
||||
typedef struct _GdkGC GdkGC;
|
||||
typedef struct _GdkPoint GdkPoint;
|
||||
typedef struct _GdkRectangle GdkRectangle;
|
||||
typedef struct _GdkSegment GdkSegment;
|
||||
typedef struct _GdkFont GdkFont;
|
||||
typedef struct _GdkCursor GdkCursor;
|
||||
typedef struct _GdkColorContextDither GdkColorContextDither;
|
||||
typedef struct _GdkColorContext GdkColorContext;
|
||||
|
||||
typedef struct _GdkEventAny GdkEventAny;
|
||||
typedef struct _GdkEventExpose GdkEventExpose;
|
||||
typedef struct _GdkEventMotion GdkEventMotion;
|
||||
typedef struct _GdkEventButton GdkEventButton;
|
||||
typedef struct _GdkEventKey GdkEventKey;
|
||||
typedef struct _GdkEventFocus GdkEventFocus;
|
||||
typedef struct _GdkEventCrossing GdkEventCrossing;
|
||||
typedef struct _GdkEventConfigure GdkEventConfigure;
|
||||
typedef struct _GdkEventProperty GdkEventProperty;
|
||||
typedef struct _GdkEventSelection GdkEventSelection;
|
||||
typedef struct _GdkEventProximity GdkEventProximity;
|
||||
typedef struct _GdkEventOther GdkEventOther;
|
||||
typedef struct _GdkEventDragBegin GdkEventDragBegin;
|
||||
typedef struct _GdkEventAny GdkEventAny;
|
||||
typedef struct _GdkEventExpose GdkEventExpose;
|
||||
typedef struct _GdkEventNoExpose GdkEventNoExpose;
|
||||
typedef struct _GdkEventVisibility GdkEventVisibility;
|
||||
typedef struct _GdkEventMotion GdkEventMotion;
|
||||
typedef struct _GdkEventButton GdkEventButton;
|
||||
typedef struct _GdkEventKey GdkEventKey;
|
||||
typedef struct _GdkEventFocus GdkEventFocus;
|
||||
typedef struct _GdkEventCrossing GdkEventCrossing;
|
||||
typedef struct _GdkEventConfigure GdkEventConfigure;
|
||||
typedef struct _GdkEventProperty GdkEventProperty;
|
||||
typedef struct _GdkEventSelection GdkEventSelection;
|
||||
typedef struct _GdkEventProximity GdkEventProximity;
|
||||
typedef struct _GdkEventOther GdkEventOther;
|
||||
typedef struct _GdkEventDragBegin GdkEventDragBegin;
|
||||
typedef struct _GdkEventDragRequest GdkEventDragRequest;
|
||||
typedef struct _GdkEventDropEnter GdkEventDropEnter;
|
||||
typedef struct _GdkEventDropEnter GdkEventDropEnter;
|
||||
typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable;
|
||||
typedef struct _GdkEventDropLeave GdkEventDropLeave;
|
||||
typedef struct _GdkEventClient GdkEventClient;
|
||||
typedef union _GdkEvent GdkEvent;
|
||||
typedef struct _GdkDeviceInfo GdkDeviceInfo;
|
||||
typedef struct _GdkTimeCoord GdkTimeCoord;
|
||||
typedef struct _GdkEventDropLeave GdkEventDropLeave;
|
||||
typedef struct _GdkEventClient GdkEventClient;
|
||||
typedef union _GdkEvent GdkEvent;
|
||||
typedef struct _GdkDeviceKey GdkDeviceKey;
|
||||
typedef struct _GdkDeviceInfo GdkDeviceInfo;
|
||||
typedef struct _GdkTimeCoord GdkTimeCoord;
|
||||
typedef struct _GdkRegion GdkRegion;
|
||||
typedef gint (*GdkEventFunc) (GdkEvent *event,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
typedef void* GdkIC;
|
||||
typedef void* GdkIM;
|
||||
|
||||
|
||||
/* Types of windows.
|
||||
* Root: There is only 1 root window and it is initialized
|
||||
* at startup. Creating a window of type GDK_WINDOW_ROOT
|
||||
* is an error.
|
||||
* at startup. Creating a window of type GDK_WINDOW_ROOT
|
||||
* is an error.
|
||||
* Toplevel: Windows which interact with the window manager.
|
||||
* Child: Windows which are children of some other type of window.
|
||||
* (Any other type of window). Most windows are child windows.
|
||||
* (Any other type of window). Most windows are child windows.
|
||||
* Dialog: A special kind of toplevel window which interacts with
|
||||
* the window manager slightly differently than a regular
|
||||
* toplevel window. Dialog windows should be used for any
|
||||
* transient window.
|
||||
* the window manager slightly differently than a regular
|
||||
* toplevel window. Dialog windows should be used for any
|
||||
* transient window.
|
||||
* Pixmap: Pixmaps are really just another kind of window which
|
||||
* doesn't actually appear on the screen. It can't have
|
||||
* children, either and is really just a convenience so
|
||||
* that the drawing functions can work on both windows
|
||||
* and pixmaps transparently. (ie. You shouldn't pass a
|
||||
* pixmap to any procedure which accepts a window with the
|
||||
* exception of the drawing functions).
|
||||
* doesn't actually appear on the screen. It can't have
|
||||
* children, either and is really just a convenience so
|
||||
* that the drawing functions can work on both windows
|
||||
* and pixmaps transparently. (ie. You shouldn't pass a
|
||||
* pixmap to any procedure which accepts a window with the
|
||||
* exception of the drawing functions).
|
||||
* Foreign: A window that actually belongs to another application
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@@ -109,17 +119,18 @@ typedef enum
|
||||
GDK_WINDOW_CHILD,
|
||||
GDK_WINDOW_DIALOG,
|
||||
GDK_WINDOW_TEMP,
|
||||
GDK_WINDOW_PIXMAP
|
||||
GDK_WINDOW_PIXMAP,
|
||||
GDK_WINDOW_FOREIGN
|
||||
} GdkWindowType;
|
||||
|
||||
/* Classes of windows.
|
||||
* InputOutput: Almost every window should be of this type. Such windows
|
||||
* receive events and are also displayed on screen.
|
||||
* receive events and are also displayed on screen.
|
||||
* InputOnly: Used only in special circumstances when events need to be
|
||||
* stolen from another window or windows. Input only windows
|
||||
* have no visible output, so they are handy for placing over
|
||||
* top of a group of windows in order to grab the events (or
|
||||
* filter the events) from those windows.
|
||||
* stolen from another window or windows. Input only windows
|
||||
* have no visible output, so they are handy for placing over
|
||||
* top of a group of windows in order to grab the events (or
|
||||
* filter the events) from those windows.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@@ -129,13 +140,13 @@ typedef enum
|
||||
|
||||
/* Types of images.
|
||||
* Normal: Normal X image type. These are slow as they involve passing
|
||||
* the entire image through the X connection each time a draw
|
||||
* request is required.
|
||||
* the entire image through the X connection each time a draw
|
||||
* request is required.
|
||||
* Shared: Shared memory X image type. These are fast as the X server
|
||||
* and the program actually use the same piece of memory. They
|
||||
* should be used with care though as there is the possibility
|
||||
* for both the X server and the program to be reading/writing
|
||||
* the image simultaneously and producing undesired results.
|
||||
* and the program actually use the same piece of memory. They
|
||||
* should be used with care though as there is the possibility
|
||||
* for both the X server and the program to be reading/writing
|
||||
* the image simultaneously and producing undesired results.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@@ -182,20 +193,21 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_WA_TITLE = 1 << 1,
|
||||
GDK_WA_X = 1 << 2,
|
||||
GDK_WA_Y = 1 << 3,
|
||||
GDK_WA_CURSOR = 1 << 4,
|
||||
GDK_WA_TITLE = 1 << 1,
|
||||
GDK_WA_X = 1 << 2,
|
||||
GDK_WA_Y = 1 << 3,
|
||||
GDK_WA_CURSOR = 1 << 4,
|
||||
GDK_WA_COLORMAP = 1 << 5,
|
||||
GDK_WA_VISUAL = 1 << 6,
|
||||
GDK_WA_WMCLASS = 1 << 7
|
||||
GDK_WA_VISUAL = 1 << 6,
|
||||
GDK_WA_WMCLASS = 1 << 7,
|
||||
GDK_WA_NOREDIR = 1 << 8
|
||||
} GdkWindowAttributesType;
|
||||
|
||||
/* Size restriction enumeration.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_HINT_POS = 1 << 0,
|
||||
GDK_HINT_POS = 1 << 0,
|
||||
GDK_HINT_MIN_SIZE = 1 << 1,
|
||||
GDK_HINT_MAX_SIZE = 1 << 2
|
||||
} GdkWindowHints;
|
||||
@@ -269,15 +281,30 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
#include <gdk/gdkcursors.h>
|
||||
GDK_LAST_CURSOR
|
||||
GDK_LAST_CURSOR,
|
||||
GDK_CURSOR_IS_PIXMAP = -1
|
||||
} GdkCursorType;
|
||||
|
||||
typedef enum {
|
||||
GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */
|
||||
GDK_FILTER_TRANSLATE, /* Translated event stored */
|
||||
GDK_FILTER_REMOVE /* Terminate processing, removing event */
|
||||
} GdkFilterReturn;
|
||||
|
||||
typedef enum {
|
||||
GDK_VISIBILITY_UNOBSCURED,
|
||||
GDK_VISIBILITY_PARTIAL,
|
||||
GDK_VISIBILITY_FULLY_OBSCURED
|
||||
} GdkVisibilityState;
|
||||
|
||||
/* Event types.
|
||||
* Nothing: No event occurred.
|
||||
* Delete: A window delete event was sent by the window manager.
|
||||
* The specified window should be deleted.
|
||||
* The specified window should be deleted.
|
||||
* Destroy: A window has been destroyed.
|
||||
* Expose: Part of a window has been uncovered.
|
||||
* NoExpose: Same as expose, but no expose event was generated.
|
||||
* VisibilityNotify: A window has become fully/partially/not obscured.
|
||||
* MotionNotify: The mouse has moved.
|
||||
* ButtonPress: A mouse button was pressed.
|
||||
* ButtonRelease: A mouse button was release.
|
||||
@@ -286,44 +313,46 @@ typedef enum
|
||||
* EnterNotify: A window was entered.
|
||||
* LeaveNotify: A window was exited.
|
||||
* FocusChange: The focus window has changed. (The focus window gets
|
||||
* keyboard events).
|
||||
* keyboard events).
|
||||
* Resize: A window has been resized.
|
||||
* Map: A window has been mapped. (It is now visible on the screen).
|
||||
* Unmap: A window has been unmapped. (It is no longer visible on
|
||||
* the screen).
|
||||
* the screen).
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_NOTHING = -1,
|
||||
GDK_DELETE = 0,
|
||||
GDK_DESTROY = 1,
|
||||
GDK_EXPOSE = 2,
|
||||
GDK_MOTION_NOTIFY = 3,
|
||||
GDK_BUTTON_PRESS = 4,
|
||||
GDK_2BUTTON_PRESS = 5,
|
||||
GDK_3BUTTON_PRESS = 6,
|
||||
GDK_BUTTON_RELEASE = 7,
|
||||
GDK_KEY_PRESS = 8,
|
||||
GDK_KEY_RELEASE = 9,
|
||||
GDK_ENTER_NOTIFY = 10,
|
||||
GDK_LEAVE_NOTIFY = 11,
|
||||
GDK_FOCUS_CHANGE = 12,
|
||||
GDK_CONFIGURE = 13,
|
||||
GDK_MAP = 14,
|
||||
GDK_UNMAP = 15,
|
||||
GDK_PROPERTY_NOTIFY = 16,
|
||||
GDK_SELECTION_CLEAR = 17,
|
||||
GDK_NOTHING = -1,
|
||||
GDK_DELETE = 0,
|
||||
GDK_DESTROY = 1,
|
||||
GDK_EXPOSE = 2,
|
||||
GDK_MOTION_NOTIFY = 3,
|
||||
GDK_BUTTON_PRESS = 4,
|
||||
GDK_2BUTTON_PRESS = 5,
|
||||
GDK_3BUTTON_PRESS = 6,
|
||||
GDK_BUTTON_RELEASE = 7,
|
||||
GDK_KEY_PRESS = 8,
|
||||
GDK_KEY_RELEASE = 9,
|
||||
GDK_ENTER_NOTIFY = 10,
|
||||
GDK_LEAVE_NOTIFY = 11,
|
||||
GDK_FOCUS_CHANGE = 12,
|
||||
GDK_CONFIGURE = 13,
|
||||
GDK_MAP = 14,
|
||||
GDK_UNMAP = 15,
|
||||
GDK_PROPERTY_NOTIFY = 16,
|
||||
GDK_SELECTION_CLEAR = 17,
|
||||
GDK_SELECTION_REQUEST = 18,
|
||||
GDK_SELECTION_NOTIFY = 19,
|
||||
GDK_PROXIMITY_IN = 20,
|
||||
GDK_PROXIMITY_OUT = 21,
|
||||
GDK_SELECTION_NOTIFY = 19,
|
||||
GDK_PROXIMITY_IN = 20,
|
||||
GDK_PROXIMITY_OUT = 21,
|
||||
GDK_DRAG_BEGIN = 22,
|
||||
GDK_DRAG_REQUEST = 23,
|
||||
GDK_DROP_ENTER = 24,
|
||||
GDK_DROP_LEAVE = 25,
|
||||
GDK_DROP_DATA_AVAIL = 26,
|
||||
GDK_CLIENT_EVENT = 27,
|
||||
GDK_OTHER_EVENT = 9999
|
||||
GDK_DRAG_REQUEST = 23,
|
||||
GDK_DROP_ENTER = 24,
|
||||
GDK_DROP_LEAVE = 25,
|
||||
GDK_DROP_DATA_AVAIL = 26,
|
||||
GDK_CLIENT_EVENT = 27,
|
||||
GDK_VISIBILITY_NOTIFY = 28,
|
||||
GDK_NO_EXPOSE = 29,
|
||||
GDK_OTHER_EVENT = 9999 /* Deprecated, use filters instead */
|
||||
} GdkEventType;
|
||||
|
||||
/* Event masks. (Used to select what types of events a window
|
||||
@@ -331,25 +360,26 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_EXPOSURE_MASK = 1 << 1,
|
||||
GDK_POINTER_MOTION_MASK = 1 << 2,
|
||||
GDK_POINTER_MOTION_HINT_MASK = 1 << 3,
|
||||
GDK_BUTTON_MOTION_MASK = 1 << 4,
|
||||
GDK_BUTTON1_MOTION_MASK = 1 << 5,
|
||||
GDK_BUTTON2_MOTION_MASK = 1 << 6,
|
||||
GDK_BUTTON3_MOTION_MASK = 1 << 7,
|
||||
GDK_BUTTON_PRESS_MASK = 1 << 8,
|
||||
GDK_BUTTON_RELEASE_MASK = 1 << 9,
|
||||
GDK_KEY_PRESS_MASK = 1 << 10,
|
||||
GDK_KEY_RELEASE_MASK = 1 << 11,
|
||||
GDK_ENTER_NOTIFY_MASK = 1 << 12,
|
||||
GDK_LEAVE_NOTIFY_MASK = 1 << 13,
|
||||
GDK_FOCUS_CHANGE_MASK = 1 << 14,
|
||||
GDK_STRUCTURE_MASK = 1 << 15,
|
||||
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
|
||||
GDK_PROXIMITY_IN_MASK = 1 << 17,
|
||||
GDK_PROXIMITY_OUT_MASK = 1 << 18,
|
||||
GDK_ALL_EVENTS_MASK = 0x07FFFF
|
||||
GDK_EXPOSURE_MASK = 1 << 1,
|
||||
GDK_POINTER_MOTION_MASK = 1 << 2,
|
||||
GDK_POINTER_MOTION_HINT_MASK = 1 << 3,
|
||||
GDK_BUTTON_MOTION_MASK = 1 << 4,
|
||||
GDK_BUTTON1_MOTION_MASK = 1 << 5,
|
||||
GDK_BUTTON2_MOTION_MASK = 1 << 6,
|
||||
GDK_BUTTON3_MOTION_MASK = 1 << 7,
|
||||
GDK_BUTTON_PRESS_MASK = 1 << 8,
|
||||
GDK_BUTTON_RELEASE_MASK = 1 << 9,
|
||||
GDK_KEY_PRESS_MASK = 1 << 10,
|
||||
GDK_KEY_RELEASE_MASK = 1 << 11,
|
||||
GDK_ENTER_NOTIFY_MASK = 1 << 12,
|
||||
GDK_LEAVE_NOTIFY_MASK = 1 << 13,
|
||||
GDK_FOCUS_CHANGE_MASK = 1 << 14,
|
||||
GDK_STRUCTURE_MASK = 1 << 15,
|
||||
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
|
||||
GDK_VISIBILITY_NOTIFY_MASK = 1 << 17,
|
||||
GDK_PROXIMITY_IN_MASK = 1 << 18,
|
||||
GDK_PROXIMITY_OUT_MASK = 1 << 19,
|
||||
GDK_ALL_EVENTS_MASK = 0x07FFFF
|
||||
} GdkEventMask;
|
||||
|
||||
/* Types of enter/leave notifications.
|
||||
@@ -362,12 +392,12 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_NOTIFY_ANCESTOR = 0,
|
||||
GDK_NOTIFY_VIRTUAL = 1,
|
||||
GDK_NOTIFY_INFERIOR = 2,
|
||||
GDK_NOTIFY_NONLINEAR = 3,
|
||||
GDK_NOTIFY_NONLINEAR_VIRTUAL = 4,
|
||||
GDK_NOTIFY_UNKNOWN = 5
|
||||
GDK_NOTIFY_ANCESTOR = 0,
|
||||
GDK_NOTIFY_VIRTUAL = 1,
|
||||
GDK_NOTIFY_INFERIOR = 2,
|
||||
GDK_NOTIFY_NONLINEAR = 3,
|
||||
GDK_NOTIFY_NONLINEAR_VIRTUAL = 4,
|
||||
GDK_NOTIFY_UNKNOWN = 5
|
||||
} GdkNotifyType;
|
||||
|
||||
/* Types of modifiers.
|
||||
@@ -375,13 +405,13 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
GDK_SHIFT_MASK = 1 << 0,
|
||||
GDK_LOCK_MASK = 1 << 1,
|
||||
GDK_LOCK_MASK = 1 << 1,
|
||||
GDK_CONTROL_MASK = 1 << 2,
|
||||
GDK_MOD1_MASK = 1 << 3,
|
||||
GDK_MOD2_MASK = 1 << 4,
|
||||
GDK_MOD3_MASK = 1 << 5,
|
||||
GDK_MOD4_MASK = 1 << 6,
|
||||
GDK_MOD5_MASK = 1 << 7,
|
||||
GDK_MOD1_MASK = 1 << 3,
|
||||
GDK_MOD2_MASK = 1 << 4,
|
||||
GDK_MOD3_MASK = 1 << 5,
|
||||
GDK_MOD4_MASK = 1 << 6,
|
||||
GDK_MOD5_MASK = 1 << 7,
|
||||
GDK_BUTTON1_MASK = 1 << 8,
|
||||
GDK_BUTTON2_MASK = 1 << 9,
|
||||
GDK_BUTTON3_MASK = 1 << 10,
|
||||
@@ -391,7 +421,7 @@ typedef enum
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_CLIP_BY_CHILDREN = 0,
|
||||
GDK_CLIP_BY_CHILDREN = 0,
|
||||
GDK_INCLUDE_INFERIORS = 1
|
||||
} GdkSubwindowMode;
|
||||
|
||||
@@ -404,11 +434,11 @@ typedef enum
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_OK = 0,
|
||||
GDK_ERROR = -1,
|
||||
GDK_OK = 0,
|
||||
GDK_ERROR = -1,
|
||||
GDK_ERROR_PARAM = -2,
|
||||
GDK_ERROR_FILE = -3,
|
||||
GDK_ERROR_MEM = -4
|
||||
GDK_ERROR_MEM = -4
|
||||
} GdkStatus;
|
||||
|
||||
typedef enum
|
||||
@@ -421,10 +451,10 @@ typedef enum
|
||||
{
|
||||
GDK_GC_FOREGROUND = 1 << 0,
|
||||
GDK_GC_BACKGROUND = 1 << 1,
|
||||
GDK_GC_FONT = 1 << 2,
|
||||
GDK_GC_FONT = 1 << 2,
|
||||
GDK_GC_FUNCTION = 1 << 3,
|
||||
GDK_GC_FILL = 1 << 4,
|
||||
GDK_GC_TILE = 1 << 5,
|
||||
GDK_GC_FILL = 1 << 4,
|
||||
GDK_GC_TILE = 1 << 5,
|
||||
GDK_GC_STIPPLE = 1 << 6,
|
||||
GDK_GC_CLIP_MASK = 1 << 7,
|
||||
GDK_GC_SUBWINDOW = 1 << 8,
|
||||
@@ -535,10 +565,93 @@ typedef enum
|
||||
GDK_EXTENSION_EVENTS_CURSOR
|
||||
} GdkExtensionMode;
|
||||
|
||||
typedef void (*GdkInputFunction) (gpointer data,
|
||||
gint source,
|
||||
typedef enum
|
||||
{
|
||||
GdkIMPreeditArea = 0x0001L,
|
||||
GdkIMPreeditCallbacks = 0x0002L,
|
||||
GdkIMPreeditPosition = 0x0004L,
|
||||
GdkIMPreeditNothing = 0x0008L,
|
||||
GdkIMPreeditNone = 0x0010L,
|
||||
GdkIMStatusArea = 0x0100L,
|
||||
GdkIMStatusCallbacks = 0x0200L,
|
||||
GdkIMStatusNothing = 0x0400L,
|
||||
GdkIMStatusNone = 0x0800L
|
||||
} GdkIMStyle;
|
||||
|
||||
/* The next two enumeration values current match the
|
||||
* Motif constants. If this is changed, the implementation
|
||||
* of gdk_window_set_decorations/gdk_window_set_functions
|
||||
* will need to change as well.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_DECOR_ALL = 1 << 0,
|
||||
GDK_DECOR_BORDER = 1 << 1,
|
||||
GDK_DECOR_RESIZEH = 1 << 2,
|
||||
GDK_DECOR_TITLE = 1 << 3,
|
||||
GDK_DECOR_MENU = 1 << 4,
|
||||
GDK_DECOR_MINIMIZE = 1 << 5,
|
||||
GDK_DECOR_MAXIMIZE = 1 << 6
|
||||
} GdkWMDecoration;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_FUNC_ALL = 1 << 0,
|
||||
GDK_FUNC_RESIZE = 1 << 1,
|
||||
GDK_FUNC_MOVE = 1 << 2,
|
||||
GDK_FUNC_MINIMIZE = 1 << 3,
|
||||
GDK_FUNC_MAXIMIZE = 1 << 4,
|
||||
GDK_FUNC_CLOSE = 1 << 5
|
||||
} GdkWMFunction;
|
||||
|
||||
#define GdkIMPreeditMask \
|
||||
( GdkIMPreeditArea | GdkIMPreeditCallbacks | \
|
||||
GdkIMPreeditPosition | GdkIMPreeditNothing | \
|
||||
GdkIMPreeditNone )
|
||||
|
||||
#define GdkIMStatusMask \
|
||||
( GdkIMStatusArea | GdkIMStatusCallbacks | \
|
||||
GdkIMStatusNothing | GdkIMStatusNone )
|
||||
|
||||
typedef void (*GdkInputFunction) (gpointer data,
|
||||
gint source,
|
||||
GdkInputCondition condition);
|
||||
|
||||
typedef void (*GdkDestroyNotify) (gpointer data);
|
||||
|
||||
/* Color Context modes.
|
||||
*
|
||||
* GDK_CC_MODE_UNDEFINED - unknown
|
||||
* GDK_CC_MODE_BW - default B/W
|
||||
* GDK_CC_MODE_STD_CMAP - has a standard colormap
|
||||
* GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual
|
||||
* GDK_CC_MODE_MY_GRAY - my grayramp
|
||||
* GDK_CC_MODE_PALETTE - has a pre-allocated palette
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_CC_MODE_UNDEFINED,
|
||||
GDK_CC_MODE_BW,
|
||||
GDK_CC_MODE_STD_CMAP,
|
||||
GDK_CC_MODE_TRUE,
|
||||
GDK_CC_MODE_MY_GRAY,
|
||||
GDK_CC_MODE_PALETTE
|
||||
} GdkColorContextMode;
|
||||
|
||||
/* Types of overlapping between a rectangle and a region
|
||||
* GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
|
||||
* GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
|
||||
* GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_OVERLAP_RECTANGLE_IN,
|
||||
GDK_OVERLAP_RECTANGLE_OUT,
|
||||
GDK_OVERLAP_RECTANGLE_PART
|
||||
} GdkOverlapType;
|
||||
|
||||
/* The color type.
|
||||
* A color consists of red, green and blue values in the
|
||||
* range 0-65535 and a pixel value. The pixel value is highly
|
||||
@@ -609,6 +722,7 @@ struct _GdkWindowAttr
|
||||
GdkCursor *cursor;
|
||||
gchar *wmclass_name;
|
||||
gchar *wmclass_class;
|
||||
gboolean override_redirect;
|
||||
};
|
||||
|
||||
struct _GdkWindow
|
||||
@@ -618,37 +732,37 @@ struct _GdkWindow
|
||||
|
||||
struct _GdkImage
|
||||
{
|
||||
GdkImageType type;
|
||||
GdkVisual *visual; /* visual used to create the image */
|
||||
GdkByteOrder byte_order;
|
||||
guint16 width;
|
||||
guint16 height;
|
||||
guint16 depth;
|
||||
guint16 bpp; /* bytes per pixel */
|
||||
guint16 bpl; /* bytes per line */
|
||||
gpointer mem;
|
||||
GdkImageType type;
|
||||
GdkVisual *visual; /* visual used to create the image */
|
||||
GdkByteOrder byte_order;
|
||||
guint16 width;
|
||||
guint16 height;
|
||||
guint16 depth;
|
||||
guint16 bpp; /* bytes per pixel */
|
||||
guint16 bpl; /* bytes per line */
|
||||
gpointer mem;
|
||||
};
|
||||
|
||||
struct _GdkGCValues
|
||||
{
|
||||
GdkColor foreground;
|
||||
GdkColor background;
|
||||
GdkFont *font;
|
||||
GdkFunction function;
|
||||
GdkFill fill;
|
||||
GdkPixmap *tile;
|
||||
GdkPixmap *stipple;
|
||||
GdkPixmap *clip_mask;
|
||||
GdkColor foreground;
|
||||
GdkColor background;
|
||||
GdkFont *font;
|
||||
GdkFunction function;
|
||||
GdkFill fill;
|
||||
GdkPixmap *tile;
|
||||
GdkPixmap *stipple;
|
||||
GdkPixmap *clip_mask;
|
||||
GdkSubwindowMode subwindow_mode;
|
||||
gint ts_x_origin;
|
||||
gint ts_y_origin;
|
||||
gint clip_x_origin;
|
||||
gint clip_y_origin;
|
||||
gint graphics_exposures;
|
||||
gint line_width;
|
||||
GdkLineStyle line_style;
|
||||
GdkCapStyle cap_style;
|
||||
GdkJoinStyle join_style;
|
||||
gint ts_x_origin;
|
||||
gint ts_y_origin;
|
||||
gint clip_x_origin;
|
||||
gint clip_y_origin;
|
||||
gint graphics_exposures;
|
||||
gint line_width;
|
||||
GdkLineStyle line_style;
|
||||
GdkCapStyle cap_style;
|
||||
GdkJoinStyle join_style;
|
||||
};
|
||||
|
||||
struct _GdkGC
|
||||
@@ -690,8 +804,71 @@ struct _GdkCursor
|
||||
GdkCursorType type;
|
||||
};
|
||||
|
||||
struct _GdkColorContextDither
|
||||
{
|
||||
gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
|
||||
gint fast_err[32][32][32]; /* internal RGB error information */
|
||||
gint fast_erg[32][32][32];
|
||||
gint fast_erb[32][32][32];
|
||||
};
|
||||
|
||||
struct _GdkColorContext
|
||||
{
|
||||
GdkVisual *visual;
|
||||
GdkColormap *colormap;
|
||||
|
||||
gint num_colors; /* available no. of colors in colormap */
|
||||
gint max_colors; /* maximum no. of colors */
|
||||
gint num_allocated; /* no. of allocated colors */
|
||||
|
||||
GdkColorContextMode mode;
|
||||
gint need_to_free_colormap;
|
||||
GdkAtom std_cmap_atom;
|
||||
|
||||
gulong *clut; /* color look-up table */
|
||||
GdkColor *cmap; /* colormap */
|
||||
|
||||
GHashTable *color_hash; /* hash table of allocated colors */
|
||||
GdkColor *palette; /* preallocated palette */
|
||||
gint num_palette; /* size of palette */
|
||||
|
||||
GdkColorContextDither *fast_dither; /* fast dither matrix */
|
||||
|
||||
struct
|
||||
{
|
||||
gint red;
|
||||
gint green;
|
||||
gint blue;
|
||||
} shifts;
|
||||
|
||||
struct
|
||||
{
|
||||
gulong red;
|
||||
gulong green;
|
||||
gulong blue;
|
||||
} masks;
|
||||
|
||||
struct
|
||||
{
|
||||
gint red;
|
||||
gint green;
|
||||
gint blue;
|
||||
} bits;
|
||||
|
||||
gulong max_entry;
|
||||
|
||||
gulong black_pixel;
|
||||
gulong white_pixel;
|
||||
};
|
||||
|
||||
/* Types for XInput support */
|
||||
|
||||
struct _GdkDeviceKey
|
||||
{
|
||||
guint keyval;
|
||||
GdkModifierType modifiers;
|
||||
};
|
||||
|
||||
struct _GdkDeviceInfo
|
||||
{
|
||||
guint32 deviceid;
|
||||
@@ -701,6 +878,8 @@ struct _GdkDeviceInfo
|
||||
gint has_cursor; /* TRUE if the X pointer follows device motion */
|
||||
gint num_axes;
|
||||
GdkAxisUse *axes; /* Specifies use for each axis */
|
||||
gint num_keys;
|
||||
GdkDeviceKey *keys;
|
||||
};
|
||||
|
||||
struct _GdkTimeCoord
|
||||
@@ -713,6 +892,14 @@ struct _GdkTimeCoord
|
||||
gdouble ytilt;
|
||||
};
|
||||
|
||||
/* Event filtering */
|
||||
|
||||
typedef void GdkXEvent; /* Can be cast to XEvent */
|
||||
|
||||
typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
|
||||
struct _GdkEventAny
|
||||
{
|
||||
GdkEventType type;
|
||||
@@ -724,14 +911,32 @@ struct _GdkEventExpose
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkRectangle area;
|
||||
gint count; /* If non-zero, how many more events follow. */
|
||||
};
|
||||
|
||||
struct _GdkEventNoExpose
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
/* XXX: does anyone need the X major_code or minor_code fields? */
|
||||
};
|
||||
|
||||
struct _GdkEventVisibility
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkVisibilityState state;
|
||||
};
|
||||
|
||||
struct _GdkEventMotion
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
@@ -742,12 +947,14 @@ struct _GdkEventMotion
|
||||
gint16 is_hint;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
gdouble x_root, y_root;
|
||||
};
|
||||
|
||||
struct _GdkEventButton
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
@@ -758,21 +965,26 @@ struct _GdkEventButton
|
||||
guint button;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
gdouble x_root, y_root;
|
||||
};
|
||||
|
||||
struct _GdkEventKey
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
guint state;
|
||||
guint keyval;
|
||||
gint length;
|
||||
gchar *string;
|
||||
};
|
||||
|
||||
struct _GdkEventCrossing
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkWindow *subwindow;
|
||||
GdkNotifyType detail;
|
||||
};
|
||||
@@ -781,6 +993,7 @@ struct _GdkEventFocus
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
gint16 in;
|
||||
};
|
||||
|
||||
@@ -788,6 +1001,7 @@ struct _GdkEventConfigure
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
gint16 x, y;
|
||||
gint16 width;
|
||||
gint16 height;
|
||||
@@ -797,6 +1011,7 @@ struct _GdkEventProperty
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom atom;
|
||||
guint32 time;
|
||||
guint state;
|
||||
@@ -806,6 +1021,7 @@ struct _GdkEventSelection
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom selection;
|
||||
GdkAtom target;
|
||||
GdkAtom property;
|
||||
@@ -820,6 +1036,7 @@ struct _GdkEventProximity
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 time;
|
||||
GdkInputSource source;
|
||||
guint32 deviceid;
|
||||
@@ -829,6 +1046,7 @@ struct _GdkEventDragRequest
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 requestor;
|
||||
union {
|
||||
struct {
|
||||
@@ -848,12 +1066,14 @@ struct _GdkEventDragRequest
|
||||
|
||||
GdkPoint drop_coords;
|
||||
gchar *data_type;
|
||||
guint32 timestamp;
|
||||
};
|
||||
|
||||
struct _GdkEventDragBegin
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
union {
|
||||
struct {
|
||||
guint protocol_version:4;
|
||||
@@ -867,6 +1087,7 @@ struct _GdkEventDropEnter
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 requestor;
|
||||
union {
|
||||
struct {
|
||||
@@ -883,6 +1104,7 @@ struct _GdkEventDropLeave
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 requestor;
|
||||
union {
|
||||
struct {
|
||||
@@ -897,6 +1119,7 @@ struct _GdkEventDropDataAvailable
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
guint32 requestor;
|
||||
union {
|
||||
struct {
|
||||
@@ -909,12 +1132,15 @@ struct _GdkEventDropDataAvailable
|
||||
gchar *data_type; /* MIME type */
|
||||
gulong data_numbytes;
|
||||
gpointer data;
|
||||
guint32 timestamp;
|
||||
GdkPoint coords;
|
||||
};
|
||||
|
||||
struct _GdkEventClient
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
gint8 send_event;
|
||||
GdkAtom message_type;
|
||||
gushort data_format;
|
||||
union {
|
||||
@@ -924,40 +1150,45 @@ struct _GdkEventClient
|
||||
} data;
|
||||
};
|
||||
|
||||
#ifndef _XLIB_H_
|
||||
#define XEvent void
|
||||
#endif
|
||||
|
||||
struct _GdkEventOther
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
XEvent *xevent;
|
||||
gint8 send_event;
|
||||
GdkXEvent *xevent;
|
||||
};
|
||||
|
||||
union _GdkEvent
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkEventAny any;
|
||||
GdkEventExpose expose;
|
||||
GdkEventMotion motion;
|
||||
GdkEventButton button;
|
||||
GdkEventKey key;
|
||||
GdkEventCrossing crossing;
|
||||
GdkEventFocus focus_change;
|
||||
GdkEventConfigure configure;
|
||||
GdkEventProperty property;
|
||||
GdkEventSelection selection;
|
||||
GdkEventProximity proximity;
|
||||
GdkEventDragBegin dragbegin;
|
||||
GdkEventDragRequest dragrequest;
|
||||
GdkEventDropEnter dropenter;
|
||||
GdkEventDropLeave dropleave;
|
||||
GdkEventType type;
|
||||
GdkEventAny any;
|
||||
GdkEventExpose expose;
|
||||
GdkEventNoExpose no_expose;
|
||||
GdkEventVisibility visibility;
|
||||
GdkEventMotion motion;
|
||||
GdkEventButton button;
|
||||
GdkEventKey key;
|
||||
GdkEventCrossing crossing;
|
||||
GdkEventFocus focus_change;
|
||||
GdkEventConfigure configure;
|
||||
GdkEventProperty property;
|
||||
GdkEventSelection selection;
|
||||
GdkEventProximity proximity;
|
||||
GdkEventDragBegin dragbegin;
|
||||
GdkEventDragRequest dragrequest;
|
||||
GdkEventDropEnter dropenter;
|
||||
GdkEventDropLeave dropleave;
|
||||
GdkEventDropDataAvailable dropdataavailable;
|
||||
GdkEventClient client;
|
||||
GdkEventOther other;
|
||||
GdkEventClient client;
|
||||
GdkEventOther other;
|
||||
};
|
||||
|
||||
struct _GdkRegion
|
||||
{
|
||||
gpointer user_data;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ static gint navailable_depths;
|
||||
static GdkVisualType available_types[6];
|
||||
static gint navailable_types;
|
||||
|
||||
static char* visual_names[] =
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
static gchar* visual_names[] =
|
||||
{
|
||||
"static gray",
|
||||
"grayscale",
|
||||
@@ -50,12 +52,14 @@ static char* visual_names[] =
|
||||
"direct color",
|
||||
};
|
||||
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
static GHashTable *visual_hash = NULL;
|
||||
|
||||
void
|
||||
gdk_visual_init ()
|
||||
{
|
||||
static gint possible_depths[5] = { 32, 24, 16, 15, 8 };
|
||||
static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 };
|
||||
static GdkVisualType possible_types[6] =
|
||||
{
|
||||
GDK_VISUAL_DIRECT_COLOR,
|
||||
@@ -66,7 +70,7 @@ gdk_visual_init ()
|
||||
GDK_VISUAL_STATIC_GRAY
|
||||
};
|
||||
|
||||
static gint npossible_depths = 5;
|
||||
static gint npossible_depths = 6;
|
||||
static gint npossible_types = 6;
|
||||
|
||||
XVisualInfo *visual_list;
|
||||
@@ -85,7 +89,7 @@ gdk_visual_init ()
|
||||
nvisuals = 0;
|
||||
for (i = 0; i < nxvisuals; i++)
|
||||
{
|
||||
if (visual_list[i].depth >= 8)
|
||||
if (visual_list[i].depth >= 1)
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
switch (visual_list[i].c_class)
|
||||
@@ -201,11 +205,13 @@ gdk_visual_init ()
|
||||
break;
|
||||
}
|
||||
|
||||
if (gdk_debug_level >= 1)
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gdk_debug_flags & GDK_DEBUG_MISC)
|
||||
for (i = 0; i < nvisuals; i++)
|
||||
g_print ("visual: %s: %d\n",
|
||||
g_print ("Gdk: visual: %s: %d\n",
|
||||
visual_names[visuals[i].visual.type],
|
||||
visuals[i].visual.depth);
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
navailable_depths = 0;
|
||||
for (i = 0; i < npossible_depths; i++)
|
||||
@@ -348,12 +354,17 @@ gdk_query_visual_types (GdkVisualType **visual_types,
|
||||
*visual_types = available_types;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_query_visuals (GdkVisual **visual_return,
|
||||
gint *count)
|
||||
GList*
|
||||
gdk_list_visuals (void)
|
||||
{
|
||||
*count = nvisuals;
|
||||
*visual_return = (GdkVisual*) visuals;
|
||||
GList *list;
|
||||
guint i;
|
||||
|
||||
list = NULL;
|
||||
for (i = 0; i < nvisuals; ++i)
|
||||
list = g_list_append (list, (gpointer) &visuals[i]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
956
gdk/gdkwindow.c
956
gdk/gdkwindow.c
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
#define GDK_ROOT_WINDOW() gdk_root_window
|
||||
#define GDK_ROOT_PARENT() &gdk_root_parent
|
||||
#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_root_parent)
|
||||
#define GDK_DISPLAY() gdk_display
|
||||
#define GDK_WINDOW_XDISPLAY(win) (((GdkWindowPrivate*) win)->xdisplay)
|
||||
#define GDK_WINDOW_XWINDOW(win) (((GdkWindowPrivate*) win)->xwindow)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#include "gdkprivate.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static guint gdk_xid_hash (XID *xid);
|
||||
static gint gdk_xid_compare (XID *a,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "../config.h"
|
||||
#include "gxid_lib.h"
|
||||
|
||||
#ifdef XINPUT_GXI
|
||||
|
||||
@@ -16,8 +17,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "gxid_lib.h"
|
||||
|
||||
/* handles mechanics of communicating with a client */
|
||||
static int
|
||||
gxid_send_message(char *host, int port, GxidMessage *msg)
|
||||
@@ -112,5 +111,15 @@ gxid_release_device(char *host, int port, GxidU32 device, GxidU32 window)
|
||||
return gxid_send_message(host,port,(GxidMessage *)&msg);
|
||||
}
|
||||
|
||||
#else /* !XINPUT_GXI */
|
||||
|
||||
/* Some compilers don't like empty source files */
|
||||
int
|
||||
gxid_claim_device(char *host, int port, GxidU32 device, GxidU32 window,
|
||||
int exclusive)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* XINPUT_GXI */
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed -f makecursors.sed $1 > .makecursors.tmp
|
||||
awk '{printf "%s = %s,\n", $1, $2}' .makecursors.tmp
|
||||
rm .makecursors.tmp
|
||||
4
gdk/makecursors.awk
Executable file
4
gdk/makecursors.awk
Executable file
@@ -0,0 +1,4 @@
|
||||
$1 == "#define" && NF >= 3 {
|
||||
sub(/^XC/,"GDK",$2)
|
||||
printf("%s = %s,\n",toupper($2),$3)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
/define/ ! d
|
||||
/define/ y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
|
||||
s/^.*XC_/GDK_/g
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed -f makekeysyms.sed $1 > .makekeysms.tmp
|
||||
awk '{printf "#define %s %s\n", $1, $2}' .makekeysms.tmp
|
||||
rm .makekeysms.tmp
|
||||
5
gdk/makekeysyms.awk
Executable file
5
gdk/makekeysyms.awk
Executable file
@@ -0,0 +1,5 @@
|
||||
$1 == "#define" && NF >= 3 {
|
||||
sub(/^XK/,"GDK",$2)
|
||||
sub(/0X/,"0x",$3)
|
||||
print $1,$2,$3
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
/define/ ! d
|
||||
s/^.*XK_/GDK_/g
|
||||
s/0X/0x/g
|
||||
131
gdk/x11/MwmUtil.h
Normal file
131
gdk/x11/MwmUtil.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of the GNU LessTif Library.
|
||||
*
|
||||
* 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, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef MWMUTIL_H_INCLUDED
|
||||
#define MWMUTIL_H_INCLUDED
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 input_mode;
|
||||
CARD32 status;
|
||||
} MotifWmHints, MwmHints;
|
||||
|
||||
#define MWM_HINTS_FUNCTIONS (1L << 0)
|
||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||
#define MWM_HINTS_INPUT_MODE (1L << 2)
|
||||
#define MWM_HINTS_STATUS (1L << 3)
|
||||
|
||||
#define MWM_FUNC_ALL (1L << 0)
|
||||
#define MWM_FUNC_RESIZE (1L << 1)
|
||||
#define MWM_FUNC_MOVE (1L << 2)
|
||||
#define MWM_FUNC_MINIMIZE (1L << 3)
|
||||
#define MWM_FUNC_MAXIMIZE (1L << 4)
|
||||
#define MWM_FUNC_CLOSE (1L << 5)
|
||||
|
||||
#define MWM_DECOR_ALL (1L << 0)
|
||||
#define MWM_DECOR_BORDER (1L << 1)
|
||||
#define MWM_DECOR_RESIZEH (1L << 2)
|
||||
#define MWM_DECOR_TITLE (1L << 3)
|
||||
#define MWM_DECOR_MENU (1L << 4)
|
||||
#define MWM_DECOR_MINIMIZE (1L << 5)
|
||||
#define MWM_DECOR_MAXIMIZE (1L << 6)
|
||||
|
||||
#define MWM_INPUT_MODELESS 0
|
||||
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
|
||||
#define MWM_INPUT_SYSTEM_MODAL 2
|
||||
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
|
||||
#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
|
||||
|
||||
#define MWM_TEAROFF_WINDOW (1L<<0)
|
||||
|
||||
/*
|
||||
* atoms
|
||||
*/
|
||||
#define _XA_MOTIF_BINDINGS "_MOTIF_BINDINGS"
|
||||
#define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
|
||||
#define _XA_MOTIF_WM_MESSAGES "_MOTIF_WM_MESSAGES"
|
||||
#define _XA_MOTIF_WM_OFFSET "_MOTIF_WM_OFFSET"
|
||||
#define _XA_MOTIF_WM_MENU "_MOTIF_WM_MENU"
|
||||
#define _XA_MOTIF_WM_INFO "_MOTIF_WM_INFO"
|
||||
#define _XA_MWM_HINTS _XA_MOTIF_WM_HINTS
|
||||
#define _XA_MWM_MESSAGES _XA_MOTIF_WM_MESSAGES
|
||||
#define _XA_MWM_MENU _XA_MOTIF_WM_MENU
|
||||
#define _XA_MWM_INFO _XA_MOTIF_WM_INFO
|
||||
|
||||
|
||||
/*
|
||||
* _MWM_INFO property
|
||||
*/
|
||||
typedef struct {
|
||||
long flags;
|
||||
Window wm_window;
|
||||
} MotifWmInfo;
|
||||
|
||||
typedef MotifWmInfo MwmInfo;
|
||||
|
||||
#define MWM_INFO_STARTUP_STANDARD (1L<<0)
|
||||
#define MWM_INFO_STARTUP_CUSTOM (1L<<1)
|
||||
|
||||
/*
|
||||
* _MWM_HINTS property
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 inputMode;
|
||||
CARD32 status;
|
||||
} PropMotifWmHints;
|
||||
|
||||
typedef PropMotifWmHints PropMwmHints;
|
||||
|
||||
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
|
||||
#define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS
|
||||
|
||||
/*
|
||||
* _MWM_INFO property, slight return
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 flags;
|
||||
CARD32 wmWindow;
|
||||
} PropMotifWmInfo;
|
||||
|
||||
typedef PropMotifWmInfo PropMwmInfo;
|
||||
|
||||
#define PROP_MOTIF_WM_INFO_ELEMENTS 2
|
||||
#define PROP_MWM_INFO_ELEMENTS PROP_MOTIF_WM_INFO_ELEMENTS
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MWMUTIL_H_INCLUDED */
|
||||
1724
gdk/x11/gdkcc-x11.c
Normal file
1724
gdk/x11/gdkcc-x11.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@ static void gdk_colormap_remove (GdkColormap *cmap);
|
||||
static guint gdk_colormap_hash (Colormap *cmap);
|
||||
static gint gdk_colormap_cmp (Colormap *a,
|
||||
Colormap *b);
|
||||
static void gdk_colormap_real_destroy (GdkColormap *colormap);
|
||||
|
||||
static GHashTable *colormap_hash = NULL;
|
||||
|
||||
@@ -117,7 +118,7 @@ gdk_colormap_new (GdkVisual *visual,
|
||||
return colormap;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gdk_colormap_real_destroy (GdkColormap *colormap)
|
||||
{
|
||||
GdkColormapPrivate *private = (GdkColormapPrivate*) colormap;
|
||||
@@ -132,12 +133,6 @@ gdk_colormap_real_destroy (GdkColormap *colormap)
|
||||
g_free (colormap);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_colormap_destroy (GdkColormap *colormap)
|
||||
{
|
||||
gdk_colormap_unref (colormap);
|
||||
}
|
||||
|
||||
GdkColormap*
|
||||
gdk_colormap_ref (GdkColormap *cmap)
|
||||
{
|
||||
@@ -179,22 +174,27 @@ gdk_colormap_get_system (void)
|
||||
private->next_color = 0;
|
||||
private->ref_count = 1;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
if ((private->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
||||
(private->visual->type == GDK_VISUAL_PSEUDO_COLOR))
|
||||
{
|
||||
xpalette[i].pixel = i;
|
||||
xpalette[i].red = 0;
|
||||
xpalette[i].green = 0;
|
||||
xpalette[i].blue = 0;
|
||||
}
|
||||
|
||||
XQueryColors (gdk_display, private->xcolormap, xpalette, 256);
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
colormap->colors[i].pixel = xpalette[i].pixel;
|
||||
colormap->colors[i].red = xpalette[i].red;
|
||||
colormap->colors[i].green = xpalette[i].green;
|
||||
colormap->colors[i].blue = xpalette[i].blue;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
xpalette[i].pixel = i;
|
||||
xpalette[i].red = 0;
|
||||
xpalette[i].green = 0;
|
||||
xpalette[i].blue = 0;
|
||||
}
|
||||
|
||||
XQueryColors (gdk_display, private->xcolormap, xpalette,
|
||||
MIN (private->visual->colormap_size, 256));
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
colormap->colors[i].pixel = xpalette[i].pixel;
|
||||
colormap->colors[i].red = xpalette[i].red;
|
||||
colormap->colors[i].green = xpalette[i].green;
|
||||
colormap->colors[i].blue = xpalette[i].blue;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_colormap_add (colormap);
|
||||
|
||||
@@ -38,6 +38,37 @@ gdk_cursor_new (GdkCursorType cursor_type)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
GdkCursor*
|
||||
gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, gint x, gint y)
|
||||
{
|
||||
GdkCursorPrivate *private;
|
||||
GdkCursor *cursor;
|
||||
Pixmap source_pixmap, mask_pixmap;
|
||||
Cursor xcursor;
|
||||
XColor xfg, xbg;
|
||||
|
||||
source_pixmap = ((GdkPixmapPrivate *) source)->xwindow;
|
||||
mask_pixmap = ((GdkPixmapPrivate *) mask)->xwindow;
|
||||
|
||||
xfg.pixel = fg->pixel;
|
||||
xfg.red = fg->red;
|
||||
xfg.blue = fg->blue;
|
||||
xfg.green = fg->green;
|
||||
xbg.pixel = bg->pixel;
|
||||
xbg.red = bg->red;
|
||||
xbg.blue = bg->blue;
|
||||
xbg.green = bg->green;
|
||||
|
||||
xcursor = XCreatePixmapCursor (gdk_display, source_pixmap, mask_pixmap, &xfg, &xbg, x, y);
|
||||
private = g_new (GdkCursorPrivate, 1);
|
||||
private->xdisplay = gdk_display;
|
||||
private->xcursor = xcursor;
|
||||
cursor = (GdkCursor *) private;
|
||||
cursor->type = GDK_CURSOR_IS_PIXMAP;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_cursor_destroy (GdkCursor *cursor)
|
||||
{
|
||||
|
||||
144
gdk/x11/gdkdnd-x11.c
Normal file
144
gdk/x11/gdkdnd-x11.c
Normal file
@@ -0,0 +1,144 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <string.h>
|
||||
#include "gdkx.h"
|
||||
#include "gdk.h"
|
||||
|
||||
/* Nothing much here now, but we have to make a start some time ;-) */
|
||||
|
||||
void
|
||||
gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, GdkCursor *goahead_cursor)
|
||||
{
|
||||
gdk_dnd.c->gdk_cursor_dragdefault =
|
||||
((GdkCursorPrivate *)default_cursor)->xcursor;
|
||||
gdk_dnd.c->gdk_cursor_dragok = ((GdkCursorPrivate *)goahead_cursor)->xcursor;
|
||||
|
||||
if(gdk_dnd.dnd_grabbed)
|
||||
{
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
/* We were displaying pixmaps for the drag */
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_default);
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_default);
|
||||
if(gdk_dnd.c->drag_pm_ok)
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_ok);
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
|
||||
}
|
||||
gdk_dnd.c->drag_pm_default = gdk_dnd.c->drag_pm_ok = NULL;
|
||||
g_list_free(gdk_dnd.c->xids);
|
||||
gdk_dnd.c->xids = NULL;
|
||||
}
|
||||
gdk_dnd_display_drag_cursor(-1, -1,
|
||||
gdk_dnd.dnd_drag_target?TRUE:FALSE,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
|
||||
GdkPoint *default_hotspot,
|
||||
GdkWindow *goahead_pixmapwin,
|
||||
GdkPoint *goahead_hotspot)
|
||||
{
|
||||
g_return_if_fail(default_pixmapwin != NULL);
|
||||
|
||||
g_list_free(gdk_dnd.c->xids); gdk_dnd.c->xids = NULL;
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_default);
|
||||
if(gdk_dnd.c->drag_pm_ok)
|
||||
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
|
||||
|
||||
gdk_dnd.c->drag_pm_ok = NULL;
|
||||
|
||||
gdk_window_ref(default_pixmapwin);
|
||||
gdk_dnd.c->drag_pm_default = default_pixmapwin;
|
||||
gdk_dnd.c->default_hotspot = *default_hotspot;
|
||||
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)default_pixmapwin)->xwindow);
|
||||
if(goahead_pixmapwin)
|
||||
{
|
||||
gdk_window_ref(goahead_pixmapwin);
|
||||
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)goahead_pixmapwin)->xwindow);
|
||||
gdk_dnd.c->drag_pm_ok = goahead_pixmapwin;
|
||||
gdk_dnd.c->ok_hotspot = *goahead_hotspot;
|
||||
}
|
||||
|
||||
if(gdk_dnd.dnd_grabbed)
|
||||
{
|
||||
gdk_dnd_display_drag_cursor(-1, -1,
|
||||
gdk_dnd.dnd_drag_target?TRUE:FALSE,
|
||||
TRUE);
|
||||
XChangeActivePointerGrab (gdk_display,
|
||||
ButtonMotionMask |
|
||||
ButtonPressMask |
|
||||
ButtonReleaseMask |
|
||||
EnterWindowMask | LeaveWindowMask,
|
||||
None,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
|
||||
gboolean change_made)
|
||||
{
|
||||
if(!gdk_dnd.dnd_grabbed)
|
||||
return;
|
||||
|
||||
if(gdk_dnd.c->drag_pm_default)
|
||||
{
|
||||
/* We're doing pixmaps here... */
|
||||
GdkWindow *mypix, *opix;
|
||||
GdkPoint *myhotspot;
|
||||
gint itmp;
|
||||
guint masktmp;
|
||||
Window wtmp;
|
||||
|
||||
if(x == -2 && y == -2) /* Hide the cursors */
|
||||
{
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_ok);
|
||||
gdk_window_hide(gdk_dnd.c->drag_pm_default);
|
||||
return;
|
||||
}
|
||||
|
||||
if(x == -1 && y == -1) /* We're supposed to find it out for ourselves */
|
||||
XQueryPointer(gdk_display, gdk_root_window,
|
||||
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &masktmp);
|
||||
|
||||
if(drag_ok)
|
||||
{
|
||||
mypix = gdk_dnd.c->drag_pm_ok;
|
||||
opix = gdk_dnd.c->drag_pm_default;
|
||||
myhotspot = &gdk_dnd.c->ok_hotspot;
|
||||
}
|
||||
else
|
||||
{
|
||||
mypix = gdk_dnd.c->drag_pm_default;
|
||||
opix = gdk_dnd.c->drag_pm_ok;
|
||||
myhotspot = &gdk_dnd.c->default_hotspot;
|
||||
}
|
||||
if(change_made)
|
||||
{
|
||||
gdk_window_hide(opix);
|
||||
gdk_window_show(mypix); /* There ought to be a way to know if
|
||||
a window is already mapped etc. */
|
||||
}
|
||||
gdk_window_move(mypix, x - myhotspot->x, y - myhotspot->y);
|
||||
}
|
||||
else if(change_made)
|
||||
{
|
||||
Cursor c;
|
||||
/* Move cursors around */
|
||||
if(drag_ok)
|
||||
c = gdk_dnd.c->gdk_cursor_dragok;
|
||||
else
|
||||
c = gdk_dnd.c->gdk_cursor_dragdefault;
|
||||
XChangeActivePointerGrab (gdk_display,
|
||||
ButtonMotionMask |
|
||||
ButtonPressMask |
|
||||
ButtonReleaseMask |
|
||||
EnterWindowMask | LeaveWindowMask,
|
||||
c,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ gdk_font_load (const gchar *font_name)
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_fontset_load(gchar *fontset_name)
|
||||
gdk_fontset_load (gchar *fontset_name)
|
||||
{
|
||||
GdkFont *font;
|
||||
GdkFontPrivate *private;
|
||||
@@ -93,40 +93,6 @@ gdk_fontset_load(gchar *fontset_name)
|
||||
}
|
||||
return font;
|
||||
}
|
||||
void
|
||||
gdk_font_free (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
|
||||
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_fontset_free (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
gdk_font_ref (GdkFont *font)
|
||||
@@ -140,6 +106,35 @@ gdk_font_ref (GdkFont *font)
|
||||
return font;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_font_unref (GdkFont *font)
|
||||
{
|
||||
GdkFontPrivate *private;
|
||||
|
||||
g_return_if_fail (font != NULL);
|
||||
|
||||
private = (GdkFontPrivate*) font;
|
||||
|
||||
private->ref_count -= 1;
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
switch (font->type)
|
||||
{
|
||||
case GDK_FONT_FONT:
|
||||
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
|
||||
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
|
||||
break;
|
||||
case GDK_FONT_FONTSET:
|
||||
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
|
||||
break;
|
||||
default:
|
||||
g_error ("unknown font type.");
|
||||
break;
|
||||
}
|
||||
g_free (font);
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_font_id (GdkFont *font)
|
||||
{
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
#include "gdktypes.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
gint gdk_debug_level = 0;
|
||||
gint gdk_show_events = FALSE;
|
||||
guint gdk_debug_flags = 0;
|
||||
gint gdk_use_xshm = TRUE;
|
||||
gchar *gdk_display_name = NULL;
|
||||
Display *gdk_display = NULL;
|
||||
@@ -34,14 +33,22 @@ Atom gdk_wm_take_focus;
|
||||
Atom gdk_wm_protocols;
|
||||
Atom gdk_wm_window_protocols[2];
|
||||
Atom gdk_selection_property;
|
||||
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
|
||||
{0,0}, {0,0}, NULL};
|
||||
GdkDndGlobals gdk_dnd = {None,None,None,
|
||||
None,None,None,
|
||||
None,
|
||||
None,None,
|
||||
&gdk_dnd_cursorinfo,
|
||||
NULL,
|
||||
0, 0,
|
||||
{0,0}};
|
||||
0,
|
||||
FALSE, FALSE, FALSE,
|
||||
None,
|
||||
{0,0},
|
||||
{0,0}, {0,0},
|
||||
{0,0,0,0}, NULL, None, 0};
|
||||
gchar *gdk_progname = NULL;
|
||||
gchar *gdk_progclass = NULL;
|
||||
gint gdk_error_code;
|
||||
gint gdk_error_warnings = TRUE;
|
||||
gint gdk_null_window_warnings = TRUE;
|
||||
GList *gdk_default_filters = NULL;
|
||||
|
||||
@@ -136,7 +136,6 @@ gdk_image_init ()
|
||||
{
|
||||
if (!gdk_image_check_xshm (gdk_display))
|
||||
{
|
||||
g_warning ("MIT-SHM Extension not availible on server");
|
||||
gdk_use_xshm = False;
|
||||
}
|
||||
}
|
||||
@@ -213,7 +212,6 @@ gdk_image_new (GdkImageType type,
|
||||
g_free (private->x_shm_info);
|
||||
g_free (image);
|
||||
|
||||
gdk_use_xshm = False;
|
||||
gdk_use_xshm = False;
|
||||
return NULL;
|
||||
}
|
||||
@@ -249,8 +247,7 @@ gdk_image_new (GdkImageType type,
|
||||
gdk_error_warnings = 1;
|
||||
if (gdk_error_code == -1)
|
||||
{
|
||||
g_warning ("XShmAttach failed!");
|
||||
|
||||
/* this is the common failure case so omit warning */
|
||||
XDestroyImage (private->ximage);
|
||||
shmdt (x_shm_info->shmaddr);
|
||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||
@@ -330,6 +327,8 @@ gdk_image_get (GdkWindow *window,
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
win_private = (GdkWindowPrivate *) window;
|
||||
if (win_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
private = g_new (GdkImagePrivate, 1);
|
||||
image = (GdkImage*) private;
|
||||
@@ -447,6 +446,8 @@ gdk_image_put_normal (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
@@ -478,6 +479,8 @@ gdk_image_put_shared (GdkDrawable *drawable,
|
||||
g_return_if_fail (gc != NULL);
|
||||
|
||||
drawable_private = (GdkWindowPrivate*) drawable;
|
||||
if (drawable_private->destroyed)
|
||||
return;
|
||||
image_private = (GdkImagePrivate*) image;
|
||||
gc_private = (GdkGCPrivate*) gc;
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ gdk_input_init(void)
|
||||
GList *tmp_list;
|
||||
|
||||
gdk_input_vtable.set_mode = gdk_input_gxi_set_mode;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_key = gdk_input_common_set_key;
|
||||
gdk_input_vtable.motion_events = gdk_input_gxi_motion_events;
|
||||
gdk_input_vtable.get_pointer = gdk_input_gxi_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = gdk_input_gxi_grab_pointer;
|
||||
|
||||
@@ -32,6 +32,7 @@ gdk_input_init ()
|
||||
{
|
||||
gdk_input_vtable.set_mode = NULL;
|
||||
gdk_input_vtable.set_axes = NULL;
|
||||
gdk_input_vtable.set_key = NULL;
|
||||
gdk_input_vtable.motion_events = NULL;
|
||||
gdk_input_vtable.get_pointer = gdk_input_none_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = NULL;
|
||||
|
||||
@@ -59,6 +59,8 @@ static void gdk_input_common_get_pointer (GdkWindow *window,
|
||||
gdouble *ytilt,
|
||||
GdkModifierType *mask);
|
||||
|
||||
#define GDK_MAX_DEVICE_CLASSES 13
|
||||
|
||||
/* Global variables */
|
||||
|
||||
static gint gdk_input_root_width;
|
||||
@@ -70,9 +72,11 @@ gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_
|
||||
{
|
||||
Window root,parent;
|
||||
Window *children;
|
||||
int nchildren;
|
||||
int x,y,width,height;
|
||||
int xc,yc,widthc,heightc,border_widthc,depthc;
|
||||
guint nchildren;
|
||||
gint x,y;
|
||||
guint width, height;
|
||||
gint xc,yc;
|
||||
guint widthc,heightc,border_widthc,depthc;
|
||||
|
||||
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
|
||||
if (children) XFree(children);
|
||||
@@ -156,6 +160,8 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
/* step through the classes */
|
||||
|
||||
gdkdev->info.num_axes = 0;
|
||||
gdkdev->info.num_keys = 0;
|
||||
gdkdev->info.keys = NULL;
|
||||
gdkdev->axes = 0;
|
||||
gdkdev->info.has_cursor = 0;
|
||||
gdkdev->needs_update = FALSE;
|
||||
@@ -168,6 +174,32 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
switch (class->class) {
|
||||
case ButtonClass:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case KeyClass:
|
||||
{
|
||||
XKeyInfo *xki = (XKeyInfo *)class;
|
||||
/* Hack to catch XFree86 3.3.1 bug. Other devices better
|
||||
* not have exactly 25 keys...
|
||||
*/
|
||||
if ((xki->min_keycode == 8) && (xki->max_keycode == 32))
|
||||
{
|
||||
gdkdev->info.num_keys = 32;
|
||||
gdkdev->min_keycode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdkdev->info.num_keys = xki->max_keycode - xki->min_keycode + 1;
|
||||
gdkdev->min_keycode = xki->min_keycode;
|
||||
}
|
||||
gdkdev->info.keys = g_new (GdkDeviceKey, gdkdev->info.num_keys);
|
||||
|
||||
for (j=0; j<gdkdev->info.num_keys; j++)
|
||||
{
|
||||
gdkdev->info.keys[j].keyval = 0;
|
||||
gdkdev->info.keys[j].modifiers = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ValuatorClass:
|
||||
@@ -218,12 +250,45 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
|
||||
g_free(gdkdev->info.name);
|
||||
if (gdkdev->axes)
|
||||
g_free(gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free(gdkdev->info.keys);
|
||||
g_free(gdkdev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (device->use != IsXPointer)
|
||||
{
|
||||
int error_warn = gdk_error_warnings;
|
||||
|
||||
gdk_error_warnings = 0;
|
||||
gdk_error_code = 0;
|
||||
gdkdev->xdevice = XOpenDevice(gdk_display, gdkdev->info.deviceid);
|
||||
gdk_error_warnings = error_warn;
|
||||
|
||||
/* return NULL if device is not ready */
|
||||
if (gdk_error_code)
|
||||
{
|
||||
g_free (gdkdev->info.name);
|
||||
if (gdkdev->axes)
|
||||
g_free (gdkdev->axes);
|
||||
if (gdkdev->info.keys)
|
||||
g_free (gdkdev->info.keys);
|
||||
if (gdkdev->info.axes)
|
||||
g_free (gdkdev->info.axes);
|
||||
g_free (gdkdev);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gdkdev->buttonpress_type = 0;
|
||||
gdkdev->buttonrelease_type = 0;
|
||||
gdkdev->keypress_type = 0;
|
||||
gdkdev->keyrelease_type = 0;
|
||||
gdkdev->motionnotify_type = 0;
|
||||
gdkdev->proximityin_type = 0;
|
||||
gdkdev->proximityout_type = 0;
|
||||
gdkdev->changenotify_type = 0;
|
||||
|
||||
return gdkdev;
|
||||
}
|
||||
@@ -240,11 +305,15 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
|
||||
i = 0;
|
||||
/* We have to track press and release events in pairs to keep
|
||||
track of button state correctly and implement grabbing */
|
||||
track of button state correctly and implement grabbing for
|
||||
the gxi support */
|
||||
if (mask & GDK_BUTTON_PRESS_MASK || mask & GDK_BUTTON_RELEASE_MASK)
|
||||
{
|
||||
DeviceButtonPress (gdkdev->xdevice, gdkdev->buttonpress_type,
|
||||
class);
|
||||
DeviceButtonPress (gdkdev->xdevice, gdkdev->buttonpress_type,
|
||||
class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
DeviceButtonPressGrab (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
DeviceButtonRelease (gdkdev->xdevice, gdkdev->buttonrelease_type,
|
||||
@@ -258,6 +327,38 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
else
|
||||
if (mask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
|
||||
GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
|
||||
GDK_POINTER_MOTION_HINT_MASK))
|
||||
{
|
||||
/* Make sure gdkdev->motionnotify_type is set */
|
||||
DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class);
|
||||
}
|
||||
if (mask & GDK_BUTTON1_MOTION_MASK)
|
||||
{
|
||||
DeviceButton1Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON2_MOTION_MASK)
|
||||
{
|
||||
DeviceButton2Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON3_MOTION_MASK)
|
||||
{
|
||||
DeviceButton3Motion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_BUTTON_MOTION_MASK)
|
||||
{
|
||||
DeviceButtonMotion (gdkdev->xdevice, 0, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_POINTER_MOTION_HINT_MASK)
|
||||
{
|
||||
/* We'll get into trouble if the macros change, but at least we'll
|
||||
@@ -266,6 +367,18 @@ gdk_input_common_find_events(GdkWindow *window,
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_KEY_PRESS_MASK)
|
||||
{
|
||||
DeviceKeyPress (gdkdev->xdevice, gdkdev->keypress_type, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_KEY_RELEASE_MASK)
|
||||
{
|
||||
DeviceKeyRelease (gdkdev->xdevice, gdkdev->keyrelease_type, class);
|
||||
if (class != 0)
|
||||
classes[i++] = class;
|
||||
}
|
||||
if (mask & GDK_PROXIMITY_IN_MASK)
|
||||
{
|
||||
ProximityIn (gdkdev->xdevice, gdkdev->proximityin_type, class);
|
||||
@@ -286,7 +399,7 @@ static void
|
||||
gdk_input_common_select_events(GdkWindow *window,
|
||||
GdkDevicePrivate *gdkdev)
|
||||
{
|
||||
XEventClass classes[6];
|
||||
XEventClass classes[GDK_MAX_DEVICE_CLASSES];
|
||||
gint num_classes;
|
||||
|
||||
if (gdkdev->info.mode == GDK_MODE_DISABLED)
|
||||
@@ -492,9 +605,77 @@ gdk_input_common_other_event (GdkEvent *event,
|
||||
event->button.state = gdk_input_translate_state(xdbe->state,xdbe->device_state);
|
||||
event->button.button = xdbe->button;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("button %s:\t\twindow: %ld device: %ld x,y: %f %f button: %d\n",
|
||||
(event->button.type == GDK_BUTTON_PRESS) ? "press" : "release",
|
||||
xdbe->window,
|
||||
xdbe->deviceid,
|
||||
event->button.x, event->button.y,
|
||||
xdbe->button));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((xevent->type == gdkdev->keypress_type) ||
|
||||
(xevent->type == gdkdev->keyrelease_type))
|
||||
{
|
||||
XDeviceKeyEvent *xdke = (XDeviceKeyEvent *)(xevent);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("device key %s:\twindow: %ld device: %ld keycode: %d\n",
|
||||
(event->key.type == GDK_KEY_PRESS) ? "press" : "release",
|
||||
xdke->window,
|
||||
xdke->deviceid,
|
||||
xdke->keycode));
|
||||
|
||||
if (xdke->keycode < gdkdev->min_keycode ||
|
||||
xdke->keycode >= gdkdev->min_keycode + gdkdev->info.num_keys)
|
||||
{
|
||||
g_warning ("Invalid device key code received");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
event->key.keyval = gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].keyval;
|
||||
|
||||
if (event->key.keyval == 0)
|
||||
{
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("\t\ttranslation - NONE\n"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
event->key.type = (xdke->type == gdkdev->keypress_type) ?
|
||||
GDK_KEY_PRESS : GDK_KEY_RELEASE;
|
||||
|
||||
event->key.window = input_window->window;
|
||||
event->key.time = xdke->time;
|
||||
|
||||
event->key.state = gdk_input_translate_state(xdke->state, xdke->device_state)
|
||||
| gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].modifiers;
|
||||
|
||||
/* Add a string translation for the key event */
|
||||
if ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xFF))
|
||||
{
|
||||
event->key.length = 1;
|
||||
event->key.string = g_new (gchar, 2);
|
||||
event->key.string[0] = (gchar)event->key.keyval;
|
||||
event->key.string[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->key.length = 0;
|
||||
event->key.string = g_new0 (gchar, 1);
|
||||
}
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("\t\ttranslation - keyval: %d modifiers: %#x\n",
|
||||
event->key.keyval,
|
||||
event->key.state));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (xevent->type == gdkdev->motionnotify_type)
|
||||
{
|
||||
XDeviceMotionEvent *xdme = (XDeviceMotionEvent *)(xevent);
|
||||
@@ -511,15 +692,17 @@ gdk_input_common_other_event (GdkEvent *event,
|
||||
event->motion.deviceid = xdme->deviceid;
|
||||
event->motion.state = gdk_input_translate_state(xdme->state,
|
||||
xdme->device_state);
|
||||
event->motion.is_hint = xdme->is_hint;
|
||||
event->motion.source = gdkdev->info.source;
|
||||
event->motion.deviceid = xdme->deviceid;
|
||||
|
||||
if (gdk_show_events)
|
||||
g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f hint: %s\n",
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f state %#4x hint: %s\n",
|
||||
xdme->window,
|
||||
xdme->deviceid,
|
||||
event->motion.x, event->motion.y,
|
||||
(xevent->xmotion.is_hint) ? "true" : "false");
|
||||
event->motion.state,
|
||||
(xdme->is_hint) ? "true" : "false"));
|
||||
|
||||
|
||||
return TRUE;
|
||||
@@ -562,6 +745,21 @@ gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
}
|
||||
}
|
||||
|
||||
void gdk_input_common_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
{
|
||||
GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid);
|
||||
|
||||
gdkdev = gdk_input_find_device (deviceid);
|
||||
g_return_if_fail (gdkdev != NULL);
|
||||
g_return_if_fail (index < gdkdev->info.num_keys);
|
||||
|
||||
gdkdev->info.keys[index].keyval = keyval;
|
||||
gdkdev->info.keys[index].modifiers = modifiers;
|
||||
}
|
||||
|
||||
static GdkTimeCoord *
|
||||
gdk_input_common_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
@@ -658,24 +856,21 @@ gdk_input_common_get_pointer (GdkWindow *window,
|
||||
switch (input_class->class)
|
||||
{
|
||||
case ValuatorClass:
|
||||
gdk_input_translate_coordinates(gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
x, y, pressure,
|
||||
xtilt, ytilt);
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
((XValuatorState *)input_class)->valuators,
|
||||
x, y, pressure,
|
||||
xtilt, ytilt);
|
||||
|
||||
|
||||
break;
|
||||
case ButtonClass:
|
||||
if (mask)
|
||||
{
|
||||
*mask &= ~(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
|
||||
GDK_BUTTON3_MASK | GDK_BUTTON4_MASK |
|
||||
GDK_BUTTON5_MASK);
|
||||
for (i=0; i < ((XButtonState *)input_class)->num_buttons; i++)
|
||||
{
|
||||
if (((XButtonState *)input_class)->buttons[i])
|
||||
*mask |= GDK_BUTTON1_MASK << i;
|
||||
}
|
||||
*mask &= 0xFF;
|
||||
if (((XButtonState *)input_class)->num_buttons > 0)
|
||||
*mask |= ((XButtonState *)input_class)->buttons[0] << 7;
|
||||
/* GDK_BUTTON1_MASK = 1 << 8, and button n is stored
|
||||
* in bit 1<<(n%8) in byte n/8. n = 1,2,... */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ void
|
||||
gdk_input_init(void)
|
||||
{
|
||||
gdk_input_vtable.set_mode = gdk_input_xfree_set_mode;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_axes = gdk_input_common_set_axes;
|
||||
gdk_input_vtable.set_key = gdk_input_common_set_key;
|
||||
gdk_input_vtable.motion_events = gdk_input_common_motion_events;
|
||||
gdk_input_vtable.get_pointer = gdk_input_common_get_pointer;
|
||||
gdk_input_vtable.grab_pointer = gdk_input_xfree_grab_pointer;
|
||||
@@ -229,33 +230,6 @@ gdk_input_xfree_other_event (GdkEvent *event,
|
||||
gdk_input_ignore_core)
|
||||
gdk_input_check_proximity();
|
||||
|
||||
/* Do a passive button grab. We have to be careful not to release
|
||||
an explicit grab, if any. Doubling the grab should be harmless,
|
||||
but we check anyways. */
|
||||
|
||||
/* FIXME, finding the proper events here is going to be SLOW - but
|
||||
we might have different sets for each window/device combination */
|
||||
|
||||
if (return_val> 0 && !input_window->grabbed)
|
||||
{
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
XEventClass event_classes[6];
|
||||
gint num_classes;
|
||||
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
((GdkWindowPrivate *)window)->extension_events,
|
||||
event_classes, &num_classes);
|
||||
|
||||
XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
TRUE, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, event->button.time);
|
||||
}
|
||||
else if (event->type == GDK_BUTTON_RELEASE)
|
||||
XUngrabDevice( GDK_DISPLAY(), gdkdev->xdevice, event->button.time);
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
||||
|
||||
@@ -284,8 +258,9 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
GdkInputWindow *input_window, *new_window;
|
||||
GdkDevicePrivate *gdkdev;
|
||||
GList *tmp_list;
|
||||
XEventClass event_classes[6];
|
||||
XEventClass event_classes[GDK_MAX_DEVICE_CLASSES];
|
||||
gint num_classes;
|
||||
gint result;
|
||||
|
||||
tmp_list = gdk_input_windows;
|
||||
new_window = NULL;
|
||||
@@ -296,15 +271,12 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
return AlreadyGrabbed;
|
||||
|
||||
if (input_window->window == window)
|
||||
{
|
||||
new_window = input_window;
|
||||
break;
|
||||
}
|
||||
new_window = input_window;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
g_return_if_fail (new_window == NULL);
|
||||
g_return_val_if_fail (new_window != NULL, Success); /* shouldn't happen */
|
||||
|
||||
new_window->grabbed = TRUE;
|
||||
|
||||
@@ -313,17 +285,21 @@ gdk_input_xfree_grab_pointer (GdkWindow * window,
|
||||
{
|
||||
gdkdev = (GdkDevicePrivate *)tmp_list->data;
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER &&
|
||||
gdkdev->xdevice && !gdkdev->button_state)
|
||||
gdkdev->xdevice)
|
||||
{
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
((GdkWindowPrivate *)window)->extension_events,
|
||||
gdk_input_common_find_events (window, gdkdev,
|
||||
event_mask,
|
||||
event_classes, &num_classes);
|
||||
|
||||
/* FIXME: we should do something on failure */
|
||||
XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
TRUE, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, time);
|
||||
result = XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice,
|
||||
GDK_WINDOW_XWINDOW (window),
|
||||
owner_events, num_classes, event_classes,
|
||||
GrabModeAsync, GrabModeAsync, time);
|
||||
|
||||
/* FIXME: if failure occurs on something other than the first
|
||||
device, things will be badly inconsistent */
|
||||
if (result != Success)
|
||||
return result;
|
||||
}
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
@@ -355,11 +331,9 @@ gdk_input_xfree_ungrab_pointer (guint32 time)
|
||||
while (tmp_list)
|
||||
{
|
||||
gdkdev = (GdkDevicePrivate *)tmp_list->data;
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER &&
|
||||
gdkdev->xdevice && !gdkdev->button_state)
|
||||
{
|
||||
XUngrabDevice( gdk_display, gdkdev->xdevice, time);
|
||||
}
|
||||
if (gdkdev->info.deviceid != GDK_CORE_POINTER && gdkdev->xdevice)
|
||||
XUngrabDevice( gdk_display, gdkdev->xdevice, time);
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,15 @@ gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes)
|
||||
gdk_input_vtable.set_axes (deviceid, axes);
|
||||
}
|
||||
|
||||
void gdk_input_set_key (guint32 deviceid,
|
||||
guint index,
|
||||
guint keyval,
|
||||
GdkModifierType modifiers)
|
||||
{
|
||||
if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_key)
|
||||
gdk_input_vtable.set_key (deviceid, index, keyval, modifiers);
|
||||
}
|
||||
|
||||
GdkTimeCoord *
|
||||
gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 deviceid,
|
||||
@@ -109,14 +118,20 @@ gdk_input_motion_events (GdkWindow *window,
|
||||
guint32 stop,
|
||||
gint *nevents_return)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
XTimeCoord *xcoords;
|
||||
GdkTimeCoord *coords;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
window_private = (GdkWindowPrivate *) window;
|
||||
if (window_private->destroyed)
|
||||
return NULL;
|
||||
|
||||
if (deviceid == GDK_CORE_POINTER)
|
||||
{
|
||||
xcoords = XGetMotionEvents (gdk_display,
|
||||
((GdkWindowPrivate *)window)->xwindow,
|
||||
window_private->xwindow,
|
||||
start, stop, nevents_return);
|
||||
if (xcoords)
|
||||
{
|
||||
@@ -195,10 +210,14 @@ void
|
||||
gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
GdkExtensionMode mode)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
GList *tmp_list;
|
||||
GdkInputWindow *iw;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
if (window_private->destroyed)
|
||||
return;
|
||||
|
||||
if (mode == GDK_EXTENSION_EVENTS_NONE)
|
||||
mask = 0;
|
||||
@@ -215,7 +234,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
iw->grabbed = FALSE;
|
||||
|
||||
gdk_input_windows = g_list_append(gdk_input_windows,iw);
|
||||
((GdkWindowPrivate *)window)->extension_events = mask;
|
||||
window_private->extension_events = mask;
|
||||
|
||||
/* Add enter window events to the event mask */
|
||||
/* FIXME, this is not needed for XINPUT_NONE */
|
||||
@@ -232,7 +251,7 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
|
||||
g_free(iw);
|
||||
}
|
||||
|
||||
((GdkWindowPrivate *)window)->extension_events = 0;
|
||||
window_private->extension_events = 0;
|
||||
}
|
||||
|
||||
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)
|
||||
@@ -258,7 +277,7 @@ gdk_input_window_destroy (GdkWindow *window)
|
||||
input_window = gdk_input_window_find (window);
|
||||
g_return_if_fail (input_window != NULL);
|
||||
|
||||
gdk_input_windows = g_list_remove(gdk_input_windows,input_window);
|
||||
gdk_input_windows = g_list_remove (gdk_input_windows,input_window);
|
||||
g_free(input_window);
|
||||
}
|
||||
|
||||
@@ -280,6 +299,7 @@ gdk_input_exit (void)
|
||||
g_free(gdkdev->axes);
|
||||
#endif
|
||||
g_free(gdkdev->info.axes);
|
||||
g_free(gdkdev->info.keys);
|
||||
g_free(gdkdev);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user