diff --git a/LICENSE b/LICENSE index 17cb286..d159169 100644 --- a/LICENSE +++ b/LICENSE @@ -1,117 +1,339 @@ -GNU GENERAL PUBLIC LICENSE -Version 2, June 1991 + 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 + 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. -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + Preamble -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. -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. -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. -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. -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. -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. -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. -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. -The precise terms and conditions for copying, distribution and modification follow. + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -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". -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. -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. -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. -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: -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. - 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. - 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.) - 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. -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. -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. -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: -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, - 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, - 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.) - 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. -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. -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. -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. -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. -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. -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. -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. -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. -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. -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. -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. -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. -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 -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. -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. -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 -END OF TERMS AND CONDITIONS + How to Apply These Terms to Your New Programs -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. -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. -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. + + Copyright (C) - one line to give the program's name and an idea of what it does. Copyright (C) yyyy 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 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. - 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. - 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. +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: +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. + 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. +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: +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. + 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 + , 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. diff --git a/README.md b/README.md index d042017..a5e4d59 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ # GtkCodeThemer +GtkCodeThemer is a source code color scheme editor for GtkSourceView applications such as Gedit, Anjuta, and Scribes. +It is a standalone Python application, not a plugin, and (currently) requires Gtk 3.x. -temp \ No newline at end of file + +### Credit +Much of this code was taken, restructured, and fixed (last updated 11 years ago...) from here. It was made more pythonic in addition to being integrated with my personal code template project. + +### Requirements +* PyGObject (Gtk introspection library) +* setproctitle (Define process title to search and kill more easily) + +### Note +* Will eventually move to Gtk 4. + +![GtkCodeThemer](images/pic1.png) diff --git a/images/pic1.png b/images/pic1.png new file mode 100644 index 0000000..76c62da Binary files /dev/null and b/images/pic1.png differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4f65d82 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +PyGObject +pyxdg +setproctitle +sqlmodel diff --git a/src/__builtins__.py b/src/__builtins__.py new file mode 100644 index 0000000..3a100fe --- /dev/null +++ b/src/__builtins__.py @@ -0,0 +1,59 @@ +# Python imports +import builtins +import threading +import sys + +# Lib imports + +# Application imports +from utils.event_system import EventSystem +from utils.endpoint_registry import EndpointRegistry +from utils.keybindings import Keybindings +from utils.logger import Logger +from utils.settings_manager.manager import SettingsManager + + + +# NOTE: Threads WILL NOT die with parent's destruction. +def threaded_wrapper(fn): + def wrapper(*args, **kwargs): + threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=False).start() + return wrapper + +# NOTE: Threads WILL die with parent's destruction. +def daemon_threaded_wrapper(fn): + def wrapper(*args, **kwargs): + threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=True).start() + return wrapper + + + +# NOTE: Just reminding myself we can add to builtins two different ways... +# __builtins__.update({"event_system": Builtins()}) +builtins.app_name = "GtkCodeThemer" + +builtins.keybindings = Keybindings() +builtins.event_system = EventSystem() +builtins.endpoint_registry = EndpointRegistry() +builtins.settings_manager = SettingsManager() + +settings_manager.load_settings() + +builtins.settings = settings_manager.settings +builtins.logger = Logger(settings_manager.get_home_config_path(), \ + _ch_log_lvl=settings.debugging.ch_log_lvl, \ + _fh_log_lvl=settings.debugging.fh_log_lvl).get_logger() + +builtins.threaded = threaded_wrapper +builtins.daemon_threaded = daemon_threaded_wrapper + + + +def custom_except_hook(exc_type, exc_value, exc_traceback): + if issubclass(exc_type, KeyboardInterrupt): + sys.__excepthook__(exc_type, exc_value, exc_traceback) + return + + logger.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)) + +sys.excepthook = custom_except_hook diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..90dc8da --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,3 @@ +""" + Start of package. +""" diff --git a/src/__main__.py b/src/__main__.py new file mode 100644 index 0000000..e1914c8 --- /dev/null +++ b/src/__main__.py @@ -0,0 +1,53 @@ +#!/usr/bin/python3 + +# Python imports +import argparse +import faulthandler +import traceback +from setproctitle import setproctitle + +import tracemalloc +tracemalloc.start() + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +# Application imports +from __builtins__ import * +from app import Application + + + + +if __name__ == "__main__": + ''' Set process title, get arguments, and create GTK main thread. ''' + + try: + setproctitle(f'{app_name}') + faulthandler.enable() # For better debug info + + parser = argparse.ArgumentParser() + # Add long and short arguments + parser.add_argument("--debug", "-d", default="false", help="Do extra console messaging.") + parser.add_argument("--trace-debug", "-td", default="false", help="Disable saves, ignore IPC lock, do extra console messaging.") + parser.add_argument("--no-plugins", "-np", default="false", help="Do not load plugins.") + parser.add_argument("--new-tab", "-nt", default="false", help="Opens a 'New Tab' if a handler is set for it.") + parser.add_argument("--file", "-f", default="default", help="JUST SOME FILE ARG.") + + # Read arguments (If any...) + args, unknownargs = parser.parse_known_args() + + if args.debug == "true": + settings_manager.set_debug(True) + + if args.trace_debug == "true": + settings_manager.set_trace_debug(True) + + settings_manager.do_dirty_start_check() + Application(args, unknownargs) + Gtk.main() + except Exception as e: + traceback.print_exc() + quit() diff --git a/src/app.py b/src/app.py new file mode 100644 index 0000000..6621415 --- /dev/null +++ b/src/app.py @@ -0,0 +1,59 @@ +# Python imports +import signal +import os + +# Lib imports + +# Application imports +from utils.debugging import debug_signal_handler +from utils.ipc_server import IPCServer +from core.window import Window + + + +class AppLaunchException(Exception): + ... + + +class Application(IPCServer): + """ docstring for Application. """ + + def __init__(self, args, unknownargs): + super(Application, self).__init__() + + if not settings_manager.is_trace_debug(): + self.socket_realization_check() + + if not self.is_ipc_alive: + for arg in unknownargs + [args.new_tab,]: + if os.path.isfile(arg): + message = f"FILE|{arg}" + self.send_ipc_message(message) + + raise AppLaunchException(f"{app_name} IPC Server Exists: Will send path(s) to it and close...") + + self.setup_debug_hook() + Window(args, unknownargs) + + + def socket_realization_check(self): + try: + self.create_ipc_listener() + except Exception: + self.send_test_ipc_message() + + try: + self.create_ipc_listener() + except Exception as e: + ... + + def setup_debug_hook(self): + try: + # kill -SIGUSR2 from Linux/Unix or SIGBREAK signal from Windows + signal.signal( + vars(signal).get("SIGBREAK") or vars(signal).get("SIGUSR1"), + debug_signal_handler + ) + except ValueError: + # Typically: ValueError: signal only works in main thread + ... diff --git a/src/core/__init__.py b/src/core/__init__.py new file mode 100644 index 0000000..f1af95c --- /dev/null +++ b/src/core/__init__.py @@ -0,0 +1,3 @@ +""" + Core Module +""" \ No newline at end of file diff --git a/src/core/controller.py b/src/core/controller.py new file mode 100644 index 0000000..470c7b0 --- /dev/null +++ b/src/core/controller.py @@ -0,0 +1,75 @@ +# Python imports +import os + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +# Application imports +from .mixins.signals_mixins import SignalsMixins +from .controller_data import ControllerData +from .widgets.transparency_scale import TransparencyScale + + + +class Controller(SignalsMixins, ControllerData): + def __init__(self, args, unknownargs): + self.setup_controller_data() + + self._setup_styling() + self._setup_signals() + self._subscribe_to_events() + + for arg in unknownargs + [args.new_tab,]: + if os.path.isfile(arg): + message = f"FILE|{arg}" + event_system.emit("post_file_to_ipc", message) + + logger.info(f"Made it past {self.__class__} loading...") + + + def _setup_styling(self): + ... + + def _setup_signals(self): + self.window.connect("focus-out-event", self.unset_keys_and_data) + self.window.connect("key-press-event", self.on_global_key_press_controller) + self.window.connect("key-release-event", self.on_global_key_release_controller) + + def _subscribe_to_events(self): + event_system.subscribe("shutting_down", lambda: print("Shutting down...")) + event_system.subscribe("handle_file_from_ipc", self.handle_file_from_ipc) + event_system.subscribe("remove_transparency", self._remove_transparency) + event_system.subscribe("update_transparency", self._update_transparency) + + def setup_builder_and_container(self): + self.builder = Gtk.Builder() + self.builder.add_from_file(settings_manager.get_glade_file()) + self.builder.expose_object("main_window", self.window) + + settings_manager.set_builder(self.builder) + + glade_box = self.builder.get_object("glade_box") + self.base_container = glade_box + self.ctx = self.base_container.get_style_context() + + self.ctx.add_class(f"mw_transparency_{settings.theming.transparency}") + settings_manager.register_signals_to_builder([self, self.base_container]) + + TransparencyScale() + self.window.add(glade_box) + + + def _interactive_debug(self, widget = None, eve = None): + event_system.emit("load_interactive_debug") + + def _remove_transparency(self): + self.ctx.remove_class(f"mw_transparency_{settings.theming.transparency}") + + def _update_transparency(self): + self.ctx.add_class(f"mw_transparency_{settings.theming.transparency}") + + + def _close_app(self): + event_system.emit("tear_down") diff --git a/src/core/controller_data.py b/src/core/controller_data.py new file mode 100644 index 0000000..bd1c03e --- /dev/null +++ b/src/core/controller_data.py @@ -0,0 +1,174 @@ +# Python imports +import os +import subprocess +import collections +import tempfile + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +gi.require_version('GtkSource', '4') +from gi.repository import GObject +from gi.repository import Gtk +from gi.repository import Gdk +from gi.repository import GtkSource + +# Application imports + + + +class ControllerData: + ''' ControllerData contains most of the state of the app at ay given time. It also has some support methods. ''' + + def setup_controller_data(self) -> None: + # Needed hack to get GtkSourceView widget to run from glade file... + GtkSource.View() + + self.window = settings_manager.get_main_window() + self.builder = None + self.base_container = None + + self.setup_builder_and_container() + + self.was_midified_key = False + self.ctrl_down = False + self.shift_down = False + self.alt_down = False + + + self.language_id = 'c' + self.language_name = 'C' + self.black_color = Gdk.color_parse('#000000'); + self.gui_style_ids = [ + 'bracket-match', 'bracket-mismatch', + 'current-line', 'cursor', 'line-numbers', + 'secondary-cursor', 'selection', + 'selection-unfocused', 'text' + ] + + self.styles_list = self.builder.get_object('styles_list') + self.languages_list = self.builder.get_object('languages_list') + + self.languages_dropdown = self.builder.get_object('languages_dropdown') + self.styles_treeview = self.builder.get_object('styles_treeview') + + self.bold_tggle_btn = self.builder.get_object('bold_tggle_btn') + self.italic_tggle_btn = self.builder.get_object('italic_tggle_btn') + self.underline_tggle_btn = self.builder.get_object('underline_tggle_btn') + self.strikethrough_tggle_btn = self.builder.get_object('strikethrough_tggle_btn') + self.fr_check_btn = self.builder.get_object('fr_check_btn') + self.br_check_btn = self.builder.get_object('br_check_btn') + self.fr_color_btn = self.builder.get_object('fr_color_btn') + self.br_color_btn = self.builder.get_object('br_color_btn') + self.reset_btn = self.builder.get_object('reset_btn') + + self.name_entry = self.builder.get_object('name_entry') + self.id_entry = self.builder.get_object('id_entry') + self.desc_entry = self.builder.get_object('desc_entry') + self.authr_entry = self.builder.get_object('authr_entry') + self.sample_lbl = self.builder.get_object('sample_lbl') + self.src_buffer = GtkSource.Buffer(max_undo_levels = 0) + self.src_preview = self.builder.get_object('src_preview') + + + self.scheme_manager = GtkSource.StyleSchemeManager() + self.language_manager = GtkSource.LanguageManager() + self.all_styles_dict = collections.OrderedDict() + + self.language = self.language_manager.get_language(self.language_id) + self.current_lang_id = self.language_id + self.current_lang_name = self.language_name + self.orig_scheme_file = None + + self.bold_tggl_handler = self.get_handler_id(self.bold_tggle_btn, 'toggled') + self.italic_tggl_handler = self.get_handler_id(self.italic_tggle_btn, 'toggled') + self.underline_tggl_handler = self.get_handler_id(self.underline_tggle_btn, 'toggled') + self.strikethrough_tggl_handler = self.get_handler_id(self.strikethrough_tggle_btn, 'toggled') + self.foreground_tggl_handler = self.get_handler_id(self.fr_check_btn, 'toggled') + self.background_tggl_handler = self.get_handler_id(self.br_check_btn, 'toggled') + + # watch temp directory to help the sample viewer + self.scheme_manager.append_search_path( tempfile.gettempdir() ) + self.src_preview.set_buffer(self.src_buffer) + self.load_initial_data() + + def load_initial_data(self, from_file = None): + if from_file and os.path.isfile(from_file): + self.load_scheme(from_file) + else: + self.load_scheme('cobalt') + + languages = self.language_manager.get_language_ids() + languages.sort() + self.lang_map_name_to_id = {} + + self.languages_list.append(['Default styles']) + self.lang_map_name_to_id['Default styles'] = 'def' + + for lang in languages: + lang_name = self.language_manager.get_language(lang).get_name() + self.lang_map_name_to_id[lang_name] = lang + + if lang_name != 'Defaults': + self.languages_list.append([lang_name]) + + self.styles_treeview_selection = self.styles_treeview.get_selection() + self.styles_treeview_selection.connect('changed', self.on_style_selected) + + # select the first language + self.languages_dropdown.set_active(0) + + # select the first style + model = self.styles_treeview.get_model() + tree_iter = model.get_iter_first() + self.styles_treeview_selection.select_iter(tree_iter) + self.selected_style_id = model[tree_iter][0] + + def get_handler_id(self, obj, signal_name): + signal_id, detail = GObject.signal_parse_name(signal_name, obj, True) + return GObject.signal_handler_find(obj, GObject.SignalMatchType.ID, signal_id, detail, None, None, None) + + def get_base_container(self): + return self.base_container + + def clear_console(self) -> None: + ''' Clears the terminal screen. ''' + os.system('cls' if os.name == 'nt' else 'clear') + + def call_method(self, _method_name: str, data: type) -> type: + ''' + Calls a method from scope of class. + + Parameters: + a (obj): self + b (str): method name to be called + c (*): Data (if any) to be passed to the method. + Note: It must be structured according to the given methods requirements. + + Returns: + Return data is that which the calling method gives. + ''' + method_name = str(_method_name) + method = getattr(self, method_name, lambda data: f"No valid key passed...\nkey={method_name}\nargs={data}") + return method(*data) if data else method() + + def has_method(self, obj: type, method: type) -> type: + ''' Checks if a given method exists. ''' + return callable(getattr(obj, method, None)) + + def clear_children(self, widget: type) -> None: + ''' Clear children of a gtk widget. ''' + for child in widget.get_children(): + widget.remove(child) + + def get_clipboard_data(self, encoding = "utf-8") -> str: + proc = subprocess.Popen(['xclip','-selection', 'clipboard', '-o'], stdout = subprocess.PIPE) + retcode = proc.wait() + data = proc.stdout.read() + return data.decode(encoding).strip() + + def set_clipboard_data(self, data: type, encoding = "utf-8") -> None: + proc = subprocess.Popen(['xclip','-selection','clipboard'], stdin = subprocess.PIPE) + proc.stdin.write(data.encode(encoding)) + proc.stdin.close() + retcode = proc.wait() diff --git a/src/core/mixins/__init__.py b/src/core/mixins/__init__.py new file mode 100644 index 0000000..4589fc7 --- /dev/null +++ b/src/core/mixins/__init__.py @@ -0,0 +1,3 @@ +""" + Generic Mixins Module +""" diff --git a/src/core/mixins/signals/__init__.py b/src/core/mixins/signals/__init__.py new file mode 100644 index 0000000..03c3ec2 --- /dev/null +++ b/src/core/mixins/signals/__init__.py @@ -0,0 +1,3 @@ +""" + Signals module +""" diff --git a/src/core/mixins/signals/ipc_signals_mixin.py b/src/core/mixins/signals/ipc_signals_mixin.py new file mode 100644 index 0000000..9e48cf7 --- /dev/null +++ b/src/core/mixins/signals/ipc_signals_mixin.py @@ -0,0 +1,17 @@ +# Python imports + +# Lib imports + +# Application imports + + + + +class IPCSignalsMixin: + """ IPCSignalsMixin handle messages from another starting solarfm process. """ + + def print_to_console(self, message=None): + logger.debug(message) + + def handle_file_from_ipc(self, path: str) -> None: + logger.debug(f"File From IPC: {path}") diff --git a/src/core/mixins/signals/keyboard_signals_mixin.py b/src/core/mixins/signals/keyboard_signals_mixin.py new file mode 100644 index 0000000..1a99277 --- /dev/null +++ b/src/core/mixins/signals/keyboard_signals_mixin.py @@ -0,0 +1,94 @@ +# Python imports +import re + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +gi.require_version('Gdk', '3.0') +from gi.repository import Gtk +from gi.repository import Gdk + +# Application imports + + + +valid_keyvalue_pat = re.compile(r"[a-z0-9A-Z-_\[\]\(\)\| ]") + + + +class KeyboardSignalsMixin: + """ KeyboardSignalsMixin keyboard hooks controller. """ + + # TODO: Need to set methods that use this to somehow check the keybindings state instead. + def unset_keys_and_data(self, widget=None, eve=None): + self.ctrl_down = False + self.shift_down = False + self.alt_down = False + + def on_global_key_press_controller(self, eve, user_data): + keyname = Gdk.keyval_name(user_data.keyval).lower() + modifiers = Gdk.ModifierType(user_data.get_state() & ~Gdk.ModifierType.LOCK_MASK) + + self.was_midified_key = True if modifiers != 0 else False + + if keyname.replace("_l", "").replace("_r", "") in ["control", "alt", "shift"]: + if "control" in keyname: + self.ctrl_down = True + if "shift" in keyname: + self.shift_down = True + if "alt" in keyname: + self.alt_down = True + + def on_global_key_release_controller(self, widget, event): + """ Handler for keyboard events """ + keyname = Gdk.keyval_name(event.keyval).lower() + modifiers = Gdk.ModifierType(event.get_state() & ~Gdk.ModifierType.LOCK_MASK) + + if keyname.replace("_l", "").replace("_r", "") in ["control", "alt", "shift"]: + should_return = self.was_midified_key and (self.ctrl_down or self.shift_down or self.alt_down) + + if "control" in keyname: + self.ctrl_down = False + if "shift" in keyname: + self.shift_down = False + if "alt" in keyname: + self.alt_down = False + + # NOTE: In effect a filter after releasing a modifier and we have a modifier mapped + if should_return: + self.was_midified_key = False + return + + mapping = keybindings.lookup(event) + logger.debug(f"on_global_key_release_controller > key > {keyname}") + logger.debug(f"on_global_key_release_controller > keyval > {event.keyval}") + logger.debug(f"on_global_key_release_controller > mapping > {mapping}") + + if mapping: + # See if in controller scope + try: + getattr(self, mapping)() + return True + except Exception: + # Must be plugins scope, event call, OR we forgot to add method to controller scope + if "||" in mapping: + sender, eve_type = mapping.split("||") + else: + sender = "" + eve_type = mapping + + self.handle_key_event_system(sender, eve_type) + else: + logger.debug(f"on_global_key_release_controller > key > {keyname}") + + if self.ctrl_down: + if not keyname in ["1", "kp_1", "2", "kp_2", "3", "kp_3", "4", "kp_4"]: + self.handle_key_event_system(None, mapping) + else: + ... + + def handle_key_event_system(self, sender, eve_type): + event_system.emit(eve_type) + + def keyboard_close_tab(self): + ... diff --git a/src/core/mixins/signals/main_signals_mixin.py b/src/core/mixins/signals/main_signals_mixin.py new file mode 100644 index 0000000..2efbedf --- /dev/null +++ b/src/core/mixins/signals/main_signals_mixin.py @@ -0,0 +1,37 @@ +# Python imports + +# Lib imports + +# Application imports +from utils.style_properties import StyleProperties + +from .widget_signals.list_signals_mixin import ListSignalsMixin +from .widget_signals.tggle_and_check_box_signals_mixin import TggleAndCheckBoxSignals +from .widget_signals.sourceview_signals_mixin import SourceviewSignalsMixin +from .widget_signals.dialog_signals_mixin import DialogSignalsMixin + + + +class MainSignalsMixin(ListSignalsMixin, TggleAndCheckBoxSignals, SourceviewSignalsMixin, DialogSignalsMixin): + + def on_style_changed(self, data): + if self.selected_style_id not in self.all_styles_dict: + self.all_styles_dict[self.selected_style_id] = StyleProperties() + + color_scale = 255.0/65535.0 + if data == self.br_color_btn: + color = data.get_color() + self.all_styles_dict[self.selected_style_id].background = ('#%02x%02x%02x' % (color.red * color_scale, color.green * color_scale, color.blue * color_scale)) + elif data == self.fr_color_btn: + color = data.get_color() + self.all_styles_dict[self.selected_style_id].foreground = ('#%02x%02x%02x' % (color.red * color_scale, color.green * color_scale, color.blue * color_scale)) + elif data == self.bold_tggle_btn: + self.all_styles_dict[self.selected_style_id].bold = data.get_active() + elif data == self.italic_tggle_btn: + self.all_styles_dict[self.selected_style_id].italic = data.get_active() + elif data == self.underline_tggle_btn: + self.all_styles_dict[self.selected_style_id].underline = data.get_active() + elif data == self.strikethrough_tggle_btn: + self.all_styles_dict[self.selected_style_id].strikethrough = data.get_active() + + self.update_sample_view() diff --git a/src/core/mixins/signals/widget_signals/__init__.py b/src/core/mixins/signals/widget_signals/__init__.py new file mode 100644 index 0000000..1c711d0 --- /dev/null +++ b/src/core/mixins/signals/widget_signals/__init__.py @@ -0,0 +1,3 @@ +""" + Widget signals module +""" diff --git a/src/core/mixins/signals/widget_signals/dialog_signals_mixin.py b/src/core/mixins/signals/widget_signals/dialog_signals_mixin.py new file mode 100644 index 0000000..bd3b052 --- /dev/null +++ b/src/core/mixins/signals/widget_signals/dialog_signals_mixin.py @@ -0,0 +1,139 @@ +# Python imports +import os + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +# Application imports + + + +class DialogSignalsMixin(): + def on_open_clicked(self, param): + file_chooser = Gtk.FileChooserDialog('Open', self.window, Gtk.FileChooserAction.OPEN, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + + file_filter = Gtk.FileFilter() + file_filter.set_name('XML files') + file_filter.add_pattern('*.xml') + file_chooser.add_filter(file_filter) + + file_filter = Gtk.FileFilter() + file_filter.set_name('All files') + file_filter.add_pattern('*') + file_chooser.add_filter(file_filter) + + file_chooser.set_default_response(Gtk.ResponseType.OK) + file_chooser.set_current_folder(os.path.expanduser('~')) + + path = None + response = file_chooser.run() + if response == Gtk.ResponseType.OK: + path = file_chooser.get_filename() + if path and not os.access(path, os.R_OK): + abspath = os.path.abspath(path) + self.message_dialog(Gtk.MessageType.ERROR, ('Could not open file "%s"') % abspath, ('The file "%s" could not be opened. ' 'Permission denied.') % abspath, file_chooser) + path = None + + file_chooser.destroy() + if not path: return + self.load_scheme(path) + + def on_save_clicked(self, param): + if not self.origSchemeFile: + filename = run_save_as_dialog(self.window, self.entryId.get_text() + '.xml') + + if filename and not '.' in os.path.basename(filename): + filename = f"{filename}.xml" + + if filename: + self.write_scheme(filename, self.entryId.get_text()) + self.origSchemeFile = filename + else: + self.write_scheme(self.origSchemeFile, self.entryId.get_text()) + + def on_save_as_clicked(self, param): + filename = run_save_as_dialog(self.window, self.entryId.get_text() + '.xml') + if filename and not '.' in os.path.basename(filename): + filename = f"{filename}.xml" + + if filename: + self.write_scheme(filename, self.entryId.get_text()) + self.origSchemeFile = filename + + + def message_dialog( + dialog_type, + short_msg, + long_msg = None, + parent = None, + buttons = Gtk.ButtonsType.OK, + additional_buttons = None + ): + dialog = Gtk.MessageDialog(parent = parent, flags = Gtk.DialogFlags.MODAL, type = dialog_type, buttons = buttons) + + if additional_buttons: + dialog.add_buttons(*additional_buttons) + + dialog.set_markup(short_msg) + if long_msg: + if isinstance(long_msg, Gtk.Widget): + widget = long_msg + elif isinstance(long_msg, str): + widget = Gtk.Label() + widget.set_markup(long_msg) + else: + raise TypeError('"long_msg" must be a Gtk.Widget or a string') + + expander = Gtk.Expander(label = 'Click here for details') + expander.set_border_width(6) + expander.add(widget) + dialog.vbox.pack_end(expander, True, True, 0) + + dialog.show_all() + response = dialog.run() + dialog.destroy() + + return response + + def run_save_as_dialog(parent, current_name): + file_chooser = Gtk.FileChooserDialog('Save As', parent, Gtk.FileChooserAction.SAVE, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.OK)) + + file_filter = Gtk.FileFilter() + file_filter.set_name('XML files') + file_filter.add_pattern('*.xml') + file_chooser.add_filter(file_filter) + + file_filter = Gtk.FileFilter() + file_filter.set_name('All files') + file_filter.add_pattern('*') + file_chooser.add_filter(file_filter) + + file_chooser.set_default_response(Gtk.ResponseType.OK) + file_chooser.set_current_folder( os.path.expanduser('~') ) + + if current_name: + file_chooser.set_current_name(current_name) + + file_chooser.set_default_response(Gtk.ResponseType.OK) + + path = None + while True: + response = file_chooser.run() + if response != Gtk.ResponseType.OK: + path = None + break + + path = file_chooser.get_filename() + if not os.path.exists(path): break + + sub_msg_1 = ('A file named "%s" already exists') % os.path.abspath(path) + sub_msg_2 = ('Do you which to replace it with the current project?') + text = '%s\n\n%s\n' % (sub_msg_1, sub_msg_2) + result = message_dialog(Gtk.MessageType.ERROR, text, parent = parent, buttons = Gtk.ButtonsType.NONE, additional_buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, 'Replace', Gtk.ResponseType.YES)) + + if result == Gtk.ResponseType.YES: break + + file_chooser.destroy() + return path \ No newline at end of file diff --git a/src/core/mixins/signals/widget_signals/list_signals_mixin.py b/src/core/mixins/signals/widget_signals/list_signals_mixin.py new file mode 100644 index 0000000..46df805 --- /dev/null +++ b/src/core/mixins/signals/widget_signals/list_signals_mixin.py @@ -0,0 +1,107 @@ +# Python imports + +# Lib imports +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gdk + +# Application imports +from utils.languages import samples + + + + +class ListSignalsMixin: + def on_language_selected(self, combo): + tree_iter = combo.get_active_iter() + + if tree_iter: + model = combo.get_model() + self.current_lang_name = model[tree_iter][0] + self.current_lang_id = self.lang_map_name_to_id[self.current_lang_name] + + self.styles_list.clear() + + remove_len = len(self.current_lang_id) + 1 + lang = self.language_manager.get_language(self.current_lang_id) + + if lang: + style_ids = lang.get_style_ids() + style_ids.sort() + + if self.current_lang_id == 'def': + for style_id in self.gui_style_ids: + self.styles_list.append([style_id]) + + for style_id in style_ids: + self.styles_list.append([style_id[remove_len:]]) + + tree_iter = self.styles_treeview.get_model().get_iter_first() + self.styles_treeview_selection.select_iter(tree_iter) + model = self.styles_treeview.get_model() + self.selected_style_id = model[tree_iter][0] + + if self.current_lang_id in samples: + self.src_buffer.set_language(lang); + self.src_buffer.set_text(samples[self.current_lang_id]) + self.sample_lbl.set_text(f"{self.current_lang_name} sample") + else: + self.src_buffer.set_language(self.language); + self.src_buffer.set_text(samples[self.language_id]) + self.sample_lbl.set_text(f"{self.language_name} sample") + + def on_style_selected(self, selection): + model, tree_iter = selection.get_selected() + if not tree_iter: return + + self.selected_style_id = f"{self.current_lang_id}:{model[tree_iter][0]}" + + # handle the special case for GUI styles + if self.selected_style_id not in self.all_styles_dict and self.current_lang_id == 'def': + self.selected_style_id = model[tree_iter][0] + + # block all the toggle handlers so they dont get triggered + self.bold_tggle_btn.handler_block(self.bold_tggl_handler) + self.italic_tggle_btn.handler_block(self.italic_tggl_handler) + self.underline_tggle_btn.handler_block(self.underline_tggl_handler) + self.strikethrough_tggle_btn.handler_block(self.strikethrough_tggl_handler) + self.fr_check_btn.handler_block(self.foreground_tggl_handler) + self.br_check_btn.handler_block(self.background_tggl_handler) + + if self.selected_style_id in self.all_styles_dict: + this_style = self.all_styles_dict[self.selected_style_id] + + # handle foreground and background colors + if this_style.foreground: + self.fr_color_btn.set_color(Gdk.color_parse(this_style.foreground)) + self.fr_color_btn.set_sensitive(True) + self.fr_check_btn.set_active(True) + else: + self.fr_color_btn.set_color(self.black_color) + self.fr_color_btn.set_sensitive(False) + self.fr_check_btn.set_active(False) + + if this_style.background: + self.br_color_btn.set_color(Gdk.color_parse(this_style.background)) + self.br_color_btn.set_sensitive(True) + self.br_check_btn.set_active(True) + else: + self.br_color_btn.set_color(self.black_color) + self.br_color_btn.set_sensitive(False) + self.br_check_btn.set_active(False) + + # handle text styling + self.italic_tggle_btn.set_active(this_style.italic) + self.bold_tggle_btn.set_active(this_style.bold) + self.strikethrough_tggle_btn.set_active(this_style.strikethrough) + self.underline_tggle_btn.set_active(this_style.underline) + self.reset_btn.set_sensitive(True) + else: + self.clear_and_disable_style_buttons() + + self.bold_tggle_btn.handler_unblock(self.bold_tggl_handler) + self.italic_tggle_btn.handler_unblock(self.italic_tggl_handler) + self.underline_tggle_btn.handler_unblock(self.underline_tggl_handler) + self.strikethrough_tggle_btn.handler_unblock(self.strikethrough_tggl_handler) + self.fr_check_btn.handler_unblock(self.foreground_tggl_handler) + self.br_check_btn.handler_unblock(self.background_tggl_handler) diff --git a/src/core/mixins/signals/widget_signals/sourceview_signals_mixin.py b/src/core/mixins/signals/widget_signals/sourceview_signals_mixin.py new file mode 100644 index 0000000..9daea6d --- /dev/null +++ b/src/core/mixins/signals/widget_signals/sourceview_signals_mixin.py @@ -0,0 +1,107 @@ +# Python imports +import os +import tempfile +from xml.etree import ElementTree as ET + +# Lib imports + +# Application imports +from utils.style_properties import StyleProperties + + + +class SourceviewSignalsMixin: + def update_sample_view(self): + """ + Update the sample shown in the GUI. + To do this we must write the scheme to disk and reload it from there. + """ + + self.write_scheme(self.temp_scheme_file, self.temp_scheme_id) + self.scheme_manager.force_rescan() + + new_scheme = self.scheme_manager.get_scheme(self.temp_scheme_id) + self.src_buffer.set_style_scheme(new_scheme); + + def load_scheme(self, scheme_id_or_file): + xml_tree = None + + if os.path.isfile(scheme_id_or_file): + directory = os.path.dirname(scheme_id_or_file) + + if directory not in self.scheme_manager.get_search_path(): + self.scheme_manager.prepend_search_path(directory) + + with open(scheme_id_or_file, 'r') as f: + xml_tree = ET.parse(f) + + if xml_tree.getroot().tag == 'style-scheme': + this_scheme = self.scheme_manager.get_scheme( xml_tree.getroot().attrib['id'] ) + + if not this_scheme: return False + + testFilename = this_scheme.get_filename() + + if testFilename != scheme_id_or_file: + text = 'There was a problem opening the file\n\nYou appear to have schemes with the same IDs in different directories\n' + self.message_dialog(Gtk.MessageType.ERROR, text, buttons = Gtk.ButtonsType.NONE, additional_buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)) + return False + + self.orig_scheme_file = scheme_id_or_file + else: + this_scheme = self.scheme_manager.get_scheme(scheme_id_or_file) + if not this_scheme: return False + + self.currentScheme = this_scheme + + self.name_entry.set_text( this_scheme.get_name() ) + self.authr_entry.set_text( ', '.join( this_scheme.get_authors() ) ) + self.desc_entry.set_text( this_scheme.get_description() ) + self.id_entry.set_text( this_scheme.get_id() ) + + scheme_file = self.currentScheme.get_filename() + with open(scheme_file, 'r') as f: + xml_tree = ET.parse(f) + + style_elems = xml_tree.findall('style') + self.all_styles_dict.clear() + + for style_elem in style_elems: + this_style = self.currentScheme.get_style(style_elem.attrib['name']) + styleProps = StyleProperties() + styleProps.from_gtk_source_style(this_style) + self.all_styles_dict[style_elem.attrib['name']] = styleProps; + + self.src_buffer.set_style_scheme(self.currentScheme); + + # set up temp file so the sample view can be updated + self.temp_scheme_id = f"{this_scheme.get_id()}_temp" + self.temp_scheme_file = f"{tempfile.gettempdir()}/{self.temp_scheme_id}.xml" + + return True + + def write_scheme(self, location, scheme_id): + output = f'\n' + output += f' {self.authr_entry.get_text()}\n' + output += f' {self.desc_entry.get_text()}\n\n' + for k, v in self.all_styles_dict.items(): + output += f' + + diff --git a/user_config/usr/share/gtkcodethemer/contexct_menu.json b/user_config/usr/share/gtkcodethemer/contexct_menu.json new file mode 100644 index 0000000..5759064 --- /dev/null +++ b/user_config/usr/share/gtkcodethemer/contexct_menu.json @@ -0,0 +1,16 @@ +{ + "Open Actions": { + "Open": ["STOCK_OPEN", "open"], + "Open With": ["STOCK_OPEN", "open_with"], + "Execute": ["STOCK_EXECUTE", "execute"], + "Execute in Terminal": ["STOCK_EXECUTE", "execute_in_terminal"] + }, + "File Actions": { + "New": ["STOCK_ADD", "create"], + "Rename": ["STOCK_EDIT", "rename"], + "Cut": ["STOCK_CUT", "cut"], + "Copy": ["STOCK_COPY", "copy"], + "Paste": ["STOCK_PASTE", "paste"] + }, + "Plugins": {} +} diff --git a/user_config/usr/share/gtkcodethemer/icons/app_name-64x64.png b/user_config/usr/share/gtkcodethemer/icons/app_name-64x64.png new file mode 100644 index 0000000..6105709 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/app_name-64x64.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/app_name.png b/user_config/usr/share/gtkcodethemer/icons/app_name.png new file mode 100644 index 0000000..c40fb0f Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/app_name.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/archive.png b/user_config/usr/share/gtkcodethemer/icons/archive.png new file mode 100644 index 0000000..7943e4e Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/archive.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/audio.png b/user_config/usr/share/gtkcodethemer/icons/audio.png new file mode 100644 index 0000000..c010134 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/audio.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/bin.png b/user_config/usr/share/gtkcodethemer/icons/bin.png new file mode 100644 index 0000000..d6954e3 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/bin.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/dir.png b/user_config/usr/share/gtkcodethemer/icons/dir.png new file mode 100644 index 0000000..a9b5e9f Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/dir.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/doc.png b/user_config/usr/share/gtkcodethemer/icons/doc.png new file mode 100644 index 0000000..f838826 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/doc.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/image.png b/user_config/usr/share/gtkcodethemer/icons/image.png new file mode 100644 index 0000000..46f1ae6 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/image.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/pdf.png b/user_config/usr/share/gtkcodethemer/icons/pdf.png new file mode 100644 index 0000000..9f40122 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/pdf.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/presentation.png b/user_config/usr/share/gtkcodethemer/icons/presentation.png new file mode 100644 index 0000000..3a339af Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/presentation.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/spreadsheet.png b/user_config/usr/share/gtkcodethemer/icons/spreadsheet.png new file mode 100644 index 0000000..710efa6 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/spreadsheet.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/text.png b/user_config/usr/share/gtkcodethemer/icons/text.png new file mode 100644 index 0000000..2546fcd Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/text.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/trash.png b/user_config/usr/share/gtkcodethemer/icons/trash.png new file mode 100644 index 0000000..c6514b9 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/trash.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/video.png b/user_config/usr/share/gtkcodethemer/icons/video.png new file mode 100644 index 0000000..55afa98 Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/video.png differ diff --git a/user_config/usr/share/gtkcodethemer/icons/web.png b/user_config/usr/share/gtkcodethemer/icons/web.png new file mode 100644 index 0000000..17017ce Binary files /dev/null and b/user_config/usr/share/gtkcodethemer/icons/web.png differ diff --git a/user_config/usr/share/gtkcodethemer/key-bindings.json b/user_config/usr/share/gtkcodethemer/key-bindings.json new file mode 100644 index 0000000..a172eea --- /dev/null +++ b/user_config/usr/share/gtkcodethemer/key-bindings.json @@ -0,0 +1,23 @@ +{ + "keybindings": { + "help" : "F1", + "rename_files" : ["F2", "e"], + "open_terminal" : "F4", + "refresh_tab" : ["F5", "r"], + "delete_files" : "Delete", + "tggl_top_main_menubar" : "Alt_L", + "trash_files" : "t", + "tear_down" : "q", + "go_up" : "Up", + "go_home" : "slash", + "grab_focus_path_entry" : "l", + "open_files" : "o", + "show_hide_hidden_files" : "h", + "keyboard_create_tab" : "t", + "keyboard_close_tab" : "w", + "keyboard_copy_files" : "c", + "keyboard_cut_files" : "x", + "paste_files" : "v", + "show_new_file_menu" : "n" + } +} diff --git a/user_config/usr/share/gtkcodethemer/stylesheet.css b/user_config/usr/share/gtkcodethemer/stylesheet.css new file mode 100644 index 0000000..ce012b1 --- /dev/null +++ b/user_config/usr/share/gtkcodethemer/stylesheet.css @@ -0,0 +1,130 @@ +.base-container { + margin: 10px; +} + + + + +/* * selection { + background-color: rgba(116, 0, 0, 0.65); + color: rgba(255, 255, 255, 0.5); +} */ + +/* Rubberband coloring */ +/* .rubberband, +rubberband, +flowbox rubberband, +treeview.view rubberband, +.content-view rubberband, +.content-view .rubberband, +XfdesktopIconView.view .rubberband { + border: 1px solid #6c6c6c; + background-color: rgba(21, 158, 167, 0.57); +} + +XfdesktopIconView.view:active { + background-color: rgba(172, 102, 21, 1); +} */ + + + + +.mw_transparency_1 { background: rgba(39, 43, 52, 0.1); } +.mw_transparency_2 { background: rgba(39, 43, 52, 0.2); } +.mw_transparency_3 { background: rgba(39, 43, 52, 0.3); } +.mw_transparency_4 { background: rgba(39, 43, 52, 0.4); } +.mw_transparency_5 { background: rgba(39, 43, 52, 0.5); } +.mw_transparency_6 { background: rgba(39, 43, 52, 0.6); } +.mw_transparency_7 { background: rgba(39, 43, 52, 0.7); } +.mw_transparency_8 { background: rgba(39, 43, 52, 0.8); } +.mw_transparency_9 { background: rgba(39, 43, 52, 0.9); } +.mw_transparency_10 { background: rgba(39, 43, 52, 0.10); } +.mw_transparency_11 { background: rgba(39, 43, 52, 0.11); } +.mw_transparency_12 { background: rgba(39, 43, 52, 0.12); } +.mw_transparency_13 { background: rgba(39, 43, 52, 0.13); } +.mw_transparency_14 { background: rgba(39, 43, 52, 0.14); } +.mw_transparency_15 { background: rgba(39, 43, 52, 0.15); } +.mw_transparency_16 { background: rgba(39, 43, 52, 0.16); } +.mw_transparency_17 { background: rgba(39, 43, 52, 0.17); } +.mw_transparency_18 { background: rgba(39, 43, 52, 0.18); } +.mw_transparency_19 { background: rgba(39, 43, 52, 0.19); } +.mw_transparency_20 { background: rgba(39, 43, 52, 0.20); } +.mw_transparency_21 { background: rgba(39, 43, 52, 0.21); } +.mw_transparency_22 { background: rgba(39, 43, 52, 0.22); } +.mw_transparency_23 { background: rgba(39, 43, 52, 0.23); } +.mw_transparency_24 { background: rgba(39, 43, 52, 0.24); } +.mw_transparency_25 { background: rgba(39, 43, 52, 0.25); } +.mw_transparency_26 { background: rgba(39, 43, 52, 0.26); } +.mw_transparency_27 { background: rgba(39, 43, 52, 0.27); } +.mw_transparency_28 { background: rgba(39, 43, 52, 0.28); } +.mw_transparency_29 { background: rgba(39, 43, 52, 0.29); } +.mw_transparency_30 { background: rgba(39, 43, 52, 0.30); } +.mw_transparency_31 { background: rgba(39, 43, 52, 0.31); } +.mw_transparency_32 { background: rgba(39, 43, 52, 0.32); } +.mw_transparency_33 { background: rgba(39, 43, 52, 0.33); } +.mw_transparency_34 { background: rgba(39, 43, 52, 0.34); } +.mw_transparency_35 { background: rgba(39, 43, 52, 0.35); } +.mw_transparency_36 { background: rgba(39, 43, 52, 0.36); } +.mw_transparency_37 { background: rgba(39, 43, 52, 0.37); } +.mw_transparency_38 { background: rgba(39, 43, 52, 0.38); } +.mw_transparency_39 { background: rgba(39, 43, 52, 0.39); } +.mw_transparency_40 { background: rgba(39, 43, 52, 0.40); } +.mw_transparency_41 { background: rgba(39, 43, 52, 0.41); } +.mw_transparency_42 { background: rgba(39, 43, 52, 0.42); } +.mw_transparency_43 { background: rgba(39, 43, 52, 0.43); } +.mw_transparency_44 { background: rgba(39, 43, 52, 0.44); } +.mw_transparency_45 { background: rgba(39, 43, 52, 0.45); } +.mw_transparency_46 { background: rgba(39, 43, 52, 0.46); } +.mw_transparency_47 { background: rgba(39, 43, 52, 0.47); } +.mw_transparency_48 { background: rgba(39, 43, 52, 0.48); } +.mw_transparency_49 { background: rgba(39, 43, 52, 0.49); } +.mw_transparency_50 { background: rgba(39, 43, 52, 0.50); } +.mw_transparency_51 { background: rgba(39, 43, 52, 0.51); } +.mw_transparency_52 { background: rgba(39, 43, 52, 0.52); } +.mw_transparency_53 { background: rgba(39, 43, 52, 0.53); } +.mw_transparency_54 { background: rgba(39, 43, 52, 0.54); } +.mw_transparency_55 { background: rgba(39, 43, 52, 0.55); } +.mw_transparency_56 { background: rgba(39, 43, 52, 0.56); } +.mw_transparency_57 { background: rgba(39, 43, 52, 0.57); } +.mw_transparency_58 { background: rgba(39, 43, 52, 0.58); } +.mw_transparency_59 { background: rgba(39, 43, 52, 0.59); } +.mw_transparency_60 { background: rgba(39, 43, 52, 0.60); } +.mw_transparency_61 { background: rgba(39, 43, 52, 0.61); } +.mw_transparency_62 { background: rgba(39, 43, 52, 0.62); } +.mw_transparency_63 { background: rgba(39, 43, 52, 0.63); } +.mw_transparency_64 { background: rgba(39, 43, 52, 0.64); } +.mw_transparency_65 { background: rgba(39, 43, 52, 0.65); } +.mw_transparency_66 { background: rgba(39, 43, 52, 0.66); } +.mw_transparency_67 { background: rgba(39, 43, 52, 0.67); } +.mw_transparency_68 { background: rgba(39, 43, 52, 0.68); } +.mw_transparency_69 { background: rgba(39, 43, 52, 0.69); } +.mw_transparency_70 { background: rgba(39, 43, 52, 0.70); } +.mw_transparency_71 { background: rgba(39, 43, 52, 0.71); } +.mw_transparency_72 { background: rgba(39, 43, 52, 0.72); } +.mw_transparency_73 { background: rgba(39, 43, 52, 0.73); } +.mw_transparency_74 { background: rgba(39, 43, 52, 0.74); } +.mw_transparency_75 { background: rgba(39, 43, 52, 0.75); } +.mw_transparency_76 { background: rgba(39, 43, 52, 0.76); } +.mw_transparency_77 { background: rgba(39, 43, 52, 0.77); } +.mw_transparency_78 { background: rgba(39, 43, 52, 0.78); } +.mw_transparency_79 { background: rgba(39, 43, 52, 0.79); } +.mw_transparency_80 { background: rgba(39, 43, 52, 0.80); } +.mw_transparency_81 { background: rgba(39, 43, 52, 0.81); } +.mw_transparency_82 { background: rgba(39, 43, 52, 0.82); } +.mw_transparency_83 { background: rgba(39, 43, 52, 0.83); } +.mw_transparency_84 { background: rgba(39, 43, 52, 0.84); } +.mw_transparency_85 { background: rgba(39, 43, 52, 0.85); } +.mw_transparency_86 { background: rgba(39, 43, 52, 0.86); } +.mw_transparency_87 { background: rgba(39, 43, 52, 0.87); } +.mw_transparency_88 { background: rgba(39, 43, 52, 0.88); } +.mw_transparency_89 { background: rgba(39, 43, 52, 0.89); } +.mw_transparency_90 { background: rgba(39, 43, 52, 0.90); } +.mw_transparency_91 { background: rgba(39, 43, 52, 0.91); } +.mw_transparency_92 { background: rgba(39, 43, 52, 0.92); } +.mw_transparency_93 { background: rgba(39, 43, 52, 0.93); } +.mw_transparency_94 { background: rgba(39, 43, 52, 0.94); } +.mw_transparency_95 { background: rgba(39, 43, 52, 0.95); } +.mw_transparency_96 { background: rgba(39, 43, 52, 0.96); } +.mw_transparency_97 { background: rgba(39, 43, 52, 0.97); } +.mw_transparency_98 { background: rgba(39, 43, 52, 0.98); } +.mw_transparency_99 { background: rgba(39, 43, 52, 0.99); }