pax_global_header00006660000000000000000000000064132342354150014514gustar00rootroot0000000000000052 comment=16f1506a9a4f80ee30dbdb140f689f6b885610ef deepin-picker-1.6.2/000077500000000000000000000000001323423541500142415ustar00rootroot00000000000000deepin-picker-1.6.2/.gitignore000066400000000000000000000000651323423541500162320ustar00rootroot00000000000000Makefile moc_*.o moc_*.cpp *.o build/ *.qm *pro.user deepin-picker-1.6.2/.tx/000077500000000000000000000000001323423541500147525ustar00rootroot00000000000000deepin-picker-1.6.2/.tx/config000066400000000000000000000005011323423541500161360ustar00rootroot00000000000000[main] host = https://www.transifex.com minimum_perc = 80 mode = developer [deepin-picker.deepin-picker] file_filter = translations/deepin-picker_.ts source_file = translations/deepin-picker.ts source_lang = en type = QT [deepin-picker.desktop] source_file = deepin-picker.desktop source_lang = en type = DESKTOP deepin-picker-1.6.2/.tx/deepin-picker.desktop/000077500000000000000000000000001323423541500211415ustar00rootroot00000000000000deepin-picker-1.6.2/.tx/deepin-picker.desktop/am_ET_translation000066400000000000000000000004761323423541500244760ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[am_ET]=ዲፕኢን መራጭ Comment[am_ET]=ቀለም መራጭ Icon[am_ET]=ዲፕኢን መራጭ deepin-picker-1.6.2/.tx/deepin-picker.desktop/ar_translation000066400000000000000000000004741323423541500241110ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[ar]=منتقي الألوان ديبين Comment[ar]=منتقي اللون Icon[ar]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/ast_translation000066400000000000000000000004461323423541500242750ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[ast]=Seleutor Deepin Comment[ast]=Seleutor de color Icon[ast]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/ca_translation000066400000000000000000000004511323423541500240650ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[ca]=Selector del Deepin Comment[ca]=Selector de color Icon[ca]=selector-deepin deepin-picker-1.6.2/.tx/deepin-picker.desktop/cs_translation000066400000000000000000000004401323423541500241050ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[cs]=Sběrač barev Comment[cs]=Sběrač barev Icon[cs]=Sběrač barev deepin-picker-1.6.2/.tx/deepin-picker.desktop/da_translation000066400000000000000000000004351323423541500240700ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[da]=Deepin pipette Comment[da]=Farvevælger Icon[da]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/de_translation000066400000000000000000000004401323423541500240700ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[de]=Deepin Farbpipette Comment[de]=Farbpipette Icon[de]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/es_419_translation000066400000000000000000000004551323423541500245120ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[es_419]=Deepin Picker Comment[es_419]=Selector de color Icon[es_419]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/es_translation000066400000000000000000000004431323423541500241120ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[es]=Selector Deepin Comment[es]=Selector de color Icon[es]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/fr_translation000066400000000000000000000004431323423541500241120ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[fr]=Deepin Picker Comment[fr]=Pipette à couleurs Icon[fr]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/he_translation000066400000000000000000000004541323423541500241010ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[he]=הבוחר של Deepin Comment[he]=בוחר צבעים Icon[he]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/hr_translation000066400000000000000000000004331323423541500241130ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[hr]=Deepin birač Comment[hr]=Birač boja Icon[hr]=deepin-birač deepin-picker-1.6.2/.tx/deepin-picker.desktop/hu_translation000066400000000000000000000004401323423541500241140ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[hu]=Deepin Picker Comment[hu]=Szín felismerő Icon[hu]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/it_translation000066400000000000000000000004341323423541500241170ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[it]=Deepin Picker Comment[it]=Color picker Icon[it]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/lt_translation000066400000000000000000000004501323423541500241200ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[lt]=Deepin parinkiklis Comment[lt]=Spalvos parinkiklis Icon[lt]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/ms_translation000066400000000000000000000004351323423541500241230ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[ms]=Pemilih Warna Comment[ms]=Pemilih warna Icon[ms]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/pl_translation000066400000000000000000000004541323423541500241200ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[pl]=Zbieracz kolorów Deepin Comment[pl]=Zbieracz kolorów Icon[pl]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/pt_BR_translation000066400000000000000000000004541323423541500245130ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[pt_BR]=Deepin Picker Comment[pt_BR]=Selecionador de cor Icon[pt_BR]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/pt_translation000066400000000000000000000004441323423541500241270ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[pt]=Deepin Picker Comment[pt]=Identificador de cor Icon[pt]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/ru_translation000066400000000000000000000004651323423541500241350ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[ru]=Сборщик Deepin Comment[ru]=Выбор цвета Icon[ru]=сборщик-deepin deepin-picker-1.6.2/.tx/deepin-picker.desktop/sk_translation000066400000000000000000000004331323423541500241170ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[sk]=Deepin Výber Comment[sk]=Výber farby Icon[sk]=deepin-vyber deepin-picker-1.6.2/.tx/deepin-picker.desktop/sl_translation000066400000000000000000000004311323423541500241160ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[sl]=Kapalka Deepin Comment[sl]=Kapalka Icon[sl]=kapalka-deepin deepin-picker-1.6.2/.tx/deepin-picker.desktop/tr_translation000066400000000000000000000004361323423541500241320ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[tr]=Deepin Seçici Comment[tr]=Renk seçici Icon[tr]=deepin-seçici deepin-picker-1.6.2/.tx/deepin-picker.desktop/uk_translation000066400000000000000000000004341323423541500241220ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[uk]=Deepin Picker Comment[uk]=Color picker Icon[uk]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/zh_CN_translation000066400000000000000000000004521323423541500245040ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[zh_CN]=深度取色器 Comment[zh_CN]=颜色取色器 Icon[zh_CN]=deepin-picker deepin-picker-1.6.2/.tx/deepin-picker.desktop/zh_TW_translation000066400000000000000000000004451323423541500245400ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations # Translations Name[zh_TW]=Deepin 取色器 Comment[zh_TW]=取色器 Icon[zh_TW]=deepin-picker deepin-picker-1.6.2/CHANGELOG.md000066400000000000000000000023071323423541500160540ustar00rootroot00000000000000# Change Log Simplest color picker. ## [Unreleased] ## [1.6.2] - 2018-1-31 - Update translation - Regenerate screenPixmap when the color is picked, thanks Bet4 - Provide dbus API to make other application can call deepin-picker for color pick ## [1.6.1] - 2017-11-22 - Update translation ## [1.5] - 2017-11-17 ### Features - Install dbus service ### Bug Fixes - Flatpak_icon_workaround - Set color_type default value ## [1.5] - 2017-11-06 - Support FlatPak, add dbus service file - Fix color type can't save in config file with FlatPak environment - Synchronous translations ## [1.4] - 2017-11-02 - Fix mouse event pass to application window under picker ## [1.3] - 2017-11-02 ### Added - Use DBus start process to compatible with FlatPak - Use DBus popup composite warning dialog to compatible with FlatPak ### Fixed - Fix left button got empty color. ## [1.2] - 2017-11-02 ### Added - Support CMYK color - Support HSV color - Support HiDPI - Popup warning dialog if composite is not enable in system - Update translations from transifex.com ### Fixed - Fix the edge of the magnifying glass - Fix color format restore to default after restart - Fix the first system notification can not be hidden immediately deepin-picker-1.6.2/LICENSE000066400000000000000000001045131323423541500152520ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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. But first, please read . deepin-picker-1.6.2/README.md000066400000000000000000000014421323423541500155210ustar00rootroot00000000000000# Deepin Picker Deepin Picker: Simplest color picker. ## Dependencies ## Installation * mkdir build * cd build * qmake .. * make * ./deepin-picker ## Usage ## Config file ## Getting help Any usage issues can ask for help via * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC channel](https://webchat.freenode.net/?channels=deepin) * [Forum](https://bbs.deepin.org) * [WiKi](http://wiki.deepin.org/) ## Getting involved We encourage you to report issues and contribute changes * [Contribution guide for users](http://wiki.deepin.org/index.php?title=Contribution_Guidelines_for_Users) * [Contribution guide for developers](http://wiki.deepin.org/index.php?title=Contribution_Guidelines_for_Developers). ## License Deepin Picker is licensed under [GPLv3](LICENSE). # deepin-picker deepin-picker-1.6.2/com.deepin.Picker.service000066400000000000000000000001061323423541500210550ustar00rootroot00000000000000[D-BUS Service] Name=com.deepin.Picker Exec=/usr/bin/deepin-picker -i deepin-picker-1.6.2/debian/000077500000000000000000000000001323423541500154635ustar00rootroot00000000000000deepin-picker-1.6.2/debian/changelog000066400000000000000000000002331323423541500173330ustar00rootroot00000000000000deepin-picker (1.0.0-1) unstable; urgency=medium * Initial Release. -- Deepin Packages Builder Wed, 11 Oct 2017 17:38:35 +0800 deepin-picker-1.6.2/debian/compat000066400000000000000000000000021323423541500166610ustar00rootroot000000000000009 deepin-picker-1.6.2/debian/control000066400000000000000000000007251323423541500170720ustar00rootroot00000000000000Source: deepin-picker Section: utils Priority: optional Maintainer: Deepin Packages Builder Build-Depends: debhelper (>= 9),pkg-config, qt5-qmake, libxcb-util0-dev, libdtkwidget-dev,qttools5-dev-tools,libqt5svg5-dev,libxtst-dev, Standards-Version: 3.9.8 Homepage: http://www.deepin.org Package: deepin-picker Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Color picker tool for deepin A color picker tool for deepin. deepin-picker-1.6.2/debian/copyright000066400000000000000000000016501323423541500174200ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: deepin-picker Files: * Copyright: 2017 Deepin Technology Co., Ltd. License: GPL-3+ This package 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 3 of the License, or (at your option) any later version. . This package 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, see . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". deepin-picker-1.6.2/debian/rules000077500000000000000000000000631323423541500165420ustar00rootroot00000000000000#!/usr/bin/make -f export QT_SELECT=5 %: dh $@ deepin-picker-1.6.2/debian/source/000077500000000000000000000000001323423541500167635ustar00rootroot00000000000000deepin-picker-1.6.2/debian/source/format000066400000000000000000000000151323423541500201720ustar00rootroot000000000000003.0 (native) deepin-picker-1.6.2/deepin-picker.desktop000066400000000000000000000046111323423541500203550ustar00rootroot00000000000000[Desktop Entry] Categories=Graphics;Picker; Comment=Color picker Exec=deepin-picker Icon=deepin-picker Name=Deepin Picker StartupNotify=true TryExec=deepin-picker Type=Application # Translations Name[zh_CN]=深度取色器 Comment[zh_CN]=颜色取色器 Name[ms] = Pemilih Warna Comment[ms] = Pemilih warna Icon[ms] = deepin-picker Name[lt] = Deepin parinkiklis Comment[lt] = Spalvos parinkiklis Icon[lt] = deepin-picker Name[cs] = Sběrač barev Comment[cs] = Sběrač barev Icon[cs] = Sběrač barev Name[pt] = Deepin Picker Comment[pt] = Identificador de cor Icon[pt] = deepin-picker Name[hr] = Deepin birač Comment[hr] = Birač boja Icon[hr] = deepin-birač Name[pt_BR] = Deepin Picker Comment[pt_BR] = Selecionador de cor Icon[pt_BR] = deepin-picker Icon[zh_CN] = deepin-picker Name[he] = הבוחר של Deepin Comment[he] = בוחר צבעים Icon[he] = deepin-picker Name[ar] = منتقي الألوان ديبين Comment[ar] = منتقي اللون Icon[ar] = deepin-picker Name[sk] = Deepin Výber Comment[sk] = Výber farby Icon[sk] = deepin-vyber Name[es_419] = Deepin Picker Comment[es_419] = Selector de color Icon[es_419] = deepin-picker Name[es] = Selector Deepin Comment[es] = Selector de color Icon[es] = deepin-picker Name[ca] = Selector del Deepin Comment[ca] = Selector de color Icon[ca] = selector-deepin Name[sl] = Kapalka Deepin Comment[sl] = Kapalka Icon[sl] = kapalka-deepin Name[fr] = Deepin Picker Comment[fr] = Pipette à couleurs Icon[fr] = deepin-picker Name[da] = Deepin pipette Comment[da] = Farvevælger Icon[da] = deepin-picker Name[ast] = Seleutor Deepin Comment[ast] = Seleutor de color Icon[ast] = deepin-picker Name[uk] = Deepin Picker Comment[uk] = Color picker Icon[uk] = deepin-picker Name[de] = Deepin Farbpipette Comment[de] = Farbpipette Icon[de] = deepin-picker Name[tr] = Deepin Seçici Comment[tr] = Renk seçici Icon[tr] = deepin-seçici Name[hu] = Deepin Picker Comment[hu] = Szín felismerő Icon[hu] = deepin-picker Name[zh_TW] = Deepin 取色器 Comment[zh_TW] = 取色器 Icon[zh_TW] = deepin-picker Name[pl] = Zbieracz kolorów Deepin Comment[pl] = Zbieracz kolorów Icon[pl] = deepin-picker Name[it] = Deepin Picker Comment[it] = Color picker Icon[it] = deepin-picker Name[am_ET] = ዲፕኢን መራጭ Comment[am_ET] = ቀለም መራጭ Icon[am_ET] = ዲፕኢን መራጭ Name[ru] = Сборщик Deepin Comment[ru] = Выбор цвета Icon[ru] = сборщик-deepin deepin-picker-1.6.2/deepin-picker.pro000066400000000000000000000045721323423541500175120ustar00rootroot00000000000000###################################################################### # Automatically generated by qmake (3.0) ?? 2? 4 17:49:37 2017 ###################################################################### TEMPLATE = app TARGET = deepin-picker CONFIG += link_pkgconfig CONFIG += c++11 PKGCONFIG += xcb xcb-util dtkwidget RESOURCES = deepin-picker.qrc # Input HEADERS += src/picker.h \ src/eventmonitor.h \ src/colormenu.h \ src/clipboard.h \ src/animation.h \ src/dbusnotify.h \ src/settings.h \ src/utils.h SOURCES += src/picker.cpp \ src/eventmonitor.cpp \ src/colormenu.cpp \ src/clipboard.cpp \ src/animation.cpp \ src/dbusnotify.cpp \ src/settings.cpp \ src/utils.cpp \ src/main.cpp QT += core QT += widgets QT += gui QT += network QT += x11extras QT += dbus QT += svg QMAKE_CXXFLAGS += -g LIBS += -lX11 -lXext -lXtst isEmpty(PREFIX){ PREFIX = /usr } isEmpty(BINDIR):BINDIR=/usr/bin isEmpty(ICONDIR):ICONDIR=/usr/share/icons/hicolor/scalable/apps isEmpty(APPDIR):APPDIR=/usr/share/applications isEmpty(DSRDIR):DSRDIR=/usr/share/deepin-picker isEmpty(DOCDIR):DOCDIR=/usr/share/dman/deepin-picker target.path = $$INSTROOT$$BINDIR icon.path = $$INSTROOT$$ICONDIR desktop.path = $$INSTROOT$$APPDIR translations.path = $$INSTROOT$$DSRDIR/translations manual.path = $$INSTROOT$$DOCDIR icon.files = image/deepin-picker.svg desktop.files = deepin-picker.desktop manual.files = manual/* dbus_service.files = $$PWD/com.deepin.Picker.service dbus_service.path = $$PREFIX/share/dbus-1/services INSTALLS += target icon desktop manual dbus_service isEmpty(TRANSLATIONS) { include(translations.pri) } TRANSLATIONS_COMPILED = $$TRANSLATIONS TRANSLATIONS_COMPILED ~= s/\.ts/.qm/g translations.files = $$TRANSLATIONS_COMPILED INSTALLS += translations CONFIG *= update_translations release_translations CONFIG(update_translations) { isEmpty(lupdate):lupdate=lupdate system($$lupdate -no-obsolete -locations none $$_PRO_FILE_) } CONFIG(release_translations) { isEmpty(lrelease):lrelease=lrelease system($$lrelease $$_PRO_FILE_) } DSR_LANG_PATH += $$DSRDIR/translations DEFINES += "DSR_LANG_PATH=\\\"$$DSR_LANG_PATH\\\"" deepin-picker-1.6.2/deepin-picker.qrc000066400000000000000000000002101323423541500174600ustar00rootroot00000000000000 image/shadow.png image/logo.svg deepin-picker-1.6.2/image/000077500000000000000000000000001323423541500153235ustar00rootroot00000000000000deepin-picker-1.6.2/image/deepin-picker.svg000066400000000000000000000367511323423541500205770ustar00rootroot00000000000000 deepin-picker Created with Sketch. deepin-picker-1.6.2/image/logo.svg000066400000000000000000000367511323423541500170200ustar00rootroot00000000000000 deepin-picker Created with Sketch. deepin-picker-1.6.2/image/shadow.png000066400000000000000000000144211323423541500173200ustar00rootroot00000000000000PNG  IHDRwJsRGBIDATx흉8rEg<=ޗk",0^\GIesҙاuBF T]'%^^WUՒQWx9W%>}CT=X*o{cM3dZ&ļ?\:MʲPYW%2\6ۮkW%HIy>m"x\R-pU`u )U>7-SaY> \kg/qU3zoڅ}>gK./ nqZʗ%|l K^h_ =tPOH4eH-Oђߞ^{}x`%YߵoޒY6rI Eɼ.*|L#B,,WhV+>cQ]cL/Go|^θm5Bw.^_ZKCO2_[s\maoTY[JTm"\ĸA5Rs;\ :V^*7v-snx"n5JwE|ʋ%*<;@'|7mXvT`/Ykm--X]{lɐ6s4K+x#+oy`#gsmH*yXQO \y-򻶣x̝Țo-5bFϼe:Uu#._ZǢ3 -)%A~;V2cQO"%Cg`+;"=u/v %uh:`EXsH{hVY߲(0T+8~gבvo % Mت -ϴil@;ϬT>Q9Ȋǻv/ +>M7b+@stB+Y{uRqoDaVX X M[ EKK7wZ> | 7(%Xa\~fOc ,ow !cQ` ߉,I*OOKQ__B<hV(3B^pI)%JpӛrdbWbQ ϳi; ,W>V- w, D!놕zRaΰE(0do V84[Jf_X2v` )Kʷ(0@?m+[m/T"Ckw%(Э,uJC(%a+Yϋ#Q\:EK{W)dY#`J(כ2fgxZ{VZr,jĢ8`JQa)@Ud!_=Ry6|) +<VPkwcF{uN)sT9"Q`5ޭŠTnC9UY[p`9`F j{f[J(fGe:Q W+o49@RE(0^nz{u (PbRo]Z8> Dn*[S/> D QK7Rs7e# ,X{ce*(z, PjU$]9XUhV (*KuI`+%M(ЭѵGM+ywX<V@%aoʘQ)vX]@UVf {'ZJjGU[/ B@ E(pSLC֊ۇ5@!`+,'Zw{X3 D)wJhPnr| ~Q[,a4Q`SYꆶX*4 o3gD(.h{Ue*wDY} ujK4Jb} Ҫ% 5bQ`+G^ai̻XrSz|v+X+eG ] v K`iƼ[kqTRFaYlKQ4^xNR@Njtnk4$,U&> V@N*K;X:@g wCQ, e&-g!w|, D+PҏϘ V%FX:VNLKa,w :D&B, `bv,6w}n \E"* ȁKᗯtC5~rSA8D] aM,wXF]_ZWFFX%b5YC<9}v]o$J䅖6FC(G.â+HXݴSX8Ditv4B)1OیES*kt6X:'+#_r "EPa:,ҿ--@ӇX8 cïk `djvcQ`k|D5U<>f?bRQX[/7Tk-`(8~m%vh>/VvM`IFZĢES] 򢩊%+x[cTM^*ʳKaZXکQm+OS&K_][UŠU= -ڪN{UG8 FUaE(1ۻDW?M\ ޺r(G|nu)[[KH붑i?ީ寰]7{nn`鋐eݮL> K[uܺi #i[6v_=%Z,BXh|, lӗL2إ_wK*5r~mcQ] Q[p6^HhU&~Kjd5N[K[NL엎}L=|XC(zV߭ҹG@ڻCp\aFַuX!Kc˰/F+P#~tX:\ ñDaM 0v ײ'``VXk7/P"6BDV". Ïo7`@c*V*#kZQ|, ,UyD"̺֯KXȽKnA[- .cQWidSOk^nrZWm L~f^ށ&NG5s k}dd%v\/_5V`iD< 8wYykՎ㧰Oh([#a`傎,0 n!r]S_.&X`; рS3k.|ΙètD`B]A0R.eKgUW3(tT`XhOZ.%oK%aK`q*0 /ep^sQhI,yв_[2 :Hns%r-p U'h; 8Pz=֏jjTe4S+9fPM*8I` *FWAeyyJ2@v)SM ̱1K_s_8^®X|v8bc`,3To.eWA\{s/OZTnh/NT*c0'rC3}?=cU'"%\ {;eE<=qQw, '"SKA )yGPK=.myin\|Յ<B,RPr)GJ|:1'D& F]pOvk4RNAu[&4)Du=Su"o\NZ뤬=k8Ձ~ T[NϹ&(:}?`S6 h+B<=x^}0PnO=z]mۋ(070bټ@<)bUyx ?78Wuc=NBWɾQ׷]_u*07pاUGx@BZ󖳬u4~݇ y[[\=?QUNT`)3_a4?u4~-syj{s5zzoU:6syc=u2u(t7R( OOReWD U@Q D(@Q D ?ł8{]PIENDB`deepin-picker-1.6.2/src/000077500000000000000000000000001323423541500150305ustar00rootroot00000000000000deepin-picker-1.6.2/src/animation.cpp000066400000000000000000000062241323423541500175170ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "animation.h" #include "utils.h" #include #include #include #include Animation::Animation(int x, int y, QPixmap pixmap, QColor color, QWidget *parent) : QWidget(parent) { // Init window flags to make window transparent and get correctly behavior. setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool); setAttribute(Qt::WA_TranslucentBackground, true); setMouseTracking(true); installEventFilter(this); // Init attributes. animationDuration = 25; animationFrames = 12; blockHeight = 20; blockWidth = 20; cursorColor = color; cursorX = x; cursorY = y; height = 220; renderTicker = 0; screenshotPixmap = pixmap; width = 220; // Move and resize window. move(x - width / 2, y - height / 2); resize(width, height); // Start animation when module init. renderTimer = new QTimer(); connect(renderTimer, SIGNAL(timeout()), this, SLOT(renderAnimation())); renderTimer->start(animationDuration); } Animation::~Animation() { delete renderTimer; } void Animation::paintEvent(QPaintEvent *) { // Make clip radius change along with ticker. qreal devicePixelRatio = qApp->devicePixelRatio(); int radius = screenshotPixmap.width() / 2 * (1 - Utils::easeInOut(renderTicker * 1.0 / animationFrames)); radius = radius / devicePixelRatio; int width = rect().width(); int height = rect().height(); // Init painter. QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); // Make opacity change along with ticker. painter.setOpacity(Utils::easeInOut(renderTicker * 1.0 / animationFrames)); // Draw screenshot pixmap. QPainterPath circlePath; circlePath.addEllipse(width / 2 - radius, height / 2 - radius, radius * 2, radius * 2); painter.setClipPath(circlePath); painter.drawPixmap(width / 2 - radius, height / 2 - radius, screenshotPixmap); } void Animation::renderAnimation() { if (renderTicker < animationFrames) { renderTicker++; repaint(); } else { renderTimer->stop(); hide(); // hide window when animation finish emit finish(); } } deepin-picker-1.6.2/src/animation.h000066400000000000000000000030731323423541500171630ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef ANIMATION_H #define ANIMATION_H #include #include #include #include class Animation : public QWidget { Q_OBJECT public: Animation(int x, int y, QPixmap pixmap, QColor color, QWidget *parent=0); ~Animation(); public slots: void renderAnimation(); signals: void finish(); protected: void paintEvent(QPaintEvent *); private: QColor cursorColor; QPixmap screenshotPixmap; QTimer *renderTimer; int animationDuration; int animationFrames; int blockHeight; int blockWidth; int cursorX; int cursorY; int height; int renderTicker; int width; }; #endif deepin-picker-1.6.2/src/clipboard.cpp000066400000000000000000000051021323423541500174710ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "clipboard.h" #include "dbusnotify.h" #include "settings.h" #include "utils.h" #include #include #include #include Clipboard::Clipboard(QObject *parent) : QObject(parent) { } Clipboard::~Clipboard() { } void Clipboard::copyToClipboard(QColor color, QString colorType) { // Save color type to config file. QString colorString; if (colorType == "HEX") { colorString = Utils::colorToHex(color); } else if (colorType == "RGB") { colorString = Utils::colorToRGB(color); } else if (colorType == "RGBA") { colorString = Utils::colorToRGBA(color); } else if (colorType == "Float_RGB") { colorString = Utils::colorToFloatRGB(color); } else if (colorType == "Float_RGBA") { colorString = Utils::colorToFloatRGBA(color); } else if (colorType == "CMYK") { colorString = Utils::colorToCMYK(color); } else if (colorType == "HSV") { colorString = Utils::colorToHSV(color); } Settings *settings = new Settings(); settings->setOption("color_type", colorType); // Popup notify. DBusNotify *notifyDBus = new DBusNotify(this); notifyDBus->CloseNotification(0); // we need hide last time system notify first QStringList actions; QVariantMap hints; notifyDBus->Notify( QCoreApplication::applicationName(), 0, "deepin-picker", "", QString(tr("Copy color %1 to clipboard")).arg(colorString), // body actions, hints, 0); // Copy to clipbard. QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(colorString); // Quit application. QApplication::quit(); } deepin-picker-1.6.2/src/clipboard.h000066400000000000000000000022401323423541500171360ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef CLIPBOARD_H #define CLIPBOARD_H #include #include class Clipboard : public QObject { Q_OBJECT public: Clipboard(QObject *parent=0); ~Clipboard(); public slots: void copyToClipboard(QColor color, QString colorString); }; #endif deepin-picker-1.6.2/src/colormenu.cpp000066400000000000000000000145131323423541500175430ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "colormenu.h" #include "settings.h" #include #include "utils.h" #include #include #include #include #include #include #include ColorMenu::ColorMenu(int x, int y, int size, QColor color, QWidget *parent) : QWidget(parent) { // Init window flags. setWindowFlags(Qt::FramelessWindowHint | Qt::Tool); setAttribute(Qt::WA_TranslucentBackground, true); setMouseTracking(true); installEventFilter(this); // Init attributes. clickMenuItem = false; menuOffsetX = 10; menuOffsetY = 40; shadowBottomMargin = 20; shadowXMargin = 20; windowColor = color; windowSize = size; windowX = x; windowY = y; // Add drop shadow window effect. QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(); effect->setColor(QColor(0, 0, 0, 255 * 2 / 10)); effect->setBlurRadius(10); effect->setXOffset(0); effect->setYOffset(5); this->setGraphicsEffect(effect); // Build menu and menu actions. colorMenu = new QMenu(); connect(colorMenu, &QMenu::aboutToHide, this, [&]() { QTimer::singleShot(200, this, [&]() { if (!clickMenuItem) { exit(); } }); }); rgbAction = new QAction("RGB", this); rgbAction->setCheckable(true); connect(rgbAction, &QAction::triggered, this, &ColorMenu::copyRGBColor); rgbFloatAction = new QAction("RGB (1.0)", this); rgbFloatAction->setCheckable(true); connect(rgbFloatAction, &QAction::triggered, this, &ColorMenu::copyFloatRGBColor); rgbaAction = new QAction("RGBA", this); rgbaAction->setCheckable(true); connect(rgbaAction, &QAction::triggered, this, &ColorMenu::copyRGBAColor); rgbaFloatAction = new QAction("RGBA (1.0)", this); rgbaFloatAction->setCheckable(true); connect(rgbaFloatAction, &QAction::triggered, this, &ColorMenu::copyFloatRGBAColor); hexAction = new QAction("HEX", this); hexAction->setCheckable(true); connect(hexAction, &QAction::triggered, this, &ColorMenu::copyHexColor); cmykAction = new QAction("CMYK", this); cmykAction->setCheckable(true); connect(cmykAction, &QAction::triggered, this, &ColorMenu::copyCmykColor); hsvAction = new QAction("HSV", this); hsvAction->setCheckable(true); connect(hsvAction, &QAction::triggered, this, &ColorMenu::copyHsvColor); colorMenu->addAction(rgbAction); colorMenu->addAction(rgbFloatAction); colorMenu->addAction(rgbaAction); colorMenu->addAction(rgbaFloatAction); colorMenu->addAction(hexAction); colorMenu->addAction(cmykAction); colorMenu->addAction(hsvAction); // Set menu action check status with color type. Settings *settings = new Settings(); QString colorType = settings->getOption("color_type", "HEX").toString(); if (colorType == "HEX") { hexAction->setChecked(true); } else if (colorType == "RGB") { rgbAction->setChecked(true); } else if (colorType == "RGBA") { rgbaAction->setChecked(true); } else if (colorType == "Float_RGB") { rgbFloatAction->setChecked(true); } else if (colorType == "Float_RGBA") { rgbaFloatAction->setChecked(true); } else if (colorType == "CMYK") { cmykAction->setChecked(true); } else if (colorType == "HSV") { hsvAction->setChecked(true); } // Move and resize window. move(x - shadowXMargin, y); resize(windowSize + shadowXMargin * 2, windowSize + shadowBottomMargin); } ColorMenu::~ColorMenu() { delete hexAction; delete rgbAction; delete rgbFloatAction; delete rgbaAction; delete rgbaFloatAction; delete cmykAction; delete colorMenu; } void ColorMenu::paintEvent(QPaintEvent *) { int x = shadowXMargin; QPainter painter(this); painter.setOpacity(1); painter.setRenderHint(QPainter::Antialiasing, false); painter.setBrush(windowColor); painter.drawRect(QRect(x + 1, 1, windowSize - 3, windowSize - 3)); painter.setPen(windowColor); painter.drawRect(QRect(x + 1, 1, windowSize - 3, windowSize - 3)); painter.setRenderHint(QPainter::Antialiasing, false); QPen outsidePen("#000000"); outsidePen.setWidth(1); painter.setOpacity(0.2); painter.setPen(outsidePen); painter.drawRect(QRect(x, 0, windowSize - 1, windowSize - 1)); painter.setRenderHint(QPainter::Antialiasing, false); QPen insidePen("#ffffff"); insidePen.setWidth(2); insidePen.setJoinStyle(Qt::MiterJoin); painter.setOpacity(0.5); painter.setPen(insidePen); painter.drawRect(QRect(x + 2, 2, windowSize - 4, windowSize - 4)); } void ColorMenu::showMenu() { colorMenu->exec(QPoint(windowX - windowSize / 2 + menuOffsetX, windowY - windowSize / 2 + menuOffsetY)); } void ColorMenu::copyRGBColor() { clickMenuItem = true; copyColor(windowColor, "RGB"); } void ColorMenu::copyFloatRGBColor() { clickMenuItem = true; copyColor(windowColor, "Float_RGB"); } void ColorMenu::copyRGBAColor() { clickMenuItem = true; copyColor(windowColor, "RGBA"); } void ColorMenu::copyFloatRGBAColor() { clickMenuItem = true; copyColor(windowColor, "Float_RGBA"); } void ColorMenu::copyHexColor() { clickMenuItem = true; copyColor(windowColor, "HEX"); } void ColorMenu::copyCmykColor() { clickMenuItem = true; copyColor(windowColor, "CMYK"); } void ColorMenu::copyHsvColor() { clickMenuItem = true; copyColor(windowColor, "HSV"); } deepin-picker-1.6.2/src/colormenu.h000066400000000000000000000037521323423541500172130ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef COLORMENU_H #define COLORMENU_H #include #include #include #include #include class ColorMenu : public QWidget { Q_OBJECT public: ColorMenu(int x, int y, int size, QColor color, QWidget *parent=0); ~ColorMenu(); signals: void copyColor(QColor color, QString colorType); void exit(); public slots: void copyFloatRGBAColor(); void copyFloatRGBColor(); void copyHexColor(); void copyCmykColor(); void copyHsvColor(); void copyRGBAColor(); void copyRGBColor(); void showMenu(); protected: void paintEvent(QPaintEvent *); private: QAction *hexAction; QAction *rgbAction; QAction *rgbFloatAction; QAction *rgbaAction; QAction *rgbaFloatAction; QAction *cmykAction; QAction *hsvAction; QColor windowColor; QMenu *colorMenu; bool clickMenuItem; int menuOffsetX; int menuOffsetY; int shadowBottomMargin; int shadowXMargin; int windowSize; int windowX; int windowY; }; #endif deepin-picker-1.6.2/src/dbusnotify.cpp000066400000000000000000000037241323423541500177300ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * Maintainer: Peng Hui * * 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 3 of the License, or * 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, see . */ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp -c DBusNotify -p dbusnotify org.freedesktop.Notifications.xml * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #include "dbusnotify.h" /* * Implementation of interface class DBusNotify */ const QString NOTIFY_DBUS_NAME = "org.freedesktop.Notifications"; const QString NOTIFY_DBUS_PATH = "/org/freedesktop/Notifications"; DBusNotify::DBusNotify(QObject *parent) : QDBusAbstractInterface(NOTIFY_DBUS_NAME, NOTIFY_DBUS_PATH, staticInterfaceName(), QDBusConnection::sessionBus(), parent) { QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); } DBusNotify::~DBusNotify() { QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); } deepin-picker-1.6.2/src/dbusnotify.h000066400000000000000000000120621323423541500173700ustar00rootroot00000000000000/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * 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 3 of the License, or * 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, see . */ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp -c DBusNotify -p dbusnotify org.freedesktop.Notifications.xml * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DBUSNOTIFY_H #define DBUSNOTIFY_H #include #include #include #include #include #include #include #include /* * Proxy class for interface org.freedesktop.Notifications */ class DBusNotify: public QDBusAbstractInterface { Q_OBJECT Q_SLOT void __propertyChanged__(const QDBusMessage& msg) { QList arguments = msg.arguments(); if (3 != arguments.count()) return; QString interfaceName = msg.arguments().at(0).toString(); if (interfaceName !="org.freedesktop.Notifications") return; QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); QStringList keys = changedProps.keys(); foreach(const QString &prop, keys) { const QMetaObject* self = metaObject(); for (int i=self->propertyOffset(); i < self->propertyCount(); ++i) { QMetaProperty p = self->property(i); if (p.name() == prop) { Q_EMIT p.notifySignal().invoke(this); } } } } public: static inline const char *staticInterfaceName() { return "org.freedesktop.Notifications"; } public: DBusNotify(QObject *parent = 0); ~DBusNotify(); public Q_SLOTS: // METHODS inline QDBusPendingReply<> ClearRecords() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("ClearRecords"), argumentList); } inline QDBusPendingReply<> CloseNotification(uint in0) { QList argumentList; argumentList << QVariant::fromValue(in0); return asyncCallWithArgumentList(QStringLiteral("CloseNotification"), argumentList); } inline QDBusPendingReply GetAllRecords() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetAllRecords"), argumentList); } inline QDBusPendingReply GetCapbilities() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetCapbilities"), argumentList); } inline QDBusPendingReply GetServerInformation() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetServerInformation"), argumentList); } inline QDBusReply GetServerInformation(QString &out1, QString &out2, QString &out3) { QList argumentList; QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetServerInformation"), argumentList); if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 4) { out1 = qdbus_cast(reply.arguments().at(1)); out2 = qdbus_cast(reply.arguments().at(2)); out3 = qdbus_cast(reply.arguments().at(3)); } return reply; } inline QDBusPendingReply Notify(const QString &in0, uint in1, const QString &in2, const QString &in3, const QString &in4, const QStringList &in5, const QVariantMap &in6, int in7) { QList argumentList; argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6) << QVariant::fromValue(in7); return asyncCallWithArgumentList(QStringLiteral("Notify"), argumentList); } inline QDBusPendingReply<> RemoveRecord(const QString &in0) { QList argumentList; argumentList << QVariant::fromValue(in0); return asyncCallWithArgumentList(QStringLiteral("RemoveRecord"), argumentList); } Q_SIGNALS: // SIGNALS void ActionInvoked(uint in0, const QString &in1); void NotificationClosed(uint in0, uint in1); void RecordAdded(const QString &in0); }; namespace org { namespace freedesktop { typedef ::DBusNotify Notifications; } } #endif deepin-picker-1.6.2/src/eventmonitor.cpp000066400000000000000000000115751323423541500202760ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "eventmonitor.h" #include EventMonitor::EventMonitor(QObject *parent) : QThread(parent) { isPress = false; } void EventMonitor::run() { // Init x11 display. Display* display = XOpenDisplay(0); if (display == 0) { fprintf(stderr, "unable to open display\n"); return; } // Receive from ALL clients, including future clients. XRecordClientSpec clients = XRecordAllClients; XRecordRange* range = XRecordAllocRange(); if (range == 0) { fprintf(stderr, "unable to allocate XRecordRange\n"); return; } // Receive KeyPress, KeyRelease, ButtonPress, ButtonRelease and MotionNotify events. memset(range, 0, sizeof(XRecordRange)); range->device_events.first = KeyPress; range->device_events.last = MotionNotify; // And create the XRECORD context. XRecordContext context = XRecordCreateContext(display, 0, &clients, 1, &range, 1); if (context == 0) { fprintf(stderr, "XRecordCreateContext failed\n"); return; } XFree(range); // Sync x11 display message. XSync(display, True); Display* display_datalink = XOpenDisplay(0); if (display_datalink == 0) { fprintf(stderr, "unable to open second display\n"); return; } // Enter in xrecord event loop. if (!XRecordEnableContext(display_datalink, context, callback, (XPointer) this)) { fprintf(stderr, "XRecordEnableContext() failed\n"); return; } } void EventMonitor::callback(XPointer ptr, XRecordInterceptData* data) { ((EventMonitor *) ptr)->handleRecordEvent(data); } void EventMonitor::handleRecordEvent(XRecordInterceptData* data) { if (data->category == XRecordFromServer) { xEvent * event = (xEvent *)data->data; switch (event->u.u.type) { case ButtonPress: if (filterWheelEvent(event->u.u.detail)) { isPress = true; if (event->u.u.detail == Button1) { emit leftButtonPress( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } else if (event->u.u.detail == Button3) { emit rightButtonPress( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } } break; case MotionNotify: if (isPress) { emit mouseDrag( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } else { emit mouseMove( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } break; case ButtonRelease: if (filterWheelEvent(event->u.u.detail)) { isPress = false; if (event->u.u.detail == Button1) { emit leftButtonRelease( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } else if (event->u.u.detail == Button3) { emit rightButtonRelease( event->u.keyButtonPointer.rootX, event->u.keyButtonPointer.rootY); } } break; case KeyPress: emit keyPress(((unsigned char*) data->data)[1]); // If key is equal to esc, emit pressEsc signal. if (((unsigned char*) data->data)[1] == 9) { emit pressEsc(); } break; case KeyRelease: emit keyRelease(((unsigned char*) data->data)[1]); break; default: break; } } fflush(stdout); XRecordFreeData(data); } bool EventMonitor::filterWheelEvent(int detail) { return detail != WheelUp && detail != WheelDown && detail != WheelLeft && detail != WheelRight; } deepin-picker-1.6.2/src/eventmonitor.h000066400000000000000000000036041323423541500177350ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef EVENTMONITOR_H #define EVENTMONITOR_H #include #include #include // Virtual button codes that are not defined by X11. #define Button1 1 #define Button2 2 #define Button3 3 #define WheelUp 4 #define WheelDown 5 #define WheelLeft 6 #define WheelRight 7 #define XButton1 8 #define XButton2 9 class EventMonitor : public QThread { Q_OBJECT public: EventMonitor(QObject *parent = 0); signals: void keyPress(int code); void keyRelease(int code); void leftButtonPress(int x, int y); void leftButtonRelease(int x, int y); void mouseDrag(int x, int y); void mouseMove(int x, int y); void pressEsc(); void rightButtonPress(int x, int y); void rightButtonRelease(int x, int y); protected: static void callback(XPointer trash, XRecordInterceptData* data); bool filterWheelEvent(int detail); void handleRecordEvent(XRecordInterceptData *); void run(); private: bool isPress; }; #endif deepin-picker-1.6.2/src/main.cpp000066400000000000000000000117261323423541500164670ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include #include #include #include #include #include #include #include #include #include #include #include #include "utils.h" #include "clipboard.h" #include "picker.h" #include "eventmonitor.h" DWIDGET_USE_NAMESPACE int main(int argc, char *argv[]) { // Load DTK xcb plugin. DApplication::loadDXcbPlugin(); // Init attributes. const char *descriptionText = QT_TRANSLATE_NOOP("MainWindow", "Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked." ); const QString acknowledgementLink = "https://www.deepin.org/acknowledgments/deepin-picker"; // Init dtk application's attrubites. DApplication app(argc, argv); if (!DWindowManagerHelper::instance()->hasComposite()) { Utils::warnNoComposite(); return 0; } app.loadTranslator(); app.setOrganizationName("deepin"); app.setApplicationName("deepin-picker"); app.setApplicationVersion("1.2"); app.setProductIcon(QIcon(Utils::getQrcPath("logo_96.svg"))); app.setProductName(DApplication::translate("MainWindow", "Deepin Picker")); app.setApplicationDescription(DApplication::translate("MainWindow", descriptionText) + "\n"); app.setApplicationAcknowledgementPage(acknowledgementLink); app.setWindowIcon(QIcon(Utils::getQrcPath("logo_48.png"))); QCommandLineParser parser; const QCommandLineOption appidOption("i", "Id for app caller, suggestion add current time in app id"); parser.addOption(appidOption); parser.process(app); bool isLaunchByDBus = parser.isSet(appidOption); // Init modules. Clipboard *clipboard = new Clipboard(); Picker *picker = new Picker(isLaunchByDBus); if (!isLaunchByDBus) { picker->StartPick(""); } EventMonitor eventMonitor; // Exit xrecord thread when copy color to system clipboard. QObject::connect(picker, &Picker::copyColor, clipboard, [&] () { eventMonitor.terminate(); }); // Exit application when module trigger exit signal. QObject::connect(picker, &Picker::exit, clipboard, [&] () { eventMonitor.terminate(); QApplication::quit(); }); // Exit application when user press esc to cancel pick. QObject::connect(&eventMonitor, &EventMonitor::pressEsc, clipboard, [&] () { eventMonitor.terminate(); QApplication::quit(); }); // Trigger copyToClipboard slot when got copyColor signal. QObject::connect(picker, &Picker::copyColor, clipboard, &Clipboard::copyToClipboard, Qt::QueuedConnection); // Binding handler to xrecord signal. QObject::connect(&eventMonitor, &EventMonitor::mouseMove, picker, &Picker::handleMouseMove, Qt::QueuedConnection); QObject::connect(&eventMonitor, &EventMonitor::leftButtonPress, picker, &Picker::handleLeftButtonPress, Qt::QueuedConnection); QObject::connect(&eventMonitor, &EventMonitor::rightButtonRelease, picker, &Picker::handleRightButtonRelease, Qt::QueuedConnection); // Start event monitor thread. eventMonitor.start(); if (isLaunchByDBus) { QDBusConnection dbus = QDBusConnection::sessionBus(); if (dbus.registerService("com.deepin.Picker")) { dbus.registerObject("/com/deepin/Picker", picker, QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportScriptableSignals); } } return app.exec(); } deepin-picker-1.6.2/src/picker.cpp000066400000000000000000000172351323423541500170210ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "picker.h" #include "animation.h" #include "settings.h" #include "utils.h" #include "colormenu.h" #include #include #include #include #include #include #include #include #include #include #include Picker::Picker(bool launchByDBus) { // Init app id. isLaunchByDBus = launchByDBus; // Init window flags. setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool); setAttribute(Qt::WA_TranslucentBackground, true); setMouseTracking(true); installEventFilter(this); // Init attributes. blockHeight = 20; blockWidth = 20; displayCursorDot = false; height = 220; screenshotSize = 11; width = 220; windowHeight = 236; windowWidth = 236; shadowPixmap = new QPixmap(Utils::getQrcPath("shadow.png")); // Init update screenshot timer. updateScreenshotTimer = new QTimer(this); updateScreenshotTimer->setSingleShot(true); connect(updateScreenshotTimer, SIGNAL(timeout()), this, SLOT(updateScreenshot())); // Init window size and position. screenPixmap = QApplication::primaryScreen()->grabWindow(0); resize(screenPixmap.size()); move(0, 0); } Picker::~Picker() { delete animation; delete menu; delete shadowPixmap; delete updateScreenshotTimer; } void Picker::paintEvent(QPaintEvent *) { } void Picker::handleMouseMove(int, int) { // Update screenshot. if (updateScreenshotTimer->isActive()) { updateScreenshotTimer->stop(); } updateScreenshotTimer->start(5); } void Picker::updateScreenshot() { if (!displayCursorDot && isVisible()) { // Get cursor coordinate. cursorX = QCursor::pos().x(); cursorY = QCursor::pos().y(); // Need add offset to make drop shadow's position correctly. int offsetX = (windowWidth - width) / 2; int offsetY = (windowHeight - height) / 2; // Get image under cursor. qreal devicePixelRatio = qApp->devicePixelRatio(); int size = screenshotSize / devicePixelRatio; screenshotPixmap = QApplication::primaryScreen()->grabWindow( 0, cursorX - size / 2, cursorY - size / 2, size, size).scaled(width * devicePixelRatio, height * devicePixelRatio); // Clip screenshot pixmap to circle. // NOTE: need copy pixmap here, otherwise we will got bad circle. QPixmap cursorPixmap = *shadowPixmap; QPainter painter(&cursorPixmap); painter.setRenderHint(QPainter::Antialiasing, true); painter.save(); QPainterPath circlePath; circlePath.addEllipse(2 + offsetX, 2 + offsetY, width - 4, height - 4); painter.setClipPath(circlePath); painter.drawPixmap(1 + offsetX, 1 + offsetY, screenshotPixmap); painter.restore(); // Draw circle bound. int outsidePenWidth = 1; QPen outsidePen("#000000"); outsidePen.setWidth(outsidePenWidth); painter.setOpacity(0.05); painter.setPen(outsidePen); painter.drawEllipse(1 + offsetX, 1 + offsetY, width - 2, height - 2); int insidePenWidth = 4; QPen insidePen("#ffffff"); insidePen.setWidth(insidePenWidth); painter.setOpacity(0.5); painter.setPen(insidePen); painter.drawEllipse(3 + offsetX, 3 + offsetY, width - 6, height - 6); // Draw focus block. painter.setOpacity(1); painter.setRenderHint(QPainter::Antialiasing, false); painter.setOpacity(0.2); painter.setPen("#000000"); painter.drawRect(QRect(width / 2 - blockWidth / 2 + offsetX, height / 2 - blockHeight / 2 + offsetY, blockWidth, blockHeight)); painter.setOpacity(1); painter.setPen("#ffffff"); painter.drawRect(QRect(width / 2 - blockWidth / 2 + 1 + offsetX, height / 2 - blockHeight / 2 + 1 + offsetY, blockWidth - 2, blockHeight - 2)); // Set screenshot as cursor. QApplication::setOverrideCursor(QCursor(cursorPixmap)); } } void Picker::handleLeftButtonPress(int x, int y) { if (!displayCursorDot && isVisible()) { // Rest cursor and hide window. // NOTE: Don't call hide() at here, let process die, // Otherwise mouse event will pass to application window under picker. QApplication::setOverrideCursor(Qt::ArrowCursor); // Rest color type to hex if config file not exist. Settings *settings = new Settings(); // Emit copyColor signal to copy color to system clipboard. cursorColor = getColorAtCursor(x, y); copyColor(cursorColor, settings->getOption("color_type", "HEX").toString()); // Send colorPicked signal when call by DBus and no empty appid. if (isLaunchByDBus && appid != "") { colorPicked(appid, Utils::colorToHex(cursorColor)); } } } void Picker::handleRightButtonRelease(int x, int y) { if (!displayCursorDot && isVisible()) { // Set displayCursorDot flag when click right button. displayCursorDot = true; cursorColor = getColorAtCursor(x, y); // Popup color menu window. qreal devicePixelRatio = qApp->devicePixelRatio(); menu = new ColorMenu( x / devicePixelRatio - blockWidth / 2, y / devicePixelRatio - blockHeight / 2, blockWidth, cursorColor); connect(menu, &ColorMenu::copyColor, this, &Picker::copyColor, Qt::QueuedConnection); connect(menu, &ColorMenu::exit, this, &Picker::exit, Qt::QueuedConnection); menu->show(); menu->setFocus(); // set focus to monitor 'aboutToHide' signal of color menu // Display animation before poup color menu. animation = new Animation(x / devicePixelRatio, y / devicePixelRatio, screenshotPixmap, cursorColor); connect(animation, &Animation::finish, this, &Picker::popupColorMenu, Qt::QueuedConnection); // Rest cursor to default cursor. QApplication::setOverrideCursor(Qt::ArrowCursor); // Show animation after rest cursor to avoid flash screen. animation->show(); } } QColor Picker::getColorAtCursor(int x, int y) { screenPixmap = QApplication::primaryScreen()->grabWindow(0); return QColor(screenPixmap.copy(x, y, 1, 1).toImage().pixel(0, 0)); } void Picker::popupColorMenu() { // Hide picker main window and popup color menu. // NOTE: Don't call hide() at here, let process die, // Otherwise mouse event will pass to application window under picker. menu->showMenu(); } void Picker::StartPick(QString id) { // Update app id. appid = id; // Show window. show(); // Update screenshot when start. updateScreenshot(); } deepin-picker-1.6.2/src/picker.h000066400000000000000000000043361323423541500164640ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef PICKER_H #define PICKER_H #include #include #include "colormenu.h" #include "animation.h" #include #include class Picker : public QWidget { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.deepin.Picker") public: Picker(bool launchByDBus); ~Picker(); QColor getColorAtCursor(int x, int y); signals: void copyColor(QColor color, QString colorType); void exit(); Q_SCRIPTABLE void colorPicked(QString appid, QString color); public slots: void handleLeftButtonPress(int x, int y); void handleMouseMove(int x, int y); void handleRightButtonRelease(int x, int y); void popupColorMenu(); void updateScreenshot(); Q_SCRIPTABLE void StartPick(QString appid); protected: void paintEvent(QPaintEvent *); private: Animation *animation; ColorMenu *menu; QPixmap *shadowPixmap; QPixmap screenPixmap; QPixmap screenshotPixmap; QTimer *updateScreenshotTimer; QColor cursorColor; bool displayCursorDot; int blockHeight; int blockWidth; int cursorX; int cursorY; int height; int screenshotSize; int width; int windowHeight; int windowWidth; bool isLaunchByDBus; QString appid; }; #endif deepin-picker-1.6.2/src/settings.cpp000066400000000000000000000034511323423541500173770ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include #include #include #include "settings.h" #include Settings::Settings(QObject *parent) : QObject(parent) { // Init. settings = new QSettings(configPath()); groupName = "Configure"; } Settings::~Settings() { delete settings; } QString Settings::configPath() { QString path = QString("%1/%2/config.conf"). arg(qApp->organizationName()). arg(qApp->applicationName()); return path; } QVariant Settings::getOption(const QString &key, const QVariant &defaultValue) { QVariant result; settings->beginGroup(groupName); result = settings->value(key, defaultValue); settings->endGroup(); return result; } void Settings::setOption(const QString &key, const QVariant &value) { settings->beginGroup(groupName); settings->setValue(key, value); settings->endGroup(); settings->sync(); } deepin-picker-1.6.2/src/settings.h000066400000000000000000000024451323423541500170460ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #ifndef SETTINGS_H #define SETTINGS_H #include class Settings : public QObject { Q_OBJECT public: Settings(QObject *parent = 0); ~Settings(); QString configPath(); QVariant getOption(const QString &key, const QVariant &defaultValue); void setOption(const QString &key, const QVariant &value); private: QSettings* settings; QString groupName; }; #endif // SETTINGS_H deepin-picker-1.6.2/src/utils.cpp000066400000000000000000000057751323423541500167120ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include "utils.h" #include #include #include #include #include #include #include #include #include static const QString WarningDialogService = "com.deepin.dde.WarningDialog"; static const QString WarningDialogPath = "/com/deepin/dde/WarningDialog"; static const QString WarningDialogInterface = "com.deepin.dde.WarningDialog"; QString Utils::getQrcPath(QString imageName) { return QString(":/image/%1").arg(imageName); } QString Utils::getQssPath(QString qssName) { return QString(":/qss/%1").arg(qssName); } QString Utils::colorToHex(QColor color) { return color.name().toUpper(); } QString Utils::colorToCMYK(QColor color) { return QString("(%1, %2, %3, %4)").arg(color.cyan()).arg(color.magenta()).arg(color.yellow()).arg(color.black()); } QString Utils::colorToHSV(QColor color) { return QString("(%1, %2, %3)").arg(color.hue()).arg(color.saturation()).arg(color.value()); } QString Utils::colorToRGB(QColor color) { return QString("(%1, %2, %3)").arg(color.red()).arg(color.green()).arg(color.blue()); } QString Utils::colorToRGBA(QColor color) { return QString("(%1, %2, %3, 1.0)").arg(color.red()).arg(color.green()).arg(color.blue()); } QString Utils::colorToFloatRGB(QColor color) { return QString("(%1, %2, %3)").arg(color.red() / 255.0).arg(color.green() / 255.0).arg(color.blue() / 255.0); } QString Utils::colorToFloatRGBA(QColor color) { return QString("(%1, %2, %3, 1.0)").arg(color.red() / 255.0).arg(color.green() / 255.0).arg(color.blue() / 255.0); } qreal Utils::easeInOut(qreal x) { return (1 - qCos(M_PI * x)) / 2; } qreal Utils::easeInQuad(qreal x) { return qPow(x, 2); } qreal Utils::easeOutQuad(qreal x) { return -1 * qPow(x - 1, 2) + 1; } qreal Utils::easeInQuint(qreal x) { return qPow(x, 5); } qreal Utils::easeOutQuint(qreal x) { return qPow(x - 1, 5) + 1; } void Utils::warnNoComposite() { QDBusInterface iface(WarningDialogService, WarningDialogPath, WarningDialogService); iface.call("RaiseWindow"); } deepin-picker-1.6.2/src/utils.h000066400000000000000000000033011323423541500163360ustar00rootroot00000000000000/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*- * -*- coding: utf-8 -*- * * Copyright (C) 2011 ~ 2017 Deepin, Inc. * 2011 ~ 2017 Wang Yong * * Author: Wang Yong * Maintainer: Wang Yong * * 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 3 of the License, or * 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, see . */ #include #include #include #include class Utils : public QObject { Q_OBJECT public: static QString getQrcPath(QString imageName); static QString getQssPath(QString qssName); static void passInputEvent(int wid); static QString colorToHex(QColor color); static QString colorToCMYK(QColor color); static QString colorToHSV(QColor color); static QString colorToRGB(QColor color); static QString colorToRGBA(QColor color); static QString colorToFloatRGB(QColor color); static QString colorToFloatRGBA(QColor color); static qreal easeInOut(qreal x); static qreal easeInQuad(qreal x); static qreal easeInQuint(qreal x); static qreal easeOutQuad(qreal x); static qreal easeOutQuint(qreal x); static void warnNoComposite(); }; deepin-picker-1.6.2/translations.pri000066400000000000000000000015161323423541500175010ustar00rootroot00000000000000TRANSLATIONS += \ translations/deepin-picker_ar.ts \ translations/deepin-picker_ast.ts \ translations/deepin-picker_cs.ts \ translations/deepin-picker_de.ts \ translations/deepin-picker_en_US.ts \ translations/deepin-picker_es_419.ts \ translations/deepin-picker_es.ts \ translations/deepin-picker_fr.ts \ translations/deepin-picker_he.ts \ translations/deepin-picker_hr.ts \ translations/deepin-picker_id.ts \ translations/deepin-picker_it.ts \ translations/deepin-picker_lt.ts \ translations/deepin-picker_pt_BR.ts \ translations/deepin-picker_ru.ts \ translations/deepin-picker_sk.ts \ translations/deepin-picker_sl.ts \ translations/deepin-picker_tr.ts \ translations/deepin-picker.ts \ translations/deepin-picker_uk.ts \ translations/deepin-picker_zh_CN.ts deepin-picker-1.6.2/translations/000077500000000000000000000000001323423541500167625ustar00rootroot00000000000000deepin-picker-1.6.2/translations/deepin-picker.ts000066400000000000000000000016031323423541500220510ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_am_ET.ts000066400000000000000000000024071323423541500231210ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard ቀለም ኮፒ ማድረጊያ ወደ %1 ቁራጭ ሰሌዳ MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. ዲፕኢን መምረጫ ፈጣን የ መመልከቻ ቀለም መምረጫ መሳሪያ ነው: RGB እና HEX ኮድ ማግኘት ይቻላል እንደ ቀለም ምርጫው አይነት: እና በራሱ ያስቀምጣል ወደ ቁራጭ ሰሌዳ ውስጥ:የ ቀለም መምረጫ ቦታ ላይ ነው አይጡን መጫን ያለብዎት Deepin Picker ዲፕኢን መምረጫ deepin-picker-1.6.2/translations/deepin-picker_ar.ts000066400000000000000000000016341323423541500225370ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard نسخ اللون %1 إلى الحافظة MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker منتقي الألوان ديبين deepin-picker-1.6.2/translations/deepin-picker_ast.ts000066400000000000000000000015721323423541500227250ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copiar color %1 al cartafueyu MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker Seleutor Deepin deepin-picker-1.6.2/translations/deepin-picker_ca.ts000066400000000000000000000022241323423541500225140ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copia el color %1 al porta-retalls MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. El Selector del Deepin és una eina de selecció de color de pantalla ràpida. Els codis RGB i HEX es poden obtenir d'acord amb el color seleccionat i es poden desar automàticament al porta-retalls. L'àrea de selecció de color és on s'ha clicat amb el ratolí. Deepin Picker Selector del Deepin deepin-picker-1.6.2/translations/deepin-picker_cs.ts000066400000000000000000000021141323423541500225340ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopírovat barvu %1 do schránky MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Sběrač barev je rychlý nástroj na sbírání barev na obrazovce. Podle sebrané barvy je možné obdržet RGB a HEX kód a automaticky jej uložit do schránky. Oblast sběru barev je tam, kde se klepne myší. Deepin Picker Sběrač barev deepin-picker-1.6.2/translations/deepin-picker_da.ts000066400000000000000000000021211323423541500225110ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopiér farven %1 til udklipsholderen MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin pipette er et hurtigt værktøj til at vælge skærmfarve. RGB- og HEX-kode kan udvindes fra den valgte farve og gemmes automatisk til udklipsholderen. Farvevælgerområdet er der hvor der klikkes med musen. Deepin Picker Deepin pipette deepin-picker-1.6.2/translations/deepin-picker_de.ts000066400000000000000000000023431323423541500225230ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Farbe %1 wurde in die Zwischenablage kopiert MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Die Deepin Farbpipette ist eine einfache Bildschirm-Farbpipette. Der RGB- und HEX-Farbcode eines Bildschirmpixels kann schnell und einfach abgegriffen und in die Zwischenablage abgelegt werden. Das gelingt mit einem einfachen Mausklick an der entsprechenden Bildschirm-Position. Eine integrierte Lupe hilft beim exakten Wählen des richtigen Pixels. Deepin Picker Deepin Farbpipette deepin-picker-1.6.2/translations/deepin-picker_en_US.ts000066400000000000000000000013441323423541500231440ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard MainWindow Deepin Picker Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. deepin-picker-1.6.2/translations/deepin-picker_es.ts000066400000000000000000000021661323423541500225450ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copiar color %1 al portapapeles MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. El selector deepin es una herramienta de selección de color en pantalla. El código RGB y HEX se obtiene de acuerdo al color elegido y se guarda automáticamente en el portapapeles. El área de selección de color es donde debe hacer clic con el ratón. Deepin Picker Selector Deepin deepin-picker-1.6.2/translations/deepin-picker_es_419.ts000066400000000000000000000022321323423541500231340ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copia el color %1 al portapapeles MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker es una herramienta veloz para seleccionar un color en pantalla activa. Se puede obtener códigos RGB y HEX de acuerdo al color seleccionado y se guarda automáticamente en el portapapeles. La zona de selección de color es en donde se hace clic al ratón. Deepin Picker Selector de color Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_fr.ts000066400000000000000000000022241323423541500225400ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copier la couleur %1 dans le presse-papiers MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker est un outil rapide de sélection de couleur à écran. Les codes RVB et HEX peuvent être obtenus en fonction de la couleur choisie et peuvent être sauvegardés dans le presse-papier. La zone de sélection de couleur est l'endroit où la souris a cliqué. Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_he.ts000066400000000000000000000016211323423541500225250ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard העתקת הצבע %1 ללוח הגזירים MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker הבוחר של Deepin deepin-picker-1.6.2/translations/deepin-picker_hr.ts000066400000000000000000000015711323423541500225460ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopiraj boju %1 u međuspremnik MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker Deepin birač deepin-picker-1.6.2/translations/deepin-picker_hu.ts000066400000000000000000000020511323423541500225430ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard A %1 szín másolása vágólapra MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. A Deepin Picker alkalmazással gyorsan le lehet olvasni az egérmutató alatt levő színt. Egy kattintással el lehet menteni a vágólapra akár RGB, vagy HEX formátumban is.  Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_id.ts000066400000000000000000000015371323423541500225330ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_it.ts000066400000000000000000000022151323423541500225450ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copia il colore %1 negli appunti MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker è un tool per rilevare i colori. I codici RGB e HEX del colore selezionato vengono rilevati e salvati negli appunti. I codici colori riguardano ovviamente l'area in cui si seleziona col puntatore del Mouse. Localizzazione italiana a cura di Massimo A. Carofano Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_lt.ts000066400000000000000000000021271323423541500225520ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopijuoti %1 spalvą į iškarpinę MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin parinkiklis yra greitas ekrano spalvos parinkimo įrankis. Pagal parinktą spalvą gali būti gautas ir nukopijuotas į iškarpinę RGB ir HEX kodas. Spalvos parinkimo sritis yra ten, kur yra spustelėjama pele. Deepin Picker Deepin parinkiklis deepin-picker-1.6.2/translations/deepin-picker_ms.ts000066400000000000000000000021631323423541500225520ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Salin warna %1 ke dalam papan keratan MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Pemilih Deepin ialah alat memilih warna skrin yang pantas. Kod RGB dan HEX boleh didapati berdasarkan warna yang dipilih dan disimpan secara automatik ke dalam papan keratan. Kawasan pemilihan warna merupakan tempat di mana penuding tetikus diklik. Deepin Picker Pemilih Deepin deepin-picker-1.6.2/translations/deepin-picker_pl.ts000066400000000000000000000021611323423541500225440ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopiuj kolor %1 do schowka MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Zbieracz kolorów Deepin to narzędzie do szybkiego zbierania kolorów z ekranu. Zgodnie z wybranym kolorem można uzyskać jego kod RGB i HEX i automatycznie zapisać w schowku. Obszar wybierania kolorów to miejsce, w którym kliknięto myszką. Deepin Picker Zbieracz kolorów Deepin deepin-picker-1.6.2/translations/deepin-picker_pt.ts000066400000000000000000000021571323423541500225610ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copiar cor %1 para área de transferência MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. O Deepin Picker é uma ferramenta rápida para escolha de cores. O código HEX ou RGB pode ser obtido de acordo com a cor selecionada e gravado automaticamente para a memória. O ponteiro do rato é usado para escolher a zona a identificar. Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_pt_BR.ts000066400000000000000000000021671323423541500231450ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Copiando a cor faltando 1% para a área de transferência MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker é uma ferramenta de seleção rápida de cores de tela. O código RGB e HEX pode ser obtido de acordo com a cor escolhida e auto salva na área de transferência. A área de escolha de cores é onde o mouse clicou. Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_ru.ts000066400000000000000000000024131323423541500225570ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Скопировать цвет %1 в буфер обмена MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker - это инструмент для быстрого выбора цвета экрана. Код RGB и HEX можно получить в соответствии с выбранным цветом и автоматически сохранить в буфер обмена. Область выбора цвета - это щелчок мыши. Deepin Picker Выбор цвета Deepin deepin-picker-1.6.2/translations/deepin-picker_sk.ts000066400000000000000000000021161323423541500225460ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopírovať farbu %1 do schránky MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Výber je nástroj rýchleho vyberania farieb na obrazovke. RGB a HEX kód je možné získať podľa vybratej farby a automaticky uloženej do schránky. Oblasť výberu farieb je miesto, kde kliknete myšou. Deepin Picker Deepin Výber deepin-picker-1.6.2/translations/deepin-picker_sl.ts000066400000000000000000000020021323423541500225410ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Kopiraj bravo %1 v odložišče MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Kapalka Deepin je hitro zaslonsko orodje za izbiro barv. S klikom na barvo se prikažeta RGB in HEX kodi barve in se shranita v odložišče. Deepin Picker Kapalka Deepin deepin-picker-1.6.2/translations/deepin-picker_tr.ts000066400000000000000000000020631323423541500225570ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard %1 rengi panoya kopyala MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Seçici hızlı bir ekran renk toplama aracıdır. RGB ve HEX kodu alınmış renge göre elde edilebilir ve otomatik olarak panoya kaydedilir. Renk toplama alanı fare tıklandığı yerdir. Deepin Picker Deepin Seçici deepin-picker-1.6.2/translations/deepin-picker_uk.ts000066400000000000000000000024451323423541500225550ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard Скопіювати колір %1 до буферу обміну MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin Picker - це інструмент для швидкого вибору кольору екрану. RGB та HEX код може бути отриманий відповідно до обраного кольору та автоматично збережений в буфер обміну. Область вибору кольору - це місце, куди клацнули мишею. Deepin Picker Deepin Picker deepin-picker-1.6.2/translations/deepin-picker_zh_CN.ts000066400000000000000000000020751323423541500231360ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard 拷贝颜色%1到剪切板 MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. 深度取色器是一款帮助你快速在屏幕上取色的工具。并且能根据你取的颜色得到RGB、HEX代码。打开软件后,鼠标经过的地方即为深度取色器取色的区域。 Deepin Picker 深度取色器 deepin-picker-1.6.2/translations/deepin-picker_zh_TW.ts000066400000000000000000000020201323423541500231560ustar00rootroot00000000000000 Clipboard Copy color %1 to clipboard 顏色 %1 已複製到剪貼簿 MainWindow Deepin Picker is a fast screen color picking tool. RGB and HEX code can be obtained according color picked and auto saved to clipboard. The color picking area is where mouse clicked. Deepin 取色器是款快速的螢幕取色工具。透過滑鼠選擇顏色後,能自動將 RGB 及十六進位等色彩模式儲存到剪貼簿。 Deepin Picker Deepin 取色器