Initial commit
Amtk has been developed inside the Tepl git repository first. Now
extract Amtk from Tepl, so that projects like Devhelp can use Amtk
without depending on Tepl, GtkSourceView, uchardet, etc.
Sébastien Wilmet
6 years ago
0 | GNU LESSER GENERAL PUBLIC LICENSE | |
1 | Version 2.1, February 1999 | |
2 | ||
3 | Copyright (C) 1991, 1999 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 | [This is the first released version of the Lesser GPL. It also counts | |
9 | as the successor of the GNU Library Public License, version 2, hence | |
10 | the version number 2.1.] | |
11 | ||
12 | Preamble | |
13 | ||
14 | The licenses for most software are designed to take away your | |
15 | freedom to share and change it. By contrast, the GNU General Public | |
16 | Licenses are intended to guarantee your freedom to share and change | |
17 | free software--to make sure the software is free for all its users. | |
18 | ||
19 | This license, the Lesser General Public License, applies to some | |
20 | specially designated software packages--typically libraries--of the | |
21 | Free Software Foundation and other authors who decide to use it. You | |
22 | can use it too, but we suggest you first think carefully about whether | |
23 | this license or the ordinary General Public License is the better | |
24 | strategy to use in any particular case, based on the explanations below. | |
25 | ||
26 | When we speak of free software, we are referring to freedom of use, | |
27 | not price. Our General Public Licenses are designed to make sure that | |
28 | you have the freedom to distribute copies of free software (and charge | |
29 | for this service if you wish); that you receive source code or can get | |
30 | it if you want it; that you can change the software and use pieces of | |
31 | it in new free programs; and that you are informed that you can do | |
32 | these things. | |
33 | ||
34 | To protect your rights, we need to make restrictions that forbid | |
35 | distributors to deny you these rights or to ask you to surrender these | |
36 | rights. These restrictions translate to certain responsibilities for | |
37 | you if you distribute copies of the library or if you modify it. | |
38 | ||
39 | For example, if you distribute copies of the library, whether gratis | |
40 | or for a fee, you must give the recipients all the rights that we gave | |
41 | you. You must make sure that they, too, receive or can get the source | |
42 | code. If you link other code with the library, you must provide | |
43 | complete object files to the recipients, so that they can relink them | |
44 | with the library after making changes to the library and recompiling | |
45 | it. And you must show them these terms so they know their rights. | |
46 | ||
47 | We protect your rights with a two-step method: (1) we copyright the | |
48 | library, and (2) we offer you this license, which gives you legal | |
49 | permission to copy, distribute and/or modify the library. | |
50 | ||
51 | To protect each distributor, we want to make it very clear that | |
52 | there is no warranty for the free library. Also, if the library is | |
53 | modified by someone else and passed on, the recipients should know | |
54 | that what they have is not the original version, so that the original | |
55 | author's reputation will not be affected by problems that might be | |
56 | introduced by others. | |
57 | ||
58 | Finally, software patents pose a constant threat to the existence of | |
59 | any free program. We wish to make sure that a company cannot | |
60 | effectively restrict the users of a free program by obtaining a | |
61 | restrictive license from a patent holder. Therefore, we insist that | |
62 | any patent license obtained for a version of the library must be | |
63 | consistent with the full freedom of use specified in this license. | |
64 | ||
65 | Most GNU software, including some libraries, is covered by the | |
66 | ordinary GNU General Public License. This license, the GNU Lesser | |
67 | General Public License, applies to certain designated libraries, and | |
68 | is quite different from the ordinary General Public License. We use | |
69 | this license for certain libraries in order to permit linking those | |
70 | libraries into non-free programs. | |
71 | ||
72 | When a program is linked with a library, whether statically or using | |
73 | a shared library, the combination of the two is legally speaking a | |
74 | combined work, a derivative of the original library. The ordinary | |
75 | General Public License therefore permits such linking only if the | |
76 | entire combination fits its criteria of freedom. The Lesser General | |
77 | Public License permits more lax criteria for linking other code with | |
78 | the library. | |
79 | ||
80 | We call this license the "Lesser" General Public License because it | |
81 | does Less to protect the user's freedom than the ordinary General | |
82 | Public License. It also provides other free software developers Less | |
83 | of an advantage over competing non-free programs. These disadvantages | |
84 | are the reason we use the ordinary General Public License for many | |
85 | libraries. However, the Lesser license provides advantages in certain | |
86 | special circumstances. | |
87 | ||
88 | For example, on rare occasions, there may be a special need to | |
89 | encourage the widest possible use of a certain library, so that it becomes | |
90 | a de-facto standard. To achieve this, non-free programs must be | |
91 | allowed to use the library. A more frequent case is that a free | |
92 | library does the same job as widely used non-free libraries. In this | |
93 | case, there is little to gain by limiting the free library to free | |
94 | software only, so we use the Lesser General Public License. | |
95 | ||
96 | In other cases, permission to use a particular library in non-free | |
97 | programs enables a greater number of people to use a large body of | |
98 | free software. For example, permission to use the GNU C Library in | |
99 | non-free programs enables many more people to use the whole GNU | |
100 | operating system, as well as its variant, the GNU/Linux operating | |
101 | system. | |
102 | ||
103 | Although the Lesser General Public License is Less protective of the | |
104 | users' freedom, it does ensure that the user of a program that is | |
105 | linked with the Library has the freedom and the wherewithal to run | |
106 | that program using a modified version of the Library. | |
107 | ||
108 | The precise terms and conditions for copying, distribution and | |
109 | modification follow. Pay close attention to the difference between a | |
110 | "work based on the library" and a "work that uses the library". The | |
111 | former contains code derived from the library, whereas the latter must | |
112 | be combined with the library in order to run. | |
113 | ||
114 | GNU LESSER GENERAL PUBLIC LICENSE | |
115 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
116 | ||
117 | 0. This License Agreement applies to any software library or other | |
118 | program which contains a notice placed by the copyright holder or | |
119 | other authorized party saying it may be distributed under the terms of | |
120 | this Lesser General Public License (also called "this License"). | |
121 | Each licensee is addressed as "you". | |
122 | ||
123 | A "library" means a collection of software functions and/or data | |
124 | prepared so as to be conveniently linked with application programs | |
125 | (which use some of those functions and data) to form executables. | |
126 | ||
127 | The "Library", below, refers to any such software library or work | |
128 | which has been distributed under these terms. A "work based on the | |
129 | Library" means either the Library or any derivative work under | |
130 | copyright law: that is to say, a work containing the Library or a | |
131 | portion of it, either verbatim or with modifications and/or translated | |
132 | straightforwardly into another language. (Hereinafter, translation is | |
133 | included without limitation in the term "modification".) | |
134 | ||
135 | "Source code" for a work means the preferred form of the work for | |
136 | making modifications to it. For a library, complete source code means | |
137 | all the source code for all modules it contains, plus any associated | |
138 | interface definition files, plus the scripts used to control compilation | |
139 | and installation of the library. | |
140 | ||
141 | Activities other than copying, distribution and modification are not | |
142 | covered by this License; they are outside its scope. The act of | |
143 | running a program using the Library is not restricted, and output from | |
144 | such a program is covered only if its contents constitute a work based | |
145 | on the Library (independent of the use of the Library in a tool for | |
146 | writing it). Whether that is true depends on what the Library does | |
147 | and what the program that uses the Library does. | |
148 | ||
149 | 1. You may copy and distribute verbatim copies of the Library's | |
150 | complete source code as you receive it, in any medium, provided that | |
151 | you conspicuously and appropriately publish on each copy an | |
152 | appropriate copyright notice and disclaimer of warranty; keep intact | |
153 | all the notices that refer to this License and to the absence of any | |
154 | warranty; and distribute a copy of this License along with the | |
155 | Library. | |
156 | ||
157 | You may charge a fee for the physical act of transferring a copy, | |
158 | and you may at your option offer warranty protection in exchange for a | |
159 | fee. | |
160 | ||
161 | 2. You may modify your copy or copies of the Library or any portion | |
162 | of it, thus forming a work based on the Library, and copy and | |
163 | distribute such modifications or work under the terms of Section 1 | |
164 | above, provided that you also meet all of these conditions: | |
165 | ||
166 | a) The modified work must itself be a software library. | |
167 | ||
168 | b) You must cause the files modified to carry prominent notices | |
169 | stating that you changed the files and the date of any change. | |
170 | ||
171 | c) You must cause the whole of the work to be licensed at no | |
172 | charge to all third parties under the terms of this License. | |
173 | ||
174 | d) If a facility in the modified Library refers to a function or a | |
175 | table of data to be supplied by an application program that uses | |
176 | the facility, other than as an argument passed when the facility | |
177 | is invoked, then you must make a good faith effort to ensure that, | |
178 | in the event an application does not supply such function or | |
179 | table, the facility still operates, and performs whatever part of | |
180 | its purpose remains meaningful. | |
181 | ||
182 | (For example, a function in a library to compute square roots has | |
183 | a purpose that is entirely well-defined independent of the | |
184 | application. Therefore, Subsection 2d requires that any | |
185 | application-supplied function or table used by this function must | |
186 | be optional: if the application does not supply it, the square | |
187 | root function must still compute square roots.) | |
188 | ||
189 | These requirements apply to the modified work as a whole. If | |
190 | identifiable sections of that work are not derived from the Library, | |
191 | and can be reasonably considered independent and separate works in | |
192 | themselves, then this License, and its terms, do not apply to those | |
193 | sections when you distribute them as separate works. But when you | |
194 | distribute the same sections as part of a whole which is a work based | |
195 | on the Library, the distribution of the whole must be on the terms of | |
196 | this License, whose permissions for other licensees extend to the | |
197 | entire whole, and thus to each and every part regardless of who wrote | |
198 | it. | |
199 | ||
200 | Thus, it is not the intent of this section to claim rights or contest | |
201 | your rights to work written entirely by you; rather, the intent is to | |
202 | exercise the right to control the distribution of derivative or | |
203 | collective works based on the Library. | |
204 | ||
205 | In addition, mere aggregation of another work not based on the Library | |
206 | with the Library (or with a work based on the Library) on a volume of | |
207 | a storage or distribution medium does not bring the other work under | |
208 | the scope of this License. | |
209 | ||
210 | 3. You may opt to apply the terms of the ordinary GNU General Public | |
211 | License instead of this License to a given copy of the Library. To do | |
212 | this, you must alter all the notices that refer to this License, so | |
213 | that they refer to the ordinary GNU General Public License, version 2, | |
214 | instead of to this License. (If a newer version than version 2 of the | |
215 | ordinary GNU General Public License has appeared, then you can specify | |
216 | that version instead if you wish.) Do not make any other change in | |
217 | these notices. | |
218 | ||
219 | Once this change is made in a given copy, it is irreversible for | |
220 | that copy, so the ordinary GNU General Public License applies to all | |
221 | subsequent copies and derivative works made from that copy. | |
222 | ||
223 | This option is useful when you wish to copy part of the code of | |
224 | the Library into a program that is not a library. | |
225 | ||
226 | 4. You may copy and distribute the Library (or a portion or | |
227 | derivative of it, under Section 2) in object code or executable form | |
228 | under the terms of Sections 1 and 2 above provided that you accompany | |
229 | it with the complete corresponding machine-readable source code, which | |
230 | must be distributed under the terms of Sections 1 and 2 above on a | |
231 | medium customarily used for software interchange. | |
232 | ||
233 | If distribution of object code is made by offering access to copy | |
234 | from a designated place, then offering equivalent access to copy the | |
235 | source code from the same place satisfies the requirement to | |
236 | distribute the source code, even though third parties are not | |
237 | compelled to copy the source along with the object code. | |
238 | ||
239 | 5. A program that contains no derivative of any portion of the | |
240 | Library, but is designed to work with the Library by being compiled or | |
241 | linked with it, is called a "work that uses the Library". Such a | |
242 | work, in isolation, is not a derivative work of the Library, and | |
243 | therefore falls outside the scope of this License. | |
244 | ||
245 | However, linking a "work that uses the Library" with the Library | |
246 | creates an executable that is a derivative of the Library (because it | |
247 | contains portions of the Library), rather than a "work that uses the | |
248 | library". The executable is therefore covered by this License. | |
249 | Section 6 states terms for distribution of such executables. | |
250 | ||
251 | When a "work that uses the Library" uses material from a header file | |
252 | that is part of the Library, the object code for the work may be a | |
253 | derivative work of the Library even though the source code is not. | |
254 | Whether this is true is especially significant if the work can be | |
255 | linked without the Library, or if the work is itself a library. The | |
256 | threshold for this to be true is not precisely defined by law. | |
257 | ||
258 | If such an object file uses only numerical parameters, data | |
259 | structure layouts and accessors, and small macros and small inline | |
260 | functions (ten lines or less in length), then the use of the object | |
261 | file is unrestricted, regardless of whether it is legally a derivative | |
262 | work. (Executables containing this object code plus portions of the | |
263 | Library will still fall under Section 6.) | |
264 | ||
265 | Otherwise, if the work is a derivative of the Library, you may | |
266 | distribute the object code for the work under the terms of Section 6. | |
267 | Any executables containing that work also fall under Section 6, | |
268 | whether or not they are linked directly with the Library itself. | |
269 | ||
270 | 6. As an exception to the Sections above, you may also combine or | |
271 | link a "work that uses the Library" with the Library to produce a | |
272 | work containing portions of the Library, and distribute that work | |
273 | under terms of your choice, provided that the terms permit | |
274 | modification of the work for the customer's own use and reverse | |
275 | engineering for debugging such modifications. | |
276 | ||
277 | You must give prominent notice with each copy of the work that the | |
278 | Library is used in it and that the Library and its use are covered by | |
279 | this License. You must supply a copy of this License. If the work | |
280 | during execution displays copyright notices, you must include the | |
281 | copyright notice for the Library among them, as well as a reference | |
282 | directing the user to the copy of this License. Also, you must do one | |
283 | of these things: | |
284 | ||
285 | a) Accompany the work with the complete corresponding | |
286 | machine-readable source code for the Library including whatever | |
287 | changes were used in the work (which must be distributed under | |
288 | Sections 1 and 2 above); and, if the work is an executable linked | |
289 | with the Library, with the complete machine-readable "work that | |
290 | uses the Library", as object code and/or source code, so that the | |
291 | user can modify the Library and then relink to produce a modified | |
292 | executable containing the modified Library. (It is understood | |
293 | that the user who changes the contents of definitions files in the | |
294 | Library will not necessarily be able to recompile the application | |
295 | to use the modified definitions.) | |
296 | ||
297 | b) Use a suitable shared library mechanism for linking with the | |
298 | Library. A suitable mechanism is one that (1) uses at run time a | |
299 | copy of the library already present on the user's computer system, | |
300 | rather than copying library functions into the executable, and (2) | |
301 | will operate properly with a modified version of the library, if | |
302 | the user installs one, as long as the modified version is | |
303 | interface-compatible with the version that the work was made with. | |
304 | ||
305 | c) Accompany the work with a written offer, valid for at | |
306 | least three years, to give the same user the materials | |
307 | specified in Subsection 6a, above, for a charge no more | |
308 | than the cost of performing this distribution. | |
309 | ||
310 | d) If distribution of the work is made by offering access to copy | |
311 | from a designated place, offer equivalent access to copy the above | |
312 | specified materials from the same place. | |
313 | ||
314 | e) Verify that the user has already received a copy of these | |
315 | materials or that you have already sent this user a copy. | |
316 | ||
317 | For an executable, the required form of the "work that uses the | |
318 | Library" must include any data and utility programs needed for | |
319 | reproducing the executable from it. However, as a special exception, | |
320 | the materials to be distributed need not include anything that is | |
321 | normally distributed (in either source or binary form) with the major | |
322 | components (compiler, kernel, and so on) of the operating system on | |
323 | which the executable runs, unless that component itself accompanies | |
324 | the executable. | |
325 | ||
326 | It may happen that this requirement contradicts the license | |
327 | restrictions of other proprietary libraries that do not normally | |
328 | accompany the operating system. Such a contradiction means you cannot | |
329 | use both them and the Library together in an executable that you | |
330 | distribute. | |
331 | ||
332 | 7. You may place library facilities that are a work based on the | |
333 | Library side-by-side in a single library together with other library | |
334 | facilities not covered by this License, and distribute such a combined | |
335 | library, provided that the separate distribution of the work based on | |
336 | the Library and of the other library facilities is otherwise | |
337 | permitted, and provided that you do these two things: | |
338 | ||
339 | a) Accompany the combined library with a copy of the same work | |
340 | based on the Library, uncombined with any other library | |
341 | facilities. This must be distributed under the terms of the | |
342 | Sections above. | |
343 | ||
344 | b) Give prominent notice with the combined library of the fact | |
345 | that part of it is a work based on the Library, and explaining | |
346 | where to find the accompanying uncombined form of the same work. | |
347 | ||
348 | 8. You may not copy, modify, sublicense, link with, or distribute | |
349 | the Library except as expressly provided under this License. Any | |
350 | attempt otherwise to copy, modify, sublicense, link with, or | |
351 | distribute the Library is void, and will automatically terminate your | |
352 | rights under this License. However, parties who have received copies, | |
353 | or rights, from you under this License will not have their licenses | |
354 | terminated so long as such parties remain in full compliance. | |
355 | ||
356 | 9. You are not required to accept this License, since you have not | |
357 | signed it. However, nothing else grants you permission to modify or | |
358 | distribute the Library or its derivative works. These actions are | |
359 | prohibited by law if you do not accept this License. Therefore, by | |
360 | modifying or distributing the Library (or any work based on the | |
361 | Library), you indicate your acceptance of this License to do so, and | |
362 | all its terms and conditions for copying, distributing or modifying | |
363 | the Library or works based on it. | |
364 | ||
365 | 10. Each time you redistribute the Library (or any work based on the | |
366 | Library), the recipient automatically receives a license from the | |
367 | original licensor to copy, distribute, link with or modify the Library | |
368 | subject to these terms and conditions. You may not impose any further | |
369 | restrictions on the recipients' exercise of the rights granted herein. | |
370 | You are not responsible for enforcing compliance by third parties with | |
371 | this License. | |
372 | ||
373 | 11. If, as a consequence of a court judgment or allegation of patent | |
374 | infringement or for any other reason (not limited to patent issues), | |
375 | conditions are imposed on you (whether by court order, agreement or | |
376 | otherwise) that contradict the conditions of this License, they do not | |
377 | excuse you from the conditions of this License. If you cannot | |
378 | distribute so as to satisfy simultaneously your obligations under this | |
379 | License and any other pertinent obligations, then as a consequence you | |
380 | may not distribute the Library at all. For example, if a patent | |
381 | license would not permit royalty-free redistribution of the Library by | |
382 | all those who receive copies directly or indirectly through you, then | |
383 | the only way you could satisfy both it and this License would be to | |
384 | refrain entirely from distribution of the Library. | |
385 | ||
386 | If any portion of this section is held invalid or unenforceable under any | |
387 | particular circumstance, the balance of the section is intended to apply, | |
388 | and the section as a whole is intended to apply in other circumstances. | |
389 | ||
390 | It is not the purpose of this section to induce you to infringe any | |
391 | patents or other property right claims or to contest validity of any | |
392 | such claims; this section has the sole purpose of protecting the | |
393 | integrity of the free software distribution system which is | |
394 | implemented by public license practices. Many people have made | |
395 | generous contributions to the wide range of software distributed | |
396 | through that system in reliance on consistent application of that | |
397 | system; it is up to the author/donor to decide if he or she is willing | |
398 | to distribute software through any other system and a licensee cannot | |
399 | impose that choice. | |
400 | ||
401 | This section is intended to make thoroughly clear what is believed to | |
402 | be a consequence of the rest of this License. | |
403 | ||
404 | 12. If the distribution and/or use of the Library is restricted in | |
405 | certain countries either by patents or by copyrighted interfaces, the | |
406 | original copyright holder who places the Library under this License may add | |
407 | an explicit geographical distribution limitation excluding those countries, | |
408 | so that distribution is permitted only in or among countries not thus | |
409 | excluded. In such case, this License incorporates the limitation as if | |
410 | written in the body of this License. | |
411 | ||
412 | 13. The Free Software Foundation may publish revised and/or new | |
413 | versions of the Lesser General Public License from time to time. | |
414 | Such new versions will be similar in spirit to the present version, | |
415 | but may differ in detail to address new problems or concerns. | |
416 | ||
417 | Each version is given a distinguishing version number. If the Library | |
418 | specifies a version number of this License which applies to it and | |
419 | "any later version", you have the option of following the terms and | |
420 | conditions either of that version or of any later version published by | |
421 | the Free Software Foundation. If the Library does not specify a | |
422 | license version number, you may choose any version ever published by | |
423 | the Free Software Foundation. | |
424 | ||
425 | 14. If you wish to incorporate parts of the Library into other free | |
426 | programs whose distribution conditions are incompatible with these, | |
427 | write to the author to ask for permission. For software which is | |
428 | copyrighted by the Free Software Foundation, write to the Free | |
429 | Software Foundation; we sometimes make exceptions for this. Our | |
430 | decision will be guided by the two goals of preserving the free status | |
431 | of all derivatives of our free software and of promoting the sharing | |
432 | and reuse of software generally. | |
433 | ||
434 | NO WARRANTY | |
435 | ||
436 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | |
437 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | |
438 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | |
439 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | |
440 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | |
441 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
442 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | |
443 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | |
444 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
445 | ||
446 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | |
447 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | |
448 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | |
449 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | |
450 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | |
451 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | |
452 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | |
453 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | |
454 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | |
455 | DAMAGES. | |
456 | ||
457 | END OF TERMS AND CONDITIONS | |
458 | ||
459 | How to Apply These Terms to Your New Libraries | |
460 | ||
461 | If you develop a new library, and you want it to be of the greatest | |
462 | possible use to the public, we recommend making it free software that | |
463 | everyone can redistribute and change. You can do so by permitting | |
464 | redistribution under these terms (or, alternatively, under the terms of the | |
465 | ordinary General Public License). | |
466 | ||
467 | To apply these terms, attach the following notices to the library. It is | |
468 | safest to attach them to the start of each source file to most effectively | |
469 | convey the exclusion of warranty; and each file should have at least the | |
470 | "copyright" line and a pointer to where the full notice is found. | |
471 | ||
472 | <one line to give the library's name and a brief idea of what it does.> | |
473 | Copyright (C) <year> <name of author> | |
474 | ||
475 | This library is free software; you can redistribute it and/or | |
476 | modify it under the terms of the GNU Lesser General Public | |
477 | License as published by the Free Software Foundation; either | |
478 | version 2.1 of the License, or (at your option) any later version. | |
479 | ||
480 | This library is distributed in the hope that it will be useful, | |
481 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
482 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
483 | Lesser General Public License for more details. | |
484 | ||
485 | You should have received a copy of the GNU Lesser General Public | |
486 | License along with this library; if not, write to the Free Software | |
487 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
488 | ||
489 | Also add information on how to contact you by electronic and paper mail. | |
490 | ||
491 | You should also get your employer (if you work as a programmer) or your | |
492 | school, if any, to sign a "copyright disclaimer" for the library, if | |
493 | necessary. Here is a sample; alter the names: | |
494 | ||
495 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
496 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | |
497 | ||
498 | <signature of Ty Coon>, 1 April 1990 | |
499 | Ty Coon, President of Vice | |
500 | ||
501 | That's all there is to it! |
0 | How to contribute to Tepl | |
1 | ========================= | |
2 | ||
3 | Tepl follows the same guidelines and code conventions as GtkSourceView: | |
4 | ||
5 | https://git.gnome.org/browse/gtksourceview/tree/HACKING | |
6 | ||
7 | Tepl is hosted on the GNOME GitLab instance, you can fork the repository | |
8 | and then do a merge request: | |
9 | ||
10 | https://gitlab.gnome.org/GNOME/tepl | |
11 | ||
12 | Read the following wiki page to know the conventions for the commit messages: | |
13 | ||
14 | https://wiki.gnome.org/Git/CommitMessages |
0 | SUBDIRS = po amtk tests testsuite docs | |
1 | ||
2 | @CODE_COVERAGE_RULES@ | |
3 | ||
4 | AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection | |
5 | ||
6 | pkgconfig_DATA = amtk-$(AMTK_API_VERSION).pc | |
7 | ||
8 | DISTCLEANFILES = $(pkgconfig_DATA) | |
9 | ||
10 | EXTRA_DIST = \ | |
11 | amtk.doap \ | |
12 | amtk.pc.in \ | |
13 | HACKING | |
14 | ||
15 | MAINTAINERCLEANFILES = \ | |
16 | $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ | |
17 | $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ | |
18 | $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ | |
19 | gtk-doc.make \ | |
20 | INSTALL | |
21 | ||
22 | -include $(top_srcdir)/git.mk |
0 | News in 4.0.0, 2018-04-08 | |
1 | ------------------------- | |
2 | - Project moved to GNOME GitLab. | |
3 | - Various small improvements. | |
4 | - Translation updates. | |
5 | ||
6 | News in 3.99.1, 2017-12-09 | |
7 | -------------------------- | |
8 | ||
9 | * General: | |
10 | - Use GtkSourceView 4. | |
11 | ||
12 | * Amtk: | |
13 | - Improve amtk_utils_bind_g_action_to_gtk_action() to support _detailed_ | |
14 | GAction names. | |
15 | - Add amtk_utils_create_gtk_action(). | |
16 | ||
17 | * Framework: | |
18 | - Add more GAction's and corresponding AmtkActionInfo's: | |
19 | - win.tepl-undo | |
20 | - win.tepl-redo | |
21 | - win.tepl-indent | |
22 | - win.tepl-unindent | |
23 | - win.tepl-open | |
24 | - win.tepl-save | |
25 | - win.tepl-save-as | |
26 | - app.tepl-new-window | |
27 | - Add TeplApplicationWindow:handle-title boolean property to handle the window | |
28 | title. | |
29 | - Add more vfuncs to TeplAbstractFactory: create_file and create_main_window. | |
30 | - Add TeplAbstractFactoryVala class to work-around Vala bugs. | |
31 | - Add functions related to main windows: | |
32 | - tepl_application_get_active_main_window() | |
33 | - tepl_application_window_is_main_window() | |
34 | - tepl_application_window_get_window_group() | |
35 | - TeplApplication: add options to handle the GApplication::activate and | |
36 | GApplication::open signals. | |
37 | - Start to write high-level functions for loading and saving files. | |
38 | - On Tab::close-request, show close confirmation dialog. | |
39 | ||
40 | * File loading and saving toolkit: | |
41 | - TeplFileLoader: | |
42 | - Internal code refactorings to have more re-usable code independent of | |
43 | GtkTextView. | |
44 | - Add fallback mode to determine encoding if uchardet fails. | |
45 | - Write more unit tests. | |
46 | - TeplEncoding: | |
47 | - Make tepl_encoding_get_default_candidates() more robust in case of | |
48 | mis-translation. | |
49 | - Improve API documentation. | |
50 | - Write GtkSourceView to Tepl file loading and saving porting guide. | |
51 | ||
52 | * Misc: | |
53 | - Translation updates. | |
54 | ||
55 | News in 3.0.0, 2017-09-09 | |
56 | ------------------------- | |
57 | ||
58 | * Translation updates. | |
59 | ||
60 | News in 2.99.4, 2017-08-20 | |
61 | -------------------------- | |
62 | ||
63 | Amtk: | |
64 | * Add factory functions to create GtkMenuToolButton's and GtkCheckMenuItem's. | |
65 | * Improve API of amtk_application_window_connect_menu_to_statusbar(). | |
66 | * Add amtk_utils_bind_g_action_to_gtk_action(), to be able to port an | |
67 | application gradually to GAction while still using GtkUIManager. | |
68 | ||
69 | Framework: | |
70 | * TeplTabLabel: add an overridable tooltip API, by default the tooltip shows | |
71 | the file location. | |
72 | ||
73 | News in 2.99.3, 2017-08-09 | |
74 | -------------------------- | |
75 | ||
76 | Amtk: | |
77 | * Add amtk_init() and amtk_finalize(). | |
78 | * Remove AmtkFactoryMenu class, move its functions to its parent class | |
79 | AmtkFactory. | |
80 | * AmtkFactory: add functions to create GtkToolItem's. | |
81 | * Add amtk_application_window_create_open_recent_menu(). | |
82 | * Improvements to the documentation. | |
83 | * Other small code improvements. | |
84 | ||
85 | Framework: | |
86 | * TeplTabGroup interface: | |
87 | * Add :active-tab, :active-view and :active-buffer properties. | |
88 | * Add tepl_tab_group_set_active_tab(). | |
89 | * Add tepl_tab_group_append_tab(). | |
90 | * Finish to implement the GActions for the Edit menu: cut, copy, paste, delete | |
91 | and select all. (Update the GAction:enabled properties). | |
92 | * Add "win.tepl-new-file" GAction. | |
93 | * Add the TeplAbstractFactory class to create TeplTab's and tab labels. | |
94 | * TeplBuffer: rename title -> full-title and add short-title. | |
95 | * Add the TeplTab::close-request signal. | |
96 | * Add the TeplTabLabel class (which shows the buffer short-title, plus a close | |
97 | button; the tooltip is not yet handled). | |
98 | ||
99 | Misc: | |
100 | * Add tepl_init() and tepl_finalize(), do not use DSO constructors/destructors. | |
101 | * Implement small internal utility: TeplSignalGroup, inspired by DzlSignalGroup | |
102 | from libdazzle, but with a much simpler implementation. | |
103 | * Improvements to the documentation. | |
104 | * Translation updates. | |
105 | ||
106 | News in 2.99.2, 2017-07-18 | |
107 | -------------------------- | |
108 | ||
109 | Amtk: | |
110 | * The biggest change in this release is that the classes and functions related | |
111 | to actions and menus have been moved to a new shared library called Amtk | |
112 | (Actions, Menus and Toolbars Kit), since it was not really related to text | |
113 | editors, it is more general. But Amtk is still developed inside the Tepl | |
114 | repository. Amtk is a basic GtkUIManager replacement based on GAction (still | |
115 | under development, it is not yet finished, for example it doesn't handle | |
116 | toolbars). | |
117 | * Add AmtkFactory and AmtkFactoryMenu, which replace | |
118 | amtk_action_info_store_create_menu_item(). | |
119 | ||
120 | Framework: | |
121 | * Revamp TeplTab. | |
122 | * Add TeplTabGroup interface. | |
123 | * Add TeplNotebook that implements TeplTabGroup. | |
124 | * Implement TeplTabGroup in TeplTab and TeplApplicationWindow. | |
125 | * Start to implement the Edit menu: provide GActions and AmtkActionInfos for | |
126 | the cut, copy, paste, delete and select all actions. | |
127 | ||
128 | Misc: | |
129 | * Improve TeplInfoBar. | |
130 | ||
131 | News in 2.99.1, 2017-06-15 | |
132 | -------------------------- | |
133 | * The library has been renamed from Gtef (GTK+ text editor framework) to Tepl | |
134 | (Text editor product line), to have a more beautiful name. The end of Tepl is | |
135 | pronounced like “apple”. | |
136 | * Write a more complete introduction in the reference manual. | |
137 | * Add Slovenian translation. | |
138 | ||
139 | News in 2.0.1, 2017-04-21 | |
140 | ------------------------- | |
141 | * The bugzilla product has been created. | |
142 | * Fix bug in gtef_iter_get_line_indentation(). | |
143 | * Add Hungarian, Russian and Friulian translations. | |
144 | * Other small improvements. | |
145 | ||
146 | News in 2.0.0, 2017-03-18 | |
147 | ------------------------- | |
148 | * Add Ukrainian and Serbian translations. | |
149 | ||
150 | News in 1.99.2, 2017-03-12 | |
151 | -------------------------- | |
152 | This is an unstable release leading towards 2.0. The 2.0 stable version will be | |
153 | released at the same time as GNOME 3.24. | |
154 | ||
155 | Basic GtkUIManager replacement based on GAction: | |
156 | * Add an easy way to create a GtkMenuItem from a GtefActionInfo. | |
157 | * Add a function to check that every GtefActionInfo in a GtefActionInfoStore | |
158 | has been used. | |
159 | * Add reference counting to GtefActionInfo. | |
160 | * Add GtefActionInfoCentralStore singleton class. | |
161 | * Add gtef_action_map_add_action_entries_check_dups(), to check if there are | |
162 | duplicates when adding GActions to a GActionMap. | |
163 | * Rename gtef_application_get_action_info_store() to | |
164 | gtef_application_get_app_action_info_store(). | |
165 | * Add GtefMenuShell, an extension of GtkMenuShell with the ::menu-item-selected | |
166 | and ::menu-item-deselected signals. | |
167 | * Add gtef_menu_item_get/set_long_description(). | |
168 | * Add GtefApplicationWindow, an extension of GtkApplicationWindow with: | |
169 | * A statusbar property. | |
170 | * A function to connect a GtefMenuShell to the statusbar, | |
171 | pushing/popping the long descriptions of GtkMenuItems when they are | |
172 | selected/deselected. | |
173 | * A function to connect a GtkRecentChooserMenu to the statusbar, | |
174 | pushing/popping the full paths. | |
175 | * A function to create a GtkMenuItem with a simple and generic | |
176 | GtkRecentChooserMenu as submenu. | |
177 | ||
178 | Misc: | |
179 | * Add gtef_application_open_simple(). | |
180 | * Replace GNOME by GTK+ in the Gtef acronym. Gtef now stands for “GTK+ Text | |
181 | Editor Framework”. | |
182 | * The project is now hosted on gnome.org! | |
183 | https://wiki.gnome.org/Projects/Gtef | |
184 | The bugzilla product is not yet created. | |
185 | * Add Polish, Brazilian Portuguese, Swedish, Indonesian and German | |
186 | translations. | |
187 | ||
188 | News in 1.99.1, 2017-01-26 | |
189 | -------------------------- | |
190 | This is an unstable release leading towards 2.0. The 2.0 stable version will be | |
191 | released at the same time as GNOME 3.24. | |
192 | ||
193 | File loading and saving: | |
194 | * Finish the first usable version of the new GtefFileLoader. | |
195 | * Use etags instead of mtime. | |
196 | * GtefFileSaver: do not use an heuristic to know if it's a "save as" operation. | |
197 | * Add GtefEncoding, a fork of GtkSourceEncoding to suit the needs of the new | |
198 | file loader. | |
199 | * Re-usable code outside of GtkTextView: GtefFileContentLoader and | |
200 | GtefEncodingConverter (private classes). | |
201 | * Various other small improvements. | |
202 | ||
203 | Various features for text editors: | |
204 | * Add GtefBuffer:gtef-style-scheme-id property. | |
205 | * Add gtef_view_select_lines(). | |
206 | * Add gtef_view_goto_line() and gtef_view_goto_line_offset(). | |
207 | * Add gtef_iter_get_line_indentation(). | |
208 | * The GtefInfoBar class has been revamped. | |
209 | ||
210 | Starting a basic GtkUIManager replacement based on GAction: | |
211 | * Add gtef_utils_menu_item_set_icon_name() | |
212 | * Add GtefActionInfo | |
213 | * Add GtefActionInfoStore | |
214 | * Note that those classes are a little out of scope for a text editor library. | |
215 | I would be happy to move those classes to a better library once the feature | |
216 | is finished and well-tested. The classes were added to Gtef for convenience. | |
217 | ||
218 | Framework: | |
219 | * Add gtef namespace to GtefBuffer signals and properties to avoid potential | |
220 | conflicts with future GtkSourceView versions. | |
221 | * Add GtefApplication with gtef_application_get_action_info_store(). | |
222 | ||
223 | Documentation: | |
224 | * Add an intro with the pkg-config name. | |
225 | * List API breaks. | |
226 | ||
227 | Misc: | |
228 | * Improvements to the build system. | |
229 | ||
230 | News in 1.0.0, 2016-10-26 | |
231 | ------------------------- | |
232 | ||
233 | This is the first version of Gtef. | |
234 | ||
235 | File loading and saving: | |
236 | * Save and load file metadata. If GVfs is not available, there is a fallback | |
237 | implementation with an XML file (used e.g. on Windows). | |
238 | * A new file loader based on uchardet (implementation not completely finished). | |
239 | ||
240 | Starting the framework: | |
241 | * GtefBuffer, a subclass of GtkSourceBuffer with additional features. | |
242 | * GtefView, a subclass of GtkSourceView with additional features. | |
243 | * GtefTab, contains a GtefView with GtkInfoBars on top. | |
244 | * GtefInfoBar, a subclass of GtkInfoBar. | |
245 | ||
246 | Starting code folding: | |
247 | * GtefGutterRendererFolds, a basic gutter renderer for code folding. | |
248 | * GtefFoldRegion, a foldable region in a GtkTextBuffer. |
0 | Tepl - Text editor product line | |
1 | =============================== | |
2 | ||
3 | This is version 4.0.1 of Tepl. | |
4 | ||
5 | Tepl is a library that eases the development of GtkSourceView-based text | |
6 | editors and IDEs. | |
7 | ||
8 | Tepl was previously named Gtef (GTK+ text editor framework). The project has | |
9 | been renamed in June 2017 to have a more beautiful name. The end of Tepl is | |
10 | pronounced like in “apple”. | |
11 | ||
12 | The Tepl library is free software and is released under the terms of the GNU | |
13 | Lesser General Public License, see the 'COPYING' file for more information. | |
14 | ||
15 | The Tepl web page: | |
16 | ||
17 | https://wiki.gnome.org/Projects/Tepl | |
18 | ||
19 | Dependencies | |
20 | ------------ | |
21 | ||
22 | - GLib >= 2.52 | |
23 | - GTK+ >= 3.22 | |
24 | - GtkSourceView >= 4.0 | |
25 | - libxml2 >= 2.5 | |
26 | - uchardet - https://www.freedesktop.org/wiki/Software/uchardet/ | |
27 | ||
28 | Installation | |
29 | ------------ | |
30 | ||
31 | Simple install procedure from a tarball: | |
32 | ||
33 | $ ./configure | |
34 | $ make | |
35 | [ Become root if necessary ] | |
36 | $ make install | |
37 | ||
38 | See the file 'INSTALL' for more detailed information. | |
39 | ||
40 | From the Git repository, the 'configure' script and the 'INSTALL' file are not | |
41 | yet generated, so you need to run 'autogen.sh' instead, which takes the same | |
42 | arguments as 'configure'. | |
43 | ||
44 | To build the latest version of Tepl plus its dependencies from Git, Jhbuild is | |
45 | recommended: | |
46 | ||
47 | https://wiki.gnome.org/Projects/Jhbuild | |
48 | ||
49 | How to contribute | |
50 | ----------------- | |
51 | ||
52 | See the file 'HACKING'. |
0 | @CODE_COVERAGE_RULES@ | |
1 | ||
2 | AM_CPPFLAGS = \ | |
3 | -DDATADIR=\""$(datadir)"\" \ | |
4 | -DG_LOG_DOMAIN=\"Amtk\" \ | |
5 | -DAMTK_COMPILATION \ | |
6 | -I$(top_builddir) \ | |
7 | -I$(top_srcdir) \ | |
8 | $(WARN_CFLAGS) \ | |
9 | $(CODE_COVERAGE_CPPFLAGS) \ | |
10 | $(AMTK_DEP_CFLAGS) | |
11 | ||
12 | amtk_public_headers = \ | |
13 | amtk.h \ | |
14 | amtk-action-info.h \ | |
15 | amtk-action-info-central-store.h \ | |
16 | amtk-action-info-store.h \ | |
17 | amtk-action-map.h \ | |
18 | amtk-application-window.h \ | |
19 | amtk-factory.h \ | |
20 | amtk-init.h \ | |
21 | amtk-menu-item.h \ | |
22 | amtk-menu-shell.h \ | |
23 | amtk-types.h \ | |
24 | amtk-utils.h | |
25 | ||
26 | amtk_public_c_files = \ | |
27 | amtk-action-info.c \ | |
28 | amtk-action-info-central-store.c \ | |
29 | amtk-action-info-store.c \ | |
30 | amtk-action-map.c \ | |
31 | amtk-application-window.c \ | |
32 | amtk-factory.c \ | |
33 | amtk-init.c \ | |
34 | amtk-menu-item.c \ | |
35 | amtk-menu-shell.c \ | |
36 | amtk-utils.c | |
37 | ||
38 | amtk_built_public_headers = \ | |
39 | amtk-enum-types.h | |
40 | ||
41 | amtk_built_public_c_files = \ | |
42 | amtk-enum-types.c | |
43 | ||
44 | # Helper Libtool library, so that the private functions can be used in unit | |
45 | # tests. | |
46 | noinst_LTLIBRARIES = libamtk-core.la | |
47 | ||
48 | libamtk_core_la_SOURCES = \ | |
49 | $(amtk_public_c_files) \ | |
50 | $(amtk_public_headers) | |
51 | ||
52 | nodist_libamtk_core_la_SOURCES = \ | |
53 | $(amtk_built_public_c_files) \ | |
54 | $(amtk_built_public_headers) | |
55 | ||
56 | BUILT_SOURCES = \ | |
57 | $(amtk_built_public_c_files) \ | |
58 | $(amtk_built_public_headers) | |
59 | ||
60 | libamtk_core_la_CFLAGS = \ | |
61 | $(CODE_COVERAGE_CFLAGS) | |
62 | ||
63 | libamtk_core_la_LDFLAGS = \ | |
64 | -no-undefined \ | |
65 | $(WARN_LDFLAGS) | |
66 | ||
67 | libamtk_core_la_LIBADD = \ | |
68 | $(CODE_COVERAGE_LIBS) | |
69 | ||
70 | # The real library. | |
71 | lib_LTLIBRARIES = libamtk-@AMTK_API_VERSION@.la | |
72 | ||
73 | libamtk_@AMTK_API_VERSION@_la_SOURCES = | |
74 | ||
75 | libamtk_@AMTK_API_VERSION@_la_LIBADD = \ | |
76 | libamtk-core.la \ | |
77 | $(AMTK_DEP_LIBS) | |
78 | ||
79 | libamtk_@AMTK_API_VERSION@_la_LDFLAGS = \ | |
80 | -version-info $(AMTK_LT_VERSION) \ | |
81 | -no-undefined \ | |
82 | -export-symbols-regex "^amtk_.*" \ | |
83 | $(WARN_LDFLAGS) | |
84 | ||
85 | libamtk_includedir = $(includedir)/amtk-@AMTK_API_VERSION@/amtk | |
86 | libamtk_include_HEADERS = $(amtk_public_headers) | |
87 | nodist_libamtk_include_HEADERS = $(amtk_built_public_headers) | |
88 | ||
89 | ENUM_TYPES = $(amtk_public_headers) | |
90 | ||
91 | amtk-enum-types.h: amtk-enum-types.h.template $(ENUM_TYPES) $(GLIB_MKENUMS) | |
92 | $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template amtk-enum-types.h.template $(ENUM_TYPES)) > $@ | |
93 | ||
94 | amtk-enum-types.c: amtk-enum-types.c.template $(ENUM_TYPES) $(GLIB_MKENUMS) | |
95 | $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template amtk-enum-types.c.template $(ENUM_TYPES)) > $@ | |
96 | ||
97 | EXTRA_DIST = \ | |
98 | amtk-enum-types.c.template \ | |
99 | amtk-enum-types.h.template \ | |
100 | NOTES | |
101 | ||
102 | CLEANFILES = $(BUILT_SOURCES) | |
103 | ||
104 | if HAVE_INTROSPECTION | |
105 | -include $(INTROSPECTION_MAKEFILE) | |
106 | INTROSPECTION_GIRS = Amtk-@AMTK_API_VERSION@.gir | |
107 | ||
108 | INTROSPECTION_SCANNER_ENV = CC="$(CC)" | |
109 | ||
110 | Amtk-@AMTK_API_VERSION@.gir: libamtk-@AMTK_API_VERSION@.la | |
111 | ||
112 | INTROSPECTION_SCANNER_ARGS = \ | |
113 | -I$(top_srcdir) \ | |
114 | -I$(top_builddir) \ | |
115 | --c-include=amtk/amtk.h \ | |
116 | --warn-all | |
117 | ||
118 | Amtk_@AMTK_API_VERSION@_gir_NAMESPACE = Amtk | |
119 | Amtk_@AMTK_API_VERSION@_gir_VERSION = @AMTK_API_VERSION@ | |
120 | Amtk_@AMTK_API_VERSION@_gir_CFLAGS = $(AMTK_DEP_CFLAGS) | |
121 | Amtk_@AMTK_API_VERSION@_gir_SCANNERFLAGS = $(WARN_SCANNERFLAGS) | |
122 | Amtk_@AMTK_API_VERSION@_gir_LIBS = libamtk-@AMTK_API_VERSION@.la | |
123 | Amtk_@AMTK_API_VERSION@_gir_FILES = \ | |
124 | $(amtk_public_headers) \ | |
125 | $(amtk_public_c_files) \ | |
126 | $(amtk_built_public_headers) \ | |
127 | $(amtk_built_public_c_files) | |
128 | ||
129 | Amtk_@AMTK_API_VERSION@_gir_INCLUDES = Gtk-3.0 | |
130 | Amtk_@AMTK_API_VERSION@_gir_PACKAGES = gtk+-3.0 | |
131 | Amtk_@AMTK_API_VERSION@_gir_EXPORT_PACKAGES = amtk-@AMTK_API_VERSION@ | |
132 | ||
133 | girdir = $(datadir)/gir-1.0 | |
134 | gir_DATA = Amtk-@AMTK_API_VERSION@.gir | |
135 | ||
136 | typelibdir = $(libdir)/girepository-1.0 | |
137 | typelib_DATA = Amtk-@AMTK_API_VERSION@.typelib | |
138 | ||
139 | CLEANFILES += \ | |
140 | $(gir_DATA) \ | |
141 | $(typelib_DATA) | |
142 | ||
143 | endif # HAVE_INTROSPECTION | |
144 | ||
145 | -include $(top_srcdir)/git.mk |
0 | Amtk notes | |
1 | ========== | |
2 | ||
3 | TODO list | |
4 | --------- | |
5 | ||
6 | - Implement more factory functions. | |
7 | - Support detailed GAction names in factory functions. | |
8 | ||
9 | Other possible things to do | |
10 | --------------------------- | |
11 | ||
12 | - When calling amtk_menu_item_set_icon_name(), do not have a large margin on | |
13 | the left. GtkUIManager was able to put the icon without the large margin (in | |
14 | the same column as the check or radio drawing). Maybe only GtkImageMenuItem | |
15 | is able to do that, but is deprecated (and removed in GTK+ 4). | |
16 | ||
17 | - Add convenient API to replace a placeholder by a list of menu/toolbar items? | |
18 | And be able to update the placeholder content when the application runs (so | |
19 | mark items to recognize them later, to know that they are part of the | |
20 | placeholder). Or create a Placeholder object that contains the list of items, | |
21 | so when the Placeholder object is modified, the menu/toolbar is updated | |
22 | accordingly. | |
23 | ||
24 | - Add one more sanity check: check that a GAction is *implemented* when (or | |
25 | after) creating a menu or toolbar item for that action? | |
26 | ||
27 | - An AmtkActionInfo could have a field for the default AmtkFactoryFlags (or to | |
28 | force some flags). For example setting AMTK_FACTORY_IGNORE_ACCELS_FOR_APP for | |
29 | the tepl-cut/copy/paste/select-all actions. | |
30 | ||
31 | - To prevent apps from modifying ActionInfos of libs, maybe seal an ActionInfo | |
32 | when it is added to a store, except for mark_as_used(). But it's maybe a bit | |
33 | too paranoid. Or instead of sealing, have a builder, see: | |
34 | https://blogs.gnome.org/otte/2018/02/03/builders/ | |
35 | ||
36 | - ActionInfo and ActionInfoEntry could have one more field for an identifier, | |
37 | because when using a detailed GAction name the name is less "greppable" and | |
38 | less easy to understand. The detailed GAction name would be the equivalent of | |
39 | the callback in a GtkActionEntry. |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-action-info-central-store.h" | |
20 | #include "amtk-action-info.h" | |
21 | ||
22 | /** | |
23 | * SECTION:amtk-action-info-central-store | |
24 | * @Short_description: Aggregation of all #AmtkActionInfoStore's | |
25 | * @Title: AmtkActionInfoCentralStore | |
26 | * @See_also: #AmtkActionInfoStore | |
27 | * | |
28 | * #AmtkActionInfoCentralStore is a singleton class containing the aggregation | |
29 | * of all #AmtkActionInfoStore's. Each time an #AmtkActionInfo is added to an | |
30 | * #AmtkActionInfoStore, it is also added to the #AmtkActionInfoCentralStore. | |
31 | */ | |
32 | ||
33 | /* API design: | |
34 | * | |
35 | * Why both AmtkActionInfoStore and AmtkActionInfoCentralStore are needed? | |
36 | * | |
37 | * Advantage of AmtkActionInfoStore: | |
38 | * - amtk_action_info_store_check_all_used() | |
39 | * | |
40 | * Advantages of AmtkActionInfoCentralStore: | |
41 | * - The central store checks if there are no duplicated action names | |
42 | * (globally). | |
43 | * - Permits to write AmtkFactory functions that don't require an | |
44 | * AmtkActionInfoStore parameter. | |
45 | * | |
46 | * By having the two classes, we have the best of both worlds. We should not be | |
47 | * afraid to create a lot of classes, and see things in big, even if it's a bit | |
48 | * Java-ish. | |
49 | */ | |
50 | ||
51 | struct _AmtkActionInfoCentralStorePrivate | |
52 | { | |
53 | /* Key: owned gchar*: action name. | |
54 | * Value: owned AmtkActionInfo. | |
55 | */ | |
56 | GHashTable *hash_table; | |
57 | }; | |
58 | ||
59 | static AmtkActionInfoCentralStore *singleton = NULL; | |
60 | ||
61 | G_DEFINE_TYPE_WITH_PRIVATE (AmtkActionInfoCentralStore, amtk_action_info_central_store, G_TYPE_OBJECT) | |
62 | ||
63 | static void | |
64 | amtk_action_info_central_store_finalize (GObject *object) | |
65 | { | |
66 | AmtkActionInfoCentralStore *central_store = AMTK_ACTION_INFO_CENTRAL_STORE (object); | |
67 | ||
68 | g_hash_table_unref (central_store->priv->hash_table); | |
69 | ||
70 | if (singleton == central_store) | |
71 | { | |
72 | singleton = NULL; | |
73 | } | |
74 | ||
75 | G_OBJECT_CLASS (amtk_action_info_central_store_parent_class)->finalize (object); | |
76 | } | |
77 | ||
78 | static void | |
79 | amtk_action_info_central_store_class_init (AmtkActionInfoCentralStoreClass *klass) | |
80 | { | |
81 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
82 | ||
83 | object_class->finalize = amtk_action_info_central_store_finalize; | |
84 | } | |
85 | ||
86 | static void | |
87 | amtk_action_info_central_store_init (AmtkActionInfoCentralStore *central_store) | |
88 | { | |
89 | central_store->priv = amtk_action_info_central_store_get_instance_private (central_store); | |
90 | ||
91 | central_store->priv->hash_table = g_hash_table_new_full (g_str_hash, | |
92 | g_str_equal, | |
93 | g_free, | |
94 | (GDestroyNotify) amtk_action_info_unref); | |
95 | } | |
96 | ||
97 | /** | |
98 | * amtk_action_info_central_store_get_singleton: | |
99 | * | |
100 | * Returns: (transfer none): the #AmtkActionInfoCentralStore singleton instance. | |
101 | * Since: 3.0 | |
102 | */ | |
103 | AmtkActionInfoCentralStore * | |
104 | amtk_action_info_central_store_get_singleton (void) | |
105 | { | |
106 | if (G_UNLIKELY (singleton == NULL)) | |
107 | { | |
108 | singleton = g_object_new (AMTK_TYPE_ACTION_INFO_CENTRAL_STORE, NULL); | |
109 | } | |
110 | ||
111 | return singleton; | |
112 | } | |
113 | ||
114 | void | |
115 | _amtk_action_info_central_store_unref_singleton (void) | |
116 | { | |
117 | if (singleton != NULL) | |
118 | { | |
119 | g_object_unref (singleton); | |
120 | } | |
121 | ||
122 | /* singleton is not set to NULL here, it is set to NULL in | |
123 | * amtk_action_info_central_store_finalize() (i.e. when we are sure that | |
124 | * the ref count reaches 0). | |
125 | */ | |
126 | } | |
127 | ||
128 | void | |
129 | _amtk_action_info_central_store_add (AmtkActionInfoCentralStore *central_store, | |
130 | AmtkActionInfo *info) | |
131 | { | |
132 | const gchar *action_name; | |
133 | ||
134 | g_return_if_fail (AMTK_IS_ACTION_INFO_CENTRAL_STORE (central_store)); | |
135 | g_return_if_fail (info != NULL); | |
136 | ||
137 | action_name = amtk_action_info_get_action_name (info); | |
138 | g_return_if_fail (action_name != NULL); | |
139 | ||
140 | if (g_hash_table_lookup (central_store->priv->hash_table, action_name) != NULL) | |
141 | { | |
142 | g_warning ("The AmtkActionInfoCentralStore already contains an AmtkActionInfo " | |
143 | "with the action name “%s”. Libraries must namespace their action names.", | |
144 | action_name); | |
145 | return; | |
146 | } | |
147 | ||
148 | g_hash_table_insert (central_store->priv->hash_table, | |
149 | g_strdup (action_name), | |
150 | amtk_action_info_ref (info)); | |
151 | } | |
152 | ||
153 | /** | |
154 | * amtk_action_info_central_store_lookup: | |
155 | * @central_store: the #AmtkActionInfoCentralStore. | |
156 | * @action_name: an action name. | |
157 | * | |
158 | * Returns: (transfer none): the found #AmtkActionInfo, or %NULL. | |
159 | * Since: 2.0 | |
160 | */ | |
161 | AmtkActionInfo * | |
162 | amtk_action_info_central_store_lookup (AmtkActionInfoCentralStore *central_store, | |
163 | const gchar *action_name) | |
164 | { | |
165 | g_return_val_if_fail (AMTK_IS_ACTION_INFO_CENTRAL_STORE (central_store), NULL); | |
166 | g_return_val_if_fail (action_name != NULL, NULL); | |
167 | ||
168 | return g_hash_table_lookup (central_store->priv->hash_table, action_name); | |
169 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_ACTION_INFO_CENTRAL_STORE_H | |
20 | #define AMTK_ACTION_INFO_CENTRAL_STORE_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <glib-object.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_ACTION_INFO_CENTRAL_STORE (amtk_action_info_central_store_get_type ()) | |
32 | #define AMTK_ACTION_INFO_CENTRAL_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMTK_TYPE_ACTION_INFO_CENTRAL_STORE, AmtkActionInfoCentralStore)) | |
33 | #define AMTK_ACTION_INFO_CENTRAL_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AMTK_TYPE_ACTION_INFO_CENTRAL_STORE, AmtkActionInfoCentralStoreClass)) | |
34 | #define AMTK_IS_ACTION_INFO_CENTRAL_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMTK_TYPE_ACTION_INFO_CENTRAL_STORE)) | |
35 | #define AMTK_IS_ACTION_INFO_CENTRAL_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMTK_TYPE_ACTION_INFO_CENTRAL_STORE)) | |
36 | #define AMTK_ACTION_INFO_CENTRAL_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AMTK_TYPE_ACTION_INFO_CENTRAL_STORE, AmtkActionInfoCentralStoreClass)) | |
37 | ||
38 | typedef struct _AmtkActionInfoCentralStoreClass AmtkActionInfoCentralStoreClass; | |
39 | typedef struct _AmtkActionInfoCentralStorePrivate AmtkActionInfoCentralStorePrivate; | |
40 | ||
41 | struct _AmtkActionInfoCentralStore | |
42 | { | |
43 | GObject parent; | |
44 | ||
45 | AmtkActionInfoCentralStorePrivate *priv; | |
46 | }; | |
47 | ||
48 | struct _AmtkActionInfoCentralStoreClass | |
49 | { | |
50 | GObjectClass parent_class; | |
51 | ||
52 | gpointer padding[12]; | |
53 | }; | |
54 | ||
55 | GType amtk_action_info_central_store_get_type (void) G_GNUC_CONST; | |
56 | ||
57 | AmtkActionInfoCentralStore * | |
58 | amtk_action_info_central_store_get_singleton (void); | |
59 | ||
60 | AmtkActionInfo *amtk_action_info_central_store_lookup (AmtkActionInfoCentralStore *central_store, | |
61 | const gchar *action_name); | |
62 | ||
63 | G_GNUC_INTERNAL | |
64 | void _amtk_action_info_central_store_add (AmtkActionInfoCentralStore *central_store, | |
65 | AmtkActionInfo *info); | |
66 | ||
67 | G_GNUC_INTERNAL | |
68 | void _amtk_action_info_central_store_unref_singleton (void); | |
69 | ||
70 | G_END_DECLS | |
71 | ||
72 | #endif /* AMTK_ACTION_INFO_CENTRAL_STORE_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-action-info-store.h" | |
20 | #include "amtk-action-info.h" | |
21 | #include "amtk-action-info-central-store.h" | |
22 | ||
23 | /** | |
24 | * SECTION:amtk-action-info-store | |
25 | * @Short_description: A store of #AmtkActionInfo's | |
26 | * @Title: AmtkActionInfoStore | |
27 | * @See_also: #AmtkActionInfo, #AmtkActionInfoCentralStore | |
28 | * | |
29 | * #AmtkActionInfoStore contains a set of #AmtkActionInfo's. It is add-only, an | |
30 | * #AmtkActionInfo cannot be removed. | |
31 | * | |
32 | * #AmtkActionInfoStore is designed so that libraries can provide their own | |
33 | * store, to share action information (with translations) and possibly the | |
34 | * #GAction implementations as well. | |
35 | * | |
36 | * A library #AmtkActionInfoStore must namespace the action names to not have | |
37 | * conflicts when an #AmtkActionInfo is added to the | |
38 | * #AmtkActionInfoCentralStore. Examples of namespaced action names: | |
39 | * `"win.amtk-save"` or `"app.amtk-quit"`. | |
40 | * | |
41 | * Once an #AmtkActionInfo has been added to an #AmtkActionInfoStore, it is | |
42 | * discouraged to modify it afterwards. An #AmtkActionInfoStore is meant to be | |
43 | * something static, created on application startup. See the [paragraph about | |
44 | * static objects in AmtkFactory][amtk-factory-static-objects]. | |
45 | */ | |
46 | ||
47 | struct _AmtkActionInfoStorePrivate | |
48 | { | |
49 | /* Key: owned gchar*: action name. | |
50 | * Value: owned AmtkActionInfo. | |
51 | */ | |
52 | GHashTable *hash_table; | |
53 | }; | |
54 | ||
55 | G_DEFINE_TYPE_WITH_PRIVATE (AmtkActionInfoStore, amtk_action_info_store, G_TYPE_OBJECT) | |
56 | ||
57 | static void | |
58 | amtk_action_info_store_finalize (GObject *object) | |
59 | { | |
60 | AmtkActionInfoStore *store = AMTK_ACTION_INFO_STORE (object); | |
61 | ||
62 | g_hash_table_unref (store->priv->hash_table); | |
63 | ||
64 | G_OBJECT_CLASS (amtk_action_info_store_parent_class)->finalize (object); | |
65 | } | |
66 | ||
67 | static void | |
68 | amtk_action_info_store_class_init (AmtkActionInfoStoreClass *klass) | |
69 | { | |
70 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
71 | ||
72 | object_class->finalize = amtk_action_info_store_finalize; | |
73 | } | |
74 | ||
75 | static void | |
76 | amtk_action_info_store_init (AmtkActionInfoStore *store) | |
77 | { | |
78 | store->priv = amtk_action_info_store_get_instance_private (store); | |
79 | ||
80 | store->priv->hash_table = g_hash_table_new_full (g_str_hash, | |
81 | g_str_equal, | |
82 | g_free, | |
83 | (GDestroyNotify) amtk_action_info_unref); | |
84 | } | |
85 | ||
86 | /** | |
87 | * amtk_action_info_store_new: | |
88 | * | |
89 | * Returns: a new #AmtkActionInfoStore. | |
90 | * Since: 3.0 | |
91 | */ | |
92 | AmtkActionInfoStore * | |
93 | amtk_action_info_store_new (void) | |
94 | { | |
95 | return g_object_new (AMTK_TYPE_ACTION_INFO_STORE, NULL); | |
96 | } | |
97 | ||
98 | /** | |
99 | * amtk_action_info_store_add: | |
100 | * @store: an #AmtkActionInfoStore. | |
101 | * @info: an #AmtkActionInfo. | |
102 | * | |
103 | * Inserts @info into @store and into the #AmtkActionInfoCentralStore. Both the | |
104 | * @store and central store must <emphasis>not</emphasis> already contain an | |
105 | * #AmtkActionInfo with the same action name. The stores take their own | |
106 | * reference on @info. | |
107 | * | |
108 | * Since: 2.0 | |
109 | */ | |
110 | void | |
111 | amtk_action_info_store_add (AmtkActionInfoStore *store, | |
112 | AmtkActionInfo *info) | |
113 | { | |
114 | const gchar *action_name; | |
115 | AmtkActionInfoCentralStore *central_store; | |
116 | ||
117 | g_return_if_fail (AMTK_IS_ACTION_INFO_STORE (store)); | |
118 | g_return_if_fail (info != NULL); | |
119 | ||
120 | action_name = amtk_action_info_get_action_name (info); | |
121 | g_return_if_fail (action_name != NULL); | |
122 | ||
123 | if (g_hash_table_lookup (store->priv->hash_table, action_name) != NULL) | |
124 | { | |
125 | g_warning ("%s(): the AmtkActionInfoStore already contains an AmtkActionInfo " | |
126 | "with the action name “%s”.", | |
127 | G_STRFUNC, | |
128 | action_name); | |
129 | return; | |
130 | } | |
131 | ||
132 | g_hash_table_insert (store->priv->hash_table, | |
133 | g_strdup (action_name), | |
134 | amtk_action_info_ref (info)); | |
135 | ||
136 | central_store = amtk_action_info_central_store_get_singleton (); | |
137 | _amtk_action_info_central_store_add (central_store, info); | |
138 | } | |
139 | ||
140 | /** | |
141 | * amtk_action_info_store_add_entries: | |
142 | * @store: an #AmtkActionInfoStore. | |
143 | * @entries: (array length=n_entries) (element-type AmtkActionInfoEntry): a | |
144 | * pointer to the first item in an array of #AmtkActionInfoEntry structs. | |
145 | * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated. | |
146 | * @translation_domain: (nullable): a gettext domain, or %NULL. | |
147 | * | |
148 | * Calls amtk_action_info_store_add() for each entry. | |
149 | * | |
150 | * If @translation_domain is not %NULL, g_dgettext() is used to translate the | |
151 | * @label and @tooltip of each entry before setting them to the #AmtkActionInfo. | |
152 | * | |
153 | * An API similar to g_action_map_add_action_entries(). | |
154 | * | |
155 | * Since: 2.0 | |
156 | */ | |
157 | void | |
158 | amtk_action_info_store_add_entries (AmtkActionInfoStore *store, | |
159 | const AmtkActionInfoEntry *entries, | |
160 | gint n_entries, | |
161 | const gchar *translation_domain) | |
162 | { | |
163 | gint i; | |
164 | ||
165 | g_return_if_fail (AMTK_IS_ACTION_INFO_STORE (store)); | |
166 | g_return_if_fail (n_entries >= -1); | |
167 | g_return_if_fail (entries != NULL || n_entries == 0); | |
168 | ||
169 | for (i = 0; n_entries == -1 ? entries[i].action_name != NULL : i < n_entries; i++) | |
170 | { | |
171 | AmtkActionInfo *info; | |
172 | ||
173 | info = amtk_action_info_new_from_entry (&entries[i], translation_domain); | |
174 | amtk_action_info_store_add (store, info); | |
175 | amtk_action_info_unref (info); | |
176 | } | |
177 | } | |
178 | ||
179 | /** | |
180 | * amtk_action_info_store_lookup: | |
181 | * @store: an #AmtkActionInfoStore. | |
182 | * @action_name: an action name. | |
183 | * | |
184 | * Returns: (transfer none): the found #AmtkActionInfo, or %NULL. | |
185 | * Since: 2.0 | |
186 | */ | |
187 | AmtkActionInfo * | |
188 | amtk_action_info_store_lookup (AmtkActionInfoStore *store, | |
189 | const gchar *action_name) | |
190 | { | |
191 | g_return_val_if_fail (AMTK_IS_ACTION_INFO_STORE (store), NULL); | |
192 | g_return_val_if_fail (action_name != NULL, NULL); | |
193 | ||
194 | return g_hash_table_lookup (store->priv->hash_table, action_name); | |
195 | } | |
196 | ||
197 | static void | |
198 | check_used_cb (gpointer key, | |
199 | gpointer value, | |
200 | gpointer user_data) | |
201 | { | |
202 | const gchar *action_name = key; | |
203 | const AmtkActionInfo *action_info = value; | |
204 | ||
205 | if (!amtk_action_info_has_been_used (action_info)) | |
206 | { | |
207 | g_warning ("AmtkActionInfo with action_name='%s' has not been used.", | |
208 | action_name); | |
209 | } | |
210 | } | |
211 | ||
212 | /** | |
213 | * amtk_action_info_store_check_all_used: | |
214 | * @store: an #AmtkActionInfoStore. | |
215 | * | |
216 | * Checks for each #AmtkActionInfo of @store that it has been used (see | |
217 | * amtk_action_info_has_been_used()). If an #AmtkActionInfo has not been used, a | |
218 | * warning is printed and might indicate dead code. | |
219 | * | |
220 | * You probably want to call this function on the application store after | |
221 | * creating the menu and toolbar. But it can also be useful for a store provided | |
222 | * by a library, to easily see which actions are not used by the application. | |
223 | * | |
224 | * Since: 2.0 | |
225 | */ | |
226 | void | |
227 | amtk_action_info_store_check_all_used (AmtkActionInfoStore *store) | |
228 | { | |
229 | g_return_if_fail (AMTK_IS_ACTION_INFO_STORE (store)); | |
230 | ||
231 | g_hash_table_foreach (store->priv->hash_table, | |
232 | check_used_cb, | |
233 | NULL); | |
234 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_ACTION_INFO_STORE_H | |
20 | #define AMTK_ACTION_INFO_STORE_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <glib-object.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_ACTION_INFO_STORE (amtk_action_info_store_get_type ()) | |
32 | #define AMTK_ACTION_INFO_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMTK_TYPE_ACTION_INFO_STORE, AmtkActionInfoStore)) | |
33 | #define AMTK_ACTION_INFO_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AMTK_TYPE_ACTION_INFO_STORE, AmtkActionInfoStoreClass)) | |
34 | #define AMTK_IS_ACTION_INFO_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMTK_TYPE_ACTION_INFO_STORE)) | |
35 | #define AMTK_IS_ACTION_INFO_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMTK_TYPE_ACTION_INFO_STORE)) | |
36 | #define AMTK_ACTION_INFO_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AMTK_TYPE_ACTION_INFO_STORE, AmtkActionInfoStoreClass)) | |
37 | ||
38 | typedef struct _AmtkActionInfoStoreClass AmtkActionInfoStoreClass; | |
39 | typedef struct _AmtkActionInfoStorePrivate AmtkActionInfoStorePrivate; | |
40 | ||
41 | struct _AmtkActionInfoStore | |
42 | { | |
43 | GObject parent; | |
44 | ||
45 | AmtkActionInfoStorePrivate *priv; | |
46 | }; | |
47 | ||
48 | struct _AmtkActionInfoStoreClass | |
49 | { | |
50 | GObjectClass parent_class; | |
51 | ||
52 | gpointer padding[12]; | |
53 | }; | |
54 | ||
55 | GType amtk_action_info_store_get_type (void); | |
56 | ||
57 | AmtkActionInfoStore * amtk_action_info_store_new (void); | |
58 | ||
59 | void amtk_action_info_store_add (AmtkActionInfoStore *store, | |
60 | AmtkActionInfo *info); | |
61 | ||
62 | void amtk_action_info_store_add_entries (AmtkActionInfoStore *store, | |
63 | const AmtkActionInfoEntry *entries, | |
64 | gint n_entries, | |
65 | const gchar *translation_domain); | |
66 | ||
67 | AmtkActionInfo * amtk_action_info_store_lookup (AmtkActionInfoStore *store, | |
68 | const gchar *action_name); | |
69 | ||
70 | void amtk_action_info_store_check_all_used (AmtkActionInfoStore *store); | |
71 | ||
72 | G_END_DECLS | |
73 | ||
74 | #endif /* AMTK_ACTION_INFO_STORE_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "config.h" | |
20 | #include "amtk-action-info.h" | |
21 | #include <glib/gi18n-lib.h> | |
22 | #include "amtk-utils.h" | |
23 | ||
24 | /** | |
25 | * SECTION:amtk-action-info | |
26 | * @Short_description: #GAction information | |
27 | * @Title: AmtkActionInfo | |
28 | * @See_also: #AmtkActionInfoStore | |
29 | * | |
30 | * An #AmtkActionInfo instance contains a set of information about a #GAction. | |
31 | * Those pieces of information are useful to create UI elements that trigger the | |
32 | * #GAction, for example a menu item or a toolbar item. | |
33 | * | |
34 | * The recommended way to create a set of #AmtkActionInfo's is to use the | |
35 | * amtk_action_info_store_add_entries() function. | |
36 | */ | |
37 | ||
38 | struct _AmtkActionInfo | |
39 | { | |
40 | gchar *action_name; | |
41 | gchar *icon_name; | |
42 | gchar *label; | |
43 | gchar *tooltip; | |
44 | ||
45 | /* Must never be NULL, must be a NULL-terminated array. This way, it | |
46 | * can be used directly as an argument to | |
47 | * gtk_application_set_accels_for_action(). | |
48 | */ | |
49 | gchar **accels; | |
50 | ||
51 | gint ref_count; | |
52 | ||
53 | guint used : 1; | |
54 | }; | |
55 | ||
56 | static void _amtk_action_info_free (AmtkActionInfo *info); | |
57 | ||
58 | G_DEFINE_BOXED_TYPE (AmtkActionInfo, amtk_action_info, | |
59 | amtk_action_info_copy, | |
60 | _amtk_action_info_free) | |
61 | ||
62 | static void | |
63 | _amtk_action_info_free (AmtkActionInfo *info) | |
64 | { | |
65 | if (info != NULL) | |
66 | { | |
67 | g_free (info->action_name); | |
68 | g_free (info->icon_name); | |
69 | g_free (info->label); | |
70 | g_free (info->tooltip); | |
71 | g_strfreev (info->accels); | |
72 | ||
73 | g_free (info); | |
74 | } | |
75 | } | |
76 | ||
77 | /** | |
78 | * amtk_action_info_new: | |
79 | * | |
80 | * Returns: a new #AmtkActionInfo. | |
81 | * Since: 2.0 | |
82 | */ | |
83 | AmtkActionInfo * | |
84 | amtk_action_info_new (void) | |
85 | { | |
86 | AmtkActionInfo *info; | |
87 | ||
88 | info = g_new0 (AmtkActionInfo, 1); | |
89 | info->accels = g_malloc0 (sizeof (gchar *)); | |
90 | info->ref_count = 1; | |
91 | ||
92 | return info; | |
93 | } | |
94 | ||
95 | /** | |
96 | * amtk_action_info_new_from_entry: | |
97 | * @info_entry: an #AmtkActionInfoEntry. | |
98 | * @translation_domain: (nullable): a gettext domain, or %NULL. | |
99 | * | |
100 | * Creates a new #AmtkActionInfo from an #AmtkActionInfoEntry. | |
101 | * | |
102 | * If @translation_domain is not %NULL, g_dgettext() is used to translate the | |
103 | * @label and @tooltip before setting them to the #AmtkActionInfo. | |
104 | * | |
105 | * Returns: a new #AmtkActionInfo. | |
106 | * Since: 2.0 | |
107 | */ | |
108 | AmtkActionInfo * | |
109 | amtk_action_info_new_from_entry (const AmtkActionInfoEntry *info_entry, | |
110 | const gchar *translation_domain) | |
111 | { | |
112 | AmtkActionInfo *info; | |
113 | ||
114 | info = amtk_action_info_new (); | |
115 | info->action_name = g_strdup (info_entry->action_name); | |
116 | info->icon_name = g_strdup (info_entry->icon_name); | |
117 | ||
118 | if (translation_domain != NULL) | |
119 | { | |
120 | info->label = g_strdup (g_dgettext (translation_domain, info_entry->label)); | |
121 | info->tooltip = g_strdup (g_dgettext (translation_domain, info_entry->tooltip)); | |
122 | } | |
123 | else | |
124 | { | |
125 | info->label = g_strdup (info_entry->label); | |
126 | info->tooltip = g_strdup (info_entry->tooltip); | |
127 | } | |
128 | ||
129 | if (info_entry->accel != NULL) | |
130 | { | |
131 | g_strfreev (info->accels); | |
132 | ||
133 | info->accels = g_malloc (2 * sizeof (gchar *)); | |
134 | info->accels[0] = g_strdup (info_entry->accel); | |
135 | info->accels[1] = NULL; | |
136 | } | |
137 | ||
138 | return info; | |
139 | } | |
140 | ||
141 | /** | |
142 | * amtk_action_info_ref: | |
143 | * @info: an #AmtkActionInfo. | |
144 | * | |
145 | * Increments the reference count of @info by one. | |
146 | * | |
147 | * Returns: the passed in @info. | |
148 | * Since: 2.0 | |
149 | */ | |
150 | AmtkActionInfo * | |
151 | amtk_action_info_ref (AmtkActionInfo *info) | |
152 | { | |
153 | g_return_val_if_fail (info != NULL, NULL); | |
154 | ||
155 | info->ref_count++; | |
156 | ||
157 | return info; | |
158 | } | |
159 | ||
160 | /** | |
161 | * amtk_action_info_unref: | |
162 | * @info: an #AmtkActionInfo. | |
163 | * | |
164 | * Decrements the reference count of @info by one. If the reference count drops | |
165 | * to 0, @info is freed. | |
166 | * | |
167 | * Since: 2.0 | |
168 | */ | |
169 | void | |
170 | amtk_action_info_unref (AmtkActionInfo *info) | |
171 | { | |
172 | g_return_if_fail (info != NULL); | |
173 | ||
174 | info->ref_count--; | |
175 | ||
176 | if (info->ref_count == 0) | |
177 | { | |
178 | _amtk_action_info_free (info); | |
179 | } | |
180 | } | |
181 | ||
182 | /** | |
183 | * amtk_action_info_copy: | |
184 | * @info: an #AmtkActionInfo. | |
185 | * | |
186 | * Returns: (transfer full): a copy of @info. The copy will have a reference | |
187 | * count of one. | |
188 | * Since: 2.0 | |
189 | */ | |
190 | AmtkActionInfo * | |
191 | amtk_action_info_copy (const AmtkActionInfo *info) | |
192 | { | |
193 | AmtkActionInfo *new_info; | |
194 | ||
195 | g_return_val_if_fail (info != NULL, NULL); | |
196 | ||
197 | new_info = amtk_action_info_new (); | |
198 | ||
199 | new_info->action_name = g_strdup (info->action_name); | |
200 | new_info->icon_name = g_strdup (info->icon_name); | |
201 | new_info->label = g_strdup (info->label); | |
202 | new_info->tooltip = g_strdup (info->tooltip); | |
203 | ||
204 | amtk_action_info_set_accels (new_info, (const gchar * const *)info->accels); | |
205 | ||
206 | return new_info; | |
207 | } | |
208 | ||
209 | /** | |
210 | * amtk_action_info_get_action_name: | |
211 | * @info: an #AmtkActionInfo. | |
212 | * | |
213 | * Returns: (nullable): the action name, or %NULL. Example: `"win.save"`. | |
214 | * Since: 2.0 | |
215 | */ | |
216 | const gchar * | |
217 | amtk_action_info_get_action_name (const AmtkActionInfo *info) | |
218 | { | |
219 | g_return_val_if_fail (info != NULL, NULL); | |
220 | ||
221 | return info->action_name; | |
222 | } | |
223 | ||
224 | /** | |
225 | * amtk_action_info_set_action_name: | |
226 | * @info: an #AmtkActionInfo. | |
227 | * @action_name: the action name. | |
228 | * | |
229 | * Sets the action name, for example `"win.save"`. | |
230 | * | |
231 | * Since: 2.0 | |
232 | */ | |
233 | void | |
234 | amtk_action_info_set_action_name (AmtkActionInfo *info, | |
235 | const gchar *action_name) | |
236 | { | |
237 | g_return_if_fail (info != NULL); | |
238 | g_return_if_fail (action_name != NULL); | |
239 | ||
240 | g_free (info->action_name); | |
241 | info->action_name = g_strdup (action_name); | |
242 | } | |
243 | ||
244 | /** | |
245 | * amtk_action_info_get_icon_name: | |
246 | * @info: an #AmtkActionInfo. | |
247 | * | |
248 | * Returns: (nullable): the icon name, or %NULL. | |
249 | * Since: 2.0 | |
250 | */ | |
251 | const gchar * | |
252 | amtk_action_info_get_icon_name (const AmtkActionInfo *info) | |
253 | { | |
254 | g_return_val_if_fail (info != NULL, NULL); | |
255 | ||
256 | return info->icon_name; | |
257 | } | |
258 | ||
259 | /** | |
260 | * amtk_action_info_set_icon_name: | |
261 | * @info: an #AmtkActionInfo. | |
262 | * @icon_name: (nullable): the icon name, or %NULL. | |
263 | * | |
264 | * Since: 2.0 | |
265 | */ | |
266 | void | |
267 | amtk_action_info_set_icon_name (AmtkActionInfo *info, | |
268 | const gchar *icon_name) | |
269 | { | |
270 | g_return_if_fail (info != NULL); | |
271 | ||
272 | g_free (info->icon_name); | |
273 | info->icon_name = g_strdup (icon_name); | |
274 | } | |
275 | ||
276 | /** | |
277 | * amtk_action_info_get_label: | |
278 | * @info: an #AmtkActionInfo. | |
279 | * | |
280 | * Gets the label. The label has normally a mnemonic. | |
281 | * | |
282 | * Returns: (nullable): the label (i.e. a short description), or %NULL. | |
283 | * Since: 2.0 | |
284 | */ | |
285 | const gchar * | |
286 | amtk_action_info_get_label (const AmtkActionInfo *info) | |
287 | { | |
288 | g_return_val_if_fail (info != NULL, NULL); | |
289 | ||
290 | return info->label; | |
291 | } | |
292 | ||
293 | /** | |
294 | * amtk_action_info_set_label: | |
295 | * @info: an #AmtkActionInfo. | |
296 | * @label: (nullable): the label (i.e. a short description), or %NULL. | |
297 | * | |
298 | * Sets the label with a mnemonic. | |
299 | * | |
300 | * Since: 2.0 | |
301 | */ | |
302 | void | |
303 | amtk_action_info_set_label (AmtkActionInfo *info, | |
304 | const gchar *label) | |
305 | { | |
306 | g_return_if_fail (info != NULL); | |
307 | ||
308 | g_free (info->label); | |
309 | info->label = g_strdup (label); | |
310 | } | |
311 | ||
312 | /** | |
313 | * amtk_action_info_get_tooltip: | |
314 | * @info: an #AmtkActionInfo. | |
315 | * | |
316 | * Returns: (nullable): the tooltip (i.e. a long description), or %NULL. | |
317 | * Since: 2.0 | |
318 | */ | |
319 | const gchar * | |
320 | amtk_action_info_get_tooltip (const AmtkActionInfo *info) | |
321 | { | |
322 | g_return_val_if_fail (info != NULL, NULL); | |
323 | ||
324 | return info->tooltip; | |
325 | } | |
326 | ||
327 | /** | |
328 | * amtk_action_info_set_tooltip: | |
329 | * @info: an #AmtkActionInfo. | |
330 | * @tooltip: (nullable): the tooltip (i.e. a long description), or %NULL. | |
331 | * | |
332 | * Since: 2.0 | |
333 | */ | |
334 | void | |
335 | amtk_action_info_set_tooltip (AmtkActionInfo *info, | |
336 | const gchar *tooltip) | |
337 | { | |
338 | g_return_if_fail (info != NULL); | |
339 | ||
340 | g_free (info->tooltip); | |
341 | info->tooltip = g_strdup (tooltip); | |
342 | } | |
343 | ||
344 | /** | |
345 | * amtk_action_info_get_accels: | |
346 | * @info: an #AmtkActionInfo. | |
347 | * | |
348 | * Returns the accelerators. This function never returns %NULL, it always | |
349 | * returns a %NULL-terminated array, to be suitable for | |
350 | * gtk_application_set_accels_for_action(). | |
351 | * | |
352 | * Returns: (transfer none) (array zero-terminated=1): a %NULL-terminated array | |
353 | * of accelerators in the format understood by gtk_accelerator_parse(). | |
354 | * Since: 2.0 | |
355 | */ | |
356 | const gchar * const * | |
357 | amtk_action_info_get_accels (const AmtkActionInfo *info) | |
358 | { | |
359 | g_return_val_if_fail (info != NULL, NULL); | |
360 | ||
361 | g_assert (info->accels != NULL); | |
362 | ||
363 | return (const gchar * const *)info->accels; | |
364 | } | |
365 | ||
366 | /** | |
367 | * amtk_action_info_set_accels: | |
368 | * @info: an #AmtkActionInfo. | |
369 | * @accels: (array zero-terminated=1): a %NULL-terminated array of accelerators | |
370 | * in the format understood by gtk_accelerator_parse(). | |
371 | * | |
372 | * A function similar to gtk_application_set_accels_for_action(). | |
373 | * | |
374 | * @accels must not be %NULL, it must be a %NULL-terminated array, to be | |
375 | * consistent with gtk_application_set_accels_for_action(). | |
376 | * | |
377 | * Since: 2.0 | |
378 | */ | |
379 | void | |
380 | amtk_action_info_set_accels (AmtkActionInfo *info, | |
381 | const gchar * const *accels) | |
382 | { | |
383 | g_return_if_fail (info != NULL); | |
384 | g_return_if_fail (accels != NULL); | |
385 | ||
386 | g_strfreev (info->accels); | |
387 | info->accels = _amtk_utils_strv_copy (accels); | |
388 | } | |
389 | ||
390 | /** | |
391 | * amtk_action_info_mark_as_used: | |
392 | * @info: an #AmtkActionInfo. | |
393 | * | |
394 | * Mark @info as used. An #AmtkFactory function that uses an #AmtkActionInfo | |
395 | * should call this function. See amtk_action_info_store_check_all_used(). | |
396 | * | |
397 | * Since: 3.0 | |
398 | */ | |
399 | void | |
400 | amtk_action_info_mark_as_used (AmtkActionInfo *info) | |
401 | { | |
402 | g_return_if_fail (info != NULL); | |
403 | ||
404 | info->used = TRUE; | |
405 | } | |
406 | ||
407 | /** | |
408 | * amtk_action_info_has_been_used: | |
409 | * @info: an #AmtkActionInfo. | |
410 | * | |
411 | * Returns whether @info has been used (for example by an #AmtkFactory | |
412 | * function). See also amtk_action_info_store_check_all_used(). | |
413 | * | |
414 | * Returns: whether @info has been used. | |
415 | * Since: 3.0 | |
416 | */ | |
417 | gboolean | |
418 | amtk_action_info_has_been_used (const AmtkActionInfo *info) | |
419 | { | |
420 | g_return_val_if_fail (info != NULL, FALSE); | |
421 | ||
422 | return info->used; | |
423 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_ACTION_INFO_H | |
20 | #define AMTK_ACTION_INFO_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <glib-object.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_ACTION_INFO (amtk_action_info_get_type ()) | |
32 | ||
33 | /** | |
34 | * AmtkActionInfoEntry: | |
35 | * @action_name: the action name. | |
36 | * @icon_name: the icon name, or %NULL. | |
37 | * @label: the label (i.e. a short description) with a mnemonic, or %NULL. | |
38 | * @accel: the accelerator, in the format understood by gtk_accelerator_parse(). | |
39 | * Or %NULL. | |
40 | * @tooltip: the tooltip (i.e. a long description), or %NULL. | |
41 | * | |
42 | * This struct defines a set of information for a single action. It is for use | |
43 | * with amtk_action_info_store_add_entries(). | |
44 | * | |
45 | * Like #GActionEntry, it is permissible to use an incomplete initialiser in | |
46 | * order to leave some of the later values as %NULL. Additional optional fields | |
47 | * may be added in the future. | |
48 | * | |
49 | * Since: 2.0 | |
50 | */ | |
51 | struct _AmtkActionInfoEntry | |
52 | { | |
53 | const gchar *action_name; | |
54 | const gchar *icon_name; | |
55 | const gchar *label; | |
56 | const gchar *accel; | |
57 | const gchar *tooltip; | |
58 | ||
59 | /*< private >*/ | |
60 | gpointer padding[3]; | |
61 | }; | |
62 | ||
63 | GType amtk_action_info_get_type (void) G_GNUC_CONST; | |
64 | ||
65 | AmtkActionInfo * amtk_action_info_new (void); | |
66 | ||
67 | AmtkActionInfo * amtk_action_info_new_from_entry (const AmtkActionInfoEntry *info_entry, | |
68 | const gchar *translation_domain); | |
69 | ||
70 | AmtkActionInfo * amtk_action_info_ref (AmtkActionInfo *info); | |
71 | ||
72 | void amtk_action_info_unref (AmtkActionInfo *info); | |
73 | ||
74 | AmtkActionInfo * amtk_action_info_copy (const AmtkActionInfo *info); | |
75 | ||
76 | const gchar * amtk_action_info_get_action_name (const AmtkActionInfo *info); | |
77 | ||
78 | void amtk_action_info_set_action_name (AmtkActionInfo *info, | |
79 | const gchar *action_name); | |
80 | ||
81 | const gchar * amtk_action_info_get_icon_name (const AmtkActionInfo *info); | |
82 | ||
83 | void amtk_action_info_set_icon_name (AmtkActionInfo *info, | |
84 | const gchar *icon_name); | |
85 | ||
86 | const gchar * amtk_action_info_get_label (const AmtkActionInfo *info); | |
87 | ||
88 | void amtk_action_info_set_label (AmtkActionInfo *info, | |
89 | const gchar *label); | |
90 | ||
91 | const gchar * amtk_action_info_get_tooltip (const AmtkActionInfo *info); | |
92 | ||
93 | void amtk_action_info_set_tooltip (AmtkActionInfo *info, | |
94 | const gchar *tooltip); | |
95 | ||
96 | const gchar * const * amtk_action_info_get_accels (const AmtkActionInfo *info); | |
97 | ||
98 | void amtk_action_info_set_accels (AmtkActionInfo *info, | |
99 | const gchar * const *accels); | |
100 | ||
101 | void amtk_action_info_mark_as_used (AmtkActionInfo *info); | |
102 | ||
103 | gboolean amtk_action_info_has_been_used (const AmtkActionInfo *info); | |
104 | ||
105 | G_END_DECLS | |
106 | ||
107 | #endif /* AMTK_ACTION_INFO_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-action-map.h" | |
20 | ||
21 | /** | |
22 | * SECTION:amtk-action-map | |
23 | * @Short_description: #GActionMap wrapper functions | |
24 | * @Title: AmtkActionMap | |
25 | * | |
26 | * #GActionMap wrapper functions. | |
27 | */ | |
28 | ||
29 | static void | |
30 | check_dups_in_array (const GActionEntry *entries, | |
31 | const gchar *action_name, | |
32 | gint action_num) | |
33 | { | |
34 | gint i; | |
35 | ||
36 | for (i = 0; i < action_num; i++) | |
37 | { | |
38 | const GActionEntry *entry = &entries[i]; | |
39 | ||
40 | if (g_strcmp0 (action_name, entry->name) == 0) | |
41 | { | |
42 | g_warning ("amtk_action_map_add_action_entries_check_dups(): " | |
43 | "the GActionEntry array contains duplicated entries for the action name '%s'. " | |
44 | "The first one will be dropped from the GActionMap.", | |
45 | action_name); | |
46 | return; | |
47 | } | |
48 | } | |
49 | } | |
50 | ||
51 | /** | |
52 | * amtk_action_map_add_action_entries_check_dups: | |
53 | * @action_map: a #GActionMap. | |
54 | * @entries: (array length=n_entries) (element-type GActionEntry): a pointer to | |
55 | * the first item in an array of #GActionEntry structs. | |
56 | * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated. | |
57 | * @user_data: the user data for signal connections. | |
58 | * | |
59 | * A wrapper function for g_action_map_add_action_entries() that checks | |
60 | * duplicates. | |
61 | * | |
62 | * This function first checks - for each entry - that the @action_map doesn't | |
63 | * already contain a #GAction with the same name. A warning is printed if an old | |
64 | * action will be dropped. In any case, it then calls | |
65 | * g_action_map_add_action_entries() with the same arguments as passed to this | |
66 | * function. | |
67 | * | |
68 | * This function also checks if there are duplicates in the @entries array | |
69 | * itself. | |
70 | * | |
71 | * Since: 2.0 | |
72 | */ | |
73 | void | |
74 | amtk_action_map_add_action_entries_check_dups (GActionMap *action_map, | |
75 | const GActionEntry *entries, | |
76 | gint n_entries, | |
77 | gpointer user_data) | |
78 | { | |
79 | gint i; | |
80 | ||
81 | g_return_if_fail (G_IS_ACTION_MAP (action_map)); | |
82 | g_return_if_fail (n_entries >= -1); | |
83 | g_return_if_fail (entries != NULL || n_entries == 0); | |
84 | ||
85 | for (i = 0; n_entries == -1 ? entries[i].name != NULL : i < n_entries; i++) | |
86 | { | |
87 | const GActionEntry *entry = &entries[i]; | |
88 | ||
89 | if (g_action_map_lookup_action (action_map, entry->name) != NULL) | |
90 | { | |
91 | g_warning ("%s(): the GActionMap already contains a GAction with the name '%s'. " | |
92 | "The old GAction will be dropped from the GActionMap.", | |
93 | G_STRFUNC, | |
94 | entry->name); | |
95 | } | |
96 | ||
97 | check_dups_in_array (entries, entry->name, i); | |
98 | } | |
99 | ||
100 | g_action_map_add_action_entries (action_map, | |
101 | entries, | |
102 | n_entries, | |
103 | user_data); | |
104 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_ACTION_MAP_H | |
20 | #define AMTK_ACTION_MAP_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gio/gio.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | void amtk_action_map_add_action_entries_check_dups (GActionMap *action_map, | |
31 | const GActionEntry *entries, | |
32 | gint n_entries, | |
33 | gpointer user_data); | |
34 | ||
35 | G_END_DECLS | |
36 | ||
37 | #endif /* AMTK_ACTION_MAP_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "config.h" | |
20 | #include "amtk-application-window.h" | |
21 | #include <glib/gi18n-lib.h> | |
22 | #include "amtk-action-info.h" | |
23 | #include "amtk-action-info-central-store.h" | |
24 | #include "amtk-menu-item.h" | |
25 | #include "amtk-menu-shell.h" | |
26 | #include "amtk-utils.h" | |
27 | ||
28 | /** | |
29 | * SECTION:amtk-application-window | |
30 | * @Short_description: An extension of GtkApplicationWindow | |
31 | * @Title: AmtkApplicationWindow | |
32 | * | |
33 | * #AmtkApplicationWindow extends the #GtkApplicationWindow class with a | |
34 | * #AmtkApplicationWindow:statusbar property and functions to show longer | |
35 | * descriptions of #GtkMenuItem's to the #GtkStatusbar. | |
36 | * | |
37 | * Note that #AmtkApplicationWindow extends the #GtkApplicationWindow class but | |
38 | * without subclassing it, because several libraries might want to extend | |
39 | * #GtkApplicationWindow and an application needs to be able to use all those | |
40 | * extensions at the same time. | |
41 | */ | |
42 | ||
43 | /* API design: | |
44 | * | |
45 | * AmtkApplicationWindow was first implemented in Tepl, and | |
46 | * TeplApplicationWindow needs to access the GtkApplicationWindow for the | |
47 | * GActionMap. Currently AmtkApplicationWindow could be renamed to AmtkWindow | |
48 | * and be an extension of GtkWindow instead of GtkApplicationWindow, it would | |
49 | * have the advantage to have shorter function names and be a little more | |
50 | * re-usable. But I think it's not a big problem to keep AmtkApplicationWindow | |
51 | * as is, because (1) the A in Amtk is all about GActions, so normally the app | |
52 | * already uses GtkApplicationWindow, (2) it is easy to port an application to | |
53 | * use GtkApplicationWindow, most of the time it's just changing the parent | |
54 | * class when subclassing GtkWindow, (3) it is more future-proof for Amtk to | |
55 | * have access to the GtkApplicationWindow, in case we want to add some features | |
56 | * that require the GActionMap or whatever. -- swilmet | |
57 | */ | |
58 | ||
59 | struct _AmtkApplicationWindowPrivate | |
60 | { | |
61 | GtkApplicationWindow *gtk_window; | |
62 | GtkStatusbar *statusbar; | |
63 | }; | |
64 | ||
65 | enum | |
66 | { | |
67 | PROP_0, | |
68 | PROP_APPLICATION_WINDOW, | |
69 | PROP_STATUSBAR, | |
70 | N_PROPERTIES | |
71 | }; | |
72 | ||
73 | #define AMTK_APPLICATION_WINDOW_KEY "amtk-application-window-key" | |
74 | #define MENU_SHELL_STATUSBAR_CONTEXT_ID_KEY "amtk-menu-shell-statusbar-context-id-key" | |
75 | #define MENU_SHELL_FOR_RECENT_CHOOSER_KEY "amtk-menu-shell-for-recent-chooser-key" | |
76 | ||
77 | static GParamSpec *properties[N_PROPERTIES]; | |
78 | ||
79 | G_DEFINE_TYPE_WITH_PRIVATE (AmtkApplicationWindow, amtk_application_window, G_TYPE_OBJECT) | |
80 | ||
81 | static void | |
82 | amtk_application_window_get_property (GObject *object, | |
83 | guint prop_id, | |
84 | GValue *value, | |
85 | GParamSpec *pspec) | |
86 | { | |
87 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (object); | |
88 | ||
89 | switch (prop_id) | |
90 | { | |
91 | case PROP_APPLICATION_WINDOW: | |
92 | g_value_set_object (value, amtk_application_window_get_application_window (amtk_window)); | |
93 | break; | |
94 | ||
95 | case PROP_STATUSBAR: | |
96 | g_value_set_object (value, amtk_application_window_get_statusbar (amtk_window)); | |
97 | break; | |
98 | ||
99 | default: | |
100 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
101 | break; | |
102 | } | |
103 | } | |
104 | ||
105 | static void | |
106 | amtk_application_window_set_property (GObject *object, | |
107 | guint prop_id, | |
108 | const GValue *value, | |
109 | GParamSpec *pspec) | |
110 | { | |
111 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (object); | |
112 | ||
113 | switch (prop_id) | |
114 | { | |
115 | case PROP_APPLICATION_WINDOW: | |
116 | g_assert (amtk_window->priv->gtk_window == NULL); | |
117 | amtk_window->priv->gtk_window = g_value_get_object (value); | |
118 | break; | |
119 | ||
120 | case PROP_STATUSBAR: | |
121 | amtk_application_window_set_statusbar (amtk_window, g_value_get_object (value)); | |
122 | break; | |
123 | ||
124 | default: | |
125 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
126 | break; | |
127 | } | |
128 | } | |
129 | ||
130 | static void | |
131 | amtk_application_window_dispose (GObject *object) | |
132 | { | |
133 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (object); | |
134 | ||
135 | amtk_window->priv->gtk_window = NULL; | |
136 | g_clear_object (&amtk_window->priv->statusbar); | |
137 | ||
138 | G_OBJECT_CLASS (amtk_application_window_parent_class)->dispose (object); | |
139 | } | |
140 | ||
141 | static void | |
142 | amtk_application_window_class_init (AmtkApplicationWindowClass *klass) | |
143 | { | |
144 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
145 | ||
146 | object_class->get_property = amtk_application_window_get_property; | |
147 | object_class->set_property = amtk_application_window_set_property; | |
148 | object_class->dispose = amtk_application_window_dispose; | |
149 | ||
150 | /** | |
151 | * AmtkApplicationWindow:application-window: | |
152 | * | |
153 | * The #GtkApplicationWindow. | |
154 | * | |
155 | * Since: 2.0 | |
156 | */ | |
157 | properties[PROP_APPLICATION_WINDOW] = | |
158 | g_param_spec_object ("application-window", | |
159 | "GtkApplicationWindow", | |
160 | "", | |
161 | GTK_TYPE_APPLICATION_WINDOW, | |
162 | G_PARAM_READWRITE | | |
163 | G_PARAM_CONSTRUCT_ONLY | | |
164 | G_PARAM_STATIC_STRINGS); | |
165 | ||
166 | /** | |
167 | * AmtkApplicationWindow:statusbar: | |
168 | * | |
169 | * The #GtkStatusbar. %NULL by default. | |
170 | * | |
171 | * Since: 2.0 | |
172 | */ | |
173 | properties[PROP_STATUSBAR] = | |
174 | g_param_spec_object ("statusbar", | |
175 | "GtkStatusbar", | |
176 | "", | |
177 | GTK_TYPE_STATUSBAR, | |
178 | G_PARAM_READWRITE | | |
179 | G_PARAM_STATIC_STRINGS); | |
180 | ||
181 | g_object_class_install_properties (object_class, N_PROPERTIES, properties); | |
182 | } | |
183 | ||
184 | static void | |
185 | amtk_application_window_init (AmtkApplicationWindow *amtk_window) | |
186 | { | |
187 | amtk_window->priv = amtk_application_window_get_instance_private (amtk_window); | |
188 | } | |
189 | ||
190 | /** | |
191 | * amtk_application_window_get_from_gtk_application_window: | |
192 | * @gtk_window: a #GtkApplicationWindow. | |
193 | * | |
194 | * Returns the #AmtkApplicationWindow of @gtk_window. The returned object is | |
195 | * guaranteed to be the same for the lifetime of @gtk_window. | |
196 | * | |
197 | * Returns: (transfer none): the #AmtkApplicationWindow of @gtk_window. | |
198 | * Since: 2.0 | |
199 | */ | |
200 | AmtkApplicationWindow * | |
201 | amtk_application_window_get_from_gtk_application_window (GtkApplicationWindow *gtk_window) | |
202 | { | |
203 | AmtkApplicationWindow *amtk_window; | |
204 | ||
205 | g_return_val_if_fail (GTK_IS_APPLICATION_WINDOW (gtk_window), NULL); | |
206 | ||
207 | amtk_window = g_object_get_data (G_OBJECT (gtk_window), AMTK_APPLICATION_WINDOW_KEY); | |
208 | ||
209 | if (amtk_window == NULL) | |
210 | { | |
211 | amtk_window = g_object_new (AMTK_TYPE_APPLICATION_WINDOW, | |
212 | "application-window", gtk_window, | |
213 | NULL); | |
214 | ||
215 | g_object_set_data_full (G_OBJECT (gtk_window), | |
216 | AMTK_APPLICATION_WINDOW_KEY, | |
217 | amtk_window, | |
218 | g_object_unref); | |
219 | } | |
220 | ||
221 | g_return_val_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window), NULL); | |
222 | return amtk_window; | |
223 | } | |
224 | ||
225 | /** | |
226 | * amtk_application_window_get_application_window: | |
227 | * @amtk_window: an #AmtkApplicationWindow. | |
228 | * | |
229 | * Returns: (transfer none): the #GtkApplicationWindow of @amtk_window. | |
230 | * Since: 2.0 | |
231 | */ | |
232 | GtkApplicationWindow * | |
233 | amtk_application_window_get_application_window (AmtkApplicationWindow *amtk_window) | |
234 | { | |
235 | g_return_val_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window), NULL); | |
236 | ||
237 | return amtk_window->priv->gtk_window; | |
238 | } | |
239 | ||
240 | /** | |
241 | * amtk_application_window_get_statusbar: | |
242 | * @amtk_window: an #AmtkApplicationWindow. | |
243 | * | |
244 | * Returns: (transfer none) (nullable): the #AmtkApplicationWindow:statusbar. | |
245 | * Since: 2.0 | |
246 | */ | |
247 | GtkStatusbar * | |
248 | amtk_application_window_get_statusbar (AmtkApplicationWindow *amtk_window) | |
249 | { | |
250 | g_return_val_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window), NULL); | |
251 | ||
252 | return amtk_window->priv->statusbar; | |
253 | } | |
254 | ||
255 | /** | |
256 | * amtk_application_window_set_statusbar: | |
257 | * @amtk_window: an #AmtkApplicationWindow. | |
258 | * @statusbar: (nullable): a #GtkStatusbar, or %NULL. | |
259 | * | |
260 | * Sets the #AmtkApplicationWindow:statusbar property. | |
261 | * | |
262 | * Since: 2.0 | |
263 | */ | |
264 | void | |
265 | amtk_application_window_set_statusbar (AmtkApplicationWindow *amtk_window, | |
266 | GtkStatusbar *statusbar) | |
267 | { | |
268 | g_return_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window)); | |
269 | g_return_if_fail (statusbar == NULL || GTK_IS_STATUSBAR (statusbar)); | |
270 | ||
271 | if (amtk_window->priv->statusbar == statusbar) | |
272 | { | |
273 | return; | |
274 | } | |
275 | ||
276 | if (statusbar != NULL) | |
277 | { | |
278 | g_object_ref_sink (statusbar); | |
279 | } | |
280 | ||
281 | if (amtk_window->priv->statusbar != NULL) | |
282 | { | |
283 | g_object_unref (amtk_window->priv->statusbar); | |
284 | } | |
285 | ||
286 | amtk_window->priv->statusbar = statusbar; | |
287 | g_object_notify_by_pspec (G_OBJECT (amtk_window), properties[PROP_STATUSBAR]); | |
288 | } | |
289 | ||
290 | /* Returns: %TRUE if a context ID exists and has been set to @context_id. */ | |
291 | static gboolean | |
292 | get_statusbar_context_id_for_menu_shell (AmtkApplicationWindow *amtk_window, | |
293 | AmtkMenuShell *amtk_menu_shell, | |
294 | gboolean create, | |
295 | guint *context_id) | |
296 | { | |
297 | gpointer data; | |
298 | ||
299 | g_assert (amtk_window->priv->statusbar != NULL); | |
300 | g_assert (context_id != NULL); | |
301 | ||
302 | data = g_object_get_data (G_OBJECT (amtk_menu_shell), MENU_SHELL_STATUSBAR_CONTEXT_ID_KEY); | |
303 | ||
304 | if (data == NULL && !create) | |
305 | { | |
306 | return FALSE; | |
307 | } | |
308 | ||
309 | if (data == NULL) | |
310 | { | |
311 | *context_id = gtk_statusbar_get_context_id (amtk_window->priv->statusbar, | |
312 | "Show long description of menu items."); | |
313 | ||
314 | g_object_set_data (G_OBJECT (amtk_menu_shell), | |
315 | MENU_SHELL_STATUSBAR_CONTEXT_ID_KEY, | |
316 | GUINT_TO_POINTER (*context_id)); | |
317 | } | |
318 | else | |
319 | { | |
320 | *context_id = GPOINTER_TO_UINT (data); | |
321 | } | |
322 | ||
323 | return TRUE; | |
324 | } | |
325 | ||
326 | /* Free the return value with g_free(). */ | |
327 | static gchar * | |
328 | get_menu_item_long_description (AmtkMenuShell *amtk_menu_shell, | |
329 | GtkMenuItem *menu_item) | |
330 | { | |
331 | const gchar *long_description; | |
332 | gpointer data; | |
333 | gboolean is_for_recent_chooser; | |
334 | ||
335 | long_description = amtk_menu_item_get_long_description (menu_item); | |
336 | if (long_description != NULL) | |
337 | { | |
338 | return g_strdup (long_description); | |
339 | } | |
340 | ||
341 | data = g_object_get_data (G_OBJECT (amtk_menu_shell), MENU_SHELL_FOR_RECENT_CHOOSER_KEY); | |
342 | is_for_recent_chooser = data != NULL ? GPOINTER_TO_INT (data) : FALSE; | |
343 | ||
344 | if (is_for_recent_chooser) | |
345 | { | |
346 | GtkMenuShell *gtk_menu_shell; | |
347 | GtkRecentChooserMenu *recent_chooser_menu; | |
348 | gchar *uri; | |
349 | GFile *file; | |
350 | gchar *parse_name; | |
351 | gchar *nicer_filename; | |
352 | gchar *ret; | |
353 | ||
354 | gtk_menu_shell = amtk_menu_shell_get_menu_shell (amtk_menu_shell); | |
355 | recent_chooser_menu = GTK_RECENT_CHOOSER_MENU (gtk_menu_shell); | |
356 | uri = amtk_utils_recent_chooser_menu_get_item_uri (recent_chooser_menu, menu_item); | |
357 | ||
358 | if (uri == NULL) | |
359 | { | |
360 | return NULL; | |
361 | } | |
362 | ||
363 | file = g_file_new_for_uri (uri); | |
364 | g_free (uri); | |
365 | ||
366 | parse_name = g_file_get_parse_name (file); | |
367 | g_object_unref (file); | |
368 | ||
369 | nicer_filename = _amtk_utils_replace_home_dir_with_tilde (parse_name); | |
370 | g_free (parse_name); | |
371 | ||
372 | /* Translators: %s is a filename. */ | |
373 | ret = g_strdup_printf (_("Open “%s”"), nicer_filename); | |
374 | g_free (nicer_filename); | |
375 | ||
376 | return ret; | |
377 | } | |
378 | ||
379 | return NULL; | |
380 | } | |
381 | ||
382 | static void | |
383 | menu_item_selected_cb (AmtkMenuShell *amtk_menu_shell, | |
384 | GtkMenuItem *menu_item, | |
385 | gpointer user_data) | |
386 | { | |
387 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (user_data); | |
388 | gchar *long_description; | |
389 | guint context_id; | |
390 | ||
391 | if (amtk_window->priv->statusbar == NULL) | |
392 | { | |
393 | return; | |
394 | } | |
395 | ||
396 | long_description = get_menu_item_long_description (amtk_menu_shell, menu_item); | |
397 | if (long_description == NULL) | |
398 | { | |
399 | return; | |
400 | } | |
401 | ||
402 | get_statusbar_context_id_for_menu_shell (amtk_window, | |
403 | amtk_menu_shell, | |
404 | TRUE, | |
405 | &context_id); | |
406 | ||
407 | gtk_statusbar_push (amtk_window->priv->statusbar, | |
408 | context_id, | |
409 | long_description); | |
410 | ||
411 | g_free (long_description); | |
412 | } | |
413 | ||
414 | static void | |
415 | menu_item_deselected_cb (AmtkMenuShell *amtk_menu_shell, | |
416 | GtkMenuItem *menu_item, | |
417 | gpointer user_data) | |
418 | { | |
419 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (user_data); | |
420 | const gchar *long_description; | |
421 | gpointer data; | |
422 | gboolean is_for_recent_chooser; | |
423 | guint context_id; | |
424 | ||
425 | if (amtk_window->priv->statusbar == NULL) | |
426 | { | |
427 | return; | |
428 | } | |
429 | ||
430 | long_description = amtk_menu_item_get_long_description (menu_item); | |
431 | ||
432 | data = g_object_get_data (G_OBJECT (amtk_menu_shell), MENU_SHELL_FOR_RECENT_CHOOSER_KEY); | |
433 | is_for_recent_chooser = data != NULL ? GPOINTER_TO_INT (data) : FALSE; | |
434 | ||
435 | if (long_description == NULL && !is_for_recent_chooser) | |
436 | { | |
437 | return; | |
438 | } | |
439 | ||
440 | if (get_statusbar_context_id_for_menu_shell (amtk_window, | |
441 | amtk_menu_shell, | |
442 | FALSE, | |
443 | &context_id)) | |
444 | { | |
445 | gtk_statusbar_pop (amtk_window->priv->statusbar, context_id); | |
446 | } | |
447 | } | |
448 | ||
449 | static void | |
450 | statusbar_notify_cb (AmtkApplicationWindow *amtk_window, | |
451 | GParamSpec *pspec, | |
452 | gpointer user_data) | |
453 | { | |
454 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (user_data); | |
455 | ||
456 | g_object_set_data (G_OBJECT (amtk_menu_shell), | |
457 | MENU_SHELL_STATUSBAR_CONTEXT_ID_KEY, | |
458 | NULL); | |
459 | } | |
460 | ||
461 | /** | |
462 | * amtk_application_window_connect_menu_to_statusbar: | |
463 | * @amtk_window: an #AmtkApplicationWindow. | |
464 | * @menu_shell: a #GtkMenuShell. | |
465 | * | |
466 | * Connects to the #AmtkMenuShell::menu-item-selected and | |
467 | * #AmtkMenuShell::menu-item-deselected signals of @menu_shell to push/pop the | |
468 | * long description of #GtkMenuItem's to the #AmtkApplicationWindow:statusbar. | |
469 | * | |
470 | * The long description is retrieved with amtk_menu_item_get_long_description(). | |
471 | * So amtk_menu_item_set_long_description() must have been called, which is the | |
472 | * case if the #GtkMenuItem has been created with #AmtkFactory. | |
473 | * | |
474 | * Since: 2.0 | |
475 | */ | |
476 | void | |
477 | amtk_application_window_connect_menu_to_statusbar (AmtkApplicationWindow *amtk_window, | |
478 | GtkMenuShell *menu_shell) | |
479 | { | |
480 | AmtkMenuShell *amtk_menu_shell; | |
481 | ||
482 | g_return_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window)); | |
483 | g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell)); | |
484 | ||
485 | amtk_menu_shell = amtk_menu_shell_get_from_gtk_menu_shell (menu_shell); | |
486 | ||
487 | g_signal_connect_object (amtk_menu_shell, | |
488 | "menu-item-selected", | |
489 | G_CALLBACK (menu_item_selected_cb), | |
490 | amtk_window, | |
491 | 0); | |
492 | ||
493 | g_signal_connect_object (amtk_menu_shell, | |
494 | "menu-item-deselected", | |
495 | G_CALLBACK (menu_item_deselected_cb), | |
496 | amtk_window, | |
497 | 0); | |
498 | ||
499 | g_signal_connect_object (amtk_window, | |
500 | "notify::statusbar", | |
501 | G_CALLBACK (statusbar_notify_cb), | |
502 | amtk_menu_shell, | |
503 | 0); | |
504 | } | |
505 | ||
506 | /** | |
507 | * amtk_application_window_connect_recent_chooser_menu_to_statusbar: | |
508 | * @amtk_window: an #AmtkApplicationWindow. | |
509 | * @menu: a #GtkRecentChooserMenu. | |
510 | * | |
511 | * An alternative to gtk_recent_chooser_set_show_tips(). Shows the full path in | |
512 | * the #AmtkApplicationWindow:statusbar when a #GtkMenuItem of @menu is | |
513 | * selected. | |
514 | * | |
515 | * The full path is retrieved with | |
516 | * amtk_utils_recent_chooser_menu_get_item_uri(). | |
517 | * | |
518 | * Since: 2.0 | |
519 | */ | |
520 | void | |
521 | amtk_application_window_connect_recent_chooser_menu_to_statusbar (AmtkApplicationWindow *amtk_window, | |
522 | GtkRecentChooserMenu *menu) | |
523 | { | |
524 | AmtkMenuShell *amtk_menu_shell; | |
525 | ||
526 | g_return_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window)); | |
527 | g_return_if_fail (GTK_IS_RECENT_CHOOSER_MENU (menu)); | |
528 | ||
529 | amtk_menu_shell = amtk_menu_shell_get_from_gtk_menu_shell (GTK_MENU_SHELL (menu)); | |
530 | ||
531 | g_object_set_data (G_OBJECT (amtk_menu_shell), | |
532 | MENU_SHELL_FOR_RECENT_CHOOSER_KEY, | |
533 | GINT_TO_POINTER (TRUE)); | |
534 | ||
535 | amtk_application_window_connect_menu_to_statusbar (amtk_window, GTK_MENU_SHELL (menu)); | |
536 | } | |
537 | ||
538 | static void | |
539 | open_recent_file_cb (GtkRecentChooser *recent_chooser, | |
540 | gpointer user_data) | |
541 | { | |
542 | AmtkApplicationWindow *amtk_window = AMTK_APPLICATION_WINDOW (user_data); | |
543 | gchar *uri; | |
544 | GFile *files[1]; | |
545 | GtkApplication *app; | |
546 | ||
547 | uri = gtk_recent_chooser_get_current_uri (recent_chooser); | |
548 | files[0] = g_file_new_for_uri (uri); | |
549 | ||
550 | app = gtk_window_get_application (GTK_WINDOW (amtk_window->priv->gtk_window)); | |
551 | g_application_open (G_APPLICATION (app), files, 1, ""); | |
552 | ||
553 | g_free (uri); | |
554 | g_object_unref (files[0]); | |
555 | } | |
556 | ||
557 | /** | |
558 | * amtk_application_window_create_open_recent_menu: | |
559 | * @amtk_window: an #AmtkApplicationWindow. | |
560 | * | |
561 | * Creates a simple and generic #GtkRecentChooserMenu. | |
562 | * | |
563 | * The #GtkRecentChooser is configured to show files only recently used with the | |
564 | * current application, as returned by g_get_application_name(). If recent files | |
565 | * are added to the default #GtkRecentManager with | |
566 | * gtk_recent_manager_add_item(), the files will normally show up in the | |
567 | * #GtkRecentChooserMenu. | |
568 | * | |
569 | * The #GtkRecentChooserMenu is connected to the statusbar with | |
570 | * amtk_application_window_connect_recent_chooser_menu_to_statusbar(). | |
571 | * | |
572 | * When the #GtkRecentChooser::item-activated signal is emitted, | |
573 | * g_application_open() is called (with an empty hint), so the #GApplication | |
574 | * must have the %G_APPLICATION_HANDLES_OPEN flag set. | |
575 | * | |
576 | * Returns: (transfer floating): a new #GtkRecentChooserMenu. | |
577 | * Since: 3.0 | |
578 | */ | |
579 | GtkWidget * | |
580 | amtk_application_window_create_open_recent_menu (AmtkApplicationWindow *amtk_window) | |
581 | { | |
582 | GtkRecentChooserMenu *recent_chooser_menu; | |
583 | GtkRecentChooser *recent_chooser; | |
584 | GtkRecentFilter *filter; | |
585 | ||
586 | g_return_val_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window), NULL); | |
587 | ||
588 | recent_chooser_menu = GTK_RECENT_CHOOSER_MENU (gtk_recent_chooser_menu_new ()); | |
589 | ||
590 | recent_chooser = GTK_RECENT_CHOOSER (recent_chooser_menu); | |
591 | gtk_recent_chooser_set_local_only (recent_chooser, FALSE); | |
592 | gtk_recent_chooser_set_sort_type (recent_chooser, GTK_RECENT_SORT_MRU); | |
593 | ||
594 | filter = gtk_recent_filter_new (); | |
595 | gtk_recent_filter_add_application (filter, g_get_application_name ()); | |
596 | gtk_recent_chooser_set_filter (recent_chooser, filter); | |
597 | ||
598 | amtk_application_window_connect_recent_chooser_menu_to_statusbar (amtk_window, recent_chooser_menu); | |
599 | ||
600 | g_signal_connect_object (recent_chooser, | |
601 | "item-activated", | |
602 | G_CALLBACK (open_recent_file_cb), | |
603 | amtk_window, | |
604 | 0); | |
605 | ||
606 | return GTK_WIDGET (recent_chooser_menu); | |
607 | } | |
608 | ||
609 | /** | |
610 | * amtk_application_window_create_open_recent_menu_item: | |
611 | * @amtk_window: an #AmtkApplicationWindow. | |
612 | * | |
613 | * Creates a #GtkMenuItem with a simple and generic #GtkRecentChooserMenu as | |
614 | * submenu. The #GtkRecentChooserMenu is created with | |
615 | * amtk_application_window_create_open_recent_menu(). | |
616 | * | |
617 | * Returns: (transfer floating): a new #GtkMenuItem. | |
618 | * Since: 2.0 | |
619 | */ | |
620 | GtkWidget * | |
621 | amtk_application_window_create_open_recent_menu_item (AmtkApplicationWindow *amtk_window) | |
622 | { | |
623 | GtkMenuItem *menu_item; | |
624 | gchar *long_description; | |
625 | GtkWidget *recent_chooser_menu; | |
626 | ||
627 | g_return_val_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window), NULL); | |
628 | ||
629 | menu_item = GTK_MENU_ITEM (gtk_menu_item_new_with_mnemonic (_("Open _Recent"))); | |
630 | ||
631 | /* Translators: %s is the application name. */ | |
632 | long_description = g_strdup_printf (_("Open a file recently used with %s"), | |
633 | g_get_application_name ()); | |
634 | amtk_menu_item_set_long_description (menu_item, long_description); | |
635 | g_free (long_description); | |
636 | ||
637 | recent_chooser_menu = amtk_application_window_create_open_recent_menu (amtk_window); | |
638 | gtk_menu_item_set_submenu (menu_item, recent_chooser_menu); | |
639 | ||
640 | return GTK_WIDGET (menu_item); | |
641 | } | |
642 | ||
643 | /* ex:set ts=8 noet: */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_APPLICATION_WINDOW_H | |
20 | #define AMTK_APPLICATION_WINDOW_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gtk/gtk.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_APPLICATION_WINDOW (amtk_application_window_get_type ()) | |
32 | #define AMTK_APPLICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMTK_TYPE_APPLICATION_WINDOW, AmtkApplicationWindow)) | |
33 | #define AMTK_APPLICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AMTK_TYPE_APPLICATION_WINDOW, AmtkApplicationWindowClass)) | |
34 | #define AMTK_IS_APPLICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMTK_TYPE_APPLICATION_WINDOW)) | |
35 | #define AMTK_IS_APPLICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMTK_TYPE_APPLICATION_WINDOW)) | |
36 | #define AMTK_APPLICATION_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AMTK_TYPE_APPLICATION_WINDOW, AmtkApplicationWindowClass)) | |
37 | ||
38 | typedef struct _AmtkApplicationWindowClass AmtkApplicationWindowClass; | |
39 | typedef struct _AmtkApplicationWindowPrivate AmtkApplicationWindowPrivate; | |
40 | ||
41 | struct _AmtkApplicationWindow | |
42 | { | |
43 | GObject parent; | |
44 | ||
45 | AmtkApplicationWindowPrivate *priv; | |
46 | }; | |
47 | ||
48 | struct _AmtkApplicationWindowClass | |
49 | { | |
50 | GObjectClass parent_class; | |
51 | ||
52 | gpointer padding[12]; | |
53 | }; | |
54 | ||
55 | GType amtk_application_window_get_type (void) G_GNUC_CONST; | |
56 | ||
57 | AmtkApplicationWindow * amtk_application_window_get_from_gtk_application_window (GtkApplicationWindow *gtk_window); | |
58 | ||
59 | GtkApplicationWindow * amtk_application_window_get_application_window (AmtkApplicationWindow *amtk_window); | |
60 | ||
61 | GtkStatusbar * amtk_application_window_get_statusbar (AmtkApplicationWindow *amtk_window); | |
62 | ||
63 | void amtk_application_window_set_statusbar (AmtkApplicationWindow *amtk_window, | |
64 | GtkStatusbar *statusbar); | |
65 | ||
66 | void amtk_application_window_connect_menu_to_statusbar (AmtkApplicationWindow *amtk_window, | |
67 | GtkMenuShell *menu_shell); | |
68 | ||
69 | void amtk_application_window_connect_recent_chooser_menu_to_statusbar | |
70 | (AmtkApplicationWindow *amtk_window, | |
71 | GtkRecentChooserMenu *menu); | |
72 | ||
73 | GtkWidget * amtk_application_window_create_open_recent_menu (AmtkApplicationWindow *amtk_window); | |
74 | ||
75 | GtkWidget * amtk_application_window_create_open_recent_menu_item (AmtkApplicationWindow *amtk_window); | |
76 | ||
77 | G_END_DECLS | |
78 | ||
79 | #endif /* AMTK_APPLICATION_WINDOW_H */ | |
80 | ||
81 | /* ex:set ts=8 noet: */ |
0 | /*** BEGIN file-header ***/ | |
1 | #include "amtk-enum-types.h" | |
2 | ||
3 | /*** END file-header ***/ | |
4 | ||
5 | /*** BEGIN file-production ***/ | |
6 | /* enumerations from "@filename@" */ | |
7 | #include "@filename@" | |
8 | ||
9 | /*** END file-production ***/ | |
10 | ||
11 | /*** BEGIN value-header ***/ | |
12 | GType | |
13 | @enum_name@_get_type (void) | |
14 | { | |
15 | static GType the_type = 0; | |
16 | ||
17 | if (the_type == 0) | |
18 | { | |
19 | static const G@Type@Value values[] = { | |
20 | /*** END value-header ***/ | |
21 | ||
22 | /*** BEGIN value-production ***/ | |
23 | { @VALUENAME@, | |
24 | "@VALUENAME@", | |
25 | "@valuenick@" }, | |
26 | /*** END value-production ***/ | |
27 | ||
28 | /*** BEGIN value-tail ***/ | |
29 | { 0, NULL, NULL } | |
30 | }; | |
31 | ||
32 | the_type = g_@type@_register_static ( | |
33 | g_intern_static_string ("@EnumName@"), | |
34 | values); | |
35 | } | |
36 | ||
37 | return the_type; | |
38 | } | |
39 | ||
40 | /*** END value-tail ***/ |
0 | /*** BEGIN file-header ***/ | |
1 | #ifndef AMTK_ENUM_TYPES_H | |
2 | #define AMTK_ENUM_TYPES_H | |
3 | ||
4 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
5 | #error "Only <amtk/amtk.h> can be included directly." | |
6 | #endif | |
7 | ||
8 | #include <glib-object.h> | |
9 | ||
10 | G_BEGIN_DECLS | |
11 | ||
12 | /*** END file-header ***/ | |
13 | ||
14 | /*** BEGIN file-production ***/ | |
15 | /* Enumerations from "@filename@" */ | |
16 | ||
17 | /*** END file-production ***/ | |
18 | ||
19 | /*** BEGIN enumeration-production ***/ | |
20 | #define AMTK_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) | |
21 | GType @enum_name@_get_type (void); | |
22 | ||
23 | /*** END enumeration-production ***/ | |
24 | ||
25 | /*** BEGIN file-tail ***/ | |
26 | G_END_DECLS | |
27 | ||
28 | #endif /* AMTK_ENUM_TYPES_H */ | |
29 | /*** END file-tail ***/ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-factory.h" | |
20 | #include "amtk-action-info.h" | |
21 | #include "amtk-action-info-central-store.h" | |
22 | #include "amtk-menu-item.h" | |
23 | #include "amtk-enum-types.h" | |
24 | ||
25 | /** | |
26 | * SECTION:amtk-factory | |
27 | * @Short_description: Factory functions | |
28 | * @Title: AmtkFactory | |
29 | * | |
30 | * #AmtkFactory contains functions to create menu or toolbar items from | |
31 | * #AmtkActionInfo's. A factory function accesses an #AmtkActionInfo from the | |
32 | * #AmtkActionInfoCentralStore. | |
33 | * | |
34 | * A #GtkApplication can be associated so that factory functions can call | |
35 | * gtk_application_set_accels_for_action() with the accelerators returned by | |
36 | * amtk_action_info_get_accels() (this erases previously set accelerators for | |
37 | * that action, if any). Note that gtk_application_set_accels_for_action() is | |
38 | * called by factory functions and not by amtk_action_info_store_add(), so that | |
39 | * libraries can provide their own store and the accelerators are set to the | |
40 | * #GtkApplication only if an #AmtkActionInfo is actually used. | |
41 | * | |
42 | * #AmtkFactoryFlags permits to control how a factory function creates the | |
43 | * object, to ignore some steps. Factory functions are declined in two variants: | |
44 | * a simple form which takes the value of the #AmtkFactory:default-flags | |
45 | * property, and the same function with the `_full` suffix which takes an | |
46 | * #AmtkFactoryFlags argument and ignores the #AmtkFactory:default-flags. See | |
47 | * for example amtk_factory_create_menu_item() and | |
48 | * amtk_factory_create_menu_item_full(). | |
49 | * | |
50 | * # Static objects # {#amtk-factory-static-objects} | |
51 | * | |
52 | * An important detail is that once a factory function has created an object, | |
53 | * the object is not updated if the corresponding #AmtkActionInfo is modified | |
54 | * afterwards. #AmtkActionInfo doesn't have a notify signal, and it is anyway | |
55 | * discouraged to modify an #AmtkActionInfo after being added to an | |
56 | * #AmtkActionInfoStore. An #AmtkActionInfoStore is meant to be something | |
57 | * static, created on application startup. Updating automatically menu and | |
58 | * toolbar items is out of scope for the Amtk library. If for example action | |
59 | * accelerators can be modified at run-time, the menu needs to be re-generated. | |
60 | * | |
61 | * # Menus | |
62 | * | |
63 | * Some general notes about the functions that create #GtkMenuItem's: | |
64 | * - If not ignored by an #AmtkFactoryFlags, the first accelerator returned by | |
65 | * amtk_action_info_get_accels() is set to the #GtkAccelLabel of the | |
66 | * #GtkMenuItem. | |
67 | * - If not ignored by an #AmtkFactoryFlags, the tooltip is set with | |
68 | * amtk_menu_item_set_long_description(), which permits to display it in a | |
69 | * #GtkStatusbar with amtk_application_window_connect_menu_to_statusbar(). | |
70 | * | |
71 | * ## Code example to create a menu | |
72 | * | |
73 | * How to create a #GtkMenuBar with #AmtkFactory. Each submenu is created by a | |
74 | * separate function, to make the code clearer. | |
75 | * | |
76 | * |[ | |
77 | * static GtkWidget * | |
78 | * create_file_submenu (void) | |
79 | * { | |
80 | * GtkMenuShell *file_submenu; | |
81 | * AmtkFactory *factory; | |
82 | * | |
83 | * file_submenu = GTK_MENU_SHELL (gtk_menu_new ()); | |
84 | * | |
85 | * factory = amtk_factory_new_with_default_application (); | |
86 | * gtk_menu_shell_append (file_submenu, amtk_factory_create_menu_item (factory, "win.open")); | |
87 | * gtk_menu_shell_append (file_submenu, amtk_factory_create_menu_item (factory, "win.save")); | |
88 | * gtk_menu_shell_append (file_submenu, gtk_separator_menu_item_new ()); | |
89 | * gtk_menu_shell_append (file_submenu, amtk_factory_create_menu_item (factory, "app.quit")); | |
90 | * g_object_unref (factory); | |
91 | * | |
92 | * return GTK_WIDGET (file_submenu); | |
93 | * } | |
94 | * | |
95 | * static GtkWidget * | |
96 | * create_help_submenu (void) | |
97 | * { | |
98 | * GtkMenuShell *help_submenu; | |
99 | * AmtkFactory *factory; | |
100 | * | |
101 | * help_submenu = GTK_MENU_SHELL (gtk_menu_new ()); | |
102 | * | |
103 | * factory = amtk_factory_new_with_default_application (); | |
104 | * gtk_menu_shell_append (help_submenu, amtk_factory_create_menu_item (factory, "app.about")); | |
105 | * g_object_unref (factory); | |
106 | * | |
107 | * return GTK_WIDGET (help_submenu); | |
108 | * } | |
109 | * | |
110 | * static GtkWidget * | |
111 | * create_menu_bar (void) | |
112 | * { | |
113 | * GtkWidget *file_menu_item; | |
114 | * GtkWidget *help_menu_item; | |
115 | * GtkWidget *menu_bar; | |
116 | * | |
117 | * file_menu_item = gtk_menu_item_new_with_mnemonic ("_File"); | |
118 | * gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_menu_item), | |
119 | * create_file_submenu ()); | |
120 | * | |
121 | * help_menu_item = gtk_menu_item_new_with_mnemonic ("_Help"); | |
122 | * gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_menu_item), | |
123 | * create_help_submenu ()); | |
124 | * | |
125 | * menu_bar = gtk_menu_bar_new (); | |
126 | * gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), file_menu_item); | |
127 | * gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), help_menu_item); | |
128 | * | |
129 | * // Additionally, it is a good place to call | |
130 | * // amtk_action_info_store_check_all_used() here. | |
131 | * | |
132 | * return menu_bar; | |
133 | * } | |
134 | * ]| | |
135 | * | |
136 | * # Toolbars | |
137 | * | |
138 | * Some general notes about the functions that create #GtkToolItem's: | |
139 | * - The accelerators returned by amtk_action_info_get_accels() are not used for | |
140 | * documentation purposes in a toolbar, so the | |
141 | * %AMTK_FACTORY_IGNORE_ACCELS_FOR_DOC flag has no impact. The accelerators | |
142 | * are documented only in menu items. | |
143 | * | |
144 | * ## Code example to create a toolbar | |
145 | * | |
146 | * How to create a basic #GtkToolbar with #AmtkFactory. | |
147 | * | |
148 | * |[ | |
149 | * static GtkWidget * | |
150 | * create_toolbar (void) | |
151 | * { | |
152 | * GtkToolbar *toolbar; | |
153 | * AmtkFactory *factory; | |
154 | * | |
155 | * toolbar = GTK_TOOLBAR (gtk_toolbar_new ()); | |
156 | * | |
157 | * // Small performance improvement: | |
158 | * // Do not associate a GtkApplication, because the menu has already been | |
159 | * // generated, the menu contains all actions, so | |
160 | * // gtk_application_set_accels_for_action() has already been called for all | |
161 | * // actions. Another way is to set the AMTK_FACTORY_IGNORE_ACCELS_FOR_APP | |
162 | * // flag. | |
163 | * factory = amtk_factory_new (NULL); | |
164 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.new-file"), -1); | |
165 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.open"), -1); | |
166 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.save"), -1); | |
167 | * gtk_toolbar_insert (toolbar, gtk_separator_tool_item_new (), -1); | |
168 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.cut"), -1); | |
169 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.copy"), -1); | |
170 | * gtk_toolbar_insert (toolbar, amtk_factory_create_tool_button (factory, "win.paste"), -1); | |
171 | * g_object_unref (factory); | |
172 | * | |
173 | * return GTK_WIDGET (toolbar); | |
174 | * } | |
175 | * ]| | |
176 | */ | |
177 | ||
178 | struct _AmtkFactoryPrivate | |
179 | { | |
180 | /* Weak ref */ | |
181 | GtkApplication *app; | |
182 | ||
183 | AmtkFactoryFlags default_flags; | |
184 | }; | |
185 | ||
186 | enum | |
187 | { | |
188 | PROP_0, | |
189 | PROP_APPLICATION, | |
190 | PROP_DEFAULT_FLAGS, | |
191 | N_PROPERTIES | |
192 | }; | |
193 | ||
194 | static GParamSpec *properties[N_PROPERTIES]; | |
195 | ||
196 | G_DEFINE_TYPE_WITH_PRIVATE (AmtkFactory, amtk_factory, G_TYPE_OBJECT) | |
197 | ||
198 | static void | |
199 | amtk_factory_get_property (GObject *object, | |
200 | guint prop_id, | |
201 | GValue *value, | |
202 | GParamSpec *pspec) | |
203 | { | |
204 | AmtkFactory *factory = AMTK_FACTORY (object); | |
205 | ||
206 | switch (prop_id) | |
207 | { | |
208 | case PROP_APPLICATION: | |
209 | g_value_set_object (value, amtk_factory_get_application (factory)); | |
210 | break; | |
211 | ||
212 | case PROP_DEFAULT_FLAGS: | |
213 | g_value_set_flags (value, amtk_factory_get_default_flags (factory)); | |
214 | break; | |
215 | ||
216 | default: | |
217 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
218 | break; | |
219 | } | |
220 | } | |
221 | ||
222 | static void | |
223 | amtk_factory_set_property (GObject *object, | |
224 | guint prop_id, | |
225 | const GValue *value, | |
226 | GParamSpec *pspec) | |
227 | { | |
228 | AmtkFactory *factory = AMTK_FACTORY (object); | |
229 | ||
230 | switch (prop_id) | |
231 | { | |
232 | case PROP_APPLICATION: | |
233 | g_assert (factory->priv->app == NULL); | |
234 | factory->priv->app = g_value_get_object (value); | |
235 | if (factory->priv->app != NULL) | |
236 | { | |
237 | g_object_add_weak_pointer (G_OBJECT (factory->priv->app), | |
238 | (gpointer *) &factory->priv->app); | |
239 | } | |
240 | break; | |
241 | ||
242 | case PROP_DEFAULT_FLAGS: | |
243 | amtk_factory_set_default_flags (factory, g_value_get_flags (value)); | |
244 | break; | |
245 | ||
246 | default: | |
247 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
248 | break; | |
249 | } | |
250 | } | |
251 | ||
252 | static void | |
253 | amtk_factory_dispose (GObject *object) | |
254 | { | |
255 | AmtkFactory *factory = AMTK_FACTORY (object); | |
256 | ||
257 | if (factory->priv->app != NULL) | |
258 | { | |
259 | g_object_remove_weak_pointer (G_OBJECT (factory->priv->app), | |
260 | (gpointer *) &factory->priv->app); | |
261 | factory->priv->app = NULL; | |
262 | } | |
263 | ||
264 | G_OBJECT_CLASS (amtk_factory_parent_class)->dispose (object); | |
265 | } | |
266 | ||
267 | static void | |
268 | amtk_factory_class_init (AmtkFactoryClass *klass) | |
269 | { | |
270 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
271 | ||
272 | object_class->get_property = amtk_factory_get_property; | |
273 | object_class->set_property = amtk_factory_set_property; | |
274 | object_class->dispose = amtk_factory_dispose; | |
275 | ||
276 | /** | |
277 | * AmtkFactory:application: | |
278 | * | |
279 | * The associated #GtkApplication (it is optional, it can be %NULL). | |
280 | * #AmtkFactory has a weak reference to the #GtkApplication. | |
281 | * | |
282 | * Since: 3.0 | |
283 | */ | |
284 | properties[PROP_APPLICATION] = | |
285 | g_param_spec_object ("application", | |
286 | "GtkApplication", | |
287 | "", | |
288 | GTK_TYPE_APPLICATION, | |
289 | G_PARAM_READWRITE | | |
290 | G_PARAM_CONSTRUCT_ONLY | | |
291 | G_PARAM_STATIC_STRINGS); | |
292 | ||
293 | /** | |
294 | * AmtkFactory:default-flags: | |
295 | * | |
296 | * The default #AmtkFactoryFlags. | |
297 | * | |
298 | * Since: 3.0 | |
299 | */ | |
300 | properties[PROP_DEFAULT_FLAGS] = | |
301 | g_param_spec_flags ("default-flags", | |
302 | "Default flags", | |
303 | "", | |
304 | AMTK_TYPE_FACTORY_FLAGS, | |
305 | AMTK_FACTORY_FLAGS_NONE, | |
306 | G_PARAM_READWRITE | | |
307 | G_PARAM_STATIC_STRINGS); | |
308 | ||
309 | g_object_class_install_properties (object_class, N_PROPERTIES, properties); | |
310 | } | |
311 | ||
312 | static void | |
313 | amtk_factory_init (AmtkFactory *factory) | |
314 | { | |
315 | factory->priv = amtk_factory_get_instance_private (factory); | |
316 | } | |
317 | ||
318 | /** | |
319 | * amtk_factory_new: | |
320 | * @application: (nullable): a #GtkApplication, or %NULL. | |
321 | * | |
322 | * Creates a new #AmtkFactory object. Associating a #GtkApplication is optional, | |
323 | * if it is %NULL gtk_application_set_accels_for_action() won't be called. | |
324 | * | |
325 | * Returns: a new #AmtkFactory. | |
326 | * Since: 3.0 | |
327 | */ | |
328 | AmtkFactory * | |
329 | amtk_factory_new (GtkApplication *application) | |
330 | { | |
331 | g_return_val_if_fail (application == NULL || GTK_IS_APPLICATION (application), NULL); | |
332 | ||
333 | return g_object_new (AMTK_TYPE_FACTORY, | |
334 | "application", application, | |
335 | NULL); | |
336 | } | |
337 | ||
338 | /** | |
339 | * amtk_factory_new_with_default_application: | |
340 | * | |
341 | * Calls amtk_factory_new() with g_application_get_default() (it must be a | |
342 | * #GtkApplication). | |
343 | * | |
344 | * Returns: a new #AmtkFactory with the default #GtkApplication. | |
345 | * Since: 3.0 | |
346 | */ | |
347 | AmtkFactory * | |
348 | amtk_factory_new_with_default_application (void) | |
349 | { | |
350 | return amtk_factory_new (GTK_APPLICATION (g_application_get_default ())); | |
351 | } | |
352 | ||
353 | /** | |
354 | * amtk_factory_get_application: | |
355 | * @factory: an #AmtkFactory. | |
356 | * | |
357 | * Returns: (transfer none) (nullable): the #AmtkFactory:application. | |
358 | * Since: 3.0 | |
359 | */ | |
360 | GtkApplication * | |
361 | amtk_factory_get_application (AmtkFactory *factory) | |
362 | { | |
363 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
364 | ||
365 | return factory->priv->app; | |
366 | } | |
367 | ||
368 | /** | |
369 | * amtk_factory_get_default_flags: | |
370 | * @factory: an #AmtkFactory. | |
371 | * | |
372 | * Returns: the #AmtkFactory:default-flags. | |
373 | * Since: 3.0 | |
374 | */ | |
375 | AmtkFactoryFlags | |
376 | amtk_factory_get_default_flags (AmtkFactory *factory) | |
377 | { | |
378 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), AMTK_FACTORY_FLAGS_NONE); | |
379 | ||
380 | return factory->priv->default_flags; | |
381 | } | |
382 | ||
383 | /** | |
384 | * amtk_factory_set_default_flags: | |
385 | * @factory: an #AmtkFactory. | |
386 | * @default_flags: the new value. | |
387 | * | |
388 | * Sets the #AmtkFactory:default-flags property. | |
389 | * | |
390 | * Since: 3.0 | |
391 | */ | |
392 | void | |
393 | amtk_factory_set_default_flags (AmtkFactory *factory, | |
394 | AmtkFactoryFlags default_flags) | |
395 | { | |
396 | g_return_if_fail (AMTK_IS_FACTORY (factory)); | |
397 | ||
398 | if (factory->priv->default_flags != default_flags) | |
399 | { | |
400 | factory->priv->default_flags = default_flags; | |
401 | g_object_notify_by_pspec (G_OBJECT (factory), properties[PROP_DEFAULT_FLAGS]); | |
402 | } | |
403 | } | |
404 | ||
405 | static AmtkActionInfo * | |
406 | common_create (AmtkFactory *factory, | |
407 | const gchar *action_name, | |
408 | AmtkFactoryFlags flags, | |
409 | GtkWidget **widget) | |
410 | { | |
411 | AmtkActionInfoCentralStore *central_store; | |
412 | AmtkActionInfo *action_info; | |
413 | ||
414 | central_store = amtk_action_info_central_store_get_singleton (); | |
415 | action_info = amtk_action_info_central_store_lookup (central_store, action_name); | |
416 | ||
417 | if (action_info == NULL) | |
418 | { | |
419 | g_warning ("AmtkFactory create function: action name '%s' not found.", | |
420 | action_name); | |
421 | ||
422 | g_object_ref_sink (*widget); | |
423 | g_object_unref (*widget); | |
424 | *widget = NULL; | |
425 | return NULL; | |
426 | } | |
427 | ||
428 | if ((flags & AMTK_FACTORY_IGNORE_GACTION) == 0) | |
429 | { | |
430 | gtk_actionable_set_action_name (GTK_ACTIONABLE (*widget), action_name); | |
431 | } | |
432 | ||
433 | if ((flags & AMTK_FACTORY_IGNORE_ACCELS) == 0 && | |
434 | (flags & AMTK_FACTORY_IGNORE_ACCELS_FOR_APP) == 0 && | |
435 | factory->priv->app != NULL) | |
436 | { | |
437 | const gchar * const *accels; | |
438 | ||
439 | accels = amtk_action_info_get_accels (action_info); | |
440 | gtk_application_set_accels_for_action (factory->priv->app, action_name, accels); | |
441 | } | |
442 | ||
443 | amtk_action_info_mark_as_used (action_info); | |
444 | ||
445 | return action_info; | |
446 | } | |
447 | ||
448 | static AmtkActionInfo * | |
449 | common_create_menu_item (AmtkFactory *factory, | |
450 | const gchar *action_name, | |
451 | AmtkFactoryFlags flags, | |
452 | GtkMenuItem **menu_item) | |
453 | { | |
454 | AmtkActionInfo *action_info; | |
455 | const gchar * const *accels; | |
456 | const gchar *tooltip; | |
457 | ||
458 | action_info = common_create (factory, action_name, flags, (GtkWidget **)menu_item); | |
459 | if (action_info == NULL) | |
460 | { | |
461 | return NULL; | |
462 | } | |
463 | ||
464 | if ((flags & AMTK_FACTORY_IGNORE_LABEL) == 0) | |
465 | { | |
466 | gtk_menu_item_set_use_underline (*menu_item, TRUE); | |
467 | gtk_menu_item_set_label (*menu_item, amtk_action_info_get_label (action_info)); | |
468 | } | |
469 | ||
470 | accels = amtk_action_info_get_accels (action_info); | |
471 | if ((flags & AMTK_FACTORY_IGNORE_ACCELS) == 0 && | |
472 | (flags & AMTK_FACTORY_IGNORE_ACCELS_FOR_DOC) == 0 && | |
473 | accels != NULL && accels[0] != NULL) | |
474 | { | |
475 | guint accel_key; | |
476 | GdkModifierType accel_mods; | |
477 | ||
478 | gtk_accelerator_parse (accels[0], &accel_key, &accel_mods); | |
479 | ||
480 | if (accel_key != 0 || accel_mods != 0) | |
481 | { | |
482 | GtkWidget *child; | |
483 | ||
484 | child = gtk_bin_get_child (GTK_BIN (*menu_item)); | |
485 | ||
486 | gtk_accel_label_set_accel (GTK_ACCEL_LABEL (child), | |
487 | accel_key, | |
488 | accel_mods); | |
489 | } | |
490 | } | |
491 | ||
492 | tooltip = amtk_action_info_get_tooltip (action_info); | |
493 | if ((flags & AMTK_FACTORY_IGNORE_TOOLTIP) == 0 && | |
494 | tooltip != NULL) | |
495 | { | |
496 | amtk_menu_item_set_long_description (*menu_item, tooltip); | |
497 | } | |
498 | ||
499 | return action_info; | |
500 | } | |
501 | ||
502 | static AmtkActionInfo * | |
503 | common_create_tool_button (AmtkFactory *factory, | |
504 | const gchar *action_name, | |
505 | AmtkFactoryFlags flags, | |
506 | GtkToolButton **tool_button) | |
507 | { | |
508 | AmtkActionInfo *action_info; | |
509 | const gchar *icon_name; | |
510 | const gchar *tooltip; | |
511 | ||
512 | action_info = common_create (factory, action_name, flags, (GtkWidget **)tool_button); | |
513 | if (action_info == NULL) | |
514 | { | |
515 | return NULL; | |
516 | } | |
517 | ||
518 | if ((flags & AMTK_FACTORY_IGNORE_LABEL) == 0) | |
519 | { | |
520 | gtk_tool_button_set_use_underline (*tool_button, TRUE); | |
521 | gtk_tool_button_set_label (*tool_button, amtk_action_info_get_label (action_info)); | |
522 | } | |
523 | ||
524 | icon_name = amtk_action_info_get_icon_name (action_info); | |
525 | if ((flags & AMTK_FACTORY_IGNORE_ICON) == 0 && | |
526 | icon_name != NULL) | |
527 | { | |
528 | gtk_tool_button_set_icon_name (*tool_button, icon_name); | |
529 | } | |
530 | ||
531 | tooltip = amtk_action_info_get_tooltip (action_info); | |
532 | if ((flags & AMTK_FACTORY_IGNORE_TOOLTIP) == 0 && | |
533 | tooltip != NULL) | |
534 | { | |
535 | gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (*tool_button), tooltip); | |
536 | } | |
537 | ||
538 | return action_info; | |
539 | } | |
540 | ||
541 | /** | |
542 | * amtk_factory_create_menu_item: | |
543 | * @factory: an #AmtkFactory. | |
544 | * @action_name: an action name. | |
545 | * | |
546 | * Creates a new #GtkMenuItem for @action_name with the | |
547 | * #AmtkFactory:default-flags. | |
548 | * | |
549 | * Returns: (transfer floating): a new #GtkMenuItem for @action_name. | |
550 | * Since: 3.0 | |
551 | */ | |
552 | GtkWidget * | |
553 | amtk_factory_create_menu_item (AmtkFactory *factory, | |
554 | const gchar *action_name) | |
555 | { | |
556 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
557 | g_return_val_if_fail (action_name != NULL, NULL); | |
558 | ||
559 | return amtk_factory_create_menu_item_full (factory, | |
560 | action_name, | |
561 | factory->priv->default_flags); | |
562 | } | |
563 | ||
564 | /** | |
565 | * amtk_factory_create_menu_item_full: | |
566 | * @factory: an #AmtkFactory. | |
567 | * @action_name: an action name. | |
568 | * @flags: #AmtkFactoryFlags. | |
569 | * | |
570 | * This function ignores the #AmtkFactory:default-flags property and takes the | |
571 | * @flags argument instead. | |
572 | * | |
573 | * Returns: (transfer floating): a new #GtkMenuItem for @action_name. | |
574 | * Since: 3.0 | |
575 | */ | |
576 | GtkWidget * | |
577 | amtk_factory_create_menu_item_full (AmtkFactory *factory, | |
578 | const gchar *action_name, | |
579 | AmtkFactoryFlags flags) | |
580 | { | |
581 | GtkMenuItem *menu_item; | |
582 | AmtkActionInfo *action_info; | |
583 | const gchar *icon_name; | |
584 | ||
585 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
586 | g_return_val_if_fail (action_name != NULL, NULL); | |
587 | ||
588 | menu_item = GTK_MENU_ITEM (gtk_menu_item_new ()); | |
589 | ||
590 | action_info = common_create_menu_item (factory, action_name, flags, &menu_item); | |
591 | if (action_info == NULL) | |
592 | { | |
593 | return NULL; | |
594 | } | |
595 | ||
596 | icon_name = amtk_action_info_get_icon_name (action_info); | |
597 | if ((flags & AMTK_FACTORY_IGNORE_ICON) == 0 && | |
598 | icon_name != NULL) | |
599 | { | |
600 | amtk_menu_item_set_icon_name (menu_item, icon_name); | |
601 | } | |
602 | ||
603 | return GTK_WIDGET (menu_item); | |
604 | } | |
605 | ||
606 | /** | |
607 | * amtk_factory_create_check_menu_item: | |
608 | * @factory: an #AmtkFactory. | |
609 | * @action_name: an action name. | |
610 | * | |
611 | * Creates a new #GtkCheckMenuItem for @action_name with the | |
612 | * #AmtkFactory:default-flags. | |
613 | * | |
614 | * See the documentation of amtk_factory_create_check_menu_item_full() for more | |
615 | * information. | |
616 | * | |
617 | * Returns: (transfer floating): a new #GtkCheckMenuItem for @action_name. | |
618 | * Since: 3.0 | |
619 | */ | |
620 | GtkWidget * | |
621 | amtk_factory_create_check_menu_item (AmtkFactory *factory, | |
622 | const gchar *action_name) | |
623 | { | |
624 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
625 | g_return_val_if_fail (action_name != NULL, NULL); | |
626 | ||
627 | return amtk_factory_create_check_menu_item_full (factory, | |
628 | action_name, | |
629 | factory->priv->default_flags); | |
630 | } | |
631 | ||
632 | /** | |
633 | * amtk_factory_create_check_menu_item_full: | |
634 | * @factory: an #AmtkFactory. | |
635 | * @action_name: an action name. | |
636 | * @flags: #AmtkFactoryFlags. | |
637 | * | |
638 | * This function ignores the #AmtkFactory:default-flags property and takes the | |
639 | * @flags argument instead. | |
640 | * | |
641 | * Note that since it is a #GtkCheckMenuItem the icon is not set, even if it | |
642 | * would be possible with amtk_menu_item_set_icon_name(). | |
643 | * | |
644 | * If the action controls a boolean property, think about using | |
645 | * #GPropertyAction. | |
646 | * | |
647 | * Returns: (transfer floating): a new #GtkCheckMenuItem for @action_name. | |
648 | * Since: 3.0 | |
649 | */ | |
650 | GtkWidget * | |
651 | amtk_factory_create_check_menu_item_full (AmtkFactory *factory, | |
652 | const gchar *action_name, | |
653 | AmtkFactoryFlags flags) | |
654 | { | |
655 | GtkMenuItem *check_menu_item; | |
656 | AmtkActionInfo *action_info; | |
657 | ||
658 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
659 | g_return_val_if_fail (action_name != NULL, NULL); | |
660 | ||
661 | check_menu_item = GTK_MENU_ITEM (gtk_check_menu_item_new ()); | |
662 | ||
663 | action_info = common_create_menu_item (factory, action_name, flags, &check_menu_item); | |
664 | if (action_info == NULL) | |
665 | { | |
666 | return NULL; | |
667 | } | |
668 | ||
669 | return GTK_WIDGET (check_menu_item); | |
670 | } | |
671 | ||
672 | /** | |
673 | * amtk_factory_create_tool_button: | |
674 | * @factory: an #AmtkFactory. | |
675 | * @action_name: an action name. | |
676 | * | |
677 | * Creates a new #GtkToolButton for @action_name with the | |
678 | * #AmtkFactory:default-flags. | |
679 | * | |
680 | * Returns: (transfer floating): a new #GtkToolButton for @action_name. | |
681 | * Since: 3.0 | |
682 | */ | |
683 | GtkToolItem * | |
684 | amtk_factory_create_tool_button (AmtkFactory *factory, | |
685 | const gchar *action_name) | |
686 | { | |
687 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
688 | g_return_val_if_fail (action_name != NULL, NULL); | |
689 | ||
690 | return amtk_factory_create_tool_button_full (factory, | |
691 | action_name, | |
692 | factory->priv->default_flags); | |
693 | } | |
694 | ||
695 | /** | |
696 | * amtk_factory_create_tool_button_full: | |
697 | * @factory: an #AmtkFactory. | |
698 | * @action_name: an action name. | |
699 | * @flags: #AmtkFactoryFlags. | |
700 | * | |
701 | * This function ignores the #AmtkFactory:default-flags property and takes the | |
702 | * @flags argument instead. | |
703 | * | |
704 | * Returns: (transfer floating): a new #GtkToolButton for @action_name. | |
705 | * Since: 3.0 | |
706 | */ | |
707 | GtkToolItem * | |
708 | amtk_factory_create_tool_button_full (AmtkFactory *factory, | |
709 | const gchar *action_name, | |
710 | AmtkFactoryFlags flags) | |
711 | { | |
712 | GtkToolButton *tool_button; | |
713 | AmtkActionInfo *action_info; | |
714 | ||
715 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
716 | g_return_val_if_fail (action_name != NULL, NULL); | |
717 | ||
718 | tool_button = GTK_TOOL_BUTTON (gtk_tool_button_new (NULL, NULL)); | |
719 | ||
720 | action_info = common_create_tool_button (factory, action_name, flags, &tool_button); | |
721 | if (action_info == NULL) | |
722 | { | |
723 | return NULL; | |
724 | } | |
725 | ||
726 | return GTK_TOOL_ITEM (tool_button); | |
727 | } | |
728 | ||
729 | /** | |
730 | * amtk_factory_create_menu_tool_button: | |
731 | * @factory: an #AmtkFactory. | |
732 | * @action_name: an action name. | |
733 | * | |
734 | * Creates a new #GtkMenuToolButton for @action_name with the | |
735 | * #AmtkFactory:default-flags. | |
736 | * | |
737 | * See the documentation of amtk_factory_create_menu_tool_button_full() for more | |
738 | * information. | |
739 | * | |
740 | * Returns: (transfer floating): a new #GtkMenuToolButton for @action_name. | |
741 | * Since: 3.0 | |
742 | */ | |
743 | GtkMenuToolButton * | |
744 | amtk_factory_create_menu_tool_button (AmtkFactory *factory, | |
745 | const gchar *action_name) | |
746 | { | |
747 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
748 | g_return_val_if_fail (action_name != NULL, NULL); | |
749 | ||
750 | return amtk_factory_create_menu_tool_button_full (factory, | |
751 | action_name, | |
752 | factory->priv->default_flags); | |
753 | } | |
754 | ||
755 | /** | |
756 | * amtk_factory_create_menu_tool_button_full: | |
757 | * @factory: an #AmtkFactory. | |
758 | * @action_name: an action name. | |
759 | * @flags: #AmtkFactoryFlags. | |
760 | * | |
761 | * This function ignores the #AmtkFactory:default-flags property and takes the | |
762 | * @flags argument instead. | |
763 | * | |
764 | * After calling this function, you need to use the #GtkMenuToolButton API to | |
765 | * set the menu and also possibly set a tooltip to the arrow. | |
766 | * | |
767 | * Returns: (transfer floating): a new #GtkMenuToolButton for @action_name. | |
768 | * Since: 3.0 | |
769 | */ | |
770 | GtkMenuToolButton * | |
771 | amtk_factory_create_menu_tool_button_full (AmtkFactory *factory, | |
772 | const gchar *action_name, | |
773 | AmtkFactoryFlags flags) | |
774 | { | |
775 | GtkToolButton *menu_tool_button; | |
776 | AmtkActionInfo *action_info; | |
777 | ||
778 | g_return_val_if_fail (AMTK_IS_FACTORY (factory), NULL); | |
779 | g_return_val_if_fail (action_name != NULL, NULL); | |
780 | ||
781 | menu_tool_button = GTK_TOOL_BUTTON (gtk_menu_tool_button_new (NULL, NULL)); | |
782 | ||
783 | action_info = common_create_tool_button (factory, action_name, flags, &menu_tool_button); | |
784 | if (action_info == NULL) | |
785 | { | |
786 | return NULL; | |
787 | } | |
788 | ||
789 | return GTK_MENU_TOOL_BUTTON (menu_tool_button); | |
790 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_FACTORY_H | |
20 | #define AMTK_FACTORY_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gtk/gtk.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_FACTORY (amtk_factory_get_type ()) | |
32 | #define AMTK_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMTK_TYPE_FACTORY, AmtkFactory)) | |
33 | #define AMTK_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AMTK_TYPE_FACTORY, AmtkFactoryClass)) | |
34 | #define AMTK_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMTK_TYPE_FACTORY)) | |
35 | #define AMTK_IS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMTK_TYPE_FACTORY)) | |
36 | #define AMTK_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AMTK_TYPE_FACTORY, AmtkFactoryClass)) | |
37 | ||
38 | typedef struct _AmtkFactoryClass AmtkFactoryClass; | |
39 | typedef struct _AmtkFactoryPrivate AmtkFactoryPrivate; | |
40 | ||
41 | struct _AmtkFactory | |
42 | { | |
43 | GObject parent; | |
44 | ||
45 | AmtkFactoryPrivate *priv; | |
46 | }; | |
47 | ||
48 | struct _AmtkFactoryClass | |
49 | { | |
50 | GObjectClass parent_class; | |
51 | ||
52 | gpointer padding[12]; | |
53 | }; | |
54 | ||
55 | /** | |
56 | * AmtkFactoryFlags: | |
57 | * @AMTK_FACTORY_FLAGS_NONE: No flags. | |
58 | * @AMTK_FACTORY_IGNORE_GACTION: Do not call gtk_actionable_set_action_name(). | |
59 | * @AMTK_FACTORY_IGNORE_ICON: Do not set an icon. | |
60 | * @AMTK_FACTORY_IGNORE_LABEL: Do not set a label/short description. | |
61 | * @AMTK_FACTORY_IGNORE_TOOLTIP: Do not set a tooltip/long description. | |
62 | * @AMTK_FACTORY_IGNORE_ACCELS: Ignore completely the accelerators. | |
63 | * @AMTK_FACTORY_IGNORE_ACCELS_FOR_DOC: Ignore the accelerators for | |
64 | * documentation purposes only. For example do not add/configure a | |
65 | * #GtkAccelLabel. | |
66 | * @AMTK_FACTORY_IGNORE_ACCELS_FOR_APP: Do not call | |
67 | * gtk_application_set_accels_for_action(). | |
68 | * | |
69 | * #AmtkFactoryFlags permits to control how a factory function creates the | |
70 | * object, to ignore some steps. | |
71 | * | |
72 | * Since: 3.0 | |
73 | */ | |
74 | typedef enum | |
75 | { | |
76 | AMTK_FACTORY_FLAGS_NONE = 0, | |
77 | AMTK_FACTORY_IGNORE_GACTION = 1 << 0, | |
78 | AMTK_FACTORY_IGNORE_ICON = 1 << 1, | |
79 | AMTK_FACTORY_IGNORE_LABEL = 1 << 2, | |
80 | AMTK_FACTORY_IGNORE_TOOLTIP = 1 << 3, | |
81 | AMTK_FACTORY_IGNORE_ACCELS = 1 << 4, | |
82 | AMTK_FACTORY_IGNORE_ACCELS_FOR_DOC = 1 << 5, | |
83 | AMTK_FACTORY_IGNORE_ACCELS_FOR_APP = 1 << 6, | |
84 | } AmtkFactoryFlags; | |
85 | ||
86 | GType amtk_factory_get_type (void); | |
87 | ||
88 | AmtkFactory * amtk_factory_new (GtkApplication *application); | |
89 | ||
90 | AmtkFactory * amtk_factory_new_with_default_application (void); | |
91 | ||
92 | GtkApplication * amtk_factory_get_application (AmtkFactory *factory); | |
93 | ||
94 | AmtkFactoryFlags amtk_factory_get_default_flags (AmtkFactory *factory); | |
95 | ||
96 | void amtk_factory_set_default_flags (AmtkFactory *factory, | |
97 | AmtkFactoryFlags default_flags); | |
98 | ||
99 | GtkWidget * amtk_factory_create_menu_item (AmtkFactory *factory, | |
100 | const gchar *action_name); | |
101 | ||
102 | GtkWidget * amtk_factory_create_menu_item_full (AmtkFactory *factory, | |
103 | const gchar *action_name, | |
104 | AmtkFactoryFlags flags); | |
105 | ||
106 | GtkWidget * amtk_factory_create_check_menu_item (AmtkFactory *factory, | |
107 | const gchar *action_name); | |
108 | ||
109 | GtkWidget * amtk_factory_create_check_menu_item_full (AmtkFactory *factory, | |
110 | const gchar *action_name, | |
111 | AmtkFactoryFlags flags); | |
112 | ||
113 | GtkToolItem * amtk_factory_create_tool_button (AmtkFactory *factory, | |
114 | const gchar *action_name); | |
115 | ||
116 | GtkToolItem * amtk_factory_create_tool_button_full (AmtkFactory *factory, | |
117 | const gchar *action_name, | |
118 | AmtkFactoryFlags flags); | |
119 | ||
120 | GtkMenuToolButton * amtk_factory_create_menu_tool_button (AmtkFactory *factory, | |
121 | const gchar *action_name); | |
122 | ||
123 | GtkMenuToolButton * amtk_factory_create_menu_tool_button_full (AmtkFactory *factory, | |
124 | const gchar *action_name, | |
125 | AmtkFactoryFlags flags); | |
126 | ||
127 | G_END_DECLS | |
128 | ||
129 | #endif /* AMTK_FACTORY_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "config.h" | |
20 | #include "amtk-init.h" | |
21 | #include <glib/gi18n-lib.h> | |
22 | #include "amtk-action-info-central-store.h" | |
23 | ||
24 | /** | |
25 | * amtk_init: | |
26 | * | |
27 | * Initializes the Amtk library (e.g. for the internationalization). | |
28 | * | |
29 | * This function can be called several times, but is meant to be called at the | |
30 | * beginning of main(), before any other Amtk function call. | |
31 | * | |
32 | * Since: 3.0 | |
33 | */ | |
34 | void | |
35 | amtk_init (void) | |
36 | { | |
37 | static gboolean done = FALSE; | |
38 | ||
39 | if (!done) | |
40 | { | |
41 | gchar *locale_dir; | |
42 | ||
43 | locale_dir = g_build_filename (DATADIR, "locale", NULL); | |
44 | bindtextdomain (GETTEXT_PACKAGE, locale_dir); | |
45 | g_free (locale_dir); | |
46 | ||
47 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); | |
48 | ||
49 | done = TRUE; | |
50 | } | |
51 | } | |
52 | ||
53 | /** | |
54 | * amtk_finalize: | |
55 | * | |
56 | * Free the resources allocated by Amtk. For example it unrefs the singleton | |
57 | * objects. | |
58 | * | |
59 | * It is not mandatory to call this function, it's just to be friendlier to | |
60 | * memory debugging tools. This function is meant to be called at the end of | |
61 | * main(). It can be called several times. | |
62 | * | |
63 | * Since: 3.0 | |
64 | */ | |
65 | ||
66 | /* Another way is to use a DSO destructor, see gconstructor.h in GLib. | |
67 | * | |
68 | * The advantage of calling amtk_finalize() at the end of main() is that | |
69 | * gobject-list [1] correctly reports that all Amtk* objects have been finalized | |
70 | * when quitting the application. On the other hand a DSO destructor runs after | |
71 | * the gobject-list's last output, so it's much less convenient, see: | |
72 | * https://git.gnome.org/browse/gtksourceview/commit/?id=e761de9c2bee90c232875bbc41e6e73e1f63e145 | |
73 | * | |
74 | * [1] A tool for debugging the lifetime of GObjects: | |
75 | * https://github.com/danni/gobject-list | |
76 | */ | |
77 | void | |
78 | amtk_finalize (void) | |
79 | { | |
80 | static gboolean done = FALSE; | |
81 | ||
82 | /* Unref the singleton only once, even if this function is called | |
83 | * multiple times, to see if a reference is not released correctly. | |
84 | * Normally the singleton have a ref count of 1. If for some reason the | |
85 | * ref count is increased somewhere, it needs to be decreased | |
86 | * accordingly, at the right place. | |
87 | */ | |
88 | if (!done) | |
89 | { | |
90 | _amtk_action_info_central_store_unref_singleton (); | |
91 | done = TRUE; | |
92 | } | |
93 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_INIT_H | |
20 | #define AMTK_INIT_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <glib.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | void amtk_init (void); | |
31 | void amtk_finalize (void); | |
32 | ||
33 | G_END_DECLS | |
34 | ||
35 | #endif /* AMTK_INIT_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-menu-item.h" | |
20 | ||
21 | /** | |
22 | * SECTION:amtk-menu-item | |
23 | * @Short_description: #GtkMenuItem functions | |
24 | * @Title: AmtkMenuItem | |
25 | * | |
26 | * #GtkMenuItem functions. | |
27 | */ | |
28 | ||
29 | #define LONG_DESCRIPTION_KEY "amtk-menu-item-long-description-key" | |
30 | ||
31 | /** | |
32 | * amtk_menu_item_get_long_description: | |
33 | * @menu_item: a #GtkMenuItem. | |
34 | * | |
35 | * Returns: (nullable): the long description of @menu_item, previously set with | |
36 | * amtk_menu_item_set_long_description(). | |
37 | * Since: 2.0 | |
38 | */ | |
39 | const gchar * | |
40 | amtk_menu_item_get_long_description (GtkMenuItem *menu_item) | |
41 | { | |
42 | g_return_val_if_fail (GTK_IS_MENU_ITEM (menu_item), NULL); | |
43 | ||
44 | return g_object_get_data (G_OBJECT (menu_item), LONG_DESCRIPTION_KEY); | |
45 | } | |
46 | ||
47 | /** | |
48 | * amtk_menu_item_set_long_description: | |
49 | * @menu_item: a #GtkMenuItem. | |
50 | * @long_description: (nullable): the long description, or %NULL to unset it. | |
51 | * | |
52 | * Sets the long description of @menu_item. A possible use-case is to display it | |
53 | * in a #GtkStatusbar, or as a tooltip. | |
54 | * | |
55 | * Since: 2.0 | |
56 | */ | |
57 | void | |
58 | amtk_menu_item_set_long_description (GtkMenuItem *menu_item, | |
59 | const gchar *long_description) | |
60 | { | |
61 | g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); | |
62 | ||
63 | g_object_set_data_full (G_OBJECT (menu_item), | |
64 | LONG_DESCRIPTION_KEY, | |
65 | g_strdup (long_description), | |
66 | g_free); | |
67 | } | |
68 | ||
69 | /** | |
70 | * amtk_menu_item_set_icon_name: | |
71 | * @item: a #GtkMenuItem. | |
72 | * @icon_name: an icon name. | |
73 | * | |
74 | * Sets an icon to a #GtkMenuItem. | |
75 | * | |
76 | * If the child widget of @item is already a #GtkBox, all #GtkImage widgets | |
77 | * inside that box are first destroyed. A #GtkImage for @icon_name is then | |
78 | * inserted to the box. | |
79 | * | |
80 | * If the child widget of @item is not a #GtkBox (it's usually the | |
81 | * #GtkAccelLabel), it is replaced by a new #GtkBox and the initial child widget | |
82 | * is inserted to the #GtkBox, alongside the icon. | |
83 | * | |
84 | * As a consequence, if you want to call functions on the #GtkAccelLabel, it's | |
85 | * easier to do it before calling this function. | |
86 | * | |
87 | * Since: 2.0 | |
88 | */ | |
89 | /* Based on gtk_model_menu_item_set_icon() from gtkmodelmenuitem.c (private | |
90 | * GTK+ class). | |
91 | * Copyright 2011, 2013 Canonical Limited | |
92 | */ | |
93 | void | |
94 | amtk_menu_item_set_icon_name (GtkMenuItem *item, | |
95 | const gchar *icon_name) | |
96 | { | |
97 | GtkWidget *child; | |
98 | ||
99 | g_return_if_fail (GTK_IS_MENU_ITEM (item)); | |
100 | ||
101 | child = gtk_bin_get_child (GTK_BIN (item)); | |
102 | ||
103 | /* There are only three possibilities here: | |
104 | * | |
105 | * - no child | |
106 | * - accel label child | |
107 | * - already a box | |
108 | * | |
109 | * Handle the no-child case by having GtkMenuItem create the accel | |
110 | * label, then we will only have two possible cases. | |
111 | */ | |
112 | if (child == NULL) | |
113 | { | |
114 | gtk_menu_item_get_label (item); | |
115 | child = gtk_bin_get_child (GTK_BIN (item)); | |
116 | g_return_if_fail (GTK_IS_LABEL (child)); | |
117 | } | |
118 | ||
119 | /* If it is a box, make sure there are no images inside of it already. */ | |
120 | if (GTK_IS_BOX (child)) | |
121 | { | |
122 | GList *children; | |
123 | ||
124 | children = gtk_container_get_children (GTK_CONTAINER (child)); | |
125 | while (children != NULL) | |
126 | { | |
127 | if (GTK_IS_IMAGE (children->data)) | |
128 | { | |
129 | gtk_widget_destroy (children->data); | |
130 | } | |
131 | ||
132 | children = g_list_delete_link (children, children); | |
133 | } | |
134 | } | |
135 | else | |
136 | { | |
137 | GtkWidget *box; | |
138 | ||
139 | if (icon_name == NULL) | |
140 | { | |
141 | return; | |
142 | } | |
143 | ||
144 | box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); | |
145 | ||
146 | /* Reparent the child without destroying it */ | |
147 | g_object_ref (child); | |
148 | gtk_container_remove (GTK_CONTAINER (item), child); | |
149 | gtk_box_pack_end (GTK_BOX (box), child, TRUE, TRUE, 0); | |
150 | g_object_unref (child); | |
151 | ||
152 | gtk_container_add (GTK_CONTAINER (item), box); | |
153 | gtk_widget_show (box); | |
154 | ||
155 | /* Now we have a box */ | |
156 | child = box; | |
157 | } | |
158 | ||
159 | g_assert (GTK_IS_BOX (child)); | |
160 | ||
161 | /* child is now a box containing a label and no image. Add the icon, | |
162 | * if appropriate. | |
163 | */ | |
164 | if (icon_name != NULL) | |
165 | { | |
166 | GtkWidget *image; | |
167 | ||
168 | image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); | |
169 | gtk_image_set_pixel_size (GTK_IMAGE (image), 16); | |
170 | gtk_box_pack_start (GTK_BOX (child), image, FALSE, FALSE, 0); | |
171 | gtk_widget_show (image); | |
172 | } | |
173 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_MENU_ITEM_H | |
20 | #define AMTK_MENU_ITEM_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gtk/gtk.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | const gchar * amtk_menu_item_get_long_description (GtkMenuItem *menu_item); | |
31 | ||
32 | void amtk_menu_item_set_long_description (GtkMenuItem *menu_item, | |
33 | const gchar *long_description); | |
34 | ||
35 | void amtk_menu_item_set_icon_name (GtkMenuItem *item, | |
36 | const gchar *icon_name); | |
37 | ||
38 | G_END_DECLS | |
39 | ||
40 | #endif /* AMTK_MENU_ITEM_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2016, 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-menu-shell.h" | |
20 | ||
21 | /** | |
22 | * SECTION:amtk-menu-shell | |
23 | * @Short_description: An extension of #GtkMenuShell | |
24 | * @Title: AmtkMenuShell | |
25 | * | |
26 | * #AmtkMenuShell extends the #GtkMenuShell abstract class with the | |
27 | * #AmtkMenuShell::menu-item-selected and #AmtkMenuShell::menu-item-deselected | |
28 | * convenience signals. | |
29 | * | |
30 | * One possible use-case is to push/pop longer descriptions of menu items to a | |
31 | * #GtkStatusbar, exactly like | |
32 | * amtk_application_window_connect_menu_to_statusbar() does. | |
33 | */ | |
34 | ||
35 | struct _AmtkMenuShellPrivate | |
36 | { | |
37 | GtkMenuShell *gtk_menu_shell; | |
38 | }; | |
39 | ||
40 | enum | |
41 | { | |
42 | PROP_0, | |
43 | PROP_MENU_SHELL, | |
44 | N_PROPERTIES | |
45 | }; | |
46 | ||
47 | enum | |
48 | { | |
49 | SIGNAL_MENU_ITEM_SELECTED, | |
50 | SIGNAL_MENU_ITEM_DESELECTED, | |
51 | N_SIGNALS | |
52 | }; | |
53 | ||
54 | #define AMTK_MENU_SHELL_KEY "amtk-menu-shell-key" | |
55 | ||
56 | static GParamSpec *properties[N_PROPERTIES]; | |
57 | static guint signals[N_SIGNALS]; | |
58 | ||
59 | G_DEFINE_TYPE_WITH_PRIVATE (AmtkMenuShell, amtk_menu_shell, G_TYPE_OBJECT) | |
60 | ||
61 | /* Prototypes */ | |
62 | static void connect_menu_shell (AmtkMenuShell *amtk_menu_shell, | |
63 | GtkMenuShell *gtk_menu_shell); | |
64 | ||
65 | static void disconnect_menu_shell (AmtkMenuShell *amtk_menu_shell, | |
66 | GtkMenuShell *gtk_menu_shell); | |
67 | ||
68 | static void | |
69 | menu_item_select_cb (GtkMenuItem *menu_item, | |
70 | gpointer user_data) | |
71 | { | |
72 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (user_data); | |
73 | GtkWidget *submenu; | |
74 | ||
75 | submenu = gtk_menu_item_get_submenu (menu_item); | |
76 | ||
77 | if (GTK_IS_MENU_SHELL (submenu)) | |
78 | { | |
79 | connect_menu_shell (amtk_menu_shell, GTK_MENU_SHELL (submenu)); | |
80 | } | |
81 | ||
82 | g_signal_emit (amtk_menu_shell, | |
83 | signals[SIGNAL_MENU_ITEM_SELECTED], 0, | |
84 | menu_item); | |
85 | } | |
86 | ||
87 | static void | |
88 | menu_item_deselect_cb (GtkMenuItem *menu_item, | |
89 | gpointer user_data) | |
90 | { | |
91 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (user_data); | |
92 | GtkWidget *submenu; | |
93 | ||
94 | submenu = gtk_menu_item_get_submenu (menu_item); | |
95 | ||
96 | if (GTK_IS_MENU_SHELL (submenu)) | |
97 | { | |
98 | disconnect_menu_shell (amtk_menu_shell, GTK_MENU_SHELL (submenu)); | |
99 | } | |
100 | ||
101 | g_signal_emit (amtk_menu_shell, | |
102 | signals[SIGNAL_MENU_ITEM_DESELECTED], 0, | |
103 | menu_item); | |
104 | } | |
105 | ||
106 | static void | |
107 | connect_menu_item (AmtkMenuShell *amtk_menu_shell, | |
108 | GtkMenuItem *menu_item) | |
109 | { | |
110 | g_signal_connect_object (menu_item, | |
111 | "select", | |
112 | G_CALLBACK (menu_item_select_cb), | |
113 | amtk_menu_shell, | |
114 | 0); | |
115 | ||
116 | g_signal_connect_object (menu_item, | |
117 | "deselect", | |
118 | G_CALLBACK (menu_item_deselect_cb), | |
119 | amtk_menu_shell, | |
120 | 0); | |
121 | } | |
122 | ||
123 | static void | |
124 | disconnect_menu_item (AmtkMenuShell *amtk_menu_shell, | |
125 | GtkMenuItem *menu_item) | |
126 | { | |
127 | g_signal_handlers_disconnect_by_func (menu_item, | |
128 | menu_item_select_cb, | |
129 | amtk_menu_shell); | |
130 | ||
131 | g_signal_handlers_disconnect_by_func (menu_item, | |
132 | menu_item_deselect_cb, | |
133 | amtk_menu_shell); | |
134 | } | |
135 | ||
136 | static void | |
137 | insert_cb (GtkMenuShell *gtk_menu_shell, | |
138 | GtkWidget *child, | |
139 | gint position, | |
140 | gpointer user_data) | |
141 | { | |
142 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (user_data); | |
143 | ||
144 | if (GTK_IS_MENU_ITEM (child)) | |
145 | { | |
146 | connect_menu_item (amtk_menu_shell, GTK_MENU_ITEM (child)); | |
147 | } | |
148 | } | |
149 | ||
150 | static void | |
151 | remove_cb (GtkContainer *container, | |
152 | GtkWidget *child, | |
153 | gpointer user_data) | |
154 | { | |
155 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (user_data); | |
156 | ||
157 | if (GTK_IS_MENU_ITEM (child)) | |
158 | { | |
159 | disconnect_menu_item (amtk_menu_shell, GTK_MENU_ITEM (child)); | |
160 | } | |
161 | } | |
162 | ||
163 | static void | |
164 | connect_menu_shell (AmtkMenuShell *amtk_menu_shell, | |
165 | GtkMenuShell *gtk_menu_shell) | |
166 | { | |
167 | GList *children; | |
168 | GList *l; | |
169 | ||
170 | children = gtk_container_get_children (GTK_CONTAINER (gtk_menu_shell)); | |
171 | ||
172 | for (l = children; l != NULL; l = l->next) | |
173 | { | |
174 | GtkMenuItem *menu_item = l->data; | |
175 | ||
176 | if (GTK_IS_MENU_ITEM (menu_item)) | |
177 | { | |
178 | connect_menu_item (amtk_menu_shell, menu_item); | |
179 | } | |
180 | } | |
181 | ||
182 | g_list_free (children); | |
183 | ||
184 | g_signal_connect_object (gtk_menu_shell, | |
185 | "insert", | |
186 | G_CALLBACK (insert_cb), | |
187 | amtk_menu_shell, | |
188 | 0); | |
189 | ||
190 | g_signal_connect_object (gtk_menu_shell, | |
191 | "remove", | |
192 | G_CALLBACK (remove_cb), | |
193 | amtk_menu_shell, | |
194 | 0); | |
195 | } | |
196 | ||
197 | static void | |
198 | disconnect_menu_shell (AmtkMenuShell *amtk_menu_shell, | |
199 | GtkMenuShell *gtk_menu_shell) | |
200 | { | |
201 | GList *children; | |
202 | GList *l; | |
203 | ||
204 | children = gtk_container_get_children (GTK_CONTAINER (gtk_menu_shell)); | |
205 | ||
206 | for (l = children; l != NULL; l = l->next) | |
207 | { | |
208 | GtkMenuItem *menu_item = l->data; | |
209 | ||
210 | if (GTK_IS_MENU_ITEM (menu_item)) | |
211 | { | |
212 | disconnect_menu_item (amtk_menu_shell, menu_item); | |
213 | } | |
214 | } | |
215 | ||
216 | g_list_free (children); | |
217 | ||
218 | g_signal_handlers_disconnect_by_func (gtk_menu_shell, | |
219 | insert_cb, | |
220 | amtk_menu_shell); | |
221 | ||
222 | g_signal_handlers_disconnect_by_func (gtk_menu_shell, | |
223 | remove_cb, | |
224 | amtk_menu_shell); | |
225 | } | |
226 | ||
227 | static void | |
228 | set_menu_shell (AmtkMenuShell *amtk_menu_shell, | |
229 | GtkMenuShell *gtk_menu_shell) | |
230 | { | |
231 | g_assert (amtk_menu_shell->priv->gtk_menu_shell == NULL); | |
232 | g_return_if_fail (GTK_IS_MENU_SHELL (gtk_menu_shell)); | |
233 | ||
234 | amtk_menu_shell->priv->gtk_menu_shell = gtk_menu_shell; | |
235 | connect_menu_shell (amtk_menu_shell, gtk_menu_shell); | |
236 | } | |
237 | ||
238 | static void | |
239 | amtk_menu_shell_get_property (GObject *object, | |
240 | guint prop_id, | |
241 | GValue *value, | |
242 | GParamSpec *pspec) | |
243 | { | |
244 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (object); | |
245 | ||
246 | switch (prop_id) | |
247 | { | |
248 | case PROP_MENU_SHELL: | |
249 | g_value_set_object (value, amtk_menu_shell_get_menu_shell (amtk_menu_shell)); | |
250 | break; | |
251 | ||
252 | default: | |
253 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
254 | break; | |
255 | } | |
256 | } | |
257 | ||
258 | static void | |
259 | amtk_menu_shell_set_property (GObject *object, | |
260 | guint prop_id, | |
261 | const GValue *value, | |
262 | GParamSpec *pspec) | |
263 | { | |
264 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (object); | |
265 | ||
266 | switch (prop_id) | |
267 | { | |
268 | case PROP_MENU_SHELL: | |
269 | set_menu_shell (amtk_menu_shell, g_value_get_object (value)); | |
270 | break; | |
271 | ||
272 | default: | |
273 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
274 | break; | |
275 | } | |
276 | } | |
277 | ||
278 | static void | |
279 | amtk_menu_shell_dispose (GObject *object) | |
280 | { | |
281 | AmtkMenuShell *amtk_menu_shell = AMTK_MENU_SHELL (object); | |
282 | ||
283 | amtk_menu_shell->priv->gtk_menu_shell = NULL; | |
284 | ||
285 | G_OBJECT_CLASS (amtk_menu_shell_parent_class)->dispose (object); | |
286 | } | |
287 | ||
288 | static void | |
289 | amtk_menu_shell_class_init (AmtkMenuShellClass *klass) | |
290 | { | |
291 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | |
292 | ||
293 | object_class->get_property = amtk_menu_shell_get_property; | |
294 | object_class->set_property = amtk_menu_shell_set_property; | |
295 | object_class->dispose = amtk_menu_shell_dispose; | |
296 | ||
297 | /** | |
298 | * AmtkMenuShell:menu-shell: | |
299 | * | |
300 | * The #GtkMenuShell. | |
301 | * | |
302 | * Since: 2.0 | |
303 | */ | |
304 | properties[PROP_MENU_SHELL] = | |
305 | g_param_spec_object ("menu-shell", | |
306 | "GtkMenuShell", | |
307 | "", | |
308 | GTK_TYPE_MENU_SHELL, | |
309 | G_PARAM_READWRITE | | |
310 | G_PARAM_CONSTRUCT_ONLY | | |
311 | G_PARAM_STATIC_STRINGS); | |
312 | ||
313 | g_object_class_install_properties (object_class, N_PROPERTIES, properties); | |
314 | ||
315 | /** | |
316 | * AmtkMenuShell::menu-item-selected: | |
317 | * @amtk_menu_shell: the #AmtkMenuShell emitting the signal. | |
318 | * @menu_item: the #GtkMenuItem that has been selected. | |
319 | * | |
320 | * The ::menu-item-selected signal is emitted when the | |
321 | * #GtkMenuItem::select signal is emitted on a #GtkMenuItem belonging | |
322 | * (directly or indirectly through submenus) to @amtk_menu_shell. | |
323 | * | |
324 | * Since: 2.0 | |
325 | */ | |
326 | signals[SIGNAL_MENU_ITEM_SELECTED] = | |
327 | g_signal_new ("menu-item-selected", | |
328 | G_TYPE_FROM_CLASS (klass), | |
329 | G_SIGNAL_RUN_FIRST, | |
330 | G_STRUCT_OFFSET (AmtkMenuShellClass, menu_item_selected), | |
331 | NULL, NULL, NULL, | |
332 | G_TYPE_NONE, | |
333 | 1, GTK_TYPE_MENU_ITEM); | |
334 | ||
335 | /** | |
336 | * AmtkMenuShell::menu-item-deselected: | |
337 | * @amtk_menu_shell: the #AmtkMenuShell emitting the signal. | |
338 | * @menu_item: the #GtkMenuItem that has been deselected. | |
339 | * | |
340 | * The ::menu-item-deselected signal is emitted when the | |
341 | * #GtkMenuItem::deselect signal is emitted on a #GtkMenuItem belonging | |
342 | * (directly or indirectly through submenus) to @amtk_menu_shell. | |
343 | * | |
344 | * Since: 2.0 | |
345 | */ | |
346 | signals[SIGNAL_MENU_ITEM_DESELECTED] = | |
347 | g_signal_new ("menu-item-deselected", | |
348 | G_TYPE_FROM_CLASS (klass), | |
349 | G_SIGNAL_RUN_FIRST, | |
350 | G_STRUCT_OFFSET (AmtkMenuShellClass, menu_item_deselected), | |
351 | NULL, NULL, NULL, | |
352 | G_TYPE_NONE, | |
353 | 1, GTK_TYPE_MENU_ITEM); | |
354 | } | |
355 | ||
356 | static void | |
357 | amtk_menu_shell_init (AmtkMenuShell *amtk_menu_shell) | |
358 | { | |
359 | amtk_menu_shell->priv = amtk_menu_shell_get_instance_private (amtk_menu_shell); | |
360 | } | |
361 | ||
362 | /** | |
363 | * amtk_menu_shell_get_from_gtk_menu_shell: | |
364 | * @gtk_menu_shell: a #GtkMenuShell. | |
365 | * | |
366 | * Returns the #AmtkMenuShell of @gtk_menu_shell. The returned object is | |
367 | * guaranteed to be the same for the lifetime of @gtk_menu_shell. | |
368 | * | |
369 | * Returns: (transfer none): the #AmtkMenuShell of @gtk_menu_shell. | |
370 | * Since: 2.0 | |
371 | */ | |
372 | AmtkMenuShell * | |
373 | amtk_menu_shell_get_from_gtk_menu_shell (GtkMenuShell *gtk_menu_shell) | |
374 | { | |
375 | AmtkMenuShell *amtk_menu_shell; | |
376 | ||
377 | g_return_val_if_fail (GTK_IS_MENU_SHELL (gtk_menu_shell), NULL); | |
378 | ||
379 | amtk_menu_shell = g_object_get_data (G_OBJECT (gtk_menu_shell), AMTK_MENU_SHELL_KEY); | |
380 | ||
381 | if (amtk_menu_shell == NULL) | |
382 | { | |
383 | amtk_menu_shell = g_object_new (AMTK_TYPE_MENU_SHELL, | |
384 | "menu-shell", gtk_menu_shell, | |
385 | NULL); | |
386 | ||
387 | g_object_set_data_full (G_OBJECT (gtk_menu_shell), | |
388 | AMTK_MENU_SHELL_KEY, | |
389 | amtk_menu_shell, | |
390 | g_object_unref); | |
391 | } | |
392 | ||
393 | g_return_val_if_fail (AMTK_IS_MENU_SHELL (amtk_menu_shell), NULL); | |
394 | return amtk_menu_shell; | |
395 | } | |
396 | ||
397 | /** | |
398 | * amtk_menu_shell_get_menu_shell: | |
399 | * @amtk_menu_shell: an #AmtkMenuShell. | |
400 | * | |
401 | * Returns: (transfer none): the #GtkMenuShell of @amtk_menu_shell. | |
402 | * Since: 2.0 | |
403 | */ | |
404 | GtkMenuShell * | |
405 | amtk_menu_shell_get_menu_shell (AmtkMenuShell *amtk_menu_shell) | |
406 | { | |
407 | g_return_val_if_fail (AMTK_IS_MENU_SHELL (amtk_menu_shell), NULL); | |
408 | ||
409 | return amtk_menu_shell->priv->gtk_menu_shell; | |
410 | } | |
411 | ||
412 | /* ex:set ts=8 noet: */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_MENU_SHELL_H | |
20 | #define AMTK_MENU_SHELL_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gtk/gtk.h> | |
27 | #include <amtk/amtk-types.h> | |
28 | ||
29 | G_BEGIN_DECLS | |
30 | ||
31 | #define AMTK_TYPE_MENU_SHELL (amtk_menu_shell_get_type ()) | |
32 | #define AMTK_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AMTK_TYPE_MENU_SHELL, AmtkMenuShell)) | |
33 | #define AMTK_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AMTK_TYPE_MENU_SHELL, AmtkMenuShellClass)) | |
34 | #define AMTK_IS_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AMTK_TYPE_MENU_SHELL)) | |
35 | #define AMTK_IS_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AMTK_TYPE_MENU_SHELL)) | |
36 | #define AMTK_MENU_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AMTK_TYPE_MENU_SHELL, AmtkMenuShellClass)) | |
37 | ||
38 | typedef struct _AmtkMenuShellClass AmtkMenuShellClass; | |
39 | typedef struct _AmtkMenuShellPrivate AmtkMenuShellPrivate; | |
40 | ||
41 | struct _AmtkMenuShell | |
42 | { | |
43 | GObject parent; | |
44 | ||
45 | AmtkMenuShellPrivate *priv; | |
46 | }; | |
47 | ||
48 | struct _AmtkMenuShellClass | |
49 | { | |
50 | GObjectClass parent_class; | |
51 | ||
52 | /* Signals */ | |
53 | ||
54 | void (* menu_item_selected) (AmtkMenuShell *amtk_menu_shell, | |
55 | GtkMenuItem *menu_item); | |
56 | ||
57 | void (* menu_item_deselected) (AmtkMenuShell *amtk_menu_shell, | |
58 | GtkMenuItem *menu_item); | |
59 | ||
60 | gpointer padding[12]; | |
61 | }; | |
62 | ||
63 | GType amtk_menu_shell_get_type (void) G_GNUC_CONST; | |
64 | ||
65 | AmtkMenuShell * amtk_menu_shell_get_from_gtk_menu_shell (GtkMenuShell *gtk_menu_shell); | |
66 | ||
67 | GtkMenuShell * amtk_menu_shell_get_menu_shell (AmtkMenuShell *amtk_menu_shell); | |
68 | ||
69 | G_END_DECLS | |
70 | ||
71 | #endif /* AMTK_MENU_SHELL_H */ | |
72 | ||
73 | /* ex:set ts=8 noet: */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_TYPES_H | |
20 | #define AMTK_TYPES_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <glib.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | typedef struct _AmtkActionInfo AmtkActionInfo; | |
31 | typedef struct _AmtkActionInfoEntry AmtkActionInfoEntry; | |
32 | typedef struct _AmtkActionInfoStore AmtkActionInfoStore; | |
33 | typedef struct _AmtkActionInfoCentralStore AmtkActionInfoCentralStore; | |
34 | typedef struct _AmtkApplicationWindow AmtkApplicationWindow; | |
35 | typedef struct _AmtkFactory AmtkFactory; | |
36 | typedef struct _AmtkMenuShell AmtkMenuShell; | |
37 | ||
38 | G_END_DECLS | |
39 | ||
40 | #endif /* AMTK_TYPES_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include "amtk-utils.h" | |
20 | #include <string.h> | |
21 | #include "amtk-action-info.h" | |
22 | #include "amtk-action-info-central-store.h" | |
23 | ||
24 | /** | |
25 | * SECTION:amtk-utils | |
26 | * @title: AmtkUtils | |
27 | * @short_description: Utility functions | |
28 | * | |
29 | * Utility functions. | |
30 | */ | |
31 | ||
32 | /* | |
33 | * _amtk_utils_replace_home_dir_with_tilde: | |
34 | * @filename: the filename. | |
35 | * | |
36 | * Replaces the home directory with a tilde, if the home directory is present in | |
37 | * the @filename. | |
38 | * | |
39 | * Returns: the new filename. Free with g_free(). | |
40 | */ | |
41 | /* This function is a copy from tepl-utils, which originally comes from gedit. */ | |
42 | gchar * | |
43 | _amtk_utils_replace_home_dir_with_tilde (const gchar *filename) | |
44 | { | |
45 | gchar *tmp; | |
46 | gchar *home; | |
47 | ||
48 | g_return_val_if_fail (filename != NULL, NULL); | |
49 | ||
50 | /* Note that g_get_home_dir returns a const string */ | |
51 | tmp = (gchar *) g_get_home_dir (); | |
52 | ||
53 | if (tmp == NULL) | |
54 | { | |
55 | return g_strdup (filename); | |
56 | } | |
57 | ||
58 | home = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL); | |
59 | if (home == NULL) | |
60 | { | |
61 | return g_strdup (filename); | |
62 | } | |
63 | ||
64 | if (g_str_equal (filename, home)) | |
65 | { | |
66 | g_free (home); | |
67 | return g_strdup ("~"); | |
68 | } | |
69 | ||
70 | tmp = home; | |
71 | home = g_strdup_printf ("%s/", tmp); | |
72 | g_free (tmp); | |
73 | ||
74 | if (g_str_has_prefix (filename, home)) | |
75 | { | |
76 | gchar *res = g_strdup_printf ("~/%s", filename + strlen (home)); | |
77 | g_free (home); | |
78 | return res; | |
79 | } | |
80 | ||
81 | g_free (home); | |
82 | return g_strdup (filename); | |
83 | } | |
84 | ||
85 | /* Deep copy of @strv. */ | |
86 | gchar ** | |
87 | _amtk_utils_strv_copy (const gchar * const *strv) | |
88 | { | |
89 | guint length; | |
90 | gchar **new_strv; | |
91 | guint i; | |
92 | ||
93 | if (strv == NULL) | |
94 | { | |
95 | return NULL; | |
96 | } | |
97 | ||
98 | length = g_strv_length ((gchar **)strv); | |
99 | ||
100 | new_strv = g_malloc ((length + 1) * sizeof (gchar *)); | |
101 | ||
102 | for (i = 0; i < length; i++) | |
103 | { | |
104 | new_strv[i] = g_strdup (strv[i]); | |
105 | } | |
106 | ||
107 | new_strv[length] = NULL; | |
108 | ||
109 | return new_strv; | |
110 | } | |
111 | ||
112 | static gint | |
113 | get_menu_item_position (GtkMenuShell *menu_shell, | |
114 | GtkMenuItem *item) | |
115 | { | |
116 | GList *children; | |
117 | GList *l; | |
118 | gint pos; | |
119 | gboolean found = FALSE; | |
120 | ||
121 | children = gtk_container_get_children (GTK_CONTAINER (menu_shell)); | |
122 | ||
123 | for (l = children, pos = 0; l != NULL; l = l->next, pos++) | |
124 | { | |
125 | GtkMenuItem *cur_item = l->data; | |
126 | ||
127 | if (cur_item == item) | |
128 | { | |
129 | found = TRUE; | |
130 | break; | |
131 | } | |
132 | } | |
133 | ||
134 | g_list_free (children); | |
135 | ||
136 | return found ? pos : -1; | |
137 | } | |
138 | ||
139 | /** | |
140 | * amtk_utils_recent_chooser_menu_get_item_uri: | |
141 | * @menu: a #GtkRecentChooserMenu. | |
142 | * @item: a #GtkMenuItem. | |
143 | * | |
144 | * Gets the URI of @item. @item must be a child of @menu. @menu must be a | |
145 | * #GtkRecentChooserMenu. | |
146 | * | |
147 | * This function has been written because the value returned by | |
148 | * gtk_recent_chooser_get_current_uri() is not updated when #GtkMenuItem's of a | |
149 | * #GtkRecentChooserMenu are selected/deselected. | |
150 | * | |
151 | * Returns: the URI of @item. Free with g_free() when no longer needed. | |
152 | * Since: 2.0 | |
153 | */ | |
154 | gchar * | |
155 | amtk_utils_recent_chooser_menu_get_item_uri (GtkRecentChooserMenu *menu, | |
156 | GtkMenuItem *item) | |
157 | { | |
158 | gint pos; | |
159 | gchar **all_uris; | |
160 | gsize length; | |
161 | gchar *item_uri = NULL; | |
162 | ||
163 | g_return_val_if_fail (GTK_IS_RECENT_CHOOSER_MENU (menu), NULL); | |
164 | g_return_val_if_fail (GTK_IS_MENU_ITEM (item), NULL); | |
165 | ||
166 | { | |
167 | GtkWidget *item_parent; | |
168 | ||
169 | item_parent = gtk_widget_get_parent (GTK_WIDGET (item)); | |
170 | g_return_val_if_fail (item_parent == GTK_WIDGET (menu), NULL); | |
171 | } | |
172 | ||
173 | pos = get_menu_item_position (GTK_MENU_SHELL (menu), item); | |
174 | g_return_val_if_fail (pos >= 0, NULL); | |
175 | ||
176 | all_uris = gtk_recent_chooser_get_uris (GTK_RECENT_CHOOSER (menu), &length); | |
177 | ||
178 | if ((gsize)pos < length) | |
179 | { | |
180 | item_uri = g_strdup (all_uris[pos]); | |
181 | } | |
182 | ||
183 | g_strfreev (all_uris); | |
184 | return item_uri; | |
185 | } | |
186 | ||
187 | static gboolean | |
188 | variant_type_equal_null_safe (const GVariantType *type1, | |
189 | const GVariantType *type2) | |
190 | { | |
191 | if (type1 == NULL || type2 == NULL) | |
192 | { | |
193 | return type1 == NULL && type2 == NULL; | |
194 | } | |
195 | ||
196 | return g_variant_type_equal (type1, type2); | |
197 | } | |
198 | ||
199 | #define AMTK_GVARIANT_PARAM_KEY "amtk-gvariant-param-key" | |
200 | ||
201 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
202 | static void | |
203 | gtk_action_activate_cb (GtkAction *gtk_action, | |
204 | GAction *g_action) | |
205 | { | |
206 | GVariant *param; | |
207 | ||
208 | param = g_object_get_data (G_OBJECT (gtk_action), AMTK_GVARIANT_PARAM_KEY); | |
209 | g_action_activate (g_action, param); | |
210 | } | |
211 | ||
212 | /** | |
213 | * amtk_utils_bind_g_action_to_gtk_action: | |
214 | * @g_action_map: a #GActionMap. | |
215 | * @detailed_g_action_name_without_prefix: a detailed #GAction name without the | |
216 | * #GActionMap prefix; the #GAction must be present in @g_action_map. | |
217 | * @gtk_action_group: a #GtkActionGroup. | |
218 | * @gtk_action_name: a #GtkAction name present in @gtk_action_group. | |
219 | * | |
220 | * Utility function to be able to port an application gradually to #GAction, | |
221 | * when #GtkUIManager and #GtkAction are still used. Porting to #GAction should | |
222 | * be the first step. | |
223 | * | |
224 | * For @detailed_g_action_name_without_prefix, see the | |
225 | * g_action_parse_detailed_name() function. The `"app."` or `"win."` prefix (or | |
226 | * any other #GActionMap prefix) must not be included in | |
227 | * @detailed_g_action_name_without_prefix. For example a valid | |
228 | * @detailed_g_action_name_without_prefix is `"open"` or | |
229 | * `"insert-command::foobar"`. | |
230 | * | |
231 | * The same #GAction can be bound to several #GtkAction's (with different | |
232 | * parameter values for the #GAction), but the reverse is not true, one | |
233 | * #GtkAction cannot be bound to several #GAction's. | |
234 | * | |
235 | * This function: | |
236 | * - Calls g_action_activate() when the #GtkAction #GtkAction::activate signal | |
237 | * is emitted. | |
238 | * - Binds the #GAction #GAction:enabled property to the #GtkAction | |
239 | * #GtkAction:sensitive property. The binding is done with the | |
240 | * %G_BINDING_BIDIRECTIONAL and %G_BINDING_SYNC_CREATE flags, the source is | |
241 | * the #GAction and the target is the #GtkAction. | |
242 | * | |
243 | * When using this function, you should set the callback to %NULL in the | |
244 | * corresponding #GtkActionEntry. | |
245 | * | |
246 | * Since: 4.0 | |
247 | */ | |
248 | void | |
249 | amtk_utils_bind_g_action_to_gtk_action (GActionMap *g_action_map, | |
250 | const gchar *detailed_g_action_name_without_prefix, | |
251 | GtkActionGroup *gtk_action_group, | |
252 | const gchar *gtk_action_name) | |
253 | { | |
254 | gchar *g_action_name = NULL; | |
255 | GVariant *target_value = NULL; | |
256 | GAction *g_action; | |
257 | GtkAction *gtk_action; | |
258 | GError *error = NULL; | |
259 | ||
260 | g_return_if_fail (G_IS_ACTION_MAP (g_action_map)); | |
261 | g_return_if_fail (detailed_g_action_name_without_prefix != NULL); | |
262 | g_return_if_fail (GTK_IS_ACTION_GROUP (gtk_action_group)); | |
263 | g_return_if_fail (gtk_action_name != NULL); | |
264 | ||
265 | g_action_parse_detailed_name (detailed_g_action_name_without_prefix, | |
266 | &g_action_name, | |
267 | &target_value, | |
268 | &error); | |
269 | ||
270 | /* The doc of g_action_parse_detailed_name() doesn't explain if it | |
271 | * returns a floating ref for the GVariant. | |
272 | */ | |
273 | if (target_value != NULL && | |
274 | g_variant_is_floating (target_value)) | |
275 | { | |
276 | g_variant_ref_sink (target_value); | |
277 | } | |
278 | ||
279 | if (error != NULL) | |
280 | { | |
281 | g_warning ("Error when parsing detailed GAction name '%s': %s", | |
282 | detailed_g_action_name_without_prefix, | |
283 | error->message); | |
284 | ||
285 | g_clear_error (&error); | |
286 | goto out; | |
287 | } | |
288 | ||
289 | g_action = g_action_map_lookup_action (g_action_map, g_action_name); | |
290 | if (g_action == NULL) | |
291 | { | |
292 | g_warn_if_reached (); | |
293 | goto out; | |
294 | } | |
295 | ||
296 | /* Sanity check, ensure that the GVariant target has the good type. */ | |
297 | { | |
298 | const GVariantType *g_action_param_type; | |
299 | const GVariantType *target_value_type = NULL; | |
300 | ||
301 | g_action_param_type = g_action_get_parameter_type (g_action); | |
302 | ||
303 | if (target_value != NULL) | |
304 | { | |
305 | target_value_type = g_variant_get_type (target_value); | |
306 | } | |
307 | ||
308 | if (!variant_type_equal_null_safe (g_action_param_type, target_value_type)) | |
309 | { | |
310 | g_warn_if_reached (); | |
311 | goto out; | |
312 | } | |
313 | } | |
314 | ||
315 | gtk_action = gtk_action_group_get_action (gtk_action_group, gtk_action_name); | |
316 | if (gtk_action == NULL) | |
317 | { | |
318 | g_warn_if_reached (); | |
319 | goto out; | |
320 | } | |
321 | ||
322 | if (target_value != NULL) | |
323 | { | |
324 | g_object_set_data_full (G_OBJECT (gtk_action), | |
325 | AMTK_GVARIANT_PARAM_KEY, | |
326 | g_variant_ref (target_value), | |
327 | (GDestroyNotify)g_variant_unref); | |
328 | } | |
329 | ||
330 | g_signal_connect_object (gtk_action, | |
331 | "activate", | |
332 | G_CALLBACK (gtk_action_activate_cb), | |
333 | g_action, | |
334 | 0); | |
335 | ||
336 | g_object_bind_property (g_action, "enabled", | |
337 | gtk_action, "sensitive", | |
338 | G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); | |
339 | ||
340 | out: | |
341 | g_free (g_action_name); | |
342 | g_clear_pointer (&target_value, (GDestroyNotify)g_variant_unref); | |
343 | } | |
344 | ||
345 | /** | |
346 | * amtk_utils_create_gtk_action: | |
347 | * @g_action_map: a #GActionMap. | |
348 | * @detailed_g_action_name_with_prefix: a detailed #GAction name with the | |
349 | * #GActionMap prefix; the #GAction must be present in @g_action_map. | |
350 | * @gtk_action_group: a #GtkActionGroup. | |
351 | * @gtk_action_name: the name of the #GtkAction to create and add to | |
352 | * @gtk_action_group. | |
353 | * | |
354 | * Utility function to be able to port an application gradually to #GAction and | |
355 | * #AmtkActionInfo, when #GtkUIManager is still used. This function goes one | |
356 | * step further compared to amtk_utils_bind_g_action_to_gtk_action(). With | |
357 | * amtk_utils_bind_g_action_to_gtk_action(), only the #GAction must exist. With | |
358 | * amtk_utils_create_gtk_action(), both the #GAction and #AmtkActionInfo must | |
359 | * exist (so typically you need to convert the #GtkActionEntry's into | |
360 | * #AmtkActionInfoEntry's). | |
361 | * | |
362 | * This function creates a #GtkAction from a #GAction plus its corresponding | |
363 | * #AmtkActionInfo. | |
364 | * | |
365 | * The #GtkAction is created with the information provided by the | |
366 | * #AmtkActionInfo (retrieved with amtk_action_info_central_store_lookup() with | |
367 | * @detailed_g_action_name_with_prefix as argument). Only the first accelerator | |
368 | * is taken into account. | |
369 | * | |
370 | * Once the #GtkAction is created, it is added to the @gtk_action_group, and | |
371 | * amtk_utils_bind_g_action_to_gtk_action() is called. | |
372 | * | |
373 | * Since: 4.0 | |
374 | */ | |
375 | void | |
376 | amtk_utils_create_gtk_action (GActionMap *g_action_map, | |
377 | const gchar *detailed_g_action_name_with_prefix, | |
378 | GtkActionGroup *gtk_action_group, | |
379 | const gchar *gtk_action_name) | |
380 | { | |
381 | AmtkActionInfoCentralStore *central_store; | |
382 | AmtkActionInfo *g_action_info; | |
383 | GtkAction *gtk_action; | |
384 | const gchar * const *accels; | |
385 | const gchar *first_accel; | |
386 | const gchar *detailed_g_action_name_without_prefix; | |
387 | ||
388 | g_return_if_fail (G_IS_ACTION_MAP (g_action_map)); | |
389 | g_return_if_fail (detailed_g_action_name_with_prefix != NULL); | |
390 | g_return_if_fail (GTK_IS_ACTION_GROUP (gtk_action_group)); | |
391 | g_return_if_fail (gtk_action_name != NULL); | |
392 | ||
393 | central_store = amtk_action_info_central_store_get_singleton (); | |
394 | g_action_info = amtk_action_info_central_store_lookup (central_store, detailed_g_action_name_with_prefix); | |
395 | ||
396 | gtk_action = gtk_action_new (gtk_action_name, | |
397 | amtk_action_info_get_label (g_action_info), | |
398 | amtk_action_info_get_tooltip (g_action_info), | |
399 | NULL); | |
400 | ||
401 | gtk_action_set_icon_name (gtk_action, amtk_action_info_get_icon_name (g_action_info)); | |
402 | ||
403 | accels = amtk_action_info_get_accels (g_action_info); | |
404 | first_accel = accels != NULL ? accels[0] : NULL; | |
405 | ||
406 | gtk_action_group_add_action_with_accel (gtk_action_group, gtk_action, first_accel); | |
407 | g_object_unref (gtk_action); | |
408 | ||
409 | detailed_g_action_name_without_prefix = strchr (detailed_g_action_name_with_prefix, '.'); | |
410 | if (detailed_g_action_name_without_prefix != NULL) | |
411 | { | |
412 | detailed_g_action_name_without_prefix++; | |
413 | } | |
414 | else | |
415 | { | |
416 | detailed_g_action_name_without_prefix = detailed_g_action_name_with_prefix; | |
417 | } | |
418 | ||
419 | amtk_utils_bind_g_action_to_gtk_action (g_action_map, | |
420 | detailed_g_action_name_without_prefix, | |
421 | gtk_action_group, | |
422 | gtk_action_name); | |
423 | } | |
424 | G_GNUC_END_IGNORE_DEPRECATIONS |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_UTILS_H | |
20 | #define AMTK_UTILS_H | |
21 | ||
22 | #if !defined (AMTK_H_INSIDE) && !defined (AMTK_COMPILATION) | |
23 | #error "Only <amtk/amtk.h> can be included directly." | |
24 | #endif | |
25 | ||
26 | #include <gtk/gtk.h> | |
27 | ||
28 | G_BEGIN_DECLS | |
29 | ||
30 | /* File utilities */ | |
31 | ||
32 | G_GNUC_INTERNAL | |
33 | gchar * _amtk_utils_replace_home_dir_with_tilde (const gchar *filename); | |
34 | ||
35 | /* String utilities */ | |
36 | ||
37 | G_GNUC_INTERNAL | |
38 | gchar ** _amtk_utils_strv_copy (const gchar * const *strv); | |
39 | ||
40 | /* GTK+ utilities */ | |
41 | ||
42 | gchar * amtk_utils_recent_chooser_menu_get_item_uri (GtkRecentChooserMenu *menu, | |
43 | GtkMenuItem *item); | |
44 | ||
45 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS | |
46 | void amtk_utils_bind_g_action_to_gtk_action (GActionMap *g_action_map, | |
47 | const gchar *detailed_g_action_name_without_prefix, | |
48 | GtkActionGroup *gtk_action_group, | |
49 | const gchar *gtk_action_name); | |
50 | ||
51 | void amtk_utils_create_gtk_action (GActionMap *g_action_map, | |
52 | const gchar *detailed_g_action_name_with_prefix, | |
53 | GtkActionGroup *gtk_action_group, | |
54 | const gchar *gtk_action_name); | |
55 | G_GNUC_END_IGNORE_DEPRECATIONS | |
56 | ||
57 | G_END_DECLS | |
58 | ||
59 | #endif /* AMTK_UTILS_H */ |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef AMTK_H | |
20 | #define AMTK_H | |
21 | ||
22 | #define AMTK_H_INSIDE | |
23 | ||
24 | #include <amtk/amtk-types.h> | |
25 | #include <amtk/amtk-enum-types.h> | |
26 | ||
27 | #include <amtk/amtk-action-info.h> | |
28 | #include <amtk/amtk-action-info-store.h> | |
29 | #include <amtk/amtk-action-info-central-store.h> | |
30 | #include <amtk/amtk-action-map.h> | |
31 | #include <amtk/amtk-application-window.h> | |
32 | #include <amtk/amtk-factory.h> | |
33 | #include <amtk/amtk-init.h> | |
34 | #include <amtk/amtk-menu-item.h> | |
35 | #include <amtk/amtk-menu-shell.h> | |
36 | #include <amtk/amtk-utils.h> | |
37 | ||
38 | #undef AMTK_H_INSIDE | |
39 | ||
40 | #endif /* AMTK_H */ |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | <Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
2 | xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | |
3 | xmlns:foaf="http://xmlns.com/foaf/0.1/" | |
4 | xmlns:gnome="http://api.gnome.org/doap-extensions#" | |
5 | xmlns="http://usefulinc.com/ns/doap#"> | |
6 | <name xml:lang="en">Amtk</name> | |
7 | <shortdesc xml:lang="en">Actions, Menus and Toolbars Kit for GTK+</shortdesc> | |
8 | <description xml:lang="en">Amtk is the acronym for “Actions, Menus and | |
9 | Toolbars Kit”. It is a basic GtkUIManager replacement based on GAction.</description> | |
10 | ||
11 | <homepage rdf:resource="https://wiki.gnome.org/Projects/Tepl" /> | |
12 | <mailing-list rdf:resource="https://mail.gnome.org/mailman/listinfo/gnome-devtools" /> | |
13 | <download-page rdf:resource="https://download.gnome.org/sources/amtk/" /> | |
14 | <bug-database rdf:resource="https://gitlab.gnome.org/GNOME/tepl/issues" /> | |
15 | ||
16 | <programming-language>C</programming-language> | |
17 | ||
18 | <maintainer> | |
19 | <foaf:Person> | |
20 | <foaf:name>Sébastien Wilmet</foaf:name> | |
21 | <foaf:mbox rdf:resource="mailto:swilmet@gnome.org" /> | |
22 | <gnome:userid>swilmet</gnome:userid> | |
23 | </foaf:Person> | |
24 | </maintainer> | |
25 | </Project> |
0 | prefix=@prefix@ | |
1 | exec_prefix=@exec_prefix@ | |
2 | libdir=@libdir@ | |
3 | includedir=@includedir@ | |
4 | ||
5 | Name: Amtk | |
6 | Description: Actions, Menus and Toolbars Kit | |
7 | Version: @PACKAGE_VERSION@ | |
8 | Requires: @AMTK_PACKAGE_REQUIRES@ | |
9 | Requires.private: @AMTK_PACKAGE_REQUIRES_PRIVATE@ | |
10 | Libs: -L${libdir} -lamtk-@AMTK_API_VERSION@ | |
11 | Cflags: -I${includedir}/amtk-@AMTK_API_VERSION@ |
0 | #!/bin/sh | |
1 | # Run this to generate all the initial makefiles, etc. | |
2 | test -n "$srcdir" || srcdir=$(dirname "$0") | |
3 | test -n "$srcdir" || srcdir=. | |
4 | ||
5 | olddir=$(pwd) | |
6 | ||
7 | cd $srcdir | |
8 | ||
9 | (test -f configure.ac) || { | |
10 | echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***" | |
11 | exit 1 | |
12 | } | |
13 | ||
14 | # shellcheck disable=SC2016 | |
15 | PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac) | |
16 | ||
17 | if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then | |
18 | echo "*** WARNING: I am going to run 'configure' with no arguments." >&2 | |
19 | echo "*** If you wish to pass any to it, please specify them on the" >&2 | |
20 | echo "*** '$0' command line." >&2 | |
21 | echo "" >&2 | |
22 | fi | |
23 | ||
24 | aclocal --install || exit 1 | |
25 | gtkdocize --copy || exit 1 | |
26 | autoreconf --verbose --force --install || exit 1 | |
27 | ||
28 | cd "$olddir" | |
29 | if [ "$NOCONFIGURE" = "" ]; then | |
30 | $srcdir/configure "$@" || exit 1 | |
31 | ||
32 | if [ "$1" = "--help" ]; then exit 0 else | |
33 | echo "Now type 'make' to compile $PKG_NAME" || exit 1 | |
34 | fi | |
35 | else | |
36 | echo "Skipping configure process." | |
37 | fi |
0 | dnl Process this file with autoconf to produce a configure script. | |
1 | ||
2 | AC_PREREQ(2.64) | |
3 | ||
4 | # Package version of the form 'major.minor.micro'. | |
5 | m4_define(amtk_package_version, 4.0.1) | |
6 | ||
7 | AC_INIT([Amtk], | |
8 | [amtk_package_version], | |
9 | [https://gitlab.gnome.org/GNOME/tepl/issues], | |
10 | [amtk], | |
11 | [https://wiki.gnome.org/Projects/Tepl]) | |
12 | ||
13 | AX_REQUIRE_DEFINED([AX_IS_RELEASE]) | |
14 | AX_IS_RELEASE([git-directory]) | |
15 | ||
16 | # Libtool versioning | |
17 | # | |
18 | # For development releases (if the minor package version is odd), keep the same | |
19 | # Libtool version. | |
20 | # | |
21 | # For a new minor stable release (when incrementing the minor package version | |
22 | # to an even number), apply the following algorithm step by step: | |
23 | # 1. If the library source code has changed at all since the last | |
24 | # update, then increment REVISION. | |
25 | # 2. If any exported functions or data have been added, removed, or | |
26 | # changed since the last update, increment CURRENT and set REVISION | |
27 | # to 0. | |
28 | # 3. If any exported functions or data have been added since the last | |
29 | # public release, increment AGE. | |
30 | # 4. If any exported functions or data have been removed since the last | |
31 | # public release, set AGE to 0. | |
32 | # | |
33 | # When incrementing the API version (usually for a new major package version), | |
34 | # set CURRENT, REVISION and AGE to 0 since it's like a new library. | |
35 | AMTK_LT_CURRENT=0 | |
36 | AMTK_LT_REVISION=0 | |
37 | AMTK_LT_AGE=0 | |
38 | AMTK_LT_VERSION="$AMTK_LT_CURRENT:$AMTK_LT_REVISION:$AMTK_LT_AGE" | |
39 | AC_SUBST([AMTK_LT_VERSION]) | |
40 | ||
41 | # API version, used for parallel installability. | |
42 | # Not used in: | |
43 | # - po/Makevars | |
44 | # - the docs/reference/amtk-4.0-sections.txt filename | |
45 | # Because as far as I've tested, it is not easily feasible to not hardcode the | |
46 | # API version in those places (swilmet). | |
47 | AMTK_API_VERSION=4 | |
48 | AC_SUBST([AMTK_API_VERSION]) | |
49 | ||
50 | # Dependencies | |
51 | glib_req=2.52 | |
52 | gtk_req=3.22 | |
53 | ||
54 | AC_CONFIG_SRCDIR([amtk/amtk.h]) | |
55 | AC_CONFIG_HEADER([config.h]) | |
56 | AC_CONFIG_MACRO_DIR([m4]) | |
57 | ||
58 | # gnu strictness to generate the INSTALL file | |
59 | AM_INIT_AUTOMAKE([1.14 tar-ustar dist-xz no-dist-gzip gnu -Wno-portability]) | |
60 | ||
61 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
62 | ||
63 | # Check for programs | |
64 | AC_PROG_CC | |
65 | AC_PROG_INSTALL | |
66 | ||
67 | AX_REQUIRE_DEFINED([PKG_PROG_PKG_CONFIG]) | |
68 | AX_REQUIRE_DEFINED([PKG_INSTALLDIR]) | |
69 | PKG_PROG_PKG_CONFIG | |
70 | PKG_INSTALLDIR | |
71 | ||
72 | AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums]) | |
73 | ||
74 | # Initialize libtool | |
75 | LT_PREREQ([2.2.6]) | |
76 | LT_INIT([disable-static]) | |
77 | ||
78 | # Compile warnings. There can be deprecation warnings at any time, so disable | |
79 | # -Werror by default with the [yes] argument. | |
80 | AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS]) | |
81 | AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [yes]) | |
82 | ||
83 | # Dynamic linking dependencies | |
84 | # TODO simplify. | |
85 | AX_REQUIRE_DEFINED([AX_PKG_CHECK_MODULES]) | |
86 | AX_PKG_CHECK_MODULES([AMTK_DEP], | |
87 | [glib-2.0 >= $glib_req gtk+-3.0 >= $gtk_req], | |
88 | [], | |
89 | [], [], | |
90 | [AMTK_PACKAGE_REQUIRES], | |
91 | [AMTK_PACKAGE_REQUIRES_PRIVATE]) | |
92 | ||
93 | # i18n | |
94 | AM_GNU_GETTEXT([external]) | |
95 | AM_GNU_GETTEXT_VERSION([0.19.4]) | |
96 | AC_SUBST([GETTEXT_PACKAGE], [amtk-$AMTK_API_VERSION]) | |
97 | AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Define to the gettext package name.]) | |
98 | ||
99 | # Documentation | |
100 | AX_REQUIRE_DEFINED([GTK_DOC_CHECK]) | |
101 | GTK_DOC_CHECK([1.25], [--flavour=no-tmpl]) | |
102 | ||
103 | # Installed Tests for gnome continuous integration | |
104 | AC_ARG_ENABLE(installed_tests, | |
105 | AS_HELP_STRING([--enable-installed-tests], | |
106 | [Install test programs (default: no)]),, | |
107 | [enable_installed_tests=no]) | |
108 | ||
109 | AM_CONDITIONAL(INSTALLED_TESTS, test "x$enable_installed_tests" = "xyes") | |
110 | ||
111 | # Introspection | |
112 | AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK]) | |
113 | GOBJECT_INTROSPECTION_CHECK([1.42.0]) | |
114 | ||
115 | # Code coverage for unit tests | |
116 | AX_REQUIRE_DEFINED([AX_CODE_COVERAGE]) | |
117 | AX_CODE_COVERAGE | |
118 | ||
119 | # Valgrind check | |
120 | AX_REQUIRE_DEFINED([AX_VALGRIND_CHECK]) | |
121 | AX_VALGRIND_CHECK | |
122 | ||
123 | AX_REQUIRE_DEFINED([PKG_CHECK_VAR]) | |
124 | PKG_CHECK_VAR([GLIB_PREFIX], [glib-2.0], [prefix]) | |
125 | ||
126 | # Output files | |
127 | AC_CONFIG_FILES([ | |
128 | amtk-${AMTK_API_VERSION}.pc:amtk.pc.in | |
129 | Makefile | |
130 | amtk/Makefile | |
131 | docs/Makefile | |
132 | docs/reference/amtk-docs.xml | |
133 | docs/reference/amtk-intro.xml | |
134 | docs/reference/Makefile | |
135 | po/Makefile.in | |
136 | tests/Makefile | |
137 | testsuite/Makefile | |
138 | ]) | |
139 | ||
140 | AC_OUTPUT | |
141 | ||
142 | echo " | |
143 | Configuration: | |
144 | ||
145 | ${PACKAGE_NAME} version ${PACKAGE_VERSION} | |
146 | ||
147 | Source code location: ${srcdir} | |
148 | Prefix: ${prefix} | |
149 | Compiler: ${CC} | |
150 | Documentation: ${enable_gtk_doc} | |
151 | GObject introspection: ${found_introspection} | |
152 | Code coverage: ${enable_code_coverage} | |
153 | Valgrind check: ${enable_valgrind} | |
154 | Installed tests: ${enable_installed_tests} | |
155 | " |
0 | ## Process this file with automake to produce Makefile.in | |
1 | AUTOMAKE_OPTIONS = 1.6 | |
2 | ||
3 | # The name of the module. | |
4 | # For library-web, it's simpler if the DOC_MODULE follows the scheme: | |
5 | # $name-$major.$minor | |
6 | # (to show the API online at developer.gnome.org) | |
7 | # So, add ".0". | |
8 | DOC_MODULE = amtk-@AMTK_API_VERSION@.0 | |
9 | ||
10 | # The top-level XML file (SGML in the past). | |
11 | DOC_MAIN_SGML_FILE = amtk-docs.xml | |
12 | ||
13 | # Extra options to supply to gtkdoc-scan | |
14 | SCAN_OPTIONS = --rebuild-types | |
15 | ||
16 | # The directory containing the source code. Relative to $(srcdir) | |
17 | DOC_SOURCE_DIR = $(top_srcdir)/amtk | |
18 | ||
19 | # Used for dependencies | |
20 | HFILE_GLOB = $(top_srcdir)/amtk/*.h | |
21 | CFILE_GLOB = $(top_srcdir)/amtk/*.c | |
22 | ||
23 | # Header files or dirs to ignore when scanning. Use base file/dir names | |
24 | # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code | |
25 | IGNORE_HFILES = \ | |
26 | amtk.h \ | |
27 | $(NULL) | |
28 | ||
29 | # Extra options to supply to gtkdoc-mkdb | |
30 | MKDB_OPTIONS = --xml-mode --output-format=xml | |
31 | ||
32 | # Images to copy into HTML directory | |
33 | HTML_IMAGES = | |
34 | ||
35 | # Extra XML files that are included by $(DOC_MAIN_SGML_FILE) | |
36 | content_files = \ | |
37 | amtk-intro.xml \ | |
38 | api-breaks.xml | |
39 | ||
40 | # Extra options to supply to gtkdoc-fixref | |
41 | FIXXREF_OPTIONS = | |
42 | ||
43 | # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. | |
44 | # Only needed if you are using gtkdoc-scangobj to dynamically query widget | |
45 | # signals and properties. | |
46 | GTKDOC_CFLAGS = -I$(top_srcdir) $(AMTK_DEP_CFLAGS) | |
47 | GTKDOC_LIBS = \ | |
48 | $(top_builddir)/amtk/libamtk-@AMTK_API_VERSION@.la \ | |
49 | $(AMTK_DEP_LIBS) | |
50 | ||
51 | MAINTAINERCLEANFILES = \ | |
52 | $(DOC_MODULE)-overrides.txt \ | |
53 | $(DOC_MODULE).types | |
54 | ||
55 | # include common portion ... | |
56 | include $(top_srcdir)/gtk-doc.make | |
57 | ||
58 | EXTRA_DIST += \ | |
59 | amtk-intro.xml.in \ | |
60 | amtk-docs.xml.in | |
61 | ||
62 | DISTCLEANFILES = \ | |
63 | amtk-intro.xml \ | |
64 | amtk-docs.xml | |
65 | ||
66 | -include $(top_srcdir)/git.mk |
0 | <INCLUDE>amtk/amtk.h</INCLUDE> | |
1 | ||
2 | <SECTION> | |
3 | <FILE>amtk-init</FILE> | |
4 | <TITLE>Amtk Initialization and Finalization</TITLE> | |
5 | amtk_init | |
6 | amtk_finalize | |
7 | </SECTION> | |
8 | ||
9 | <SECTION> | |
10 | <FILE>amtk-application-window</FILE> | |
11 | AmtkApplicationWindow | |
12 | amtk_application_window_get_from_gtk_application_window | |
13 | amtk_application_window_get_application_window | |
14 | amtk_application_window_get_statusbar | |
15 | amtk_application_window_set_statusbar | |
16 | amtk_application_window_connect_menu_to_statusbar | |
17 | amtk_application_window_connect_recent_chooser_menu_to_statusbar | |
18 | amtk_application_window_create_open_recent_menu | |
19 | amtk_application_window_create_open_recent_menu_item | |
20 | <SUBSECTION Standard> | |
21 | AMTK_APPLICATION_WINDOW | |
22 | AMTK_APPLICATION_WINDOW_CLASS | |
23 | AMTK_APPLICATION_WINDOW_GET_CLASS | |
24 | AMTK_IS_APPLICATION_WINDOW | |
25 | AMTK_IS_APPLICATION_WINDOW_CLASS | |
26 | AMTK_TYPE_APPLICATION_WINDOW | |
27 | AmtkApplicationWindowClass | |
28 | AmtkApplicationWindowPrivate | |
29 | amtk_application_window_get_type | |
30 | </SECTION> | |
31 | ||
32 | <SECTION> | |
33 | <FILE>amtk-action-info</FILE> | |
34 | AmtkActionInfo | |
35 | AmtkActionInfoEntry | |
36 | amtk_action_info_new | |
37 | amtk_action_info_new_from_entry | |
38 | amtk_action_info_ref | |
39 | amtk_action_info_unref | |
40 | amtk_action_info_copy | |
41 | amtk_action_info_get_action_name | |
42 | amtk_action_info_set_action_name | |
43 | amtk_action_info_get_icon_name | |
44 | amtk_action_info_set_icon_name | |
45 | amtk_action_info_get_label | |
46 | amtk_action_info_set_label | |
47 | amtk_action_info_get_tooltip | |
48 | amtk_action_info_set_tooltip | |
49 | amtk_action_info_get_accels | |
50 | amtk_action_info_set_accels | |
51 | amtk_action_info_mark_as_used | |
52 | amtk_action_info_has_been_used | |
53 | <SUBSECTION Standard> | |
54 | amtk_action_info_get_type | |
55 | AMTK_TYPE_ACTION_INFO | |
56 | </SECTION> | |
57 | ||
58 | <SECTION> | |
59 | <FILE>amtk-action-info-store</FILE> | |
60 | AmtkActionInfoStore | |
61 | amtk_action_info_store_new | |
62 | amtk_action_info_store_add | |
63 | amtk_action_info_store_add_entries | |
64 | amtk_action_info_store_lookup | |
65 | amtk_action_info_store_check_all_used | |
66 | <SUBSECTION Standard> | |
67 | AMTK_ACTION_INFO_STORE | |
68 | AMTK_ACTION_INFO_STORE_CLASS | |
69 | AMTK_ACTION_INFO_STORE_GET_CLASS | |
70 | AMTK_IS_ACTION_INFO_STORE | |
71 | AMTK_IS_ACTION_INFO_STORE_CLASS | |
72 | AMTK_TYPE_ACTION_INFO_STORE | |
73 | AmtkActionInfoStoreClass | |
74 | AmtkActionInfoStorePrivate | |
75 | amtk_action_info_store_get_type | |
76 | </SECTION> | |
77 | ||
78 | <SECTION> | |
79 | <FILE>amtk-action-info-central-store</FILE> | |
80 | AmtkActionInfoCentralStore | |
81 | amtk_action_info_central_store_get_singleton | |
82 | amtk_action_info_central_store_lookup | |
83 | <SUBSECTION Standard> | |
84 | AMTK_ACTION_INFO_CENTRAL_STORE | |
85 | AMTK_ACTION_INFO_CENTRAL_STORE_CLASS | |
86 | AMTK_ACTION_INFO_CENTRAL_STORE_GET_CLASS | |
87 | AMTK_IS_ACTION_INFO_CENTRAL_STORE | |
88 | AMTK_IS_ACTION_INFO_CENTRAL_STORE_CLASS | |
89 | AMTK_TYPE_ACTION_INFO_CENTRAL_STORE | |
90 | AmtkActionInfoCentralStoreClass | |
91 | AmtkActionInfoCentralStorePrivate | |
92 | amtk_action_info_central_store_get_type | |
93 | </SECTION> | |
94 | ||
95 | <SECTION> | |
96 | <FILE>amtk-action-map</FILE> | |
97 | amtk_action_map_add_action_entries_check_dups | |
98 | </SECTION> | |
99 | ||
100 | <SECTION> | |
101 | <FILE>amtk-factory</FILE> | |
102 | AmtkFactory | |
103 | AmtkFactoryFlags | |
104 | amtk_factory_new | |
105 | amtk_factory_new_with_default_application | |
106 | amtk_factory_get_application | |
107 | amtk_factory_get_default_flags | |
108 | amtk_factory_set_default_flags | |
109 | amtk_factory_create_menu_item | |
110 | amtk_factory_create_menu_item_full | |
111 | amtk_factory_create_check_menu_item | |
112 | amtk_factory_create_check_menu_item_full | |
113 | amtk_factory_create_tool_button | |
114 | amtk_factory_create_tool_button_full | |
115 | amtk_factory_create_menu_tool_button | |
116 | amtk_factory_create_menu_tool_button_full | |
117 | <SUBSECTION Standard> | |
118 | AMTK_FACTORY | |
119 | AMTK_FACTORY_CLASS | |
120 | AMTK_FACTORY_GET_CLASS | |
121 | AMTK_IS_FACTORY | |
122 | AMTK_IS_FACTORY_CLASS | |
123 | AMTK_TYPE_FACTORY | |
124 | AmtkFactoryClass | |
125 | AmtkFactoryPrivate | |
126 | amtk_factory_get_type | |
127 | AMTK_TYPE_FACTORY_FLAGS | |
128 | amtk_factory_flags_get_type | |
129 | </SECTION> | |
130 | ||
131 | <SECTION> | |
132 | <FILE>amtk-menu-item</FILE> | |
133 | amtk_menu_item_get_long_description | |
134 | amtk_menu_item_set_long_description | |
135 | amtk_menu_item_set_icon_name | |
136 | </SECTION> | |
137 | ||
138 | <SECTION> | |
139 | <FILE>amtk-menu-shell</FILE> | |
140 | AmtkMenuShell | |
141 | amtk_menu_shell_get_from_gtk_menu_shell | |
142 | amtk_menu_shell_get_menu_shell | |
143 | <SUBSECTION Standard> | |
144 | AMTK_IS_MENU_SHELL | |
145 | AMTK_IS_MENU_SHELL_CLASS | |
146 | AMTK_MENU_SHELL | |
147 | AMTK_MENU_SHELL_CLASS | |
148 | AMTK_MENU_SHELL_GET_CLASS | |
149 | AMTK_TYPE_MENU_SHELL | |
150 | AmtkMenuShellClass | |
151 | AmtkMenuShellPrivate | |
152 | amtk_menu_shell_get_type | |
153 | </SECTION> | |
154 | ||
155 | <SECTION> | |
156 | <FILE>amtk-utils</FILE> | |
157 | amtk_utils_recent_chooser_menu_get_item_uri | |
158 | amtk_utils_bind_g_action_to_gtk_action | |
159 | amtk_utils_create_gtk_action | |
160 | </SECTION> |
0 | <?xml version="1.0"?> | |
1 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" | |
3 | [ | |
4 | <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> | |
5 | <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent"> | |
6 | %gtkdocentities; | |
7 | ]> | |
8 | <book id="index"> | |
9 | <bookinfo> | |
10 | <title>Amtk @AMTK_API_VERSION@ Reference Manual</title> | |
11 | <releaseinfo>for Amtk &package_version;</releaseinfo> | |
12 | </bookinfo> | |
13 | ||
14 | <xi:include href="amtk-intro.xml"/> | |
15 | ||
16 | <chapter id="api-reference"> | |
17 | <title>Amtk API Reference</title> | |
18 | <xi:include href="xml/amtk-init.xml"/> | |
19 | <xi:include href="xml/amtk-application-window.xml"/> | |
20 | <xi:include href="xml/amtk-action-info.xml"/> | |
21 | <xi:include href="xml/amtk-action-info-store.xml"/> | |
22 | <xi:include href="xml/amtk-action-info-central-store.xml"/> | |
23 | <xi:include href="xml/amtk-action-map.xml"/> | |
24 | <xi:include href="xml/amtk-factory.xml"/> | |
25 | <xi:include href="xml/amtk-menu-item.xml"/> | |
26 | <xi:include href="xml/amtk-menu-shell.xml"/> | |
27 | <xi:include href="xml/amtk-utils.xml"/> | |
28 | </chapter> | |
29 | ||
30 | <xi:include href="api-breaks.xml"/> | |
31 | ||
32 | <part id="annexes"> | |
33 | <title>Annexes</title> | |
34 | ||
35 | <chapter id="object-tree"> | |
36 | <title>Object Hierarchy</title> | |
37 | <xi:include href="xml/tree_index.sgml"/> | |
38 | </chapter> | |
39 | ||
40 | <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> | |
41 | ||
42 | <index id="api-index-full"> | |
43 | <title>Index of all symbols</title> | |
44 | <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> | |
45 | </index> | |
46 | <index id="api-index-1-0" role="1.0"> | |
47 | <title>Index of new symbols in 1.0</title> | |
48 | <xi:include href="xml/api-index-1.0.xml"><xi:fallback /></xi:include> | |
49 | </index> | |
50 | <index id="api-index-2-0" role="2.0"> | |
51 | <title>Index of new symbols in 2.0</title> | |
52 | <xi:include href="xml/api-index-2.0.xml"><xi:fallback /></xi:include> | |
53 | </index> | |
54 | <index id="api-index-3-0" role="3.0"> | |
55 | <title>Index of new symbols in 3.0</title> | |
56 | <xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include> | |
57 | </index> | |
58 | <index id="api-index-4-0" role="4.0"> | |
59 | <title>Index of new symbols in 4.0</title> | |
60 | <xi:include href="xml/api-index-4.0.xml"><xi:fallback /></xi:include> | |
61 | </index> | |
62 | </part> | |
63 | </book> |
0 | <?xml version="1.0"?> | |
1 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" | |
3 | [ | |
4 | <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> | |
5 | <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent"> | |
6 | %gtkdocentities; | |
7 | ]> | |
8 | ||
9 | <refentry id="amtk-intro"> | |
10 | <refmeta> | |
11 | <refentrytitle>Amtk Introduction</refentrytitle> | |
12 | </refmeta> | |
13 | ||
14 | <refnamediv> | |
15 | <refname>Amtk Introduction</refname> | |
16 | <refpurpose> | |
17 | Introduction to the Actions, Menus and Toolbars Kit for GTK+ | |
18 | </refpurpose> | |
19 | </refnamediv> | |
20 | ||
21 | <para> | |
22 | Amtk is the acronym for “Actions, Menus and Toolbars Kit”. It is a basic | |
23 | <link linkend="GtkUIManager">GtkUIManager</link> replacement based on | |
24 | <link linkend="GAction">GAction</link>. | |
25 | <link linkend="GtkUIManager">GtkUIManager</link> has been deprecated in | |
26 | GTK+ 3, without a good replacement for applications that want to keep a | |
27 | traditional UI (with a <link linkend="GtkMenuBar">GtkMenuBar</link>, a | |
28 | <link linkend="GtkToolbar">GtkToolbar</link> and a | |
29 | <link linkend="GtkStatusbar">GtkStatusbar</link>; in contrast to the new UI | |
30 | with a <link linkend="GtkHeaderBar">GtkHeaderBar</link> and a “hamburger | |
31 | menu”). | |
32 | </para> | |
33 | ||
34 | <para> | |
35 | Amtk is developed inside the Tepl repository, but is a separate shared library | |
36 | so that applications can use it without depending on Tepl, GtkSourceView, etc. | |
37 | </para> | |
38 | ||
39 | <para> | |
40 | With Amtk, menus and toolbars are created programmatically, but with | |
41 | convenient APIs (the support for an XML format will maybe be added in the | |
42 | future, contributions welcome). <link linkend="GMenu">GMenu</link> is not | |
43 | used, a menubar is created with <link linkend="GtkMenuItem">GtkMenuItem</link>'s, | |
44 | although the support for <link linkend="GMenu">GMenu</link> could easily be | |
45 | added. | |
46 | </para> | |
47 | ||
48 | <para> | |
49 | There are currently several things that are not possible to do with the | |
50 | support of <link linkend="GMenu">GMenu</link> in GTK+, that Amtk solves: | |
51 | </para> | |
52 | <itemizedlist> | |
53 | <listitem> | |
54 | <para> | |
55 | Primarily, encoding the information about an action only once, to create | |
56 | both a menu item and a toolbar item for that action. The information | |
57 | needed: a label (i.e. a short description), an icon, a tooltip (i.e. a | |
58 | longer description) and keyboard shortcuts. This is implemented by | |
59 | <link linkend="AmtkActionInfo">AmtkActionInfo</link>, with | |
60 | <link linkend="AmtkFactory">AmtkFactory</link> functions to create menu | |
61 | and toolbar items. | |
62 | </para> | |
63 | <para> | |
64 | When writing an XML file to create a <link linkend="GMenu">GMenu</link> | |
65 | with the format understood by <link linkend="GtkBuilder">GtkBuilder</link> | |
66 | (see the class description of <link linkend="GtkApplicationWindow">GtkApplicationWindow</link>), | |
67 | the information in the XML file can be used only to create a <link linkend="GMenu">GMenu</link>, | |
68 | not a toolbar. It would not be convenient to duplicate the information. | |
69 | </para> | |
70 | </listitem> | |
71 | <listitem> | |
72 | <para> | |
73 | When a <link linkend="GtkMenuItem">GtkMenuItem</link> is selected (e.g. | |
74 | when the mouse hovers it), showing a longer description in the | |
75 | <link linkend="GtkStatusbar">GtkStatusbar</link>. This is implemented by | |
76 | <link linkend="AmtkApplicationWindow">AmtkApplicationWindow</link>. It | |
77 | makes the UI better self-discoverable, to improve the usability. | |
78 | </para> | |
79 | </listitem> | |
80 | <listitem> | |
81 | <para> | |
82 | Related to the previous point: having a | |
83 | <link linkend="GtkRecentChooser">GtkRecentChooser</link> menu that shows | |
84 | in a <link linkend="GtkStatusbar">GtkStatusbar</link> the full file path | |
85 | when a menu item is selected. This is implemented by | |
86 | <link linkend="amtk-application-window-connect-recent-chooser-menu-to-statusbar">amtk_application_window_connect_recent_chooser_menu_to_statusbar()</link>. | |
87 | </para> | |
88 | </listitem> | |
89 | <listitem> | |
90 | <para> | |
91 | Additionally, the Amtk infrastructure permits to share | |
92 | <link linkend="AmtkActionInfo">AmtkActionInfo</link>'s in a library (with | |
93 | translations); this is a bit similar to | |
94 | <link linkend="GtkStockItem">GtkStockItem</link>, to reduce the amount of | |
95 | work that an application (and translators) need to do. | |
96 | </para> | |
97 | </listitem> | |
98 | </itemizedlist> | |
99 | ||
100 | <refsect1> | |
101 | <title>Sanity checks</title> | |
102 | <para> | |
103 | Amtk has several functions to do various sanity checks. They normally don't | |
104 | impact too much the performances, so it is recommended to always run them, | |
105 | although they could be disabled on production. The functions: | |
106 | </para> | |
107 | <itemizedlist> | |
108 | <listitem> | |
109 | <para> | |
110 | <link linkend="amtk-action-map-add-action-entries-check-dups">amtk_action_map_add_action_entries_check_dups()</link> | |
111 | </para> | |
112 | </listitem> | |
113 | <listitem> | |
114 | <para> | |
115 | <link linkend="amtk-action-info-store-check-all-used">amtk_action_info_store_check_all_used()</link> | |
116 | </para> | |
117 | </listitem> | |
118 | <listitem> | |
119 | <para> | |
120 | Another sanity check, but which cannot be disabled: the | |
121 | <link linkend="AmtkActionInfoCentralStore">AmtkActionInfoCentralStore</link> | |
122 | checks that each <link linkend="AmtkActionInfo">AmtkActionInfo</link> | |
123 | has a unique action name. Which means that | |
124 | <link linkend="AmtkActionInfo">AmtkActionInfo</link>'s provided by a | |
125 | library must be namespaced. | |
126 | </para> | |
127 | </listitem> | |
128 | </itemizedlist> | |
129 | </refsect1> | |
130 | ||
131 | <refsect1> | |
132 | <title>GTK+ dependency</title> | |
133 | <para> | |
134 | Amtk @AMTK_API_VERSION@ depends on GTK+ 3. | |
135 | </para> | |
136 | </refsect1> | |
137 | ||
138 | <refsect1> | |
139 | <title>pkg-config name</title> | |
140 | <para> | |
141 | For Amtk @AMTK_API_VERSION@, the pkg-config name is: | |
142 | <code>amtk-@AMTK_API_VERSION@</code> | |
143 | </para> | |
144 | <para> | |
145 | To compile a program that uses Amtk @AMTK_API_VERSION@, you can for | |
146 | example use the following command: | |
147 | </para> | |
148 | <para> | |
149 | <code>$ gcc hello.c `pkg-config --cflags --libs amtk-@AMTK_API_VERSION@` -o hello</code> | |
150 | </para> | |
151 | </refsect1> | |
152 | </refentry> |
0 | <?xml version="1.0"?> | |
1 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" | |
3 | [ | |
4 | <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> | |
5 | <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent"> | |
6 | %gtkdocentities; | |
7 | ]> | |
8 | ||
9 | <part id="api-breaks"> | |
10 | <title>API Breaks</title> | |
11 | ||
12 | <chapter id="api-breaks-2-to-3-amtk"> | |
13 | <title>Gtef 2 -> Amtk 3</title> | |
14 | ||
15 | <itemizedlist> | |
16 | <listitem> | |
17 | <para> | |
18 | The classes and functions related to actions and menus have been moved | |
19 | to a new shared library called Amtk (Actions, Menus and Toolbars Kit), | |
20 | since it was not really related to text editors, it is more general. | |
21 | But Amtk is still developed inside the Tepl repository. | |
22 | </para> | |
23 | </listitem> | |
24 | <listitem> | |
25 | <para> | |
26 | The <link linkend="AmtkFactory">AmtkFactory</link> class has been | |
27 | added, which replace <code>gtef_action_info_store_create_menu_item()</code> | |
28 | and removes the <code>GtefActionInfoStore:application</code> property. | |
29 | </para> | |
30 | </listitem> | |
31 | <listitem> | |
32 | <para> | |
33 | <code>gtef_action_info_central_store_get_instance()</code> has been | |
34 | renamed to | |
35 | <link linkend="amtk-action-info-central-store-get-singleton">amtk_action_info_central_store_get_singleton()</link>. | |
36 | </para> | |
37 | </listitem> | |
38 | <listitem> | |
39 | <para> | |
40 | <link linkend="amtk-application-window-connect-menu-to-statusbar">amtk_application_window_connect_menu_to_statusbar()</link> | |
41 | now takes a <link linkend="GtkMenuShell">GtkMenuShell</link> parameter | |
42 | instead of <link linkend="AmtkMenuShell">AmtkMenuShell</link>. | |
43 | </para> | |
44 | </listitem> | |
45 | </itemizedlist> | |
46 | </chapter> | |
47 | </part> |
0 | # git.mk, a small Makefile to autogenerate .gitignore files | |
1 | # for autotools-based projects. | |
2 | # | |
3 | # Copyright 2009, Red Hat, Inc. | |
4 | # Copyright 2010,2011,2012,2013 Behdad Esfahbod | |
5 | # Written by Behdad Esfahbod | |
6 | # | |
7 | # Copying and distribution of this file, with or without modification, | |
8 | # is permitted in any medium without royalty provided the copyright | |
9 | # notice and this notice are preserved. | |
10 | # | |
11 | # The latest version of this file can be downloaded from: | |
12 | GIT_MK_URL = https://raw.githubusercontent.com/behdad/git.mk/master/git.mk | |
13 | # | |
14 | # Bugs, etc, should be reported upstream at: | |
15 | # https://github.com/behdad/git.mk | |
16 | # | |
17 | # To use in your project, import this file in your git repo's toplevel, | |
18 | # then do "make -f git.mk". This modifies all Makefile.am files in | |
19 | # your project to -include git.mk. Remember to add that line to new | |
20 | # Makefile.am files you create in your project, or just rerun the | |
21 | # "make -f git.mk". | |
22 | # | |
23 | # This enables automatic .gitignore generation. If you need to ignore | |
24 | # more files, add them to the GITIGNOREFILES variable in your Makefile.am. | |
25 | # But think twice before doing that. If a file has to be in .gitignore, | |
26 | # chances are very high that it's a generated file and should be in one | |
27 | # of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES. | |
28 | # | |
29 | # The only case that you need to manually add a file to GITIGNOREFILES is | |
30 | # when remove files in one of mostlyclean-local, clean-local, distclean-local, | |
31 | # or maintainer-clean-local make targets. | |
32 | # | |
33 | # Note that for files like editor backup, etc, there are better places to | |
34 | # ignore them. See "man gitignore". | |
35 | # | |
36 | # If "make maintainer-clean" removes the files but they are not recognized | |
37 | # by this script (that is, if "git status" shows untracked files still), send | |
38 | # me the output of "git status" as well as your Makefile.am and Makefile for | |
39 | # the directories involved and I'll diagnose. | |
40 | # | |
41 | # For a list of toplevel files that should be in MAINTAINERCLEANFILES, see | |
42 | # Makefile.am.sample in the git.mk git repo. | |
43 | # | |
44 | # Don't EXTRA_DIST this file. It is supposed to only live in git clones, | |
45 | # not tarballs. It serves no useful purpose in tarballs and clutters the | |
46 | # build dir. | |
47 | # | |
48 | # This file knows how to handle autoconf, automake, libtool, gtk-doc, | |
49 | # gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu, appdata, | |
50 | # appstream, hotdoc. | |
51 | # | |
52 | # This makefile provides the following targets: | |
53 | # | |
54 | # - all: "make all" will build all gitignore files. | |
55 | # - gitignore: makes all gitignore files in the current dir and subdirs. | |
56 | # - .gitignore: make gitignore file for the current dir. | |
57 | # - gitignore-recurse: makes all gitignore files in the subdirs. | |
58 | # | |
59 | # KNOWN ISSUES: | |
60 | # | |
61 | # - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the | |
62 | # submodule doesn't find us. If you have configure.{in,ac} files in | |
63 | # subdirs, add a proxy git.mk file in those dirs that simply does: | |
64 | # "include $(top_srcdir)/../git.mk". Add more ..'s to your taste. | |
65 | # And add those files to git. See vte/gnome-pty-helper/git.mk for | |
66 | # example. | |
67 | # | |
68 | ||
69 | ||
70 | ||
71 | ############################################################################### | |
72 | # Variables user modules may want to add to toplevel MAINTAINERCLEANFILES: | |
73 | ############################################################################### | |
74 | ||
75 | # | |
76 | # Most autotools-using modules should be fine including this variable in their | |
77 | # toplevel MAINTAINERCLEANFILES: | |
78 | GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL = \ | |
79 | $(srcdir)/aclocal.m4 \ | |
80 | $(srcdir)/autoscan.log \ | |
81 | $(srcdir)/configure.scan \ | |
82 | `AUX_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_AUX_DIR:$$1' ./configure.ac); \ | |
83 | test "x$$AUX_DIR" = "x$(srcdir)/" && AUX_DIR=$(srcdir); \ | |
84 | for x in \ | |
85 | ar-lib \ | |
86 | compile \ | |
87 | config.guess \ | |
88 | config.rpath \ | |
89 | config.sub \ | |
90 | depcomp \ | |
91 | install-sh \ | |
92 | ltmain.sh \ | |
93 | missing \ | |
94 | mkinstalldirs \ | |
95 | test-driver \ | |
96 | ylwrap \ | |
97 | ; do echo "$$AUX_DIR/$$x"; done` \ | |
98 | `cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_HEADERS:$$1' ./configure.ac | \ | |
99 | head -n 1 | while read f; do echo "$(srcdir)/$$f.in"; done` | |
100 | # | |
101 | # All modules should also be fine including the following variable, which | |
102 | # removes automake-generated Makefile.in files: | |
103 | GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN = \ | |
104 | `cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_FILES:$$1' ./configure.ac | \ | |
105 | while read f; do \ | |
106 | case $$f in Makefile|*/Makefile) \ | |
107 | test -f "$(srcdir)/$$f.am" && echo "$(srcdir)/$$f.in";; esac; \ | |
108 | done` | |
109 | # | |
110 | # Modules that use libtool and use AC_CONFIG_MACRO_DIR() may also include this, | |
111 | # though it's harmless to include regardless. | |
112 | GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL = \ | |
113 | `MACRO_DIR=$(srcdir)/$$(cd $(top_srcdir); $(AUTOCONF) --trace 'AC_CONFIG_MACRO_DIR:$$1' ./configure.ac); \ | |
114 | if test "x$$MACRO_DIR" != "x$(srcdir)/"; then \ | |
115 | for x in \ | |
116 | libtool.m4 \ | |
117 | ltoptions.m4 \ | |
118 | ltsugar.m4 \ | |
119 | ltversion.m4 \ | |
120 | lt~obsolete.m4 \ | |
121 | ; do echo "$$MACRO_DIR/$$x"; done; \ | |
122 | fi` | |
123 | ||
124 | ||
125 | ||
126 | ############################################################################### | |
127 | # Default rule is to install ourselves in all Makefile.am files: | |
128 | ############################################################################### | |
129 | ||
130 | git-all: git-mk-install | |
131 | ||
132 | git-mk-install: | |
133 | @echo "Installing git makefile" | |
134 | @any_failed=; \ | |
135 | find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \ | |
136 | if grep 'include .*/git.mk' $$x >/dev/null; then \ | |
137 | echo "$$x already includes git.mk"; \ | |
138 | else \ | |
139 | failed=; \ | |
140 | echo "Updating $$x"; \ | |
141 | { cat $$x; \ | |
142 | echo ''; \ | |
143 | echo '-include $$(top_srcdir)/git.mk'; \ | |
144 | } > $$x.tmp || failed=1; \ | |
145 | if test x$$failed = x; then \ | |
146 | mv $$x.tmp $$x || failed=1; \ | |
147 | fi; \ | |
148 | if test x$$failed = x; then : else \ | |
149 | echo "Failed updating $$x"; >&2 \ | |
150 | any_failed=1; \ | |
151 | fi; \ | |
152 | fi; done; test -z "$$any_failed" | |
153 | ||
154 | git-mk-update: | |
155 | wget $(GIT_MK_URL) -O $(top_srcdir)/git.mk | |
156 | ||
157 | .PHONY: git-all git-mk-install git-mk-update | |
158 | ||
159 | ||
160 | ||
161 | ############################################################################### | |
162 | # Actual .gitignore generation: | |
163 | ############################################################################### | |
164 | ||
165 | $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk | |
166 | @echo "git.mk: Generating $@" | |
167 | @{ \ | |
168 | if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \ | |
169 | for x in \ | |
170 | $(DOC_MODULE)-decl-list.txt \ | |
171 | $(DOC_MODULE)-decl.txt \ | |
172 | tmpl/$(DOC_MODULE)-unused.sgml \ | |
173 | "tmpl/*.bak" \ | |
174 | $(REPORT_FILES) \ | |
175 | $(DOC_MODULE).pdf \ | |
176 | xml html \ | |
177 | ; do echo "/$$x"; done; \ | |
178 | FLAVOR=$$(cd $(top_srcdir); $(AUTOCONF) --trace 'GTK_DOC_CHECK:$$2' ./configure.ac); \ | |
179 | case $$FLAVOR in *no-tmpl*) echo /tmpl;; esac; \ | |
180 | if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-types"; then \ | |
181 | echo "/$(DOC_MODULE).types"; \ | |
182 | fi; \ | |
183 | if echo "$(SCAN_OPTIONS)" | grep -q "\-\-rebuild-sections"; then \ | |
184 | echo "/$(DOC_MODULE)-sections.txt"; \ | |
185 | fi; \ | |
186 | if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ | |
187 | for x in \ | |
188 | $(SETUP_FILES) \ | |
189 | $(DOC_MODULE).types \ | |
190 | ; do echo "/$$x"; done; \ | |
191 | fi; \ | |
192 | fi; \ | |
193 | if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \ | |
194 | for lc in $(DOC_LINGUAS); do \ | |
195 | for x in \ | |
196 | $(if $(DOC_MODULE),$(DOC_MODULE).xml) \ | |
197 | $(DOC_PAGES) \ | |
198 | $(DOC_INCLUDES) \ | |
199 | ; do echo "/$$lc/$$x"; done; \ | |
200 | done; \ | |
201 | for x in \ | |
202 | $(_DOC_OMF_ALL) \ | |
203 | $(_DOC_DSK_ALL) \ | |
204 | $(_DOC_HTML_ALL) \ | |
205 | $(_DOC_MOFILES) \ | |
206 | $(DOC_H_FILE) \ | |
207 | "*/.xml2po.mo" \ | |
208 | "*/*.omf.out" \ | |
209 | ; do echo /$$x; done; \ | |
210 | fi; \ | |
211 | if test "x$(HOTDOC)" = x; then :; else \ | |
212 | $(foreach project, $(HOTDOC_PROJECTS),echo "/$(call HOTDOC_TARGET,$(project))"; \ | |
213 | echo "/$(shell $(call HOTDOC_PROJECT_COMMAND,$(project)) --get-conf-path output)" ; \ | |
214 | echo "/$(shell $(call HOTDOC_PROJECT_COMMAND,$(project)) --get-private-folder)" ; \ | |
215 | ) \ | |
216 | for x in \ | |
217 | .hotdoc.d \ | |
218 | ; do echo "/$$x"; done; \ | |
219 | fi; \ | |
220 | if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \ | |
221 | for lc in $(HELP_LINGUAS); do \ | |
222 | for x in \ | |
223 | $(HELP_FILES) \ | |
224 | "$$lc.stamp" \ | |
225 | "$$lc.mo" \ | |
226 | ; do echo "/$$lc/$$x"; done; \ | |
227 | done; \ | |
228 | fi; \ | |
229 | if test "x$(gsettings_SCHEMAS)" = x; then :; else \ | |
230 | for x in \ | |
231 | $(gsettings_SCHEMAS:.xml=.valid) \ | |
232 | $(gsettings__enum_file) \ | |
233 | ; do echo "/$$x"; done; \ | |
234 | fi; \ | |
235 | if test "x$(appdata_XML)" = x; then :; else \ | |
236 | for x in \ | |
237 | $(appdata_XML:.xml=.valid) \ | |
238 | ; do echo "/$$x"; done; \ | |
239 | fi; \ | |
240 | if test "x$(appstream_XML)" = x; then :; else \ | |
241 | for x in \ | |
242 | $(appstream_XML:.xml=.valid) \ | |
243 | ; do echo "/$$x"; done; \ | |
244 | fi; \ | |
245 | if test -f $(srcdir)/po/Makefile.in.in; then \ | |
246 | for x in \ | |
247 | ABOUT-NLS \ | |
248 | po/Makefile.in.in \ | |
249 | po/Makefile.in.in~ \ | |
250 | po/Makefile.in \ | |
251 | po/Makefile \ | |
252 | po/Makevars.template \ | |
253 | po/POTFILES \ | |
254 | po/Rules-quot \ | |
255 | po/stamp-it \ | |
256 | po/stamp-po \ | |
257 | po/.intltool-merge-cache \ | |
258 | "po/*.gmo" \ | |
259 | "po/*.header" \ | |
260 | "po/*.mo" \ | |
261 | "po/*.sed" \ | |
262 | "po/*.sin" \ | |
263 | po/$(GETTEXT_PACKAGE).pot \ | |
264 | intltool-extract.in \ | |
265 | intltool-merge.in \ | |
266 | intltool-update.in \ | |
267 | ; do echo "/$$x"; done; \ | |
268 | fi; \ | |
269 | if test -f $(srcdir)/configure; then \ | |
270 | for x in \ | |
271 | autom4te.cache \ | |
272 | configure \ | |
273 | config.h \ | |
274 | stamp-h1 \ | |
275 | libtool \ | |
276 | config.lt \ | |
277 | ; do echo "/$$x"; done; \ | |
278 | fi; \ | |
279 | if test "x$(DEJATOOL)" = x; then :; else \ | |
280 | for x in \ | |
281 | $(DEJATOOL) \ | |
282 | ; do echo "/$$x.sum"; echo "/$$x.log"; done; \ | |
283 | echo /site.exp; \ | |
284 | fi; \ | |
285 | if test "x$(am__dirstamp)" = x; then :; else \ | |
286 | echo "$(am__dirstamp)"; \ | |
287 | fi; \ | |
288 | if test "x$(findstring libtool,$(LTCOMPILE))" = x -a "x$(findstring libtool,$(LTCXXCOMPILE))" = x -a "x$(GTKDOC_RUN)" = x; then :; else \ | |
289 | for x in \ | |
290 | "*.lo" \ | |
291 | ".libs" "_libs" \ | |
292 | ; do echo "$$x"; done; \ | |
293 | fi; \ | |
294 | for x in \ | |
295 | .gitignore \ | |
296 | $(GITIGNOREFILES) \ | |
297 | $(CLEANFILES) \ | |
298 | $(PROGRAMS) $(check_PROGRAMS) $(EXTRA_PROGRAMS) \ | |
299 | $(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \ | |
300 | $(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \ | |
301 | so_locations \ | |
302 | $(MOSTLYCLEANFILES) \ | |
303 | $(TEST_LOGS) \ | |
304 | $(TEST_LOGS:.log=.trs) \ | |
305 | $(TEST_SUITE_LOG) \ | |
306 | $(TESTS:=.test) \ | |
307 | "*.gcda" \ | |
308 | "*.gcno" \ | |
309 | $(DISTCLEANFILES) \ | |
310 | $(am__CONFIG_DISTCLEAN_FILES) \ | |
311 | $(CONFIG_CLEAN_FILES) \ | |
312 | TAGS ID GTAGS GRTAGS GSYMS GPATH tags \ | |
313 | "*.tab.c" \ | |
314 | $(MAINTAINERCLEANFILES) \ | |
315 | $(BUILT_SOURCES) \ | |
316 | $(patsubst %.vala,%.c,$(filter %.vala,$(SOURCES))) \ | |
317 | $(filter %_vala.stamp,$(DIST_COMMON)) \ | |
318 | $(filter %.vapi,$(DIST_COMMON)) \ | |
319 | $(filter $(addprefix %,$(notdir $(patsubst %.vapi,%.h,$(filter %.vapi,$(DIST_COMMON))))),$(DIST_COMMON)) \ | |
320 | Makefile \ | |
321 | Makefile.in \ | |
322 | "*.orig" \ | |
323 | "*.rej" \ | |
324 | "*.bak" \ | |
325 | "*~" \ | |
326 | ".*.sw[nop]" \ | |
327 | ".dirstamp" \ | |
328 | ; do echo "/$$x"; done; \ | |
329 | for x in \ | |
330 | "*.$(OBJEXT)" \ | |
331 | $(DEPDIR) \ | |
332 | ; do echo "$$x"; done; \ | |
333 | } | \ | |
334 | sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \ | |
335 | sed 's@/[.]/@/@g' | \ | |
336 | LC_ALL=C sort | uniq > $@.tmp && \ | |
337 | mv $@.tmp $@; | |
338 | ||
339 | all: $(srcdir)/.gitignore gitignore-recurse-maybe | |
340 | gitignore: $(srcdir)/.gitignore gitignore-recurse | |
341 | ||
342 | gitignore-recurse-maybe: | |
343 | @for subdir in $(DIST_SUBDIRS); do \ | |
344 | case " $(SUBDIRS) " in \ | |
345 | *" $$subdir "*) :;; \ | |
346 | *) test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir");; \ | |
347 | esac; \ | |
348 | done | |
349 | gitignore-recurse: | |
350 | @for subdir in $(DIST_SUBDIRS); do \ | |
351 | test "$$subdir" = . -o -e "$$subdir/.git" || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) gitignore || echo "Skipping $$subdir"); \ | |
352 | done | |
353 | ||
354 | maintainer-clean: gitignore-clean | |
355 | gitignore-clean: | |
356 | -rm -f $(srcdir)/.gitignore | |
357 | ||
358 | .PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe |
0 | *.m4 |
0 | # Set of available languages. | |
1 | # Please keep this list sorted alphabetically. | |
2 | cs | |
3 | da | |
4 | de | |
5 | es | |
6 | fur | |
7 | id | |
8 | hu | |
9 | pl | |
10 | pt_BR | |
11 | ru | |
12 | sr | |
13 | sl | |
14 | sv | |
15 | uk |
0 | # Makefile variables for PO directory in any package using GNU gettext. | |
1 | ||
2 | # Usually the message domain is the same as the package name. | |
3 | DOMAIN = amtk-4 | |
4 | ||
5 | # These two variables depend on the location of this directory. | |
6 | subdir = po | |
7 | top_builddir = .. | |
8 | ||
9 | # These options get passed to xgettext. | |
10 | XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments | |
11 | ||
12 | # This is the copyright holder that gets inserted into the header of the | |
13 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding | |
14 | # package. (Note that the msgstr strings, extracted from the package's | |
15 | # sources, belong to the copyright holder of the package.) Translators are | |
16 | # expected to transfer the copyright for their translations to this person | |
17 | # or entity, or to disclaim their copyright. The empty string stands for | |
18 | # the public domain; in this case the translators are expected to disclaim | |
19 | # their copyright. | |
20 | COPYRIGHT_HOLDER = The Amtk team | |
21 | ||
22 | # This tells whether or not to prepend "GNU " prefix to the package | |
23 | # name that gets inserted into the header of the $(DOMAIN).pot file. | |
24 | # Possible values are "yes", "no", or empty. If it is empty, try to | |
25 | # detect it automatically by scanning the files in $(top_srcdir) for | |
26 | # "GNU packagename" string. | |
27 | PACKAGE_GNU = no | |
28 | ||
29 | # This is the email address or URL to which the translators shall report | |
30 | # bugs in the untranslated strings: | |
31 | # - Strings which are not entire sentences, see the maintainer guidelines | |
32 | # in the GNU gettext documentation, section 'Preparing Strings'. | |
33 | # - Strings which use unclear terms or require additional context to be | |
34 | # understood. | |
35 | # - Strings which make invalid assumptions about notation of date, time or | |
36 | # money. | |
37 | # - Pluralisation problems. | |
38 | # - Incorrect English spelling. | |
39 | # - Incorrect formatting. | |
40 | # It can be your email address, or a mailing list address where translators | |
41 | # can write to without being subscribed, or the URL of a web page through | |
42 | # which the translators can contact you. | |
43 | MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT) | |
44 | ||
45 | # This is the list of locale categories, beyond LC_MESSAGES, for which the | |
46 | # message catalogs shall be used. It is usually empty. | |
47 | EXTRA_LOCALE_CATEGORIES = | |
48 | ||
49 | # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' | |
50 | # context. Possible values are "yes" and "no". Set this to yes if the | |
51 | # package uses functions taking also a message context, like pgettext(), or | |
52 | # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. | |
53 | USE_MSGCTXT = yes | |
54 | ||
55 | # These options get passed to msgmerge. | |
56 | # Useful options are in particular: | |
57 | # --previous to keep previous msgids of translated messages, | |
58 | # --quiet to reduce the verbosity. | |
59 | MSGMERGE_OPTIONS = --quiet | |
60 | ||
61 | # These options get passed to msginit. | |
62 | # If you want to disable line wrapping when writing PO files, add | |
63 | # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and | |
64 | # MSGINIT_OPTIONS. | |
65 | MSGINIT_OPTIONS = | |
66 | ||
67 | # This tells whether or not to regenerate a PO file when $(DOMAIN).pot | |
68 | # has changed. Possible values are "yes" and "no". Set this to no if | |
69 | # the POT file is checked in the repository and the version control | |
70 | # program ignores timestamps. | |
71 | PO_DEPENDS_ON_POT = no | |
72 | ||
73 | # This tells whether or not to forcibly update $(DOMAIN).pot and | |
74 | # regenerate PO files on "make dist". Possible values are "yes" and | |
75 | # "no". Set this to no if the POT file and PO files are maintained | |
76 | # externally. | |
77 | DIST_DEPENDS_ON_UPDATE_PO = yes |
0 | # List of source files containing translatable strings. | |
1 | amtk/amtk-action-info.c | |
2 | amtk/amtk-action-info-central-store.c | |
3 | amtk/amtk-action-info-store.c | |
4 | amtk/amtk-action-map.c | |
5 | amtk/amtk-application-window.c | |
6 | amtk/amtk-factory.c | |
7 | amtk/amtk-init.c | |
8 | amtk/amtk-menu-item.c | |
9 | amtk/amtk-menu-shell.c | |
10 | amtk/amtk-utils.c |
0 | # Czech translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Marek Černocký <marek@manet.cz>, 2017, 2018. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
9 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
10 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
11 | "PO-Revision-Date: 2018-02-07 08:02+0100\n" | |
12 | "Last-Translator: Marek Černocký <marek@manet.cz>\n" | |
13 | "Language-Team: čeština <gnome-cs-list@gnome.org>\n" | |
14 | "Language: cs\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" | |
19 | "X-Generator: Gtranslator 2.91.7\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Otevřít „%s“" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Otevřít ne_dávné" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Otevřít soubor nedávno použitý aplikací %s" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "_Nový" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Nový soubor" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "No_vé okno" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Vytvořit nové okno" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "_Otevřít" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | msgid "Open a file" | |
66 | msgstr "Otevřít soubor" | |
67 | ||
68 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
69 | #: tepl/tepl-tab.c:752 | |
70 | msgid "_Save" | |
71 | msgstr "_Uložit" | |
72 | ||
73 | #: tepl/tepl-application.c:102 | |
74 | msgid "Save the current file" | |
75 | msgstr "Uložit aktuální soubor" | |
76 | ||
77 | #: tepl/tepl-application.c:104 | |
78 | msgid "Save _As" | |
79 | msgstr "Uložit j_ako" | |
80 | ||
81 | #: tepl/tepl-application.c:105 | |
82 | msgid "Save the current file to a different location" | |
83 | msgstr "Uložit aktuální soubor na jiné místo" | |
84 | ||
85 | #. Edit menu | |
86 | #: tepl/tepl-application.c:109 | |
87 | msgid "_Undo" | |
88 | msgstr "_Zpět" | |
89 | ||
90 | #: tepl/tepl-application.c:110 | |
91 | msgid "Undo the last action" | |
92 | msgstr "Vrátit zpět poslední úkon" | |
93 | ||
94 | #: tepl/tepl-application.c:112 | |
95 | msgid "_Redo" | |
96 | msgstr "Zno_vu" | |
97 | ||
98 | #: tepl/tepl-application.c:113 | |
99 | msgid "Redo the last undone action" | |
100 | msgstr "Znovu provást poslední vrácený úkon" | |
101 | ||
102 | #: tepl/tepl-application.c:115 | |
103 | msgid "Cu_t" | |
104 | msgstr "_Vyjmout" | |
105 | ||
106 | #: tepl/tepl-application.c:116 | |
107 | msgid "Cut the selection" | |
108 | msgstr "Vyjmout výběr" | |
109 | ||
110 | #: tepl/tepl-application.c:118 | |
111 | msgid "_Copy" | |
112 | msgstr "_Kopírovat" | |
113 | ||
114 | #: tepl/tepl-application.c:119 | |
115 | msgid "Copy the selection" | |
116 | msgstr "Kopírovat výběr" | |
117 | ||
118 | #: tepl/tepl-application.c:121 | |
119 | msgid "_Paste" | |
120 | msgstr "V_ložit" | |
121 | ||
122 | #: tepl/tepl-application.c:122 | |
123 | msgid "Paste the clipboard" | |
124 | msgstr "Vložit obsah schránky" | |
125 | ||
126 | #: tepl/tepl-application.c:124 | |
127 | msgid "_Delete" | |
128 | msgstr "_Smazat" | |
129 | ||
130 | #: tepl/tepl-application.c:125 | |
131 | msgid "Delete the selected text" | |
132 | msgstr "Smazat vybraný text" | |
133 | ||
134 | #: tepl/tepl-application.c:127 | |
135 | msgid "Select _All" | |
136 | msgstr "Vybr_at vše" | |
137 | ||
138 | #: tepl/tepl-application.c:128 | |
139 | msgid "Select all the text" | |
140 | msgstr "Vybrat všechen text" | |
141 | ||
142 | #: tepl/tepl-application.c:130 | |
143 | msgid "_Indent" | |
144 | msgstr "Odsad_it" | |
145 | ||
146 | #: tepl/tepl-application.c:131 | |
147 | msgid "Indent the selected lines" | |
148 | msgstr "Odsadit vybrané řádky" | |
149 | ||
150 | #: tepl/tepl-application.c:133 | |
151 | msgid "_Unindent" | |
152 | msgstr "Zr_ušit odsazení" | |
153 | ||
154 | #: tepl/tepl-application.c:134 | |
155 | msgid "Unindent the selected lines" | |
156 | msgstr "Zrušit odsazení vybraných řádků" | |
157 | ||
158 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
159 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
160 | #. * doesn't have the real path to the file, so it would screw up some | |
161 | #. * features for text editors: | |
162 | #. * - showing the directory in parentheses in the window title, or in the | |
163 | #. * tab tooltip; | |
164 | #. * - opening a recent file. | |
165 | #. * Basically everywhere where the directory is shown. | |
166 | #. | |
167 | #: tepl/tepl-application-window.c:174 | |
168 | msgid "Open File" | |
169 | msgstr "Otevření souboru" | |
170 | ||
171 | #: tepl/tepl-application-window.c:177 | |
172 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
173 | msgid "_Cancel" | |
174 | msgstr "_Zrušit" | |
175 | ||
176 | #: tepl/tepl-application-window.c:708 | |
177 | msgid "Read-Only" | |
178 | msgstr "Jen ke čtení" | |
179 | ||
180 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
181 | #, c-format | |
182 | msgid "Save changes to file “%s” before closing?" | |
183 | msgstr "Uložit před zavřením změny do souboru „%s“?" | |
184 | ||
185 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
186 | msgid "Close _without Saving" | |
187 | msgstr "Zavřít _bez uložení" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
190 | msgid "_Save As…" | |
191 | msgstr "Uložit j_ako…" | |
192 | ||
193 | #. UTF-8 first, so that it's the first encoding returned by | |
194 | #. * tepl_encoding_get_all(). | |
195 | #. | |
196 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
197 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
198 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
199 | msgid "Unicode" | |
200 | msgstr "Unikód" | |
201 | ||
202 | #. FIXME GEOSTD8 ? | |
203 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
204 | #: tepl/tepl-encoding.c:180 | |
205 | msgid "Western" | |
206 | msgstr "Západoevropské" | |
207 | ||
208 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
209 | msgid "Central European" | |
210 | msgstr "Středoevropské" | |
211 | ||
212 | #: tepl/tepl-encoding.c:119 | |
213 | msgid "South European" | |
214 | msgstr "Jihoevropské" | |
215 | ||
216 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
217 | msgid "Baltic" | |
218 | msgstr "Baltické" | |
219 | ||
220 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
221 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
222 | msgid "Cyrillic" | |
223 | msgstr "Azbuka" | |
224 | ||
225 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
226 | msgid "Arabic" | |
227 | msgstr "Arabské" | |
228 | ||
229 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
230 | msgid "Greek" | |
231 | msgstr "Řecké" | |
232 | ||
233 | #: tepl/tepl-encoding.c:124 | |
234 | msgid "Hebrew Visual" | |
235 | msgstr "Hebrejské vizuální" | |
236 | ||
237 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
238 | msgid "Turkish" | |
239 | msgstr "Turecké" | |
240 | ||
241 | #: tepl/tepl-encoding.c:126 | |
242 | msgid "Nordic" | |
243 | msgstr "Skandinávské" | |
244 | ||
245 | #: tepl/tepl-encoding.c:128 | |
246 | msgid "Celtic" | |
247 | msgstr "Keltské" | |
248 | ||
249 | #: tepl/tepl-encoding.c:130 | |
250 | msgid "Romanian" | |
251 | msgstr "Rumunské" | |
252 | ||
253 | #: tepl/tepl-encoding.c:140 | |
254 | msgid "Armenian" | |
255 | msgstr "Armenské" | |
256 | ||
257 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
258 | msgid "Chinese Traditional" | |
259 | msgstr "Čínské tradiční" | |
260 | ||
261 | #: tepl/tepl-encoding.c:143 | |
262 | msgid "Cyrillic/Russian" | |
263 | msgstr "Azbuka ruská" | |
264 | ||
265 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
266 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
267 | msgid "Japanese" | |
268 | msgstr "Japonské" | |
269 | ||
270 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
271 | #: tepl/tepl-encoding.c:175 | |
272 | msgid "Korean" | |
273 | msgstr "Korejské" | |
274 | ||
275 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
276 | msgid "Chinese Simplified" | |
277 | msgstr "Čínské zjednodušené" | |
278 | ||
279 | #: tepl/tepl-encoding.c:155 | |
280 | msgid "Georgian" | |
281 | msgstr "Gruzínské" | |
282 | ||
283 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
284 | msgid "Hebrew" | |
285 | msgstr "Hebrejské" | |
286 | ||
287 | #: tepl/tepl-encoding.c:170 | |
288 | msgid "Cyrillic/Ukrainian" | |
289 | msgstr "Azbuka ukrajinská" | |
290 | ||
291 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
292 | msgid "Vietnamese" | |
293 | msgstr "Vietnamské" | |
294 | ||
295 | #: tepl/tepl-encoding.c:174 | |
296 | msgid "Thai" | |
297 | msgstr "Thajské" | |
298 | ||
299 | #: tepl/tepl-encoding.c:370 | |
300 | msgid "Unknown" | |
301 | msgstr "Neznámé" | |
302 | ||
303 | #. Translators: This is the sorted list of encodings used by Tepl for | |
304 | #. * automatic detection of the file encoding. You may want to customize | |
305 | #. * it adding encodings that are common in your country, for instance the | |
306 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
307 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
308 | #. * European languages) if you think people in your country will rarely | |
309 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
310 | #. * the encoding for the current locale, so please don't translate the | |
311 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
312 | #. * commas. | |
313 | #. | |
314 | #: tepl/tepl-encoding.c:695 | |
315 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
316 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-2', 'WINDOWS-1250', 'UTF-16']" | |
317 | ||
318 | #: tepl/tepl-encoding-converter.c:302 | |
319 | #, c-format | |
320 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
321 | msgstr "Převod ze znakové sady „%s“ do „%s“ není podporován." | |
322 | ||
323 | #: tepl/tepl-encoding-converter.c:311 | |
324 | #, c-format | |
325 | msgid "Could not open converter from “%s” to “%s”: %s" | |
326 | msgstr "Nelze otevřít převodník z „%s“ do „%s“: %s" | |
327 | ||
328 | #: tepl/tepl-encoding-converter.c:368 | |
329 | msgid "The input data contains an invalid sequence." | |
330 | msgstr "Vstupní data obsahují neplatnou posloupnost." | |
331 | ||
332 | #: tepl/tepl-encoding-converter.c:377 | |
333 | #, c-format | |
334 | msgid "Error when converting data: %s" | |
335 | msgstr "Chyba při převodu dat: %s" | |
336 | ||
337 | #: tepl/tepl-encoding-converter.c:556 | |
338 | msgid "The input data ends with an incomplete multi-byte sequence." | |
339 | msgstr "Vstupní data končí neúplnou víceznakovou posloupností." | |
340 | ||
341 | #: tepl/tepl-encoding-converter.c:579 | |
342 | msgid "The input content ends with incomplete data." | |
343 | msgstr "Obsah vstupu končí neúplnými daty." | |
344 | ||
345 | #: tepl/tepl-file.c:413 | |
346 | #, c-format | |
347 | msgid "Untitled File %d" | |
348 | msgstr "Nepojmenovaný soubor %d" | |
349 | ||
350 | #: tepl/tepl-file-content-loader.c:331 | |
351 | #, c-format | |
352 | msgid "The file is too big. Maximum %s can be loaded." | |
353 | msgstr "Soubor je příliš velký. Načteno může být nanejvýše %s." | |
354 | ||
355 | #: tepl/tepl-file-loader.c:872 | |
356 | msgid "It is not possible to detect the character encoding automatically." | |
357 | msgstr "Není možné automaticky zjistit kódování znaků." | |
358 | ||
359 | #: tepl/tepl-file-saver.c:784 | |
360 | msgid "The file is externally modified." | |
361 | msgstr "Soubor byl externě změněn." | |
362 | ||
363 | #: tepl/tepl-file-saver.c:1318 | |
364 | msgid "The buffer contains invalid characters." | |
365 | msgstr "Vyrovnávací paměť obsahuje neplatné znaky." | |
366 | ||
367 | #: tepl/tepl-tab.c:534 | |
368 | msgid "Error when loading the file." | |
369 | msgstr "Chyba při načítání souboru." | |
370 | ||
371 | #: tepl/tepl-tab.c:748 | |
372 | msgid "Save File" | |
373 | msgstr "Uložení souboru" | |
374 | ||
375 | #. Translators: location of a file. | |
376 | #: tepl/tepl-tab-label.c:273 | |
377 | msgid "Location:" | |
378 | msgstr "Umístění:" | |
379 | ||
380 | #: tepl/tepl-tab-label.c:342 | |
381 | msgid "Close file" | |
382 | msgstr "Zavřít soubor" | |
383 | ||
384 | #: tepl/tepl-tab-saving.c:64 | |
385 | msgid "Error when saving the file." | |
386 | msgstr "Chyba při ukládání souboru." |
0 | # Danish translation of tepl. | |
1 | # Copyright (C) 2018 Free Software Foundation, Inc. | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Joe Hansen <joedalton2@yahoo.dk>, 2018. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl\n" | |
8 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
9 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
10 | "POT-Creation-Date: 2018-02-07 07:03+0000\n" | |
11 | "PO-Revision-Date: 2018-02-24 02:00+0200\n" | |
12 | "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" | |
13 | "Language-Team: Danish <dansk@dansk-gruppen.dk>\n" | |
14 | "Language: da\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | ||
19 | #. Translators: %s is a filename. | |
20 | #: amtk/amtk-application-window.c:374 | |
21 | #, c-format | |
22 | msgid "Open “%s”" | |
23 | msgstr "Åbn “%s”" | |
24 | ||
25 | #: amtk/amtk-application-window.c:630 | |
26 | msgid "Open _Recent" | |
27 | msgstr "Åbn _seneste" | |
28 | ||
29 | #. Translators: %s is the application name. | |
30 | #: amtk/amtk-application-window.c:633 | |
31 | #, c-format | |
32 | msgid "Open a file recently used with %s" | |
33 | msgstr "Åbn en fil brugt for nylig med %s" | |
34 | ||
35 | #. action, icon, label, accel, tooltip | |
36 | #. File menu | |
37 | #. Why "file" and not "document"? "Document" is not the best | |
38 | #. word because the action is not always to create a new | |
39 | #. document. For example a LaTeX document can be composed of | |
40 | #. several _files_. Or for source code we do not really create a | |
41 | #. new "document". | |
42 | #: tepl/tepl-application.c:92 | |
43 | msgid "_New" | |
44 | msgstr "_Ny" | |
45 | ||
46 | #: tepl/tepl-application.c:93 | |
47 | msgid "New file" | |
48 | msgstr "Ny fil" | |
49 | ||
50 | #: tepl/tepl-application.c:95 | |
51 | msgid "New _Window" | |
52 | msgstr "Nyt _vindue" | |
53 | ||
54 | #: tepl/tepl-application.c:96 | |
55 | msgid "Create a new window" | |
56 | msgstr "Opret et nyt vindue" | |
57 | ||
58 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
59 | msgid "_Open" | |
60 | msgstr "_Åbn" | |
61 | ||
62 | #: tepl/tepl-application.c:99 | |
63 | msgid "Open a file" | |
64 | msgstr "Åbn en fil" | |
65 | ||
66 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
67 | #: tepl/tepl-tab.c:752 | |
68 | msgid "_Save" | |
69 | msgstr "_Gem" | |
70 | ||
71 | #: tepl/tepl-application.c:102 | |
72 | msgid "Save the current file" | |
73 | msgstr "Gem den nuværende fil" | |
74 | ||
75 | #: tepl/tepl-application.c:104 | |
76 | msgid "Save _As" | |
77 | msgstr "Gem _som" | |
78 | ||
79 | #: tepl/tepl-application.c:105 | |
80 | msgid "Save the current file to a different location" | |
81 | msgstr "Gem den nuværende fil til en anden placering" | |
82 | ||
83 | #. Edit menu | |
84 | #: tepl/tepl-application.c:109 | |
85 | msgid "_Undo" | |
86 | msgstr "_Genskab" | |
87 | ||
88 | #: tepl/tepl-application.c:110 | |
89 | msgid "Undo the last action" | |
90 | msgstr "Genskab den sidste handling" | |
91 | ||
92 | #: tepl/tepl-application.c:112 | |
93 | msgid "_Redo" | |
94 | msgstr "_Omgør" | |
95 | ||
96 | #: tepl/tepl-application.c:113 | |
97 | msgid "Redo the last undone action" | |
98 | msgstr "Omgør den sidste genskab-handling" | |
99 | ||
100 | #: tepl/tepl-application.c:115 | |
101 | msgid "Cu_t" | |
102 | msgstr "K_lip" | |
103 | ||
104 | #: tepl/tepl-application.c:116 | |
105 | msgid "Cut the selection" | |
106 | msgstr "Klip markeringen" | |
107 | ||
108 | #: tepl/tepl-application.c:118 | |
109 | msgid "_Copy" | |
110 | msgstr "_Kopier" | |
111 | ||
112 | #: tepl/tepl-application.c:119 | |
113 | msgid "Copy the selection" | |
114 | msgstr "Kopier markeringen" | |
115 | ||
116 | #: tepl/tepl-application.c:121 | |
117 | msgid "_Paste" | |
118 | msgstr "_Indsæt" | |
119 | ||
120 | #: tepl/tepl-application.c:122 | |
121 | msgid "Paste the clipboard" | |
122 | msgstr "Indsæt udklipsholderen" | |
123 | ||
124 | #: tepl/tepl-application.c:124 | |
125 | msgid "_Delete" | |
126 | msgstr "_Slet" | |
127 | ||
128 | #: tepl/tepl-application.c:125 | |
129 | msgid "Delete the selected text" | |
130 | msgstr "Slet den markerede tekst" | |
131 | ||
132 | #: tepl/tepl-application.c:127 | |
133 | msgid "Select _All" | |
134 | msgstr "Vælg _alt" | |
135 | ||
136 | #: tepl/tepl-application.c:128 | |
137 | msgid "Select all the text" | |
138 | msgstr "Vælg al teksten" | |
139 | ||
140 | #: tepl/tepl-application.c:130 | |
141 | msgid "_Indent" | |
142 | msgstr "Indr_yk" | |
143 | ||
144 | #: tepl/tepl-application.c:131 | |
145 | msgid "Indent the selected lines" | |
146 | msgstr "Indryk de markerede linjer" | |
147 | ||
148 | #: tepl/tepl-application.c:133 | |
149 | msgid "_Unindent" | |
150 | msgstr "_Fjern indryk" | |
151 | ||
152 | #: tepl/tepl-application.c:134 | |
153 | msgid "Unindent the selected lines" | |
154 | msgstr "Fjern indrykning af de valge linjer" | |
155 | ||
156 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
157 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
158 | #. * doesn't have the real path to the file, so it would screw up some | |
159 | #. * features for text editors: | |
160 | #. * - showing the directory in parentheses in the window title, or in the | |
161 | #. * tab tooltip; | |
162 | #. * - opening a recent file. | |
163 | #. * Basically everywhere where the directory is shown. | |
164 | #. | |
165 | #: tepl/tepl-application-window.c:174 | |
166 | msgid "Open File" | |
167 | msgstr "Åbn fil" | |
168 | ||
169 | #: tepl/tepl-application-window.c:177 | |
170 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
171 | msgid "_Cancel" | |
172 | msgstr "_Annullér" | |
173 | ||
174 | #: tepl/tepl-application-window.c:708 | |
175 | msgid "Read-Only" | |
176 | msgstr "Skrivebeskyttet" | |
177 | ||
178 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
179 | #, c-format | |
180 | msgid "Save changes to file “%s” before closing?" | |
181 | msgstr "Gem ændringer til filen “%s” før lukning?" | |
182 | ||
183 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
184 | msgid "Close _without Saving" | |
185 | msgstr "Luk _uden at gemme" | |
186 | ||
187 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
188 | msgid "_Save As…" | |
189 | msgstr "_Gem som …" | |
190 | ||
191 | #. UTF-8 first, so that it's the first encoding returned by | |
192 | #. * tepl_encoding_get_all(). | |
193 | #. | |
194 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
195 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
196 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
197 | msgid "Unicode" | |
198 | msgstr "Unicode" | |
199 | ||
200 | #. FIXME GEOSTD8 ? | |
201 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
202 | #: tepl/tepl-encoding.c:180 | |
203 | msgid "Western" | |
204 | msgstr "Vestlig" | |
205 | ||
206 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
207 | msgid "Central European" | |
208 | msgstr "Centraleuropæisk" | |
209 | ||
210 | #: tepl/tepl-encoding.c:119 | |
211 | msgid "South European" | |
212 | msgstr "Sydeuropæisk" | |
213 | ||
214 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
215 | msgid "Baltic" | |
216 | msgstr "Baltisk" | |
217 | ||
218 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
219 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
220 | msgid "Cyrillic" | |
221 | msgstr "Kyrillisk" | |
222 | ||
223 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
224 | msgid "Arabic" | |
225 | msgstr "Arabisk" | |
226 | ||
227 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
228 | msgid "Greek" | |
229 | msgstr "Græsk" | |
230 | ||
231 | #: tepl/tepl-encoding.c:124 | |
232 | msgid "Hebrew Visual" | |
233 | msgstr "Hebraisk visuelt" | |
234 | ||
235 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
236 | msgid "Turkish" | |
237 | msgstr "Tyrkisk" | |
238 | ||
239 | #: tepl/tepl-encoding.c:126 | |
240 | msgid "Nordic" | |
241 | msgstr "Nordisk" | |
242 | ||
243 | #: tepl/tepl-encoding.c:128 | |
244 | msgid "Celtic" | |
245 | msgstr "Keltisk" | |
246 | ||
247 | #: tepl/tepl-encoding.c:130 | |
248 | msgid "Romanian" | |
249 | msgstr "Rumænsk" | |
250 | ||
251 | #: tepl/tepl-encoding.c:140 | |
252 | msgid "Armenian" | |
253 | msgstr "Armensk" | |
254 | ||
255 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
256 | msgid "Chinese Traditional" | |
257 | msgstr "Kinesisk traditionelt" | |
258 | ||
259 | #: tepl/tepl-encoding.c:143 | |
260 | msgid "Cyrillic/Russian" | |
261 | msgstr "Kyrillisk/russisk" | |
262 | ||
263 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
264 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
265 | msgid "Japanese" | |
266 | msgstr "Japansk" | |
267 | ||
268 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
269 | #: tepl/tepl-encoding.c:175 | |
270 | msgid "Korean" | |
271 | msgstr "Koreansk" | |
272 | ||
273 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
274 | msgid "Chinese Simplified" | |
275 | msgstr "Kinesisk forenklet" | |
276 | ||
277 | #: tepl/tepl-encoding.c:155 | |
278 | msgid "Georgian" | |
279 | msgstr "Georgisk" | |
280 | ||
281 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
282 | msgid "Hebrew" | |
283 | msgstr "Hebraisk" | |
284 | ||
285 | #: tepl/tepl-encoding.c:170 | |
286 | msgid "Cyrillic/Ukrainian" | |
287 | msgstr "Kyrillisk/ukrainsk" | |
288 | ||
289 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
290 | msgid "Vietnamese" | |
291 | msgstr "Vietnamesisk" | |
292 | ||
293 | #: tepl/tepl-encoding.c:174 | |
294 | msgid "Thai" | |
295 | msgstr "Thai" | |
296 | ||
297 | #: tepl/tepl-encoding.c:370 | |
298 | msgid "Unknown" | |
299 | msgstr "Ukendt" | |
300 | ||
301 | #. Translators: This is the sorted list of encodings used by Tepl for | |
302 | #. * automatic detection of the file encoding. You may want to customize | |
303 | #. * it adding encodings that are common in your country, for instance the | |
304 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
305 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
306 | #. * European languages) if you think people in your country will rarely | |
307 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
308 | #. * the encoding for the current locale, so please don't translate the | |
309 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
310 | #. * commas. | |
311 | #. | |
312 | #: tepl/tepl-encoding.c:695 | |
313 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
314 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
315 | ||
316 | #: tepl/tepl-encoding-converter.c:302 | |
317 | #, c-format | |
318 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
319 | msgstr "Konvertering fra tegnsættet “%s” til “%s” er ikke understøttet." | |
320 | ||
321 | #: tepl/tepl-encoding-converter.c:311 | |
322 | #, c-format | |
323 | msgid "Could not open converter from “%s” to “%s”: %s" | |
324 | msgstr "Kunne ikke åbne konverteringsprogram fra “%s” til “%s”: %s" | |
325 | ||
326 | #: tepl/tepl-encoding-converter.c:368 | |
327 | msgid "The input data contains an invalid sequence." | |
328 | msgstr "Inddataene indeholder en ugyldig sekvens." | |
329 | ||
330 | #: tepl/tepl-encoding-converter.c:377 | |
331 | #, c-format | |
332 | msgid "Error when converting data: %s" | |
333 | msgstr "Der opstod en fejl under konvertering af data: %s" | |
334 | ||
335 | #: tepl/tepl-encoding-converter.c:556 | |
336 | msgid "The input data ends with an incomplete multi-byte sequence." | |
337 | msgstr "Inddataene ender med en ufuldstændig multi-byte-sekvens." | |
338 | ||
339 | #: tepl/tepl-encoding-converter.c:579 | |
340 | msgid "The input content ends with incomplete data." | |
341 | msgstr "Inddataindholdet ender med ufuldstændige data." | |
342 | ||
343 | #: tepl/tepl-file.c:413 | |
344 | #, c-format | |
345 | msgid "Untitled File %d" | |
346 | msgstr "Filen %d er uden titel" | |
347 | ||
348 | #: tepl/tepl-file-content-loader.c:331 | |
349 | #, c-format | |
350 | msgid "The file is too big. Maximum %s can be loaded." | |
351 | msgstr "Filen er for stor. Maksimalt %s kan indlæses." | |
352 | ||
353 | #: tepl/tepl-file-loader.c:872 | |
354 | msgid "It is not possible to detect the character encoding automatically." | |
355 | msgstr "Det er ikke muligt at udlede tegnkodningen automatisk." | |
356 | ||
357 | #: tepl/tepl-file-saver.c:784 | |
358 | msgid "The file is externally modified." | |
359 | msgstr "Filen bliver ændret eksternt." | |
360 | ||
361 | #: tepl/tepl-file-saver.c:1318 | |
362 | msgid "The buffer contains invalid characters." | |
363 | msgstr "Mellemlageret indeholder ugyldige tegn." | |
364 | ||
365 | #: tepl/tepl-tab.c:534 | |
366 | msgid "Error when loading the file." | |
367 | msgstr "Fejl under indlæsning af filen." | |
368 | ||
369 | #: tepl/tepl-tab.c:748 | |
370 | msgid "Save File" | |
371 | msgstr "Gem fil" | |
372 | ||
373 | #. Translators: location of a file. | |
374 | #: tepl/tepl-tab-label.c:273 | |
375 | msgid "Location:" | |
376 | msgstr "Placering:" | |
377 | ||
378 | #: tepl/tepl-tab-label.c:342 | |
379 | msgid "Close file" | |
380 | msgstr "Luk fil" | |
381 | ||
382 | #: tepl/tepl-tab-saving.c:64 | |
383 | msgid "Error when saving the file." | |
384 | msgstr "Der opstod en fejl, da filen blev gemt." |
0 | # German translation for tepl. | |
1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Christian Kirbach <christian.kirbach@gmail.com>, 2017. | |
4 | # Mario Blättermann <mario.blaettermann@gmail.com>, 2017. | |
5 | # Tim Sabsch <tim@sabsch.com>, 2018. | |
6 | # | |
7 | msgid "" | |
8 | msgstr "" | |
9 | "Project-Id-Version: tepl master\n" | |
10 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
11 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
12 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
13 | "PO-Revision-Date: 2018-02-27 17:06+0100\n" | |
14 | "Last-Translator: Tim Sabsch <tim@sabsch.com>\n" | |
15 | "Language-Team: German <gnome-de@gnome.org>\n" | |
16 | "Language: de\n" | |
17 | "MIME-Version: 1.0\n" | |
18 | "Content-Type: text/plain; charset=UTF-8\n" | |
19 | "Content-Transfer-Encoding: 8bit\n" | |
20 | "X-Generator: Poedit 2.0.6\n" | |
21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
22 | ||
23 | #. Translators: %s is a filename. | |
24 | #: amtk/amtk-application-window.c:374 | |
25 | #, c-format | |
26 | msgid "Open “%s”" | |
27 | msgstr "»%s« öffnen" | |
28 | ||
29 | #: amtk/amtk-application-window.c:630 | |
30 | msgid "Open _Recent" | |
31 | msgstr "Zu_letzt geöffnet" | |
32 | ||
33 | #. Translators: %s is the application name. | |
34 | #: amtk/amtk-application-window.c:633 | |
35 | #, c-format | |
36 | msgid "Open a file recently used with %s" | |
37 | msgstr "Eine kürzlich von »%s« verwendete Datei öffnen" | |
38 | ||
39 | #. action, icon, label, accel, tooltip | |
40 | #. File menu | |
41 | #. Why "file" and not "document"? "Document" is not the best | |
42 | #. word because the action is not always to create a new | |
43 | #. document. For example a LaTeX document can be composed of | |
44 | #. several _files_. Or for source code we do not really create a | |
45 | #. new "document". | |
46 | #: tepl/tepl-application.c:92 | |
47 | msgid "_New" | |
48 | msgstr "_Neu" | |
49 | ||
50 | #: tepl/tepl-application.c:93 | |
51 | msgid "New file" | |
52 | msgstr "Neue Datei" | |
53 | ||
54 | #: tepl/tepl-application.c:95 | |
55 | msgid "New _Window" | |
56 | msgstr "Neues _Fenster" | |
57 | ||
58 | #: tepl/tepl-application.c:96 | |
59 | msgid "Create a new window" | |
60 | msgstr "Ein neues Fenster öffnen" | |
61 | ||
62 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
63 | msgid "_Open" | |
64 | msgstr "Ö_ffnen" | |
65 | ||
66 | #: tepl/tepl-application.c:99 | |
67 | msgid "Open a file" | |
68 | msgstr "Eine Datei öffnen" | |
69 | ||
70 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
71 | #: tepl/tepl-tab.c:752 | |
72 | msgid "_Save" | |
73 | msgstr "_Speichern" | |
74 | ||
75 | #: tepl/tepl-application.c:102 | |
76 | msgid "Save the current file" | |
77 | msgstr "Aktuelle Datei speichern" | |
78 | ||
79 | #: tepl/tepl-application.c:104 | |
80 | msgid "Save _As" | |
81 | msgstr "Speichern _unter" | |
82 | ||
83 | #: tepl/tepl-application.c:105 | |
84 | msgid "Save the current file to a different location" | |
85 | msgstr "Datei an einem anderen Ort speichern" | |
86 | ||
87 | #. Edit menu | |
88 | #: tepl/tepl-application.c:109 | |
89 | msgid "_Undo" | |
90 | msgstr "_Rückgängig" | |
91 | ||
92 | #: tepl/tepl-application.c:110 | |
93 | msgid "Undo the last action" | |
94 | msgstr "Letzte Aktion rückgängig machen" | |
95 | ||
96 | #: tepl/tepl-application.c:112 | |
97 | msgid "_Redo" | |
98 | msgstr "_Wiederholen" | |
99 | ||
100 | #: tepl/tepl-application.c:113 | |
101 | msgid "Redo the last undone action" | |
102 | msgstr "Die letzte zurückgenommene Aktion wiederholen" | |
103 | ||
104 | #: tepl/tepl-application.c:115 | |
105 | msgid "Cu_t" | |
106 | msgstr "_Ausschneiden" | |
107 | ||
108 | #: tepl/tepl-application.c:116 | |
109 | msgid "Cut the selection" | |
110 | msgstr "Die Auswahl ausschneiden" | |
111 | ||
112 | #: tepl/tepl-application.c:118 | |
113 | msgid "_Copy" | |
114 | msgstr "_Kopieren" | |
115 | ||
116 | #: tepl/tepl-application.c:119 | |
117 | msgid "Copy the selection" | |
118 | msgstr "Die Auswahl kopieren" | |
119 | ||
120 | #: tepl/tepl-application.c:121 | |
121 | msgid "_Paste" | |
122 | msgstr "_Einfügen" | |
123 | ||
124 | #: tepl/tepl-application.c:122 | |
125 | msgid "Paste the clipboard" | |
126 | msgstr "Den Inhalt der Zwischenablage einfügen" | |
127 | ||
128 | #: tepl/tepl-application.c:124 | |
129 | msgid "_Delete" | |
130 | msgstr "_Löschen" | |
131 | ||
132 | #: tepl/tepl-application.c:125 | |
133 | msgid "Delete the selected text" | |
134 | msgstr "Ausgewählten Text löschen" | |
135 | ||
136 | #: tepl/tepl-application.c:127 | |
137 | msgid "Select _All" | |
138 | msgstr "Alles au_swählen" | |
139 | ||
140 | #: tepl/tepl-application.c:128 | |
141 | msgid "Select all the text" | |
142 | msgstr "Den gesamten Text auswählen" | |
143 | ||
144 | #: tepl/tepl-application.c:130 | |
145 | msgid "_Indent" | |
146 | msgstr "Ein_rücken" | |
147 | ||
148 | #: tepl/tepl-application.c:131 | |
149 | msgid "Indent the selected lines" | |
150 | msgstr "Die ausgewählten Zeilen einrücken" | |
151 | ||
152 | #: tepl/tepl-application.c:133 | |
153 | msgid "_Unindent" | |
154 | msgstr "A_usrücken" | |
155 | ||
156 | #: tepl/tepl-application.c:134 | |
157 | msgid "Unindent the selected lines" | |
158 | msgstr "Die ausgewählten Zeilen ausrücken" | |
159 | ||
160 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
161 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
162 | #. * doesn't have the real path to the file, so it would screw up some | |
163 | #. * features for text editors: | |
164 | #. * - showing the directory in parentheses in the window title, or in the | |
165 | #. * tab tooltip; | |
166 | #. * - opening a recent file. | |
167 | #. * Basically everywhere where the directory is shown. | |
168 | #. | |
169 | #: tepl/tepl-application-window.c:174 | |
170 | msgid "Open File" | |
171 | msgstr "Datei öffnen" | |
172 | ||
173 | #: tepl/tepl-application-window.c:177 | |
174 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
175 | msgid "_Cancel" | |
176 | msgstr "A_bbrechen" | |
177 | ||
178 | #: tepl/tepl-application-window.c:708 | |
179 | msgid "Read-Only" | |
180 | msgstr "Schreibgeschützt" | |
181 | ||
182 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
183 | #, c-format | |
184 | msgid "Save changes to file “%s” before closing?" | |
185 | msgstr "Änderungen an der Datei »%s« vor dem Schließen speichern?" | |
186 | ||
187 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
188 | msgid "Close _without Saving" | |
189 | msgstr "Ohne Speichern s_chließen" | |
190 | ||
191 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
192 | msgid "_Save As…" | |
193 | msgstr "Speichern _unter …" | |
194 | ||
195 | #. UTF-8 first, so that it's the first encoding returned by | |
196 | #. * tepl_encoding_get_all(). | |
197 | #. | |
198 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
199 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
200 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
201 | msgid "Unicode" | |
202 | msgstr "Unicode" | |
203 | ||
204 | #. FIXME GEOSTD8 ? | |
205 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
206 | #: tepl/tepl-encoding.c:180 | |
207 | msgid "Western" | |
208 | msgstr "Westeuropäisch" | |
209 | ||
210 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
211 | msgid "Central European" | |
212 | msgstr "Mitteleuropäisch" | |
213 | ||
214 | #: tepl/tepl-encoding.c:119 | |
215 | msgid "South European" | |
216 | msgstr "Südeuropäisch" | |
217 | ||
218 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
219 | msgid "Baltic" | |
220 | msgstr "Baltisch" | |
221 | ||
222 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
223 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
224 | msgid "Cyrillic" | |
225 | msgstr "Kyrillisch" | |
226 | ||
227 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
228 | msgid "Arabic" | |
229 | msgstr "Arabisch" | |
230 | ||
231 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
232 | msgid "Greek" | |
233 | msgstr "Griechisch" | |
234 | ||
235 | #: tepl/tepl-encoding.c:124 | |
236 | msgid "Hebrew Visual" | |
237 | msgstr "Hebräisch (visuell)" | |
238 | ||
239 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
240 | msgid "Turkish" | |
241 | msgstr "Türkisch" | |
242 | ||
243 | #: tepl/tepl-encoding.c:126 | |
244 | msgid "Nordic" | |
245 | msgstr "Skandinavisch" | |
246 | ||
247 | #: tepl/tepl-encoding.c:128 | |
248 | msgid "Celtic" | |
249 | msgstr "Keltisch" | |
250 | ||
251 | #: tepl/tepl-encoding.c:130 | |
252 | msgid "Romanian" | |
253 | msgstr "Rumänisch" | |
254 | ||
255 | #: tepl/tepl-encoding.c:140 | |
256 | msgid "Armenian" | |
257 | msgstr "Armenisch" | |
258 | ||
259 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
260 | msgid "Chinese Traditional" | |
261 | msgstr "Chinesisch (traditionell)" | |
262 | ||
263 | #: tepl/tepl-encoding.c:143 | |
264 | msgid "Cyrillic/Russian" | |
265 | msgstr "Kyrillisch/Russisch" | |
266 | ||
267 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
268 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
269 | msgid "Japanese" | |
270 | msgstr "Japanisch" | |
271 | ||
272 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
273 | #: tepl/tepl-encoding.c:175 | |
274 | msgid "Korean" | |
275 | msgstr "Koreanisch" | |
276 | ||
277 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
278 | msgid "Chinese Simplified" | |
279 | msgstr "Chinesisch (vereinfacht)" | |
280 | ||
281 | #: tepl/tepl-encoding.c:155 | |
282 | msgid "Georgian" | |
283 | msgstr "Georgisch" | |
284 | ||
285 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
286 | msgid "Hebrew" | |
287 | msgstr "Hebräisch" | |
288 | ||
289 | #: tepl/tepl-encoding.c:170 | |
290 | msgid "Cyrillic/Ukrainian" | |
291 | msgstr "Kyrillisch/Ukrainisch" | |
292 | ||
293 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
294 | msgid "Vietnamese" | |
295 | msgstr "Vietnamesisch" | |
296 | ||
297 | #: tepl/tepl-encoding.c:174 | |
298 | msgid "Thai" | |
299 | msgstr "Thailändisch" | |
300 | ||
301 | #: tepl/tepl-encoding.c:370 | |
302 | msgid "Unknown" | |
303 | msgstr "Unbekannt" | |
304 | ||
305 | # translator-comments beachten. | |
306 | #. Translators: This is the sorted list of encodings used by Tepl for | |
307 | #. * automatic detection of the file encoding. You may want to customize | |
308 | #. * it adding encodings that are common in your country, for instance the | |
309 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
310 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
311 | #. * European languages) if you think people in your country will rarely | |
312 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
313 | #. * the encoding for the current locale, so please don't translate the | |
314 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
315 | #. * commas. | |
316 | #. | |
317 | #: tepl/tepl-encoding.c:695 | |
318 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
319 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
320 | ||
321 | #: tepl/tepl-encoding-converter.c:302 | |
322 | #, c-format | |
323 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
324 | msgstr "Umwandlung von Zeichensatz »%s« in »%s« wird nicht unterstützt." | |
325 | ||
326 | #: tepl/tepl-encoding-converter.c:311 | |
327 | #, c-format | |
328 | msgid "Could not open converter from “%s” to “%s”: %s" | |
329 | msgstr "Konverter von »%s« in »%s« konnte nicht geöffnet werden: %s" | |
330 | ||
331 | #: tepl/tepl-encoding-converter.c:368 | |
332 | msgid "The input data contains an invalid sequence." | |
333 | msgstr "Die EIngabedaten enthalten eine ungültige Folge." | |
334 | ||
335 | #: tepl/tepl-encoding-converter.c:377 | |
336 | #, c-format | |
337 | msgid "Error when converting data: %s" | |
338 | msgstr "Fehler beim Konvertieren der Daten: %s" | |
339 | ||
340 | #: tepl/tepl-encoding-converter.c:556 | |
341 | msgid "The input data ends with an incomplete multi-byte sequence." | |
342 | msgstr "Die Eingabedaten endenn mit einer unvollständigen Folge mehrerer Byte." | |
343 | ||
344 | #: tepl/tepl-encoding-converter.c:579 | |
345 | msgid "The input content ends with incomplete data." | |
346 | msgstr "Die Eingabe endet mit unvollständigen Daten." | |
347 | ||
348 | #: tepl/tepl-file.c:413 | |
349 | #, c-format | |
350 | msgid "Untitled File %d" | |
351 | msgstr "Unbenannte Datei %d" | |
352 | ||
353 | #: tepl/tepl-file-content-loader.c:331 | |
354 | #, c-format | |
355 | msgid "The file is too big. Maximum %s can be loaded." | |
356 | msgstr "Die Datei ist zu groß. Es können höchstens %s geladen werden." | |
357 | ||
358 | #: tepl/tepl-file-loader.c:872 | |
359 | msgid "It is not possible to detect the character encoding automatically." | |
360 | msgstr "Die Zeichenkodierung kann nicht automatisch erkannt werden." | |
361 | ||
362 | #: tepl/tepl-file-saver.c:784 | |
363 | msgid "The file is externally modified." | |
364 | msgstr "Die Datei wurde extern verändert." | |
365 | ||
366 | #: tepl/tepl-file-saver.c:1318 | |
367 | msgid "The buffer contains invalid characters." | |
368 | msgstr "Zwischenspeicher enthält ungültige Zeichen." | |
369 | ||
370 | #: tepl/tepl-tab.c:534 | |
371 | msgid "Error when loading the file." | |
372 | msgstr "Beim Laden der Datei trat ein Fehler auf." | |
373 | ||
374 | #: tepl/tepl-tab.c:748 | |
375 | msgid "Save File" | |
376 | msgstr "Datei speichern" | |
377 | ||
378 | #. Translators: location of a file. | |
379 | #: tepl/tepl-tab-label.c:273 | |
380 | msgid "Location:" | |
381 | msgstr "Ort:" | |
382 | ||
383 | #: tepl/tepl-tab-label.c:342 | |
384 | msgid "Close file" | |
385 | msgstr "Datei schließen" | |
386 | ||
387 | #: tepl/tepl-tab-saving.c:64 | |
388 | msgid "Error when saving the file." | |
389 | msgstr "Beim Speichern der Datei trat ein Fehler auf." |
0 | # Spanish translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Daniel Mustieles <daniel.mustieles@gmail.com>, 2017. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
9 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
10 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
11 | "PO-Revision-Date: 2017-12-14 14:15+0100\n" | |
12 | "Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n" | |
13 | "Language-Team: es <gnome-es-list@gnome.org>\n" | |
14 | "Language: es\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
19 | "X-Generator: Gtranslator 2.91.6\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Abrir «%s»" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Abir _reciente" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Abrir un archivo usado recientemente con %s" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "_Nuevo" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Archivo nuevo" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "_Ventana nueva" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Crear una ventana nueva" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "Ab_rir" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | msgid "Open a file" | |
66 | msgstr "Abrir un archivo" | |
67 | ||
68 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
69 | #: tepl/tepl-tab.c:752 | |
70 | msgid "_Save" | |
71 | msgstr "_Guardar" | |
72 | ||
73 | #: tepl/tepl-application.c:102 | |
74 | msgid "Save the current file" | |
75 | msgstr "Guardar el archivo actual" | |
76 | ||
77 | #: tepl/tepl-application.c:104 | |
78 | msgid "Save _As" | |
79 | msgstr "Guardar _como" | |
80 | ||
81 | #: tepl/tepl-application.c:105 | |
82 | msgid "Save the current file to a different location" | |
83 | msgstr "Guarda el archivo actual en un lugar diferente" | |
84 | ||
85 | #. Edit menu | |
86 | #: tepl/tepl-application.c:109 | |
87 | msgid "_Undo" | |
88 | msgstr "Des_hacer" | |
89 | ||
90 | #: tepl/tepl-application.c:110 | |
91 | msgid "Undo the last action" | |
92 | msgstr "Deshace la última acción" | |
93 | ||
94 | #: tepl/tepl-application.c:112 | |
95 | msgid "_Redo" | |
96 | msgstr "_Rehacer" | |
97 | ||
98 | #: tepl/tepl-application.c:113 | |
99 | msgid "Redo the last undone action" | |
100 | msgstr "Rehacer la última acción deshecha" | |
101 | ||
102 | #: tepl/tepl-application.c:115 | |
103 | msgid "Cu_t" | |
104 | msgstr "C_ortar" | |
105 | ||
106 | #: tepl/tepl-application.c:116 | |
107 | msgid "Cut the selection" | |
108 | msgstr "Cortar la selección" | |
109 | ||
110 | #: tepl/tepl-application.c:118 | |
111 | msgid "_Copy" | |
112 | msgstr "_Copiar" | |
113 | ||
114 | #: tepl/tepl-application.c:119 | |
115 | msgid "Copy the selection" | |
116 | msgstr "Copiar la selección" | |
117 | ||
118 | #: tepl/tepl-application.c:121 | |
119 | msgid "_Paste" | |
120 | msgstr "_Pegar" | |
121 | ||
122 | #: tepl/tepl-application.c:122 | |
123 | msgid "Paste the clipboard" | |
124 | msgstr "Pegar del portapapeles" | |
125 | ||
126 | #: tepl/tepl-application.c:124 | |
127 | msgid "_Delete" | |
128 | msgstr "_Eliminar" | |
129 | ||
130 | #: tepl/tepl-application.c:125 | |
131 | msgid "Delete the selected text" | |
132 | msgstr "Eliminar el texto seleccionado" | |
133 | ||
134 | #: tepl/tepl-application.c:127 | |
135 | msgid "Select _All" | |
136 | msgstr "Seleccionar _todo" | |
137 | ||
138 | #: tepl/tepl-application.c:128 | |
139 | msgid "Select all the text" | |
140 | msgstr "Seleccionar todo el texto" | |
141 | ||
142 | #: tepl/tepl-application.c:130 | |
143 | msgid "_Indent" | |
144 | msgstr "_Sangrar" | |
145 | ||
146 | #: tepl/tepl-application.c:131 | |
147 | msgid "Indent the selected lines" | |
148 | msgstr "Sangrar las líneas seleccionadas" | |
149 | ||
150 | #: tepl/tepl-application.c:133 | |
151 | msgid "_Unindent" | |
152 | msgstr "Qui_tar sangrado" | |
153 | ||
154 | #: tepl/tepl-application.c:134 | |
155 | msgid "Unindent the selected lines" | |
156 | msgstr "Quitar sangrado de las líneas seleccionadas" | |
157 | ||
158 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
159 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
160 | #. * doesn't have the real path to the file, so it would screw up some | |
161 | #. * features for text editors: | |
162 | #. * - showing the directory in parentheses in the window title, or in the | |
163 | #. * tab tooltip; | |
164 | #. * - opening a recent file. | |
165 | #. * Basically everywhere where the directory is shown. | |
166 | #. | |
167 | #: tepl/tepl-application-window.c:174 | |
168 | msgid "Open File" | |
169 | msgstr "Abrir archivo" | |
170 | ||
171 | #: tepl/tepl-application-window.c:177 | |
172 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
173 | msgid "_Cancel" | |
174 | msgstr "_Cancelar" | |
175 | ||
176 | #: tepl/tepl-application-window.c:708 | |
177 | msgid "Read-Only" | |
178 | msgstr "Sólo lectura" | |
179 | ||
180 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
181 | #, c-format | |
182 | msgid "Save changes to file “%s” before closing?" | |
183 | msgstr "¿Quiere guardar los cambios en el archivo «%s» antes de cerrar?" | |
184 | ||
185 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
186 | msgid "Close _without Saving" | |
187 | msgstr "Cerrar _sin guardar" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
190 | #| msgid "Save _As" | |
191 | msgid "_Save As…" | |
192 | msgstr "Guardar _como…" | |
193 | ||
194 | #. UTF-8 first, so that it's the first encoding returned by | |
195 | #. * tepl_encoding_get_all(). | |
196 | #. | |
197 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
198 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
199 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
200 | msgid "Unicode" | |
201 | msgstr "Unicode" | |
202 | ||
203 | #. FIXME GEOSTD8 ? | |
204 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
205 | #: tepl/tepl-encoding.c:180 | |
206 | msgid "Western" | |
207 | msgstr "Occidental" | |
208 | ||
209 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
210 | msgid "Central European" | |
211 | msgstr "Europa central" | |
212 | ||
213 | #: tepl/tepl-encoding.c:119 | |
214 | msgid "South European" | |
215 | msgstr "Europa del sur" | |
216 | ||
217 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
218 | msgid "Baltic" | |
219 | msgstr "Báltico" | |
220 | ||
221 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
222 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
223 | msgid "Cyrillic" | |
224 | msgstr "Cirílico" | |
225 | ||
226 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
227 | msgid "Arabic" | |
228 | msgstr "Árabe" | |
229 | ||
230 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
231 | msgid "Greek" | |
232 | msgstr "Griego" | |
233 | ||
234 | #: tepl/tepl-encoding.c:124 | |
235 | msgid "Hebrew Visual" | |
236 | msgstr "Hebreo visual" | |
237 | ||
238 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
239 | msgid "Turkish" | |
240 | msgstr "Turco" | |
241 | ||
242 | #: tepl/tepl-encoding.c:126 | |
243 | msgid "Nordic" | |
244 | msgstr "Nórdico" | |
245 | ||
246 | #: tepl/tepl-encoding.c:128 | |
247 | msgid "Celtic" | |
248 | msgstr "Celta" | |
249 | ||
250 | #: tepl/tepl-encoding.c:130 | |
251 | msgid "Romanian" | |
252 | msgstr "Rumano" | |
253 | ||
254 | #: tepl/tepl-encoding.c:140 | |
255 | msgid "Armenian" | |
256 | msgstr "Armenio" | |
257 | ||
258 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
259 | msgid "Chinese Traditional" | |
260 | msgstr "Chino tradicional" | |
261 | ||
262 | #: tepl/tepl-encoding.c:143 | |
263 | msgid "Cyrillic/Russian" | |
264 | msgstr "Cirílico/Ruso" | |
265 | ||
266 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
267 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
268 | msgid "Japanese" | |
269 | msgstr "Japones" | |
270 | ||
271 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
272 | #: tepl/tepl-encoding.c:175 | |
273 | msgid "Korean" | |
274 | msgstr "Coreano" | |
275 | ||
276 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
277 | msgid "Chinese Simplified" | |
278 | msgstr "Chino simplificado" | |
279 | ||
280 | #: tepl/tepl-encoding.c:155 | |
281 | msgid "Georgian" | |
282 | msgstr "Georgiano" | |
283 | ||
284 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
285 | msgid "Hebrew" | |
286 | msgstr "Hebreo" | |
287 | ||
288 | #: tepl/tepl-encoding.c:170 | |
289 | msgid "Cyrillic/Ukrainian" | |
290 | msgstr "Cirílico/Ucraniano" | |
291 | ||
292 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
293 | msgid "Vietnamese" | |
294 | msgstr "Vietnamita" | |
295 | ||
296 | #: tepl/tepl-encoding.c:174 | |
297 | msgid "Thai" | |
298 | msgstr "Tailandés" | |
299 | ||
300 | #: tepl/tepl-encoding.c:370 | |
301 | msgid "Unknown" | |
302 | msgstr "Desconocido" | |
303 | ||
304 | #. Translators: This is the sorted list of encodings used by Tepl for | |
305 | #. * automatic detection of the file encoding. You may want to customize | |
306 | #. * it adding encodings that are common in your country, for instance the | |
307 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
308 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
309 | #. * European languages) if you think people in your country will rarely | |
310 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
311 | #. * the encoding for the current locale, so please don't translate the | |
312 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
313 | #. * commas. | |
314 | #. | |
315 | #: tepl/tepl-encoding.c:695 | |
316 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
317 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
318 | ||
319 | #: tepl/tepl-encoding-converter.c:302 | |
320 | #, c-format | |
321 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
322 | msgstr "" | |
323 | "La conversión desde el conjunto de caracteres «%s» a «%s» no está soportada." | |
324 | ||
325 | #: tepl/tepl-encoding-converter.c:311 | |
326 | #, c-format | |
327 | msgid "Could not open converter from “%s” to “%s”: %s" | |
328 | msgstr "No se pudo abrir el conversor de «%s» a «%s»: %s" | |
329 | ||
330 | #: tepl/tepl-encoding-converter.c:368 | |
331 | msgid "The input data contains an invalid sequence." | |
332 | msgstr "Los datos de entrada contienen una secuencia no válida." | |
333 | ||
334 | #: tepl/tepl-encoding-converter.c:377 | |
335 | #, c-format | |
336 | msgid "Error when converting data: %s" | |
337 | msgstr "Error al convertir los datos: %s" | |
338 | ||
339 | #: tepl/tepl-encoding-converter.c:556 | |
340 | msgid "The input data ends with an incomplete multi-byte sequence." | |
341 | msgstr "" | |
342 | "Los datos de entrada terminan con una secuencia de varios bytes incompleta." | |
343 | ||
344 | #: tepl/tepl-encoding-converter.c:579 | |
345 | msgid "The input content ends with incomplete data." | |
346 | msgstr "El contenido de la entrada termina con datos incompletos." | |
347 | ||
348 | #: tepl/tepl-file.c:413 | |
349 | #, c-format | |
350 | msgid "Untitled File %d" | |
351 | msgstr "Archivo sin título %d" | |
352 | ||
353 | #: tepl/tepl-file-content-loader.c:331 | |
354 | #, c-format | |
355 | msgid "The file is too big. Maximum %s can be loaded." | |
356 | msgstr "El archivo es demasiado grande. Sólo se puede cargar un máximo de %s." | |
357 | ||
358 | #: tepl/tepl-file-loader.c:872 | |
359 | msgid "It is not possible to detect the character encoding automatically." | |
360 | msgstr "No es posible detectar la codificación de caracteres automáticamente." | |
361 | ||
362 | #: tepl/tepl-file-saver.c:784 | |
363 | msgid "The file is externally modified." | |
364 | msgstr "El archivo se ha modificado externamente." | |
365 | ||
366 | #: tepl/tepl-file-saver.c:1318 | |
367 | msgid "The buffer contains invalid characters." | |
368 | msgstr "El búfer contiene caracteres no válidos." | |
369 | ||
370 | #: tepl/tepl-tab.c:534 | |
371 | msgid "Error when loading the file." | |
372 | msgstr "Error al cargar el archivo." | |
373 | ||
374 | #: tepl/tepl-tab.c:748 | |
375 | msgid "Save File" | |
376 | msgstr "Guardar archivo" | |
377 | ||
378 | #. Translators: location of a file. | |
379 | #: tepl/tepl-tab-label.c:273 | |
380 | msgid "Location:" | |
381 | msgstr "Ubicación:" | |
382 | ||
383 | #: tepl/tepl-tab-label.c:342 | |
384 | #| msgid "New file" | |
385 | msgid "Close file" | |
386 | msgstr "Cerrar archivo" | |
387 | ||
388 | #: tepl/tepl-tab-saving.c:64 | |
389 | msgid "Error when saving the file." | |
390 | msgstr "Error al guardar el archivo." |
0 | # Friulian translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Fabio Tomat <f.t.public@gmail.com>, 2017. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: \n" | |
9 | "POT-Creation-Date: 2017-04-03 05:53+0000\n" | |
10 | "PO-Revision-Date: 2017-04-08 20:42+0200\n" | |
11 | "Language-Team: Friulian <fur@li.org>\n" | |
12 | "Language: fur\n" | |
13 | "MIME-Version: 1.0\n" | |
14 | "Content-Type: text/plain; charset=UTF-8\n" | |
15 | "Content-Transfer-Encoding: 8bit\n" | |
16 | "Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n" | |
17 | "X-Generator: Poedit 1.8.12\n" | |
18 | ||
19 | #. Translators: %s is a filename. | |
20 | #: tepl/tepl-application-window.c:356 | |
21 | #, c-format | |
22 | msgid "Open “%s”" | |
23 | msgstr "Vierç “%s”" | |
24 | ||
25 | #: tepl/tepl-application-window.c:575 | |
26 | msgid "Open _Recent" | |
27 | msgstr "Vierç _resint" | |
28 | ||
29 | #. Translators: %s is the application name. | |
30 | #: tepl/tepl-application-window.c:578 | |
31 | #, c-format | |
32 | msgid "Open a file recently used with %s" | |
33 | msgstr "Vierç un file doprât di resint cun %s" | |
34 | ||
35 | #. UTF-8 first, so that it's the first encoding returned by | |
36 | #. * tepl_encoding_get_all(). | |
37 | #. | |
38 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
39 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
40 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
41 | msgid "Unicode" | |
42 | msgstr "Unicode" | |
43 | ||
44 | #. FIXME GEOSTD8 ? | |
45 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
46 | #: tepl/tepl-encoding.c:180 | |
47 | msgid "Western" | |
48 | msgstr "Ocidentâl" | |
49 | ||
50 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
51 | msgid "Central European" | |
52 | msgstr "European centrâl" | |
53 | ||
54 | #: tepl/tepl-encoding.c:119 | |
55 | msgid "South European" | |
56 | msgstr "European dal sud" | |
57 | ||
58 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
59 | msgid "Baltic" | |
60 | msgstr "Baltic" | |
61 | ||
62 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
63 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
64 | msgid "Cyrillic" | |
65 | msgstr "Cirilic" | |
66 | ||
67 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
68 | msgid "Arabic" | |
69 | msgstr "Arap" | |
70 | ||
71 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
72 | msgid "Greek" | |
73 | msgstr "Grêc" | |
74 | ||
75 | #: tepl/tepl-encoding.c:124 | |
76 | msgid "Hebrew Visual" | |
77 | msgstr "Ebraic Visuâl" | |
78 | ||
79 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
80 | msgid "Turkish" | |
81 | msgstr "Turc" | |
82 | ||
83 | #: tepl/tepl-encoding.c:126 | |
84 | msgid "Nordic" | |
85 | msgstr "Nordic" | |
86 | ||
87 | #: tepl/tepl-encoding.c:128 | |
88 | msgid "Celtic" | |
89 | msgstr "Celtic" | |
90 | ||
91 | #: tepl/tepl-encoding.c:130 | |
92 | msgid "Romanian" | |
93 | msgstr "Rumen" | |
94 | ||
95 | #: tepl/tepl-encoding.c:140 | |
96 | msgid "Armenian" | |
97 | msgstr "Armen" | |
98 | ||
99 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
100 | msgid "Chinese Traditional" | |
101 | msgstr "Cinês tradizionâl" | |
102 | ||
103 | #: tepl/tepl-encoding.c:143 | |
104 | msgid "Cyrillic/Russian" | |
105 | msgstr "Cirilic/Rus" | |
106 | ||
107 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
108 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
109 | msgid "Japanese" | |
110 | msgstr "Gjaponês" | |
111 | ||
112 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
113 | #: tepl/tepl-encoding.c:175 | |
114 | msgid "Korean" | |
115 | msgstr "Corean" | |
116 | ||
117 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
118 | msgid "Chinese Simplified" | |
119 | msgstr "Cinês semplificât" | |
120 | ||
121 | #: tepl/tepl-encoding.c:155 | |
122 | msgid "Georgian" | |
123 | msgstr "Gjeorgjan" | |
124 | ||
125 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
126 | msgid "Hebrew" | |
127 | msgstr "Ebraic" | |
128 | ||
129 | #: tepl/tepl-encoding.c:170 | |
130 | msgid "Cyrillic/Ukrainian" | |
131 | msgstr "Cirilic/Ucrain" | |
132 | ||
133 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
134 | msgid "Vietnamese" | |
135 | msgstr "Vietnamît" | |
136 | ||
137 | #: tepl/tepl-encoding.c:174 | |
138 | msgid "Thai" | |
139 | msgstr "Tailandês" | |
140 | ||
141 | #: tepl/tepl-encoding.c:365 | |
142 | msgid "Unknown" | |
143 | msgstr "No cognossût" | |
144 | ||
145 | #. Translators: This is the sorted list of encodings used by Tepl for | |
146 | #. * automatic detection of the file encoding. You may want to customize | |
147 | #. * it adding encodings that are common in your country, for instance the | |
148 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
149 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
150 | #. * European languages) if you think people in your country will rarely | |
151 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
152 | #. * the encoding for the current locale, so please don't translate the | |
153 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
154 | #. * commas. | |
155 | #. | |
156 | #: tepl/tepl-encoding.c:640 | |
157 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
158 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
159 | ||
160 | #: tepl/tepl-encoding-converter.c:302 | |
161 | #, c-format | |
162 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
163 | msgstr "La conversion de cumbinazion di caratars “%s” a “%s” no je supuartade." | |
164 | ||
165 | #: tepl/tepl-encoding-converter.c:311 | |
166 | #, c-format | |
167 | msgid "Could not open converter from “%s” to “%s”: %s" | |
168 | msgstr "Impussibil convertî di “%s” a “%s”: %s" | |
169 | ||
170 | #: tepl/tepl-encoding-converter.c:368 | |
171 | msgid "The input data contains an invalid sequence." | |
172 | msgstr "I dâts in jentrade a contegnin une secuence no valide." | |
173 | ||
174 | #: tepl/tepl-encoding-converter.c:377 | |
175 | #, c-format | |
176 | msgid "Error when converting data: %s" | |
177 | msgstr "Erôr tal convertî i dâts: %s" | |
178 | ||
179 | #: tepl/tepl-encoding-converter.c:556 | |
180 | msgid "The input data ends with an incomplete multi-byte sequence." | |
181 | msgstr "I dâts in jentrade a finissin cuntune secuence di byte multiplis incomplete." | |
182 | ||
183 | #: tepl/tepl-encoding-converter.c:579 | |
184 | msgid "The input content ends with incomplete data." | |
185 | msgstr "Il contignût de jentrade al finìs cun dâts incomplets." | |
186 | ||
187 | #: tepl/tepl-file.c:413 | |
188 | #, c-format | |
189 | msgid "Untitled File %d" | |
190 | msgstr "File cence titul %d" | |
191 | ||
192 | #: tepl/tepl-file-content-loader.c:334 | |
193 | #, c-format | |
194 | msgid "The file is too big. Maximum %s can be loaded." | |
195 | msgstr "Il file al è masse grant. Si pues cjariâ al massim %s." | |
196 | ||
197 | #: tepl/tepl-file-loader.c:925 | |
198 | msgid "It is not possible to detect the character encoding automatically." | |
199 | msgstr "Nol è pussibil individuâ la codifiche dal caratar in automatic." | |
200 | ||
201 | #: tepl/tepl-file-saver.c:784 | |
202 | msgid "The file is externally modified." | |
203 | msgstr "Il file al è modificât di difûr di chi." | |
204 | ||
205 | #: tepl/tepl-file-saver.c:1318 | |
206 | msgid "The buffer contains invalid characters." | |
207 | msgstr "Il buffer al conten caratars no valits." |
0 | # Hungarian translation for tepl. | |
1 | # Copyright (C) 2017, 2018 Free Software Foundation, Inc. | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # | |
4 | # Balázs Úr <urbalazs at gmail dot com>, 2017, 2018. | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
9 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
10 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
11 | "PO-Revision-Date: 2018-02-26 23:33+0100\n" | |
12 | "Last-Translator: Balázs Úr <urbalazs@gmail.com>\n" | |
13 | "Language-Team: Hungarian <openscope at googlegroups dot com>\n" | |
14 | "Language: hu\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
19 | "X-Generator: Lokalize 1.2\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "„%s” megnyitása" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "_Legutóbbi megnyitása" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "A(z) %s alkalmazással legutóbb használt fájl megnyitása" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "Ú_j" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Új fájl" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "Új _ablak" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Új ablak létrehozása" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "_Megnyitás" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | msgid "Open a file" | |
66 | msgstr "Fájl megnyitása" | |
67 | ||
68 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
69 | #: tepl/tepl-tab.c:752 | |
70 | msgid "_Save" | |
71 | msgstr "M_entés" | |
72 | ||
73 | #: tepl/tepl-application.c:102 | |
74 | msgid "Save the current file" | |
75 | msgstr "Jelenlegi fájl mentése" | |
76 | ||
77 | #: tepl/tepl-application.c:104 | |
78 | msgid "Save _As" | |
79 | msgstr "Men_tés másként" | |
80 | ||
81 | #: tepl/tepl-application.c:105 | |
82 | msgid "Save the current file to a different location" | |
83 | msgstr "Jelenlegi fájl mentése egy másik helyre" | |
84 | ||
85 | #. Edit menu | |
86 | #: tepl/tepl-application.c:109 | |
87 | msgid "_Undo" | |
88 | msgstr "V_isszavonás" | |
89 | ||
90 | #: tepl/tepl-application.c:110 | |
91 | msgid "Undo the last action" | |
92 | msgstr "Az utolsó művelet visszavonása" | |
93 | ||
94 | #: tepl/tepl-application.c:112 | |
95 | msgid "_Redo" | |
96 | msgstr "Új_ra" | |
97 | ||
98 | #: tepl/tepl-application.c:113 | |
99 | msgid "Redo the last undone action" | |
100 | msgstr "A visszavont művelet ismételt végrehajtása" | |
101 | ||
102 | #: tepl/tepl-application.c:115 | |
103 | msgid "Cu_t" | |
104 | msgstr "_Kivágás" | |
105 | ||
106 | #: tepl/tepl-application.c:116 | |
107 | msgid "Cut the selection" | |
108 | msgstr "A kijelölés kivágása" | |
109 | ||
110 | #: tepl/tepl-application.c:118 | |
111 | msgid "_Copy" | |
112 | msgstr "_Másolás" | |
113 | ||
114 | #: tepl/tepl-application.c:119 | |
115 | msgid "Copy the selection" | |
116 | msgstr "A kijelölés másolása" | |
117 | ||
118 | #: tepl/tepl-application.c:121 | |
119 | msgid "_Paste" | |
120 | msgstr "_Beillesztés" | |
121 | ||
122 | #: tepl/tepl-application.c:122 | |
123 | msgid "Paste the clipboard" | |
124 | msgstr "A vágólap tartalmának beillesztése" | |
125 | ||
126 | #: tepl/tepl-application.c:124 | |
127 | msgid "_Delete" | |
128 | msgstr "_Törlés" | |
129 | ||
130 | #: tepl/tepl-application.c:125 | |
131 | msgid "Delete the selected text" | |
132 | msgstr "A kijelölt szöveg törlése" | |
133 | ||
134 | #: tepl/tepl-application.c:127 | |
135 | msgid "Select _All" | |
136 | msgstr "Az össz_es kijelölése" | |
137 | ||
138 | #: tepl/tepl-application.c:128 | |
139 | msgid "Select all the text" | |
140 | msgstr "Az összes szöveg kijelölése" | |
141 | ||
142 | #: tepl/tepl-application.c:130 | |
143 | msgid "_Indent" | |
144 | msgstr "_Behúzás" | |
145 | ||
146 | #: tepl/tepl-application.c:131 | |
147 | msgid "Indent the selected lines" | |
148 | msgstr "A kijelölt sorok behúzása" | |
149 | ||
150 | #: tepl/tepl-application.c:133 | |
151 | msgid "_Unindent" | |
152 | msgstr "Behúzás _visszavonása" | |
153 | ||
154 | #: tepl/tepl-application.c:134 | |
155 | msgid "Unindent the selected lines" | |
156 | msgstr "A kijelölt sorok behúzásának visszavonása" | |
157 | ||
158 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
159 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
160 | #. * doesn't have the real path to the file, so it would screw up some | |
161 | #. * features for text editors: | |
162 | #. * - showing the directory in parentheses in the window title, or in the | |
163 | #. * tab tooltip; | |
164 | #. * - opening a recent file. | |
165 | #. * Basically everywhere where the directory is shown. | |
166 | #. | |
167 | #: tepl/tepl-application-window.c:174 | |
168 | msgid "Open File" | |
169 | msgstr "Fájl megnyitása" | |
170 | ||
171 | #: tepl/tepl-application-window.c:177 | |
172 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
173 | msgid "_Cancel" | |
174 | msgstr "_Mégse" | |
175 | ||
176 | #: tepl/tepl-application-window.c:708 | |
177 | msgid "Read-Only" | |
178 | msgstr "Írásvédett" | |
179 | ||
180 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
181 | #, c-format | |
182 | msgid "Save changes to file “%s” before closing?" | |
183 | msgstr "Menti a változtatásokat a(z) „%s” fájlba bezárás előtt?" | |
184 | ||
185 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
186 | msgid "Close _without Saving" | |
187 | msgstr "Bezárás mentés _nélkül" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
190 | msgid "_Save As…" | |
191 | msgstr "M_entés másként…" | |
192 | ||
193 | #. UTF-8 first, so that it's the first encoding returned by | |
194 | #. * tepl_encoding_get_all(). | |
195 | #. | |
196 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
197 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
198 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
199 | msgid "Unicode" | |
200 | msgstr "Unicode" | |
201 | ||
202 | #. FIXME GEOSTD8 ? | |
203 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
204 | #: tepl/tepl-encoding.c:180 | |
205 | msgid "Western" | |
206 | msgstr "Nyugati" | |
207 | ||
208 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
209 | msgid "Central European" | |
210 | msgstr "Közép-európai" | |
211 | ||
212 | #: tepl/tepl-encoding.c:119 | |
213 | msgid "South European" | |
214 | msgstr "Dél-európai" | |
215 | ||
216 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
217 | msgid "Baltic" | |
218 | msgstr "Balti" | |
219 | ||
220 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
221 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
222 | msgid "Cyrillic" | |
223 | msgstr "Cirill" | |
224 | ||
225 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
226 | msgid "Arabic" | |
227 | msgstr "Arab" | |
228 | ||
229 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
230 | msgid "Greek" | |
231 | msgstr "Görög" | |
232 | ||
233 | #: tepl/tepl-encoding.c:124 | |
234 | msgid "Hebrew Visual" | |
235 | msgstr "Héber (képi)" | |
236 | ||
237 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
238 | msgid "Turkish" | |
239 | msgstr "Török" | |
240 | ||
241 | #: tepl/tepl-encoding.c:126 | |
242 | msgid "Nordic" | |
243 | msgstr "Északi" | |
244 | ||
245 | #: tepl/tepl-encoding.c:128 | |
246 | msgid "Celtic" | |
247 | msgstr "Kelta" | |
248 | ||
249 | #: tepl/tepl-encoding.c:130 | |
250 | msgid "Romanian" | |
251 | msgstr "Román" | |
252 | ||
253 | #: tepl/tepl-encoding.c:140 | |
254 | msgid "Armenian" | |
255 | msgstr "Örmény" | |
256 | ||
257 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
258 | msgid "Chinese Traditional" | |
259 | msgstr "Hagyományos kínai" | |
260 | ||
261 | #: tepl/tepl-encoding.c:143 | |
262 | msgid "Cyrillic/Russian" | |
263 | msgstr "Cirill/orosz" | |
264 | ||
265 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
266 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
267 | msgid "Japanese" | |
268 | msgstr "Japán" | |
269 | ||
270 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
271 | #: tepl/tepl-encoding.c:175 | |
272 | msgid "Korean" | |
273 | msgstr "Koreai" | |
274 | ||
275 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
276 | msgid "Chinese Simplified" | |
277 | msgstr "Egyszerűsített kínai" | |
278 | ||
279 | #: tepl/tepl-encoding.c:155 | |
280 | msgid "Georgian" | |
281 | msgstr "Grúz" | |
282 | ||
283 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
284 | msgid "Hebrew" | |
285 | msgstr "Héber" | |
286 | ||
287 | #: tepl/tepl-encoding.c:170 | |
288 | msgid "Cyrillic/Ukrainian" | |
289 | msgstr "Cirill/ukrán" | |
290 | ||
291 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
292 | msgid "Vietnamese" | |
293 | msgstr "Vietnami" | |
294 | ||
295 | #: tepl/tepl-encoding.c:174 | |
296 | msgid "Thai" | |
297 | msgstr "Thai" | |
298 | ||
299 | #: tepl/tepl-encoding.c:370 | |
300 | msgid "Unknown" | |
301 | msgstr "Ismeretlen" | |
302 | ||
303 | #. Translators: This is the sorted list of encodings used by Tepl for | |
304 | #. * automatic detection of the file encoding. You may want to customize | |
305 | #. * it adding encodings that are common in your country, for instance the | |
306 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
307 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
308 | #. * European languages) if you think people in your country will rarely | |
309 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
310 | #. * the encoding for the current locale, so please don't translate the | |
311 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
312 | #. * commas. | |
313 | #. | |
314 | #: tepl/tepl-encoding.c:695 | |
315 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
316 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-2', 'WINDOWS-1250', 'IBM852', 'UTF-16']" | |
317 | ||
318 | #: tepl/tepl-encoding-converter.c:302 | |
319 | #, c-format | |
320 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
321 | msgstr "A(z) „%s” és „%s” karakterkészletek közötti átalakítás nem támogatott." | |
322 | ||
323 | #: tepl/tepl-encoding-converter.c:311 | |
324 | #, c-format | |
325 | msgid "Could not open converter from “%s” to “%s”: %s" | |
326 | msgstr "" | |
327 | "A(z) „%s” karakterkészletről „%s” karakterkészletre átalakító nem nyitható " | |
328 | "meg: %s" | |
329 | ||
330 | #: tepl/tepl-encoding-converter.c:368 | |
331 | msgid "The input data contains an invalid sequence." | |
332 | msgstr "A bemeneti adat érvénytelen sorozatot tartalmaz." | |
333 | ||
334 | #: tepl/tepl-encoding-converter.c:377 | |
335 | #, c-format | |
336 | msgid "Error when converting data: %s" | |
337 | msgstr "Hiba az adatok átalakításakor: %s" | |
338 | ||
339 | #: tepl/tepl-encoding-converter.c:556 | |
340 | msgid "The input data ends with an incomplete multi-byte sequence." | |
341 | msgstr "A bemeneti adat egy befejezetlen több-bájtos sorozattal végződik." | |
342 | ||
343 | #: tepl/tepl-encoding-converter.c:579 | |
344 | msgid "The input content ends with incomplete data." | |
345 | msgstr "A bemeneti tartalom befejezetlen adattal végződik." | |
346 | ||
347 | #: tepl/tepl-file.c:413 | |
348 | #, c-format | |
349 | msgid "Untitled File %d" | |
350 | msgstr "%d. névtelen fájl" | |
351 | ||
352 | #: tepl/tepl-file-content-loader.c:331 | |
353 | #, c-format | |
354 | msgid "The file is too big. Maximum %s can be loaded." | |
355 | msgstr "A fájl túl nagy. Legfeljebb %s lehet betöltve." | |
356 | ||
357 | #: tepl/tepl-file-loader.c:872 | |
358 | msgid "It is not possible to detect the character encoding automatically." | |
359 | msgstr "Nem lehetséges a karakterkódolást automatikusan felismerni." | |
360 | ||
361 | #: tepl/tepl-file-saver.c:784 | |
362 | msgid "The file is externally modified." | |
363 | msgstr "A fájlt külsőleg módosították." | |
364 | ||
365 | #: tepl/tepl-file-saver.c:1318 | |
366 | msgid "The buffer contains invalid characters." | |
367 | msgstr "A puffer érvénytelen karaktereket tartalmaz." | |
368 | ||
369 | #: tepl/tepl-tab.c:534 | |
370 | msgid "Error when loading the file." | |
371 | msgstr "Hiba a fájl betöltésekor." | |
372 | ||
373 | #: tepl/tepl-tab.c:748 | |
374 | msgid "Save File" | |
375 | msgstr "Fájl mentése" | |
376 | ||
377 | #. Translators: location of a file. | |
378 | #: tepl/tepl-tab-label.c:273 | |
379 | msgid "Location:" | |
380 | msgstr "Hely:" | |
381 | ||
382 | #: tepl/tepl-tab-label.c:342 | |
383 | msgid "Close file" | |
384 | msgstr "Fájl bezárása" | |
385 | ||
386 | #: tepl/tepl-tab-saving.c:64 | |
387 | msgid "Error when saving the file." | |
388 | msgstr "Hiba a fájl mentésekor." | |
389 |
0 | # Indonesian translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Andika Triwidada <atriwidada@gnome.org>, 2017. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
9 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
10 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
11 | "PO-Revision-Date: 2017-12-05 14:52+0700\n" | |
12 | "Last-Translator: Kukuh Syafaat <syafaatkukuh@gmail.com>\n" | |
13 | "Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n" | |
14 | "Language: id\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | "X-Generator: Poedit 2.0.4\n" | |
19 | ||
20 | #. Translators: %s is a filename. | |
21 | #: amtk/amtk-application-window.c:374 | |
22 | #, c-format | |
23 | msgid "Open “%s”" | |
24 | msgstr "Membuka \"%s\"" | |
25 | ||
26 | #: amtk/amtk-application-window.c:630 | |
27 | msgid "Open _Recent" | |
28 | msgstr "Buka Te_rkini" | |
29 | ||
30 | #. Translators: %s is the application name. | |
31 | #: amtk/amtk-application-window.c:633 | |
32 | #, c-format | |
33 | msgid "Open a file recently used with %s" | |
34 | msgstr "Membuka dokumen yang baru-baru ini dipakai dengan %s" | |
35 | ||
36 | #. action, icon, label, accel, tooltip | |
37 | #. File menu | |
38 | #. Why "file" and not "document"? "Document" is not the best | |
39 | #. word because the action is not always to create a new | |
40 | #. document. For example a LaTeX document can be composed of | |
41 | #. several _files_. Or for source code we do not really create a | |
42 | #. new "document". | |
43 | #: tepl/tepl-application.c:92 | |
44 | msgid "_New" | |
45 | msgstr "_Baru" | |
46 | ||
47 | #: tepl/tepl-application.c:93 | |
48 | msgid "New file" | |
49 | msgstr "Berkas baru" | |
50 | ||
51 | #: tepl/tepl-application.c:95 | |
52 | msgid "New _Window" | |
53 | msgstr "_Jendela Baru" | |
54 | ||
55 | #: tepl/tepl-application.c:96 | |
56 | msgid "Create a new window" | |
57 | msgstr "Membuat jendela baru" | |
58 | ||
59 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
60 | msgid "_Open" | |
61 | msgstr "_Buka" | |
62 | ||
63 | #: tepl/tepl-application.c:99 | |
64 | msgid "Open a file" | |
65 | msgstr "Buka suatu berkas" | |
66 | ||
67 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
68 | #: tepl/tepl-tab.c:752 | |
69 | msgid "_Save" | |
70 | msgstr "_Simpan" | |
71 | ||
72 | #: tepl/tepl-application.c:102 | |
73 | msgid "Save the current file" | |
74 | msgstr "Simpan berkas saat ini" | |
75 | ||
76 | #: tepl/tepl-application.c:104 | |
77 | msgid "Save _As" | |
78 | msgstr "Simp_an Sebagai" | |
79 | ||
80 | #: tepl/tepl-application.c:105 | |
81 | msgid "Save the current file to a different location" | |
82 | msgstr "Simpan berkas saat ini ke lokasi yang berbeda" | |
83 | ||
84 | #. Edit menu | |
85 | #: tepl/tepl-application.c:109 | |
86 | msgid "_Undo" | |
87 | msgstr "Tak _Jadi" | |
88 | ||
89 | #: tepl/tepl-application.c:110 | |
90 | msgid "Undo the last action" | |
91 | msgstr "Batalkan aksi terakhir" | |
92 | ||
93 | #: tepl/tepl-application.c:112 | |
94 | msgid "_Redo" | |
95 | msgstr "_Jadi Lagi" | |
96 | ||
97 | #: tepl/tepl-application.c:113 | |
98 | msgid "Redo the last undone action" | |
99 | msgstr "Jadikan lagi aksi terakhir yang dibatalkan" | |
100 | ||
101 | #: tepl/tepl-application.c:115 | |
102 | msgid "Cu_t" | |
103 | msgstr "Po_tong" | |
104 | ||
105 | #: tepl/tepl-application.c:116 | |
106 | msgid "Cut the selection" | |
107 | msgstr "Potong bagian yang dipilih" | |
108 | ||
109 | #: tepl/tepl-application.c:118 | |
110 | msgid "_Copy" | |
111 | msgstr "Sali_n" | |
112 | ||
113 | #: tepl/tepl-application.c:119 | |
114 | msgid "Copy the selection" | |
115 | msgstr "Salin bagian yang dipilih" | |
116 | ||
117 | #: tepl/tepl-application.c:121 | |
118 | msgid "_Paste" | |
119 | msgstr "Tem_pel" | |
120 | ||
121 | #: tepl/tepl-application.c:122 | |
122 | msgid "Paste the clipboard" | |
123 | msgstr "Tempel papan klip" | |
124 | ||
125 | #: tepl/tepl-application.c:124 | |
126 | msgid "_Delete" | |
127 | msgstr "_Hapus" | |
128 | ||
129 | #: tepl/tepl-application.c:125 | |
130 | msgid "Delete the selected text" | |
131 | msgstr "Hapus teks yang dipilih" | |
132 | ||
133 | #: tepl/tepl-application.c:127 | |
134 | msgid "Select _All" | |
135 | msgstr "Pilih Semu_a" | |
136 | ||
137 | #: tepl/tepl-application.c:128 | |
138 | msgid "Select all the text" | |
139 | msgstr "Pilih semua teks" | |
140 | ||
141 | #: tepl/tepl-application.c:130 | |
142 | msgid "_Indent" | |
143 | msgstr "_Indentasi" | |
144 | ||
145 | #: tepl/tepl-application.c:131 | |
146 | msgid "Indent the selected lines" | |
147 | msgstr "Indentasi baris yang dipilih" | |
148 | ||
149 | #: tepl/tepl-application.c:133 | |
150 | msgid "_Unindent" | |
151 | msgstr "Hap_us indentasi" | |
152 | ||
153 | #: tepl/tepl-application.c:134 | |
154 | msgid "Unindent the selected lines" | |
155 | msgstr "Hapus indentasi baris yang dipilih" | |
156 | ||
157 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
158 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
159 | #. * doesn't have the real path to the file, so it would screw up some | |
160 | #. * features for text editors: | |
161 | #. * - showing the directory in parentheses in the window title, or in the | |
162 | #. * tab tooltip; | |
163 | #. * - opening a recent file. | |
164 | #. * Basically everywhere where the directory is shown. | |
165 | #. | |
166 | #: tepl/tepl-application-window.c:174 | |
167 | msgid "Open File" | |
168 | msgstr "Buka Berkas" | |
169 | ||
170 | #: tepl/tepl-application-window.c:177 | |
171 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
172 | msgid "_Cancel" | |
173 | msgstr "Ba_tal" | |
174 | ||
175 | #: tepl/tepl-application-window.c:708 | |
176 | msgid "Read-Only" | |
177 | msgstr "Hanya-Baca" | |
178 | ||
179 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
180 | #, c-format | |
181 | msgid "Save changes to file “%s” before closing?" | |
182 | msgstr "Simpan perubahan ke berkas \"%s\" sebelum ditutup?" | |
183 | ||
184 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
185 | msgid "Close _without Saving" | |
186 | msgstr "Tutup _tanpa Menyimpan" | |
187 | ||
188 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
189 | msgid "_Save As…" | |
190 | msgstr "_Simpan Sebagai…" | |
191 | ||
192 | #. UTF-8 first, so that it's the first encoding returned by | |
193 | #. * tepl_encoding_get_all(). | |
194 | #. | |
195 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
196 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
197 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
198 | msgid "Unicode" | |
199 | msgstr "Unikode" | |
200 | ||
201 | #. FIXME GEOSTD8 ? | |
202 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
203 | #: tepl/tepl-encoding.c:180 | |
204 | msgid "Western" | |
205 | msgstr "Barat" | |
206 | ||
207 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
208 | msgid "Central European" | |
209 | msgstr "Eropa Tengah" | |
210 | ||
211 | #: tepl/tepl-encoding.c:119 | |
212 | msgid "South European" | |
213 | msgstr "Eropa Selatan" | |
214 | ||
215 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
216 | msgid "Baltic" | |
217 | msgstr "Baltik" | |
218 | ||
219 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
220 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
221 | msgid "Cyrillic" | |
222 | msgstr "Sirilik" | |
223 | ||
224 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
225 | msgid "Arabic" | |
226 | msgstr "Arab" | |
227 | ||
228 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
229 | msgid "Greek" | |
230 | msgstr "Yunani" | |
231 | ||
232 | #: tepl/tepl-encoding.c:124 | |
233 | msgid "Hebrew Visual" | |
234 | msgstr "Ibrani Visual" | |
235 | ||
236 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
237 | msgid "Turkish" | |
238 | msgstr "Turki" | |
239 | ||
240 | #: tepl/tepl-encoding.c:126 | |
241 | msgid "Nordic" | |
242 | msgstr "Nordik" | |
243 | ||
244 | #: tepl/tepl-encoding.c:128 | |
245 | msgid "Celtic" | |
246 | msgstr "Seltik" | |
247 | ||
248 | #: tepl/tepl-encoding.c:130 | |
249 | msgid "Romanian" | |
250 | msgstr "Rumania" | |
251 | ||
252 | #: tepl/tepl-encoding.c:140 | |
253 | msgid "Armenian" | |
254 | msgstr "Armenia" | |
255 | ||
256 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
257 | msgid "Chinese Traditional" | |
258 | msgstr "Cina Tradisional" | |
259 | ||
260 | #: tepl/tepl-encoding.c:143 | |
261 | msgid "Cyrillic/Russian" | |
262 | msgstr "Sirilik/Rusia" | |
263 | ||
264 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
265 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
266 | msgid "Japanese" | |
267 | msgstr "Jepang" | |
268 | ||
269 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
270 | #: tepl/tepl-encoding.c:175 | |
271 | msgid "Korean" | |
272 | msgstr "Korea" | |
273 | ||
274 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
275 | msgid "Chinese Simplified" | |
276 | msgstr "Cina Sederhana" | |
277 | ||
278 | #: tepl/tepl-encoding.c:155 | |
279 | msgid "Georgian" | |
280 | msgstr "Georgia" | |
281 | ||
282 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
283 | msgid "Hebrew" | |
284 | msgstr "Ibrani" | |
285 | ||
286 | #: tepl/tepl-encoding.c:170 | |
287 | msgid "Cyrillic/Ukrainian" | |
288 | msgstr "Sirilik/Ukraina" | |
289 | ||
290 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
291 | msgid "Vietnamese" | |
292 | msgstr "Vietnam" | |
293 | ||
294 | #: tepl/tepl-encoding.c:174 | |
295 | msgid "Thai" | |
296 | msgstr "Thai" | |
297 | ||
298 | #: tepl/tepl-encoding.c:370 | |
299 | msgid "Unknown" | |
300 | msgstr "Tidak Dikenal" | |
301 | ||
302 | #. Translators: This is the sorted list of encodings used by Tepl for | |
303 | #. * automatic detection of the file encoding. You may want to customize | |
304 | #. * it adding encodings that are common in your country, for instance the | |
305 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
306 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
307 | #. * European languages) if you think people in your country will rarely | |
308 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
309 | #. * the encoding for the current locale, so please don't translate the | |
310 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
311 | #. * commas. | |
312 | #. | |
313 | #: tepl/tepl-encoding.c:695 | |
314 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
315 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
316 | ||
317 | #: tepl/tepl-encoding-converter.c:302 | |
318 | #, c-format | |
319 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
320 | msgstr "Konversi dari gugus karakter \"%s\" ke \"%s\" tak didukung." | |
321 | ||
322 | #: tepl/tepl-encoding-converter.c:311 | |
323 | #, c-format | |
324 | msgid "Could not open converter from “%s” to “%s”: %s" | |
325 | msgstr "Tidak dapat membuka pengubah dari \"%s\" menjadi \"%s\": %s" | |
326 | ||
327 | #: tepl/tepl-encoding-converter.c:368 | |
328 | msgid "The input data contains an invalid sequence." | |
329 | msgstr "Data masukan memuat suatu urutan yang tidak valid." | |
330 | ||
331 | #: tepl/tepl-encoding-converter.c:377 | |
332 | #, c-format | |
333 | msgid "Error when converting data: %s" | |
334 | msgstr "Galat saat mengonversi data: %s" | |
335 | ||
336 | #: tepl/tepl-encoding-converter.c:556 | |
337 | msgid "The input data ends with an incomplete multi-byte sequence." | |
338 | msgstr "Data masukan diakhiri dengan urutan multi-byte yang tidak lengkap." | |
339 | ||
340 | #: tepl/tepl-encoding-converter.c:579 | |
341 | msgid "The input content ends with incomplete data." | |
342 | msgstr "Isi masukan berakhir dengan data yang tidak lengkap." | |
343 | ||
344 | #: tepl/tepl-file.c:413 | |
345 | #, c-format | |
346 | msgid "Untitled File %d" | |
347 | msgstr "Berkas Tanpa Nama %d" | |
348 | ||
349 | #: tepl/tepl-file-content-loader.c:331 | |
350 | #, c-format | |
351 | msgid "The file is too big. Maximum %s can be loaded." | |
352 | msgstr "Berkas telalu besar. Maksimum %s dapat dimuat." | |
353 | ||
354 | #: tepl/tepl-file-loader.c:872 | |
355 | msgid "It is not possible to detect the character encoding automatically." | |
356 | msgstr "Tak mungkin mendeteksi pengkodean karakter secara otomatis." | |
357 | ||
358 | #: tepl/tepl-file-saver.c:784 | |
359 | msgid "The file is externally modified." | |
360 | msgstr "Berkas telah diubah secara eksternal." | |
361 | ||
362 | #: tepl/tepl-file-saver.c:1318 | |
363 | msgid "The buffer contains invalid characters." | |
364 | msgstr "Penyangga mengandung karakter tak valid." | |
365 | ||
366 | #: tepl/tepl-tab.c:534 | |
367 | msgid "Error when loading the file." | |
368 | msgstr "Galat saat memuat berkas." | |
369 | ||
370 | #: tepl/tepl-tab.c:748 | |
371 | msgid "Save File" | |
372 | msgstr "Simpan Berkas" | |
373 | ||
374 | #. Translators: location of a file. | |
375 | #: tepl/tepl-tab-label.c:273 | |
376 | msgid "Location:" | |
377 | msgstr "Lokasi:" | |
378 | ||
379 | #: tepl/tepl-tab-label.c:342 | |
380 | msgid "Close file" | |
381 | msgstr "Tutup berkas" | |
382 | ||
383 | #: tepl/tepl-tab-saving.c:64 | |
384 | msgid "Error when saving the file." | |
385 | msgstr "Galat saat menyimpan berkas." | |
386 | ||
387 | #~ msgid "Could not find the file “%s”." | |
388 | #~ msgstr "Tak bisa temukan berkas \"%s\"." | |
389 | ||
390 | #~ msgid "Please check that you typed the location correctly and try again." | |
391 | #~ msgstr "" | |
392 | #~ "Silakan periksa apakah lokasi yang Anda ketikkan benar dan coba lagi." | |
393 | ||
394 | #~ msgid "Unable to handle “%s:” locations." | |
395 | #~ msgstr "Tak bisa menangani lokasi \"%s:\"." | |
396 | ||
397 | #~ msgid "The location of the file cannot be accessed." | |
398 | #~ msgstr "Lokasi berkas tak dapat diakses." | |
399 | ||
400 | #~ msgid "“%s” is a directory." | |
401 | #~ msgstr "\"%s\" adalah direktori." | |
402 | ||
403 | #~ msgid "“%s” is not a valid location." | |
404 | #~ msgstr "\"%s\" bukan lokasi yang sah." | |
405 | ||
406 | #~ msgid "" | |
407 | #~ "Host “%s” could not be found. Please check that your proxy settings are " | |
408 | #~ "correct and try again." | |
409 | #~ msgstr "" | |
410 | #~ "Host \"%s\" tidak dapat ditemukan. Silakan periksa apakah tatanan proksi " | |
411 | #~ "Anda sudah benar dan coba lagi." | |
412 | ||
413 | #~ msgid "" | |
414 | #~ "Hostname was invalid. Please check that you typed the location correctly " | |
415 | #~ "and try again." | |
416 | #~ msgstr "" | |
417 | #~ "Nama host tidak valid. Silakan periksa lokasi yg Anda tik dan coba lagi." | |
418 | ||
419 | #~ msgid "“%s” is not a regular file." | |
420 | #~ msgstr "\"%s\" bukan berkas reguler." | |
421 | ||
422 | #~ msgid "Connection timed out. Please try again." | |
423 | #~ msgstr "Koneksi melewati waktu tunggu. Silakan coba lagi." | |
424 | ||
425 | #~ msgid "Unexpected error: %s" | |
426 | #~ msgstr "Kesalahan yang tidak diduga: %s" | |
427 | ||
428 | #~ msgid "_Retry" | |
429 | #~ msgstr "_Ulangi" | |
430 | ||
431 | #~ msgid "Edit Any_way" | |
432 | #~ msgstr "Sunt_ing Saja" | |
433 | ||
434 | #~ msgid "" | |
435 | #~ "The number of followed links is limited and the actual file could not be " | |
436 | #~ "found within this limit." | |
437 | #~ msgstr "" | |
438 | #~ "Cacah taut yang diikuti terbatas dan berkas sesungguhnya tak ditemukan " | |
439 | #~ "dalam batas ini." | |
440 | ||
441 | #~ msgid "You do not have the permissions necessary to open the file." | |
442 | #~ msgstr "Anda tidak memiliki izin yang diperlukan untuk membuka berkas." | |
443 | ||
444 | #~ msgid "" | |
445 | #~ "Unable to detect the character encoding.\n" | |
446 | #~ "Please check that you are not trying to open a binary file.\n" | |
447 | #~ "Select a character encoding from the menu and try again." | |
448 | #~ msgstr "" | |
449 | #~ "Tidak bisa mendeteksi pengkodean karakter.\n" | |
450 | #~ "Harap periksa bahwa Anda tidak mencoba membuka suatu berkas biner.\n" | |
451 | #~ "Pilih suatu pengkodean karakter dari menu dan cobalah lagi." | |
452 | ||
453 | #~ msgid "There was a problem opening the file “%s”." | |
454 | #~ msgstr "Ada masalah ketika membuka berkas \"%s\"." | |
455 | ||
456 | #~ msgid "" | |
457 | #~ "The file you opened has some invalid characters. If you continue editing " | |
458 | #~ "this file you could corrupt it.\n" | |
459 | #~ "You can also choose another character encoding and try again." | |
460 | #~ msgstr "" | |
461 | #~ "Berkas yang Anda buka memiliki beberapa karakter yang tidak valid. Bila " | |
462 | #~ "Anda melanjutkan menyunting berkas ini Anda bisa merusaknya.\n" | |
463 | #~ "Anda juga dapat memilih pengkodean karakter yang lain dan mencoba lagi." | |
464 | ||
465 | #~ msgid "Could not open the file “%s” using the “%s” character encoding." | |
466 | #~ msgstr "" | |
467 | #~ "Tak dapat membuka berkas \"%s\" menggunakan pengkodean karakter \"%s\"." | |
468 | ||
469 | #~ msgid "" | |
470 | #~ "Please check that you are not trying to open a binary file.\n" | |
471 | #~ "Select a different character encoding from the menu and try again." | |
472 | #~ msgstr "" | |
473 | #~ "Harap periksa bahwa Anda tidak mencoba membuka suatu berkas biner.\n" | |
474 | #~ "Pilih suatu pengkodean karakter lain dari menu dan cobalah lagi." | |
475 | ||
476 | #~ msgid "Could not open the file “%s”." | |
477 | #~ msgstr "Tidak bisa membuka berkas \"%s\"." |
0 | # Polish translation for tepl. | |
1 | # Copyright © 2017 the tepl authors. | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Piotr Drąg <piotrdrag@gmail.com>, 2017. | |
4 | # Aviary.pl <community-poland@mozilla.org>, 2017. | |
5 | # | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: tepl\n" | |
9 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
10 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
11 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
12 | "PO-Revision-Date: 2017-12-03 18:37+0100\n" | |
13 | "Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n" | |
14 | "Language-Team: Polish <community-poland@mozilla.org>\n" | |
15 | "Language: pl\n" | |
16 | "MIME-Version: 1.0\n" | |
17 | "Content-Type: text/plain; charset=UTF-8\n" | |
18 | "Content-Transfer-Encoding: 8bit\n" | |
19 | "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " | |
20 | "|| n%100>=20) ? 1 : 2);\n" | |
21 | ||
22 | #. Translators: %s is a filename. | |
23 | #: amtk/amtk-application-window.c:374 | |
24 | #, c-format | |
25 | msgid "Open “%s”" | |
26 | msgstr "Otwórz „%s”" | |
27 | ||
28 | #: amtk/amtk-application-window.c:630 | |
29 | msgid "Open _Recent" | |
30 | msgstr "Ostatnio używane doku_menty" | |
31 | ||
32 | #. Translators: %s is the application name. | |
33 | #: amtk/amtk-application-window.c:633 | |
34 | #, c-format | |
35 | msgid "Open a file recently used with %s" | |
36 | msgstr "Otwarcie pliku ostatnio używanego w programie %s" | |
37 | ||
38 | #. action, icon, label, accel, tooltip | |
39 | #. File menu | |
40 | #. Why "file" and not "document"? "Document" is not the best | |
41 | #. word because the action is not always to create a new | |
42 | #. document. For example a LaTeX document can be composed of | |
43 | #. several _files_. Or for source code we do not really create a | |
44 | #. new "document". | |
45 | #: tepl/tepl-application.c:92 | |
46 | msgid "_New" | |
47 | msgstr "_Nowy" | |
48 | ||
49 | #: tepl/tepl-application.c:93 | |
50 | msgid "New file" | |
51 | msgstr "Nowy plik" | |
52 | ||
53 | #: tepl/tepl-application.c:95 | |
54 | msgid "New _Window" | |
55 | msgstr "No_we okno" | |
56 | ||
57 | #: tepl/tepl-application.c:96 | |
58 | msgid "Create a new window" | |
59 | msgstr "Otwiera nowe okno" | |
60 | ||
61 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
62 | msgid "_Open" | |
63 | msgstr "_Otwórz" | |
64 | ||
65 | #: tepl/tepl-application.c:99 | |
66 | msgid "Open a file" | |
67 | msgstr "Otwiera plik" | |
68 | ||
69 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
70 | #: tepl/tepl-tab.c:752 | |
71 | msgid "_Save" | |
72 | msgstr "_Zapisz" | |
73 | ||
74 | #: tepl/tepl-application.c:102 | |
75 | msgid "Save the current file" | |
76 | msgstr "Zapisuje obecny plik" | |
77 | ||
78 | #: tepl/tepl-application.c:104 | |
79 | msgid "Save _As" | |
80 | msgstr "Z_apisz jako" | |
81 | ||
82 | #: tepl/tepl-application.c:105 | |
83 | msgid "Save the current file to a different location" | |
84 | msgstr "Zapisuje obecny plik w innym miejscu" | |
85 | ||
86 | #. Edit menu | |
87 | #: tepl/tepl-application.c:109 | |
88 | msgid "_Undo" | |
89 | msgstr "_Cofnij" | |
90 | ||
91 | #: tepl/tepl-application.c:110 | |
92 | msgid "Undo the last action" | |
93 | msgstr "Cofa ostatnie działanie" | |
94 | ||
95 | #: tepl/tepl-application.c:112 | |
96 | msgid "_Redo" | |
97 | msgstr "P_onów" | |
98 | ||
99 | #: tepl/tepl-application.c:113 | |
100 | msgid "Redo the last undone action" | |
101 | msgstr "Ponawia ostatnio cofnięte działanie" | |
102 | ||
103 | #: tepl/tepl-application.c:115 | |
104 | msgid "Cu_t" | |
105 | msgstr "_Wytnij" | |
106 | ||
107 | #: tepl/tepl-application.c:116 | |
108 | msgid "Cut the selection" | |
109 | msgstr "Wycina zaznaczenie" | |
110 | ||
111 | #: tepl/tepl-application.c:118 | |
112 | msgid "_Copy" | |
113 | msgstr "S_kopiuj" | |
114 | ||
115 | #: tepl/tepl-application.c:119 | |
116 | msgid "Copy the selection" | |
117 | msgstr "Kopiuje zaznaczenie" | |
118 | ||
119 | #: tepl/tepl-application.c:121 | |
120 | msgid "_Paste" | |
121 | msgstr "Wk_lej" | |
122 | ||
123 | #: tepl/tepl-application.c:122 | |
124 | msgid "Paste the clipboard" | |
125 | msgstr "Wkleja zawartość schowka" | |
126 | ||
127 | #: tepl/tepl-application.c:124 | |
128 | msgid "_Delete" | |
129 | msgstr "_Usuń" | |
130 | ||
131 | #: tepl/tepl-application.c:125 | |
132 | msgid "Delete the selected text" | |
133 | msgstr "Usuwa zaznaczony tekst" | |
134 | ||
135 | #: tepl/tepl-application.c:127 | |
136 | msgid "Select _All" | |
137 | msgstr "Z_aznacz wszystko" | |
138 | ||
139 | #: tepl/tepl-application.c:128 | |
140 | msgid "Select all the text" | |
141 | msgstr "Zaznacza cały tekst" | |
142 | ||
143 | #: tepl/tepl-application.c:130 | |
144 | msgid "_Indent" | |
145 | msgstr "_Dodaj wcięcie" | |
146 | ||
147 | #: tepl/tepl-application.c:131 | |
148 | msgid "Indent the selected lines" | |
149 | msgstr "Dodaje wcięcie do zaznaczonych wierszy" | |
150 | ||
151 | #: tepl/tepl-application.c:133 | |
152 | msgid "_Unindent" | |
153 | msgstr "_Usuń wcięcie" | |
154 | ||
155 | #: tepl/tepl-application.c:134 | |
156 | msgid "Unindent the selected lines" | |
157 | msgstr "Usuwa wcięcie z zaznaczonych wierszy" | |
158 | ||
159 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
160 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
161 | #. * doesn't have the real path to the file, so it would screw up some | |
162 | #. * features for text editors: | |
163 | #. * - showing the directory in parentheses in the window title, or in the | |
164 | #. * tab tooltip; | |
165 | #. * - opening a recent file. | |
166 | #. * Basically everywhere where the directory is shown. | |
167 | #. | |
168 | #: tepl/tepl-application-window.c:174 | |
169 | msgid "Open File" | |
170 | msgstr "Otwarcie pliku" | |
171 | ||
172 | #: tepl/tepl-application-window.c:177 | |
173 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
174 | msgid "_Cancel" | |
175 | msgstr "_Anuluj" | |
176 | ||
177 | #: tepl/tepl-application-window.c:708 | |
178 | msgid "Read-Only" | |
179 | msgstr "Tylko do odczytu" | |
180 | ||
181 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
182 | #, c-format | |
183 | msgid "Save changes to file “%s” before closing?" | |
184 | msgstr "Zapisać zmiany przed zamknięciem pliku „%s”?" | |
185 | ||
186 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
187 | msgid "Close _without Saving" | |
188 | msgstr "Zamknij _bez zapisywania" | |
189 | ||
190 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
191 | msgid "_Save As…" | |
192 | msgstr "Zapi_sz jako…" | |
193 | ||
194 | #. UTF-8 first, so that it's the first encoding returned by | |
195 | #. * tepl_encoding_get_all(). | |
196 | #. | |
197 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
198 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
199 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
200 | msgid "Unicode" | |
201 | msgstr "unikod" | |
202 | ||
203 | #. FIXME GEOSTD8 ? | |
204 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
205 | #: tepl/tepl-encoding.c:180 | |
206 | msgid "Western" | |
207 | msgstr "zachodnie" | |
208 | ||
209 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
210 | msgid "Central European" | |
211 | msgstr "środkowoeuropejskie" | |
212 | ||
213 | #: tepl/tepl-encoding.c:119 | |
214 | msgid "South European" | |
215 | msgstr "południowoeuropejskie" | |
216 | ||
217 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
218 | msgid "Baltic" | |
219 | msgstr "bałtyckie" | |
220 | ||
221 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
222 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
223 | msgid "Cyrillic" | |
224 | msgstr "cyrylica" | |
225 | ||
226 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
227 | msgid "Arabic" | |
228 | msgstr "arabskie" | |
229 | ||
230 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
231 | msgid "Greek" | |
232 | msgstr "greckie" | |
233 | ||
234 | #: tepl/tepl-encoding.c:124 | |
235 | msgid "Hebrew Visual" | |
236 | msgstr "hebrajskie (wizualne)" | |
237 | ||
238 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
239 | msgid "Turkish" | |
240 | msgstr "tureckie" | |
241 | ||
242 | #: tepl/tepl-encoding.c:126 | |
243 | msgid "Nordic" | |
244 | msgstr "skandynawskie" | |
245 | ||
246 | #: tepl/tepl-encoding.c:128 | |
247 | msgid "Celtic" | |
248 | msgstr "celtyckie" | |
249 | ||
250 | #: tepl/tepl-encoding.c:130 | |
251 | msgid "Romanian" | |
252 | msgstr "rumuńskie" | |
253 | ||
254 | #: tepl/tepl-encoding.c:140 | |
255 | msgid "Armenian" | |
256 | msgstr "ormiańskie" | |
257 | ||
258 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
259 | msgid "Chinese Traditional" | |
260 | msgstr "chińskie (tradycyjne)" | |
261 | ||
262 | #: tepl/tepl-encoding.c:143 | |
263 | msgid "Cyrillic/Russian" | |
264 | msgstr "cyrylica/rosyjskie" | |
265 | ||
266 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
267 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
268 | msgid "Japanese" | |
269 | msgstr "japońskie" | |
270 | ||
271 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
272 | #: tepl/tepl-encoding.c:175 | |
273 | msgid "Korean" | |
274 | msgstr "koreańskie" | |
275 | ||
276 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
277 | msgid "Chinese Simplified" | |
278 | msgstr "chińskie (uproszczone)" | |
279 | ||
280 | #: tepl/tepl-encoding.c:155 | |
281 | msgid "Georgian" | |
282 | msgstr "gruzińskie" | |
283 | ||
284 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
285 | msgid "Hebrew" | |
286 | msgstr "hebrajskie" | |
287 | ||
288 | #: tepl/tepl-encoding.c:170 | |
289 | msgid "Cyrillic/Ukrainian" | |
290 | msgstr "cyrylica/ukraińskie" | |
291 | ||
292 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
293 | msgid "Vietnamese" | |
294 | msgstr "wietnamskie" | |
295 | ||
296 | #: tepl/tepl-encoding.c:174 | |
297 | msgid "Thai" | |
298 | msgstr "tajskie" | |
299 | ||
300 | #: tepl/tepl-encoding.c:370 | |
301 | msgid "Unknown" | |
302 | msgstr "nieznane" | |
303 | ||
304 | #. Translators: This is the sorted list of encodings used by Tepl for | |
305 | #. * automatic detection of the file encoding. You may want to customize | |
306 | #. * it adding encodings that are common in your country, for instance the | |
307 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
308 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
309 | #. * European languages) if you think people in your country will rarely | |
310 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
311 | #. * the encoding for the current locale, so please don't translate the | |
312 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
313 | #. * commas. | |
314 | #. | |
315 | #: tepl/tepl-encoding.c:695 | |
316 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
317 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-2', 'WINDOWS-1250', 'UTF-16']" | |
318 | ||
319 | #: tepl/tepl-encoding-converter.c:302 | |
320 | #, c-format | |
321 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
322 | msgstr "Konwersja z zestawu znaków „%s” do „%s” jest nieobsługiwana." | |
323 | ||
324 | #: tepl/tepl-encoding-converter.c:311 | |
325 | #, c-format | |
326 | msgid "Could not open converter from “%s” to “%s”: %s" | |
327 | msgstr "Nie można otworzyć konwertera z „%s” do „%s”: %s" | |
328 | ||
329 | #: tepl/tepl-encoding-converter.c:368 | |
330 | msgid "The input data contains an invalid sequence." | |
331 | msgstr "Dane wejściowe zawierają nieprawidłową sekwencję." | |
332 | ||
333 | #: tepl/tepl-encoding-converter.c:377 | |
334 | #, c-format | |
335 | msgid "Error when converting data: %s" | |
336 | msgstr "Błąd podczas konwersji danych: %s" | |
337 | ||
338 | #: tepl/tepl-encoding-converter.c:556 | |
339 | msgid "The input data ends with an incomplete multi-byte sequence." | |
340 | msgstr "Dane wejściowe kończą się niepełną sekwencją wielobajtową." | |
341 | ||
342 | #: tepl/tepl-encoding-converter.c:579 | |
343 | msgid "The input content ends with incomplete data." | |
344 | msgstr "Treść wejściowa kończą się niepełnymi danymi." | |
345 | ||
346 | #: tepl/tepl-file.c:413 | |
347 | #, c-format | |
348 | msgid "Untitled File %d" | |
349 | msgstr "%d. plik bez tytułu" | |
350 | ||
351 | #: tepl/tepl-file-content-loader.c:331 | |
352 | #, c-format | |
353 | msgid "The file is too big. Maximum %s can be loaded." | |
354 | msgstr "Plik jest za duży. Maksymalnie można wczytać %s." | |
355 | ||
356 | #: tepl/tepl-file-loader.c:872 | |
357 | msgid "It is not possible to detect the character encoding automatically." | |
358 | msgstr "Nie można automatycznie wykryć kodowania znaków." | |
359 | ||
360 | #: tepl/tepl-file-saver.c:784 | |
361 | msgid "The file is externally modified." | |
362 | msgstr "Plik został zmodyfikowany poza programem." | |
363 | ||
364 | #: tepl/tepl-file-saver.c:1318 | |
365 | msgid "The buffer contains invalid characters." | |
366 | msgstr "Bufor zawiera nieprawidłowe znaki." | |
367 | ||
368 | #: tepl/tepl-tab.c:534 | |
369 | msgid "Error when loading the file." | |
370 | msgstr "Błąd podczas wczytywania pliku." | |
371 | ||
372 | #: tepl/tepl-tab.c:748 | |
373 | msgid "Save File" | |
374 | msgstr "Zapis pliku" | |
375 | ||
376 | #. Translators: location of a file. | |
377 | #: tepl/tepl-tab-label.c:273 | |
378 | msgid "Location:" | |
379 | msgstr "Położenie:" | |
380 | ||
381 | #: tepl/tepl-tab-label.c:342 | |
382 | msgid "Close file" | |
383 | msgstr "Zamyka plik" | |
384 | ||
385 | #: tepl/tepl-tab-saving.c:64 | |
386 | msgid "Error when saving the file." | |
387 | msgstr "Błąd podczas zapisywania pliku." | |
388 | ||
389 | #~ msgid "Could not find the file “%s”." | |
390 | #~ msgstr "Nie można odnaleźć pliku „%s”." | |
391 | ||
392 | #~ msgid "Please check that you typed the location correctly and try again." | |
393 | #~ msgstr "" | |
394 | #~ "Proszę sprawdzić, czy wprowadzone zostało poprawne położenie i spróbować " | |
395 | #~ "ponownie." | |
396 | ||
397 | #~ msgid "Unable to handle “%s:” locations." | |
398 | #~ msgstr "Nie można obsłużyć położeń „%s:”." | |
399 | ||
400 | #~ msgid "The location of the file cannot be accessed." | |
401 | #~ msgstr "Nie można uzyskać dostępu do położenia pliku." | |
402 | ||
403 | #~ msgid "“%s” is a directory." | |
404 | #~ msgstr "„%s” jest katalogiem." | |
405 | ||
406 | #~ msgid "“%s” is not a valid location." | |
407 | #~ msgstr "„%s” nie jest prawidłowym położeniem." | |
408 | ||
409 | #~ msgid "" | |
410 | #~ "Host “%s” could not be found. Please check that your proxy settings are " | |
411 | #~ "correct and try again." | |
412 | #~ msgstr "" | |
413 | #~ "Nie można odnaleźć komputera „%s”. Proszę sprawdzić poprawność ustawień " | |
414 | #~ "pośrednika i spróbować ponownie." | |
415 | ||
416 | #~ msgid "" | |
417 | #~ "Hostname was invalid. Please check that you typed the location correctly " | |
418 | #~ "and try again." | |
419 | #~ msgstr "" | |
420 | #~ "Nazwa komputera jest nieprawidłowa. Proszę sprawdzić, czy wprowadzone " | |
421 | #~ "położenie jest poprawne i spróbować ponownie." | |
422 | ||
423 | #~ msgid "“%s” is not a regular file." | |
424 | #~ msgstr "„%s” nie jest zwykłym plikiem." | |
425 | ||
426 | #~ msgid "Connection timed out. Please try again." | |
427 | #~ msgstr "Przekroczono czas połączenia. Proszę spróbować ponownie." | |
428 | ||
429 | #~ msgid "Unexpected error: %s" | |
430 | #~ msgstr "Nieoczekiwany błąd: %s" | |
431 | ||
432 | #~ msgid "_Retry" | |
433 | #~ msgstr "P_onów" | |
434 | ||
435 | #~ msgid "Edit Any_way" | |
436 | #~ msgstr "_Modyfikuj mimo to" | |
437 | ||
438 | #~ msgid "" | |
439 | #~ "The number of followed links is limited and the actual file could not be " | |
440 | #~ "found within this limit." | |
441 | #~ msgstr "" | |
442 | #~ "Liczba dowiązań do podążenia jest ograniczona. Plik nie został " | |
443 | #~ "odnaleziony w zakresie tego ograniczenia." | |
444 | ||
445 | #~ msgid "You do not have the permissions necessary to open the file." | |
446 | #~ msgstr "Brak odpowiednich uprawnień do otwarcia tego pliku." | |
447 | ||
448 | #~ msgid "" | |
449 | #~ "Unable to detect the character encoding.\n" | |
450 | #~ "Please check that you are not trying to open a binary file.\n" | |
451 | #~ "Select a character encoding from the menu and try again." | |
452 | #~ msgstr "" | |
453 | #~ "Nie można wykryć kodowania znaków.\n" | |
454 | #~ "Proszę sprawdzić, czy otwierany plik nie jest binarny.\n" | |
455 | #~ "Można także wybrać kodowanie znaków w menu i spróbować ponownie." | |
456 | ||
457 | #~ msgid "There was a problem opening the file “%s”." | |
458 | #~ msgstr "Wystąpił problem podczas otwierania pliku „%s”." | |
459 | ||
460 | #~ msgid "" | |
461 | #~ "The file you opened has some invalid characters. If you continue editing " | |
462 | #~ "this file you could corrupt it.\n" | |
463 | #~ "You can also choose another character encoding and try again." | |
464 | #~ msgstr "" | |
465 | #~ "Otwarty plik zawiera nieprawidłowe znaki. Jeśli modyfikowanie tego pliku " | |
466 | #~ "zostanie kontynuowane, może on zostać uszkodzony.\n" | |
467 | #~ "Można także wybrać inne kodowanie znaków i spróbować ponownie." | |
468 | ||
469 | #~ msgid "Could not open the file “%s” using the “%s” character encoding." | |
470 | #~ msgstr "Nie można otworzyć pliku „%s” za pomocą kodowania znaków „%s”." | |
471 | ||
472 | #~ msgid "" | |
473 | #~ "Please check that you are not trying to open a binary file.\n" | |
474 | #~ "Select a different character encoding from the menu and try again." | |
475 | #~ msgstr "" | |
476 | #~ "Proszę sprawdzić, czy otwierany plik nie jest binarny.\n" | |
477 | #~ "Można także wybrać inne kodowanie znaków w menu i spróbować ponownie." | |
478 | ||
479 | #~ msgid "Could not open the file “%s”." | |
480 | #~ msgstr "Nie można otworzyć pliku „%s”." |
0 | # Brazilian Portuguese translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Rafael Fontenelle <rafaelff@gnome.org>, 2017. | |
4 | msgid "" | |
5 | msgstr "" | |
6 | "Project-Id-Version: tepl master\n" | |
7 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=tepl&k" | |
8 | "eywords=I18N+L10N&component=general\n" | |
9 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
10 | "PO-Revision-Date: 2017-12-12 06:28-0200\n" | |
11 | "Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n" | |
12 | "Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n" | |
13 | "Language: pt_BR\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" | |
18 | "X-Generator: Virtaal 1.0.0-beta1\n" | |
19 | "X-Project-Style: gnome\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Abrir “%s”" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Abrir _recente" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Abre um arquivo recentemente usado com %s" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "_Novo" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Novo arquivo" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "Nova _janela" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Cria uma nova janela" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "_Abrir" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | #| msgid "New file" | |
66 | msgid "Open a file" | |
67 | msgstr "Abre um arquivo" | |
68 | ||
69 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
70 | #: tepl/tepl-tab.c:752 | |
71 | msgid "_Save" | |
72 | msgstr "_Salvar" | |
73 | ||
74 | #: tepl/tepl-application.c:102 | |
75 | msgid "Save the current file" | |
76 | msgstr "Salva o arquivo atual" | |
77 | ||
78 | #: tepl/tepl-application.c:104 | |
79 | msgid "Save _As" | |
80 | msgstr "Salvar _como" | |
81 | ||
82 | #: tepl/tepl-application.c:105 | |
83 | msgid "Save the current file to a different location" | |
84 | msgstr "Salva o arquivo atual em um local diferente" | |
85 | ||
86 | #. Edit menu | |
87 | #: tepl/tepl-application.c:109 | |
88 | msgid "_Undo" | |
89 | msgstr "_Desfazer" | |
90 | ||
91 | #: tepl/tepl-application.c:110 | |
92 | #| msgid "Copy the selection" | |
93 | msgid "Undo the last action" | |
94 | msgstr "Desfaz a última ação" | |
95 | ||
96 | #: tepl/tepl-application.c:112 | |
97 | msgid "_Redo" | |
98 | msgstr "_Refazer" | |
99 | ||
100 | #: tepl/tepl-application.c:113 | |
101 | msgid "Redo the last undone action" | |
102 | msgstr "Refaz a última ação desfeita" | |
103 | ||
104 | #: tepl/tepl-application.c:115 | |
105 | msgid "Cu_t" | |
106 | msgstr "Recor_tar" | |
107 | ||
108 | #: tepl/tepl-application.c:116 | |
109 | msgid "Cut the selection" | |
110 | msgstr "Recorta a seleção" | |
111 | ||
112 | #: tepl/tepl-application.c:118 | |
113 | msgid "_Copy" | |
114 | msgstr "_Copiar" | |
115 | ||
116 | #: tepl/tepl-application.c:119 | |
117 | msgid "Copy the selection" | |
118 | msgstr "Copia a seleção" | |
119 | ||
120 | #: tepl/tepl-application.c:121 | |
121 | msgid "_Paste" | |
122 | msgstr "C_olar" | |
123 | ||
124 | #: tepl/tepl-application.c:122 | |
125 | msgid "Paste the clipboard" | |
126 | msgstr "Cola conteúdo da área de transferência" | |
127 | ||
128 | #: tepl/tepl-application.c:124 | |
129 | msgid "_Delete" | |
130 | msgstr "E_xcluir" | |
131 | ||
132 | #: tepl/tepl-application.c:125 | |
133 | msgid "Delete the selected text" | |
134 | msgstr "Exclui o texto selecionado" | |
135 | ||
136 | #: tepl/tepl-application.c:127 | |
137 | msgid "Select _All" | |
138 | msgstr "Selecionar _tudo" | |
139 | ||
140 | #: tepl/tepl-application.c:128 | |
141 | msgid "Select all the text" | |
142 | msgstr "Seleciona todo o texto" | |
143 | ||
144 | #: tepl/tepl-application.c:130 | |
145 | msgid "_Indent" | |
146 | msgstr "_Recuar" | |
147 | ||
148 | #: tepl/tepl-application.c:131 | |
149 | #| msgid "Delete the selected text" | |
150 | msgid "Indent the selected lines" | |
151 | msgstr "Recua as linhas selecionadas" | |
152 | ||
153 | #: tepl/tepl-application.c:133 | |
154 | msgid "_Unindent" | |
155 | msgstr "Re_tirar recuo" | |
156 | ||
157 | #: tepl/tepl-application.c:134 | |
158 | #| msgid "Delete the selected text" | |
159 | msgid "Unindent the selected lines" | |
160 | msgstr "Retira recuo das linhas selecionadas" | |
161 | ||
162 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
163 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
164 | #. * doesn't have the real path to the file, so it would screw up some | |
165 | #. * features for text editors: | |
166 | #. * - showing the directory in parentheses in the window title, or in the | |
167 | #. * tab tooltip; | |
168 | #. * - opening a recent file. | |
169 | #. * Basically everywhere where the directory is shown. | |
170 | #. | |
171 | #: tepl/tepl-application-window.c:174 | |
172 | msgid "Open File" | |
173 | msgstr "Abrir arquivo" | |
174 | ||
175 | #: tepl/tepl-application-window.c:177 | |
176 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
177 | msgid "_Cancel" | |
178 | msgstr "_Cancelar" | |
179 | ||
180 | #: tepl/tepl-application-window.c:708 | |
181 | msgid "Read-Only" | |
182 | msgstr "Apenas leitura" | |
183 | ||
184 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
185 | #, c-format | |
186 | msgid "Save changes to file “%s” before closing?" | |
187 | msgstr "Salvar alterações ao arquivo “%s” antes de fechar?" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
190 | msgid "Close _without Saving" | |
191 | msgstr "_Fechar sem salvar" | |
192 | ||
193 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
194 | msgid "_Save As…" | |
195 | msgstr "_Salvar como…" | |
196 | ||
197 | #. UTF-8 first, so that it's the first encoding returned by | |
198 | #. * tepl_encoding_get_all(). | |
199 | #. | |
200 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
201 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
202 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
203 | msgid "Unicode" | |
204 | msgstr "Unicode" | |
205 | ||
206 | #. FIXME GEOSTD8 ? | |
207 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
208 | #: tepl/tepl-encoding.c:180 | |
209 | msgid "Western" | |
210 | msgstr "Ocidental" | |
211 | ||
212 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
213 | msgid "Central European" | |
214 | msgstr "Europeu central" | |
215 | ||
216 | #: tepl/tepl-encoding.c:119 | |
217 | msgid "South European" | |
218 | msgstr "Europeu meridional" | |
219 | ||
220 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
221 | msgid "Baltic" | |
222 | msgstr "Báltico" | |
223 | ||
224 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
225 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
226 | msgid "Cyrillic" | |
227 | msgstr "Cirílico" | |
228 | ||
229 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
230 | msgid "Arabic" | |
231 | msgstr "Arábico" | |
232 | ||
233 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
234 | msgid "Greek" | |
235 | msgstr "Grego" | |
236 | ||
237 | #: tepl/tepl-encoding.c:124 | |
238 | msgid "Hebrew Visual" | |
239 | msgstr "Hebraico visual" | |
240 | ||
241 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
242 | msgid "Turkish" | |
243 | msgstr "Turco" | |
244 | ||
245 | #: tepl/tepl-encoding.c:126 | |
246 | msgid "Nordic" | |
247 | msgstr "Nórdico" | |
248 | ||
249 | #: tepl/tepl-encoding.c:128 | |
250 | msgid "Celtic" | |
251 | msgstr "Celta" | |
252 | ||
253 | #: tepl/tepl-encoding.c:130 | |
254 | msgid "Romanian" | |
255 | msgstr "Romeno" | |
256 | ||
257 | #: tepl/tepl-encoding.c:140 | |
258 | msgid "Armenian" | |
259 | msgstr "Armênio" | |
260 | ||
261 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
262 | msgid "Chinese Traditional" | |
263 | msgstr "Chinês tradicional" | |
264 | ||
265 | #: tepl/tepl-encoding.c:143 | |
266 | msgid "Cyrillic/Russian" | |
267 | msgstr "Cirílico/Russo" | |
268 | ||
269 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
270 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
271 | msgid "Japanese" | |
272 | msgstr "Japonês" | |
273 | ||
274 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
275 | #: tepl/tepl-encoding.c:175 | |
276 | msgid "Korean" | |
277 | msgstr "Coreano" | |
278 | ||
279 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
280 | msgid "Chinese Simplified" | |
281 | msgstr "Chinês simplificado" | |
282 | ||
283 | #: tepl/tepl-encoding.c:155 | |
284 | msgid "Georgian" | |
285 | msgstr "Georgiano" | |
286 | ||
287 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
288 | msgid "Hebrew" | |
289 | msgstr "Hebraico" | |
290 | ||
291 | #: tepl/tepl-encoding.c:170 | |
292 | msgid "Cyrillic/Ukrainian" | |
293 | msgstr "Cirílico/Ucraniano" | |
294 | ||
295 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
296 | msgid "Vietnamese" | |
297 | msgstr "Vietnamita" | |
298 | ||
299 | #: tepl/tepl-encoding.c:174 | |
300 | msgid "Thai" | |
301 | msgstr "Tailandês" | |
302 | ||
303 | #: tepl/tepl-encoding.c:370 | |
304 | msgid "Unknown" | |
305 | msgstr "Desconhecido" | |
306 | ||
307 | #. Translators: This is the sorted list of encodings used by Tepl for | |
308 | #. * automatic detection of the file encoding. You may want to customize | |
309 | #. * it adding encodings that are common in your country, for instance the | |
310 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
311 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
312 | #. * European languages) if you think people in your country will rarely | |
313 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
314 | #. * the encoding for the current locale, so please don't translate the | |
315 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
316 | #. * commas. | |
317 | #. | |
318 | #: tepl/tepl-encoding.c:695 | |
319 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
320 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
321 | ||
322 | #: tepl/tepl-encoding-converter.c:302 | |
323 | #, c-format | |
324 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
325 | msgstr "Não há suporte a conversão de conjunto de caracteres “%s” para “%s”." | |
326 | ||
327 | #: tepl/tepl-encoding-converter.c:311 | |
328 | #, c-format | |
329 | msgid "Could not open converter from “%s” to “%s”: %s" | |
330 | msgstr "Não foi possível abrir o conversor de “%s” para “%s”: %s" | |
331 | ||
332 | #: tepl/tepl-encoding-converter.c:368 | |
333 | msgid "The input data contains an invalid sequence." | |
334 | msgstr "Os dados de entrada contêm uma sequência inválida." | |
335 | ||
336 | #: tepl/tepl-encoding-converter.c:377 | |
337 | #, c-format | |
338 | msgid "Error when converting data: %s" | |
339 | msgstr "Erro ao converter dados: %s" | |
340 | ||
341 | #: tepl/tepl-encoding-converter.c:556 | |
342 | msgid "The input data ends with an incomplete multi-byte sequence." | |
343 | msgstr "Os dados de entrada terminam com uma sequência multibyte incompleta." | |
344 | ||
345 | #: tepl/tepl-encoding-converter.c:579 | |
346 | msgid "The input content ends with incomplete data." | |
347 | msgstr "O conteúdo de entrada termina com dados incompletos." | |
348 | ||
349 | #: tepl/tepl-file.c:413 | |
350 | #, c-format | |
351 | msgid "Untitled File %d" | |
352 | msgstr "Arquivo sem título %d" | |
353 | ||
354 | #: tepl/tepl-file-content-loader.c:331 | |
355 | #, c-format | |
356 | msgid "The file is too big. Maximum %s can be loaded." | |
357 | msgstr "O arquivo é grande demais. No máximo %s pode ser carregado." | |
358 | ||
359 | #: tepl/tepl-file-loader.c:872 | |
360 | msgid "It is not possible to detect the character encoding automatically." | |
361 | msgstr "Não foi possível detectar a codificação de caracteres automaticamente." | |
362 | ||
363 | #: tepl/tepl-file-saver.c:784 | |
364 | msgid "The file is externally modified." | |
365 | msgstr "O arquivo foi modificado externamente." | |
366 | ||
367 | #: tepl/tepl-file-saver.c:1318 | |
368 | msgid "The buffer contains invalid characters." | |
369 | msgstr "O buffer contém caracteres inválidos." | |
370 | ||
371 | #: tepl/tepl-tab.c:534 | |
372 | #| msgid "Error when converting data: %s" | |
373 | msgid "Error when loading the file." | |
374 | msgstr "Erro ao carregar o arquivo." | |
375 | ||
376 | #: tepl/tepl-tab.c:748 | |
377 | msgid "Save File" | |
378 | msgstr "Salvar arquivo" | |
379 | ||
380 | #. Translators: location of a file. | |
381 | #: tepl/tepl-tab-label.c:273 | |
382 | msgid "Location:" | |
383 | msgstr "Localização:" | |
384 | ||
385 | #: tepl/tepl-tab-label.c:342 | |
386 | msgid "Close file" | |
387 | msgstr "Fecha o arquivo" | |
388 | ||
389 | #: tepl/tepl-tab-saving.c:64 | |
390 | #| msgid "Error when converting data: %s" | |
391 | msgid "Error when saving the file." | |
392 | msgstr "Erro ao salvar o arquivo." | |
393 | ||
394 | #~ msgid "Could not find the file “%s”." | |
395 | #~ msgstr "Não foi possível localizar o arquivo “%s”." | |
396 | ||
397 | #~ msgid "Please check that you typed the location correctly and try again." | |
398 | #~ msgstr "" | |
399 | #~ "Por favor, verifique se você digitou a localização correta e tente " | |
400 | #~ "novamente." | |
401 | ||
402 | #~ msgid "Unable to handle “%s:” locations." | |
403 | #~ msgstr "Não é possível tratar de localizações “%s:”." | |
404 | ||
405 | #~ msgid "The location of the file cannot be accessed." | |
406 | #~ msgstr "A localização do arquivo não pode ser acessada." | |
407 | ||
408 | #~ msgid "“%s” is a directory." | |
409 | #~ msgstr "“%s” é um diretório." | |
410 | ||
411 | #~ msgid "“%s” is not a valid location." | |
412 | #~ msgstr "“%s” não é uma localização válida." | |
413 | ||
414 | #~ msgid "" | |
415 | #~ "Host “%s” could not be found. Please check that your proxy settings are " | |
416 | #~ "correct and try again." | |
417 | #~ msgstr "" | |
418 | #~ "O host “%s” não pôde ser localizado. Por favor, verifique suas " | |
419 | #~ "configurações de proxy e tente novamente." | |
420 | ||
421 | #~ msgid "" | |
422 | #~ "Hostname was invalid. Please check that you typed the location correctly " | |
423 | #~ "and try again." | |
424 | #~ msgstr "" | |
425 | #~ "Nome de máquina inválido. Por favor, verifique se você digitou a " | |
426 | #~ "localização corretamente e tente novamente." | |
427 | ||
428 | #~ msgid "“%s” is not a regular file." | |
429 | #~ msgstr "“%s” não é uma arquivo comum." | |
430 | ||
431 | #~ msgid "Connection timed out. Please try again." | |
432 | #~ msgstr "Tempo expirada. Por favor, tente novamente." | |
433 | ||
434 | #~ msgid "Unexpected error: %s" | |
435 | #~ msgstr "Erro inesperado: %s" | |
436 | ||
437 | #~ msgid "_Retry" | |
438 | #~ msgstr "_Tentar novamente" | |
439 | ||
440 | #~ msgid "Edit Any_way" | |
441 | #~ msgstr "_Editar assim mesmo" | |
442 | ||
443 | #~ msgid "" | |
444 | #~ "The number of followed links is limited and the actual file could not be " | |
445 | #~ "found within this limit." | |
446 | #~ msgstr "" | |
447 | #~ "O número de links seguidos é limitado e o arquivo não pôde ser localizado " | |
448 | #~ "dentro deste limite." | |
449 | ||
450 | #~ msgid "You do not have the permissions necessary to open the file." | |
451 | #~ msgstr "Você não possui as permissões necessárias para abrir o arquivo." | |
452 | ||
453 | #~ msgid "" | |
454 | #~ "Unable to detect the character encoding.\n" | |
455 | #~ "Please check that you are not trying to open a binary file.\n" | |
456 | #~ "Select a character encoding from the menu and try again." | |
457 | #~ msgstr "" | |
458 | #~ "Não foi possível detectar a codificação de caracteres.\n" | |
459 | #~ "Por favor, certifique-se de que você não está tentando abrir um arquivo " | |
460 | #~ "binário.\n" | |
461 | #~ "Selecione uma codificação de caracteres do menu e tente novamente." | |
462 | ||
463 | #~ msgid "There was a problem opening the file “%s”." | |
464 | #~ msgstr "Houve um problema ao abrir o arquivo “%s”." | |
465 | ||
466 | #~ msgid "" | |
467 | #~ "The file you opened has some invalid characters. If you continue editing " | |
468 | #~ "this file you could corrupt it.\n" | |
469 | #~ "You can also choose another character encoding and try again." | |
470 | #~ msgstr "" | |
471 | #~ "O arquivo que você abrir possui alguns caracteres inválidos. Se você " | |
472 | #~ "continuar a editar esse arquivo, você pode corrompê-lo.\n" | |
473 | #~ "Você também pode escolher uma outra codificação de caracteres e tentar " | |
474 | #~ "novamente." | |
475 | ||
476 | #~ msgid "Could not open the file “%s” using the “%s” character encoding." | |
477 | #~ msgstr "" | |
478 | #~ "Não foi possível abrir o arquivo “%s” usando a codificação de caracteres " | |
479 | #~ "“%s”." | |
480 | ||
481 | #~ msgid "" | |
482 | #~ "Please check that you are not trying to open a binary file.\n" | |
483 | #~ "Select a different character encoding from the menu and try again." | |
484 | #~ msgstr "" | |
485 | #~ "Por favor, certifique-se de que você não está tentando abrir um arquivo " | |
486 | #~ "binário.\n" | |
487 | #~ "Selecione uma codificação de caracteres diferente do menu e tente " | |
488 | #~ "novamente." | |
489 | ||
490 | #~ msgid "Could not open the file “%s”." | |
491 | #~ msgstr "Não foi possível abrir o arquivo “%s”." |
0 | # Russian translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: \n" | |
9 | "POT-Creation-Date: 2017-03-19 11:57+0000\n" | |
10 | "PO-Revision-Date: 2017-03-25 22:57+0500\n" | |
11 | "Language-Team: Russian <gnome-cyr@gnome.org>\n" | |
12 | "Language: ru\n" | |
13 | "MIME-Version: 1.0\n" | |
14 | "Content-Type: text/plain; charset=UTF-8\n" | |
15 | "Content-Transfer-Encoding: 8bit\n" | |
16 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" | |
17 | "Last-Translator: Pavel Elizaryev <gonleef@tuta.io>\n" | |
18 | "X-Generator: Poedit 1.8.11\n" | |
19 | ||
20 | #. Translators: %s is a filename. | |
21 | #: tepl/tepl-application-window.c:356 | |
22 | #, c-format | |
23 | msgid "Open “%s”" | |
24 | msgstr "Открыть «%s»" | |
25 | ||
26 | #: tepl/tepl-application-window.c:575 | |
27 | msgid "Open _Recent" | |
28 | msgstr "Открыть _недавние" | |
29 | ||
30 | #. Translators: %s is the application name. | |
31 | #: tepl/tepl-application-window.c:578 | |
32 | #, c-format | |
33 | msgid "Open a file recently used with %s" | |
34 | msgstr "Открыть файл, который недавно использовался с «%s»" | |
35 | ||
36 | #. UTF-8 first, so that it's the first encoding returned by | |
37 | #. * tepl_encoding_get_all(). | |
38 | #. | |
39 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
40 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
41 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
42 | msgid "Unicode" | |
43 | msgstr "Юникод" | |
44 | ||
45 | #. FIXME GEOSTD8 ? | |
46 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
47 | #: tepl/tepl-encoding.c:180 | |
48 | msgid "Western" | |
49 | msgstr "Западная" | |
50 | ||
51 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
52 | msgid "Central European" | |
53 | msgstr "Центральноевропейская" | |
54 | ||
55 | #: tepl/tepl-encoding.c:119 | |
56 | msgid "South European" | |
57 | msgstr "Южноевропейская" | |
58 | ||
59 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
60 | msgid "Baltic" | |
61 | msgstr "Балтийская" | |
62 | ||
63 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
64 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
65 | msgid "Cyrillic" | |
66 | msgstr "Кириллица" | |
67 | ||
68 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
69 | msgid "Arabic" | |
70 | msgstr "Арабская" | |
71 | ||
72 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
73 | msgid "Greek" | |
74 | msgstr "Греческая" | |
75 | ||
76 | #: tepl/tepl-encoding.c:124 | |
77 | msgid "Hebrew Visual" | |
78 | msgstr "Еврейская отображаемая" | |
79 | ||
80 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
81 | msgid "Turkish" | |
82 | msgstr "Турецкая" | |
83 | ||
84 | #: tepl/tepl-encoding.c:126 | |
85 | msgid "Nordic" | |
86 | msgstr "Северная" | |
87 | ||
88 | #: tepl/tepl-encoding.c:128 | |
89 | msgid "Celtic" | |
90 | msgstr "Кельтская" | |
91 | ||
92 | #: tepl/tepl-encoding.c:130 | |
93 | msgid "Romanian" | |
94 | msgstr "Римская" | |
95 | ||
96 | #: tepl/tepl-encoding.c:140 | |
97 | msgid "Armenian" | |
98 | msgstr "Армянская" | |
99 | ||
100 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
101 | msgid "Chinese Traditional" | |
102 | msgstr "Китайская традиционная" | |
103 | ||
104 | #: tepl/tepl-encoding.c:143 | |
105 | msgid "Cyrillic/Russian" | |
106 | msgstr "Кириллица (российская)" | |
107 | ||
108 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
109 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
110 | msgid "Japanese" | |
111 | msgstr "Японская" | |
112 | ||
113 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
114 | #: tepl/tepl-encoding.c:175 | |
115 | msgid "Korean" | |
116 | msgstr "Корейская" | |
117 | ||
118 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
119 | msgid "Chinese Simplified" | |
120 | msgstr "Китайская упрощённая" | |
121 | ||
122 | #: tepl/tepl-encoding.c:155 | |
123 | msgid "Georgian" | |
124 | msgstr "Грузинская" | |
125 | ||
126 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
127 | msgid "Hebrew" | |
128 | msgstr "Еврейская" | |
129 | ||
130 | #: tepl/tepl-encoding.c:170 | |
131 | msgid "Cyrillic/Ukrainian" | |
132 | msgstr "Кириллица (украинская)" | |
133 | ||
134 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
135 | msgid "Vietnamese" | |
136 | msgstr "Вьетнамская" | |
137 | ||
138 | #: tepl/tepl-encoding.c:174 | |
139 | msgid "Thai" | |
140 | msgstr "Тайская" | |
141 | ||
142 | #: tepl/tepl-encoding.c:365 | |
143 | msgid "Unknown" | |
144 | msgstr "Неизвестная" | |
145 | ||
146 | #. Translators: This is the sorted list of encodings used by Tepl for | |
147 | #. * automatic detection of the file encoding. You may want to customize | |
148 | #. * it adding encodings that are common in your country, for instance the | |
149 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
150 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
151 | #. * European languages) if you think people in your country will rarely | |
152 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
153 | #. * the encoding for the current locale, so please don't translate the | |
154 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
155 | #. * commas. | |
156 | #. | |
157 | #: tepl/tepl-encoding.c:640 | |
158 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
159 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-5', 'UTF-16', ' KOI8-R']" | |
160 | ||
161 | #: tepl/tepl-encoding-converter.c:302 | |
162 | #, c-format | |
163 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
164 | msgstr "Преобразование из набора символов «%s» в «%s» не поддерживается." | |
165 | ||
166 | #: tepl/tepl-encoding-converter.c:311 | |
167 | #, c-format | |
168 | msgid "Could not open converter from “%s” to “%s”: %s" | |
169 | msgstr "Не удалось открыть конвертер из «%s» в «%s»: «%s»" | |
170 | ||
171 | #: tepl/tepl-encoding-converter.c:368 | |
172 | msgid "The input data contains an invalid sequence." | |
173 | msgstr "Входные данные содержат недопустимую последовательность." | |
174 | ||
175 | #: tepl/tepl-encoding-converter.c:377 | |
176 | #, c-format | |
177 | msgid "Error when converting data: %s" | |
178 | msgstr "Ошибка при конвертировании данных: «%s»" | |
179 | ||
180 | #: tepl/tepl-encoding-converter.c:556 | |
181 | msgid "The input data ends with an incomplete multi-byte sequence." | |
182 | msgstr "Входные данные заканчиваются незавершенной многобайтовой последовательностью." | |
183 | ||
184 | #: tepl/tepl-encoding-converter.c:579 | |
185 | msgid "The input content ends with incomplete data." | |
186 | msgstr "Содержимое ввода заканчивается незавершенными данными." | |
187 | ||
188 | #: tepl/tepl-file.c:413 | |
189 | #, c-format | |
190 | msgid "Untitled File %d" | |
191 | msgstr "Безымянный файл %d" | |
192 | ||
193 | #: tepl/tepl-file-content-loader.c:334 | |
194 | #, c-format | |
195 | msgid "The file is too big. Maximum %s can be loaded." | |
196 | msgstr "Файл слишком большой. Максимальный размер загрузки «%s»." | |
197 | ||
198 | #: tepl/tepl-file-loader.c:925 | |
199 | msgid "It is not possible to detect the character encoding automatically." | |
200 | msgstr "Не удалось автоматически определить кодировку." | |
201 | ||
202 | #: tepl/tepl-file-saver.c:784 | |
203 | msgid "The file is externally modified." | |
204 | msgstr "Файл был модифицирован внешней программой." | |
205 | ||
206 | #: tepl/tepl-file-saver.c:1318 | |
207 | msgid "The buffer contains invalid characters." | |
208 | msgstr "Буфер содержит недопустимые символы." |
0 | # Slovenian translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # | |
4 | # Matej Urbančič <mateju@svn.gnome.org>, 2017. | |
5 | # | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: tepl master\n" | |
9 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" | |
10 | "product=tepl&keywords=I18N+L10N&component=general\n" | |
11 | "POT-Creation-Date: 2017-05-07 16:45+0000\n" | |
12 | "PO-Revision-Date: 2017-05-09 17:32+0200\n" | |
13 | "Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n" | |
14 | "Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups." | |
15 | "com>\n" | |
16 | "Language: sl_SI\n" | |
17 | "MIME-Version: 1.0\n" | |
18 | "Content-Type: text/plain; charset=UTF-8\n" | |
19 | "Content-Transfer-Encoding: 8bit\n" | |
20 | "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 " | |
21 | "|| n%100==4 ? 3 : 0);\n" | |
22 | "X-Poedit-SourceCharset: UTF-8\n" | |
23 | "X-Generator: Poedit 2.0.1\n" | |
24 | ||
25 | #. Translators: %s is a filename. | |
26 | #: tepl/tepl-application-window.c:356 | |
27 | #, fuzzy, c-format | |
28 | msgid "Open “%s”" | |
29 | msgstr "Odpri %s" | |
30 | ||
31 | #: tepl/tepl-application-window.c:575 | |
32 | msgid "Open _Recent" | |
33 | msgstr "Odpri _nedavno" | |
34 | ||
35 | #. Translators: %s is the application name. | |
36 | #: tepl/tepl-application-window.c:578 | |
37 | #, fuzzy, c-format | |
38 | msgid "Open a file recently used with %s" | |
39 | msgstr "Nobenih nedavno uporabljenih virov ni najdenih z URI '%s'" | |
40 | ||
41 | #. UTF-8 first, so that it's the first encoding returned by | |
42 | #. * tepl_encoding_get_all(). | |
43 | #. | |
44 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
45 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
46 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
47 | msgid "Unicode" | |
48 | msgstr "Unicode" | |
49 | ||
50 | #. FIXME GEOSTD8 ? | |
51 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
52 | #: tepl/tepl-encoding.c:180 | |
53 | msgid "Western" | |
54 | msgstr "Zahodnjaški" | |
55 | ||
56 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
57 | msgid "Central European" | |
58 | msgstr "Srednjeevropski" | |
59 | ||
60 | #: tepl/tepl-encoding.c:119 | |
61 | msgid "South European" | |
62 | msgstr "Južnoevropski" | |
63 | ||
64 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
65 | msgid "Baltic" | |
66 | msgstr "Baltski" | |
67 | ||
68 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
69 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
70 | msgid "Cyrillic" | |
71 | msgstr "Cirilično" | |
72 | ||
73 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
74 | msgid "Arabic" | |
75 | msgstr "Arabski" | |
76 | ||
77 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
78 | msgid "Greek" | |
79 | msgstr "Grški" | |
80 | ||
81 | #: tepl/tepl-encoding.c:124 | |
82 | msgid "Hebrew Visual" | |
83 | msgstr "Hebrejski predočeni" | |
84 | ||
85 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
86 | msgid "Turkish" | |
87 | msgstr "Turški" | |
88 | ||
89 | #: tepl/tepl-encoding.c:126 | |
90 | msgid "Nordic" | |
91 | msgstr "Nordijski" | |
92 | ||
93 | #: tepl/tepl-encoding.c:128 | |
94 | msgid "Celtic" | |
95 | msgstr "Keltski" | |
96 | ||
97 | #: tepl/tepl-encoding.c:130 | |
98 | msgid "Romanian" | |
99 | msgstr "Romunski" | |
100 | ||
101 | #: tepl/tepl-encoding.c:140 | |
102 | msgid "Armenian" | |
103 | msgstr "Armenski" | |
104 | ||
105 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
106 | msgid "Chinese Traditional" | |
107 | msgstr "Kitajski tradicionalen" | |
108 | ||
109 | #: tepl/tepl-encoding.c:143 | |
110 | msgid "Cyrillic/Russian" | |
111 | msgstr "Cirilica/Ruski" | |
112 | ||
113 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
114 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
115 | msgid "Japanese" | |
116 | msgstr "Japonski" | |
117 | ||
118 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
119 | #: tepl/tepl-encoding.c:175 | |
120 | msgid "Korean" | |
121 | msgstr "Korejski" | |
122 | ||
123 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
124 | msgid "Chinese Simplified" | |
125 | msgstr "Kitajski poenostavljen" | |
126 | ||
127 | #: tepl/tepl-encoding.c:155 | |
128 | msgid "Georgian" | |
129 | msgstr "Gruzijski" | |
130 | ||
131 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
132 | msgid "Hebrew" | |
133 | msgstr "Hebrejski" | |
134 | ||
135 | #: tepl/tepl-encoding.c:170 | |
136 | msgid "Cyrillic/Ukrainian" | |
137 | msgstr "Cirilica/Ukrajinski" | |
138 | ||
139 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
140 | msgid "Vietnamese" | |
141 | msgstr "Vietnamski" | |
142 | ||
143 | #: tepl/tepl-encoding.c:174 | |
144 | msgid "Thai" | |
145 | msgstr "Tajski" | |
146 | ||
147 | #: tepl/tepl-encoding.c:365 | |
148 | msgid "Unknown" | |
149 | msgstr "Neznano" | |
150 | ||
151 | #. Translators: This is the sorted list of encodings used by Tepl for | |
152 | #. * automatic detection of the file encoding. You may want to customize | |
153 | #. * it adding encodings that are common in your country, for instance the | |
154 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
155 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
156 | #. * European languages) if you think people in your country will rarely | |
157 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
158 | #. * the encoding for the current locale, so please don't translate the | |
159 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
160 | #. * commas. | |
161 | #. | |
162 | #: tepl/tepl-encoding.c:640 | |
163 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
164 | msgstr "['UTF-8', 'TRENUTNI', 'ISO-8859-15', 'UTF-16']" | |
165 | ||
166 | #: tepl/tepl-encoding-converter.c:302 | |
167 | #, fuzzy, c-format | |
168 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
169 | msgstr "Pretvorba iz nabora znakov '%s' v '%s' ni podprta" | |
170 | ||
171 | #: tepl/tepl-encoding-converter.c:311 | |
172 | #, fuzzy, c-format | |
173 | msgid "Could not open converter from “%s” to “%s”: %s" | |
174 | msgstr "Ni mogoče odpreti pretvornika iz '%s' v '%s': %s" | |
175 | ||
176 | #: tepl/tepl-encoding-converter.c:368 | |
177 | #, fuzzy | |
178 | msgid "The input data contains an invalid sequence." | |
179 | msgstr "Neveljavno zaporedje bajtov na vhodu pretvorbe" | |
180 | ||
181 | #: tepl/tepl-encoding-converter.c:377 | |
182 | #, fuzzy, c-format | |
183 | msgid "Error when converting data: %s" | |
184 | msgstr "" | |
185 | "Napaka (%s) pretvarjanja podatkov za podrejeni predmet; ukaz je izpuščen." | |
186 | ||
187 | #: tepl/tepl-encoding-converter.c:556 | |
188 | msgid "The input data ends with an incomplete multi-byte sequence." | |
189 | msgstr "" | |
190 | ||
191 | #: tepl/tepl-encoding-converter.c:579 | |
192 | msgid "The input content ends with incomplete data." | |
193 | msgstr "" | |
194 | ||
195 | #: tepl/tepl-file.c:413 | |
196 | #, fuzzy, c-format | |
197 | msgid "Untitled File %d" | |
198 | msgstr "Nenaslovljen dokument %d" | |
199 | ||
200 | #: tepl/tepl-file-content-loader.c:334 | |
201 | #, c-format | |
202 | msgid "The file is too big. Maximum %s can be loaded." | |
203 | msgstr "" | |
204 | ||
205 | #: tepl/tepl-file-loader.c:925 | |
206 | #, fuzzy | |
207 | msgid "It is not possible to detect the character encoding automatically." | |
208 | msgstr "Ni mogoče določiti nabora znakov v datoteki." | |
209 | ||
210 | #: tepl/tepl-file-saver.c:784 | |
211 | msgid "The file is externally modified." | |
212 | msgstr "Datoteka je močno spremenjena." | |
213 | ||
214 | #: tepl/tepl-file-saver.c:1318 | |
215 | msgid "The buffer contains invalid characters." | |
216 | msgstr "Medpomnilnik vsebuje neveljavne znake." |
0 | # Serbian translation for tepl. | |
1 | # Copyright © 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Мирослав Николић <miroslavnikolic@rocketmail.com>, 2017–2018. | |
4 | msgid "" | |
5 | msgstr "" | |
6 | "Project-Id-Version: tepl master\n" | |
7 | "Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=tepl&k" | |
8 | "eywords=I18N+L10N&component=general\n" | |
9 | "POT-Creation-Date: 2017-12-01 09:23+0000\n" | |
10 | "PO-Revision-Date: 2018-02-23 00:49+0200\n" | |
11 | "Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n" | |
12 | "Language-Team: српски <gnome-sr@googlegroups.org>\n" | |
13 | "Language: sr\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | "Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : " | |
18 | "n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" | |
19 | "X-Project-Style: gnome\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Отварам „%s“" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Отвори _скорашње" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Отворите датотеку коју је недавно користио „%s“" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "_Нова" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Нова датотека" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "Нови _прозор" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Направите нови прозор" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "_Отвори" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | #| msgid "New file" | |
66 | msgid "Open a file" | |
67 | msgstr "Отворите датотеку" | |
68 | ||
69 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
70 | #: tepl/tepl-tab.c:752 | |
71 | msgid "_Save" | |
72 | msgstr "_Сачувај" | |
73 | ||
74 | #: tepl/tepl-application.c:102 | |
75 | msgid "Save the current file" | |
76 | msgstr "Сачувајте текућу датотеку" | |
77 | ||
78 | #: tepl/tepl-application.c:104 | |
79 | msgid "Save _As" | |
80 | msgstr "Сачувај _као" | |
81 | ||
82 | #: tepl/tepl-application.c:105 | |
83 | msgid "Save the current file to a different location" | |
84 | msgstr "Сачувајте текућу датотеку на другом месту" | |
85 | ||
86 | #. Edit menu | |
87 | #: tepl/tepl-application.c:109 | |
88 | msgid "_Undo" | |
89 | msgstr "_Опозови" | |
90 | ||
91 | #: tepl/tepl-application.c:110 | |
92 | #| msgid "Copy the selection" | |
93 | msgid "Undo the last action" | |
94 | msgstr "Опозовите последњу радњу" | |
95 | ||
96 | #: tepl/tepl-application.c:112 | |
97 | msgid "_Redo" | |
98 | msgstr "_Понови" | |
99 | ||
100 | #: tepl/tepl-application.c:113 | |
101 | msgid "Redo the last undone action" | |
102 | msgstr "Поништите последњу раду опозива" | |
103 | ||
104 | #: tepl/tepl-application.c:115 | |
105 | msgid "Cu_t" | |
106 | msgstr "_Исеци" | |
107 | ||
108 | #: tepl/tepl-application.c:116 | |
109 | msgid "Cut the selection" | |
110 | msgstr "Исеците избор" | |
111 | ||
112 | #: tepl/tepl-application.c:118 | |
113 | msgid "_Copy" | |
114 | msgstr "У_множи" | |
115 | ||
116 | #: tepl/tepl-application.c:119 | |
117 | msgid "Copy the selection" | |
118 | msgstr "Умножите избор" | |
119 | ||
120 | #: tepl/tepl-application.c:121 | |
121 | msgid "_Paste" | |
122 | msgstr "У_баци" | |
123 | ||
124 | #: tepl/tepl-application.c:122 | |
125 | msgid "Paste the clipboard" | |
126 | msgstr "Убаците из оставе" | |
127 | ||
128 | #: tepl/tepl-application.c:124 | |
129 | msgid "_Delete" | |
130 | msgstr "_Обриши" | |
131 | ||
132 | #: tepl/tepl-application.c:125 | |
133 | msgid "Delete the selected text" | |
134 | msgstr "Обришите изабрани текст" | |
135 | ||
136 | #: tepl/tepl-application.c:127 | |
137 | msgid "Select _All" | |
138 | msgstr "Изабери _све" | |
139 | ||
140 | #: tepl/tepl-application.c:128 | |
141 | msgid "Select all the text" | |
142 | msgstr "Изаберите сав текст" | |
143 | ||
144 | #: tepl/tepl-application.c:130 | |
145 | msgid "_Indent" | |
146 | msgstr "_Увуци" | |
147 | ||
148 | #: tepl/tepl-application.c:131 | |
149 | #| msgid "Delete the selected text" | |
150 | msgid "Indent the selected lines" | |
151 | msgstr "Увуците изабране редове" | |
152 | ||
153 | #: tepl/tepl-application.c:133 | |
154 | msgid "_Unindent" | |
155 | msgstr "_Поништи увлачење" | |
156 | ||
157 | #: tepl/tepl-application.c:134 | |
158 | #| msgid "Delete the selected text" | |
159 | msgid "Unindent the selected lines" | |
160 | msgstr "Поништите увлачење изабраних редова" | |
161 | ||
162 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
163 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
164 | #. * doesn't have the real path to the file, so it would screw up some | |
165 | #. * features for text editors: | |
166 | #. * - showing the directory in parentheses in the window title, or in the | |
167 | #. * tab tooltip; | |
168 | #. * - opening a recent file. | |
169 | #. * Basically everywhere where the directory is shown. | |
170 | #. | |
171 | #: tepl/tepl-application-window.c:174 | |
172 | msgid "Open File" | |
173 | msgstr "Отвори датотеку" | |
174 | ||
175 | #: tepl/tepl-application-window.c:177 | |
176 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
177 | msgid "_Cancel" | |
178 | msgstr "_Откажи" | |
179 | ||
180 | #: tepl/tepl-application-window.c:708 | |
181 | msgid "Read-Only" | |
182 | msgstr "Само за читање" | |
183 | ||
184 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
185 | #, c-format | |
186 | msgid "Save changes to file “%s” before closing?" | |
187 | msgstr "Да сачувам измене у датотеку „%s“ пре затварања?" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
190 | msgid "Close _without Saving" | |
191 | msgstr "Затвори _без чувања" | |
192 | ||
193 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
194 | msgid "_Save As…" | |
195 | msgstr "_Сачувај као…" | |
196 | ||
197 | #. UTF-8 first, so that it's the first encoding returned by | |
198 | #. * tepl_encoding_get_all(). | |
199 | #. | |
200 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
201 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
202 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
203 | msgid "Unicode" | |
204 | msgstr "Уникод" | |
205 | ||
206 | #. FIXME GEOSTD8 ? | |
207 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
208 | #: tepl/tepl-encoding.c:180 | |
209 | msgid "Western" | |
210 | msgstr "Западни" | |
211 | ||
212 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
213 | msgid "Central European" | |
214 | msgstr "Централноевропски" | |
215 | ||
216 | #: tepl/tepl-encoding.c:119 | |
217 | msgid "South European" | |
218 | msgstr "Јужноевропски" | |
219 | ||
220 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
221 | msgid "Baltic" | |
222 | msgstr "Балтички" | |
223 | ||
224 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
225 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
226 | msgid "Cyrillic" | |
227 | msgstr "Ћирилични" | |
228 | ||
229 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
230 | msgid "Arabic" | |
231 | msgstr "Арапски" | |
232 | ||
233 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
234 | msgid "Greek" | |
235 | msgstr "Грчки" | |
236 | ||
237 | #: tepl/tepl-encoding.c:124 | |
238 | msgid "Hebrew Visual" | |
239 | msgstr "Хебрејски визуелни" | |
240 | ||
241 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
242 | msgid "Turkish" | |
243 | msgstr "Турски" | |
244 | ||
245 | #: tepl/tepl-encoding.c:126 | |
246 | msgid "Nordic" | |
247 | msgstr "Нордијски" | |
248 | ||
249 | #: tepl/tepl-encoding.c:128 | |
250 | msgid "Celtic" | |
251 | msgstr "Келтски" | |
252 | ||
253 | #: tepl/tepl-encoding.c:130 | |
254 | msgid "Romanian" | |
255 | msgstr "Румунски" | |
256 | ||
257 | #: tepl/tepl-encoding.c:140 | |
258 | msgid "Armenian" | |
259 | msgstr "Јерменски" | |
260 | ||
261 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
262 | msgid "Chinese Traditional" | |
263 | msgstr "Кинески традиционални" | |
264 | ||
265 | #: tepl/tepl-encoding.c:143 | |
266 | msgid "Cyrillic/Russian" | |
267 | msgstr "Ћирилични/Руски" | |
268 | ||
269 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
270 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
271 | msgid "Japanese" | |
272 | msgstr "Јапански" | |
273 | ||
274 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
275 | #: tepl/tepl-encoding.c:175 | |
276 | msgid "Korean" | |
277 | msgstr "Корејски" | |
278 | ||
279 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
280 | msgid "Chinese Simplified" | |
281 | msgstr "Кинески поједностављени" | |
282 | ||
283 | #: tepl/tepl-encoding.c:155 | |
284 | msgid "Georgian" | |
285 | msgstr "Грузијски" | |
286 | ||
287 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
288 | msgid "Hebrew" | |
289 | msgstr "Хебрејски" | |
290 | ||
291 | #: tepl/tepl-encoding.c:170 | |
292 | msgid "Cyrillic/Ukrainian" | |
293 | msgstr "Ћирилични/Украјински" | |
294 | ||
295 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
296 | msgid "Vietnamese" | |
297 | msgstr "Вијетнамски" | |
298 | ||
299 | #: tepl/tepl-encoding.c:174 | |
300 | msgid "Thai" | |
301 | msgstr "Тајландски" | |
302 | ||
303 | #: tepl/tepl-encoding.c:370 | |
304 | msgid "Unknown" | |
305 | msgstr "Непознат" | |
306 | ||
307 | #. Translators: This is the sorted list of encodings used by Tepl for | |
308 | #. * automatic detection of the file encoding. You may want to customize | |
309 | #. * it adding encodings that are common in your country, for instance the | |
310 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
311 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
312 | #. * European languages) if you think people in your country will rarely | |
313 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
314 | #. * the encoding for the current locale, so please don't translate the | |
315 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
316 | #. * commas. | |
317 | #. | |
318 | #: tepl/tepl-encoding.c:695 | |
319 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
320 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
321 | ||
322 | #: tepl/tepl-encoding-converter.c:302 | |
323 | #, c-format | |
324 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
325 | msgstr "Претварање из скупа знакова „%s“ у „%s“ још није подржано." | |
326 | ||
327 | #: tepl/tepl-encoding-converter.c:311 | |
328 | #, c-format | |
329 | msgid "Could not open converter from “%s” to “%s”: %s" | |
330 | msgstr "Не могу да отворим претварач из „%s“ у „%s“: %s" | |
331 | ||
332 | #: tepl/tepl-encoding-converter.c:368 | |
333 | msgid "The input data contains an invalid sequence." | |
334 | msgstr "Улазни подаци садрже неисправан низ." | |
335 | ||
336 | #: tepl/tepl-encoding-converter.c:377 | |
337 | #, c-format | |
338 | msgid "Error when converting data: %s" | |
339 | msgstr "Грешка приликом претварања података: %s" | |
340 | ||
341 | #: tepl/tepl-encoding-converter.c:556 | |
342 | msgid "The input data ends with an incomplete multi-byte sequence." | |
343 | msgstr "Улазни подаци се завршавају непотпуним вишебајтним низом." | |
344 | ||
345 | #: tepl/tepl-encoding-converter.c:579 | |
346 | msgid "The input content ends with incomplete data." | |
347 | msgstr "Улаз садржи крај са непотпуним подацима." | |
348 | ||
349 | #: tepl/tepl-file.c:413 | |
350 | #, c-format | |
351 | msgid "Untitled File %d" | |
352 | msgstr "Неименована датотека %d" | |
353 | ||
354 | #: tepl/tepl-file-content-loader.c:331 | |
355 | #, c-format | |
356 | msgid "The file is too big. Maximum %s can be loaded." | |
357 | msgstr "Датотека је превелика. Највише %s може бити учитано." | |
358 | ||
359 | #: tepl/tepl-file-loader.c:872 | |
360 | msgid "It is not possible to detect the character encoding automatically." | |
361 | msgstr "Не могу аутоматски да одредим кодирање знакова." | |
362 | ||
363 | #: tepl/tepl-file-saver.c:784 | |
364 | msgid "The file is externally modified." | |
365 | msgstr "Датотека је измењена споља." | |
366 | ||
367 | #: tepl/tepl-file-saver.c:1318 | |
368 | msgid "The buffer contains invalid characters." | |
369 | msgstr "Међумеморија садржи неисправне знаке." | |
370 | ||
371 | #: tepl/tepl-tab.c:534 | |
372 | #| msgid "Error when converting data: %s" | |
373 | msgid "Error when loading the file." | |
374 | msgstr "Грешка приликом учитавања датотеке." | |
375 | ||
376 | #: tepl/tepl-tab.c:748 | |
377 | msgid "Save File" | |
378 | msgstr "Сачувај датотеку" | |
379 | ||
380 | #. Translators: location of a file. | |
381 | #: tepl/tepl-tab-label.c:273 | |
382 | msgid "Location:" | |
383 | msgstr "Место:" | |
384 | ||
385 | #: tepl/tepl-tab-label.c:342 | |
386 | msgid "Close file" | |
387 | msgstr "Затвори датотеку" | |
388 | ||
389 | #: tepl/tepl-tab-saving.c:64 | |
390 | #| msgid "Error when converting data: %s" | |
391 | msgid "Error when saving the file." | |
392 | msgstr "Грешка приликом чувања датотеке." | |
393 | ||
394 | #~ msgid "Could not find the file “%s”." | |
395 | #~ msgstr "Не могу да нађем датотеку „%s“." | |
396 | ||
397 | #~ msgid "Please check that you typed the location correctly and try again." | |
398 | #~ msgstr "Проверите да ли сте исправно укуцали место и пробајте поново." | |
399 | ||
400 | #~ msgid "Unable to handle “%s:” locations." | |
401 | #~ msgstr "Не могу да радим са „%s:“ местима." | |
402 | ||
403 | #~ msgid "The location of the file cannot be accessed." | |
404 | #~ msgstr "Не могу да приступим месту датотеке." | |
405 | ||
406 | #~ msgid "“%s” is a directory." | |
407 | #~ msgstr "„%s“ је директоријум." | |
408 | ||
409 | #~ msgid "“%s” is not a valid location." | |
410 | #~ msgstr "„%s“ није исправно место." | |
411 | ||
412 | #~ msgid "" | |
413 | #~ "Host “%s” could not be found. Please check that your proxy settings are " | |
414 | #~ "correct and try again." | |
415 | #~ msgstr "" | |
416 | #~ "Не могу да нађем домаћина „%s“. Проверите да ли су ваша подешавања " | |
417 | #~ "посредника исправна и пробајте поново." | |
418 | ||
419 | #~ msgid "" | |
420 | #~ "Hostname was invalid. Please check that you typed the location correctly " | |
421 | #~ "and try again." | |
422 | #~ msgstr "" | |
423 | #~ "Назив домаћина беше неисправан. Проверите да ли сте исправно укуцали " | |
424 | #~ "место и пробајте поново." | |
425 | ||
426 | #~ msgid "“%s” is not a regular file." | |
427 | #~ msgstr "„%s“ није обична датотека." | |
428 | ||
429 | #~ msgid "Connection timed out. Please try again." | |
430 | #~ msgstr "Истекло је време за везу. Пробајте поново." | |
431 | ||
432 | #~ msgid "Unexpected error: %s" | |
433 | #~ msgstr "Неочекивана грешка: %s" | |
434 | ||
435 | #~ msgid "_Retry" | |
436 | #~ msgstr "_Покушај поново" | |
437 | ||
438 | #~ msgid "Edit Any_way" | |
439 | #~ msgstr "Уреди _ипак" | |
440 | ||
441 | #~ msgid "" | |
442 | #~ "The number of followed links is limited and the actual file could not be " | |
443 | #~ "found within this limit." | |
444 | #~ msgstr "" | |
445 | #~ "Број праћених веза је ограничен, а стварну датотеку не могу пронаћи у " | |
446 | #~ "овом опсегу." | |
447 | ||
448 | #~ msgid "You do not have the permissions necessary to open the file." | |
449 | #~ msgstr "Немате потребна овлашћења да отворите датотеку." | |
450 | ||
451 | #~ msgid "" | |
452 | #~ "Unable to detect the character encoding.\n" | |
453 | #~ "Please check that you are not trying to open a binary file.\n" | |
454 | #~ "Select a character encoding from the menu and try again." | |
455 | #~ msgstr "" | |
456 | #~ "Не могу да откријем кодирање знакова.\n" | |
457 | #~ "Проверите да не покушавате да отворите бинарну датотеку.\n" | |
458 | #~ "Изабери кодирање знакова из изборника и покушајте поново." | |
459 | ||
460 | #~ msgid "There was a problem opening the file “%s”." | |
461 | #~ msgstr "Дошло је до проблема при отварању датотеке „%s“." | |
462 | ||
463 | #~ msgid "" | |
464 | #~ "The file you opened has some invalid characters. If you continue editing " | |
465 | #~ "this file you could corrupt it.\n" | |
466 | #~ "You can also choose another character encoding and try again." | |
467 | #~ msgstr "" | |
468 | #~ "Датотека коју сте отворили има неке неисправне знакове. Ако наставите да " | |
469 | #~ "је уређујете можете да је оштетите.\n" | |
470 | #~ "Такође можете да изаберете други кодни распоред и да покушате поново." | |
471 | ||
472 | #~ msgid "Could not open the file “%s” using the “%s” character encoding." | |
473 | #~ msgstr "Не могу да отворим датотеку „%s“ користећи „%s“ кодирање знакова." | |
474 | ||
475 | #~ msgid "" | |
476 | #~ "Please check that you are not trying to open a binary file.\n" | |
477 | #~ "Select a different character encoding from the menu and try again." | |
478 | #~ msgstr "" | |
479 | #~ "Проверите да не покушавате да отворите бинарну датотеку.\n" | |
480 | #~ "Изабери други кодни распоред из изборника и покушајте поново." | |
481 | ||
482 | #~ msgid "Could not open the file “%s”." | |
483 | #~ msgstr "Не могу да отворим датотеку „%s“." |
0 | # Swedish translation for tepl. | |
1 | # Copyright © 2017, 2018 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # Anders Jonsson <anders.jonsson@norsjovallen.se>, 2017, 2018. | |
4 | # Josef Andersson <l10nl18nsweja@gmail.com>, 2017. | |
5 | # | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: tepl master\n" | |
9 | "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/tepl/issues\n" | |
10 | "POT-Creation-Date: 2018-02-27 19:31+0000\n" | |
11 | "PO-Revision-Date: 2018-03-11 22:01+0100\n" | |
12 | "Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n" | |
13 | "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" | |
14 | "Language: sv\n" | |
15 | "MIME-Version: 1.0\n" | |
16 | "Content-Type: text/plain; charset=UTF-8\n" | |
17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
19 | "X-Generator: Poedit 2.0.6\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: amtk/amtk-application-window.c:374 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Öppna ”%s”" | |
26 | ||
27 | #: amtk/amtk-application-window.c:630 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Öppna _senaste" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: amtk/amtk-application-window.c:633 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Öppna en fil som tidigare använts med %s" | |
36 | ||
37 | #. action, icon, label, accel, tooltip | |
38 | #. File menu | |
39 | #. Why "file" and not "document"? "Document" is not the best | |
40 | #. word because the action is not always to create a new | |
41 | #. document. For example a LaTeX document can be composed of | |
42 | #. several _files_. Or for source code we do not really create a | |
43 | #. new "document". | |
44 | #: tepl/tepl-application.c:92 | |
45 | msgid "_New" | |
46 | msgstr "_Ny" | |
47 | ||
48 | #: tepl/tepl-application.c:93 | |
49 | msgid "New file" | |
50 | msgstr "Ny fil" | |
51 | ||
52 | #: tepl/tepl-application.c:95 | |
53 | msgid "New _Window" | |
54 | msgstr "Nytt _fönster" | |
55 | ||
56 | #: tepl/tepl-application.c:96 | |
57 | msgid "Create a new window" | |
58 | msgstr "Skapa ett nytt fönster" | |
59 | ||
60 | #: tepl/tepl-application.c:98 tepl/tepl-application-window.c:178 | |
61 | msgid "_Open" | |
62 | msgstr "Ö_ppna" | |
63 | ||
64 | #: tepl/tepl-application.c:99 | |
65 | msgid "Open a file" | |
66 | msgstr "Öppna en fil" | |
67 | ||
68 | #: tepl/tepl-application.c:101 tepl/tepl-close-confirm-dialog-single.c:144 | |
69 | #: tepl/tepl-tab.c:752 | |
70 | msgid "_Save" | |
71 | msgstr "_Spara" | |
72 | ||
73 | #: tepl/tepl-application.c:102 | |
74 | msgid "Save the current file" | |
75 | msgstr "Spara aktuell fil" | |
76 | ||
77 | #: tepl/tepl-application.c:104 | |
78 | msgid "Save _As" | |
79 | msgstr "S_para som" | |
80 | ||
81 | #: tepl/tepl-application.c:105 | |
82 | msgid "Save the current file to a different location" | |
83 | msgstr "Spara den aktuella filen till en annan plats" | |
84 | ||
85 | #. Edit menu | |
86 | #: tepl/tepl-application.c:109 | |
87 | msgid "_Undo" | |
88 | msgstr "Å_ngra" | |
89 | ||
90 | #: tepl/tepl-application.c:110 | |
91 | msgid "Undo the last action" | |
92 | msgstr "Ångra den senaste åtgärden" | |
93 | ||
94 | #: tepl/tepl-application.c:112 | |
95 | msgid "_Redo" | |
96 | msgstr "_Gör om" | |
97 | ||
98 | #: tepl/tepl-application.c:113 | |
99 | msgid "Redo the last undone action" | |
100 | msgstr "Gör om senaste ångrade åtgärden" | |
101 | ||
102 | #: tepl/tepl-application.c:115 | |
103 | msgid "Cu_t" | |
104 | msgstr "Klipp _ut" | |
105 | ||
106 | #: tepl/tepl-application.c:116 | |
107 | msgid "Cut the selection" | |
108 | msgstr "Klipp ut markering" | |
109 | ||
110 | #: tepl/tepl-application.c:118 | |
111 | msgid "_Copy" | |
112 | msgstr "_Kopiera" | |
113 | ||
114 | #: tepl/tepl-application.c:119 | |
115 | msgid "Copy the selection" | |
116 | msgstr "Kopiera markeringen" | |
117 | ||
118 | #: tepl/tepl-application.c:121 | |
119 | msgid "_Paste" | |
120 | msgstr "K_listra in" | |
121 | ||
122 | #: tepl/tepl-application.c:122 | |
123 | msgid "Paste the clipboard" | |
124 | msgstr "Klistra in urklipp" | |
125 | ||
126 | #: tepl/tepl-application.c:124 | |
127 | msgid "_Delete" | |
128 | msgstr "_Ta bort" | |
129 | ||
130 | #: tepl/tepl-application.c:125 | |
131 | msgid "Delete the selected text" | |
132 | msgstr "Ta bort den markerade texten" | |
133 | ||
134 | #: tepl/tepl-application.c:127 | |
135 | msgid "Select _All" | |
136 | msgstr "Markera _allt" | |
137 | ||
138 | #: tepl/tepl-application.c:128 | |
139 | msgid "Select all the text" | |
140 | msgstr "Markera all text" | |
141 | ||
142 | #: tepl/tepl-application.c:130 | |
143 | msgid "_Indent" | |
144 | msgstr "_Indentera" | |
145 | ||
146 | #: tepl/tepl-application.c:131 | |
147 | msgid "Indent the selected lines" | |
148 | msgstr "Indentera de markerade raderna" | |
149 | ||
150 | #: tepl/tepl-application.c:133 | |
151 | msgid "_Unindent" | |
152 | msgstr "_Avindentera" | |
153 | ||
154 | #: tepl/tepl-application.c:134 | |
155 | msgid "Unindent the selected lines" | |
156 | msgstr "Avindentera de markerade raderna" | |
157 | ||
158 | #. Create a GtkFileChooserDialog, not a GtkFileChooserNative, because | |
159 | #. * with GtkFileChooserNative the GFile that we obtain (in flatpak) | |
160 | #. * doesn't have the real path to the file, so it would screw up some | |
161 | #. * features for text editors: | |
162 | #. * - showing the directory in parentheses in the window title, or in the | |
163 | #. * tab tooltip; | |
164 | #. * - opening a recent file. | |
165 | #. * Basically everywhere where the directory is shown. | |
166 | #. | |
167 | #: tepl/tepl-application-window.c:174 | |
168 | msgid "Open File" | |
169 | msgstr "Öppna fil" | |
170 | ||
171 | #: tepl/tepl-application-window.c:177 | |
172 | #: tepl/tepl-close-confirm-dialog-single.c:138 tepl/tepl-tab.c:751 | |
173 | msgid "_Cancel" | |
174 | msgstr "A_vbryt" | |
175 | ||
176 | #: tepl/tepl-application-window.c:708 | |
177 | msgid "Read-Only" | |
178 | msgstr "Skrivskyddad" | |
179 | ||
180 | #: tepl/tepl-close-confirm-dialog-single.c:133 | |
181 | #, c-format | |
182 | msgid "Save changes to file “%s” before closing?" | |
183 | msgstr "Spara ändringar till filen ”%s” innan du stänger?" | |
184 | ||
185 | #: tepl/tepl-close-confirm-dialog-single.c:137 | |
186 | msgid "Close _without Saving" | |
187 | msgstr "Stäng _utan att spara" | |
188 | ||
189 | #: tepl/tepl-close-confirm-dialog-single.c:150 | |
190 | msgid "_Save As…" | |
191 | msgstr "_Spara som…" | |
192 | ||
193 | #. UTF-8 first, so that it's the first encoding returned by | |
194 | #. * tepl_encoding_get_all(). | |
195 | #. | |
196 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
197 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
198 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
199 | msgid "Unicode" | |
200 | msgstr "Unicode" | |
201 | ||
202 | #. FIXME GEOSTD8 ? | |
203 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
204 | #: tepl/tepl-encoding.c:180 | |
205 | msgid "Western" | |
206 | msgstr "Västerländsk" | |
207 | ||
208 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
209 | msgid "Central European" | |
210 | msgstr "Centraleuropeisk" | |
211 | ||
212 | #: tepl/tepl-encoding.c:119 | |
213 | msgid "South European" | |
214 | msgstr "Sydeuropeisk" | |
215 | ||
216 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
217 | msgid "Baltic" | |
218 | msgstr "Baltisk" | |
219 | ||
220 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
221 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
222 | msgid "Cyrillic" | |
223 | msgstr "Kyrillisk" | |
224 | ||
225 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
226 | msgid "Arabic" | |
227 | msgstr "Arabisk" | |
228 | ||
229 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
230 | msgid "Greek" | |
231 | msgstr "Grekisk" | |
232 | ||
233 | #: tepl/tepl-encoding.c:124 | |
234 | msgid "Hebrew Visual" | |
235 | msgstr "Hebreisk visuell" | |
236 | ||
237 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
238 | msgid "Turkish" | |
239 | msgstr "Turkisk" | |
240 | ||
241 | #: tepl/tepl-encoding.c:126 | |
242 | msgid "Nordic" | |
243 | msgstr "Nordisk" | |
244 | ||
245 | #: tepl/tepl-encoding.c:128 | |
246 | msgid "Celtic" | |
247 | msgstr "Keltisk" | |
248 | ||
249 | #: tepl/tepl-encoding.c:130 | |
250 | msgid "Romanian" | |
251 | msgstr "Rumänsk" | |
252 | ||
253 | #: tepl/tepl-encoding.c:140 | |
254 | msgid "Armenian" | |
255 | msgstr "Armenisk" | |
256 | ||
257 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
258 | msgid "Chinese Traditional" | |
259 | msgstr "Kinesisk (traditionell)" | |
260 | ||
261 | #: tepl/tepl-encoding.c:143 | |
262 | msgid "Cyrillic/Russian" | |
263 | msgstr "Kyrillisk/Rysk" | |
264 | ||
265 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
266 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
267 | msgid "Japanese" | |
268 | msgstr "Japansk" | |
269 | ||
270 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
271 | #: tepl/tepl-encoding.c:175 | |
272 | msgid "Korean" | |
273 | msgstr "Koreansk" | |
274 | ||
275 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
276 | msgid "Chinese Simplified" | |
277 | msgstr "Kinesisk (förenklad)" | |
278 | ||
279 | #: tepl/tepl-encoding.c:155 | |
280 | msgid "Georgian" | |
281 | msgstr "Georgisk" | |
282 | ||
283 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
284 | msgid "Hebrew" | |
285 | msgstr "Hebreisk" | |
286 | ||
287 | #: tepl/tepl-encoding.c:170 | |
288 | msgid "Cyrillic/Ukrainian" | |
289 | msgstr "Kyrillisk/Ukrainsk" | |
290 | ||
291 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
292 | msgid "Vietnamese" | |
293 | msgstr "Vietnamesisk" | |
294 | ||
295 | #: tepl/tepl-encoding.c:174 | |
296 | msgid "Thai" | |
297 | msgstr "Thailändsk" | |
298 | ||
299 | #: tepl/tepl-encoding.c:370 | |
300 | msgid "Unknown" | |
301 | msgstr "Okänd" | |
302 | ||
303 | #. Translators: This is the sorted list of encodings used by Tepl for | |
304 | #. * automatic detection of the file encoding. You may want to customize | |
305 | #. * it adding encodings that are common in your country, for instance the | |
306 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
307 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
308 | #. * European languages) if you think people in your country will rarely | |
309 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
310 | #. * the encoding for the current locale, so please don't translate the | |
311 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
312 | #. * commas. | |
313 | #. | |
314 | #: tepl/tepl-encoding.c:695 | |
315 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
316 | msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
317 | ||
318 | #: tepl/tepl-encoding-converter.c:302 | |
319 | #, c-format | |
320 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
321 | msgstr "Konvertering från teckentabellen ”%s” till ”%s” stöds inte." | |
322 | ||
323 | #: tepl/tepl-encoding-converter.c:311 | |
324 | #, c-format | |
325 | msgid "Could not open converter from “%s” to “%s”: %s" | |
326 | msgstr "Kunde inte öppna konverteraren från ”%s” till ”%s”: %s" | |
327 | ||
328 | #: tepl/tepl-encoding-converter.c:368 | |
329 | msgid "The input data contains an invalid sequence." | |
330 | msgstr "Indata innehåller en ogiltig sekvens." | |
331 | ||
332 | #: tepl/tepl-encoding-converter.c:377 | |
333 | #, c-format | |
334 | msgid "Error when converting data: %s" | |
335 | msgstr "Fel vid konvertering av data: %s" | |
336 | ||
337 | #: tepl/tepl-encoding-converter.c:556 | |
338 | msgid "The input data ends with an incomplete multi-byte sequence." | |
339 | msgstr "Indata avslutas med en ofullständig flerbytesekvens." | |
340 | ||
341 | #: tepl/tepl-encoding-converter.c:579 | |
342 | msgid "The input content ends with incomplete data." | |
343 | msgstr "Inmatningsinnehållet avslutas med ofullständiga data." | |
344 | ||
345 | #: tepl/tepl-file.c:413 | |
346 | #, c-format | |
347 | msgid "Untitled File %d" | |
348 | msgstr "Namnlös fil %d" | |
349 | ||
350 | #: tepl/tepl-file-content-loader.c:331 | |
351 | #, c-format | |
352 | msgid "The file is too big. Maximum %s can be loaded." | |
353 | msgstr "Filen är för stor. Högst %s kan läsas in." | |
354 | ||
355 | #: tepl/tepl-file-loader.c:872 | |
356 | msgid "It is not possible to detect the character encoding automatically." | |
357 | msgstr "Det går inte att identifiera teckenkodningen automatiskt." | |
358 | ||
359 | #: tepl/tepl-file-saver.c:784 | |
360 | msgid "The file is externally modified." | |
361 | msgstr "Filen har ändrats externt." | |
362 | ||
363 | #: tepl/tepl-file-saver.c:1318 | |
364 | msgid "The buffer contains invalid characters." | |
365 | msgstr "Bufferten innehåller ogiltiga tecken." | |
366 | ||
367 | #: tepl/tepl-tab.c:534 | |
368 | msgid "Error when loading the file." | |
369 | msgstr "Fel vid inläsning av filen." | |
370 | ||
371 | #: tepl/tepl-tab.c:748 | |
372 | msgid "Save File" | |
373 | msgstr "Spara fil" | |
374 | ||
375 | #. Translators: location of a file. | |
376 | #: tepl/tepl-tab-label.c:273 | |
377 | msgid "Location:" | |
378 | msgstr "Plats:" | |
379 | ||
380 | #: tepl/tepl-tab-label.c:342 | |
381 | msgid "Close file" | |
382 | msgstr "Stäng fil" | |
383 | ||
384 | #: tepl/tepl-tab-saving.c:64 | |
385 | msgid "Error when saving the file." | |
386 | msgstr "Fel vid sparande av filen." | |
387 | ||
388 | #~ msgid "Could not find the file “%s”." | |
389 | #~ msgstr "Kunde inte hitta filen ”%s”." | |
390 | ||
391 | #~ msgid "Please check that you typed the location correctly and try again." | |
392 | #~ msgstr "Kontrollera att du angav platsen korrekt och försök igen." | |
393 | ||
394 | #~ msgid "Unable to handle “%s:” locations." | |
395 | #~ msgstr "Kan inte hantera ”%s:”-platser." | |
396 | ||
397 | #~ msgid "The location of the file cannot be accessed." | |
398 | #~ msgstr "Platsen för filen kan inte kommas åt." | |
399 | ||
400 | #~ msgid "“%s” is a directory." | |
401 | #~ msgstr "”%s” är en katalog." | |
402 | ||
403 | #~ msgid "“%s” is not a valid location." | |
404 | #~ msgstr "”%s” är inte en giltig plats." | |
405 | ||
406 | #~ msgid "Host “%s” could not be found. Please check that your proxy settings are correct and try again." | |
407 | #~ msgstr "Värden ”%s” kunde inte hittas. Kontrollera att dina proxyinställningar är korrekta och försök igen." | |
408 | ||
409 | #~ msgid "Hostname was invalid. Please check that you typed the location correctly and try again." | |
410 | #~ msgstr "Värdnamnet var ogiltigt. Kontrollera att du angav platsen korrekt och försök igen." | |
411 | ||
412 | #~ msgid "“%s” is not a regular file." | |
413 | #~ msgstr "”%s” är inte en vanlig fil." | |
414 | ||
415 | #~ msgid "Connection timed out. Please try again." | |
416 | #~ msgstr "Anslutningens tidsgräns överskreds. Försök igen." | |
417 | ||
418 | #~ msgid "Unexpected error: %s" | |
419 | #~ msgstr "Oväntat fel: %s" | |
420 | ||
421 | #~ msgid "_Retry" | |
422 | #~ msgstr "_Försök igen" | |
423 | ||
424 | #~ msgid "Edit Any_way" | |
425 | #~ msgstr "Redigera än_då" | |
426 | ||
427 | #~ msgid "The number of followed links is limited and the actual file could not be found within this limit." | |
428 | #~ msgstr "Antalet följda länkar är begränsat och den faktiska filen kunde inte hittas inom denna gräns." | |
429 | ||
430 | #~ msgid "You do not have the permissions necessary to open the file." | |
431 | #~ msgstr "Du har inte de rättigheter som krävs för att öppna filen." | |
432 | ||
433 | #~ msgid "" | |
434 | #~ "Unable to detect the character encoding.\n" | |
435 | #~ "Please check that you are not trying to open a binary file.\n" | |
436 | #~ "Select a character encoding from the menu and try again." | |
437 | #~ msgstr "" | |
438 | #~ "Kan inte identifiera teckenkodningen.\n" | |
439 | #~ "Kontrollera att du inte försöker öppna en binär fil.\n" | |
440 | #~ "Välj en teckenkodning från menyn och försök igen." | |
441 | ||
442 | #~ msgid "There was a problem opening the file “%s”." | |
443 | #~ msgstr "Det uppstod ett problem vid öppnandet av filen ”%s”." | |
444 | ||
445 | #~ msgid "" | |
446 | #~ "The file you opened has some invalid characters. If you continue editing this file you could corrupt it.\n" | |
447 | #~ "You can also choose another character encoding and try again." | |
448 | #~ msgstr "" | |
449 | #~ "Filen du öppnade innehåller ogiltiga tecken. Om du fortsätter redigera denna fil kan du förstöra den.\n" | |
450 | #~ "Du kan också välja en annan teckenkodning och försöka igen." | |
451 | ||
452 | #~ msgid "Could not open the file “%s” using the “%s” character encoding." | |
453 | #~ msgstr "Kunde inte öppna filen ”%s” med teckenkodningen ”%s”." | |
454 | ||
455 | #~ msgid "" | |
456 | #~ "Please check that you are not trying to open a binary file.\n" | |
457 | #~ "Select a different character encoding from the menu and try again." | |
458 | #~ msgstr "" | |
459 | #~ "Kontrollera att du inte försöker öppna en binär fil.\n" | |
460 | #~ "Välj en annan teckenkodning från menyn och försök igen." | |
461 | ||
462 | #~ msgid "Could not open the file “%s”." | |
463 | #~ msgstr "Kunde inte öppna filen ”%s”." |
0 | # Ukrainian translation for tepl. | |
1 | # Copyright (C) 2017 tepl's COPYRIGHT HOLDER | |
2 | # This file is distributed under the same license as the tepl package. | |
3 | # | |
4 | # yurchor <yurchor@ukr.net>, 2017. | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: tepl master\n" | |
8 | "Report-Msgid-Bugs-To: \n" | |
9 | "POT-Creation-Date: 2017-03-12 11:25+0000\n" | |
10 | "PO-Revision-Date: 2017-03-12 15:32+0200\n" | |
11 | "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" | |
12 | "Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n" | |
13 | "Language: uk\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n%" | |
18 | "10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" | |
19 | "X-Generator: Lokalize 1.5\n" | |
20 | ||
21 | #. Translators: %s is a filename. | |
22 | #: tepl/tepl-application-window.c:356 | |
23 | #, c-format | |
24 | msgid "Open “%s”" | |
25 | msgstr "Відкрити «%s»" | |
26 | ||
27 | #: tepl/tepl-application-window.c:575 | |
28 | msgid "Open _Recent" | |
29 | msgstr "Відкрити не_давній" | |
30 | ||
31 | #. Translators: %s is the application name. | |
32 | #: tepl/tepl-application-window.c:578 | |
33 | #, c-format | |
34 | msgid "Open a file recently used with %s" | |
35 | msgstr "Відкрити нещодавно використаний файл за допомогою %s" | |
36 | ||
37 | #. UTF-8 first, so that it's the first encoding returned by | |
38 | #. * tepl_encoding_get_all(). | |
39 | #. | |
40 | #: tepl/tepl-encoding.c:115 tepl/tepl-encoding.c:132 tepl/tepl-encoding.c:133 | |
41 | #: tepl/tepl-encoding.c:134 tepl/tepl-encoding.c:135 tepl/tepl-encoding.c:136 | |
42 | #: tepl/tepl-encoding.c:137 tepl/tepl-encoding.c:138 | |
43 | msgid "Unicode" | |
44 | msgstr "Unicode" | |
45 | ||
46 | #. FIXME GEOSTD8 ? | |
47 | #: tepl/tepl-encoding.c:117 tepl/tepl-encoding.c:129 tepl/tepl-encoding.c:157 | |
48 | #: tepl/tepl-encoding.c:180 | |
49 | msgid "Western" | |
50 | msgstr "Західна" | |
51 | ||
52 | #: tepl/tepl-encoding.c:118 tepl/tepl-encoding.c:158 tepl/tepl-encoding.c:178 | |
53 | msgid "Central European" | |
54 | msgstr "Центральноєвропейська" | |
55 | ||
56 | #: tepl/tepl-encoding.c:119 | |
57 | msgid "South European" | |
58 | msgstr "Південноєвропейська" | |
59 | ||
60 | #: tepl/tepl-encoding.c:120 tepl/tepl-encoding.c:127 tepl/tepl-encoding.c:185 | |
61 | msgid "Baltic" | |
62 | msgstr "Балтійська" | |
63 | ||
64 | #: tepl/tepl-encoding.c:121 tepl/tepl-encoding.c:159 tepl/tepl-encoding.c:166 | |
65 | #: tepl/tepl-encoding.c:168 tepl/tepl-encoding.c:169 tepl/tepl-encoding.c:179 | |
66 | msgid "Cyrillic" | |
67 | msgstr "Кирилиця" | |
68 | ||
69 | #: tepl/tepl-encoding.c:122 tepl/tepl-encoding.c:162 tepl/tepl-encoding.c:184 | |
70 | msgid "Arabic" | |
71 | msgstr "Арабська" | |
72 | ||
73 | #: tepl/tepl-encoding.c:123 tepl/tepl-encoding.c:181 | |
74 | msgid "Greek" | |
75 | msgstr "Грецька" | |
76 | ||
77 | #: tepl/tepl-encoding.c:124 | |
78 | msgid "Hebrew Visual" | |
79 | msgstr "Іврит (візуальний)" | |
80 | ||
81 | #: tepl/tepl-encoding.c:125 tepl/tepl-encoding.c:160 tepl/tepl-encoding.c:182 | |
82 | msgid "Turkish" | |
83 | msgstr "Турецька" | |
84 | ||
85 | #: tepl/tepl-encoding.c:126 | |
86 | msgid "Nordic" | |
87 | msgstr "Скандинавська" | |
88 | ||
89 | #: tepl/tepl-encoding.c:128 | |
90 | msgid "Celtic" | |
91 | msgstr "Кельтська" | |
92 | ||
93 | #: tepl/tepl-encoding.c:130 | |
94 | msgid "Romanian" | |
95 | msgstr "Румунська" | |
96 | ||
97 | #: tepl/tepl-encoding.c:140 | |
98 | msgid "Armenian" | |
99 | msgstr "Вірменська" | |
100 | ||
101 | #: tepl/tepl-encoding.c:141 tepl/tepl-encoding.c:142 tepl/tepl-encoding.c:150 | |
102 | msgid "Chinese Traditional" | |
103 | msgstr "Китайська (традиційна)" | |
104 | ||
105 | #: tepl/tepl-encoding.c:143 | |
106 | msgid "Cyrillic/Russian" | |
107 | msgstr "Кирилиця/Російська" | |
108 | ||
109 | #: tepl/tepl-encoding.c:145 tepl/tepl-encoding.c:146 tepl/tepl-encoding.c:147 | |
110 | #: tepl/tepl-encoding.c:164 tepl/tepl-encoding.c:172 | |
111 | msgid "Japanese" | |
112 | msgstr "Японська" | |
113 | ||
114 | #: tepl/tepl-encoding.c:149 tepl/tepl-encoding.c:165 tepl/tepl-encoding.c:167 | |
115 | #: tepl/tepl-encoding.c:175 | |
116 | msgid "Korean" | |
117 | msgstr "Корейська" | |
118 | ||
119 | #: tepl/tepl-encoding.c:152 tepl/tepl-encoding.c:153 tepl/tepl-encoding.c:154 | |
120 | msgid "Chinese Simplified" | |
121 | msgstr "Китайська (спрощена)" | |
122 | ||
123 | #: tepl/tepl-encoding.c:155 | |
124 | msgid "Georgian" | |
125 | msgstr "Грузинська" | |
126 | ||
127 | #: tepl/tepl-encoding.c:161 tepl/tepl-encoding.c:183 | |
128 | msgid "Hebrew" | |
129 | msgstr "Іврит" | |
130 | ||
131 | #: tepl/tepl-encoding.c:170 | |
132 | msgid "Cyrillic/Ukrainian" | |
133 | msgstr "Кирилиця/Українська" | |
134 | ||
135 | #: tepl/tepl-encoding.c:173 tepl/tepl-encoding.c:176 tepl/tepl-encoding.c:186 | |
136 | msgid "Vietnamese" | |
137 | msgstr "В’єтнамська" | |
138 | ||
139 | #: tepl/tepl-encoding.c:174 | |
140 | msgid "Thai" | |
141 | msgstr "Тайська" | |
142 | ||
143 | #: tepl/tepl-encoding.c:365 | |
144 | msgid "Unknown" | |
145 | msgstr "Невідоме" | |
146 | ||
147 | #. Translators: This is the sorted list of encodings used by Tepl for | |
148 | #. * automatic detection of the file encoding. You may want to customize | |
149 | #. * it adding encodings that are common in your country, for instance the | |
150 | #. * GB18030 encoding for the Chinese translation. You may also want to | |
151 | #. * remove the ISO-8859-15 encoding (covering English and most Western | |
152 | #. * European languages) if you think people in your country will rarely | |
153 | #. * use it. 'CURRENT' is a magic value used by Tepl and it represents | |
154 | #. * the encoding for the current locale, so please don't translate the | |
155 | #. * 'CURRENT' term. Keep the same format: square brackets, single quotes, | |
156 | #. * commas. | |
157 | #. | |
158 | #: tepl/tepl-encoding.c:640 | |
159 | msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" | |
160 | msgstr "['UTF-8', 'CURRENT', 'CP1251', 'KOI8U', 'UTF-16']" | |
161 | ||
162 | #: tepl/tepl-encoding-converter.c:302 | |
163 | #, c-format | |
164 | msgid "Conversion from character set “%s” to “%s” is not supported." | |
165 | msgstr "" | |
166 | "Підтримки перетворення з кодування «%s» на кодування «%s» не передбачено." | |
167 | ||
168 | #: tepl/tepl-encoding-converter.c:311 | |
169 | #, c-format | |
170 | msgid "Could not open converter from “%s” to “%s”: %s" | |
171 | msgstr "Не вдалося відкрити засіб перетворення з «%s» на «%s»: %s" | |
172 | ||
173 | #: tepl/tepl-encoding-converter.c:368 | |
174 | msgid "The input data contains an invalid sequence." | |
175 | msgstr "У вхідних даних міститься некоректна послідовність символів." | |
176 | ||
177 | #: tepl/tepl-encoding-converter.c:377 | |
178 | #, c-format | |
179 | msgid "Error when converting data: %s" | |
180 | msgstr "Помилка під час спроби перетворити дані: %s" | |
181 | ||
182 | #: tepl/tepl-encoding-converter.c:556 | |
183 | msgid "The input data ends with an incomplete multi-byte sequence." | |
184 | msgstr "Вхідні дані закінчилися на незавершеній багатобайтовій послідовності." | |
185 | ||
186 | #: tepl/tepl-encoding-converter.c:579 | |
187 | msgid "The input content ends with incomplete data." | |
188 | msgstr "Вхідні дані виявилися незавершеними." | |
189 | ||
190 | #: tepl/tepl-file.c:413 | |
191 | #, c-format | |
192 | msgid "Untitled File %d" | |
193 | msgstr "Файл без назви %d" | |
194 | ||
195 | #: tepl/tepl-file-content-loader.c:334 | |
196 | #, c-format | |
197 | msgid "The file is too big. Maximum %s can be loaded." | |
198 | msgstr "" | |
199 | "Файл є надто великим. Можна завантажувати файли, розмір яких не перевищує %s." | |
200 | ||
201 | #: tepl/tepl-file-loader.c:925 | |
202 | msgid "It is not possible to detect the character encoding automatically." | |
203 | msgstr "Неможливо визначити кодування символів у автоматичному режимі." | |
204 | ||
205 | #: tepl/tepl-file-saver.c:776 | |
206 | msgid "The file is externally modified." | |
207 | msgstr "Файл змінено ззовні." | |
208 | ||
209 | #: tepl/tepl-file-saver.c:1310 | |
210 | msgid "The buffer contains invalid characters." | |
211 | msgstr "У буфері містяться некоректні символи." | |
212 | ||
213 | #: tepl/tepl-io-error-info-bar.c:74 | |
214 | #, c-format | |
215 | msgid "Could not find the file “%s”." | |
216 | msgstr "Не вдалося знайти файл «%s»." | |
217 | ||
218 | #: tepl/tepl-io-error-info-bar.c:77 tepl/tepl-io-error-info-bar.c:104 | |
219 | #: tepl/tepl-io-error-info-bar.c:111 | |
220 | msgid "Please check that you typed the location correctly and try again." | |
221 | msgstr "" | |
222 | "Будь ласка, перевірте, чи правильно вказано адресу місця, і повторіть спробу." | |
223 | ||
224 | #. Translators: %s is a URI scheme (like for example | |
225 | #. * http:, ftp:, etc.). | |
226 | #. | |
227 | #: tepl/tepl-io-error-info-bar.c:90 | |
228 | #, c-format | |
229 | msgid "Unable to handle “%s:” locations." | |
230 | msgstr "Обробки місць «%s:» не передбачено." | |
231 | ||
232 | #: tepl/tepl-io-error-info-bar.c:98 | |
233 | msgid "The location of the file cannot be accessed." | |
234 | msgstr "Не вдалося отримати доступ до місця зберігання файла." | |
235 | ||
236 | #: tepl/tepl-io-error-info-bar.c:102 | |
237 | #, c-format | |
238 | msgid "“%s” is a directory." | |
239 | msgstr "«%s» є каталогом." | |
240 | ||
241 | #: tepl/tepl-io-error-info-bar.c:109 | |
242 | #, c-format | |
243 | msgid "“%s” is not a valid location." | |
244 | msgstr "«%s» не є коректним записом місця." | |
245 | ||
246 | #. Translators: %s is a hostname. | |
247 | #: tepl/tepl-io-error-info-bar.c:141 | |
248 | #, c-format | |
249 | msgid "" | |
250 | "Host “%s” could not be found. Please check that your proxy settings are " | |
251 | "correct and try again." | |
252 | msgstr "" | |
253 | "Не вдалося знайти вузол «%s». Будь ласка, перевірте, чи правильно вказано " | |
254 | "параметри проксі-сервера, і повторіть спробу." | |
255 | ||
256 | #. Use the same string as INVALID_HOST. | |
257 | #: tepl/tepl-io-error-info-bar.c:150 | |
258 | msgid "" | |
259 | "Hostname was invalid. Please check that you typed the location correctly and " | |
260 | "try again." | |
261 | msgstr "" | |
262 | "Некоректна назва вузла. Будь ласка, перевірте, чи правильно її вказано, і " | |
263 | "повторіть спробу." | |
264 | ||
265 | #: tepl/tepl-io-error-info-bar.c:159 | |
266 | #, c-format | |
267 | msgid "“%s” is not a regular file." | |
268 | msgstr "«%s» не є звичайним файлом." | |
269 | ||
270 | #: tepl/tepl-io-error-info-bar.c:164 | |
271 | msgid "Connection timed out. Please try again." | |
272 | msgstr "Перевищено час очікування на з’єднання. Будь ласка, повторіть спробу." | |
273 | ||
274 | #: tepl/tepl-io-error-info-bar.c:168 | |
275 | #, c-format | |
276 | msgid "Unexpected error: %s" | |
277 | msgstr "Неочікувана помилка: %s" | |
278 | ||
279 | #: tepl/tepl-io-error-info-bar.c:179 tepl/tepl-io-error-info-bar.c:212 | |
280 | #: tepl/tepl-progress-info-bar.c:53 | |
281 | msgid "_Cancel" | |
282 | msgstr "_Скасувати" | |
283 | ||
284 | #: tepl/tepl-io-error-info-bar.c:185 tepl/tepl-io-error-info-bar.c:195 | |
285 | msgid "_Retry" | |
286 | msgstr "П_овторити" | |
287 | ||
288 | #: tepl/tepl-io-error-info-bar.c:201 | |
289 | msgid "Edit Any_way" | |
290 | msgstr "Редагувати _попри все" | |
291 | ||
292 | #: tepl/tepl-io-error-info-bar.c:270 | |
293 | msgid "" | |
294 | "The number of followed links is limited and the actual file could not be " | |
295 | "found within this limit." | |
296 | msgstr "" | |
297 | "Кількість посилань для переходів є обмеженою. Сам файл не вкладається у ці " | |
298 | "обмеження." | |
299 | ||
300 | #: tepl/tepl-io-error-info-bar.c:275 | |
301 | msgid "You do not have the permissions necessary to open the file." | |
302 | msgstr "У вас немає достатніх прав доступу для відкриття файла." | |
303 | ||
304 | #: tepl/tepl-io-error-info-bar.c:285 | |
305 | msgid "" | |
306 | "Unable to detect the character encoding.\n" | |
307 | "Please check that you are not trying to open a binary file.\n" | |
308 | "Select a character encoding from the menu and try again." | |
309 | msgstr "" | |
310 | "Не вдалося визначити кодування символів.\n" | |
311 | "Будь ласка, перевірте, чи не намагаєтеся ви відкрити бінарний файл.\n" | |
312 | "Виберіть кодування у меню і повторіть спробу." | |
313 | ||
314 | #: tepl/tepl-io-error-info-bar.c:294 | |
315 | #, c-format | |
316 | msgid "There was a problem opening the file “%s”." | |
317 | msgstr "Під час спроби відкрити файл «%s» виникли проблеми." | |
318 | ||
319 | #: tepl/tepl-io-error-info-bar.c:296 | |
320 | msgid "" | |
321 | "The file you opened has some invalid characters. If you continue editing " | |
322 | "this file you could corrupt it.\n" | |
323 | "You can also choose another character encoding and try again." | |
324 | msgstr "" | |
325 | "У відкритому вами файлі було виявлено некоректні символи. Подальше " | |
326 | "редагування цього файла може призвести до пошкодження даних у ньому.\n" | |
327 | "Ви можете вибрати інше кодування символів і повторити спробу відкриття." | |
328 | ||
329 | #: tepl/tepl-io-error-info-bar.c:312 | |
330 | #, c-format | |
331 | msgid "Could not open the file “%s” using the “%s” character encoding." | |
332 | msgstr "Не вдалося відкрити файл «%s» з використанням кодування символів «%s»." | |
333 | ||
334 | #: tepl/tepl-io-error-info-bar.c:316 | |
335 | msgid "" | |
336 | "Please check that you are not trying to open a binary file.\n" | |
337 | "Select a different character encoding from the menu and try again." | |
338 | msgstr "" | |
339 | "Будь ласка, перевірте, чи не намагаєтеся ви відкрити бінарний файл.\n" | |
340 | "Виберіть інше кодування у меню і повторіть спробу." | |
341 | ||
342 | #: tepl/tepl-io-error-info-bar.c:329 | |
343 | #, c-format | |
344 | msgid "Could not open the file “%s”." | |
345 | msgstr "Не вдалося відкрити файл «%s»." | |
346 |
0 | AM_CPPFLAGS = \ | |
1 | -I$(top_srcdir) \ | |
2 | $(WARN_CFLAGS) \ | |
3 | $(AMTK_DEP_CFLAGS) | |
4 | ||
5 | AM_LDFLAGS = $(WARN_LDFLAGS) | |
6 | ||
7 | LDADD = $(top_builddir)/amtk/libamtk-core.la \ | |
8 | $(AMTK_DEP_LIBS) | |
9 | ||
10 | noinst_PROGRAMS = $(TEST_PROGS) | |
11 | TEST_PROGS = | |
12 | ||
13 | # TODO use Amtk only. | |
14 | #TEST_PROGS += test-menu | |
15 | #test_menu_SOURCES = test-menu.c | |
16 | ||
17 | -include $(top_srcdir)/git.mk |
0 | /* | |
1 | * This file is part of Tepl, a text editor library. | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Tepl is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Tepl is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include <tepl/tepl.h> | |
20 | ||
21 | static void | |
22 | add_action_info_entries (TeplApplication *tepl_app) | |
23 | { | |
24 | AmtkActionInfoStore *store; | |
25 | ||
26 | const AmtkActionInfoEntry entries[] = | |
27 | { | |
28 | /* action, icon, label, accel, tooltip */ | |
29 | ||
30 | { "app.quit", "application-exit", "_Quit", "<Control>q", | |
31 | "Quit the application" }, | |
32 | ||
33 | { "app.about", "help-about", "_About", NULL, | |
34 | "About this application" }, | |
35 | ||
36 | { "win.show-side-panel", NULL, "_Side Panel", "F12", | |
37 | "Show or hide the side panel" }, | |
38 | }; | |
39 | ||
40 | store = tepl_application_get_app_action_info_store (tepl_app); | |
41 | ||
42 | amtk_action_info_store_add_entries (store, | |
43 | entries, | |
44 | G_N_ELEMENTS (entries), | |
45 | NULL); | |
46 | } | |
47 | ||
48 | static void | |
49 | quit_activate_cb (GSimpleAction *quit_action, | |
50 | GVariant *parameter, | |
51 | gpointer user_data) | |
52 | { | |
53 | g_application_quit (G_APPLICATION (user_data)); | |
54 | } | |
55 | ||
56 | static void | |
57 | about_activate_cb (GSimpleAction *about_action, | |
58 | GVariant *parameter, | |
59 | gpointer user_data) | |
60 | { | |
61 | g_print ("About\n"); | |
62 | } | |
63 | ||
64 | static void | |
65 | add_app_action_entries (GApplication *app) | |
66 | { | |
67 | const GActionEntry entries[] = | |
68 | { | |
69 | { "quit", quit_activate_cb }, | |
70 | { "about", about_activate_cb }, | |
71 | }; | |
72 | ||
73 | amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (app), | |
74 | entries, | |
75 | G_N_ELEMENTS (entries), | |
76 | app); | |
77 | } | |
78 | ||
79 | static void | |
80 | startup_cb (GApplication *g_app, | |
81 | gpointer user_data) | |
82 | { | |
83 | TeplApplication *tepl_app; | |
84 | ||
85 | tepl_app = tepl_application_get_from_gtk_application (GTK_APPLICATION (g_app)); | |
86 | ||
87 | add_action_info_entries (tepl_app); | |
88 | add_app_action_entries (g_app); | |
89 | } | |
90 | ||
91 | static GtkWidget * | |
92 | create_file_submenu (void) | |
93 | { | |
94 | GtkMenuShell *file_submenu; | |
95 | AmtkFactory *factory; | |
96 | ||
97 | file_submenu = GTK_MENU_SHELL (gtk_menu_new ()); | |
98 | ||
99 | factory = amtk_factory_new_with_default_application (); | |
100 | gtk_menu_shell_append (file_submenu, amtk_factory_create_menu_item (factory, "app.quit")); | |
101 | g_object_unref (factory); | |
102 | ||
103 | return GTK_WIDGET (file_submenu); | |
104 | } | |
105 | ||
106 | static GtkWidget * | |
107 | create_view_submenu (void) | |
108 | { | |
109 | GtkMenuShell *view_submenu; | |
110 | AmtkFactory *factory; | |
111 | ||
112 | view_submenu = GTK_MENU_SHELL (gtk_menu_new ()); | |
113 | ||
114 | factory = amtk_factory_new_with_default_application (); | |
115 | gtk_menu_shell_append (view_submenu, amtk_factory_create_check_menu_item (factory, "win.show-side-panel")); | |
116 | g_object_unref (factory); | |
117 | ||
118 | return GTK_WIDGET (view_submenu); | |
119 | } | |
120 | ||
121 | static GtkWidget * | |
122 | create_help_submenu (void) | |
123 | { | |
124 | GtkMenuShell *help_submenu; | |
125 | AmtkFactory *factory; | |
126 | ||
127 | help_submenu = GTK_MENU_SHELL (gtk_menu_new ()); | |
128 | ||
129 | factory = amtk_factory_new_with_default_application (); | |
130 | gtk_menu_shell_append (help_submenu, amtk_factory_create_menu_item (factory, "app.about")); | |
131 | g_object_unref (factory); | |
132 | ||
133 | return GTK_WIDGET (help_submenu); | |
134 | } | |
135 | ||
136 | static GtkMenuBar * | |
137 | create_menu_bar (void) | |
138 | { | |
139 | GtkWidget *file_menu_item; | |
140 | GtkWidget *view_menu_item; | |
141 | GtkWidget *help_menu_item; | |
142 | GtkMenuBar *menu_bar; | |
143 | TeplApplication *app; | |
144 | AmtkActionInfoStore *store; | |
145 | ||
146 | file_menu_item = gtk_menu_item_new_with_mnemonic ("_File"); | |
147 | gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_menu_item), | |
148 | create_file_submenu ()); | |
149 | ||
150 | view_menu_item = gtk_menu_item_new_with_mnemonic ("_View"); | |
151 | gtk_menu_item_set_submenu (GTK_MENU_ITEM (view_menu_item), | |
152 | create_view_submenu ()); | |
153 | ||
154 | help_menu_item = gtk_menu_item_new_with_mnemonic ("_Help"); | |
155 | gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_menu_item), | |
156 | create_help_submenu ()); | |
157 | ||
158 | menu_bar = GTK_MENU_BAR (gtk_menu_bar_new ()); | |
159 | gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), file_menu_item); | |
160 | gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), view_menu_item); | |
161 | gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), help_menu_item); | |
162 | ||
163 | app = tepl_application_get_default (); | |
164 | store = tepl_application_get_app_action_info_store (app); | |
165 | amtk_action_info_store_check_all_used (store); | |
166 | ||
167 | return menu_bar; | |
168 | } | |
169 | ||
170 | static void | |
171 | add_win_actions (GtkApplicationWindow *window, | |
172 | GtkWidget *side_panel) | |
173 | { | |
174 | GPropertyAction *side_panel_action; | |
175 | ||
176 | side_panel_action = g_property_action_new ("show-side-panel", side_panel, "visible"); | |
177 | g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (side_panel_action)); | |
178 | g_object_unref (side_panel_action); | |
179 | } | |
180 | ||
181 | static void | |
182 | activate_cb (GApplication *g_app, | |
183 | gpointer user_data) | |
184 | { | |
185 | GtkWidget *window; | |
186 | GtkWidget *vgrid; | |
187 | GtkWidget *hgrid; | |
188 | GtkWidget *side_panel; | |
189 | ||
190 | window = gtk_application_window_new (GTK_APPLICATION (g_app)); | |
191 | gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); | |
192 | ||
193 | vgrid = gtk_grid_new (); | |
194 | gtk_orientable_set_orientation (GTK_ORIENTABLE (vgrid), GTK_ORIENTATION_VERTICAL); | |
195 | ||
196 | gtk_container_add (GTK_CONTAINER (vgrid), GTK_WIDGET (create_menu_bar ())); | |
197 | ||
198 | hgrid = gtk_grid_new (); | |
199 | side_panel = gtk_label_new ("Side panel"); | |
200 | gtk_container_add (GTK_CONTAINER (hgrid), side_panel); | |
201 | gtk_container_add (GTK_CONTAINER (hgrid), gtk_label_new ("Text view")); | |
202 | gtk_container_add (GTK_CONTAINER (vgrid), hgrid); | |
203 | ||
204 | add_win_actions (GTK_APPLICATION_WINDOW (window), side_panel); | |
205 | ||
206 | gtk_container_add (GTK_CONTAINER (window), vgrid); | |
207 | gtk_widget_show_all (window); | |
208 | } | |
209 | ||
210 | int | |
211 | main (int argc, | |
212 | char **argv) | |
213 | { | |
214 | GtkApplication *app; | |
215 | int status; | |
216 | ||
217 | app = gtk_application_new ("org.gnome.tepl.test-menu", G_APPLICATION_FLAGS_NONE); | |
218 | ||
219 | g_signal_connect (app, | |
220 | "startup", | |
221 | G_CALLBACK (startup_cb), | |
222 | NULL); | |
223 | ||
224 | g_signal_connect (app, | |
225 | "activate", | |
226 | G_CALLBACK (activate_cb), | |
227 | NULL); | |
228 | ||
229 | status = g_application_run (G_APPLICATION (app), argc, argv); | |
230 | g_object_unref (app); | |
231 | return status; | |
232 | } |
0 | @CODE_COVERAGE_RULES@ | |
1 | ||
2 | @VALGRIND_CHECK_RULES@ | |
3 | ||
4 | # https://github.com/dtrebbien/GNOME.supp | |
5 | VALGRIND_SUPPRESSIONS_FILES = \ | |
6 | $(GLIB_PREFIX)/share/glib-2.0/valgrind/glib.supp \ | |
7 | $(top_srcdir)/../GNOME.supp/build/base.supp \ | |
8 | $(top_srcdir)/../GNOME.supp/build/pango.supp \ | |
9 | $(top_srcdir)/../GNOME.supp/build/gdk.supp \ | |
10 | $(top_srcdir)/../GNOME.supp/build/gtk3.supp | |
11 | ||
12 | AM_CPPFLAGS = \ | |
13 | -I$(top_srcdir) \ | |
14 | $(WARN_CFLAGS) \ | |
15 | $(AMTK_DEP_CFLAGS) | |
16 | ||
17 | AM_LDFLAGS = $(WARN_LDFLAGS) | |
18 | ||
19 | LDADD = $(top_builddir)/amtk/libamtk-core.la \ | |
20 | $(AMTK_DEP_LIBS) | |
21 | ||
22 | noinst_PROGRAMS = $(UNIT_TEST_PROGS) | |
23 | TESTS = $(UNIT_TEST_PROGS) | |
24 | UNIT_TEST_PROGS = | |
25 | ||
26 | UNIT_TEST_PROGS += test-action-info-store | |
27 | test_action_info_store_SOURCES = test-action-info-store.c | |
28 | ||
29 | UNIT_TEST_PROGS += test-action-map | |
30 | test_action_map_SOURCES = test-action-map.c | |
31 | ||
32 | UNIT_TEST_PROGS += test-utils | |
33 | test_utils_SOURCES = test-utils.c | |
34 | ||
35 | if INSTALLED_TESTS | |
36 | insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)-@AMTK_API_VERSION@ | |
37 | insttest_PROGRAMS = $(UNIT_TEST_PROGS) | |
38 | ||
39 | %.test: %$(EXEEXT) Makefile | |
40 | $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ | |
41 | echo 'Description=Amtk test' >> $@.tmp; \ | |
42 | echo 'Exec=$(insttestdir)/$<' >> $@.tmp; \ | |
43 | echo 'Type=session' >> $@.tmp; \ | |
44 | echo 'Output=TAP' >> $@.tmp; \ | |
45 | mv $@.tmp $@) | |
46 | ||
47 | test_files = $(UNIT_TEST_PROGS:=.test) | |
48 | ||
49 | CLEANFILES = $(test_files) | |
50 | ||
51 | testmetadir = $(datadir)/installed-tests/$(PACKAGE)-@AMTK_API_VERSION@ | |
52 | testmeta_DATA = $(test_files) | |
53 | ||
54 | endif # INSTALLED_TESTS | |
55 | ||
56 | -include $(top_srcdir)/git.mk |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include <amtk/amtk.h> | |
20 | ||
21 | static void | |
22 | test_add_entries (void) | |
23 | { | |
24 | AmtkActionInfoStore *store; | |
25 | AmtkActionInfoCentralStore *central_store; | |
26 | AmtkActionInfo *info1; | |
27 | AmtkActionInfo *info2; | |
28 | ||
29 | const AmtkActionInfoEntry entries[] = | |
30 | { | |
31 | /* action, icon, label, accel, tooltip */ | |
32 | ||
33 | { "app.quit", "application-exit", "_Quit", "<Control>q", | |
34 | "Quit the application" }, | |
35 | ||
36 | /* Tooltip field missing, must be NULL. */ | |
37 | { "win.open", "document-open", "_Open", "<Control>o" }, | |
38 | }; | |
39 | ||
40 | store = amtk_action_info_store_new (); | |
41 | ||
42 | amtk_action_info_store_add_entries (store, | |
43 | entries, | |
44 | G_N_ELEMENTS (entries), | |
45 | NULL); | |
46 | ||
47 | info1 = amtk_action_info_store_lookup (store, "win.open"); | |
48 | g_assert (info1 != NULL); | |
49 | g_assert_cmpstr (amtk_action_info_get_icon_name (info1), ==, "document-open"); | |
50 | g_assert (amtk_action_info_get_tooltip (info1) == NULL); | |
51 | ||
52 | central_store = amtk_action_info_central_store_get_singleton (); | |
53 | info2 = amtk_action_info_central_store_lookup (central_store, "win.open"); | |
54 | g_assert (info1 == info2); | |
55 | ||
56 | info1 = amtk_action_info_store_lookup (store, "plouf"); | |
57 | g_assert (info1 == NULL); | |
58 | ||
59 | g_object_unref (store); | |
60 | } | |
61 | ||
62 | int | |
63 | main (int argc, | |
64 | char **argv) | |
65 | { | |
66 | gtk_test_init (&argc, &argv); | |
67 | ||
68 | g_test_add_func ("/action-info-store/add-entries", test_add_entries); | |
69 | ||
70 | return g_test_run (); | |
71 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include <amtk/amtk.h> | |
20 | ||
21 | static void | |
22 | test_add_action_entries_check_dups (void) | |
23 | { | |
24 | GSimpleActionGroup *group; | |
25 | const GActionEntry entries[] = | |
26 | { | |
27 | { "quit" }, | |
28 | { "about" } | |
29 | }; | |
30 | ||
31 | group = g_simple_action_group_new (); | |
32 | amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (group), | |
33 | entries, | |
34 | G_N_ELEMENTS (entries), | |
35 | NULL); | |
36 | g_object_unref (group); | |
37 | ||
38 | g_test_trap_subprocess ("/action-map/add-action-entries-check-dups/subprocess/add-two-times", 0, 0); | |
39 | g_test_trap_assert_failed (); | |
40 | g_test_trap_assert_stderr ("*the GActionMap already contains a GAction with the name*"); | |
41 | ||
42 | g_test_trap_subprocess ("/action-map/add-action-entries-check-dups/subprocess/dups-in-array", 0, 0); | |
43 | g_test_trap_assert_failed (); | |
44 | g_test_trap_assert_stderr ("*the GActionEntry array contains duplicated entries for the action name*"); | |
45 | } | |
46 | ||
47 | static void | |
48 | test_add_action_entries_check_dups__add_two_times (void) | |
49 | { | |
50 | GSimpleActionGroup *group; | |
51 | const GActionEntry entries[] = | |
52 | { | |
53 | { "quit" } | |
54 | }; | |
55 | ||
56 | group = g_simple_action_group_new (); | |
57 | ||
58 | amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (group), | |
59 | entries, | |
60 | G_N_ELEMENTS (entries), | |
61 | NULL); | |
62 | amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (group), | |
63 | entries, | |
64 | G_N_ELEMENTS (entries), | |
65 | NULL); | |
66 | ||
67 | g_object_unref (group); | |
68 | } | |
69 | ||
70 | static void | |
71 | test_add_action_entries_check_dups__dups_in_array (void) | |
72 | { | |
73 | GSimpleActionGroup *group; | |
74 | const GActionEntry entries[] = | |
75 | { | |
76 | { "quit" }, | |
77 | { "quit" } | |
78 | }; | |
79 | ||
80 | group = g_simple_action_group_new (); | |
81 | ||
82 | amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (group), | |
83 | entries, | |
84 | G_N_ELEMENTS (entries), | |
85 | NULL); | |
86 | ||
87 | g_object_unref (group); | |
88 | } | |
89 | ||
90 | int | |
91 | main (int argc, | |
92 | char **argv) | |
93 | { | |
94 | g_test_init (&argc, &argv, NULL); | |
95 | ||
96 | g_test_add_func ("/action-map/add-action-entries-check-dups", | |
97 | test_add_action_entries_check_dups); | |
98 | g_test_add_func ("/action-map/add-action-entries-check-dups/subprocess/add-two-times", | |
99 | test_add_action_entries_check_dups__add_two_times); | |
100 | g_test_add_func ("/action-map/add-action-entries-check-dups/subprocess/dups-in-array", | |
101 | test_add_action_entries_check_dups__dups_in_array); | |
102 | ||
103 | return g_test_run (); | |
104 | } |
0 | /* | |
1 | * This file is part of Amtk - Actions, Menus and Toolbars Kit | |
2 | * | |
3 | * Copyright 2017 - Sébastien Wilmet <swilmet@gnome.org> | |
4 | * | |
5 | * Amtk is free software; you can redistribute it and/or modify it under | |
6 | * the terms of the GNU Lesser General Public License as published by the | |
7 | * Free Software Foundation; either version 2.1 of the License, or (at your | |
8 | * option) any later version. | |
9 | * | |
10 | * Amtk is distributed in the hope that it will be useful, but WITHOUT ANY | |
11 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
13 | * License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public License | |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include <amtk/amtk.h> | |
20 | ||
21 | static void | |
22 | check_strv_equal (const gchar * const *strv1, | |
23 | const gchar * const *strv2) | |
24 | { | |
25 | gint i; | |
26 | ||
27 | if (strv1 == NULL || strv2 == NULL) | |
28 | { | |
29 | g_assert (strv1 == NULL && strv2 == NULL); | |
30 | return; | |
31 | } | |
32 | ||
33 | for (i = 0; strv1[i] != NULL && strv2[i] != NULL; i++) | |
34 | { | |
35 | g_assert_cmpstr (strv1[i], ==, strv2[i]); | |
36 | } | |
37 | ||
38 | g_assert (strv1[i] == NULL); | |
39 | g_assert (strv2[i] == NULL); | |
40 | } | |
41 | ||
42 | static void | |
43 | test_strv_copy (void) | |
44 | { | |
45 | const gchar *stack_strv_empty[] = { NULL }; | |
46 | const gchar *stack_strv_nonempty[] = { "a", "b", NULL }; | |
47 | GPtrArray *ptr_array; | |
48 | gchar **heap_strv; | |
49 | gchar **strv_copy; | |
50 | ||
51 | /* NULL */ | |
52 | strv_copy = _amtk_utils_strv_copy (NULL); | |
53 | g_assert (strv_copy == NULL); | |
54 | ||
55 | /* Empty */ | |
56 | strv_copy = _amtk_utils_strv_copy (stack_strv_empty); | |
57 | check_strv_equal (stack_strv_empty, (const gchar * const *)strv_copy); | |
58 | g_strfreev (strv_copy); | |
59 | ||
60 | /* Non-empty */ | |
61 | strv_copy = _amtk_utils_strv_copy (stack_strv_nonempty); | |
62 | check_strv_equal (stack_strv_nonempty, (const gchar * const *)strv_copy); | |
63 | g_strfreev (strv_copy); | |
64 | ||
65 | /* Created from a GPtrArray */ | |
66 | ptr_array = g_ptr_array_new (); | |
67 | g_ptr_array_add (ptr_array, g_strdup ("")); | |
68 | g_ptr_array_add (ptr_array, g_strdup ("non-empty")); | |
69 | g_ptr_array_add (ptr_array, g_strdup ("bathory")); | |
70 | g_ptr_array_add (ptr_array, NULL); | |
71 | ||
72 | heap_strv = (gchar **)g_ptr_array_free (ptr_array, FALSE); | |
73 | ||
74 | strv_copy = _amtk_utils_strv_copy ((const gchar * const *)heap_strv); | |
75 | check_strv_equal ((const gchar * const *)heap_strv, | |
76 | (const gchar * const *)strv_copy); | |
77 | g_strfreev (strv_copy); | |
78 | ||
79 | g_strfreev (heap_strv); | |
80 | } | |
81 | ||
82 | int | |
83 | main (int argc, | |
84 | char **argv) | |
85 | { | |
86 | g_test_init (&argc, &argv, NULL); | |
87 | ||
88 | g_test_add_func ("/utils/strv-copy", test_strv_copy); | |
89 | ||
90 | return g_test_run (); | |
91 | } |