pax_global_header00006660000000000000000000000064133430417650014520gustar00rootroot0000000000000052 comment=17dca0125fc3c931418d8723b684332d35bd5715 gcolor3-2.3.1/000077500000000000000000000000001334304176500130735ustar00rootroot00000000000000gcolor3-2.3.1/LICENSE000066400000000000000000000432551334304176500141110ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. gcolor3-2.3.1/README.md000066400000000000000000000040301334304176500143470ustar00rootroot00000000000000Gcolor3 ======= **Choose colors from the picker or the screen** This README is only relevant for development resources and instructions. For a description of Gcolor3, screenshots and installation instructions for end-users, please see the [website](https://hjdskes.nl/projects/gcolor3/). Compile from source ------------ To compile Gcolor3, you need the GTK+ 3 development packages and your distribution's package containing the tools to compile packages. You also need the [meson](http://mesonbuild.com) build system. When the build- and runtime dependencies of Gcolor3 have been installed, run the following commands to build and install Gcolor3: $ meson build $ ninja -C build # ninja -C build install Translations ------------ You can help translating Gcolor3 to your own language! Currently, Gcolor3 is available in over 10 languages. New translations are always welcome! To do so, simply follow these steps: $ meson build $ ninja -C build gcolor3-pot $ mv po/Gcolor3.pot po/xx.po Where `xx` is the code of your language (e.g. `nl` for Dutch or `en_GB` for British English). Edit the [LINGUAS](https://gitlab.gnome.org/World/gcolor3/blob/master/po/LINGUAS) file and add your language code. Please keep the list sorted alphabetically. Lastly, open the `.po` file you just generated and translate all the strings. Don't forget to fill in the information in the header! When a translation needs updating, execute the following commands: $ meson build $ ninja -C build gcolor3-update-po When you are done translating, either make a pull request on [GitLab][gitlab] or send me the file via [email](mailto:hjdskes@gmail.com). Bugs ---- For any bug or request, please [create an issue](https://gitlab.gnome.org/World/gcolor3/issues/new?issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=) on [GitLab][gitlab]. License ------- Please see [LICENSE](https://gitlab.gnome.org/World/gcolor3/blob/master/LICENSE) on [GitLab][gitlab]. **Copyright © 2013 - 2018** Jente Hidskes <hjdskes@gmail.com> [gitlab]: https://gitlab.gnome.org/World/gcolor3 gcolor3-2.3.1/data/000077500000000000000000000000001334304176500140045ustar00rootroot00000000000000gcolor3-2.3.1/data/color-row.ui000066400000000000000000000122761334304176500162760ustar00rootroot00000000000000 gcolor3-2.3.1/data/gcolor3-marshalers.list000066400000000000000000000022641334304176500204140ustar00rootroot00000000000000# see glib-genmarshal(1) for a detailed description of the file format, # possible parameter types are: # VOID indicates no return type, or no extra # parameters. if VOID is used as the parameter # list, no additional parameters may be present. # BOOLEAN for boolean types (gboolean) # CHAR for signed char types (gchar) # UCHAR for unsigned char types (guchar) # INT for signed integer types (gint) # UINT for unsigned integer types (guint) # LONG for signed long integer types (glong) # ULONG for unsigned long integer types (gulong) # ENUM for enumeration types (gint) # FLAGS for flag enumeration types (guint) # FLOAT for single-precision float types (gfloat) # DOUBLE for double-precision float types (gdouble) # STRING for string types (gchar*) # BOXED for boxed (anonymous but reference counted) types (GBoxed*) # POINTER for anonymous pointer types (gpointer) # OBJECT for GObject or derived types (GObject*) # NONE deprecated alias for VOID # BOOL deprecated alias for BOOLEAN VOID:STRING VOID:STRING,STRING gcolor3-2.3.1/data/gcolor3.1000066400000000000000000000016311334304176500154370ustar00rootroot00000000000000.TH GCOLOR3 "1" "August 26, 2018" . .SH NAME gcolor3 \- a color selection dialog . .SH SYNOPSIS .B gcolor3 .RI [ OPTIONS ] . .SH DESCRIPTION .B gcolor3 enables you to pick the color from any pixel on your screen. It also offers a palette, so that you can easily mix and match a couple of colors together. . .SH OPTIONS .SS "Help Options" .TP .BR \-h ", " \-\^\-help Show help options .TP .BR \-\^\-help\-all Show all help options .SS "Application Options" .TP .BR \-v ", " \-\^\-version Show the application's version .TP .BI "\-\^\-display=" DISPLAY X display to use . .SH FILES .TP .BR $XDG_CONFIG_HOME/gcolor3/rgb.ini Your saved color are stored in this file . .SH NOTES .B gcolor3 prints the last selected color to stdout in hex format on exit. . .SH BUGS For any bugs or feature requests, please create an issue on GitLab at https://gitlab.gnome.org/World/gcolor3/issues . .SH AUTHORS Jente Hidskes and contributors gcolor3-2.3.1/data/gcolor3.gresource.xml000066400000000000000000000010071334304176500200710ustar00rootroot00000000000000 shortcuts.ui menus.ui color-row.ui window.ui gcolor3-2.3.1/data/menus.ui000066400000000000000000000012231334304176500154700ustar00rootroot00000000000000
app.shortcuts _Keyboard Shortcuts app.about _About app.quit _Quit <Primary>q
gcolor3-2.3.1/data/meson.build000066400000000000000000000011511334304176500161440ustar00rootroot00000000000000install_data('nl.hjdskes.gcolor3.svg', install_dir: join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps')) install_man('gcolor3.1') i18n.merge_file( input: 'nl.hjdskes.gcolor3.desktop.in', output: 'nl.hjdskes.gcolor3.desktop', type: 'desktop', po_dir: join_paths(meson.source_root(), 'po'), install: true, install_dir: join_paths(datadir, 'applications') ) i18n.merge_file( input: 'nl.hjdskes.gcolor3.appdata.xml.in', output: 'nl.hjdskes.gcolor3.appdata.xml', type: 'xml', po_dir: join_paths(meson.source_root(), 'po'), install: true, install_dir: join_paths(datadir, 'metainfo') ) gcolor3-2.3.1/data/nl.hjdskes.gcolor3.appdata.xml.in000066400000000000000000000101651334304176500221610ustar00rootroot00000000000000 nl.hjdskes.gcolor3.desktop CC0-1.0 GPL-2.0+ Color picker Choose colors from the picker or the screen

Ever wanted to know the value of that color on your screen? Gcolor3 enables you to pick the color from any pixel on your screen. It also offers a palette, so that you can easily mix and match a couple of colors together.

When you have found the perfect combination of colors, naturally you want to save them. Gcolor3 allows you to conveniently save and retrieve colors.

Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike Gcolor2, but uses the newer GTK+ version and other modernisations to better integrate into your modern desktop.

AppMenu HiDpiIcon ModernToolkit https://gitlab.gnome.org/World/gcolor3/raw/3216e4703e78e934d72255f81c9b339cd2345e69/picker.png The picker and the color palette https://gitlab.gnome.org/World/gcolor3/raw/3216e4703e78e934d72255f81c9b339cd2345e69/saved.png The list of saved colors https://hjdskes.nl/projects/gcolor3/ https://gitlab.gnome.org/World/gcolor3/issues https://gitlab.gnome.org/World/gcolor3/issues Jente Hidskes hjdskes_at_gmail.com gcolor3

Gcolor3 has moved to the GNOME umbrella! It is now part of the World collection, non official GNOME projects that use additional functionality.

  • The saved colors page is now more in-line with GNOME
  • Gcolor3 now builds on FreeBSD

After two years, work has finally picked up again on Gcolor3. Thanks to numerous contributors, Gcolor3 version 2.3 is finally here. It brings UI improvements, new and updated translations and a crash fix for Wayland. Full Wayland support is planned for version 2.4.

  • Redesign the saved colors page
  • Redesign the header bar
  • Disable color picking on Wayland for now, instead of crashing
  • Add a shortcuts window
  • Gcolor3 is now available as a Flatpak
  • New and updated translations
  • Gcolor3 now comes with a manual page
  • Lots of under-the-hood improvements

  • Centrally manage colors between several running instances;
  • Follow the XDG directory specification for the configuration file. This means that the configuration file has moved from `~/.rgb.ini` to `$XDG_CONFIG_HOME/gcolor3/config.ini`;
  • Copy the selected color's hex value from the tree view using Ctrl-C;
  • Make the main window resizable;
  • Translation updates.
For more information, see the release notes on Gcolor3's GitLab page.

nl.hjdskes.gcolor3.desktop gcolor3
gcolor3-2.3.1/data/nl.hjdskes.gcolor3.desktop.in000066400000000000000000000007661334304176500214270ustar00rootroot00000000000000[Desktop Entry] Name=Color picker Comment=Choose colors from the picker or the screen Exec=gcolor3 # Translators: Do NOT translate or transliterate this text (this is an icon file name)! Icon=nl.hjdskes.gcolor3 StartupNotify=true Terminal=false Type=Application Categories=GNOME;GTK;Graphics; # Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity Keywords=Color;Picker;Palette; # Required for Unity to show the application name. X-Ubuntu-Gettext-Domain=gcolor3 gcolor3-2.3.1/data/nl.hjdskes.gcolor3.svg000066400000000000000000000303741334304176500201460ustar00rootroot00000000000000 image/svg+xml May 2007 Andreas Nilsson http://www.andreasn.se 3 gcolor3-2.3.1/data/shortcuts.ui000066400000000000000000000046441334304176500164110ustar00rootroot00000000000000 1 1 shortcuts 12 1 General 1 F9 Change page 1 Palette shortcuts 1 <ctrl>s Save currently selected color 1 Saved color management 1 <ctrl>c Copy highlighted color's hex value 1 Delete Delete highlighted color gcolor3-2.3.1/data/window.ui000066400000000000000000000267321334304176500156640ustar00rootroot00000000000000 True False document-save-symbolic gcolor3-2.3.1/meson.build000066400000000000000000000030021334304176500152300ustar00rootroot00000000000000project('gcolor3', 'c', version: '2.3.1', license: 'GPL2+', meson_version: '>= 0.40.0', default_options: [ 'c_std=c99', 'werror=true' ] ) dep_gtk = dependency('gtk+-3.0', version: '>= 3.20.0', required: true) cc = meson.get_compiler('c') dep_lm = cc.find_library('m', required: true) i18n= import('i18n') gnome = import('gnome') prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir')) datadir = join_paths(prefix, get_option('datadir')) localedir = join_paths(prefix, get_option('localedir')) subdir('data') subdir('src') subdir('po') defines = [ ['PACKAGE', meson.project_name()], ['PACKAGE_NAME', meson.project_name()], ['PACKAGE_URL', 'https://hjdskes.nl/projects/gcolor3'], ['PACKAGE_VERSION', meson.project_version()], ['GETTEXT_PACKAGE', meson.project_name()], ['LOCALE_DIR', localedir], ['COPYRIGHT', '2013 - 2018'], ] config_h = configuration_data() foreach define: defines config_h.set_quoted(define[0], define[1]) endforeach config_h.set('UNUSED', '__attribute__ ((unused))') configure_file(output: 'config.h', configuration: config_h) meson.add_install_script('meson_install.sh', get_option('datadir')) output = '\n ' + meson.project_name() + ' ' + meson.project_version() + '\n' output += ' ==================\n\n' output += ' prefix: ' + prefix + '\n' output += ' bindir: ' + bindir + '\n' output += ' datadir: ' + datadir + '\n' output += ' localedir: ' + localedir + '\n' message(output) gcolor3-2.3.1/meson_install.sh000066400000000000000000000003441334304176500162770ustar00rootroot00000000000000#!/usr/bin/env sh if [ -z $DESTDIR ]; then DATADIR=$1 # Update the desktop database update-desktop-database -q # Update icon cache gtk-update-icon-cache -f -t $MESON_INSTALL_DESTDIR_PREFIX/$DATADIR/icons/hicolor fi gcolor3-2.3.1/nl.hjdskes.gcolor3.json000066400000000000000000000015421334304176500174020ustar00rootroot00000000000000{ "app-id": "nl.hjdskes.gcolor3", "runtime": "org.gnome.Platform", "runtime-version": "3.28", "sdk": "org.gnome.Sdk", "command": "gcolor3", "finish-args": [ "--share=ipc", "--socket=x11", "--socket=wayland", "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro", "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf" ], "cleanup": [ "/share/man" ], "modules": [ { "name": "gcolor3", "buildsystem": "meson", "config-opts": [ "--buildtype=debugoptimized" ], "sources": [ { "type": "git", "url": "https://gitlab.gnome.org/World/gcolor3.git" } ] } ] } gcolor3-2.3.1/picker.png000066400000000000000000001104721334304176500150630ustar00rootroot00000000000000PNG  IHDRI&0xsBIT|dtEXtSoftwaregnome-screenshot> IDATxw|ueu:[P^("Ł8(EAA"8@ld,=ȼ{h&mҦ%M_;hvO>O=ԣE+B!4MC4l>6qSN]$vtOJJжmAvUUQU5B!tt: ^ݹs7= pqRRSN9ej v;B!hL&GYݹs:dȐV!B$zc%B!Dc( V5I)..8S$B!^o1hfX_Shtۄ$&ݢw,UUIN>DZZ*>d2ؒv:ھPUÇވP?!K4RPPyZ-l?n&Pj^D :b"u~J87XС8OϞk4iJھHJ:@VV&  `7Gԁp%{w_׽([!.,m£L /}s_x RݻfOѥK7{kHѪU+ `7AԁP?!uv0At2:ƅq¬byOZ#(fX ЅTUE [48QPr:0EE>B!"HOhp'Q4fBQ=`7A!BIOhp'Q4fBQ !BQHOhpN'aXj%=B0 w<3 >*wK\x O?&Oyٲu_wAE]Đ!Cꫯضmݻwgڴi{nɿ ۵kǜ9s+ضm p^.{eŬ[ ruUފl6?<-!C0e4ir(!cL|I\^|5şuGt:22eӯ\s:U&'7]0;ILHp[l_ϙm8K~_'V;F8j2.}y78)*IqVyWTU?]&6&oe +X˯}3f3AUU>]?~_Ypϝ\/˚(*,bK;;wFUU劢21=Ƣ2;=o>'i]2cǎs<%p%%=e|LZz:ߛs';;~⬻hlظ_ȼٳ~|^3Oys+hެ/ڿxLD7a⤗l}u]7 |B Ȼ3bS4h _.7^y/į_Dcϵn%Tx{*ڶ$;GǎcnՊoK>j(.Zn_ڷo… }~>O޽z 5konݚI&W_cD/өc;wqڷk˫/M ^9MH9ܳiѢy:e<8n:wDL2}Ǟoy{{tܑg&:7Kdd$7oOCsˊfĉ|5kBxXt0Yٌz>wdpe3 yFol6q޹%챱͉bՏ?,ii% zv]iضD_iYDEa=y=ӡ}J~Yok֭0w{l{)IN]Ze  ĭqrfìбC''3vկ,Y ^{5RSS1_>ӦMСC9rٳgeqqqXV+̬,~_={SUUeU$&%A#ٶ};II- t:]s5s?KΈ0]||f3ll`0|5̞7G|F&t5kBji*/=1ͬgRSS`2u/@<9{[׮̚M4i&̚ݺve~%/ѣs9/ꫯr}qӪU+^粓Y#<}Ν;Yp!&L <4a&"BJu#$>MӰZθi&|Ekm%h`C\E]=z=缐G-`t+N/tqsz_k=sr}(kL;U;x]NTT EaB:DGG;GZ8(Bbb+ NPPpkD^o@UPTT|^Ӧ͜3EEEnw[Nif( 6ФIA ,3y9<<͛c6ͩ~llfsiڴ&^8b߾<!O8*xeҋ. ~W (((NSRR6/??c]ANN咗yį"ZQin';v_ !'&AoWTرm%P !D Ahp4ϣG%BB0tfN+荋)qB4ғ.U E4^BAtHOh/ IN |a ]48ғ(3 !D5H*xERqal%eZh#:ߖ& ݁^`9vL_L0v;mސIpE^/cf&/?.>f"RG6Q^$&СCցb&##:u}ؒ %Po$Hoʎ/uvS%Я{ (0۽U"`¢ nŐ#i׮ر"Bdd]t ;j ncD45k~ v3Dsn!{|BRPP .B!B] B!p'AB!!p8!B! Cqqq B!pa8q"/mB!B0|`A!BBIMM!B!!2B!!Ft!B!BB!B ҅B!1 !Bb$HB!"H.B!D ]!B#AB!!Ft!B!BB!B ҅B!1 !Bb$HB!"H.B!D ]!B#AB!!Ft!B!BB!B ҅B!1 !Bb$HB!"H.B!D ]!B#AB!!Ft!B!BB!B ҅B!1 !Bb$HB!"H.B!D1BddaXQaa$$$즈:"%tQRSS`7B!Rfff^N'<<<ͩtmf3;wMxxDHh fC*ǜ`%d9ғ^!GL'tu9uYXu9X\lJzŊLZ$F͈К5%B!B%\mAH-D:&wCt=| pz:uS"Ԅ1Ge69owqܰ?qzJN(W(ؕ"4䱃<*oҢhjASD{eE7:MXcX,`7C7E( c!"// kgƍ5cЭWUG)-9B(4n*mHS4#z6kMkB!:i$v~bf^GYɞTP1P/W)Wl7Rl܈>} %r K0N6!BQa~ _ίKH'pī k{Ǡ˲i;EX5D[!<m !BH)))3VE,&]-0l{ *[8s1G@DDG8ZqB! Y BQ6Ay>boϩ:`?9 lS1Y.T|;ze'!BO$H"}gsIrWRUP-GﺷtOcUXVwtXJEֲB! ~͇8k^]ߪ }P<> ⻡h"!BQ݀Q3ǹ̎z\]3V=H.PDk]]˦.]4q0D_,gnQi/&..Α#G*MNNfȐ!ӧOϟ_f矧_~DGGӽ{w@lh@XW\w|]/"I^KfQ8S?2yJ~ r2ϭiR)jgbVqEaƍ77l29СCrұcG֭[ǘ1c׿'|p8K駟x7ٵkf͢M6ެpC!nFuj,S,_NS\ƍ9s&O=[n^_fΜ9:s=8KFFEr0'M]jaeJ{cdgy`[$8RQM[Wyv* (.x y QfΜС3f̠ILL䭷K.u yt|P'( q4mڴ.64,/_}ѣGsnڵ+ǎmۖ1cо}{ڴiO?n܆)//ѡ};w_1O?uO2iDY; p>.((`ԩDFFҦMFARR˅ERL  !Oi.5I}<ѣر#۷o> ]4sNgQFѣ9x ˖-cL0Nnn.FL:~8&?s&3g>w>#sN>3$.,,DUUV+<?#ǎc۶mvmуV\P%.@JJ*&v\SYiWP=杻s-&%kx8}磯Of$z֋xwp}NV[n3@k^eAFյ ئŔiyGi_T˰0˜9g.iĴh7гGTU%556YA܂g49Sx9x &38%K0h g-[fqG׮];w[^kbb"k֬_~jՊ{n-&{g|s{UF Kt\~%k[Lj;wTYiÆ t֍X}QILL䪫b޼y N8Qr!BR݈} l4)tJ"@|thy#O#õi܆5CtC^H魬v{hZ+rb7 ܆zg˖M\uյnFdd+ӧ_P > U(W_÷A?4t_L1?販wqU*\NfR;|#lp:`͸(֋M{#TWy)^OmB!DkAˆN(f<'gT-We=l=ر%Kv'Jh9KzwSSK8 is/pkB!N gF~M)u iœq5 4>!CnСБZzXr>GqssO[`4 "f !BԙFwČx)c<_ȕa<דGOo&2` ߆ Xz5thhsX/0B= އ%8LI l>B!*H9zӣ= w})08Kㅣ"f74tJIp)ii`1j s ^PUGeUGASu!BԑFOZxЫ ڵ*KOwgj0Y9sNihZIAӘ-74#[|KuALT;hS?!B:(3%+|O-H7j,| i'JKKc lڴ MPT%PցVKz q*ˉ2$Q\{kZ*ϨBthDQ!B:FƤ&_I.N| k4/- g۶muz+/(= )]}fjt7%4Mcɒ%<㤤x]OE0YÓG=Q~5l`ս^rO#@/OmB!uSgJiQ}X K!LkiL&ׯGS5tJ.NZPѴK8iQzъ\JFAnG4SEXKy)Q7?{TgQ!ŸDOf~+)TT7B/\c9r5}/QfFC_]IoK:-v ( RTat%Zie@LshshVL*q?3 [U 22ҰX,npp"ɾ)BI(sVK[}>C&y%]] |oH_YfQPPP'9?**9ri: EN}k=3WFӇI[Eeff`6\Mdd6bs߄Gďo6Tdffg6CS]ތ>C.S\*NW=bڔrnf?ߦQY~+/n"ꛓST]|չR^*L:i Saaau:'7MoP2ǜz4d^ЫM7j&>EGGIII^`ժU%SK] :, w)RZt zEAӹ}ٽy.a14cr=MG=C?uV\Yz,,,\F@ɾ)BQxxDHsmL߰ysi=/J[?Pc-/"ǎǠӗ zN_!pi-Fw)Q: lp W.m4c<.IB!AS/ϐ\~?Mie'zw=iTTs0|_j4bN:Mp((:6:LpJͪm-j3cf~ );-NyB!Rt TW G|jO7݁taΝGzz:Fc{Kup;F䶹iB!7*HcfN| нOt[o@*((gtW(%yZi½IZӊoHw)ck~=u^v]K~-BQQ gDs *'i; B2MCI̫EOzvzv{[3<_.yv@-B̍܏^tFȿ}*9VZs(,,Dӣӕvs/e*wM4eshFeǒ EOYSc{]#(pB!pUoYST=@.nΰw0vSlشuXVVk&y@믉g!99!CO>}?~QSW_uCod[[q|# iӽJ+5 s..]Jqq1zE>JR:bN-ť44Mq.h0Ћ#Ġ/tS5icyuzF?`:th߾_;7n˖-#+Qrss :t(SLaڵSn{$7mq;7 u>;I~q5OO|!jZO>;˖;i_|Qsxf$Ǐ$,Z̿3 G;;ǘھ'%66YfѢE ˿K 6[na$''\GXK -@Ӿ %<|#RT\|^uCa}K4F!ߓcd&Ŕv{*.=M?]%mwc|=EzqK4/=饽=zSr): }_{zC]~oW^͕W\i={(TNGLL,kڵct֍swST\Tt2{{hղ^Ec:y "#"#xY??Y7oQ/dҫ0Ҵiڽuȑ#tm^׮]8vڵ5qPW^~+#+;S:TLƜ}ZoeQG=@/<g[ZRX,V\Ů]@i ZWJR ^G)U)Wu^i(Iy*k /..\L|CEi4N:/7iڵma7q頋JuӐ/4e+e=tpry:tߦ}-,W^sǎon~'_x!.n?u'K^#tҙ_xRU*"F&M8s}Sr1Se9͗iFVV6yk^z[.xMl磹iѼ$;nI/臫]^&m([3o{Eu{;U_rC:H?~8?'fSǼO BO^jj*+V|Knnn rϫ5wCXϥǼROeKjssSs^*z]KRQ{C~}8+W1:|F ~WvM~~>`XNu*lvfKodש=H>rsLF#=.%111WpPXXHbbu(LL9g%f_)'B)ᠠЧc}K4F!͊mDO]zζr-.M5Mغu+;V ӊttSV2ny^j]JY۞UG6(Yv"NY۷kǨE|ky/VǍ\s9xkO+T|w2\ՆO`d~ҶROrڴi޽{%''*mڴN] =f2Kuhߎ?o`W뉊*q*,,GEE0׉ro߆¾%< q'/<WjzFu BkoYEɚ'pzur$=p -}ƙ{ӿ{;k/.<|31.L?JlL 2LPת?ŗ_f3xmn/ިJjjYmsb!"< -[fqG׮];w.__~­/u{zYj > ;\ovFS3%-=-6zj}K4FJjjJ͒W@4Ί%Q _HKKUCS54G}juAIu_!cpOf7Z ێW?Ii˖M\uյnFdd_JnC\\|PҧOA_}7P333~A?愜' IDATd#z;5Mq)+ZZ|~p2˖-'33JQv\=!0 E-8@G֟)r.B!?\D+=P(j%C0zp27opԠBϸtʼn|A(Ew5wP[OK=מJ=eUHO:z#ӯ!OjlD)G K !arknb `ذa#7oUC)(ji4U4OSPTJx^Υ;֕\։R~8.=SQ8 ]^1\f ! &3S]{8$Znn.6mȇsqo*r]{+WCЋ|Tiw9{U]n'RC'Hu?R\[Oz *B!D#rA ϩ.Ӟ Hu9tUU+}^KEES@[=|+㖗-Wމ㟗\|9_}yC\עs_H tMo|6yvB! l6P K3ʎ;D@)՜ɡszC %OU='V}՝8ZzMPBdqvAa(6 1,mB!DRA&:lHkd`Evv6vbTVPGKXWE)T uՒ=nӊwYUE=כQ]HTltP?2^ӊ݊azX{ l6즈ZXkdl.dH8h6'8DGGp.`ibv/N"C>>W,uCMj9TOnʩ.eUOe _<={_{L;qi4]F#6>{/*z˦ʯ뭇|N5=^UHͣi9U(غ'j5+Oy9;@ Off֭b19ÉO$...Mu@MjBbA.ݗO BUvhimq8Xy.nx].x^bޟ?T{7 '..>BT Li Pғ5 {w=z4@:Nt[E<\o+:dayt500i`г$j @ BXL(TjfSf3II(...=W5FodRiH.ZRrVŵRx=)|,E.C]U %u/Z B'Ԓ}Jޯ|tYcR!B46!'5*cޝGU ;kN" .X7ԺoUZĵukkkժUk[_[bUK+" $@BBV2Lf33I|'w=s0 ONMaֱw^4MKb\kW f̣fg+(=ьy̬:a0h1f|،z1eqx3i KвPk қMJ%HB!DH } um)/>zkMy1;oU+m =Az`k:kus. )uHc\;)E\`l:~-m>vx4}&:]UUUUqݩh΀G/&ߛ"Ϝj;7s\?%RZK= ZaU;iYSk *h@+6/ 2ÅZ䪣F)19$S:?phQh{^Wu*nfNUڢ)CrlTs*]~j .+m~͊աV /ҔNbJ</fՄI5aRM ~ kӼЪEkB*&UFc60\TAE |UUDCE l(Qk*ni: jMMJ,ڮ &Jl6&LHeee"|otcgNͤѳF5uF ,"dVCW& Qc1 Wd;Q-%1'R-AzOv$l6FKHGv{FZI NiO8 'p70{kzT5j&q*n1m(q6a  xFICQ^AoBԚ.B! AzYs9xp8h%5nuxy^̣KWt op퉞7-fҳG.hҔ߲B;M ɤDKuq:]x<@x0lzKʼnlw[«^ ƨM(Q/ J1 /Q &l" / <:%WᥩѮ[m.I<_B!I td")k}i\n4M ̞kz[44ŠK~"FJsUŊB i-Ucty"DWÄ+D/dpadDbSqnΊ ұXZ]M6(n ҅B5&H* 3>׋(mX9u%i5ܡ,u2vQc\Lo ϓm[:: gnϤ'At!Bt ']Z&JD6CNE36Qm#/ln6RJ[B[sZ6u&\+aX!ӥMnyS+'7{`|r-nN;1+jmQEkaALm (%|::7(x<DݚѹB!h6YX<&fDI&fs [(v?j!%^DE.d*ы /2=EKJ/ .S7xH>C~KG=^d2u(H_SN>4<sn݆}|,\|I""uŜ+--嬳΢)Ssϵz79393ZLx嗙={69;0!y]y7n~޽;/EMnm΃=q.85͖͘@+(Zھx_T=gh8EW[l>԰y๰@_Qaa} /bB-ڪmcWmN̤fdnyg9ʚƜ[z5ٜ̚6kO~Buuu:̙È#Xj7x#\s _Ԧ/wT?v,K_~q->Pm֮]?ƍկ~o[zꩤ<<<,_1ArYrYFM`-2L:6j Պ(i) 1)'*JKKRQmZNIњk 6/r ۠"mh ޔZ9˛:j}oJY~^Q3d՚5=^uOWg7\E8Nt]gӦM 0 s=Gqq1=Fͮ]Kn#D[&%*cKc2zbX":0|p/_;… [=cqw0g 0>|p^|E/^&D+f&=O[fͨՆͤ[V2331-)$Fi) JdaIQ&Bb*i!"SK">fb1?y~V6WJu-3ѳfUߡ>nl֮߀ j6|^/GLʅ>s_x }^Ͳߋ/6[N9}3ϿȥW^y\}&3|gC'*((' //믿ιqg͔&FRM* s@fMwСCC3227oK. y&HiIC *j_~dffrσ>H 3 DOBbWɰmt_M y=qČv(OzP''=cAӧ* 6l t*3+p5x?sEȟڟKSϰg}<_USEwFeee5*ؘ1cػwom^{yܡ~zρ+VpG&} 6DaϞ=]6F!:*m]4-6@uf#7+%- ꣇*$ۗaZi%mϖ~zs'&Švaqj+gZZ_a7W?=VQ+s[-f͜0sF?OWkhwYgO$y\q%r⟠( xUcB~B9ɴja.C#G 1&[~I( S&OFd>7n7?F/">ƍɓyy#..?s!xW+MiMQ_xzs Vo^5A_rLxmz^꧇쩇[+]MoC'wE̤i)'--;v6>G4Mݥ49Y=޽{+{)((w;ppUWyǒ%KޝM&H/*zTLkvKQ uczߺ$],i|;6 4#Ʃ'{!goImh.o_L;H4?}T^_}71瘣y^Oʩ'eíc<; GAAu!C}chƐ!Cna(z<8.3gX8j N9i.Z0Hm?7o3g43 }Q}б ĤK9cΠ:"mr҇v礗zAi4T7Vs}M rc(GhmTr0^[=7\i;>[8[-l4ƃ1I JӒ޶t~~Gd5|j͙q~]TVUqUW2ed Q߶vݰ:"X{_siꫯ7`֬Y$Fпk5~ / /yW˻bBt ҇ᏭbTŠ7?躎]CK2ƩmQ1%]EB_ R1E-<֧bQ[bI !VUM5%\ImC ͌{>\ v87 Ո!P~D]}q.??˛oM}}=W|ʶohӿ?+r+'?\Jeڪʅs/ĺ|l߱/|⮻youkin7.+Vh"Yx1vbҥ7[omS!Ji.^&~oN8Psn`֭+8G/]իWS^^G͙giBIw4`]k *5b5vv֣{1a&ScWm+qjUו5эkq``5ԍ6%-a~<-aj~2n 'C_g3U9Mwik`GLF99.pW_W^I>ujD?wK7qeOP~j`x_YI~^}&ǎE4**S={.rL'nٳgcij \C1p@/__ϴi3f O?4gђnL!jW_q=3324.Ps`֭߼Oϩ':_'fRm;јل#Éi#ц'Ĩy+3ۡ[x֣7mlmՖDHmnٹA !U>$/Ȝf+:LLVz;Fs /\]k7_x\U4x>fS[V!u3연v#t<*`7t_Na]n54*B>(t3cےTPq_pszz+a) Um7*وR1TQMQ[JJL2i.́ty"HqQllCX?ǽ6y]V֏ 2=ч},!Bt fX=kj_GW*:gPԄ$FFե<}LsĬrհ %%"j`yjMWIc'Pџ;vIțaT5q ZUL ڼE|UMmC ;o6o&-П.A{GgԆ[}_ *xkr IDAT^ln"eS#ǡq0`[~˕mn[l8C]@7Eqi3'ffM5p'ىƫymÜ8o!cl]~fݿ.Azx:T !"u!MGr+ǖ qc9Ɍm)N]t%wݨ#J[1b_AW4))%#tc~X^wFƺz-Azx Z09/ѥcB!]N,t3obTQ߼ݳz*߉'z8p Q~+UUp G1,hJ\%\Zo/ /}*U4o)&#>qlQ!H&pĖYlC -MzMo/-KqnE+lbbMzv^n(oMM2Yn^clP6B!W ugbg[A~l&?5_;@y6[oeF;|>j0;N_ 3~+]8Zn'wB!AzIMZ~yt7o/|HZV|v5ZS&"RUUUUqݩlv @aaQ] F;xpsv}7.ϲK1!nY~f JDݒ@J+Zs5M]Q *hQQFCըJ4Qn)*f"h q,!Btp]̚5]~s\lT7U_罕%t-s}AݻrB̭`(P';4]Bl߾=[ƌ9;~ S_iFM;AxB =6Hqʜ|n4\|i5:YBRΈ?AWcysm[mm-S/A='Yt0Nyߨ8ގwH!z.]ټyeet) <χix.gee1nx&NĞ=e|Ῡ>OBQ^!SդsT2e7?|Wabrqy凎xtjqSQSf|r |i*r,V/tɨc%b}o2YrټyK0`.+irQ\< .Jl"#oA:!p5cF5XI 8Ԩ~I': T0)Jz:j15jSP\z)g\?7jr߱d# ;Mj1/9‹bsW pOo^xlrIzzBz&4 /4/[e4NzH$.|-a#Aw-6`N)cOIsO=^nd/m3gLC gxG4֭[ '|E u=M4N}:+V>˗;pB)(( ''ǰ zL:|?8ncrqy$%YCu 5osss[tɀ˪Io4<0.{/orN _v{e͡c7ztmuޅ\{|@`&gck8j~-f1g_x1wPZmw?Ͻҷ3ſ6/lXtu<!NYYGKz=z|=={vw˘/R-HvvvǷv^t+f҃ΛdCg?lb”q/x:rKҴ|p,+L!y0}^E UzQOtCgRZn Pe^,yH\f5-3M AR;6l~=\M>#n زuU/لI5,Ձj|Y3Uk>cѳ0LпYoo7? ^c 9sVDNw{~NU۬XO>9t|w3g#F$u^tԫt_=fl{ŧkX9^u-`\5ON!%{:_AW4LO^2VՊd/zI~Q=2_jЮ"77^ (6駞+l:>ǜ}<9PO8oW۶1b!h+o~ 3㏝X ?v,?[g`ϸ%(o}g}ϼ)çDv~q"D f n>7n7 ۹뮻(**⫯?9seӦMdeez^tt |iKŋN4n @ޠ´wYglvGFFG0eG5=I*1EQDtKz0QUu ZJ&?66?f֯hhh`wiY/UU8M:ft{cX3>see8.&ҝ%Dknw^J^ BgΜ/))᭷C?3hs4zu-,+'=zVʃ\{_T/?kN*u= uDjلeSQ.̓?g;mOɭaCy˗`clld}2lX>T ͆oaz\ =jh^!s O=<V^g%¯:kϼn|g44QX8C7`;iTklld޼y̜9ŋ'l[TTѣ)++ky!A +u<|m Ѝ;wK2^f[W}X˜߀Pm.ݢRh|Ogv*6thĹ۫zƍ=,4~m;g~;w28JK=80#mv&N|‚|6׳jg˒{=&I]O>"ڟPQQNAA~g-.υ^j^h`va:/D:`N澋Qyhw2{it+:C) E5<0Oyj.J9.^S1G͍??UعGg\{ǼkXzר%??˛oM}}=W|ʶo =.;;cgcOdc[8樣B3QQN{_]g8Nvҋ߽;\.w}uV{1vͨQׯ_h۰an,Y¡ColnJ(9e}&ݟk6P]ýz0=#PI[\P`jbo~rhǍ5{n=3N;5ec4/;nGLt!z]veF:JJɖ^0bcÆu|iClL2-c3A7u'K3SH!鬱(2cT²ݥnںHQps\׻t@י4TECeȐlذ={ϜgϞ26lXǐ!2dQBNgt_p;.:dwFSG[K/e%;)ч躎-;ÏNc?p~د~ >zK!Jhqm?+:jf"D_aX8gٱ*+p( uWN*v?_MQQ6E+dkt`QWCO0;UnY n sȸ' ߰o7-C1O}ZA +gti[!:AVVcN ''/ݻ3).Hvv?,@xzilldr\.'~%%%dffxB~}&'=-yQ9&Z3=|[#G}٘X#ޗ@7- =V9Ini? ӫ̢B@|?UU@ffS\\LvvvΠKNHW鐓f҃.dHΣb8+lNz.`+?a>'yUMz~1i(d>sB^Jh%2 n̄ `J4EѳM?lX,呝͐!C|h9b6l"D7ӉNՔ } k/c/,Ι]_Ϣx_%GWVH3=V͌ f#CxL<~qD\˚mFUXL~hߙZ]#2P֛E :WdG4Sn|c{&B @jMV+q/X{>~q6|lImޔC]_v4T`E=~wh`cmJ+e B!z>{h<-{Ԩ_H``$ݲ3ua nah_t]dzB +Mp4)i~b/ r?ĎMո~(Bt_~Ynz(B\NV^ɸqR: mf9llIeWE3Gc{s} #ߥ߽Df[8Zq~nձ58my ܥ/_!D79p P}„\NlLFF&)qxpߟ3YhFebIo%S8G~E~2t2524LfP:?ס4xjU<5*ZO W W w z'zOqtZ?\$ʁUTVVvR=!<@ [z+7Ov0芞8lO/6sKv,fuuߡ>p=R>B!;$3zXzE2Qdtܨ~2zԾM2FYTz@t!B='bk:j Г K'p7^p~?QО(@Oth?{f;\V ЅBHcƫ5|-Ç &e x=IDAT{nA~i:|uűB!Lv8is0PO7pLOܨ]Gds58Hw& B!z/pGpԫq/qiG. E,m~%/ BHIjU^|2WϤVmwr ;ZV1 =_C߄ =Ws=ڏNPDf0`E 9-{2}ߚBj2AzW̮wly[^G?E !;} L E\.n=Cu!DNs&iX˱?pc6K\TW`X^iMnWYY)v &RYY!z9s[*9͜Py篙jL@uf0Š} 4ʇ|' %E]t=CVBt9 һA@nhٽ'o *ǒ {L1uSdsaIw!BMnva>9K6ƏlXkE%?ޕEW`?CCLYG{0r!B&Az3d7Ovo+3_,xbFaN8/#kI>B!]M4e錞ajR&JM,7Uq*U< * ,Yl{?<[F ?YCd9ԏP.B!H {S$[!:B!B ҅Hm7 f9/&O>-[BO=T{h6<l#GlSR:,2e =\̘ZkjswƜZzBtIw"^{M^y\rх\tvvhQGŻqLU6cΜ9}gʕ,\%\txppWC5 !> "^yC l6ӡ6=šyڵ/'&jll1 !H "W9'Ϋ{Hm]ǎkR2p`tm`\>j&f82niSu; ' 0ih3Ͽ՟QuE\p9|܈O<׭gwi)C 废,wQYYĉsx?˗v{8標,J2324kӧ+.s=7ߌBu~i ~'X,/_isF;뮻(--eذaIIFcc#%%%6v!]Kr҅H]~˸/}.gȰ߁k\'?4s>w&N4gdU̓L9b2w;<_,Ⅷ̥]#zo7䚫y'=rKne#QWWS>jSϰg}<_USrE "Ǻ͟?N,YBMM 555|^&"@8-ߤ6eee5*1cƌ`޽I\OK F|A2332d]t~mG2!]Ht!R@u+ӿ_7%5b%rM7v{Xzu_r9b8v>c9trrrُhlldwiuӦAAA>'pjk,wJ~~>%%P( y쫨ɓⶫؿ谙Tʄqc)-6[۪zX-222pll~̖_2nwgvssrp\Wit(k~8={6˗/P|jkk#gċns͜93_RR[o!‡~gu!~)N9T!(AZyuqϕ0yn/'xعs;4hp?|0֮[ϩ?8)sx4 M"fK۷E7iS9 <zfeeQPߡq /~3uzV\j壏>Ԝ!C}chƐ!CnEEE=v!Hjjj5jLJ=[VFCMMMΙgb*>_>nA%Q[iov0bo;wQYUW]ɔɓ)*,DU:d@QYYYNc{\~TVV_ŋSYYIee%'x"ߨNW_EӴб7xYf.LM{8va~]B'AѼ^OJdZmx6z*n^x/l۾*V^òfԓOg3ϒiS߿u=ͷަ+>e7tOUUܳyŗX~#>;v__u7ox icѢExbvҥKo~íڦ6`|h0`>˦M;v,|wd!IJt!%?YĔ#&xgٿqݔ d1DŽ\}Տyo1_YΚw:<(.嶟j*0/ GLsbSO<=LƏiTTzHu d\L61cOG'Z. MCCn,YBii)Ŝ|<3߀B#\O֯_+9$'=»﬋{ 89]a ! ]yUUaCcu 5F&G}2p,IЄB!"H.={7O`=_3izhB!1o߆܏2LK99 !"mL233vvCOpB! ] G͜!!B$M]B!H3 !Bf$HB!"H.B!D ]!B4#AB!iFtѣY,V<OʞqcZRB!$H=Z~~>;wnqws{\n" "Language-Team: Deutsch <>\n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.1.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:145 msgid "Color picker" msgstr "Farbwähler" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:84 msgid "Choose colors from the picker or the screen" msgstr "Wählen Sie Farben vom Farbrad oder dem Bildschirm" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Farbe;Farbauswahl;Farbpalette;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Gcolor3 ermöglicht es, die Farbe eines beliebigen Pixels des Bildschirms " "aufzunehmen. Weiterhin wird eine Farbpalette zur Abstimmung von " "Farbkombinationen bereitgestellt." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Gcolor3 ermöglicht in bequemer Weise Abspeichern und Wiederverwenden Ihrer " "Lieblingsfarben." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 ist ein Farbwahlprogramm basierend auf GTK+ 3. Zur Funktionalität " "von Gcolor2 bietet es eine modernisierte Benutzeroberfläche." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Der Farbwähler und die Farbpalette" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Liste der gespeicherten Farben" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Redesign the saved colors page" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:59 msgid "Redesign the header bar" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:60 msgid "Disable color picking on Wayland for now, instead of crashing" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:61 msgid "Add a shortcuts window" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:62 msgid "Gcolor3 is now available as a Flatpak" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:63 msgid "New and updated translations" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:64 msgid "Gcolor3 now comes with a manual page" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:65 msgid "Lots of under-the-hood improvements" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:74 msgid "Centrally manage colors between several running instances;" msgstr "Zentrale Farbverwaltung zwischen verschiedenen laufenden Instanzen;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:75 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" "Die Konfigurationsdatei folgt nun der \"XDG directory specification\". Das " "bedeutet dass die Datei nun am Ort `$XDG_CONFIG_HOME/gcolor3/config.ini` " "statt am Ort `~/.rgb.ini` liegt;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:77 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "Strg+C zum Kopieren des gewählten HEX-Werts aus der Baumansicht;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:78 msgid "Make the main window resizable;" msgstr "Hauptfenster größenveränderbar;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:79 msgid "Translation updates." msgstr "Aktualisierung der Übersetzungen." #: data/color-row.ui:46 msgid "Click to change the color's name" msgstr "Klicken um den Namen der Farbe zu ändern" #: data/color-row.ui:47 msgid "Name" msgstr "Name" #: data/color-row.ui:68 msgid "Copy this color's hex value to the clipboard" msgstr "Diesen HEX-Wert in die Zwischenablage kopieren" #: data/color-row.ui:90 msgid "Delete this color" msgstr "Diese Farbe löschen" #: data/menus.ui:7 msgid "_Keyboard Shortcuts" msgstr "_Tastenkürzel" #: data/menus.ui:11 msgid "_About" msgstr "_Über Gcolor3" #: data/menus.ui:15 msgid "_Quit" msgstr "_Beenden" #: data/shortcuts.ui:14 msgid "General" msgstr "Allgemein" #: data/shortcuts.ui:19 msgid "Change page" msgstr "Tab wechseln" #: data/shortcuts.ui:27 msgid "Palette shortcuts" msgstr "Tastenkürzel für die Farbpalette" #: data/shortcuts.ui:32 msgid "Save currently selected color" msgstr "Momentan gewählte Farbe speichern" #: data/shortcuts.ui:40 msgid "Saved color management" msgstr "Gespeichertes Farbmanagement" #: data/shortcuts.ui:45 msgid "Copy highlighted color's hex value" msgstr "HEX-Wert der hervorgehobenen Farbe in die Zwischenablage" #: data/shortcuts.ui:52 msgid "Delete highlighted color" msgstr "Hervorgehobene Farbe löschen" #: data/window.ui:26 msgid "Color name..." msgstr "Farbname..." #: data/window.ui:89 msgid "page0" msgstr "" #: data/window.ui:155 msgid "page1" msgstr "" #: data/window.ui:162 msgid "Saved colors" msgstr "Gespeicherte Farben" #: src/main.c:43 msgid "Show the application's version" msgstr "Programmversion anzeigen" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- wählen Sie eine Farbe vom Farbwähler oder dem Bildschirm" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "'%s --help' ausführen, um die vollständige Parameterliste anzuzeigen" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:88 msgid "translator-credits" msgstr "Jens John, Vincent Bermel" #: src/gcolor3-application.c:89 msgid "Website" msgstr "Webseite" #: src/gcolor3-color-row.c:76 msgid "Could not parse color to display thumbnail\n" msgstr "Farbe konnte nicht verarbeitet werden\n" #: src/gcolor3-color-selection.c:406 msgid "" "Select the color you want from the outer ring. Select the darkness or " "lightness of that color using the inner triangle." msgstr "" "Wählen Sie die gewünschte Farbe vom äußeren Farbkreis und die gewünschte " "Helligkeit auf dem inneren Dreieck." #: src/gcolor3-color-selection.c:436 msgid "Picking a color is currently not supported on Wayland." msgstr "" "Das Abgreifen einer Farbe vom Bildschirm ist momentan unter Wayland nicht " "möglich." #: src/gcolor3-color-selection.c:447 msgid "" "Click the eyedropper, then click a color anywhere on your screen to select " "that color." msgstr "" "Klicken Sie auf das Pipettensymbol und dann auf einen beliebigen Punkt auf " "dem Bildschirm um die dortige Farbe auszuwählen." #: src/gcolor3-color-selection.c:458 msgid "_Hue:" msgstr "Farbwert _H:" #: src/gcolor3-color-selection.c:459 msgid "Position on the color wheel." msgstr "Winkel auf dem Farbkreis." #: src/gcolor3-color-selection.c:461 msgid "S_aturation:" msgstr "Sättigung _S:" #: src/gcolor3-color-selection.c:462 msgid "Intensity of the color." msgstr "Intensität der Farbe." #: src/gcolor3-color-selection.c:463 msgid "_Value:" msgstr "Hellwert _V:" #: src/gcolor3-color-selection.c:464 msgid "Brightness of the color." msgstr "Helligkeit der Farbe." #: src/gcolor3-color-selection.c:465 msgid "_Red:" msgstr "_Rot:" #: src/gcolor3-color-selection.c:466 msgid "Amount of red light in the color." msgstr "Rotanteil der Farbe." #: src/gcolor3-color-selection.c:467 msgid "_Green:" msgstr "_Grün:" #: src/gcolor3-color-selection.c:468 msgid "Amount of green light in the color." msgstr "Grünanteil der Farbe." #: src/gcolor3-color-selection.c:469 msgid "_Blue:" msgstr "_Blau:" #: src/gcolor3-color-selection.c:470 msgid "Amount of blue light in the color." msgstr "Blauanteil der Farbe." #: src/gcolor3-color-selection.c:473 msgid "Op_acity:" msgstr "_Opazität:" #: src/gcolor3-color-selection.c:481 src/gcolor3-color-selection.c:491 msgid "Transparency of the color." msgstr "Opazität (Nichttransparenz) der Farbe." #: src/gcolor3-color-selection.c:498 msgid "Color _name:" msgstr "Farb_name:" #: src/gcolor3-color-selection.c:513 msgid "" "You can enter an HTML-style hexadecimal color value, or simply a color name " "such as “orange” in this entry." msgstr "" "Akzeptiert werden sowohl HTML-artige Hexadezimal-Farbwerte als auch " "Farbnamen wie \"Orange\"." #: src/gcolor3-color-selection.c:545 msgid "_Palette:" msgstr "_Palette:" #: src/gcolor3-color-selection.c:575 msgid "Color Wheel" msgstr "Farbkreis" #: src/gcolor3-color-selection.c:1040 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now. You can drag this color to a palette entry, or select this color as " "current by dragging it to the other color swatch alongside." msgstr "" "Die zuvor gewählte Farbe und zum Vergleich rechts die aktuelle Farbe. Kann " "in die Palette gezogen werden für einen Eintrag dort oder als gewählte Farbe " "festgelegt werden." #: src/gcolor3-color-selection.c:1046 msgid "" "The color you’ve chosen. You can drag this color to a palette entry to save " "it for use in the future." msgstr "" "Die gewählte Farbe. Kann in eine Palette gezogen und so zur zukünftigen " "Verwendung gespeichert werden." #: src/gcolor3-color-selection.c:1052 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now." msgstr "Die zuvor gewählte Farbe und zum Vergleich die aktuelle Farbe." #: src/gcolor3-color-selection.c:1056 msgid "The color you’ve chosen." msgstr "Die gewählte Farbe." #: src/gcolor3-color-selection.c:1425 msgid "_Save color here" msgstr "Farbe hier _speichern" #: src/gcolor3-color-selection.c:1631 msgid "" "Click this palette entry to make it the current color. To change this entry, " "drag a color swatch here or right-click it and select “Save color here.”" msgstr "" "Auf diesen Paletteneintrag klicken um die Farbe auszuwählen. Zum Bearbeiten " "des Eintrags Farbfeld hier hin ziehen oder Rechtsklick und Klick auf \"Farbe " "hier speichern\"." #: src/gcolor3-color-store.c:66 #, c-format msgid "Error creating config directory: %s" msgstr "Fehler beim Anlegen des Konfigurationsordners: %s" #: src/gcolor3-color-store.c:89 #, c-format msgid "Cannot count number of items: %s\n" msgstr "Anzahl der Einträge konnte nicht gezählt werden: %s\n" #: src/gcolor3-color-store.c:110 #, c-format msgid "Cannot read colors: %s\n" msgstr "Folgende Farbe konnte nicht verarbeitet werden: %s\n" #: src/gcolor3-color-store.c:124 #, c-format msgid "Cannot access color at position %d: %s\n" msgstr "Zugriff nicht möglich auf Farbe an Position %d: %s\n" #: src/gcolor3-color-store.c:147 #, c-format msgid "Error writing file: %s" msgstr "Fehler beim Schreiben der Datei: %s" #: src/gcolor3-color-store.c:187 #, c-format msgid "" "Error opening file: %s. Colors likely won't be saved, unless this is the " "first run" msgstr "Fehler beim Öffnen der Datei: %s. Farben werden nicht gespeichert." #: src/gcolor3-color-store.c:215 src/gcolor3-color-store.c:301 #, c-format msgid "There is already a color named `%s`" msgstr "Eine Farbe mit Name `%s` besteht bereits." #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot locate index of addition: %s. UI won't be updated\n" msgstr "" #: src/gcolor3-color-store.c:254 #, c-format msgid "Cannot locate index of removal: %s. UI won't be updated\n" msgstr "" #: src/gcolor3-color-store.c:268 #, c-format msgid "Error deleting key: %s" msgstr "Fehler beim Löschen des Schlüssels: %s" #: src/gcolor3-color-store.c:296 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Nichtexistente Farbe `%s` konnte nicht umbenannt werden." #: src/gcolor3-color-store.c:306 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Der HEX-Wert konnte nicht ermittelt werden für `%s`: %s" #: src/gcolor3-color-store.c:312 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Fehler beim Löschen des alten Namens `%s`: %s" #: src/gcolor3-color-store.c:345 #, c-format msgid "Error reading keys: %s. This is harmless if this is the first run" msgstr "Fehler beim Lesen der Schlüssel: %s. Harmlos beim ersten Start." #: src/gcolor3-window.c:397 msgid "Picker" msgstr "Farbwähler" gcolor3-2.3.1/po/el.po000066400000000000000000000062261334304176500144570ustar00rootroot00000000000000# Greek translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-10-01 14:04+0200\n" "PO-Revision-Date: Wed Jul 29 2015 19:07:48 GMT+0200 (CEST)\n" "Last-Translator: Konstantinos Thermos \n" "Language-Team: Greek\n" "Language: el\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Loco-Source-Locale: en_US\n" "X-Generator: Loco - https://localise.biz/\n" "X-Loco-Parser: loco_parse_po\n" "X-Loco-Target-Locale: el_GR\n" #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:1 ../src/gcolor3-application.c:146 #, fuzzy msgid "Color picker" msgstr "Επιλογέας χρώματος" #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:2 ../src/gcolor3-window.c:499 #, fuzzy msgid "Choose colors from the picker or the screen" msgstr "Επιλέξτε χρώματα απο την παλέτα ή απο την οθόνη" #. Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:4 msgid "Color;Picker;Palette;" msgstr "Χρώμα;Επιλογέας;Παλέτα;" #: ../src/main.c:45 msgid "Show the application's version" msgstr "Εμφάνιση έκδοσης εφαρμογής" #: ../src/main.c:56 #, fuzzy msgid "- pick a color from the picker or the screen" msgstr "- επιλέξτε χρώματα απο την παλέτα ή απο την οθόνη" #: ../src/main.c:67 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Τρέξτε '%s --help' για να δείτε μια ολοκληρωμένη λίστα με διαθέσιμες " "επιλογές γραμής εντολών" #: ../src/gcolor3-application.c:86 msgid "About" msgstr "Σχετικά" #: ../src/gcolor3-application.c:87 msgid "Quit" msgstr "Κλείσιμο" #: ../src/gcolor3-application.c:131 msgid "Error opening file: " msgstr "Σφάλμα στο άνοιγμα του αρχείου: " #: ../src/gcolor3-application.c:178 msgid "Error writing file: " msgstr "Σφάλμα στην αποθήκευση στο αρχείο: " #: ../src/gcolor3-window.c:129 msgid "Error deleting key: " msgstr "Σφάλμα στη διαγραφή του κλειδιού: " #: ../src/gcolor3-window.c:341 msgid "Color name..." msgstr "Το όνομά χρώμα..." #: ../src/gcolor3-window.c:364 msgid "Picker" msgstr "" #: ../src/gcolor3-window.c:374 msgid "Saved colors" msgstr "Αποθηκευμένα χρώματα" #: ../src/gcolor3-window.c:389 msgid "Color" msgstr "Χρώμα" #: ../src/gcolor3-window.c:404 msgid "Name" msgstr "Όνομα" #. Translators: translate this to give yourself credits. #: ../src/gcolor3-window.c:503 msgid "translator-credits" msgstr "Κωνσταντίνος Θερμός" #: ../src/gcolor3-window.c:504 msgid "Website" msgstr "Ιστοσελίδα" #: ../src/gcolor3-window.c:538 msgid "Error reading keys: " msgstr "Σφάλμα στην ανάγνωση των κλειδιών: " gcolor3-2.3.1/po/en_GB.po000066400000000000000000000324351334304176500150320ustar00rootroot00000000000000# British English translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-01 19:35+0200\n" "PO-Revision-Date: 2013-06-11 13:09+0200\n" "Last-Translator: Jente Hidskes \n" "Language-Team: British English\n" "Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:145 msgid "Color picker" msgstr "Colour picker" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:84 msgid "Choose colors from the picker or the screen" msgstr "Choose colours from the picker or the screen" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Colour;Picker;Palette" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Ever wanted to know the value of that colour on your screen? Gcolor3 enables " "you to pick the colour from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colours together." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "When you have found the perfect combination of colours, naturally you want " "to save them. Gcolor3 allows you to conveniently save and retrieve colours." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 is a colour selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernizations to better " "integrate into your modern desktop." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "The picker and the colour palette" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "The list of saved colours" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Redesign the saved colors page" msgstr "Redesign the saved colours page" #: data/nl.hjdskes.gcolor3.appdata.xml.in:59 msgid "Redesign the header bar" msgstr "Redesign the header bar" #: data/nl.hjdskes.gcolor3.appdata.xml.in:60 msgid "Disable color picking on Wayland for now, instead of crashing" msgstr "Disable colour picking on Wayland for now, instead of crashing" #: data/nl.hjdskes.gcolor3.appdata.xml.in:61 msgid "Add a shortcuts window" msgstr "Add a shortcuts window" #: data/nl.hjdskes.gcolor3.appdata.xml.in:62 msgid "Gcolor3 is now available as a Flatpak" msgstr "Gcolor3 is now available as a Flatpak" #: data/nl.hjdskes.gcolor3.appdata.xml.in:63 msgid "New and updated translations" msgstr "New and updated translations" #: data/nl.hjdskes.gcolor3.appdata.xml.in:64 msgid "Gcolor3 now comes with a manual page" msgstr "Gcolor3 now comes with a manual page" #: data/nl.hjdskes.gcolor3.appdata.xml.in:65 msgid "Lots of under-the-hood improvements" msgstr "Lots of under-the-hood improvements" #: data/nl.hjdskes.gcolor3.appdata.xml.in:74 msgid "Centrally manage colors between several running instances;" msgstr "Centrally manage colours between several running instances;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:75 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:77 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "Copy the selected colour's hex value from the tree view using Ctrl-C;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:78 msgid "Make the main window resizable;" msgstr "Make the main window resizable;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:79 msgid "Translation updates." msgstr "Translation updates." #: data/color-row.ui:46 msgid "Click to change the color's name" msgstr "Click to change the colour's name" #: data/color-row.ui:47 msgid "Name" msgstr "Name" #: data/color-row.ui:68 msgid "Copy this color's hex value to the clipboard" msgstr "Copy this colour's hex value to the clipboard" #: data/color-row.ui:90 msgid "Delete this color" msgstr "Delete this colour" #: data/menus.ui:7 msgid "_Keyboard Shortcuts" msgstr "_Keyboard Shortcuts" #: data/menus.ui:11 msgid "_About" msgstr "_About" #: data/menus.ui:15 msgid "_Quit" msgstr "_Quit" #: data/shortcuts.ui:14 msgid "General" msgstr "General" #: data/shortcuts.ui:19 msgid "Change page" msgstr "Change page" #: data/shortcuts.ui:27 msgid "Palette shortcuts" msgstr "Palette shortcuts" #: data/shortcuts.ui:32 msgid "Save currently selected color" msgstr "Save currently selected colour" #: data/shortcuts.ui:40 msgid "Saved color management" msgstr "Saved colour management" #: data/shortcuts.ui:45 msgid "Copy highlighted color's hex value" msgstr "Copy highlighted colour's hex value" #: data/shortcuts.ui:52 msgid "Delete highlighted color" msgstr "Delete highlighted colour" #: data/window.ui:26 msgid "Color name..." msgstr "Colour name..." #: data/window.ui:89 msgid "page0" msgstr "" #: data/window.ui:155 msgid "page1" msgstr "" #: data/window.ui:162 msgid "Saved colors" msgstr "Saved colours" #: src/main.c:43 msgid "Show the application's version" msgstr "Show the application's version" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- pick a colour from the picker or the screen" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "Run '%s --help' to see a full list of available command line options" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:88 msgid "translator-credits" msgstr "Jente Hidskes" #: src/gcolor3-application.c:89 msgid "Website" msgstr "Website" #: src/gcolor3-color-row.c:76 msgid "Could not parse color to display thumbnail\n" msgstr "Could not parse colour to display thumbnail\n" #: src/gcolor3-color-selection.c:406 msgid "" "Select the color you want from the outer ring. Select the darkness or " "lightness of that color using the inner triangle." msgstr "" "Select the colour you want from the outer ring. Select the darkness or " "lightness of that colour using the inner triangle." #: src/gcolor3-color-selection.c:436 msgid "Picking a color is currently not supported on Wayland." msgstr "Picking a colour is currently not supported on Wayland." #: src/gcolor3-color-selection.c:447 msgid "" "Click the eyedropper, then click a color anywhere on your screen to select " "that color." msgstr "" "Click the eyedropper, then click a colour anywhere on your screen to select " "that colour." #: src/gcolor3-color-selection.c:458 msgid "_Hue:" msgstr "_Hue:" #: src/gcolor3-color-selection.c:459 msgid "Position on the color wheel." msgstr "Position on the colour wheel." #: src/gcolor3-color-selection.c:461 msgid "S_aturation:" msgstr "S_aturation:" #: src/gcolor3-color-selection.c:462 msgid "Intensity of the color." msgstr "Intensity of the colour." #: src/gcolor3-color-selection.c:463 msgid "_Value:" msgstr "_Value:" #: src/gcolor3-color-selection.c:464 msgid "Brightness of the color." msgstr "Brightness of the colour." #: src/gcolor3-color-selection.c:465 msgid "_Red:" msgstr "_Red:" #: src/gcolor3-color-selection.c:466 msgid "Amount of red light in the color." msgstr "Amount of red light in the colour." #: src/gcolor3-color-selection.c:467 msgid "_Green:" msgstr "_Green:" #: src/gcolor3-color-selection.c:468 msgid "Amount of green light in the color." msgstr "Amount of green light in the colour." #: src/gcolor3-color-selection.c:469 msgid "_Blue:" msgstr "_Blue:" #: src/gcolor3-color-selection.c:470 msgid "Amount of blue light in the color." msgstr "Amount of blue light in the colour." #: src/gcolor3-color-selection.c:473 msgid "Op_acity:" msgstr "Op_acity:" #: src/gcolor3-color-selection.c:481 src/gcolor3-color-selection.c:491 msgid "Transparency of the color." msgstr "Transparency of the colour." #: src/gcolor3-color-selection.c:498 msgid "Color _name:" msgstr "Colour _name:" #: src/gcolor3-color-selection.c:513 msgid "" "You can enter an HTML-style hexadecimal color value, or simply a color name " "such as “orange” in this entry." msgstr "" "You can enter an HTML-style hexadecimal colour value, or simply a colour " "name such as “orange” in this entry." #: src/gcolor3-color-selection.c:545 msgid "_Palette:" msgstr "_Palette:" #: src/gcolor3-color-selection.c:575 msgid "Color Wheel" msgstr "Colour Wheel" #: src/gcolor3-color-selection.c:1040 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now. You can drag this color to a palette entry, or select this color as " "current by dragging it to the other color swatch alongside." msgstr "" "The previously-selected colour, for comparison to the colour you’re " "selecting now. You can drag this colour to a palette entry, or select this " "colour as current by dragging it to the other colour swatch alongside." #: src/gcolor3-color-selection.c:1046 msgid "" "The color you’ve chosen. You can drag this color to a palette entry to save " "it for use in the future." msgstr "" "The colour you’ve chosen. You can drag this colour to a palette entry to " "save it for use in the future." #: src/gcolor3-color-selection.c:1052 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now." msgstr "" "The previously-selected colour, for comparison to the colour you’re " "selecting now." #: src/gcolor3-color-selection.c:1056 msgid "The color you’ve chosen." msgstr "The colour you’ve chosen." #: src/gcolor3-color-selection.c:1425 msgid "_Save color here" msgstr "_Save colour here" #: src/gcolor3-color-selection.c:1631 msgid "" "Click this palette entry to make it the current color. To change this entry, " "drag a color swatch here or right-click it and select “Save color here.”" msgstr "" "Click this palette entry to make it the current colour. To change this " "entry, drag a colour swatch here or right-click it and select “Save colour " "here.”" #: src/gcolor3-color-store.c:66 #, c-format msgid "Error creating config directory: %s" msgstr "Error creating config directory: %s" #: src/gcolor3-color-store.c:89 #, c-format msgid "Cannot count number of items: %s\n" msgstr "Cannot count number of items: %s\n" #: src/gcolor3-color-store.c:110 #, fuzzy, c-format msgid "Cannot read colors: %s\n" msgstr "Cannot read colours: %s\n" #: src/gcolor3-color-store.c:124 #, c-format msgid "Cannot access color at position %d: %s\n" msgstr "Cannot access colour at position %d: %s\n" #: src/gcolor3-color-store.c:147 #, c-format msgid "Error writing file: %s" msgstr "Error writing file: %s" #: src/gcolor3-color-store.c:187 #, c-format msgid "" "Error opening file: %s. Colors likely won't be saved, unless this is the " "first run" msgstr "" "Error opening file: %s. Colours likely won't be saved, unless this is the " "first run" #: src/gcolor3-color-store.c:215 src/gcolor3-color-store.c:301 #, c-format msgid "There is already a color named `%s`" msgstr "There is already a colour named `%s`" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot locate index of addition: %s. UI won't be updated\n" msgstr "Cannot locate index of addition: %s. UI won't be updated\n" #: src/gcolor3-color-store.c:254 #, c-format msgid "Cannot locate index of removal: %s. UI won't be updated\n" msgstr "Cannot locate index of removal: %s. UI won't be updated\n" #: src/gcolor3-color-store.c:268 #, c-format msgid "Error deleting key: %s" msgstr "Error deleting key: %s" #: src/gcolor3-color-store.c:296 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Cannot rename nonexisting colour `%s`" #: src/gcolor3-color-store.c:306 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Cannot retrieve hex value belonging to `%s`: %s" #: src/gcolor3-color-store.c:312 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Error deleting old name `%s`: %s" #: src/gcolor3-color-store.c:345 #, c-format msgid "Error reading keys: %s. This is harmless if this is the first run" msgstr "Error reading keys: %s. This is harmless if this is the first run" #: src/gcolor3-window.c:397 msgid "Picker" msgstr "Picker" gcolor3-2.3.1/po/es.po000066400000000000000000000146121334304176500144640ustar00rootroot00000000000000# Spanish translation for Gcolor3 # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2018-01-18 10:44+0100\n" "Last-Translator: Xoan Sampaiño \n" "Language-Team: Spanish\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.5\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 msgid "Color picker" msgstr "Selector de color" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 msgid "Choose colors from the picker or the screen" msgstr "Elija colores desde un selector o desde la pantalla" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Color;Selector;Paleta;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "¿Alguna vez quisiste saber el valor de ese color en tu pantalla? Gcolor3 le " "permite elegir el color de cualquier píxel en su pantalla. También ofrece " "una paleta, para que pueda mezclar y combinar fácilmente un par de colores." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Cuando haya encontrado la combinación perfecta de colores, seguramente desee " "guardarlos. Gcolor3 le permite guardar y recuperar colores cómodamente." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 es un diálogo de selección de color escrito en GTK+ 3. Se parece " "mucho a Gcolor2, pero utiliza la versión más nueva de GTK+ y otras " "modernizaciones para integrarse mejor en su escritorio moderno." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "El selector y la paleta de colores" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "La lista de colores guardados" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 msgid "_About" msgstr "A_cerca de" #: data/menus.ui:11 msgid "_Quit" msgstr "_Salir" #: data/window.ui:55 msgid "Saved colors" msgstr "Colores guardados" #: data/window.ui:104 msgid "Color name..." msgstr "Nombre del color..." #: src/main.c:43 msgid "Show the application's version" msgstr "Mostrar información sobre la versión y salir" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- elija colores desde el selector o desde la pantalla" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Ejecute «%s --help» para ver una lista completa de las opciones disponibles" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 msgid "translator-credits" msgstr "Xoan Sampaiño " #: src/gcolor3-application.c:61 msgid "Website" msgstr "Sitio web" #: src/gcolor3-color-store.c:68 #, c-format msgid "Error creating config directory: %s" msgstr "Se ha producido un error al crear el directorio de configuración: %s" #: src/gcolor3-color-store.c:86 #, c-format msgid "Error writing file: %s" msgstr "Se ha producido un error al escribir el fichero: %s" #: src/gcolor3-color-store.c:138 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "" "Se ha producido un error al abrir el fichero: %s. Probablemente no se " "guardarán los colores" #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, c-format msgid "There is already a color named `%s`" msgstr "Ya existe un color llamado «%s»" #: src/gcolor3-color-store.c:184 #, c-format msgid "Error deleting key: %s" msgstr "Se ha producido un error al borrar la clave: %s" #: src/gcolor3-color-store.c:212 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "No se ha podido renombrar el color «%s» no existente" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "No se ha podido recuperar el valor hexadecimal del color «%s»: %s" #: src/gcolor3-color-store.c:228 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Se ha producido un error al borrar el nombre antiguo «%s»: %s" #: src/gcolor3-color-store.c:253 #, c-format msgid "Error reading keys: %s" msgstr "Se ha producido un error al leer las claves: %s" #: src/gcolor3-window.c:327 msgid "The model is empty; there are no colors to remove" msgstr "El modelo está vacío; no hay colores para eliminar" #: src/gcolor3-window.c:367 msgid "Cannot update color: invalid path" msgstr "No se ha podido actualizar el color: ruta no válida" #: src/gcolor3-window.c:501 msgid "Color" msgstr "Color" #: src/gcolor3-window.c:521 msgid "Name" msgstr "Nombre" #: src/gcolor3-window.c:546 msgid "Picker" msgstr "Selector" gcolor3-2.3.1/po/fr.po000066400000000000000000000147771334304176500145000ustar00rootroot00000000000000# French translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2015-07-29 21:54+0200\n" "Last-Translator: Timothée Floure \n" "Language-Team: French\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 msgid "Color picker" msgstr "Sélecteur de couleur" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 msgid "Choose colors from the picker or the screen" msgstr "Choisissez les couleurs depuis le sélecteur ou l’écran" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Couleur;Sélecteur;Palette" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Avez-vous déjà eu envie d'obtenir la valeur d'une couleur ? Gcolor3 vous " "permet d'obtenir la couleur de n'importe quel pixel de votre écran. Il offre " "aussi une palette permettant d'aisément mélanger et assortir ces couleurs." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Une fois avoir trouvé la combinaison parfaite, vous ne voulez évidemment pas " "la perdre. Gcolor3 permet efficacement de sauvegarder puis récupérer vos " "couleurs." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 est un sélecteur de couleurs écrit en GTK+ 3. Il est largement " "semblable à Gcolor2 mais utilise une version plus récente de GTK+. Il " "implémente aussi d'autres améliorations afin de mieux s'intégrer dans les " "environnements de bureau mordernes." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Sélecteur et palette" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Liste des couleurs sauvegardées" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 msgid "_About" msgstr "_À propos" #: data/menus.ui:11 msgid "_Quit" msgstr "_Quitter" #: data/window.ui:55 msgid "Saved colors" msgstr "Couleurs sauvegardées" #: data/window.ui:104 msgid "Color name..." msgstr "Nom de la couleur..." #: src/main.c:43 msgid "Show the application's version" msgstr "Afficher la version de l’application" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- choisir une couleur depuis le sélecteur ou l’écran" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Utilisez '%s --help' pour voir une liste complète des options disponibles en " "ligne de commande" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 msgid "translator-credits" msgstr "Nicolas Gaulard-Querol & Timothée Floure" #: src/gcolor3-application.c:61 msgid "Website" msgstr "Site web" #: src/gcolor3-color-store.c:68 #, c-format msgid "Error creating config directory: %s" msgstr "Erreur lors de la création du dossier de configuration: %s" #: src/gcolor3-color-store.c:86 #, c-format msgid "Error writing file: %s" msgstr "Erreur lors de l’écriture du fichier: %s" #: src/gcolor3-color-store.c:138 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "" "Erreur lors de l'ouverture du fichier: %s. Les couleurs ne seront pas " "sauvegardées." #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, c-format msgid "There is already a color named `%s`" msgstr "Il y a déjà une couleur nommée `%s`" #: src/gcolor3-color-store.c:184 #, c-format msgid "Error deleting key: %s" msgstr "Erreur lors de la suppression de la clé: %s" #: src/gcolor3-color-store.c:212 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Impossible de renommer `%s` : couleur inexistante" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Impossible d'extraire la valeur hexadécimale appartenant à `%s`: %s" #: src/gcolor3-color-store.c:228 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Erreur lors de la suppression de la clé `%s` : %s " #: src/gcolor3-color-store.c:253 #, c-format msgid "Error reading keys: %s" msgstr "Erreur lors de la lecture des clés: %s" #: src/gcolor3-window.c:327 msgid "The model is empty; there are no colors to remove" msgstr "Le modèle est vide; il n'y a aucune couleur à enlever" #: src/gcolor3-window.c:367 msgid "Cannot update color: invalid path" msgstr "Impossible de mettre à jour la couleur: chemin invalide" #: src/gcolor3-window.c:501 msgid "Color" msgstr "Couleur" #: src/gcolor3-window.c:521 msgid "Name" msgstr "Nom" #: src/gcolor3-window.c:546 msgid "Picker" msgstr "Sélecteur" #~ msgid "Error opening file: " #~ msgstr "Erreur lors de l’ouverture du fichier: " gcolor3-2.3.1/po/gl.po000066400000000000000000000131031334304176500144510ustar00rootroot00000000000000# Galician translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-01-18 11:54+0100\n" "PO-Revision-Date: 2018-01-18 12:15+0100\n" "Last-Translator: Xoan Sampaiño \n" "Language-Team: Galician \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.0.5\n" #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:1 ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:1 #: ../src/gcolor3-application.c:121 msgid "Color picker" msgstr "Selector de cor" #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:2 ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:2 #: ../src/gcolor3-application.c:58 msgid "Choose colors from the picker or the screen" msgstr "Escolla cores desde o selector ou desde a pantalla" #. Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: ../data/nl.hjdskes.gcolor3.desktop.in.in.h:4 msgid "Color;Picker;Palette;" msgstr "Cor;Selector;Paleta;" #: ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:3 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Algunha vez quixo saber o valor desa cor na pantalla? Gcolor3 permítelle " "escoller a cor desde calquera píxel na pantalla. Tamén ofrece unha paleta, " "para que poida mesturar facilmente e combinar un par de cores xuntos." #: ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:4 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Cando atopa a combinación perfecta de cores, seguramente quererá gardalos. " "Gcolor3 permítelle gardar e recuperar cores comodamente." #: ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:5 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 é un diálogo de selección de cor escrito en GTK+ 3. É moi parecido a " "Gcolor2, pero usa a nova versión de GTK+ e outras modernizacións para " "integrarse mellor no seu escritorio moderno." #: ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:6 msgid "The picker and the color palette" msgstr "O selector e a paleta de cores" #: ../data/nl.hjdskes.gcolor3.appdata.xml.in.h:7 msgid "The list of saved colors" msgstr "A lista de cores gardadas" #: ../data/menus.ui.h:1 msgid "_About" msgstr "_Sobre" #: ../data/menus.ui.h:2 msgid "_Quit" msgstr "_Saír" #: ../data/window.ui.h:1 msgid "Saved colors" msgstr "Cores gardadas" #: ../data/window.ui.h:2 msgid "Color name..." msgstr "Nome da cor…" #: ../src/main.c:45 msgid "Show the application's version" msgstr "Mostrar a versión do aplicativo" #: ../src/main.c:56 msgid "- pick a color from the picker or the screen" msgstr "- escolla unha cor desde o selector ou desde a pantalla" #: ../src/main.c:67 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Execute '%s --help' para ver a lista completa de opcións por liña de ordes " "dispoñíbeis" #. Translators: translate this to give yourself credits. #: ../src/gcolor3-application.c:62 msgid "translator-credits" msgstr "" "Fran Dieguez , 2016.\n" "Xoan Sampaiño , 2018." #: ../src/gcolor3-application.c:63 msgid "Website" msgstr "Sitio web" #: ../src/gcolor3-color-store.c:70 #, c-format msgid "Error creating config directory: %s" msgstr "Produciuse un erro ao crear o cartafol de configuración: %s" #: ../src/gcolor3-color-store.c:88 #, c-format msgid "Error writing file: %s" msgstr "Produciuse un erro ao escribir o ficheiro: %s" #: ../src/gcolor3-color-store.c:140 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "" "Produciuse un erro ao escribir o ficheiro: %s. É posíbel que as cores non se " "garden" #: ../src/gcolor3-color-store.c:165 ../src/gcolor3-color-store.c:219 #, c-format msgid "There is already a color named `%s`" msgstr "Xa hai unha cor chamada «%s»" #: ../src/gcolor3-color-store.c:186 #, c-format msgid "Error deleting key: %s" msgstr "Produciuse un erro ao eliminar a chave: %s" #: ../src/gcolor3-color-store.c:214 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Non se puido renomear a cor «%s» non existente" #: ../src/gcolor3-color-store.c:224 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Non se puido recuperar o valor hexadecimal pertencente a «%s»: %s" #: ../src/gcolor3-color-store.c:230 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Produciuse un erro ao eliminar o nome antigo «%s»: %s" #: ../src/gcolor3-color-store.c:255 #, c-format msgid "Error reading keys: %s" msgstr "Produciuse un erro ao ler as chaves: %s" #: ../src/gcolor3-window.c:336 msgid "The model is empty; there are no colors to remove" msgstr "O modelo está baleiro; non hai cores para eliminar" #: ../src/gcolor3-window.c:376 msgid "Cannot update color: invalid path" msgstr "Non se puido actualizar a cor: ruta non válida" #: ../src/gcolor3-window.c:510 msgid "Color" msgstr "Cor" #: ../src/gcolor3-window.c:530 msgid "Name" msgstr "Nome" #: ../src/gcolor3-window.c:555 msgid "Picker" msgstr "Selector" gcolor3-2.3.1/po/id.po000066400000000000000000000147651334304176500144620ustar00rootroot00000000000000# Indonesian translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2017-12-10 10:37+0700\n" "Last-Translator: Dindin Hernawan \n" "Language-Team: Indonesian\n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.7.1\n" "Plural-Forms: nplurals=1; plural=0;\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 #, fuzzy msgid "Color picker" msgstr "Pemetik warna" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 #, fuzzy msgid "Choose colors from the picker or the screen" msgstr "Pilih warna dari pemetik atau layar" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 #, fuzzy msgid "Color;Picker;Palette;" msgstr "Warna; Pemetik; Palet;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 #, fuzzy msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Pernah ingin tahu nilai warna itu di layar Anda? Gcolor3 memungkinkan Anda " "untuk memilih warna dari piksel pada layar Anda. Ini juga menawarkan palet, " "sehingga Anda dapat dengan mudah mencampur dan mencocokkan beberapa warna " "bersama-sama." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 #, fuzzy msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Bila Anda telah menemukan kombinasi warna yang sempurna, tentu Anda ingin " "menyimpanya. Gcolor3 memungkinkan Anda menyimpan dan mengambil warna dengan " "mudah." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 #, fuzzy msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 adalah dialog pilihan warna yang ditulis dalam GTK + 3. Ini sangat " "mirip dengan Gcolor2, namun menggunakan versi GTK + yang lebih baru dan " "modernisasi lainnya untuk mengintegrasikannya dengan lebih baik ke dalam " "desktop modern Anda." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 #, fuzzy msgid "The picker and the color palette" msgstr "Pemetik dan palet warna" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 #, fuzzy msgid "The list of saved colors" msgstr "Daftar warna yang disimpan" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 #, fuzzy msgid "_About" msgstr "_Tentang" #: data/menus.ui:11 #, fuzzy msgid "_Quit" msgstr "_Keluar" #: data/window.ui:55 #, fuzzy msgid "Saved colors" msgstr "Warna tersimpan" #: data/window.ui:104 #, fuzzy msgid "Color name..." msgstr "Nama warna..." #: src/main.c:43 #, fuzzy msgid "Show the application's version" msgstr "Tampilkan versi aplikasi" #: src/main.c:54 #, fuzzy msgid "- pick a color from the picker or the screen" msgstr "- pilih warna dari pemetik atau layar" #: src/main.c:65 #, fuzzy, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Jalankan '% s --help' untuk melihat daftar lengkap opsi baris perintah yang " "tersedia" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 #, fuzzy msgid "translator-credits" msgstr "penerjemah-kredit" #: src/gcolor3-application.c:61 #, fuzzy msgid "Website" msgstr "Situs web" #: src/gcolor3-color-store.c:68 #, fuzzy, c-format msgid "Error creating config directory: %s" msgstr "Kesalahan membuat direktori config:% s" #: src/gcolor3-color-store.c:86 #, fuzzy, c-format msgid "Error writing file: %s" msgstr "Kesalahan saat menulis berkas:% s" #: src/gcolor3-color-store.c:138 #, fuzzy, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "" "Kesalahan saat membuka berkas:% s. Warna kemungkinan tidak akan disimpan" #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, fuzzy, c-format msgid "There is already a color named `%s`" msgstr "Sudah ada warna yang bernama `% s`" #: src/gcolor3-color-store.c:184 #, fuzzy, c-format msgid "Error deleting key: %s" msgstr "Kesalahan saat menghapus kunci:% s" #: src/gcolor3-color-store.c:212 #, fuzzy, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Tidak dapat mengganti nama warna tidak ada `% s`" #: src/gcolor3-color-store.c:222 #, fuzzy, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Tidak dapat mengambil nilai hex milik `% s`:% s" #: src/gcolor3-color-store.c:228 #, fuzzy, c-format msgid "Error deleting old name `%s`: %s" msgstr "Kesalahan menghapus nama lama `% s`:% s" #: src/gcolor3-color-store.c:253 #, fuzzy, c-format msgid "Error reading keys: %s" msgstr "Kesalahan saat membaca kunci:% s" #: src/gcolor3-window.c:327 #, fuzzy msgid "The model is empty; there are no colors to remove" msgstr "Modelnya kosong; tidak ada warna untuk dihapus" #: src/gcolor3-window.c:367 #, fuzzy msgid "Cannot update color: invalid path" msgstr "Tidak dapat memperbarui warna: jalur tidak valid" #: src/gcolor3-window.c:501 #, fuzzy msgid "Color" msgstr "Warna" #: src/gcolor3-window.c:521 #, fuzzy msgid "Name" msgstr "Name" #: src/gcolor3-window.c:546 #, fuzzy msgid "Picker" msgstr "Pemetik" gcolor3-2.3.1/po/meson.build000066400000000000000000000000631334304176500156520ustar00rootroot00000000000000i18n.gettext(meson.project_name(), preset: 'glib') gcolor3-2.3.1/po/nb.po000066400000000000000000000142331334304176500144530ustar00rootroot00000000000000# Norsk Bokmål translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2017-03-22 11:00+0100\n" "Last-Translator: Kristian Robertsen \n" "Language-Team: Norsk Bokmål\n" "Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 msgid "Color picker" msgstr "Fargevelger" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 msgid "Choose colors from the picker or the screen" msgstr "Velg farger enten fra velgeren eller fra skjermen" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Farge;Velger;Palett" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Har du noen gang villet vite verdien til en farge du ser på skjermen? Gcolor " "3lar deg hente ut fargen til en hvilken som helst piksel på skjermen. Den " "tilbyrogså en palett å velge fra, slik at du ekelt kan mikse og matche flere " "farger." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Når du har funnet den perfekte kombinasjonen av farger vil du naturligvis ha " "muligheten til å lagre de. Gcolor3 lar deg enkelt lagre og hente inn farger." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 er en fargevelgerdialog skrevet med GTK+ 3. Den er svært lik Gcolor " "2,men bruker en nyere GTK+ versjon og andre moderniseringer slik at " "denintegrerer bedre med moderne desktops." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Fargevelgeren og fargepaletten" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Listen over lagrede farger" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 msgid "_About" msgstr "_Om" #: data/menus.ui:11 msgid "_Quit" msgstr "_Avslutt" #: data/window.ui:55 msgid "Saved colors" msgstr "Lagrede farger" #: data/window.ui:104 msgid "Color name..." msgstr "Fargenavn..." #: src/main.c:43 msgid "Show the application's version" msgstr "Vis applikasjonens versjon" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- velg en farge fra fargevelgeren eller fra skjermen" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Kjør '%s --help' for å se en komplett liste over tilgjengelige kommandolinje-" "opsjoner" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 msgid "translator-credits" msgstr "oversetter-kreditering" #: src/gcolor3-application.c:61 msgid "Website" msgstr "Nettside" #: src/gcolor3-color-store.c:68 #, c-format msgid "Error creating config directory: %s" msgstr "Feil ved oppretting av konfig mappe: %s" #: src/gcolor3-color-store.c:86 #, c-format msgid "Error writing file: %s" msgstr "Feil ved oppretting av fil: %s" #: src/gcolor3-color-store.c:138 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "Feil ved åpning av fil: %s. Fargene vil sannsynligvis ikke bli lagret." #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, c-format msgid "There is already a color named `%s`" msgstr "Det er allerede en farge ved navn `%s`" #: src/gcolor3-color-store.c:184 #, c-format msgid "Error deleting key: %s" msgstr "Feil ved sletting av tast: %s" #: src/gcolor3-color-store.c:212 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Kan ikke endre navn på ikke-eksisterende farge `%s`" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Kan ikke hente hex-verdien tilhørende `%s`: %s" #: src/gcolor3-color-store.c:228 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Feil ved sletting av gammelt navn `%s`: %s" #: src/gcolor3-color-store.c:253 #, c-format msgid "Error reading keys: %s" msgstr "Feil ved innlesing av taster: %s" #: src/gcolor3-window.c:327 msgid "The model is empty; there are no colors to remove" msgstr "Modellen en tom; det er ingen farger å fjerne" #: src/gcolor3-window.c:367 msgid "Cannot update color: invalid path" msgstr "Kan ikke oppdatere farge: ugyldig filsti" #: src/gcolor3-window.c:501 msgid "Color" msgstr "Farge" #: src/gcolor3-window.c:521 msgid "Name" msgstr "Navn" #: src/gcolor3-window.c:546 msgid "Picker" msgstr "Velger" gcolor3-2.3.1/po/nl.po000066400000000000000000000327711334304176500144740ustar00rootroot00000000000000# Dutch translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-01 19:35+0200\n" "PO-Revision-Date: 2015-07-28 11:17+0200\n" "Last-Translator: Jente Hidskes \n" "Language-Team: Dutch\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:145 msgid "Color picker" msgstr "Kleurenkiezer" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:84 msgid "Choose colors from the picker or the screen" msgstr "Kies kleuren van de kiezer of van het scherm" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Kleur;Kiezer;Palet;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Ooit de waarde van die kleur op uw scherm willen weten? Gcolor stelt u in " "staat om de kleur van elke pixel op uw scherm te kiezen. Het biedt u ook een " "palet, zodat u eenvoudig een selectie van kleuren kan combineren." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Als u de perfecte combinatie van kleuren hebt gevonden, wilt u deze " "uiteraard opslaan. Gcolor3 laat u gemakkelijk kleuren opslaan en ophalen." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 is een dialoog om kleuren te selecteren, geschreven in GTK+ 3. Het " "lijkt op Gcolor2, maar gebruikt de nieuwere GTK+ versie en andere " "modernisaties om beter te integreren in jouw moderne bureaubladomgeving." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "De kiezer en het kleurenpalet" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "De lijst met opgeslagen kleuren" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Redesign the saved colors page" msgstr "De pagina voor opgeslagen kleuren opnieuw ontworpen" #: data/nl.hjdskes.gcolor3.appdata.xml.in:59 msgid "Redesign the header bar" msgstr "De header bar opnieuw ontworpen" #: data/nl.hjdskes.gcolor3.appdata.xml.in:60 msgid "Disable color picking on Wayland for now, instead of crashing" msgstr "" "Kleuren kiezen op Wayland is voor nu uitgeschakeld, in plaats van te crashen" #: data/nl.hjdskes.gcolor3.appdata.xml.in:61 msgid "Add a shortcuts window" msgstr "Een shortcuts venster toegevoegd" #: data/nl.hjdskes.gcolor3.appdata.xml.in:62 msgid "Gcolor3 is now available as a Flatpak" msgstr "Gcolor3 is nu beschikbaar als een Flatpak" #: data/nl.hjdskes.gcolor3.appdata.xml.in:63 msgid "New and updated translations" msgstr "Nieuwe en bijgewerkte translaties" #: data/nl.hjdskes.gcolor3.appdata.xml.in:64 msgid "Gcolor3 now comes with a manual page" msgstr "Gcolor3 komt nu met een man pagina" #: data/nl.hjdskes.gcolor3.appdata.xml.in:65 msgid "Lots of under-the-hood improvements" msgstr "Veel onder-de-motorkap verbeteringen" #: data/nl.hjdskes.gcolor3.appdata.xml.in:74 msgid "Centrally manage colors between several running instances;" msgstr "Opgeslagen kleuren worden nu centraal beheerd;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:75 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" "Volg de XDG directory specificatie voor het configuratiebestand.Dit betekent " "dat het configuratiebestand is verplaatst van `~/.rgb.ini` naar `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:77 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" "Kopieer de geselecteerde kleur's hex waarde van de tree view met CTRL-C;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:78 msgid "Make the main window resizable;" msgstr "Maak het hoofdvenster schaalbaar;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:79 msgid "Translation updates." msgstr "Translatie-updates." #: data/color-row.ui:46 msgid "Click to change the color's name" msgstr "Klik om een kleur's naam te veranderen" #: data/color-row.ui:47 msgid "Name" msgstr "Naam" #: data/color-row.ui:68 msgid "Copy this color's hex value to the clipboard" msgstr "Kopieer deze kleur's hex waarde naar het klembord" #: data/color-row.ui:90 msgid "Delete this color" msgstr "Verwijder deze kleur" #: data/menus.ui:7 msgid "_Keyboard Shortcuts" msgstr "_Sneltoetsen" #: data/menus.ui:11 msgid "_About" msgstr "_Over" #: data/menus.ui:15 msgid "_Quit" msgstr "_Afsluiten" #: data/shortcuts.ui:14 msgid "General" msgstr "Algemeen" #: data/shortcuts.ui:19 msgid "Change page" msgstr "Verander van pagina" #: data/shortcuts.ui:27 msgid "Palette shortcuts" msgstr "Palet sneltoetsen" #: data/shortcuts.ui:32 msgid "Save currently selected color" msgstr "Sla de geselecteerde kleur op" #: data/shortcuts.ui:40 msgid "Saved color management" msgstr "Beheer van opgeslagen kleuren" #: data/shortcuts.ui:45 msgid "Copy highlighted color's hex value" msgstr "Kopieer de geselecteerde kleur's hex waarde" #: data/shortcuts.ui:52 msgid "Delete highlighted color" msgstr "Verwijder de geselecteerde kleur" #: data/window.ui:26 msgid "Color name..." msgstr "Kleurnaam..." #: data/window.ui:89 msgid "page0" msgstr "" #: data/window.ui:155 msgid "page1" msgstr "" #: data/window.ui:162 msgid "Saved colors" msgstr "Opgeslagen kleuren" #: src/main.c:43 msgid "Show the application's version" msgstr "Toon versienummer van de applicatie" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- kies een kleur van de kiezer of van het scherm" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "Voer '%s --help' uit om alle mogelijke opdracht-opties te zien" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:88 msgid "translator-credits" msgstr "Jente Hidskes" #: src/gcolor3-application.c:89 msgid "Website" msgstr "Webpagina" #: src/gcolor3-color-row.c:76 msgid "Could not parse color to display thumbnail\n" msgstr "Kon de kleur niet parseren om de thumbnail weer te geven\n" #: src/gcolor3-color-selection.c:406 msgid "" "Select the color you want from the outer ring. Select the darkness or " "lightness of that color using the inner triangle." msgstr "" "Selecteer de kleur die u wilt in de buitenste ring. Selecteer de helderheid " "van die kleur met de binnenste driehoek." #: src/gcolor3-color-selection.c:436 msgid "Picking a color is currently not supported on Wayland." msgstr "Een kleur kiezen is op dit moment niet ondersteund op Wayland." #: src/gcolor3-color-selection.c:447 msgid "" "Click the eyedropper, then click a color anywhere on your screen to select " "that color." msgstr "" "Klik op het piper, daarna op een kleur waar dan ook op uw scherm om deze te " "kiezen" #: src/gcolor3-color-selection.c:458 msgid "_Hue:" msgstr "_Tint:" #: src/gcolor3-color-selection.c:459 msgid "Position on the color wheel." msgstr "Positie op het kleurenwiel." #: src/gcolor3-color-selection.c:461 msgid "S_aturation:" msgstr "_Verzadiging:" #: src/gcolor3-color-selection.c:462 msgid "Intensity of the color." msgstr "Kleurintensiteit." #: src/gcolor3-color-selection.c:463 msgid "_Value:" msgstr "_Waarde:" #: src/gcolor3-color-selection.c:464 msgid "Brightness of the color." msgstr "Kleurhelderheid." #: src/gcolor3-color-selection.c:465 msgid "_Red:" msgstr "_Rood:" #: src/gcolor3-color-selection.c:466 msgid "Amount of red light in the color." msgstr "Hoeveelheid rood in de kleur." #: src/gcolor3-color-selection.c:467 msgid "_Green:" msgstr "_Groen:" #: src/gcolor3-color-selection.c:468 msgid "Amount of green light in the color." msgstr "Hoeveelheid groen in de kleur." #: src/gcolor3-color-selection.c:469 msgid "_Blue:" msgstr "_Blauw:" #: src/gcolor3-color-selection.c:470 msgid "Amount of blue light in the color." msgstr "Hoeveelheid blauw in de kleur." #: src/gcolor3-color-selection.c:473 msgid "Op_acity:" msgstr "_Transparantie:" #: src/gcolor3-color-selection.c:481 src/gcolor3-color-selection.c:491 msgid "Transparency of the color." msgstr "Kleurtransparantie." #: src/gcolor3-color-selection.c:498 msgid "Color _name:" msgstr "_Kleurnaam:" #: src/gcolor3-color-selection.c:513 msgid "" "You can enter an HTML-style hexadecimal color value, or simply a color name " "such as “orange” in this entry." msgstr "" "U kunt een HTML-stijl hexadecimale kleurwaarde invullen, of simpelweg een " "naam zoals “oranje”." #: src/gcolor3-color-selection.c:545 msgid "_Palette:" msgstr "_Palet:" #: src/gcolor3-color-selection.c:575 msgid "Color Wheel" msgstr "Kleurenwiel" #: src/gcolor3-color-selection.c:1040 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now. You can drag this color to a palette entry, or select this color as " "current by dragging it to the other color swatch alongside." msgstr "" "De laatstgeselecteerde kleur, ter vergelijking met de kleur die u nu " "selecteert.U kunt deze kleur naar een paletvak slepen, of als huidige kleur " "instellen door deze naar het kleurenmodel hiernaast te slepen." #: src/gcolor3-color-selection.c:1046 msgid "" "The color you’ve chosen. You can drag this color to a palette entry to save " "it for use in the future." msgstr "" "De kleur die u heeft uitgekozen. U kunt deze kleur naar een paletvak slepen " "om deze op te slaan voor toekomstig gebruik." #: src/gcolor3-color-selection.c:1052 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now." msgstr "" "De laatstgeselecteerde kleur, ter vergelijking met de kleur die u selecteert." #: src/gcolor3-color-selection.c:1056 msgid "The color you’ve chosen." msgstr "De kleur die u heeft gekozen." #: src/gcolor3-color-selection.c:1425 msgid "_Save color here" msgstr "_Sla kleur hier op" #: src/gcolor3-color-selection.c:1631 msgid "" "Click this palette entry to make it the current color. To change this entry, " "drag a color swatch here or right-click it and select “Save color here.”" msgstr "" "Klik in dit paletvak om het de huidige kleur te maken. Om dit vak te " "veranderen, sleep een kleur in dit vak of klik met de rechtermuisknop en " "selecteer “Sla hier een kleur op.”" #: src/gcolor3-color-store.c:66 #, c-format msgid "Error creating config directory: %s" msgstr "Fout bij het aanmaken van de configuratiemap: %s" #: src/gcolor3-color-store.c:89 #, c-format msgid "Cannot count number of items: %s\n" msgstr "Kan hoeveelheid items niet tellen: %s\n" #: src/gcolor3-color-store.c:110 #, c-format msgid "Cannot read colors: %s\n" msgstr "Kan kleur niet lezen: %s\n" #: src/gcolor3-color-store.c:124 #, c-format msgid "Cannot access color at position %d: %s\n" msgstr "Kan niet bij kleur op positie %d: %s\n" #: src/gcolor3-color-store.c:147 #, c-format msgid "Error writing file: %s" msgstr "Fout bij het schrijven van bestand: %s" #: src/gcolor3-color-store.c:187 #, c-format msgid "" "Error opening file: %s. Colors likely won't be saved, unless this is the " "first run" msgstr "" "Fout bij het openen van bestand: %s. Kleuren worden waarschijnlijk niet " "opgeslagen, tenzij dit de eerste uitvoer is" #: src/gcolor3-color-store.c:215 src/gcolor3-color-store.c:301 #, c-format msgid "There is already a color named `%s`" msgstr "Er is al een kleur genaamd `%s`" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot locate index of addition: %s. UI won't be updated\n" msgstr "Kan index van toevoeging niet vinden: %s. UI wordt niet bijgewerkt\n" #: src/gcolor3-color-store.c:254 #, c-format msgid "Cannot locate index of removal: %s. UI won't be updated\n" msgstr "Kan index van verwijdering niet vinden: %s. UI wordt niet bijgewerkt\n" #: src/gcolor3-color-store.c:268 #, c-format msgid "Error deleting key: %s" msgstr "Fout bij het verwijderen van sleutel: %s" #: src/gcolor3-color-store.c:296 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Kan niet-bestaande kleur `%s` niet hernoemen" #: src/gcolor3-color-store.c:306 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Kan hex-waarde behorende bij `%s` niet ophalen: %s" #: src/gcolor3-color-store.c:312 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Fout bij het verwijderen van sleutel `%s`: %s" #: src/gcolor3-color-store.c:345 #, c-format msgid "Error reading keys: %s. This is harmless if this is the first run" msgstr "" "Fout bij het lezen van sleutels: %s. Dit is ongevaarlijk als dit de eerste " "uitvoer is" #: src/gcolor3-window.c:397 msgid "Picker" msgstr "Kiezer" gcolor3-2.3.1/po/ru.po000066400000000000000000000366331334304176500145120ustar00rootroot00000000000000# Russian translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-01 19:50+0200\n" "PO-Revision-Date: 2018-08-28 10:50+0200\n" "Last-Translator: PuppyRus linux Team \n" "Language-Team: puppyrus.org\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:145 msgid "Color picker" msgstr "Выбор цвета" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:84 msgid "Choose colors from the picker or the screen" msgstr "Определите цвет на экране с помощью пипетки" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Color;Picker;Palette;Цвет;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Хотите узнать значение любого цвета на экране? Gcolor3 поможет вам, " "коснитесь пипеткой нужной точки на экране. Программа также имеет палитру, " "так что вы можете легко смешивать и сочетать пару цветов вместе." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Gcolor3 позволяет сохранять и загружать созданные вами комбинации цвета." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 это программа выбора цвета написанная на GTK+ 3. Программа похожа на " "Gcolor2, но использует новую версию GTK+ и другие улучшения для лучшей " "интеграции в современные окружения рабочих столов." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Пипетка и палитра цветов" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Список сохраненных цветов" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Redesign the saved colors page" msgstr "Редактор страницы сохраненных цветов" #: data/nl.hjdskes.gcolor3.appdata.xml.in:59 msgid "Redesign the header bar" msgstr "Редактор заголовка панели" #: data/nl.hjdskes.gcolor3.appdata.xml.in:60 msgid "Disable color picking on Wayland for now, instead of crashing" msgstr "Выключить пробу цветов в Wayland, для исключения падения программы" #: data/nl.hjdskes.gcolor3.appdata.xml.in:61 msgid "Add a shortcuts window" msgstr "Добавить окно со ссылками" #: data/nl.hjdskes.gcolor3.appdata.xml.in:62 msgid "Gcolor3 is now available as a Flatpak" msgstr "Gcolor3 теперь доступен как пакет Flatpak" #: data/nl.hjdskes.gcolor3.appdata.xml.in:63 msgid "New and updated translations" msgstr "Новые и обновленные переводы" #: data/nl.hjdskes.gcolor3.appdata.xml.in:64 msgid "Gcolor3 now comes with a manual page" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:65 msgid "Lots of under-the-hood improvements" msgstr "Множество других имзменений" #: data/nl.hjdskes.gcolor3.appdata.xml.in:74 msgid "Centrally manage colors between several running instances;" msgstr "" "Централизованное управление цветами между несколькими запущенными " "экземплярами;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:75 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:77 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" "Копировать hex значение цвета в буфер обмена для последующей вставки Ctrl-C;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:78 msgid "Make the main window resizable;" msgstr "Разрешить изменение размеров окна;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:79 msgid "Translation updates." msgstr "Обновления переводов." #: data/color-row.ui:46 msgid "Click to change the color's name" msgstr "Щелкните для изменения имени цвета" #: data/color-row.ui:47 msgid "Name" msgstr "Имя" #: data/color-row.ui:68 msgid "Copy this color's hex value to the clipboard" msgstr "Копировать hex значение цвета в буфер обмена" #: data/color-row.ui:90 msgid "Delete this color" msgstr "Удалить цвет" #: data/menus.ui:7 msgid "_Keyboard Shortcuts" msgstr "_Горячие клавиши" #: data/menus.ui:11 msgid "_About" msgstr "_О программе" #: data/menus.ui:15 msgid "_Quit" msgstr "_Выход" #: data/shortcuts.ui:14 msgid "General" msgstr "Основные" #: data/shortcuts.ui:19 msgid "Change page" msgstr "Изменить страницу" #: data/shortcuts.ui:27 msgid "Palette shortcuts" msgstr "Palette shortcuts" #: data/shortcuts.ui:32 msgid "Save currently selected color" msgstr "Сохранить выбранный цвет" #: data/shortcuts.ui:40 msgid "Saved color management" msgstr "Saved colour management" #: data/shortcuts.ui:45 msgid "Copy highlighted color's hex value" msgstr "Copy highlighted colour's hex value" #: data/shortcuts.ui:52 msgid "Delete highlighted color" msgstr "Delete highlighted colour" #: data/window.ui:26 msgid "Color name..." msgstr "Название цвета..." #: data/window.ui:89 msgid "page0" msgstr "страница0" #: data/window.ui:155 msgid "page1" msgstr "страница1" #: data/window.ui:162 msgid "Saved colors" msgstr "Сохраненные цвета" #: src/main.c:43 msgid "Show the application's version" msgstr "Показать версию программы" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- определите цвет на экране с помощью пипетки" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "Запустите '%s --help' для просмотра списка всех доступных параметров" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:88 msgid "translator-credits" msgstr "PuppyRus linux Team" #: src/gcolor3-application.c:89 msgid "Website" msgstr "Website" #: src/gcolor3-color-row.c:76 msgid "Could not parse color to display thumbnail\n" msgstr "Не удается получить цвет для предпросмотра\n" #: src/gcolor3-color-selection.c:406 msgid "" "Select the color you want from the outer ring. Select the darkness or " "lightness of that color using the inner triangle." msgstr "" "Выберите нужный цвет на внешнем круге. Выберите темный или более светлый " "оттенок, используя внутренний треугольник." #: src/gcolor3-color-selection.c:436 msgid "Picking a color is currently not supported on Wayland." msgstr "Пипетка в настоящее время не работает в Wayland." #: src/gcolor3-color-selection.c:447 msgid "" "Click the eyedropper, then click a color anywhere on your screen to select " "that color." msgstr "" "Щелкните на пипетке, затем щелкните на цвете в любом месте экрана чтобы " "выбрать этот цвет." #: src/gcolor3-color-selection.c:458 msgid "_Hue:" msgstr "_Тон:" #: src/gcolor3-color-selection.c:459 msgid "Position on the color wheel." msgstr "Положение на цветовом круге." #: src/gcolor3-color-selection.c:461 msgid "S_aturation:" msgstr "Н_асыщенность:" #: src/gcolor3-color-selection.c:462 msgid "Intensity of the color." msgstr "Глубина цвета." #: src/gcolor3-color-selection.c:463 msgid "_Value:" msgstr "_Значение:" #: src/gcolor3-color-selection.c:464 msgid "Brightness of the color." msgstr "Яркость цвета." #: src/gcolor3-color-selection.c:465 msgid "_Red:" msgstr "_Красный:" #: src/gcolor3-color-selection.c:466 msgid "Amount of red light in the color." msgstr "Количество красного оттенка в цвете." #: src/gcolor3-color-selection.c:467 msgid "_Green:" msgstr "_Зеленый:" #: src/gcolor3-color-selection.c:468 msgid "Amount of green light in the color." msgstr "Количество зеленого оттенка в цвете." #: src/gcolor3-color-selection.c:469 msgid "_Blue:" msgstr "_Синий:" #: src/gcolor3-color-selection.c:470 msgid "Amount of blue light in the color." msgstr "Количество зеленого оттенка в цвете." #: src/gcolor3-color-selection.c:473 msgid "Op_acity:" msgstr "Не_прозрачность:" #: src/gcolor3-color-selection.c:481 src/gcolor3-color-selection.c:491 msgid "Transparency of the color." msgstr "Прозрачность цвета." #: src/gcolor3-color-selection.c:498 msgid "Color _name:" msgstr "_Имя цвета:" #: src/gcolor3-color-selection.c:513 msgid "" "You can enter an HTML-style hexadecimal color value, or simply a color name " "such as “orange” in this entry." msgstr "" "Вы можете ввести в этой строке или шестнадцатеричное значение цвета (в стиле " "HTML), или название цвета, например, “orange”" #: src/gcolor3-color-selection.c:545 msgid "_Palette:" msgstr "_Палитра:" #: src/gcolor3-color-selection.c:575 msgid "Color Wheel" msgstr "Цветовой круг" #: src/gcolor3-color-selection.c:1040 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now. You can drag this color to a palette entry, or select this color as " "current by dragging it to the other color swatch alongside." msgstr "" "Выбранный ранее цвет, для сравнения c цветом, выбранным сейчас. Вы можете " "перетащить этот цвет на палитру, или выбрать в качестве основного, перетащив " "поверх основного цвета." #: src/gcolor3-color-selection.c:1046 msgid "" "The color you’ve chosen. You can drag this color to a palette entry to save " "it for use in the future." msgstr "" "Выбранный вами цвет. Вы можете перетащить этот цвет на палитру и сохранить " "его для будущего использования." #: src/gcolor3-color-selection.c:1052 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now." msgstr "Выбранный ранее цвет, для сравнения c цветом, выбранным сейчас." #: src/gcolor3-color-selection.c:1056 msgid "The color you’ve chosen." msgstr "Выбранный вами цвет." #: src/gcolor3-color-selection.c:1425 msgid "_Save color here" msgstr "_Сохранить цвет" #: src/gcolor3-color-selection.c:1631 msgid "" "Click this palette entry to make it the current color. To change this entry, " "drag a color swatch here or right-click it and select “Save color here.”" msgstr "" "Щелкните на палитре чтобы выбрать цвет. Для изменения цвета, перемещайте " "указатель, щелчком правой кнопки выберите “Сохранить цвет”." #: src/gcolor3-color-store.c:66 #, c-format msgid "Error creating config directory: %s" msgstr "Ошибка создания каталога с настройками: %s" #: src/gcolor3-color-store.c:89 #, c-format msgid "Cannot count number of items: %s\n" msgstr "Ошибка подсчета количества элементов: %s\n" #: src/gcolor3-color-store.c:110 #, c-format msgid "Cannot read colors: %s\n" msgstr "Ошибка чтения цвета: %s\n" #: src/gcolor3-color-store.c:124 #, c-format msgid "Cannot access color at position %d: %s\n" msgstr "Ошибка чтения цвета %d: %s\n" #: src/gcolor3-color-store.c:147 #, c-format msgid "Error writing file: %s" msgstr "Ошибка записи файла: %s" #: src/gcolor3-color-store.c:187 #, c-format msgid "" "Error opening file: %s. Colors likely won't be saved, unless this is the " "first run" msgstr "" "Ошибка открытия файла: %s. Цвета не были сохранены, возможно это первый " "запуск программы" #: src/gcolor3-color-store.c:215 src/gcolor3-color-store.c:301 #, c-format msgid "There is already a color named `%s`" msgstr "Уже есть цвет с именем `%s`" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot locate index of addition: %s. UI won't be updated\n" msgstr "Cannot locate index of addition: %s. UI не обновлен\n" #: src/gcolor3-color-store.c:254 #, c-format msgid "Cannot locate index of removal: %s. UI won't be updated\n" msgstr "Cannot locate index of removal: %s. UI не обновлен\n" #: src/gcolor3-color-store.c:268 #, c-format msgid "Error deleting key: %s" msgstr "Ошибка удаления ключа: %s" #: src/gcolor3-color-store.c:296 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Нельзя переименовать несуществующий цвет `%s`" #: src/gcolor3-color-store.c:306 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Не удается получить hex значение `%s`: %s" #: src/gcolor3-color-store.c:312 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Ошибка удаления старого имени `%s`: %s" #: src/gcolor3-color-store.c:345 #, c-format msgid "Error reading keys: %s. This is harmless if this is the first run" msgstr "Ошибка чтения ключей: %s. Это нормально при первом запуске программы" #: src/gcolor3-window.c:397 msgid "Picker" msgstr "Цвет" gcolor3-2.3.1/po/sr.po000066400000000000000000000403131334304176500144760ustar00rootroot00000000000000# Serbian translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: gcolor3 master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-01 19:42+0200\n" "PO-Revision-Date: 2018-08-26 18:28+0200\n" "Last-Translator: Марко М. Костић \n" "Language-Team: Serbian\n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "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" "X-Generator: Poedit 2.0.6\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:145 msgid "Color picker" msgstr "Бирач боја" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:84 msgid "Choose colors from the picker or the screen" msgstr "Изаберите боју из бирача или са екрана" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Боја;Бирач;Палета;Color;Picker;Pallete;Boja:Birač;Paleta" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Да ли сте икада пожелели да знате вредност боје на одређеном делу вашег " "екрана? Програм Gcolor3 вам омогућава да одаберете боју са било ког пиксела " "на вашем екрану. Такође вам нуди палету са којом можете лако мешати и " "тражити одговарајуће нијансе." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Када пронађете савршен спој боја, желите да сачувате те боје. Програм " "Gcolor3 вам омогућава да чувате тренутно изабране боје и користите већ " "сачуване боје." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Програм Gcolor3 је алатка за бирање боја која је написана коришћењем ГТК+ 3. " "Слична је програму Gcolor2 али користи новије издање ГТК+-а и друге модерне " "елементе да би се боље уклопио у ваш модеран начин коришћења рачунара." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Бирач и палета боја" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Списак сачуваних боја" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Redesign the saved colors page" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:59 msgid "Redesign the header bar" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:60 msgid "Disable color picking on Wayland for now, instead of crashing" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:61 msgid "Add a shortcuts window" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:62 msgid "Gcolor3 is now available as a Flatpak" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:63 msgid "New and updated translations" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:64 msgid "Gcolor3 now comes with a manual page" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:65 msgid "Lots of under-the-hood improvements" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:74 msgid "Centrally manage colors between several running instances;" msgstr "" "Управљајте бојама са више покренутих примерака програма на једном месту;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:75 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" "Пратите XDG спецификацију фасцикли за датотеку са подешавањима. Ово значи да " "је датотека подешавања премештена из „~/.rgb.ini“ у „$XDG_CONFIG_HOME/" "gcolor3/config.ini“;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:77 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" "Копирај хекс вредност изабране боје из приказа стабла користећи Ctrl+C;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:78 msgid "Make the main window resizable;" msgstr "Учини величину главног прозора промењивом;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:79 msgid "Translation updates." msgstr "Ажурирања превода." #: data/color-row.ui:46 msgid "Click to change the color's name" msgstr "Кликни за промену назива боје" #: data/color-row.ui:47 msgid "Name" msgstr "Име" #: data/color-row.ui:68 msgid "Copy this color's hex value to the clipboard" msgstr "Копирај хекс вредност ове боје у оставу" #: data/color-row.ui:90 msgid "Delete this color" msgstr "Обриши ову боју" #: data/menus.ui:7 msgid "_Keyboard Shortcuts" msgstr "Пречице _тастатуре" #: data/menus.ui:11 msgid "_About" msgstr "_О програму" #: data/menus.ui:15 msgid "_Quit" msgstr "_Изађи" #: data/shortcuts.ui:14 msgid "General" msgstr "Опште" #: data/shortcuts.ui:19 msgid "Change page" msgstr "Промени страницу" #: data/shortcuts.ui:27 msgid "Palette shortcuts" msgstr "Пречице палете" #: data/shortcuts.ui:32 msgid "Save currently selected color" msgstr "Сачувај тренутно изабрану боју" #: data/shortcuts.ui:40 msgid "Saved color management" msgstr "Управљање сачуваним бојама" #: data/shortcuts.ui:45 msgid "Copy highlighted color's hex value" msgstr "Копирај хекс вредност означене боје" #: data/shortcuts.ui:52 msgid "Delete highlighted color" msgstr "Обриши означену боју" #: data/window.ui:26 msgid "Color name..." msgstr "Име боје..." #: data/window.ui:89 msgid "page0" msgstr "" #: data/window.ui:155 msgid "page1" msgstr "" #: data/window.ui:162 msgid "Saved colors" msgstr "Сачуване боје" #: src/main.c:43 msgid "Show the application's version" msgstr "Прикажи издање програма" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- изабери боју из бирача или са екрана" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Покрените „%s --help“ да бисте видели списак са свим доступним опцијама у " "терминалу" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:88 msgid "translator-credits" msgstr "Марко М. Костић (Marko M. Kostić) " #: src/gcolor3-application.c:89 msgid "Website" msgstr "Веб страница" #: src/gcolor3-color-row.c:76 msgid "Could not parse color to display thumbnail\n" msgstr "Нисам успео да обрадим боју да бих приказао сличицу\n" #: src/gcolor3-color-selection.c:406 msgid "" "Select the color you want from the outer ring. Select the darkness or " "lightness of that color using the inner triangle." msgstr "" "Изаберите жељену боју са спољног прстена. Изаберите светлу или тамну нијансу " "ове боје користећи унутрашњи троугао." #: src/gcolor3-color-selection.c:436 msgid "Picking a color is currently not supported on Wayland." msgstr "Бирање боје тренутно није подржано на Вејленду." #: src/gcolor3-color-selection.c:447 msgid "" "Click the eyedropper, then click a color anywhere on your screen to select " "that color." msgstr "" "Кликните на пипету па онда кликните на било коју боју на вашем екрану да " "бисте је изабрали." #: src/gcolor3-color-selection.c:458 msgid "_Hue:" msgstr "_Нијанса:" #: src/gcolor3-color-selection.c:459 msgid "Position on the color wheel." msgstr "Положај на точку боја." #: src/gcolor3-color-selection.c:461 msgid "S_aturation:" msgstr "З_асићеност:" #: src/gcolor3-color-selection.c:462 msgid "Intensity of the color." msgstr "Засићеност боје." #: src/gcolor3-color-selection.c:463 msgid "_Value:" msgstr "_Вредност:" #: src/gcolor3-color-selection.c:464 msgid "Brightness of the color." msgstr "Осветљеност боје." #: src/gcolor3-color-selection.c:465 msgid "_Red:" msgstr "_Црвена:" #: src/gcolor3-color-selection.c:466 msgid "Amount of red light in the color." msgstr "Количина црвене светлости у боји." #: src/gcolor3-color-selection.c:467 msgid "_Green:" msgstr "_Зелена:" #: src/gcolor3-color-selection.c:468 msgid "Amount of green light in the color." msgstr "Количина зелене светлости у боји." #: src/gcolor3-color-selection.c:469 msgid "_Blue:" msgstr "_Плава:" #: src/gcolor3-color-selection.c:470 msgid "Amount of blue light in the color." msgstr "Количина плаве светлости у боји." #: src/gcolor3-color-selection.c:473 msgid "Op_acity:" msgstr "_Провидност:" #: src/gcolor3-color-selection.c:481 src/gcolor3-color-selection.c:491 msgid "Transparency of the color." msgstr "Провидност боје." #: src/gcolor3-color-selection.c:498 msgid "Color _name:" msgstr "_Назив боје:" #: src/gcolor3-color-selection.c:513 msgid "" "You can enter an HTML-style hexadecimal color value, or simply a color name " "such as “orange” in this entry." msgstr "" "Овде можете унети ХТМЛ хексадецималну вредност боје или назив боје на " "енглеском као што је „orange“." #: src/gcolor3-color-selection.c:545 msgid "_Palette:" msgstr "_Палета:" #: src/gcolor3-color-selection.c:575 msgid "Color Wheel" msgstr "Точак боја" #: src/gcolor3-color-selection.c:1040 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now. You can drag this color to a palette entry, or select this color as " "current by dragging it to the other color swatch alongside." msgstr "" "Раније изабрана боја, која се пореди са бојом коју сада изаберете. Ову боју " "можете превући на палету или је изабрати као текућу ако је превучете на " "преглед тренутно изабране боје." #: src/gcolor3-color-selection.c:1046 msgid "" "The color you’ve chosen. You can drag this color to a palette entry to save " "it for use in the future." msgstr "" "Изабрана боја. Можете је превући на палету боја како би је сачували за " "накнадну употребу." #: src/gcolor3-color-selection.c:1052 msgid "" "The previously-selected color, for comparison to the color you’re selecting " "now." msgstr "" "Раније изабрана боја која се користи за поређење са бојом коју сада бирате." #: src/gcolor3-color-selection.c:1056 msgid "The color you’ve chosen." msgstr "Боја коју сте изабрали." #: src/gcolor3-color-selection.c:1425 msgid "_Save color here" msgstr "Овде _сачувај боју" #: src/gcolor3-color-selection.c:1631 msgid "" "Click this palette entry to make it the current color. To change this entry, " "drag a color swatch here or right-click it and select “Save color here.”" msgstr "" "Кликните на ову ставку палете да је изаберете као текућу боју. Уколико " "желите да је измените превуците другу боју овде или кликните десним тастером " "миша и изаберите „Овде сачувај боју.“" #: src/gcolor3-color-store.c:66 #, c-format msgid "Error creating config directory: %s" msgstr "Грешка приликом прављења фасцикле са подешавањима: %s" #: src/gcolor3-color-store.c:89 #, c-format msgid "Cannot count number of items: %s\n" msgstr "Не могу да пребројим број ставки: %s\n" #: src/gcolor3-color-store.c:110 #, c-format msgid "Cannot read colors: %s\n" msgstr "Не могу да прочитам боје: %s\n" #: src/gcolor3-color-store.c:124 #, c-format msgid "Cannot access color at position %d: %s\n" msgstr "Не могу да приступим боји на положају %d: %s\n" #: src/gcolor3-color-store.c:147 #, c-format msgid "Error writing file: %s" msgstr "Грешка приликом уписивања у датотеку:%s" #: src/gcolor3-color-store.c:187 #, c-format msgid "" "Error opening file: %s. Colors likely won't be saved, unless this is the " "first run" msgstr "" "Не могу да отворим датотеку: %s. Боје највероватније неће бити сачуване, " "осим ако ово није прво покретање програма" #: src/gcolor3-color-store.c:215 src/gcolor3-color-store.c:301 #, c-format msgid "There is already a color named `%s`" msgstr "Већ постоји боја са називом „%s“" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot locate index of addition: %s. UI won't be updated\n" msgstr "Не могу да нађем индекс додатог: %s. УИ вероватно неће бити измењен\n" #: src/gcolor3-color-store.c:254 #, c-format msgid "Cannot locate index of removal: %s. UI won't be updated\n" msgstr "" "Не могу да нађем индекс уклоњеног: %s. УИ вероватно неће бити измењен\n" #: src/gcolor3-color-store.c:268 #, c-format msgid "Error deleting key: %s" msgstr "Грешка приликом брисања кључа: %s" #: src/gcolor3-color-store.c:296 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Не могу да уклоним непостојећу боју „%s“" #: src/gcolor3-color-store.c:306 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Не могу да прочитам хексадецималну вредност која припада „%s“: %s" #: src/gcolor3-color-store.c:312 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Грешка приликом брисања старог назива `%s`: %s" #: src/gcolor3-color-store.c:345 #, c-format msgid "Error reading keys: %s. This is harmless if this is the first run" msgstr "" "Грешка при читању кључева: %s. Ово је безопасно ако је ово прво покретање " "програма" #: src/gcolor3-window.c:397 msgid "Picker" msgstr "Бирач" gcolor3-2.3.1/po/sv.po000066400000000000000000000140661334304176500145100ustar00rootroot00000000000000# Swedish translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: 2.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2013-06-11 13:24+0200\n" "Last-Translator: Angelica Ankarberg\n" "Language-Team: Swedish\n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 msgid "Color picker" msgstr "Färgväljare" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 msgid "Choose colors from the picker or the screen" msgstr "Välj färger från väljaren eller skärmen" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Färg;Väljare;Palett;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Har du någonsin velat veta värdet på den där färgen på skärmen? Gcolor3 " "möjliggör att du kan välja färg från vilken pixel som helst på skärmen. Den " "erbjuder också en palett, så att du enkelt kan blanda olika färger." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "När du har hittat den perfekta kombinationen av färger, vill du naturligtvis " "spara dem. Gcolor3 tillåter dig att praktiskt spara och hämta färger." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 är en färgvalsdialog skriven i GTK+ 3. Den är mycket lik Gcolor2, " "men använder den nyare GTK+ versionen och andra moderniseringar för att " "bättra integreras i ditt moderna skrivbord." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Väljaren och färgpaletten" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Listan med sparade färger" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 msgid "_About" msgstr "_Om" #: data/menus.ui:11 msgid "_Quit" msgstr "_Avsluta" #: data/window.ui:55 msgid "Saved colors" msgstr "Sparade färger" #: data/window.ui:104 msgid "Color name..." msgstr "Färgnamn..." #: src/main.c:43 msgid "Show the application's version" msgstr "Visa applikationens version" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "- välj en färg från väljaren eller skärmen" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "Kör '%s --help' för att få en lista av alla tillgängliga kommandon" #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 msgid "translator-credits" msgstr "Angelica Ankarberg" #: src/gcolor3-application.c:61 msgid "Website" msgstr "Hemsida" #: src/gcolor3-color-store.c:68 #, c-format msgid "Error creating config directory: %s" msgstr "Fel vid skapande av konfigurationsmappen: %s" #: src/gcolor3-color-store.c:86 #, c-format msgid "Error writing file: %s" msgstr "Fel vid skrivande av fil: %s" #: src/gcolor3-color-store.c:138 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "Fel vid öppnande av fil: %s. Färger kommer inte att sparas" #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, c-format msgid "There is already a color named `%s`" msgstr "Det finns redan en färg som heter `%s`" #: src/gcolor3-color-store.c:184 #, c-format msgid "Error deleting key: %s" msgstr "Fel vid radering av nyckel: %s" #: src/gcolor3-color-store.c:212 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Kan inte namge obefintlig färg `%s`" #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Kan inte hämta hex-värde tillhörande `%s`: %s" #: src/gcolor3-color-store.c:228 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Fel vid radering av gammalt namn `%s`: %s" #: src/gcolor3-color-store.c:253 #, c-format msgid "Error reading keys: %s" msgstr "Fel vid avläsning av nycklar: %s" #: src/gcolor3-window.c:327 msgid "The model is empty; there are no colors to remove" msgstr "Modellen är tom; det finns inga färger att radera" #: src/gcolor3-window.c:367 msgid "Cannot update color: invalid path" msgstr "Kan inte uppdatera färg: ogiltig väg" #: src/gcolor3-window.c:501 msgid "Color" msgstr "Färg" #: src/gcolor3-window.c:521 msgid "Name" msgstr "Namn" #: src/gcolor3-window.c:546 msgid "Picker" msgstr "Väljare" gcolor3-2.3.1/po/uk.po000066400000000000000000000162201334304176500144710ustar00rootroot00000000000000# Swedish translation for Gcolor3. # This file is distributed under the same license as the Gcolor3 package. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-12 21:42+0200\n" "PO-Revision-Date: 2016-08-11 15:31+0300\n" "Last-Translator: Daniel Korostil \n" "Language-Team: linux.org.ua\n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "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" "X-Generator: Virtaal 0.7.1\n" #: data/nl.hjdskes.gcolor3.desktop.in:3 #: data/nl.hjdskes.gcolor3.appdata.xml.in:7 src/gcolor3-application.c:119 msgid "Color picker" msgstr "Збирач кольору" #: data/nl.hjdskes.gcolor3.desktop.in:4 #: data/nl.hjdskes.gcolor3.appdata.xml.in:8 src/gcolor3-application.c:56 msgid "Choose colors from the picker or the screen" msgstr "Виберіть колір зі збирача або зі знімку" #. Translators: Do NOT translate or transliterate this text (this is an icon file name)! #: data/nl.hjdskes.gcolor3.desktop.in:7 msgid "nl.hjdskes.gcolor3" msgstr "" #. Translators: Extra keywords that can be used to search for Gcolor3 in GNOME Shell and Unity #: data/nl.hjdskes.gcolor3.desktop.in:13 msgid "Color;Picker;Palette;" msgstr "Колір;Збирач;Палітра;" #: data/nl.hjdskes.gcolor3.appdata.xml.in:10 msgid "" "Ever wanted to know the value of that color on your screen? Gcolor3 enables " "you to pick the color from any pixel on your screen. It also offers a " "palette, so that you can easily mix and match a couple of colors together." msgstr "" "Бажаєте одержати значення кольору на вашому екрані? Gcolor3 дозволяє вибрати " "колір з будь-якої точки екрана. Також є палітра, тож можете легко змішувати " "і поєднувати кольори разом." #: data/nl.hjdskes.gcolor3.appdata.xml.in:15 msgid "" "When you have found the perfect combination of colors, naturally you want to " "save them. Gcolor3 allows you to conveniently save and retrieve colors." msgstr "" "Коли ви знайшли ідеальний набір кольорів, вочевидь, ви захочете їх зберегти. " "Gcolor3 дозволяє зручно зберігати і одержувати їх." #: data/nl.hjdskes.gcolor3.appdata.xml.in:19 msgid "" "Gcolor3 is a color selection dialog written in GTK+ 3. It is much alike " "Gcolor2, but uses the newer GTK+ version and other modernisations to better " "integrate into your modern desktop." msgstr "" "Gcolor3 — вікно вибору кольорів, написаних на GTK+ 3. Дуже схожий на " "Gcolor2, але підтримує новішу версію GTK+ та інші покращення для " "інтегрування в сучасні стільниці." #: data/nl.hjdskes.gcolor3.appdata.xml.in:33 msgid "The picker and the color palette" msgstr "Палітра і вибір кольорів" #: data/nl.hjdskes.gcolor3.appdata.xml.in:37 msgid "The list of saved colors" msgstr "Перелік збережений кольорів" #. Translators: please do NOT translate this. #: data/nl.hjdskes.gcolor3.appdata.xml.in:44 msgid "Jente Hidskes" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:53 msgid "Centrally manage colors between several running instances;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:54 msgid "" "Follow the XDG directory specification for the configuration file. This " "means that the configuration file has moved from `~/.rgb.ini` to `" "$XDG_CONFIG_HOME/gcolor3/config.ini`;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:56 msgid "Copy the selected color's hex value from the tree view using Ctrl-C;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:57 msgid "Make the main window resizable;" msgstr "" #: data/nl.hjdskes.gcolor3.appdata.xml.in:58 msgid "Translation updates." msgstr "" #: data/menus.ui:7 msgid "_About" msgstr "_Про програму" #: data/menus.ui:11 msgid "_Quit" msgstr "Ви_йти" #: data/window.ui:55 msgid "Saved colors" msgstr "Збережені кольори" #: data/window.ui:104 msgid "Color name..." msgstr "Назва кольору…" #: src/main.c:43 msgid "Show the application's version" msgstr "Показати версію програму" #: src/main.c:54 msgid "- pick a color from the picker or the screen" msgstr "— виберіть колір зі збирача або екрана" #: src/main.c:65 #, c-format msgid "Run '%s --help' to see a full list of available command line options" msgstr "" "Виконайте «%s --help», щоб побачити повний перелік параметрів командного " "рядка." #. Translators: translate this to give yourself credits. #: src/gcolor3-application.c:60 msgid "translator-credits" msgstr "Daniel Korostil " #: src/gcolor3-application.c:61 msgid "Website" msgstr "Сайт" #: src/gcolor3-color-store.c:68 #, c-format msgid "Error creating config directory: %s" msgstr "Помилка створення каталогу налаштувань: %s" #: src/gcolor3-color-store.c:86 #, c-format msgid "Error writing file: %s" msgstr "Помилка записування файла: %s" #: src/gcolor3-color-store.c:138 #, c-format msgid "Error opening file: %s. Colors likely won't be saved" msgstr "Помилка відкриття файла: %s. Кольори ймовірно не збережуться." #: src/gcolor3-color-store.c:163 src/gcolor3-color-store.c:217 #, c-format msgid "There is already a color named `%s`" msgstr "Уже є така назва для кольору: «%s»" #: src/gcolor3-color-store.c:184 #, c-format msgid "Error deleting key: %s" msgstr "Помилка вилучення ключа: %s" #: src/gcolor3-color-store.c:212 #, c-format msgid "Cannot rename nonexisting color `%s`" msgstr "Неможливо перейменувати колір «%s», якого немає." #: src/gcolor3-color-store.c:222 #, c-format msgid "Cannot retrieve hex value belonging to `%s`: %s" msgstr "Неможливо одержати шістнадцяткове значення для «%s»: %s" #: src/gcolor3-color-store.c:228 #, c-format msgid "Error deleting old name `%s`: %s" msgstr "Помилка вилучення старого ключа «%s»: %s" #: src/gcolor3-color-store.c:253 #, c-format msgid "Error reading keys: %s" msgstr "Помилка читання ключа: %s" #: src/gcolor3-window.c:327 msgid "The model is empty; there are no colors to remove" msgstr "Модель порожня; немає кольору для вилучення" #: src/gcolor3-window.c:367 msgid "Cannot update color: invalid path" msgstr "Неможливо оновити колір: хибний шлях" #: src/gcolor3-window.c:501 msgid "Color" msgstr "Колір" #: src/gcolor3-window.c:521 msgid "Name" msgstr "Назва" #: src/gcolor3-window.c:546 msgid "Picker" msgstr "Збирач" gcolor3-2.3.1/saved.png000066400000000000000000000424031334304176500147060ustar00rootroot00000000000000PNG  IHDRI&0xsBIT|dtEXtSoftwaregnome-screenshot> IDATxyxT{&!!B(KPeiK(*"EJq?VQAAJڂ@ aW$$ a'@,@t$@9'u]9sL;Wf`&fL:530f,cɲIl67oK%1C}x'N7wTk*ۭ5_G\cǏ-D{{ۛS4}j]e>%=x%*&\-B:C>^~ަ&wͷ'O瞕$)AMD۪,[kN?YStW٭5U-ݮ\l6i}^S k>VQQ *t]TܺIzj߮$~ٸ]뮗=?_zjMzyׯ/I>{V/mwTitvvUPPMbdui5ԟGՍtםw/_J׬SVvk TD#01^Vp*..'>7P)^~Xk;$Ic&L]~ }ӓT/:x`6(ұ/sO[Lf6G]+I%37^_73s '>mT=_/_6('7GolW[׮SfVkn-^\'i>rW=ύaCuc|}}pVHz)zw*1`m-7]D͚>M6M$}jެYEH|gKs{yHn߿ViW(6#WX0m߹SCB/ي5w$?;j}ys܆SÏ>$IӼ|? ~LO ǯuvd23.uqlvBCC5Aj~gؖ-ԴInt;~t~KV)A6Ms?3zm8 Co=}'J}/oKi׭%˖_%Vh}驡Whh|R,-7os SmC?YqLқS'VZ]G]ݥuІa_K٧Rdٔ˛QGIw/^6e4hmIN8o˯ 4T~~~zw҈Dؗ_/j}2 W;վ nU-[4SJj$aj}]+%oVZe6ݒ ˥]>!Z_}mR/?~z|24 C/^?<>H-[PPfv8d/]CSMѨ{js2UnwϚ6gr(ŵjY=6__5KM(mWdz7հA*tԄQGJf뇄ր.ZvqrrrBIRqqj_}}_/ۭO0 =Qdf0 ~.lhvmվ][:|D_gߔ~>[I3'GI_ow{St9:|)AYzީZ4?.04WdӏɌ U+SO+77O-7Xu<ubuJxְno~Ѿ+uhYnPV-d򟱄t65镉 ˕2k]r*,,ڷAOЂi@$IAuJfM n)##;4֠GVt |*(,Kc_Vmսٸޞync[uKN:uJ^RqcZ񊊊vUT\)媬o~_e,uh6Mޔ}>I3b[4׋# 9N9K2s֌U:NH|gݲlqJ]ߒ(\ʬZ_oH|e溹Mj TAuh믻\#̼+aCSOkЀA5im;vjK6=ԩSG[nnhFe۵gw.s)/|[_q{~^JfЯo|ѵ*ZS麸8^=:~™"#x-ǿ^K\ޕ^,#\}MIЧс4o5Y@um|=vLڶ}\.ǵ7k!?;.ۭ{H,T;wVqq^ίF?G~N9vԵKɫP+FgϞO\tη$hW0J߄n{ ?Վ%Aځڻ1UKnޛKUvY}eTGn>C9zTyJ޺].{(5-MgTGڗ:q2Cn\eךuѩgTPX~Zj)^U=@UR./e>ŵjwzSU/8XZ!̤>߀/w>=<h+TTXf~(ֻ\.ogwzc[?鞻z(V-Ot2ꇄ螻{*c 2 C1Z+WFo7%Iaazt/ꆟ\ʘeU+ @s1_N~H}sw]*V4p4ͮ_bi?kTXXfMIh9zhxKEEjw5z wy:t6em;`gSDD{zTTjOG5 /|C`}\l*t:}'cfqYAAA t̙ӗ m ˥ܒu6]+ P6MEEVqq4h! >6\LGH|3 t!f!P3BH& >" @EEE3PTT@%tGDD4֡CHPEEE8fKlN`oOVZZj[ݣ5kav &hMn/ ï/..6?⟗gv~ܹl{#˗av~ĿUKR|Mf@֭[x Fjneva3vLf K;!0ѹsdΝs#&2!CH,X !B:`1tb!CH,X !B:`1tb!CH,X !B:`1tb7g-f >&[ >g^f.aŊfB:`1tb!CH,X !B:`1tb7Jah߾=zX.v:837fRSSt~-*::{T B:*@=ZC1% (M xgL8)r:ϩSr8f(??_|S)kmv;^3gN+>&ծ]۴>rvnyyyڳ{Q5騜1c_GJ'$ȑ#V:,pj >Ԏ9m;*P^^9iʸv]qڵkO=<ƞ7ϼay.W>pԖenP6%0d٭}v3o-q) (7(6ܦljfa&T ۼJ@E0X 3ZXe*}L:`1̤jat:jZm޲U'O$uTmIO\}եKIRbbݫ 6(99Yȑ#Kϙ0ajѢEڲej.Yb֮X˾r۷{}5ҔW'jWԼYSڽˣ&y[r 7nTݺu=M:U9qիqVZ ӧ^K;***Ҍ3rJuA4sLۦ\N>T1}4*ر_}}ƾ4JQQ%ǏפoxsD\@Hйsg%%%]UM \vSSSU\\]fI%I:xձcG DEy6-O CEEE***T ?\n͝;W 6( @֭Xrbbb/==]a(&&5 F$%%)ُ8ߟo+GF6Vٳ_0Naa:t$IL&?>Қƍ@bM:|ĠA1c'TFF222ԭ[7-\PU%W^Z`+|ԩ"##^+kڴBBBt27o\ꫯP3w_xl յ&='ϐ5TjZƿ2I_Դ kQs/;&ՆT'xBǎӰaô~-YD&LШQLiĈ=zV^B%''kӦM$á멧ҦMtIM8䮁ԩSTWMn5jXeeg++;[FՃ,=^/8XwtZz$B:Pm7n$)>>^/}{ヲԠ|F_|Qjذm۶:uz>}oT^^ڴicbǀu]e#e&nidsۯvF=?\kҙIGu-_;>& nݢ={UMr2qm͕+).u{wuo{wG@@Kդ=kkRKENv+5l-[q5ȫ-hәgrRsߛ+WjJ^f1*2B$$w(.p@E@~DսyEp\ ԫg=л$R^^.KXtP-nE^P>n<'%/7@ʌU*aX#["ZXe*}AH**}AHGDEIG3vt9***};rr͵86,/0С|ztTQ o{;cEIq${wD":u,av;7;fU):soRڵM/רk={WDS $IsQDDf̘!IUZZ&Op0* 幆Ԭ[wH5 Cof1UAu\u@YIO3gBCC5n8͚5K ՚5kԧOjU:fjj4iRzvں{>R IDATx2Ϝ9 jС>Sף_~ڵk]On[z5lPzKwEs]wݥ hٲe*..ȑ#զMuq.]W^QΝ_Z~}b7NZRF4dkN~$P/ZlH :yska}e9uBBBT/8X'OJs:z^c)33SƍO?Leff{ϔnX999[aa5Tm۶yÇܹs}R˖-=Zj%I:rHkiĉZ`>cm޼Yuw!UZ3|pGׯW.]H͚5K{ѣO^ݪU4c {ׯ$IǏ׿/-ZH7oVPPPi@DݻW6lPrr<#GzT.Yb֮X˾r۷{}5ҔW'jWԼYSڽˣ&y[r 7nTݺu=M:U߿&O6mڨ}on[gs=ĉWǾZj)88XO.w ~PTTiӦi͚5j׮gZZhŋ롇$Kl wyG6m﷿n&I/3gjϞ=j׮fΜ+WC3gߖ$hJIIQDD$i„ ;TGӧOGy_}c}:u٣Kp8,ө*??_;v,655Uڵl6_(*{WUvrl _<.(6 HRc_M/@y͛^rݚ;w$);;[6lP@@֭[1#zj׮zKoV!C\4EGQppxKOOa)w ~rT\\b? P``%mݦ72dZj]_XX(}^x6$))IQg\Bqddce=[z CIh13*jܸZz$֤G 4H3f|Iedd(##Cݺu… Q,Zp}QǏŋO\tN^`WթS'EFF?hѢvdz a(99Ym۶y;vPzzM]I&!J5kZj髯*xӦMKWuk].Wך<Pii$eR+}7BV>7ʕ׺?=ͽ;TJw# @{j|z|ZTAAA{bRӮmv]~jla j˖`۷I&t\fy%s:s㬶>\.b[j{|JmuX,FEF薄NETB:xIjjvڥo]9rkך 'NTkW%@z{ORKۺ\.岄^AH/9{LA)**JC SO=ev[@q+yAEp%󜤲@H/׆ n8["Z5±U*UfPtP-PtTNPsԤPAV V(?q75ذ@n𐟟'av^zѪؤ{ӫ݊ {?3騜JM{3AQ%x'::Z|S_VGmݻw)**V.::F*0qy& s \.s\.!0n4%}puIG%ykKY86 s6u>iI,tP-nf*}L:`1̤jalT30Uf+ڇԪ5kyVezJoSV6ml6E[ͽVSzzz0uAs̹辕U}Zp%o>)s7Qm=,Ҿ4egg+;;[ii`=wx/B:Peeeyl;wZÇKgeesj޼6mڤÇkС?~jnw]-[iɹd?NSM۷W..@b9s(""B3f̐$*--M'Oր]v0* 幆Ԭ[wH5 Cof1UAu\u@YIO3gBCC5n8͚5K ՚5kԧOjfYO?T}ׯ_?ڵKf̘vyꫯԤIBjٲ"##5tP;wwzu׫aÆի/I>}ڴiQ߭[7uc7߬?6xska}e9uBBBT/8X'OJs:z^c)33SƍO?Leff{ϔnX999[aa5CԲeKsZj%I:rHk|P{QZZZ/BUQjؠ?IS}믿VVV,YR3IIIJMMUjj˾Ï\.c@@%I֭["[Nwq5k{{ \;+GF6ڄqjڤ;ǎ)*2RǎjyP  RFFƌ'|RPnݴpBeddxI^zi8矫SN,w >^.K"## ׄ_ rA֤'t1NxXCi+4IJMۯ57#kQm>:v옆 kɒ%0aFU\o߾tuY#FhZz M6:uhȐ!6l6oެ'O^PHHzQz_G.gԳgOK,u9uv9zӽ=@=VY֨cK n^?mP7n$)>>^/}{÷#F_Tbb6lk۶mǟz)M2Eʼ=m4K}Uu \cx@)));K}ڷo!׌}U zd@̤6L|RvF=?\kҙIGu-_;>& nݢ={Ud57=mer(}ǺvfP*y-XrZW^ ԽVnnFDRR+wڻ/UN{# ֨ת^>+V,9lݺWw໾knW2t5ȫ-hәgrRsߛ+WjJ^f1*2B$$w(.p@E {٭פ 'NTkW%@z{~(..R^^.KXt>X}{=[Ynq"/hntT|=jv5*3VB:apl> jalT!T cT!%ɬ& c!4PdP~~٭|s200PEEExS3gҋ[=!cp~bCyoF=J@6K&7׷Qvi]1 odzH5+\8-bM5! &Idv#8h rnPTTbc[݊W̙ڽ{rssLEX%%ǔFqbZqqniv] *!V[j$ DH,X !B:`1tb!CH,X !B:`1tb!CH,X !B:`1tb!CH,X @U1 Cr\f(0Сhny10#G|100P1>Q)*ևPt+cF)J5P5A ʘYRSStSNp8nP~~fRSSv*55EgΜV|M]i}|uݔg7>Q)c5FuyTG5Y%IiWFput+p8tmq iGV۶r(//^Μ4e\ݮ8ڵ\={A|L{66'rr fp\2 Ca݊iJg0JqaynF5 30m Y"I,tP-2m>`&f@ vEp:Zf6o٪NItM 6̤çLSV֧#en>^mװgтEڗlegg+5-M,ҰguCH~"++K;wV͵i& >\C%I:t?e^#!!AYYYΝ;+Ts>[fqڪvyklݦIS+''8N6en^%?1gEDDhƌXi0`vsNy \v+\Y6Q%!SffnIҡCԲeK[j%I:rH+..VNNVXXXQ_-Z͛7+((4_0|pGׯW.]$Iڻw6lؠd>Z7P>}Z=2chU>c=nT}iJ?IS<*D ¬u%;wVRRUՔa޼yz畛+ۭsJahݺuebbbsyJ5Iaa?|-3III:?V`+GF6Vٳ_0Naa:t$IL&?>Қƍ@bM:|ĠA1c'TFF222ԭ[7-\Pk{ xN:)22k=Z4kLjW_}U6m-]R_Tuk].Wך<Pii$eR+1&^v{wqc$C[6|Qv =䩆 ;2Vu .m]A=y\fvf&__Hܹ"IG r59`@Lf{#2{X(|~ISS7[oooODBo} Ўv7{Y>$ϛhO?Ե/>雪VF9Ѩ~qw/]ҝ_˻rYGGGgD)I QЁ v]vpPQӐΚ#ye={y>{cQ:̍:ޑc(B}EMNN\.k~~.yJ˗ VrA#Mgɭ[tx txX  t9Y͙FvwK9 wI}J:IRZYY1{8ےh%tؖ@+(#l% J:[ʱ-9VPGJ*Y;uے8MYe>ԇknX\Zt IvⰈbj4F?_X,|?Ώt宾$=î;rUVnWCI&z|SW~xqj*qFMGdrT/^J$3^RMw 4>YD=-LG溞|[+ va^<uuի]mmUVwOF} FI7" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include "gcolor3-application.h" #include "gcolor3-color-store.h" #include "gcolor3-window.h" struct _Gcolor3ApplicationPrivate { Gcolor3ColorStore *colors; }; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3Application, gcolor3_application, GTK_TYPE_APPLICATION); static void gcolor3_application_action_shortcuts (UNUSED GSimpleAction *action, UNUSED GVariant *parameter, gpointer user_data) { static GtkWindow *overlay = NULL; GtkBuilder *builder; GtkWindow *window; if (!overlay) { builder = gtk_builder_new_from_resource ("/nl/hjdskes/gcolor3/shortcuts.ui"); overlay = GTK_WINDOW (gtk_builder_get_object (builder, "shortcuts-gcolor3")); g_object_unref (builder); g_object_set (overlay, "view-name", NULL, NULL); g_signal_connect (overlay, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL); window = gtk_application_get_active_window (GTK_APPLICATION (user_data)); gtk_window_set_modal (overlay, TRUE); gtk_window_set_transient_for (overlay, window); gtk_window_set_destroy_with_parent (overlay, TRUE); } gtk_window_present (overlay); } static void gcolor3_application_action_about (UNUSED GSimpleAction *action, UNUSED GVariant *parameter, gpointer user_data) { static const char *authors[] = { "Jente Hidskes ", NULL, }; static const char *artists[] = { "hhh", NULL, }; gtk_show_about_dialog (gtk_application_get_active_window (GTK_APPLICATION (user_data)), "program-name", g_get_application_name (), "version", PACKAGE_VERSION, "copyright", "Copyright \xc2\xa9 "COPYRIGHT" Jente Hidskes", "comments", _("Choose colors from the picker or the screen"), "authors", authors, "artists", artists, /* Translators: translate this to give yourself credits. */ "translator-credits", _("translator-credits"), "website-label", _("Website"), "website", PACKAGE_URL, "logo-icon-name", "nl.hjdskes.gcolor3", "wrap-license", TRUE, "license-type", GTK_LICENSE_GPL_2_0, NULL); } static void gcolor3_application_action_quit (UNUSED GSimpleAction *action, UNUSED GVariant *parameter, gpointer user_data) { GList *windows; windows = gtk_application_get_windows (GTK_APPLICATION (user_data)); g_list_foreach (windows, (GFunc) gcolor3_window_destroy, NULL); } static GActionEntry app_entries[] = { { "shortcuts", gcolor3_application_action_shortcuts, NULL, NULL, NULL }, { "about", gcolor3_application_action_about, NULL, NULL, NULL }, { "quit", gcolor3_application_action_quit, NULL, NULL, NULL }, }; static void gcolor3_application_init_accelerators (GtkApplication *application) { /* Taken from eog, which in turn has this based on a simular * construct in Evince (src/ev-application.c). * Setting multiple accelerators at once for an action * is not very straight forward in a static way. * * This gchar* array simulates an action<->accels mapping. * Enter the action name followed by the accelerator strings * and terminate the entry with a NULL-string.*/ static const gchar *const accelmap[] = { "win.change-page", "F9", NULL, NULL /* Terminating NULL */ }; const gchar *const *it; for (it = accelmap; it[0]; it += g_strv_length ((gchar **)it) + 1) { gtk_application_set_accels_for_action (application, it[0], &it[1]); } } static void gcolor3_application_startup (GApplication *application) { Gcolor3Application *app = GCOLOR3_APPLICATION (application); G_APPLICATION_CLASS (gcolor3_application_parent_class)->startup (application); gtk_window_set_default_icon_name ("gcolor3"); g_set_application_name (_("Color picker")); g_action_map_add_action_entries (G_ACTION_MAP (application), app_entries, G_N_ELEMENTS (app_entries), application); gcolor3_application_init_accelerators (GTK_APPLICATION (app)); } static void gcolor3_application_activate (GApplication *application) { Gcolor3ApplicationPrivate *priv; Gcolor3Window *window; priv = gcolor3_application_get_instance_private (GCOLOR3_APPLICATION (application)); window = gcolor3_window_new (GCOLOR3_APPLICATION (application), priv->colors); gtk_window_present_with_time (GTK_WINDOW (window), GDK_CURRENT_TIME); } static void gcolor3_application_dispose (GObject *object) { Gcolor3ApplicationPrivate *priv; priv = gcolor3_application_get_instance_private (GCOLOR3_APPLICATION (object)); g_clear_object (&priv->colors); G_OBJECT_CLASS (gcolor3_application_parent_class)->dispose (object); } static void gcolor3_application_class_init (Gcolor3ApplicationClass *gcolor3_application_class) { GObjectClass *object_class = G_OBJECT_CLASS (gcolor3_application_class); GApplicationClass *application_class = G_APPLICATION_CLASS (gcolor3_application_class); object_class->dispose = gcolor3_application_dispose; application_class->startup = gcolor3_application_startup; application_class->activate = gcolor3_application_activate; } static void gcolor3_application_init (Gcolor3Application *application) { Gcolor3ApplicationPrivate *priv; priv = gcolor3_application_get_instance_private (application); priv->colors = gcolor3_color_store_new (); } Gcolor3Application * gcolor3_application_new (void) { return g_object_new (GCOLOR3_TYPE_APPLICATION, "application-id", "nl.hjdskes.gcolor3", "flags", G_APPLICATION_FLAGS_NONE, NULL); } gcolor3-2.3.1/src/gcolor3-application.h000066400000000000000000000041551334304176500177110ustar00rootroot00000000000000/* Gcolor3Application * * Copyright (C) 2015-2016 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_APPLICATION_H__ #define __GCOLOR3_APPLICATION_H__ #include #include G_BEGIN_DECLS typedef struct _Gcolor3Application Gcolor3Application; typedef struct _Gcolor3ApplicationClass Gcolor3ApplicationClass; typedef struct _Gcolor3ApplicationPrivate Gcolor3ApplicationPrivate; #define GCOLOR3_TYPE_APPLICATION (gcolor3_application_get_type ()) #define GCOLOR3_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_APPLICATION, Gcolor3Application)) #define GCOLOR3_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_APPLICATION, Gcolor3ApplicationClass)) #define GCOLOR3_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_APPLICATION)) #define GCOLOR3_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_APPLICATION)) #define GCOLOR3_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_APPLICATION, Gcolor3ApplicationClass)) struct _Gcolor3Application { GtkApplication base_instance; }; struct _Gcolor3ApplicationClass { GtkApplicationClass parent_class; }; GType gcolor3_application_get_type (void) G_GNUC_CONST; Gcolor3Application *gcolor3_application_new (void); G_END_DECLS #endif /* __GCOLOR3_APPLICATION_H__ */ gcolor3-2.3.1/src/gcolor3-color-item.c000066400000000000000000000070621334304176500174530ustar00rootroot00000000000000/* Gcolor3ColorItem * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "gcolor3-color-item.h" enum { PROP_0, PROP_KEY, PROP_HEX, }; struct _Gcolor3ColorItemPrivate { gchar *key; const gchar *hex; }; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3ColorItem, gcolor3_color_item, G_TYPE_OBJECT) static void gcolor3_color_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { Gcolor3ColorItemPrivate *priv; priv = gcolor3_color_item_get_instance_private (GCOLOR3_COLOR_ITEM (object)); switch (prop_id) { case PROP_KEY: g_value_set_string (value, priv->key); break; case PROP_HEX: g_value_set_string (value, priv->hex); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_color_item_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { Gcolor3ColorItemPrivate *priv; priv = gcolor3_color_item_get_instance_private (GCOLOR3_COLOR_ITEM (object)); switch (prop_id) { case PROP_KEY: priv->key = g_value_dup_string (value); break; case PROP_HEX: priv->hex = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_color_item_finalize (GObject *object) { Gcolor3ColorItemPrivate *priv; priv = gcolor3_color_item_get_instance_private (GCOLOR3_COLOR_ITEM (object)); g_free (priv->key); G_OBJECT_CLASS (gcolor3_color_item_parent_class)->finalize (object); } static void gcolor3_color_item_class_init (Gcolor3ColorItemClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gcolor3_color_item_finalize; object_class->get_property = gcolor3_color_item_get_property; object_class->set_property = gcolor3_color_item_set_property; g_object_class_install_property (object_class, PROP_KEY, g_param_spec_string ("key", "key", "Key of this row's color", "Black", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_PRIVATE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HEX, g_param_spec_string ("hex", "HexValue", "Hex value of this row's color", "#000000", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_PRIVATE | G_PARAM_STATIC_STRINGS)); } static void gcolor3_color_item_init (Gcolor3ColorItem *item) { } Gcolor3ColorItem * gcolor3_color_item_new (const gchar *key, const gchar *hex) { g_return_val_if_fail (key != NULL, NULL); g_return_val_if_fail (hex != NULL, NULL); return g_object_new (GCOLOR3_TYPE_COLOR_ITEM, "key", key, "hex", hex, NULL); } gcolor3-2.3.1/src/gcolor3-color-item.h000066400000000000000000000040701334304176500174540ustar00rootroot00000000000000/* Gcolor3ColorItem * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_COLOR_ITEM_H__ #define __GCOLOR3_COLOR_ITEM_H__ #include G_BEGIN_DECLS typedef struct _Gcolor3ColorItem Gcolor3ColorItem; typedef struct _Gcolor3ColorItemClass Gcolor3ColorItemClass; typedef struct _Gcolor3ColorItemPrivate Gcolor3ColorItemPrivate; #define GCOLOR3_TYPE_COLOR_ITEM (gcolor3_color_item_get_type ()) #define GCOLOR3_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItem)) #define GCOLOR3_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItemClass)) #define GCOLOR3_IS_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_COLOR_ITEM)) #define GCOLOR3_IS_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_COLOR_ITEM)) #define GCOLOR3_COLOR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_COLOR_ITEM, Gcolor3ColorItemClass)) struct _Gcolor3ColorItem { GObject base_instance; }; struct _Gcolor3ColorItemClass { GObjectClass parent_class; }; GType gcolor3_color_item_get_type (void) G_GNUC_CONST; Gcolor3ColorItem *gcolor3_color_item_new (const gchar *key, const gchar *hex); G_END_DECLS #endif /* __GCOLOR3_COLOR_ITEM_H__ */ gcolor3-2.3.1/src/gcolor3-color-row.c000066400000000000000000000216111334304176500173200ustar00rootroot00000000000000/* Gcolor3ColorRow * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include "gcolor3-color-row.h" #define I_(string) g_intern_static_string (string) #define THUMB_SIZE 32 #define RADIUS 3 enum { PROP_0, PROP_KEY, PROP_HEX, }; enum { SIGNAL_COLOR_REMOVED, SIGNAL_COLOR_RENAMED, SIGNAL_LAST, }; static guint signals[SIGNAL_LAST]; struct _Gcolor3ColorRowPrivate { GtkWidget *image; GtkWidget *label; GtkWidget *entry; gchar *key; const gchar *hex; }; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3ColorRow, gcolor3_color_row, GTK_TYPE_LIST_BOX_ROW) static void set_color_thumbnail (Gcolor3ColorRow *row) { Gcolor3ColorRowPrivate *priv; GtkStyleContext *style_context; cairo_surface_t *surface; cairo_t *context; GValue border_radius = { 0 }; GdkRGBA color; double x = 0; double y = 0; double degrees = G_PI / 180.0; int radius = RADIUS; priv = gcolor3_color_row_get_instance_private (row); if (!gdk_rgba_parse (&color, priv->hex)) { g_warning (_("Could not parse color to display thumbnail\n")); return; } surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, THUMB_SIZE, THUMB_SIZE); context = cairo_create (surface); cairo_set_source_rgba (context, color.red, color.green, color.blue, color.alpha); style_context = gtk_widget_get_style_context (GTK_WIDGET (priv->entry)); gtk_style_context_save (style_context); gtk_style_context_get_property (style_context, GTK_STYLE_PROPERTY_BORDER_RADIUS, GTK_STATE_FLAG_NORMAL, &border_radius); gtk_style_context_restore (style_context); if (G_VALUE_HOLDS_INT (&border_radius)) { radius = g_value_get_int (&border_radius); } g_value_unset (&border_radius); /* Code from https://www.cairographics.org/samples/rounded_rectangle/ */ cairo_new_sub_path (context); cairo_arc (context, x + THUMB_SIZE - radius, y + radius, radius, -90 * degrees, 0); cairo_arc (context, x + THUMB_SIZE - radius, y + THUMB_SIZE - radius, radius, 0, 90 * degrees); cairo_arc (context, x + radius, y + THUMB_SIZE - radius, radius, 90 * degrees, 180 * degrees); cairo_arc (context, x + radius, y + radius, radius, 180 * degrees, 270 * degrees); cairo_close_path (context); cairo_fill_preserve (context); gtk_image_set_from_surface (GTK_IMAGE (priv->image), surface); cairo_destroy (context); cairo_surface_destroy (surface); } static void set_color_in_clipboard (const gchar *color) { GtkClipboard *clipboard; clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); gtk_clipboard_set_text (clipboard, color, -1); } static void gcolor3_color_row_copy_button_clicked (UNUSED GtkButton *button, gpointer user_data) { Gcolor3ColorRowPrivate *priv; priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (user_data)); set_color_in_clipboard (priv->hex); } static void gcolor3_color_row_delete_button_clicked (UNUSED GtkButton *button, gpointer user_data) { g_signal_emit (GCOLOR3_COLOR_ROW (user_data), signals[SIGNAL_COLOR_REMOVED], 0); } static void gcolor3_color_row_entry_activated (GtkEntry *entry, gpointer user_data) { Gcolor3ColorRowPrivate *priv; gchar *old_key; priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (user_data)); old_key = g_strdup (priv->key); priv->key = g_strdup (gtk_entry_get_text (entry)); g_signal_emit (GCOLOR3_COLOR_ROW (user_data), signals[SIGNAL_COLOR_RENAMED], 0, old_key, priv->key); g_free (old_key); } static gboolean gcolor3_color_row_key_press_event (GtkWidget *row, GdkEventKey *event) { Gcolor3ColorRowPrivate *priv; if (event->type != GDK_KEY_PRESS) { return GDK_EVENT_PROPAGATE; } priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (row)); switch (event->keyval) { case GDK_KEY_c: if ((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) { return GDK_EVENT_PROPAGATE; } set_color_in_clipboard (priv->hex); return GDK_EVENT_STOP; case GDK_KEY_Delete: g_object_ref (row); g_signal_emit (GCOLOR3_COLOR_ROW (row), signals[SIGNAL_COLOR_REMOVED], 0); return GDK_EVENT_STOP; default: return GDK_EVENT_PROPAGATE; } } static void gcolor3_color_row_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { Gcolor3ColorRowPrivate *priv; priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (object)); switch (prop_id) { case PROP_KEY: priv->key = g_value_dup_string (value); break; case PROP_HEX: priv->hex = g_value_dup_string (value); set_color_thumbnail (GCOLOR3_COLOR_ROW (object)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_color_row_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { Gcolor3ColorRowPrivate *priv; priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (object)); switch (prop_id) { case PROP_KEY: g_value_set_string (value, priv->key); break; case PROP_HEX: g_value_set_string (value, priv->hex); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_color_row_finalize (GObject *object) { Gcolor3ColorRowPrivate *priv; priv = gcolor3_color_row_get_instance_private (GCOLOR3_COLOR_ROW (object)); g_free (priv->key); G_OBJECT_CLASS (gcolor3_color_row_parent_class)->finalize (object); } static void gcolor3_color_row_class_init (Gcolor3ColorRowClass *gcolor3_color_row_class) { GObjectClass *object_class = G_OBJECT_CLASS (gcolor3_color_row_class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (gcolor3_color_row_class); object_class->set_property = gcolor3_color_row_set_property; object_class->get_property = gcolor3_color_row_get_property; object_class->finalize = gcolor3_color_row_finalize; widget_class->key_press_event = gcolor3_color_row_key_press_event; signals[SIGNAL_COLOR_REMOVED] = g_signal_new (I_("color-removed"), GCOLOR3_TYPE_COLOR_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); signals[SIGNAL_COLOR_RENAMED] = g_signal_new (I_("color-renamed"), GCOLOR3_TYPE_COLOR_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); g_object_class_install_property (object_class, PROP_KEY, g_param_spec_string ("key", "key", "Key of this row's color", "Black", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_PRIVATE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HEX, g_param_spec_string ("hex", "HexValue", "Hex value of this row's color", "#000000", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_PRIVATE | G_PARAM_STATIC_STRINGS)); gtk_widget_class_set_template_from_resource (widget_class, "/nl/hjdskes/gcolor3/color-row.ui"); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3ColorRow, image); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3ColorRow, label); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3ColorRow, entry); gtk_widget_class_bind_template_callback (widget_class, gcolor3_color_row_copy_button_clicked); gtk_widget_class_bind_template_callback (widget_class, gcolor3_color_row_delete_button_clicked); gtk_widget_class_bind_template_callback (widget_class, gcolor3_color_row_entry_activated); } static void gcolor3_color_row_init (Gcolor3ColorRow *color_row) { Gcolor3ColorRowPrivate *priv; priv = gcolor3_color_row_get_instance_private (color_row); gtk_widget_init_template (GTK_WIDGET (color_row)); g_object_bind_property (color_row, "key", priv->entry, "text", G_BINDING_DEFAULT); g_object_bind_property (color_row, "hex", priv->label, "label", G_BINDING_DEFAULT); } Gcolor3ColorRow * gcolor3_color_row_new (const gchar *key, const gchar *hex) { g_return_val_if_fail (key != NULL, NULL); g_return_val_if_fail (hex != NULL, NULL); return g_object_new (GCOLOR3_TYPE_COLOR_ROW, "key", key, "hex", hex, NULL); } gcolor3-2.3.1/src/gcolor3-color-row.h000066400000000000000000000040451334304176500173270ustar00rootroot00000000000000/* Gcolor3ColorRow * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_COLOR_ROW_H__ #define __GCOLOR3_COLOR_ROW_H__ #include G_BEGIN_DECLS typedef struct _Gcolor3ColorRow Gcolor3ColorRow; typedef struct _Gcolor3ColorRowClass Gcolor3ColorRowClass; typedef struct _Gcolor3ColorRowPrivate Gcolor3ColorRowPrivate; #define GCOLOR3_TYPE_COLOR_ROW (gcolor3_color_row_get_type ()) #define GCOLOR3_COLOR_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_COLOR_ROW, Gcolor3ColorRow)) #define GCOLOR3_COLOR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_COLOR_ROW, Gcolor3ColorRowClass)) #define GCOLOR3_IS_COLOR_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_COLOR_ROW)) #define GCOLOR3_IS_COLOR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_COLOR_ROW)) #define GCOLOR3_COLOR_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_COLOR_ROW, Gcolor3ColorRowClass)) struct _Gcolor3ColorRow { GtkListBoxRow base_instance; }; struct _Gcolor3ColorRowClass { GtkListBoxRowClass parent_class; }; GType gcolor3_color_row_get_type (void) G_GNUC_CONST; Gcolor3ColorRow *gcolor3_color_row_new (const gchar *key, const gchar *hex); G_END_DECLS #endif /* __GCOLOR3_COLOR_ROW_H__ */ gcolor3-2.3.1/src/gcolor3-color-selection.c000066400000000000000000003053741334304176500205110ustar00rootroot00000000000000/* GTK - The GIMP Toolkit * Copyright (C) 2000 Red Hat, Inc. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ /* * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. * * Updated and adapted for inclusion in Gcolor3 by Jente Hidskes 2017. */ #include "config.h" // TODO: get rid of all deprecated API #define GDK_DISABLE_DEPRECATION_WARNINGS #include "gcolor3-color-selection.h" #include "gcolor3-hsv.h" #include "utils.h" #include #include #include #ifdef GDK_WINDOWING_WAYLAND #include #endif #include #include #ifdef ENABLE_NLS #define P_(String) g_dgettext(GETTEXT_PACKAGE "-properties",String) #else #define P_(String) (String) #endif #define I_(string) g_intern_static_string (string) /** * SECTION:gtkcolorsel * @Short_description: Widget used to select a color * @Title: Gcolor3ColorSelection * * The #Gcolor3ColorSelection is a widget that is used to select * a color. It consists of a color wheel and number of sliders * and entry boxes for color parameters such as hue, saturation, * value, red, green, blue, and opacity. */ /* Keep it in sync with gtksettings.c:default_color_palette */ #define DEFAULT_COLOR_PALETTE "black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90" /* Number of elements in the custom palatte */ #define CUSTOM_PALETTE_WIDTH 10 #define CUSTOM_PALETTE_HEIGHT 2 #define CUSTOM_PALETTE_ENTRY_WIDTH 20 #define CUSTOM_PALETTE_ENTRY_HEIGHT 20 /* The cursor for the dropper */ #define DROPPER_WIDTH 17 #define DROPPER_HEIGHT 17 #define DROPPER_STRIDE (DROPPER_WIDTH * 4) #define DROPPER_X_HOT 2 #define DROPPER_Y_HOT 16 #define SAMPLE_WIDTH 64 #define SAMPLE_HEIGHT 28 #define CHECK_SIZE 16 #define BIG_STEP 20 /* Conversion between 0->1 double and and guint16. See * scale_round() in utils.c for more general conversions */ #define SCALE(i) (i / 65535.) #define UNSCALE(d) ((guint16)(d * 65535 + 0.5)) #define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) enum { COLOR_CHANGED, LAST_SIGNAL }; enum { PROP_0, PROP_HAS_PALETTE, PROP_HAS_OPACITY_CONTROL, PROP_CURRENT_ALPHA, PROP_CURRENT_RGBA }; enum { COLORSEL_RED = 0, COLORSEL_GREEN = 1, COLORSEL_BLUE = 2, COLORSEL_OPACITY = 3, COLORSEL_HUE, COLORSEL_SATURATION, COLORSEL_VALUE, COLORSEL_NUM_CHANNELS }; struct _Gcolor3ColorSelectionPrivate { guint has_opacity : 1; guint has_palette : 1; guint changing : 1; guint default_set : 1; guint default_alpha_set : 1; guint has_grab : 1; // FIXME: these can be replaced with a GdkRGBA gdouble color[COLORSEL_NUM_CHANNELS]; gdouble old_color[COLORSEL_NUM_CHANNELS]; GtkWidget *triangle_colorsel; GtkWidget *hue_spinbutton; GtkWidget *sat_spinbutton; GtkWidget *val_spinbutton; GtkWidget *red_spinbutton; GtkWidget *green_spinbutton; GtkWidget *blue_spinbutton; GtkWidget *opacity_slider; GtkWidget *opacity_label; GtkWidget *opacity_entry; GtkWidget *palette_frame; GtkWidget *hex_entry; /* The Palette code */ GtkWidget *custom_palette [CUSTOM_PALETTE_WIDTH][CUSTOM_PALETTE_HEIGHT]; /* The color_sample stuff */ GtkWidget *sample_area; GtkWidget *old_sample; GtkWidget *cur_sample; GtkWidget *colorsel; /* Window for grabbing on */ GtkWidget *dropper_grab_widget; guint32 grab_time; GdkDevice *keyboard_device; GdkDevice *pointer_device; /* Connection to settings */ gulong settings_connection; }; static void gcolor3_color_selection_destroy (GtkWidget *widget); static void gcolor3_color_selection_finalize (GObject *object); static void update_color (Gcolor3ColorSelection *colorsel); static void gcolor3_color_selection_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gcolor3_color_selection_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gcolor3_color_selection_realize (GtkWidget *widget); static void gcolor3_color_selection_unrealize (GtkWidget *widget); static void gcolor3_color_selection_show_all (GtkWidget *widget); static gboolean gcolor3_color_selection_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event); static void gcolor3_color_selection_set_palette_color (Gcolor3ColorSelection *colorsel, gint index, GdkRGBA *color); static void set_focus_line_attributes (GtkWidget *drawing_area, cairo_t *cr, gint *focus_width); static void default_noscreen_change_palette_func (const GdkRGBA *colors, gint n_colors); static void default_change_palette_func (GdkScreen *screen, const GdkRGBA *colors, gint n_colors); static void make_control_relations (AtkObject *atk_obj, GtkWidget *widget); static void make_all_relations (AtkObject *atk_obj, Gcolor3ColorSelectionPrivate *priv); static void hsv_changed (GtkWidget *hsv, gpointer data); static void get_screen_color (GtkWidget *button); static void adjustment_changed (GtkAdjustment *adjustment, gpointer data); static void opacity_entry_changed (GtkWidget *opacity_entry, gpointer data); static void hex_changed (GtkWidget *hex_entry, gpointer data); static gboolean hex_focus_out (GtkWidget *hex_entry, GdkEventFocus *event, gpointer data); static void color_sample_new (Gcolor3ColorSelection *colorsel); static void make_label_spinbutton (Gcolor3ColorSelection *colorsel, GtkWidget **spinbutton, gchar *text, GtkWidget *table, gint i, gint j, gint channel_type, const gchar *tooltip); static void make_palette_frame (Gcolor3ColorSelection *colorsel, GtkWidget *table, gint i, gint j); static void set_selected_palette (Gcolor3ColorSelection *colorsel, int x, int y); static void set_focus_line_attributes (GtkWidget *drawing_area, cairo_t *cr, gint *focus_width); static gboolean mouse_press (GtkWidget *invisible, GdkEventButton *event, gpointer data); static void palette_change_notify_instance (GObject *object, GParamSpec *pspec, gpointer data); static void update_palette (Gcolor3ColorSelection *colorsel); static void shutdown_eyedropper (GtkWidget *widget); static guint color_selection_signals[LAST_SIGNAL] = { 0 }; static Gcolor3ColorSelectionChangePaletteFunc noscreen_change_palette_hook = default_noscreen_change_palette_func; static Gcolor3ColorSelectionChangePaletteWithScreenFunc change_palette_hook = default_change_palette_func; static const guchar dropper_bits[] = { "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\0\0\0\377" "\0\0\0\377\0\0\0\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377" "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\377" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\0\0\0\377\0\0" "\0\377\0\0\0\377\0\0\0\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\0\0\0\377\0\0\0\377\0" "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377" "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\377\377\377\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" "\0\0\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\0\0\0\377\0\0" "\0\377\0\0\0\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377" "\377\377\377\377\377\377\377\377\377\377\0\0\0\377\0\0\0\377\377\377" "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377" "\0\0\0\377\377\377\377\377\0\0\0\377\377\377\377\377\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377" "\377\377\377\377\377\377\377\377\377\0\0\0\377\0\0\0\0\0\0\0\0\377\377" "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0" "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" "\377\377\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377" "\377\377\377\377\377\377\377\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\0\0" "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0" "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3ColorSelection, gcolor3_color_selection, GTK_TYPE_BOX) static void gcolor3_color_selection_class_init (Gcolor3ColorSelectionClass *klass) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = gcolor3_color_selection_finalize; gobject_class->set_property = gcolor3_color_selection_set_property; gobject_class->get_property = gcolor3_color_selection_get_property; widget_class = GTK_WIDGET_CLASS (klass); widget_class->destroy = gcolor3_color_selection_destroy; widget_class->realize = gcolor3_color_selection_realize; widget_class->unrealize = gcolor3_color_selection_unrealize; widget_class->show_all = gcolor3_color_selection_show_all; widget_class->grab_broken_event = gcolor3_color_selection_grab_broken; g_object_class_install_property (gobject_class, PROP_HAS_OPACITY_CONTROL, g_param_spec_boolean ("has-opacity-control", P_("Has Opacity Control"), P_("Whether the color selector should allow setting opacity"), FALSE, G_PARAM_READWRITE| G_PARAM_STATIC_NAME| G_PARAM_STATIC_NICK| G_PARAM_STATIC_BLURB)); g_object_class_install_property (gobject_class, PROP_HAS_PALETTE, g_param_spec_boolean ("has-palette", P_("Has palette"), P_("Whether a palette should be used"), FALSE, G_PARAM_READWRITE| G_PARAM_STATIC_NAME| G_PARAM_STATIC_NICK| G_PARAM_STATIC_BLURB)); g_object_class_install_property (gobject_class, PROP_CURRENT_ALPHA, g_param_spec_uint ("current-alpha", P_("Current Alpha"), P_("The current opacity value (0 fully transparent, 65535 fully opaque)"), 0, 65535, 65535, G_PARAM_READWRITE| G_PARAM_STATIC_NAME| G_PARAM_STATIC_NICK| G_PARAM_STATIC_BLURB)); /** * Gcolor3ColorSelection:current-rgba: * * The current RGBA color. * * Since: 3.0 */ g_object_class_install_property (gobject_class, PROP_CURRENT_RGBA, g_param_spec_boxed ("current-rgba", P_("Current RGBA"), P_("The current RGBA color"), GDK_TYPE_RGBA, G_PARAM_READWRITE| G_PARAM_STATIC_NAME| G_PARAM_STATIC_NICK| G_PARAM_STATIC_BLURB)); /** * Gcolor3ColorSelection::color-changed: * @colorselection: the object which received the signal. * * This signal is emitted when the color changes in the #Gcolor3ColorSelection * according to its update policy. */ color_selection_signals[COLOR_CHANGED] = g_signal_new (I_("color-changed"), G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (Gcolor3ColorSelectionClass, color_changed), NULL, NULL, NULL, G_TYPE_NONE, 0); } static void gcolor3_color_selection_init (Gcolor3ColorSelection *colorsel) { GtkWidget *top_hbox; GtkWidget *top_right_vbox; GtkWidget *table, *label, *hbox, *frame, *vbox, *button; GtkAdjustment *adjust; GtkWidget *picker_image; gint i, j; Gcolor3ColorSelectionPrivate *priv; AtkObject *atk_obj; GList *focus_chain = NULL; gtk_orientable_set_orientation (GTK_ORIENTABLE (colorsel), GTK_ORIENTATION_VERTICAL); gtk_widget_push_composite_child (); priv = colorsel->private_data = gcolor3_color_selection_get_instance_private (colorsel); priv->changing = FALSE; priv->default_set = FALSE; priv->default_alpha_set = FALSE; top_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (colorsel), top_hbox, FALSE, FALSE, 0); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); priv->triangle_colorsel = gcolor3_hsv_new (); g_signal_connect (priv->triangle_colorsel, "changed", G_CALLBACK (hsv_changed), colorsel); gcolor3_hsv_set_metrics (GCOLOR3_HSV (priv->triangle_colorsel), 174, 15); gtk_box_pack_start (GTK_BOX (top_hbox), vbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), priv->triangle_colorsel, FALSE, FALSE, 0); gtk_widget_set_tooltip_text (priv->triangle_colorsel, _("Select the color you want from the outer ring. " "Select the darkness or lightness of that color " "using the inner triangle.")); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_widget_set_size_request (frame, -1, 30); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); color_sample_new (colorsel); gtk_container_add (GTK_CONTAINER (frame), priv->sample_area); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); button = gtk_button_new (); gtk_widget_set_events (button, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); g_object_set_data (G_OBJECT (button), I_("COLORSEL"), colorsel); g_signal_connect (button, "clicked", G_CALLBACK (get_screen_color), NULL); picker_image = gtk_image_new_from_icon_name ("gtk-color-picker", GTK_ICON_SIZE_BUTTON); gtk_container_add (GTK_CONTAINER (button), picker_image); gtk_widget_show (GTK_WIDGET (picker_image)); gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default())) { gtk_widget_set_sensitive (button, FALSE); gtk_widget_set_tooltip_text (button, _("Picking a color is currently not supported on " "Wayland.")); } #else if (FALSE) { } #endif else { gtk_widget_set_tooltip_text (button, _("Click the eyedropper, then click a color " "anywhere on your screen to select that color.")); } top_right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (top_hbox), top_right_vbox, FALSE, FALSE, 0); table = gtk_grid_new (); gtk_box_pack_start (GTK_BOX (top_right_vbox), table, FALSE, FALSE, 0); gtk_grid_set_row_spacing (GTK_GRID (table), 6); gtk_grid_set_column_spacing (GTK_GRID (table), 12); make_label_spinbutton (colorsel, &priv->hue_spinbutton, _("_Hue:"), table, 0, 0, COLORSEL_HUE, _("Position on the color wheel.")); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (priv->hue_spinbutton), TRUE); make_label_spinbutton (colorsel, &priv->sat_spinbutton, _("S_aturation:"), table, 0, 1, COLORSEL_SATURATION, _("Intensity of the color.")); make_label_spinbutton (colorsel, &priv->val_spinbutton, _("_Value:"), table, 0, 2, COLORSEL_VALUE, _("Brightness of the color.")); make_label_spinbutton (colorsel, &priv->red_spinbutton, _("_Red:"), table, 6, 0, COLORSEL_RED, _("Amount of red light in the color.")); make_label_spinbutton (colorsel, &priv->green_spinbutton, _("_Green:"), table, 6, 1, COLORSEL_GREEN, _("Amount of green light in the color.")); make_label_spinbutton (colorsel, &priv->blue_spinbutton, _("_Blue:"), table, 6, 2, COLORSEL_BLUE, _("Amount of blue light in the color.")); gtk_grid_attach (GTK_GRID (table), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), 0, 3, 8, 1); priv->opacity_label = gtk_label_new_with_mnemonic (_("Op_acity:")); gtk_widget_set_halign (priv->opacity_label, GTK_ALIGN_START); gtk_widget_set_valign (priv->opacity_label, GTK_ALIGN_CENTER); gtk_grid_attach (GTK_GRID (table), priv->opacity_label, 0, 4, 1, 1); adjust = gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0); g_object_set_data (G_OBJECT (adjust), I_("COLORSEL"), colorsel); priv->opacity_slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjust); gtk_widget_set_tooltip_text (priv->opacity_slider, _("Transparency of the color.")); gtk_label_set_mnemonic_widget (GTK_LABEL (priv->opacity_label), priv->opacity_slider); gtk_scale_set_draw_value (GTK_SCALE (priv->opacity_slider), FALSE); g_signal_connect (adjust, "value-changed", G_CALLBACK (adjustment_changed), GINT_TO_POINTER (COLORSEL_OPACITY)); gtk_grid_attach (GTK_GRID (table), priv->opacity_slider, 1, 4, 6, 1); priv->opacity_entry = gtk_entry_new (); gtk_widget_set_tooltip_text (priv->opacity_entry, _("Transparency of the color.")); gtk_widget_set_size_request (priv->opacity_entry, 40, -1); g_signal_connect (priv->opacity_entry, "activate", G_CALLBACK (opacity_entry_changed), colorsel); gtk_grid_attach (GTK_GRID (table), priv->opacity_entry, 7, 4, 1, 1); label = gtk_label_new_with_mnemonic (_("Color _name:")); gtk_grid_attach (GTK_GRID (table), label, 0, 5, 1, 1); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); priv->hex_entry = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->hex_entry); g_signal_connect (priv->hex_entry, "activate", G_CALLBACK (hex_changed), colorsel); g_signal_connect (priv->hex_entry, "focus-out-event", G_CALLBACK (hex_focus_out), colorsel); gtk_widget_set_tooltip_text (priv->hex_entry, _("You can enter an HTML-style hexadecimal color " "value, or simply a color name such as “orange” " "in this entry.")); gtk_entry_set_width_chars (GTK_ENTRY (priv->hex_entry), 7); gtk_grid_attach (GTK_GRID (table), priv->hex_entry, 1, 5, 4, 1); focus_chain = g_list_append (focus_chain, priv->hue_spinbutton); focus_chain = g_list_append (focus_chain, priv->sat_spinbutton); focus_chain = g_list_append (focus_chain, priv->val_spinbutton); focus_chain = g_list_append (focus_chain, priv->red_spinbutton); focus_chain = g_list_append (focus_chain, priv->green_spinbutton); focus_chain = g_list_append (focus_chain, priv->blue_spinbutton); focus_chain = g_list_append (focus_chain, priv->opacity_slider); focus_chain = g_list_append (focus_chain, priv->opacity_entry); focus_chain = g_list_append (focus_chain, priv->hex_entry); gtk_container_set_focus_chain (GTK_CONTAINER (table), focus_chain); g_list_free (focus_chain); /* Set up the palette */ table = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (table), 1); gtk_grid_set_column_spacing (GTK_GRID (table), 1); for (i = 0; i < CUSTOM_PALETTE_WIDTH; i++) { for (j = 0; j < CUSTOM_PALETTE_HEIGHT; j++) { make_palette_frame (colorsel, table, i, j); } } set_selected_palette (colorsel, 0, 0); priv->palette_frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); label = gtk_label_new_with_mnemonic (_("_Palette:")); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (priv->palette_frame), label, FALSE, FALSE, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->custom_palette[0][0]); gtk_box_pack_end (GTK_BOX (top_right_vbox), priv->palette_frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (priv->palette_frame), table, FALSE, FALSE, 0); gtk_widget_show_all (top_hbox); /* hide unused stuff */ if (priv->has_opacity == FALSE) { gtk_widget_hide (priv->opacity_label); gtk_widget_hide (priv->opacity_slider); gtk_widget_hide (priv->opacity_entry); } if (priv->has_palette == FALSE) { gtk_widget_hide (priv->palette_frame); } atk_obj = gtk_widget_get_accessible (priv->triangle_colorsel); if (GTK_IS_ACCESSIBLE (atk_obj)) { atk_object_set_name (atk_obj, _("Color Wheel")); atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (colorsel)), ATK_ROLE_COLOR_CHOOSER); make_all_relations (atk_obj, priv); } gtk_widget_pop_composite_child (); } /* GObject methods */ static void gcolor3_color_selection_finalize (GObject *object) { G_OBJECT_CLASS (gcolor3_color_selection_parent_class)->finalize (object); } static void gcolor3_color_selection_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (object); switch (prop_id) { case PROP_HAS_OPACITY_CONTROL: gcolor3_color_selection_set_has_opacity_control (colorsel, g_value_get_boolean (value)); break; case PROP_HAS_PALETTE: gcolor3_color_selection_set_has_palette (colorsel, g_value_get_boolean (value)); break; case PROP_CURRENT_ALPHA: gcolor3_color_selection_set_current_alpha (colorsel, g_value_get_uint (value)); break; case PROP_CURRENT_RGBA: gcolor3_color_selection_set_current_rgba (colorsel, g_value_get_boxed (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_color_selection_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (object); switch (prop_id) { case PROP_HAS_OPACITY_CONTROL: g_value_set_boolean (value, gcolor3_color_selection_get_has_opacity_control (colorsel)); break; case PROP_HAS_PALETTE: g_value_set_boolean (value, gcolor3_color_selection_get_has_palette (colorsel)); break; case PROP_CURRENT_ALPHA: g_value_set_uint (value, gcolor3_color_selection_get_current_alpha (colorsel)); break; case PROP_CURRENT_RGBA: { GdkRGBA rgba; gcolor3_color_selection_get_current_rgba (colorsel, &rgba); g_value_set_boxed (value, &rgba); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } /* GtkWidget methods */ static void gcolor3_color_selection_destroy (GtkWidget *widget) { Gcolor3ColorSelection *cselection = GCOLOR3_COLOR_SELECTION (widget); Gcolor3ColorSelectionPrivate *priv = cselection->private_data; if (priv->dropper_grab_widget) { gtk_widget_destroy (priv->dropper_grab_widget); priv->dropper_grab_widget = NULL; } GTK_WIDGET_CLASS (gcolor3_color_selection_parent_class)->destroy (widget); } static void gcolor3_color_selection_realize (GtkWidget *widget) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (widget); Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; GtkSettings *settings = gtk_widget_get_settings (widget); priv->settings_connection = g_signal_connect (settings, "notify::gtk-color-palette", G_CALLBACK (palette_change_notify_instance), widget); update_palette (colorsel); GTK_WIDGET_CLASS (gcolor3_color_selection_parent_class)->realize (widget); } static void gcolor3_color_selection_unrealize (GtkWidget *widget) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (widget); Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; GtkSettings *settings = gtk_widget_get_settings (widget); g_signal_handler_disconnect (settings, priv->settings_connection); GTK_WIDGET_CLASS (gcolor3_color_selection_parent_class)->unrealize (widget); } /* We override show-all since we have internal widgets that * shouldn’t be shown when you call show_all(), like the * palette and opacity sliders. */ static void gcolor3_color_selection_show_all (GtkWidget *widget) { gtk_widget_show (widget); } static gboolean gcolor3_color_selection_grab_broken (GtkWidget *widget, UNUSED GdkEventGrabBroken *event) { shutdown_eyedropper (widget); return TRUE; } /* * * The Sample Color * */ static void color_sample_draw_sample (Gcolor3ColorSelection *colorsel, int which, cairo_t * cr); static void color_sample_update_samples (Gcolor3ColorSelection *colorsel); static void set_color_internal (Gcolor3ColorSelection *colorsel, gdouble *color) { Gcolor3ColorSelectionPrivate *priv; gint i; priv = colorsel->private_data; priv->changing = TRUE; priv->color[COLORSEL_RED] = color[0]; priv->color[COLORSEL_GREEN] = color[1]; priv->color[COLORSEL_BLUE] = color[2]; priv->color[COLORSEL_OPACITY] = color[3]; gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); if (priv->default_set == FALSE) { for (i = 0; i < COLORSEL_NUM_CHANNELS; i++) priv->old_color[i] = priv->color[i]; } priv->default_set = TRUE; priv->default_alpha_set = TRUE; update_color (colorsel); } static void set_color_icon (GdkDragContext *context, gdouble *colors) { GdkPixbuf *pixbuf; guint32 pixel; pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 48, 32); pixel = (((UNSCALE (colors[COLORSEL_RED]) & 0xff00) << 16) | ((UNSCALE (colors[COLORSEL_GREEN]) & 0xff00) << 8) | ((UNSCALE (colors[COLORSEL_BLUE]) & 0xff00))); gdk_pixbuf_fill (pixbuf, pixel); gtk_drag_set_icon_pixbuf (context, pixbuf, -2, -2); g_object_unref (pixbuf); } static void color_sample_drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer data) { Gcolor3ColorSelection *colorsel = data; Gcolor3ColorSelectionPrivate *priv; gdouble *colsrc; priv = colorsel->private_data; if (widget == priv->old_sample) colsrc = priv->old_color; else colsrc = priv->color; set_color_icon (context, colsrc); } static void color_sample_drag_end (GtkWidget *widget, UNUSED GdkDragContext *context, UNUSED gpointer data) { g_object_set_data (G_OBJECT (widget), I_("gtk-color-selection-drag-window"), NULL); } static void color_sample_drop_handle (GtkWidget *widget, UNUSED GdkDragContext *context, UNUSED gint x, UNUSED gint y, GtkSelectionData *selection_data, UNUSED guint info, UNUSED guint time, gpointer data) { Gcolor3ColorSelection *colorsel = data; Gcolor3ColorSelectionPrivate *priv; gint length; guint16 *vals; gdouble color[4]; priv = colorsel->private_data; /* This is currently a guint16 array of the format: * R * G * B * opacity */ length = gtk_selection_data_get_length (selection_data); if (length < 0) return; /* We accept drops with the wrong format, since the KDE color * chooser incorrectly drops application/x-color with format 8. */ if (length != 8) { g_warning ("Received invalid color data"); return; } vals = (guint16 *) gtk_selection_data_get_data (selection_data); if (widget == priv->cur_sample) { color[0] = (gdouble)vals[0] / 0xffff; color[1] = (gdouble)vals[1] / 0xffff; color[2] = (gdouble)vals[2] / 0xffff; color[3] = (gdouble)vals[3] / 0xffff; set_color_internal (colorsel, color); } } static void color_sample_drag_handle (GtkWidget *widget, UNUSED GdkDragContext *context, GtkSelectionData *selection_data, UNUSED guint info, UNUSED guint time, gpointer data) { Gcolor3ColorSelection *colorsel = data; Gcolor3ColorSelectionPrivate *priv; guint16 vals[4]; gdouble *colsrc; priv = colorsel->private_data; if (widget == priv->old_sample) colsrc = priv->old_color; else colsrc = priv->color; vals[0] = colsrc[COLORSEL_RED] * 0xffff; vals[1] = colsrc[COLORSEL_GREEN] * 0xffff; vals[2] = colsrc[COLORSEL_BLUE] * 0xffff; vals[3] = priv->has_opacity ? colsrc[COLORSEL_OPACITY] * 0xffff : 0xffff; gtk_selection_data_set (selection_data, gdk_atom_intern_static_string ("application/x-color"), 16, (guchar *)vals, 8); } /* which = 0 means draw old sample, which = 1 means draw new */ static void color_sample_draw_sample (Gcolor3ColorSelection *colorsel, int which, cairo_t *cr) { GtkWidget *da; gint x, y, goff; Gcolor3ColorSelectionPrivate *priv; int width, height; g_return_if_fail (colorsel != NULL); priv = colorsel->private_data; g_return_if_fail (priv->sample_area != NULL); if (!gtk_widget_is_drawable (priv->sample_area)) return; if (which == 0) { da = priv->old_sample; goff = 0; } else { GtkAllocation old_sample_allocation; da = priv->cur_sample; gtk_widget_get_allocation (priv->old_sample, &old_sample_allocation); goff = old_sample_allocation.width % 32; } /* Below needs tweaking for non-power-of-two */ width = gtk_widget_get_allocated_width (da); height = gtk_widget_get_allocated_height (da); if (priv->has_opacity) { /* Draw checks in background */ cairo_set_source_rgb (cr, 0.5, 0.5, 0.5); cairo_rectangle (cr, 0, 0, width, height); cairo_fill (cr); cairo_set_source_rgb (cr, 0.75, 0.75, 0.75); for (x = goff & -CHECK_SIZE; x < goff + width; x += CHECK_SIZE) for (y = 0; y < height; y += CHECK_SIZE) if ((x / CHECK_SIZE + y / CHECK_SIZE) % 2 == 0) cairo_rectangle (cr, x - goff, y, CHECK_SIZE, CHECK_SIZE); cairo_fill (cr); } if (which == 0) { cairo_set_source_rgba (cr, priv->old_color[COLORSEL_RED], priv->old_color[COLORSEL_GREEN], priv->old_color[COLORSEL_BLUE], priv->has_opacity ? priv->old_color[COLORSEL_OPACITY] : 1.0); } else { cairo_set_source_rgba (cr, priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], priv->has_opacity ? priv->color[COLORSEL_OPACITY] : 1.0); } cairo_rectangle (cr, 0, 0, width, height); cairo_fill (cr); } static void color_sample_update_samples (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; gtk_widget_queue_draw (priv->old_sample); gtk_widget_queue_draw (priv->cur_sample); } static gboolean color_old_sample_draw (UNUSED GtkWidget *da, cairo_t *cr, Gcolor3ColorSelection *colorsel) { color_sample_draw_sample (colorsel, 0, cr); return FALSE; } static gboolean color_cur_sample_draw (UNUSED GtkWidget *da, cairo_t *cr, Gcolor3ColorSelection *colorsel) { color_sample_draw_sample (colorsel, 1, cr); return FALSE; } static void color_sample_setup_dnd (Gcolor3ColorSelection *colorsel, GtkWidget *sample) { static const GtkTargetEntry targets[] = { { "application/x-color", 0 } }; Gcolor3ColorSelectionPrivate *priv; priv = colorsel->private_data; gtk_drag_source_set (sample, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK, targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); g_signal_connect (sample, "drag-begin", G_CALLBACK (color_sample_drag_begin), colorsel); if (sample == priv->cur_sample) { gtk_drag_dest_set (sample, GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, targets, 1, GDK_ACTION_COPY); g_signal_connect (sample, "drag-end", G_CALLBACK (color_sample_drag_end), colorsel); } g_signal_connect (sample, "drag-data-get", G_CALLBACK (color_sample_drag_handle), colorsel); g_signal_connect (sample, "drag-data-received", G_CALLBACK (color_sample_drop_handle), colorsel); } static void update_tooltips (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; priv = colorsel->private_data; if (priv->has_palette == TRUE) { gtk_widget_set_tooltip_text (priv->old_sample, _("The previously-selected color, for comparison to the color " "you’re selecting now. You can drag this color to a palette " "entry, or select this color as current by dragging it to the " "other color swatch alongside.")); gtk_widget_set_tooltip_text (priv->cur_sample, _("The color you’ve chosen. You can drag this color to a palette " "entry to save it for use in the future.")); } else { gtk_widget_set_tooltip_text (priv->old_sample, _("The previously-selected color, for comparison to the color " "you’re selecting now.")); gtk_widget_set_tooltip_text (priv->cur_sample, _("The color you’ve chosen.")); } } static void color_sample_new (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; priv = colorsel->private_data; priv->sample_area = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); priv->old_sample = gtk_drawing_area_new (); priv->cur_sample = gtk_drawing_area_new (); gtk_box_pack_start (GTK_BOX (priv->sample_area), priv->old_sample, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (priv->sample_area), priv->cur_sample, TRUE, TRUE, 0); g_signal_connect (priv->old_sample, "draw", G_CALLBACK (color_old_sample_draw), colorsel); g_signal_connect (priv->cur_sample, "draw", G_CALLBACK (color_cur_sample_draw), colorsel); color_sample_setup_dnd (colorsel, priv->old_sample); color_sample_setup_dnd (colorsel, priv->cur_sample); update_tooltips (colorsel); gtk_widget_show_all (priv->sample_area); } /* The palette area code */ static void palette_get_color (GtkWidget *drawing_area, gdouble *color) { gdouble *color_val; g_return_if_fail (color != NULL); color_val = g_object_get_data (G_OBJECT (drawing_area), "color_val"); if (color_val == NULL) { /* Default to white for no good reason */ color[0] = 1.0; color[1] = 1.0; color[2] = 1.0; color[3] = 1.0; return; } color[0] = color_val[0]; color[1] = color_val[1]; color[2] = color_val[2]; color[3] = 1.0; } static gboolean palette_draw (GtkWidget *drawing_area, cairo_t *cr, UNUSED gpointer data) { GtkStyleContext *context; gint focus_width; GdkRGBA color; context = gtk_widget_get_style_context (drawing_area); gtk_style_context_get_background_color (context, 0, &color); gdk_cairo_set_source_rgba (cr, &color); cairo_paint (cr); if (gtk_widget_has_visible_focus (drawing_area)) { set_focus_line_attributes (drawing_area, cr, &focus_width); cairo_rectangle (cr, focus_width / 2., focus_width / 2., gtk_widget_get_allocated_width (drawing_area) - focus_width, gtk_widget_get_allocated_height (drawing_area) - focus_width); cairo_stroke (cr); } return FALSE; } static void set_focus_line_attributes (GtkWidget *drawing_area, cairo_t *cr, gint *focus_width) { gdouble color[4]; gint8 *dash_list; gtk_widget_style_get (drawing_area, "focus-line-width", focus_width, "focus-line-pattern", (gchar *)&dash_list, NULL); palette_get_color (drawing_area, color); if (INTENSITY (color[0], color[1], color[2]) > 0.5) cairo_set_source_rgb (cr, 0., 0., 0.); else cairo_set_source_rgb (cr, 1., 1., 1.); cairo_set_line_width (cr, *focus_width); if (dash_list[0]) { gint n_dashes = strlen ((gchar *)dash_list); gdouble *dashes = g_new (gdouble, n_dashes); gdouble total_length = 0; gdouble dash_offset; gint i; for (i = 0; i < n_dashes; i++) { dashes[i] = dash_list[i]; total_length += dash_list[i]; } /* The dash offset here aligns the pattern to integer pixels * by starting the dash at the right side of the left border * Negative dash offsets in cairo don't work * (https://bugs.freedesktop.org/show_bug.cgi?id=2729) */ dash_offset = - *focus_width / 2.; while (dash_offset < 0) dash_offset += total_length; cairo_set_dash (cr, dashes, n_dashes, dash_offset); g_free (dashes); } g_free (dash_list); } static void palette_drag_begin (GtkWidget *widget, UNUSED GdkDragContext *context, UNUSED gpointer data) { gdouble colors[4]; palette_get_color (widget, colors); set_color_icon (context, colors); } static void palette_drag_handle (GtkWidget *widget, UNUSED GdkDragContext *context, GtkSelectionData *selection_data, UNUSED guint info, UNUSED guint time, UNUSED gpointer data) { guint16 vals[4]; gdouble colsrc[4]; palette_get_color (widget, colsrc); vals[0] = colsrc[COLORSEL_RED] * 0xffff; vals[1] = colsrc[COLORSEL_GREEN] * 0xffff; vals[2] = colsrc[COLORSEL_BLUE] * 0xffff; vals[3] = 0xffff; gtk_selection_data_set (selection_data, gdk_atom_intern_static_string ("application/x-color"), 16, (guchar *)vals, 8); } static void palette_drag_end (GtkWidget *widget, UNUSED GdkDragContext *context, UNUSED gpointer data) { g_object_set_data (G_OBJECT (widget), I_("gtk-color-selection-drag-window"), NULL); } static GdkRGBA * get_current_colors (Gcolor3ColorSelection *colorsel) { GtkSettings *settings; GdkRGBA *colors = NULL; gint n_colors = 0; gchar *palette; settings = gtk_widget_get_settings (GTK_WIDGET (colorsel)); g_object_get (settings, "gtk-color-palette", &palette, NULL); if (!gcolor3_color_selection_palette_from_string (palette, &colors, &n_colors)) { gcolor3_color_selection_palette_from_string (DEFAULT_COLOR_PALETTE, &colors, &n_colors); } else { /* If there are less colors provided than the number of slots in the * color selection, we fill in the rest from the defaults. */ if (n_colors < (CUSTOM_PALETTE_WIDTH * CUSTOM_PALETTE_HEIGHT)) { GdkRGBA *tmp_colors = colors; gint tmp_n_colors = n_colors; gcolor3_color_selection_palette_from_string (DEFAULT_COLOR_PALETTE, &colors, &n_colors); memcpy (colors, tmp_colors, sizeof (GdkRGBA) * tmp_n_colors); g_free (tmp_colors); } } /* make sure that we fill every slot */ g_assert (n_colors == CUSTOM_PALETTE_WIDTH * CUSTOM_PALETTE_HEIGHT); g_free (palette); return colors; } /* Changes the model color */ static void palette_change_color (GtkWidget *drawing_area, Gcolor3ColorSelection *colorsel, gdouble *color) { gint x, y; Gcolor3ColorSelectionPrivate *priv; GdkRGBA gdk_color; GdkRGBA *current_colors; GdkScreen *screen; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (GTK_IS_DRAWING_AREA (drawing_area)); priv = colorsel->private_data; gdk_color.red = color[0]; gdk_color.green = color[1]; gdk_color.blue = color[2]; x = 0; y = 0; /* Quiet GCC */ while (x < CUSTOM_PALETTE_WIDTH) { y = 0; while (y < CUSTOM_PALETTE_HEIGHT) { if (priv->custom_palette[x][y] == drawing_area) goto out; ++y; } ++x; } out: g_assert (x < CUSTOM_PALETTE_WIDTH || y < CUSTOM_PALETTE_HEIGHT); current_colors = get_current_colors (colorsel); current_colors[y * CUSTOM_PALETTE_WIDTH + x] = gdk_color; screen = gtk_widget_get_screen (GTK_WIDGET (colorsel)); if (change_palette_hook != default_change_palette_func) (* change_palette_hook) (screen, current_colors, CUSTOM_PALETTE_WIDTH * CUSTOM_PALETTE_HEIGHT); else if (noscreen_change_palette_hook != default_noscreen_change_palette_func) { if (screen != gdk_screen_get_default ()) g_warning ("gcolor3_color_selection_set_change_palette_hook used by " "widget is not on the default screen."); (* noscreen_change_palette_hook) (current_colors, CUSTOM_PALETTE_WIDTH * CUSTOM_PALETTE_HEIGHT); } else (* change_palette_hook) (screen, current_colors, CUSTOM_PALETTE_WIDTH * CUSTOM_PALETTE_HEIGHT); g_free (current_colors); } /* Changes the view color */ static void palette_set_color (GtkWidget *drawing_area, Gcolor3ColorSelection *colorsel, gdouble *color) { gdouble *new_color = g_new (double, 4); GdkRGBA rgba; rgba.red = color[0]; rgba.green = color[1]; rgba.blue = color[2]; rgba.alpha = 1; gtk_widget_override_background_color (drawing_area, GTK_STATE_FLAG_NORMAL, &rgba); if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drawing_area), "color_set")) == 0) { static const GtkTargetEntry targets[] = { { "application/x-color", 0 } }; gtk_drag_source_set (drawing_area, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK, targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); g_signal_connect (drawing_area, "drag-begin", G_CALLBACK (palette_drag_begin), colorsel); g_signal_connect (drawing_area, "drag-data-get", G_CALLBACK (palette_drag_handle), colorsel); g_object_set_data (G_OBJECT (drawing_area), I_("color_set"), GINT_TO_POINTER (1)); } new_color[0] = color[0]; new_color[1] = color[1]; new_color[2] = color[2]; new_color[3] = 1.0; g_object_set_data_full (G_OBJECT (drawing_area), I_("color_val"), new_color, (GDestroyNotify)g_free); } static void save_color_selected (UNUSED GtkWidget *menuitem, gpointer data) { Gcolor3ColorSelection *colorsel; GtkWidget *drawing_area; Gcolor3ColorSelectionPrivate *priv; drawing_area = GTK_WIDGET (data); colorsel = GCOLOR3_COLOR_SELECTION (g_object_get_data (G_OBJECT (drawing_area), "gtk-color-sel")); priv = colorsel->private_data; palette_change_color (drawing_area, colorsel, priv->color); } static void do_popup (Gcolor3ColorSelection *colorsel, GtkWidget *drawing_area, const GdkEvent *trigger_event) { GtkWidget *menu; GtkWidget *mi; g_object_set_data (G_OBJECT (drawing_area), I_("gtk-color-sel"), colorsel); menu = gtk_menu_new (); g_signal_connect (menu, "hide", G_CALLBACK (gtk_widget_destroy), NULL); mi = gtk_menu_item_new_with_mnemonic (_("_Save color here")); g_signal_connect (mi, "activate", G_CALLBACK (save_color_selected), drawing_area); gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); gtk_widget_show_all (mi); if (trigger_event && gdk_event_triggers_context_menu (trigger_event)) gtk_menu_popup_at_pointer (GTK_MENU (menu), trigger_event); else gtk_menu_popup_at_widget (GTK_MENU (menu), drawing_area, GDK_GRAVITY_CENTER, GDK_GRAVITY_NORTH_WEST, trigger_event); } static gboolean palette_enter (GtkWidget *drawing_area, UNUSED GdkEventCrossing *event, UNUSED gpointer data) { g_object_set_data (G_OBJECT (drawing_area), I_("gtk-colorsel-have-pointer"), GUINT_TO_POINTER (TRUE)); return FALSE; } static gboolean palette_leave (GtkWidget *drawing_area, UNUSED GdkEventCrossing *event, UNUSED gpointer data) { g_object_set_data (G_OBJECT (drawing_area), I_("gtk-colorsel-have-pointer"), NULL); return FALSE; } static gboolean palette_press (GtkWidget *drawing_area, GdkEventButton *event, gpointer data) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (data); gtk_widget_grab_focus (drawing_area); if (gdk_event_triggers_context_menu ((GdkEvent *) event)) { do_popup (colorsel, drawing_area, (GdkEvent *) event); return TRUE; } return FALSE; } static gboolean palette_release (GtkWidget *drawing_area, GdkEventButton *event, gpointer data) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (data); gtk_widget_grab_focus (drawing_area); if (event->button == GDK_BUTTON_PRIMARY && g_object_get_data (G_OBJECT (drawing_area), "gtk-colorsel-have-pointer") != NULL) { if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drawing_area), "color_set")) != 0) { gdouble color[4]; palette_get_color (drawing_area, color); set_color_internal (colorsel, color); } } return FALSE; } static void palette_drop_handle (GtkWidget *widget, UNUSED GdkDragContext *context, UNUSED gint x, UNUSED gint y, GtkSelectionData *selection_data, UNUSED guint info, UNUSED guint time, gpointer data) { Gcolor3ColorSelection *colorsel = GCOLOR3_COLOR_SELECTION (data); gint length; guint16 *vals; gdouble color[4]; length = gtk_selection_data_get_length (selection_data); if (length < 0) return; /* We accept drops with the wrong format, since the KDE color * chooser incorrectly drops application/x-color with format 8. */ if (length != 8) { g_warning ("Received invalid color data"); return; } vals = (guint16 *) gtk_selection_data_get_data (selection_data); color[0] = (gdouble)vals[0] / 0xffff; color[1] = (gdouble)vals[1] / 0xffff; color[2] = (gdouble)vals[2] / 0xffff; color[3] = (gdouble)vals[3] / 0xffff; palette_change_color (widget, colorsel, color); set_color_internal (colorsel, color); } static gint palette_activate (GtkWidget *widget, GdkEventKey *event, gpointer data) { /* should have a drawing area subclass with an activate signal */ if ((event->keyval == GDK_KEY_space) || (event->keyval == GDK_KEY_Return) || (event->keyval == GDK_KEY_ISO_Enter) || (event->keyval == GDK_KEY_KP_Enter) || (event->keyval == GDK_KEY_KP_Space)) { if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "color_set")) != 0) { gdouble color[4]; palette_get_color (widget, color); set_color_internal (GCOLOR3_COLOR_SELECTION (data), color); } return TRUE; } return FALSE; } static gboolean palette_popup (GtkWidget *widget, gpointer data) { do_popup (data, widget, NULL); return TRUE; } static GtkWidget* palette_new (Gcolor3ColorSelection *colorsel) { GtkWidget *retval; static const GtkTargetEntry targets[] = { { "application/x-color", 0 } }; retval = gtk_drawing_area_new (); gtk_widget_set_can_focus (retval, TRUE); g_object_set_data (G_OBJECT (retval), I_("color_set"), GINT_TO_POINTER (0)); gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); g_signal_connect (retval, "draw", G_CALLBACK (palette_draw), colorsel); g_signal_connect (retval, "button-press-event", G_CALLBACK (palette_press), colorsel); g_signal_connect (retval, "button-release-event", G_CALLBACK (palette_release), colorsel); g_signal_connect (retval, "enter-notify-event", G_CALLBACK (palette_enter), colorsel); g_signal_connect (retval, "leave-notify-event", G_CALLBACK (palette_leave), colorsel); g_signal_connect (retval, "key-press-event", G_CALLBACK (palette_activate), colorsel); g_signal_connect (retval, "popup-menu", G_CALLBACK (palette_popup), colorsel); gtk_drag_dest_set (retval, GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, targets, 1, GDK_ACTION_COPY); g_signal_connect (retval, "drag-end", G_CALLBACK (palette_drag_end), NULL); g_signal_connect (retval, "drag-data-received", G_CALLBACK (palette_drop_handle), colorsel); gtk_widget_set_tooltip_text (retval, _("Click this palette entry to make it the current color. " "To change this entry, drag a color swatch here or right-click " "it and select “Save color here.”")); return retval; } /* The actual Gcolor3ColorSelection widget */ static GdkCursor * make_picker_cursor (GdkScreen *screen) { GdkCursor *cursor; cursor = gdk_cursor_new_from_name (gdk_screen_get_display (screen), "color-picker"); if (!cursor) { GdkPixbuf *pixbuf; pixbuf = gdk_pixbuf_new_from_data (dropper_bits, GDK_COLORSPACE_RGB, TRUE, 8, DROPPER_WIDTH, DROPPER_HEIGHT, DROPPER_STRIDE, NULL, NULL); cursor = gdk_cursor_new_from_pixbuf (gdk_screen_get_display (screen), pixbuf, DROPPER_X_HOT, DROPPER_Y_HOT); g_object_unref (pixbuf); } return cursor; } static void grab_color_at_pointer (GdkScreen *screen, GdkDevice *device, gint x_root, gint y_root, gpointer data) { GdkPixbuf *pixbuf; guchar *pixels; Gcolor3ColorSelection *colorsel = data; Gcolor3ColorSelectionPrivate *priv; GdkWindow *root_window = gdk_screen_get_root_window (screen); priv = colorsel->private_data; pixbuf = gdk_pixbuf_get_from_window (root_window, x_root, y_root, 1, 1); if (!pixbuf) { gint x, y; GdkWindow *window = gdk_device_get_window_at_position (device, &x, &y); if (!window) return; pixbuf = gdk_pixbuf_get_from_window (window, x, y, 1, 1); if (!pixbuf) return; } pixels = gdk_pixbuf_get_pixels (pixbuf); priv->color[COLORSEL_RED] = SCALE(pixels[0] * 0x101); priv->color[COLORSEL_GREEN] = SCALE(pixels[1] * 0x101); priv->color[COLORSEL_BLUE] = SCALE(pixels[2] * 0x101); g_object_unref (pixbuf); gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); update_color (colorsel); } static void shutdown_eyedropper (GtkWidget *widget) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; colorsel = GCOLOR3_COLOR_SELECTION (widget); priv = colorsel->private_data; if (priv->has_grab) { gdk_device_ungrab (priv->keyboard_device, priv->grab_time); gdk_device_ungrab (priv->pointer_device, priv->grab_time); gtk_device_grab_remove (priv->dropper_grab_widget, priv->pointer_device); priv->has_grab = FALSE; priv->keyboard_device = NULL; priv->pointer_device = NULL; } } static void mouse_motion (UNUSED GtkWidget *invisible, GdkEventMotion *event, gpointer data) { grab_color_at_pointer (gdk_event_get_screen ((GdkEvent *) event), gdk_event_get_device ((GdkEvent *) event), event->x_root, event->y_root, data); } static gboolean mouse_release (GtkWidget *invisible, GdkEventButton *event, gpointer data) { /* Gcolor3ColorSelection *colorsel = data; */ if (event->button != GDK_BUTTON_PRIMARY) return FALSE; grab_color_at_pointer (gdk_event_get_screen ((GdkEvent *) event), gdk_event_get_device ((GdkEvent *) event), event->x_root, event->y_root, data); shutdown_eyedropper (GTK_WIDGET (data)); g_signal_handlers_disconnect_by_func (invisible, mouse_motion, data); g_signal_handlers_disconnect_by_func (invisible, mouse_release, data); return TRUE; } /* Helper Functions */ static gboolean key_press (GtkWidget *invisible, GdkEventKey *event, gpointer data) { GdkScreen *screen = gdk_event_get_screen ((GdkEvent *) event); GdkDevice *device, *pointer_device; guint state = event->state & gtk_accelerator_get_default_mod_mask (); gint x, y; gint dx, dy; device = gdk_event_get_device ((GdkEvent * ) event); pointer_device = gdk_device_get_associated_device (device); gdk_device_get_position (pointer_device, NULL, &x, &y); dx = 0; dy = 0; switch (event->keyval) { case GDK_KEY_space: case GDK_KEY_Return: case GDK_KEY_ISO_Enter: case GDK_KEY_KP_Enter: case GDK_KEY_KP_Space: grab_color_at_pointer (screen, pointer_device, x, y, data); /* fall through */ case GDK_KEY_Escape: shutdown_eyedropper (data); g_signal_handlers_disconnect_by_func (invisible, mouse_press, data); g_signal_handlers_disconnect_by_func (invisible, key_press, data); return TRUE; case GDK_KEY_Up: case GDK_KEY_KP_Up: dy = state == GDK_MOD1_MASK ? -BIG_STEP : -1; break; case GDK_KEY_Down: case GDK_KEY_KP_Down: dy = state == GDK_MOD1_MASK ? BIG_STEP : 1; break; case GDK_KEY_Left: case GDK_KEY_KP_Left: dx = state == GDK_MOD1_MASK ? -BIG_STEP : -1; break; case GDK_KEY_Right: case GDK_KEY_KP_Right: dx = state == GDK_MOD1_MASK ? BIG_STEP : 1; break; default: return FALSE; } gdk_device_warp (pointer_device, screen, x + dx, y + dy); return TRUE; } static gboolean mouse_press (GtkWidget *invisible, GdkEventButton *event, gpointer data) { if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY) { g_signal_connect (invisible, "motion-notify-event", G_CALLBACK (mouse_motion), data); g_signal_connect (invisible, "button-release-event", G_CALLBACK (mouse_release), data); g_signal_handlers_disconnect_by_func (invisible, mouse_press, data); g_signal_handlers_disconnect_by_func (invisible, key_press, data); return TRUE; } return FALSE; } /* when the button is clicked */ static void get_screen_color (GtkWidget *button) { Gcolor3ColorSelection *colorsel = g_object_get_data (G_OBJECT (button), "COLORSEL"); Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (button)); GdkDevice *device, *keyb_device, *pointer_device; GdkCursor *picker_cursor; GdkGrabStatus grab_status; GdkWindow *window; GtkWidget *grab_widget, *toplevel; guint32 time = gtk_get_current_event_time (); device = gtk_get_current_event_device (); if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) { keyb_device = device; pointer_device = gdk_device_get_associated_device (device); } else { pointer_device = device; keyb_device = gdk_device_get_associated_device (device); } if (priv->dropper_grab_widget == NULL) { grab_widget = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (grab_widget), screen); gtk_window_resize (GTK_WINDOW (grab_widget), 1, 1); gtk_window_move (GTK_WINDOW (grab_widget), -100, -100); gtk_widget_show (grab_widget); gtk_widget_add_events (grab_widget, GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (colorsel)); if (GTK_IS_WINDOW (toplevel)) { if (gtk_window_has_group (GTK_WINDOW (toplevel))) gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), GTK_WINDOW (grab_widget)); } priv->dropper_grab_widget = grab_widget; } window = gtk_widget_get_window (priv->dropper_grab_widget); if (gdk_device_grab (keyb_device, window, GDK_OWNERSHIP_APPLICATION, FALSE, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, NULL, time) != GDK_GRAB_SUCCESS) return; picker_cursor = make_picker_cursor (screen); grab_status = gdk_device_grab (pointer_device, window, GDK_OWNERSHIP_APPLICATION, FALSE, GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK, picker_cursor, time); g_object_unref (picker_cursor); if (grab_status != GDK_GRAB_SUCCESS) { gdk_device_ungrab (keyb_device, time); return; } gtk_device_grab_add (priv->dropper_grab_widget, pointer_device, TRUE); priv->grab_time = time; priv->has_grab = TRUE; priv->keyboard_device = keyb_device; priv->pointer_device = pointer_device; g_signal_connect (priv->dropper_grab_widget, "button-press-event", G_CALLBACK (mouse_press), colorsel); g_signal_connect (priv->dropper_grab_widget, "key-press-event", G_CALLBACK (key_press), colorsel); } static void hex_changed (UNUSED GtkWidget *hex_entry, gpointer data) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; GdkRGBA color; gchar *text; colorsel = GCOLOR3_COLOR_SELECTION (data); priv = colorsel->private_data; if (priv->changing) return; text = gtk_editable_get_chars (GTK_EDITABLE (priv->hex_entry), 0, -1); if (gdk_rgba_parse (&color, text)) { priv->color[COLORSEL_RED] = color.red; priv->color[COLORSEL_GREEN] = color.green; priv->color[COLORSEL_BLUE] = color.blue; gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); update_color (colorsel); } g_free (text); } static gboolean hex_focus_out (GtkWidget *hex_entry, UNUSED GdkEventFocus *event, gpointer data) { hex_changed (hex_entry, data); return FALSE; } static void hsv_changed (GtkWidget *hsv, gpointer data) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; colorsel = GCOLOR3_COLOR_SELECTION (data); priv = colorsel->private_data; if (priv->changing) return; gcolor3_hsv_get_color (GCOLOR3_HSV (hsv), &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); gtk_hsv_to_rgb (priv->color[COLORSEL_HUE], priv->color[COLORSEL_SATURATION], priv->color[COLORSEL_VALUE], &priv->color[COLORSEL_RED], &priv->color[COLORSEL_GREEN], &priv->color[COLORSEL_BLUE]); update_color (colorsel); } static void adjustment_changed (GtkAdjustment *adjustment, gpointer data) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; colorsel = GCOLOR3_COLOR_SELECTION (g_object_get_data (G_OBJECT (adjustment), "COLORSEL")); priv = colorsel->private_data; if (priv->changing) return; switch (GPOINTER_TO_INT (data)) { case COLORSEL_SATURATION: case COLORSEL_VALUE: priv->color[GPOINTER_TO_INT (data)] = gtk_adjustment_get_value (adjustment) / 100; gtk_hsv_to_rgb (priv->color[COLORSEL_HUE], priv->color[COLORSEL_SATURATION], priv->color[COLORSEL_VALUE], &priv->color[COLORSEL_RED], &priv->color[COLORSEL_GREEN], &priv->color[COLORSEL_BLUE]); break; case COLORSEL_HUE: priv->color[GPOINTER_TO_INT (data)] = gtk_adjustment_get_value (adjustment) / 360; gtk_hsv_to_rgb (priv->color[COLORSEL_HUE], priv->color[COLORSEL_SATURATION], priv->color[COLORSEL_VALUE], &priv->color[COLORSEL_RED], &priv->color[COLORSEL_GREEN], &priv->color[COLORSEL_BLUE]); break; case COLORSEL_RED: case COLORSEL_GREEN: case COLORSEL_BLUE: priv->color[GPOINTER_TO_INT (data)] = gtk_adjustment_get_value (adjustment) / 255; gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); break; default: priv->color[GPOINTER_TO_INT (data)] = gtk_adjustment_get_value (adjustment) / 255; break; } update_color (colorsel); } static void opacity_entry_changed (UNUSED GtkWidget *opacity_entry, gpointer data) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; GtkAdjustment *adj; gchar *text; colorsel = GCOLOR3_COLOR_SELECTION (data); priv = colorsel->private_data; if (priv->changing) return; text = gtk_editable_get_chars (GTK_EDITABLE (priv->opacity_entry), 0, -1); adj = gtk_range_get_adjustment (GTK_RANGE (priv->opacity_slider)); gtk_adjustment_set_value (adj, g_strtod (text, NULL)); update_color (colorsel); g_free (text); } static void make_label_spinbutton (Gcolor3ColorSelection *colorsel, GtkWidget **spinbutton, gchar *text, GtkWidget *table, gint i, gint j, gint channel_type, const gchar *tooltip) { GtkWidget *label; GtkAdjustment *adjust; if (channel_type == COLORSEL_HUE) { adjust = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 1.0, 0.0); } else if (channel_type == COLORSEL_SATURATION || channel_type == COLORSEL_VALUE) { adjust = gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 1.0, 0.0); } else { adjust = gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0); } g_object_set_data (G_OBJECT (adjust), I_("COLORSEL"), colorsel); *spinbutton = gtk_spin_button_new (adjust, 10.0, 0); gtk_widget_set_tooltip_text (*spinbutton, tooltip); g_signal_connect (adjust, "value-changed", G_CALLBACK (adjustment_changed), GINT_TO_POINTER (channel_type)); label = gtk_label_new_with_mnemonic (text); gtk_label_set_mnemonic_widget (GTK_LABEL (label), *spinbutton); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_grid_attach (GTK_GRID (table), label, i, j, 1, 1); gtk_grid_attach (GTK_GRID (table), *spinbutton, i+1, j, 1, 1); } static void make_palette_frame (Gcolor3ColorSelection *colorsel, GtkWidget *table, gint i, gint j) { GtkWidget *frame; Gcolor3ColorSelectionPrivate *priv; priv = colorsel->private_data; frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); priv->custom_palette[i][j] = palette_new (colorsel); gtk_widget_set_size_request (priv->custom_palette[i][j], CUSTOM_PALETTE_ENTRY_WIDTH, CUSTOM_PALETTE_ENTRY_HEIGHT); gtk_container_add (GTK_CONTAINER (frame), priv->custom_palette[i][j]); gtk_grid_attach (GTK_GRID (table), frame, i, j, 1, 1); } /* Set the palette entry [x][y] to be the currently selected one. */ static void set_selected_palette (Gcolor3ColorSelection *colorsel, int x, int y) { Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; gtk_widget_grab_focus (priv->custom_palette[x][y]); } static void update_color (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv = colorsel->private_data; gchar entryval[12]; gchar opacity_text[32]; gchar *ptr; priv->changing = TRUE; color_sample_update_samples (colorsel); gcolor3_hsv_set_color (GCOLOR3_HSV (priv->triangle_colorsel), priv->color[COLORSEL_HUE], priv->color[COLORSEL_SATURATION], priv->color[COLORSEL_VALUE]); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->hue_spinbutton)), scale_round (priv->color[COLORSEL_HUE], 360)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->sat_spinbutton)), scale_round (priv->color[COLORSEL_SATURATION], 100)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->val_spinbutton)), scale_round (priv->color[COLORSEL_VALUE], 100)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->red_spinbutton)), scale_round (priv->color[COLORSEL_RED], 255)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->green_spinbutton)), scale_round (priv->color[COLORSEL_GREEN], 255)); gtk_adjustment_set_value (gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->blue_spinbutton)), scale_round (priv->color[COLORSEL_BLUE], 255)); gtk_adjustment_set_value (gtk_range_get_adjustment (GTK_RANGE (priv->opacity_slider)), scale_round (priv->color[COLORSEL_OPACITY], 255)); g_snprintf (opacity_text, 32, "%.0f", scale_round (priv->color[COLORSEL_OPACITY], 255)); gtk_entry_set_text (GTK_ENTRY (priv->opacity_entry), opacity_text); g_snprintf (entryval, 11, "#%2X%2X%2X", (guint) (scale_round (priv->color[COLORSEL_RED], 255)), (guint) (scale_round (priv->color[COLORSEL_GREEN], 255)), (guint) (scale_round (priv->color[COLORSEL_BLUE], 255))); for (ptr = entryval; *ptr; ptr++) if (*ptr == ' ') *ptr = '0'; gtk_entry_set_text (GTK_ENTRY (priv->hex_entry), entryval); priv->changing = FALSE; g_object_ref (colorsel); g_signal_emit (colorsel, color_selection_signals[COLOR_CHANGED], 0); g_object_freeze_notify (G_OBJECT (colorsel)); g_object_notify (G_OBJECT (colorsel), "current-rgba"); g_object_notify (G_OBJECT (colorsel), "current-alpha"); g_object_thaw_notify (G_OBJECT (colorsel)); g_object_unref (colorsel); } static void update_palette (Gcolor3ColorSelection *colorsel) { GdkRGBA *current_colors; gint i, j; current_colors = get_current_colors (colorsel); for (i = 0; i < CUSTOM_PALETTE_HEIGHT; i++) { for (j = 0; j < CUSTOM_PALETTE_WIDTH; j++) { gint index; index = i * CUSTOM_PALETTE_WIDTH + j; gcolor3_color_selection_set_palette_color (colorsel, index, ¤t_colors[index]); } } g_free (current_colors); } static void palette_change_notify_instance (UNUSED GObject *object, UNUSED GParamSpec *pspec, gpointer data) { update_palette (GCOLOR3_COLOR_SELECTION (data)); } static void default_noscreen_change_palette_func (const GdkRGBA *colors, gint n_colors) { default_change_palette_func (gdk_screen_get_default (), colors, n_colors); } static void default_change_palette_func (GdkScreen *screen, const GdkRGBA *colors, gint n_colors) { gchar *str; str = gcolor3_color_selection_palette_to_string (colors, n_colors); gtk_settings_set_string_property (gtk_settings_get_for_screen (screen), "gtk-color-palette", str, "gcolor3_color_selection_palette_to_string"); g_free (str); } /** * gcolor3_color_selection_new: * * Creates a new Gcolor3ColorSelection. * * Returns: a new #Gcolor3ColorSelection */ GtkWidget * gcolor3_color_selection_new (void) { Gcolor3ColorSelection *colorsel; Gcolor3ColorSelectionPrivate *priv; gdouble color[4]; color[0] = 1.0; color[1] = 1.0; color[2] = 1.0; color[3] = 1.0; colorsel = g_object_new (GCOLOR3_TYPE_COLOR_SELECTION, NULL); priv = colorsel->private_data; set_color_internal (colorsel, color); gcolor3_color_selection_set_has_opacity_control (colorsel, TRUE); /* We want to make sure that default_set is FALSE. * This way the user can still set it. */ priv->default_set = FALSE; priv->default_alpha_set = FALSE; return GTK_WIDGET (colorsel); } /** * gcolor3_color_selection_get_has_opacity_control: * @colorsel: a #Gcolor3ColorSelection * * Determines whether the colorsel has an opacity control. * * Returns: %TRUE if the @colorsel has an opacity control, * %FALSE if it does't */ gboolean gcolor3_color_selection_get_has_opacity_control (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel), FALSE); priv = colorsel->private_data; return priv->has_opacity; } /** * gcolor3_color_selection_set_has_opacity_control: * @colorsel: a #Gcolor3ColorSelection * @has_opacity: %TRUE if @colorsel can set the opacity, %FALSE otherwise * * Sets the @colorsel to use or not use opacity. */ void gcolor3_color_selection_set_has_opacity_control (Gcolor3ColorSelection *colorsel, gboolean has_opacity) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); priv = colorsel->private_data; has_opacity = has_opacity != FALSE; if (priv->has_opacity != has_opacity) { priv->has_opacity = has_opacity; if (has_opacity) { gtk_widget_show (priv->opacity_slider); gtk_widget_show (priv->opacity_label); gtk_widget_show (priv->opacity_entry); } else { gtk_widget_hide (priv->opacity_slider); gtk_widget_hide (priv->opacity_label); gtk_widget_hide (priv->opacity_entry); } color_sample_update_samples (colorsel); g_object_notify (G_OBJECT (colorsel), "has-opacity-control"); } } /** * gcolor3_color_selection_get_has_palette: * @colorsel: a #Gcolor3ColorSelection * * Determines whether the color selector has a color palette. * * Returns: %TRUE if the selector has a palette, %FALSE if it hasn't */ gboolean gcolor3_color_selection_get_has_palette (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel), FALSE); priv = colorsel->private_data; return priv->has_palette; } /** * gcolor3_color_selection_set_has_palette: * @colorsel: a #Gcolor3ColorSelection * @has_palette: %TRUE if palette is to be visible, %FALSE otherwise * * Shows and hides the palette based upon the value of @has_palette. */ void gcolor3_color_selection_set_has_palette (Gcolor3ColorSelection *colorsel, gboolean has_palette) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); priv = colorsel->private_data; has_palette = has_palette != FALSE; if (priv->has_palette != has_palette) { priv->has_palette = has_palette; if (has_palette) gtk_widget_show (priv->palette_frame); else gtk_widget_hide (priv->palette_frame); update_tooltips (colorsel); g_object_notify (G_OBJECT (colorsel), "has-palette"); } } /** * gcolor3_color_selection_set_current_color: * @colorsel: a #Gcolor3ColorSelection * @color: a #GdkRGBA to set the current color with * * Sets the current color to be @color. * * The first time this is called, it will also set * the original color to be @color too. */ void gcolor3_color_selection_set_current_color (Gcolor3ColorSelection *colorsel, const GdkRGBA *color) { Gcolor3ColorSelectionPrivate *priv; gint i; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (color != NULL); priv = colorsel->private_data; priv->changing = TRUE; priv->color[COLORSEL_RED] = color->red; priv->color[COLORSEL_GREEN] = color->green; priv->color[COLORSEL_BLUE] = color->blue; gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); if (priv->default_set == FALSE) { for (i = 0; i < COLORSEL_NUM_CHANNELS; i++) priv->old_color[i] = priv->color[i]; } priv->default_set = TRUE; update_color (colorsel); } /** * gcolor3_color_selection_set_current_alpha: * @colorsel: a #Gcolor3ColorSelection * @alpha: an integer between 0 and 65535 * * Sets the current opacity to be @alpha. * * The first time this is called, it will also set * the original opacity to be @alpha too. */ // FIXME: this can possibly be removed, together with all special alpha treatment. void gcolor3_color_selection_set_current_alpha (Gcolor3ColorSelection *colorsel, guint16 alpha) { Gcolor3ColorSelectionPrivate *priv; gint i; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); priv = colorsel->private_data; priv->changing = TRUE; priv->color[COLORSEL_OPACITY] = SCALE (alpha); if (priv->default_alpha_set == FALSE) { for (i = 0; i < COLORSEL_NUM_CHANNELS; i++) priv->old_color[i] = priv->color[i]; } priv->default_alpha_set = TRUE; update_color (colorsel); } /** * gcolor3_color_selection_get_current_color: * @colorsel: a #Gcolor3ColorSelection * @color: (out): a #GdkRGBA to fill in with the current color * * Sets @color to be the current color in the Gcolor3ColorSelection widget. */ void gcolor3_color_selection_get_current_color (Gcolor3ColorSelection *colorsel, GdkRGBA *color) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (color != NULL); priv = colorsel->private_data; color->red = priv->color[COLORSEL_RED]; color->green = priv->color[COLORSEL_GREEN]; color->blue = priv->color[COLORSEL_BLUE]; } /** * gcolor3_color_selection_get_current_alpha: * @colorsel: a #Gcolor3ColorSelection * * Returns the current alpha value. * * Returns: an integer between 0 and 65535 */ guint16 gcolor3_color_selection_get_current_alpha (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel), 0); priv = colorsel->private_data; return priv->has_opacity ? UNSCALE (priv->color[COLORSEL_OPACITY]) : 65535; } /** * gcolor3_color_selection_set_previous_color: * @colorsel: a #Gcolor3ColorSelection * @color: a #GdkRGBA to set the previous color with * * Sets the “previous” color to be @color. * * This function should be called with some hesitations, * as it might seem confusing to have that color change. * Calling gcolor3_color_selection_set_current_color() will also * set this color the first time it is called. */ void gcolor3_color_selection_set_previous_color (Gcolor3ColorSelection *colorsel, const GdkRGBA *color) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (color != NULL); priv = colorsel->private_data; priv->changing = TRUE; priv->old_color[COLORSEL_RED] = color->red; priv->old_color[COLORSEL_GREEN] = color->green; priv->old_color[COLORSEL_BLUE] = color->blue; gtk_rgb_to_hsv (priv->old_color[COLORSEL_RED], priv->old_color[COLORSEL_GREEN], priv->old_color[COLORSEL_BLUE], &priv->old_color[COLORSEL_HUE], &priv->old_color[COLORSEL_SATURATION], &priv->old_color[COLORSEL_VALUE]); color_sample_update_samples (colorsel); priv->default_set = TRUE; priv->changing = FALSE; } /** * gcolor3_color_selection_set_previous_alpha: * @colorsel: a #Gcolor3ColorSelection * @alpha: an integer between 0 and 65535 * * Sets the “previous” alpha to be @alpha. * * This function should be called with some hesitations, * as it might seem confusing to have that alpha change. */ void gcolor3_color_selection_set_previous_alpha (Gcolor3ColorSelection *colorsel, guint16 alpha) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); priv = colorsel->private_data; priv->changing = TRUE; priv->old_color[COLORSEL_OPACITY] = SCALE (alpha); color_sample_update_samples (colorsel); priv->default_alpha_set = TRUE; priv->changing = FALSE; } /** * gcolor3_color_selection_get_previous_color: * @colorsel: a #Gcolor3ColorSelection * @color: (out): a #GdkRGBA to fill in with the original color value * * Fills @color in with the original color value. */ void gcolor3_color_selection_get_previous_color (Gcolor3ColorSelection *colorsel, GdkRGBA *color) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (color != NULL); priv = colorsel->private_data; color->red = priv->old_color[COLORSEL_RED]; color->green = priv->old_color[COLORSEL_GREEN]; color->blue = priv->old_color[COLORSEL_BLUE]; } /** * gcolor3_color_selection_get_previous_alpha: * @colorsel: a #Gcolor3ColorSelection * * Returns the previous alpha value. * * Returns: an integer between 0 and 65535 */ guint16 gcolor3_color_selection_get_previous_alpha (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel), 0); priv = colorsel->private_data; return priv->has_opacity ? UNSCALE (priv->old_color[COLORSEL_OPACITY]) : 65535; } /** * gcolor3_color_selection_set_current_rgba: * @colorsel: a #Gcolor3ColorSelection * @rgba: A #GdkRGBA to set the current color with * * Sets the current color to be @rgba. * * The first time this is called, it will also set * the original color to be @rgba too. * * Since: 3.0 */ void gcolor3_color_selection_set_current_rgba (Gcolor3ColorSelection *colorsel, const GdkRGBA *rgba) { Gcolor3ColorSelectionPrivate *priv; gint i; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (rgba != NULL); priv = colorsel->private_data; priv->changing = TRUE; priv->color[COLORSEL_RED] = CLAMP (rgba->red, 0, 1); priv->color[COLORSEL_GREEN] = CLAMP (rgba->green, 0, 1); priv->color[COLORSEL_BLUE] = CLAMP (rgba->blue, 0, 1); priv->color[COLORSEL_OPACITY] = CLAMP (rgba->alpha, 0, 1); gtk_rgb_to_hsv (priv->color[COLORSEL_RED], priv->color[COLORSEL_GREEN], priv->color[COLORSEL_BLUE], &priv->color[COLORSEL_HUE], &priv->color[COLORSEL_SATURATION], &priv->color[COLORSEL_VALUE]); if (priv->default_set == FALSE) { for (i = 0; i < COLORSEL_NUM_CHANNELS; i++) priv->old_color[i] = priv->color[i]; } priv->default_set = TRUE; update_color (colorsel); } /** * gcolor3_color_selection_get_current_rgba: * @colorsel: a #Gcolor3ColorSelection * @rgba: (out): a #GdkRGBA to fill in with the current color * * Sets @rgba to be the current color in the Gcolor3ColorSelection widget. * * Since: 3.0 */ void gcolor3_color_selection_get_current_rgba (Gcolor3ColorSelection *colorsel, GdkRGBA *rgba) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (rgba != NULL); priv = colorsel->private_data; rgba->red = priv->color[COLORSEL_RED]; rgba->green = priv->color[COLORSEL_GREEN]; rgba->blue = priv->color[COLORSEL_BLUE]; rgba->alpha = (priv->has_opacity) ? priv->color[COLORSEL_OPACITY] : 1; } /** * gcolor3_color_selection_set_previous_rgba: * @colorsel: a #Gcolor3ColorSelection * @rgba: a #GdkRGBA to set the previous color with * * Sets the “previous” color to be @rgba. * * This function should be called with some hesitations, * as it might seem confusing to have that color change. * Calling gcolor3_color_selection_set_current_rgba() will also * set this color the first time it is called. * * Since: 3.0 */ void gcolor3_color_selection_set_previous_rgba (Gcolor3ColorSelection *colorsel, const GdkRGBA *rgba) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (rgba != NULL); priv = colorsel->private_data; priv->changing = TRUE; priv->old_color[COLORSEL_RED] = CLAMP (rgba->red, 0, 1); priv->old_color[COLORSEL_GREEN] = CLAMP (rgba->green, 0, 1); priv->old_color[COLORSEL_BLUE] = CLAMP (rgba->blue, 0, 1); priv->old_color[COLORSEL_OPACITY] = CLAMP (rgba->alpha, 0, 1); gtk_rgb_to_hsv (priv->old_color[COLORSEL_RED], priv->old_color[COLORSEL_GREEN], priv->old_color[COLORSEL_BLUE], &priv->old_color[COLORSEL_HUE], &priv->old_color[COLORSEL_SATURATION], &priv->old_color[COLORSEL_VALUE]); color_sample_update_samples (colorsel); priv->default_set = TRUE; priv->changing = FALSE; } /** * gcolor3_color_selection_get_previous_rgba: * @colorsel: a #Gcolor3ColorSelection * @rgba: (out): a #GdkRGBA to fill in with the original color value * * Fills @rgba in with the original color value. * * Since: 3.0 */ void gcolor3_color_selection_get_previous_rgba (Gcolor3ColorSelection *colorsel, GdkRGBA *rgba) { Gcolor3ColorSelectionPrivate *priv; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (rgba != NULL); priv = colorsel->private_data; rgba->red = priv->old_color[COLORSEL_RED]; rgba->green = priv->old_color[COLORSEL_GREEN]; rgba->blue = priv->old_color[COLORSEL_BLUE]; rgba->alpha = (priv->has_opacity) ? priv->old_color[COLORSEL_OPACITY] : 1; } /** * gcolor3_color_selection_set_palette_color: * @colorsel: a #Gcolor3ColorSelection * @index: the color index of the palette * @color: A #GdkRGBA to set the palette with * * Sets the palette located at @index to have @color as its color. */ static void gcolor3_color_selection_set_palette_color (Gcolor3ColorSelection *colorsel, gint index, GdkRGBA *color) { Gcolor3ColorSelectionPrivate *priv; gint x, y; gdouble col[3]; g_return_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel)); g_return_if_fail (index >= 0 && index < CUSTOM_PALETTE_WIDTH*CUSTOM_PALETTE_HEIGHT); x = index % CUSTOM_PALETTE_WIDTH; y = index / CUSTOM_PALETTE_WIDTH; priv = colorsel->private_data; col[0] = color->red; col[1] = color->green; col[2] = color->blue; palette_set_color (priv->custom_palette[x][y], colorsel, col); } /** * gcolor3_color_selection_is_adjusting: * @colorsel: a #Gcolor3ColorSelection * * Gets the current state of the @colorsel. * * Returns: %TRUE if the user is currently dragging * a color around, and %FALSE if the selection has stopped */ gboolean gcolor3_color_selection_is_adjusting (Gcolor3ColorSelection *colorsel) { Gcolor3ColorSelectionPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_COLOR_SELECTION (colorsel), FALSE); priv = colorsel->private_data; return (gcolor3_hsv_is_adjusting (GCOLOR3_HSV (priv->triangle_colorsel))); } /** * gcolor3_color_selection_palette_from_string: * @str: a string encoding a color palette * @colors: (out) (array length=n_colors): return location for * allocated array of #GdkRGBA * @n_colors: return location for length of array * * Parses a color palette string; the string is a colon-separated * list of color names readable by gdk_rgba_parse(). * * Returns: %TRUE if a palette was successfully parsed */ gboolean gcolor3_color_selection_palette_from_string (const gchar *str, GdkRGBA **colors, gint *n_colors) { GdkRGBA *retval; gint count; gchar *p; gchar *start; gchar *copy; count = 0; retval = NULL; copy = g_strdup (str); start = copy; p = copy; while (TRUE) { if (*p == ':' || *p == '\0') { gboolean done = TRUE; if (start == p) { goto failed; /* empty entry */ } if (*p) { *p = '\0'; done = FALSE; } retval = g_renew (GdkRGBA, retval, count + 1); if (!gdk_rgba_parse (retval + count, start)) { goto failed; } ++count; if (done) break; else start = p + 1; } ++p; } g_free (copy); if (colors) *colors = retval; else g_free (retval); if (n_colors) *n_colors = count; return TRUE; failed: g_free (copy); g_free (retval); if (colors) *colors = NULL; if (n_colors) *n_colors = 0; return FALSE; } /** * gcolor3_color_selection_palette_to_string: * @colors: (array length=n_colors): an array of colors * @n_colors: length of the array * * Encodes a palette as a string, useful for persistent storage. * * Returns: allocated string encoding the palette */ gchar* gcolor3_color_selection_palette_to_string (const GdkRGBA *colors, gint n_colors) { gint i; gchar **strs = NULL; gchar *retval; if (n_colors == 0) return g_strdup (""); strs = g_new0 (gchar*, n_colors + 1); i = 0; while (i < n_colors) { gchar *ptr; strs[i] = g_strdup_printf ("#%2X%2X%2X", (unsigned int) colors[i].red / 256, (unsigned int) colors[i].green / 256, (unsigned int) colors[i].blue / 256); for (ptr = strs[i]; *ptr; ptr++) if (*ptr == ' ') *ptr = '0'; ++i; } retval = g_strjoinv (":", strs); g_strfreev (strs); return retval; } /** * gcolor3_color_selection_set_change_palette_with_screen_hook: (skip) * @func: a function to call when the custom palette needs saving * * Installs a global function to be called whenever the user * tries to modify the palette in a color selection. * * This function should save the new palette contents, and update * the #GtkSettings:gtk-color-palette GtkSettings property so all * Gcolor3ColorSelection widgets will be modified. * * Returns: the previous change palette hook (that was replaced) * * Since: 2.2 */ Gcolor3ColorSelectionChangePaletteWithScreenFunc gcolor3_color_selection_set_change_palette_with_screen_hook (Gcolor3ColorSelectionChangePaletteWithScreenFunc func) { Gcolor3ColorSelectionChangePaletteWithScreenFunc old; old = change_palette_hook; change_palette_hook = func; return old; } static void make_control_relations (AtkObject *atk_obj, GtkWidget *widget) { AtkObject *obj; obj = gtk_widget_get_accessible (widget); atk_object_add_relationship (atk_obj, ATK_RELATION_CONTROLLED_BY, obj); atk_object_add_relationship (obj, ATK_RELATION_CONTROLLER_FOR, atk_obj); } static void make_all_relations (AtkObject *atk_obj, Gcolor3ColorSelectionPrivate *priv) { make_control_relations (atk_obj, priv->hue_spinbutton); make_control_relations (atk_obj, priv->sat_spinbutton); make_control_relations (atk_obj, priv->val_spinbutton); make_control_relations (atk_obj, priv->red_spinbutton); make_control_relations (atk_obj, priv->green_spinbutton); make_control_relations (atk_obj, priv->blue_spinbutton); } gcolor3-2.3.1/src/gcolor3-color-selection.h000066400000000000000000000147201334304176500205060ustar00rootroot00000000000000/* GTK - The GIMP Toolkit * Copyright (C) 2000 Red Hat, Inc. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. * * Updated and adapted for inclusion in Gcolor3 by Jente Hidskes 2017. */ #ifndef __GCOLOR3_COLOR_SELECTION_H__ #define __GCOLOR3_COLOR_SELECTION_H__ #include G_BEGIN_DECLS #define GCOLOR3_TYPE_COLOR_SELECTION (gcolor3_color_selection_get_type ()) #define GCOLOR3_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCOLOR3_TYPE_COLOR_SELECTION, Gcolor3ColorSelection)) #define GCOLOR3_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCOLOR3_TYPE_COLOR_SELECTION, Gcolor3ColorSelectionClass)) #define GCOLOR3_IS_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCOLOR3_TYPE_COLOR_SELECTION)) #define GCOLOR3_IS_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCOLOR3_TYPE_COLOR_SELECTION)) #define GCOLOR3_COLOR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCOLOR3_TYPE_COLOR_SELECTION, Gcolor3ColorSelectionClass)) typedef struct _Gcolor3ColorSelection Gcolor3ColorSelection; typedef struct _Gcolor3ColorSelectionPrivate Gcolor3ColorSelectionPrivate; typedef struct _Gcolor3ColorSelectionClass Gcolor3ColorSelectionClass; /** * Gcolor3ColorSelectionChangePaletteFunc: * @colors: (array length=n_colors): Array of colors * @n_colors: Number of colors in the array */ typedef void (* Gcolor3ColorSelectionChangePaletteFunc) (const GdkRGBA *colors, gint n_colors); /** * Gcolor3ColorSelectionChangePaletteWithScreenFunc: * @screen: * @colors: (array length=n_colors): Array of colors * @n_colors: Number of colors in the array * * Since: 2.2 */ typedef void (* Gcolor3ColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkRGBA *colors, gint n_colors); struct _Gcolor3ColorSelection { GtkBox parent_instance; /*< private >*/ Gcolor3ColorSelectionPrivate *private_data; }; /** * Gcolor3ColorSelectionClass: * @parent_class: The parent class. * @color_changed: */ struct _Gcolor3ColorSelectionClass { GtkBoxClass parent_class; void (*color_changed) (Gcolor3ColorSelection *color_selection); /*< private >*/ /* Padding for future expansion */ void (*_gcolor3_reserved1) (void); void (*_gcolor3_reserved2) (void); void (*_gcolor3_reserved3) (void); void (*_gcolor3_reserved4) (void); }; /* ColorSelection */ GType gcolor3_color_selection_get_type (void) G_GNUC_CONST; GtkWidget *gcolor3_color_selection_new (void); gboolean gcolor3_color_selection_get_has_opacity_control (Gcolor3ColorSelection *colorsel); void gcolor3_color_selection_set_has_opacity_control (Gcolor3ColorSelection *colorsel, gboolean has_opacity); gboolean gcolor3_color_selection_get_has_palette (Gcolor3ColorSelection *colorsel); void gcolor3_color_selection_set_has_palette (Gcolor3ColorSelection *colorsel, gboolean has_palette); void gcolor3_color_selection_set_current_alpha (Gcolor3ColorSelection *colorsel, guint16 alpha); guint16 gcolor3_color_selection_get_current_alpha (Gcolor3ColorSelection *colorsel); void gcolor3_color_selection_set_previous_alpha (Gcolor3ColorSelection *colorsel, guint16 alpha); guint16 gcolor3_color_selection_get_previous_alpha (Gcolor3ColorSelection *colorsel); void gcolor3_color_selection_set_current_rgba (Gcolor3ColorSelection *colorsel, const GdkRGBA *rgba); void gcolor3_color_selection_get_current_rgba (Gcolor3ColorSelection *colorsel, GdkRGBA *rgba); void gcolor3_color_selection_set_previous_rgba (Gcolor3ColorSelection *colorsel, const GdkRGBA *rgba); void gcolor3_color_selection_get_previous_rgba (Gcolor3ColorSelection *colorsel, GdkRGBA *rgba); gboolean gcolor3_color_selection_is_adjusting (Gcolor3ColorSelection *colorsel); gboolean gcolor3_color_selection_palette_from_string (const gchar *str, GdkRGBA **colors, gint *n_colors); gchar* gcolor3_color_selection_palette_to_string (const GdkRGBA *colors, gint n_colors); Gcolor3ColorSelectionChangePaletteWithScreenFunc gcolor3_color_selection_set_change_palette_with_screen_hook (Gcolor3ColorSelectionChangePaletteWithScreenFunc func); void gcolor3_color_selection_set_current_color (Gcolor3ColorSelection *colorsel, const GdkRGBA *color); void gcolor3_color_selection_get_current_color (Gcolor3ColorSelection *colorsel, GdkRGBA *color); void gcolor3_color_selection_set_previous_color (Gcolor3ColorSelection *colorsel, const GdkRGBA *color); void gcolor3_color_selection_get_previous_color (Gcolor3ColorSelection *colorsel, GdkRGBA *color); G_END_DECLS #endif /* __GCOLOR3_COLOR_SELECTION_H__ */ gcolor3-2.3.1/src/gcolor3-color-store.c000066400000000000000000000234201334304176500176450ustar00rootroot00000000000000/* Gcolor3ColorStore * * Copyright (C) 2016 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include "gcolor3-color-item.h" #include "gcolor3-color-store.h" #include "gcolor3-marshalers.h" struct _Gcolor3ColorStorePrivate { GKeyFile *colors; }; static void gcolor3_color_store_iface_init (GListModelInterface *iface); G_DEFINE_TYPE_WITH_CODE (Gcolor3ColorStore, gcolor3_color_store, G_TYPE_OBJECT, G_ADD_PRIVATE (Gcolor3ColorStore) G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gcolor3_color_store_iface_init) ) static inline gchar * get_user_file (void) { return g_build_filename (g_get_user_config_dir (), "gcolor3", "config.ini", NULL); } static inline gchar * get_user_dir (void) { return g_build_filename (g_get_user_config_dir (), "gcolor3", NULL); } static gboolean ensure_user_dir (void) { gchar *dir; int ret; dir = get_user_dir (); ret = g_mkdir_with_parents (dir, 0700); g_free (dir); if (ret < 0) { g_warning (_("Error creating config directory: %s"), g_strerror (errno)); return FALSE; } return TRUE; } static GType gcolor3_color_store_get_item_type (UNUSED GListModel *list) { return G_TYPE_VARIANT; } static guint gcolor3_color_store_get_n_items (GListModel *list) { Gcolor3ColorStorePrivate *priv; GError *error = NULL; gsize n_items; gchar **keys; priv = gcolor3_color_store_get_instance_private (GCOLOR3_COLOR_STORE (list)); if (!(keys = g_key_file_get_keys (priv->colors, "Colors", &n_items, &error))) { g_warning (_("Cannot count number of items: %s\n"), error->message); g_clear_error (&error); return 0; } g_strfreev (keys); return n_items; } static gpointer gcolor3_color_store_get_item (GListModel *list, guint position) { Gcolor3ColorStorePrivate *priv; Gcolor3ColorItem *item; GError *error = NULL; gsize n_items; gchar **keys; gchar *value; priv = gcolor3_color_store_get_instance_private (GCOLOR3_COLOR_STORE (list)); if (!(keys = g_key_file_get_keys (priv->colors, "Colors", &n_items, &error))) { g_warning (_("Cannot read colors: %s\n"), error->message); g_clear_error (&error); // Returning NULL violates an assumption of the interface, // where get_item should never return NULL for an // index that is smaller than the length of the // list. Hence, we return a default value of black. return g_variant_new ("(ss)", "Black", "#000000"); } if (position > n_items) { return NULL; } if (!(value = g_key_file_get_string (priv->colors, "Colors", keys[position], &error))) { g_warning (_("Cannot access color at position %d: %s\n"), position, error->message); g_clear_error (&error); return g_variant_new ("(ss)", "Black", "#000000"); } item = gcolor3_color_item_new (keys[position], value); g_free (value); g_strfreev (keys); return item; } static void gcolor3_color_store_dispose (GObject *object) { Gcolor3ColorStorePrivate *priv; GError *error = NULL; gchar *file; priv = gcolor3_color_store_get_instance_private (GCOLOR3_COLOR_STORE (object)); // TODO: possibly only write to disk if contents changed? file = get_user_file (); if ((ensure_user_dir ()) && !(g_key_file_save_to_file (priv->colors, file, &error))) { g_warning (_("Error writing file: %s"), error->message); g_clear_error (&error); } g_free (file); g_key_file_free (priv->colors); G_OBJECT_CLASS (gcolor3_color_store_parent_class)->dispose (object); } static void gcolor3_color_store_class_init (Gcolor3ColorStoreClass *gcolor3_color_store_class) { GObjectClass *object_class = G_OBJECT_CLASS (gcolor3_color_store_class); object_class->dispose = gcolor3_color_store_dispose; } static void gcolor3_color_store_iface_init (GListModelInterface *iface) { iface->get_item_type = gcolor3_color_store_get_item_type; iface->get_n_items = gcolor3_color_store_get_n_items; iface->get_item = gcolor3_color_store_get_item; } static void gcolor3_color_store_init (Gcolor3ColorStore *store) { Gcolor3ColorStorePrivate *priv; gchar *file; GError *error = NULL; priv = gcolor3_color_store_get_instance_private (store); priv->colors = g_key_file_new (); file = get_user_file (); if (!(g_key_file_load_from_file (priv->colors, file, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &error))) { g_warning (_("Error opening file: %s. Colors likely won't be saved, unless this is the first run"), error->message); g_clear_error (&error); } g_free (file); } Gcolor3ColorStore * gcolor3_color_store_new () { return g_object_new (GCOLOR3_TYPE_COLOR_STORE, NULL); } gboolean gcolor3_color_store_add_color (Gcolor3ColorStore *store, const gchar *key, const gchar *hex) { Gcolor3ColorStorePrivate *priv; GError *error = NULL; gchar **keys; gsize length; g_return_val_if_fail (GCOLOR3_IS_COLOR_STORE (store), FALSE); g_return_val_if_fail (key != NULL && hex != NULL, FALSE); priv = gcolor3_color_store_get_instance_private (store); if (g_key_file_has_key (priv->colors, "Colors", key, NULL)) { g_warning (_("There is already a color named `%s`"), key); return FALSE; } g_key_file_set_string (priv->colors, "Colors", key, hex); if (!(keys = g_key_file_get_keys (priv->colors, "Colors", &length, &error))) { g_warning (_("Cannot locate index of addition: %s. UI won't be updated\n"), error->message); g_clear_error (&error); return TRUE; } for (guint i = 0; i < length; i++) { if (strcmp (keys[i], key) != 0) { continue; } g_list_model_items_changed (G_LIST_MODEL (store), i, 0, 1); break; } g_strfreev (keys); return TRUE; } gboolean gcolor3_color_store_remove_color (Gcolor3ColorStore *store, const gchar *key) { Gcolor3ColorStorePrivate *priv; GError *error = NULL; gchar **keys; gsize length; guint i; g_return_val_if_fail (GCOLOR3_IS_COLOR_STORE (store), FALSE); g_return_val_if_fail (key != NULL, FALSE); priv = gcolor3_color_store_get_instance_private (store); if (!(keys = g_key_file_get_keys (priv->colors, "Colors", &length, &error))) { g_warning (_("Cannot locate index of removal: %s. UI won't be updated\n"), error->message); g_clear_error (&error); return TRUE; } for (i = 0; i < length; i++) { if (strcmp (keys[i], key) != 0) { continue; } break; } g_strfreev (keys); if (!(g_key_file_remove_key (priv->colors, "Colors", key, &error))) { g_warning (_("Error deleting key: %s"), error->message); g_clear_error (&error); return FALSE; } g_list_model_items_changed (G_LIST_MODEL (store), i, 1, 0); return TRUE; } gboolean gcolor3_color_store_rename_color (Gcolor3ColorStore *store, const gchar *old_name, const gchar *new_name) { Gcolor3ColorStorePrivate *priv; gchar *hex; GError *error = NULL; g_return_val_if_fail (GCOLOR3_IS_COLOR_STORE (store), FALSE); g_return_val_if_fail (old_name != NULL && new_name != NULL, FALSE); priv = gcolor3_color_store_get_instance_private (store); if (strlen (new_name) <= 0 || !g_strcmp0 (old_name, new_name)) { return FALSE; } if (!(g_key_file_has_key (priv->colors, "Colors", old_name, NULL))) { g_warning (_("Cannot rename nonexisting color `%s`"), old_name); return FALSE; } if (g_key_file_has_key (priv->colors, "Colors", new_name, NULL)) { g_warning (_("There is already a color named `%s`"), new_name); return FALSE; } if (!(hex = g_key_file_get_string (priv->colors, "Colors", old_name, &error))) { g_warning (_("Cannot retrieve hex value belonging to `%s`: %s"), old_name, error->message); g_clear_error (&error); return FALSE; } if (!(g_key_file_remove_key (priv->colors, "Colors", old_name, &error))) { g_warning (_("Error deleting old name `%s`: %s"), old_name, error->message); g_clear_error (&error); g_free (hex); return FALSE; } g_key_file_set_string (priv->colors, "Colors", new_name, hex); g_free (hex); // TODO: find out position of rename. This is tricky, because // the removal might be in a different spot than the addition, // and the interface expects an in-place update. If we model // this by removing and inserting, the location changes and // this will be reflected in the UI, which is confusing. // g_list_model_items_changed (G_LIST_MODEL (store), x, 0, 0); return TRUE; } void gcolor3_color_store_foreach (Gcolor3ColorStore *store, Gcolor3ColorStoreForeachFunc func, gpointer user_data) { Gcolor3ColorStorePrivate *priv; GError *error = NULL; gchar **keys = NULL; gsize length; g_return_if_fail (GCOLOR3_IS_COLOR_STORE (store)); priv = gcolor3_color_store_get_instance_private (store); if (!(keys = g_key_file_get_keys (priv->colors, "Colors", &length, &error))) { g_warning (_("Error reading keys: %s. This is harmless if this is the first run"), error->message); g_clear_error (&error); return; } for (guint i = 0; i < length; i++) { gchar *value; if (!(value = g_key_file_get_string (priv->colors, "Colors", keys[i], NULL))) { continue; } func (keys[i], value, user_data); g_free (value); } g_strfreev (keys); } gboolean gcolor3_color_store_empty (Gcolor3ColorStore *store) { g_return_val_if_fail (GCOLOR3_IS_COLOR_STORE (store), TRUE); return gcolor3_color_store_get_n_items (G_LIST_MODEL (store)) == 0; } gcolor3-2.3.1/src/gcolor3-color-store.h000066400000000000000000000055171334304176500176610ustar00rootroot00000000000000/* Gcolor3ColorStore * * Copyright (C) 2016 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_COLOR_STORE_H__ #define __GCOLOR3_COLOR_STORE_H__ #include #include G_BEGIN_DECLS typedef struct _Gcolor3ColorStore Gcolor3ColorStore; typedef struct _Gcolor3ColorStoreClass Gcolor3ColorStoreClass; typedef struct _Gcolor3ColorStorePrivate Gcolor3ColorStorePrivate; typedef void (*Gcolor3ColorStoreForeachFunc) (const gchar *key, const gchar *hex, gpointer user_data); #define GCOLOR3_TYPE_COLOR_STORE (gcolor3_color_store_get_type ()) #define GCOLOR3_COLOR_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_COLOR_STORE, Gcolor3ColorStore)) #define GCOLOR3_COLOR_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_COLOR_STORE, Gcolor3ColorStoreClass)) #define GCOLOR3_IS_COLOR_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_COLOR_STORE)) #define GCOLOR3_IS_COLOR_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_COLOR_STORE)) #define GCOLOR3_COLOR_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_COLOR_STORE, Gcolor3ColorStoreClass)) struct _Gcolor3ColorStore { GObject base_instance; }; struct _Gcolor3ColorStoreClass { GObjectClass parent_class; }; GType gcolor3_color_store_get_type (void); Gcolor3ColorStore *gcolor3_color_store_new (void); gboolean gcolor3_color_store_add_color (Gcolor3ColorStore *store, const gchar *key, const gchar *hex); gboolean gcolor3_color_store_remove_color (Gcolor3ColorStore *store, const gchar *key); gboolean gcolor3_color_store_rename_color (Gcolor3ColorStore *store, const gchar *old_name, const gchar *new_name); void gcolor3_color_store_foreach (Gcolor3ColorStore *store, Gcolor3ColorStoreForeachFunc func, gpointer user_data); gboolean gcolor3_color_store_empty (Gcolor3ColorStore *store); G_END_DECLS #endif /* __GCOLOR3_COLOR_STORE_H__ */ gcolor3-2.3.1/src/gcolor3-hsv.c000066400000000000000000001113361334304176500162010ustar00rootroot00000000000000/* HSV color selector for GTK+ * * Copyright (C) 1999 The Free Software Foundation * * Authors: Simon Budig (original code) * Federico Mena-Quintero (cleanup for GTK+) * Jonathan Blandford (cleanup for GTK+) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. * * Updated and adapted for inclusion in Gcolor3 by Jente Hidskes 2018 */ #include "config.h" // TODO: get rid of all deprecated API #define GDK_DISABLE_DEPRECATION_WARNINGS #include "gcolor3-hsv.h" #include #include #include #define I_(string) g_intern_static_string (string) /** * SECTION:gtkhsv * @Short_description: A “color wheel” widget * @Title: Gcolor3HSV * @See_also: #Gcolor3ColorSelection, #Gcolor3ColorSelectionDialog * * #Gcolor3HSV is the “color wheel” part of a complete color selector widget. * It allows to select a color by determining its HSV components in an * intuitive way. Moving the selection around the outer ring changes the hue, * and moving the selection point inside the inner triangle changes value and * saturation. */ /* Default width/height */ #define DEFAULT_SIZE 100 /* Default ring width */ #define DEFAULT_RING_WIDTH 10 /* Dragging modes */ typedef enum { DRAG_NONE, DRAG_H, DRAG_SV } DragMode; /* Private part of the Gcolor3HSV structure */ struct _Gcolor3HSVPrivate { /* Color value */ double h; double s; double v; /* Size and ring width */ int size; int ring_width; /* Window for capturing events */ GdkWindow *window; /* Dragging mode */ DragMode mode; guint focus_on_ring : 1; }; /* Signal IDs */ enum { CHANGED, MOVE, LAST_SIGNAL }; static void gcolor3_hsv_destroy (GtkWidget *widget); static void gcolor3_hsv_realize (GtkWidget *widget); static void gcolor3_hsv_unrealize (GtkWidget *widget); static void gcolor3_hsv_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural); static void gcolor3_hsv_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); static void gcolor3_hsv_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gcolor3_hsv_button_press (GtkWidget *widget, GdkEventButton *event); static gboolean gcolor3_hsv_button_release (GtkWidget *widget, GdkEventButton *event); static gboolean gcolor3_hsv_motion (GtkWidget *widget, GdkEventMotion *event); static gboolean gcolor3_hsv_draw (GtkWidget *widget, cairo_t *cr); static gboolean gcolor3_hsv_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event); static gboolean gcolor3_hsv_focus (GtkWidget *widget, GtkDirectionType direction); static void gcolor3_hsv_move (Gcolor3HSV *hsv, GtkDirectionType dir); static guint hsv_signals[LAST_SIGNAL]; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3HSV, gcolor3_hsv, GTK_TYPE_WIDGET) /* Class initialization function for the HSV color selector */ static void gcolor3_hsv_class_init (Gcolor3HSVClass *class) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; Gcolor3HSVClass *hsv_class; GtkBindingSet *binding_set; gobject_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; hsv_class = GCOLOR3_HSV_CLASS (class); widget_class->destroy = gcolor3_hsv_destroy; widget_class->realize = gcolor3_hsv_realize; widget_class->unrealize = gcolor3_hsv_unrealize; widget_class->get_preferred_width = gcolor3_hsv_get_preferred_width; widget_class->get_preferred_height = gcolor3_hsv_get_preferred_height; widget_class->size_allocate = gcolor3_hsv_size_allocate; widget_class->button_press_event = gcolor3_hsv_button_press; widget_class->button_release_event = gcolor3_hsv_button_release; widget_class->motion_notify_event = gcolor3_hsv_motion; widget_class->draw = gcolor3_hsv_draw; widget_class->focus = gcolor3_hsv_focus; widget_class->grab_broken_event = gcolor3_hsv_grab_broken; gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_COLOR_CHOOSER); hsv_class->move = gcolor3_hsv_move; hsv_signals[CHANGED] = g_signal_new (I_("changed"), G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (Gcolor3HSVClass, changed), NULL, NULL, NULL, G_TYPE_NONE, 0); hsv_signals[MOVE] = g_signal_new (I_("move"), G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (Gcolor3HSVClass, move), NULL, NULL, NULL, G_TYPE_NONE, 1, GTK_TYPE_DIRECTION_TYPE); binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP); gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Up, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP); gtk_binding_entry_add_signal (binding_set, GDK_KEY_Down, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN); gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Down, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN); gtk_binding_entry_add_signal (binding_set, GDK_KEY_Right, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT); gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Right, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT); gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT); gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT); } static void gcolor3_hsv_init (Gcolor3HSV *hsv) { Gcolor3HSVPrivate *priv; priv = gcolor3_hsv_get_instance_private (hsv); hsv->priv = priv; gtk_widget_set_has_window (GTK_WIDGET (hsv), FALSE); gtk_widget_set_can_focus (GTK_WIDGET (hsv), TRUE); priv->h = 0.0; priv->s = 0.0; priv->v = 0.0; priv->size = DEFAULT_SIZE; priv->ring_width = DEFAULT_RING_WIDTH; } static void gcolor3_hsv_destroy (GtkWidget *widget) { GTK_WIDGET_CLASS (gcolor3_hsv_parent_class)->destroy (widget); } static void gcolor3_hsv_realize (GtkWidget *widget) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; GtkAllocation allocation; GdkWindow *parent_window; GdkWindowAttr attr; int attr_mask; gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); attr.window_type = GDK_WINDOW_CHILD; attr.x = allocation.x; attr.y = allocation.y; attr.width = allocation.width; attr.height = allocation.height; attr.wclass = GDK_INPUT_ONLY; attr.event_mask = gtk_widget_get_events (widget); attr.event_mask |= (GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); attr_mask = GDK_WA_X | GDK_WA_Y; parent_window = gtk_widget_get_parent_window (widget); gtk_widget_set_window (widget, parent_window); g_object_ref (parent_window); priv->window = gdk_window_new (parent_window, &attr, attr_mask); gdk_window_set_user_data (priv->window, hsv); gdk_window_show (priv->window); } static void gcolor3_hsv_unrealize (GtkWidget *widget) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gdk_window_set_user_data (priv->window, NULL); gdk_window_destroy (priv->window); priv->window = NULL; GTK_WIDGET_CLASS (gcolor3_hsv_parent_class)->unrealize (widget); } static void gcolor3_hsv_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gint focus_width; gint focus_pad; gtk_widget_style_get (widget, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); *minimum = priv->size + 2 * (focus_width + focus_pad); *natural = priv->size + 2 * (focus_width + focus_pad); } static void gcolor3_hsv_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gint focus_width; gint focus_pad; gtk_widget_style_get (widget, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); *minimum = priv->size + 2 * (focus_width + focus_pad); *natural = priv->size + 2 * (focus_width + focus_pad); } static void gcolor3_hsv_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gtk_widget_set_allocation (widget, allocation); if (gtk_widget_get_realized (widget)) gdk_window_move_resize (priv->window, allocation->x, allocation->y, allocation->width, allocation->height); } /* Utility functions */ #define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) /* Converts from HSV to RGB */ static void hsv_to_rgb (gdouble *h, gdouble *s, gdouble *v) { gdouble hue, saturation, value; gdouble f, p, q, t; if (*s == 0.0) { *h = *v; *s = *v; *v = *v; /* heh */ } else { hue = *h * 6.0; saturation = *s; value = *v; if (hue == 6.0) hue = 0.0; f = hue - (int) hue; p = value * (1.0 - saturation); q = value * (1.0 - saturation * f); t = value * (1.0 - saturation * (1.0 - f)); switch ((int) hue) { case 0: *h = value; *s = t; *v = p; break; case 1: *h = q; *s = value; *v = p; break; case 2: *h = p; *s = value; *v = t; break; case 3: *h = p; *s = q; *v = value; break; case 4: *h = t; *s = p; *v = value; break; case 5: *h = value; *s = p; *v = q; break; default: g_assert_not_reached (); } } } /* Computes the vertices of the saturation/value triangle */ static void compute_triangle (Gcolor3HSV *hsv, gint *hx, gint *hy, gint *sx, gint *sy, gint *vx, gint *vy) { Gcolor3HSVPrivate *priv = hsv->priv; GtkWidget *widget = GTK_WIDGET (hsv); gdouble center_x; gdouble center_y; gdouble inner, outer; gdouble angle; center_x = gtk_widget_get_allocated_width (widget) / 2.0; center_y = gtk_widget_get_allocated_height (widget) / 2.0; outer = priv->size / 2.0; inner = outer - priv->ring_width; angle = priv->h * 2.0 * G_PI; *hx = floor (center_x + cos (angle) * inner + 0.5); *hy = floor (center_y - sin (angle) * inner + 0.5); *sx = floor (center_x + cos (angle + 2.0 * G_PI / 3.0) * inner + 0.5); *sy = floor (center_y - sin (angle + 2.0 * G_PI / 3.0) * inner + 0.5); *vx = floor (center_x + cos (angle + 4.0 * G_PI / 3.0) * inner + 0.5); *vy = floor (center_y - sin (angle + 4.0 * G_PI / 3.0) * inner + 0.5); } /* Computes whether a point is inside the hue ring */ static gboolean is_in_ring (Gcolor3HSV *hsv, gdouble x, gdouble y) { Gcolor3HSVPrivate *priv = hsv->priv; GtkWidget *widget = GTK_WIDGET (hsv); gdouble dx, dy, dist; gdouble center_x; gdouble center_y; gdouble inner, outer; center_x = gtk_widget_get_allocated_width (widget) / 2.0; center_y = gtk_widget_get_allocated_height (widget) / 2.0; outer = priv->size / 2.0; inner = outer - priv->ring_width; dx = x - center_x; dy = center_y - y; dist = dx * dx + dy * dy; return (dist >= inner * inner && dist <= outer * outer); } /* Computes a saturation/value pair based on the mouse coordinates */ static void compute_sv (Gcolor3HSV *hsv, gdouble x, gdouble y, gdouble *s, gdouble *v) { GtkWidget *widget = GTK_WIDGET (hsv); int ihx, ihy, isx, isy, ivx, ivy; double hx, hy, sx, sy, vx, vy; double center_x; double center_y; compute_triangle (hsv, &ihx, &ihy, &isx, &isy, &ivx, &ivy); center_x = gtk_widget_get_allocated_width (widget) / 2.0; center_y = gtk_widget_get_allocated_height (widget) / 2.0; hx = ihx - center_x; hy = center_y - ihy; sx = isx - center_x; sy = center_y - isy; vx = ivx - center_x; vy = center_y - ivy; x -= center_x; y = center_y - y; if (vx * (x - sx) + vy * (y - sy) < 0.0) { *s = 1.0; *v = (((x - sx) * (hx - sx) + (y - sy) * (hy-sy)) / ((hx - sx) * (hx - sx) + (hy - sy) * (hy - sy))); if (*v < 0.0) *v = 0.0; else if (*v > 1.0) *v = 1.0; } else if (hx * (x - sx) + hy * (y - sy) < 0.0) { *s = 0.0; *v = (((x - sx) * (vx - sx) + (y - sy) * (vy - sy)) / ((vx - sx) * (vx - sx) + (vy - sy) * (vy - sy))); if (*v < 0.0) *v = 0.0; else if (*v > 1.0) *v = 1.0; } else if (sx * (x - hx) + sy * (y - hy) < 0.0) { *v = 1.0; *s = (((x - vx) * (hx - vx) + (y - vy) * (hy - vy)) / ((hx - vx) * (hx - vx) + (hy - vy) * (hy - vy))); if (*s < 0.0) *s = 0.0; else if (*s > 1.0) *s = 1.0; } else { *v = (((x - sx) * (hy - vy) - (y - sy) * (hx - vx)) / ((vx - sx) * (hy - vy) - (vy - sy) * (hx - vx))); if (*v<= 0.0) { *v = 0.0; *s = 0.0; } else { if (*v > 1.0) *v = 1.0; if (fabs (hy - vy) < fabs (hx - vx)) *s = (x - sx - *v * (vx - sx)) / (*v * (hx - vx)); else *s = (y - sy - *v * (vy - sy)) / (*v * (hy - vy)); if (*s < 0.0) *s = 0.0; else if (*s > 1.0) *s = 1.0; } } } /* Computes whether a point is inside the saturation/value triangle */ static gboolean is_in_triangle (Gcolor3HSV *hsv, gdouble x, gdouble y) { int hx, hy, sx, sy, vx, vy; double det, s, v; compute_triangle (hsv, &hx, &hy, &sx, &sy, &vx, &vy); det = (vx - sx) * (hy - sy) - (vy - sy) * (hx - sx); s = ((x - sx) * (hy - sy) - (y - sy) * (hx - sx)) / det; v = ((vx - sx) * (y - sy) - (vy - sy) * (x - sx)) / det; return (s >= 0.0 && v >= 0.0 && s + v <= 1.0); } /* Computes a value based on the mouse coordinates */ static double compute_v (Gcolor3HSV *hsv, gdouble x, gdouble y) { GtkWidget *widget = GTK_WIDGET (hsv); double center_x; double center_y; double dx, dy; double angle; center_x = gtk_widget_get_allocated_width (widget) / 2.0; center_y = gtk_widget_get_allocated_height (widget) / 2.0; dx = x - center_x; dy = center_y - y; angle = atan2 (dy, dx); if (angle < 0.0) angle += 2.0 * G_PI; return angle / (2.0 * G_PI); } /* Event handlers */ static void set_cross_grab (Gcolor3HSV *hsv, GdkDevice *device, guint32 time) { Gcolor3HSVPrivate *priv = hsv->priv; GdkCursor *cursor; cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (hsv)), GDK_CROSSHAIR); gdk_device_grab (device, priv->window, GDK_OWNERSHIP_NONE, FALSE, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, cursor, time); g_object_unref (cursor); } static gboolean gcolor3_hsv_grab_broken (GtkWidget *widget, UNUSED GdkEventGrabBroken *event) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; priv->mode = DRAG_NONE; return TRUE; } static gint gcolor3_hsv_button_press (GtkWidget *widget, GdkEventButton *event) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; double x, y; if (priv->mode != DRAG_NONE || event->button != GDK_BUTTON_PRIMARY) return FALSE; x = event->x; y = event->y; if (is_in_ring (hsv, x, y)) { priv->mode = DRAG_H; set_cross_grab (hsv, gdk_event_get_device ((GdkEvent *) event), event->time); gcolor3_hsv_set_color (hsv, compute_v (hsv, x, y), priv->s, priv->v); gtk_widget_grab_focus (widget); priv->focus_on_ring = TRUE; return TRUE; } if (is_in_triangle (hsv, x, y)) { gdouble s, v; priv->mode = DRAG_SV; set_cross_grab (hsv, gdk_event_get_device ((GdkEvent *) event), event->time); compute_sv (hsv, x, y, &s, &v); gcolor3_hsv_set_color (hsv, priv->h, s, v); gtk_widget_grab_focus (widget); priv->focus_on_ring = FALSE; return TRUE; } return FALSE; } static gint gcolor3_hsv_button_release (GtkWidget *widget, GdkEventButton *event) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; DragMode mode; gdouble x, y; if (priv->mode == DRAG_NONE || event->button != GDK_BUTTON_PRIMARY) return FALSE; /* Set the drag mode to DRAG_NONE so that signal handlers for "catched" * can see that this is the final color state. */ mode = priv->mode; priv->mode = DRAG_NONE; x = event->x; y = event->y; if (mode == DRAG_H) { gcolor3_hsv_set_color (hsv, compute_v (hsv, x, y), priv->s, priv->v); } else if (mode == DRAG_SV) { gdouble s, v; compute_sv (hsv, x, y, &s, &v); gcolor3_hsv_set_color (hsv, priv->h, s, v); } else { g_assert_not_reached (); } gdk_device_ungrab (gdk_event_get_device ((GdkEvent *) event), event->time); return TRUE; } static gint gcolor3_hsv_motion (GtkWidget *widget, GdkEventMotion *event) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gdouble x, y; if (priv->mode == DRAG_NONE) return FALSE; gdk_event_request_motions (event); x = event->x; y = event->y; if (priv->mode == DRAG_H) { gcolor3_hsv_set_color (hsv, compute_v (hsv, x, y), priv->s, priv->v); return TRUE; } else if (priv->mode == DRAG_SV) { gdouble s, v; compute_sv (hsv, x, y, &s, &v); gcolor3_hsv_set_color (hsv, priv->h, s, v); return TRUE; } g_assert_not_reached (); return FALSE; } /* Redrawing */ /* Paints the hue ring */ static void paint_ring (Gcolor3HSV *hsv, cairo_t *cr) { Gcolor3HSVPrivate *priv = hsv->priv; GtkWidget *widget = GTK_WIDGET (hsv); int xx, yy, width, height; gdouble dx, dy, dist; gdouble center_x; gdouble center_y; gdouble inner, outer; guint32 *buf, *p; gdouble angle; gdouble hue; gdouble r, g, b; cairo_surface_t *source; cairo_t *source_cr; gint stride; width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); center_x = width / 2.0; center_y = height / 2.0; outer = priv->size / 2.0; inner = outer - priv->ring_width; /* Create an image initialized with the ring colors */ stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width); buf = g_new (guint32, height * stride / 4); for (yy = 0; yy < height; yy++) { p = buf + yy * width; dy = -(yy - center_y); for (xx = 0; xx < width; xx++) { dx = xx - center_x; dist = dx * dx + dy * dy; if (dist < ((inner-1) * (inner-1)) || dist > ((outer+1) * (outer+1))) { *p++ = 0; continue; } angle = atan2 (dy, dx); if (angle < 0.0) angle += 2.0 * G_PI; hue = angle / (2.0 * G_PI); r = hue; g = 1.0; b = 1.0; hsv_to_rgb (&r, &g, &b); *p++ = (((int)floor (r * 255 + 0.5) << 16) | ((int)floor (g * 255 + 0.5) << 8) | (int)floor (b * 255 + 0.5)); } } source = cairo_image_surface_create_for_data ((unsigned char *)buf, CAIRO_FORMAT_RGB24, width, height, stride); /* Now draw the value marker onto the source image, so that it * will get properly clipped at the edges of the ring */ source_cr = cairo_create (source); r = priv->h; g = 1.0; b = 1.0; hsv_to_rgb (&r, &g, &b); if (INTENSITY (r, g, b) > 0.5) cairo_set_source_rgb (source_cr, 0., 0., 0.); else cairo_set_source_rgb (source_cr, 1., 1., 1.); cairo_move_to (source_cr, center_x, center_y); cairo_line_to (source_cr, center_x + cos (priv->h * 2.0 * G_PI) * priv->size / 2, center_y - sin (priv->h * 2.0 * G_PI) * priv->size / 2); cairo_stroke (source_cr); cairo_destroy (source_cr); /* Draw the ring using the source image */ cairo_save (cr); cairo_set_source_surface (cr, source, 0, 0); cairo_surface_destroy (source); cairo_set_line_width (cr, priv->ring_width); cairo_new_path (cr); cairo_arc (cr, center_x, center_y, priv->size / 2. - priv->ring_width / 2., 0, 2 * G_PI); cairo_stroke (cr); cairo_restore (cr); g_free (buf); } /* Converts an HSV triplet to an integer RGB triplet */ static void get_color (gdouble h, gdouble s, gdouble v, gint *r, gint *g, gint *b) { hsv_to_rgb (&h, &s, &v); *r = floor (h * 255 + 0.5); *g = floor (s * 255 + 0.5); *b = floor (v * 255 + 0.5); } #define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t)) #define LERP(a, b, v1, v2, i) (((v2) - (v1) != 0) \ ? ((a) + ((b) - (a)) * ((i) - (v1)) / ((v2) - (v1))) \ : (a)) /* Number of pixels we extend out from the edges when creating * color source to avoid artifacts */ #define PAD 3 /* Paints the HSV triangle */ static void paint_triangle (Gcolor3HSV *hsv, cairo_t *cr, gboolean draw_focus) { Gcolor3HSVPrivate *priv = hsv->priv; GtkWidget *widget = GTK_WIDGET (hsv); gint hx, hy, sx, sy, vx, vy; /* HSV vertices */ gint x1, y1, r1, g1, b1; /* First vertex in scanline order */ gint x2, y2, r2, g2, b2; /* Second vertex */ gint x3, y3, r3, g3, b3; /* Third vertex */ gint t; guint32 *buf, *p, c; gint xl, xr, rl, rr, gl, gr, bl, br; /* Scanline data */ gint xx, yy; gint x_interp, y_interp; gint x_start, x_end; cairo_surface_t *source; gdouble r, g, b; gint stride; int width, height; GtkStyleContext *context; priv = hsv->priv; width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); /* Compute triangle's vertices */ compute_triangle (hsv, &hx, &hy, &sx, &sy, &vx, &vy); x1 = hx; y1 = hy; get_color (priv->h, 1.0, 1.0, &r1, &g1, &b1); x2 = sx; y2 = sy; get_color (priv->h, 1.0, 0.0, &r2, &g2, &b2); x3 = vx; y3 = vy; get_color (priv->h, 0.0, 1.0, &r3, &g3, &b3); if (y2 > y3) { SWAP (x2, x3, t); SWAP (y2, y3, t); SWAP (r2, r3, t); SWAP (g2, g3, t); SWAP (b2, b3, t); } if (y1 > y3) { SWAP (x1, x3, t); SWAP (y1, y3, t); SWAP (r1, r3, t); SWAP (g1, g3, t); SWAP (b1, b3, t); } if (y1 > y2) { SWAP (x1, x2, t); SWAP (y1, y2, t); SWAP (r1, r2, t); SWAP (g1, g2, t); SWAP (b1, b2, t); } /* Shade the triangle */ stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width); buf = g_new (guint32, height * stride / 4); for (yy = 0; yy < height; yy++) { p = buf + yy * width; if (yy >= y1 - PAD && yy < y3 + PAD) { y_interp = CLAMP (yy, y1, y3); if (y_interp < y2) { xl = LERP (x1, x2, y1, y2, y_interp); rl = LERP (r1, r2, y1, y2, y_interp); gl = LERP (g1, g2, y1, y2, y_interp); bl = LERP (b1, b2, y1, y2, y_interp); } else { xl = LERP (x2, x3, y2, y3, y_interp); rl = LERP (r2, r3, y2, y3, y_interp); gl = LERP (g2, g3, y2, y3, y_interp); bl = LERP (b2, b3, y2, y3, y_interp); } xr = LERP (x1, x3, y1, y3, y_interp); rr = LERP (r1, r3, y1, y3, y_interp); gr = LERP (g1, g3, y1, y3, y_interp); br = LERP (b1, b3, y1, y3, y_interp); if (xl > xr) { SWAP (xl, xr, t); SWAP (rl, rr, t); SWAP (gl, gr, t); SWAP (bl, br, t); } x_start = MAX (xl - PAD, 0); x_end = MIN (xr + PAD, width); x_start = MIN (x_start, x_end); c = (rl << 16) | (gl << 8) | bl; for (xx = 0; xx < x_start; xx++) *p++ = c; for (; xx < x_end; xx++) { x_interp = CLAMP (xx, xl, xr); *p++ = ((LERP (rl, rr, xl, xr, x_interp) << 16) | (LERP (gl, gr, xl, xr, x_interp) << 8) | LERP (bl, br, xl, xr, x_interp)); } c = (rr << 16) | (gr << 8) | br; for (; xx < width; xx++) *p++ = c; } } source = cairo_image_surface_create_for_data ((unsigned char *)buf, CAIRO_FORMAT_RGB24, width, height, stride); /* Draw a triangle with the image as a source */ cairo_set_source_surface (cr, source, 0, 0); cairo_surface_destroy (source); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y2); cairo_line_to (cr, x3, y3); cairo_close_path (cr); cairo_fill (cr); g_free (buf); /* Draw value marker */ xx = floor (sx + (vx - sx) * priv->v + (hx - vx) * priv->s * priv->v + 0.5); yy = floor (sy + (vy - sy) * priv->v + (hy - vy) * priv->s * priv->v + 0.5); r = priv->h; g = priv->s; b = priv->v; hsv_to_rgb (&r, &g, &b); context = gtk_widget_get_style_context (widget); gtk_style_context_save (context); if (INTENSITY (r, g, b) > 0.5) { gtk_style_context_add_class (context, "light-area-focus"); cairo_set_source_rgb (cr, 0., 0., 0.); } else { gtk_style_context_add_class (context, "dark-area-focus"); cairo_set_source_rgb (cr, 1., 1., 1.); } #define RADIUS 4 #define FOCUS_RADIUS 6 cairo_new_path (cr); cairo_arc (cr, xx, yy, RADIUS, 0, 2 * G_PI); cairo_stroke (cr); /* Draw focus outline */ if (draw_focus && !priv->focus_on_ring) { gint focus_width; gint focus_pad; gtk_widget_style_get (widget, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); gtk_render_focus (context, cr, xx - FOCUS_RADIUS - focus_width - focus_pad, yy - FOCUS_RADIUS - focus_width - focus_pad, 2 * (FOCUS_RADIUS + focus_width + focus_pad), 2 * (FOCUS_RADIUS + focus_width + focus_pad)); } gtk_style_context_restore (context); } /* Paints the contents of the HSV color selector */ static gboolean gcolor3_hsv_draw (GtkWidget *widget, cairo_t *cr) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; gboolean draw_focus; draw_focus = gtk_widget_has_visible_focus (widget); paint_ring (hsv, cr); paint_triangle (hsv, cr, draw_focus); if (draw_focus && priv->focus_on_ring) { GtkStyleContext *context; context = gtk_widget_get_style_context (widget); gtk_render_focus (context, cr, 0, 0, gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget)); } return FALSE; } static gboolean gcolor3_hsv_focus (GtkWidget *widget, GtkDirectionType dir) { Gcolor3HSV *hsv = GCOLOR3_HSV (widget); Gcolor3HSVPrivate *priv = hsv->priv; if (!gtk_widget_has_focus (widget)) { if (dir == GTK_DIR_TAB_BACKWARD) priv->focus_on_ring = FALSE; else priv->focus_on_ring = TRUE; gtk_widget_grab_focus (GTK_WIDGET (hsv)); return TRUE; } switch (dir) { case GTK_DIR_UP: if (priv->focus_on_ring) return FALSE; else priv->focus_on_ring = TRUE; break; case GTK_DIR_DOWN: if (priv->focus_on_ring) priv->focus_on_ring = FALSE; else return FALSE; break; case GTK_DIR_LEFT: case GTK_DIR_TAB_BACKWARD: if (priv->focus_on_ring) return FALSE; else priv->focus_on_ring = TRUE; break; case GTK_DIR_RIGHT: case GTK_DIR_TAB_FORWARD: if (priv->focus_on_ring) priv->focus_on_ring = FALSE; else return FALSE; break; } gtk_widget_queue_draw (GTK_WIDGET (hsv)); return TRUE; } /** * gcolor3_hsv_new: * * Creates a new HSV color selector. * * Returns: A newly-created HSV color selector. * * Since: 2.14 */ GtkWidget* gcolor3_hsv_new (void) { return g_object_new (GCOLOR3_TYPE_HSV, NULL); } /** * gcolor3_hsv_set_color: * @hsv: An HSV color selector * @h: Hue * @s: Saturation * @v: Value * * Sets the current color in an HSV color selector. * Color component values must be in the [0.0, 1.0] range. * * Since: 2.14 */ void gcolor3_hsv_set_color (Gcolor3HSV *hsv, gdouble h, gdouble s, gdouble v) { Gcolor3HSVPrivate *priv; g_return_if_fail (GCOLOR3_IS_HSV (hsv)); g_return_if_fail (h >= 0.0 && h <= 1.0); g_return_if_fail (s >= 0.0 && s <= 1.0); g_return_if_fail (v >= 0.0 && v <= 1.0); priv = hsv->priv; priv->h = h; priv->s = s; priv->v = v; g_signal_emit (hsv, hsv_signals[CHANGED], 0); gtk_widget_queue_draw (GTK_WIDGET (hsv)); } /** * gcolor3_hsv_get_color: * @hsv: An HSV color selector * @h: (out): Return value for the hue * @s: (out): Return value for the saturation * @v: (out): Return value for the value * * Queries the current color in an HSV color selector. * Returned values will be in the [0.0, 1.0] range. * * Since: 2.14 */ void gcolor3_hsv_get_color (Gcolor3HSV *hsv, double *h, double *s, double *v) { Gcolor3HSVPrivate *priv; g_return_if_fail (GCOLOR3_IS_HSV (hsv)); priv = hsv->priv; if (h) *h = priv->h; if (s) *s = priv->s; if (v) *v = priv->v; } /** * gcolor3_hsv_set_metrics: * @hsv: An HSV color selector * @size: Diameter for the hue ring * @ring_width: Width of the hue ring * * Sets the size and ring width of an HSV color selector. * * Since: 2.14 */ void gcolor3_hsv_set_metrics (Gcolor3HSV *hsv, gint size, gint ring_width) { Gcolor3HSVPrivate *priv; int same_size; g_return_if_fail (GCOLOR3_IS_HSV (hsv)); g_return_if_fail (size > 0); g_return_if_fail (ring_width > 0); g_return_if_fail (2 * ring_width + 1 <= size); priv = hsv->priv; same_size = (priv->size == size); priv->size = size; priv->ring_width = ring_width; if (same_size) gtk_widget_queue_draw (GTK_WIDGET (hsv)); else gtk_widget_queue_resize (GTK_WIDGET (hsv)); } /** * gcolor3_hsv_get_metrics: * @hsv: An HSV color selector * @size: (out): Return value for the diameter of the hue ring * @ring_width: (out): Return value for the width of the hue ring * * Queries the size and ring width of an HSV color selector. * * Since: 2.14 */ void gcolor3_hsv_get_metrics (Gcolor3HSV *hsv, gint *size, gint *ring_width) { Gcolor3HSVPrivate *priv; g_return_if_fail (GCOLOR3_IS_HSV (hsv)); priv = hsv->priv; if (size) *size = priv->size; if (ring_width) *ring_width = priv->ring_width; } /** * gcolor3_hsv_is_adjusting: * @hsv: A #Gcolor3HSV * * An HSV color selector can be said to be adjusting if multiple rapid * changes are being made to its value, for example, when the user is * adjusting the value with the mouse. This function queries whether * the HSV color selector is being adjusted or not. * * Returns: %TRUE if clients can ignore changes to the color value, * since they may be transitory, or %FALSE if they should consider * the color value status to be final. * * Since: 2.14 */ gboolean gcolor3_hsv_is_adjusting (Gcolor3HSV *hsv) { Gcolor3HSVPrivate *priv; g_return_val_if_fail (GCOLOR3_IS_HSV (hsv), FALSE); priv = hsv->priv; return priv->mode != DRAG_NONE; } static void gcolor3_hsv_move (Gcolor3HSV *hsv, GtkDirectionType dir) { Gcolor3HSVPrivate *priv = hsv->priv; gdouble hue, sat, val; gint hx, hy, sx, sy, vx, vy; /* HSV vertices */ gint x, y; /* position in triangle */ hue = priv->h; sat = priv->s; val = priv->v; compute_triangle (hsv, &hx, &hy, &sx, &sy, &vx, &vy); x = floor (sx + (vx - sx) * priv->v + (hx - vx) * priv->s * priv->v + 0.5); y = floor (sy + (vy - sy) * priv->v + (hy - vy) * priv->s * priv->v + 0.5); #define HUE_DELTA 0.002 switch (dir) { case GTK_DIR_UP: if (priv->focus_on_ring) hue += HUE_DELTA; else { y -= 1; compute_sv (hsv, x, y, &sat, &val); } break; case GTK_DIR_DOWN: if (priv->focus_on_ring) hue -= HUE_DELTA; else { y += 1; compute_sv (hsv, x, y, &sat, &val); } break; case GTK_DIR_LEFT: if (priv->focus_on_ring) hue += HUE_DELTA; else { x -= 1; compute_sv (hsv, x, y, &sat, &val); } break; case GTK_DIR_RIGHT: if (priv->focus_on_ring) hue -= HUE_DELTA ; else { x += 1; compute_sv (hsv, x, y, &sat, &val); } break; default: /* we don't care about the tab directions */ break; } /* Wrap */ if (hue < 0.0) hue = 1.0; else if (hue > 1.0) hue = 0.0; gcolor3_hsv_set_color (hsv, hue, sat, val); } gcolor3-2.3.1/src/gcolor3-hsv.h000066400000000000000000000064341334304176500162100ustar00rootroot00000000000000/* HSV color selector for GTK+ * * Copyright (C) 1999 The Free Software Foundation * * Authors: Simon Budig (original code) * Federico Mena-Quintero (cleanup for GTK+) * Jonathan Blandford (cleanup for GTK+) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. * * Updated and adapted for inclusion in Gcolor3 by Jente Hidskes 2018. */ #ifndef __GCOLOR3_HSV_H__ #define __GCOLOR3_HSV_H__ #include G_BEGIN_DECLS #define GCOLOR3_TYPE_HSV (gcolor3_hsv_get_type ()) #define GCOLOR3_HSV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCOLOR3_TYPE_HSV, Gcolor3HSV)) #define GCOLOR3_HSV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCOLOR3_TYPE_HSV, Gcolor3HSVClass)) #define GCOLOR3_IS_HSV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCOLOR3_TYPE_HSV)) #define GCOLOR3_IS_HSV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCOLOR3_TYPE_HSV)) #define GCOLOR3_HSV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCOLOR3_TYPE_HSV, Gcolor3HSVClass)) typedef struct _Gcolor3HSV Gcolor3HSV; typedef struct _Gcolor3HSVPrivate Gcolor3HSVPrivate; typedef struct _Gcolor3HSVClass Gcolor3HSVClass; struct _Gcolor3HSV { GtkWidget parent_instance; /*< private >*/ Gcolor3HSVPrivate *priv; }; struct _Gcolor3HSVClass { GtkWidgetClass parent_class; /* Notification signals */ void (* changed) (Gcolor3HSV *hsv); /* Keybindings */ void (* move) (Gcolor3HSV *hsv, GtkDirectionType type); /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); void (*_gtk_reserved4) (void); }; GType gcolor3_hsv_get_type (void) G_GNUC_CONST; GtkWidget* gcolor3_hsv_new (void); void gcolor3_hsv_set_color (Gcolor3HSV *hsv, double h, double s, double v); void gcolor3_hsv_get_color (Gcolor3HSV *hsv, gdouble *h, gdouble *s, gdouble *v); void gcolor3_hsv_set_metrics (Gcolor3HSV *hsv, gint size, gint ring_width); void gcolor3_hsv_get_metrics (Gcolor3HSV *hsv, gint *size, gint *ring_width); gboolean gcolor3_hsv_is_adjusting (Gcolor3HSV *hsv); G_END_DECLS #endif /* __GCOLOR3_HSV_H__ */ gcolor3-2.3.1/src/gcolor3-window.c000066400000000000000000000321311334304176500167030ustar00rootroot00000000000000/* Gcolor3Window * * Copyright (C) 2015-2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include "gcolor3-color-item.h" #include "gcolor3-color-row.h" #include "gcolor3-color-selection.h" #include "gcolor3-color-store.h" #include "gcolor3-window.h" #include "utils.h" enum { PROP_0, PROP_STORE, }; struct _Gcolor3WindowPrivate { GtkWidget *button_save; GtkWidget *entry; GtkWidget *page_stack; GtkWidget *picker; GtkWidget *list_stack; GtkWidget *scroll; GtkWidget *listbox; GtkWidget *empty_placeholder; Gcolor3ColorStore *store; GdkRGBA current; }; G_DEFINE_TYPE_WITH_PRIVATE (Gcolor3Window, gcolor3_window, GTK_TYPE_APPLICATION_WINDOW) static void save_color (Gcolor3WindowPrivate *priv) { const gchar *key; gchar *hex; key = gtk_entry_get_text (GTK_ENTRY (priv->entry)); hex = hex_value (&priv->current); if (strlen (key) == 0) { /* If using `hex` as key, do not save the first character (e.g., `#`) * because GKeyFile will see these as (and subsequently ignore) comments. */ key = hex + 1; } /* This will add the color to the store (if the key isn't * already used), which in turn will update the list box due * to the binding between the store's list model and the list * box. */ gcolor3_color_store_add_color (priv->store, key, hex); g_free (hex); if (!gcolor3_color_store_empty (priv->store)) { gtk_stack_set_visible_child (GTK_STACK (priv->list_stack), priv->scroll); } } static gboolean gcolor3_window_picker_page_key_handler (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { Gcolor3WindowPrivate *priv; if (event->type != GDK_KEY_PRESS) { return GDK_EVENT_PROPAGATE; } priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); switch (event->keyval) { case GDK_KEY_s: if ((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) { return GDK_EVENT_PROPAGATE; } /* Emulate a button click, to give the user visual feedback of the save action. */ g_signal_emit_by_name (priv->button_save, "activate"); return GDK_EVENT_STOP; default: return GDK_EVENT_PROPAGATE; } } static void gcolor3_window_entry_activated (UNUSED GtkEntry *entry, gpointer user_data) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); /* Emulate a button click, to give the user visual feedback of the save action. */ g_signal_emit_by_name (priv->button_save, "activate"); } static void gcolor3_window_save_button_clicked (UNUSED GtkButton *button, gpointer user_data) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); save_color (priv); } static void gcolor3_window_color_row_deleted (Gcolor3ColorRow *row, gpointer user_data) { Gcolor3WindowPrivate *priv; gchar *key; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); g_object_get (row, "key", &key, NULL); /* Removing a color from the store will automatically remove it from the list box, due to the binding between the two. */ gcolor3_color_store_remove_color (priv->store, key); g_free (key); if (gcolor3_color_store_empty (priv->store)) { gtk_stack_set_visible_child (GTK_STACK (priv->list_stack), priv->empty_placeholder); } } static void gcolor3_window_color_row_renamed (UNUSED Gcolor3ColorRow *row, const gchar *old_name, const gchar *new_name, gpointer user_data) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); gcolor3_color_store_rename_color (priv->store, old_name, new_name); } static void gcolor3_window_action_change_page (UNUSED GSimpleAction *action, UNUSED GVariant *parameter, gpointer user_data) { Gcolor3WindowPrivate *priv; const gchar *page; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); page = gtk_stack_get_visible_child_name (GTK_STACK (priv->page_stack)); if (g_strcmp0 (page, "saved-colors") == 0) { gtk_stack_set_visible_child_name (GTK_STACK (priv->page_stack), "picker"); } else { gtk_stack_set_visible_child_name (GTK_STACK (priv->page_stack), "saved-colors"); } } static const GActionEntry window_actions[] = { { "change-page", gcolor3_window_action_change_page, NULL, NULL, NULL }, }; static void gcolor3_window_picker_changed (Gcolor3ColorSelection *picker, gpointer user_data) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); gcolor3_color_selection_get_current_color (GCOLOR3_COLOR_SELECTION (picker), &priv->current); } static void gcolor3_window_stack_changed (GtkStack *stack, UNUSED GParamSpec *pspec, gpointer user_data) { Gcolor3WindowPrivate *priv; const gchar *page; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); page = gtk_stack_get_visible_child_name (stack); if (g_strcmp0 (page, "saved-colors") == 0) { gtk_widget_hide (priv->button_save); gtk_widget_hide (priv->entry); } else { gtk_widget_show (priv->button_save); gtk_widget_show (priv->entry); } } static void gcolor3_window_selection_changed (GtkListBox *listbox, gpointer user_data) { Gcolor3WindowPrivate *priv; GtkListBoxRow *row; GdkRGBA new, current; gchar *color; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (user_data)); row = gtk_list_box_get_selected_row (listbox); if (!row) { /* This callback also triggers when a row is deleted, in which the selected row returns NULL. In this case, we don't want to select another color, anyway. */ return; } g_object_get (row, "hex", &color, NULL); gdk_rgba_parse (&new, color); g_free (color); /* Save the old color in the picker. */ gcolor3_color_selection_get_current_color (GCOLOR3_COLOR_SELECTION (priv->picker), ¤t); gcolor3_color_selection_set_previous_color (GCOLOR3_COLOR_SELECTION (priv->picker), ¤t); gcolor3_color_selection_set_current_color (GCOLOR3_COLOR_SELECTION (priv->picker), &new); } static GtkWidget * create_widget_func (gpointer item, gpointer user_data) { Gcolor3ColorRow *row; gchar *key, *hex; g_object_get ((Gcolor3ColorItem *) item, "key", &key, "hex", &hex, NULL); row = gcolor3_color_row_new (key, hex); g_signal_connect (row, "color-removed", G_CALLBACK (gcolor3_window_color_row_deleted), user_data); g_signal_connect (row, "color-renamed", G_CALLBACK (gcolor3_window_color_row_renamed), user_data); g_free (key); g_free (hex); return GTK_WIDGET (row); } static void gcolor3_window_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (object)); switch (prop_id) { case PROP_STORE: priv->store = GCOLOR3_COLOR_STORE (g_value_dup_object (value)); gtk_list_box_bind_model (GTK_LIST_BOX (priv->listbox), G_LIST_MODEL (priv->store), create_widget_func, object, NULL); if (gcolor3_color_store_empty (priv->store)) { gtk_stack_set_visible_child (GTK_STACK (priv->list_stack), priv->empty_placeholder); } else { gtk_stack_set_visible_child (GTK_STACK (priv->list_stack), priv->scroll); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_window_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (object)); switch (prop_id) { case PROP_STORE: g_value_set_object (value, priv->store); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gcolor3_window_dispose (GObject *object) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (object)); g_clear_object (&priv->store); G_OBJECT_CLASS (gcolor3_window_parent_class)->dispose (object); } static void gcolor3_window_finalize (GObject *object) { Gcolor3WindowPrivate *priv; gchar *hex; priv = gcolor3_window_get_instance_private (GCOLOR3_WINDOW (object)); hex = hex_value (&priv->current); g_printf ("%s\n", hex); g_free (hex); G_OBJECT_CLASS (gcolor3_window_parent_class)->finalize (object); } static void gcolor3_window_class_init (Gcolor3WindowClass *gcolor3_window_class) { GObjectClass *object_class = G_OBJECT_CLASS (gcolor3_window_class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (gcolor3_window_class); object_class->set_property = gcolor3_window_set_property; object_class->get_property = gcolor3_window_get_property; object_class->dispose = gcolor3_window_dispose; object_class->finalize = gcolor3_window_finalize; g_object_class_install_property (object_class, PROP_STORE, g_param_spec_object ("color-store", "ColorStore", "The managed colors", GCOLOR3_TYPE_COLOR_STORE, G_PARAM_READWRITE | G_PARAM_PRIVATE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); gtk_widget_class_set_template_from_resource (widget_class, "/nl/hjdskes/gcolor3/window.ui"); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, button_save); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, entry); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, page_stack); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, list_stack); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, scroll); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, listbox); gtk_widget_class_bind_template_child_private (widget_class, Gcolor3Window, empty_placeholder); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_stack_changed); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_picker_changed); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_selection_changed); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_picker_page_key_handler); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_entry_activated); gtk_widget_class_bind_template_callback (widget_class, gcolor3_window_save_button_clicked); } static void gcolor3_window_init (Gcolor3Window *window) { Gcolor3WindowPrivate *priv; priv = gcolor3_window_get_instance_private (window); gtk_widget_init_template (GTK_WIDGET (window)); /* Add the custom color selection widget. */ priv->picker = gcolor3_color_selection_new (); gtk_widget_set_valign (priv->picker, GTK_ALIGN_CENTER); gtk_widget_set_halign (priv->picker, GTK_ALIGN_CENTER); gtk_widget_set_margin_top (priv->picker, 6); gtk_widget_set_margin_bottom (priv->picker, 6); gtk_widget_set_margin_start (priv->picker, 6); gtk_widget_set_margin_end (priv->picker, 6); g_signal_connect (priv->picker, "color-changed", G_CALLBACK (gcolor3_window_picker_changed), window); g_signal_connect (priv->picker, "key-press-event", G_CALLBACK (gcolor3_window_picker_page_key_handler), window); gtk_stack_add_titled (GTK_STACK (priv->page_stack), priv->picker, "picker", _("Picker")); gtk_container_child_set (GTK_CONTAINER (priv->page_stack), priv->picker, "position", 0, NULL); gtk_widget_set_visible (priv->picker, TRUE); /* Call the callback to initialise the GtkEntry and to prevent * saving #000000 when saving the white color right away. */ gcolor3_window_picker_changed (GCOLOR3_COLOR_SELECTION (priv->picker), window); g_action_map_add_action_entries (G_ACTION_MAP (window), window_actions, G_N_ELEMENTS (window_actions), window); /* Finally, make the color picker the visible stack page. */ gtk_stack_set_visible_child_name (GTK_STACK (priv->page_stack), "picker"); } Gcolor3Window * gcolor3_window_new (Gcolor3Application *application, Gcolor3ColorStore *store) { g_return_val_if_fail (GCOLOR3_IS_APPLICATION (application), NULL); g_return_val_if_fail (GCOLOR3_IS_COLOR_STORE (store), NULL); return g_object_new (GCOLOR3_TYPE_WINDOW, "application", application, "color-store", store, NULL); } void gcolor3_window_destroy (Gcolor3Window *window, UNUSED gpointer user_data) { g_return_if_fail (window != NULL); gtk_widget_destroy (GTK_WIDGET (window)); } gcolor3-2.3.1/src/gcolor3-window.h000066400000000000000000000042511334304176500167120ustar00rootroot00000000000000/* Gcolor3Window * * Copyright (C) 2015-2016 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GCOLOR3_WINDOW_H__ #define __GCOLOR3_WINDOW_H__ #include #include #include "gcolor3-application.h" #include "gcolor3-color-store.h" G_BEGIN_DECLS typedef struct _Gcolor3Window Gcolor3Window; typedef struct _Gcolor3WindowClass Gcolor3WindowClass; typedef struct _Gcolor3WindowPrivate Gcolor3WindowPrivate; #define GCOLOR3_TYPE_WINDOW (gcolor3_window_get_type ()) #define GCOLOR3_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCOLOR3_TYPE_WINDOW, Gcolor3Window)) #define GCOLOR3_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GCOLOR3_TYPE_WINDOW, Gcolor3WindowClass)) #define GCOLOR3_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCOLOR3_TYPE_WINDOW)) #define GCOLOR3_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GCOLOR3_TYPE_WINDOW)) #define GCOLOR3_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GCOLOR3_TYPE_WINDOW, Gcolor3WindowClass)) struct _Gcolor3Window { GtkApplicationWindow base_instance; }; struct _Gcolor3WindowClass { GtkApplicationWindowClass parent_class; }; GType gcolor3_window_get_type (void) G_GNUC_CONST; Gcolor3Window *gcolor3_window_new (Gcolor3Application *application, Gcolor3ColorStore *store); void gcolor3_window_destroy (Gcolor3Window *window, gpointer user_data); G_END_DECLS #endif /* __GCOLOR3_WINDOW_H__ */ gcolor3-2.3.1/src/main.c000066400000000000000000000051521334304176500147550ustar00rootroot00000000000000/* Gcolor3 main * * Copyright (C) 2015-2016 Jente Hidskes * * Author: Jente Hidskes * * Modeled after eog's main.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include "gcolor3-application.h" static gboolean _print_version_and_exit (UNUSED const gchar *name, UNUSED const gchar *value, UNUSED gpointer user_data, UNUSED GError **error) { g_print ("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit (EXIT_SUCCESS); return TRUE; } static const GOptionEntry options[] = { { "version", 'v', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, _print_version_and_exit, N_("Show the application's version"), NULL }, { NULL } }; static gboolean _parse_options (int argc, char **argv) { GOptionContext *context; GError *error = NULL; gboolean succes; context = g_option_context_new (_("- pick a color from the picker or the screen")); g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); /* This initialises GTK during parsing. */ g_option_context_add_group (context, gtk_get_option_group (FALSE)); succes = g_option_context_parse (context, &argc, &argv, &error); g_option_context_free (context); if (!succes) { gchar *help; help = g_strdup_printf (_("Run '%s --help' to see a full " "list of available command line " "options"), argv[0]); g_printerr ("%s\n%s\n", error->message, help); g_clear_error (&error); g_free (help); return FALSE; } return TRUE; } int main (int argc, char **argv) { Gcolor3Application *application; int status; bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); if (!_parse_options (argc, argv)) { return EXIT_FAILURE; } application = gcolor3_application_new (); status = g_application_run (G_APPLICATION (application), argc, argv); g_object_unref (application); return status; } gcolor3-2.3.1/src/meson.build000066400000000000000000000017531334304176500160320ustar00rootroot00000000000000headers = [ 'gcolor3-application.h', 'gcolor3-color-item.h', 'gcolor3-color-row.h', 'gcolor3-color-selection.h', 'gcolor3-color-store.h', 'gcolor3-hsv.h', 'gcolor3-window.h', 'utils.h' ] sources = [ 'gcolor3-application.c', 'gcolor3-color-item.c', 'gcolor3-color-row.c', 'gcolor3-color-selection.c', 'gcolor3-color-store.c', 'gcolor3-hsv.c', 'gcolor3-window.c', 'main.c', 'utils.c' ] sources += gnome.compile_resources( 'gcolor3-resources', join_paths(meson.source_root(), 'data', 'gcolor3.gresource.xml'), source_dir: join_paths(meson.source_root(), 'data'), c_name: 'gcolor3' ) sources += gnome.genmarshal( 'gcolor3-marshalers', sources: join_paths(meson.source_root(), 'data', 'gcolor3-marshalers.list'), prefix: '_gcolor3_marshal' ) executable( meson.project_name(), sources + headers, include_directories: [ include_directories('../data', '..') ], dependencies: [ dep_gtk, dep_lm ], install: true, install_dir: bindir ) gcolor3-2.3.1/src/utils.c000066400000000000000000000025101334304176500151640ustar00rootroot00000000000000/* Utilities * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include #include "utils.h" inline double scale_round (double val, double factor) { val = floor (val * factor + 0.5); val = MAX (val, 0); val = MIN (val, factor); return val; } inline gchar * hex_value (GdkRGBA *color) { return g_strdup_printf ("#%.2X%.2X%.2X", (unsigned int) (scale_round (color->red, 255)), (unsigned int) (scale_round (color->green, 255)), (unsigned int) (scale_round (color->blue, 255))); } gcolor3-2.3.1/src/utils.h000066400000000000000000000020251334304176500151720ustar00rootroot00000000000000/* Utilities * * Copyright (C) 2018 Jente Hidskes * * Author: Jente Hidskes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __UTILS_H__ #define __UTILS_H__ #include #include G_BEGIN_DECLS double scale_round (double val, double factor); gchar *hex_value (GdkRGBA *color); G_END_DECLS #endif /* __UTILS_H__ */