Imported Upstream version 1.0.2
Margarita Manterola
6 years ago
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |
4 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Lesser General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License along | |
306 | with this program; if not, write to the Free Software Foundation, Inc., | |
307 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
308 | ||
309 | Also add information on how to contact you by electronic and paper mail. | |
310 | ||
311 | If the program is interactive, make it output a short notice like this | |
312 | when it starts in an interactive mode: | |
313 | ||
314 | Gnomovision version 69, Copyright (C) year name of author | |
315 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
316 | This is free software, and you are welcome to redistribute it | |
317 | under certain conditions; type `show c' for details. | |
318 | ||
319 | The hypothetical commands `show w' and `show c' should show the appropriate | |
320 | parts of the General Public License. Of course, the commands you use may | |
321 | be called something other than `show w' and `show c'; they could even be | |
322 | mouse-clicks or menu items--whatever suits your program. | |
323 | ||
324 | You should also get your employer (if you work as a programmer) or your | |
325 | school, if any, to sign a "copyright disclaimer" for the program, if | |
326 | necessary. Here is a sample; alter the names: | |
327 | ||
328 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
329 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
330 | ||
331 | <signature of Ty Coon>, 1 April 1989 | |
332 | Ty Coon, President of Vice | |
333 | ||
334 | This General Public License does not permit incorporating your program into | |
335 | proprietary programs. If your program is a subroutine library, you may | |
336 | consider it more useful to permit linking proprietary applications with the | |
337 | library. If this is what you want to do, use the GNU Lesser General | |
338 | Public License instead of this License. |
0 | SUBDIRS = libxapp po schemas files | |
1 | ||
2 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} | |
3 | ||
4 | DISTCHECK_CONFIGURE_FLAGS = --enable-introspection | |
5 | ||
6 | @INTLTOOL_XML_RULE@ | |
7 | ||
8 | MAINTAINERCLEANFILES = \ | |
9 | $(srcdir)/aclocal.m4 \ | |
10 | $(srcdir)/config.guess \ | |
11 | $(srcdir)/config.h.in \ | |
12 | $(srcdir)/config.sub \ | |
13 | $(srcdir)/depcomp \ | |
14 | $(srcdir)/install-sh \ | |
15 | $(srcdir)/ltmain.sh \ | |
16 | $(srcdir)/missing \ | |
17 | $(srcdir)/mkinstalldirs \ | |
18 | `find "$(srcdir)" -type f -name Makefile.in -print` \ | |
19 | $(srcdir)/configure \ | |
20 | $(srcdir)/m4/gnome-doc-utils.m4 \ | |
21 | $(srcdir)/m4/gtk-doc.m4 \ | |
22 | $(srcdir)/m4/intltool.m4 | |
23 | ||
24 | dist-hook: | |
25 | $(AM_V_GEN)if test -d "$(srcdir)/.git"; then \ | |
26 | ( echo '# Generated by Makefile. Do not edit.'; echo; \ | |
27 | GIT_DIR="$(top_srcdir)/.git" ./missing --run \ | |
28 | git log $(CHANGELOG_GIT_RANGE) --no-color -M -C --name-status ) \ | |
29 | > ChangeLog.tmp \ | |
30 | && mv -f ChangeLog.tmp $(distdir)/ChangeLog \ | |
31 | || ( rm -f ChangeLog.tmp ; echo Failed to generate ChangeLog >&2 ); \ | |
32 | else \ | |
33 | echo A git checkout is required to generate ChangeLog >&2; \ | |
34 | fi | |
35 | ||
36 | GITIGNOREFILES = $(PACKAGE)-\*.tar.{gz,bz2,xz} | |
37 | -include $(top_srcdir)/git.mk |
0 | This project gathers the components which are common to multiple desktop environments and required to implement cross-DE solutions. | |
1 | ||
2 | # xapp-common | |
3 | ||
4 | A set of resources and tools. | |
5 | ||
6 | # libxapp | |
7 | ||
8 | A library available in C, Python and other languages (via Gobject Introspection). | |
9 | ||
10 | # Scope | |
11 | ||
12 | In the long term Xapps are there to provide applications to users in multiple DEs, but also to provide building blocks, resources and libraries to Linux developers who want to develop applications which work well in multiple DEs. | |
13 | ||
14 | This project is still relatively new though and we can't yet commit to a stable ABI. | |
15 | ||
16 | You are welcome to use libxapp or xapps-common in your application, but if you do, please make sure to tell us, so that we can communicate with you going forward about any potential changes. | |
17 | ||
18 | ## XAppMonitorBlanker | |
19 | ||
20 | XAppMonitorBlanker is used to blank other monitors. It takes a window as an argument and blanks all the monitors but the one where the window is located. | |
21 | ||
22 | This is particularly useful in multi-monitor situations, for presentations, full screen media playback etc.. | |
23 | ||
24 | `XAppMonitorBlanker *xapp_monitor_blanker_new (void);` | |
25 | ||
26 | `void xapp_monitor_blanker_blank_other_monitors (XAppMonitorBlanker *self, GtkWindow *window);` | |
27 | ||
28 | `void xapp_monitor_blanker_unblank_monitors (XAppMonitorBlanker *self);` | |
29 | ||
30 | `gboolean xapp_monitor_blanker_are_monitors_blanked (XAppMonitorBlanker *self);` | |
31 | ||
32 | This is used by: | |
33 | ||
34 | - xplayer | |
35 | ||
36 | ## XAppKbdLayoutController | |
37 | ||
38 | XAppKbdLayoutController is used to get a keyboard layout code or flag for a given locale. | |
39 | ||
40 | `XAppKbdLayoutController *xapp_kbd_layout_controller_new (void);` | |
41 | ||
42 | `gboolean xapp_kbd_layout_controller_get_enabled (XAppKbdLayoutController *controller);` | |
43 | ||
44 | `guint xapp_kbd_layout_controller_get_current_group (XAppKbdLayoutController *controller);` | |
45 | ||
46 | `void xapp_kbd_layout_controller_set_current_group (XAppKbdLayoutController *controller, guint group);` | |
47 | ||
48 | `void xapp_kbd_layout_controller_next_group (XAppKbdLayoutController *controller);` | |
49 | ||
50 | `void xapp_kbd_layout_controller_previous_group (XAppKbdLayoutController *controller);` | |
51 | ||
52 | `gchar *xapp_kbd_layout_controller_get_current_name (XAppKbdLayoutController *controller);` | |
53 | ||
54 | `gchar **xapp_kbd_layout_controller_get_all_names (XAppKbdLayoutController *controller);` | |
55 | ||
56 | `gchar *xapp_kbd_layout_controller_get_current_icon_name (XAppKbdLayoutController *controller);` | |
57 | ||
58 | `gchar *xapp_kbd_layout_controller_get_icon_name_for_group (XAppKbdLayoutController *controller, guint group);` | |
59 | ||
60 | `gchar *xapp_kbd_layout_controller_get_short_name (XAppKbdLayoutController *controller);` | |
61 | ||
62 | `gchar *xapp_kbd_layout_controller_get_short_name_for_group (XAppKbdLayoutController *controller, guint group);` | |
63 | ||
64 | This is used by: | |
65 | ||
66 | - cinnamon-screensaver | |
67 | - cinnamon keyboard applet |
0 | # Configure paths for ESD | |
1 | # Manish Singh 98-9-30 | |
2 | # stolen back from Frank Belew | |
3 | # stolen from Manish Singh | |
4 | # Shamelessly stolen from Owen Taylor | |
5 | ||
6 | dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
7 | dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS | |
8 | dnl | |
9 | AC_DEFUN([AM_PATH_ESD], | |
10 | [dnl | |
11 | dnl Get the cflags and libraries from the esd-config script | |
12 | dnl | |
13 | AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], | |
14 | esd_prefix="$withval", esd_prefix="") | |
15 | AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], | |
16 | esd_exec_prefix="$withval", esd_exec_prefix="") | |
17 | AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], | |
18 | , enable_esdtest=yes) | |
19 | ||
20 | if test x$esd_exec_prefix != x ; then | |
21 | esd_args="$esd_args --exec-prefix=$esd_exec_prefix" | |
22 | if test x${ESD_CONFIG+set} != xset ; then | |
23 | ESD_CONFIG=$esd_exec_prefix/bin/esd-config | |
24 | fi | |
25 | fi | |
26 | if test x$esd_prefix != x ; then | |
27 | esd_args="$esd_args --prefix=$esd_prefix" | |
28 | if test x${ESD_CONFIG+set} != xset ; then | |
29 | ESD_CONFIG=$esd_prefix/bin/esd-config | |
30 | fi | |
31 | fi | |
32 | ||
33 | AC_PATH_PROG(ESD_CONFIG, esd-config, no) | |
34 | min_esd_version=ifelse([$1], ,0.2.5,$1) | |
35 | AC_MSG_CHECKING(for ESD - version >= $min_esd_version) | |
36 | no_esd="" | |
37 | if test "$ESD_CONFIG" = "no" ; then | |
38 | no_esd=yes | |
39 | else | |
40 | ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` | |
41 | ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` | |
42 | ||
43 | esd_major_version=`$ESD_CONFIG $esd_args --version | \ | |
44 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
45 | esd_minor_version=`$ESD_CONFIG $esd_args --version | \ | |
46 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
47 | esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ | |
48 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
49 | if test "x$enable_esdtest" = "xyes" ; then | |
50 | ac_save_CFLAGS="$CFLAGS" | |
51 | ac_save_LIBS="$LIBS" | |
52 | CFLAGS="$CFLAGS $ESD_CFLAGS" | |
53 | LIBS="$LIBS $ESD_LIBS" | |
54 | dnl | |
55 | dnl Now check if the installed ESD is sufficiently new. (Also sanity | |
56 | dnl checks the results of esd-config to some extent | |
57 | dnl | |
58 | rm -f conf.esdtest | |
59 | AC_TRY_RUN([ | |
60 | #include <stdio.h> | |
61 | #include <stdlib.h> | |
62 | #include <string.h> | |
63 | #include <esd.h> | |
64 | ||
65 | char* | |
66 | my_strdup (char *str) | |
67 | { | |
68 | char *new_str; | |
69 | ||
70 | if (str) | |
71 | { | |
72 | new_str = malloc ((strlen (str) + 1) * sizeof(char)); | |
73 | strcpy (new_str, str); | |
74 | } | |
75 | else | |
76 | new_str = NULL; | |
77 | ||
78 | return new_str; | |
79 | } | |
80 | ||
81 | int main () | |
82 | { | |
83 | int major, minor, micro; | |
84 | char *tmp_version; | |
85 | ||
86 | system ("touch conf.esdtest"); | |
87 | ||
88 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
89 | tmp_version = my_strdup("$min_esd_version"); | |
90 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
91 | printf("%s, bad version string\n", "$min_esd_version"); | |
92 | exit(1); | |
93 | } | |
94 | ||
95 | if (($esd_major_version > major) || | |
96 | (($esd_major_version == major) && ($esd_minor_version > minor)) || | |
97 | (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) | |
98 | { | |
99 | return 0; | |
100 | } | |
101 | else | |
102 | { | |
103 | printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); | |
104 | printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); | |
105 | printf("*** best to upgrade to the required version.\n"); | |
106 | printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); | |
107 | printf("*** to point to the correct copy of esd-config, and remove the file\n"); | |
108 | printf("*** config.cache before re-running configure\n"); | |
109 | return 1; | |
110 | } | |
111 | } | |
112 | ||
113 | ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
114 | CFLAGS="$ac_save_CFLAGS" | |
115 | LIBS="$ac_save_LIBS" | |
116 | fi | |
117 | fi | |
118 | if test "x$no_esd" = x ; then | |
119 | AC_MSG_RESULT(yes) | |
120 | ifelse([$2], , :, [$2]) | |
121 | else | |
122 | AC_MSG_RESULT(no) | |
123 | if test "$ESD_CONFIG" = "no" ; then | |
124 | echo "*** The esd-config script installed by ESD could not be found" | |
125 | echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" | |
126 | echo "*** your path, or set the ESD_CONFIG environment variable to the" | |
127 | echo "*** full path to esd-config." | |
128 | else | |
129 | if test -f conf.esdtest ; then | |
130 | : | |
131 | else | |
132 | echo "*** Could not run ESD test program, checking why..." | |
133 | CFLAGS="$CFLAGS $ESD_CFLAGS" | |
134 | LIBS="$LIBS $ESD_LIBS" | |
135 | AC_TRY_LINK([ | |
136 | #include <stdio.h> | |
137 | #include <esd.h> | |
138 | ], [ return 0; ], | |
139 | [ echo "*** The test program compiled, but did not run. This usually means" | |
140 | echo "*** that the run-time linker is not finding ESD or finding the wrong" | |
141 | echo "*** version of ESD. If it is not finding ESD, you'll need to set your" | |
142 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
143 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
144 | echo "*** is required on your system" | |
145 | echo "***" | |
146 | echo "*** If you have an old version installed, it is best to remove it, although" | |
147 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
148 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
149 | echo "*** exact error that occured. This usually means ESD was incorrectly installed" | |
150 | echo "*** or that you have moved ESD since it was installed. In the latter case, you" | |
151 | echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) | |
152 | CFLAGS="$ac_save_CFLAGS" | |
153 | LIBS="$ac_save_LIBS" | |
154 | fi | |
155 | fi | |
156 | ESD_CFLAGS="" | |
157 | ESD_LIBS="" | |
158 | ifelse([$3], , :, [$3]) | |
159 | fi | |
160 | AC_SUBST(ESD_CFLAGS) | |
161 | AC_SUBST(ESD_LIBS) | |
162 | rm -f conf.esdtest | |
163 | ]) |
0 | #!/bin/sh | |
1 | ||
2 | srcdir=`dirname $0` | |
3 | test -z "$srcdir" && srcdir=. | |
4 | ||
5 | which gnome-autogen.sh || { | |
6 | echo "You need to install gnome-common from GNOME Git (or from" | |
7 | echo "your OS vendor's package manager)." | |
8 | exit 1 | |
9 | } | |
10 | . gnome-autogen.sh |
0 | ||
1 | AC_INIT(xapp, 1.0.2) | |
2 | AC_CONFIG_SRCDIR(libxapp) | |
3 | ||
4 | AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz tar-ustar]) | |
5 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
6 | ||
7 | AC_CONFIG_HEADERS([config.h]) | |
8 | ||
9 | AC_CONFIG_MACRO_DIR([m4]) | |
10 | ||
11 | # Before making a release, the LT_VERSION string should be modified. | |
12 | # The string is of the form C:R:A. | |
13 | # - If interfaces have been changed or added, but binary compatibility has | |
14 | # been preserved, change to C+1:0:A+1 | |
15 | # - If binary compatibility has been broken (eg removed or changed interfaces) | |
16 | # change to C+1:0:0 | |
17 | # - If the interface is the same as the previous version, change to C:R+1:A | |
18 | ||
19 | LT_VERSION=1:0:0 | |
20 | AC_SUBST(LT_VERSION) | |
21 | ||
22 | LT_PREREQ([2.2.6]) | |
23 | LT_INIT([dlopen win32-dll disable-static]) | |
24 | ||
25 | IT_PROG_INTLTOOL([0.40.6]) | |
26 | ||
27 | AC_PROG_CC | |
28 | PKG_PROG_PKG_CONFIG | |
29 | ||
30 | GNOME_COMPILE_WARNINGS([maximum]) | |
31 | GNOME_MAINTAINER_MODE_DEFINES | |
32 | ||
33 | AC_ARG_ENABLE(deprecation_flags, | |
34 | [AC_HELP_STRING([--enable-deprecation-flags], | |
35 | [use *_DISABLE_DEPRECATED flags @<:@default=no@:>@])],, | |
36 | [enable_deprecation_flags=no]) | |
37 | ||
38 | if test "x$enable_deprecation_flags" = "xyes"; then | |
39 | DISABLE_DEPRECATED_CFLAGS=$DISABLE_DEPRECATED | |
40 | AC_SUBST(DISABLE_DEPRECATED_CFLAGS) | |
41 | fi | |
42 | ||
43 | dnl If you add a version number here, you *must* add an AC_SUBST line for | |
44 | dnl it too, or it will never make it into the spec file! | |
45 | ||
46 | GDK_PIXBUF_REQUIRED=2.22.0 | |
47 | GTK_REQUIRED=3.3.16 | |
48 | GLIB_REQUIRED=2.37.3 | |
49 | ||
50 | AC_SUBST(GTK_REQUIRED) | |
51 | AC_SUBST(GLIB_REQUIRED) | |
52 | AC_SUBST(GDK_PIXBUF_REQUIRED) | |
53 | ||
54 | PKG_CHECK_MODULES(XLIB, x11, | |
55 | X11_PACKAGE=x11, | |
56 | [X11_PACKAGE= | |
57 | AC_PATH_XTRA | |
58 | if test "x$no_x" = xyes; then | |
59 | AC_MSG_ERROR("no (requires X development libraries)") | |
60 | else | |
61 | XLIB_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" | |
62 | XLIB_CFLAGS=$X_CFLAGS | |
63 | fi]) | |
64 | AC_SUBST(X11_PACKAGE) | |
65 | AC_SUBST(XLIB_CFLAGS) | |
66 | AC_SUBST(XLIB_LIBS) | |
67 | ||
68 | dnl pkg-config dependency checks | |
69 | ||
70 | PKG_CHECK_MODULES(XAPP, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED | |
71 | gtk+-3.0 >= $GTK_REQUIRED | |
72 | glib-2.0 >= $GLIB_REQUIRED | |
73 | gio-2.0 >= $GLIB_REQUIRED | |
74 | cairo | |
75 | libgnomekbdui) | |
76 | ||
77 | dnl Language Support | |
78 | ||
79 | GETTEXT_PACKAGE=xapp | |
80 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", | |
81 | [The gettext translation domain]) | |
82 | AC_SUBST(GETTEXT_PACKAGE) | |
83 | ||
84 | AM_GLIB_GNU_GETTEXT | |
85 | ||
86 | GLIB_GSETTINGS | |
87 | ||
88 | GOBJECT_INTROSPECTION_CHECK([0.9.7]) | |
89 | ||
90 | AC_CONFIG_FILES([ | |
91 | Makefile | |
92 | libxapp/Makefile | |
93 | libxapp/xapp.pc | |
94 | libxapp/xapp-uninstalled.pc | |
95 | schemas/Makefile | |
96 | po/Makefile.in | |
97 | files/Makefile | |
98 | ]) | |
99 | ||
100 | AC_OUTPUT | |
101 | ||
102 | dnl --------------------------------------------------------------------------- | |
103 | dnl - Show summary | |
104 | dnl --------------------------------------------------------------------------- | |
105 | ||
106 | echo " | |
107 | ||
108 | prefix: ${prefix} | |
109 | exec_prefix: ${exec_prefix} | |
110 | libdir: ${libdir} | |
111 | bindir: ${bindir} | |
112 | sbindir: ${sbindir} | |
113 | sysconfdir: ${sysconfdir} | |
114 | localstatedir: ${localstatedir} | |
115 | datadir: ${datadir} | |
116 | source code location: ${srcdir} | |
117 | compiler: ${CC} | |
118 | cflags: ${CFLAGS} | |
119 | Maintainer mode: ${USE_MAINTAINER_MODE} | |
120 | Use *_DISABLE_DEPRECATED: ${enable_deprecation_flags} | |
121 | ||
122 | " |
0 | install-data-hook: | |
1 | find -mindepth 1 -maxdepth 1 -type d -exec cp -R {} $(DESTDIR)/ \; | |
2 | ||
3 | uninstall-hook: | |
4 | find -mindepth 1 -type f -exec rm $(DESTDIR)/{} \; |
0 | #!/usr/bin/python3 | |
1 | ||
2 | import sys | |
3 | import os | |
4 | import stat | |
5 | import subprocess | |
6 | ||
7 | content = "" | |
8 | ||
9 | mode = os.fstat(0).st_mode | |
10 | if stat.S_ISFIFO(mode): | |
11 | content = sys.stdin.read() | |
12 | elif stat.S_ISREG(mode): | |
13 | content = sys.stdin.read() | |
14 | else: | |
15 | args = sys.argv[1:] | |
16 | if len(args) == 1 and os.path.exists(args[0]): | |
17 | with open(args[0], 'r') as infile: | |
18 | content = infile.read() | |
19 | else: | |
20 | str_args = ' '.join(args) | |
21 | content = str_args | |
22 | ||
23 | if content != "": | |
24 | for paster in ['/usr/bin/gist-paste', '/usr/bin/fpaste']: | |
25 | if os.path.exists(paster): | |
26 | p = subprocess.Popen([paster], stdin=subprocess.PIPE) | |
27 | p.communicate(content.encode("UTF-8")) |
0 | #!/usr/bin/python3 | |
1 | ||
2 | import subprocess, os | |
3 | ||
4 | inxi = subprocess.Popen(['inxi', '-Fxxrzc0'], stdout=subprocess.PIPE) | |
5 | pastebin = subprocess.Popen(['/usr/bin/pastebin'], stdin=inxi.stdout, stdout=subprocess.PIPE) | |
6 | inxi.stdout.close() | |
7 | output = pastebin.communicate()[0] | |
8 | output = output.split()[0] # if we have more than one URL, only use the first one | |
9 | pastebin.wait() | |
10 | subprocess.call(['xdg-open', output]) |
0 | #!/bin/bash | |
1 | ||
2 | # Author: Weitian Leung <weitianleung@gmail.com> | |
3 | # Version: 2.0 | |
4 | # License: GPL-3.0 | |
5 | # Description: set a picture as xfce4 wallpaper | |
6 | ||
7 | wallpaper=$1 | |
8 | ||
9 | # check image | |
10 | mime_type=`file --mime-type -b "$wallpaper"` | |
11 | if [[ ! "$mime_type" == image/* ]]; then | |
12 | echo "Invalid image" | |
13 | exit 1 | |
14 | fi | |
15 | ||
16 | # set to every monitor that contains image-path/last-image | |
17 | properties=$(xfconf-query -c xfce4-desktop -p /backdrop -l | grep -e "screen.*/monitor.*image-path$" -e "screen.*/monitor.*/last-image$") | |
18 | ||
19 | for property in $properties; do | |
20 | xfconf-query -c xfce4-desktop -p $property -s "$wallpaper" | |
21 | done | |
22 | ||
23 | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | ||
29 | ||
30 | ||
31 |
+99
-0
0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
1 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | |
2 | ||
3 | <svg | |
4 | xmlns:dc="http://purl.org/dc/elements/1.1/" | |
5 | xmlns:cc="http://creativecommons.org/ns#" | |
6 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
7 | xmlns:svg="http://www.w3.org/2000/svg" | |
8 | xmlns="http://www.w3.org/2000/svg" | |
9 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
10 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
11 | id="svg7384" | |
12 | height="16" | |
13 | width="16" | |
14 | version="1.1" | |
15 | inkscape:version="0.91 r13725" | |
16 | sodipodi:docname="xapp-search-entire-word-symbolic.svg"> | |
17 | <defs | |
18 | id="defs7667" /> | |
19 | <sodipodi:namedview | |
20 | pagecolor="#ffffff" | |
21 | bordercolor="#666666" | |
22 | borderopacity="1" | |
23 | objecttolerance="10" | |
24 | gridtolerance="10" | |
25 | guidetolerance="10" | |
26 | inkscape:pageopacity="0" | |
27 | inkscape:pageshadow="2" | |
28 | inkscape:window-width="1479" | |
29 | inkscape:window-height="852" | |
30 | id="namedview7665" | |
31 | showgrid="true" | |
32 | inkscape:zoom="22.627417" | |
33 | inkscape:cx="11.198507" | |
34 | inkscape:cy="11.756873" | |
35 | inkscape:window-x="2265" | |
36 | inkscape:window-y="90" | |
37 | inkscape:window-maximized="0" | |
38 | inkscape:current-layer="g4147" | |
39 | inkscape:snap-bbox="true" | |
40 | inkscape:bbox-paths="true" | |
41 | inkscape:snap-bbox-midpoints="true" | |
42 | inkscape:snap-bbox-edge-midpoints="true" | |
43 | inkscape:bbox-nodes="true" | |
44 | inkscape:snap-intersection-paths="true" | |
45 | inkscape:object-nodes="true"> | |
46 | <inkscape:grid | |
47 | type="xygrid" | |
48 | id="grid4148" /> | |
49 | </sodipodi:namedview> | |
50 | <metadata | |
51 | id="metadata90"> | |
52 | <rdf:RDF> | |
53 | <cc:Work | |
54 | rdf:about=""> | |
55 | <dc:format>image/svg+xml</dc:format> | |
56 | <dc:type | |
57 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
58 | <dc:title>Gnome Symbolic Icon Theme</dc:title> | |
59 | </cc:Work> | |
60 | </rdf:RDF> | |
61 | </metadata> | |
62 | <title | |
63 | id="title9167">Gnome Symbolic Icon Theme</title> | |
64 | <g | |
65 | id="g4147" | |
66 | style="fill:#bebebe;fill-opacity:1;stroke:none" | |
67 | transform="matrix(1.3889016,0,0,1.3889016,-3.0103731,-3.5159478)"> | |
68 | <g | |
69 | transform="scale(1.1627898,0.86000064)" | |
70 | style="font-style:normal;font-weight:normal;font-size:23.34823418px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | |
71 | id="text4138-6"> | |
72 | <path | |
73 | d="m 9.9135395,5.4551583 1.8575845,-2e-7 0,2.8410321 c 0,2.0390788 -0.631802,3.0193748 -1.8575845,3.0193748 l 3e-7,-0.837201 c 0.3385492,-0.03113 0.5778682,-0.2446 0.7179572,-0.5403447 0.14009,-0.2957443 0.210134,-0.8405365 0.210134,-1.6343764 l -0.0051,-0.3370195 -0.9229612,0 z" | |
74 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:FreeSans;-inkscape-font-specification:FreeSans;fill:#bebebe;fill-opacity:1;stroke:none" | |
75 | id="path4157" | |
76 | inkscape:connector-curvature="0" | |
77 | sodipodi:nodetypes="ccsccssccc" /> | |
78 | <path | |
79 | sodipodi:nodetypes="ccsccssccc" | |
80 | inkscape:connector-curvature="0" | |
81 | id="path4159" | |
82 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:FreeSans;-inkscape-font-specification:FreeSans;fill:#bebebe;fill-opacity:1;stroke:none" | |
83 | d="m 7.4367607,5.4551581 1.8575849,-2e-7 0,2.8410321 c 0,2.039079 -0.631802,3.019375 -1.8575849,3.019375 l 3e-7,-0.837201 c 0.3385493,-0.03113 0.5778685,-0.2446 0.7179576,-0.5403449 0.14009,-0.2957443 0.210134,-0.8405365 0.210134,-1.6343764 l -0.0051,-0.3370195 -0.9229616,0 z" /> | |
84 | <path | |
85 | d="m 6.1983412,11.315703 -1.8575849,0 0,-2.8410321 c 0,-2.039079 0.631802,-3.019375 1.8575849,-3.019375 l -3e-7,0.837201 c -0.3385493,0.03113 -0.5778685,0.2446 -0.7179576,0.5403449 -0.14009,0.2957443 -0.210134,0.8405365 -0.210134,1.6343764 l 0.0051,0.3370195 0.9229616,0 z" | |
86 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:FreeSans;-inkscape-font-specification:FreeSans;fill:#bebebe;fill-opacity:1;stroke:none" | |
87 | id="path4161" | |
88 | inkscape:connector-curvature="0" | |
89 | sodipodi:nodetypes="ccsccssccc" /> | |
90 | <path | |
91 | sodipodi:nodetypes="ccsccssccc" | |
92 | inkscape:connector-curvature="0" | |
93 | id="path4163" | |
94 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:FreeSans;-inkscape-font-specification:FreeSans;fill:#bebebe;fill-opacity:1;stroke:none" | |
95 | d="m 3.7215923,11.315565 -1.8575849,0 0,-2.8410319 c 0,-2.039079 0.631802,-3.019375 1.8575849,-3.019375 l -3e-7,0.837201 c -0.3385493,0.03113 -0.5778685,0.2446 -0.7179576,0.5403449 -0.14009,0.2957443 -0.210134,0.8405365 -0.210134,1.6343764 l 0.0051,0.3370195 0.9229616,0 z" /> | |
96 | </g> | |
97 | </g> | |
98 | </svg> |
0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
1 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | |
2 | ||
3 | <svg | |
4 | xmlns:dc="http://purl.org/dc/elements/1.1/" | |
5 | xmlns:cc="http://creativecommons.org/ns#" | |
6 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
7 | xmlns:svg="http://www.w3.org/2000/svg" | |
8 | xmlns="http://www.w3.org/2000/svg" | |
9 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
10 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
11 | id="svg7384" | |
12 | height="16" | |
13 | width="16" | |
14 | version="1.1" | |
15 | inkscape:version="0.91 r13725" | |
16 | sodipodi:docname="xapp-search-wrap-symbolic.svg"> | |
17 | <defs | |
18 | id="defs9" /> | |
19 | <sodipodi:namedview | |
20 | pagecolor="#ffffff" | |
21 | bordercolor="#666666" | |
22 | borderopacity="1" | |
23 | objecttolerance="10" | |
24 | gridtolerance="10" | |
25 | guidetolerance="10" | |
26 | inkscape:pageopacity="0" | |
27 | inkscape:pageshadow="2" | |
28 | inkscape:window-width="1236" | |
29 | inkscape:window-height="795" | |
30 | id="namedview7" | |
31 | showgrid="true" | |
32 | inkscape:snap-bbox="true" | |
33 | inkscape:bbox-paths="true" | |
34 | inkscape:bbox-nodes="true" | |
35 | inkscape:snap-bbox-edge-midpoints="true" | |
36 | inkscape:snap-bbox-midpoints="true" | |
37 | inkscape:object-paths="true" | |
38 | inkscape:snap-intersection-paths="true" | |
39 | inkscape:object-nodes="true" | |
40 | inkscape:snap-smooth-nodes="true" | |
41 | inkscape:zoom="41.7193" | |
42 | inkscape:cx="10.555301" | |
43 | inkscape:cy="7.666891" | |
44 | inkscape:window-x="583" | |
45 | inkscape:window-y="99" | |
46 | inkscape:window-maximized="0" | |
47 | inkscape:current-layer="svg7384"> | |
48 | <inkscape:grid | |
49 | type="xygrid" | |
50 | id="grid4137" /> | |
51 | </sodipodi:namedview> | |
52 | <metadata | |
53 | id="metadata90"> | |
54 | <rdf:RDF> | |
55 | <cc:Work | |
56 | rdf:about=""> | |
57 | <dc:format>image/svg+xml</dc:format> | |
58 | <dc:type | |
59 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
60 | <dc:title>Gnome Symbolic Icon Theme</dc:title> | |
61 | </cc:Work> | |
62 | </rdf:RDF> | |
63 | </metadata> | |
64 | <title | |
65 | id="title9167">Gnome Symbolic Icon Theme</title> | |
66 | <path | |
67 | style="opacity:1;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | |
68 | d="M 2,1 C 1.446,1 1,1.446 1,2 l 0,12 c 0,0.554 0.446,1 1,1 l 11,0 c 0.554,0 0.82481,-0.474429 1,-1 l 0,-3 -2,0 0,1 c 0,0.554 -0.446,1 -1,1 L 4,13 C 3.446,13 3,12.554 3,12 L 3,4 C 3,3.446 3.446,3 4,3 l 7,0 c 0.554,0 1,0.4726696 1,1 l 0,1 -2,0 0,1 3,3 3,-3 0,-1 -2,0 0,-3 C 14,1.446 13.554,1 13,1 Z" | |
69 | id="rect4144" | |
70 | inkscape:connector-curvature="0" | |
71 | sodipodi:nodetypes="ssssscccsssssssscccccccsss" /> | |
72 | </svg> |
0 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
1 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | |
2 | ||
3 | <svg | |
4 | xmlns:dc="http://purl.org/dc/elements/1.1/" | |
5 | xmlns:cc="http://creativecommons.org/ns#" | |
6 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
7 | xmlns:svg="http://www.w3.org/2000/svg" | |
8 | xmlns="http://www.w3.org/2000/svg" | |
9 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
10 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
11 | id="svg7384" | |
12 | height="16" | |
13 | width="16" | |
14 | version="1.1" | |
15 | inkscape:version="0.91 r13725" | |
16 | sodipodi:docname="xapp-text-case-symbolic.svg"> | |
17 | <defs | |
18 | id="defs7667" /> | |
19 | <sodipodi:namedview | |
20 | pagecolor="#ffffff" | |
21 | bordercolor="#666666" | |
22 | borderopacity="1" | |
23 | objecttolerance="10" | |
24 | gridtolerance="10" | |
25 | guidetolerance="10" | |
26 | inkscape:pageopacity="0" | |
27 | inkscape:pageshadow="2" | |
28 | inkscape:window-width="1560" | |
29 | inkscape:window-height="849" | |
30 | id="namedview7665" | |
31 | showgrid="true" | |
32 | inkscape:zoom="32" | |
33 | inkscape:cx="1.8642481" | |
34 | inkscape:cy="7.8505367" | |
35 | inkscape:window-x="2231" | |
36 | inkscape:window-y="204" | |
37 | inkscape:window-maximized="0" | |
38 | inkscape:current-layer="g4147" | |
39 | inkscape:snap-bbox="true" | |
40 | inkscape:bbox-paths="true" | |
41 | inkscape:snap-bbox-edge-midpoints="true" | |
42 | inkscape:bbox-nodes="true" | |
43 | inkscape:snap-bbox-midpoints="true"> | |
44 | <inkscape:grid | |
45 | type="xygrid" | |
46 | id="grid4138" /> | |
47 | </sodipodi:namedview> | |
48 | <metadata | |
49 | id="metadata90"> | |
50 | <rdf:RDF> | |
51 | <cc:Work | |
52 | rdf:about=""> | |
53 | <dc:format>image/svg+xml</dc:format> | |
54 | <dc:type | |
55 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
56 | <dc:title>Gnome Symbolic Icon Theme</dc:title> | |
57 | </cc:Work> | |
58 | </rdf:RDF> | |
59 | </metadata> | |
60 | <title | |
61 | id="title9167">Gnome Symbolic Icon Theme</title> | |
62 | <g | |
63 | id="g4147" | |
64 | style="fill:#bebebe;fill-opacity:1;stroke:none" | |
65 | transform="matrix(1.3889016,0,0,1.3889016,-3.0103731,-3.5159478)"> | |
66 | <g | |
67 | transform="matrix(0.83484587,0,0,1.0714235,1.697848,-0.28559499)" | |
68 | style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:11.25px;line-height:125%;font-family:'Noto Sans UI';-inkscape-font-specification:'Noto Sans UI, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | |
69 | id="flowRoot4140"> | |
70 | <path | |
71 | d="m 6.489624,12.037222 -0.5822754,-1.911621 -2.9278564,0 -0.5822754,1.911621 -1.8347168,0 2.8344727,-8.0639647 2.0819091,0 2.845459,8.0639647 -1.8347168,0 z M 5.5008545,8.6973784 Q 4.6933594,6.0991118 4.5889893,5.7585356 4.4901123,5.4179594 4.446167,5.2202055 4.2648926,5.9233305 3.407959,8.6973784 l 2.0928955,0 z" | |
72 | id="path4160" | |
73 | inkscape:connector-curvature="0" /> | |
74 | </g> | |
75 | <g | |
76 | transform="matrix(1.0955533,0,0,1.2543973,-0.50361273,-1.4227521)" | |
77 | style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.09992599px;line-height:125%;font-family:'Noto Sans UI';-inkscape-font-specification:'Noto Sans UI, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | |
78 | id="flowRoot4148"> | |
79 | <path | |
80 | d="m 12.110808,11.108837 -0.233347,-0.601167 -0.03164,0 q -0.304539,0.383639 -0.628852,0.533931 -0.320358,0.146337 -0.838469,0.146337 -0.6367617,0 -1.0045807,-0.363864 -0.3638638,-0.363864 -0.3638638,-1.0362213 0,-0.7039975 0.4904252,-1.036221 0.4943802,-0.3361786 1.4870953,-0.371774 l 0.767279,-0.02373 0,-0.1937971 q 0,-0.6723571 -0.688178,-0.6723571 -0.529975,0 -1.2458379,0.3203584 L 9.4213799,6.995593 q 0.7633231,-0.3994592 1.6927581,-0.3994592 0.889884,0 1.364489,0.3875941 0.474605,0.3875941 0.474605,1.1786025 l 0,2.9465066 -0.842424,0 z m -0.355953,-2.0487121 -0.466695,0.01582 q -0.526021,0.01582 -0.783099,0.189842 -0.257077,0.1740219 -0.257077,0.5299757 0,0.5102004 0.585346,0.5102004 0.419234,0 0.668402,-0.241257 0.253123,-0.2412581 0.253123,-0.6407174 l 0,-0.3638639 z" | |
81 | id="path4157" | |
82 | inkscape:connector-curvature="0" /> | |
83 | </g> | |
84 | </g> | |
85 | </svg> |
0 | CLEANFILES = | |
1 | ||
2 | noinst_LTLIBRARIES = | |
3 | lib_LTLIBRARIES = libxapp.la | |
4 | ||
5 | AM_CPPFLAGS = \ | |
6 | -I$(top_srcdir) \ | |
7 | $(XAPP_CFLAGS) \ | |
8 | $(XLIB_CFLAGS) \ | |
9 | -DG_LOG_DOMAIN=\"XApp\" \ | |
10 | -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale\"" \ | |
11 | $(DISABLE_DEPRECATED_CFLAGS) | |
12 | ||
13 | AM_CFLAGS = $(WARN_CFLAGS) | |
14 | ||
15 | introspection_sources = \ | |
16 | xapp-monitor-blanker.c \ | |
17 | xapp-kbd-layout-controller.c | |
18 | ||
19 | libxapp_la_SOURCES = \ | |
20 | $(introspection_sources) | |
21 | ||
22 | libxapp_la_LIBADD = \ | |
23 | $(XLIB_LIBS) \ | |
24 | $(XAPP_LIBS) \ | |
25 | -lrt | |
26 | ||
27 | libxapp_la_LDFLAGS = \ | |
28 | -version-info $(LT_VERSION) \ | |
29 | -export-symbols-regex "^xapp_.*" \ | |
30 | -no-undefined | |
31 | ||
32 | pkgconfigdir = $(libdir)/pkgconfig | |
33 | pkgconfig_DATA = xapp.pc | |
34 | ||
35 | libxappdir = $(includedir)/xapp/libxapp | |
36 | libxapp_HEADERS = \ | |
37 | xapp-monitor-blanker.h \ | |
38 | xapp-kbd-layout-controller.h | |
39 | ||
40 | -include $(INTROSPECTION_MAKEFILE) | |
41 | INTROSPECTION_GIRS = | |
42 | INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all | |
43 | INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) | |
44 | ||
45 | if HAVE_INTROSPECTION | |
46 | ||
47 | XApp-1.0.gir: libxapp.la | |
48 | XApp_1_0_gir_INCLUDES = GObject-2.0 Gtk-3.0 | |
49 | XApp_1_0_gir_PACKAGES = gdk-pixbuf-2.0 glib-2.0 gobject-2.0 gio-2.0 gtk+-3.0 | |
50 | XApp_1_0_gir_EXPORT_PACKAGES = xapp | |
51 | XApp_1_0_gir_CFLAGS = -I$(top_srcdir) -DWITH_INTROSPECTION | |
52 | XApp_1_0_gir_LIBS = libxapp.la | |
53 | XApp_1_0_gir_FILES = $(introspection_sources) $(libxapp_HEADERS) | |
54 | XApp_1_0_gir_SCANNERFLAGS = --identifier-prefix=XApp --symbol-prefix=xapp_ | |
55 | INTROSPECTION_GIRS += XApp-1.0.gir | |
56 | ||
57 | girdir = $(datadir)/gir-1.0 | |
58 | gir_DATA = $(INTROSPECTION_GIRS) | |
59 | ||
60 | typelibdir = $(libdir)/girepository-1.0 | |
61 | typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) | |
62 | ||
63 | CLEANFILES += $(gir_DATA) $(typelib_DATA) | |
64 | endif | |
65 | ||
66 | EXTRA_DIST = \ | |
67 | xapp.pc.in \ | |
68 | xapp-uninstalled.pc.in \ | |
69 | $(pnpdata_DATA_dist) | |
70 | ||
71 | -include $(top_srcdir)/git.mk |
0 | ||
1 | #include <config.h> | |
2 | ||
3 | #include <stdio.h> | |
4 | #include <stdlib.h> | |
5 | #include <string.h> | |
6 | #include <math.h> | |
7 | ||
8 | #include <glib/gstdio.h> | |
9 | #include <gdk/gdk.h> | |
10 | #include <gtk/gtk.h> | |
11 | ||
12 | #include <libgnomekbd/gkbd-configuration.h> | |
13 | ||
14 | #include "xapp-kbd-layout-controller.h" | |
15 | ||
16 | enum | |
17 | { | |
18 | PROP_0, | |
19 | ||
20 | PROP_ENABLED | |
21 | }; | |
22 | ||
23 | enum | |
24 | { | |
25 | KBD_LAYOUT_CHANGED, | |
26 | KBD_CONFIG_CHANGED, | |
27 | ||
28 | LAST_SIGNAL | |
29 | }; | |
30 | ||
31 | static guint signals[LAST_SIGNAL] = { 0, }; | |
32 | ||
33 | typedef struct | |
34 | { | |
35 | gchar *group_name; | |
36 | gchar *variant_name; | |
37 | ||
38 | gchar *group_label; | |
39 | gint group_dupe_id; | |
40 | ||
41 | gchar *variant_label; | |
42 | gint variant_dupe_id; | |
43 | } GroupData; | |
44 | ||
45 | #define GROUP_DATA(ptr, idx) ((GroupData *) g_ptr_array_index (ptr, idx)) | |
46 | ||
47 | static void | |
48 | group_data_free (GroupData *data) | |
49 | { | |
50 | g_clear_pointer (&data->group_name, g_free); | |
51 | g_clear_pointer (&data->group_label, g_free); | |
52 | g_clear_pointer (&data->variant_label, g_free); | |
53 | data->group_dupe_id = 0; | |
54 | data->variant_dupe_id = 0; | |
55 | ||
56 | g_slice_free (GroupData, data); | |
57 | } | |
58 | ||
59 | struct _XAppKbdLayoutControllerPrivate | |
60 | { | |
61 | GkbdConfiguration *config; | |
62 | ||
63 | gint num_groups; | |
64 | ||
65 | GPtrArray *group_data; | |
66 | ||
67 | gulong changed_id; | |
68 | gulong group_changed_id; | |
69 | guint idle_changed_id; | |
70 | ||
71 | gboolean enabled; | |
72 | }; | |
73 | ||
74 | G_DEFINE_TYPE (XAppKbdLayoutController, xapp_kbd_layout_controller, G_TYPE_OBJECT); | |
75 | ||
76 | static void | |
77 | clear_stores (XAppKbdLayoutController *controller) | |
78 | { | |
79 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
80 | ||
81 | g_clear_pointer (&priv->group_data, g_ptr_array_unref); | |
82 | } | |
83 | ||
84 | static gchar * | |
85 | create_label (XAppKbdLayoutController *controller, | |
86 | const gchar *name, | |
87 | gint dupe_id) | |
88 | { | |
89 | if (g_utf8_validate (name, -1, NULL)) | |
90 | { | |
91 | gchar utf8[20]; | |
92 | gchar *utf8_cased = NULL; | |
93 | ||
94 | g_utf8_strncpy (utf8, name, 2); | |
95 | ||
96 | utf8_cased = g_utf8_strdown (utf8, -1); | |
97 | ||
98 | GString *string = g_string_new (utf8_cased); | |
99 | ||
100 | g_free (utf8_cased); | |
101 | ||
102 | if (dupe_id > 0) | |
103 | { | |
104 | string = g_string_append_unichar (string, 0x2080 + dupe_id); | |
105 | } | |
106 | ||
107 | return g_string_free (string, FALSE); | |
108 | } | |
109 | ||
110 | return NULL; | |
111 | } | |
112 | ||
113 | static void | |
114 | load_stores (XAppKbdLayoutController *controller) | |
115 | { | |
116 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
117 | ||
118 | gchar **group_names = gkbd_configuration_get_group_names (priv->config); | |
119 | priv->num_groups = g_strv_length (group_names); | |
120 | ||
121 | /* We do nothing if there's only one keyboard layout enabled */ | |
122 | if (priv->num_groups == 1) | |
123 | { | |
124 | priv->enabled = FALSE; | |
125 | return; | |
126 | } | |
127 | ||
128 | priv->enabled = TRUE; | |
129 | ||
130 | /* Populate the GroupData pointer array */ | |
131 | ||
132 | gint i, j, group_dupe_id, variant_dupe_id; | |
133 | GPtrArray *list = g_ptr_array_new_with_free_func ((GDestroyNotify) group_data_free); | |
134 | ||
135 | for (i = 0; i < priv->num_groups; i++) | |
136 | { | |
137 | GroupData *data = g_slice_new0 (GroupData); | |
138 | ||
139 | /* Iterate through group names, figure out subscript values for duplicates */ | |
140 | ||
141 | gchar *group_name = gkbd_configuration_get_group_name (priv->config, i); | |
142 | group_dupe_id = 0; | |
143 | ||
144 | for (j = 0; j < list->len; j++) | |
145 | { | |
146 | GroupData *iter = g_ptr_array_index (list, j); | |
147 | ||
148 | if (g_strcmp0 (group_name, iter->group_name) == 0) | |
149 | { | |
150 | group_dupe_id++; | |
151 | iter->group_dupe_id = group_dupe_id; | |
152 | } | |
153 | } | |
154 | ||
155 | if (group_dupe_id > 0) | |
156 | { | |
157 | group_dupe_id++; | |
158 | } | |
159 | ||
160 | data->group_name = group_name; | |
161 | data->group_dupe_id = group_dupe_id; | |
162 | ||
163 | /* Iterate through layout/variant names, figure out subscript values for duplicates */ | |
164 | ||
165 | gchar *variant_name = gkbd_configuration_extract_layout_name (priv->config, i); | |
166 | variant_dupe_id = 0; | |
167 | ||
168 | for (j = 0; j < list->len; j++) | |
169 | { | |
170 | GroupData *iter = g_ptr_array_index (list, j); | |
171 | ||
172 | if (g_strcmp0 (variant_name, iter->variant_name) == 0) | |
173 | { | |
174 | variant_dupe_id++; | |
175 | iter->variant_dupe_id = variant_dupe_id; | |
176 | } | |
177 | } | |
178 | ||
179 | if (variant_dupe_id > 0) | |
180 | { | |
181 | variant_dupe_id++; | |
182 | } | |
183 | ||
184 | data->variant_name = variant_name; | |
185 | data->variant_dupe_id = variant_dupe_id; | |
186 | ||
187 | /* Finally, add the GroupData slice to the array */ | |
188 | g_ptr_array_add (list, data); | |
189 | } | |
190 | ||
191 | for (i = 0; i < priv->num_groups; i++) | |
192 | { | |
193 | GroupData *data = g_ptr_array_index (list, i); | |
194 | ||
195 | /* Now generate labels for group names and for variant names. This is done | |
196 | * in its own loop after the initial run, because previous dupe ids could have | |
197 | * changed later in the loop. | |
198 | */ | |
199 | ||
200 | data->group_label = create_label (controller, data->group_name, data->group_dupe_id); | |
201 | data->variant_label = create_label (controller, data->variant_name, data->variant_dupe_id); | |
202 | } | |
203 | ||
204 | priv->group_data = list; | |
205 | } | |
206 | ||
207 | static gboolean | |
208 | idle_config_changed (XAppKbdLayoutController *controller) | |
209 | { | |
210 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
211 | ||
212 | clear_stores (controller); | |
213 | load_stores (controller); | |
214 | ||
215 | if (gkbd_configuration_get_current_group (priv->config) >= priv->num_groups) | |
216 | { | |
217 | xapp_kbd_layout_controller_set_current_group (controller, 0); | |
218 | } | |
219 | ||
220 | g_signal_emit (controller, signals[KBD_CONFIG_CHANGED], 0); | |
221 | ||
222 | priv->idle_changed_id = 0; | |
223 | return FALSE; | |
224 | } | |
225 | ||
226 | static void | |
227 | on_configuration_changed (GkbdConfiguration *config, | |
228 | XAppKbdLayoutController *controller) | |
229 | { | |
230 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
231 | ||
232 | if (priv->idle_changed_id != 0) | |
233 | { | |
234 | g_source_remove (priv->idle_changed_id); | |
235 | priv->idle_changed_id = 0; | |
236 | } | |
237 | ||
238 | priv->idle_changed_id = g_idle_add ((GSourceFunc) idle_config_changed, controller); | |
239 | } | |
240 | ||
241 | ||
242 | static void | |
243 | on_configuration_group_changed (GkbdConfiguration *config, | |
244 | gint group, | |
245 | XAppKbdLayoutController *controller) | |
246 | { | |
247 | g_signal_emit (controller, signals[KBD_LAYOUT_CHANGED], 0, (guint) group); | |
248 | } | |
249 | ||
250 | static void | |
251 | xapp_kbd_layout_controller_init (XAppKbdLayoutController *controller) | |
252 | { | |
253 | controller->priv = G_TYPE_INSTANCE_GET_PRIVATE (controller, XAPP_TYPE_KBD_LAYOUT_CONTROLLER, XAppKbdLayoutControllerPrivate); | |
254 | ||
255 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
256 | ||
257 | priv->config = gkbd_configuration_get (); | |
258 | priv->enabled = FALSE; | |
259 | priv->idle_changed_id = 0; | |
260 | ||
261 | priv->group_data = NULL; | |
262 | } | |
263 | ||
264 | static void | |
265 | xapp_kbd_layout_controller_constructed (GObject *object) | |
266 | { | |
267 | G_OBJECT_CLASS (xapp_kbd_layout_controller_parent_class)->constructed (object); | |
268 | ||
269 | XAppKbdLayoutController *controller = XAPP_KBD_LAYOUT_CONTROLLER (object); | |
270 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
271 | ||
272 | gkbd_configuration_start_listen (priv->config); | |
273 | ||
274 | priv->changed_id = g_signal_connect_object (priv->config, | |
275 | "changed", | |
276 | G_CALLBACK (on_configuration_changed), | |
277 | controller, 0); | |
278 | ||
279 | priv->group_changed_id = g_signal_connect_object (priv->config, | |
280 | "group-changed", | |
281 | G_CALLBACK (on_configuration_group_changed), | |
282 | controller, 0); | |
283 | clear_stores (controller); | |
284 | load_stores (controller); | |
285 | } | |
286 | ||
287 | static void | |
288 | xapp_kbd_layout_controller_get_property (GObject *gobject, | |
289 | guint prop_id, | |
290 | GValue *value, | |
291 | GParamSpec *pspec) | |
292 | { | |
293 | XAppKbdLayoutController *controller = XAPP_KBD_LAYOUT_CONTROLLER (gobject); | |
294 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
295 | ||
296 | switch (prop_id) | |
297 | { | |
298 | case PROP_ENABLED: | |
299 | g_value_set_boolean (value, priv->enabled); | |
300 | break; | |
301 | default: | |
302 | G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); | |
303 | break; | |
304 | } | |
305 | } | |
306 | ||
307 | static void | |
308 | xapp_kbd_layout_controller_dispose (GObject *object) | |
309 | { | |
310 | XAppKbdLayoutController *controller = XAPP_KBD_LAYOUT_CONTROLLER (object); | |
311 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
312 | ||
313 | gkbd_configuration_stop_listen (priv->config); | |
314 | ||
315 | clear_stores (controller); | |
316 | ||
317 | if (priv->changed_id > 0) | |
318 | { | |
319 | g_signal_handler_disconnect (priv->config, priv->changed_id); | |
320 | priv->changed_id = 0; | |
321 | } | |
322 | ||
323 | if (priv->group_changed_id > 0) | |
324 | { | |
325 | g_signal_handler_disconnect (priv->config, priv->group_changed_id); | |
326 | priv->group_changed_id = 0; | |
327 | } | |
328 | ||
329 | if (priv->idle_changed_id != 0) | |
330 | { | |
331 | g_source_remove (priv->idle_changed_id); | |
332 | priv->idle_changed_id = 0; | |
333 | } | |
334 | ||
335 | G_OBJECT_CLASS (xapp_kbd_layout_controller_parent_class)->dispose (object); | |
336 | } | |
337 | ||
338 | static void | |
339 | xapp_kbd_layout_controller_finalize (GObject *object) | |
340 | { | |
341 | XAppKbdLayoutController *controller = XAPP_KBD_LAYOUT_CONTROLLER (object); | |
342 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
343 | ||
344 | g_clear_object (&priv->config); | |
345 | ||
346 | G_OBJECT_CLASS (xapp_kbd_layout_controller_parent_class)->finalize (object); | |
347 | } | |
348 | ||
349 | static void | |
350 | xapp_kbd_layout_controller_class_init (XAppKbdLayoutControllerClass *klass) | |
351 | { | |
352 | GObjectClass *gobject_class = G_OBJECT_CLASS (klass); | |
353 | ||
354 | gobject_class->dispose = xapp_kbd_layout_controller_dispose; | |
355 | gobject_class->finalize = xapp_kbd_layout_controller_finalize; | |
356 | gobject_class->get_property = xapp_kbd_layout_controller_get_property; | |
357 | gobject_class->constructed = xapp_kbd_layout_controller_constructed; | |
358 | ||
359 | g_type_class_add_private (gobject_class, sizeof (XAppKbdLayoutControllerPrivate)); | |
360 | ||
361 | g_object_class_install_property (gobject_class, PROP_ENABLED, | |
362 | g_param_spec_boolean ("enabled", | |
363 | "Enabled", | |
364 | "Whether we're enabled (more than one keyboard layout is installed)", | |
365 | FALSE, | |
366 | G_PARAM_READABLE) | |
367 | ); | |
368 | ||
369 | signals[KBD_LAYOUT_CHANGED] = g_signal_new ("layout-changed", | |
370 | G_TYPE_FROM_CLASS (gobject_class), | |
371 | G_SIGNAL_RUN_LAST, | |
372 | 0, | |
373 | NULL, NULL, | |
374 | g_cclosure_marshal_VOID__UINT, | |
375 | G_TYPE_NONE, | |
376 | 1, G_TYPE_UINT); | |
377 | ||
378 | signals[KBD_CONFIG_CHANGED] = g_signal_new ("config-changed", | |
379 | G_TYPE_FROM_CLASS (gobject_class), | |
380 | G_SIGNAL_RUN_LAST, | |
381 | 0, | |
382 | NULL, NULL, | |
383 | g_cclosure_marshal_VOID__VOID, | |
384 | G_TYPE_NONE, | |
385 | 0, G_TYPE_NONE); | |
386 | } | |
387 | ||
388 | XAppKbdLayoutController * | |
389 | xapp_kbd_layout_controller_new (void) | |
390 | { | |
391 | return g_object_new (XAPP_TYPE_KBD_LAYOUT_CONTROLLER, NULL); | |
392 | } | |
393 | ||
394 | gboolean | |
395 | xapp_kbd_layout_controller_get_enabled (XAppKbdLayoutController *controller) | |
396 | { | |
397 | return controller->priv->enabled; | |
398 | } | |
399 | ||
400 | guint | |
401 | xapp_kbd_layout_controller_get_current_group (XAppKbdLayoutController *controller) | |
402 | { | |
403 | g_return_val_if_fail (controller->priv->enabled, 0); | |
404 | ||
405 | return gkbd_configuration_get_current_group (controller->priv->config); | |
406 | } | |
407 | ||
408 | void | |
409 | xapp_kbd_layout_controller_set_current_group (XAppKbdLayoutController *controller, | |
410 | guint group) | |
411 | { | |
412 | g_return_if_fail (controller->priv->enabled); | |
413 | g_return_if_fail (group <= controller->priv->num_groups); | |
414 | ||
415 | guint current = gkbd_configuration_get_current_group (controller->priv->config); | |
416 | ||
417 | if (current != group) | |
418 | { | |
419 | gkbd_configuration_lock_group (controller->priv->config, group); | |
420 | } | |
421 | } | |
422 | ||
423 | void | |
424 | xapp_kbd_layout_controller_next_group (XAppKbdLayoutController *controller) | |
425 | { | |
426 | g_return_if_fail (controller->priv->enabled); | |
427 | ||
428 | gkbd_configuration_lock_next_group (controller->priv->config); | |
429 | } | |
430 | ||
431 | void | |
432 | xapp_kbd_layout_controller_previous_group (XAppKbdLayoutController *controller) | |
433 | { | |
434 | g_return_if_fail (controller->priv->enabled); | |
435 | ||
436 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
437 | ||
438 | gint current = gkbd_configuration_get_current_group (priv->config); | |
439 | ||
440 | if (current > 0) | |
441 | { | |
442 | current--; | |
443 | } | |
444 | else | |
445 | { | |
446 | current = priv->num_groups - 1; | |
447 | } | |
448 | ||
449 | gkbd_configuration_lock_group (controller->priv->config, current); | |
450 | } | |
451 | ||
452 | /** | |
453 | * xapp_kbd_layout_controller_get_current_name: | |
454 | * | |
455 | * Returns the full name of the current keyboard layout. | |
456 | * | |
457 | * Returns: (transfer full): the newly created string or NULL | |
458 | * if something went wrong. | |
459 | */ | |
460 | gchar * | |
461 | xapp_kbd_layout_controller_get_current_name (XAppKbdLayoutController *controller) | |
462 | { | |
463 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
464 | ||
465 | return gkbd_configuration_get_current_tooltip (controller->priv->config); | |
466 | } | |
467 | ||
468 | /** | |
469 | * xapp_kbd_layout_controller_get_all_names: | |
470 | * | |
471 | * Returns an array of all full layout names | |
472 | * | |
473 | * Returns: (transfer none) (array zero-terminated=1): array of names | |
474 | */ | |
475 | gchar ** | |
476 | xapp_kbd_layout_controller_get_all_names (XAppKbdLayoutController *controller) | |
477 | { | |
478 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
479 | ||
480 | return gkbd_configuration_get_group_names (controller->priv->config); | |
481 | } | |
482 | ||
483 | /** | |
484 | * xapp_kbd_layout_controller_get_current_icon_name: | |
485 | * | |
486 | * Returns the icon file name (no path or extension) to use for the current layout | |
487 | * | |
488 | * Returns: (transfer full): a new string with the icon name. | |
489 | */ | |
490 | gchar * | |
491 | xapp_kbd_layout_controller_get_current_icon_name (XAppKbdLayoutController *controller) | |
492 | { | |
493 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
494 | ||
495 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
496 | ||
497 | guint current = gkbd_configuration_get_current_group (priv->config); | |
498 | ||
499 | return g_strdup (GROUP_DATA (priv->group_data, current)->group_name); | |
500 | } | |
501 | ||
502 | /** | |
503 | * xapp_kbd_layout_controller_get_icon_name_for_group: | |
504 | * | |
505 | * Returns the icon file name (no path or extension) to use for the specified layout. | |
506 | * | |
507 | * Returns: (transfer full): a new string with the icon name. | |
508 | */ | |
509 | gchar * | |
510 | xapp_kbd_layout_controller_get_icon_name_for_group (XAppKbdLayoutController *controller, | |
511 | guint group) | |
512 | { | |
513 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
514 | g_return_val_if_fail (group <= controller->priv->num_groups, NULL); | |
515 | ||
516 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
517 | ||
518 | return g_strdup (GROUP_DATA (priv->group_data, group)->group_name); | |
519 | } | |
520 | ||
521 | /** | |
522 | * xapp_kbd_layout_controller_get_current_flag_id: | |
523 | * | |
524 | * Returns the duplicate id for the current layout | |
525 | * | |
526 | * Returns: the id | |
527 | */ | |
528 | gint | |
529 | xapp_kbd_layout_controller_get_current_flag_id (XAppKbdLayoutController *controller) | |
530 | { | |
531 | g_return_val_if_fail (controller->priv->enabled, 0); | |
532 | ||
533 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
534 | ||
535 | guint current = gkbd_configuration_get_current_group (priv->config); | |
536 | ||
537 | return GROUP_DATA (priv->group_data, current)->group_dupe_id; | |
538 | } | |
539 | ||
540 | ||
541 | /** | |
542 | * xapp_kbd_layout_controller_flag_id_for_group: | |
543 | * | |
544 | * Returns the duplicate id for the specified layout | |
545 | * | |
546 | * Returns: the id | |
547 | */ | |
548 | gint | |
549 | xapp_kbd_layout_controller_get_flag_id_for_group (XAppKbdLayoutController *controller, | |
550 | guint group) | |
551 | { | |
552 | g_return_val_if_fail (controller->priv->enabled, 0); | |
553 | g_return_val_if_fail (group < controller->priv->num_groups, 0); | |
554 | ||
555 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
556 | ||
557 | return GROUP_DATA (priv->group_data, group)->group_dupe_id; | |
558 | } | |
559 | ||
560 | /** | |
561 | * xapp_kbd_layout_controller_get_current_short_group_label: | |
562 | * | |
563 | * Returns the short group label (and subscript, if any) of the current layout | |
564 | * | |
565 | * Returns: (transfer full): a new string or NULL. | |
566 | */ | |
567 | gchar * | |
568 | xapp_kbd_layout_controller_get_current_short_group_label (XAppKbdLayoutController *controller) | |
569 | { | |
570 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
571 | ||
572 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
573 | ||
574 | guint current = gkbd_configuration_get_current_group (priv->config); | |
575 | ||
576 | return g_strdup (GROUP_DATA (priv->group_data, current)->group_label); | |
577 | } | |
578 | ||
579 | /** | |
580 | * xapp_kbd_layout_controller_get_short_group_label_for_group: | |
581 | * | |
582 | * Returns the short group label and subscript of the specified layout. | |
583 | * | |
584 | * Returns: (transfer full): a new string or NULL. | |
585 | */ | |
586 | gchar * | |
587 | xapp_kbd_layout_controller_get_short_group_label_for_group (XAppKbdLayoutController *controller, | |
588 | guint group) | |
589 | { | |
590 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
591 | g_return_val_if_fail (group < controller->priv->num_groups, NULL); | |
592 | ||
593 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
594 | ||
595 | ||
596 | return g_strdup (GROUP_DATA (priv->group_data, group)->group_label); | |
597 | } | |
598 | ||
599 | /** | |
600 | * xapp_kbd_layout_controller_get_current_variant_label: | |
601 | * | |
602 | * Returns the variant label (and subscript, if any) of the current layout | |
603 | * | |
604 | * Returns: (transfer full): a new string or NULL. | |
605 | */ | |
606 | gchar * | |
607 | xapp_kbd_layout_controller_get_current_variant_label (XAppKbdLayoutController *controller) | |
608 | { | |
609 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
610 | ||
611 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
612 | ||
613 | guint current = gkbd_configuration_get_current_group (priv->config); | |
614 | ||
615 | return g_strdup (GROUP_DATA (priv->group_data, current)->variant_label); | |
616 | } | |
617 | ||
618 | /** | |
619 | * xapp_kbd_layout_controller_get_variant_label_for_group: | |
620 | * | |
621 | * Returns the variant label and subscript of the specified layout. | |
622 | * | |
623 | * Returns: (transfer full): a new string or NULL. | |
624 | */ | |
625 | gchar * | |
626 | xapp_kbd_layout_controller_get_variant_label_for_group (XAppKbdLayoutController *controller, | |
627 | guint group) | |
628 | { | |
629 | g_return_val_if_fail (controller->priv->enabled, NULL); | |
630 | ||
631 | XAppKbdLayoutControllerPrivate *priv = controller->priv; | |
632 | ||
633 | g_return_val_if_fail (group < controller->priv->num_groups, NULL); | |
634 | ||
635 | return g_strdup (GROUP_DATA (priv->group_data, group)->variant_label); | |
636 | } | |
637 | ||
638 | void | |
639 | xapp_kbd_layout_controller_render_cairo_subscript (cairo_t *cr, | |
640 | gdouble x, | |
641 | gdouble y, | |
642 | gdouble width, | |
643 | gdouble height, | |
644 | gint subscript) | |
645 | { | |
646 | if (subscript == 0) | |
647 | { | |
648 | return; | |
649 | } | |
650 | ||
651 | cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, .5); | |
652 | cairo_rectangle (cr, x, y, width, height); | |
653 | cairo_fill (cr); | |
654 | ||
655 | cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, .8); | |
656 | cairo_rectangle (cr, x + 1, y + 1, width - 2, height - 2); | |
657 | cairo_fill (cr); | |
658 | ||
659 | cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0); | |
660 | ||
661 | gchar *num_string = g_strdup_printf ("%d", subscript); | |
662 | cairo_select_font_face (cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); | |
663 | cairo_set_font_size (cr, height - 2.0); | |
664 | ||
665 | cairo_text_extents_t ext; | |
666 | cairo_text_extents (cr, num_string, &ext); | |
667 | ||
668 | cairo_move_to (cr, | |
669 | (x + (width / 2.0) - (ext.width / 2.0)), | |
670 | (y + (height / 2.0) + (ext.height / 2.0))); | |
671 | ||
672 | cairo_show_text (cr, num_string); | |
673 | g_free (num_string); | |
674 | } | |
675 |
0 | #ifndef __XAPP_KBD_LAYOUT_CONTROLLER_H__ | |
1 | #define __XAPP_KBD_LAYOUT_CONTROLLER_H__ | |
2 | ||
3 | #include <stdio.h> | |
4 | #include <gdk-pixbuf/gdk-pixbuf.h> | |
5 | ||
6 | #include <glib-object.h> | |
7 | #include <cairo.h> | |
8 | ||
9 | G_BEGIN_DECLS | |
10 | ||
11 | #define XAPP_TYPE_KBD_LAYOUT_CONTROLLER (xapp_kbd_layout_controller_get_type ()) | |
12 | #define XAPP_KBD_LAYOUT_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XAPP_TYPE_KBD_LAYOUT_CONTROLLER, XAppKbdLayoutController)) | |
13 | #define XAPP_KBD_LAYOUT_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XAPP_TYPE_KBD_LAYOUT_CONTROLLER, XAppKbdLayoutControllerClass)) | |
14 | #define XAPP_IS_KBD_LAYOUT_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XAPP_TYPE_KBD_LAYOUT_CONTROLLER)) | |
15 | #define XAPP_IS_KBD_LAYOUT_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XAPP_TYPE_KBD_LAYOUT_CONTROLLER)) | |
16 | #define XAPP_KBD_LAYOUT_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XAPP_TYPE_KBD_LAYOUT_CONTROLLER, XAppKbdLayoutControllerClass)) | |
17 | ||
18 | typedef struct _XAppKbdLayoutControllerPrivate XAppKbdLayoutControllerPrivate; | |
19 | typedef struct _XAppKbdLayoutController XAppKbdLayoutController; | |
20 | typedef struct _XAppKbdLayoutControllerClass XAppKbdLayoutControllerClass; | |
21 | ||
22 | struct _XAppKbdLayoutController | |
23 | { | |
24 | GObject parent_object; | |
25 | ||
26 | XAppKbdLayoutControllerPrivate *priv; | |
27 | }; | |
28 | ||
29 | struct _XAppKbdLayoutControllerClass | |
30 | { | |
31 | GObjectClass parent_class; | |
32 | }; | |
33 | ||
34 | GType xapp_kbd_layout_controller_get_type (void); | |
35 | XAppKbdLayoutController *xapp_kbd_layout_controller_new (void); | |
36 | gboolean xapp_kbd_layout_controller_get_enabled (XAppKbdLayoutController *controller); | |
37 | guint xapp_kbd_layout_controller_get_current_group (XAppKbdLayoutController *controller); | |
38 | void xapp_kbd_layout_controller_set_current_group (XAppKbdLayoutController *controller, | |
39 | guint group); | |
40 | void xapp_kbd_layout_controller_next_group (XAppKbdLayoutController *controller); | |
41 | void xapp_kbd_layout_controller_previous_group (XAppKbdLayoutController *controller); | |
42 | gchar *xapp_kbd_layout_controller_get_current_name (XAppKbdLayoutController *controller); | |
43 | gchar **xapp_kbd_layout_controller_get_all_names (XAppKbdLayoutController *controller); | |
44 | ||
45 | gchar *xapp_kbd_layout_controller_get_current_icon_name (XAppKbdLayoutController *controller); | |
46 | gchar *xapp_kbd_layout_controller_get_icon_name_for_group (XAppKbdLayoutController *controller, | |
47 | guint group); | |
48 | gint xapp_kbd_layout_controller_get_current_flag_id (XAppKbdLayoutController *controller); | |
49 | gint xapp_kbd_layout_controller_get_flag_id_for_group (XAppKbdLayoutController *controller, | |
50 | guint group); | |
51 | gchar *xapp_kbd_layout_controller_get_current_short_group_label (XAppKbdLayoutController *controller); | |
52 | gchar *xapp_kbd_layout_controller_get_short_group_label_for_group (XAppKbdLayoutController *controller, | |
53 | guint group); | |
54 | gchar *xapp_kbd_layout_controller_get_current_variant_label (XAppKbdLayoutController *controller); | |
55 | ||
56 | gchar *xapp_kbd_layout_controller_get_variant_label_for_group (XAppKbdLayoutController *controller, | |
57 | guint group); | |
58 | ||
59 | /* Class function */ | |
60 | void xapp_kbd_layout_controller_render_cairo_subscript (cairo_t *cr, | |
61 | gdouble x, | |
62 | gdouble y, | |
63 | gdouble width, | |
64 | gdouble height, | |
65 | gint subscript); | |
66 | ||
67 | G_END_DECLS | |
68 | ||
69 | #endif /* __XAPP_KBD_LAYOUT_CONTROLLER_H__ */ |
0 | ||
1 | #include <config.h> | |
2 | ||
3 | #include <stdio.h> | |
4 | #include <stdlib.h> | |
5 | #include <string.h> | |
6 | ||
7 | #include <gdk/gdkx.h> | |
8 | #include <gtk/gtk.h> | |
9 | ||
10 | #include <glib/gi18n-lib.h> | |
11 | ||
12 | #include "xapp-monitor-blanker.h" | |
13 | ||
14 | struct _XAppMonitorBlankerPrivate | |
15 | { | |
16 | int num_outputs; | |
17 | gboolean blanked; | |
18 | GtkWidget **windows; | |
19 | }; | |
20 | ||
21 | G_DEFINE_TYPE (XAppMonitorBlanker, xapp_monitor_blanker, G_TYPE_OBJECT); | |
22 | ||
23 | GtkWidget *create_blanking_window (GdkScreen *screen, | |
24 | int monitor); | |
25 | ||
26 | static void | |
27 | xapp_monitor_blanker_init (XAppMonitorBlanker *self) | |
28 | { | |
29 | self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, XAPP_TYPE_MONITOR_BLANKER, XAppMonitorBlankerPrivate); | |
30 | self->priv->num_outputs = 0; | |
31 | self->priv->blanked = FALSE; | |
32 | self->priv->windows = NULL; | |
33 | } | |
34 | ||
35 | static void | |
36 | xapp_monitor_blanker_finalize (GObject *object) | |
37 | { | |
38 | XAppMonitorBlanker *self = XAPP_MONITOR_BLANKER (object); | |
39 | ||
40 | if (self->priv->windows != NULL) | |
41 | { | |
42 | xapp_monitor_blanker_unblank_monitors (XAPP_MONITOR_BLANKER(self)); | |
43 | g_free (self->priv->windows); | |
44 | } | |
45 | ||
46 | G_OBJECT_CLASS (xapp_monitor_blanker_parent_class)->finalize (object); | |
47 | } | |
48 | ||
49 | static void | |
50 | xapp_monitor_blanker_class_init (XAppMonitorBlankerClass *klass) | |
51 | { | |
52 | GObjectClass *gobject_class = G_OBJECT_CLASS (klass); | |
53 | ||
54 | gobject_class->finalize = xapp_monitor_blanker_finalize; | |
55 | ||
56 | g_type_class_add_private (gobject_class, sizeof (XAppMonitorBlankerPrivate)); | |
57 | } | |
58 | ||
59 | XAppMonitorBlanker * | |
60 | xapp_monitor_blanker_new (void) | |
61 | { | |
62 | return g_object_new (XAPP_TYPE_MONITOR_BLANKER, NULL); | |
63 | } | |
64 | ||
65 | GtkWidget * | |
66 | create_blanking_window (GdkScreen *screen, | |
67 | int monitor) | |
68 | { | |
69 | GdkRectangle fullscreen; | |
70 | GtkWidget *window; | |
71 | GtkStyleContext *context; | |
72 | GtkCssProvider *provider; | |
73 | ||
74 | gdk_screen_get_monitor_geometry(screen, monitor, &fullscreen); | |
75 | ||
76 | window = gtk_window_new (GTK_WINDOW_POPUP); | |
77 | gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE); | |
78 | gtk_window_set_skip_pager_hint (GTK_WINDOW (window), TRUE); | |
79 | gtk_window_resize (GTK_WINDOW (window), fullscreen.width, fullscreen.height); | |
80 | gtk_window_move (GTK_WINDOW (window), fullscreen.x, fullscreen.y); | |
81 | gtk_widget_set_visible (window, TRUE); | |
82 | ||
83 | context = gtk_widget_get_style_context (GTK_WIDGET (window)); | |
84 | gtk_style_context_add_class (context, "xapp-blanking-window"); | |
85 | provider = gtk_css_provider_new (); | |
86 | gtk_css_provider_load_from_data (provider, | |
87 | ".xapp-blanking-window { background-color: rgb(0, 0, 0); }", | |
88 | -1, NULL); | |
89 | gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); | |
90 | ||
91 | return window; | |
92 | } | |
93 | ||
94 | void | |
95 | xapp_monitor_blanker_blank_other_monitors (XAppMonitorBlanker *self, | |
96 | GtkWindow *window) | |
97 | { | |
98 | GdkScreen *screen; | |
99 | int active_monitor; | |
100 | int i; | |
101 | ||
102 | g_return_if_fail (XAPP_IS_MONITOR_BLANKER (self)); | |
103 | ||
104 | if (self->priv->windows != NULL) | |
105 | return; | |
106 | ||
107 | screen = gtk_window_get_screen (window); | |
108 | active_monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (GTK_WIDGET (window))); | |
109 | self->priv->num_outputs = gdk_screen_get_n_monitors (screen); | |
110 | self->priv->windows = g_new (GtkWidget *, self->priv->num_outputs); | |
111 | ||
112 | for (i = 0; i < self->priv->num_outputs; i++) | |
113 | { | |
114 | if (i != active_monitor) | |
115 | { | |
116 | self->priv->windows[i] = create_blanking_window (screen, i); | |
117 | } | |
118 | else | |
119 | { | |
120 | // initialize at NULL so it gets properly skipped when windows get destroyed | |
121 | self->priv->windows[i] = NULL; | |
122 | } | |
123 | } | |
124 | ||
125 | self->priv->blanked = TRUE; | |
126 | } | |
127 | ||
128 | void | |
129 | xapp_monitor_blanker_unblank_monitors (XAppMonitorBlanker *self) | |
130 | { | |
131 | int i; | |
132 | g_return_if_fail (XAPP_IS_MONITOR_BLANKER (self)); | |
133 | ||
134 | if (self->priv->windows == NULL) | |
135 | return; | |
136 | ||
137 | for (i = 0; i < self->priv->num_outputs; i++) | |
138 | { | |
139 | if (self->priv->windows[i] != NULL) | |
140 | { | |
141 | gtk_widget_destroy (self->priv->windows[i]); | |
142 | self->priv->windows[i] = NULL; | |
143 | } | |
144 | } | |
145 | g_free (self->priv->windows); | |
146 | self->priv->windows = NULL; | |
147 | self->priv->blanked = FALSE; | |
148 | } | |
149 | ||
150 | gboolean | |
151 | xapp_monitor_blanker_are_monitors_blanked (XAppMonitorBlanker *self) | |
152 | { | |
153 | return self->priv->blanked; | |
154 | } |
0 | #ifndef __XAPP_MONITOR_BLANKER_H__ | |
1 | #define __XAPP_MONITOR_BLANKER_H__ | |
2 | ||
3 | #include <stdio.h> | |
4 | #include <gtk/gtk.h> | |
5 | ||
6 | #include <glib-object.h> | |
7 | ||
8 | G_BEGIN_DECLS | |
9 | ||
10 | #define XAPP_TYPE_MONITOR_BLANKER (xapp_monitor_blanker_get_type ()) | |
11 | #define XAPP_MONITOR_BLANKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XAPP_TYPE_MONITOR_BLANKER, XAppMonitorBlanker)) | |
12 | #define XAPP_MONITOR_BLANKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XAPP_TYPE_MONITOR_BLANKER, XAppMonitorBlankerClass)) | |
13 | #define XAPP_IS_MONITOR_BLANKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XAPP_TYPE_MONITOR_BLANKER)) | |
14 | #define XAPP_IS_MONITOR_BLANKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XAPP_TYPE_MONITOR_BLANKER)) | |
15 | #define XAPP_MONITOR_BLANKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XAPP_TYPE_MONITOR_BLANKER, XAppMonitorBlankerClass)) | |
16 | ||
17 | typedef struct _XAppMonitorBlankerPrivate XAppMonitorBlankerPrivate; | |
18 | typedef struct _XAppMonitorBlanker XAppMonitorBlanker; | |
19 | typedef struct _XAppMonitorBlankerClass XAppMonitorBlankerClass; | |
20 | ||
21 | struct _XAppMonitorBlanker | |
22 | { | |
23 | GObject parent_object; | |
24 | ||
25 | XAppMonitorBlankerPrivate *priv; | |
26 | }; | |
27 | ||
28 | struct _XAppMonitorBlankerClass | |
29 | { | |
30 | GObjectClass parent_class; | |
31 | }; | |
32 | ||
33 | GType xapp_monitor_blanker_get_type (void); | |
34 | XAppMonitorBlanker *xapp_monitor_blanker_new (void); | |
35 | void xapp_monitor_blanker_blank_other_monitors (XAppMonitorBlanker *self, | |
36 | GtkWindow *window); | |
37 | void xapp_monitor_blanker_unblank_monitors (XAppMonitorBlanker *self); | |
38 | gboolean xapp_monitor_blanker_are_monitors_blanked (XAppMonitorBlanker *self); | |
39 | ||
40 | G_END_DECLS | |
41 | ||
42 | #endif /* __XAPP_MONITOR_BLANKER_H__ */ |
0 | prefix=@prefix@ | |
1 | exec_prefix=@exec_prefix@ | |
2 | libdir=@libdir@ | |
3 | includedir=@includedir@ | |
4 | ||
5 | Name: xapp | |
6 | Description: Utility library for loading .desktop files | |
7 | Requires: gtk+-3.0 | |
8 | Version: @VERSION@ | |
9 | Libs: ${pc_top_builddir}/${pcfiledir}/libxapp.la | |
10 | Cflags: -I${pc_top_builddir}/${pcfiledir}/.. |
0 | prefix=@prefix@ | |
1 | exec_prefix=@exec_prefix@ | |
2 | libdir=@libdir@ | |
3 | includedir=@includedir@ | |
4 | ||
5 | Name: xapp | |
6 | Description: Utility library for loading .desktop files | |
7 | Requires: gtk+-3.0 | |
8 | Requires.private: xkbfile | |
9 | Version: @VERSION@ | |
10 | Libs: -L${libdir} -lxapp | |
11 | Cflags: -I${includedir}/xapp |
0 | dnl -*- mode: autoconf -*- | |
1 | ||
2 | # serial 1 | |
3 | ||
4 | dnl Usage: | |
5 | dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) | |
6 | AC_DEFUN([GTK_DOC_CHECK], | |
7 | [ | |
8 | AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | |
9 | AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first | |
10 | AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first | |
11 | ||
12 | dnl check for tools we added during development | |
13 | AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) | |
14 | AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) | |
15 | AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) | |
16 | ||
17 | dnl for overriding the documentation installation directory | |
18 | AC_ARG_WITH([html-dir], | |
19 | AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, | |
20 | [with_html_dir='${datadir}/gtk-doc/html']) | |
21 | HTML_DIR="$with_html_dir" | |
22 | AC_SUBST([HTML_DIR]) | |
23 | ||
24 | dnl enable/disable documentation building | |
25 | AC_ARG_ENABLE([gtk-doc], | |
26 | AS_HELP_STRING([--enable-gtk-doc], | |
27 | [use gtk-doc to build documentation [[default=no]]]),, | |
28 | [enable_gtk_doc=no]) | |
29 | ||
30 | if test x$enable_gtk_doc = xyes; then | |
31 | ifelse([$1],[], | |
32 | [PKG_CHECK_EXISTS([gtk-doc],, | |
33 | AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], | |
34 | [PKG_CHECK_EXISTS([gtk-doc >= $1],, | |
35 | AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) | |
36 | dnl don't check for glib if we build glib | |
37 | if test "x$PACKAGE_NAME" != "xglib"; then | |
38 | dnl don't fail if someone does not have glib | |
39 | PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) | |
40 | fi | |
41 | fi | |
42 | ||
43 | AC_MSG_CHECKING([whether to build gtk-doc documentation]) | |
44 | AC_MSG_RESULT($enable_gtk_doc) | |
45 | ||
46 | dnl enable/disable output formats | |
47 | AC_ARG_ENABLE([gtk-doc-html], | |
48 | AS_HELP_STRING([--enable-gtk-doc-html], | |
49 | [build documentation in html format [[default=yes]]]),, | |
50 | [enable_gtk_doc_html=yes]) | |
51 | AC_ARG_ENABLE([gtk-doc-pdf], | |
52 | AS_HELP_STRING([--enable-gtk-doc-pdf], | |
53 | [build documentation in pdf format [[default=no]]]),, | |
54 | [enable_gtk_doc_pdf=no]) | |
55 | ||
56 | if test -z "$GTKDOC_MKPDF"; then | |
57 | enable_gtk_doc_pdf=no | |
58 | fi | |
59 | ||
60 | ||
61 | AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) | |
62 | AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) | |
63 | AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) | |
64 | AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) | |
65 | AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) | |
66 | ]) |
0 | ## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- | |
1 | ## Copyright (C) 2001 Eazel, Inc. | |
2 | ## Author: Maciej Stachowiak <mjs@noisehavoc.org> | |
3 | ## Kenneth Christiansen <kenneth@gnu.org> | |
4 | ## | |
5 | ## This program is free software; you can redistribute it and/or modify | |
6 | ## it under the terms of the GNU General Public License as published by | |
7 | ## the Free Software Foundation; either version 2 of the License, or | |
8 | ## (at your option) any later version. | |
9 | ## | |
10 | ## This program is distributed in the hope that it will be useful, but | |
11 | ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | ## General Public License for more details. | |
14 | ## | |
15 | ## You should have received a copy of the GNU General Public License | |
16 | ## along with this program; if not, write to the Free Software | |
17 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 | ## | |
19 | ## As a special exception to the GNU General Public License, if you | |
20 | ## distribute this file as part of a program that contains a | |
21 | ## configuration script generated by Autoconf, you may include it under | |
22 | ## the same distribution terms that you use for the rest of that program. | |
23 | ||
24 | dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) | |
25 | # serial 42 IT_PROG_INTLTOOL | |
26 | AC_DEFUN([IT_PROG_INTLTOOL], [ | |
27 | AC_PREREQ([2.50])dnl | |
28 | AC_REQUIRE([AM_NLS])dnl | |
29 | ||
30 | case "$am__api_version" in | |
31 | 1.[01234]) | |
32 | AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) | |
33 | ;; | |
34 | *) | |
35 | ;; | |
36 | esac | |
37 | ||
38 | INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` | |
39 | INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` | |
40 | INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` | |
41 | if test -n "$1"; then | |
42 | AC_MSG_CHECKING([for intltool >= $1]) | |
43 | AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) | |
44 | test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || | |
45 | AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) | |
46 | fi | |
47 | ||
48 | AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) | |
49 | AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) | |
50 | AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) | |
51 | if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then | |
52 | AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) | |
53 | fi | |
54 | ||
55 | if test -z "$AM_DEFAULT_VERBOSITY"; then | |
56 | AM_DEFAULT_VERBOSITY=1 | |
57 | fi | |
58 | AC_SUBST([AM_DEFAULT_VERBOSITY]) | |
59 | ||
60 | INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' | |
61 | INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' | |
62 | INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' | |
63 | AC_SUBST(INTLTOOL_V_MERGE) | |
64 | AC_SUBST(INTLTOOL__v_MERGE_) | |
65 | AC_SUBST(INTLTOOL__v_MERGE_0) | |
66 | ||
67 | INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' | |
68 | intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' | |
69 | intltool__v_merge_options_0='-q' | |
70 | AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) | |
71 | AC_SUBST(intltool__v_merge_options_) | |
72 | AC_SUBST(intltool__v_merge_options_0) | |
73 | ||
74 | INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
75 | INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
76 | INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
77 | INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
78 | INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' | |
79 | INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
80 | INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
81 | INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
82 | INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
83 | INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
84 | INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
85 | if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then | |
86 | INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' | |
87 | else | |
88 | INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' | |
89 | fi | |
90 | INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
91 | INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
92 | INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
93 | INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
94 | INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
95 | INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
96 | INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' | |
97 | ||
98 | _IT_SUBST(INTLTOOL_DESKTOP_RULE) | |
99 | _IT_SUBST(INTLTOOL_DIRECTORY_RULE) | |
100 | _IT_SUBST(INTLTOOL_KEYS_RULE) | |
101 | _IT_SUBST(INTLTOOL_PROP_RULE) | |
102 | _IT_SUBST(INTLTOOL_OAF_RULE) | |
103 | _IT_SUBST(INTLTOOL_PONG_RULE) | |
104 | _IT_SUBST(INTLTOOL_SERVER_RULE) | |
105 | _IT_SUBST(INTLTOOL_SHEET_RULE) | |
106 | _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) | |
107 | _IT_SUBST(INTLTOOL_UI_RULE) | |
108 | _IT_SUBST(INTLTOOL_XAM_RULE) | |
109 | _IT_SUBST(INTLTOOL_KBD_RULE) | |
110 | _IT_SUBST(INTLTOOL_XML_RULE) | |
111 | _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) | |
112 | _IT_SUBST(INTLTOOL_CAVES_RULE) | |
113 | _IT_SUBST(INTLTOOL_SCHEMAS_RULE) | |
114 | _IT_SUBST(INTLTOOL_THEME_RULE) | |
115 | _IT_SUBST(INTLTOOL_SERVICE_RULE) | |
116 | _IT_SUBST(INTLTOOL_POLICY_RULE) | |
117 | ||
118 | # Check the gettext tools to make sure they are GNU | |
119 | AC_PATH_PROG(XGETTEXT, xgettext) | |
120 | AC_PATH_PROG(MSGMERGE, msgmerge) | |
121 | AC_PATH_PROG(MSGFMT, msgfmt) | |
122 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
123 | if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then | |
124 | AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) | |
125 | fi | |
126 | xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" | |
127 | mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" | |
128 | mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" | |
129 | if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then | |
130 | AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) | |
131 | fi | |
132 | ||
133 | AC_PATH_PROG(INTLTOOL_PERL, perl) | |
134 | if test -z "$INTLTOOL_PERL"; then | |
135 | AC_MSG_ERROR([perl not found]) | |
136 | fi | |
137 | AC_MSG_CHECKING([for perl >= 5.8.1]) | |
138 | $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 | |
139 | if test $? -ne 0; then | |
140 | AC_MSG_ERROR([perl 5.8.1 is required for intltool]) | |
141 | else | |
142 | IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` | |
143 | AC_MSG_RESULT([$IT_PERL_VERSION]) | |
144 | fi | |
145 | if test "x$2" != "xno-xml"; then | |
146 | AC_MSG_CHECKING([for XML::Parser]) | |
147 | if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then | |
148 | AC_MSG_RESULT([ok]) | |
149 | else | |
150 | AC_MSG_ERROR([XML::Parser perl module is required for intltool]) | |
151 | fi | |
152 | fi | |
153 | ||
154 | # Substitute ALL_LINGUAS so we can use it in po/Makefile | |
155 | AC_SUBST(ALL_LINGUAS) | |
156 | ||
157 | # Set DATADIRNAME correctly if it is not set yet | |
158 | # (copied from glib-gettext.m4) | |
159 | if test -z "$DATADIRNAME"; then | |
160 | AC_LINK_IFELSE( | |
161 | [AC_LANG_PROGRAM([[]], | |
162 | [[extern int _nl_msg_cat_cntr; | |
163 | return _nl_msg_cat_cntr]])], | |
164 | [DATADIRNAME=share], | |
165 | [case $host in | |
166 | *-*-solaris*) | |
167 | dnl On Solaris, if bind_textdomain_codeset is in libc, | |
168 | dnl GNU format message catalog is always supported, | |
169 | dnl since both are added to the libc all together. | |
170 | dnl Hence, we'd like to go with DATADIRNAME=share | |
171 | dnl in this case. | |
172 | AC_CHECK_FUNC(bind_textdomain_codeset, | |
173 | [DATADIRNAME=share], [DATADIRNAME=lib]) | |
174 | ;; | |
175 | *) | |
176 | [DATADIRNAME=lib] | |
177 | ;; | |
178 | esac]) | |
179 | fi | |
180 | AC_SUBST(DATADIRNAME) | |
181 | ||
182 | IT_PO_SUBDIR([po]) | |
183 | ||
184 | ]) | |
185 | ||
186 | ||
187 | # IT_PO_SUBDIR(DIRNAME) | |
188 | # --------------------- | |
189 | # All po subdirs have to be declared with this macro; the subdir "po" is | |
190 | # declared by IT_PROG_INTLTOOL. | |
191 | # | |
192 | AC_DEFUN([IT_PO_SUBDIR], | |
193 | [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. | |
194 | dnl | |
195 | dnl The following CONFIG_COMMANDS should be executed at the very end | |
196 | dnl of config.status. | |
197 | AC_CONFIG_COMMANDS_PRE([ | |
198 | AC_CONFIG_COMMANDS([$1/stamp-it], [ | |
199 | if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then | |
200 | AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) | |
201 | fi | |
202 | rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" | |
203 | >"$1/stamp-it.tmp" | |
204 | [sed '/^#/d | |
205 | s/^[[].*] *// | |
206 | /^[ ]*$/d | |
207 | '"s|^| $ac_top_srcdir/|" \ | |
208 | "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" | |
209 | ] | |
210 | [sed '/^POTFILES =/,/[^\\]$/ { | |
211 | /^POTFILES =/!d | |
212 | r $1/POTFILES | |
213 | } | |
214 | ' "$1/Makefile.in" >"$1/Makefile"] | |
215 | rm -f "$1/Makefile.tmp" | |
216 | mv "$1/stamp-it.tmp" "$1/stamp-it" | |
217 | ]) | |
218 | ])dnl | |
219 | ]) | |
220 | ||
221 | # _IT_SUBST(VARIABLE) | |
222 | # ------------------- | |
223 | # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST | |
224 | # | |
225 | AC_DEFUN([_IT_SUBST], | |
226 | [ | |
227 | AC_SUBST([$1]) | |
228 | m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) | |
229 | ] | |
230 | ) | |
231 | ||
232 | # deprecated macros | |
233 | AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) | |
234 | # A hint is needed for aclocal from Automake <= 1.9.4: | |
235 | # AC_DEFUN([AC_PROG_INTLTOOL], ...) | |
236 |
0 | # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- | |
1 | # | |
2 | # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. | |
3 | # Written by Gordon Matzigkeit, 1996 | |
4 | # | |
5 | # This file is free software; the Free Software Foundation gives | |
6 | # unlimited permission to copy and/or distribute it, with or without | |
7 | # modifications, as long as this notice is preserved. | |
8 | ||
9 | m4_define([_LT_COPYING], [dnl | |
10 | # Copyright (C) 2014 Free Software Foundation, Inc. | |
11 | # This is free software; see the source for copying conditions. There is NO | |
12 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
13 | ||
14 | # GNU Libtool is free software; you can redistribute it and/or modify | |
15 | # it under the terms of the GNU General Public License as published by | |
16 | # the Free Software Foundation; either version 2 of of the License, or | |
17 | # (at your option) any later version. | |
18 | # | |
19 | # As a special exception to the GNU General Public License, if you | |
20 | # distribute this file as part of a program or library that is built | |
21 | # using GNU Libtool, you may include this file under the same | |
22 | # distribution terms that you use for the rest of that program. | |
23 | # | |
24 | # GNU Libtool is distributed in the hope that it will be useful, but | |
25 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
27 | # GNU General Public License for more details. | |
28 | # | |
29 | # You should have received a copy of the GNU General Public License | |
30 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 | ]) | |
32 | ||
33 | # serial 58 LT_INIT | |
34 | ||
35 | ||
36 | # LT_PREREQ(VERSION) | |
37 | # ------------------ | |
38 | # Complain and exit if this libtool version is less that VERSION. | |
39 | m4_defun([LT_PREREQ], | |
40 | [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, | |
41 | [m4_default([$3], | |
42 | [m4_fatal([Libtool version $1 or higher is required], | |
43 | 63)])], | |
44 | [$2])]) | |
45 | ||
46 | ||
47 | # _LT_CHECK_BUILDDIR | |
48 | # ------------------ | |
49 | # Complain if the absolute build directory name contains unusual characters | |
50 | m4_defun([_LT_CHECK_BUILDDIR], | |
51 | [case `pwd` in | |
52 | *\ * | *\ *) | |
53 | AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; | |
54 | esac | |
55 | ]) | |
56 | ||
57 | ||
58 | # LT_INIT([OPTIONS]) | |
59 | # ------------------ | |
60 | AC_DEFUN([LT_INIT], | |
61 | [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK | |
62 | AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl | |
63 | AC_BEFORE([$0], [LT_LANG])dnl | |
64 | AC_BEFORE([$0], [LT_OUTPUT])dnl | |
65 | AC_BEFORE([$0], [LTDL_INIT])dnl | |
66 | m4_require([_LT_CHECK_BUILDDIR])dnl | |
67 | ||
68 | dnl Autoconf doesn't catch unexpanded LT_ macros by default: | |
69 | m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl | |
70 | m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl | |
71 | dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 | |
72 | dnl unless we require an AC_DEFUNed macro: | |
73 | AC_REQUIRE([LTOPTIONS_VERSION])dnl | |
74 | AC_REQUIRE([LTSUGAR_VERSION])dnl | |
75 | AC_REQUIRE([LTVERSION_VERSION])dnl | |
76 | AC_REQUIRE([LTOBSOLETE_VERSION])dnl | |
77 | m4_require([_LT_PROG_LTMAIN])dnl | |
78 | ||
79 | _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) | |
80 | ||
81 | dnl Parse OPTIONS | |
82 | _LT_SET_OPTIONS([$0], [$1]) | |
83 | ||
84 | # This can be used to rebuild libtool when needed | |
85 | LIBTOOL_DEPS=$ltmain | |
86 | ||
87 | # Always use our own libtool. | |
88 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' | |
89 | AC_SUBST(LIBTOOL)dnl | |
90 | ||
91 | _LT_SETUP | |
92 | ||
93 | # Only expand once: | |
94 | m4_define([LT_INIT]) | |
95 | ])# LT_INIT | |
96 | ||
97 | # Old names: | |
98 | AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) | |
99 | AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) | |
100 | dnl aclocal-1.4 backwards compatibility: | |
101 | dnl AC_DEFUN([AC_PROG_LIBTOOL], []) | |
102 | dnl AC_DEFUN([AM_PROG_LIBTOOL], []) | |
103 | ||
104 | ||
105 | # _LT_PREPARE_CC_BASENAME | |
106 | # ----------------------- | |
107 | m4_defun([_LT_PREPARE_CC_BASENAME], [ | |
108 | # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. | |
109 | func_cc_basename () | |
110 | { | |
111 | for cc_temp in @S|@*""; do | |
112 | case $cc_temp in | |
113 | compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; | |
114 | distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; | |
115 | \-*) ;; | |
116 | *) break;; | |
117 | esac | |
118 | done | |
119 | func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` | |
120 | } | |
121 | ])# _LT_PREPARE_CC_BASENAME | |
122 | ||
123 | ||
124 | # _LT_CC_BASENAME(CC) | |
125 | # ------------------- | |
126 | # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, | |
127 | # but that macro is also expanded into generated libtool script, which | |
128 | # arranges for $SED and $ECHO to be set by different means. | |
129 | m4_defun([_LT_CC_BASENAME], | |
130 | [m4_require([_LT_PREPARE_CC_BASENAME])dnl | |
131 | AC_REQUIRE([_LT_DECL_SED])dnl | |
132 | AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl | |
133 | func_cc_basename $1 | |
134 | cc_basename=$func_cc_basename_result | |
135 | ]) | |
136 | ||
137 | ||
138 | # _LT_FILEUTILS_DEFAULTS | |
139 | # ---------------------- | |
140 | # It is okay to use these file commands and assume they have been set | |
141 | # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. | |
142 | m4_defun([_LT_FILEUTILS_DEFAULTS], | |
143 | [: ${CP="cp -f"} | |
144 | : ${MV="mv -f"} | |
145 | : ${RM="rm -f"} | |
146 | ])# _LT_FILEUTILS_DEFAULTS | |
147 | ||
148 | ||
149 | # _LT_SETUP | |
150 | # --------- | |
151 | m4_defun([_LT_SETUP], | |
152 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
153 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
154 | AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl | |
155 | AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl | |
156 | ||
157 | _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl | |
158 | dnl | |
159 | _LT_DECL([], [host_alias], [0], [The host system])dnl | |
160 | _LT_DECL([], [host], [0])dnl | |
161 | _LT_DECL([], [host_os], [0])dnl | |
162 | dnl | |
163 | _LT_DECL([], [build_alias], [0], [The build system])dnl | |
164 | _LT_DECL([], [build], [0])dnl | |
165 | _LT_DECL([], [build_os], [0])dnl | |
166 | dnl | |
167 | AC_REQUIRE([AC_PROG_CC])dnl | |
168 | AC_REQUIRE([LT_PATH_LD])dnl | |
169 | AC_REQUIRE([LT_PATH_NM])dnl | |
170 | dnl | |
171 | AC_REQUIRE([AC_PROG_LN_S])dnl | |
172 | test -z "$LN_S" && LN_S="ln -s" | |
173 | _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl | |
174 | dnl | |
175 | AC_REQUIRE([LT_CMD_MAX_LEN])dnl | |
176 | _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl | |
177 | _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl | |
178 | dnl | |
179 | m4_require([_LT_FILEUTILS_DEFAULTS])dnl | |
180 | m4_require([_LT_CHECK_SHELL_FEATURES])dnl | |
181 | m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl | |
182 | m4_require([_LT_CMD_RELOAD])dnl | |
183 | m4_require([_LT_CHECK_MAGIC_METHOD])dnl | |
184 | m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl | |
185 | m4_require([_LT_CMD_OLD_ARCHIVE])dnl | |
186 | m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl | |
187 | m4_require([_LT_WITH_SYSROOT])dnl | |
188 | m4_require([_LT_CMD_TRUNCATE])dnl | |
189 | ||
190 | _LT_CONFIG_LIBTOOL_INIT([ | |
191 | # See if we are running on zsh, and set the options that allow our | |
192 | # commands through without removal of \ escapes INIT. | |
193 | if test -n "\${ZSH_VERSION+set}"; then | |
194 | setopt NO_GLOB_SUBST | |
195 | fi | |
196 | ]) | |
197 | if test -n "${ZSH_VERSION+set}"; then | |
198 | setopt NO_GLOB_SUBST | |
199 | fi | |
200 | ||
201 | _LT_CHECK_OBJDIR | |
202 | ||
203 | m4_require([_LT_TAG_COMPILER])dnl | |
204 | ||
205 | case $host_os in | |
206 | aix3*) | |
207 | # AIX sometimes has problems with the GCC collect2 program. For some | |
208 | # reason, if we set the COLLECT_NAMES environment variable, the problems | |
209 | # vanish in a puff of smoke. | |
210 | if test set != "${COLLECT_NAMES+set}"; then | |
211 | COLLECT_NAMES= | |
212 | export COLLECT_NAMES | |
213 | fi | |
214 | ;; | |
215 | esac | |
216 | ||
217 | # Global variables: | |
218 | ofile=libtool | |
219 | can_build_shared=yes | |
220 | ||
221 | # All known linkers require a '.a' archive for static linking (except MSVC, | |
222 | # which needs '.lib'). | |
223 | libext=a | |
224 | ||
225 | with_gnu_ld=$lt_cv_prog_gnu_ld | |
226 | ||
227 | old_CC=$CC | |
228 | old_CFLAGS=$CFLAGS | |
229 | ||
230 | # Set sane defaults for various variables | |
231 | test -z "$CC" && CC=cc | |
232 | test -z "$LTCC" && LTCC=$CC | |
233 | test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS | |
234 | test -z "$LD" && LD=ld | |
235 | test -z "$ac_objext" && ac_objext=o | |
236 | ||
237 | _LT_CC_BASENAME([$compiler]) | |
238 | ||
239 | # Only perform the check for file, if the check method requires it | |
240 | test -z "$MAGIC_CMD" && MAGIC_CMD=file | |
241 | case $deplibs_check_method in | |
242 | file_magic*) | |
243 | if test "$file_magic_cmd" = '$MAGIC_CMD'; then | |
244 | _LT_PATH_MAGIC | |
245 | fi | |
246 | ;; | |
247 | esac | |
248 | ||
249 | # Use C for the default configuration in the libtool script | |
250 | LT_SUPPORTED_TAG([CC]) | |
251 | _LT_LANG_C_CONFIG | |
252 | _LT_LANG_DEFAULT_CONFIG | |
253 | _LT_CONFIG_COMMANDS | |
254 | ])# _LT_SETUP | |
255 | ||
256 | ||
257 | # _LT_PREPARE_SED_QUOTE_VARS | |
258 | # -------------------------- | |
259 | # Define a few sed substitution that help us do robust quoting. | |
260 | m4_defun([_LT_PREPARE_SED_QUOTE_VARS], | |
261 | [# Backslashify metacharacters that are still active within | |
262 | # double-quoted strings. | |
263 | sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' | |
264 | ||
265 | # Same as above, but do not quote variable references. | |
266 | double_quote_subst='s/\([["`\\]]\)/\\\1/g' | |
267 | ||
268 | # Sed substitution to delay expansion of an escaped shell variable in a | |
269 | # double_quote_subst'ed string. | |
270 | delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' | |
271 | ||
272 | # Sed substitution to delay expansion of an escaped single quote. | |
273 | delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' | |
274 | ||
275 | # Sed substitution to avoid accidental globbing in evaled expressions | |
276 | no_glob_subst='s/\*/\\\*/g' | |
277 | ]) | |
278 | ||
279 | # _LT_PROG_LTMAIN | |
280 | # --------------- | |
281 | # Note that this code is called both from 'configure', and 'config.status' | |
282 | # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, | |
283 | # 'config.status' has no value for ac_aux_dir unless we are using Automake, | |
284 | # so we pass a copy along to make sure it has a sensible value anyway. | |
285 | m4_defun([_LT_PROG_LTMAIN], | |
286 | [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl | |
287 | _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) | |
288 | ltmain=$ac_aux_dir/ltmain.sh | |
289 | ])# _LT_PROG_LTMAIN | |
290 | ||
291 | ||
292 | ## ------------------------------------- ## | |
293 | ## Accumulate code for creating libtool. ## | |
294 | ## ------------------------------------- ## | |
295 | ||
296 | # So that we can recreate a full libtool script including additional | |
297 | # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS | |
298 | # in macros and then make a single call at the end using the 'libtool' | |
299 | # label. | |
300 | ||
301 | ||
302 | # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) | |
303 | # ---------------------------------------- | |
304 | # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. | |
305 | m4_define([_LT_CONFIG_LIBTOOL_INIT], | |
306 | [m4_ifval([$1], | |
307 | [m4_append([_LT_OUTPUT_LIBTOOL_INIT], | |
308 | [$1 | |
309 | ])])]) | |
310 | ||
311 | # Initialize. | |
312 | m4_define([_LT_OUTPUT_LIBTOOL_INIT]) | |
313 | ||
314 | ||
315 | # _LT_CONFIG_LIBTOOL([COMMANDS]) | |
316 | # ------------------------------ | |
317 | # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. | |
318 | m4_define([_LT_CONFIG_LIBTOOL], | |
319 | [m4_ifval([$1], | |
320 | [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], | |
321 | [$1 | |
322 | ])])]) | |
323 | ||
324 | # Initialize. | |
325 | m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) | |
326 | ||
327 | ||
328 | # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) | |
329 | # ----------------------------------------------------- | |
330 | m4_defun([_LT_CONFIG_SAVE_COMMANDS], | |
331 | [_LT_CONFIG_LIBTOOL([$1]) | |
332 | _LT_CONFIG_LIBTOOL_INIT([$2]) | |
333 | ]) | |
334 | ||
335 | ||
336 | # _LT_FORMAT_COMMENT([COMMENT]) | |
337 | # ----------------------------- | |
338 | # Add leading comment marks to the start of each line, and a trailing | |
339 | # full-stop to the whole comment if one is not present already. | |
340 | m4_define([_LT_FORMAT_COMMENT], | |
341 | [m4_ifval([$1], [ | |
342 | m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], | |
343 | [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) | |
344 | )]) | |
345 | ||
346 | ||
347 | ||
348 | ## ------------------------ ## | |
349 | ## FIXME: Eliminate VARNAME ## | |
350 | ## ------------------------ ## | |
351 | ||
352 | ||
353 | # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) | |
354 | # ------------------------------------------------------------------- | |
355 | # CONFIGNAME is the name given to the value in the libtool script. | |
356 | # VARNAME is the (base) name used in the configure script. | |
357 | # VALUE may be 0, 1 or 2 for a computed quote escaped value based on | |
358 | # VARNAME. Any other value will be used directly. | |
359 | m4_define([_LT_DECL], | |
360 | [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], | |
361 | [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], | |
362 | [m4_ifval([$1], [$1], [$2])]) | |
363 | lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) | |
364 | m4_ifval([$4], | |
365 | [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) | |
366 | lt_dict_add_subkey([lt_decl_dict], [$2], | |
367 | [tagged?], [m4_ifval([$5], [yes], [no])])]) | |
368 | ]) | |
369 | ||
370 | ||
371 | # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) | |
372 | # -------------------------------------------------------- | |
373 | m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) | |
374 | ||
375 | ||
376 | # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) | |
377 | # ------------------------------------------------ | |
378 | m4_define([lt_decl_tag_varnames], | |
379 | [_lt_decl_filter([tagged?], [yes], $@)]) | |
380 | ||
381 | ||
382 | # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) | |
383 | # --------------------------------------------------------- | |
384 | m4_define([_lt_decl_filter], | |
385 | [m4_case([$#], | |
386 | [0], [m4_fatal([$0: too few arguments: $#])], | |
387 | [1], [m4_fatal([$0: too few arguments: $#: $1])], | |
388 | [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], | |
389 | [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], | |
390 | [lt_dict_filter([lt_decl_dict], $@)])[]dnl | |
391 | ]) | |
392 | ||
393 | ||
394 | # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) | |
395 | # -------------------------------------------------- | |
396 | m4_define([lt_decl_quote_varnames], | |
397 | [_lt_decl_filter([value], [1], $@)]) | |
398 | ||
399 | ||
400 | # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) | |
401 | # --------------------------------------------------- | |
402 | m4_define([lt_decl_dquote_varnames], | |
403 | [_lt_decl_filter([value], [2], $@)]) | |
404 | ||
405 | ||
406 | # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) | |
407 | # --------------------------------------------------- | |
408 | m4_define([lt_decl_varnames_tagged], | |
409 | [m4_assert([$# <= 2])dnl | |
410 | _$0(m4_quote(m4_default([$1], [[, ]])), | |
411 | m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), | |
412 | m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) | |
413 | m4_define([_lt_decl_varnames_tagged], | |
414 | [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) | |
415 | ||
416 | ||
417 | # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) | |
418 | # ------------------------------------------------ | |
419 | m4_define([lt_decl_all_varnames], | |
420 | [_$0(m4_quote(m4_default([$1], [[, ]])), | |
421 | m4_if([$2], [], | |
422 | m4_quote(lt_decl_varnames), | |
423 | m4_quote(m4_shift($@))))[]dnl | |
424 | ]) | |
425 | m4_define([_lt_decl_all_varnames], | |
426 | [lt_join($@, lt_decl_varnames_tagged([$1], | |
427 | lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl | |
428 | ]) | |
429 | ||
430 | ||
431 | # _LT_CONFIG_STATUS_DECLARE([VARNAME]) | |
432 | # ------------------------------------ | |
433 | # Quote a variable value, and forward it to 'config.status' so that its | |
434 | # declaration there will have the same value as in 'configure'. VARNAME | |
435 | # must have a single quote delimited value for this to work. | |
436 | m4_define([_LT_CONFIG_STATUS_DECLARE], | |
437 | [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) | |
438 | ||
439 | ||
440 | # _LT_CONFIG_STATUS_DECLARATIONS | |
441 | # ------------------------------ | |
442 | # We delimit libtool config variables with single quotes, so when | |
443 | # we write them to config.status, we have to be sure to quote all | |
444 | # embedded single quotes properly. In configure, this macro expands | |
445 | # each variable declared with _LT_DECL (and _LT_TAGDECL) into: | |
446 | # | |
447 | # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' | |
448 | m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], | |
449 | [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), | |
450 | [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) | |
451 | ||
452 | ||
453 | # _LT_LIBTOOL_TAGS | |
454 | # ---------------- | |
455 | # Output comment and list of tags supported by the script | |
456 | m4_defun([_LT_LIBTOOL_TAGS], | |
457 | [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl | |
458 | available_tags='_LT_TAGS'dnl | |
459 | ]) | |
460 | ||
461 | ||
462 | # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) | |
463 | # ----------------------------------- | |
464 | # Extract the dictionary values for VARNAME (optionally with TAG) and | |
465 | # expand to a commented shell variable setting: | |
466 | # | |
467 | # # Some comment about what VAR is for. | |
468 | # visible_name=$lt_internal_name | |
469 | m4_define([_LT_LIBTOOL_DECLARE], | |
470 | [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], | |
471 | [description])))[]dnl | |
472 | m4_pushdef([_libtool_name], | |
473 | m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl | |
474 | m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), | |
475 | [0], [_libtool_name=[$]$1], | |
476 | [1], [_libtool_name=$lt_[]$1], | |
477 | [2], [_libtool_name=$lt_[]$1], | |
478 | [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl | |
479 | m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl | |
480 | ]) | |
481 | ||
482 | ||
483 | # _LT_LIBTOOL_CONFIG_VARS | |
484 | # ----------------------- | |
485 | # Produce commented declarations of non-tagged libtool config variables | |
486 | # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' | |
487 | # script. Tagged libtool config variables (even for the LIBTOOL CONFIG | |
488 | # section) are produced by _LT_LIBTOOL_TAG_VARS. | |
489 | m4_defun([_LT_LIBTOOL_CONFIG_VARS], | |
490 | [m4_foreach([_lt_var], | |
491 | m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), | |
492 | [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) | |
493 | ||
494 | ||
495 | # _LT_LIBTOOL_TAG_VARS(TAG) | |
496 | # ------------------------- | |
497 | m4_define([_LT_LIBTOOL_TAG_VARS], | |
498 | [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), | |
499 | [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) | |
500 | ||
501 | ||
502 | # _LT_TAGVAR(VARNAME, [TAGNAME]) | |
503 | # ------------------------------ | |
504 | m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) | |
505 | ||
506 | ||
507 | # _LT_CONFIG_COMMANDS | |
508 | # ------------------- | |
509 | # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of | |
510 | # variables for single and double quote escaping we saved from calls | |
511 | # to _LT_DECL, we can put quote escaped variables declarations | |
512 | # into 'config.status', and then the shell code to quote escape them in | |
513 | # for loops in 'config.status'. Finally, any additional code accumulated | |
514 | # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. | |
515 | m4_defun([_LT_CONFIG_COMMANDS], | |
516 | [AC_PROVIDE_IFELSE([LT_OUTPUT], | |
517 | dnl If the libtool generation code has been placed in $CONFIG_LT, | |
518 | dnl instead of duplicating it all over again into config.status, | |
519 | dnl then we will have config.status run $CONFIG_LT later, so it | |
520 | dnl needs to know what name is stored there: | |
521 | [AC_CONFIG_COMMANDS([libtool], | |
522 | [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], | |
523 | dnl If the libtool generation code is destined for config.status, | |
524 | dnl expand the accumulated commands and init code now: | |
525 | [AC_CONFIG_COMMANDS([libtool], | |
526 | [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) | |
527 | ])#_LT_CONFIG_COMMANDS | |
528 | ||
529 | ||
530 | # Initialize. | |
531 | m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], | |
532 | [ | |
533 | ||
534 | # The HP-UX ksh and POSIX shell print the target directory to stdout | |
535 | # if CDPATH is set. | |
536 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
537 | ||
538 | sed_quote_subst='$sed_quote_subst' | |
539 | double_quote_subst='$double_quote_subst' | |
540 | delay_variable_subst='$delay_variable_subst' | |
541 | _LT_CONFIG_STATUS_DECLARATIONS | |
542 | LTCC='$LTCC' | |
543 | LTCFLAGS='$LTCFLAGS' | |
544 | compiler='$compiler_DEFAULT' | |
545 | ||
546 | # A function that is used when there is no print builtin or printf. | |
547 | func_fallback_echo () | |
548 | { | |
549 | eval 'cat <<_LTECHO_EOF | |
550 | \$[]1 | |
551 | _LTECHO_EOF' | |
552 | } | |
553 | ||
554 | # Quote evaled strings. | |
555 | for var in lt_decl_all_varnames([[ \ | |
556 | ]], lt_decl_quote_varnames); do | |
557 | case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in | |
558 | *[[\\\\\\\`\\"\\\$]]*) | |
559 | eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes | |
560 | ;; | |
561 | *) | |
562 | eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" | |
563 | ;; | |
564 | esac | |
565 | done | |
566 | ||
567 | # Double-quote double-evaled strings. | |
568 | for var in lt_decl_all_varnames([[ \ | |
569 | ]], lt_decl_dquote_varnames); do | |
570 | case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in | |
571 | *[[\\\\\\\`\\"\\\$]]*) | |
572 | eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes | |
573 | ;; | |
574 | *) | |
575 | eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" | |
576 | ;; | |
577 | esac | |
578 | done | |
579 | ||
580 | _LT_OUTPUT_LIBTOOL_INIT | |
581 | ]) | |
582 | ||
583 | # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) | |
584 | # ------------------------------------ | |
585 | # Generate a child script FILE with all initialization necessary to | |
586 | # reuse the environment learned by the parent script, and make the | |
587 | # file executable. If COMMENT is supplied, it is inserted after the | |
588 | # '#!' sequence but before initialization text begins. After this | |
589 | # macro, additional text can be appended to FILE to form the body of | |
590 | # the child script. The macro ends with non-zero status if the | |
591 | # file could not be fully written (such as if the disk is full). | |
592 | m4_ifdef([AS_INIT_GENERATED], | |
593 | [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], | |
594 | [m4_defun([_LT_GENERATED_FILE_INIT], | |
595 | [m4_require([AS_PREPARE])]dnl | |
596 | [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl | |
597 | [lt_write_fail=0 | |
598 | cat >$1 <<_ASEOF || lt_write_fail=1 | |