pax_global_header 0000666 0000000 0000000 00000000064 14175040243 0014512 g ustar 00root root 0000000 0000000 52 comment=9a74c7135a2332f5cb314c52d0361472c063d8cc
core-0.8/ 0000775 0000000 0000000 00000000000 14175040243 0012311 5 ustar 00root root 0000000 0000000 core-0.8/.github/ 0000775 0000000 0000000 00000000000 14175040243 0013651 5 ustar 00root root 0000000 0000000 core-0.8/.github/workflows/ 0000775 0000000 0000000 00000000000 14175040243 0015706 5 ustar 00root root 0000000 0000000 core-0.8/.github/workflows/build.yml 0000664 0000000 0000000 00000001205 14175040243 0017526 0 ustar 00root root 0000000 0000000 name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
debian:
name: Debian
runs-on: ubuntu-latest
container: docker.io/library/debian:sid
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Update repository
run: apt-get update -y
- name: Install the basic dev packages
run: apt-get install -y equivs curl git devscripts lintian build-essential automake autotools-dev cmake g++
- name: Install build dependencies
run: mk-build-deps -i -t "apt-get --yes" -r
- name: Build Package
run: dpkg-buildpackage -b -uc -us -j$(nproc)
core-0.8/.gitignore 0000664 0000000 0000000 00000001163 14175040243 0014302 0 ustar 00root root 0000000 0000000 # C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.so.*
*.dll
*.dylib
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.prl
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
build/*
.vscode/*
core-0.8/CMakeLists.txt 0000664 0000000 0000000 00000002032 14175040243 0015046 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.5)
project(core)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(QT Core Gui Widgets Quick QuickControls2 DBus Xml X11Extras LinguistTools)
find_package(Qt5 REQUIRED ${QT})
# find_package(FishUI REQUIRED)
find_package(PkgConfig REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
include(GNUInstallDirs)
add_subdirectory(polkit-agent)
add_subdirectory(screen-brightness)
add_subdirectory(session)
add_subdirectory(settings-daemon)
add_subdirectory(shutdown-ui)
add_subdirectory(xembed-sni-proxy)
add_subdirectory(powerman)
add_subdirectory(cpufreq)
add_subdirectory(chotkeys)
add_subdirectory(cupdatecursor)
add_subdirectory(gmenuproxy)
add_subdirectory(notificationd)
add_subdirectory(sddm-helper)
add_subdirectory(clipboard)
install(FILES cutefish DESTINATION /etc/ COMPONENT Runtime)
core-0.8/LICENSE 0000664 0000000 0000000 00000104515 14175040243 0013324 0 ustar 00root root 0000000 0000000 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
.
core-0.8/README.md 0000664 0000000 0000000 00000003124 14175040243 0013570 0 ustar 00root root 0000000 0000000 # Core
System backend and start session and more.
## Compile dependencies
```shell
sudo pacman -S extra-cmake-modules pkgconf qt5-base qt5-quickcontrols2 qt5-x11extras qt5-tools\
kwindowsystem polkit polkit-qt5 xorg-server-devel xf86-input-libinput xf86-input-synaptics
```
For Ubuntu:
```shell
sudo apt install libpolkit-agent-1-dev libpolkit-qt5-1-dev libsm-dev libxtst-dev\
libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-composite0-dev libxcb-damage0-dev libxcb-image0-dev libxcb-util0-dev libkf5idletime-dev
```
(Yes it's annoying that so many xcb's packages here is needed to install. Isn't there a way to install one package and these `libxcb`s all get ready?)
For Debian:
```shell
sudo apt install extra-cmake-modules pkg-config xserver-xorg-input-libinput-dev libx11-xcb-dev libxcb1-dev libxcb-randr0-dev\
libxcb-keysyms1-dev libxcursor-dev libxcb-xfixes0-dev libxcb-damage0-dev libxcb-composite0-dev libxcb-shm0-dev libxcb-util-dev\
libxcb-image0-dev libxcb-dpms0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-ewmh-dev libxcb-glx0-dev libxcb-record0-dev xserver-xorg-dev\
xserver-xorg-input-synaptics-dev libxtst-dev libsm-dev libpolkit-qt5-1-dev libpolkit-agent-1-dev libkf5windowsystem-dev libkf5globalaccel-dev\
libkf5coreaddons-dev libkf5idletime-dev libqt5x11extras5-dev qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools
```
## Runtime
## Build
```shell
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make
```
## Install
```shell
sudo make install
```
## License
This project has been licensed by GPLv3.
core-0.8/chotkeys/ 0000775 0000000 0000000 00000000000 14175040243 0014142 5 ustar 00root root 0000000 0000000 core-0.8/chotkeys/CMakeLists.txt 0000664 0000000 0000000 00000000762 14175040243 0016707 0 ustar 00root root 0000000 0000000 find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras REQUIRED)
find_package(XCB MODULE REQUIRED COMPONENTS XCB KEYSYMS)
find_package(X11)
set(PROJECT_SOURCES
main.cpp
application.cpp
hotkeys.cpp
)
add_executable(chotkeys
${PROJECT_SOURCES}
)
target_link_libraries(chotkeys
PRIVATE
Qt5::Core
Qt5::Widgets
Qt5::DBus
Qt5::X11Extras
${XCB_LIBS}
${X11_LIBRARIES}
XCB::KEYSYMS
)
install(TARGETS chotkeys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
core-0.8/chotkeys/application.cpp 0000664 0000000 0000000 00000003702 14175040243 0017153 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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 "application.h"
#include "hotkeys.h"
#include
Application::Application(QObject *parent)
: QObject(parent)
, m_hotKeys(new Hotkeys)
{
setupShortcuts();
connect(m_hotKeys, &Hotkeys::pressed, this, &Application::onPressed);
connect(m_hotKeys, &Hotkeys::released, this, &Application::onReleased);
}
void Application::setupShortcuts()
{
m_hotKeys->registerKey(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Delete));
m_hotKeys->registerKey(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
m_hotKeys->registerKey(QKeySequence(Qt::META + Qt::Key_L));
// m_hotKeys->registerKey(QKeySequence(Qt::Key_Super_L));
}
void Application::onPressed(QKeySequence keySeq)
{
if (keySeq.toString() == "Ctrl+Alt+Del") {
QProcess::startDetached("cutefish-shutdown", QStringList());
}
if (keySeq.toString() == "Meta+L") {
QProcess::startDetached("cutefish-screenlocker", QStringList());
}
if (keySeq.toString() == "Ctrl+Alt+A") {
QProcess::startDetached("cutefish-screenshot", QStringList());
}
}
void Application::onReleased(QKeySequence keySeq)
{
if (keySeq == QKeySequence(Qt::Key_Super_L)) {
QProcess::startDetached("cutefish-launcher", QStringList());
}
}
core-0.8/chotkeys/application.h 0000664 0000000 0000000 00000002144 14175040243 0016617 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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 APPLICATION_H
#define APPLICATION_H
#include
#include "hotkeys.h"
class Application : public QObject
{
Q_OBJECT
public:
explicit Application(QObject *parent = nullptr);
private:
void setupShortcuts();
private slots:
void onPressed(QKeySequence keySeq);
void onReleased(QKeySequence keySeq);
private:
Hotkeys *m_hotKeys;
};
#endif // APPLICATION_H
core-0.8/chotkeys/hotkeys.cpp 0000664 0000000 0000000 00000020035 14175040243 0016334 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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 "hotkeys.h"
#include
#include
#include
#include
#include
// #include
// #include
// XCB & X11
#include
#include
#include
#include
Hotkeys::Hotkeys(QObject *parent)
: QObject(parent)
{
qApp->installNativeEventFilter(this);
}
Hotkeys::~Hotkeys()
{
qApp->removeNativeEventFilter(this);
}
bool Hotkeys::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(result);
if (eventType != "xcb_generic_event_t") {
return false;
}
xcb_generic_event_t *e = static_cast(message);
if (e->response_type == XCB_KEY_PRESS) {
xcb_key_press_event_t *keyEvent = static_cast(message);
quint32 keycode = keyEvent->detail;
quint32 mods = keyEvent->state; // & (ShiftMask | ControlMask | Mod1Mask | Mod3Mask);
quint32 id = keycode | mods;
// int keyQt;
// KKeyServer::xcbKeyPressEventToQt(keyEvent, &keyQt);
// bool found = false;
// for (QKeySequence &seq : m_shortcuts.values()) {
// if (seq == QKeySequence(keyQt)) {
// found = true;
// // emit pressed(seq);
// break;
// }
// }
// if (!found && m_shortcuts.contains(id)) {
// // emit pressed(m_shortcuts[id]);
// }
// // Keyboard needs to be ungrabed after XGrabKey() activates the grab,
// // otherwise it becomes frozen.
// xcb_connection_t *c = QX11Info::connection();
// xcb_void_cookie_t cookie = xcb_ungrab_keyboard_checked(c, XCB_TIME_CURRENT_TIME);
// xcb_flush(c);
// // xcb_flush() only makes sure that the ungrab keyboard request has been
// // sent, but is not enough to make sure that request has been fulfilled. Use
// // xcb_request_check() to make sure that the request has been processed.
// xcb_request_check(c, cookie);
// int keyQt;
// if (!KKeyServer::xcbKeyPressEventToQt(keyEvent, &keyQt)) {
// qDebug() << "KKeyServer::xcbKeyPressEventToQt failed";
// return false;
// }
// // All that work for this hey... argh...
// if (NET::timestampCompare(keyEvent->time, QX11Info::appTime()) > 0) {
// QX11Info::setAppTime(keyEvent->time);
// }
// bool found = false;
// for (QKeySequence &seq : m_shortcuts.values()) {
// if (seq == QKeySequence(keyQt)) {
// found = true;
// emit pressed(seq);
// break;
// }
// }
if (m_shortcuts.contains(id)) {
emit pressed(m_shortcuts[id]);
}
return true;
} else if (e->response_type == XCB_KEY_RELEASE) {
xcb_key_release_event_t *keyEvent = static_cast(message);
quint32 keycode = keyEvent->detail;
quint32 mods = keyEvent->state; // & (ShiftMask | ControlMask | Mod1Mask | Mod3Mask);
quint32 id = keycode | mods;
// META
if (id == 197) {
id = 133;
}
if (m_shortcuts.contains(id)) {
emit released(m_shortcuts[id]);
}
return true;
}
return false;
}
void Hotkeys::registerKey(QKeySequence keySequence)
{
if (keySequence.isEmpty())
return;
quint32 keycode = nativeKeycode(getKey(keySequence));
quint32 mods = nativeModifiers(getMods(keySequence));
quint32 keyId = keycode | mods;
// META
if (keycode == 204 && mods == 0) {
keycode = 133;
keyId = keycode | mods;
}
if (!m_shortcuts.contains(keyId)) {
registerKey(keycode, mods);
m_shortcuts.insert(keyId, keySequence);
}
}
void Hotkeys::registerKey(quint32 keycode)
{
if (!m_shortcuts.contains(keycode)) {
registerKey(keycode, 0);
m_shortcuts.insert(keycode, QKeySequence(keycode | 0));
}
}
void Hotkeys::registerKey(quint32 key, quint32 mods)
{
xcb_grab_key(QX11Info::connection(),
1,
QX11Info::appRootWindow(),
mods,
key,
XCB_GRAB_MODE_ASYNC,
XCB_GRAB_MODE_ASYNC);
xcb_grab_key(QX11Info::connection(),
1,
QX11Info::appRootWindow(),
mods | XCB_MOD_MASK_2,
key,
XCB_GRAB_MODE_ASYNC,
XCB_GRAB_MODE_ASYNC);
}
void Hotkeys::unregisterKey(quint32 key, quint32 mods)
{
xcb_ungrab_key(QX11Info::connection(), key, QX11Info::appRootWindow(), mods);
}
quint32 Hotkeys::nativeKeycode(Qt::Key k)
{
/* keysymdef.h */
quint32 key = 0;
if (k >= Qt::Key_F1 && k <= Qt::Key_F35) {
key = XK_F1 + (k - Qt::Key_F1);
} else if (k >= Qt::Key_Space && k <= Qt::Key_QuoteLeft) {
key = k;
} else if (k >= Qt::Key_BraceLeft && k <= Qt::Key_AsciiTilde) {
key = k;
} else if (k >= Qt::Key_nobreakspace && k <= Qt::Key_ydiaeresis) {
key = k;
} else {
switch (k) {
case Qt::Key_Escape:
key = XK_Escape;
break;
case Qt::Key_Tab:
case Qt::Key_Backtab:
key = XK_Tab;
break;
case Qt::Key_Backspace:
key = XK_BackSpace;
break;
case Qt::Key_Return:
case Qt::Key_Enter:
key = XK_Return;
break;
case Qt::Key_Insert:
key = XK_Insert;
break;
case Qt::Key_Delete:
key = XK_Delete;
break;
case Qt::Key_Pause:
key = XK_Pause;
break;
case Qt::Key_Print:
key = XK_Print;
break;
case Qt::Key_SysReq:
key = XK_Sys_Req;
break;
case Qt::Key_Clear:
key = XK_Clear;
break;
case Qt::Key_Home:
key = XK_Home;
break;
case Qt::Key_End:
key = XK_End;
break;
case Qt::Key_Left:
key = XK_Left;
break;
case Qt::Key_Up:
key = XK_Up;
break;
case Qt::Key_Right:
key = XK_Right;
break;
case Qt::Key_Down:
key = XK_Down;
break;
case Qt::Key_PageUp:
key = XK_Page_Up;
break;
case Qt::Key_PageDown:
key = XK_Page_Down;
break;
default:
key = 0;
}
}
return XKeysymToKeycode(QX11Info::display(), key);
}
quint32 Hotkeys::nativeModifiers(Qt::KeyboardModifiers m)
{
quint32 mods = Qt::NoModifier;
if (m & Qt::ShiftModifier)
mods |= ShiftMask;
if (m & Qt::ControlModifier)
mods |= ControlMask;
if (m & Qt::AltModifier)
mods |= Mod1Mask;
if (m & Qt::MetaModifier)
mods |= Mod4Mask;
return mods;
}
Qt::Key Hotkeys::getKey(const QKeySequence &keyseq)
{
if (keyseq.isEmpty()) {
return Qt::Key(0);
}
return Qt::Key(keyseq[0] & ~Qt::KeyboardModifierMask);
}
Qt::KeyboardModifiers Hotkeys::getMods(const QKeySequence &keyseq)
{
if (keyseq.isEmpty()) {
return Qt::KeyboardModifiers();
}
return Qt::KeyboardModifiers(keyseq[0] & Qt::KeyboardModifierMask);
}
core-0.8/chotkeys/hotkeys.h 0000664 0000000 0000000 00000003317 14175040243 0016005 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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 HOTKEYS_H
#define HOTKEYS_H
#include
#include
#include
#include
#include
#include
#include
class Hotkeys : public QObject, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
explicit Hotkeys(QObject *parent = nullptr);
~Hotkeys();
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
void registerKey(QKeySequence keySequence);
void registerKey(quint32 keycode);
void registerKey(quint32 key, quint32 mods);
void unregisterKey(quint32 key, quint32 mods);
signals:
void pressed(QKeySequence keySeq);
void released(QKeySequence keySeq);
private:
quint32 nativeKeycode(Qt::Key k);
quint32 nativeModifiers(Qt::KeyboardModifiers m);
Qt::Key getKey(const QKeySequence& keyseq);
Qt::KeyboardModifiers getMods(const QKeySequence& keyseq);
private:
QHash m_shortcuts;
};
#endif // HOTKEYS_H
core-0.8/chotkeys/main.cpp 0000664 0000000 0000000 00000002231 14175040243 0015570 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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 "application.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setQuitOnLastWindowClosed(true);
// if (!QDBusConnection::sessionBus().registerService("com.cutefish.Chotkeys")) {
// return -1;
// }
// if (!QDBusConnection::sessionBus().registerObject("/Chotkeys", &a)) {
// return -1;
// }
Application app;
return a.exec();
}
core-0.8/clipboard/ 0000775 0000000 0000000 00000000000 14175040243 0014250 5 ustar 00root root 0000000 0000000 core-0.8/clipboard/CMakeLists.txt 0000664 0000000 0000000 00000001015 14175040243 0017005 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.14)
project(cutefish-clipboard LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
add_executable(cutefish-clipboard
main.cpp
clipboard.cpp
)
target_link_libraries(cutefish-clipboard
Qt5::Core
Qt5::Gui
Qt5::Widgets
)
install(TARGETS cutefish-clipboard DESTINATION ${CMAKE_INSTALL_BINDIR}) core-0.8/clipboard/clipboard.cpp 0000664 0000000 0000000 00000004122 14175040243 0016712 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet
*
* 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
#include
#include
#include
#include
Clipboard::Clipboard(QObject *parent)
: QObject(parent)
, m_qtClipboard(qApp->clipboard())
{
connect(m_qtClipboard, &QClipboard::dataChanged, this, &Clipboard::onDataChanged);
}
void Clipboard::onDataChanged()
{
const QMimeData *mimeData = m_qtClipboard->mimeData();
if (mimeData->formats().isEmpty())
return;
if (mimeData->hasFormat("application/x-cutefish-clipboard") &&
mimeData->data("application/x-cutefish-clipboard") == "1")
return;
QByteArray timeStamp = mimeData->data("TIMESTAMP");
QMimeData *newMimeData = new QMimeData;
if (mimeData->hasImage()) {
QPixmap srcPix = m_qtClipboard->pixmap();
QByteArray bArray;
QBuffer buffer(&bArray);
buffer.open(QIODevice::WriteOnly);
srcPix.save(&buffer);
newMimeData->setImageData(srcPix);
newMimeData->setData("TIMESTAMP", timeStamp);
}
for (const QString &key : mimeData->formats()) {
if (key == "image/png" || key == "application/x-qt-image")
continue;
newMimeData->setData(key, mimeData->data(key));
}
// cutefish flag.
newMimeData->setData("application/x-cutefish-clipboard", QByteArray("1"));
m_qtClipboard->setMimeData(newMimeData);
}
core-0.8/clipboard/clipboard.h 0000664 0000000 0000000 00000002005 14175040243 0016355 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet
*
* 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:
explicit Clipboard(QObject *parent = nullptr);
private slots:
void onDataChanged();
private:
QClipboard *m_qtClipboard;
};
#endif // CLIPBOARD_H
core-0.8/clipboard/main.cpp 0000664 0000000 0000000 00000001576 14175040243 0015711 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet
*
* 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 "clipboard.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Clipboard clipboard;
return a.exec();
}
core-0.8/cmake/ 0000775 0000000 0000000 00000000000 14175040243 0013371 5 ustar 00root root 0000000 0000000 core-0.8/cmake/ECMFindModuleHelpers.cmake 0000664 0000000 0000000 00000032344 14175040243 0020277 0 ustar 00root root 0000000 0000000 #.rst:
# ECMFindModuleHelpers
# --------------------
#
# Helper macros for find modules: ecm_find_package_version_check(),
# ecm_find_package_parse_components() and
# ecm_find_package_handle_library_components().
#
# ::
#
# ecm_find_package_version_check()
#
# Prints warnings if the CMake version or the project's required CMake version
# is older than that required by extra-cmake-modules.
#
# ::
#
# ecm_find_package_parse_components(
# RESULT_VAR
# KNOWN_COMPONENTS [ [...]]
# [SKIP_DEPENDENCY_HANDLING])
#
# This macro will populate with a list of components found in
# _FIND_COMPONENTS, after checking that all those components are in the
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
# an error or warning (depending on the value of _FIND_REQUIRED) and call
# return().
#
# The order of components in is guaranteed to match the order they
# are listed in the KNOWN_COMPONENTS argument.
#
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
# __component_deps will be checked for dependent components.
# If is listed in _FIND_COMPONENTS, then all its (transitive)
# dependencies will also be added to .
#
# ::
#
# ecm_find_package_handle_library_components(
# COMPONENTS [ [...]]
# [SKIP_DEPENDENCY_HANDLING])
# [SKIP_PKG_CONFIG])
#
# Creates an imported library target for each component. The operation of this
# macro depends on the presence of a number of CMake variables.
#
# The __lib variable should contain the name of this library,
# and __header variable should contain the name of a header
# file associated with it (whatever relative path is normally passed to
# '#include'). __header_subdir variable can be used to specify
# which subdirectory of the include path the headers will be found in.
# ecm_find_package_components() will then search for the library
# and include directory (creating appropriate cache variables) and create an
# imported library target named ::.
#
# Additional variables can be used to provide additional information:
#
# If SKIP_PKG_CONFIG, the __pkg_config variable is set, and
# pkg-config is found, the pkg-config module given by
# __pkg_config will be searched for and used to help locate the
# library and header file. It will also be used to set
# __VERSION.
#
# Note that if version information is found via pkg-config,
# __FIND_VERSION can be set to require a particular version
# for each component.
#
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
# of the imported target for will be set to contain the imported
# targets for the components listed in __component_deps.
# _FOUND will also be set to false if any of the compoments in
# __component_deps are not found. This requires the components
# in __component_deps to be listed before in the
# COMPONENTS argument.
#
# The following variables will be set:
#
# ``_TARGETS``
# the imported targets
# ``_LIBRARIES``
# the found libraries
# ``_INCLUDE_DIRS``
# the combined required include directories for the components
# ``_DEFINITIONS``
# the "other" CFLAGS provided by pkg-config, if any
# ``_VERSION``
# the value of ``__VERSION`` for the first component that
# has this variable set (note that components are searched for in the order
# they are passed to the macro), although if it is already set, it will not
# be altered
#
# Note that these variables are never cleared, so if
# ecm_find_package_handle_library_components() is called multiple times with
# different components (typically because of multiple find_package() calls) then
# ``_TARGETS``, for example, will contain all the targets found in any
# call (although no duplicates).
#
# Since pre-1.0.0.
#=============================================================================
# Copyright 2014 Alex Merry
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include(CMakeParseArguments)
macro(ecm_find_package_version_check module_name)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake")
endif()
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake")
endif()
endmacro()
macro(ecm_find_package_parse_components module_name)
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
set(ecm_fppc_oneValueArgs RESULT_VAR)
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
if(ECM_FPPC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPPC_RESULT_VAR)
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
endif()
if(${module_name}_FIND_COMPONENTS)
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
# Make sure deps are included
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
if("${ecm_fppc_index}" STREQUAL "-1")
if(NOT ${module_name}_FIND_QUIETLY)
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
endif()
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
endif()
endforeach()
endforeach()
else()
message(STATUS "Skipping dependency handling for ${module_name}")
endif()
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
# This makes sure components are listed in the same order as
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
set(${ECM_FPPC_RESULT_VAR})
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
endif()
endforeach()
# if there are any left, they are unknown components
if(ecm_fppc_requestedComps)
set(ecm_fppc_msgType STATUS)
if(${module_name}_FIND_REQUIRED)
set(ecm_fppc_msgType FATAL_ERROR)
endif()
if(NOT ${module_name}_FIND_QUIETLY)
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
endif()
return()
endif()
else()
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
endif()
endmacro()
macro(ecm_find_package_handle_library_components module_name)
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
set(ecm_fpwc_oneValueArgs)
set(ecm_fpwc_multiValueArgs COMPONENTS)
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
if(ECM_FPWC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPWC_COMPONENTS)
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
endif()
include(FindPackageHandleStandardArgs)
find_package(PkgConfig)
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
set(ecm_fpwc_dep_vars)
set(ecm_fpwc_dep_targets)
if(NOT SKIP_DEPENDENCY_HANDLING)
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
endforeach()
endif()
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
${${module_name}_${ecm_fpwc_comp}_pkg_config})
endif()
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
)
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
)
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
if(NOT ${module_name}_VERSION)
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
endif()
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
FOUND_VAR
${module_name}_${ecm_fpwc_comp}_FOUND
REQUIRED_VARS
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
${ecm_fpwc_dep_vars}
VERSION_VAR
${module_name}_${ecm_fpwc_comp}_VERSION
)
mark_as_advanced(
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
)
if(${module_name}_${ecm_fpwc_comp}_FOUND)
list(APPEND ${module_name}_LIBRARIES
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
list(APPEND ${module_name}_INCLUDE_DIRS
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
set(${module_name}_DEFINITIONS
${${module_name}_DEFINITIONS}
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
)
endif()
list(APPEND ${module_name}_TARGETS
"${module_name}::${ecm_fpwc_comp}")
endif()
endforeach()
if(${module_name}_LIBRARIES)
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
endif()
if(${module_name}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
endif()
if(${module_name}_DEFINITIONS)
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
endif()
if(${module_name}_TARGETS)
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
endif()
endmacro()
core-0.8/cmake/FindAppMenuGtkModule.cmake 0000664 0000000 0000000 00000002207 14175040243 0020356 0 ustar 00root root 0000000 0000000 #.rst:
# FindAppmenuGtkModule
# -----------
#
# Try to find appmenu-gtk2-module and appmenu-gtk3-module.
# Once done this will define:
#
# ``AppMenuGtkModule_FOUND``
# System has both appmenu-gtk2-module and appmenu-gtk3-module
#=============================================================================
# SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
#
# SPDX-License-Identifier: BSD-3-Clause
find_library(AppMenuGtk2Module_LIBRARY libappmenu-gtk-module.so
PATH_SUFFIXES
gtk-2.0/modules
)
find_library(AppMenuGtk3Module_LIBRARY libappmenu-gtk-module.so
PATH_SUFFIXES
gtk-3.0/modules
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AppMenuGtkModule
FOUND_VAR
AppMenuGtkModule_FOUND
REQUIRED_VARS
AppMenuGtk3Module_LIBRARY
AppMenuGtk2Module_LIBRARY
)
mark_as_advanced(AppMenuGtk3Module_LIBRARY AppMenuGtk2Module_LIBRARY)
include(FeatureSummary)
set_package_properties(AppMenuGtkModule PROPERTIES
URL "https://github.com/rilian-la-te/vala-panel-appmenu/tree/master/subprojects/appmenu-gtk-module"
DESCRIPTION "Application Menu GTK+ Module"
) core-0.8/cmake/FindX11_XCB.cmake 0000664 0000000 0000000 00000005603 14175040243 0016245 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2014 Alex Merry
# SPDX-FileCopyrightText: 2011 Fredrik Höglund
# SPDX-FileCopyrightText: 2008 Helio Chissini de Castro
# SPDX-FileCopyrightText: 2007 Matthias Kretz
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindX11_XCB
-----------
Try to find the X11 XCB compatibility library.
This will define the following variables:
``X11_XCB_FOUND``
True if (the requested version of) libX11-xcb is available
``X11_XCB_VERSION``
The version of libX11-xcb (this is not guaranteed to be set even when
X11_XCB_FOUND is true)
``X11_XCB_LIBRARIES``
This can be passed to target_link_libraries() instead of the ``EGL::EGL``
target
``X11_XCB_INCLUDE_DIR``
This should be passed to target_include_directories() if the target is not
used for linking
``X11_XCB_DEFINITIONS``
This should be passed to target_compile_options() if the target is not
used for linking
If ``X11_XCB_FOUND`` is TRUE, it will also define the following imported
target:
``X11::XCB``
The X11 XCB compatibility library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_X11_XCB QUIET x11-xcb)
set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER})
set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION})
find_path(X11_XCB_INCLUDE_DIR
NAMES X11/Xlib-xcb.h
HINTS ${PKG_X11_XCB_INCLUDE_DIRS}
)
find_library(X11_XCB_LIBRARY
NAMES X11-xcb
HINTS ${PKG_X11_XCB_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(X11_XCB
FOUND_VAR
X11_XCB_FOUND
REQUIRED_VARS
X11_XCB_LIBRARY
X11_XCB_INCLUDE_DIR
VERSION_VAR
X11_XCB_VERSION
)
if(X11_XCB_FOUND AND NOT TARGET X11::XCB)
add_library(X11::XCB UNKNOWN IMPORTED)
set_target_properties(X11::XCB PROPERTIES
IMPORTED_LOCATION "${X11_XCB_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}"
)
endif()
mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY)
# compatibility variables
set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY})
set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR})
set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION})
include(FeatureSummary)
set_package_properties(X11_XCB PROPERTIES
URL "https://xorg.freedesktop.org/"
DESCRIPTION "A compatibility library for code that translates Xlib API calls into XCB calls"
)
core-0.8/cmake/FindXCB.cmake 0000664 0000000 0000000 00000012447 14175040243 0015620 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2011 Fredrik Höglund
# SPDX-FileCopyrightText: 2013 Martin Gräßlin
# SPDX-FileCopyrightText: 2014-2015 Alex Merry
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindXCB
-------
Try to find XCB.
This is a component-based find module, which makes use of the COMPONENTS and
OPTIONAL_COMPONENTS arguments to find_module. The following components are
available::
XCB
ATOM AUX COMPOSITE CURSOR DAMAGE
DPMS DRI2 DRI3 EVENT EWMH
GLX ICCCM IMAGE KEYSYMS PRESENT
RANDR RECORD RENDER RENDERUTIL RES
SCREENSAVER SHAPE SHM SYNC UTIL
XEVIE XF86DRI XFIXES XINERAMA XINPUT
XKB XPRINT XTEST XV XVMC
If no components are specified, this module will act as though all components
except XINPUT (which is considered unstable) were passed to
OPTIONAL_COMPONENTS.
This module will define the following variables, independently of the
components searched for or found:
``XCB_FOUND``
True if (the requestion version of) xcb is available
``XCB_VERSION``
Found xcb version
``XCB_TARGETS``
A list of all targets imported by this module (note that there may be more
than the components that were requested)
``XCB_LIBRARIES``
This can be passed to target_link_libraries() instead of the imported
targets
``XCB_INCLUDE_DIRS``
This should be passed to target_include_directories() if the targets are
not used for linking
``XCB_DEFINITIONS``
This should be passed to target_compile_options() if the targets are not
used for linking
For each searched-for components, ``XCB__FOUND`` will be set to
true if the corresponding xcb library was found, and false otherwise. If
``XCB__FOUND`` is true, the imported target ``XCB::``
will be defined. This module will also attempt to determine
``XCB_*_VERSION`` variables for each imported target, although
``XCB_VERSION`` should normally be sufficient.
In general we recommend using the imported targets, as they are easier to use
and provide more control. Bear in mind, however, that if any target is in the
link interface of an exported library, it must be made available by the
package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
# Note that this list needs to be ordered such that any component
# appears after its dependencies
set(XCB_known_components
XCB
RENDER
SHAPE
XFIXES
SHM
ATOM
AUX
COMPOSITE
CURSOR
DAMAGE
DPMS
DRI2
DRI3
EVENT
EWMH
GLX
ICCCM
IMAGE
KEYSYMS
PRESENT
RANDR
RECORD
RENDERUTIL
RES
SCREENSAVER
SYNC
UTIL
XEVIE
XF86DRI
XINERAMA
XINPUT
XKB
XPRINT
XTEST
XV
XVMC
)
# XINPUT is unstable; do not include it by default
set(XCB_default_components ${XCB_known_components})
list(REMOVE_ITEM XCB_default_components "XINPUT")
# default component info: xcb components have fairly predictable
# header files, library names and pkg-config names
foreach(_comp ${XCB_known_components})
string(TOLOWER "${_comp}" _lc_comp)
set(XCB_${_comp}_component_deps XCB)
set(XCB_${_comp}_pkg_config "xcb-${_lc_comp}")
set(XCB_${_comp}_lib "xcb-${_lc_comp}")
set(XCB_${_comp}_header "xcb/${_lc_comp}.h")
endforeach()
# exceptions
set(XCB_XCB_component_deps)
set(XCB_COMPOSITE_component_deps XCB XFIXES)
set(XCB_DAMAGE_component_deps XCB XFIXES)
set(XCB_IMAGE_component_deps XCB SHM)
set(XCB_RENDERUTIL_component_deps XCB RENDER)
set(XCB_XFIXES_component_deps XCB RENDER SHAPE)
set(XCB_XVMC_component_deps XCB XV)
set(XCB_XV_component_deps XCB SHM)
set(XCB_XCB_pkg_config "xcb")
set(XCB_XCB_lib "xcb")
set(XCB_ATOM_header "xcb/xcb_atom.h")
set(XCB_ATOM_lib "xcb-util")
set(XCB_AUX_header "xcb/xcb_aux.h")
set(XCB_AUX_lib "xcb-util")
set(XCB_CURSOR_header "xcb/xcb_cursor.h")
set(XCB_EVENT_header "xcb/xcb_event.h")
set(XCB_EVENT_lib "xcb-util")
set(XCB_EWMH_header "xcb/xcb_ewmh.h")
set(XCB_ICCCM_header "xcb/xcb_icccm.h")
set(XCB_IMAGE_header "xcb/xcb_image.h")
set(XCB_KEYSYMS_header "xcb/xcb_keysyms.h")
set(XCB_PIXEL_header "xcb/xcb_pixel.h")
set(XCB_RENDERUTIL_header "xcb/xcb_renderutil.h")
set(XCB_RENDERUTIL_lib "xcb-render-util")
set(XCB_UTIL_header "xcb/xcb_util.h")
ecm_find_package_parse_components(XCB
RESULT_VAR XCB_components
KNOWN_COMPONENTS ${XCB_known_components}
DEFAULT_COMPONENTS ${XCB_default_components}
)
list(FIND XCB_components "XINPUT" _XCB_XINPUT_index)
if (NOT _XCB_XINPUT_index EQUAL -1)
message(AUTHOR_WARNING "XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems!")
endif()
ecm_find_package_handle_library_components(XCB
COMPONENTS ${XCB_components}
)
find_package_handle_standard_args(XCB
FOUND_VAR
XCB_FOUND
REQUIRED_VARS
XCB_LIBRARIES
VERSION_VAR
XCB_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(XCB PROPERTIES
URL "https://xcb.freedesktop.org/"
DESCRIPTION "X protocol C-language Binding"
)
core-0.8/cpufreq/ 0000775 0000000 0000000 00000000000 14175040243 0013756 5 ustar 00root root 0000000 0000000 core-0.8/cpufreq/CMakeLists.txt 0000664 0000000 0000000 00000001060 14175040243 0016513 0 ustar 00root root 0000000 0000000 project(cutefish-cpufreq)
set(TARGET cutefish-cpufreq)
set(SOURCES
main.cpp
)
add_executable(${TARGET} ${SOURCES} ${DBUS_SOURCES})
target_link_libraries(${TARGET}
Qt5::Core
Qt5::Quick
Qt5::DBus
Qt5::X11Extras
)
configure_file(
com.cutefish.cpufreq.pkexec.policy.in
com.cutefish.cpufreq.pkexec.policy
@ONLY
)
install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.cutefish.cpufreq.pkexec.policy DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/actions/)
core-0.8/cpufreq/com.cutefish.cpufreq.pkexec.policy.in 0000664 0000000 0000000 00000001221 14175040243 0023111 0 ustar 00root root 0000000 0000000
Authentication is required to Change CPU configuration
battery
no
no
yes
@CMAKE_INSTALL_FULL_BINDIR@/cutefish-cpufreq
core-0.8/cpufreq/main.cpp 0000664 0000000 0000000 00000004674 14175040243 0015421 0 ustar 00root root 0000000 0000000 /*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong
*
* 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
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("Cutefish CPU frequency tool"));
parser.addHelpOption();
QCommandLineOption setOption(QStringList() << "s" << "set" << "Setting");
parser.addOption(setOption);
QCommandLineOption numberOption(QStringList() << "c" << "number" << "Number");
parser.addOption(numberOption);
QCommandLineOption modeOption(QStringList() << "m" << "mode" << "Mode");
parser.addOption(modeOption);
parser.process(a);
// cutefish-cpufreq --set -n 0 -m performance
if (parser.isSet(setOption) && parser.isSet(numberOption) && parser.isSet(modeOption)) {
QString modeStr = parser.positionalArguments().last();
if (modeStr != "powersave" && modeStr != "performance") {
return -1;
}
QFile file(QString("/sys/devices/system/cpu/cpu%1/cpufreq/scaling_governor").arg(parser.positionalArguments().first()));
if (!file.open(QIODevice::WriteOnly)) {
return -1;
}
file.write(modeStr.toUtf8());
file.close();
// Set intel gpu.
if (QFile("/usr/bin/intel_gpu_frequency").exists()) {
QProcess process;
process.setProgram("/usr/bin/intel_gpu_frequency");
if (modeStr == "powersave") {
process.setArguments(QStringList() << "-d");
} else {
process.setArguments(QStringList() << "-m");
}
process.start();
process.waitForFinished();
}
}
return 0;
}
core-0.8/cupdatecursor/ 0000775 0000000 0000000 00000000000 14175040243 0015174 5 ustar 00root root 0000000 0000000 core-0.8/cupdatecursor/CMakeLists.txt 0000664 0000000 0000000 00000000515 14175040243 0017735 0 ustar 00root root 0000000 0000000 find_package(Qt5 COMPONENTS Core Gui X11Extras REQUIRED)
find_package(X11)
add_executable(cupdatecursor
main.cpp
)
target_link_libraries(cupdatecursor
Qt5::Core
Qt5::Gui
Qt5::X11Extras
${X11_LIBRARIES}
X11::X11
X11::Xi
X11::Xcursor
)
install(TARGETS cupdatecursor DESTINATION ${CMAKE_INSTALL_BINDIR})
core-0.8/cupdatecursor/main.cpp 0000664 0000000 0000000 00000002461 14175040243 0016627 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
#include
#include
#include
#include
inline void applyTheme(const QString &theme, int size)
{
Display *display = QX11Info::display();
if (!theme.isEmpty())
XcursorSetTheme(display, QFile::encodeName(theme));
if (size > 0)
XcursorSetDefaultSize(display, size);
Cursor handle = XcursorLibraryLoadCursor(display, "left_ptr");
XDefineCursor(display, DefaultRootWindow(display), handle);
XFreeCursor(display, handle);
XFlush(display);
// For KWin
QSettings settings(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/kcminputrc",
QSettings::IniFormat);
settings.beginGroup("Mouse");
settings.setValue("cursorTheme", theme);
settings.setValue("cursorSize", size);
settings.endGroup();
settings.sync();
}
int main(int argc, char *argv[])
{
QGuiApplication::setDesktopSettingsAware(false);
QGuiApplication a(argc, argv);
if (argc != 3)
return 1;
if (!QX11Info::isPlatformX11())
return 2;
QString theme = QFile::decodeName(argv[1]);
QString size = QFile::decodeName(argv[2]);
applyTheme(theme, size.toInt());
return 0;
}
core-0.8/cutefish 0000664 0000000 0000000 00000000025 14175040243 0014043 0 ustar 00root root 0000000 0000000 [General]
Version=0.8 core-0.8/debian/ 0000775 0000000 0000000 00000000000 14175040243 0013533 5 ustar 00root root 0000000 0000000 core-0.8/debian/changelog 0000664 0000000 0000000 00000000302 14175040243 0015400 0 ustar 00root root 0000000 0000000 cutefish-core (0.8) UNRELEASED; urgency=high
* Initial release (CutefishOS)
-- CutefishOS Packaging Team Sat, 29 Jan 2022 03:14:11 +0800
core-0.8/debian/compat 0000664 0000000 0000000 00000000001 14175040243 0014730 0 ustar 00root root 0000000 0000000 9 core-0.8/debian/control 0000664 0000000 0000000 00000003662 14175040243 0015145 0 ustar 00root root 0000000 0000000 Source: cutefish-core
Section: devel
Priority: optional
Maintainer: CutefishOS
Build-Depends: cmake,
debhelper (>= 9),
extra-cmake-modules,
pkg-config,
xserver-xorg-input-libinput-dev,
libx11-xcb-dev,
libxcb1-dev,
libxcb-randr0-dev,
libxcb-keysyms1-dev,
libxcursor-dev,
libxcb-xfixes0-dev,
libxcb-damage0-dev,
libxcb-composite0-dev,
libxcb-shm0-dev,
libxcb-util-dev,
libxcb-image0-dev,
libxcb-dpms0-dev,
libxcb-dri2-0-dev,
libxcb-dri3-dev,
libxcb-ewmh-dev,
libxcb-glx0-dev,
libxcb-record0-dev,
xserver-xorg-dev,
xserver-xorg-input-synaptics-dev,
libxtst-dev,
libsm-dev,
libpolkit-qt5-1-dev,
libpolkit-agent-1-dev,
libkf5windowsystem-dev,
libkf5globalaccel-dev,
libkf5coreaddons-dev,
libkf5idletime-dev,
libqt5x11extras5-dev,
qtbase5-dev,
qtdeclarative5-dev,
qtquickcontrols2-5-dev,
qttools5-dev,
qttools5-dev-tools
Standards-Version: 4.5.0
Homepage: https://github.com/cutefishos/core
Package: cutefish-core
Architecture: any
Depends: accountsservice,
qml-module-qtquick-controls2,
qml-module-qtquick2,
qml-module-qtquick-layouts,
qml-module-qt-labs-platform,
qml-module-qt-labs-settings,
qml-module-qtqml,
qml-module-qtquick-window2,
qml-module-qtquick-shapes,
appmenu-gtk2-module,
appmenu-gtk3-module,
${misc:Depends},
${shlibs:Depends}
Description: CutefishOS System Components
core-0.8/debian/copyright 0000664 0000000 0000000 00000000176 14175040243 0015472 0 ustar 00root root 0000000 0000000 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: cutefish-core
Source: cutefishos.com
core-0.8/debian/postinst 0000664 0000000 0000000 00000001756 14175040243 0015352 0 ustar 00root root 0000000 0000000 #! /bin/sh
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `configure'
# * `abort-upgrade'
# * `abort-remove' `in-favour'
#
# * `abort-deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
case "$1" in
configure)
update-alternatives --install /usr/bin/x-session-manager \
x-session-manager /usr/bin/cutefish-session 60
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
core-0.8/debian/prerm 0000664 0000000 0000000 00000001661 14175040243 0014607 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `upgrade'
# * `failed-upgrade'
# * `remove' `in-favour'
# * `deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove)
update-alternatives --remove x-session-manager /usr/bin/cutefish-session
;;
upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
core-0.8/debian/rules 0000775 0000000 0000000 00000000051 14175040243 0014607 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
%:
dh $@ --parallel
core-0.8/debian/source/ 0000775 0000000 0000000 00000000000 14175040243 0015033 5 ustar 00root root 0000000 0000000 core-0.8/debian/source/format 0000664 0000000 0000000 00000000014 14175040243 0016241 0 ustar 00root root 0000000 0000000 3.0 (quilt)
core-0.8/gmenuproxy/ 0000775 0000000 0000000 00000000000 14175040243 0014526 5 ustar 00root root 0000000 0000000 core-0.8/gmenuproxy/CMakeLists.txt 0000664 0000000 0000000 00000002315 14175040243 0017267 0 ustar 00root root 0000000 0000000 find_package(AppMenuGtkModule)
find_package(KF5WindowSystem)
find_package(KF5CoreAddons)
set_package_properties(AppMenuGtkModule PROPERTIES TYPE RUNTIME)
add_definitions(-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_FROM_BYTEARRAY)
find_package(XCB
REQUIRED COMPONENTS
XCB
)
set(GMENU_DBUSMENU_PROXY_SRCS
extend/dbusmenutypes_p.cpp
# extend/dbusmenushortcut_p.cpp
main.cpp
menuproxy.cpp
window.cpp
menu.cpp
actions.cpp
dbusmenuadaptor.cpp
gdbusmenutypes_p.cpp
icons.cpp
utils.cpp
)
# qt_add_dbus_adaptor(GMENU_DBUSMENU_PROXY_SRCS ./com.canonical.dbusmenu.xml window.h Window)
add_executable(cutefish-gmenuproxy ${GMENU_DBUSMENU_PROXY_SRCS})
set_package_properties(XCB PROPERTIES TYPE REQUIRED)
target_link_libraries(cutefish-gmenuproxy
Qt5::Core
Qt5::X11Extras
Qt5::DBus
Qt5::Widgets
KF5::CoreAddons
KF5::WindowSystem
XCB::XCB
)
configure_file(
cutefish-gmenuproxy.service.in
cutefish-gmenuproxy.service
@ONLY
)
install(TARGETS cutefish-gmenuproxy DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cutefish-gmenuproxy.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/)
core-0.8/gmenuproxy/actions.cpp 0000664 0000000 0000000 00000015607 14175040243 0016703 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "actions.h"
#include
#include
#include
#include
#include
#include
#include
static const QString s_orgGtkActions = QStringLiteral("org.gtk.Actions");
Actions::Actions(const QString &serviceName, const QString &objectPath, QObject *parent)
: QObject(parent)
, m_serviceName(serviceName)
, m_objectPath(objectPath)
{
Q_ASSERT(!serviceName.isEmpty());
Q_ASSERT(!m_objectPath.isEmpty());
if (!QDBusConnection::sessionBus().connect(serviceName,
objectPath,
s_orgGtkActions,
QStringLiteral("Changed"),
this,
SLOT(onActionsChanged(QStringList, StringBoolMap, QVariantMap, GMenuActionMap)))) {
qDebug() << "Failed to subscribe to action changes for" << parent << "on" << serviceName << "at" << objectPath;
}
}
Actions::~Actions() = default;
void Actions::load()
{
QDBusMessage msg = QDBusMessage::createMethodCall(m_serviceName, m_objectPath, s_orgGtkActions, QStringLiteral("DescribeAll"));
QDBusPendingReply reply = QDBusConnection::sessionBus().asyncCall(msg);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply reply = *watcher;
if (reply.isError()) {
qDebug() << "Failed to get actions from" << m_serviceName << "at" << m_objectPath << reply.error();
emit failedToLoad();
} else {
m_actions = reply.value();
emit loaded();
}
watcher->deleteLater();
});
}
bool Actions::get(const QString &name, GMenuAction &action) const
{
auto it = m_actions.find(name);
if (it == m_actions.constEnd()) {
return false;
}
action = *it;
return true;
}
GMenuActionMap Actions::getAll() const
{
return m_actions;
}
void Actions::trigger(const QString &name, const QVariant &target, uint timestamp)
{
if (!m_actions.contains(name)) {
qDebug() << "Cannot invoke action" << name << "which doesn't exist";
return;
}
QDBusMessage msg = QDBusMessage::createMethodCall(m_serviceName, m_objectPath, s_orgGtkActions, QStringLiteral("Activate"));
msg << name;
QVariantList args;
if (target.isValid()) {
args << target;
}
msg << QVariant::fromValue(args);
QVariantMap platformData;
if (timestamp) {
// From documentation:
// If the startup notification id is not available, this can be just "_TIMEtime", where
// time is the time stamp from the event triggering the call.
// see also gtkwindow.c extract_time_from_startup_id and startup_id_is_fake
platformData.insert(QStringLiteral("desktop-startup-id"), QStringLiteral("_TIME") + QString::number(timestamp));
}
msg << platformData;
QDBusPendingReply reply = QDBusConnection::sessionBus().asyncCall(msg);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, name](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply reply = *watcher;
if (reply.isError()) {
qDebug() << "Failed to invoke action" << name << "on" << m_serviceName << "at" << m_objectPath << reply.error();
}
watcher->deleteLater();
});
}
bool Actions::isValid() const
{
return !m_actions.isEmpty();
}
void Actions::onActionsChanged(const QStringList &removed, const StringBoolMap &enabledChanges, const QVariantMap &stateChanges, const GMenuActionMap &added)
{
// Collect the actions that we removed, altered, or added, so we can eventually signal changes for all menus that contain one of those actions
QStringList dirtyActions;
// TODO I bet for most of the loops below we could use a nice short std algorithm
for (const QString &removedAction : removed) {
if (m_actions.remove(removedAction)) {
dirtyActions.append(removedAction);
}
}
for (auto it = enabledChanges.constBegin(), end = enabledChanges.constEnd(); it != end; ++it) {
const QString &actionName = it.key();
const bool enabled = it.value();
auto actionIt = m_actions.find(actionName);
if (actionIt == m_actions.end()) {
qDebug() << "Got enabled changed for action" << actionName << "which we don't know";
continue;
}
GMenuAction &action = *actionIt;
if (action.enabled != enabled) {
action.enabled = enabled;
dirtyActions.append(actionName);
} else {
qDebug() << "Got enabled change for action" << actionName << "which didn't change it";
}
}
for (auto it = stateChanges.constBegin(), end = stateChanges.constEnd(); it != end; ++it) {
const QString &actionName = it.key();
const QVariant &state = it.value();
auto actionIt = m_actions.find(actionName);
if (actionIt == m_actions.end()) {
qDebug() << "Got state changed for action" << actionName << "which we don't know";
continue;
}
GMenuAction &action = *actionIt;
if (action.state.isEmpty()) {
qDebug() << "Got new state for action" << actionName << "that didn't have any state before";
action.state.append(state);
dirtyActions.append(actionName);
} else {
// Action state is a list but the state change only sends us a single variant, so just overwrite the first one
QVariant &firstState = action.state.first();
if (firstState != state) {
firstState = state;
dirtyActions.append(actionName);
} else {
qDebug() << "Got state change for action" << actionName << "which didn't change it";
}
}
}
// unite() will result in keys being present multiple times, do it manually and overwrite existing ones
for (auto it = added.constBegin(), end = added.constEnd(); it != end; ++it) {
const QString &actionName = it.key();
// if ((DBUSMENUPROXY).isInfoEnabled()) {
// if (m_actions.contains(actionName)) {
// qDebug() << "Got new action" << actionName << "that we already have, overwriting existing one";
// }
// }
m_actions.insert(actionName, it.value());
dirtyActions.append(actionName);
}
if (!dirtyActions.isEmpty()) {
emit actionsChanged(dirtyActions);
}
}
core-0.8/gmenuproxy/actions.h 0000664 0000000 0000000 00000002042 14175040243 0016335 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#pragma once
#include
#include
#include "gdbusmenutypes_p.h"
class QStringList;
class Actions : public QObject
{
Q_OBJECT
public:
Actions(const QString &serviceName, const QString &objectPath, QObject *parent = nullptr);
~Actions() override;
void load();
bool get(const QString &name, GMenuAction &action) const;
GMenuActionMap getAll() const;
void trigger(const QString &name, const QVariant &target, uint timestamp = 0);
bool isValid() const; // basically "has actions"
Q_SIGNALS:
void loaded();
void failedToLoad(); // expose error?
void actionsChanged(const QStringList &dirtyActions);
private slots:
void onActionsChanged(const QStringList &removed, const StringBoolMap &enabledChanges, const QVariantMap &stateChanges, const GMenuActionMap &added);
private:
GMenuActionMap m_actions;
QString m_serviceName;
QString m_objectPath;
};
core-0.8/gmenuproxy/com.canonical.dbusmenu.xml 0000664 0000000 0000000 00000004171 14175040243 0021600 0 ustar 00root root 0000000 0000000
core-0.8/gmenuproxy/cutefish-gmenuproxy.service.in 0000664 0000000 0000000 00000000363 14175040243 0022544 0 ustar 00root root 0000000 0000000 [Unit]
Description=Proxies GTK DBus menus to a Cutefish readable format
PartOf=graphical-session.target
[Service]
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/cutefish-gmenuproxy
Restart=on-failure
Type=simple
Slice=background.slice
TimeoutSec=5sec
core-0.8/gmenuproxy/dbusmenuadaptor.cpp 0000664 0000000 0000000 00000004263 14175040243 0020434 0 ustar 00root root 0000000 0000000 /*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -m -a dbusmenuadaptor -i window.h -l Window /home/reion/Cutefish/core/gmenuproxy/com.canonical.dbusmenu.xml
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
#include "dbusmenuadaptor.h"
#include
#include
#include
#include
#include
#include
#include
/*
* Implementation of adaptor class DbusmenuAdaptor
*/
DbusmenuAdaptor::DbusmenuAdaptor(Window *parent)
: QDBusAbstractAdaptor(parent)
{
// constructor
setAutoRelaySignals(true);
}
DbusmenuAdaptor::~DbusmenuAdaptor()
{
// destructor
}
QString DbusmenuAdaptor::status() const
{
// get the value of property Status
return qvariant_cast< QString >(parent()->property("Status"));
}
uint DbusmenuAdaptor::version() const
{
// get the value of property Version
return qvariant_cast< uint >(parent()->property("Version"));
}
bool DbusmenuAdaptor::AboutToShow(int id)
{
// handle method call com.canonical.dbusmenu.AboutToShow
return parent()->AboutToShow(id);
}
void DbusmenuAdaptor::Event(int id, const QString &eventId, const QDBusVariant &data, uint timestamp)
{
// handle method call com.canonical.dbusmenu.Event
parent()->Event(id, eventId, data, timestamp);
}
DBusMenuItemList DbusmenuAdaptor::GetGroupProperties(const QList &ids, const QStringList &propertyNames)
{
// handle method call com.canonical.dbusmenu.GetGroupProperties
return parent()->GetGroupProperties(ids, propertyNames);
}
uint DbusmenuAdaptor::GetLayout(int parentId, int recursionDepth, const QStringList &propertyNames, DBusMenuLayoutItem &item)
{
// handle method call com.canonical.dbusmenu.GetLayout
return parent()->GetLayout(parentId, recursionDepth, propertyNames, item);
}
QDBusVariant DbusmenuAdaptor::GetProperty(int id, const QString &property)
{
// handle method call com.canonical.dbusmenu.GetProperty
return parent()->GetProperty(id, property);
}
#include "dbusmenuadaptor.moc"
core-0.8/gmenuproxy/dbusmenuadaptor.h 0000664 0000000 0000000 00000010700 14175040243 0020072 0 ustar 00root root 0000000 0000000 /*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -m -a dbusmenuadaptor -i window.h -l Window /home/reion/Cutefish/core/gmenuproxy/com.canonical.dbusmenu.xml
*
* qdbusxml2cpp is Copyright (C) 2020 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.
*/
#ifndef DBUSMENUADAPTOR_H
#define DBUSMENUADAPTOR_H
#include
#include
#include "window.h"
QT_BEGIN_NAMESPACE
class QByteArray;
template class QList;
template class QMap;
class QString;
class QStringList;
class QVariant;
QT_END_NAMESPACE
/*
* Adaptor class for interface com.canonical.dbusmenu
*/
class DbusmenuAdaptor: public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "com.canonical.dbusmenu")
Q_CLASSINFO("D-Bus Introspection", ""
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
"")
public:
DbusmenuAdaptor(Window *parent);
virtual ~DbusmenuAdaptor();
inline Window *parent() const
{ return static_cast(QObject::parent()); }
public: // PROPERTIES
Q_PROPERTY(QString Status READ status)
QString status() const;
Q_PROPERTY(uint Version READ version)
uint version() const;
public Q_SLOTS: // METHODS
bool AboutToShow(int id);
Q_NOREPLY void Event(int id, const QString &eventId, const QDBusVariant &data, uint timestamp);
DBusMenuItemList GetGroupProperties(const QList &ids, const QStringList &propertyNames);
uint GetLayout(int parentId, int recursionDepth, const QStringList &propertyNames, DBusMenuLayoutItem &item);
QDBusVariant GetProperty(int id, const QString &property);
Q_SIGNALS: // SIGNALS
void ItemActivationRequested(int id, uint timeStamp);
void ItemsPropertiesUpdated(DBusMenuItemList in0, DBusMenuItemKeysList in1);
void LayoutUpdated(uint revision, int parentId);
};
#endif
core-0.8/gmenuproxy/extend/ 0000775 0000000 0000000 00000000000 14175040243 0016015 5 ustar 00root root 0000000 0000000 core-0.8/gmenuproxy/extend/dbusmenushortcut_p.cpp 0000664 0000000 0000000 00000004606 14175040243 0022464 0 ustar 00root root 0000000 0000000 /* This file is part of the dbusmenu-qt library
SPDX-FileCopyrightText: 2009 Canonical
SPDX-FileContributor: Aurelien Gateau
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "dbusmenushortcut_p.h"
// Qt
#include
static const int QT_COLUMN = 0;
static const int DM_COLUMN = 1;
static void processKeyTokens(QStringList *tokens, int srcCol, int dstCol)
{
struct Row {
const char *zero;
const char *one;
const char *operator[](int col) const
{
return col == 0 ? zero : one;
}
};
static const Row table[] = {{"Meta", "Super"},
{"Ctrl", "Control"},
// Special cases for compatibility with libdbusmenu-glib which uses
// "plus" for "+" and "minus" for "-".
// cf https://bugs.launchpad.net/libdbusmenu-qt/+bug/712565
{"+", "plus"},
{"-", "minus"},
{nullptr, nullptr}};
const Row *ptr = table;
for (; ptr->zero != nullptr; ++ptr) {
const char *from = (*ptr)[srcCol];
const char *to = (*ptr)[dstCol];
tokens->replaceInStrings(from, to);
}
}
DBusMenuShortcut DBusMenuShortcut::fromKeySequence(const QKeySequence &sequence)
{
QString string = sequence.toString();
DBusMenuShortcut shortcut;
QStringList tokens = string.split(QStringLiteral(", "));
Q_FOREACH (QString token, tokens) {
// Hack: Qt::CTRL | Qt::Key_Plus is turned into the string "Ctrl++",
// but we don't want the call to token.split() to consider the
// second '+' as a separator so we replace it with its final value.
token.replace(QLatin1String("++"), QLatin1String("+plus"));
QStringList keyTokens = token.split('+');
processKeyTokens(&keyTokens, QT_COLUMN, DM_COLUMN);
shortcut << keyTokens;
}
return shortcut;
}
QKeySequence DBusMenuShortcut::toKeySequence() const
{
QStringList tmp;
Q_FOREACH (const QStringList &keyTokens_, *this) {
QStringList keyTokens = keyTokens_;
processKeyTokens(&keyTokens, DM_COLUMN, QT_COLUMN);
tmp << keyTokens.join(QLatin1String("+"));
}
QString string = tmp.join(QLatin1String(", "));
return QKeySequence::fromString(string);
}
core-0.8/gmenuproxy/extend/dbusmenushortcut_p.h 0000664 0000000 0000000 00000000777 14175040243 0022136 0 ustar 00root root 0000000 0000000 /* This file is part of the dbusmenu-qt library
SPDX-FileCopyrightText: 2009 Canonical
SPDX-FileContributor: Aurelien Gateau
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
// Qt
#include
#include
class QKeySequence;
class DBusMenuShortcut : public QList
{
public:
QKeySequence toKeySequence() const;
static DBusMenuShortcut fromKeySequence(const QKeySequence &);
};
Q_DECLARE_METATYPE(DBusMenuShortcut)
core-0.8/gmenuproxy/extend/dbusmenutypes_p.cpp 0000664 0000000 0000000 00000006532 14175040243 0021755 0 ustar 00root root 0000000 0000000 /* This file is part of the dbusmenu-qt library
SPDX-FileCopyrightText: 2009 Canonical
SPDX-FileContributor: Aurelien Gateau
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "dbusmenutypes_p.h"
// Local
#include "dbusmenushortcut_p.h"
// Qt
#include
#include
//// DBusMenuItem
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItem &obj)
{
argument.beginStructure();
argument << obj.id << obj.properties;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItem &obj)
{
argument.beginStructure();
argument >> obj.id >> obj.properties;
argument.endStructure();
return argument;
}
//// DBusMenuItemKeys
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItemKeys &obj)
{
argument.beginStructure();
argument << obj.id << obj.properties;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItemKeys &obj)
{
argument.beginStructure();
argument >> obj.id >> obj.properties;
argument.endStructure();
return argument;
}
//// DBusMenuLayoutItem
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuLayoutItem &obj)
{
argument.beginStructure();
argument << obj.id << obj.properties;
argument.beginArray(qMetaTypeId());
Q_FOREACH (const DBusMenuLayoutItem &child, obj.children) {
argument << QDBusVariant(QVariant::fromValue(child));
}
argument.endArray();
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuLayoutItem &obj)
{
argument.beginStructure();
argument >> obj.id >> obj.properties;
argument.beginArray();
while (!argument.atEnd()) {
QDBusVariant dbusVariant;
argument >> dbusVariant;
QDBusArgument childArgument = dbusVariant.variant().value();
DBusMenuLayoutItem child;
childArgument >> child;
obj.children.append(child);
}
argument.endArray();
argument.endStructure();
return argument;
}
//// DBusMenuShortcut
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuShortcut &obj)
{
argument.beginArray(qMetaTypeId());
typename QList::ConstIterator it = obj.constBegin();
typename QList::ConstIterator end = obj.constEnd();
for (; it != end; ++it)
argument << *it;
argument.endArray();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuShortcut &obj)
{
argument.beginArray();
obj.clear();
while (!argument.atEnd()) {
QStringList item;
argument >> item;
obj.push_back(item);
}
argument.endArray();
return argument;
}
void DBusMenuTypes_register()
{
static bool registered = false;
if (registered) {
return;
}
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
registered = true;
}
core-0.8/gmenuproxy/extend/dbusmenutypes_p.h 0000664 0000000 0000000 00000003713 14175040243 0021420 0 ustar 00root root 0000000 0000000 /* This file is part of the dbusmenu-qt library
SPDX-FileCopyrightText: 2009 Canonical
SPDX-FileContributor: Aurelien Gateau
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
// Qt
#include
#include
#include
class QDBusArgument;
//// DBusMenuItem
/**
* Internal struct used to communicate on DBus
*/
struct DBusMenuItem {
int id;
QVariantMap properties;
};
Q_DECLARE_METATYPE(DBusMenuItem)
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItem &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItem &item);
typedef QList DBusMenuItemList;
Q_DECLARE_METATYPE(DBusMenuItemList)
//// DBusMenuItemKeys
/**
* Represents a list of keys for a menu item
*/
struct DBusMenuItemKeys {
int id;
QStringList properties;
};
Q_DECLARE_METATYPE(DBusMenuItemKeys)
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuItemKeys &);
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuItemKeys &);
typedef QList DBusMenuItemKeysList;
Q_DECLARE_METATYPE(DBusMenuItemKeysList)
//// DBusMenuLayoutItem
/**
* Represents an item with its children. GetLayout() returns a
* DBusMenuLayoutItemList.
*/
struct DBusMenuLayoutItem;
struct DBusMenuLayoutItem {
int id;
QVariantMap properties;
QList children;
};
Q_DECLARE_METATYPE(DBusMenuLayoutItem)
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuLayoutItem &);
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuLayoutItem &);
typedef QList DBusMenuLayoutItemList;
Q_DECLARE_METATYPE(DBusMenuLayoutItemList)
//// DBusMenuShortcut
class DBusMenuShortcut;
QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuShortcut &);
const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuShortcut &);
void DBusMenuTypes_register(); core-0.8/gmenuproxy/gdbusmenutypes_p.cpp 0000664 0000000 0000000 00000006256 14175040243 0020640 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "gdbusmenutypes_p.h"
#include
#include
// GMenuItem
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuItem &item)
{
argument.beginStructure();
argument << item.id << item.section << item.items;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuItem &item)
{
argument.beginStructure();
argument >> item.id >> item.section >> item.items;
argument.endStructure();
return argument;
}
// GMenuSection
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuSection &item)
{
argument.beginStructure();
argument << item.subscription << item.menu;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuSection &item)
{
argument.beginStructure();
argument >> item.subscription >> item.menu;
argument.endStructure();
return argument;
}
// GMenuChange
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuChange &item)
{
argument.beginStructure();
argument << item.subscription << item.menu << item.changePosition << item.itemsToRemoveCount << item.itemsToInsert;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuChange &item)
{
argument.beginStructure();
argument >> item.subscription >> item.menu >> item.changePosition >> item.itemsToRemoveCount >> item.itemsToInsert;
argument.endStructure();
return argument;
}
// GMenuActionProperty
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuAction &item)
{
argument.beginStructure();
argument << item.enabled << item.signature << item.state;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuAction &item)
{
argument.beginStructure();
argument >> item.enabled >> item.signature >> item.state;
argument.endStructure();
return argument;
}
// GMenuActionsChange
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuActionsChange &item)
{
argument.beginStructure();
argument << item.removed << item.enabledChanged << item.stateChanged << item.added;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuActionsChange &item)
{
argument.beginStructure();
argument >> item.removed >> item.enabledChanged >> item.stateChanged >> item.added;
argument.endStructure();
return argument;
}
void GDBusMenuTypes_register()
{
static bool registered = false;
if (registered) {
return;
}
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
qDBusRegisterMetaType();
registered = true;
}
core-0.8/gmenuproxy/gdbusmenutypes_p.h 0000664 0000000 0000000 00000004544 14175040243 0020303 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#pragma once
#include
#include
#include
#include
class QDBusArgument;
// Various
using VariantMapList = QList;
Q_DECLARE_METATYPE(VariantMapList);
using StringBoolMap = QMap;
Q_DECLARE_METATYPE(StringBoolMap);
// Menu item itself (Start method)
struct GMenuItem {
uint id;
uint section;
VariantMapList items;
};
Q_DECLARE_METATYPE(GMenuItem);
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuItem &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuItem &item);
using GMenuItemList = QList;
Q_DECLARE_METATYPE(GMenuItemList);
// Information about what section or submenu to use for a particular entry
struct GMenuSection {
uint subscription;
uint menu;
};
Q_DECLARE_METATYPE(GMenuSection);
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuSection &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuSection &item);
// Changes of a menu item (Changed signal)
struct GMenuChange {
uint subscription;
uint menu;
uint changePosition;
uint itemsToRemoveCount;
VariantMapList itemsToInsert;
};
Q_DECLARE_METATYPE(GMenuChange);
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuChange &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuChange &item);
using GMenuChangeList = QList;
Q_DECLARE_METATYPE(GMenuChangeList);
// An application action
struct GMenuAction {
bool enabled;
QDBusSignature signature;
QVariantList state;
};
Q_DECLARE_METATYPE(GMenuAction);
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuAction &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuAction &item);
using GMenuActionMap = QMap;
Q_DECLARE_METATYPE(GMenuActionMap);
struct GMenuActionsChange {
QStringList removed;
QMap enabledChanged;
QVariantMap stateChanged;
GMenuActionMap added;
};
Q_DECLARE_METATYPE(GMenuActionsChange);
QDBusArgument &operator<<(QDBusArgument &argument, const GMenuActionsChange &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, GMenuActionsChange &item);
void GDBusMenuTypes_register();
core-0.8/gmenuproxy/gmenudbusmenuproxy.desktop 0000664 0000000 0000000 00000002766 14175040243 0022114 0 ustar 00root root 0000000 0000000 [Desktop Entry]
Exec=gmenudbusmenuproxy
Name=GMenuDBusMenuProxy
Name[ar]=وكيل قائمة D-Bus لـ GMenu.
Name[ast]=GMenuDBusMenuProxy
Name[az]=GMenuDBusMenuProxy
Name[ca]=GMenuDBusMenuProxy
Name[ca@valencia]=GMenuDBusMenuProxy
Name[da]=GMenuDBusMenuProxy
Name[de]=GMenuDBusMenuProxy
Name[el]=GMenuDBusMenuProxy
Name[en_GB]=GMenuDBusMenuProxy
Name[es]=GMenuDBusMenuProxy
Name[et]=GMenuDBusMenuProxy
Name[eu]=GMenuDBusMenuProxy
Name[fi]=GMenuDBusMenuProxy
Name[fr]=GMenuDBusMenuProxy
Name[gl]=Proxy de menú por D-Bus para GMenu.
Name[hi]=जीमेन्यूडीबसमेन्यूप्रॉक्सी
Name[hu]=GMenuDBusMenuProxy
Name[ia]=GMenuDBusMenuProxy
Name[id]=GMenuDBusMenuProxy
Name[it]=GMenuDBusMenuProxy
Name[ko]=GMenuDBusMenuProxy
Name[lt]=GMenuDBusMenuProxy
Name[ml]=ജിമെനുഡിബസ്മെനുപ്രോക്സി
Name[nl]=GMenuDBusMenuProxy
Name[nn]=GMenuDBusMenuProxy
Name[pa]=GMenuDBusMenuProxy
Name[pl]=GMenuDBusMenuProxy
Name[pt]=GMenuDBusMenuProxy
Name[pt_BR]=GMenuDBusMenuProxy
Name[ro]=GMenuDBusMenuProxy
Name[ru]=GMenuDBusMenuProxy
Name[sk]=GMenuDBusMenuProxy
Name[sl]=GMenuDBusMenuProxy
Name[sv]=GMenuDBusMenuProxy
Name[ta]=GMenuDBusMenuProxy
Name[tr]=GMenuDBusMenuProxy
Name[uk]=Проксі-меню GMenu D-Bus
Name[vi]=GMenuDBusMenuProxy
Name[x-test]=xxGMenuDBusMenuProxyxx
Name[zh_CN]=GMenuDBusMenuProxy
Name[zh_TW]=GMenuDBusMenuProxy
Type=Application
X-KDE-StartupNotify=false
NoDisplay=true
OnlyShowIn=KDE;
X-KDE-autostart-phase=1
X-systemd-skip=true
core-0.8/gmenuproxy/icons.cpp 0000664 0000000 0000000 00000037000 14175040243 0016345 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "icons.h"
#include
#include
QString Icons::actionIcon(const QString &actionName)
{
QString icon;
QString action = actionName;
if (action.isEmpty()) {
return icon;
}
static const QHash s_icons{
{QStringLiteral("new"), QStringLiteral("document-new")}, // appmenu-gtk-module "New"
{QStringLiteral("image-new"), QStringLiteral("document-new")}, // Gimp "New" item
{QStringLiteral("adddirect"), QStringLiteral("document-new")}, // LibreOffice "New" item
{QStringLiteral("filenew"), QStringLiteral("document-new")}, // Pluma "New" item
{QStringLiteral("new-window"), QStringLiteral("window-new")},
{QStringLiteral("newwindow"), QStringLiteral("window-new")},
{QStringLiteral("yelp-window-new"), QStringLiteral("window-new")}, // Gnome help
{QStringLiteral("new-tab"), QStringLiteral("tab-new")},
{QStringLiteral("open"), QStringLiteral("document-open")},
{QStringLiteral("open-location"), QStringLiteral("document-open-remote")},
{QStringLiteral("openremote"), QStringLiteral("document-open-remote")},
{QStringLiteral("save"), QStringLiteral("document-save")},
{QStringLiteral("save-as"), QStringLiteral("document-save-as")},
{QStringLiteral("saveas"), QStringLiteral("document-save-as")},
{QStringLiteral("save-all"), QStringLiteral("document-save-all")},
{QStringLiteral("saveall"), QStringLiteral("document-save-all")},
{QStringLiteral("import"), QStringLiteral("document-import")},
{QStringLiteral("export"), QStringLiteral("document-export")},
{QStringLiteral("exportto"), QStringLiteral("document-export")}, // LibreOffice
{QStringLiteral("exporttopdf"), QStringLiteral("viewpdf")}, // LibreOffice, the icon it uses but the name is quite random
{QStringLiteral("webhtml"), QStringLiteral("text-html")}, // LibreOffice
{QStringLiteral("printpreview"), QStringLiteral("document-print-preview")},
{QStringLiteral("print-preview"), QStringLiteral("document-print-preview")},
{QStringLiteral("print"), QStringLiteral("document-print")},
{QStringLiteral("print-gtk"), QStringLiteral("document-print")}, // Gimp
{QStringLiteral("mail-image"), QStringLiteral("mail-message-new")}, // Gimp
{QStringLiteral("sendmail"), QStringLiteral("mail-message-new")}, // LibreOffice
{QStringLiteral("sendviabluetooth"), QStringLiteral("preferences-system-bluetooth")}, // LibreOffice
{QStringLiteral("sendviabluetooth"), QStringLiteral("preferences-system-bluetooth")}, // LibreOffice
{QStringLiteral("document-properties"), QStringLiteral("document-properties")},
{QStringLiteral("close"), QStringLiteral("document-close")}, // appmenu-gtk-module "Close"
{QStringLiteral("closedoc"), QStringLiteral("document-close")},
{QStringLiteral("close-all"), QStringLiteral("document-close")},
{QStringLiteral("closeall"), QStringLiteral("document-close")},
{QStringLiteral("closewin"), QStringLiteral("window-close")}, // LibreOffice
{QStringLiteral("quit"), QStringLiteral("application-exit")},
{QStringLiteral("undo"), QStringLiteral("edit-undo")},
{QStringLiteral("redo"), QStringLiteral("edit-redo")},
{QStringLiteral("revert"), QStringLiteral("document-revert")},
{QStringLiteral("cut"), QStringLiteral("edit-cut")},
{QStringLiteral("copy"), QStringLiteral("edit-copy")},
{QStringLiteral("paste"), QStringLiteral("edit-paste")},
{QStringLiteral("duplicate"), QStringLiteral("edit-duplicate")},
{QStringLiteral("preferences"), QStringLiteral("settings-configure")},
{QStringLiteral("optionstreedialog"), QStringLiteral("settings-configure")}, // LibreOffice
{QStringLiteral("keyboard-shortcuts"), QStringLiteral("configure-shortcuts")},
{QStringLiteral("fullscreen"), QStringLiteral("view-fullscreen")},
{QStringLiteral("find"), QStringLiteral("edit-find")},
{QStringLiteral("searchfind"), QStringLiteral("edit-find")},
{QStringLiteral("replace"), QStringLiteral("edit-find-replace")},
{QStringLiteral("searchreplace"), QStringLiteral("edit-find-replace")}, // LibreOffice
{QStringLiteral("searchdialog"), QStringLiteral("edit-find-replace")}, // LibreOffice
{QStringLiteral("find-replace"), QStringLiteral("edit-find-replace")}, // Inkscape
{QStringLiteral("select-all"), QStringLiteral("edit-select-all")},
{QStringLiteral("selectall"), QStringLiteral("edit-select-all")},
{QStringLiteral("select-none"), QStringLiteral("edit-select-invert")},
{QStringLiteral("select-invert"), QStringLiteral("edit-select-invert")},
{QStringLiteral("invert-selection"), QStringLiteral("edit-select-invert")}, // Inkscape
{QStringLiteral("check-spelling"), QStringLiteral("tools-check-spelling")},
{QStringLiteral("set-language"), QStringLiteral("set-language")},
{QStringLiteral("increasesize"), QStringLiteral("zoom-in")},
{QStringLiteral("decreasesize"), QStringLiteral("zoom-out")},
{QStringLiteral("zoom-in"), QStringLiteral("zoom-in")},
{QStringLiteral("zoom-out"), QStringLiteral("zoom-out")},
{QStringLiteral("zoomfit"), QStringLiteral("zoom-fit-best")},
{QStringLiteral("zoom-fit-in"), QStringLiteral("zoom-fit-best")},
{QStringLiteral("show-guides"), QStringLiteral("show-guides")},
{QStringLiteral("show-grid"), QStringLiteral("show-grid")},
{QStringLiteral("rotateclockwise"), QStringLiteral("object-rotate-right")},
{QStringLiteral("rotatecounterclockwise"), QStringLiteral("object-rotate-left")},
{QStringLiteral("fliphorizontally"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("image-flip-horizontal"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("flipvertically"), QStringLiteral("object-flip-vertical")},
{QStringLiteral("image-flip-vertical"), QStringLiteral("object-flip-vertical")},
{QStringLiteral("image-scale"), QStringLiteral("transform-scale")},
{QStringLiteral("bold"), QStringLiteral("format-text-bold")},
{QStringLiteral("italic"), QStringLiteral("format-text-italic")},
{QStringLiteral("underline"), QStringLiteral("format-text-underline")},
{QStringLiteral("strikeout"), QStringLiteral("format-text-strikethrough")},
{QStringLiteral("superscript"), QStringLiteral("format-text-superscript")},
{QStringLiteral("subscript"), QStringLiteral("format-text-subscript")},
// "grow" is a bit unspecific to always set it to "grow font", so use the exact ID here
{QStringLiteral(".uno:Grow"), QStringLiteral("format-font-size-more")}, // LibreOffice
{QStringLiteral(".uno:Shrink"), QStringLiteral("format-font-size-less")}, // LibreOffice
// also a bit unspecific?
{QStringLiteral("alignleft"), QStringLiteral("format-justify-left")},
{QStringLiteral("alignhorizontalcenter"), QStringLiteral("format-justify-center")},
{QStringLiteral("alignright"), QStringLiteral("format-justify-right")},
{QStringLiteral("alignjustified"), QStringLiteral("format-justify-fill")},
{QStringLiteral("incrementindent"), QStringLiteral("format-indent-more")},
{QStringLiteral("decrementindent"), QStringLiteral("format-indent-less")},
{QStringLiteral("defaultbullet"), QStringLiteral("format-list-unordered")}, // LibreOffice
{QStringLiteral("defaultnumbering"), QStringLiteral("format-list-ordered")}, // LibreOffice
{QStringLiteral("sortascending"), QStringLiteral("view-sort-ascending")},
{QStringLiteral("sortdescending"), QStringLiteral("view-sort-descending")},
{QStringLiteral("autopilotmenu"), QStringLiteral("tools-wizard")}, // LibreOffice
{QStringLiteral("layers-new"), QStringLiteral("layer-new")},
{QStringLiteral("layers-duplicate"), QStringLiteral("layer-duplicate")},
{QStringLiteral("layers-delete"), QStringLiteral("layer-delete")},
{QStringLiteral("layers-anchor"), QStringLiteral("anchor")},
{QStringLiteral("slideshow"), QStringLiteral("media-playback-start")}, // Gwenview uses this icon for that
{QStringLiteral("playvideo"), QStringLiteral("media-playback-start")},
{QStringLiteral("addtags"), QStringLiteral("tag-new")},
{QStringLiteral("newevent"), QStringLiteral("appointment-new")},
{QStringLiteral("previous-document"), QStringLiteral("go-previous")},
{QStringLiteral("prevphoto"), QStringLiteral("go-previous")},
{QStringLiteral("next-document"), QStringLiteral("go-next")},
{QStringLiteral("nextphoto"), QStringLiteral("go-next")},
{QStringLiteral("redeye"), QStringLiteral("redeyes")},
{QStringLiteral("crop"), QStringLiteral("transform-crop")},
{QStringLiteral("move"), QStringLiteral("transform-move")},
{QStringLiteral("rotate"), QStringLiteral("transform-rotate")},
{QStringLiteral("scale"), QStringLiteral("transform-scale")},
{QStringLiteral("shear"), QStringLiteral("transform-shear")},
{QStringLiteral("flip"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("flag"), QStringLiteral("flag-red")}, // is there a "mark" or "important" icon that isn't email?
{QStringLiteral("tools-measure"), QStringLiteral("measure")},
{QStringLiteral("tools-text"), QStringLiteral("draw-text")},
{QStringLiteral("tools-color-picker"), QStringLiteral("color-picker")},
{QStringLiteral("tools-paintbrush"), QStringLiteral("draw-brush")},
{QStringLiteral("tools-eraser"), QStringLiteral("draw-eraser")},
{QStringLiteral("tools-paintbrush"), QStringLiteral("draw-brush")},
{QStringLiteral("help"), QStringLiteral("help-contents")},
{QStringLiteral("helpindex"), QStringLiteral("help-contents")},
{QStringLiteral("contents"), QStringLiteral("help-contents")},
{QStringLiteral("helpcontents"), QStringLiteral("help-contents")},
{QStringLiteral("context-help"), QStringLiteral("help-whatsthis")},
{QStringLiteral("extendedhelp"), QStringLiteral("help-whatsthis")}, // LibreOffice
{QStringLiteral("helpreportproblem"), QStringLiteral("tools-report-bug")},
{QStringLiteral("sendfeedback"), QStringLiteral("tools-report-bug")}, // LibreOffice
{QStringLiteral("about"), QStringLiteral("help-about")},
{QStringLiteral("emptytrash"), QStringLiteral("trash-empty")},
{QStringLiteral("movetotrash"), QStringLiteral("user-trash-symbolic")},
// Gnome help
{QStringLiteral("yelp-application-larger-text"), QStringLiteral("format-font-size-more")},
{QStringLiteral("yelp-application-smaller-text"), QStringLiteral("format-font-size-less")}, // LibreOffice
// LibreOffice documents in its New menu
{QStringLiteral("private:factory/swriter"), QStringLiteral("application-vnd.oasis.opendocument.text")},
{QStringLiteral("private:factory/scalc"), QStringLiteral("application-vnd.oasis.opendocument.spreadsheet")},
{QStringLiteral("private:factory/simpress"), QStringLiteral("application-vnd.oasis.opendocument.presentation")},
{QStringLiteral("private:factory/sdraw"), QStringLiteral("application-vnd.oasis.opendocument.graphics")},
{QStringLiteral("private:factory/swriter/web"), QStringLiteral("text-html")},
{QStringLiteral("private:factory/smath"), QStringLiteral("application-vnd.oasis.opendocument.formula")},
};
// Sometimes we get additional arguments (?slot=123) we don't care about
const int questionMarkIndex = action.indexOf(QLatin1Char('?'));
if (questionMarkIndex > -1) {
action.truncate(questionMarkIndex);
}
icon = s_icons.value(action);
if (icon.isEmpty()) {
const int dotIndex = action.indexOf(QLatin1Char('.')); // app., win., or unity. prefix
QString prefix;
if (dotIndex > -1) {
prefix = action.left(dotIndex);
action = action.mid(dotIndex + 1);
}
// appmenu-gtk-module
if (prefix == QLatin1String("unity")) {
// Remove superfluous hyphens added by appmenu-gtk-module
// First remove multiple subsequent ones
static QRegularExpression subsequentHyphenRegExp(QStringLiteral("-{2,}"));
action.replace(subsequentHyphenRegExp, QStringLiteral("-"));
// now we can be sure we only have a single hyphen at the start or end, remove it if needed
if (action.startsWith(QLatin1Char('-'))) {
action.remove(0, 1);
}
if (action.endsWith(QLatin1Char('-'))) {
action.chop(1);
}
// It also turns accelerators (&) into hyphens, so remove any hyphen that comes before
// a lower-case letter ("mid sentence"), e.g. "P-references"
static QRegularExpression strayHyphenRegExp(QStringLiteral("-(?=[a-z]+)"));
action.remove(strayHyphenRegExp);
}
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
static const auto s_dup1Prefix = QStringLiteral("dup:1:"); // can it be dup2 also?
if (action.startsWith(s_dup1Prefix)) {
action = action.mid(s_dup1Prefix.length());
}
static const auto s_unoPrefix = QStringLiteral(".uno:"); // LibreOffice with appmenu-gtk
if (action.startsWith(s_unoPrefix)) {
action = action.mid(s_unoPrefix.length());
}
// LibreOffice's "Open" entry is always "OpenFromAppname" so we just chop that off
if (action.startsWith(QLatin1String("OpenFrom"))) {
action.truncate(4); // basically "Open"
}
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
static const auto s_commonPrefix = QStringLiteral("Common");
if (action.startsWith(s_commonPrefix)) {
action = action.mid(s_commonPrefix.length());
}
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
static const auto s_prefixes = QStringList{
// Gimp with appmenu-gtk
QStringLiteral("file-"),
QStringLiteral("edit-"),
QStringLiteral("view-"),
QStringLiteral("image-"),
QStringLiteral("layers-"),
QStringLiteral("colors-"),
QStringLiteral("tools-"),
QStringLiteral("plug-in-"),
QStringLiteral("windows-"),
QStringLiteral("dialogs-"),
QStringLiteral("help-"),
};
for (const QString &prefix : s_prefixes) {
if (action.startsWith(prefix)) {
action = action.mid(prefix.length());
break;
}
}
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
action = action.toLower();
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
static const auto s_prefixes = QStringList{
// Pluma with appmenu-gtk
QStringLiteral("file"),
QStringLiteral("edit"),
QStringLiteral("view"),
QStringLiteral("help"),
};
for (const QString &prefix : s_prefixes) {
if (action.startsWith(prefix)) {
action = action.mid(prefix.length());
break;
}
}
icon = s_icons.value(action);
}
return icon;
}
core-0.8/gmenuproxy/icons.h 0000664 0000000 0000000 00000000346 14175040243 0016015 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#pragma once
#include
namespace Icons
{
QString actionIcon(const QString &actionName);
}
core-0.8/gmenuproxy/main.cpp 0000664 0000000 0000000 00000001617 14175040243 0016163 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include
#include
#include
#include "menuproxy.h"
int main(int argc, char **argv)
{
qputenv("QT_QPA_PLATFORM", "xcb");
QGuiApplication::setDesktopSettingsAware(false);
QGuiApplication app(argc, argv);
if (!KWindowSystem::isPlatformX11()) {
qFatal("qdbusmenuproxy is only useful XCB. Aborting");
}
auto disableSessionManagement = [](QSessionManager &sm) {
sm.setRestartHint(QSessionManager::RestartNever);
};
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
app.setQuitOnLastWindowClosed(false);
MenuProxy proxy;
return app.exec();
}
core-0.8/gmenuproxy/menu.cpp 0000664 0000000 0000000 00000025225 14175040243 0016204 0 ustar 00root root 0000000 0000000 /*
SPDX-FileCopyrightText: 2018 Kai Uwe Broulik
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "menu.h"
#include
#include
#include
#include
#include
#include
#include
#include "utils.h"
static const QString s_orgGtkMenus = QStringLiteral("org.gtk.Menus");
Menu::Menu(const QString &serviceName, const QString &objectPath, QObject *parent)
: QObject(parent)
, m_serviceName(serviceName)
, m_objectPath(objectPath)
{
Q_ASSERT(!serviceName.isEmpty());
Q_ASSERT(!m_objectPath.isEmpty());
if (!QDBusConnection::sessionBus()
.connect(m_serviceName, m_objectPath, s_orgGtkMenus, QStringLiteral("Changed"), this, SLOT(onMenuChanged(GMenuChangeList)))) {
qDebug() << "Failed to subscribe to menu changes for" << parent << "on" << serviceName << "at" << objectPath;
}
}
Menu::~Menu() = default;
void Menu::cleanup()
{
stop(m_subscriptions);
}
void Menu::start(uint id)
{
if (m_subscriptions.contains(id)) {
return;
}
// TODO watch service disappearing?
// dbus-send --print-reply --session --dest=:1.103 /org/libreoffice/window/104857641/menus/menubar org.gtk.Menus.Start array:uint32:0
QDBusMessage msg = QDBusMessage::createMethodCall(m_serviceName, m_objectPath, s_orgGtkMenus, QStringLiteral("Start"));
msg.setArguments({QVariant::fromValue(QList{id})});
QDBusPendingReply