Say welcome to Edgar, the python gadget loader.
You can now write E gadgets in python. ...python rocks !!
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser 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
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
|
@ -0,0 +1,36 @@
|
|||
# Simple Makefile for Enlightenment (edgar) gadgets
|
||||
|
||||
# gadget specific config
|
||||
GADGET_NAME = audio
|
||||
EXTRA_FILES =
|
||||
|
||||
|
||||
# nothing should be changed below this point
|
||||
GADGET_FILES = __init__.pyc $(GADGET_NAME).edj
|
||||
prefix = $(shell pkg-config --variable=libdir enlightenment)
|
||||
gadget_folder = ${prefix}/enlightenment/gadgets/$(GADGET_NAME)
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_FILES) $(EXTRA_FILES)
|
||||
|
||||
install: all
|
||||
@mkdir -p -v ${gadget_folder}
|
||||
@cp --preserve=mode -v $(GADGET_FILES) $(EXTRA_FILES) $(gadget_folder)
|
||||
|
||||
uninstall: all
|
||||
@rm -rfv ${gadget_folder}
|
||||
|
||||
clean:
|
||||
@rm -fv $(GADGET_NAME).edj
|
||||
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
%.edj: %.edc images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $<
|
||||
@chmod -v og+r $@
|
||||
|
||||
%.pyc: %.py
|
||||
python3 -c "from py_compile import compile; compile('$<', '$@')"
|
|
@ -0,0 +1,508 @@
|
|||
# This python file use the following encoding: utf-8
|
||||
|
||||
import os
|
||||
import sys
|
||||
import dbus
|
||||
from urllib.parse import unquote as url_unquote
|
||||
|
||||
import e
|
||||
|
||||
from efl import ecore
|
||||
from efl import evas
|
||||
from efl import edje
|
||||
from efl.dbus_mainloop import DBusEcoreMainLoop
|
||||
from efl.elementary.icon import Icon
|
||||
from efl.elementary.label import Label
|
||||
from efl.elementary.slider import Slider
|
||||
|
||||
|
||||
def DBG(*args):
|
||||
print(*args)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
_instance = None
|
||||
|
||||
|
||||
class Gadget(e.Gadget):
|
||||
|
||||
__gadget_name__ = 'Audio'
|
||||
__gadget_vers__ = '0.1'
|
||||
__gadget_auth__ = 'DaveMDS'
|
||||
__gadget_mail__ = 'dave@gurumeditation.it'
|
||||
__gadget_desc__ = 'The complete audio gadget.'
|
||||
__gadget_vapi__ = 1
|
||||
|
||||
def __init__(self):
|
||||
global _instance
|
||||
_instance = self
|
||||
|
||||
super().__init__()
|
||||
|
||||
self.player_objs = {} # key: "player name" val: (list of edje objs)
|
||||
self.channel_objs = {} # key: Channel instance val: (list of elm Slider)
|
||||
|
||||
self.mpris = Mpris2_Client()
|
||||
self.pulse = PulseAudio_Client()
|
||||
|
||||
def instance_created(self, obj, site):
|
||||
super().instance_created(obj, site)
|
||||
|
||||
obj.signal_callback_add('mouse,down,2', 'over', self.speaker_click_cb)
|
||||
obj.signal_callback_add('mouse,wheel,*', 'over', self.speaker_wheel_cb)
|
||||
self.speaker_update(obj)
|
||||
|
||||
def instance_destroyed(self, obj):
|
||||
super().instance_destroyed(obj)
|
||||
|
||||
def speaker_click_cb(self, obj, sig, source):
|
||||
ch = self.pulse.channels[0]
|
||||
ch.mute_toggle()
|
||||
|
||||
def speaker_update(self, speaker):
|
||||
if self.pulse and len(self.pulse.channels) > 0:
|
||||
ch = self.pulse.channels[0]
|
||||
left = right = ch.volume / 655
|
||||
speaker.message_send(0, (ch.muted, left, right))
|
||||
|
||||
def speaker_wheel_cb(self, obj, sig, source):
|
||||
ch = self.pulse.channels[0]
|
||||
vol = ch.volume
|
||||
if sig == 'mouse,wheel,0,1':
|
||||
new_vol = vol - 3000
|
||||
elif sig == 'mouse,wheel,0,-1':
|
||||
new_vol = vol + 3000
|
||||
else:
|
||||
return
|
||||
ch.volume_set(min(max(0, new_vol), 65500))
|
||||
|
||||
def popup_created(self, popup):
|
||||
super().popup_created(popup)
|
||||
|
||||
# add all the available players to the popup edje box
|
||||
for player in self.mpris.players:
|
||||
self.popup_player_add(popup, player)
|
||||
|
||||
# add all the channel sliders
|
||||
if self.pulse.conn is not None:
|
||||
for ch in self.pulse.channels:
|
||||
self.popup_volume_add(popup, ch)
|
||||
else:
|
||||
lb = Label(popup, text='Cannot connect to PulseAudio')
|
||||
lb.show()
|
||||
popup.part_box_append('volumes.box', lb)
|
||||
|
||||
def popup_destroyed(self, popup):
|
||||
super().popup_destroyed(popup)
|
||||
|
||||
while True:
|
||||
# pop an item from the players box
|
||||
obj = popup.part_box_remove_at('players.box', 0)
|
||||
if obj is None: break
|
||||
|
||||
# remove the obj from our lists
|
||||
for name, objs in self.player_objs.items():
|
||||
while obj in objs: objs.remove(obj)
|
||||
|
||||
# delete the cover image
|
||||
cover = obj.part_swallow_get('cover.swallow')
|
||||
if cover: cover.delete()
|
||||
|
||||
# and finally delete the player edje obj
|
||||
obj.delete()
|
||||
|
||||
def popup_player_add(self, popup, player):
|
||||
# create the edje obj for this player from 'e/gadgets/audio/player'
|
||||
o = edje.Edje(popup.evas, update_hints=True)
|
||||
e.theme_edje_object_set(o, 'audio', 'player')
|
||||
o.size_hint_min = o.size_min
|
||||
|
||||
o.signal_callback_add('act,play', '', lambda o,sig,src: player.play())
|
||||
o.signal_callback_add('act,prev', '', lambda o,sig,src: player.prev())
|
||||
o.signal_callback_add('act,next', '', lambda o,sig,src: player.next())
|
||||
o.signal_callback_add('act,rais', '', lambda o,sig,src: player.rais())
|
||||
|
||||
self.player_update(o, player)
|
||||
o.show()
|
||||
|
||||
# insert the player in the popup box
|
||||
popup.part_box_append('players.box', o)
|
||||
|
||||
# keep track of this obj in the player_objs dict
|
||||
if not player in self.player_objs:
|
||||
self.player_objs[player] = []
|
||||
self.player_objs[player].append(o)
|
||||
|
||||
def player_changed(self, player):
|
||||
# the mpris player has changed, update all the relative edje objects
|
||||
for o in self.player_objs.get(player, []):
|
||||
self.player_update(o, player)
|
||||
|
||||
def player_update(self, obj, player):
|
||||
# player name
|
||||
obj.part_text_set('player_name', player.label or player.name)
|
||||
|
||||
# play/pause button
|
||||
if player.playback_status == 'Playing':
|
||||
obj.signal_emit('state,set,playing', '')
|
||||
else:
|
||||
obj.signal_emit('state,set,paused', '')
|
||||
|
||||
# metadata
|
||||
txt = ''
|
||||
if 'xesam:title' in player.metadata:
|
||||
txt += '<title>%s</><br>' % player.metadata['xesam:title']
|
||||
if 'xesam:artist' in player.metadata:
|
||||
txt += '<tag>by</> %s<br>' % player.metadata['xesam:artist'][0]
|
||||
if 'xesam:album' in player.metadata:
|
||||
txt += '<tag>from</> %s<br>' % player.metadata['xesam:album']
|
||||
obj.part_text_set('metadata', txt)
|
||||
|
||||
# cover image
|
||||
img = obj.part_swallow_get('cover.swallow')
|
||||
if img: img.delete()
|
||||
|
||||
if 'mpris:artUrl' in player.metadata:
|
||||
fname = url_unquote(player.metadata['mpris:artUrl'])
|
||||
fname = fname.replace('file://', '')
|
||||
try:
|
||||
img = evas.FilledImage(obj.evas, file=fname)
|
||||
obj.part_swallow('cover.swallow', img)
|
||||
except:
|
||||
pass
|
||||
|
||||
def popup_volume_add(self, popup, channel):
|
||||
sl = Slider(popup, text=channel.name, min_max=(0, 65500),
|
||||
size_hint_align=(evas.EVAS_HINT_FILL, 0.0))
|
||||
sl.value = channel.volume
|
||||
sl.disabled = True if channel.muted else False
|
||||
sl.callback_changed_add(self.popup_slider_changed_cb, channel)
|
||||
sl.callback_slider_drag_start_add(self.popup_slider_drag_start_cb)
|
||||
sl.callback_slider_drag_stop_add(self.popup_slider_drag_stop_cb)
|
||||
sl.event_callback_add(evas.EVAS_CALLBACK_MOUSE_DOWN,
|
||||
self.popup_slider_click_cb, channel)
|
||||
sl.show()
|
||||
|
||||
# insert the slider in the popup box
|
||||
popup.part_box_prepend('volumes.box', sl)
|
||||
# popup.calc_force()
|
||||
|
||||
# keep track of this obj in the channel_objs dict
|
||||
if not channel in self.channel_objs:
|
||||
self.channel_objs[channel] = []
|
||||
self.channel_objs[channel].append(sl)
|
||||
|
||||
def popup_slider_changed_cb(self, slider, channel):
|
||||
channel.volume_set(slider.value)
|
||||
|
||||
def popup_slider_click_cb(self, slider, event, channel):
|
||||
if event.button == 2:
|
||||
channel.mute_toggle()
|
||||
|
||||
def popup_slider_drag_start_cb(self, slider):
|
||||
slider.data['dragging'] = True
|
||||
|
||||
def popup_slider_drag_stop_cb(self, slider):
|
||||
del slider.data['dragging']
|
||||
|
||||
def volume_changed(self, channel):
|
||||
# update all the sliders (except the one currently dragged)
|
||||
if channel in self.channel_objs:
|
||||
for sl in self.channel_objs[channel]:
|
||||
if not 'dragging' in sl.data:
|
||||
sl.value = channel.volume
|
||||
# update all the speakers
|
||||
for speaker in self._instances:
|
||||
self.speaker_update(speaker)
|
||||
|
||||
def mute_changed(self, channel):
|
||||
# update all the sliders and the speakers
|
||||
if channel in self.channel_objs:
|
||||
for sl in self.channel_objs[channel]:
|
||||
sl.disabled = True if channel.muted else False
|
||||
for speaker in self._instances:
|
||||
self.speaker_update(speaker)
|
||||
|
||||
def channel_added(self, channel):
|
||||
for popup in self._popups:
|
||||
self.popup_volume_add(popup, channel)
|
||||
|
||||
def channel_removed(self, channel):
|
||||
if channel in self.channel_objs:
|
||||
for sl in self.channel_objs[channel]:
|
||||
sl.delete()
|
||||
del self.channel_objs[channel][:]
|
||||
del self.channel_objs[channel]
|
||||
|
||||
|
||||
class Mpris2_Client(object):
|
||||
BASE_PATH = 'org.mpris.MediaPlayer2.'
|
||||
|
||||
def __init__ (self):
|
||||
self.players = []
|
||||
self.bus = dbus.SessionBus(mainloop=DBusEcoreMainLoop())
|
||||
|
||||
# update the players list
|
||||
self.update_players_list()
|
||||
# and keep the list updated when names changes
|
||||
self.sig1 = self.bus.add_signal_receiver(self.name_owner_changed_cb,
|
||||
"NameOwnerChanged")
|
||||
|
||||
def name_owner_changed_cb(self, name, old_owner, new_owner):
|
||||
if name.startswith(self.BASE_PATH):
|
||||
self.update_players_list()
|
||||
|
||||
def update_players_list(self):
|
||||
names = [ n for n in self.bus.list_names() if n.startswith(self.BASE_PATH) ]
|
||||
del self.players[:]
|
||||
for name in names:
|
||||
self.players.append(Mpris2_Player(self.bus, name[len(self.BASE_PATH):]))
|
||||
|
||||
|
||||
class Mpris2_Player(object):
|
||||
MAIN_IFACE = 'org.mpris.MediaPlayer2'
|
||||
PLAYER_IFACE = 'org.mpris.MediaPlayer2.Player'
|
||||
|
||||
def __init__(self, bus, name):
|
||||
self.name = name
|
||||
self.label = None
|
||||
self.metadata = None # metadata dict as per mpris2 specs
|
||||
self.playback_status = 'Stopped' # or 'Playing' or 'Paused'
|
||||
self.volume = 0.0 # range: 0.0 - 1.0
|
||||
|
||||
self.proxy = bus.get_object('org.mpris.MediaPlayer2.%s' % name,
|
||||
'/org/mpris/MediaPlayer2')
|
||||
|
||||
# self.prop_iface.GetAll(...)
|
||||
self.prop_iface = dbus.Interface(self.proxy, dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
self.prop_iface.connect_to_signal('PropertiesChanged', self.props_changed_cb)
|
||||
self.metadata = self.prop_iface.Get(self.PLAYER_IFACE, 'Metadata')
|
||||
self.playback_status = self.prop_iface.Get(self.PLAYER_IFACE, 'PlaybackStatus')
|
||||
self.volume = self.prop_iface.Get(self.PLAYER_IFACE, 'Volume')
|
||||
self.label = self.prop_iface.Get(self.MAIN_IFACE, 'Identity')
|
||||
|
||||
def props_changed_cb(self, iface, props, invalidated):
|
||||
if 'Metadata' in props:
|
||||
self.metadata = props.get('Metadata')
|
||||
if 'PlaybackStatus' in props:
|
||||
self.playback_status = props.get('PlaybackStatus')
|
||||
if 'Volume' in props:
|
||||
self.volume = props.get('Volume')
|
||||
|
||||
_instance.player_changed(self)
|
||||
|
||||
def play(self):
|
||||
self.proxy.PlayPause(dbus_interface=self.PLAYER_IFACE)
|
||||
|
||||
def next(self):
|
||||
self.proxy.Next(dbus_interface=self.PLAYER_IFACE)
|
||||
|
||||
def prev(self):
|
||||
self.proxy.Previous(dbus_interface=self.PLAYER_IFACE)
|
||||
|
||||
def rais(self):
|
||||
self.proxy.Raise(dbus_interface=self.MAIN_IFACE)
|
||||
|
||||
|
||||
class AudioChannel(object):
|
||||
def __init__(self, obj, iface, name, volume, muted):
|
||||
self.obj = obj
|
||||
self.iface = iface
|
||||
self.name = name
|
||||
self.volume = int(volume[0])
|
||||
self.muted = muted
|
||||
|
||||
# This do not work, only connection on the main pulse obj work...
|
||||
# so for the moment dispatch the callback from there
|
||||
# obj.connect_to_signal('VolumeUpdated', self.volume_changed_signal_cb)
|
||||
|
||||
def volume_set(self, value):
|
||||
self.volume = value
|
||||
self.obj.Set(self.iface, 'Volume', [dbus.UInt32(value)],
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
|
||||
def mute_toggle(self):
|
||||
self.muted = not self.muted
|
||||
self.obj.Set(self.iface, 'Mute', self.muted,
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
|
||||
def volume_changed_signal_cb(self, volume):
|
||||
self.volume = int(volume[0])
|
||||
_instance.volume_changed(self)
|
||||
|
||||
def mute_changed_signal_cb(self, muted):
|
||||
self.muted = muted
|
||||
_instance.mute_changed(self)
|
||||
|
||||
def __str__(self):
|
||||
return '[%s]: "%s" volume: %s' % \
|
||||
(self.iface.split('.')[-1], self.name, self.volume[:])
|
||||
|
||||
|
||||
class PulseAudio_Client(object):
|
||||
PULSE_OBJ = '/org/pulseaudio/core1'
|
||||
PULSE_IFACE = 'org.PulseAudio.Core1'
|
||||
STREAM_IFACE = 'org.PulseAudio.Core1.Stream'
|
||||
DEVICE_IFACE = 'org.PulseAudio.Core1.Device'
|
||||
|
||||
def __init__ (self):
|
||||
self.conn = None
|
||||
self.srv_addr = None
|
||||
self.channels = []
|
||||
|
||||
self.try_to_connect()
|
||||
|
||||
def try_to_connect(self):
|
||||
if self.connect() is False:
|
||||
ecore.Timer(5.0, self.try_to_connect)
|
||||
return ecore.ECORE_CALLBACK_CANCEL
|
||||
|
||||
def connect(self):
|
||||
self.srv_addr = self.address_lookup()
|
||||
if self.srv_addr is None:
|
||||
# TODO maybe try to start pulse here
|
||||
return False
|
||||
try:
|
||||
self.conn = dbus.connection.Connection(self.srv_addr,
|
||||
mainloop=DBusEcoreMainLoop())
|
||||
except:
|
||||
return False
|
||||
|
||||
# get all available channels
|
||||
self.all_channels_add()
|
||||
# and listen for channels added/removed
|
||||
pulse = self.conn.get_object(object_path=self.PULSE_OBJ)
|
||||
for sig in ('NewSink', 'SinkRemoved',
|
||||
'NewPlaybackStream', 'PlaybackStreamRemoved'):
|
||||
pulse.ListenForSignal('org.PulseAudio.Core1.' + sig,
|
||||
dbus.Array(signature='o'))
|
||||
self.conn.add_signal_receiver(self.channel_signal_cb, sig,
|
||||
member_keyword='signal')
|
||||
# also enable volume/mute signal from pulse
|
||||
for sig in ('Device.VolumeUpdated', 'Device.MuteUpdated',
|
||||
'Stream.VolumeUpdated', 'Stream.MuteUpdated'):
|
||||
pulse.ListenForSignal('org.PulseAudio.Core1.' + sig,
|
||||
dbus.Array(signature='o'))
|
||||
# this should be connected per-object, in the Channel class...
|
||||
for sig in ('VolumeUpdated', 'MuteUpdated'):
|
||||
self.conn.add_signal_receiver(self.volume_signal_cb, sig,
|
||||
member_keyword='signal',
|
||||
path_keyword='obj_path')
|
||||
return True
|
||||
|
||||
def channel_signal_cb(self, *args, signal):
|
||||
obj_path = args[0]
|
||||
if signal == 'NewSink':
|
||||
ch = self.sink_add(obj_path)
|
||||
if ch: _instance.channel_added(ch)
|
||||
elif signal == 'NewPlaybackStream':
|
||||
ch = self.stream_add(obj_path)
|
||||
if ch: _instance.channel_added(ch)
|
||||
elif signal in ('SinkRemoved', 'PlaybackStreamRemoved'):
|
||||
for ch in self.channels:
|
||||
if ch.obj.object_path == obj_path:
|
||||
_instance.channel_removed(ch)
|
||||
self.channels.remove(ch)
|
||||
del ch
|
||||
|
||||
def volume_signal_cb(self, *args, signal, obj_path):
|
||||
# dispatch to the correct Channel instance
|
||||
for ch in self.channels:
|
||||
if ch.obj.object_path == obj_path:
|
||||
if signal == 'VolumeUpdated':
|
||||
ch.volume_changed_signal_cb(*args)
|
||||
elif signal == 'MuteUpdated':
|
||||
ch.mute_changed_signal_cb(*args)
|
||||
break
|
||||
|
||||
def address_lookup(self):
|
||||
""" Search the address of the pulse dbus socket """
|
||||
# 1. try the environment var
|
||||
addr = os.environ.get('PULSE_DBUS_SERVER')
|
||||
if addr: return addr
|
||||
|
||||
# 2. well-known system-wide daemon socket
|
||||
if os.access('/run/pulse/dbus-socket', os.R_OK | os.W_OK):
|
||||
return 'unix:path=/run/pulse/dbus-socket'
|
||||
|
||||
# 3. dbus lookup on the SessionBus
|
||||
try:
|
||||
bus = dbus.SessionBus()
|
||||
obj = bus.get_object('org.PulseAudio1', '/org/pulseaudio/server_lookup1')
|
||||
return obj.Get('org.PulseAudio.ServerLookup1', 'Address',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
except:
|
||||
return None
|
||||
|
||||
def _fuckyoupulse(self, ay):
|
||||
return ''.join([ chr(byte) for byte in ay ])
|
||||
|
||||
def all_channels_add(self):
|
||||
obj = self.conn.get_object(self.PULSE_IFACE, self.PULSE_OBJ)
|
||||
|
||||
sinks = obj.Get(self.PULSE_IFACE, 'Sinks',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
streams = obj.Get(self.PULSE_IFACE, 'PlaybackStreams',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
|
||||
# keep the default sink (if available) on top of the list
|
||||
try:
|
||||
default_sink = obj.Get(self.PULSE_IFACE, 'FallbackSink',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if default_sink in sinks:
|
||||
sinks.remove(default_sink)
|
||||
sinks.insert(0, default_sink)
|
||||
|
||||
for obj_path in sinks:
|
||||
self.sink_add(obj_path)
|
||||
|
||||
for obj_path in streams:
|
||||
self.stream_add(obj_path)
|
||||
|
||||
def stream_add(self, obj_path):
|
||||
try:
|
||||
obj = self.conn.get_object(self.STREAM_IFACE, obj_path)
|
||||
volume = obj.Get(self.STREAM_IFACE, 'Volume',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
mute = obj.Get(self.STREAM_IFACE, 'Mute',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
props = obj.Get(self.STREAM_IFACE, 'PropertyList',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
except:
|
||||
return None
|
||||
|
||||
try:
|
||||
name = self._fuckyoupulse(props['application.name'])
|
||||
except:
|
||||
name = 'Unknown app'
|
||||
|
||||
ch = AudioChannel(obj, self.STREAM_IFACE, name, volume, mute)
|
||||
self.channels.append(ch)
|
||||
return ch
|
||||
|
||||
def sink_add(self, obj_path):
|
||||
try:
|
||||
obj = self.conn.get_object(self.DEVICE_IFACE, obj_path)
|
||||
volume = obj.Get(self.DEVICE_IFACE, 'Volume',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
mute = obj.Get(self.DEVICE_IFACE, 'Mute',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
props = obj.Get(self.DEVICE_IFACE, 'PropertyList',
|
||||
dbus_interface=dbus.PROPERTIES_IFACE)
|
||||
except:
|
||||
return None
|
||||
|
||||
try:
|
||||
name = self._fuckyoupulse(props['device.profile.description'])
|
||||
except:
|
||||
try:
|
||||
name = self._fuckyoupulse(props['device.description'])
|
||||
except:
|
||||
name = 'Unknown device'
|
||||
|
||||
ch = AudioChannel(obj, self.DEVICE_IFACE, name, volume, mute)
|
||||
self.channels.append(ch)
|
||||
return ch
|
|
@ -0,0 +1,413 @@
|
|||
/**
|
||||
* E17 Audio Gadget
|
||||
*/
|
||||
|
||||
|
||||
#define FIXED_SIZE(_WIDTH, _HEIGHT) \
|
||||
min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1;
|
||||
|
||||
#define FN "Sans"
|
||||
#define FNBD "Sans:style=Bold"
|
||||
#define FN_COL_HIGHLIGHT 51 153 255 255; color2: 51 153 255 24; color3: 51 153 255 18
|
||||
|
||||
|
||||
images {
|
||||
image: "icon_mixer.png" COMP;
|
||||
image: "icon_prev.png" COMP;
|
||||
image: "icon_next.png" COMP;
|
||||
image: "icon_pause.png" COMP;
|
||||
image: "icon_play.png" COMP;
|
||||
image: "cover.png" COMP;
|
||||
image: "speaker.png" COMP;
|
||||
image: "inset_round_hilight.png" COMP;
|
||||
image: "inset_round_shadow.png" COMP;
|
||||
image: "inset_round_shading.png" COMP;
|
||||
image: "led_dot_white.png" COMP;
|
||||
}
|
||||
|
||||
|
||||
collections {
|
||||
/**
|
||||
* API [e/gadget/icon] The group used for the icon of the gadget
|
||||
*/
|
||||
group { name: "e/gadgets/audio/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "icon_mixer.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API [e/gadget/main] The main group of the gadget
|
||||
*/
|
||||
group { name: "e/gadgets/audio/main";
|
||||
max: 160 160;
|
||||
min: 16 16;
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT_SET) && (id == 0)) {
|
||||
new m, l, r;
|
||||
|
||||
m = getarg(2);
|
||||
l = getarg(3);
|
||||
r = getarg(4);
|
||||
|
||||
if (m) {
|
||||
run_program(PROGRAM:"mute");
|
||||
} else {
|
||||
run_program(PROGRAM:"unmute");
|
||||
}
|
||||
|
||||
if (l <= 0) {
|
||||
run_program(PROGRAM:"l0-off");
|
||||
run_program(PROGRAM:"l1-off");
|
||||
run_program(PROGRAM:"l2-off");
|
||||
run_program(PROGRAM:"l3-off");
|
||||
run_program(PROGRAM:"l4-off");
|
||||
} else if (l <= 20) {
|
||||
run_program(PROGRAM:"l0-on");
|
||||
run_program(PROGRAM:"l1-off");
|
||||
run_program(PROGRAM:"l2-off");
|
||||
run_program(PROGRAM:"l3-off");
|
||||
run_program(PROGRAM:"l4-off");
|
||||
} else if (l <= 40) {
|
||||
run_program(PROGRAM:"l0-on");
|
||||
run_program(PROGRAM:"l1-on");
|
||||
run_program(PROGRAM:"l2-off");
|
||||
run_program(PROGRAM:"l3-off");
|
||||
run_program(PROGRAM:"l4-off");
|
||||
} else if (l <= 60) {
|
||||
run_program(PROGRAM:"l0-on");
|
||||
run_program(PROGRAM:"l1-on");
|
||||
run_program(PROGRAM:"l2-on");
|
||||
run_program(PROGRAM:"l3-off");
|
||||
run_program(PROGRAM:"l4-off");
|
||||
} else if (l <= 80) {
|
||||
run_program(PROGRAM:"l0-on");
|
||||
run_program(PROGRAM:"l1-on");
|
||||
run_program(PROGRAM:"l2-on");
|
||||
run_program(PROGRAM:"l3-on");
|
||||
run_program(PROGRAM:"l4-off");
|
||||
} else {
|
||||
run_program(PROGRAM:"l0-on");
|
||||
run_program(PROGRAM:"l1-on");
|
||||
run_program(PROGRAM:"l2-on");
|
||||
run_program(PROGRAM:"l3-on");
|
||||
run_program(PROGRAM:"l4-on");
|
||||
}
|
||||
|
||||
if (r <= 0) {
|
||||
run_program(PROGRAM:"r0-off");
|
||||
run_program(PROGRAM:"r1-off");
|
||||
run_program(PROGRAM:"r2-off");
|
||||
run_program(PROGRAM:"r3-off");
|
||||
run_program(PROGRAM:"r4-off");
|
||||
} else if (r <= 20) {
|
||||
run_program(PROGRAM:"r0-on");
|
||||
run_program(PROGRAM:"r1-off");
|
||||
run_program(PROGRAM:"r2-off");
|
||||
run_program(PROGRAM:"r3-off");
|
||||
run_program(PROGRAM:"r4-off");
|
||||
} else if (r <= 40) {
|
||||
run_program(PROGRAM:"r0-on");
|
||||
run_program(PROGRAM:"r1-on");
|
||||
run_program(PROGRAM:"r2-off");
|
||||
run_program(PROGRAM:"r3-off");
|
||||
run_program(PROGRAM:"r4-off");
|
||||
} else if (r <= 60) {
|
||||
run_program(PROGRAM:"r0-on");
|
||||
run_program(PROGRAM:"r1-on");
|
||||
run_program(PROGRAM:"r2-on");
|
||||
run_program(PROGRAM:"r3-off");
|
||||
run_program(PROGRAM:"r4-off");
|
||||
} else if (r <= 80) {
|
||||
run_program(PROGRAM:"r0-on");
|
||||
run_program(PROGRAM:"r1-on");
|
||||
run_program(PROGRAM:"r2-on");
|
||||
run_program(PROGRAM:"r3-on");
|
||||
run_program(PROGRAM:"r4-off");
|
||||
} else {
|
||||
run_program(PROGRAM:"r0-on");
|
||||
run_program(PROGRAM:"r1-on");
|
||||
run_program(PROGRAM:"r2-on");
|
||||
run_program(PROGRAM:"r3-on");
|
||||
run_program(PROGRAM:"r4-on");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "base-sh";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "base";
|
||||
rel1.offset: 0 -1;
|
||||
rel2.to: "base";
|
||||
rel2.offset: -1 -2;
|
||||
image.normal: "inset_round_shadow.png";
|
||||
}
|
||||
}
|
||||
part { name: "base-hi";
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "base";
|
||||
rel1.offset: 0 1;
|
||||
rel2.to: "base";
|
||||
rel2.offset: -1 0;
|
||||
image.normal: "inset_round_hilight.png";
|
||||
}
|
||||
}
|
||||
part { name: "base";
|
||||
description { state: "default" 0.0;
|
||||
// min: 32 32;
|
||||
rel1.relative: (25/380) (25/380);
|
||||
rel2.relative: (365/380) (365/380);
|
||||
aspect: 1.0 1.0; aspect_preference: BOTH;
|
||||
image.normal: "speaker.png";
|
||||
}
|
||||
}
|
||||
part { name: "state"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.relative: -1.0 -1.0;
|
||||
rel2.relative: 2.0 2.0;
|
||||
color: 51 153 255 255;
|
||||
}
|
||||
description { state: "mute" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 153 51 255;
|
||||
}
|
||||
}
|
||||
#define LED(_NAME, _BASE, _X, _SIZE) \
|
||||
part { name: _NAME; type: RECT; \
|
||||
clip_to: "state"; \
|
||||
description { state: "default" 0.0; \
|
||||
rel1.relative: ((_BASE+(_X*8))/160) (80/160); \
|
||||
rel2.relative: ((_BASE+(_X*8))/160) (80/160); \
|
||||
min: 1 1; \
|
||||
max: 1 1; \
|
||||
visible: 0; \
|
||||
color: 255 255 255 0; \
|
||||
} \
|
||||
description { state: "active" 0.0; \
|
||||
inherit: "default" 0.0; \
|
||||
visible: 1; \
|
||||
color: 255 255 255 255; \
|
||||
} \
|
||||
} \
|
||||
part { name: _NAME"g"; \
|
||||
clip_to: "state"; \
|
||||
description { state: "default" 0.0; \
|
||||
rel1.to: _NAME; \
|
||||
rel2.to: _NAME; \
|
||||
image.normal: "led_dot_white.png"; \
|
||||
min: _SIZE _SIZE; \
|
||||
visible: 0; \
|
||||
color: 255 255 255 0; \
|
||||
} \
|
||||
description { state: "active" 0.0; \
|
||||
inherit: "default" 0.0; \
|
||||
visible: 1; \
|
||||
color: 255 255 255 255; \
|
||||
} \
|
||||
}
|
||||
LED("r0", 99, 0, 1)
|
||||
LED("r1", 99, 1, 9)
|
||||
LED("r2", 99, 2, 15)
|
||||
LED("r3", 99, 3, 21)
|
||||
LED("r4", 99, 4, 27)
|
||||
LED("l0", 61, 0, 1)
|
||||
LED("l1", 61, -1, 9)
|
||||
LED("l2", 61, -2, 15)
|
||||
LED("l3", 61, -3, 21)
|
||||
LED("l4", 61, -4, 27)
|
||||
#undef LED
|
||||
part { name: "over"; type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "mute";
|
||||
action: STATE_SET "mute" 0.0;
|
||||
transition: LINEAR 0.3;
|
||||
target: "state";
|
||||
}
|
||||
program { name: "unmute";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.2;
|
||||
target: "state";
|
||||
}
|
||||
#define PROG(_NAME) \
|
||||
program { name: _NAME"-on"; \
|
||||
action: STATE_SET "active" 0.0; \
|
||||
target: _NAME; \
|
||||
target: _NAME"g"; \
|
||||
} \
|
||||
program { name: _NAME"-off"; \
|
||||
action: STATE_SET "default" 0.0; \
|
||||
target: _NAME; \
|
||||
target: _NAME"g"; \
|
||||
}
|
||||
PROG("r0")
|
||||
PROG("r1")
|
||||
PROG("r2")
|
||||
PROG("r3")
|
||||
PROG("r4")
|
||||
PROG("l0")
|
||||
PROG("l1")
|
||||
PROG("l2")
|
||||
PROG("l3")
|
||||
PROG("l4")
|
||||
#undef PROG
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API [e/gadget/popup] This is the group that will be placed inside popups
|
||||
*/
|
||||
group { name: "e/gadgets/audio/popup";
|
||||
min: 310 0;
|
||||
parts {
|
||||
part { name: "players.box";
|
||||
type: BOX;
|
||||
description { state: "default" 0.0;
|
||||
rel2.relative: 1.0 0.0;
|
||||
align: 0.0 0.0;
|
||||
box {
|
||||
layout: "vertical";
|
||||
padding: 0 6;
|
||||
min: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "volumes.box";
|
||||
type: BOX;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "players.box";
|
||||
rel1.relative: 0.0 1.0;
|
||||
rel1.offset: 0 6;
|
||||
box {
|
||||
layout: "vertical";
|
||||
padding: 0 6;
|
||||
min: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/gadgets/audio/player";
|
||||
styles {
|
||||
style { name: "music_control_metadata_style";
|
||||
base: "font="FN" font_size=10 align=left color=#ffff style=shadow,bottom shadow_color=#00000080 wrap=mixed";
|
||||
tag: "title" "+ font="FNBD" font_size=12";
|
||||
tag: "tag" "+ font_size=8 color=#888f";
|
||||
tag: "br" "\n";
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "cover_bg";
|
||||
description { state: "default" 0;
|
||||
min: 100 100;
|
||||
max: 100 100;
|
||||
align: 0.0 0.5;
|
||||
image.normal: "cover.png";
|
||||
}
|
||||
}
|
||||
part { name: "cover.swallow"; type: SWALLOW;
|
||||
description { state: "default" 0;
|
||||
rel1.to: "cover_bg";
|
||||
rel2.to: "cover_bg";
|
||||
}
|
||||
}
|
||||
part { name: "player_name"; type: TEXT;
|
||||
effect: GLOW;
|
||||
description { state: "default" 0;
|
||||
min: 210 15;
|
||||
max: 210 15;
|
||||
align: 0.5 0.0;
|
||||
color: FN_COL_HIGHLIGHT;
|
||||
text {
|
||||
size: 12;
|
||||
font: FNBD;
|
||||
}
|
||||
rel1.to_x: "cover_bg";
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.offset: 3 0;
|
||||
}
|
||||
}
|
||||
part { name: "metadata"; type: TEXTBLOCK;
|
||||
description { state: "default" 0;
|
||||
text {
|
||||
style: "music_control_metadata_style";
|
||||
text: "Song Title";
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
rel1.to_x: "cover_bg";
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel1.offset: 3 15;
|
||||
}
|
||||
}
|
||||
part { name: "prev_btn";
|
||||
description { state: "default" 0;
|
||||
FIXED_SIZE(32, 32)
|
||||
rel1.to: "metadata";
|
||||
rel2.to: "metadata";
|
||||
align: 0.1 1.0;
|
||||
image.normal: "icon_prev.png";
|
||||
}
|
||||
}
|
||||
part { name: "play_btn";
|
||||
description { state: "default" 0;
|
||||
FIXED_SIZE(32, 32)
|
||||
rel1.to: "metadata";
|
||||
rel2.to: "metadata";
|
||||
align: 0.5 1.0;
|
||||
image.normal: "icon_pause.png";
|
||||
}
|
||||
description { state: "play" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "icon_play.png";
|
||||
}
|
||||
}
|
||||
part { name: "next_btn";
|
||||
description { state: "default" 0;
|
||||
FIXED_SIZE(32, 32)
|
||||
rel1.to: "metadata";
|
||||
rel2.to: "metadata";
|
||||
align: 0.9 1.0;
|
||||
image.normal: "icon_next.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { signal: "state,set,playing"; source: "";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "play_btn";
|
||||
}
|
||||
program { signal: "state,set,paused"; source: "";
|
||||
action: STATE_SET "play" 0.0;
|
||||
target: "play_btn";
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "play_btn";
|
||||
action: SIGNAL_EMIT "act,play" "";
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "prev_btn";
|
||||
action: SIGNAL_EMIT "act,prev" "";
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "next_btn";
|
||||
action: SIGNAL_EMIT "act,next" "";
|
||||
}
|
||||
program { signal: "mouse,down,1"; source: "player_name";
|
||||
action: SIGNAL_EMIT "act,rais" "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 509 B |
After Width: | Height: | Size: 19 KiB |
|
@ -0,0 +1,36 @@
|
|||
# Simple Makefile for Enlightenment (edgar) gadgets
|
||||
|
||||
# gadget specific config
|
||||
GADGET_NAME = calculator
|
||||
EXTRA_FILES =
|
||||
|
||||
|
||||
# nothing should be changed below this point
|
||||
GADGET_FILES = __init__.pyc $(GADGET_NAME).edj
|
||||
prefix = $(shell pkg-config --variable=libdir enlightenment)
|
||||
gadget_folder = ${prefix}/enlightenment/gadgets/$(GADGET_NAME)
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_FILES) $(EXTRA_FILES)
|
||||
|
||||
install: all
|
||||
@mkdir -p -v ${gadget_folder}
|
||||
@cp --preserve=mode -v $(GADGET_FILES) $(EXTRA_FILES) $(gadget_folder)
|
||||
|
||||
uninstall: all
|
||||
@rm -rfv ${gadget_folder}
|
||||
|
||||
clean:
|
||||
@rm -fv $(GADGET_NAME).edj
|
||||
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
%.edj: %.edc images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $<
|
||||
@chmod -v og+r $@
|
||||
|
||||
%.pyc: %.py
|
||||
python3 -c "from py_compile import compile; compile('$<', '$@')"
|
|
@ -0,0 +1,13 @@
|
|||
# This python file use the following encoding: utf-8
|
||||
|
||||
import e
|
||||
|
||||
|
||||
|
||||
class Gadget(e.Gadget):
|
||||
__gadget_name__ = 'Calculator'
|
||||
__gadget_vers__ = '0.1'
|
||||
__gadget_auth__ = 'DaveMDS'
|
||||
__gadget_mail__ = 'dave@gurumeditation.it'
|
||||
__gadget_desc__ = 'A pure edje calculator.'
|
||||
__gadget_vapi__ = 1
|
|
@ -0,0 +1,472 @@
|
|||
/* Copyright (C) 2008-2014 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of calculator.
|
||||
* calculator. is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* calculator. is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with calculator. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
images {
|
||||
image: "0.png" COMP;
|
||||
image: "1.png" COMP;
|
||||
image: "2.png" COMP;
|
||||
image: "3.png" COMP;
|
||||
image: "4.png" COMP;
|
||||
image: "5.png" COMP;
|
||||
image: "6.png" COMP;
|
||||
image: "7.png" COMP;
|
||||
image: "8.png" COMP;
|
||||
image: "9.png" COMP;
|
||||
image: "bg.png" COMP;
|
||||
image: "canc.png" COMP;
|
||||
image: "divide.png" COMP;
|
||||
image: "multiply.png" COMP;
|
||||
image: "minus.png" COMP;
|
||||
image: "plus.png" COMP;
|
||||
image: "point.png" COMP;
|
||||
image: "result.png" COMP;
|
||||
image: "m-c.png" COMP;
|
||||
image: "m-minus.png" COMP;
|
||||
image: "m-plus.png" COMP;
|
||||
image: "m-r.png" COMP;
|
||||
}
|
||||
|
||||
fonts {
|
||||
font: "Vera.ttf" "vera";
|
||||
}
|
||||
|
||||
|
||||
collections {
|
||||
|
||||
group { name: "e/gadgets/calculator/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "canc.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/gadgets/calculator/main";
|
||||
min: 231 256;
|
||||
max: 462 512;
|
||||
script {
|
||||
public current = 0; //Current float number
|
||||
public sum = 0;
|
||||
public sub = 0;
|
||||
public mul = 0;
|
||||
public div = 0;
|
||||
public restart = 0;
|
||||
public locale = 0; //The ascii value used for '.' by current locale
|
||||
|
||||
public get_locale()
|
||||
{
|
||||
new buf[5];
|
||||
snprintf(buf, 4, "%f", 1.1);
|
||||
set_int(locale, buf[1]);
|
||||
}
|
||||
|
||||
public calc_digit_add(val)
|
||||
{
|
||||
new buf[32];
|
||||
new text[32];
|
||||
|
||||
get_text(PART:"display", text, 31);
|
||||
|
||||
//need a new number (+.-,*,/ pressed)
|
||||
if (get_int(restart))
|
||||
snprintf(buf, 31, "%i", val);
|
||||
//point pressed
|
||||
else if (val == -1)
|
||||
snprintf(buf, 31, "%i%c", get_int(current), get_int(locale));
|
||||
//only the 0 digit is on screen
|
||||
else if ((text[0] == '0') && (text[1] == 0))
|
||||
snprintf(buf, 31, "%i", val);
|
||||
//Normal: append the number
|
||||
else
|
||||
snprintf(buf, 31, "%s%i", text, val);
|
||||
|
||||
set_text(PART:"display", buf);
|
||||
set_float(current, atof(buf));
|
||||
|
||||
if (get_int(restart))
|
||||
set_int(restart, 0);
|
||||
}
|
||||
|
||||
public calc_reset()
|
||||
{
|
||||
set_float(current, 0.0);
|
||||
set_float(sum, 0.0);
|
||||
set_float(sub, 0.0);
|
||||
set_float(mul, 0.0);
|
||||
set_float(div, 0.0);
|
||||
set_text(PART:"display", "0");
|
||||
}
|
||||
|
||||
public calc_result()
|
||||
{
|
||||
new buf[32];
|
||||
|
||||
if (get_float(sum))
|
||||
{
|
||||
snprintf(buf, 31, "%f", get_float(sum) + get_float(current));
|
||||
set_float(sum, 0.0);
|
||||
}
|
||||
else if (get_float(sub))
|
||||
{
|
||||
snprintf(buf, 31, "%f", get_float(sub) - get_float(current));
|
||||
set_float(sub, 0.0);
|
||||
}
|
||||
else if (get_float(mul))
|
||||
{
|
||||
snprintf(buf, 31, "%f", get_float(mul) * get_float(current));
|
||||
set_float(mul, 0.0);
|
||||
}
|
||||
else if (get_float(div))
|
||||
{
|
||||
snprintf(buf, 31, "%f", get_float(div) / get_float(current));
|
||||
set_float(div, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//remove leading zeroes
|
||||
new i = 0;
|
||||
while (buf[i] != 0) i++;
|
||||
i--;
|
||||
while (i && (buf[i] == '0'))
|
||||
{
|
||||
buf[i] = 0;
|
||||
i--;
|
||||
}
|
||||
if (buf[i] == get_int(locale)) buf[i] = 0;
|
||||
|
||||
//Set result
|
||||
set_text(PART:"display", buf);
|
||||
set_float(current, atof(buf));
|
||||
}
|
||||
|
||||
public calc_sum()
|
||||
{
|
||||
if (get_float(sum))
|
||||
calc_result();
|
||||
set_float(sum, get_float(current));
|
||||
set_float(current, 0.0);
|
||||
set_int(restart, 1);
|
||||
}
|
||||
|
||||
public calc_sub()
|
||||
{
|
||||
if (get_float(sub))
|
||||
calc_result();
|
||||
set_float(sub, get_float(current));
|
||||
set_float(current, 0.0);
|
||||
set_int(restart, 1);
|
||||
}
|
||||
|
||||
public calc_mul()
|
||||
{
|
||||
if (get_float(mul))
|
||||
calc_result();
|
||||
set_float(mul, get_float(current));
|
||||
set_float(current, 0.0);
|
||||
set_int(restart, 1);
|
||||
}
|
||||
|
||||
public calc_div()
|
||||
{
|
||||
if (get_float(div))
|
||||
calc_result();
|
||||
set_float(div, get_float(current));
|
||||
set_float(current, 0.0);
|
||||
set_int(restart, 1);
|
||||
}
|
||||
}
|
||||
|
||||
parts {
|
||||
part { name: "bg";
|
||||
type: IMAGE;
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
aspect: 0.9 0.9;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "display";
|
||||
type: TEXT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 68 72 63 200;
|
||||
rel1 {
|
||||
relative: 0.07 0.09;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.93 0.22;
|
||||
to: "bg";
|
||||
}
|
||||
text{
|
||||
font: "vera";
|
||||
size: 20;
|
||||
fit: 0 1;
|
||||
align: 1 0.5;
|
||||
text: "012345";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
part { name: "num_bg";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 0 255 0;
|
||||
rel1 {
|
||||
relative: 0.14 0.27;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.73 0.95;
|
||||
to: "bg";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define BTN(pname, rel1x, rel1y, rel2x, rel2y) \
|
||||
part { name: pname; \
|
||||
type: IMAGE; \
|
||||
description { state: "default" 0.0; \
|
||||
align: 0.5 0.5; \
|
||||
image { \
|
||||
normal: pname".png"; \
|
||||
} \
|
||||
rel1 { \
|
||||
relative: (rel1x+0.01) (rel1y+0.01); \
|
||||
to: "num_bg"; \
|
||||
} \
|
||||
rel2 { \
|
||||
relative: (rel2x-0.01) (rel2y-0.01); \
|
||||
to: "num_bg"; \
|
||||
} \
|
||||
} \
|
||||
description { state: "pressed" 0.0; \
|
||||
align: 0.5 0.5; \
|
||||
image { \
|
||||
normal: pname".png"; \
|
||||
} \
|
||||
rel1 { \
|
||||
relative: (rel1x+0.01) (rel1y+0.05); \
|
||||
to: "num_bg"; \
|
||||
} \
|
||||
rel2 { \
|
||||
relative: (rel2x-0.01) (rel2y-0.05); \
|
||||
to: "num_bg"; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
BTN("0", 0.0, 0.75, 0.33, 1.0)
|
||||
BTN("1", 0.0, 0.50, 0.33, 0.75)
|
||||
BTN("2", 0.33, 0.50, 0.66, 0.75)
|
||||
BTN("3", 0.66, 0.50, 0.99, 0.75)
|
||||
BTN("4", 0.0, 0.25, 0.33, 0.50)
|
||||
BTN("5", 0.33, 0.25, 0.66, 0.50)
|
||||
BTN("6", 0.66, 0.25, 0.99, 0.50)
|
||||
BTN("7", 0.0, 0.0, 0.33, 0.25)
|
||||
BTN("8", 0.33, 0.0, 0.66, 0.25)
|
||||
BTN("9", 0.66, 0.0, 0.99, 0.25)
|
||||
BTN("point", 0.33, 0.75, 0.66, 1.0)
|
||||
BTN("result", 0.66, 0.75, 0.99, 1.0)
|
||||
BTN("canc", 1.03, 0.0, 1.30, 0.20)
|
||||
BTN("divide", 1.03, 0.20, 1.30, 0.40)
|
||||
BTN("multiply", 1.03, 0.40, 1.30, 0.60)
|
||||
BTN("minus", 1.03, 0.60, 1.30, 0.80)
|
||||
BTN("plus", 1.03, 0.80, 1.30, 1.0)
|
||||
|
||||
}
|
||||
#define BTN_PROG(__pname) \
|
||||
program { name: "pressed_"__pname; \
|
||||
signal: "mouse,down,*"; \
|
||||
source: __pname; \
|
||||
action: STATE_SET "pressed" 0.0; \
|
||||
transition: SINUSOIDAL 0.2; \
|
||||
target: __pname; \
|
||||
after: "released_"__pname; \
|
||||
} \
|
||||
program { name: "released_"__pname; \
|
||||
source: ""; \
|
||||
action: STATE_SET "default" 0.0;\
|
||||
transition: SINUSOIDAL 0.2; \
|
||||
target: __pname; \
|
||||
}
|
||||
|
||||
programs {
|
||||
program { name: "init";
|
||||
signal: "load";
|
||||
source: "";
|
||||
script {
|
||||
set_text(PART:"display", "0");
|
||||
get_locale();
|
||||
}
|
||||
}
|
||||
|
||||
BTN_PROG("0")
|
||||
BTN_PROG("1")
|
||||
BTN_PROG("2")
|
||||
BTN_PROG("3")
|
||||
BTN_PROG("4")
|
||||
BTN_PROG("5")
|
||||
BTN_PROG("6")
|
||||
BTN_PROG("7")
|
||||
BTN_PROG("8")
|
||||
BTN_PROG("9")
|
||||
BTN_PROG("point")
|
||||
BTN_PROG("result")
|
||||
BTN_PROG("canc")
|
||||
BTN_PROG("divide")
|
||||
BTN_PROG("multiply")
|
||||
BTN_PROG("plus")
|
||||
BTN_PROG("minus")
|
||||
|
||||
program { name: "clicked_0";
|
||||
signal: "mouse,down,*";
|
||||
source: "0";
|
||||
script {
|
||||
calc_digit_add(0);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_1";
|
||||
signal: "mouse,down,*";
|
||||
source: "1";
|
||||
script {
|
||||
calc_digit_add(1);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_2";
|
||||
signal: "mouse,down,*";
|
||||
source: "2";
|
||||
script {
|
||||
calc_digit_add(2);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_3";
|
||||
signal: "mouse,down,*";
|
||||
source: "3";
|
||||
script {
|
||||
calc_digit_add(3);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_4";
|
||||
signal: "mouse,down,*";
|
||||
source: "4";
|
||||
script {
|
||||
calc_digit_add(4);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_5";
|
||||
signal: "mouse,down,*";
|
||||
source: "5";
|
||||
script {
|
||||
calc_digit_add(5);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_6";
|
||||
signal: "mouse,down,*";
|
||||
source: "6";
|
||||
script {
|
||||
calc_digit_add(6);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_7";
|
||||
signal: "mouse,down,*";
|
||||
source: "7";
|
||||
script {
|
||||
calc_digit_add(7);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_8";
|
||||
signal: "mouse,down,*";
|
||||
source: "8";
|
||||
script {
|
||||
calc_digit_add(8);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_9";
|
||||
signal: "mouse,down,*";
|
||||
source: "9";
|
||||
script {
|
||||
calc_digit_add(9);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_point";
|
||||
signal: "mouse,down,*";
|
||||
source: "point";
|
||||
script {
|
||||
calc_digit_add(-1);
|
||||
}
|
||||
}
|
||||
program { name: "clicked_canc";
|
||||
signal: "mouse,down,*";
|
||||
source: "canc";
|
||||
script {
|
||||
calc_reset();
|
||||
}
|
||||
}
|
||||
program { name: "clicked_plus";
|
||||
signal: "mouse,down,*";
|
||||
source: "plus";
|
||||
script {
|
||||
calc_sum();
|
||||
}
|
||||
}
|
||||
program { name: "clicked_minus";
|
||||
signal: "mouse,down,*";
|
||||
source: "minus";
|
||||
script {
|
||||
calc_sub();
|
||||
}
|
||||
}
|
||||
program { name: "clicked_multiply";
|
||||
signal: "mouse,down,*";
|
||||
source: "multiply";
|
||||
script {
|
||||
calc_mul();
|
||||
}
|
||||
}
|
||||
program { name: "clicked_divide";
|
||||
signal: "mouse,down,*";
|
||||
source: "divide";
|
||||
script {
|
||||
calc_div();
|
||||
}
|
||||
}
|
||||
program { name: "clicked_result";
|
||||
signal: "mouse,down,*";
|
||||
source: "result";
|
||||
script {
|
||||
calc_result();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 5.1 KiB |
|
@ -0,0 +1,36 @@
|
|||
# Simple Makefile for Enlightenment (edgar) gadgets
|
||||
|
||||
# gadget specific config
|
||||
GADGET_NAME = led_clock
|
||||
EXTRA_FILES =
|
||||
|
||||
|
||||
# nothing should be changed below this point
|
||||
GADGET_FILES = __init__.pyc $(GADGET_NAME).edj
|
||||
prefix = $(shell pkg-config --variable=libdir enlightenment)
|
||||
gadget_folder = ${prefix}/enlightenment/gadgets/$(GADGET_NAME)
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_FILES) $(EXTRA_FILES)
|
||||
|
||||
install: all
|
||||
@mkdir -p -v ${gadget_folder}
|
||||
@cp --preserve=mode -v $(GADGET_FILES) $(EXTRA_FILES) $(gadget_folder)
|
||||
|
||||
uninstall: all
|
||||
@rm -rfv ${gadget_folder}
|
||||
|
||||
clean:
|
||||
@rm -fv $(GADGET_NAME).edj
|
||||
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
%.edj: %.edc images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $<
|
||||
@chmod -v og+r $@
|
||||
|
||||
%.pyc: %.py
|
||||
python3 -c "from py_compile import compile; compile('$<', '$@')"
|
|
@ -0,0 +1,145 @@
|
|||
# This python file use the following encoding: utf-8
|
||||
|
||||
import sys
|
||||
import os
|
||||
import datetime
|
||||
import random
|
||||
import e
|
||||
|
||||
from efl import edje
|
||||
from efl import ecore
|
||||
|
||||
|
||||
COLORS = ('off', 'red', 'green', 'blu')
|
||||
|
||||
class Gadget(e.Gadget):
|
||||
|
||||
__gadget_name__ = 'Led Clock'
|
||||
__gadget_vers__ = '0.1'
|
||||
__gadget_auth__ = 'DaveMDS'
|
||||
__gadget_mail__ = 'dave@gurumeditation.it'
|
||||
__gadget_desc__ = 'The usual led clock.'
|
||||
__gadget_vapi__ = 1
|
||||
|
||||
def instance_created(self, obj, site):
|
||||
super().instance_created(obj, site)
|
||||
|
||||
timer = ecore.Timer(1.0, self.clock_timer_cb, obj)
|
||||
obj.data['timer'] = timer
|
||||
|
||||
obj.signal_callback_add('mouse,down,1', '*', self.led_click_cb)
|
||||
return obj
|
||||
|
||||
def instance_destroyed(self, obj):
|
||||
super().instance_destroyed(obj)
|
||||
|
||||
timer = obj.data.get('timer')
|
||||
if timer: timer.delete()
|
||||
timer2 = obj.data.get('timer2')
|
||||
if timer2: timer2.delete()
|
||||
|
||||
def clock_timer_cb(self, obj):
|
||||
time = datetime.datetime.now()
|
||||
self.draw_digit(obj, int(time.hour / 10), 1)
|
||||
self.draw_digit(obj, int(time.hour % 10), 2);
|
||||
self.draw_digit(obj, int(time.minute / 10), 3);
|
||||
self.draw_digit(obj, int(time.minute % 10), 4);
|
||||
return ecore.ECORE_CALLBACK_RENEW
|
||||
|
||||
def draw_digit(self, obj, digit, position):
|
||||
# build the "framebuffer"
|
||||
if position == 1:
|
||||
fb = [0, 0, 0]
|
||||
elif position == 3:
|
||||
fb = [0, 0, 0, 0, 0, 0]
|
||||
else:
|
||||
fb = [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
|
||||
# turn on the first N 'led' on the array (N = digit)
|
||||
for i in range(digit):
|
||||
fb[i] = 1;
|
||||
|
||||
# scramble the grid
|
||||
random.shuffle(fb)
|
||||
|
||||
# render to the 'fb'
|
||||
if position == 1:
|
||||
for i in range(len(fb)):
|
||||
self.led_set(obj, i + 1, 'red' if fb[i] else 'off')
|
||||
elif position == 2:
|
||||
for i in range(len(fb)):
|
||||
self.led_set(obj, i + 4, 'green' if fb[i] else 'off')
|
||||
elif position == 3:
|
||||
for i in range(len(fb)):
|
||||
self.led_set(obj, i + 13, 'blu' if fb[i] else 'off')
|
||||
elif position == 4:
|
||||
for i in range(len(fb)):
|
||||
self.led_set(obj, i + 19, 'red' if fb[i] else 'off')
|
||||
|
||||
|
||||
def led_set(self, obj, led, color):
|
||||
obj.signal_emit('led,set,' + color, 'led%d' % led)
|
||||
|
||||
def clear_all(self, obj):
|
||||
for i in range(1, 28):
|
||||
self.led_set(obj, i, 'off')
|
||||
|
||||
|
||||
## Animations
|
||||
def led_click_cb(self, obj, signal, source):
|
||||
if source == 'led1': start_func = self.start_anim_1
|
||||
elif source == 'led2': start_func = self.start_anim_2
|
||||
elif source == 'led3': start_func = self.start_anim_3
|
||||
else: return
|
||||
|
||||
timer = obj.data.get('timer')
|
||||
if timer: timer.delete()
|
||||
timer2 = obj.data.get('timer2')
|
||||
if timer2: timer2.delete()
|
||||
obj.data['timer2'] = ecore.Timer(10.0, self.stop_anim, obj)
|
||||
start_func(obj)
|
||||
|
||||
def stop_anim(self, obj):
|
||||
self.clear_all(obj)
|
||||
del obj.data['timer2']
|
||||
obj.data['timer'].delete()
|
||||
obj.data['timer'] = ecore.Timer(1.0, self.clock_timer_cb, obj)
|
||||
|
||||
return ecore.ECORE_CALLBACK_CANCEL
|
||||
|
||||
|
||||
## ANIM 1 (full colors)
|
||||
def start_anim_1(self, obj):
|
||||
obj.data['timer'] = ecore.Timer(0.4, self.animator_1, obj)
|
||||
obj.data['color'] = 0
|
||||
|
||||
def animator_1(self, obj):
|
||||
for i in range(1, 28):
|
||||
self.led_set(obj, i, COLORS[obj.data['color'] % 4])
|
||||
obj.data['color'] += 1
|
||||
return ecore.ECORE_CALLBACK_RENEW
|
||||
|
||||
|
||||
## ANIM 2 (colors carousell)
|
||||
def start_anim_2(self, obj):
|
||||
self.clear_all(obj)
|
||||
obj.data['timer'] = ecore.Timer(0.02, self.animator_2, obj)
|
||||
obj.data['color'] = 1
|
||||
obj.data['count'] = 27
|
||||
|
||||
def animator_2(self, obj):
|
||||
self.led_set(obj, obj.data['count'], COLORS[obj.data['color'] % 4])
|
||||
obj.data['count'] -= 1
|
||||
if obj.data['count'] <= 0:
|
||||
obj.data['count'] = 27
|
||||
obj.data['color'] += 1
|
||||
return ecore.ECORE_CALLBACK_RENEW
|
||||
|
||||
## ANIM 3 (randomize)
|
||||
def start_anim_3(self, obj):
|
||||
obj.data['timer'] = ecore.Timer(0.075, self.animator_3, obj)
|
||||
|
||||
def animator_3(self, obj):
|
||||
for i in range(1, 28):
|
||||
self.led_set(obj, i, random.choice(COLORS))
|
||||
return ecore.ECORE_CALLBACK_RENEW
|
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 61 KiB |
|
@ -0,0 +1,188 @@
|
|||
/* Copyright (C) 2014 Davide Andreoli <dave@gurumeditation.it>
|
||||
*
|
||||
* This file is part of led_clock.
|
||||
* led_clock. is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* led_clock. is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with led_clock. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* E17 Led Clock
|
||||
* A led clock.
|
||||
*/
|
||||
|
||||
images {
|
||||
image: "bg.png" COMP;
|
||||
image: "led_off.png" COMP;
|
||||
image: "led_red.png" COMP;
|
||||
image: "led_blu.png" COMP;
|
||||
image: "led_green.png" COMP;
|
||||
image: "icon.png" COMP;
|
||||
}
|
||||
|
||||
collections {
|
||||
|
||||
group { name: "e/gadgets/led_clock/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "icon.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "e/gadgets/led_clock/main";
|
||||
|
||||
|
||||
parts {
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
min: 74 21;
|
||||
max: 370 105;
|
||||
aspect: 3.5 3.5;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
border: 4 6 4 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define LED_PART(NAME, X1, Y1, X2, Y2) \
|
||||
part { name: NAME; \
|
||||
description { state: "default" 0.0; \
|
||||
align: 0.0 0.0; \
|
||||
rel1.relative: X1 Y1; \
|
||||
rel2.relative: X2 Y2; \
|
||||
rel1.to: "bg"; \
|
||||
rel2.to: "bg"; \
|
||||
color: 230 230 230 150; \
|
||||
image { normal: "led_off.png"; } \
|
||||
} \
|
||||
description { state: "green" 0.0; \
|
||||
inherit: "default" 0.0; \
|
||||
color: 230 230 230 230; \
|
||||
image { normal: "led_green.png"; } \
|
||||
} \
|
||||
description { state: "red" 0.0; \
|
||||
inherit: "default" 0.0; \
|
||||
color: 230 230 230 230; \
|
||||
image { normal: "led_red.png"; } \
|
||||
} \
|
||||
description { state: "blu" 0.0; \
|
||||
inherit: "default" 0.0; \
|
||||
color: 230 230 230 230; \
|
||||
image { normal: "led_blu.png"; } \
|
||||
} \
|
||||
}
|
||||
|
||||
LED_PART("led1", 0.043, 0.15, 0.103, 0.35)
|
||||
LED_PART("led2", 0.043, 0.40, 0.103, 0.60)
|
||||
LED_PART("led3", 0.043, 0.65, 0.103, 0.85)
|
||||
//--------------------
|
||||
LED_PART("led4", 0.193, 0.15, 0.253, 0.35)
|
||||
LED_PART("led5", 0.193, 0.40, 0.253, 0.60)
|
||||
LED_PART("led6", 0.193, 0.65, 0.253, 0.85)
|
||||
|
||||
LED_PART("led7", 0.268, 0.15, 0.330, 0.35)
|
||||
LED_PART("led8", 0.268, 0.40, 0.330, 0.60)
|
||||
LED_PART("led9", 0.268, 0.65, 0.330, 0.85)
|
||||
|
||||
LED_PART("led10", 0.346, 0.15, 0.404, 0.35)
|
||||
LED_PART("led11", 0.346, 0.40, 0.404, 0.60)
|
||||
LED_PART("led12", 0.346, 0.65, 0.404, 0.85)
|
||||
//--------------------
|
||||
LED_PART("led13", 0.497, 0.15, 0.560, 0.35)
|
||||
LED_PART("led14", 0.497, 0.40, 0.560, 0.60)
|
||||
LED_PART("led15", 0.497, 0.65, 0.560, 0.85)
|
||||
|
||||
LED_PART("led16", 0.573, 0.15, 0.638, 0.35)
|
||||
LED_PART("led17", 0.573, 0.40, 0.638, 0.60)
|
||||
LED_PART("led18", 0.573, 0.65, 0.638, 0.85)
|
||||
//--------------------
|
||||
LED_PART("led19", 0.730, 0.15, 0.795, 0.35)
|
||||
LED_PART("led20", 0.730, 0.40, 0.795, 0.60)
|
||||
LED_PART("led21", 0.730, 0.65, 0.795, 0.85)
|
||||
|
||||
LED_PART("led22", 0.805, 0.15, 0.869, 0.35)
|
||||
LED_PART("led23", 0.805, 0.40, 0.869, 0.60)
|
||||
LED_PART("led24", 0.805, 0.65, 0.869, 0.85)
|
||||
|
||||
LED_PART("led25", 0.883, 0.15, 0.947, 0.35)
|
||||
LED_PART("led26", 0.883, 0.40, 0.947, 0.60)
|
||||
LED_PART("led27", 0.883, 0.65, 0.947, 0.85)
|
||||
}
|
||||
programs {
|
||||
|
||||
#define LED_PROG(LED) \
|
||||
program { name: LED"_green"; \
|
||||
signal: "led,set,green"; \
|
||||
source: LED; \
|
||||
action: STATE_SET "green" 0.0; \
|
||||
target: LED; \
|
||||
} \
|
||||
program { name: LED"_red"; \
|
||||
signal: "led,set,red"; \
|
||||
source: LED; \
|
||||
action: STATE_SET "red" 0.0; \
|
||||
target: LED; \
|
||||
} \
|
||||
program { name: LED"_blu"; \
|
||||
signal: "led,set,blu"; \
|
||||
source: LED; \
|
||||
action: STATE_SET "blu" 0.0; \
|
||||
target: LED; \
|
||||
} \
|
||||
program { name: LED"_off"; \
|
||||
signal: "led,set,off"; \
|
||||
source: LED; \
|
||||
action: STATE_SET "default" 0.0; \
|
||||
target: LED; \
|
||||
}
|
||||
|
||||
LED_PROG("led1")
|
||||
LED_PROG("led2")
|
||||
LED_PROG("led3")
|
||||
LED_PROG("led4")
|
||||
LED_PROG("led5")
|
||||
LED_PROG("led6")
|
||||
LED_PROG("led7")
|
||||
LED_PROG("led8")
|
||||
LED_PROG("led9")
|
||||
LED_PROG("led10")
|
||||
LED_PROG("led11")
|
||||
LED_PROG("led12")
|
||||
LED_PROG("led13")
|
||||
LED_PROG("led14")
|
||||
LED_PROG("led15")
|
||||
LED_PROG("led16")
|
||||
LED_PROG("led17")
|
||||
LED_PROG("led18")
|
||||
LED_PROG("led19")
|
||||
LED_PROG("led20")
|
||||
LED_PROG("led21")
|
||||
LED_PROG("led22")
|
||||
LED_PROG("led23")
|
||||
LED_PROG("led24")
|
||||
LED_PROG("led25")
|
||||
LED_PROG("led26")
|
||||
LED_PROG("led27")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
# Simple Makefile for Enlightenment (edgar) gadgets
|
||||
|
||||
# gadget specific config
|
||||
GADGET_NAME = ruler
|
||||
EXTRA_FILES =
|
||||
|
||||
|
||||
# nothing should be changed below this point
|
||||
GADGET_FILES = __init__.pyc $(GADGET_NAME).edj
|
||||
prefix = $(shell pkg-config --variable=libdir enlightenment)
|
||||
gadget_folder = ${prefix}/enlightenment/gadgets/$(GADGET_NAME)
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_FILES) $(EXTRA_FILES)
|
||||
|
||||
install: all
|
||||
@mkdir -p -v ${gadget_folder}
|
||||
@cp --preserve=mode -v $(GADGET_FILES) $(EXTRA_FILES) $(gadget_folder)
|
||||
|
||||
uninstall: all
|
||||
@rm -rfv ${gadget_folder}
|
||||
|
||||
clean:
|
||||
@rm -fv $(GADGET_NAME).edj
|
||||
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
%.edj: %.edc images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $<
|
||||
@chmod -v og+r $@
|
||||
|
||||
%.pyc: %.py
|
||||
python3 -c "from py_compile import compile; compile('$<', '$@')"
|
|
@ -0,0 +1,28 @@
|
|||
# This python file use the following encoding: utf-8
|
||||
|
||||
import sys
|
||||
import os
|
||||
import e
|
||||
|
||||
from efl import evas
|
||||
|
||||
|
||||
class Gadget(e.Gadget):
|
||||
|
||||
__gadget_name__ = 'Ruler (HalloWorld)'
|
||||
__gadget_vers__ = '0.1'
|
||||
__gadget_auth__ = 'DaveMDS'
|
||||
__gadget_mail__ = 'dave@gurumeditation.it'
|
||||
__gadget_desc__ = 'All gadgets sets have a ruler...'
|
||||
__gadget_vapi__ = 1
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def instance_orient(self, obj, generic, specific):
|
||||
super().instance_orient(obj, generic, specific)
|
||||
|
||||
if generic == e.E_GADCON_ORIENT_VERT:
|
||||
obj.signal_emit('gadget,orient,vert', '')
|
||||
else:
|
||||
obj.signal_emit('gadget,orient,horiz', '')
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 14 KiB |
|
@ -0,0 +1,77 @@
|
|||
/**
|
||||
* E17 Ruler Gadget (HalloWorld)
|
||||
*
|
||||
* This is the simplest gadget yo can do.
|
||||
* Ruler will be used as reference, all off the gadgets features will be
|
||||
* documented here.You can use this file as a skeleton for your new gadgets.
|
||||
*
|
||||
* All the thing that is labeled as API are part that must exist in every
|
||||
* gadget.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
images {
|
||||
image: "icon.png" COMP;
|
||||
image: "ruler_horiz.png" COMP;
|
||||
image: "ruler_vert.png" COMP;
|
||||
}
|
||||
|
||||
|
||||
collections {
|
||||
/**
|
||||
* API [e/gadget/icon] The group used for the icon of the gadget
|
||||
*/
|
||||
group { name: "e/gadgets/ruler/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "icon.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API [e/gadget/main] The main group of the gadget
|
||||
* This group is the one that is places on the screen. It's name must be
|
||||
* e/gadget/main.
|
||||
*/
|
||||
group { name: "e/gadgets/ruler/main";
|
||||
parts {
|
||||
part { name: "ruler";
|
||||
description { state: "default" 0.0;
|
||||
min: 800 70;
|
||||
max: 800 70;
|
||||
image {
|
||||
normal: "ruler_horiz.png";
|
||||
}
|
||||
}
|
||||
description { state: "vertical" 0.0;
|
||||
min: 70 800;
|
||||
max: 70 800;
|
||||
image {
|
||||
normal: "ruler_vert.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { signal: "gadget,orient,vert";
|
||||
source: "";
|
||||
action: STATE_SET "vertical" 0.0;
|
||||
target: "ruler";
|
||||
}
|
||||
program { signal: "gadget,orient,horiz";
|
||||
source: "";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "ruler";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
GADGET_NAME = actions
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_NAME).edj
|
||||
|
||||
$(GADGET_NAME).edj: $(GADGET_NAME).edc $(GADGET_NAME).embryo images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $< $@
|
||||
|
||||
install: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
cp $(GADGET_NAME).edj ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
|
||||
uninstall: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj;
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(GADGET_NAME).edj
|
|
@ -0,0 +1,119 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of top5.
|
||||
* top5 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* top5 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with top5. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* E17 Actions Launcher
|
||||
*/
|
||||
|
||||
|
||||
data {
|
||||
item: "e/gadget/name" "EActions";
|
||||
item: "e/gadget/description" "Example gadget that run E actions";
|
||||
item: "e/gadget/version" "0.1.0";
|
||||
item: "e/gadget/author" "davemds <dave@gurumeditattion.it>";
|
||||
item: "e/gadget/license" "LGPL";
|
||||
item: "e/gadget/apparence" "plain";
|
||||
}
|
||||
|
||||
images {
|
||||
image: "bg.png" COMP;
|
||||
image: "e_logo.png" COMP;
|
||||
}
|
||||
|
||||
collections {
|
||||
group { name: "e/gadget/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/main";
|
||||
min: 90 100;
|
||||
max: 450 100;
|
||||
|
||||
#include "actions.embryo"
|
||||
|
||||
parts {
|
||||
part { name: "bg";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
text {
|
||||
text: "push me";
|
||||
font: "Sans";
|
||||
size: 14;
|
||||
align: 0.5 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "logo";
|
||||
type: IMAGE;
|
||||
mouse_events: 1;
|
||||
description { state: "default" 0;
|
||||
min: 140 70;
|
||||
max: 140 70;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 0 5;
|
||||
to: "bg";
|
||||
}
|
||||
image {
|
||||
normal: "e_logo.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
programs {
|
||||
program { name: "init";
|
||||
signal: "load";
|
||||
source: "";
|
||||
script {
|
||||
init();
|
||||
}
|
||||
}
|
||||
program { name: "click";
|
||||
signal: "mouse,clicked,1";
|
||||
source: "logo";
|
||||
script {
|
||||
do_the_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,459 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part top5.
|
||||
* top5 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* top5 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with top5. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// #define ACTION "syscon"
|
||||
// #define PARAMS ""
|
||||
|
||||
// #define ACTION "everything"
|
||||
// #define PARAMS ""
|
||||
|
||||
// #define ACTION "restart"
|
||||
// #define PARAMS ""
|
||||
|
||||
// #define ACTION "desk_flip_by"
|
||||
// #define PARAMS "1 0"
|
||||
|
||||
// #define ACTION "exec"
|
||||
// #define PARAMS "terminology"
|
||||
|
||||
|
||||
// #define ACTION "fileman"
|
||||
// #define PARAMS "~"
|
||||
|
||||
#define ACTION "menu_show"
|
||||
#define PARAMS "main"
|
||||
// #define PARAMS "favorites"
|
||||
// #define PARAMS "all"
|
||||
|
||||
|
||||
// #define ACTION "volume_increase"
|
||||
// #define ACTION "volume_decrease"
|
||||
// #define ACTION "volume_mute"
|
||||
// #define PARAMS ""
|
||||
|
||||
|
||||
// THOSE FAILS
|
||||
// #define ACTION "configuration"
|
||||
// #define PARAMS ""
|
||||
// #define ACTION "app"
|
||||
// #define PARAMS "firefox"
|
||||
|
||||
// THOSE FAILS (no go() in action)
|
||||
// #define ACTION "delayed_action"
|
||||
// #define PARAMS "0.0 everything"
|
||||
// #define ACTION "delayed_action"
|
||||
// #define PARAMS "0.0 exec terminology"
|
||||
|
||||
|
||||
script {
|
||||
|
||||
public init()
|
||||
{
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Actions Init");
|
||||
}
|
||||
|
||||
public do_the_action()
|
||||
{
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_ACTION", ACTION, PARAMS);
|
||||
}
|
||||
|
||||
public message(Msg_Type:type, id, ...)
|
||||
{
|
||||
new cmd[32];
|
||||
new res[32];
|
||||
|
||||
if ((type != MSG_STRING_SET)) return;
|
||||
getsarg(2, cmd, sizeof(cmd));
|
||||
|
||||
if (strcmp(cmd, "EDGAR_ACTION_REPLY") == 0)
|
||||
{
|
||||
getsarg(3, res, sizeof(res))
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Action reply received", res);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*** basic actions list ***/
|
||||
|
||||
/*** Clock
|
||||
- Toggle calendar [clock]
|
||||
params:'show_calendar' '(null)'
|
||||
*** Desktop
|
||||
- Flip Desktop Left [desk_flip_by]
|
||||
params:'-1 0' '(null)'
|
||||
- Flip Desktop Right [desk_flip_by]
|
||||
params:'1 0' '(null)'
|
||||
- Flip Desktop Up [desk_flip_by]
|
||||
params:'0 -1' '(null)'
|
||||
- Flip Desktop Down [desk_flip_by]
|
||||
params:'0 1' '(null)'
|
||||
- Flip Desktop By... [desk_flip_by]
|
||||
params:'(null)' 'syntax: X-offset Y-offset, example: -1 0'
|
||||
- Flip To Previous Desktop [desk_flip_prev]
|
||||
params:'(null)' '(null)'
|
||||
- Show The Desktop [desk_deskshow_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Show The Shelf [shelf_show]
|
||||
params:'(null)' 'shelf name glob: Shelf-* '
|
||||
- Flip Desktop To... [desk_flip_to]
|
||||
params:'(null)' 'syntax: X Y, example: 1 2'
|
||||
- Flip Desktop Linearly... [desk_linear_flip_by]
|
||||
params:'(null)' 'syntax: N-offset, example: -2'
|
||||
- Switch To Desktop 0 [desk_linear_flip_to]
|
||||
params:'0' '(null)'
|
||||
- Switch To Desktop 1 [desk_linear_flip_to]
|
||||
params:'1' '(null)'
|
||||
- Switch To Desktop 2 [desk_linear_flip_to]
|
||||
params:'2' '(null)'
|
||||
- Switch To Desktop 3 [desk_linear_flip_to]
|
||||
params:'3' '(null)'
|
||||
- Switch To Desktop 4 [desk_linear_flip_to]
|
||||
params:'4' '(null)'
|
||||
- Switch To Desktop 5 [desk_linear_flip_to]
|
||||
params:'5' '(null)'
|
||||
- Switch To Desktop 6 [desk_linear_flip_to]
|
||||
params:'6' '(null)'
|
||||
- Switch To Desktop 7 [desk_linear_flip_to]
|
||||
params:'7' '(null)'
|
||||
- Switch To Desktop 8 [desk_linear_flip_to]
|
||||
params:'8' '(null)'
|
||||
- Switch To Desktop 9 [desk_linear_flip_to]
|
||||
params:'9' '(null)'
|
||||
- Switch To Desktop 10 [desk_linear_flip_to]
|
||||
params:'10' '(null)'
|
||||
- Switch To Desktop 11 [desk_linear_flip_to]
|
||||
params:'11' '(null)'
|
||||
- Switch To Desktop... [desk_linear_flip_to]
|
||||
params:'(null)' 'syntax: N, example: 1'
|
||||
- Flip Desktop Left (All Screens) [desk_flip_by_all]
|
||||
params:'-1 0' '(null)'
|
||||
- Flip Desktop Right (All Screens) [desk_flip_by_all]
|
||||
params:'1 0' '(null)'
|
||||
- Flip Desktop Up (All Screens) [desk_flip_by_all]
|
||||
params:'0 -1' '(null)'
|
||||
- Flip Desktop Down (All Screens) [desk_flip_by_all]
|
||||
params:'0 1' '(null)'
|
||||
- Flip Desktop By... (All Screens) [desk_flip_by_all]
|
||||
params:'(null)' 'syntax: X-offset Y-offset, example: -1 0'
|
||||
- Flip Desktop To... (All Screens) [desk_flip_to_all]
|
||||
params:'(null)' 'syntax: X Y, example: 1 2'
|
||||
- Flip Desktop Linearly... (All Screens) [desk_linear_flip_by_all]
|
||||
params:'(null)' 'syntax: N-offset, example: -2'
|
||||
- Flip Desktop In Direction... [desk_flip_in_direction]
|
||||
params:'(null)' 'syntax: N-pixel-offset, example: 25'
|
||||
- Switch To Desktop 0 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'0' '(null)'
|
||||
- Switch To Desktop 1 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'1' '(null)'
|
||||
- Switch To Desktop 2 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'2' '(null)'
|
||||
- Switch To Desktop 3 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'3' '(null)'
|
||||
- Switch To Desktop 4 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'4' '(null)'
|
||||
- Switch To Desktop 5 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'5' '(null)'
|
||||
- Switch To Desktop 6 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'6' '(null)'
|
||||
- Switch To Desktop 7 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'7' '(null)'
|
||||
- Switch To Desktop 8 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'8' '(null)'
|
||||
- Switch To Desktop 9 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'9' '(null)'
|
||||
- Switch To Desktop 10 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'10' '(null)'
|
||||
- Switch To Desktop 11 (All Screens) [desk_linear_flip_to_all]
|
||||
params:'11' '(null)'
|
||||
- Switch To Desktop... (All Screens) [desk_linear_flip_to_all]
|
||||
params:'(null)' 'syntax: N, example: 1'
|
||||
- Lock [desk_lock]
|
||||
params:'(null)' '(null)'
|
||||
- Cleanup Windows [cleanup_windows]
|
||||
params:'(null)' '(null)'
|
||||
*** Enlightenment
|
||||
- Restart [restart]
|
||||
params:'(null)' '(null)'
|
||||
- Exit [exit]
|
||||
params:'(null)' '(null)'
|
||||
- Exit Now [exit_now]
|
||||
params:'(null)' '(null)'
|
||||
*** Enlightenment : Mode
|
||||
- Presentation Mode Toggle [mode_presentation_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Offline Mode Toggle [mode_offline_toggle]
|
||||
params:'(null)' '(null)'
|
||||
*** Enlightenment : Module
|
||||
- Enable the named module [module_enable]
|
||||
params:'(null)' '(null)'
|
||||
- Disable the named module [module_disable]
|
||||
params:'(null)' '(null)'
|
||||
- Toggle the named module [module_toggle]
|
||||
params:'(null)' '(null)'
|
||||
*** Everything Launcher
|
||||
- Show Everything Launcher [everything]
|
||||
params:'' '(null)'
|
||||
- Show Applications Plugin [everything]
|
||||
params:'Applications' '(null)'
|
||||
- Show Exebuf Plugin [everything]
|
||||
params:'Exebuf' '(null)'
|
||||
- Show Files Plugin [everything]
|
||||
params:'Files' '(null)'
|
||||
- Show Recent Files Plugin [everything]
|
||||
params:'Recent Files' '(null)'
|
||||
- Show Windows Plugin [everything]
|
||||
params:'Windows' '(null)'
|
||||
- Show Settings Plugin [everything]
|
||||
params:'Settings' '(null)'
|
||||
- Show Calculator Plugin [everything]
|
||||
params:'Calculator' '(null)'
|
||||
- Show Plugins Plugin [everything]
|
||||
params:'Plugins' '(null)'
|
||||
- Show Start Plugin [everything]
|
||||
params:'Start' '(null)'
|
||||
- Show Text Plugin [everything]
|
||||
params:'Text' '(null)'
|
||||
*** Gadgets
|
||||
- Show/hide gadgets [gadman_toggle]
|
||||
params:'(null)' '(null)'
|
||||
*** Generic : Actions
|
||||
- Delayed Action [delayed_action]
|
||||
params:'(null)' '[0.0 exec xterm] [0.3 exec xev]'
|
||||
*** IBar
|
||||
- Focus IBar [ibar_focus]
|
||||
params:'<none>' '(null)'
|
||||
*** Keyboard Layouts
|
||||
- Use keyboard layout [kbd_layout]
|
||||
params:'(null)' 'syntax: Keyboard-layout-name, example: us'
|
||||
- Next keyboard layout [kbd_layout_next]
|
||||
params:'(null)' '(null)'
|
||||
- Previous keyboard layout [kbd_layout_prev]
|
||||
params:'(null)' '(null)'
|
||||
*** Launch
|
||||
- Command [exec]
|
||||
params:'(null)' 'syntax: CommandName, example: /usr/bin/xmms'
|
||||
- Application [app]
|
||||
params:'(null)' 'syntax: , example:'
|
||||
- New Instance of Focused App [app_new_instance]
|
||||
params:'(null)' '(null)'
|
||||
- File Manager [fileman]
|
||||
params:'(null)' 'syntax: /path/to/dir or ~/path/to/dir or favorites or desktop, examples: /boot/grub, ~/downloads'
|
||||
- Settings Panel [configuration]
|
||||
params:'(null)' '(null)'
|
||||
*** Menu
|
||||
- Window Menu [window_menu]
|
||||
params:'(null)' '(null)'
|
||||
- Show Main Menu [menu_show]
|
||||
params:'main' '(null)'
|
||||
- Show Favorites Menu [menu_show]
|
||||
params:'favorites' '(null)'
|
||||
- Show All Applications Menu [menu_show]
|
||||
params:'all' '(null)'
|
||||
- Show Clients Menu [menu_show]
|
||||
params:'clients' '(null)'
|
||||
- Show Menu... [menu_show]
|
||||
params:'(null)' 'syntax: MenuName, example: MyMenu'
|
||||
*** Mixer
|
||||
- Increase Volume [volume_increase]
|
||||
params:'(null)' '(null)'
|
||||
- Decrease Volume [volume_decrease]
|
||||
params:'(null)' '(null)'
|
||||
- Mute Volume [volume_mute]
|
||||
params:'(null)' '(null)'
|
||||
*** Pager
|
||||
- Show Pager Popup [pager_show]
|
||||
params:'<none>' '(null)'
|
||||
- Popup Desk Right [pager_switch]
|
||||
params:'right' '(null)'
|
||||
- Popup Desk Left [pager_switch]
|
||||
params:'left' '(null)'
|
||||
- Popup Desk Up [pager_switch]
|
||||
params:'up' '(null)'
|
||||
- Popup Desk Down [pager_switch]
|
||||
params:'down' '(null)'
|
||||
- Popup Desk Next [pager_switch]
|
||||
params:'next' '(null)'
|
||||
- Popup Desk Previous [pager_switch]
|
||||
params:'prev' '(null)'
|
||||
*** Screen
|
||||
- Send Mouse To Screen 0 [screen_send_to]
|
||||
params:'0' '(null)'
|
||||
- Send Mouse To Screen 1 [screen_send_to]
|
||||
params:'1' '(null)'
|
||||
- Send Mouse To Screen... [screen_send_to]
|
||||
params:'(null)' 'syntax: N, example: 0'
|
||||
- Send Mouse Forward 1 Screen [screen_send_by]
|
||||
params:'1' '(null)'
|
||||
- Send Mouse Back 1 Screen [screen_send_by]
|
||||
params:'-1' '(null)'
|
||||
- Send Mouse Forward/Back Screens... [screen_send_by]
|
||||
params:'(null)' 'syntax: N-offset, example: -2'
|
||||
- Dim [dim_screen]
|
||||
params:'(null)' '(null)'
|
||||
- Undim [undim_screen]
|
||||
params:'(null)' '(null)'
|
||||
- Backlight Set [backlight_set]
|
||||
params:'(null)' 'syntax: brightness(0 - 100), example: 50'
|
||||
- Backlight Min [backlight_set]
|
||||
params:'0' '(null)'
|
||||
- Backlight Mid [backlight_set]
|
||||
params:'50' '(null)'
|
||||
- Backlight Max [backlight_set]
|
||||
params:'100' '(null)'
|
||||
- Backlight Adjust [backlight_adjust]
|
||||
params:'(null)' 'syntax: brightness(-100 - 100), example: -20'
|
||||
- Backlight Up [backlight_adjust]
|
||||
params:'10' '(null)'
|
||||
- Backlight Down [backlight_adjust]
|
||||
params:'-10' '(null)'
|
||||
- Backlight Controls [backlight]
|
||||
params:'(null)' '(null)'
|
||||
*** System
|
||||
- Log Out [logout]
|
||||
params:'(null)' '(null)'
|
||||
- Power Off Now [halt_now]
|
||||
params:'(null)' '(null)'
|
||||
- Power Off [halt]
|
||||
params:'(null)' '(null)'
|
||||
- Reboot [reboot]
|
||||
params:'(null)' '(null)'
|
||||
- Suspend Now [suspend_now]
|
||||
params:'(null)' '(null)'
|
||||
- Suspend [suspend]
|
||||
params:'(null)' '(null)'
|
||||
- Hibernate [hibernate]
|
||||
params:'(null)' '(null)'
|
||||
- Hibernate Now [hibernate_now]
|
||||
params:'(null)' '(null)'
|
||||
- System Controls [syscon]
|
||||
params:'(null)' '(null)'
|
||||
*** Window : Actions
|
||||
- Move [window_move]
|
||||
params:'(null)' '(null)'
|
||||
- Resize [window_resize]
|
||||
params:'(null)' '(null)'
|
||||
- Raise [window_raise]
|
||||
params:'(null)' '(null)'
|
||||
- Lower [window_lower]
|
||||
params:'(null)' '(null)'
|
||||
- Close [window_close]
|
||||
params:'(null)' '(null)'
|
||||
- Kill [window_kill]
|
||||
params:'(null)' '(null)'
|
||||
- Move To Center [window_move_to_center]
|
||||
params:'(null)' '(null)'
|
||||
- Move To Coordinates... [window_move_to]
|
||||
params:'(null)' 'syntax: [+,-]X [+,-]Y or * [+,-]Y or [+,-]X *, example: -1 +1'
|
||||
- Move By Coordinate Offset... [window_move_by]
|
||||
params:'(null)' 'syntax: X-offset Y-offset, example: -1 0'
|
||||
- Resize By... [window_resize_by]
|
||||
params:'(null)' 'syntax: W H, example: 100 150'
|
||||
- Push in Direction... [window_push]
|
||||
params:'(null)' 'syntax: direction, example: up, down, left, right, up-left, up-right, down-left, down-right'
|
||||
- Drag Icon... [window_drag_icon]
|
||||
params:'(null)' '(null)'
|
||||
*** Window : List
|
||||
- Jump to window... [window_jump_to]
|
||||
params:'(null)' 'syntax: icccm window name, example: urxvt-mutt'
|
||||
- Jump to window... or start... [window_jump_to_or_start]
|
||||
params:'(null)' 'syntax: icccm_window_name application'
|
||||
- Next Window [winlist]
|
||||
params:'next' '(null)'
|
||||
- Previous Window [winlist]
|
||||
params:'prev' '(null)'
|
||||
- Next window of same class [winlist]
|
||||
params:'class-next' '(null)'
|
||||
- Previous window of same class [winlist]
|
||||
params:'class-prev' '(null)'
|
||||
- Next window class [winlist]
|
||||
params:'classes-next' '(null)'
|
||||
- Previous window class [winlist]
|
||||
params:'classes-prev' '(null)'
|
||||
- Window on the Left [winlist]
|
||||
params:'left' '(null)'
|
||||
- Window Down [winlist]
|
||||
params:'down' '(null)'
|
||||
- Window Up [winlist]
|
||||
params:'up' '(null)'
|
||||
- Window on the Right [winlist]
|
||||
params:'right' '(null)'
|
||||
*** Window : Moving
|
||||
- To Next Desktop [window_desk_move_by]
|
||||
params:'1 0' '(null)'
|
||||
- To Previous Desktop [window_desk_move_by]
|
||||
params:'-1 0' '(null)'
|
||||
- By Desktop #... [window_desk_move_by]
|
||||
params:'(null)' 'syntax: X-offset Y-offset, example: -2 2'
|
||||
- To Desktop... [window_desk_move_to]
|
||||
params:'(null)' 'syntax: X Y, example: 0 1'
|
||||
- To Next Screen [window_zone_move_by]
|
||||
params:'1' '(null)'
|
||||
- To Previous Screen [window_zone_move_by]
|
||||
params:'-1' '(null)'
|
||||
*** Window : State
|
||||
- Sticky Mode Toggle [window_sticky_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Sticky Mode Enable [window_sticky]
|
||||
params:'(null)' '(null)'
|
||||
- Iconic Mode Toggle [window_iconic_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Iconic Mode Enable [window_iconic]
|
||||
params:'(null)' '(null)'
|
||||
- Fullscreen Mode Toggle [window_fullscreen_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Fullscreen Mode Enable [window_fullscreen]
|
||||
params:'(null)' '(null)'
|
||||
- Maximize [window_maximized_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Maximize Vertically [window_maximized_toggle]
|
||||
params:'default vertical' '(null)'
|
||||
- Maximize Horizontally [window_maximized_toggle]
|
||||
params:'default horizontal' '(null)'
|
||||
- Maximize Left [window_maximized_toggle]
|
||||
params:'default left' '(null)'
|
||||
- Maximize Right [window_maximized_toggle]
|
||||
params:'default right' '(null)'
|
||||
- Maximize Fullscreen [window_maximized_toggle]
|
||||
params:'fullscreen' '(null)'
|
||||
- Maximize Mode "Smart" [window_maximized_toggle]
|
||||
params:'smart' '(null)'
|
||||
- Maximize Mode "Expand" [window_maximized_toggle]
|
||||
params:'expand' '(null)'
|
||||
- Maximize Mode "Fill" [window_maximized_toggle]
|
||||
params:'fill' '(null)'
|
||||
- Shade Up Mode Toggle [window_shaded_toggle]
|
||||
params:'up' '(null)'
|
||||
- Shade Down Mode Toggle [window_shaded_toggle]
|
||||
params:'down' '(null)'
|
||||
- Shade Left Mode Toggle [window_shaded_toggle]
|
||||
params:'left' '(null)'
|
||||
- Shade Right Mode Toggle [window_shaded_toggle]
|
||||
params:'right' '(null)'
|
||||
- Shade Mode Toggle [window_shaded_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Set Shaded State [window_shaded]
|
||||
params:'(null)' 'syntax: "(0|1) (up|down|left|right)"'
|
||||
- Toggle Borderless State [window_borderless_toggle]
|
||||
params:'(null)' '(null)'
|
||||
- Set Border [window_border_set]
|
||||
params:'(null)' 'syntax: BorderName, example: pixel'
|
||||
- Cycle between Borders [window_border_cycle]
|
||||
params:'(null)' 'syntax: BorderNames, example: default pixel'
|
||||
- Toggle Pinned State [window_pinned_toggle]
|
||||
params:'(null)' '(null)'
|
||||
*/
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,22 @@
|
|||
GADGET_NAME = amule_control
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_NAME).edj
|
||||
|
||||
$(GADGET_NAME).edj: $(GADGET_NAME).edc $(GADGET_NAME).embryo images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $< $@
|
||||
|
||||
install: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
cp $(GADGET_NAME).edj ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
|
||||
uninstall: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj;
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(GADGET_NAME).edj
|
|
@ -0,0 +1,433 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of amule_control.
|
||||
* amule_control is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* amule_control is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with amule_control. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* E17 aMule Control gadget
|
||||
*/
|
||||
|
||||
|
||||
data {
|
||||
item: "e/gadget/name" "aMule Control";
|
||||
item: "e/gadget/description" "Control your aMule deamon";
|
||||
item: "e/gadget/version" "0.0.1";
|
||||
item: "e/gadget/author" "DaveMDS <dave@gurumeditattion.it>";
|
||||
item: "e/gadget/license" "LGPL";
|
||||
item: "e/gadget/apparence" "plain";
|
||||
}
|
||||
|
||||
images {
|
||||
image: "amule.png" COMP;
|
||||
image: "amule_over.png" COMP;
|
||||
image: "down.png" COMP;
|
||||
image: "up.png" COMP;
|
||||
image: "net.png" COMP;
|
||||
image: "net_kad_green.png" COMP;
|
||||
image: "net_kad_red.png" COMP;
|
||||
image: "net_donk_green.png" COMP;
|
||||
image: "net_donk_red.png" COMP;
|
||||
image: "bg.png" COMP;
|
||||
image: "bg_over.png" COMP;
|
||||
}
|
||||
|
||||
//~ styles {
|
||||
//~ style {
|
||||
//~ name: "text_style";
|
||||
//~ //base: "font=Sans font_size=10 align=left color=#000 wrap=word";
|
||||
//~ base: "font=MARI.TTF font_size=14 align=left color=#000 wrap=word";
|
||||
//~ tag: "br" "\n";
|
||||
//~ tag: "tab" "\t";
|
||||
//~ tag: "title" "+ style=Bold font_size=20 align=center";
|
||||
//~ tag: "i" "+ font=Sans:style=Oblique";
|
||||
//~ tag: "b" "+ font=Sans:style=Bold";
|
||||
//~ tag: "u" "+ underline=on underline_color=#000";
|
||||
//~ }
|
||||
//~ }
|
||||
|
||||
collections {
|
||||
group { name: "e/gadget/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "amule.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/main";
|
||||
min: 250 100;
|
||||
max: 250 100;
|
||||
|
||||
#include "amule_control.embryo"
|
||||
|
||||
parts {
|
||||
part { name: "bg";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0;
|
||||
// aspect: 2.5 2.5;
|
||||
// aspect_preference: BOTH;
|
||||
color: 255 255 255 255;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "icon";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 100;
|
||||
rel1 {
|
||||
relative: 0.0 0.05;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.27 0.65;
|
||||
offset: 0 0;
|
||||
to: "bg";
|
||||
}
|
||||
image {
|
||||
normal: "amule.png";
|
||||
}
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
description { state: "over" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
image {
|
||||
normal: "amule_over.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.status";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 0 0 0 255;
|
||||
rel1 {
|
||||
relative: 0.230263 0.05;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1 0.362205;
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "Deamon: stopped";
|
||||
font: "Sans";
|
||||
size: 14;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.download";
|
||||
type: TEXT;
|
||||
effect: SHADOW;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0;
|
||||
rel1 {
|
||||
relative: 0.35 0.25;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.40;
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "Download: ";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "download_icon";
|
||||
description { state: "default" 0.0;
|
||||
rel1 {
|
||||
relative: -0.1 0.2;
|
||||
to: "text.download";
|
||||
}
|
||||
rel2 {
|
||||
relative: -0.02 1.2;
|
||||
to: "text.download";
|
||||
}
|
||||
image {
|
||||
normal: "down.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.upload";
|
||||
type: TEXT;
|
||||
effect: SHADOW;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0;
|
||||
rel1 {
|
||||
relative: 0.35 0.45;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.6;
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "Upload: ";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "up_icon";
|
||||
description { state: "default" 0.0;
|
||||
rel1 {
|
||||
relative: -0.1 0.2;
|
||||
to: "text.upload";
|
||||
}
|
||||
rel2 {
|
||||
relative: -0.02 1.2;
|
||||
to: "text.upload";
|
||||
}
|
||||
image {
|
||||
normal: "up.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.kad";
|
||||
type: TEXT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0;
|
||||
rel1 {
|
||||
relative: 0.12 0.68;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.98 1.0;
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "kad";
|
||||
font: "Sans";
|
||||
size: 10;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.ed2k";
|
||||
type: TEXT;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0;
|
||||
rel1 {
|
||||
relative: 0.12 0.82;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.98 10;
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "ed2k";
|
||||
font: "Sans";
|
||||
size: 10;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "net_icon";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
visible: 1;
|
||||
image {
|
||||
normal: "net.png";
|
||||
}
|
||||
rel1 {
|
||||
relative: 0.02 0.7;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.12 0.95;
|
||||
to: "bg";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "net_icon_kad";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "net_icon";
|
||||
rel2.to: "net_icon";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "notconnected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "net_kad_red.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "firewalled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "net_kad_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "net_icon_donk";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "net_icon";
|
||||
rel2.to: "net_icon";
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "notconnected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "net_donk_red.png";
|
||||
visible: 1;
|
||||
}
|
||||
description { state: "firewalled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "connected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "net_donk_green.png";
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
part { name: "button_bg";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
rel1 {
|
||||
relative: 0.1 0.7;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
relative: 0.9 0.95;
|
||||
to: "bg";
|
||||
}
|
||||
}
|
||||
description { state: "over" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image {
|
||||
normal: "bg_over.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
}
|
||||
description { state: "hidden" 0.0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
part { name: "text.button";
|
||||
type: TEXT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
text {
|
||||
font: "Sans";
|
||||
align: 0.5 0.5;
|
||||
size: 11;
|
||||
text: "Run aMule Daemon";
|
||||
}
|
||||
rel1 {
|
||||
|
||||
to: "button_bg";
|
||||
}
|
||||
rel2 {
|
||||
|
||||
to: "button_bg";
|
||||
}
|
||||
}
|
||||
description { state: "hidden" 0;
|
||||
visible: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "init";
|
||||
signal: "load";
|
||||
source: "";
|
||||
script {
|
||||
init();
|
||||
}
|
||||
}
|
||||
program { name: "mule_click";
|
||||
signal: "mouse,down,1";
|
||||
source: "icon";
|
||||
script {
|
||||
start_client();
|
||||
}
|
||||
}
|
||||
program { name: "run_daemon_click";
|
||||
signal: "mouse,down,1";
|
||||
source: "button_bg";
|
||||
script {
|
||||
start_deamon();
|
||||
}
|
||||
}
|
||||
program { name: "button_over_in";
|
||||
signal: "mouse,in";
|
||||
source: "button_bg";
|
||||
action: STATE_SET "over" 0.0;
|
||||
target: "button_bg";
|
||||
}
|
||||
program { name: "button_over_out";
|
||||
signal: "mouse,out";
|
||||
source: "button_bg";
|
||||
script {
|
||||
button_out();
|
||||
}
|
||||
}
|
||||
program { name: "amule_over_in";
|
||||
signal: "mouse,in";
|
||||
source: "icon";
|
||||
script {
|
||||
icon_in();
|
||||
}
|
||||
}
|
||||
program { name: "amule_over_out";
|
||||
signal: "mouse,out";
|
||||
source: "icon";
|
||||
script {
|
||||
icon_out();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,238 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part ofamule_control.
|
||||
* amule_control is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* amule_control is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with amule_control. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#define EXEC_PID 1
|
||||
#define EXEC_GUI 2
|
||||
#define EXEC_DEAMON 3
|
||||
#define EXEC_CMD_DL 4
|
||||
#define EXEC_CMD_UP 5
|
||||
#define EXEC_CMD_ED2K 6
|
||||
#define EXEC_CMD_KAD 7
|
||||
|
||||
script {
|
||||
|
||||
public conf_keep_alive = 0;
|
||||
|
||||
public running = 0;
|
||||
public starting = 0;
|
||||
|
||||
public init()
|
||||
{
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "aMule Control Init");
|
||||
check_mule();
|
||||
}
|
||||
|
||||
public check_mule()
|
||||
{
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "CHK Mule");
|
||||
send_message(MSG_STRING_SET, EXEC_PID, "EDGAR_EXEC", "pidof amuled");
|
||||
timer(10.0, "check_mule", 0)
|
||||
}
|
||||
|
||||
public get_info()
|
||||
{
|
||||
if (!get_int(running))
|
||||
return;
|
||||
|
||||
send_message(MSG_STRING_SET, EXEC_CMD_DL, "EDGAR_EXEC",
|
||||
"amulecmd -c Status -P asd | grep Download");
|
||||
send_message(MSG_STRING_SET, EXEC_CMD_UP, "EDGAR_EXEC",
|
||||
"amulecmd -c Status -P asd | grep Upload");
|
||||
send_message(MSG_STRING_SET, EXEC_CMD_ED2K, "EDGAR_EXEC",
|
||||
"amulecmd -c Status -P asd | grep eD2k:");
|
||||
send_message(MSG_STRING_SET, EXEC_CMD_KAD, "EDGAR_EXEC",
|
||||
"amulecmd -c Status -P asd | grep Kad:");
|
||||
}
|
||||
|
||||
public start_client()
|
||||
{
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "RUN MULE");
|
||||
send_message(MSG_STRING_SET, EXEC_GUI, "EDGAR_EXEC", "amulegui");
|
||||
}
|
||||
|
||||
public start_deamon()
|
||||
{
|
||||
set_text(PART:"text.status", "Deamon: starting...");
|
||||
set_state(PART:"button_bg", "hidden", 0.0);
|
||||
set_state(PART:"text.button", "hidden", 0.0);
|
||||
set_int(starting, 1);
|
||||
send_message(MSG_STRING_SET, EXEC_DEAMON, "EDGAR_EXEC", "amuled");
|
||||
}
|
||||
|
||||
public button_out()
|
||||
{
|
||||
if (!get_int(running) && !get_int(starting))
|
||||
set_state(PART:"button_bg", "default", 0.0);
|
||||
}
|
||||
|
||||
public icon_in()
|
||||
{
|
||||
if (get_int(running))
|
||||
set_state(PART:"icon", "over", 0.0);
|
||||
}
|
||||
|
||||
public icon_out()
|
||||
{
|
||||
if (get_int(running))
|
||||
set_state(PART:"icon", "connected", 0.0);
|
||||
}
|
||||
|
||||
public set_running()
|
||||
{
|
||||
set_int(running, 1);
|
||||
set_int(starting, 0);
|
||||
set_text(PART:"text.status", "Deamon: running");
|
||||
set_state(PART:"icon", "connected", 0.0);
|
||||
set_state(PART:"button_bg", "hidden", 0.0);
|
||||
set_state(PART:"text.download", "visible", 0.0);
|
||||
set_state(PART:"text.upload", "visible", 0.0);
|
||||
set_state(PART:"text.ed2k", "visible", 0.0);
|
||||
set_state(PART:"text.kad", "visible", 0.0);
|
||||
set_state(PART:"net_icon", "visible", 0.0);
|
||||
set_state(PART:"text.button", "hidden", 0.0);
|
||||
}
|
||||
|
||||
public set_notrunning()
|
||||
{
|
||||
set_int(running, 0);
|
||||
set_int(starting, 0);
|
||||
set_text(PART:"text.status", "Deamon: stopped");
|
||||
set_state(PART:"icon", "default", 0.0);
|
||||
set_state(PART:"text.download", "default", 0.0);
|
||||
set_state(PART:"text.upload", "default", 0.0);
|
||||
set_state(PART:"text.ed2k", "default", 0.0);
|
||||
set_state(PART:"text.kad", "default", 0.0);
|
||||
set_state(PART:"button_bg", "default", 0.0);
|
||||
set_state(PART:"net_icon", "default", 0.0);
|
||||
set_state(PART:"text.button", "default", 0.0);
|
||||
set_state(PART:"net_icon_donk", "default", 0.0)
|
||||
set_state(PART:"net_icon_kad", "default", 0.0)
|
||||
}
|
||||
|
||||
public message(Msg_Type:type, id, ...)
|
||||
{
|
||||
new cmd[32];
|
||||
new key[32];
|
||||
new val[2048]; //TODO if this is too big (> 4000) something goes wrong
|
||||
|
||||
if ((type != MSG_STRING_SET)) return;
|
||||
getsarg(2, cmd, sizeof(cmd));
|
||||
|
||||
|
||||
if (strcmp(cmd, "EDGAR_CONF_GET_REPLY") == 0)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
getsarg(4, val, sizeof(val));
|
||||
}
|
||||
else if (strcmp(cmd, "EDGAR_EXEC_REPLY") == 0)
|
||||
{
|
||||
if (id == EXEC_PID)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
if (strcmp(key, "OK") == 0)
|
||||
{
|
||||
getsarg(4, val, sizeof(val));
|
||||
set_running();
|
||||
get_info();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (conf_keep_alive == 1)
|
||||
start_deamon();
|
||||
else
|
||||
set_notrunning();
|
||||
}
|
||||
}
|
||||
else if (id == EXEC_CMD_DL)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
if (strcmp(key, "OK") == 0)
|
||||
{
|
||||
getsarg(4, val, sizeof(val));
|
||||
set_text(PART:"text.download", val[strrchr(val, "\t") + 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "AMULECMD DL ERROR");
|
||||
set_text(PART:"text.download", "???");
|
||||
}
|
||||
}
|
||||
else if (id == EXEC_CMD_UP)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
if (strcmp(key, "OK") == 0)
|
||||
{
|
||||
getsarg(4, val, sizeof(val));
|
||||
set_text(PART:"text.upload", val[strrchr(val, "\t") + 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_text(PART:"text.upload", "???");
|
||||
}
|
||||
}
|
||||
else if (id == EXEC_CMD_ED2K)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
if (strcmp(key, "OK") == 0)
|
||||
{
|
||||
getsarg(4, val, sizeof(val));
|
||||
set_text(PART:"text.ed2k", val[2]);
|
||||
if (strstr(val, "irewalled") != -1) // case-insensitive :P
|
||||
set_state(PART:"net_icon_donk", "firewalled", 0.0)
|
||||
else if (strstr(val, "Connected") != -1)
|
||||
set_state(PART:"net_icon_donk", "connected", 0.0)
|
||||
else
|
||||
set_state(PART:"net_icon_donk", "notconnected", 0.0)
|
||||
}
|
||||
else
|
||||
{
|
||||
set_text(PART:"text.upload", "???");
|
||||
set_state(PART:"net_icon_donk", "default", 0.0)
|
||||
}
|
||||
}
|
||||
else if (id == EXEC_CMD_KAD)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
if (strcmp(key, "OK") == 0)
|
||||
{
|
||||
getsarg(4, val, sizeof(val));
|
||||
set_text(PART:"text.kad", val[2]);
|
||||
if (strstr(val, "irewalled") != -1)
|
||||
set_state(PART:"net_icon_kad", "firewalled", 0.0)
|
||||
else if (strstr(val, "Connected") != -1)
|
||||
set_state(PART:"net_icon_kad", "connected", 0.0)
|
||||
else
|
||||
set_state(PART:"net_icon_kad", "notconnected", 0.0)
|
||||
}
|
||||
else
|
||||
{
|
||||
set_text(PART:"text.upload", "???");
|
||||
set_state(PART:"net_icon_kad", "default", 0.0)
|
||||
}
|
||||
}
|
||||
else if (id == EXEC_GUI)
|
||||
{
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Gui terminated", key, val);
|
||||
}
|
||||
else if (id == EXEC_DEAMON)
|
||||
{
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Deamon terminated", key, val);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 360 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1,22 @@
|
|||
GADGET_NAME = postit
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_NAME).edj
|
||||
|
||||
$(GADGET_NAME).edj: $(GADGET_NAME).edc $(GADGET_NAME).embryo images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $< $@
|
||||
|
||||
install: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
cp $(GADGET_NAME).edj ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
|
||||
uninstall: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj;
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(GADGET_NAME).edj
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
ANTAVIANA TYPEFACE DIVISION
|
||||
___________________________
|
||||
|
||||
http://www.astramat.com/typeface
|
||||
e-mail: typeface@astramat.com
|
||||
info@antaviana.com
|
||||
|
||||
|
||||
|
||||
Antaviana Typeface Division distributes freely this font,
|
||||
but you must be aware that this typeface is PUBLISHWARE.
|
||||
|
||||
|
||||
What is PUBLISHWARE?
|
||||
|
||||
Publishware consists in the fact that the user must sent
|
||||
a copy of each work where it appears (in paper, CD-ROM or
|
||||
any other support) to the creators of this font.
|
||||
The address where the copy should be send is:
|
||||
|
||||
ANTAVIANA SERVEIS INTERACTIUS, SCCL
|
||||
(Typeface Division)
|
||||
Santa Justina, 29
|
||||
25400 Les Borges Blanques
|
||||
Lleida
|
||||
Spain
|
||||
|
||||
In case of using this typeface in a web, you just have to send the URL
|
||||
by e-mail to
|
||||
|
||||
typeface@astramat.com
|
||||
|
||||
© Antaviana Serveis Interactius, SCCL
|
||||
Typeface Division
|
||||
|
||||
http://www.astramat.com/typeface
|
||||
e-mail: typeface@astramat.com
|
||||
info@antaviana.com
|
|
@ -0,0 +1,14 @@
|
|||
Thank you for downloading this font!
|
||||
|
||||
This font is copyright (c) Jakob Fischer at www.pizzadude.dk, all rights reserved. Do not distribute without the author's permission.
|
||||
|
||||
Use this font for non-commercial use only! If you plan to use it for commercial purposes, contact me before doing so!
|
||||
|
||||
|
||||
For more original fonts take a look at www.pizzadude.dk
|
||||
|
||||
Have fun and enjoy!
|
||||
|
||||
Jakob Fischer
|
||||
jakob@pizzadude.dk
|
||||
www.pizzadude.dk
|
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 654 B |
|
@ -0,0 +1,182 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of Postit.
|
||||
* Postit. is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Postit. is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Postit. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* E17 Postit Gadget
|
||||
*/
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* TODOC emit("API:DBG", "ciccio");
|
||||
*
|
||||
*/
|
||||
|
||||
data {
|
||||
item: "e/gadget/name" "PostIt";
|
||||
item: "e/gadget/description" "Simple stickies on your desktop";
|
||||
item: "e/gadget/version" "0.0.1";
|
||||
item: "e/gadget/author" "DaveMDS <dave@gurumeditattion.it>";
|
||||
item: "e/gadget/license" "LGPL";
|
||||
item: "e/gadget/apparence" "plain";
|
||||
}
|
||||
|
||||
images {
|
||||
image: "postit.png" COMP;
|
||||
image: "icon.png" COMP;
|
||||
}
|
||||
|
||||
fonts {
|
||||
font: "BRINGTHANOIZE.TTF" "BTN.TTF";
|
||||
font: "ANMARI.TTF" "MARI.TTF";
|
||||
}
|
||||
|
||||
styles {
|
||||
style {
|
||||
name: "text_style";
|
||||
//base: "font=Sans font_size=10 align=left color=#000 wrap=word";
|
||||
base: "font=MARI.TTF font_size=14 align=left color=#000 wrap=word";
|
||||
tag: "br" "\n";
|
||||
tag: "tab" "\t";
|
||||
tag: "title" "+ style=Bold font_size=20 align=center";
|
||||
tag: "i" "+ font=Sans:style=Oblique";
|
||||
tag: "b" "+ font=Sans:style=Bold";
|
||||
tag: "u" "+ underline=on underline_color=#000";
|
||||
}
|
||||
}
|
||||
|
||||
collections {
|
||||
group { name: "e/gadget/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "icon.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/main";
|
||||
min: 100 100;
|
||||
max: 300 300;
|
||||
script {
|
||||
#include "postit.embryo"
|
||||
}
|
||||
parts {
|
||||
part { name: "bg";
|
||||
description { state: "default" 0.0;
|
||||
image {
|
||||
normal: "postit.png";
|
||||
border: 1 12 30 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "textblock";
|
||||
type: TEXTBLOCK;
|
||||
entry_mode: EDITABLE;
|
||||
multiline: 1;
|
||||
source: "e/gadget/selection"; //selection under
|
||||
source4: "e/gadget/cursor"; //cursor over
|
||||
description { state: "default" 0.0;
|
||||
text {
|
||||
text: "Put your note here";
|
||||
style: "text_style";
|
||||
}
|
||||
rel1 {
|
||||
offset: 5 35;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "init";
|
||||
signal: "load";
|
||||
source: "";
|
||||
script {
|
||||
init();
|
||||
}
|
||||
}
|
||||
program { name: "focus";
|
||||
signal: "load";
|
||||
source: "";
|
||||
action: FOCUS_SET;
|
||||
target: "textblock";
|
||||
}
|
||||
program { name: "focus_out";
|
||||
signal: "mouse,down,1";
|
||||
source: "textblock";
|
||||
script {
|
||||
save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/selection";
|
||||
parts {
|
||||
part {name: "bg";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 128 128 128 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/cursor";
|
||||
parts {
|
||||
part { name: "cur";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 255;
|
||||
rel2 {
|
||||
relative: 0.0 1.0;
|
||||
offset: 0 -1;
|
||||
}
|
||||
}
|
||||
description { state: "blink" 0.0;
|
||||
color: 0 0 0 0;
|
||||
rel2 {
|
||||
relative: 0.0 1.0;
|
||||
offset: 0 -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "blink";
|
||||
signal: "load";
|
||||
source: "*";
|
||||
in: 1.5 0;
|
||||
action: STATE_SET "blink" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "cur";
|
||||
after: "blink2";
|
||||
}
|
||||
program { name: "blink2";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.5;
|
||||
target: "cur";
|
||||
after: "blink";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of Postit.
|
||||
* Postit. is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Postit. is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Postit. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
public init()
|
||||
{
|
||||
// send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Postit Init");
|
||||
|
||||
//Try some message with errors
|
||||
// send_message(MSG_STRING_SET, 0, "EDGAR_GF");
|
||||
// send_message(MSG_STRING_SET, 0, "EDGAR_");
|
||||
// send_message(MSG_STRING_SET, 0, "EDGAR");
|
||||
// send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "", "");
|
||||
|
||||
/* Get a saved memo */
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_CONF_GET", "postit/memo");
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_ID_GET");
|
||||
}
|
||||
|
||||
public save()
|
||||
{
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Postit save");
|
||||
new memo[2048];
|
||||
|
||||
get_text(PART:"textblock", memo, 2048);
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_CONF_SET", "postit/memo", memo);
|
||||
}
|
||||
|
||||
public message(Msg_Type:type, id, ...)
|
||||
{
|
||||
new cmd[32];
|
||||
new key[32];
|
||||
new val[2048]; //TODO if this is too big (> 4000) something goes wrong
|
||||
|
||||
if ((type != MSG_STRING_SET)) return;
|
||||
getsarg(2, cmd, sizeof(cmd));
|
||||
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "message()", cmd);
|
||||
|
||||
if (strcmp(cmd, "EDGAR_CONF_GET_REPLY") == 0)
|
||||
{
|
||||
getsarg(3, key, sizeof(key));
|
||||
getsarg(4, val, sizeof(val));
|
||||
|
||||
set_text(PART:"textblock", val);
|
||||
}
|
||||
else if (strcmp(cmd, "EDGAR_ID_GET_REPLY") == 0)
|
||||
{
|
||||
getsarg(3, val, sizeof(val));
|
||||
set_text(PART:"textblock", val);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
GADGET_NAME = top5
|
||||
|
||||
EDJE_CC = edje_cc
|
||||
EDJE_FLAGS = -v -id images/ -fd fonts/
|
||||
|
||||
.PHONY: all install clean
|
||||
|
||||
all: $(GADGET_NAME).edj
|
||||
|
||||
$(GADGET_NAME).edj: $(GADGET_NAME).edc $(GADGET_NAME).embryo images/*
|
||||
$(EDJE_CC) $(EDJE_FLAGS) $< $@
|
||||
|
||||
install: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
cp $(GADGET_NAME).edj ~/.e/e/gadgets/$(GADGET_NAME).edj
|
||||
|
||||
uninstall: all
|
||||
rm -f ~/.e/e/gadgets/$(GADGET_NAME).edj;
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(GADGET_NAME).edj
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,195 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part of top5.
|
||||
* top5 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* top5 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with top5. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* E17 Top Process Viewer
|
||||
*/
|
||||
|
||||
|
||||
data {
|
||||
item: "e/gadget/name" "Top5";
|
||||
item: "e/gadget/description" "Keep your process under control";
|
||||
item: "e/gadget/version" "0.0.1";
|
||||
item: "e/gadget/author" "DaveMDS <dave@gurumeditattion.it>";
|
||||
item: "e/gadget/license" "LGPL";
|
||||
item: "e/gadget/apparence" "plain";
|
||||
}
|
||||
|
||||
images {
|
||||
image: "bg.png" COMP;
|
||||
image: "e_logo.png" COMP;
|
||||
}
|
||||
|
||||
collections {
|
||||
group { name: "e/gadget/icon";
|
||||
parts {
|
||||
part { name: "icon";
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "e/gadget/main";
|
||||
min: 150 100;
|
||||
max: 450 100;
|
||||
|
||||
#include "top5.embryo"
|
||||
|
||||
parts {
|
||||
part { name: "bg";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
image {
|
||||
normal: "bg.png";
|
||||
border: 9 9 9 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "logo";
|
||||
type: IMAGE;
|
||||
description { state: "default" 0;
|
||||
min: 180 90;
|
||||
max: 180 90;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 0 5;
|
||||
to: "bg";
|
||||
}
|
||||
image {
|
||||
normal: "e_logo.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.line1";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 10 8;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "CIAO";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.line2";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 10 23;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "CIAO2";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.line3";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 10 38;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "CIAO 3";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.line4";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 10 53;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "CIAO 4";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
part { name: "text.line5";
|
||||
type: TEXT;
|
||||
effect: PLAIN;
|
||||
description { state: "default" 0;
|
||||
color: 255 255 255 255;
|
||||
rel1 {
|
||||
offset: 10 68;
|
||||
to: "bg";
|
||||
}
|
||||
rel2 {
|
||||
to: "bg";
|
||||
}
|
||||
text {
|
||||
text: "CIAO 5";
|
||||
font: "Sans";
|
||||
size: 12;
|
||||
align: 0.0 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "init";
|
||||
signal: "load";
|
||||
source: "";
|
||||
script {
|
||||
init();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/* Copyright (C) 2008 Davide Andreoli (see AUTHORS)
|
||||
*
|
||||
* This file is part top5.
|
||||
* top5 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* top5 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with top5. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define PS_CMD "ps --sort=-pcpu axo pcpu,comm --no-headers |head -n 5"
|
||||
#define DELAY 2
|
||||
|
||||
|
||||
script {
|
||||
|
||||
|
||||
public line = 1;
|
||||
|
||||
public init()
|
||||
{
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Top5 Init");
|
||||
update();
|
||||
}
|
||||
|
||||
public update()
|
||||
{
|
||||
set_int(line, 1);
|
||||
send_message(MSG_STRING_SET, 0, "EDGAR_EXEC", PS_CMD);
|
||||
timer(DELAY, "update", 0);
|
||||
}
|
||||
|
||||
public message(Msg_Type:type, id, ...)
|
||||
{
|
||||
new cmd[32];
|
||||
new key[32];
|
||||
new val[2048]; //TODO if this is too big (> 4000) something goes wrong
|
||||
|
||||
if ((type != MSG_STRING_SET)) return;
|
||||
getsarg(2, cmd, sizeof(cmd));
|
||||
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "MSG CMD", cmd);
|
||||
|
||||
if (strcmp(cmd, "EDGAR_EXEC_DATA") == 0)
|
||||
{
|
||||
getsarg(3, val, sizeof(val));
|
||||
|
||||
if (get_int(line) == 1) set_text(PART:"text.line1", val);
|
||||
if (get_int(line) == 2) set_text(PART:"text.line2", val);
|
||||
if (get_int(line) == 3) set_text(PART:"text.line3", val);
|
||||
if (get_int(line) == 4) set_text(PART:"text.line4", val);
|
||||
if (get_int(line) == 5) set_text(PART:"text.line5", val);
|
||||
set_int(line, get_int(line) + 1);
|
||||
}
|
||||
else if (strcmp(cmd, "EDGAR_EXEC_REPLY") == 0)
|
||||
{
|
||||
getsarg(3, key, sizeof(key))
|
||||
getsarg(4, val, sizeof(val));
|
||||
//send_message(MSG_STRING_SET, 0, "EDGAR_DBG", "Command end", key, val);
|
||||
set_int(line, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 2.3 KiB |