Import LinuxCNC source tree
This commit is contained in:
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.po merge=pofile
|
||||
*.pot merge=pofile
|
||||
.github/ export-ignore
|
||||
59
.gitignore
vendored
Normal file
59
.gitignore
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
autosave.halscope
|
||||
build-stamp
|
||||
*.pyc
|
||||
*.o
|
||||
*.ko
|
||||
*.so
|
||||
*.so.*
|
||||
*.a
|
||||
*.pdf
|
||||
*.tex
|
||||
*.mod.c
|
||||
*.cmd
|
||||
.tmp*
|
||||
src/*.mod
|
||||
# Documentation-tree ignores live in docs/.gitignore.
|
||||
debian/*.debhelper.log
|
||||
rtlib/Module.symvers
|
||||
share/*/*.desktop
|
||||
share/menus/CNC.menu
|
||||
share/desktop-directories/linuxcnc-cnc.directory
|
||||
share/desktop-directories/linuxcnc-ref.directory
|
||||
share/desktop-directories/linuxcnc-doc.directory
|
||||
share/linuxcnc/mesa_modbus.c.tmpl
|
||||
src/modules.order
|
||||
/configs/*/emc.nml
|
||||
!/configs/common/emc.nml
|
||||
lib/python/gremlin.py
|
||||
lib/python/qt5_graphics.py
|
||||
lib/python/touchy
|
||||
configs/sim/gmoccapy/*.pref
|
||||
configs/sim/gmoccapy/gmoccapy_plasma/*.pref
|
||||
configs/sim/gmoccapy/gmoccapy-JA/*.pref
|
||||
configs/**/*.tbl.bak
|
||||
configs/**/halshow.preferences
|
||||
# Miscellaneous generated files (Rob)
|
||||
cscope
|
||||
cscope.*
|
||||
*.kdev*
|
||||
oprofile*
|
||||
*.log
|
||||
position.txt
|
||||
# *.9
|
||||
*.glade.h
|
||||
# Ignore test results
|
||||
*.result
|
||||
# Ignore temp files
|
||||
*.swp
|
||||
*~
|
||||
# Ignore checkref leftover output (docs/src/checkref)
|
||||
.checklink.*.tmp
|
||||
# Ignore po4a temp files
|
||||
*.failed.po
|
||||
*-new_??.po
|
||||
# Ignore stamp files
|
||||
*.*-stamp
|
||||
# Ignore VSCode settings
|
||||
.vscode/settings.json
|
||||
# autoreconf cache from debian/configure
|
||||
/autom4te.cache/
|
||||
339
COPYING
Normal file
339
COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
790
COPYING.more
Normal file
790
COPYING.more
Normal file
@@ -0,0 +1,790 @@
|
||||
****************************************************************
|
||||
|
||||
Notice: Most of LinuxCNC is covered by the GNU General Public
|
||||
License. Some portions are covered by the GNU Lesser
|
||||
General Public License (mostly interface definitions).
|
||||
Both licenses are included in their entirety below.
|
||||
|
||||
Much of LinuxCNC is derived from the Enhanced Machine Controller, a
|
||||
work of Fred Proctor, Tom Kramer, Will Shackleford, and others.
|
||||
That work was originally released into the public domain. It was
|
||||
used as the basis of LinuxCNC, but received extensive modifications.
|
||||
LinuxCNC is NOT public domain. Anyone wishing to use the public
|
||||
domain code in a way that is not compatible with the (L)GPL must
|
||||
locate the original the Enhanced Machine Controller code - they may
|
||||
NOT use LinuxCNC.
|
||||
|
||||
******************************************************************
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
|
||||
******************************************************************************
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public Licenses are
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some specially
|
||||
designated software packages--typically libraries--of the Free Software
|
||||
Foundation and other authors who decide to use it. You can use it too, but
|
||||
we suggest you first think carefully about whether this license or the
|
||||
ordinary General Public License is the better strategy to use in any
|
||||
particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish); that you receive source code or can get it
|
||||
if you want it; that you can change the software and use pieces of it
|
||||
in new free programs; and that you are informed that you can do these
|
||||
things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that we gave you.
|
||||
You must make sure that they, too, receive or can get the source code.
|
||||
If you link other code with the library, you must provide complete object
|
||||
files to the recipients, so that they can relink them with the library
|
||||
after making changes to the library and recompiling it. And you must show
|
||||
them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that there is
|
||||
no warranty for the free library. Also, if the library is modified by
|
||||
someone else and passed on, the recipients should know that what they
|
||||
have is not the original version, so that the original author's reputation
|
||||
will not be affected by problems that might be introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of any
|
||||
free program. We wish to make sure that a company cannot effectively
|
||||
restrict the users of a free program by obtaining a restrictive license
|
||||
from a patent holder. Therefore, we insist that any patent license
|
||||
obtained for a version of the library must be consistent with the full
|
||||
freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License. This license, the GNU Lesser General Public
|
||||
License, applies to certain designated libraries, and is quite different
|
||||
from the ordinary General Public License. We use this license for certain
|
||||
libraries in order to permit linking those libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using a
|
||||
shared library, the combination of the two is legally speaking a combined
|
||||
work, a derivative of the original library. The ordinary General Public
|
||||
License therefore permits such linking only if the entire combination fits
|
||||
its criteria of freedom. The Lesser General Public License permits more lax
|
||||
criteria for linking other code with the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it does
|
||||
Less to protect the user's freedom than the ordinary General Public License.
|
||||
It also provides other free software developers Less of an advantage over
|
||||
competing non-free programs. These disadvantages are the reason we use the
|
||||
ordinary General Public License for many libraries. However, the Lesser
|
||||
license provides advantages in certain special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to encourage
|
||||
the widest possible use of a certain library, so that it becomes a de-facto
|
||||
standard. To achieve this, non-free programs must be allowed to use the
|
||||
library. A more frequent case is that a free library does the same job as
|
||||
widely used non-free libraries. In this case, there is little to gain by
|
||||
limiting the free library to free software only, so we use the Lesser
|
||||
General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free programs
|
||||
enables a greater number of people to use a large body of free software.
|
||||
For example, permission to use the GNU C Library in non-free programs
|
||||
enables many more people to use the whole GNU operating system, as well
|
||||
as its variant, the GNU/Linux operating system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the users'
|
||||
freedom, it does ensure that the user of a program that is linked with the
|
||||
Library has the freedom and the wherewithal to run that program using a
|
||||
modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow. Pay close attention to the difference between a "work based on the
|
||||
library" and a "work that uses the library". The former contains code derived
|
||||
from the library, whereas the latter must be combined with the library in
|
||||
order to run.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other program
|
||||
which contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Lesser General
|
||||
Public License (also called "this License"). Each licensee is addressed as
|
||||
"you".
|
||||
|
||||
A "library" means a collection of software functions and/or data prepared
|
||||
so as to be conveniently linked with application programs (which use some
|
||||
of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which
|
||||
has been distributed under these terms. A "work based on the Library"
|
||||
means either the Library or any derivative work under copyright law:
|
||||
that is to say, a work containing the Library or a portion of it, either
|
||||
verbatim or with modifications and/or translated straightforwardly into
|
||||
another language. (Hereinafter, translation is included without limitation
|
||||
in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making
|
||||
modifications to it. For a library, complete source code means all the
|
||||
source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running a program
|
||||
using the Library is not restricted, and output from such a program is
|
||||
covered only if its contents constitute a work based on the Library
|
||||
(independent of the use of the Library in a tool for writing it). Whether
|
||||
that is true depends on what the Library does and what the program that
|
||||
uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete
|
||||
source code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this
|
||||
License and to the absence of any warranty; and distribute a copy of this
|
||||
License along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of it,
|
||||
thus forming a work based on the Library, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that
|
||||
you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
b) You must cause the files modified to carry prominent notices stating
|
||||
that you changed the files and the date of any change.
|
||||
c) You must cause the whole of the work to be licensed at no charge
|
||||
to all third parties under the terms of this License.
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses the
|
||||
facility, other than as an argument passed when the facility is invoked,
|
||||
then you must make a good faith effort to ensure that, in the event an
|
||||
application does not supply such function or table, the facility still
|
||||
operates, and performs whatever part of its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has a
|
||||
purpose that is entirely well-defined independent of the application.
|
||||
Therefore, Subsection 2d requires that any application-supplied function
|
||||
or table used by this function must be optional: if the application does
|
||||
not supply it, the square root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Library, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License,
|
||||
and its terms, do not apply to those sections when you distribute them as
|
||||
separate works. But when you distribute the same sections as part of a whole
|
||||
which is a work based on the Library, the distribution of the whole must be
|
||||
on the terms of this License, whose permissions for other licensees extend
|
||||
to the entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works
|
||||
based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library with
|
||||
the Library (or with a work based on the Library) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of
|
||||
this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public License
|
||||
instead of this License to a given copy of the Library. To do this, you must
|
||||
alter all the notices that refer to this License, so that they refer to the
|
||||
ordinary GNU General Public License, version 2, instead of to this License.
|
||||
(If a newer version than version 2 of the ordinary GNU General Public License
|
||||
has appeared, then you can specify that version instead if you wish.) Do not
|
||||
make any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that copy,
|
||||
so the ordinary GNU General Public License applies to all subsequent copies
|
||||
and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the Library
|
||||
into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative of
|
||||
it, under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you accompany it with the complete
|
||||
corresponding machine-readable source code, which must be distributed under
|
||||
the terms of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a
|
||||
designated place, then offering equivalent access to copy the source code
|
||||
from the same place satisfies the requirement to distribute the source
|
||||
code, even though third parties are not compelled to copy the source
|
||||
along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library,
|
||||
but is designed to work with the Library by being compiled or linked with
|
||||
it, is called a "work that uses the Library". Such a work, in isolation,
|
||||
is not a derivative work of the Library, and therefore falls outside the
|
||||
scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates
|
||||
an executable that is a derivative of the Library (because it contains
|
||||
portions of the Library), rather than a "work that uses the library".
|
||||
The executable is therefore covered by this License. Section 6 states
|
||||
terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library.
|
||||
The threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure
|
||||
layouts and accessors, and small macros and small inline functions
|
||||
(ten lines or less in length), then the use of the object file is
|
||||
unrestricted, regardless of whether it is legally a derivative work.
|
||||
(Executables containing this object code plus portions of the Library
|
||||
will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6, whether
|
||||
or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or link
|
||||
a "work that uses the Library" with the Library to produce a work
|
||||
containing portions of the Library, and distribute that work under
|
||||
terms of your choice, provided that the terms permit modification of
|
||||
the work for the customer's own use and reverse engineering for
|
||||
debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered
|
||||
by this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do
|
||||
one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding machine-readable
|
||||
source code for the Library including whatever changes were used in the
|
||||
work (which must be distributed under Sections 1 and 2 above); and, if
|
||||
the work is an executable linked with the Library, with the complete
|
||||
machine-readable "work that uses the Library", as object code and/or
|
||||
source code, so that the user can modify the Library and then relink
|
||||
to produce a modified executable containing the modified Library. (It
|
||||
is understood that the user who changes the contents of definitions
|
||||
files in the Library will not necessarily be able to recompile the
|
||||
application to use the modified definitions.)
|
||||
b) Use a suitable shared library mechanism for linking with the Library.
|
||||
A suitable mechanism is one that (1) uses at run time a copy of the
|
||||
library already present on the user's computer system, rather than
|
||||
copying library functions into the executable, and (2) will operate
|
||||
properly with a modified version of the library, if the user installs
|
||||
one, as long as the modified version is interface-compatible with the
|
||||
version that the work was made with.
|
||||
c) Accompany the work with a written offer, valid for at least three
|
||||
years, to give the same user the materials specified in Subsection 6a,
|
||||
above, for a charge no more than the cost of performing this distribution.
|
||||
d) If distribution of the work is made by offering access to copy from a
|
||||
designated place, offer equivalent access to copy the above specified
|
||||
materials from the same place.
|
||||
e) Verify that the user has already received a copy of these materials or
|
||||
that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library"
|
||||
must include any data and utility programs needed for reproducing the
|
||||
executable from it. However, as a special exception, the materials to be
|
||||
distributed need not include anything that is normally distributed (in
|
||||
either source or binary form) with the major components (compiler, kernel,
|
||||
and so on) of the operating system on which the executable runs, unless
|
||||
that component itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions of
|
||||
other proprietary libraries that do not normally accompany the operating
|
||||
system. Such a contradiction means you cannot use both them and the Library
|
||||
together in an executable that you distribute.
|
||||
|
||||
7. 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
|
||||
not covered by this License, and distribute such a combined library, provided
|
||||
that the separate distribution of the work based on the Library and of the
|
||||
other library facilities is otherwise permitted, and provided that you do
|
||||
these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on the
|
||||
Library, uncombined with any other library facilities. This must be
|
||||
distributed under the terms of the Sections above.
|
||||
b) Give prominent notice with the combined library of the fact that part
|
||||
of it is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the Library
|
||||
except as expressly provided under this License. Any attempt otherwise to
|
||||
copy, modify, sublicense, link with, or distribute the Library is void, and
|
||||
will automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not have
|
||||
their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute
|
||||
the Library or its derivative works. These actions are prohibited by law
|
||||
if you do not accept this License. Therefore, by modifying or distributing
|
||||
the Library (or any work based on the Library), you indicate your acceptance
|
||||
of this License to do so, and all its terms and conditions for copying,
|
||||
distributing or modifying the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the Library),
|
||||
the recipient automatically receives a license from the original licensor to
|
||||
copy, distribute, link with or modify the Library subject to these terms and
|
||||
conditions. You may not impose any further restrictions on the recipients'
|
||||
exercise of the rights granted herein. You are not responsible for enforcing
|
||||
compliance by third parties with this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute
|
||||
so as to satisfy simultaneously your obligations under this License and
|
||||
any other pertinent obligations, then as a consequence you may not distribute
|
||||
the Library at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Library by all those who receive
|
||||
copies directly or indirectly through you, then the only way you could
|
||||
satisfy both it and this License would be to refrain entirely from
|
||||
distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is implemented
|
||||
by public license practices. Many people have made generous contributions
|
||||
to the wide range of software distributed through that system in reliance
|
||||
on consistent application of that system; it is up to the author/donor
|
||||
to decide if he or she is willing to distribute software through any
|
||||
other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Library under this License may add an
|
||||
explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Library does not specify a license version
|
||||
number, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free programs
|
||||
whose distribution conditions are incompatible with these, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free Software
|
||||
Foundation, write to the Free Software Foundation; we sometimes make exceptions
|
||||
for this. Our decision will be guided by the two goals of preserving the free
|
||||
status of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
|
||||
LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
|
||||
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
|
||||
THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
33
ISSUE_TEMPLATE.md
Normal file
33
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# The issue tracker is not a support forum
|
||||
|
||||
The LinuxCNC issue tracker is to report bugs in the software.
|
||||
If you have a question about how to use the software, use one of the other methods detailed on our community support page: http://linuxcnc.org/community/
|
||||
|
||||
(delete this section before submitting your bug report)
|
||||
|
||||
## Here are the steps I follow to reproduce the issue:
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
## This is what I expected to happen:
|
||||
|
||||
## This is what happened instead:
|
||||
|
||||
## It worked properly before this:
|
||||
(If the behavior changed after making a particular change in hardware or
|
||||
software, describe the change you think is responsible. E.g., "after upgrading
|
||||
from LinuxCNC 2.7.3 to 2.7.4")
|
||||
|
||||
## Information about my hardware and software:
|
||||
|
||||
* I am using this Linux distribution and version (often, shown by `lsb_release -a`):
|
||||
* I am using this kernel version (shown by `uname -a`):
|
||||
* I am running ...
|
||||
* [ ] A binary version from linuxcnc.org (including buildbot.linuxcnc.org)
|
||||
* [ ] A binary I built myself
|
||||
* [ ] A binary version from some other source besides linuxcnc.org
|
||||
* I am using this LinuxCNC version (shown in package manager or, for git versions, `scripts/get-version-from-git`):
|
||||
* I am using this user interface (GUI) (e.g., AXIS, Touchy, gmoccapy, etc):
|
||||
* I am using this interface hardware vendor and chipset (e.g., parallel port, ethernet port, FPGA card):
|
||||
87
README.md
Normal file
87
README.md
Normal file
@@ -0,0 +1,87 @@
|
||||
|
||||
[![Badge GPL2]][License]
|
||||
[![Badge LGPL]][License]
|
||||
|
||||
<div align = center>
|
||||
|
||||
<br>
|
||||
|
||||
# LinuxCNC
|
||||
|
||||
*Controlling CNC Machines*
|
||||
|
||||
<br>
|
||||
|
||||
[![Badge Translation]][Translation]
|
||||
|
||||
<br>
|
||||
|
||||
---
|
||||
|
||||
[<kbd> <br> Website <br> </kbd>][Website]
|
||||
[<kbd> <br> Install <br> </kbd>][Install]
|
||||
[<kbd> <br> Build <br> </kbd>][Build]
|
||||
[<kbd> <br> Documentation <br> </kbd>][Documentation]
|
||||
|
||||
---
|
||||
|
||||
<br>
|
||||
|
||||
It can drive milling machines, lathes, 3D printers, laser <br>
|
||||
cutters, plasma cutters, robot arms, hexapods, and more.
|
||||
|
||||
LinuxCNC was initiated 25 years ago and evolved into a very <br>
|
||||
international project with contributions from all over the globe.
|
||||
|
||||
With release 2.9 of LinuxCNC we also transitioned the <br>
|
||||
documentation to the use of the public crowd translation <br>
|
||||
services [Weblate] and invite all our users to contribute.
|
||||
|
||||
The translations we expect to help attract practitioners <br>
|
||||
to the project and also helps educating enthusiasts of <br>
|
||||
all age groups on automated machining.
|
||||
|
||||
<br>
|
||||
|
||||
## DISCLAIMER
|
||||
|
||||
<br>
|
||||
|
||||
```
|
||||
|
||||
The authors of this software accept
|
||||
absolutely no liability for any
|
||||
harm or loss resulting from its use.
|
||||
|
||||
It is EXTREMELY unwise to rely
|
||||
on software alone for safety.
|
||||
|
||||
Any machinery capable of harming persons must have
|
||||
provisions for completely removing power from all
|
||||
motors, etc., before persons enter any danger area.
|
||||
|
||||
All machinery must be designed to comply with local
|
||||
and national safety codes, and the authors of this
|
||||
software cannot and do not, take any responsibility
|
||||
for such compliance.
|
||||
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
[Badge Translation]: https://hosted.weblate.org/widgets/linuxcnc/-/svg-badge.svg
|
||||
[Badge GPL2]: https://img.shields.io/badge/Most-LGPL_3-blue.svg?style=for-the-badge 'The license this software is under'
|
||||
[Badge LGPL]: https://img.shields.io/badge/Some-GPL_2-blue.svg?style=for-the-badge 'Some parts are under this license'
|
||||
|
||||
[Translation]: https://hosted.weblate.org/engage/linuxcnc/
|
||||
[Weblate]: https://hosted.weblate.org/projects/linuxcnc/
|
||||
[Website]: https://linuxcnc.org/
|
||||
|
||||
[Documentation]: http://linuxcnc.org/docs/devel/html/
|
||||
[Install]: http://linuxcnc.org/docs/devel/html/getting-started/getting-linuxcnc.html
|
||||
[Build]: http://linuxcnc.org/docs/devel/html/code/building-linuxcnc.html
|
||||
[License]: COPYING
|
||||
18
TODO
Normal file
18
TODO
Normal file
@@ -0,0 +1,18 @@
|
||||
TODO for the joints_axes branch
|
||||
|
||||
* clean up joints/axes throughout the whole code (lots of parts already done)
|
||||
* define a unified jogging way (both for joints and axes)
|
||||
* implement joint-limits for cartesian moves (requires simulating the speed in userspace)
|
||||
* update configs
|
||||
(and many other probably..)
|
||||
|
||||
TODO sort out axis/joints issues:
|
||||
* limits need to be imposed on joints (tricky with kins)
|
||||
* ini changes
|
||||
* clean out code (on all different levels, when joints are involved, call them joints..)
|
||||
-- this work is taking place on the joints_axes3 branch
|
||||
|
||||
TODO Convert all hardware drivers to use canonical homing,
|
||||
|
||||
Fixes in HAL modules:
|
||||
TODO canonical interfaces and naming conventions
|
||||
3
bin/.gitignore
vendored
Normal file
3
bin/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
!/profile_axis
|
||||
!/.gitignore
|
||||
4
bin/profile_axis
Executable file
4
bin/profile_axis
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_LOCATION=$(dirname "$(readlink -f "$0")")
|
||||
python3 -mcProfile -o axis.profile "$SCRIPT_LOCATION"/axis "$@"
|
||||
(echo sort cumulative; echo stats 20) | python3 -mpstats axis.profile
|
||||
18
configs/.gitignore
vendored
Normal file
18
configs/.gitignore
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
*.var
|
||||
*.var.bak
|
||||
*/core_*.hal
|
||||
!/cooltool/core_stepper4.hal
|
||||
!/hexapod-sim/core_sim_6.hal
|
||||
!/sim/core_sim_noio.hal
|
||||
!/sim/core_sim_noiocontrol.hal
|
||||
!/sim/core_sim_test.hal
|
||||
|
||||
*/axis_manualtoolchange.hal
|
||||
position*.txt
|
||||
!common/*.hal
|
||||
*.ini.expanded
|
||||
hallib
|
||||
*_cmds.hal
|
||||
*.pref
|
||||
mdi-history.dat
|
||||
resources.py
|
||||
1
configs/apps/.gitignore
vendored
Normal file
1
configs/apps/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.save
|
||||
11
configs/apps/README
Normal file
11
configs/apps/README
Normal file
@@ -0,0 +1,11 @@
|
||||
info: create system information file
|
||||
|
||||
Directories:
|
||||
|
||||
gladevcp -- demonstration widgets
|
||||
halrun ---- start halrun in xterm
|
||||
latency --- apps to investigate latency
|
||||
parport --- parallel port tests
|
||||
pyvcp ---- demonstrations
|
||||
xhc-hbo4 -- test wireless usb pendant
|
||||
|
||||
16
configs/apps/gladevcp/README
Normal file
16
configs/apps/gladevcp/README
Normal file
@@ -0,0 +1,16 @@
|
||||
gladevcp demo apps:
|
||||
|
||||
Apps:
|
||||
glade-manual
|
||||
gladevcp-test
|
||||
|
||||
Directories:
|
||||
animated-backdrop
|
||||
by-widget
|
||||
class-callback
|
||||
colored-label
|
||||
complex
|
||||
helloWorld
|
||||
mdi-command-examples
|
||||
simple-callback
|
||||
templates
|
||||
62
configs/apps/gladevcp/README.changes
Normal file
62
configs/apps/gladevcp/README.changes
Normal file
@@ -0,0 +1,62 @@
|
||||
Note on API changes to class handlers and persistence.py:
|
||||
|
||||
Class handlers:
|
||||
===============
|
||||
|
||||
The 'panel' parameter was dropped from get_handlers() since it's not needed.
|
||||
Correspondingly, the handler class __init__() method does not get this
|
||||
parameter any more as well:
|
||||
|
||||
class HandlerClass:
|
||||
...
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
|
||||
Widget access in handler classes:
|
||||
=================================
|
||||
|
||||
For a named widget, use:
|
||||
w = self.builder.get_object("widgetname")
|
||||
|
||||
To retrieve a list of all widgets in the UI file, use:
|
||||
wl = self.builder.get_objects()
|
||||
|
||||
This works regardless whether the UI is in libglade or GtkBuilder format.
|
||||
|
||||
persistence.py
|
||||
==============
|
||||
The handling of the builder parameter has been simplified. It has been dropped
|
||||
from the save_state and restore_state methods, and added instead to the
|
||||
IniFile.__init__() method. Therefore, use as follows:
|
||||
|
||||
class HandlerClass:
|
||||
...
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
# note: save_state(<object to fetch attributes from>) only:
|
||||
self.ini.save_state(self)
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
self.ini_filename = __name__ + '.ini'
|
||||
self.defaults = { IniFile.vars: dict(),
|
||||
IniFile.widgets : widget_defaults(select_widgets(self.builder.get_objects(), hal_only=False,output_only = True))
|
||||
}
|
||||
# note extra self.builder parameter
|
||||
self.ini = IniFile(self.ini_filename,self.defaults,self.builder)
|
||||
# note - only the object which gets attributes set is passed:
|
||||
self.ini.restore_state(self)
|
||||
|
||||
|
||||
All examples and templates have been adapted accordingly.
|
||||
|
||||
|
||||
Michael Haberler Dec 19 2010
|
||||
63
configs/apps/gladevcp/README.changes_es
Normal file
63
configs/apps/gladevcp/README.changes_es
Normal file
@@ -0,0 +1,63 @@
|
||||
Nota sobre los cambios API de los manejadores de clase y persistence.py:
|
||||
|
||||
Handlers de clase:
|
||||
=====================
|
||||
|
||||
El parámetro 'panel' se eliminó de get_handlers() ya que no es necesario.
|
||||
En consecuencia, el handler del método __init__() no recibe este
|
||||
parámetro:
|
||||
|
||||
class HandlerClass:
|
||||
...
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
|
||||
Acceso a widgets en handlers de clases:
|
||||
==========================================
|
||||
|
||||
Para un widget con nombre, use:
|
||||
w = self.builder.get_object("widgetname")
|
||||
|
||||
Para recuperar una lista de todos los widgets en el archivo UI, use:
|
||||
wl = self.builder.get_objects()
|
||||
|
||||
Esto funciona independientemente de si la interfaz de usuario está en formato libglade o GtkBuilder.
|
||||
|
||||
persistence.py
|
||||
==============
|
||||
El manejo del parámetro builder se ha simplificado. Se elimina
|
||||
de los métodos save_state y restore_state, y se agrega en su lugar al método
|
||||
IniFile.__init__(). Por lo tanto, utilicelo de la siguiente manera:
|
||||
|
||||
class HandlerClass:
|
||||
...
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
# note: save_state(<object to fetch attributes from>) only:
|
||||
self.ini.save_state(self)
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
self.ini_filename = __name__ + '.ini'
|
||||
self.defaults = { IniFile.vars: dict(),
|
||||
IniFile.widgets : widget_defaults(select_widgets(self.builder.get_objects(), hal_only=False,output_only = True))
|
||||
}
|
||||
# notese parámetro extra self.builder
|
||||
self.ini = IniFile(self.ini_filename, self.defaults, self.builder)
|
||||
# nota: solo se pasa el objeto que obtiene el conjunto de atributos:
|
||||
self.ini.restore_state(self)
|
||||
|
||||
|
||||
Todos los ejemplos y plantillas se han adaptado en consecuencia.
|
||||
|
||||
|
||||
Michael Haberler 19 de diciembre de 2010
|
||||
|
||||
16
configs/apps/gladevcp/animated-backdrop/README
Normal file
16
configs/apps/gladevcp/animated-backdrop/README
Normal file
@@ -0,0 +1,16 @@
|
||||
This is an example how to set a background bitmap for the gladevcp toplevel
|
||||
window, and absolute positioning of HAL widgets therein.
|
||||
|
||||
you might need to 'apt-get install python-cairo' first
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
gladevcp -u cairodraw.py cairodraw.ui
|
||||
|
||||
|
||||
-psha & mah
|
||||
|
||||
|
||||
|
||||
|
||||
7
configs/apps/gladevcp/animated-backdrop/animated-backdrop.demo
Executable file
7
configs/apps/gladevcp/animated-backdrop/animated-backdrop.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./cairodraw.py ./cairodraw.ui
|
||||
61
configs/apps/gladevcp/animated-backdrop/cairodraw.py
Normal file
61
configs/apps/gladevcp/animated-backdrop/cairodraw.py
Normal file
@@ -0,0 +1,61 @@
|
||||
import cairo
|
||||
from math import pi
|
||||
|
||||
|
||||
pngfile = 'vortex.me.png'
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def on_draw(self, widget, cr):
|
||||
print("on_draw")
|
||||
|
||||
# Sets the operator to clear which deletes everything below
|
||||
# where an object is drawn
|
||||
cr.set_operator(cairo.OPERATOR_CLEAR)
|
||||
width = widget.get_allocated_width()
|
||||
height = widget.get_allocated_height()
|
||||
# Makes the mask fill the entire window
|
||||
cr.rectangle(0.0, 0.0, width, height)
|
||||
# Deletes everything in the window (since the compositing
|
||||
# operator is clear and mask fills the entire window
|
||||
cr.fill()
|
||||
# Set the compositing operator back to the default
|
||||
cr.set_operator(cairo.OPERATOR_OVER)
|
||||
|
||||
if self.scale:
|
||||
w, h = widget.get_allocated_width(), widget.get_allocated_height()
|
||||
cr.scale(1.0 *w / self.width, 1.0*h/self.height)
|
||||
|
||||
cr.set_source_surface(self.img, 0, 0)
|
||||
cr.paint()
|
||||
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
|
||||
self.builder = builder
|
||||
win = self.builder.get_object("window1")
|
||||
|
||||
#win.set_decorated(False)
|
||||
|
||||
self.img = cairo.ImageSurface.create_from_png(pngfile)
|
||||
self.width = self.img.get_width()
|
||||
self.height = self.img.get_height()
|
||||
|
||||
# Makes the window paintable, so we can draw directly on it
|
||||
win.set_app_paintable(True)
|
||||
win.set_size_request(self.width, self.height)
|
||||
|
||||
# This sets the windows colormap, so it supports transparency.
|
||||
# This will only work if the wm support alpha channel
|
||||
screen = win.get_screen()
|
||||
rgba = screen.get_rgba_visual()
|
||||
win.set_visual(rgba)
|
||||
|
||||
# scaling the bitmap is possible by turning this on
|
||||
# however the fixed widget does NOT do proportional scaling
|
||||
self.scale = 1
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
59
configs/apps/gladevcp/animated-backdrop/cairodraw.ui
Normal file
59
configs/apps/gladevcp/animated-backdrop/cairodraw.ui
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="draw" handler="on_draw" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkFixed" id="fixed1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led1">
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x">57</property>
|
||||
<property name="y">41</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="has-tooltip">True</property>
|
||||
<property name="tooltip-text" translatable="yes">a tooltip</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x">250</property>
|
||||
<property name="y">22</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ToggleButton" id="hal_togglebutton1">
|
||||
<property name="label" translatable="yes">togglebutton</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x">29</property>
|
||||
<property name="y">107</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
BIN
configs/apps/gladevcp/animated-backdrop/screenshot.png
Normal file
BIN
configs/apps/gladevcp/animated-backdrop/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
configs/apps/gladevcp/animated-backdrop/vortex.me.png
Normal file
BIN
configs/apps/gladevcp/animated-backdrop/vortex.me.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
6
configs/apps/gladevcp/by-widget/README
Normal file
6
configs/apps/gladevcp/by-widget/README
Normal file
@@ -0,0 +1,6 @@
|
||||
by-widget
|
||||
|
||||
combobox
|
||||
radiobutton
|
||||
sourceview
|
||||
spinbutton
|
||||
7
configs/apps/gladevcp/by-widget/combobox.demo
Executable file
7
configs/apps/gladevcp/by-widget/combobox.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u combobox.py combobox.ui
|
||||
40
configs/apps/gladevcp/by-widget/combobox.py
Normal file
40
configs/apps/gladevcp/by-widget/combobox.py
Normal file
@@ -0,0 +1,40 @@
|
||||
'''
|
||||
HAL combobox
|
||||
|
||||
demo for adding a dynamic list of values
|
||||
|
||||
Michael Haberler 12/2010
|
||||
'''
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
debug = 0
|
||||
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
print("on_destroy, combobox active=%d" %(self.combo.get_active()))
|
||||
self.halcomp.exit() # avoid lingering HAL component
|
||||
Gtk.main_quit()
|
||||
|
||||
def on_changed(self, combobox, data=None):
|
||||
print("on_changed %f %d" % (combobox.hal_pin_f.get(),combobox.hal_pin_s.get()))
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
self.useropts = useropts
|
||||
|
||||
self.combo = self.builder.get_object('hal_combobox1')
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
global debug
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
|
||||
17
configs/apps/gladevcp/by-widget/combobox.txt
Normal file
17
configs/apps/gladevcp/by-widget/combobox.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
combobox examples:
|
||||
|
||||
combobox
|
||||
combobox_manual_list
|
||||
|
||||
watch this to learn about Glade and ComboBox: http://www.youtube.com/watch?v=Z5_F-rW2cL8
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
$ gladevcp -u combobox.py combobox.ui
|
||||
|
||||
combobox_manual_list.* are example files for constructing dropdown lists on the fly.
|
||||
|
||||
run as:
|
||||
$ gladevcp -u combobox_manual_list.py combobox_manual_list.ui
|
||||
|
||||
Michael Haberler 12/2010
|
||||
61
configs/apps/gladevcp/by-widget/combobox.ui
Normal file
61
configs/apps/gladevcp/by-widget/combobox.ui
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<!-- column-name myfloat -->
|
||||
<column type="gfloat"/>
|
||||
<!-- column-name description -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<data>
|
||||
<row>
|
||||
<col id="0">3.1400001049041748</col>
|
||||
<col id="1" translatable="yes">Pi </col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0">2.7182817459106445</col>
|
||||
<col id="1" translatable="yes">e</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0">42</col>
|
||||
<col id="1" translatable="yes">The Answer</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="width-request">150</property>
|
||||
<property name="height-request">50</property>
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="destroy" handler="on_destroy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_ComboBox" id="hal_combobox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="active">2</property>
|
||||
<property name="column">0</property>
|
||||
<signal name="changed" handler="on_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
17
configs/apps/gladevcp/by-widget/combobox_es.txt
Normal file
17
configs/apps/gladevcp/by-widget/combobox_es.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
ejemplos de combobox:
|
||||
|
||||
combobox
|
||||
combobox_manual_list
|
||||
|
||||
Vea esto para aprender acerca de Glade y ComboBox: http://www.youtube.com/watch?v=Z5_F-rW2cL8
|
||||
|
||||
------------------------------------------
|
||||
Para ejecutar de forma independiente:
|
||||
$ gladevcp -u combobox.py combobox.ui
|
||||
|
||||
combobox_manual_list.* son archivos de ejemplo para construir listas desplegables sobre la marcha.
|
||||
|
||||
correr como:
|
||||
$ gladevcp -u combobox_manual_list.py combobox_manual_list.ui
|
||||
|
||||
Michael Haberler 12/2010
|
||||
7
configs/apps/gladevcp/by-widget/combobox_manual_list.demo
Executable file
7
configs/apps/gladevcp/by-widget/combobox_manual_list.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./combobox_manual_list.py ./combobox_manual_list.ui
|
||||
59
configs/apps/gladevcp/by-widget/combobox_manual_list.py
Normal file
59
configs/apps/gladevcp/by-widget/combobox_manual_list.py
Normal file
@@ -0,0 +1,59 @@
|
||||
'''
|
||||
HAL combobox
|
||||
|
||||
demo for adding a dynamic list of values
|
||||
|
||||
Michael Haberler 12/2010
|
||||
'''
|
||||
|
||||
import gi
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GObject
|
||||
|
||||
debug = 0
|
||||
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
print("on_destroy")
|
||||
self.halcomp.exit() # avoid lingering HAL component
|
||||
Gtk.main_quit()
|
||||
|
||||
def on_changed(self, combobox, data=None):
|
||||
model = combobox.get_model()
|
||||
index = combobox.get_active()
|
||||
if index:
|
||||
print('index of selected value',index)
|
||||
return
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
self.useropts = useropts
|
||||
|
||||
self.combo = self.builder.get_object('hal_combobox1')
|
||||
|
||||
|
||||
self.list_store = Gtk.ListStore(GObject.TYPE_FLOAT)
|
||||
self.list_store.append([3.14])
|
||||
self.list_store.append([2.71828])
|
||||
self.list_store.append([1.67])
|
||||
self.list_store.append([47.11])
|
||||
self.list_store.append([42.0])
|
||||
self.combo.set_model(self.list_store)
|
||||
self.combo.set_active(0)
|
||||
cell = Gtk.CellRendererText()
|
||||
self.combo.pack_start(cell, True)
|
||||
self.combo.add_attribute(cell, "text", 0)
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
global debug
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
|
||||
29
configs/apps/gladevcp/by-widget/combobox_manual_list.ui
Normal file
29
configs/apps/gladevcp/by-widget/combobox_manual_list.ui
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">70</property>
|
||||
<property name="default-height">30</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_ComboBox" id="hal_combobox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="changed" handler="on_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
89
configs/apps/gladevcp/by-widget/radio.py
Normal file
89
configs/apps/gladevcp/by-widget/radio.py
Normal file
@@ -0,0 +1,89 @@
|
||||
'''
|
||||
gladevcp radiobutton example
|
||||
lifted from http://old.nabble.com/glade-and-radio-buttons.-td28793060.html
|
||||
|
||||
Michael Haberler 12/2010
|
||||
'''
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Pango
|
||||
|
||||
debug = 0
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def print_radiobutton_state(self, widget):
|
||||
if widget.get_active():
|
||||
state = 'active'
|
||||
if self.builder.get_object('showoutput_btn').get_active():
|
||||
self.set_color_label(widget.get_label())
|
||||
else:
|
||||
self.color_lbl.set_label('Unknown')
|
||||
|
||||
else:
|
||||
state = 'inactive'
|
||||
print(' %s button toggled - now %s ' % ( widget.get_label(), state))
|
||||
|
||||
def on_red_rbtn_toggled(self, widget, data=None):
|
||||
print('on_red_rbtn_toggled')
|
||||
self.print_radiobutton_state(widget)
|
||||
|
||||
def on_blue_rbtn_toggled(self, widget, data=None):
|
||||
print('on_blue_rbtn_toggled')
|
||||
self.print_radiobutton_state(widget)
|
||||
|
||||
def on_green_rbtn_toggled(self, widget, data=None):
|
||||
print('on_green_rbtn_toggled')
|
||||
self.print_radiobutton_state(widget)
|
||||
|
||||
def on_yellow_rbtn_toggled(self, widget, data=None):
|
||||
print('on_yellow_rbtn_toggled')
|
||||
self.print_radiobutton_state(widget)
|
||||
|
||||
def on_showoutput_btn_toggled(self, widget, data=None):
|
||||
if widget.get_active():
|
||||
self.color_lbl.set_sensitive(True)
|
||||
else:
|
||||
self.color_lbl.set_sensitive(False)
|
||||
|
||||
def set_color_label(self, color):
|
||||
self.color_lbl.set_label(color)
|
||||
mycolor = self.color_lookup[color.lower()]
|
||||
self.color_lbl.modify_fg(Gtk.StateFlags.NORMAL, mycolor)
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
print("on_destroy")
|
||||
self.halcomp.exit() # avoid lingering HAL component
|
||||
Gtk.main_quit()
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
self.useropts = useropts
|
||||
|
||||
self.window = self.builder.get_object('window1')
|
||||
self.color_lbl = self.builder.get_object('color_lbl')
|
||||
|
||||
fontdesc = Pango.FontDescription("Sans 20")
|
||||
self.color_lbl.modify_font(fontdesc)
|
||||
|
||||
self.color_lookup = {
|
||||
'red': Gdk.color_parse('red'),
|
||||
'blue': Gdk.color_parse('blue'),
|
||||
'green': Gdk.color_parse('green'),
|
||||
'yellow': Gdk.color_parse('yellow')
|
||||
}
|
||||
self.on_showoutput_btn_toggled(self.builder.get_object('showoutput_btn'))
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
global debug
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
|
||||
148
configs/apps/gladevcp/by-widget/radio.ui
Normal file
148
configs/apps/gladevcp/by-widget/radio.ui
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="destroy" handler="on_destroy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">spread</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="red_rbtn">
|
||||
<property name="label" translatable="yes">Red</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="yalign">0.5099999904632568</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<signal name="toggled" handler="on_red_rbtn_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="blue_rbtn">
|
||||
<property name="label" translatable="yes">Blue</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">red_rbtn</property>
|
||||
<signal name="toggled" handler="on_blue_rbtn_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="green_rbtn">
|
||||
<property name="label" translatable="yes">Green</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">red_rbtn</property>
|
||||
<signal name="toggled" handler="on_green_rbtn_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="yellow_rbtn">
|
||||
<property name="label" translatable="yes">Yellow</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">red_rbtn</property>
|
||||
<signal name="toggled" handler="on_yellow_rbtn_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="left-padding">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="color_lbl">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Unknown</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkCheckButton" id="showoutput_btn">
|
||||
<property name="label" translatable="yes">Show Color Choice</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<signal name="toggled" handler="on_showoutput_btn_toggled" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/by-widget/radiobutton.demo
Executable file
7
configs/apps/gladevcp/by-widget/radiobutton.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./radio.py ./radio.ui
|
||||
9
configs/apps/gladevcp/by-widget/radiobutton.txt
Normal file
9
configs/apps/gladevcp/by-widget/radiobutton.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
gladevcp radiobutton example
|
||||
lifted from http://old.nabble.com/glade-and-radio-buttons.-td28793060.html
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
$ gladevcp -u radio.py radio.ui
|
||||
|
||||
Michael Haberler 12/2010
|
||||
9
configs/apps/gladevcp/by-widget/radiobutton_es.txt
Normal file
9
configs/apps/gladevcp/by-widget/radiobutton_es.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Ejemplo gladevcp radiobutton
|
||||
Tomado de http://old.nabble.com/glade-and-radio-buttons.-td28793060.html
|
||||
|
||||
------------------------------------------
|
||||
Para correr independientemente:
|
||||
|
||||
$ gladevcp -u radio.py radio.ui
|
||||
|
||||
Michael Haberler 12/2010
|
||||
7
configs/apps/gladevcp/by-widget/sourceview.demo
Executable file
7
configs/apps/gladevcp/by-widget/sourceview.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./sourceview.py ./sourceview.ui
|
||||
60
configs/apps/gladevcp/by-widget/sourceview.py
Normal file
60
configs/apps/gladevcp/by-widget/sourceview.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GtkSource
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def _set_line(self,l):
|
||||
if not l:
|
||||
if self.mark:
|
||||
self.textbuffer.delete_mark(self.mark)
|
||||
self.mark = None
|
||||
return
|
||||
line = self.textbuffer.get_iter_at_line(l-1)
|
||||
if not self.mark:
|
||||
self.mark = self.textbuffer.create_source_mark('highlight', 'highlight', line)
|
||||
self.mark.set_visible(True)
|
||||
else:
|
||||
self.textbuffer.move_mark(self.mark, line)
|
||||
self.sourceview.scroll_to_mark(self.mark, 0, True, 0, 0.5)
|
||||
|
||||
def file_set(self,widget,data=None):
|
||||
filename = widget.get_filename()
|
||||
print("file_set",filename)
|
||||
self.textbuffer.set_text(open(filename).read())
|
||||
self.line = 1
|
||||
self._set_line(self.line)
|
||||
|
||||
def on_down(self,widget,data=None):
|
||||
self.line += 1
|
||||
self._set_line(self.line)
|
||||
|
||||
def on_up(self,widget,data=None):
|
||||
self.line -= 1
|
||||
self._set_line(self.line)
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
self.line = 1
|
||||
self.sourceview = builder.get_object('gtksourceview1')
|
||||
self.textbuffer = GtkSource.Buffer()
|
||||
self.sourceview.set_buffer(self.textbuffer)
|
||||
|
||||
self.sourceview.set_show_line_numbers(True)
|
||||
self.sourceview.set_show_line_marks(True)
|
||||
self.sourceview.set_highlight_current_line(True)
|
||||
|
||||
att = GtkSource.MarkAttributes()
|
||||
color = Gdk.RGBA()
|
||||
color.parse('yellow')
|
||||
att.set_background(color)
|
||||
self.sourceview.set_mark_attributes('highlight', att, 1)
|
||||
self.mark = None
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
9
configs/apps/gladevcp/by-widget/sourceview.txt
Normal file
9
configs/apps/gladevcp/by-widget/sourceview.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Example for using the sourceview widget
|
||||
---------------------------------------
|
||||
|
||||
Loading a file, and highlighting a line
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
$ gladevcp -u sourceview.py sourceview.ui
|
||||
140
configs/apps/gladevcp/by-widget/sourceview.ui
Normal file
140
configs/apps/gladevcp/by-widget/sourceview.ui
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gtksourceview" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="left-padding">12</property>
|
||||
<child>
|
||||
<object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkFileChooserButton" id="filechooserbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="file-set" handler="file_set" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="down">
|
||||
<property name="label" translatable="yes">Down</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
<signal name="pressed" handler="on_down" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="up">
|
||||
<property name="label" translatable="yes">Up</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_up" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes"><b>File</b></property>
|
||||
<property name="use-markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label-xalign">0</property>
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment2">
|
||||
<property name="width-request">300</property>
|
||||
<property name="height-request">400</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="left-padding">12</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<child>
|
||||
<object class="GtkSourceView" id="gtksourceview1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="left-margin">2</property>
|
||||
<property name="right-margin">2</property>
|
||||
<property name="show-line-numbers">True</property>
|
||||
<property name="show-line-marks">True</property>
|
||||
<property name="tab-width">4</property>
|
||||
<property name="auto-indent">True</property>
|
||||
<property name="indent-on-tab">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Sourceview Widget</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
9
configs/apps/gladevcp/by-widget/sourceview_es.txt
Normal file
9
configs/apps/gladevcp/by-widget/sourceview_es.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Ejemplo para usar el widget sourceview
|
||||
---------------------------------------
|
||||
|
||||
Cargando un archivo, y resaltando una línea
|
||||
|
||||
------------------------------------------
|
||||
Para ejecutar de forma independiente:
|
||||
|
||||
$ gladevcp -u sourceview.py sourceview.ui
|
||||
7
configs/apps/gladevcp/by-widget/spinbutton.demo
Executable file
7
configs/apps/gladevcp/by-widget/spinbutton.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u spinbutton.py spinbutton.ui
|
||||
16
configs/apps/gladevcp/by-widget/spinbutton.py
Normal file
16
configs/apps/gladevcp/by-widget/spinbutton.py
Normal file
@@ -0,0 +1,16 @@
|
||||
'''
|
||||
HAL spinbutton
|
||||
demo for Gtk bug workaround
|
||||
see Gladevcp Manual Section FAQ item 6
|
||||
'''
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def on_spinbutton_realize(self,widget,data=None):
|
||||
widget.set_value(3.14)
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
return [HandlerClass()]
|
||||
|
||||
7
configs/apps/gladevcp/by-widget/spinbutton.txt
Normal file
7
configs/apps/gladevcp/by-widget/spinbutton.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
spinbutton example
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
$ gladevcp -u spinbutton.py spinbutton.ui
|
||||
|
||||
Michael Haberler 06/2012
|
||||
41
configs/apps/gladevcp/by-widget/spinbutton.ui
Normal file
41
configs/apps/gladevcp/by-widget/spinbutton.ui
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<property name="digits">2</property>
|
||||
<signal name="realize" handler="on_spinbutton_realize" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/by-widget/spinbutton_es.txt
Normal file
7
configs/apps/gladevcp/by-widget/spinbutton_es.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
ejemplo de botón spin
|
||||
|
||||
------------------------------------------
|
||||
Para ejecutar de forma independiente:
|
||||
$ gladevcp -u spinbutton.py spinbutton.ui
|
||||
|
||||
Michael Haberler 06/2012
|
||||
19
configs/apps/gladevcp/class-callback/README
Normal file
19
configs/apps/gladevcp/class-callback/README
Normal file
@@ -0,0 +1,19 @@
|
||||
example with callback class methods
|
||||
-----------------------------------
|
||||
|
||||
This shows how to use class methods as callbacks.
|
||||
|
||||
Note:
|
||||
|
||||
There are two class definitions in this example. Both are instantiated - OtherClass around line 84 during
|
||||
import, and HandlerClass by the get_handlers() function.
|
||||
|
||||
HandlerClass.__init__() shows how to define a hal pin which is not associated to any HAL widget.
|
||||
|
||||
Passing the builder enables referring to any widget in the tree (see for instance line 33).
|
||||
|
||||
Also, a slow (1-second) timer callback is shown which updates the 'value' HAL pin - this pin is
|
||||
linked to the hal_hbar Horizontal Bar widget through class_callback.hal.
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
$ gladevcp -u class_callback.py -H class_callback.hal class_callback.ui
|
||||
7
configs/apps/gladevcp/class-callback/class_callback.demo
Executable file
7
configs/apps/gladevcp/class-callback/class_callback.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./class_callback.py -H ./class_callback.hal ./class_callback.ui
|
||||
1
configs/apps/gladevcp/class-callback/class_callback.hal
Normal file
1
configs/apps/gladevcp/class-callback/class_callback.hal
Normal file
@@ -0,0 +1 @@
|
||||
net count class_callback.value => class_callback.hal_hbar1
|
||||
93
configs/apps/gladevcp/class-callback/class_callback.py
Normal file
93
configs/apps/gladevcp/class-callback/class_callback.py
Normal file
@@ -0,0 +1,93 @@
|
||||
import hal
|
||||
import time
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GObject
|
||||
from gi.repository import Pango
|
||||
from gi.repository import GLib
|
||||
|
||||
from inspect import stack
|
||||
|
||||
class OtherClass:
|
||||
'''
|
||||
methods in this class are not exposed as callback handlers
|
||||
since the object instance is not passed to gladevcp in get_handlers()
|
||||
'''
|
||||
def invisible(selfself):
|
||||
pass
|
||||
|
||||
|
||||
class HandlerClass:
|
||||
'''
|
||||
class with gladevcp callback handlers
|
||||
'''
|
||||
|
||||
def on_button_press(self,widget,data=None):
|
||||
'''
|
||||
a callback method
|
||||
parameters are:
|
||||
the generating object instance, likte a GtkButton instance
|
||||
user data passed if any - this is currently unused but
|
||||
the convention should be retained just in case
|
||||
'''
|
||||
self.nhits += 1
|
||||
laptime = time.time() - self.start
|
||||
self.builder.get_object('message').set_label("time lap#%d: %.2f seconds" % (self.nhits,laptime))
|
||||
|
||||
def _on_timer_tick(self,userdata=None):
|
||||
'''
|
||||
the full glib functionality is available if needed.
|
||||
here's a timer function which will be called periodically
|
||||
returning True restarts the timer
|
||||
returning False makes it a one-shot
|
||||
'''
|
||||
self.ticks += 1
|
||||
self.halcomp['value'] = self.ticks
|
||||
return True
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
'''
|
||||
Handler classes are instantiated in the following state:
|
||||
- the widget tree is created, but not yet realized (no toplevel window.show() executed yet)
|
||||
- the halcomp HAL component is set up and the widhget tree's HAL pins have already been added to it
|
||||
- it is safe to add more hal pins because halcomp.ready() has not yet been called at this point.
|
||||
|
||||
after all handlers are instantiated in command line and get_handlers() order, callbacks will be
|
||||
connected with connect_signals()/signal_autoconnect()
|
||||
|
||||
The builder may be either of libglade or GtkBuilder type depending on the glade file format.
|
||||
'''
|
||||
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
self.halcomp.newpin("value", hal.HAL_FLOAT, hal.HAL_OUT)
|
||||
self.start = time.time()
|
||||
self.nhits = 0
|
||||
self.ticks = 0
|
||||
|
||||
# demonstrate a slow background timer - granularity is one second
|
||||
# for a faster timer, use this:
|
||||
# glib.timeout_add(5000, self._on_timer_tick)
|
||||
GLib.timeout_add_seconds(1, self._on_timer_tick)
|
||||
|
||||
|
||||
|
||||
|
||||
other = OtherClass() # executed at import time
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
'''
|
||||
this function is called by gladevcp at import time (when this module is passed with '-u <modname>.py')
|
||||
|
||||
return a list of object instances whose methods should be connected as callback handlers
|
||||
any method whose name does not begin with an underscore ('_') is a callback candidate
|
||||
|
||||
the 'get_handlers' name is reserved - gladevcp expects it, so do not change
|
||||
'''
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
60
configs/apps/gladevcp/class-callback/class_callback.ui
Normal file
60
configs/apps/gladevcp/class-callback/class_callback.ui
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">200</property>
|
||||
<property name="default-height">150</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Button" id="button">
|
||||
<property name="label" translatable="yes">Take lap time</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_button_press" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HBar" id="hal_hbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="bg-color">#bebebebebebe</property>
|
||||
<property name="max">60</property>
|
||||
<property name="z0-border">0.6000000238418579</property>
|
||||
<property name="z0-color">#0000ffff0000</property>
|
||||
<property name="z1-border">0.8000000119209289</property>
|
||||
<property name="z1-color">#ffffffff0000</property>
|
||||
<property name="z2-color">#ffff00000000</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
23
configs/apps/gladevcp/colored-label/README
Normal file
23
configs/apps/gladevcp/colored-label/README
Normal file
@@ -0,0 +1,23 @@
|
||||
How to colorize a HAL_Label widget depending on the pin value
|
||||
-------------------------------------------------------------
|
||||
|
||||
Setting the background color of a GtkLabel widget (and HAL_Label is
|
||||
derived from GtkLabel) is a bit tricky. The GtkLabel widget has no
|
||||
window object of its own for performance reasons, and only window
|
||||
objects can have a background color. The solution is to enclose the
|
||||
Labl in an EventBox container, which has a window but is otherwise
|
||||
invisible - see the coloredlabel.ui file.
|
||||
|
||||
To help with this, the colorize() method tries to detect this
|
||||
situation and give a warning if the widget is a GtkLabel and the
|
||||
parent widget is not an GtkEventBox. It can be used to set the colors
|
||||
of arbitrary widgets, not just GtkLabel.
|
||||
|
||||
Also, this example shows how to set a custom text and color label
|
||||
depending on the HAL pin's value.
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
$ gladevcp -u coloredlabel.py -H coloredlabel.hal coloredlabel.ui
|
||||
|
||||
7
configs/apps/gladevcp/colored-label/coloredlabel.demo
Executable file
7
configs/apps/gladevcp/colored-label/coloredlabel.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./coloredlabel.py -H ./coloredlabel.hal ./coloredlabel.ui
|
||||
2
configs/apps/gladevcp/colored-label/coloredlabel.hal
Normal file
2
configs/apps/gladevcp/colored-label/coloredlabel.hal
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
net monitored-value coloredlabel.hal_spinbutton1-s coloredlabel.hal_label1
|
||||
88
configs/apps/gladevcp/colored-label/coloredlabel.py
Normal file
88
configs/apps/gladevcp/colored-label/coloredlabel.py
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: sts=4 sw=4 et
|
||||
# This is a component of LinuxCNC
|
||||
# complex.py Copyright 2011 Michael Haberler
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.''''''
|
||||
'''
|
||||
gladevcp colored label example
|
||||
Michael Haberler 2/2011
|
||||
'''
|
||||
import sys
|
||||
import hal
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
|
||||
global red,green,white
|
||||
|
||||
red = Gdk.color_parse("red")
|
||||
green = Gdk.color_parse("green")
|
||||
yellow = Gdk.color_parse("yellow")
|
||||
|
||||
# data for a table-driven HAL Label
|
||||
table = { 0: ("No Fault", green),
|
||||
1: ("Over Current", red),
|
||||
2: ("Over Voltage", red),
|
||||
3: ("Overheat", red),
|
||||
4: ("Overload", red),
|
||||
}
|
||||
# defaults for value not in table
|
||||
default_text = "unknown value: "
|
||||
default_color = yellow
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def colorize(self, w, state, color):
|
||||
''' helper method: try to do the right thing when setting the color of a widget.
|
||||
The GtkLabel, and hence HAL_Label widget doesn't take a color, so
|
||||
it needs an enclosing Eventbox which can be colorized.'''
|
||||
if isinstance(w,Gtk.Label):
|
||||
parent = w.get_parent()
|
||||
if not isinstance(parent,Gtk.EventBox):
|
||||
print("warning: the %s Label widget is not enclosed in an EventBox" % w.get_name(), file=sys.stderr)
|
||||
parent.modify_bg(state, color)
|
||||
else:
|
||||
# non-label widgets can be directly colorized
|
||||
w.modify_bg(state, color) # colorize anyway
|
||||
|
||||
def on_label_hal_pin_change(self, hal_widget, data=None):
|
||||
'''
|
||||
this is an example of a hal-pin-changed signal handler as set in glade.
|
||||
The purpose of this callback is to deliver an optional notification to your code beyond
|
||||
just reacting to the changed HAL pin.
|
||||
|
||||
See hal_button1's 'Signals' section in glade to see how it is connected to this handler
|
||||
'''
|
||||
|
||||
value = hal_widget.hal_pin.get()
|
||||
if value not in table:
|
||||
text = default_text + str(value)
|
||||
color = default_color
|
||||
else:
|
||||
(text,color) = table[value]
|
||||
hal_widget.set_label(text)
|
||||
self.colorize(hal_widget, Gtk.StateFlags.NORMAL, color)
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
|
||||
self.hal_button1 = builder.get_object('hal_button1')
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
57
configs/apps/gladevcp/colored-label/coloredlabel.ui
Normal file
57
configs/apps/gladevcp/colored-label/coloredlabel.ui
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">200</property>
|
||||
<property name="default-height">200</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkEventBox" id="eventbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Label" id="hal_label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
<signal name="hal-pin-changed" handler="on_label_hal_pin_change" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
15
configs/apps/gladevcp/complex/README
Normal file
15
configs/apps/gladevcp/complex/README
Normal file
@@ -0,0 +1,15 @@
|
||||
complex example with widget and variable persistence
|
||||
----------------------------------------------------
|
||||
|
||||
This demonstrates the use of the gladevcp.util support for persistence,
|
||||
and shows how to get a callback when hal pins, or hal input widgets change.
|
||||
|
||||
The hal_togglebutton1 is linked to hal_led1 through complex.hal
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
$ gladevcp -u complex.py -H complex.hal complex.ui
|
||||
|
||||
or to get a lot of debug output what gladevcp and complex.py are doing:
|
||||
|
||||
$ gladevcp -d -d -u complex.py -U debug=3 -H complex.hal complex.ui
|
||||
7
configs/apps/gladevcp/complex/complex.demo
Executable file
7
configs/apps/gladevcp/complex/complex.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./complex.py -H ./complex.hal ./complex.ui
|
||||
9
configs/apps/gladevcp/complex/complex.hal
Normal file
9
configs/apps/gladevcp/complex/complex.hal
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
# a HAL table must be explicitly enabled from 'outside'
|
||||
# by setting its hal pin to 1
|
||||
# otherwise, all contained widgets are disabled ('greyed out')
|
||||
|
||||
setp complex.hal_table1 1
|
||||
|
||||
# led reflects togglebutton
|
||||
net led complex.hal_togglebutton1 => complex.hal_led1
|
||||
215
configs/apps/gladevcp/complex/complex.py
Normal file
215
configs/apps/gladevcp/complex/complex.py
Normal file
@@ -0,0 +1,215 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: sts=4 sw=4 et
|
||||
# This is a component of LinuxCNC
|
||||
# complex.py Copyright 2010 Michael Haberler
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.''''''
|
||||
'''
|
||||
gladevcp complex demo example
|
||||
Michael Haberler 11/2010
|
||||
|
||||
'''
|
||||
|
||||
import os,sys
|
||||
from gladevcp.persistence import IniFile,widget_defaults,set_debug,select_widgets
|
||||
import hal
|
||||
import hal_glib
|
||||
import gtk
|
||||
|
||||
import gi
|
||||
from gi.repository import GLib
|
||||
|
||||
debug = 0
|
||||
|
||||
class HandlerClass:
|
||||
'''
|
||||
class with gladevcp callback handlers
|
||||
'''
|
||||
|
||||
def on_button_press(self,halwidget,data=None):
|
||||
'''
|
||||
a callback method
|
||||
parameters are:
|
||||
the generating object instance, like a GtkButton instance
|
||||
user data passed if any - this is currently unused but
|
||||
the convention should be retained just in case
|
||||
'''
|
||||
print("on_button_press()")
|
||||
self.nhits += 1
|
||||
halwidget.set_label("hits: %d" % self.nhits)
|
||||
|
||||
|
||||
def on_toggle_button(self,hal_button,data=None):
|
||||
'''
|
||||
standard button-pressed callback. Parameter is the widget object instance.
|
||||
'''
|
||||
print("on_toggle_button() HAL pin value: %s" %(str(hal_button.hal_pin.get())))
|
||||
|
||||
def _on_example_trigger_change(self,hal_pin,data=None):
|
||||
'''
|
||||
executed when the 'example-trigger' hal pin value changes
|
||||
note that this callback will not be exposed as potential callback
|
||||
handler through gladevcp since the name begins with an underscore (_) .
|
||||
Parameter is the HAL pin instance.
|
||||
'''
|
||||
print("_on_example_trigger_change() - HAL pin value: %s" % (hal_pin.get()))
|
||||
|
||||
def on_led_pin_changed(self,hal_led,data=None):
|
||||
'''
|
||||
this is an example of a hal-pin-changed signal handler as set in glade.
|
||||
The purpose of this callback is to deliver an optional notification to your code beyond
|
||||
just reacting to the changed HAL pin.
|
||||
the on_led_pin_changed signal is set in the complex.ui hal_led1 signals section
|
||||
'''
|
||||
print("on_led_pin_changed() - HAL pin value:",hal_led.hal_pin.get())
|
||||
|
||||
def _on_timer_tick(self,userdata=None):
|
||||
'''
|
||||
the full glib functionality is available if needed.
|
||||
here's a timer function which will be called periodically
|
||||
returning True restarts the timer
|
||||
returning False makes it a one-shot
|
||||
'''
|
||||
self.lifetime_ticks += 1
|
||||
self.builder.get_object('message').hal_pin.set(self.lifetime_ticks)
|
||||
return True
|
||||
|
||||
|
||||
def on_unix_signal(self,signum,stack_frame):
|
||||
print("on_unix_signal(): signal %d received, saving state" % (signum))
|
||||
self.ini.save_state(self)
|
||||
gtk.main_quit()
|
||||
self.halcomp.exit()
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
'''
|
||||
gladevcp_demo.ui has a destroy callback set in the window1 Gobject
|
||||
note the widget tree is not safely accessible here any more
|
||||
'''
|
||||
print("on_destroy() - saving state)")
|
||||
self.ini.save_state(self)
|
||||
|
||||
def on_restore_defaults(self,button,data=None):
|
||||
self.ini.create_default_ini()
|
||||
self.ini.restore_state(self)
|
||||
self.builder.get_object('hal_button1').set_label("past hits: %d" % self.nhits)
|
||||
|
||||
def on_save_settings(self,button,data=None):
|
||||
print("on_save_settings() - saving state")
|
||||
self.ini.save_state(self)
|
||||
|
||||
def _hal_setup(self,halcomp, builder):
|
||||
'''
|
||||
hal related initialisation
|
||||
'''
|
||||
|
||||
# the toplevel window is always named 'window1'. Do not change.
|
||||
# widgets may be accessed through builder.get_object() and
|
||||
# builder.get_objects()
|
||||
self.window1 = self.builder.get_object("window1")
|
||||
self.led1 = self.builder.get_object("hal_led1")
|
||||
|
||||
# standard hal pins not associated with any widget
|
||||
self.halcomp.newpin("example-out", hal.HAL_BIT, hal.HAL_OUT)
|
||||
self.halcomp.newpin("example-in", hal.HAL_S32, hal.HAL_IN)
|
||||
|
||||
# hal pins with change callback. Also unrelated to any HAL widget.
|
||||
# When the pin's value changes the callback is executed.
|
||||
self.example_trigger = hal_glib.GPin(halcomp.newpin('example-trigger', hal.HAL_BIT, hal.HAL_IN))
|
||||
self.example_trigger.connect('value-changed', self._on_example_trigger_change)
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
'''
|
||||
Handler classes are instantiated in the following state:
|
||||
- the widget tree is created, but not yet realized (no toplevel window.show() executed yet)
|
||||
- the halcomp HAL component is set up and the widhget tree's HAL pins have already been added to it
|
||||
- it is safe to add more hal pins because halcomp.ready() has not yet been called at this point.
|
||||
|
||||
after all handlers are instantiated in command line and get_handlers() order, callbacks will be
|
||||
connected with connect_signals()/signal_autoconnect()
|
||||
|
||||
The builder may be either of libglade or GtkBuilder type depending on the glade file format.
|
||||
'''
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
|
||||
(directory,filename) = os.path.split(__file__)
|
||||
(basename,extension) = os.path.splitext(filename)
|
||||
self.ini_filename = os.path.join(directory,basename + '.save')
|
||||
|
||||
# the dict driving the ini file persistence feature
|
||||
# a signature checks variable names,types,sections
|
||||
#
|
||||
# to see the mechanism at work, do this:
|
||||
# - run the application, change some values, and exit
|
||||
# - edit the complex.save file and change a variable name in the widgets or vars section
|
||||
# for example, rename 'a' to 'z'
|
||||
# and remove one of the widgets in the widgets section
|
||||
# - then re-run the application
|
||||
# during startup, you get a message saying
|
||||
# "key 'a' in section 'vars' : missing"
|
||||
# "key 'hal_radiobutton1' in section 'widgets' : missing"
|
||||
#
|
||||
# to see how the protection of ini file versus a changed program works,
|
||||
# change the defaults dict below, for instance remove the 'c' : "a string variable
|
||||
# then re-run - the signature check at startup should fail, you should get:
|
||||
# "signature mismatch in ./complex.save - resetting to default"
|
||||
# and a default ini file is generated
|
||||
|
||||
self.defaults = { # these will be saved/restored as method attributes
|
||||
IniFile.vars: { 'nhits' : 0, 'lifetime_ticks': 0, 'a': 1.67, 'd': True, 'c' : "a string"},
|
||||
|
||||
# we're interested restoring state to output HAL widgets only
|
||||
# NB: this does NOT restore state pf plain gtk objects - set hal_only to False to do this
|
||||
IniFile.widgets: widget_defaults(select_widgets(self.builder.get_objects(), hal_only=True,output_only = True)),
|
||||
}
|
||||
|
||||
self.ini = IniFile(self.ini_filename,self.defaults, self.builder)
|
||||
self.ini.restore_state(self)
|
||||
|
||||
# at this point it is ok to refer to restored attributes like self.nhits and self.lifetime_ticks:
|
||||
self.builder.get_object('hal_button1').set_label("past hits: %d" % self.nhits)
|
||||
self.builder.get_object('message').hal_pin.set(self.lifetime_ticks)
|
||||
|
||||
self._hal_setup(halcomp,builder)
|
||||
|
||||
# demonstrate a slow background timer - granularity is one second
|
||||
# for a faster timer, use this:
|
||||
# GLib.timeout_add(5000, self._on_timer_tick)
|
||||
GLib.timeout_add_seconds(1, self._on_timer_tick)
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
'''
|
||||
this function is called by gladevcp at import time (when this module is passed with '-u <modname>.py')
|
||||
|
||||
return a list of object instances whose methods should be connected as callback handlers
|
||||
any method whose name does not begin with an underscore ('_') is a callback candidate
|
||||
|
||||
the 'get_handlers' name is reserved - gladevcp expects it, so do not change
|
||||
'''
|
||||
|
||||
# try this at command line:
|
||||
# -U debug=42 -U "print 'debug=%d' % debug"
|
||||
global debug
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
set_debug(debug)
|
||||
|
||||
if debug: print("%s.get_handlers() called" % (__name__))
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
185
configs/apps/gladevcp/complex/complex.ui
Normal file
185
configs/apps/gladevcp/complex/complex.ui
Normal file
@@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAction" id="action1"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
<property name="page-size">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Table" id="hal_table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
|
||||
<signal name="destroy" handler="on_destroy" swapped="no"/>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
<signal name="hal-pin-changed" handler="on_led_pin_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_button_press" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ToggleButton" id="hal_togglebutton1">
|
||||
<property name="label" translatable="yes">Toggle LED</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="toggled" handler="on_toggle_button" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="hal_hscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">Restore defaults</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_restore_defaults" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="label" translatable="yes">Save settings</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_save_settings" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Label" id="message">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="text-template">Total runtime: %s seconds</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_RadioButton" id="hal_radiobutton1">
|
||||
<property name="label" translatable="yes">lemon</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">hal_radiobutton2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_RadioButton" id="hal_radiobutton2">
|
||||
<property name="label" translatable="yes">banana</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_RadioButton" id="hal_radiobutton3">
|
||||
<property name="label" translatable="yes">chocolate</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">hal_radiobutton2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/glade-manual.demo
Executable file
7
configs/apps/gladevcp/glade-manual.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo ./glade-manual.ui
|
||||
56
configs/apps/gladevcp/glade-manual.ui
Normal file
56
configs/apps/gladevcp/glade-manual.ui
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Label" id="hal_label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="hal_hscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/gladevcp-test.demo
Executable file
7
configs/apps/gladevcp/gladevcp-test.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo ./gladevcp-test.ui
|
||||
357
configs/apps/gladevcp/gladevcp-test.ui
Normal file
357
configs/apps/gladevcp/gladevcp-test.ui
Normal file
@@ -0,0 +1,357 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
<property name="page-size">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
<property name="page-size">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment3">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment4">
|
||||
<property name="upper">1000</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment5">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
<property name="page-size">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Table" id="hal_table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HBox" id="hal_hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
<property name="pick-color-off">#00002724ffff</property>
|
||||
<property name="pick-color-on">#f88096020000</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_VBar" id="hal_vbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="bg-color">#bebebebebebe</property>
|
||||
<property name="force-width">30</property>
|
||||
<property name="invert">True</property>
|
||||
<property name="min">10</property>
|
||||
<property name="z0-border">0.699999988079071</property>
|
||||
<property name="z0-color">#0000ffff0000</property>
|
||||
<property name="z1-border">0.8000000119209289</property>
|
||||
<property name="z1-color">#ffffffff0000</property>
|
||||
<property name="z2-color">#ffff00000000</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_VScale" id="hal_vscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Label" id="hal_label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
<property name="label-pin-type">1</property>
|
||||
<property name="text-template">%.02f</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Label" id="hal_label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="bottom-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_RadioButton" id="hal_radiobutton2">
|
||||
<property name="label" translatable="yes">radiobutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="group">hal_radiobutton1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="bottom-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_RadioButton" id="hal_radiobutton1">
|
||||
<property name="label" translatable="yes">radiobutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="right-attach">2</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">500</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="right-attach">3</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="bottom-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_CheckButton" id="hal_checkbutton1">
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HBar" id="hal_hbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="bg-color">#bebebebebebe</property>
|
||||
<property name="force-height">20</property>
|
||||
<property name="max">50</property>
|
||||
<property name="z0-border">0.699999988079071</property>
|
||||
<property name="z0-color">#0000ffff0000</property>
|
||||
<property name="z1-border">0.8500000238418579</property>
|
||||
<property name="z1-color">#ffffffff0000</property>
|
||||
<property name="z2-color">#ffff00000000</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="bottom-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="hal_hscale2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="bottom-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ToggleButton" id="hal_togglebutton1">
|
||||
<property name="label" translatable="yes">togglebutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="hal_hscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Scale</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment4</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ProgressBar" id="hal_progressbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="scale">180</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
20
configs/apps/gladevcp/helloWorld/README
Normal file
20
configs/apps/gladevcp/helloWorld/README
Normal file
@@ -0,0 +1,20 @@
|
||||
a minimal gladevcp example - three HAL widgets
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
$ gladevcp_demo hw.ui
|
||||
|
||||
To connect the button HAL pin to the LED, run as:
|
||||
|
||||
$ gladevcp_demo -H hw.hal hw.ui
|
||||
|
||||
To embed this application as a tab into Axis or Touchy, copy hw.ui and hw.hal to your config directory,
|
||||
and edit your Axis/Touchy ini file as follows:
|
||||
|
||||
[DISPLAY]
|
||||
EMBED_TAB_NAME = HelloWorld
|
||||
EMBED_TAB_COMMAND = gladevcp -H hw.hal -x {XID} hw.ui
|
||||
|
||||
to edit the user interface:
|
||||
|
||||
$ glade hw.ui
|
||||
7
configs/apps/gladevcp/helloWorld/helloworld.demo
Executable file
7
configs/apps/gladevcp/helloWorld/helloworld.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -H ./hw.hal ./hw.ui
|
||||
1
configs/apps/gladevcp/helloWorld/hw.hal
Normal file
1
configs/apps/gladevcp/helloWorld/hw.hal
Normal file
@@ -0,0 +1 @@
|
||||
net button-state hw.hal_togglebutton1 => hw.hal_led1
|
||||
56
configs/apps/gladevcp/helloWorld/hw.ui
Normal file
56
configs/apps/gladevcp/helloWorld/hw.ui
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">200</property>
|
||||
<property name="default-height">150</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_LED" id="hal_led1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="led-blink-rate">0</property>
|
||||
<property name="led-shape">2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ToggleButton" id="hal_togglebutton1">
|
||||
<property name="label" translatable="yes">togglebutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Label" id="hal_label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="ypad">7</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/mdi-command-example/owordsub.demo
Executable file
7
configs/apps/gladevcp/mdi-command-example/owordsub.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo ./owordsub.ui
|
||||
93
configs/apps/gladevcp/mdi-command-example/owordsub.ui
Normal file
93
configs/apps/gladevcp/mdi-command-example/owordsub.ui
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="EMC_Action_MDI" id="hal_action_mdi1">
|
||||
<property name="command">O<oword> call [${spin-f}] [${check}] [${toggle}] [${scale}]</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_CheckButton" id="check">
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_ToggleButton" id="toggle">
|
||||
<property name="label" translatable="yes">togglebutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="scale">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">run O-word
|
||||
sub</property>
|
||||
<property name="related-action">hal_action_mdi1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/mdi-command-example/speed.demo
Executable file
7
configs/apps/gladevcp/mdi-command-example/speed.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo ./speed.ui
|
||||
56
configs/apps/gladevcp/mdi-command-example/speed.ui
Normal file
56
configs/apps/gladevcp/mdi-command-example/speed.ui
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="value">42</property>
|
||||
<property name="step-increment">0.10</property>
|
||||
</object>
|
||||
<object class="EMC_Action_MDI" id="hal_action_mdi1">
|
||||
<property name="command">(MSG, "The speed is: ${speed-f}")</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="speed">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<property name="digits">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes"> Pass speed as
|
||||
parameter in MDI
|
||||
command</property>
|
||||
<property name="related-action">hal_action_mdi1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/mdi-command-example/whoareyou.demo
Executable file
7
configs/apps/gladevcp/mdi-command-example/whoareyou.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo ./whoareyou.ui
|
||||
21
configs/apps/gladevcp/mdi-command-example/whoareyou.ui
Normal file
21
configs/apps/gladevcp/mdi-command-example/whoareyou.ui
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="EMC_Action_MDI" id="hal_action_mdi1">
|
||||
<property name="command">(MSG, "Hi, I'm an EMC_Action_MDI")</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">Who are you?</property>
|
||||
<property name="related-action">hal_action_mdi1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
10
configs/apps/gladevcp/simple-callback/README
Normal file
10
configs/apps/gladevcp/simple-callback/README
Normal file
@@ -0,0 +1,10 @@
|
||||
example demonstrating a simple user-defined callback
|
||||
-----------------------------------------------------
|
||||
|
||||
callback.py defines as on_button_press() function which is connected to the widget tree as an event handler.
|
||||
See the glade Signals tab for hal_button1 how it is referred to.
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
$ gladevcp -u simplecallback.py simplecallback.ui
|
||||
7
configs/apps/gladevcp/simple-callback/simple-callback.demo
Executable file
7
configs/apps/gladevcp/simple-callback/simple-callback.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./simplecallback.py ./simplecallback.ui
|
||||
8
configs/apps/gladevcp/simple-callback/simplecallback.py
Normal file
8
configs/apps/gladevcp/simple-callback/simplecallback.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
nhits = 0
|
||||
|
||||
def on_button_press(gtkobj,data=None):
|
||||
global nhits
|
||||
nhits += 1
|
||||
print ("on_button_press callback")
|
||||
gtkobj.set_label("hits: %d" % nhits)
|
||||
61
configs/apps/gladevcp/simple-callback/simplecallback.ui
Normal file
61
configs/apps/gladevcp/simple-callback/simplecallback.ui
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">200</property>
|
||||
<property name="default-height">150</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">Press me!</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_button_press" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">label</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HBar" id="hal_hbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="bg-color">#bebebebebebe</property>
|
||||
<property name="max">10</property>
|
||||
<property name="z0-border">0.6000000238418579</property>
|
||||
<property name="z0-color">#0000ffff0000</property>
|
||||
<property name="z1-border">0.8000000119209289</property>
|
||||
<property name="z1-color">#ffffffff0000</property>
|
||||
<property name="z2-color">#ffff00000000</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
29
configs/apps/gladevcp/templates/README
Normal file
29
configs/apps/gladevcp/templates/README
Normal file
@@ -0,0 +1,29 @@
|
||||
These are example gladevcp handler classes to start your own.
|
||||
|
||||
------------------------------------------
|
||||
To run independently:
|
||||
|
||||
$ gladevcp -u functionhandler.py button.ui
|
||||
$ gladevcp -u classhandler.py button.ui
|
||||
$ gladevcp -u classhandler_persistent.py -U debug=2 -U "print 'debug=%d' % debug" button.ui
|
||||
|
||||
NB: button.ui has really no interesting widget state to restore.
|
||||
|
||||
have a look at classhandler_persistent.ini to get an
|
||||
idea how the persistent state is saved. It should look roughly like this:
|
||||
|
||||
# generated by gladevcp.util.create_default_ini() on Wed Dec 8 12:27:13 2010
|
||||
[ini]
|
||||
version = 1
|
||||
signature = be44d45a0e07d57cfbe8915d668e8d3b399a4cdb
|
||||
[vars]
|
||||
abool = True
|
||||
afloat = 1.67
|
||||
anint = 42
|
||||
astring = sometext
|
||||
[widgets]
|
||||
# last update by gladevcp.util.save_state() on Wed Dec 8 12:31:20 2010
|
||||
|
||||
|
||||
|
||||
-Michael Haberler 12/2010
|
||||
113
configs/apps/gladevcp/templates/button.ui
Normal file
113
configs/apps/gladevcp/templates/button.ui
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<requires lib="gladevcp" version="0.0"/>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">0.10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">0.10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment3">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">0.10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment4">
|
||||
<property name="upper">100</property>
|
||||
<property name="step-increment">0.10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can-focus">False</property>
|
||||
<signal name="destroy" handler="on_destroy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="HAL_Button" id="hal_button1">
|
||||
<property name="label" translatable="yes">not much here -
|
||||
but press me anyway</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<signal name="pressed" handler="on_button_press" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_SpinButton" id="hal_spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<property name="digits">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HAL_HScale" id="hal_hscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="spinbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="invisible-char">●</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="digits">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHScale" id="hscale1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="adjustment">adjustment4</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="togglebutton1">
|
||||
<property name="label" translatable="yes">togglebutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
7
configs/apps/gladevcp/templates/classhandler.demo
Executable file
7
configs/apps/gladevcp/templates/classhandler.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./classhandler.py ./button.ui
|
||||
60
configs/apps/gladevcp/templates/classhandler.py
Normal file
60
configs/apps/gladevcp/templates/classhandler.py
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: sts=4 sw=4 et
|
||||
# This is a component of LinuxCNC
|
||||
# classhandler.py Copyright 2010 Michael Haberler
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
'''
|
||||
example gladevcp handler class to start your own
|
||||
no persistence support
|
||||
'''
|
||||
|
||||
import gi
|
||||
from gi.repository import GLib
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
|
||||
def on_button_press(self,widget,data=None):
|
||||
print("on_button_press")
|
||||
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
print("on_destroy")
|
||||
|
||||
|
||||
def _on_timer_tick(self,userdata=None):
|
||||
print("timer tick")
|
||||
return True
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
self.useropts = useropts
|
||||
|
||||
# demonstrate a slow background timer - granularity is one second
|
||||
# for a faster timer, use this:
|
||||
# glib.timeout_add(5000, self._on_timer_tick)
|
||||
GLib.timeout_add_seconds(1, self._on_timer_tick)
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
7
configs/apps/gladevcp/templates/classhandler_persistent.demo_notworking
Executable file
7
configs/apps/gladevcp/templates/classhandler_persistent.demo_notworking
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./classhandler_persistent.py -U debug=2 -U "print 'debug=%d' % debug" ./button.ui
|
||||
93
configs/apps/gladevcp/templates/classhandler_persistent.py
Normal file
93
configs/apps/gladevcp/templates/classhandler_persistent.py
Normal file
@@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim: sts=4 sw=4 et
|
||||
# This is a component of LinuxCNC
|
||||
# classhandler_persistent.py Copyright 2010 Michael Haberler
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
'''
|
||||
example gladevcp handler class with widget and attribute persistence support
|
||||
'''
|
||||
|
||||
from gladevcp.persistence import IniFile,widget_defaults,set_debug,select_widgets
|
||||
|
||||
debug = 0
|
||||
|
||||
class HandlerClass:
|
||||
|
||||
def on_button_press(self,widget,data=None):
|
||||
print("on_button_press")
|
||||
self.anint += 1
|
||||
# show retained attributes as inifile and current values
|
||||
print("attr\tini\tcurrent")
|
||||
for k in list(self.defaults[IniFile.vars].keys()):
|
||||
print("%s\t%s\t%s" % (k,self.defaults[IniFile.vars][k],getattr(self,k,None)))
|
||||
|
||||
def on_destroy(self,obj,data=None):
|
||||
'''
|
||||
save state on application exit
|
||||
'''
|
||||
print("on_destroy() - saving state")
|
||||
self.ini.save_state(self)
|
||||
|
||||
def on_restore_defaults(self,button,data=None):
|
||||
'''
|
||||
example callback for 'Reset to defaults' button (unused)
|
||||
'''
|
||||
print("on_restore_defaults() - setting default state")
|
||||
self.ini.create_default_ini()
|
||||
self.ini.restore_state(self)
|
||||
|
||||
|
||||
def __init__(self, halcomp,builder,useropts):
|
||||
self.halcomp = halcomp
|
||||
self.builder = builder
|
||||
self.useropts = useropts
|
||||
|
||||
# use the module basename for the ini file:
|
||||
self.ini_filename = __name__ + '.save'
|
||||
|
||||
# choose widgets and attributes to be retained here:
|
||||
|
||||
# this descriptor will not retain any attrbuts,
|
||||
# but the state of all widgets (HAL widgets and Gtk widgets
|
||||
# (subject to widget types supported by gladevcp.persistence.accessors())
|
||||
#self.defaults = { IniFile.vars: dict(),
|
||||
# IniFile.widgets : widget_defaults(<widgetlist>)
|
||||
# }
|
||||
|
||||
# this descriptor will retain the listed attributes, and only
|
||||
# HAL widgets state:
|
||||
self.defaults = { IniFile.vars: { 'afloat' : 1.67, 'anint' : 42, 'abool' : True, 'astring': 'sometext' },
|
||||
IniFile.widgets : widget_defaults(select_widgets(self.builder.get_objects(), hal_only=False,output_only = False))
|
||||
}
|
||||
|
||||
self.ini = IniFile(self.ini_filename,self.defaults, self.builder)
|
||||
|
||||
# it is OK to use self.panel.widgets (all widgets) here because only
|
||||
# widgets whose state was saved as per descriptor will be restored
|
||||
self.ini.restore_state(self)
|
||||
|
||||
|
||||
def get_handlers(halcomp,builder,useropts):
|
||||
|
||||
global debug
|
||||
for cmd in useropts:
|
||||
exec(cmd, globals())
|
||||
|
||||
# get some detail what save/restore etc are doing
|
||||
set_debug(debug)
|
||||
|
||||
return [HandlerClass(halcomp,builder,useropts)]
|
||||
7
configs/apps/gladevcp/templates/functionhandler.demo
Executable file
7
configs/apps/gladevcp/templates/functionhandler.demo
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
cd "$thisdir" || { echo "E: Could not change directory to '$thisdir'"; exit 1; }
|
||||
|
||||
gladevcp_demo -u ./functionhandler.py ./button.ui
|
||||
9
configs/apps/gladevcp/templates/functionhandler.py
Normal file
9
configs/apps/gladevcp/templates/functionhandler.py
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
def on_button_press(button,data=None):
|
||||
print ("button pressed")
|
||||
|
||||
|
||||
def on_destroy(object,data=None):
|
||||
print ("on_destroy")
|
||||
|
||||
8
configs/apps/halrun/README
Normal file
8
configs/apps/halrun/README
Normal file
@@ -0,0 +1,8 @@
|
||||
halrun:
|
||||
|
||||
Start halrun in an xterm
|
||||
First command 'help' shows commands
|
||||
|
||||
Note:
|
||||
Linuxcnc must not be running
|
||||
Any other instance of halrun is terminated.
|
||||
67
configs/apps/halrun/halrun.demo
Executable file
67
configs/apps/halrun/halrun.demo
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
prog=$(basename "$0")
|
||||
thisfile=$(readlink -f "$0")
|
||||
thisdir=$(dirname "$thisfile")
|
||||
HALFILE="$thisdir"/help.hal
|
||||
|
||||
# Don't care if cd succeeds. Just so user can use halcmd 'save' to create a file in $HOME
|
||||
cd || true
|
||||
|
||||
function popup () {
|
||||
msg="$*"
|
||||
wish <<EOF &
|
||||
wm withdraw .
|
||||
tk_messageBox \
|
||||
-title "$prog" \
|
||||
-message "$msg" \
|
||||
-icon error \
|
||||
-type ok
|
||||
destroy .
|
||||
EOF
|
||||
} ;# popup
|
||||
|
||||
|
||||
[ "$TERM" = "dumb" ] && TERM=xterm
|
||||
[ -x "$(which "$COLORTERM")" ] && TERM=$COLORTERM
|
||||
[ -z "$TERM" ] && TERM=xterm
|
||||
|
||||
# wip: xterm is well-behaved, some other terminals are not
|
||||
# for now: force to xterm
|
||||
TERM=xterm
|
||||
|
||||
REALTIME=$(linuxcnc_var REALTIME)
|
||||
# make sure TERM uses the expected halrun (rip or install)
|
||||
HALRUN=$(which halrun)
|
||||
|
||||
if [ -n "$debug" ] ; then
|
||||
echo "COLORTERM=$COLORTERM"
|
||||
echo "TERM=$TERM"
|
||||
echo "HALRUN=$HALRUN"
|
||||
echo "REALTIME=$REALTIME"
|
||||
fi
|
||||
|
||||
if $REALTIME status >/dev/null ; then
|
||||
msg="$prog: LinuxCNC is active"
|
||||
echo "$msg"
|
||||
popup "$msg"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# terminate any other halrun instance:
|
||||
$HALRUN -U >/dev/null 2>&1
|
||||
|
||||
if [ "$TERM" = "xterm" ] ; then
|
||||
$TERM -geometry 80x40 \
|
||||
-sb \
|
||||
-fg black -bg ivory2 \
|
||||
-title "halrun (Use Ctrl-L-button, Ctrl_R-button for xterm options)" \
|
||||
-e "echo Working_Directory=$(pwd);echo; $HALRUN -I $HALFILE"
|
||||
else
|
||||
$TERM -e "$HALRUN -I $HALFILE"
|
||||
fi
|
||||
|
||||
# cleanup
|
||||
halrun -U >/dev/null 2>&1
|
||||
exit 0
|
||||
5
configs/apps/halrun/help.hal
Normal file
5
configs/apps/halrun/help.hal
Normal file
@@ -0,0 +1,5 @@
|
||||
# help.hal: for use with halrun.demo
|
||||
# execute help statement to show commands
|
||||
# before going interactive
|
||||
|
||||
help
|
||||
4
configs/apps/halrun/nodemocopy
Normal file
4
configs/apps/halrun/nodemocopy
Normal file
@@ -0,0 +1,4 @@
|
||||
nodemocopy
|
||||
.demo files in this dir will not be copied to user dir.
|
||||
Los archivos .demo en este directorio no se copiaran al directorio de usuario.
|
||||
|
||||
3
configs/apps/info.demo
Executable file
3
configs/apps/info.demo
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
linuxcnc_info
|
||||
9
configs/apps/info.txt
Normal file
9
configs/apps/info.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
info: Create a file with information about LinuxCNC and important system items.
|
||||
|
||||
The file is created in /tmp and is suitable for posting for aid in diagnosing problems.
|
||||
|
||||
Filename: /tmp/linuxcnc.info
|
||||
|
||||
The editor specified by $VISUAL will be used to open the file.
|
||||
If $VISUAL is not set, other common editors will be tried.
|
||||
|
||||
9
configs/apps/info_es.txt
Normal file
9
configs/apps/info_es.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
info: crea un archivo con información sobre LinuxCNC y elementos importantes del sistema.
|
||||
|
||||
El archivo se crea en /tmp y es adecuado para su publicación como ayuda para diagnosticar problemas.
|
||||
|
||||
Nombre de archivo: /tmp/linuxcnc.info
|
||||
|
||||
El editor especificado por $VISUAL se utilizará para abrir el archivo.
|
||||
Si $VISUAL no está establecido, se intentarán otros editores comunes.
|
||||
|
||||
15
configs/apps/latency/README
Normal file
15
configs/apps/latency/README
Normal file
@@ -0,0 +1,15 @@
|
||||
Latency evaluation programs
|
||||
|
||||
latency-histogram-1 -- Histogram jitter for a single servo thread
|
||||
|
||||
latency-histogram -- Histogram jitter for default base and servo threads
|
||||
|
||||
latency-plot -- Plot latencies for default base and servo threads
|
||||
|
||||
latency-test -- Standard test for linuxcnc
|
||||
|
||||
Note: The latency-plot and latency-histogram programs can be run from a terminal command line with more options, for help use:
|
||||
|
||||
latency-plot --help
|
||||
latency-histogram --help
|
||||
|
||||
8
configs/apps/latency/latency-histogram-1.demo
Executable file
8
configs/apps/latency/latency-histogram-1.demo
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
latency-histogram \
|
||||
--nobase \
|
||||
--show \
|
||||
--sbinsize 1000 \
|
||||
--sbins 200 \
|
||||
|
||||
3
configs/apps/latency/latency-histogram.demo
Executable file
3
configs/apps/latency/latency-histogram.demo
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
latency-histogram --show
|
||||
3
configs/apps/latency/latency-plot.demo
Executable file
3
configs/apps/latency/latency-plot.demo
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
latency-plot
|
||||
3
configs/apps/latency/latency-test.demo
Executable file
3
configs/apps/latency/latency-test.demo
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
latency-test
|
||||
3
configs/apps/latency/nodemocopy
Normal file
3
configs/apps/latency/nodemocopy
Normal file
@@ -0,0 +1,3 @@
|
||||
nodemocopy
|
||||
.demo files in this dir will not be copied to user dir.
|
||||
Los archivos .demo en este directorio no se copiaran al directorio de usuario.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user