sozi-12.05.orig/ 0000755 0000000 0000000 00000000000 11765605665 012163 5 ustar root root sozi-12.05.orig/CMakeLists.txt 0000664 0000000 0000000 00000003003 11752172636 014712 0 ustar root root CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(sozi)
################################################################################
### Compute the sozi version with the current date
################################################################################
IF (WIN32)
# FIXME
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE SOZI_VERSION)
STRING(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" SOZI_VERSION ${SOZI_VERSION})
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%y.%m-%d%H%M%S" OUTPUT_VARIABLE SOZI_VERSION)
STRING(REPLACE "\n" "" SOZI_VERSION ${SOZI_VERSION})
ELSE (WIN32)
MESSAGE(SEND_ERROR "date not implemented")
SET(SOZI_VERSION 000000)
ENDIF (WIN32)
#MESSAGE(STATUS "SOZI_VERSION=${SOZI_VERSION}")
################################################################################
### Recurse to subfolders
################################################################################
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(player)
ADD_SUBDIRECTORY(editors)
################################################################################
### Packaging
################################################################################
SET(CPACK_PACKAGE_NAME "sozi")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sozi is a zooming presentation program")
SET(CPACK_PACKAGE_VERSION "${SOZI_VERSION}")
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
SET(CPACK_COMPONENTS_GROUPING "IGNORE")
INCLUDE(CPack)
sozi-12.05.orig/Makefile 0000664 0000000 0000000 00000003704 11752172636 013622 0 ustar root root
VERSION := $(shell date +%y.%m-%d%H%M%S)
PLAYER_JS := $(wildcard player/js/*.js)
EXTRAS_JS := $(wildcard player/extras/*.js)
#MINIFY_OPT += --nomunge
JUICER_OPT += --force
JUICER_OPT += --skip-verification
# JUICER_OPT += --minifyer none
MINIFY := juicer merge $(JUICER_OPT) --arguments "$(MINIFY_OPT)"
SRC := \
$(wildcard editors/inkscape/*.py) \
$(wildcard editors/inkscape/extras/*.py) \
$(wildcard editors/inkscape/*.inx) \
$(wildcard editors/inkscape/*.png) \
$(wildcard editors/inkscape/extras/*.inx) \
$(wildcard doc/install*.html) \
$(wildcard doc/*license.txt) \
$(wildcard player/js/extras/*.js) \
player/js/sozi.js \
player/css/sozi.css
TARGET := $(addprefix release/, $(notdir $(SRC)))
INSTALL_DIR := $(HOME)/.config/inkscape/extensions
TIMESTAMP := release/sozi-timestamp-$(VERSION)
.PHONY: zip verify minify install timestamp clean
all: zip
zip: release/sozi-release-$(VERSION).zip
verify: $(PLAYER_JS) $(EXTRAS_JS)
juicer verify $^
minify: release/sozi.js release/sozi.css
install: $(TARGET)
cp release/*.inx $(INSTALL_DIR)
cp release/*.py $(INSTALL_DIR)
cp release/*.js $(INSTALL_DIR)
cp release/*.css $(INSTALL_DIR)
cp release/*.svg $(INSTALL_DIR)
timestamp: release/sozi-timestamp-$(VERSION)
$(TIMESTAMP):
touch $@
release/sozi-release-$(VERSION).zip: $(TARGET)
cd release ; zip $(notdir $@) $(notdir $^)
release/sozi.js: $(PLAYER_JS)
$(MINIFY) --output $@ player/js/sozi.js
release/%.css: player/css/%.css
$(MINIFY) --output $@ $<
release/%.js: player/js/extras/%.js
$(MINIFY) --output $@ $<
release/%.py: editors/inkscape/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%.py: editors/inkscape/extras/%.py $(TIMESTAMP)
sed "s/{{SOZI_VERSION}}/$(VERSION)/g" $< > $@
release/%.inx: editors/inkscape/%.inx
cp $< $@
release/%.inx: editors/inkscape/extras/%.inx
cp $< $@
release/%.png: editors/inkscape/%.png
cp $< $@
release/%: doc/%
cp $< $@
clean:
rm -f $(TARGET) release/sozi-timestamp-*
sozi-12.05.orig/README 0000664 0000000 0000000 00000000272 11752172636 013037 0 ustar root root
Sozi is a presentation tool using the SVG standard.
Sozi is delivered as an extension for the SVG editor Inkscape.
Installation and licensing details are provided in the doc/ folder.
sozi-12.05.orig/doc/ 0000775 0000000 0000000 00000000000 11752172636 012723 5 ustar root root sozi-12.05.orig/doc/CMakeLists.txt 0000664 0000000 0000000 00000000521 11752172636 015461 0 ustar root root SET(sozi_doc_files ${CMAKE_CURRENT_SOURCE_DIR}/GPL-license.txt
${CMAKE_CURRENT_SOURCE_DIR}/MIT-license.txt
${PROJECT_SOURCE_DIR}/README)
### Hugly hack
SET(sozi_doc_files ${sozi_doc_files} PARENT_SCOPE)
INSTALL(FILES ${sozi_doc_files}
DESTINATION share/doc/sozi
COMPONENT doc)
sozi-12.05.orig/doc/GPL-license.txt 0000664 0000000 0000000 00000104513 11752172636 015532 0 ustar root root GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
sozi-12.05.orig/doc/MIT-license.txt 0000664 0000000 0000000 00000002102 11752172636 015530 0 ustar root root Copyright (c) 2012 Guillaume Savaton, http://senshu.baierouge.fr
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sozi-12.05.orig/doc/install-en.html 0000664 0000000 0000000 00000010252 11752172636 015657 0 ustar root root
en:install
First install Inkscape
and PyGTK using the package
manager of your distribution.
Copy all files whose names begin with "sozi" from the
archive sozi-release-[...].zip into one of these folders:
the extensions folder for all users
(/usr/share/inkscape/extensions/)
or your personal inkscape extensions folder
(~/.config/inkscape/extensions)
If you are updating from version 10.x, you should also remove
files sozi_install.inx, sozi_install.py, sozi_edit_frame.inx and
sozi_edit_frame.py from the installation folder.
Start or relaunch Inkscape.
You should now see a submenu “Sozi” in the “Extensions” menu.
Copy all files from C:\Python26 to C:\Program Files\Inkscape\python.
Copy all files whose names begin with "sozi" from the
archive sozi-release-[...].zip into
C:\Program Files\Inkscape\share\extensions.
If you are updating from version 10.x, you should also remove
files sozi_install.inx, sozi_install.py, sozi_edit_frame.inx and
sozi_edit_frame.py from the installation folder.
Start or relaunch Inkscape.
You should now see a submenu “Sozi” in the “Extensions” menu.
Currently, the most straightforward way to install
Inkscape and Sozi on MacOS X
consists in using the Fink
distribution. However, the complete installation process can take
several hours.
Install Fink. During the
setup process, enable the “unstable” tree.
Install Inkscape, lxml and PyGTK by typing the following command
in a terminal window:
Copy all files whose names begin with "sozi" from the
archive sozi-release-[...].zip into /sw/share/inkscape/extensions.
If you are updating from version 10.x, you should also remove files
sozi_install.inx, sozi_install.py, sozi_edit_frame.inx and
sozi_edit_frame.py from the installation folder.
Start or relaunch Inkscape (using the command line).
You should now see a submenu “Sozi” in the “Extensions” menu.
Vous devez d'abord installer Inkscape
et PyGTK en utilisant le gestionnaire
de paquets de votre distribution.
Parmi les fichiers provenant de l'archive sozi-release-[...].zip,
copiez ceux dont le nom commence par "sozi" dans
l'un des dossiers suivants :
dans le dossier des extensions disponibles pour tous les
utilisateurs (/usr/share/inkscape/extensions/)
ou dans votre dossier personnel
(~/.config/inkscape/extensions)
Si vous mettez à jour à partir d'une version 10.x, vous devez
supprimer les fichiers sozi_install.inx, sozi_install.py,
sozi_edit_frame.inx et sozi_edit_frame.py déjà présents dans le
dossier d'installation.
Démarrez ou relancez l'application Inkscape.
Vous devez voir apparaître un sous-menu “Sozi” dans le menu
“Extensions”.
Copiez tous les fichiers du dossier C:\Python26 vers
C:\Program Files\Inkscape\python.
Parmi les fichiers provenant de l'archive sozi-release-[...].zip,
copiez ceux dont le nom commence par "sozi" dans
le dossier C:\Program Files\Inkscape\share\extensions.
Si vous mettez à jour à partir d'une version 10.x, vous devez
supprimer les fichiers sozi_install.inx, sozi_install.py,
sozi_edit_frame.inx et sozi_edit_frame.py déjà présents dans le
dossier d'installation.
Démarrez ou relancez l'application Inkscape.
Vous devez voir apparaître un sous-menu “Sozi” dans le menu “Extensions”.
Pour le moment, la manière la plus “directe” d'installer Inkscape et
Sozi sous MacOS X consiste à utiliser la distribution
Fink. L'installation
complète peut prendre plusieurs heures.
Installez Fink en
activant l'utilisation de la branche “unstable”.
Installez Inkscape, lxml et PyGTK en entrant la commande
ci-dessous dans un terminal.
Parmi les fichiers provenant de l'archive sozi-release-[...].zip,
copiez ceux dont le nom commence par "sozi" dans
le dossier /sw/share/inkscape/extensions.
Si vous mettez à jour à partir d'une version 10.x, vous devez supprimer
les fichiers sozi_install.inx, sozi_install.py, sozi_edit_frame.inx et
sozi_edit_frame.py déjà présents dans le dossier d'installation.
Démarrez ou relancez Inkscape (en ligne de commande).
Vous devez voir apparaître un sous-menu “Sozi” dans le menu “Extensions”.
sozi-12.05.orig/doc/logo.svg 0000664 0000000 0000000 00000022422 11752172636 014406 0 ustar root root
sozi-12.05.orig/editors/ 0000775 0000000 0000000 00000000000 11765605666 013637 5 ustar root root sozi-12.05.orig/editors/CMakeLists.txt 0000664 0000000 0000000 00000000034 11752172636 016364 0 ustar root root ADD_SUBDIRECTORY(inkscape)
sozi-12.05.orig/editors/inkscape/ 0000775 0000000 0000000 00000000000 11752172636 015424 5 ustar root root sozi-12.05.orig/editors/inkscape/CMakeLists.txt 0000664 0000000 0000000 00000003752 11752172636 020173 0 ustar root root ################################################################################
### The sozi.py output file contains the sozi inkscape integration
################################################################################
ADD_CUSTOM_COMMAND(
OUTPUT sozi_upgrade.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sozi_upgrade.py
COMMAND sed -e 's/{{SOZI_VERSION}}/${SOZI_VERSION}/g' ${CMAKE_CURRENT_SOURCE_DIR}/sozi_upgrade.py > sozi_upgrade.py
)
ADD_CUSTOM_COMMAND(
OUTPUT sozi_extras_addvideo_upgrade.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_addvideo_upgrade.py
COMMAND sed -e 's/{{SOZI_VERSION}}/${SOZI_VERSION}/g' ${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_addvideo_upgrade.py > sozi_extras_addvideo_upgrade.py
)
SET(sozi_inkscape_files ${CMAKE_CURRENT_SOURCE_DIR}/sozi.inx
${CMAKE_CURRENT_SOURCE_DIR}/sozi.py
${CMAKE_CURRENT_SOURCE_DIR}/sozi.py.png
${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_addvideo.inx
${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_addvideo.py
${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_upgrade.inx
${CMAKE_CURRENT_SOURCE_DIR}/extras/sozi_extras_upgrade.py
${CMAKE_CURRENT_BINARY_DIR}/sozi_upgrade.py
${CMAKE_CURRENT_BINARY_DIR}/sozi_extras_addvideo_upgrade.py)
################################################################################
### The inkscape integration files target
################################################################################
#MESSAGE(WARNING "sozi_inkscape_files=${sozi_inkscape_files} sozi_player_files=${sozi_player_files}")
ADD_CUSTOM_TARGET(sozi_inkscape ALL DEPENDS ${sozi_inkscape_files} ${sozi_player_files})
INSTALL(FILES ${sozi_inkscape_files}
${sozi_player_files}
${sozi_doc_files}
DESTINATION share/inkscape/extensions
COMPONENT inkscape_integration)
sozi-12.05.orig/editors/inkscape/extras/ 0000775 0000000 0000000 00000000000 11752172636 016732 5 ustar root root sozi-12.05.orig/editors/inkscape/extras/sozi_extras_addvideo.inx 0000664 0000000 0000000 00000003570 11752172636 023670 0 ustar root root
<_name>Add video or audio
sozi.extras.addvideoinkex.pysozi_extras_addvideo.pysozi_extras_addvideo.jsvideoaudio
640
480
video/ogg
filename.ogv
false
1
1
all
sozi-12.05.orig/editors/inkscape/extras/sozi_extras_addvideo.py 0000664 0000000 0000000 00000011365 11752172636 023523 0 ustar root root #!/usr/bin/env python
# Sozi - A presentation tool using the SVG standard
#
# Copyright (C) 2010-2012 Guillaume Savaton
#
# This program is dual licensed under the terms of the MIT license
# or the GNU General Public License (GPL) version 3.
# A copy of both licenses is provided in the doc/ folder of the
# official release of Sozi.
#
# See http://sozi.baierouge.fr/wiki/en:license for details.
# These lines are only needed if you don't put the script directly into
# the installation directory
import sys
# Unix
sys.path.append('/usr/share/inkscape/extensions')
# OS X
sys.path.append('/Applications/Inkscape.app/Contents/Resources/extensions')
# Windows
sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import sozi_extras_addvideo_upgrade
class SoziExtrasAddVideo(inkex.Effect):
NS_URI = u"http://sozi.baierouge.fr"
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option('-E', '--element', action = 'store',
type = 'string', dest = 'element', default = 'video',
help = 'Media element (video | audio)')
self.OptionParser.add_option('-W', '--width', action = 'store',
type = 'int', dest = 'width', default = 640,
help = 'Media region width')
self.OptionParser.add_option('-H', '--height', action = 'store',
type = 'int', dest = 'height', default = 480,
help = 'Media region height')
self.OptionParser.add_option('-T', '--type', action = 'store',
type = 'string', dest = 'type', default = 'video/ogg',
help = 'Media MIME type')
self.OptionParser.add_option('-S', '--src', action = 'store',
type = 'string', dest = 'src', default = '',
help = 'Media file name')
self.OptionParser.add_option('-A', '--auto', action = 'store',
type = 'string', dest = 'auto', default = 'false',
help = 'Play automatically in Sozi frame')
self.OptionParser.add_option('-F', '--start-frame', action = 'store',
type = 'int', dest = 'start_frame', default = '1',
help = 'Start playing when entering frame number')
self.OptionParser.add_option('-G', '--stop-frame', action = 'store',
type = 'int', dest = 'stop_frame', default = '1',
help = 'Stop playing when entering frame number')
inkex.NSS[u"sozi"] = SoziExtrasAddVideo.NS_URI
def effect(self):
sozi_extras_addvideo_upgrade.upgrade_or_install(self)
self.add_media()
def add_media(self):
rect = None
if len(self.selected) != 0:
elt = self.selected.values()[0]
if elt.tag == inkex.addNS("g", "svg") and len(elt) > 0 and elt[0].tag == inkex.addNS("rect", "svg") and len(elt[0]) > 0 and elt[0][0].tag == inkex.addNS(self.options.element, "sozi"):
rect = elt[0]
if rect == None:
rect = inkex.etree.Element("rect")
rect.set("x", "0")
rect.set("y", "0")
rect.set("width", unicode(self.options.width))
rect.set("height", unicode(self.options.height))
rect.set("stroke", "none")
rect.set("fill", "#aaa")
g = inkex.etree.Element("g")
g.append(rect)
self.document.getroot().append(g)
v = inkex.etree.Element(inkex.addNS(self.options.element, "sozi"))
v.set(inkex.addNS("type", "sozi"), unicode(self.options.type))
v.set(inkex.addNS("src", "sozi"), unicode(self.options.src))
if self.options.auto == "true":
start_frame = self.document.xpath("//sozi:frame[@sozi:sequence='" + unicode(self.options.start_frame) + "']", namespaces=inkex.NSS)
stop_frame = self.document.xpath("//sozi:frame[@sozi:sequence='" + unicode(self.options.stop_frame) + "']", namespaces=inkex.NSS)
if len(start_frame) == 0:
sys.stderr.write("The start frame does not exist in this Sozi presentation.\n")
exit()
elif len(stop_frame) == 0:
sys.stderr.write("The stop frame does not exist in this Sozi presentation.\n")
exit()
elif "id" in start_frame[0].attrib and "id" in stop_frame[0].attrib:
v.set(inkex.addNS("start-frame", "sozi"), unicode(start_frame[0].attrib["id"]))
v.set(inkex.addNS("stop-frame", "sozi"), unicode(stop_frame[0].attrib["id"]))
else:
sys.stderr.write("The chosen frames are not compatible with this version of Sozi. Please run Sozi to upgrade your document.\n")
exit()
rect.append(v)
# Create effect instance
effect = SoziExtrasAddVideo()
effect.affect()
sozi-12.05.orig/editors/inkscape/extras/sozi_extras_addvideo_upgrade.py 0000664 0000000 0000000 00000006662 11752172636 025236 0 ustar root root
import os
import sys
import inkex
SOZI_VERSION = "{{SOZI_VERSION}}"
def upgrade_or_install(context):
upgrade_or_install_element(context, "script", "js")
upgrade_document(context)
def upgrade_or_install_element(context, tag, ext):
# Check version and remove older versions
latest_version_found = False
for elt in context.document.xpath("//svg:" + tag + "[@id='sozi-extras-addvideo-" + tag + "']", namespaces=inkex.NSS):
version_attr = inkex.addNS("version", "sozi")
if version_attr in elt.attrib:
version = elt.attrib[version_attr]
else:
version = "0"
if version == SOZI_VERSION:
latest_version_found = True
elif version < SOZI_VERSION:
elt.getparent().remove(elt)
else:
sys.stderr.write("Document has been created using a higher version of Sozi. Please upgrade the Inkscape plugin.\n")
exit()
# Create new element if needed
if not latest_version_found:
elt = inkex.etree.Element(inkex.addNS(tag, "svg"))
elt.text = open(os.path.join(os.path.dirname(__file__), "sozi_extras_addvideo." + ext)).read()
elt.set("id","sozi-extras-addvideo-" + tag)
elt.set(inkex.addNS("version", "sozi"), SOZI_VERSION)
context.document.getroot().append(elt)
def upgrade_document(context):
# Upgrade from 11.10
frame_count = len(context.document.xpath("//sozi:frame", namespaces=inkex.NSS))
# For each video element in the document
for velt in context.document.xpath("//sozi:video", namespaces=inkex.NSS):
# Get the Sozi frame index for the current video if it is set
frame_index = None
if "frame" in velt.attrib:
frame_index = velt.attrib["frame"]
del velt.attrib["frame"]
# If the video was set to start automatically and has a frame index set
if "auto" in velt.attrib:
if velt.attrib["auto"] == "true" and frame_index is not None:
# Get the frame element at the given index
felt = context.document.xpath("//sozi:frame[@sozi:sequence='" + frame_index + "']", namespaces=inkex.NSS)
if len(felt) > 0:
# Use the ID of that frame to start the video
velt.set(inkex.addNS("start-frame", "sozi"), felt[0].attrib["id"])
# Get the next frame element
# We assume that the frames are correctly numbered
if int(frame_index) >= frame_count:
frame_index = "1"
else:
frame_index = unicode(int(frame_index) + 1)
felt = context.document.xpath("//sozi:frame[@sozi:sequence='" + frame_index + "']", namespaces=inkex.NSS)
if len(felt) > 0:
# Use the ID of that frame to stop the video
velt.set(inkex.addNS("stop-frame", "sozi"), felt[0].attrib["id"])
del velt.attrib["auto"]
# If the video has attributes "type" and "src" with no namespace, add Sozi namespace
if "type" in velt.attrib:
velt.set(inkex.addNS("type", "sozi"), velt.attrib["type"])
del velt.attrib["type"]
if "src" in velt.attrib:
velt.set(inkex.addNS("src", "sozi"), velt.attrib["src"])
del velt.attrib["src"]
sozi-12.05.orig/editors/inkscape/extras/sozi_extras_upgrade.inx 0000664 0000000 0000000 00000002217 11752172636 023535 0 ustar root root
<_name>Upgrade
sozi.extras.upgradeinkex.pysozi_extras_upgrade.pysozi.pysozi_extras_addvideo.pyall
sozi-12.05.orig/editors/inkscape/extras/sozi_extras_upgrade.py 0000664 0000000 0000000 00000002372 11752172636 023371 0 ustar root root #!/usr/bin/env python
# Sozi - A presentation tool using the SVG standard
#
# Copyright (C) 2010-2012 Guillaume Savaton
#
# This program is dual licensed under the terms of the MIT license
# or the GNU General Public License (GPL) version 3.
# A copy of both licenses is provided in the doc/ folder of the
# official release of Sozi.
#
# See http://sozi.baierouge.fr/wiki/en:license for details.
# These lines are only needed if you don't put the script directly into
# the installation directory
import sys
# Unix
sys.path.append('/usr/share/inkscape/extensions')
# OS X
sys.path.append('/Applications/Inkscape.app/Contents/Resources/extensions')
# Windows
sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import sozi_upgrade
import sozi_extras_addvideo_upgrade
class SoziExtrasUpgrade(inkex.Effect):
NS_URI = u"http://sozi.baierouge.fr"
def __init__(self):
inkex.Effect.__init__(self)
inkex.NSS[u"sozi"] = SoziExtrasUpgrade.NS_URI
def effect(self):
sozi_upgrade.upgrade_or_install(self)
sozi_extras_addvideo_upgrade.upgrade_or_install(self)
# Create effect instance
effect = SoziExtrasUpgrade()
effect.affect()
sozi-12.05.orig/editors/inkscape/sozi.inx 0000664 0000000 0000000 00000001670 11752172636 017134 0 ustar root root
<_name>Sozi
soziinkex.pysozi.pysozi.jsall
sozi-12.05.orig/editors/inkscape/sozi.py 0000664 0000000 0000000 00000117626 11752172636 016777 0 ustar root root #!/usr/bin/env python2
# Sozi - A presentation tool using the SVG standard
#
# Copyright (C) 2010-2012 Guillaume Savaton
#
# This program is dual licensed under the terms of the MIT license
# or the GNU General Public License (GPL) version 3.
# A copy of both licenses is provided in the doc/ folder of the
# official release of Sozi.
#
# See http://sozi.baierouge.fr/wiki/en:license for details.
# These lines are only needed if you don't put the script directly into
# the installation directory
import sys
# Unix
sys.path.append('/usr/share/inkscape/extensions')
# OS X
sys.path.append('/Applications/Inkscape.app/Contents/Resources/extensions')
# Windows
sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import pygtk
pygtk.require("2.0")
import gtk
import re
import sozi_upgrade
class SoziField:
"""
A field is a wrapper for a GTK input control mapped to a Sozi frame attribute.
Provide a subclass of SoziField for each type of GTK control.
"""
def __init__(self, parent, attr, label, container_widget, input_widget, default_value, focus_events=True):
"""
Initialize a new field.
- parent: the UI object that contains the current field
- attr: the frame attribute that corresponds to the current field
- label: the human-readable text that describes the current field
- container_widget: the GTK widget that will contain the current field
- input_widget: the GTK input control for the current field
- default_value: the default value of the current field
- focus_events: True if the GTK input control handles focus events, False otherwise
"""
self.parent = parent
self.ns_attr = inkex.addNS(attr, "sozi")
self.label = label
self.container_widget = container_widget
self.input_widget = input_widget
self.default_value = unicode(default_value)
if focus_events:
self.input_widget.connect("focus-out-event", self.on_focus_out)
else:
self.input_widget.connect("changed", self.on_focus_out)
self.last_value = None
self.current_frame = None
def set_value(self, value):
"""
Fill the GTK control for the current field with the given value.
The value must be provided as a string.
Implemented by subclasses.
"""
pass
def get_value(self):
"""
Return the value of the GTK control for the current field.
The value is returned as a string.
Implemented by subclasses.
"""
pass
def reset_last_value(self):
self.last_value = self.get_value()
def write_if_needed(self):
"""
Write the value of the current field to the SVG document.
This operation is performed if all these conditions are met:
- the current field shows a property of an existing frame
- this frame has not been removed from the document
- the value of the current field has changed since it was last written
The write operation is delegated to a SoziFieldAction object.
"""
if self.current_frame is not None and self.current_frame in self.parent.effect.frames and self.last_value != self.get_value():
self.parent.do_action(SoziFieldAction(self))
self.reset_last_value()
def set_with_frame(self, frame):
"""
Set the value of the current field with the corresponding attribute of the given frame.
If frame is None, the field is filled with its default value and edition is inhibited.
The previous value of the field is written to the document if needed.
"""
self.write_if_needed()
self.current_frame = frame
if frame is not None and self.ns_attr in frame["frame_element"].attrib:
self.last_value = frame["frame_element"].attrib[self.ns_attr]
else:
self.last_value = self.default_value
self.set_value(self.last_value)
self.input_widget.set_sensitive(frame is not None)
def on_focus_out(self, widget, event=None):
"""
Event handler, called each time the current field loses focus.
"""
self.write_if_needed()
class SoziTextField(SoziField):
"""
A wrapper for a GTK Entry mapped to a Sozi frame attribute.
"""
def __init__(self, parent, attr, label, default_value):
"""
Initialize a new text field.
See class SoziField for initializer arguments.
"""
SoziField.__init__(self, parent, attr, label, gtk.HBox(), gtk.Entry(), default_value)
self.container_widget.add(gtk.Label(label))
self.container_widget.add(self.input_widget)
def set_value(self, value):
self.input_widget.set_text(value)
def get_value(self):
return unicode(self.input_widget.get_text())
class SoziComboField(SoziField):
"""
A wrapper for a GTK ComboBox with text items mapped to a Sozi frame attribute.
"""
def __init__(self, parent, attr, label, items, default_value):
"""
Initialize a new combo field.
- items: the list of items in the combo box
See class SoziField for other initializer arguments.
"""
SoziField.__init__(self, parent, attr, label, gtk.HBox(), gtk.combo_box_new_text(), default_value, False)
self.items = items
for text in items:
self.input_widget.append_text(text)
self.container_widget.add(gtk.Label(label))
self.container_widget.add(self.input_widget)
def set_value(self, value):
self.input_widget.set_active(self.items.index(value))
def get_value(self):
return unicode(self.items[self.input_widget.get_active()])
class SoziCheckButtonField(SoziField):
"""
A wrapper for a GTK CheckButton mapped to a Sozi frame attribute.
"""
def __init__(self, parent, attr, label, default_value):
"""
Initialize a new check button field.
See class SoziField for initializer arguments.
"""
button = gtk.CheckButton(label)
SoziField.__init__(self, parent, attr, label, button, button, default_value)
def set_value(self, value):
self.input_widget.set_active(value == "true")
def get_value(self):
return unicode("true" if self.input_widget.get_active() else "false")
class SoziSpinButtonField(SoziField):
"""
A wrapper for a GTK SpinButton mapped to a Sozi frame attribute.
"""
def __init__(self, parent, attr, label, min_value, max_value, default_value, factor=1, digits=0, increments=1):
"""
Initialize a new spin button field.
- label: label for the field
- min_value: the minimum float value for the current field
- max_value: the maximum float value for the current field
- default_value: the default_value
- factor : eg: factor 1000 -> comboBox=1.3s ; sozi_svg=1300
- decimals: number of decimals to display, eg: 2=> 1.00 or 0=> 1
- increments: step between 2 number when clic left on a arrow.
See class SoziField for other initializer arguments.
"""
factor = float(factor)
min_value = min_value * factor
max_value = max_value * factor
default_value = default_value * factor
SoziField.__init__(self, parent, attr, label, gtk.HBox(), gtk.SpinButton(digits=digits), default_value)
self.input_widget.set_range(min_value, max_value)
# def set_increments(step, page)
# step : increment applied for each left mousebutton press.
# page : increment applied for each middle mousebutton press.
self.input_widget.set_increments(increments, increments * 2)
self.input_widget.set_numeric(True)
self.container_widget.pack_start(gtk.Label(label))
self.container_widget.pack_start(self.input_widget)
self.factor = factor
def set_value(self, value):
self.input_widget.set_value(float(value) / self.factor)
def get_value(self):
return unicode(float(self.input_widget.get_value()) * self.factor)
def on_focus_out(self, widget, event=None):
self.input_widget.update()
SoziField.on_focus_out(self, widget, event)
class SoziAction:
"""
A wrapper for UI actions.
Action objects can be executed, undone and redone.
They can be stored in undo and redo stacks.
"""
def __init__(self, undo_description, redo_description):
"""
Initialize a new action.
- undo_description: a human-readable text that describes the undo action
- redo_description: a human-readable text that describes the redo action
"""
self.undo_description = undo_description
self.redo_description = redo_description
def do(self):
"""
Execute the current action.
Implemented by subclasses.
"""
pass
def undo(self):
"""
Undo the current action.
Implemented by subclasses.
"""
pass
def redo(self):
"""
Redo the current action.
The default implementation simply calls the do() method on the current action.
Override this method to provide a specific implementation.
"""
self.do()
class SoziFieldAction(SoziAction):
"""
A wrapper for a field modification action.
Executing a field action will write the field value to the SVG document.
"""
def __init__(self, field):
"""
Initialize a new field action for the given field.
The action object saves a copy of the previous and current values of the field.
"""
index = field.parent.effect.frames.index(field.current_frame)
SoziAction.__init__(self,
"Restore " + field.label + " in frame " + str(index + 1),
"Change " + field.label + " in frame " + str(index + 1)
)
self.field = field
self.frame = field.current_frame
self.last_value = field.last_value
self.value = field.get_value()
def do(self):
"""
Write the new value of the field to the current frame.
"""
self.frame["frame_element"].set(self.field.ns_attr, self.value)
def undo(self):
"""
Restore the previous value of the field in the frame and in the UI.
If needed, select the frame that was active when the field was modified.
"""
self.frame["frame_element"].set(self.field.ns_attr, self.last_value)
if self.field.current_frame is self.frame:
self.field.set_value(self.last_value)
self.field.reset_last_value()
else:
self.field.parent.select_frame(self.frame)
def redo(self):
"""
Write the new value of the field to the frame and to the UI.
If needed, select the frame that was active when the field was modified.
"""
self.do()
if self.field.current_frame is self.frame:
self.field.set_value(self.value)
self.field.reset_last_value()
else:
self.field.parent.select_frame(self.frame)
class SoziCreateAction(SoziAction):
"""
A wrapper for a frame creation action.
"""
def __init__(self, ui):
"""
Initialize a new frame creation action.
- ui: an instance of SoziUI
"""
# The new frame will be added at the end of the presentation
new_frame_number = str(len(ui.effect.frames) + 1)
SoziAction.__init__(self,
"Remove frame " + new_frame_number,
"Recreate frame " + new_frame_number)
self.ui = ui
def do(self):
"""
Create a new frame and select it in the frame list.
"""
self.ui.fill_form(None)
# The new frame is a copy of the currently selected frame
frame = self.ui.effect.create_new_frame(None)
for field in self.ui.fields.itervalues():
frame["frame_element"].set(field.ns_attr, field.get_value())
self.ui.effect.add_frame(frame)
self.ui.append_frame_title(-1)
self.ui.select_index(-1)
def undo(self):
"""
Remove the created frame and select the previously selected frame.
"""
self.ui.remove_last_frame_title()
self.ui.effect.delete_frame(-1)
class SoziDeleteAction(SoziAction):
"""
A wrapper for a frame delete action.
"""
def __init__(self, ui):
"""
Initialize a new frame delete action.
- ui: an instance of SoziUI
"""
index = ui.get_selected_index()
SoziAction.__init__(self,
"Restore frame " + str(index + 1),
"Remove frame " + str(index + 1))
self.ui = ui
self.index = index
self.frame = ui.effect.frames[index]
model = self.ui.list_view.get_model()
self.row = model.get(model.get_iter(index), 0, 1, 2)
def do(self):
"""
Remove the current frame and select the next one in the frame list.
"""
self.ui.effect.delete_frame(self.index)
self.ui.remove_frame_title(self.index)
# If the removed frame was the last, and if the frame list is not empty,
# select the last frame
if self.index > 0 and self.index >= len(self.ui.effect.frames):
self.ui.select_index(-1)
def undo(self):
"""
Add the removed frame and select it.
"""
self.ui.effect.insert_frame(self.index, self.frame)
self.ui.insert_row(self.index, self.row)
class SoziDuplicateAction(SoziAction):
"""
A wrapper for a frame creation action.
"""
def __init__(self, ui):
"""
Initialize a new frame creation action.
- ui: an instance of SoziUI
"""
# The new frame will be added at the end of the presentation
new_frame_number = str(len(ui.effect.frames) + 1)
SoziAction.__init__(self,
"Remove frame " + new_frame_number,
"Recreate frame " + new_frame_number)
self.ui = ui
# The new frame is a copy of the currently selected frame
self.index = ui.get_selected_index()
self.frame = ui.effect.create_new_frame(self.index)
for field in ui.fields.itervalues():
self.frame["frame_element"].set(field.ns_attr, field.get_value())
def do(self):
"""
Create a new frame and select it in the frame list.
"""
self.ui.effect.add_frame(self.frame)
self.ui.append_frame_title(-1)
self.ui.select_index(-1)
def undo(self):
"""
Remove the created frame and select the previously selected frame.
"""
self.ui.remove_last_frame_title()
self.ui.effect.delete_frame(-1)
if self.index is not None:
self.ui.select_index(self.index)
class SoziReorderAction(SoziAction):
"""
A wrapper for a frame reordering action.
"""
def __init__(self, ui, down):
"""
Initialize a new frame reorder action.
- ui: an instance of SoziUI
"""
index = ui.get_selected_index()
if down:
index_other = index + 1
else:
index_other = index - 1
SoziAction.__init__(self,
"Move frame " + str(index_other + 1) + (" up" if down else " down"),
"Move frame " + str(index + 1) + (" down" if down else " up"))
self.ui = ui
self.index = index
self.index_other = index_other
def move(self, first, second):
# Swap frames in the document
self.ui.effect.swap_frames(first, second)
# Swap frame numbers in current and other rows
model = self.ui.list_view.get_model()
iter_first = model.get_iter(first)
iter_second = model.get_iter(second)
model.set(iter_first, 0, second + 1)
model.set(iter_second, 0, first + 1)
# Move selected row
if first < second:
model.move_after(iter_first, iter_second)
else:
model.move_before(iter_first, iter_second)
self.ui.list_view.scroll_to_cell(second)
# Update up/down button sensitivity
self.ui.up_button.set_sensitive(second > 0)
self.ui.down_button.set_sensitive(second < len(self.ui.effect.frames) - 1)
def do(self):
"""
Swap current frame and next/previous frame.
"""
self.move(self.index, self.index_other)
def undo(self):
"""
Swap frames back.
"""
self.move(self.index_other, self.index)
self.ui.select_index(self.index)
def redo(self):
"""
Swap frames again.
"""
self.do()
self.ui.select_index(self.index_other)
class SoziUI:
"""
The user interface of Sozi.
"""
PROFILES = ["linear",
"accelerate", "strong-accelerate",
"decelerate", "strong-decelerate",
"accelerate-decelerate", "strong-accelerate-decelerate",
"decelerate-accelerate", "strong-decelerate-accelerate"]
def __init__(self, effect):
"""
Create a new window with the frame edition form.
- effect: the effect instance given by Inkscape
"""
self.effect = effect
self.undo_stack = []
self.redo_stack = []
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("destroy", self.on_destroy)
self.window.connect("key-press-event", self.on_key_press)
self.window.set_title("Sozi")
self.window.set_icon_from_file(__file__ + ".png")
self.window.set_border_width(5)
# Enable icons on stock buttons
#gtk.settings_get_default().set_long_property("gtk-button-images", True, "Sozi")
# Create fields for frame information
self.fields = {
"title": SoziTextField(self, "title", "Title", "New frame"),
"hide": SoziCheckButtonField(self, "hide", "Hide", "true"),
"clip": SoziCheckButtonField(self, "clip", "Clip", "true"),
"timeout-enable": SoziCheckButtonField(self, "timeout-enable", "Timeout enable", "false"),
"timeout-ms": SoziSpinButtonField(self, "timeout-ms", "Timeout (s)", 0, 3600, 5, factor=1000, digits=2, increments=0.2),
"transition-duration-ms": SoziSpinButtonField(self, "transition-duration-ms", "Duration (s)", 0, 3600, 1, factor=1000, digits=2, increments=0.1),
"transition-zoom-percent": SoziSpinButtonField(self, "transition-zoom-percent", "Zoom (%)", -100, 100, 0, increments=5),
"transition-profile": SoziComboField(self, "transition-profile", "Profile", SoziUI.PROFILES, SoziUI.PROFILES[0])
}
# Undo/redo widgets
self.undo_button = gtk.ToolButton(gtk.STOCK_UNDO)
self.undo_button.set_sensitive(False)
self.undo_button.set_label("Annuler")
self.undo_button.connect("clicked", self.on_undo)
self.redo_button = gtk.ToolButton(gtk.STOCK_REDO)
self.redo_button.set_sensitive(False)
self.redo_button.connect("clicked", self.on_redo)
toolBar = gtk.Toolbar()
toolBar.set_style(gtk.TOOLBAR_ICONS)
toolBar.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)
toolBar.add(self.undo_button)
toolBar.add(self.redo_button)
# Frame properties
frame_box = gtk.VBox(spacing=0)
frame_box.pack_start(self.fields["title"].container_widget, expand=False)
frame_box.pack_start(self.fields["hide"].container_widget, expand=False)
frame_box.pack_start(self.fields["clip"].container_widget, expand=False)
frame_box.pack_start(self.fields["timeout-enable"].container_widget, expand=False)
frame_box.pack_start(self.fields["timeout-ms"].container_widget, expand=False)
frame_group = gtk.Frame()
# fixme, spaces are here for set width of list..
frame_label=gtk.Label("Frame properties ")
frame_label.set_use_markup(True) # enable bold with
frame_group.set_label_widget(frame_label)
frame_group.add(frame_box)
# Transition properties
transition_box = gtk.VBox(spacing=5)
transition_box.pack_start(self.fields["transition-duration-ms"].container_widget, expand=False)
transition_box.pack_start(self.fields["transition-zoom-percent"].container_widget, expand=False)
transition_box.pack_start(self.fields["transition-profile"].container_widget, expand=False)
transition_group = gtk.Frame("Transition")
transition_label=gtk.Label("Transition ")
transition_label.set_use_markup(True) # enable bold with
transition_group.set_label_widget(transition_label)
transition_group.add(transition_box)
# Fill right pane
right_pane = gtk.VBox(spacing=5)
right_pane.pack_start(frame_group, expand=False)
right_pane.pack_start(transition_group, expand=False)
# Create frame list
list_renderer = gtk.CellRendererText()
list_renderer.set_property("background", "white")
sequence_column = gtk.TreeViewColumn("Seq.", list_renderer, text=0, foreground=2)
title_column = gtk.TreeViewColumn("Title", list_renderer, text=1, foreground=2)
store = gtk.ListStore(int, str, str)
self.list_view = gtk.TreeView(store)
self.list_view.append_column(sequence_column)
self.list_view.append_column(title_column)
list_scroll = gtk.ScrolledWindow()
list_scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
list_scroll.add(self.list_view)
selection = self.list_view.get_selection()
selection.set_mode(gtk.SELECTION_SINGLE) # TODO multiple selection
selection.set_select_function(self.on_selection_changed)
# Create "new" button
# This button is enabled only if an element is selected in Inkscape
self.new_button = gtk.ToolButton()
if len(effect.selected) > 0:
# The tooltip of the "new" button will show the tag of the SVG element
# selected in Inkscape, removing the namespace URI if present
self.new_button.set_tooltip_text("Create a new frame using the selected '" +
re.sub("{.*}", "", effect.selected.values()[0].tag) + "'")
else:
self.new_button.set_sensitive(False)
self.new_button.set_stock_id(gtk.STOCK_ADD)
self.new_button.connect("clicked", self.on_create_new_frame)
# Create "delete" and "duplicate" buttons
# These buttons are disabled until a frame is selected
self.delete_button = gtk.ToolButton()
self.delete_button.set_tooltip_text("Delete the current frame")
self.delete_button.set_stock_id(gtk.STOCK_REMOVE)
self.delete_button.connect("clicked", self.on_delete_frame)
self.delete_button.set_sensitive(False)
self.duplicate_button = gtk.ToolButton()
self.duplicate_button.set_tooltip_text("Duplicate the current frame")
self.duplicate_button.set_stock_id(gtk.STOCK_COPY)
self.duplicate_button.connect("clicked", self.on_duplicate_frame)
self.duplicate_button.set_sensitive(False)
# Create up/down buttons
# These buttons are disabled until a frame is selected
self.up_button = gtk.ToolButton()
self.up_button.set_tooltip_text("Move the current frame up")
self.up_button.set_stock_id(gtk.STOCK_GO_UP)
self.up_button.connect("clicked", self.on_move_frame_up)
self.up_button.set_sensitive(False)
self.down_button = gtk.ToolButton()
self.down_button.set_tooltip_text("Move the current frame down")
self.down_button.set_stock_id(gtk.STOCK_GO_DOWN)
self.down_button.connect("clicked", self.on_move_frame_down)
self.down_button.set_sensitive(False)
listToolBar = gtk.Toolbar()
listToolBar.set_icon_size(1)
listToolBar.add(self.new_button)
listToolBar.add(self.delete_button)
listToolBar.add(self.duplicate_button)
listToolBar.add(self.up_button)
listToolBar.add(self.down_button)
# Fill left pane
left_pane_content = gtk.VBox(spacing=0)
left_pane_content.pack_start(list_scroll, expand=True, fill=True)
left_pane_content.pack_end(listToolBar, expand=False)
list_group = gtk.Frame()
# fixme, spaces are here for set width of list..
list_frame_label=gtk.Label("Frame list ")
list_frame_label.set_use_markup(True) # enable bold with
list_group.set_label_widget(list_frame_label)
list_group.add(left_pane_content)
left_pane = list_group
hbox = gtk.HBox(spacing=5)
hbox.pack_start(left_pane)
hbox.pack_start(right_pane)
# button Bar
cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
cancel_button.set_tooltip_text("Cancel all changes and go back to Inkscape")
cancel_button.connect("clicked", self.on_full_undo)
ok_button = gtk.Button(stock=gtk.STOCK_OK)#or Apply
ok_button.set_tooltip_text("Apply changes and go back to Inkscape")
ok_button.connect("clicked", gtk.main_quit)
buttonBar = gtk.HBox(spacing=10)
buttonBar.pack_end(ok_button, False, False)
buttonBar.pack_end(cancel_button, False, False)
statusBar = gtk.Statusbar()
#statusBar.push(statusBar.getContexteId("a"),"Etat initial")
vbox = gtk.VBox(spacing=5)
vbox.pack_start(toolBar)
vbox.add(hbox)
vbox.add(buttonBar)
vbox.pack_end(statusBar)
self.window.add(vbox)
self.window.show_all()
# If an element is selected in Inkscape, and if it corresponds to
# one or more existing frames, select the first matching frame.
# If no element is selected in Inkscape, if at least one frame exists
# in the document, select the first frame.
selected_frame = None
if len(effect.selected) > 0:
for f in effect.frames:
if f["svg_element"].attrib["id"] in effect.selected:
selected_frame = f
break
elif len(effect.frames) > 0:
selected_frame = effect.frames[0]
# Fill frame list
for i in range(len(effect.frames)):
self.append_frame_title(i)
# Select current frame in frame list and fill form
if selected_frame is not None:
index = effect.frames.index(selected_frame)
self.list_view.get_selection().select_path((index,))
self.list_view.scroll_to_cell(index)
else:
self.fill_form(None)
gtk.main()
def append_frame_title(self, index):
"""
Append the title of the frame at the given index to the frame list view.
This method is used when filling the list view initially or when creating
a new frame.
"""
# A negative index is counted back from the end of the frame list.
# This is not needed for Python arrays, but we need to show the corect
# frame number in the list view.
if (index < 0):
index += len(self.effect.frames)
frame = self.effect.frames[index]
# Get the title of the frame
title_attr = inkex.addNS("title", "sozi")
if title_attr in frame["frame_element"].attrib:
title = frame["frame_element"].attrib[title_attr]
else:
title = "Untitled"
# The text color will show whether the current frame
# corresponds to the selected object in Inkscape
if frame["svg_element"] in self.effect.selected.values():
color = "#ff0000"
else:
color = "#000000"
self.list_view.get_model().append([index + 1, title, color])
def insert_row(self, index, row):
"""
Insert a row in the frame list view.
This method is used when undoing a frame deletion.
"""
model = self.list_view.get_model()
model.insert(index, row)
# Renumber frames in list view
for i in range(index + 1, len(self.effect.frames)):
model.set(model.get_iter(i), 0, i + 1)
# Select the inserted frame
self.select_index(index)
def remove_last_frame_title(self):
"""
Remove the title of the last frame in the list view.
This method is used when undoing the creation of a new frame.
"""
model = self.list_view.get_model()
model.remove(model.get_iter(len(self.effect.frames) - 1))
def remove_frame_title(self, index):
"""
Remove the title of the frame at the given index from the list view.
This method is used when deleting a frame.
"""
model = self.list_view.get_model()
iter = model.get_iter(index)
if model.remove(iter):
self.list_view.get_selection().select_iter(iter)
# Renumber frames
for i in range(index, len(self.effect.frames)):
model.set(model.get_iter(i), 0, i + 1)
else:
self.fill_form(None)
def fill_form(self, frame):
"""
Fill all fields with the values of the attributes of the given frame.
"""
for field in self.fields.itervalues():
field.set_with_frame(frame)
self.duplicate_button.set_sensitive(frame is not None )
self.delete_button.set_sensitive(frame is not None)
def get_selected_index(self):
"""
Return the index of the currently selected frame.
None is returned if no frame is selected.
"""
selection = self.list_view.get_selection()
model, iter = selection.get_selected()
if iter:
return model.get_path(iter)[0]
else:
return None
def select_index(self, index):
"""
Select the frame at the given index.
A negative index is counted back from the end of the frame list.
"""
if (index < 0):
index += len(self.effect.frames)
self.list_view.get_selection().select_path((index,))
self.list_view.scroll_to_cell(index)
def select_frame(self, frame):
"""
Select the given frame in the frame list.
"""
self.select_index(self.effect.frames.index(frame))
def on_create_new_frame(self, widget):
"""
Event handler: click on button "create new frame".
"""
self.do_action(SoziCreateAction(self))
def on_delete_frame(self, widget):
"""
Event handler: click on button "Delete frame".
"""
self.do_action(SoziDeleteAction(self))
def on_duplicate_frame(self, widget):
"""
"""
self.do_action(SoziDuplicateAction(self))
def on_move_frame_up(self, widget):
"""
Event handler: click on button "Move frame up".
"""
self.do_action(SoziReorderAction(self, False))
def on_move_frame_down(self, widget):
"""
Event handler: click on button "Move frame down".
"""
self.do_action(SoziReorderAction(self, True))
def on_selection_changed(self, path):
"""
Event handler: selection changed in frame list view.
This event can be triggered either due to a user action
or due to a programmatic selection change.
"""
if self.list_view.get_selection().path_is_selected(path):
# If the selection change happens on a selected row
# then the action is a deselection
frame = None
self.up_button.set_sensitive(False)
self.down_button.set_sensitive(False)
self.delete_button.set_sensitive(False)
else:
# If the selection change happens on a non-selected row
# then the action is a selection
index = path[0]
frame = self.effect.frames[index]
self.up_button.set_sensitive(index > 0)
self.down_button.set_sensitive(index < len(self.effect.frames) - 1)
self.delete_button.set_sensitive(True)
# Show the properties of the selected frame,
# or default values if no frame is selected.
self.fill_form(frame)
# Success: highlight or clear the affected row in the frame list
return True
def on_key_press(self, widget, event):
if event.state & gtk.gdk.CONTROL_MASK:
if event.keyval == gtk.keysyms.z:
self.window.set_focus(None)
self.on_undo()
elif event.keyval == gtk.keysyms.y:
self.on_redo()
def do_action(self, action):
"""
Execute the given action and push it to the undo stack.
The redo stack is emptied.
"""
action.do()
self.undo_stack.append(action)
self.redo_stack = []
self.finalize_action(action)
def on_undo(self, widget=None):
"""
Event handler: click on button "Undo".
Undo the action at the top of the undo stack and push it to the redo stack.
"""
if self.undo_stack:
action = self.undo_stack.pop()
self.redo_stack.append(action)
action.undo()
self.finalize_action(action)
def on_full_undo(self, widget=None):
"""
Event handler: click on button "Cancel".
Undo all actions.
"""
while self.undo_stack:
self.on_undo()
gtk.main_quit()
def on_redo(self, widget=None):
"""
Event handler: click on button "Redo".
Execute the action at the top of the redo stack and push it to the undo stack.
"""
if self.redo_stack:
action = self.redo_stack.pop()
self.undo_stack.append(action)
action.redo()
self.finalize_action(action)
def finalize_action(self, action):
"""
Update the UI after an action has been executed or undone.
"""
# Update the frame list view if the "title" field of a frame has changed.
if isinstance(action, SoziFieldAction) and action.field is self.fields["title"]:
index = self.effect.frames.index(action.frame)
model = self.list_view.get_model()
model.set(model.get_iter(index), 1, action.frame["frame_element"].get(action.field.ns_attr))
# Update the status of the "Undo" button
if self.undo_stack:
self.undo_button.set_tooltip_text(self.undo_stack[-1].undo_description)
else:
self.undo_button.set_tooltip_text("")
self.undo_button.set_sensitive(bool(self.undo_stack))
# Update the status of the "Redo" button
if self.redo_stack:
self.redo_button.set_tooltip_text(self.redo_stack[-1].redo_description)
else:
self.redo_button.set_tooltip_text("")
self.redo_button.set_sensitive(bool(self.redo_stack))
def on_destroy(self, widget):
"""
Event handler: close the Sozi window.
"""
gtk.main_quit()
class Sozi(inkex.Effect):
NS_URI = u"http://sozi.baierouge.fr"
def __init__(self):
inkex.Effect.__init__(self)
inkex.NSS[u"sozi"] = Sozi.NS_URI
self.frames = []
def effect(self):
sozi_upgrade.upgrade_or_install(self)
self.analyze_document()
self.ui = SoziUI(self)
def analyze_document(self):
"""
Analyze the document and collect information about the presentation.
Frames with no corresponding SVG element are removed.
Frames numbers are updated if needed.
FIXME this method currently does not support frames with layers
"""
# Get list of valid frame elements and remove orphan frames
refid_attr = inkex.addNS("refid", "sozi")
self.frames = []
for f in self.document.xpath("//sozi:frame", namespaces=inkex.NSS):
if refid_attr in f.attrib:
e = self.document.xpath("//svg:*[@id='" + f.attrib[refid_attr] + "']", namespaces=inkex.NSS)
if len(e) == 0:
self.document.getroot().remove(f)
else:
self.frames.append(
{
"frame_element": f,
"svg_element": e[0]
}
)
else:
# Frame elements with layers do not always contain a "refid" attribute.
# FIXME add the frame only if it contains valid layer elements
self.frames.append(
{
"frame_element": f,
"svg_element": None
}
)
# Sort frames by sequence attribute
sequence_attr = inkex.addNS("sequence", "sozi")
self.frames = sorted(self.frames, key=lambda f:
int(f["frame_element"].attrib[sequence_attr]) if sequence_attr in f["frame_element"].attrib else len(self.frames))
# Renumber frames
for i, f in enumerate(self.frames):
f["frame_element"].set(inkex.addNS("sequence", "sozi"), unicode(i + 1))
def swap_frames(self, first, second):
"""
Swap frames with the given indices.
"""
# Swap frames in SVG document
sequence_attr = inkex.addNS("sequence", "sozi")
self.frames[first]["frame_element"].set(sequence_attr, unicode(second + 1))
self.frames[second]["frame_element"].set(sequence_attr, unicode(first + 1))
# Swap frames in frame list
self.frames[first], self.frames[second] = self.frames[second], self.frames[first]
def create_new_frame(self, index):
"""
Create a new frame using the SVG element of the frame at the given index.
The new frame is not added to the document.
"""
if index is not None:
svg_element = self.frames[index]["svg_element"]
else:
svg_element = self.selected.values()[0]
frame_element = inkex.etree.Element(inkex.addNS("frame", "sozi"))
frame_element.set(inkex.addNS("refid", "sozi"), svg_element.attrib["id"]) # TODO check namespace?
frame_element.set(inkex.addNS("sequence", "sozi"), unicode(len(self.frames)+1))
frame_element.set("id", self.uniqueId("frame" + unicode(len(self.frames)+1)))
frame = {
"frame_element": frame_element,
"svg_element": svg_element
}
return frame
def add_frame(self, frame):
"""
Add the given frame to the document.
"""
self.document.getroot().append(frame["frame_element"])
self.frames.append(frame)
def insert_frame(self, index, frame):
"""
Insert the given frame at the given index.
"""
self.document.getroot().append(frame["frame_element"])
self.frames.insert(index, frame)
self.renumber_from_index(index)
def delete_frame(self, index):
"""
Remove the frame at the given index from the document.
"""
self.document.getroot().remove(self.frames[index]["frame_element"])
del self.frames[index]
self.renumber_from_index(index)
def renumber_from_index(self, index):
if index >= 0:
for i in range(index, len(self.frames)):
self.frames[i]["frame_element"].set(inkex.addNS("sequence", "sozi"), unicode(i + 1))
# Create effect instance
effect = Sozi()
effect.affect()
sozi-12.05.orig/editors/inkscape/sozi.py.png 0000664 0000000 0000000 00000013543 11752172636 017553 0 ustar root root PNG
IHDR @ @ iq sBIT|d pHYs u85 tEXtSoftware www.inkscape.org< tEXtAuthor Andy Fitzsimonֺd tEXtCreation Time 2006 IDATx[wXvVPX X@{h=H~5cn%\ HQAAȲ-ؕPY0<<03;soΜs331 az4'Y
lM.YYY:4\.$fΜyq @< » TPP{oeff>;vO>\.]v^ݺuݼyDZ7 T00c}Z"bHDD!s%Jjkk+BbO8ٵk?4<]v)ۅju^sbY~~]!vڥ7n!"fǎ~ӧO?,]X"$cƌ.>>_~?5Y+8D{2aIIIh9v-7o+aD$# "/^h-"ҵSssg(\o˳:Jƪ7;r HMSO
u7zDPJ^2~ɓ'=93vkSn۶`rra 5E;Id/VGf5=znر]a27 %%e 3B=zT8cS۔?Ofn#"-裏gff6 ""\r#"r.\6qƾҢ`efcҥs ~P8"//پ}` ={<\=s8kyVۓ:l/Vǯ^߹y=Ñ6SN!//)~K.C)H8D*[ʵZLV,v}@Xv-1d#<<6m'H7(L&eY+!@@ܹsܹs?A 3 Za{VUʮnk}e}=_,)zleYƪ´iիWC*Caa!v
n! &