diff --git a/CMakeLists.txt b/CMakeLists.txt
index 954fc8a..0eb8b14 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -451,7 +451,7 @@ if(APPLE OR WIN32)
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_VENDOR "ErrorAtLine0")
set(CPACK_PACKAGE_CONTACT "erroratline0@gmail.com")
- set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
endif()
if(APPLE)
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..53d1f3d
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,675 @@
+ 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
+.
+
diff --git a/LICENSE b/LICENSE
deleted file mode 100755
index 32be175..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright (c) 2026 Yousef Khadadeh
-
-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.
diff --git a/README.md b/README.md
index 85b147b..6456e5c 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
⚒️ Build Manual
-
+
@@ -75,4 +75,4 @@ This app was inspired by [Lorien](https://github.com/mbrlabs/Lorien), another gr
## Contribution
-Currently, I won't be accepting most pull requests. The program is at a stage where large parts of the code are constantly being rewritten, so unless it's something small and doesn't interfere with code I'm currently working on, I probably won't be merging it. Any issue reports (bug reports, feature requests, etc.) are welcome though!
+Currently, I won't be accepting pull requests. The program is at a stage where large parts of the code are constantly being rewritten. Any issue reports (bug reports, feature requests, etc.) are welcome though!
diff --git a/android-project/app/proguard-rules.pro b/android-project/app/proguard-rules.pro
index bcd9ebc..3156ca7 100644
--- a/android-project/app/proguard-rules.pro
+++ b/android-project/app/proguard-rules.pro
@@ -17,7 +17,9 @@
#}
-keep,includedescriptorclasses,allowoptimization class com.erroratline0.infinipaint.InfiniPaint {
- void startTextInput(int);
+ void startTextInput(long, java.lang.String, int, int, int);
+ void updateCursorPos(int, int);
+ void updateTextboxAndCursorPos(java.lang.String, int, int);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity {
diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml
index c8db854..b8111a8 100644
--- a/android-project/app/src/main/AndroidManifest.xml
+++ b/android-project/app/src/main/AndroidManifest.xml
@@ -79,6 +79,7 @@
.
+ */
+
package com.erroratline0.infinipaint;
import android.content.Context;
@@ -16,10 +34,6 @@ import org.libsdl.app.SDLActivity;
import org.libsdl.app.SDLDummyEdit;
import org.libsdl.app.SDLSurface;
-/**
- * A sample wrapper class that just calls SDLActivity
- */
-
public class InfiniPaint extends SDLActivity {
protected void onCreate(Bundle savedInstanceState) {
@@ -40,7 +54,7 @@ public class InfiniPaint extends SDLActivity {
}
static class StartInfiniPaintTextInputTask implements Runnable {
- public StartInfiniPaintTextInputTask(int textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
+ public StartInfiniPaintTextInputTask(long textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
mTextBoxID = textboxID;
mStr = str;
mSelectionBegin = selectionBegin;
@@ -48,7 +62,7 @@ public class InfiniPaint extends SDLActivity {
mInputType = inputType;
}
- int mTextBoxID;
+ long mTextBoxID;
String mStr;
int mSelectionBegin;
int mSelectionEnd;
@@ -57,29 +71,75 @@ public class InfiniPaint extends SDLActivity {
@Override
public void run() {
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1, 1);
+ //params.leftMargin = 1;
+ //params.topMargin = 1;
- if (mTextEdit == null) {
- mTextEdit = new InfiniPaintTextBoxView(getContext());
- mLayout.addView(mTextEdit, params);
+ if (mTextEdit2 == null) {
+ mTextEdit2 = new InfiniPaintTextBoxView(getContext());
+ mLayout.addView(mTextEdit2, params);
}
else {
- mTextEdit.setLayoutParams(params);
+ mTextEdit2.setLayoutParams(params);
}
- mTextEdit.setInitialData(mTextBoxID, mStr, mSelectionBegin, mSelectionEnd, mInputType);
- mTextEdit.setVisibility(View.VISIBLE);
- mTextEdit.requestFocus();
+ mTextEdit2.setInitialData(mTextBoxID, mStr, mSelectionBegin, mSelectionEnd, mInputType);
+ mTextEdit2.setVisibility(View.VISIBLE);
+ mTextEdit2.requestFocus();
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.showSoftInput(mTextEdit, 0);
+ imm.showSoftInput(mTextEdit2, 0);
if (imm.isAcceptingText())
onNativeScreenKeyboardShown();
}
}
- static public void startTextInput(int textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
- mSingleton.commandHandler.post(new StartInfiniPaintTextInputTask(textboxID, str, selectionBegin, selectionEnd, inputType));
+ static class InfiniPaintUpdateCursorPosTask implements Runnable {
+ public InfiniPaintUpdateCursorPosTask(int selectionBegin, int selectionEnd) {
+ mSelectionBegin = selectionBegin;
+ mSelectionEnd = selectionEnd;
+ }
+
+ int mSelectionBegin;
+ int mSelectionEnd;
+
+ @Override
+ public void run() {
+ if (mTextEdit2 != null) {
+ InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ mTextEdit2.ic.updateSelection(mSelectionBegin, mSelectionEnd);
+ imm.updateSelection(mTextEdit2, mSelectionBegin, mSelectionEnd, -1, -1);
+ }
+ }
}
- static InfiniPaintTextBoxView mTextEdit;
+ static class InfiniPaintUpdateTextboxAndCursorPosTask implements Runnable {
+ public InfiniPaintUpdateTextboxAndCursorPosTask(String str, int selectionBegin, int selectionEnd) {
+ mStr = str;
+ mSelectionBegin = selectionBegin;
+ mSelectionEnd = selectionEnd;
+ }
+
+ String mStr;
+ int mSelectionBegin;
+ int mSelectionEnd;
+
+ @Override
+ public void run() {
+ if (mTextEdit2 != null) {
+ InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ mTextEdit2.ic.clearAndSetNewTextAndSelection(mStr, mSelectionBegin, mSelectionEnd);
+ imm.updateSelection(mTextEdit2, mSelectionBegin, mSelectionEnd, -1, -1);
+ }
+ }
+ }
+
+ static public void startTextInput(long textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
+ mSingleton.commandHandler.post(new StartInfiniPaintTextInputTask(textboxID, str, selectionBegin, selectionEnd, inputType));
+ }
+ static public void updateCursorPos(int selectionBegin, int selectionEnd) {
+ mSingleton.commandHandler.post(new InfiniPaintUpdateCursorPosTask(selectionBegin, selectionEnd));
+ }
+ static public void updateTextboxAndCursorPos(String str, int selectionBegin, int selectionEnd) {
+ mSingleton.commandHandler.post(new InfiniPaintUpdateTextboxAndCursorPosTask(str, selectionBegin, selectionEnd));
+ }
}
diff --git a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintSurface.java b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintSurface.java
index da23356..cd1df22 100644
--- a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintSurface.java
+++ b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintSurface.java
@@ -1,8 +1,27 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
package com.erroratline0.infinipaint;
import android.content.Context;
import android.graphics.Insets;
import android.os.Build;
+import android.util.Log;
import android.view.View;
import android.view.WindowInsets;
@@ -34,7 +53,6 @@ public class InfiniPaintSurface extends SDLSurface {
WindowInsets.Type.ime());
nativeInfiniPaintUpdateIMESafeArea(imeInsets.top, imeInsets.bottom, imeInsets.left, imeInsets.right);
-
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom);
if (insets.isVisible(WindowInsets.Type.ime())) {
diff --git a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxEditable.java b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxEditable.java
new file mode 100644
index 0000000..cb81cfc
--- /dev/null
+++ b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxEditable.java
@@ -0,0 +1,122 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
+package com.erroratline0.infinipaint;
+
+import android.os.Build;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.SpannableStringBuilder;
+import android.widget.EditText;
+
+import java.util.stream.IntStream;
+
+public class InfiniPaintTextBoxEditable extends SpannableStringBuilder {
+ public static native void nativeReplace(long mTextBoxID, int st, int en, String str);
+ public static native String nativeGetString(long mTextBoxID);
+
+ public long mTextBoxID;
+
+ InfiniPaintTextBoxEditable() {
+ }
+
+ @Override
+ public SpannableStringBuilder replace(int st, int en, CharSequence source, int start, int end) {
+ nativeReplace(mTextBoxID, st, en, source.subSequence(start, end).toString());
+ return this;
+ }
+
+ @Override
+ public SpannableStringBuilder replace(int st, int en, CharSequence text) {
+ return replace(st, en, text, 0, text.length());
+ }
+
+ @Override
+ public SpannableStringBuilder insert(int where, CharSequence text, int start, int end) {
+ return replace(where, where, text, start, end);
+ }
+
+ @Override
+ public SpannableStringBuilder insert(int where, CharSequence text) {
+ return replace(where, where, text, 0, text.length());
+ }
+
+ @Override
+ public SpannableStringBuilder delete(int st, int en) {
+ return replace(st, en, "", 0, 0);
+ }
+
+ @Override
+ public SpannableStringBuilder append(CharSequence text) {
+ return replace(length(), length(), text, 0, text.length());
+ }
+
+ @Override
+ public SpannableStringBuilder append(CharSequence text, int start, int end) {
+ return replace(length(), length(), text, start, end);
+ }
+
+ @Override
+ public SpannableStringBuilder append(char text) {
+ return append(String.valueOf(text));
+ }
+
+ @Override
+ public void clear() {
+ replace(0, length(), "", 0, 0);
+ }
+
+ @Override
+ public int length() {
+ return nativeGetString(mTextBoxID).length();
+ }
+
+ @Override
+ public char charAt(int i) {
+ return nativeGetString(mTextBoxID).charAt(i);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return nativeGetString(mTextBoxID).isEmpty();
+ }
+
+ @Override
+ public CharSequence subSequence(int i, int i1) {
+ return nativeGetString(mTextBoxID).subSequence(i, i1);
+ }
+
+ @Override
+ public IntStream chars() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ return nativeGetString(mTextBoxID).chars();
+ return null;
+ }
+
+ @Override
+ public IntStream codePoints() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ return nativeGetString(mTextBoxID).codePoints();
+ return null;
+ }
+
+ @Override
+ public void getChars(int i, int i1, char[] chars, int i2) {
+ nativeGetString(mTextBoxID).getChars(i, i1, chars, i2);
+ }
+}
diff --git a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxInputConnection.java b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxInputConnection.java
index 6e61d01..9c1c4a9 100644
--- a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxInputConnection.java
+++ b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxInputConnection.java
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
package com.erroratline0.infinipaint;
import static android.text.TextUtils.CAP_MODE_SENTENCES;
@@ -9,7 +27,9 @@ import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Handler;
import android.text.Editable;
+import android.text.Selection;
import android.text.SpannableStringBuilder;
+import android.util.Log;
import android.view.*;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.CompletionInfo;
@@ -40,27 +60,38 @@ import org.libsdl.app.SDL;
import org.libsdl.app.SDLActivity;
public class InfiniPaintTextBoxInputConnection extends BaseInputConnection {
- public static native void nativeCommitText(int textboxID, String text, int newCursorPosition);
- public static native void nativeDeleteSurroundingText(int textboxID, int beforeLength, int afterLength);
- public static native void nativeSetSelection(int textboxID, int start, int end);
+ protected InfiniPaintTextBoxEditable mEditText;
+ protected long mTextBoxID;
- protected EditText mEditText;
- protected int mTextBoxID;
+ public static native int[] nativeGetSelection(long mTextBoxID);
+ public static native void nativeShiftSelection(long mTextBoxID, int amount);
+ public static native void nativeSetSelection(long mTextBoxID, int start, int end);
InfiniPaintTextBoxInputConnection(View targetView, boolean fullEditor) {
super(targetView, fullEditor);
- mEditText = new EditText(SDL.getContext());
+ mEditText = new InfiniPaintTextBoxEditable();
}
- public void setInitialData(int textboxID, String initialText, int begin, int end) {
+ public void setInitialData(long textboxID, String initialText, int begin, int end) {
mTextBoxID = textboxID;
- mEditText.setText(initialText);
- mEditText.setSelection(begin, end);
+ mEditText.mTextBoxID = textboxID;
+ Selection.setSelection(mEditText, begin, end);
+ }
+
+ public void updateSelection(int start, int end) {
+ Selection.setSelection(mEditText, start, end);
+ }
+
+ public void clearAndSetNewTextAndSelection(String str, int start, int end) {
+ finishComposingText();
+ mEditText.clear();
+ mEditText.replace(0, 0, str);
+ Selection.setSelection(mEditText, start, end);
}
@Override
public Editable getEditable() {
- return mEditText.getEditableText();
+ return mEditText;
}
@Override
@@ -82,31 +113,147 @@ public class InfiniPaintTextBoxInputConnection extends BaseInputConnection {
return true;
}
}
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_DEL && event.getAction() == KeyEvent.ACTION_DOWN) {
+ int start = Selection.getSelectionStart(mEditText);
+ int end = Selection.getSelectionEnd(mEditText);
+ if(start != end)
+ commitText("", 0);
+ else {
+ nativeShiftSelection(mTextBoxID, -1);
+ int[] p = nativeGetSelection(mTextBoxID);
+ if(p[0] != start)
+ deleteSurroundingText(start - p[0], 0);
+ }
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_DPAD_LEFT && event.getAction() == KeyEvent.ACTION_DOWN) {
+ leftKey();
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_DPAD_RIGHT && event.getAction() == KeyEvent.ACTION_DOWN) {
+ rightKey();
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_0 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("0", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_1 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("1", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_2 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("2", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_3 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("3", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_4 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("4", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_5 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("5", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_6 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("6", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_7 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("7", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_8 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("8", 1);
+ return true;
+ }
+ else if(event.getKeyCode() == KeyEvent.KEYCODE_9 && event.getAction() == KeyEvent.ACTION_DOWN) {
+ finishComposingText();
+ commitText("9", 1);
+ return true;
+ }
return super.sendKeyEvent(event);
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
- if (!super.commitText(text, newCursorPosition))
- return false;
- nativeCommitText(mTextBoxID, text.toString(), newCursorPosition);
+ // Manually do commitText
+ int composingTextBegin = getComposingSpanStart(mEditText);
+ int composingTextEnd = getComposingSpanEnd(mEditText);
+ int start, end;
+
+ if(composingTextBegin != -1 && composingTextEnd != -1) {
+ start = Math.min(composingTextBegin, composingTextEnd);
+ end = Math.max(composingTextBegin, composingTextEnd);
+ }
+ else {
+ start = Math.min(Selection.getSelectionStart(mEditText), Selection.getSelectionEnd(mEditText));
+ end = Math.max(Selection.getSelectionStart(mEditText), Selection.getSelectionEnd(mEditText));
+ }
+
+ mEditText.replace(start, end, text);
+ if(newCursorPosition <= 0)
+ setSelection(start + newCursorPosition, start + newCursorPosition);
+ else
+ setSelection(start + text.length() + newCursorPosition - 1, start + text.length() + newCursorPosition - 1);
return true;
}
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
- if (!super.setComposingText(text, newCursorPosition))
- return false;
- nativeCommitText(mTextBoxID, text.toString(), newCursorPosition);
+ // Manually do setComposingText
+ int composingTextBegin = getComposingSpanStart(mEditText);
+ int composingTextEnd = getComposingSpanEnd(mEditText);
+ int start, end;
+
+ if(composingTextBegin != -1 && composingTextEnd != -1) {
+ start = Math.min(composingTextBegin, composingTextEnd);
+ end = Math.max(composingTextBegin, composingTextEnd);
+ }
+ else {
+ start = Math.min(Selection.getSelectionStart(mEditText), Selection.getSelectionEnd(mEditText));
+ end = Math.max(Selection.getSelectionStart(mEditText), Selection.getSelectionEnd(mEditText));
+ }
+ mEditText.replace(start, end, text);
+ if(newCursorPosition <= 0)
+ setSelection(start + newCursorPosition, start + newCursorPosition);
+ else
+ setSelection(start + text.length() + newCursorPosition - 1, start + text.length() + newCursorPosition - 1);
+
+ setComposingRegion(start, start + text.length());
+
return true;
}
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
+ int start = Math.min(Selection.getSelectionStart(mEditText), Selection.getSelectionEnd(mEditText));
if (!super.deleteSurroundingText(beforeLength, afterLength))
return false;
- nativeDeleteSurroundingText(mTextBoxID, beforeLength, afterLength);
+ int newCursorPos = Math.max(start - beforeLength, 0);
+ setSelection(newCursorPos, newCursorPos);
+ return true;
+ }
+
+ @Override
+ public boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) {
+ if (!super.deleteSurroundingTextInCodePoints(beforeLength, afterLength))
+ return false;
+ int[] p = nativeGetSelection(mTextBoxID);
+ Selection.setSelection(mEditText, p[0], p[1]);
return true;
}
@@ -115,7 +262,29 @@ public class InfiniPaintTextBoxInputConnection extends BaseInputConnection {
if(!super.setSelection(start, end))
return false;
nativeSetSelection(mTextBoxID, start, end);
+ int[] p = nativeGetSelection(mTextBoxID);
+ Selection.setSelection(mEditText, p[0], p[1]);
return true;
}
+
+ @Override
+ public boolean replaceText(int start, int end, CharSequence text, int newCursorPosition, TextAttribute textAttribute) {
+ finishComposingText();
+ setSelection(start, end);
+ commitText(text, newCursorPosition);
+ return true;
+ }
+
+ public void leftKey() {
+ nativeShiftSelection(mTextBoxID, -1);
+ int[] p = nativeGetSelection(mTextBoxID);
+ Selection.setSelection(mEditText, p[0], p[1]);
+ }
+
+ public void rightKey() {
+ nativeShiftSelection(mTextBoxID, 1);
+ int[] p = nativeGetSelection(mTextBoxID);
+ Selection.setSelection(mEditText, p[0], p[1]);
+ }
}
diff --git a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxView.java b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxView.java
index 6c1114a..e7c673b 100644
--- a/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxView.java
+++ b/android-project/app/src/main/java/com/erroratline0/infinipaint/InfiniPaintTextBoxView.java
@@ -1,16 +1,38 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
package com.erroratline0.infinipaint;
import android.content.*;
import android.text.InputType;
+import android.text.Selection;
+import android.util.Log;
import android.view.*;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
-public class InfiniPaintTextBoxView extends View
+import org.libsdl.app.SDLActivity;
+
+public class InfiniPaintTextBoxView extends View implements View.OnKeyListener
{
public InfiniPaintTextBoxInputConnection ic;
- int mTextBoxID;
+ long mTextBoxID;
String mStr;
int mSelectionBegin;
int mSelectionEnd;
@@ -20,9 +42,10 @@ public class InfiniPaintTextBoxView extends View
super(context);
setFocusableInTouchMode(true);
setFocusable(true);
+ setOnKeyListener(this);
}
- void setInitialData(int textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
+ void setInitialData(long textboxID, String str, int selectionBegin, int selectionEnd, int inputType) {
mTextBoxID = textboxID;
mStr = str;
mSelectionBegin = selectionBegin;
@@ -35,6 +58,23 @@ public class InfiniPaintTextBoxView extends View
return true;
}
+ @Override
+ public boolean onKeyPreIme (int keyCode, KeyEvent event) {
+ // As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
+ // FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
+ // FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
+ // FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout
+ // FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
+ // FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
+ if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
+ if (SDLActivity.mTextEdit2 != null && SDLActivity.mTextEdit2.getVisibility() == View.VISIBLE) {
+ SDLActivity.onNativeKeyboardFocusLost();
+ }
+ }
+
+ return super.onKeyPreIme(keyCode, event);
+ }
+
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
ic = new InfiniPaintTextBoxInputConnection(this, true);
@@ -42,10 +82,14 @@ public class InfiniPaintTextBoxView extends View
outAttrs.inputType = mInputType;
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
- EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */ |
- EditorInfo.IME_ACTION_DONE;
+ EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
return ic;
}
+
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ return SDLActivity.handleKeyEvent(v, keyCode, event, ic);
+ }
}
diff --git a/android-project/app/src/main/java/com/erroratline0/infinipaint/IntPair.java b/android-project/app/src/main/java/com/erroratline0/infinipaint/IntPair.java
deleted file mode 100644
index 4562719..0000000
--- a/android-project/app/src/main/java/com/erroratline0/infinipaint/IntPair.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.erroratline0.infinipaint;
-
-public class IntPair {
- IntPair() {
- first = 0;
- second = 0;
- }
- IntPair(int initFirst, int initSecond) {
- first = initFirst;
- second = initSecond;
- }
- public int first;
- public int second;
-}
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index d0edb48..a6be515 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -48,6 +48,8 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
+import com.erroratline0.infinipaint.InfiniPaintTextBoxView;
+
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Hashtable;
@@ -57,7 +59,7 @@ import java.util.Locale;
/**
SDL Activity
*/
-public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
+public abstract class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 4;
@@ -215,6 +217,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
protected static SDLActivity mSingleton;
protected static SDLSurface mSurface;
protected static SDLDummyEdit mTextEdit;
+ public static InfiniPaintTextBoxView mTextEdit2;
protected static ViewGroup mLayout;
protected static SDLClipboardHandler mClipboardHandler;
protected static Hashtable mCursors;
@@ -326,6 +329,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
mSingleton = null;
mSurface = null;
mTextEdit = null;
+ mTextEdit2 = null;
mLayout = null;
mClipboardHandler = null;
mCursors = new Hashtable();
@@ -943,14 +947,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
break;
case COMMAND_TEXTEDIT_HIDE:
- if (mTextEdit != null) {
+ if (mTextEdit2 != null) {
// Note: On some devices setting view to GONE creates a flicker in landscape.
// Setting the View's sizes to 0 is similar to GONE but without the flicker.
// The sizes will be set to useful values when the keyboard is shown again.
- mTextEdit.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
+ mTextEdit2.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
+ imm.hideSoftInputFromWindow(mTextEdit2.getWindowToken(), 0);
onNativeScreenKeyboardHidden();
diff --git a/assets/data/icons/RemixIcon/font-serif.svg b/assets/data/icons/RemixIcon/font-serif.svg
new file mode 100644
index 0000000..02292dc
--- /dev/null
+++ b/assets/data/icons/RemixIcon/font-serif.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/include/Helpers/CallbackManager.hpp b/include/Helpers/CallbackManager.hpp
index bd93c2e..2308cdb 100644
--- a/include/Helpers/CallbackManager.hpp
+++ b/include/Helpers/CallbackManager.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/ConvertVec.hpp b/include/Helpers/ConvertVec.hpp
index 4259f2b..cc017a8 100644
--- a/include/Helpers/ConvertVec.hpp
+++ b/include/Helpers/ConvertVec.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
diff --git a/include/Helpers/FileDownloader.cpp b/include/Helpers/FileDownloader.cpp
index 47bac7f..b898ef7 100644
--- a/include/Helpers/FileDownloader.cpp
+++ b/include/Helpers/FileDownloader.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "FileDownloader.hpp"
#ifndef __EMSCRIPTEN__
diff --git a/include/Helpers/FileDownloader.hpp b/include/Helpers/FileDownloader.hpp
index fabac9d..b6c12d4 100644
--- a/include/Helpers/FileDownloader.hpp
+++ b/include/Helpers/FileDownloader.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/FileDownloaderEmscripten.cpp b/include/Helpers/FileDownloaderEmscripten.cpp
index 91a3eb6..bac003a 100644
--- a/include/Helpers/FileDownloaderEmscripten.cpp
+++ b/include/Helpers/FileDownloaderEmscripten.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#ifdef __EMSCRIPTEN__
#include "FileDownloader.hpp"
#include
diff --git a/include/Helpers/FixedPoint.hpp b/include/Helpers/FixedPoint.hpp
index e11bd61..3a66bfd 100644
--- a/include/Helpers/FixedPoint.hpp
+++ b/include/Helpers/FixedPoint.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Helpers/StringHelpers.hpp"
#include
diff --git a/include/Helpers/Logger.cpp b/include/Helpers/Logger.cpp
index 0c623e0..c65fcd4 100644
--- a/include/Helpers/Logger.cpp
+++ b/include/Helpers/Logger.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "Logger.hpp"
#include
#include
diff --git a/include/Helpers/Logger.hpp b/include/Helpers/Logger.hpp
index c5e6f5b..2baff36 100644
--- a/include/Helpers/Logger.hpp
+++ b/include/Helpers/Logger.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/MathExtras.hpp b/include/Helpers/MathExtras.hpp
index 506451c..2db3c09 100644
--- a/include/Helpers/MathExtras.hpp
+++ b/include/Helpers/MathExtras.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/Networking/ByteStream.cpp b/include/Helpers/Networking/ByteStream.cpp
index 3dfabd0..e103084 100644
--- a/include/Helpers/Networking/ByteStream.cpp
+++ b/include/Helpers/Networking/ByteStream.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ByteStream.hpp"
#include
#include
diff --git a/include/Helpers/Networking/ByteStream.hpp b/include/Helpers/Networking/ByteStream.hpp
index ca62e30..d87a9d6 100644
--- a/include/Helpers/Networking/ByteStream.hpp
+++ b/include/Helpers/Networking/ByteStream.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/Networking/NetClient.cpp b/include/Helpers/Networking/NetClient.cpp
index 6ed5903..7fbed18 100644
--- a/include/Helpers/Networking/NetClient.cpp
+++ b/include/Helpers/Networking/NetClient.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetClient.hpp"
#include "NetLibrary.hpp"
#include "NetServer.hpp"
diff --git a/include/Helpers/Networking/NetClient.hpp b/include/Helpers/Networking/NetClient.hpp
index 63d1488..d8cabd4 100644
--- a/include/Helpers/Networking/NetClient.hpp
+++ b/include/Helpers/Networking/NetClient.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/Networking/NetLibrary.cpp b/include/Helpers/Networking/NetLibrary.cpp
index bb6d1fd..2d8251d 100644
--- a/include/Helpers/Networking/NetLibrary.cpp
+++ b/include/Helpers/Networking/NetLibrary.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetLibrary.hpp"
#include
#include
diff --git a/include/Helpers/Networking/NetLibrary.hpp b/include/Helpers/Networking/NetLibrary.hpp
index 048c6e0..1dc56f6 100644
--- a/include/Helpers/Networking/NetLibrary.hpp
+++ b/include/Helpers/Networking/NetLibrary.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/Networking/NetServer.cpp b/include/Helpers/Networking/NetServer.cpp
index f9e910e..cae9f4d 100644
--- a/include/Helpers/Networking/NetServer.cpp
+++ b/include/Helpers/Networking/NetServer.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetServer.hpp"
#include "Helpers/Networking/ByteStream.hpp"
#include "NetLibrary.hpp"
diff --git a/include/Helpers/Networking/NetServer.hpp b/include/Helpers/Networking/NetServer.hpp
index e64e3d9..741fba1 100644
--- a/include/Helpers/Networking/NetServer.hpp
+++ b/include/Helpers/Networking/NetServer.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.cpp b/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.cpp
index d991906..9cf99dc 100644
--- a/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.cpp
+++ b/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DelayUpdateSerializedClassManager.hpp"
#include
diff --git a/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.hpp b/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.hpp
index cbd6349..3a0daa6 100644
--- a/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.hpp
+++ b/include/Helpers/NetworkingObjects/DelayUpdateSerializedClassManager.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Helpers/Networking/NetLibrary.hpp"
#include "NetObjWeakPtr.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjGenericSerializedClass.hpp b/include/Helpers/NetworkingObjects/NetObjGenericSerializedClass.hpp
index 772750e..51bf75a 100644
--- a/include/Helpers/NetworkingObjects/NetObjGenericSerializedClass.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjGenericSerializedClass.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjTemporaryPtr.hpp"
#include "cereal/archives/portable_binary.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjID.cpp b/include/Helpers/NetworkingObjects/NetObjID.cpp
index 110657a..3e707c6 100644
--- a/include/Helpers/NetworkingObjects/NetObjID.cpp
+++ b/include/Helpers/NetworkingObjects/NetObjID.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetObjID.hpp"
namespace NetworkingObjects {
diff --git a/include/Helpers/NetworkingObjects/NetObjID.hpp b/include/Helpers/NetworkingObjects/NetObjID.hpp
index c649da6..81c9d1c 100644
--- a/include/Helpers/NetworkingObjects/NetObjID.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjID.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjManager.cpp b/include/Helpers/NetworkingObjects/NetObjManager.cpp
index 74af80a..a4d1fde 100644
--- a/include/Helpers/NetworkingObjects/NetObjManager.cpp
+++ b/include/Helpers/NetworkingObjects/NetObjManager.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetObjManager.hpp"
#include "NetObjTemporaryPtr.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjManager.hpp b/include/Helpers/NetworkingObjects/NetObjManager.hpp
index 0c72c84..3af9b0e 100644
--- a/include/Helpers/NetworkingObjects/NetObjManager.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjManager.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjManagerTypeList.cpp b/include/Helpers/NetworkingObjects/NetObjManagerTypeList.cpp
index 1506c5c..ef262e9 100644
--- a/include/Helpers/NetworkingObjects/NetObjManagerTypeList.cpp
+++ b/include/Helpers/NetworkingObjects/NetObjManagerTypeList.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "NetObjManagerTypeList.hpp"
namespace NetworkingObjects {
diff --git a/include/Helpers/NetworkingObjects/NetObjManagerTypeList.hpp b/include/Helpers/NetworkingObjects/NetObjManagerTypeList.hpp
index 22285e5..4624689 100644
--- a/include/Helpers/NetworkingObjects/NetObjManagerTypeList.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjManagerTypeList.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../Networking/NetLibrary.hpp"
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjOrderedList.hpp b/include/Helpers/NetworkingObjects/NetObjOrderedList.hpp
index ab67db9..a7f4447 100644
--- a/include/Helpers/NetworkingObjects/NetObjOrderedList.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjOrderedList.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Helpers/Networking/NetLibrary.hpp"
#include "NetObjOwnerPtr.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.decl.hpp b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.decl.hpp
index 7fa1b73..376e2e8 100644
--- a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.decl.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.decl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjID.hpp"
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.hpp b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.hpp
index c4aab5d..3261367 100644
--- a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjOwnerPtr.decl.hpp"
#include "NetObjOwnerPtr.impl.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.impl.hpp b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.impl.hpp
index 97ab120..fd4324d 100644
--- a/include/Helpers/NetworkingObjects/NetObjOwnerPtr.impl.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjOwnerPtr.impl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp
index cca5950..2cc2098 100644
--- a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.decl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjID.hpp"
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.hpp b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.hpp
index bc380d0..24daa15 100644
--- a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjTemporaryPtr.decl.hpp"
#include "NetObjTemporaryPtr.impl.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.impl.hpp b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.impl.hpp
index 3257b13..8122446 100644
--- a/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.impl.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjTemporaryPtr.impl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/NetworkingObjects/NetObjUnorderedSet.hpp b/include/Helpers/NetworkingObjects/NetObjUnorderedSet.hpp
index 1be67b8..e5b40cb 100644
--- a/include/Helpers/NetworkingObjects/NetObjUnorderedSet.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjUnorderedSet.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Helpers/Networking/NetLibrary.hpp"
#include "Helpers/NetworkingObjects/NetObjOwnerPtr.decl.hpp"
diff --git a/include/Helpers/NetworkingObjects/NetObjWeakPtr.hpp b/include/Helpers/NetworkingObjects/NetObjWeakPtr.hpp
index b6b1090..9d7818b 100644
--- a/include/Helpers/NetworkingObjects/NetObjWeakPtr.hpp
+++ b/include/Helpers/NetworkingObjects/NetObjWeakPtr.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "NetObjID.hpp"
#include "NetObjManager.hpp"
diff --git a/include/Helpers/Parallel.hpp b/include/Helpers/Parallel.hpp
index c3319bc..32b46bf 100644
--- a/include/Helpers/Parallel.hpp
+++ b/include/Helpers/Parallel.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#ifdef __APPLE__
diff --git a/include/Helpers/Random.cpp b/include/Helpers/Random.cpp
index 6f97177..f3db7ac 100644
--- a/include/Helpers/Random.cpp
+++ b/include/Helpers/Random.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "Random.hpp"
Random Random::global;
diff --git a/include/Helpers/Random.hpp b/include/Helpers/Random.hpp
index abb4077..e18dcb2 100644
--- a/include/Helpers/Random.hpp
+++ b/include/Helpers/Random.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
diff --git a/include/Helpers/SCollision.hpp b/include/Helpers/SCollision.hpp
index 9db6f6e..0d6327c 100644
--- a/include/Helpers/SCollision.hpp
+++ b/include/Helpers/SCollision.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Helpers/MathExtras.hpp"
#include
diff --git a/include/Helpers/StringHelpers.cpp b/include/Helpers/StringHelpers.cpp
index 882141b..ac7e46c 100644
--- a/include/Helpers/StringHelpers.cpp
+++ b/include/Helpers/StringHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "StringHelpers.hpp"
#include
#include
diff --git a/include/Helpers/StringHelpers.hpp b/include/Helpers/StringHelpers.hpp
index 2813894..81e57cf 100644
--- a/include/Helpers/StringHelpers.hpp
+++ b/include/Helpers/StringHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/include/Helpers/VersionNumber.cpp b/include/Helpers/VersionNumber.cpp
index 5d88f04..8db85f2 100644
--- a/include/Helpers/VersionNumber.cpp
+++ b/include/Helpers/VersionNumber.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "VersionNumber.hpp"
#include "StringHelpers.hpp"
diff --git a/include/Helpers/VersionNumber.hpp b/include/Helpers/VersionNumber.hpp
index 5067102..3a567af 100644
--- a/include/Helpers/VersionNumber.hpp
+++ b/include/Helpers/VersionNumber.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/linuxinstall/com.infinipaint.infinipaint.metainfo.xml b/linuxinstall/com.infinipaint.infinipaint.metainfo.xml
index 1b23da8..9860a5b 100644
--- a/linuxinstall/com.infinipaint.infinipaint.metainfo.xml
+++ b/linuxinstall/com.infinipaint.infinipaint.metainfo.xml
@@ -1,11 +1,11 @@
-
+
com.infinipaint.infinipaint
Infinipaint
Draw on a big canvas
CC0-1.0
- MIT
+ GPL-3.0-or-later
#83b9b2
diff --git a/macosinstall/Info.plist b/macosinstall/Info.plist
index a0a589e..d59bab5 100755
--- a/macosinstall/Info.plist
+++ b/macosinstall/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageType
APPL
NSHumanReadableCopyright
- Copyright (c) 2026 Yousef Khadadeh
+ Copyright (C) 2025-2026 Yousef Khadadeh
CFBundleDevelopmentRegion
en-US
CFBundleExecutable
diff --git a/src/AndroidJNICalls.cpp b/src/AndroidJNICalls.cpp
index ac77b7e..175c6b2 100644
--- a/src/AndroidJNICalls.cpp
+++ b/src/AndroidJNICalls.cpp
@@ -1,78 +1,312 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#ifdef __ANDROID__
#include "AndroidJNICalls.hpp"
#include
#include "InputManager.hpp"
#include "MainProgram.hpp"
#include
-#include
#include
+#include
+#include
-namespace AndroidJNICalls {
- InputManager* globalInputManager;
- std::mutex globalCallMutex;
-
- void startTextInput(int input_type) {
- JNIEnv* env = static_cast(SDL_GetAndroidJNIEnv());
- Logger::get().log("INFO", std::to_string((uint64_t)env) + " jni env value");
- jobject activity = (jobject)SDL_GetAndroidActivity();
- Logger::get().log("INFO", std::to_string((uint64_t)activity) + " activity value");
- jclass clazz = env->GetObjectClass(activity);
- jmethodID method_id = env->GetStaticMethodID(clazz, "startTextInput", "(I)V");
- Logger::get().log("INFO", std::to_string((uint64_t)method_id) + " method value");
- env->CallStaticVoidMethod(clazz, method_id, input_type);
- env->DeleteLocalRef(activity);
- env->DeleteLocalRef(clazz);
- }
-
- void stopTextInput() {
-
- }
-}
-
-jobject activity;
-jmethodID startTextInputMethod;
-JNIEnv* jniEnv;
-
-using namespace AndroidJNICalls;
-
-
-// https://stackoverflow.com/questions/41820039/jstringjni-to-stdstringc-with-utf8-characters
std::string jstring2string(JNIEnv *env, jstring jStr) {
if (!jStr)
return "";
- const jclass stringClass = env->GetObjectClass(jStr);
- const jmethodID getBytes = env->GetMethodID(stringClass, "getBytes", "(Ljava/lang/String;)[B");
- const jbyteArray stringJbytes = (jbyteArray) env->CallObjectMethod(jStr, getBytes, env->NewStringUTF("UTF-8"));
+ const jchar* c = env->GetStringChars(jStr, nullptr);
+ if(!c)
+ return "";
+ jsize len = env->GetStringLength(jStr);
- size_t length = (size_t) env->GetArrayLength(stringJbytes);
- jbyte* pBytes = env->GetByteArrayElements(stringJbytes, NULL);
+ SkString str = SkUnicodes::ICU::Make()->convertUtf16ToUtf8((const char16_t*)c, len);
- std::string ret = std::string((char *)pBytes, length);
- env->ReleaseByteArrayElements(stringJbytes, pBytes, JNI_ABORT);
-
- env->DeleteLocalRef(stringJbytes);
- env->DeleteLocalRef(stringClass);
- return ret;
+ return std::string(str.c_str(), str.size());
}
+jstring string2jstring(JNIEnv* env, const std::string& s) {
+ std::u16string u16str = SkUnicodes::ICU::Make()->convertUtf8ToUtf16(s.c_str(), s.size());
+ return env->NewString((const jchar*)u16str.data(), u16str.length());
+}
+
+namespace AndroidJNICalls {
+ InputManager* globalInputManager;
+
+ std::mutex textboxMutex;
+ CustomEvents::InputTextBoxID textboxID = 0;
+ std::shared_ptr textBox;
+ std::shared_ptr cursor;
+ std::shared_ptr modMap;
+ bool textChanged = false;
+ bool cursorChanged = false;
+
+ int get_android_text_pos_from_cursor_pos(const std::shared_ptr& t, const RichText::TextPosition& p) {
+ return t->get_utf16_location_from_codepoint_location(t->get_codepoint_location_from_text_position(p));
+ }
+
+ RichText::TextPosition get_cursor_pos_from_android_text_pos(const std::shared_ptr& t, int p) {
+ return t->get_text_position_from_codepoint_location(t->get_codepoint_location_from_utf16_location(p));
+ }
+
+ void startTextInput(CustomEvents::InputTextBoxID newTextboxID, const std::shared_ptr& newTextbox, const std::shared_ptr& newCursor, const std::shared_ptr& newModMap, int inputType) {
+ std::scoped_lock a{textboxMutex};
+ if(!textBox) {
+ textBox = std::make_shared();
+ cursor = std::make_shared();
+ }
+
+ textChanged = false;
+ cursorChanged = false;
+
+ textboxID = newTextboxID;
+ textBox->set_rich_text_data(newTextbox->get_rich_text_data());
+ *cursor = *newCursor;
+
+ if(newModMap)
+ modMap = std::make_shared(*newModMap);
+ else
+ modMap = nullptr;
+
+ JNIEnv* env = static_cast(SDL_GetAndroidJNIEnv());
+ jobject activity = (jobject)SDL_GetAndroidActivity();
+ jclass clazz = env->GetObjectClass(activity);
+ jmethodID method_id = env->GetStaticMethodID(clazz, "startTextInput", "(JLjava/lang/String;III)V");
+ env->CallStaticVoidMethod(clazz, method_id, textboxID, string2jstring(env, textBox->get_string()),
+ get_android_text_pos_from_cursor_pos(textBox, std::min(cursor->selectionBeginPos, cursor->selectionEndPos)),
+ get_android_text_pos_from_cursor_pos(textBox, std::max(cursor->selectionBeginPos, cursor->selectionEndPos)), inputType);
+ env->DeleteLocalRef(activity);
+ env->DeleteLocalRef(clazz);
+ }
+
+ void updateModMap(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newModMap) {
+ std::scoped_lock a{textboxMutex};
+ if(tId == textboxID && newModMap && modMap)
+ *modMap = *newModMap;
+ }
+
+ void updateCursorPos(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newCursor) {
+ std::scoped_lock a{textboxMutex};
+
+ if(tId == textboxID) {
+ *cursor = *newCursor;
+
+ JNIEnv* env = static_cast(SDL_GetAndroidJNIEnv());
+ jobject activity = (jobject)SDL_GetAndroidActivity();
+ jclass clazz = env->GetObjectClass(activity);
+ jmethodID method_id = env->GetStaticMethodID(clazz, "updateCursorPos", "(II)V");
+ env->CallStaticVoidMethod(clazz, method_id,
+ get_android_text_pos_from_cursor_pos(textBox, std::min(cursor->selectionBeginPos, cursor->selectionEndPos)),
+ get_android_text_pos_from_cursor_pos(textBox, std::max(cursor->selectionBeginPos, cursor->selectionEndPos)));
+ env->DeleteLocalRef(activity);
+ env->DeleteLocalRef(clazz);
+ }
+ }
+
+ void updateTextboxAndCursorPos(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newTextbox, const std::shared_ptr& newCursor) {
+ std::scoped_lock a{textboxMutex};
+
+ if(tId == textboxID) {
+ *cursor = *newCursor;
+ textBox->set_rich_text_data(newTextbox->get_rich_text_data());
+
+ JNIEnv* env = static_cast(SDL_GetAndroidJNIEnv());
+ jobject activity = (jobject)SDL_GetAndroidActivity();
+ jclass clazz = env->GetObjectClass(activity);
+ jmethodID method_id = env->GetStaticMethodID(clazz, "updateCursorPos", "(II)V");
+ env->CallStaticVoidMethod(clazz, method_id,
+ get_android_text_pos_from_cursor_pos(textBox, std::min(cursor->selectionBeginPos, cursor->selectionEndPos)),
+ get_android_text_pos_from_cursor_pos(textBox, std::max(cursor->selectionBeginPos, cursor->selectionEndPos)));
+ env->DeleteLocalRef(activity);
+ env->DeleteLocalRef(clazz);
+ }
+ }
+
+ std::pair getChangesToCommit(CustomEvents::InputTextBoxID tId) {
+ std::scoped_lock a{textboxMutex};
+
+ if(tId == textboxID)
+ return {textChanged, cursorChanged};
+ return {false, false};
+ }
+
+ std::pair commitAll(CustomEvents::InputTextBoxID tId, const std::shared_ptr& t, const std::shared_ptr& c) {
+ std::scoped_lock a{textboxMutex};
+
+ if(tId == textboxID) {
+ bool oldTextChanged = textChanged;
+ bool oldCursorChanged = cursorChanged;
+
+ if (textChanged) {
+ t->set_rich_text_data(textBox->get_rich_text_data());
+ textChanged = false;
+ }
+ if (cursorChanged) {
+ *c = *cursor;
+ cursorChanged = false;
+ }
+ return {oldTextChanged, oldCursorChanged};
+ }
+ else
+ return {false, false};
+ }
+
+
+ struct TextInputData {
+ enum class CommandType {
+ REPLACE_TEXT,
+ SHIFT_CURSOR,
+ SET_CURSOR
+ } command;
+ std::string strData;
+ Vector3i intData;
+ };
+
+ void input_android_text_box(const TextInputData& textboxInput) {
+ switch(textboxInput.command) {
+ case TextInputData::CommandType::REPLACE_TEXT: {
+ textBox->remove(get_cursor_pos_from_android_text_pos(textBox, textboxInput.intData.x()), get_cursor_pos_from_android_text_pos(textBox, textboxInput.intData.y()));
+ textBox->insert(get_cursor_pos_from_android_text_pos(textBox, textboxInput.intData.x()), textboxInput.strData, modMap ? std::optional(*modMap) : std::nullopt);
+ textChanged = cursorChanged = true;
+ break;
+ }
+ case TextInputData::CommandType::SHIFT_CURSOR: {
+ int newCursorPosition = textboxInput.intData.x();
+ cursor->pos = std::min(cursor->selectionBeginPos, cursor->selectionEndPos);
+ if(newCursorPosition < 0) {
+ for(int i = 0; i < (-newCursorPosition); i++)
+ cursor->selectionBeginPos = cursor->selectionEndPos = cursor->pos = textBox->move(RichText::TextBox::Movement::LEFT, cursor->pos);
+ }
+ else {
+ for(int i = 0; i < newCursorPosition; i++)
+ cursor->selectionBeginPos = cursor->selectionEndPos = cursor->pos = textBox->move(RichText::TextBox::Movement::RIGHT, cursor->pos);
+ }
+ cursorChanged = true;
+ break;
+ }
+ case TextInputData::CommandType::SET_CURSOR: {
+ cursor->selectionBeginPos = get_cursor_pos_from_android_text_pos(textBox, textboxInput.intData.x());
+ cursor->selectionEndPos = cursor->pos = get_cursor_pos_from_android_text_pos(textBox, textboxInput.intData.y());
+ cursorChanged = true;
+ break;
+ }
+ }
+ }
+}
+
+jobject activity;
+
+using namespace AndroidJNICalls;
+
extern "C"
JNIEXPORT void JNICALL
Java_com_erroratline0_infinipaint_InfiniPaintSurface_nativeInfiniPaintUpdateIMESafeArea(JNIEnv *env, jclass clazz, jint top, jint bottom, jint left, jint right) {
if(globalInputManager) {
std::scoped_lock a{globalInputManager->safeAreaWithoutIMEMutex};
globalInputManager->safeAreaWithoutIME = {{left, top}, {globalInputManager->main.window.size.x() - right, globalInputManager->main.window.size.y() - bottom}};
+
+ SDL_Event event;
+ SDL_zero(event);
+ event.type = SDL_EVENT_WINDOW_SAFE_AREA_CHANGED;
+ SDL_PushEvent(&event);
}
}
+
+extern "C"
+JNIEXPORT void JNICALL
+Java_com_erroratline0_infinipaint_InfiniPaintTextBoxEditable_nativeReplace(JNIEnv *env,
+ jclass clazz, jlong id, jint st,
+ jint en, jstring str) {
+ std::scoped_lock a{textboxMutex};
+ input_android_text_box({
+ .command = TextInputData::CommandType::REPLACE_TEXT,
+ .strData = jstring2string(env, str),
+ .intData = {std::min(st, en), std::max(en, st), 0}
+ });
+ CustomEvents::emit_event(
+ CustomEvents::AndroidTextBoxInputEvent{
+ .command = CustomEvents::AndroidTextBoxInputEvent::CommandType::COMMIT_ALL,
+ });
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_com_erroratline0_infinipaint_InfiniPaintTextBoxEditable_nativeGetString(JNIEnv *env,
+ jclass clazz, jlong id) {
+ std::scoped_lock a{textboxMutex};
+ return string2jstring(env, textBox->get_string());
+}
+
+extern "C"
+JNIEXPORT jintArray JNICALL
+Java_com_erroratline0_infinipaint_InfiniPaintTextBoxInputConnection_nativeGetSelection(JNIEnv *env,
+ jclass clazz,
+ jlong m_text_box_id) {
+ jintArray result;
+ result = env->NewIntArray(2);
+ jint fill[2];
+ for(int i = 0; i < 2; i++)
+ fill[i] = 0;
+
+ std::scoped_lock a{textboxMutex};
+
+ fill[0] = get_android_text_pos_from_cursor_pos(textBox, cursor->selectionBeginPos);
+ fill[1] = get_android_text_pos_from_cursor_pos(textBox, cursor->selectionEndPos);
+
+ env->SetIntArrayRegion(result, 0, 2, fill);
+ return result;
+}
+
extern "C"
JNIEXPORT void JNICALL
-Java_com_erroratline0_infinipaint_InfiniPaintTextBoxInputConnection_nativeSetTextBoxCursor(
- JNIEnv *env, jclass clazz, jint cursor_begin, jint cursor_end) {
- if(globalInputManager) {
- std::scoped_lock a{globalCallMutex};
- globalInputManager->main.input_android_text_box_set_cursor(cursor_begin, cursor_end);
- }
+Java_com_erroratline0_infinipaint_InfiniPaintTextBoxInputConnection_nativeShiftSelection(
+ JNIEnv *env, jclass clazz, jlong m_text_box_id, jint amount) {
+ std::scoped_lock a{textboxMutex};
+ input_android_text_box({
+ .command = TextInputData::CommandType::SHIFT_CURSOR,
+ .strData = "",
+ .intData = {amount, 0, 0}
+ });
+
+ CustomEvents::emit_event(
+ CustomEvents::AndroidTextBoxInputEvent{
+ .command = CustomEvents::AndroidTextBoxInputEvent::CommandType::COMMIT_ALL,
+ });
}
-#endif
\ No newline at end of file
+extern "C"
+JNIEXPORT void JNICALL
+Java_com_erroratline0_infinipaint_InfiniPaintTextBoxInputConnection_nativeSetSelection(JNIEnv *env,
+ jclass clazz,
+ jlong m_text_box_id,
+ jint start,
+ jint end) {
+ std::scoped_lock a{textboxMutex};
+ input_android_text_box({
+ .command = TextInputData::CommandType::SET_CURSOR,
+ .intData = {std::min(start, end), std::max(start, end), 0}
+ });
+
+ CustomEvents::emit_event(
+ CustomEvents::AndroidTextBoxInputEvent{
+ .command = CustomEvents::AndroidTextBoxInputEvent::CommandType::COMMIT_ALL,
+ });
+}
+
+#endif
diff --git a/src/AndroidJNICalls.hpp b/src/AndroidJNICalls.hpp
index e8cac97..4cf6fab 100644
--- a/src/AndroidJNICalls.hpp
+++ b/src/AndroidJNICalls.hpp
@@ -1,14 +1,37 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#ifdef __ANDROID__
#include
+#include "InputManager.hpp"
struct InputManager;
namespace AndroidJNICalls {
extern InputManager* globalInputManager;
- extern std::mutex globalCallMutex;
- void startTextInput(int input_type);
+ void startTextInput(CustomEvents::InputTextBoxID newTextboxID, const std::shared_ptr& newTextbox, const std::shared_ptr& newCursor, const std::shared_ptr& modMap, int inputType);
+ void updateCursorPos(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newCursor);
+ void updateModMap(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newModMap);
+ void updateTextboxAndCursorPos(CustomEvents::InputTextBoxID tId, const std::shared_ptr& newTextbox, const std::shared_ptr& newCursor);
+ std::pair getChangesToCommit(CustomEvents::InputTextBoxID tId);
+ std::pair commitAll(CustomEvents::InputTextBoxID tId, const std::shared_ptr& textBox, const std::shared_ptr& cursor);
}
#endif
diff --git a/src/Bookmarks/BookmarkListItem.cpp b/src/Bookmarks/BookmarkListItem.cpp
index 001b7e8..53a6c6e 100644
--- a/src/Bookmarks/BookmarkListItem.cpp
+++ b/src/Bookmarks/BookmarkListItem.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "BookmarkListItem.hpp"
#include
#include "../World.hpp"
diff --git a/src/Bookmarks/BookmarkListItem.hpp b/src/Bookmarks/BookmarkListItem.hpp
index 3353371..6065099 100644
--- a/src/Bookmarks/BookmarkListItem.hpp
+++ b/src/Bookmarks/BookmarkListItem.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/Bookmarks/BookmarkManager.cpp b/src/Bookmarks/BookmarkManager.cpp
index dd04931..9a37cbc 100644
--- a/src/Bookmarks/BookmarkManager.cpp
+++ b/src/Bookmarks/BookmarkManager.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "BookmarkManager.hpp"
#include "../World.hpp"
#include "../MainProgram.hpp"
diff --git a/src/Bookmarks/BookmarkManager.hpp b/src/Bookmarks/BookmarkManager.hpp
index 3b17ae7..46ccb44 100644
--- a/src/Bookmarks/BookmarkManager.hpp
+++ b/src/Bookmarks/BookmarkManager.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/CanvasComponents/BrushStrokeCanvasComponent.cpp b/src/CanvasComponents/BrushStrokeCanvasComponent.cpp
index 86f1b0a..4a80174 100644
--- a/src/CanvasComponents/BrushStrokeCanvasComponent.cpp
+++ b/src/CanvasComponents/BrushStrokeCanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "BrushStrokeCanvasComponent.hpp"
#include
#include
diff --git a/src/CanvasComponents/BrushStrokeCanvasComponent.hpp b/src/CanvasComponents/BrushStrokeCanvasComponent.hpp
index 5f6106a..4ae3e3a 100644
--- a/src/CanvasComponents/BrushStrokeCanvasComponent.hpp
+++ b/src/CanvasComponents/BrushStrokeCanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "CanvasComponent.hpp"
#include "Helpers/SCollision.hpp"
diff --git a/src/CanvasComponents/CanvasComponent.cpp b/src/CanvasComponents/CanvasComponent.cpp
index bb431fc..b77f673 100644
--- a/src/CanvasComponents/CanvasComponent.cpp
+++ b/src/CanvasComponents/CanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CanvasComponent.hpp"
#include "BrushStrokeCanvasComponent.hpp"
#include "ImageCanvasComponent.hpp"
diff --git a/src/CanvasComponents/CanvasComponent.hpp b/src/CanvasComponents/CanvasComponent.hpp
index 9bec924..c0dbaa5 100644
--- a/src/CanvasComponents/CanvasComponent.hpp
+++ b/src/CanvasComponents/CanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/CanvasComponents/CanvasComponentAllocator.cpp b/src/CanvasComponents/CanvasComponentAllocator.cpp
index db81350..4773092 100644
--- a/src/CanvasComponents/CanvasComponentAllocator.cpp
+++ b/src/CanvasComponents/CanvasComponentAllocator.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CanvasComponentAllocator.hpp"
#include "CanvasComponentContainer.hpp"
#include "../DrawingProgram/DrawingProgram.hpp"
diff --git a/src/CanvasComponents/CanvasComponentAllocator.hpp b/src/CanvasComponents/CanvasComponentAllocator.hpp
index 09cc428..1744e2d 100644
--- a/src/CanvasComponents/CanvasComponentAllocator.hpp
+++ b/src/CanvasComponents/CanvasComponentAllocator.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "CanvasComponentType.hpp"
diff --git a/src/CanvasComponents/CanvasComponentContainer.cpp b/src/CanvasComponents/CanvasComponentContainer.cpp
index 83b2f52..dde845f 100644
--- a/src/CanvasComponents/CanvasComponentContainer.cpp
+++ b/src/CanvasComponents/CanvasComponentContainer.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CanvasComponentContainer.hpp"
#include "CanvasComponentAllocator.hpp"
#include "../DrawData.hpp"
diff --git a/src/CanvasComponents/CanvasComponentContainer.hpp b/src/CanvasComponents/CanvasComponentContainer.hpp
index c9fef5a..b3c7cea 100644
--- a/src/CanvasComponents/CanvasComponentContainer.hpp
+++ b/src/CanvasComponents/CanvasComponentContainer.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../CoordSpaceHelper.hpp"
#include
diff --git a/src/CanvasComponents/CanvasComponentType.hpp b/src/CanvasComponents/CanvasComponentType.hpp
index 9dac1e6..73eca7b 100644
--- a/src/CanvasComponents/CanvasComponentType.hpp
+++ b/src/CanvasComponents/CanvasComponentType.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
diff --git a/src/CanvasComponents/EllipseCanvasComponent.cpp b/src/CanvasComponents/EllipseCanvasComponent.cpp
index 7687640..7079ca4 100644
--- a/src/CanvasComponents/EllipseCanvasComponent.cpp
+++ b/src/CanvasComponents/EllipseCanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EllipseCanvasComponent.hpp"
#include "CanvasComponent.hpp"
#include "Helpers/ConvertVec.hpp"
diff --git a/src/CanvasComponents/EllipseCanvasComponent.hpp b/src/CanvasComponents/EllipseCanvasComponent.hpp
index ddf1564..df610a5 100644
--- a/src/CanvasComponents/EllipseCanvasComponent.hpp
+++ b/src/CanvasComponents/EllipseCanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "CanvasComponent.hpp"
#include "../CoordSpaceHelper.hpp"
diff --git a/src/CanvasComponents/ImageCanvasComponent.cpp b/src/CanvasComponents/ImageCanvasComponent.cpp
index e6175b2..e7009ea 100644
--- a/src/CanvasComponents/ImageCanvasComponent.cpp
+++ b/src/CanvasComponents/ImageCanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ImageCanvasComponent.hpp"
#include "Eigen/Core"
#include "Helpers/ConvertVec.hpp"
diff --git a/src/CanvasComponents/ImageCanvasComponent.hpp b/src/CanvasComponents/ImageCanvasComponent.hpp
index 6710b01..83479f3 100644
--- a/src/CanvasComponents/ImageCanvasComponent.hpp
+++ b/src/CanvasComponents/ImageCanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../SharedTypes.hpp"
#include "CanvasComponent.hpp"
diff --git a/src/CanvasComponents/RectangleCanvasComponent.cpp b/src/CanvasComponents/RectangleCanvasComponent.cpp
index 85addbf..33a1632 100644
--- a/src/CanvasComponents/RectangleCanvasComponent.cpp
+++ b/src/CanvasComponents/RectangleCanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "RectangleCanvasComponent.hpp"
#include "Helpers/ConvertVec.hpp"
#include "Helpers/MathExtras.hpp"
diff --git a/src/CanvasComponents/RectangleCanvasComponent.hpp b/src/CanvasComponents/RectangleCanvasComponent.hpp
index e4f115d..b627402 100644
--- a/src/CanvasComponents/RectangleCanvasComponent.hpp
+++ b/src/CanvasComponents/RectangleCanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../SharedTypes.hpp"
#include "CanvasComponent.hpp"
diff --git a/src/CanvasComponents/TextBoxCanvasComponent.cpp b/src/CanvasComponents/TextBoxCanvasComponent.cpp
index 5080859..8be6894 100644
--- a/src/CanvasComponents/TextBoxCanvasComponent.cpp
+++ b/src/CanvasComponents/TextBoxCanvasComponent.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "TextBoxCanvasComponent.hpp"
#include "Helpers/ConvertVec.hpp"
#include
diff --git a/src/CanvasComponents/TextBoxCanvasComponent.hpp b/src/CanvasComponents/TextBoxCanvasComponent.hpp
index 1bfd941..bd2723d 100644
--- a/src/CanvasComponents/TextBoxCanvasComponent.hpp
+++ b/src/CanvasComponents/TextBoxCanvasComponent.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../SharedTypes.hpp"
#include "CanvasComponent.hpp"
diff --git a/src/CanvasTheme.cpp b/src/CanvasTheme.cpp
index 799b5aa..9421323 100644
--- a/src/CanvasTheme.cpp
+++ b/src/CanvasTheme.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CanvasTheme.hpp"
#include "DrawingProgram/DrawingProgram.hpp"
#include
diff --git a/src/CanvasTheme.hpp b/src/CanvasTheme.hpp
index a4d9ee6..e99a52b 100644
--- a/src/CanvasTheme.hpp
+++ b/src/CanvasTheme.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "cereal/archives/portable_binary.hpp"
#include
diff --git a/src/ClientData.cpp b/src/ClientData.cpp
index d3928e6..13988f4 100644
--- a/src/ClientData.cpp
+++ b/src/ClientData.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ClientData.hpp"
#include "CommandList.hpp"
#include "World.hpp"
diff --git a/src/ClientData.hpp b/src/ClientData.hpp
index ea22933..3a4f1da 100644
--- a/src/ClientData.hpp
+++ b/src/ClientData.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "CoordSpaceHelper.hpp"
diff --git a/src/CommandList.hpp b/src/CommandList.hpp
index 463e6af..38b04cf 100644
--- a/src/CommandList.hpp
+++ b/src/CommandList.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/CoordSpaceHelper.cpp b/src/CoordSpaceHelper.cpp
index 58223d9..98f1d2b 100644
--- a/src/CoordSpaceHelper.cpp
+++ b/src/CoordSpaceHelper.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CoordSpaceHelper.hpp"
#include "MainProgram.hpp"
#include
diff --git a/src/CoordSpaceHelper.hpp b/src/CoordSpaceHelper.hpp
index c637c14..966348b 100644
--- a/src/CoordSpaceHelper.hpp
+++ b/src/CoordSpaceHelper.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "SharedTypes.hpp"
#include
diff --git a/src/CoordSpaceHelperTransform.cpp b/src/CoordSpaceHelperTransform.cpp
index 4435197..f6e44b2 100644
--- a/src/CoordSpaceHelperTransform.cpp
+++ b/src/CoordSpaceHelperTransform.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CoordSpaceHelperTransform.hpp"
#include "CoordSpaceHelper.hpp"
#include "nlohmann/json.hpp"
diff --git a/src/CoordSpaceHelperTransform.hpp b/src/CoordSpaceHelperTransform.hpp
index bdb8025..47b05a7 100644
--- a/src/CoordSpaceHelperTransform.hpp
+++ b/src/CoordSpaceHelperTransform.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "SharedTypes.hpp"
#include
diff --git a/src/CustomEvents.cpp b/src/CustomEvents.cpp
index 8740cbd..c868945 100644
--- a/src/CustomEvents.cpp
+++ b/src/CustomEvents.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CustomEvents.hpp"
#include
#include
@@ -5,6 +23,12 @@
namespace CustomEvents {
+ InputTextBoxID text_box_get_new_id() {
+ static InputTextBoxID nextID = 0;
+ ++nextID;
+ return nextID;
+ }
+
std::queue> eventDataQueue;
std::mutex eventDataQueueMutex;
@@ -16,6 +40,7 @@ void init() {
OpenInfiniPaintFileEvent::EVENT_NUM = SDL_RegisterEvents(1);
AddFileToCanvasEvent::EVENT_NUM = SDL_RegisterEvents(1);
RefreshTextBoxInputEvent::EVENT_NUM = SDL_RegisterEvents(1);
+ AndroidTextBoxInputEvent::EVENT_NUM = SDL_RegisterEvents(1);
alreadyInitialized = true;
}
}
@@ -24,5 +49,6 @@ uint32_t PasteEvent::EVENT_NUM;
uint32_t OpenInfiniPaintFileEvent::EVENT_NUM;
uint32_t AddFileToCanvasEvent::EVENT_NUM;
uint32_t RefreshTextBoxInputEvent::EVENT_NUM;
+uint32_t AndroidTextBoxInputEvent::EVENT_NUM;
}
diff --git a/src/CustomEvents.hpp b/src/CustomEvents.hpp
index 76bd934..d41a4af 100644
--- a/src/CustomEvents.hpp
+++ b/src/CustomEvents.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
@@ -7,11 +25,15 @@
#include
#include
#include
+#include
#include "RichText/TextBox.hpp"
namespace CustomEvents {
void init();
+ typedef int64_t InputTextBoxID;
+ InputTextBoxID text_box_get_new_id();
+
extern std::queue> eventDataQueue;
extern std::mutex eventDataQueueMutex;
@@ -71,4 +93,19 @@ namespace CustomEvents {
struct RefreshTextBoxInputEvent {
static uint32_t EVENT_NUM;
};
+
+ struct AndroidTextBoxInputEvent {
+ static uint32_t EVENT_NUM;
+ InputTextBoxID textboxID;
+ enum class CommandType {
+ COMMIT_ALL
+ } command;
+ std::string strData;
+ Vector3i intData;
+ };
+
+ struct AndroidInsetsChangedEvent {
+ static uint32_t EVENT_NUM;
+ SCollision::AABB safeWindowRect;
+ };
}
diff --git a/src/DrawCamera.cpp b/src/DrawCamera.cpp
index 294b82b..696077d 100755
--- a/src/DrawCamera.cpp
+++ b/src/DrawCamera.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawCamera.hpp"
#include "DrawingProgram/Tools/DrawingProgramToolBase.hpp"
#include "Helpers/FixedPoint.hpp"
diff --git a/src/DrawCamera.hpp b/src/DrawCamera.hpp
index 26a6aed..2bfdd0c 100644
--- a/src/DrawCamera.hpp
+++ b/src/DrawCamera.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/DrawCollision.cpp b/src/DrawCollision.cpp
index ecf34a4..66de17b 100644
--- a/src/DrawCollision.cpp
+++ b/src/DrawCollision.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawCollision.hpp"
#include
#include
diff --git a/src/DrawCollision.hpp b/src/DrawCollision.hpp
index 75453e9..64bf083 100644
--- a/src/DrawCollision.hpp
+++ b/src/DrawCollision.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "DrawData.hpp"
diff --git a/src/DrawData.cpp b/src/DrawData.cpp
index c9e197d..86d6ca6 100644
--- a/src/DrawData.cpp
+++ b/src/DrawData.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawData.hpp"
#include "CanvasComponents/CanvasComponentContainer.hpp"
diff --git a/src/DrawData.hpp b/src/DrawData.hpp
index a4af1ec..3ec472f 100644
--- a/src/DrawData.hpp
+++ b/src/DrawData.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawCamera.hpp"
#include "ResourceManager.hpp"
diff --git a/src/DrawingProgram/DrawingProgram.cpp b/src/DrawingProgram/DrawingProgram.cpp
index cc5e9ed..7938248 100644
--- a/src/DrawingProgram/DrawingProgram.cpp
+++ b/src/DrawingProgram/DrawingProgram.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgram.hpp"
#include "Helpers/Networking/NetLibrary.hpp"
#include "Tools/DrawingProgramToolBase.hpp"
@@ -65,6 +83,10 @@ void DrawingProgram::input_paste_callback(const CustomEvents::PasteEvent& paste)
drawTool->input_paste_callback(paste);
}
+void DrawingProgram::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {
+ drawTool->input_android_text_box_input_callback(textboxInput);
+}
+
void DrawingProgram::input_drop_file_callback(const InputManager::DropCallbackArgs& drop) {
if(std::filesystem::is_regular_file(drop.data)) {
#ifdef __EMSCRIPTEN_
@@ -760,6 +782,26 @@ void DrawingProgram::get_used_resources(std::unordered_setcolor_picker_color(oldColor);
+}
+
+bool DrawingProgram::phone_gui_tool_specific_bottom_toolbar_exists() {
+ return drawTool->phone_gui_tool_specific_bottom_toolbar_exists();
+}
+
+void DrawingProgram::phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) {
+ drawTool->phone_gui_tool_specific_bottom_toolbar(t);
+}
+
void DrawingProgram::draw(SkCanvas* canvas, const DrawData& drawData) {
if(drawData.takingScreenshot)
layerMan.draw(canvas, drawData);
diff --git a/src/DrawingProgram/DrawingProgram.hpp b/src/DrawingProgram/DrawingProgram.hpp
index b206039..92363cc 100644
--- a/src/DrawingProgram/DrawingProgram.hpp
+++ b/src/DrawingProgram/DrawingProgram.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../DrawData.hpp"
#include "DrawingProgramCache.hpp"
@@ -40,6 +58,11 @@ class DrawingProgram {
CanvasComponentContainer::ObjInfo* add_file_to_canvas_by_data(const std::string& fileName, std::string_view fileBuffer, Vector2f dropPos);
void get_used_resources(std::unordered_set& resourceSet);
+ Vector4f* color_picker_left(Vector4f* oldColor);
+ Vector4f* color_picker_right(Vector4f* oldColor);
+ bool phone_gui_tool_specific_bottom_toolbar_exists();
+ void phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t);
+
void load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version);
void save_file(cereal::PortableBinaryOutputArchive& a) const;
World& world;
@@ -61,6 +84,7 @@ class DrawingProgram {
void on_tab_out();
void input_add_file_to_canvas_callback(const CustomEvents::AddFileToCanvasEvent& addFile);
void input_paste_callback(const CustomEvents::PasteEvent& paste);
+ void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput);
void input_drop_text_callback(const InputManager::DropCallbackArgs& drop);
void input_drop_file_callback(const InputManager::DropCallbackArgs& drop);
void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
diff --git a/src/DrawingProgram/DrawingProgramCache.cpp b/src/DrawingProgram/DrawingProgramCache.cpp
index 6b3dc90..51cb60a 100644
--- a/src/DrawingProgram/DrawingProgramCache.cpp
+++ b/src/DrawingProgram/DrawingProgramCache.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramCache.hpp"
#include "DrawingProgram.hpp"
#include "../World.hpp"
diff --git a/src/DrawingProgram/DrawingProgramCache.hpp b/src/DrawingProgram/DrawingProgramCache.hpp
index 0fd434f..385c4a6 100644
--- a/src/DrawingProgram/DrawingProgramCache.hpp
+++ b/src/DrawingProgram/DrawingProgramCache.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../CanvasComponents/CanvasComponentContainer.hpp"
#include
diff --git a/src/DrawingProgram/DrawingProgramSelection.cpp b/src/DrawingProgram/DrawingProgramSelection.cpp
index 60f36a4..9473e22 100644
--- a/src/DrawingProgram/DrawingProgramSelection.cpp
+++ b/src/DrawingProgram/DrawingProgramSelection.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramSelection.hpp"
#include "DrawingProgram.hpp"
#include "../World.hpp"
diff --git a/src/DrawingProgram/DrawingProgramSelection.hpp b/src/DrawingProgram/DrawingProgramSelection.hpp
index 112a589..04b93ee 100644
--- a/src/DrawingProgram/DrawingProgramSelection.hpp
+++ b/src/DrawingProgram/DrawingProgramSelection.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../CoordSpaceHelperTransform.hpp"
#include "Layers/DrawingProgramLayerManager.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayer.cpp b/src/DrawingProgram/Layers/DrawingProgramLayer.cpp
index f0c011d..7cb573d 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayer.cpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayer.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramLayer.hpp"
#include "DrawingProgramLayerManager.hpp"
#include "../DrawingProgram.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayer.hpp b/src/DrawingProgram/Layers/DrawingProgramLayer.hpp
index 5194544..6cb8110 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayer.hpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayer.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "../../CanvasComponents/CanvasComponent.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerFolder.cpp b/src/DrawingProgram/Layers/DrawingProgramLayerFolder.cpp
index 037ef98..c841be3 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerFolder.cpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerFolder.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramLayerFolder.hpp"
#include "DrawingProgramLayerListItem.hpp"
#include "DrawingProgramLayer.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerFolder.hpp b/src/DrawingProgram/Layers/DrawingProgramLayerFolder.hpp
index 5ca12f7..e6e6d80 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerFolder.hpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerFolder.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerListItem.cpp b/src/DrawingProgram/Layers/DrawingProgramLayerListItem.cpp
index 12b147e..e62a702 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerListItem.cpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerListItem.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramLayerListItem.hpp"
#include "DrawingProgramLayerFolder.hpp"
#include
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerListItem.hpp b/src/DrawingProgram/Layers/DrawingProgramLayerListItem.hpp
index 9663628..25b70bd 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerListItem.hpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerListItem.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerManager.cpp b/src/DrawingProgram/Layers/DrawingProgramLayerManager.cpp
index c3cd72a..cb88def 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerManager.cpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerManager.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramLayerManager.hpp"
#include "../../World.hpp"
#include "Helpers/NetworkingObjects/NetObjID.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerManager.hpp b/src/DrawingProgram/Layers/DrawingProgramLayerManager.hpp
index f8c30c4..391d8f5 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerManager.hpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerManager.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramLayerListItem.hpp"
#include "DrawingProgramLayerManagerGUI.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.cpp b/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.cpp
index 62a819b..82087d8 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.cpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramLayerManagerGUI.hpp"
#include "DrawingProgramLayerListItem.hpp"
#include "DrawingProgramLayerManager.hpp"
diff --git a/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.hpp b/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.hpp
index dbb75f5..4fe692f 100644
--- a/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.hpp
+++ b/src/DrawingProgram/Layers/DrawingProgramLayerManagerGUI.hpp
@@ -1,3 +1,21 @@
+#/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/DrawingProgram/Layers/SerializedBlendMode.cpp b/src/DrawingProgram/Layers/SerializedBlendMode.cpp
index e079e52..c9e3be9 100644
--- a/src/DrawingProgram/Layers/SerializedBlendMode.cpp
+++ b/src/DrawingProgram/Layers/SerializedBlendMode.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "SerializedBlendMode.hpp"
#include
diff --git a/src/DrawingProgram/Layers/SerializedBlendMode.hpp b/src/DrawingProgram/Layers/SerializedBlendMode.hpp
index 9cf0eba..eaba2b1 100644
--- a/src/DrawingProgram/Layers/SerializedBlendMode.hpp
+++ b/src/DrawingProgram/Layers/SerializedBlendMode.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/DrawingProgram/ToolConfiguration.cpp b/src/DrawingProgram/ToolConfiguration.cpp
index 0571c46..ab11730 100644
--- a/src/DrawingProgram/ToolConfiguration.cpp
+++ b/src/DrawingProgram/ToolConfiguration.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ToolConfiguration.hpp"
#include "DrawingProgram.hpp"
#include "../World.hpp"
diff --git a/src/DrawingProgram/ToolConfiguration.hpp b/src/DrawingProgram/ToolConfiguration.hpp
index 6d20488..842255c 100644
--- a/src/DrawingProgram/ToolConfiguration.hpp
+++ b/src/DrawingProgram/ToolConfiguration.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../SharedTypes.hpp"
#include "nlohmann/json.hpp"
diff --git a/src/DrawingProgram/Tools/BrushTool.cpp b/src/DrawingProgram/Tools/BrushTool.cpp
index c56cf34..947784e 100644
--- a/src/DrawingProgram/Tools/BrushTool.cpp
+++ b/src/DrawingProgram/Tools/BrushTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "BrushTool.hpp"
#include
#include "../../GUIStuff/GUIManager.hpp"
diff --git a/src/DrawingProgram/Tools/BrushTool.hpp b/src/DrawingProgram/Tools/BrushTool.hpp
index bb9f088..bef5bca 100644
--- a/src/DrawingProgram/Tools/BrushTool.hpp
+++ b/src/DrawingProgram/Tools/BrushTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp b/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp
index 530b5c8..529ff01 100644
--- a/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp
+++ b/src/DrawingProgram/Tools/DrawingProgramToolBase.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramToolBase.hpp"
#include "BrushTool.hpp"
@@ -55,7 +73,9 @@ std::unique_ptr DrawingProgramToolBase::allocate_tool_ty
return nullptr;
}
+Vector4f* DrawingProgramToolBase::color_picker_color(Vector4f* oldColor) { return nullptr; }
void DrawingProgramToolBase::input_paste_callback(const CustomEvents::PasteEvent& paste) {}
+void DrawingProgramToolBase::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {}
void DrawingProgramToolBase::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {}
void DrawingProgramToolBase::input_text_callback(const InputManager::TextCallbackArgs& text) {}
void DrawingProgramToolBase::input_key_callback(const InputManager::KeyCallbackArgs& key) {}
@@ -65,4 +85,6 @@ void DrawingProgramToolBase::input_pen_button_callback(const InputManager::PenBu
void DrawingProgramToolBase::input_pen_touch_callback(const InputManager::PenTouchCallbackArgs& touch) {}
void DrawingProgramToolBase::input_pen_motion_callback(const InputManager::PenMotionCallbackArgs& motion) {}
void DrawingProgramToolBase::input_pen_axis_callback(const InputManager::PenAxisCallbackArgs& axis) {}
+bool DrawingProgramToolBase::phone_gui_tool_specific_bottom_toolbar_exists() { return false; }
+void DrawingProgramToolBase::phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) {}
std::optional DrawingProgramToolBase::get_text_box_start_info() { return std::nullopt; }
diff --git a/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp b/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp
index 7db536c..8a6ebad 100644
--- a/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp
+++ b/src/DrawingProgram/Tools/DrawingProgramToolBase.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "../../DrawData.hpp"
@@ -38,7 +56,9 @@ class DrawingProgramToolBase {
virtual void draw(SkCanvas* canvas, const DrawData& drawData) = 0;
virtual void switch_tool(DrawingProgramToolType newTool) = 0;
virtual bool prevent_undo_or_redo() = 0;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor);
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste);
+ virtual void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput);
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
virtual void input_text_callback(const InputManager::TextCallbackArgs& text);
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key);
@@ -48,6 +68,8 @@ class DrawingProgramToolBase {
virtual void input_pen_touch_callback(const InputManager::PenTouchCallbackArgs& touch);
virtual void input_pen_motion_callback(const InputManager::PenMotionCallbackArgs& motion);
virtual void input_pen_axis_callback(const InputManager::PenAxisCallbackArgs& axis);
+ virtual bool phone_gui_tool_specific_bottom_toolbar_exists();
+ virtual void phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t);
virtual std::optional get_text_box_start_info();
virtual ~DrawingProgramToolBase();
static std::unique_ptr allocate_tool_type(DrawingProgram& drawP, DrawingProgramToolType t);
diff --git a/src/DrawingProgram/Tools/EditTool.cpp b/src/DrawingProgram/Tools/EditTool.cpp
index c4f00a8..76fa9d1 100644
--- a/src/DrawingProgram/Tools/EditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EditTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
@@ -45,9 +63,13 @@ void EditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
auto& gui = drawP.world.main.g.gui;
- gui.new_id("edit tool", [&] {
- text_label_centered(gui, "Edit");
- });
+ if(objInfoBeingEdited)
+ compEditTool->gui_phone_toolbox(t);
+ else {
+ gui.new_id("edit tool", [&] {
+ text_label_centered(gui, "Double tap object to edit");
+ });
+ }
}
void EditTool::erase_component(CanvasComponentContainer::ObjInfo* erasedComp) {
@@ -60,6 +82,11 @@ void EditTool::input_paste_callback(const CustomEvents::PasteEvent& paste) {
compEditTool->input_paste_callback(paste);
}
+void EditTool::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {
+ if(objInfoBeingEdited)
+ compEditTool->input_android_text_box_input_callback(textboxInput);
+}
+
void EditTool::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {
if(objInfoBeingEdited)
compEditTool->input_text_key_callback(key);
@@ -297,6 +324,23 @@ void EditTool::tool_update() {
}
}
+Vector4f* EditTool::color_picker_color(Vector4f* oldColor) {
+ if(objInfoBeingEdited)
+ return compEditTool->color_picker_color(oldColor);
+ return nullptr;
+}
+
+bool EditTool::phone_gui_tool_specific_bottom_toolbar_exists() {
+ if(objInfoBeingEdited)
+ return compEditTool->phone_gui_tool_specific_bottom_toolbar_exists();
+ return false;
+}
+
+void EditTool::phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) {
+ if(objInfoBeingEdited)
+ return compEditTool->phone_gui_tool_specific_bottom_toolbar(t);
+}
+
bool EditTool::prevent_undo_or_redo() {
return objInfoBeingEdited || drawP.selection.is_something_selected();
}
diff --git a/src/DrawingProgram/Tools/EditTool.hpp b/src/DrawingProgram/Tools/EditTool.hpp
index fc1a1bf..2ceba18 100644
--- a/src/DrawingProgram/Tools/EditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
@@ -27,7 +45,11 @@ class EditTool : public DrawingProgramToolBase {
virtual void switch_tool(DrawingProgramToolType newTool) override;
virtual void draw(SkCanvas* canvas, const DrawData& drawData) override;
virtual bool prevent_undo_or_redo() override;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor) override;
+ virtual bool phone_gui_tool_specific_bottom_toolbar_exists() override;
+ virtual void phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) override;
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste) override;
+ virtual void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) override;
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key) override;
virtual void input_text_callback(const InputManager::TextCallbackArgs& text) override;
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key) override;
diff --git a/src/DrawingProgram/Tools/EditTools/BrushEditTool.cpp b/src/DrawingProgram/Tools/EditTools/BrushEditTool.cpp
index ad2d6e2..9481d0a 100644
--- a/src/DrawingProgram/Tools/EditTools/BrushEditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTools/BrushEditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "BrushEditTool.hpp"
#include "../../DrawingProgram.hpp"
#include "../../../World.hpp"
@@ -29,6 +47,29 @@ void BrushEditTool::edit_gui(Toolbar& t) {
});
}
+void BrushEditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+
+ auto& a = static_cast(comp->obj->get_comp());
+ auto& gui = drawP.world.main.g.gui;
+ auto commit_update_func = [&] { comp->obj->commit_update(drawP); };
+
+ gui.new_id("edit tool brush", [&] {
+ left_to_right_line_layout(gui, [&]() {
+ t.color_selector_button("Outline Color", &a.d.color, { .onChange = commit_update_func });
+ text_label(gui, "Outline Color");
+ });
+ });
+}
+
+Vector4f* BrushEditTool::color_picker_color(Vector4f* oldColor) {
+ auto& a = static_cast(comp->obj->get_comp());
+ if(oldColor == &a.d.color)
+ return oldColor;
+ return nullptr;
+}
+
void BrushEditTool::edit_start(EditTool& editTool, std::any& prevData) {
auto& a = static_cast(comp->obj->get_comp());
oldColor = a.d.color;
diff --git a/src/DrawingProgram/Tools/EditTools/BrushEditTool.hpp b/src/DrawingProgram/Tools/EditTools/BrushEditTool.hpp
index 4f8fef1..41706f1 100644
--- a/src/DrawingProgram/Tools/EditTools/BrushEditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTools/BrushEditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramEditToolBase.hpp"
#include
@@ -12,6 +30,8 @@ class BrushEditTool : public DrawingProgramEditToolBase {
virtual void commit_edit_updates(std::any& prevData) override;
virtual bool edit_update() override;
virtual void edit_gui(Toolbar& t) override;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor) override;
private:
Vector4f oldColor;
};
diff --git a/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.cpp b/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.cpp
index 548c707..e0ef216 100644
--- a/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.cpp
+++ b/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "DrawingProgramEditToolBase.hpp"
#include "../../../MainProgram.hpp"
@@ -10,12 +28,16 @@ void DrawingProgramEditToolBase::right_click_popup_gui(Toolbar& t, Vector2f popu
t.paint_popup(popupPos);
}
+Vector4f* DrawingProgramEditToolBase::color_picker_color(Vector4f* oldColor) { return nullptr; }
void DrawingProgramEditToolBase::input_paste_callback(const CustomEvents::PasteEvent& paste) {}
+void DrawingProgramEditToolBase::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {}
void DrawingProgramEditToolBase::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {}
void DrawingProgramEditToolBase::input_text_callback(const InputManager::TextCallbackArgs& text) {}
void DrawingProgramEditToolBase::input_key_callback(const InputManager::KeyCallbackArgs& key) {}
void DrawingProgramEditToolBase::input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button, bool isDraggingPoint) {}
void DrawingProgramEditToolBase::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool isDraggingPoint) {}
+bool DrawingProgramEditToolBase::phone_gui_tool_specific_bottom_toolbar_exists() { return false; }
+void DrawingProgramEditToolBase::phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) {}
std::optional DrawingProgramEditToolBase::get_text_box_start_info() { return std::nullopt; }
DrawingProgramEditToolBase::~DrawingProgramEditToolBase() {}
diff --git a/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.hpp b/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.hpp
index 1be5229..0066152 100644
--- a/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.hpp
+++ b/src/DrawingProgram/Tools/EditTools/DrawingProgramEditToolBase.hpp
@@ -1,7 +1,26 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "../../../DrawData.hpp"
#include "../../../CanvasComponents/CanvasComponentContainer.hpp"
+#include "../../../Screens/PhoneDrawingProgramScreen.hpp"
class DrawingProgram;
class EditTool;
@@ -13,8 +32,13 @@ class DrawingProgramEditToolBase {
virtual void commit_edit_updates(std::any& prevData) = 0;
virtual bool edit_update() = 0;
virtual void edit_gui(Toolbar& t) = 0;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) = 0;
virtual void right_click_popup_gui(Toolbar& t, Vector2f popupPos);
+ virtual Vector4f* color_picker_color(Vector4f* oldColor);
+ virtual bool phone_gui_tool_specific_bottom_toolbar_exists();
+ virtual void phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t);
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste);
+ virtual void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput);
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
virtual void input_text_callback(const InputManager::TextCallbackArgs& text);
virtual void input_key_callback(const InputManager::KeyCallbackArgs& key);
diff --git a/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.cpp b/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.cpp
index b696dc4..a91eedd 100644
--- a/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EllipseDrawEditTool.hpp"
#include "../../DrawingProgram.hpp"
#include "../../../World.hpp"
@@ -50,6 +68,49 @@ void EllipseDrawEditTool::edit_gui(Toolbar& t) {
});
}
+Vector4f* EllipseDrawEditTool::color_picker_color(Vector4f* oldColor) {
+ auto& a = static_cast(comp->obj->get_comp());
+ if(oldColor == &a.d.fillColor)
+ return oldColor;
+ if(oldColor == &a.d.strokeColor)
+ return oldColor;
+ return nullptr;
+}
+
+void EllipseDrawEditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+
+ auto& a = static_cast(comp->obj->get_comp());
+ auto& gui = drawP.world.main.g.gui;
+ auto commit_update_func = [&] { comp->obj->commit_update(drawP); };
+ auto commit_update_and_layout_func = [&] {
+ comp->obj->commit_update(drawP);
+ drawP.world.main.g.gui.set_to_layout();
+ };
+
+ gui.new_id("edit tool ellipse", [&] {
+ radio_button_selector(gui, "Fill selector", &a.d.fillStrokeMode, {
+ {"Fill only", 0},
+ {"Outline only", 1},
+ {"Fill and outline", 2}
+ }, commit_update_and_layout_func);
+ if(a.d.fillStrokeMode == 0 || a.d.fillStrokeMode == 2) {
+ left_to_right_line_layout(gui, [&] {
+ t.color_selector_button("Fill color button", &a.d.fillColor, { .onChange = commit_update_func });
+ text_label(gui, "Fill Color");
+ });
+ }
+ if(a.d.fillStrokeMode == 1 || a.d.fillStrokeMode == 2) {
+ slider_scalar_field(gui, "relstrokewidth", "Outline Size", &a.d.strokeWidth, 3.0f, 40.0f, {.onEdit = commit_update_func});
+ left_to_right_line_layout(gui, [&] {
+ t.color_selector_button("Outline color button", &a.d.strokeColor, { .onChange = commit_update_func });
+ text_label(gui, "Outline Color");
+ });
+ }
+ });
+}
+
void EllipseDrawEditTool::edit_start(EditTool& editTool, std::any& prevData) {
auto& a = static_cast(comp->obj->get_comp());
diff --git a/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.hpp b/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.hpp
index dd37b6b..a0be16d 100644
--- a/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTools/EllipseDrawEditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramEditToolBase.hpp"
#include "../../../CanvasComponents/CanvasComponentContainer.hpp"
@@ -11,9 +29,11 @@ class EllipseDrawEditTool : public DrawingProgramEditToolBase {
public:
EllipseDrawEditTool(DrawingProgram& initDrawP, CanvasComponentContainer::ObjInfo* initComp);
virtual void edit_start(EditTool& editTool, std::any& prevData) override;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override;
virtual void commit_edit_updates(std::any& prevData) override;
virtual bool edit_update() override;
virtual void edit_gui(Toolbar& t) override;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor) override;
private:
void commit();
diff --git a/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp b/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp
index 81d6896..0daf950 100644
--- a/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTools/ImageEditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ImageEditTool.hpp"
#include "../../DrawingProgram.hpp"
#include "../../../CanvasComponents/ImageCanvasComponent.hpp"
@@ -77,3 +95,19 @@ void ImageEditTool::edit_gui(Toolbar& t) {
text_label_centered(gui, "Loading resource...");
});
}
+
+void ImageEditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+
+ ImageCanvasComponent& a = static_cast(comp->obj->get_comp());
+ auto& gui = drawP.world.main.g.gui;
+ gui.new_id("edit tool image", [&] {
+ text_label_centered(gui, "File Properties");
+ auto resourceData = drawP.world.netObjMan.get_obj_temporary_ref_from_id(a.d.imageID);
+ if(resourceData)
+ text_label(gui, "Name: " + resourceData->name);
+ else
+ text_label_centered(gui, "Loading resource...");
+ });
+}
diff --git a/src/DrawingProgram/Tools/EditTools/ImageEditTool.hpp b/src/DrawingProgram/Tools/EditTools/ImageEditTool.hpp
index b7ace84..f3dcd8b 100644
--- a/src/DrawingProgram/Tools/EditTools/ImageEditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTools/ImageEditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramEditToolBase.hpp"
#include
@@ -11,4 +29,5 @@ class ImageEditTool : public DrawingProgramEditToolBase {
virtual void commit_edit_updates(std::any& prevData) override;
virtual bool edit_update() override;
virtual void edit_gui(Toolbar& t) override;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override;
};
diff --git a/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.cpp b/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.cpp
index dc18c51..25576e0 100644
--- a/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "RectDrawEditTool.hpp"
#include "../../DrawingProgram.hpp"
#include "../../../World.hpp"
@@ -48,6 +66,50 @@ void RectDrawEditTool::edit_gui(Toolbar& t) {
});
}
+Vector4f* RectDrawEditTool::color_picker_color(Vector4f* oldColor) {
+ auto& a = static_cast(comp->obj->get_comp());
+ if(oldColor == &a.d.fillColor)
+ return oldColor;
+ if(oldColor == &a.d.strokeColor)
+ return oldColor;
+ return nullptr;
+}
+
+void RectDrawEditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+
+ auto& a = static_cast(comp->obj->get_comp());
+ auto commit_update_and_layout_func = [&] {
+ comp->obj->commit_update(drawP);
+ drawP.world.main.g.gui.set_to_layout();
+ };
+ auto commit_update_func = [&] { comp->obj->commit_update(drawP); };
+
+ auto& gui = drawP.world.main.g.gui;
+ gui.new_id("edit tool rectangle", [&] {
+ slider_scalar_field(gui, "relradiuswidth", "Corner Radius", &a.d.cornerRadius, 0.0f, 40.0f, { .onEdit = commit_update_func });
+ radio_button_selector(gui, "Fill selector", &a.d.fillStrokeMode, {
+ {"Fill only", 0},
+ {"Outline only", 1},
+ {"Fill and outline", 2}
+ }, commit_update_and_layout_func);
+ if(a.d.fillStrokeMode == 0 || a.d.fillStrokeMode == 2) {
+ left_to_right_line_layout(gui, [&] {
+ t.color_selector_button("Fill color button", &a.d.fillColor, { .onChange = commit_update_func });
+ text_label(gui, "Fill Color");
+ });
+ }
+ if(a.d.fillStrokeMode == 1 || a.d.fillStrokeMode == 2) {
+ slider_scalar_field(gui, "relstrokewidth", "Outline Size", &a.d.strokeWidth, 3.0f, 40.0f, { .onEdit = commit_update_func });
+ left_to_right_line_layout(gui, [&] {
+ t.color_selector_button("Outline color button", &a.d.strokeColor, { .onChange = commit_update_func });
+ text_label(gui, "Outline Color");
+ });
+ }
+ });
+}
+
void RectDrawEditTool::edit_start(EditTool& editTool, std::any& prevData) {
auto& a = static_cast(comp->obj->get_comp());
prevData = a.d;
diff --git a/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.hpp b/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.hpp
index 5018349..bafeef4 100644
--- a/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTools/RectDrawEditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramEditToolBase.hpp"
#include "../../../CanvasComponents/RectangleCanvasComponent.hpp"
@@ -13,6 +31,8 @@ class RectDrawEditTool : public DrawingProgramEditToolBase {
virtual void commit_edit_updates(std::any& prevData) override;
virtual bool edit_update() override;
virtual void edit_gui(Toolbar& t) override;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor) override;
private:
std::optional oldData;
};
diff --git a/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.cpp b/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.cpp
index 780b0e4..f936054 100644
--- a/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.cpp
+++ b/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "TextBoxEditTool.hpp"
#include "../../DrawingProgram.hpp"
#include "../../../MainProgram.hpp"
@@ -17,8 +35,10 @@
#include "../../../GUIStuff/ElementHelpers/LayoutHelpers.hpp"
#include "../../../GUIStuff/ElementHelpers/ButtonHelpers.hpp"
#include "../../../GUIStuff/ElementHelpers/NumberSliderHelpers.hpp"
-#include "../../../GUIStuff/Elements/PositionAdjustingPopupMenu.hpp"
+#include "../../../GUIStuff/ElementHelpers/DropdownHelpers.hpp"
#include "../../../GUIStuff/Elements/FontPicker.hpp"
+#include "../../../GUIStuff/Elements/LayoutElement.hpp"
+#include "../../../GUIStuff/Elements/ScrollArea.hpp"
using namespace RichText;
@@ -26,13 +46,31 @@ TextBoxEditTool::TextBoxEditTool(DrawingProgram& initDrawP, CanvasComponentConta
DrawingProgramEditToolBase(initDrawP, initComp)
{}
-void TextBoxEditTool::commit_update_func() {
+void TextBoxEditTool::commit_update_func_no_android_update() {
comp->obj->commit_update(drawP);
+ if(userInput)
+ userInput->android_force_update_modmap();
}
-void TextBoxEditTool::commit_update_and_layout_func() {
+void TextBoxEditTool::commit_update_and_layout_func_no_android_update() {
comp->obj->commit_update(drawP);
drawP.world.main.g.gui.set_to_layout();
+ // modmap update is required at the very least in response to input from the C++ side
+ if(userInput)
+ userInput->android_force_update_modmap();
+}
+
+void TextBoxEditTool::commit_update_func_and_android_update() {
+ comp->obj->commit_update(drawP);
+ if(userInput)
+ userInput->android_force_update_textbox_and_cursor();
+}
+
+void TextBoxEditTool::commit_update_and_layout_func_and_android_update() {
+ comp->obj->commit_update(drawP);
+ drawP.world.main.g.gui.set_to_layout();
+ if(userInput)
+ userInput->android_force_update_textbox_and_cursor();
}
void TextBoxEditTool::edit_gui(Toolbar& t) {
@@ -52,7 +90,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
.onFontChange = [&] {
currentMods[TextStyleModifier::ModifierType::FONT_FAMILIES] = std::make_shared(std::vector{SkString{newFontName.c_str(), newFontName.size()}});
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::FONT_FAMILIES]);});
- commit_update_func();
+ commit_update_func_and_android_update();
}
});
});
@@ -64,7 +102,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
newIsBold = !newIsBold;
currentMods[TextStyleModifier::ModifierType::WEIGHT] = std::make_shared(newIsBold ? SkFontStyle::Weight::kBold_Weight : SkFontStyle::Weight::kNormal_Weight);
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::WEIGHT]);});
- commit_update_func();
+ commit_update_func_and_android_update();
}
});
@@ -74,14 +112,14 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
newIsItalic = !newIsItalic;
currentMods[TextStyleModifier::ModifierType::SLANT] = std::make_shared(newIsItalic ? SkFontStyle::Slant::kItalic_Slant : SkFontStyle::Slant::kUpright_Slant);
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::SLANT]);});
- commit_update_func();
+ commit_update_func_and_android_update();
}
});
auto decorationChange = [&] {
currentMods[TextStyleModifier::ModifierType::DECORATION] = std::make_shared(get_new_decoration_value());
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::DECORATION]);});
- commit_update_func();
+ commit_update_func_and_android_update();
};
svg_icon_button(gui, "Underline button", "data/icons/RemixIcon/underline.svg", {
@@ -115,7 +153,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
.isSelected = isSelected,
.onClick = [&, func] {
add_undo(func);
- commit_update_func();
+ commit_update_func_and_android_update();
}
});
};
@@ -150,7 +188,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
.onEdit = [&] {
currentMods[TextStyleModifier::ModifierType::SIZE] = std::make_shared(newFontSize);
a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::SIZE]);
- commit_update_func();
+ commit_update_func_and_android_update();
},
.onSelect = [&] { hold_undo_data("Font Size", a); },
.onDeselect = [&] { release_undo_data("Font Size"); }
@@ -161,7 +199,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
.onChange = [&] {
currentMods[TextStyleModifier::ModifierType::COLOR] = std::make_shared(newTextColor);
a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::COLOR]);
- commit_update_func();
+ commit_update_func_and_android_update();
},
.onSelect = [&] { hold_undo_data("Text Color", a); },
.onDeselect = [&] { release_undo_data("Text Color"); }
@@ -176,13 +214,13 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
newHighlightColor.w() = 1.0f;
currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR] = std::make_shared(newHighlightColor);
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR]);});
- commit_update_and_layout_func();
+ commit_update_and_layout_func_and_android_update();
}
},
.onChange = [&] {
currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR] = std::make_shared(newHighlightColor);
a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR]);
- commit_update_and_layout_func();
+ commit_update_and_layout_func_and_android_update();
},
.onSelect = [&] { hold_undo_data("Highlight Color", a); },
.onDeselect = [&] { release_undo_data("Highlight Color"); }
@@ -193,7 +231,7 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
newHighlightColor = {0.0f, 0.0f, 0.0f, 0.0f};
currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR] = std::make_shared(newHighlightColor);
add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR]);});
- commit_update_and_layout_func();
+ commit_update_and_layout_func_and_android_update();
}
});
}
@@ -202,12 +240,323 @@ void TextBoxEditTool::edit_gui(Toolbar& t) {
});
}
+Vector4f* TextBoxEditTool::color_picker_color(Vector4f* oldColor) {
+ if(oldColor == &newTextColor)
+ return oldColor;
+ if(oldColor == &newHighlightColor)
+ return oldColor;
+ return nullptr;
+}
+
+bool TextBoxEditTool::phone_gui_tool_specific_bottom_toolbar_exists() {
+ return true;
+}
+
+void TextBoxEditTool::phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+
+ auto& gui = drawP.world.main.g.gui;
+ auto& io = gui.io;
+
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0) },
+ .childGap = io.theme->childGap1,
+ .childAlignment = { .x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_BOTTOM},
+ .layoutDirection = CLAY_TOP_TO_BOTTOM
+ }
+ }) {
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0) },
+ .childGap = io.theme->childGap1,
+ .childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_CENTER},
+ .layoutDirection = CLAY_LEFT_TO_RIGHT
+ }
+ }) {
+ switch(phoneGUIData.popupType) {
+ case PhoneGUIData::PopupType::NONE:
+ break;
+ case PhoneGUIData::PopupType::TEXT_COLOR: {
+ if(t.colorPickerPopupData.screenType == PhoneDrawingProgramScreen::ColorPickerPopupData::ScreenType::NORMAL) {
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0) },
+ }
+ }) {}
+ }
+ t.color_settings_popup(&newTextColor, phoneGUIData.colorSelectorData, nullptr);
+ break;
+ }
+ case PhoneGUIData::PopupType::HIGHLIGHT_COLOR: {
+ if(t.colorPickerPopupData.screenType == PhoneDrawingProgramScreen::ColorPickerPopupData::ScreenType::NORMAL) {
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0) },
+ }
+ }) {}
+ }
+ t.color_settings_popup(&newHighlightColor, phoneGUIData.colorSelectorData, nullptr, true, true);
+ break;
+ }
+ }
+ }
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0) },
+ .childGap = io.theme->childGap1,
+ .childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_CENTER},
+ .layoutDirection = CLAY_LEFT_TO_RIGHT
+ }
+ }) {
+ gui.element("bottom toolbar", [&](LayoutElement*, const Clay_ElementId& lId) {
+ CLAY(lId, {
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0)}
+ },
+ .backgroundColor = convert_vec4(io.theme->backColor1),
+ .cornerRadius = CLAY_CORNER_RADIUS(io.theme->windowCorners1)
+ }) {
+ gui.clipping_element("tools scroll", ScrollArea::Options{
+ .scrollHorizontal = true,
+ .clipHorizontal = true,
+ .scrollbarX = ScrollArea::ScrollbarType::NONE,
+ .layoutDirection = CLAY_LEFT_TO_RIGHT,
+ .xAlign = CLAY_ALIGN_X_LEFT,
+ .yAlign = CLAY_ALIGN_Y_CENTER,
+ .innerContent = [&](auto&) {
+ phone_bottom_toolbar_gui(t);
+ }
+ });
+ }
+ });
+ }
+ }
+}
+
+void TextBoxEditTool::phone_bottom_toolbar_gui(PhoneDrawingProgramScreen& t) {
+ using namespace GUIStuff;
+ using namespace ElementHelpers;
+ auto& gui = drawP.world.main.g.gui;
+ auto& a = static_cast(comp->obj->get_comp());
+ auto& currentMods = *currentModsPtr;
+
+ color_button(gui, "Text Color", &newTextColor, {
+ .isSelected = phoneGUIData.popupType == PhoneGUIData::PopupType::TEXT_COLOR,
+ .onClick = [&] {
+ t.reset_color_picker_popup_data();
+ if(phoneGUIData.popupType == PhoneGUIData::PopupType::TEXT_COLOR)
+ phoneGUIData.popupType = PhoneGUIData::PopupType::NONE;
+ else
+ phoneGUIData.popupType = PhoneGUIData::PopupType::TEXT_COLOR;
+ phoneGUIData.colorSelectorData = {
+ .onChange = [&] {
+ currentMods[TextStyleModifier::ModifierType::COLOR] = std::make_shared(newTextColor);
+ a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::COLOR]);
+ commit_update_func_and_android_update();
+ },
+ .onSelect = [&] { hold_undo_data("Text Color", a); },
+ .onDeselect = [&] { release_undo_data("Text Color"); }
+ };
+ }
+ });
+
+ color_button(gui, "Highlight Color", &newHighlightColor, {
+ .isSelected = phoneGUIData.popupType == PhoneGUIData::PopupType::HIGHLIGHT_COLOR,
+ .onClick = [&] {
+ t.reset_color_picker_popup_data();
+ if(phoneGUIData.popupType == PhoneGUIData::PopupType::HIGHLIGHT_COLOR)
+ phoneGUIData.popupType = PhoneGUIData::PopupType::NONE;
+ else
+ phoneGUIData.popupType = PhoneGUIData::PopupType::HIGHLIGHT_COLOR;
+ phoneGUIData.colorSelectorData = {
+ .onChange = [&] {
+ currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR] = std::make_shared(newHighlightColor);
+ a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::HIGHLIGHT_COLOR]);
+ commit_update_and_layout_func_and_android_update();
+ },
+ .onSelect = [&] { hold_undo_data("Highlight Color", a); },
+ .onDeselect = [&] { release_undo_data("Highlight Color"); }
+ };
+ }
+ });
+
+ CLAY_AUTO_ID({
+ .layout = {.sizing = {.width = CLAY_SIZING_FIXED(80)}}
+ }) {
+ number_dropdown(gui, "Font size", &newFontSize, 2, 80, 2, [&] {
+ currentMods[TextStyleModifier::ModifierType::SIZE] = std::make_shared(newFontSize);
+ add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::SIZE]);});
+ commit_update_func_and_android_update();
+ });
+ }
+
+ Element* fontPickerButton = svg_icon_button(gui, "Font Picker button", "data/icons/RemixIcon/font-serif.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = fontPickerIsOpen,
+ .onClick = [&] {
+ fontPickerIsOpen = !fontPickerIsOpen;
+ }
+ });
+
+ if(fontPickerIsOpen) {
+ gui.set_z_index(gui.get_z_index() + 1, [&] {
+ dropdown_many_element_popup_layout(gui, "Font Picker Popup", DropDownPopupLayout{
+ .button = fontPickerButton,
+ .isOpen = &fontPickerIsOpen,
+ .entrySize = {200.0f, BIG_BUTTON_SIZE},
+ .entryCount = FontPicker::sorted_font_list(gui).size(),
+ .entryLayout = [&](size_t i) {
+ gui.element("font button", SelectableButton::Data{
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newFontName == FontPicker::sorted_font_list(gui)[i],
+ .onClick = [&, i] {
+ newFontName = FontPicker::sorted_font_list(gui)[i];
+ currentMods[TextStyleModifier::ModifierType::FONT_FAMILIES] = std::make_shared(std::vector{SkString{newFontName.c_str(), newFontName.size()}});
+ add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::FONT_FAMILIES]);});
+ commit_update_func_and_android_update();
+ fontPickerIsOpen = false;
+ },
+ .innerContent = [&, i] (const SelectableButton::InnerContentCallbackParameters&) {
+ CLAY_AUTO_ID({
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0)},
+ .childAlignment = {.x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER}
+ }
+ }) {
+ TextParagraph::Data d;
+ RichText::TextData::Paragraph& par = d.text.paragraphs.emplace_back();
+ par.text = FontPicker::sorted_font_list(gui)[i];
+
+ d.allowNewlines = false;
+ d.ellipsis = false;
+
+ RichText::PositionedTextStyleMod& positionedMod = d.text.tStyleMods.emplace_back();
+ positionedMod.pos = {0, 0};
+ positionedMod.mods[RichText::TextStyleModifier::ModifierType::FONT_FAMILIES] = std::make_shared(std::vector{SkString{FontPicker::sorted_font_list(gui)[i].c_str(), FontPicker::sorted_font_list(gui)[i].size()}});
+
+ gui.element("font name", d);
+ }
+ }
+ });
+ }
+ });
+ });
+ }
+
+ svg_icon_button(gui, "Bold button", "data/icons/RemixIcon/bold.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newIsBold,
+ .onClick = [&] {
+ newIsBold = !newIsBold;
+ currentMods[TextStyleModifier::ModifierType::WEIGHT] = std::make_shared(newIsBold ? SkFontStyle::Weight::kBold_Weight : SkFontStyle::Weight::kNormal_Weight);
+ add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::WEIGHT]);});
+ commit_update_func_and_android_update();
+ }
+ });
+
+ svg_icon_button(gui, "Italic button", "data/icons/RemixIcon/italic.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newIsItalic,
+ .onClick = [&] {
+ newIsItalic = !newIsItalic;
+ currentMods[TextStyleModifier::ModifierType::SLANT] = std::make_shared(newIsItalic ? SkFontStyle::Slant::kItalic_Slant : SkFontStyle::Slant::kUpright_Slant);
+ add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::SLANT]);});
+ commit_update_func_and_android_update();
+ }
+ });
+
+ auto decorationChange = [&] {
+ currentMods[TextStyleModifier::ModifierType::DECORATION] = std::make_shared(get_new_decoration_value());
+ add_undo_if_selecting_area(a, [&]() {a.textBox->set_text_style_modifier_between(a.cursor->selectionBeginPos, a.cursor->selectionEndPos, currentMods[TextStyleModifier::ModifierType::DECORATION]);});
+ commit_update_func_and_android_update();
+ };
+
+ svg_icon_button(gui, "Underline button", "data/icons/RemixIcon/underline.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newIsUnderlined,
+ .onClick = [&, decorationChange] {
+ newIsUnderlined = !newIsUnderlined;
+ decorationChange();
+ }
+ });
+
+ svg_icon_button(gui, "Strikethrough button", "data/icons/RemixIcon/strikethrough.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newIsLinethrough,
+ .onClick = [&, decorationChange] {
+ newIsLinethrough = !newIsLinethrough;
+ decorationChange();
+ }
+ });
+
+ svg_icon_button(gui, "Overline button", "data/icons/RemixIcon/overline.svg", {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = newIsOverline,
+ .onClick = [&, decorationChange] {
+ newIsOverline = !newIsOverline;
+ decorationChange();
+ }
+ });
+
+ auto paragraph_operation_button = [&](const char* id, const char* svgPath, bool isSelected, const std::function& func) {
+ svg_icon_button(gui, id, svgPath, {
+ .drawType = SelectableButton::DrawType::TRANSPARENT_ALL,
+ .isSelected = isSelected,
+ .onClick = [&, func] {
+ add_undo(func);
+ commit_update_func_and_android_update();
+ }
+ });
+ };
+
+ paragraph_operation_button("Align left button", "data/icons/RemixIcon/align-left.svg", currentPStyle.textAlignment == skia::textlayout::TextAlign::kLeft, [&] {
+ currentPStyle.textAlignment = skia::textlayout::TextAlign::kLeft;
+ a.textBox->set_text_alignment_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextAlign::kLeft);
+ });
+ paragraph_operation_button("Align center button", "data/icons/RemixIcon/align-center.svg", currentPStyle.textAlignment == skia::textlayout::TextAlign::kCenter, [&] {
+ currentPStyle.textAlignment = skia::textlayout::TextAlign::kCenter;
+ a.textBox->set_text_alignment_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextAlign::kCenter);
+ });
+ paragraph_operation_button("Align right button", "data/icons/RemixIcon/align-right.svg", currentPStyle.textAlignment == skia::textlayout::TextAlign::kRight, [&] {
+ currentPStyle.textAlignment = skia::textlayout::TextAlign::kRight;
+ a.textBox->set_text_alignment_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextAlign::kRight);
+ });
+ paragraph_operation_button("Align justify button", "data/icons/RemixIcon/align-justify.svg", currentPStyle.textAlignment == skia::textlayout::TextAlign::kJustify, [&] {
+ currentPStyle.textAlignment = skia::textlayout::TextAlign::kJustify;
+ a.textBox->set_text_alignment_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextAlign::kJustify);
+ });
+ paragraph_operation_button("Text direction left button", "data/icons/RemixIcon/text-direction-l.svg", currentPStyle.textDirection == skia::textlayout::TextDirection::kLtr, [&] {
+ currentPStyle.textDirection = skia::textlayout::TextDirection::kLtr;
+ a.textBox->set_text_direction_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextDirection::kLtr);
+ });
+ paragraph_operation_button("Text direction right button", "data/icons/RemixIcon/text-direction-r.svg", currentPStyle.textDirection == skia::textlayout::TextDirection::kRtl, [&] {
+ currentPStyle.textDirection = skia::textlayout::TextDirection::kRtl;
+ a.textBox->set_text_direction_between(a.cursor->selectionBeginPos.fParagraphIndex, a.cursor->selectionEndPos.fParagraphIndex, skia::textlayout::TextDirection::kRtl);
+ });
+}
+
+void TextBoxEditTool::gui_phone_toolbox(PhoneDrawingProgramScreen& t) {
+}
+
void TextBoxEditTool::input_paste_callback(const CustomEvents::PasteEvent& paste) {
if(userInput && userInput->id == drawP.world.main.input.currentTextboxID.value()) {
auto& a = static_cast(comp->obj->get_comp());
if(userInput->input_paste_callback(paste)) {
- commit_update_and_layout_func();
set_styles_at_selection(a);
+ commit_update_and_layout_func_no_android_update();
+ }
+ }
+}
+
+void TextBoxEditTool::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {
+ if(userInput && userInput->id == drawP.world.main.input.currentTextboxID.value()) {
+ auto& a = static_cast(comp->obj->get_comp());
+ auto changes = userInput->input_android_text_box_input_callback(textboxInput);
+ if(changes.textEdited || changes.cursorChanged) {
+ set_styles_at_selection(a);
+ commit_update_and_layout_func_no_android_update();
}
}
}
@@ -217,8 +566,8 @@ void TextBoxEditTool::input_text_key_callback(const InputManager::KeyCallbackArg
auto& a = static_cast(comp->obj->get_comp());
auto changes = userInput->input_key_callback(drawP.world.main.input, key);
if(changes.textEdited || changes.cursorChanged) {
- commit_update_and_layout_func();
set_styles_at_selection(a);
+ commit_update_and_layout_func_no_android_update();
}
}
}
@@ -227,13 +576,13 @@ void TextBoxEditTool::input_text_callback(const InputManager::TextCallbackArgs&
if(userInput && userInput->id == drawP.world.main.input.currentTextboxID.value()) {
auto& a = static_cast(comp->obj->get_comp());
userInput->add_text_to_textbox(text.str);
- commit_update_and_layout_func();
set_styles_at_selection(a);
+ commit_update_and_layout_func_no_android_update();
}
}
void TextBoxEditTool::input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button, bool isDraggingPoint) {
- if(button.button == InputManager::MouseButton::LEFT && !isDraggingPoint) {
+ if(button.button == InputManager::MouseButton::LEFT && !isDraggingPoint && userInput) {
auto& a = static_cast(comp->obj->get_comp());
SCollision::ColliderCollection mousePointCollection;
@@ -245,10 +594,17 @@ void TextBoxEditTool::input_mouse_button_on_canvas_callback(const InputManager::
bool collidesWithBox = comp->obj->collides_with_cam_coords(drawP.world.drawData.cam.c, mousePointCollection);
auto oldCursor = *a.cursor;
- a.textBox->process_mouse_left_button(*a.cursor, a.get_mouse_pos(drawP), (button.down && button.clicks && collidesWithBox) ? button.clicks : 0, button.down, input.key(InputManager::KEY_GENERIC_LSHIFT).held);
+
+ if(button.deviceType == InputManager::MouseDeviceType::TOUCH) {
+ if(button.down)
+ userInput->input_finger_touch_down(a.get_mouse_pos(drawP));
+ }
+ else
+ userInput->process_mouse_left_button(a.get_mouse_pos(drawP), (button.down && button.clicks && collidesWithBox) ? button.clicks : 0, button.down, input.key(InputManager::KEY_GENERIC_LSHIFT).held);
+
if(oldCursor != *a.cursor) {
set_styles_at_selection(a);
- commit_update_and_layout_func();
+ commit_update_and_layout_func_no_android_update();
}
}
}
@@ -257,7 +613,7 @@ void TextBoxEditTool::input_mouse_motion_callback(const InputManager::MouseMotio
auto& a = static_cast(comp->obj->get_comp());
a.init_text_box(drawP);
- if(!isDraggingPoint) {
+ if(!isDraggingPoint && userInput) {
auto& a = static_cast(comp->obj->get_comp());
SCollision::ColliderCollection mousePointCollection;
@@ -267,16 +623,24 @@ void TextBoxEditTool::input_mouse_motion_callback(const InputManager::MouseMotio
InputManager& input = drawP.world.main.input;
auto oldCursor = *a.cursor;
- a.textBox->process_mouse_left_button(*a.cursor, a.get_mouse_pos(drawP), 0, drawP.controls.leftClickHeld, input.key(InputManager::KEY_GENERIC_LSHIFT).held);
+
+ if(motion.deviceType == InputManager::MouseDeviceType::TOUCH) {
+ if(drawP.controls.leftClickHeld)
+ userInput->input_finger_held_motion(a.get_mouse_pos(drawP));
+ }
+ else
+ userInput->process_mouse_left_button(a.get_mouse_pos(drawP), 0, drawP.controls.leftClickHeld, input.key(InputManager::KEY_GENERIC_LSHIFT).held);
+
if(oldCursor != *a.cursor) {
set_styles_at_selection(a);
- commit_update_and_layout_func();
+ commit_update_and_layout_func_no_android_update();
}
}
}
std::optional TextBoxEditTool::get_text_box_start_info() {
if(userInput) {
+ auto& a = static_cast(comp->obj->get_comp());
InputManager::TextInputProperties tProps {
.inputType = SDL_TextInputType::SDL_TEXTINPUT_TYPE_TEXT,
.capitalization = SDL_Capitalization::SDL_CAPITALIZE_NONE,
@@ -289,6 +653,9 @@ std::optional TextBoxEditTool::get_text_box_star
.id = userInput->id,
.rect = std::nullopt,
.inputProperties = tProps,
+ .textBox = a.textBox,
+ .cursor = a.cursor,
+ .modMap = currentModsPtr
};
}
return std::nullopt;
@@ -318,8 +685,8 @@ void TextBoxEditTool::right_click_popup_gui(Toolbar& t, Vector2f popupPos) {
userInput->do_textbox_operation_with_undo([&]() {
input.set_clipboard_plain_and_richtext_pair(a.textBox->process_cut(*a.cursor));
});
- commit_update_and_layout_func();
set_styles_at_selection(a);
+ commit_update_and_layout_func_and_android_update();
});
}
});
@@ -425,7 +792,7 @@ void TextBoxEditTool::edit_start(EditTool& editTool, std::any& prevData) {
comp->obj->commit_update(drawP);
- userInput = std::make_unique(drawP.world.main.input.text_box_get_new_id(), textbox, cur, currentModsPtr);
+ userInput = std::make_unique(CustomEvents::text_box_get_new_id(), textbox, cur, currentModsPtr);
CustomEvents::emit_event(CustomEvents::RefreshTextBoxInputEvent{});
}
diff --git a/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.hpp b/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.hpp
index 988a79a..a63f0ee 100644
--- a/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.hpp
+++ b/src/DrawingProgram/Tools/EditTools/TextBoxEditTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../../../CanvasComponents/TextBoxCanvasComponent.hpp"
#include "DrawingProgramEditToolBase.hpp"
@@ -15,15 +33,29 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
virtual void commit_edit_updates(std::any& prevData) override;
virtual bool edit_update() override;
virtual void edit_gui(Toolbar& t) override;
+ virtual void gui_phone_toolbox(PhoneDrawingProgramScreen& t) override;
virtual void right_click_popup_gui(Toolbar& t, Vector2f popupPos) override;
+ virtual Vector4f* color_picker_color(Vector4f* oldColor) override;
+ virtual bool phone_gui_tool_specific_bottom_toolbar_exists() override;
+ virtual void phone_gui_tool_specific_bottom_toolbar(PhoneDrawingProgramScreen& t) override;
virtual void input_paste_callback(const CustomEvents::PasteEvent& paste) override;
+ virtual void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) override;
virtual void input_text_key_callback(const InputManager::KeyCallbackArgs& key) override;
virtual void input_text_callback(const InputManager::TextCallbackArgs& text) override;
virtual void input_mouse_button_on_canvas_callback(const InputManager::MouseButtonCallbackArgs& button, bool isDraggingPoint) override;
virtual void input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool isDraggingPoint) override;
virtual std::optional get_text_box_start_info() override;
private:
+ struct PhoneGUIData {
+ enum class PopupType {
+ NONE,
+ TEXT_COLOR,
+ HIGHLIGHT_COLOR
+ } popupType = PopupType::NONE;
+ PhoneDrawingProgramScreen::ColorSelectorData colorSelectorData;
+ } phoneGUIData;
+
std::unique_ptr userInput;
struct TextBoxEditToolAllData {
@@ -31,6 +63,7 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
RichText::TextData richText;
};
+ bool fontPickerIsOpen = false;
uint32_t newFontSize = 15;
Vector4f newTextColor{1.0f, 1.0f, 1.0f, 1.0f};
Vector4f newHighlightColor{1.0f, 1.0f, 1.0f, 0.0f};
@@ -42,6 +75,8 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
std::string newFontName;
RichText::ParagraphStyleData currentPStyle;
+ void phone_bottom_toolbar_gui(PhoneDrawingProgramScreen& t);
+
uint8_t get_new_decoration_value();
void set_styles_at_selection(TextBoxCanvasComponent& a);
void add_undo_if_selecting_area(TextBoxCanvasComponent& a, const std::function& func);
@@ -50,14 +85,14 @@ class TextBoxEditTool : public DrawingProgramEditToolBase {
void hold_undo_data(const std::string& undoName, TextBoxCanvasComponent& a);
void release_undo_data(const std::string& undoName);
- void commit_update_func();
- void commit_update_and_layout_func();
+ void commit_update_func_no_android_update();
+ void commit_update_and_layout_func_no_android_update();
+ void commit_update_func_and_android_update();
+ void commit_update_and_layout_func_and_android_update();
std::unordered_map> undoHeldData;
std::shared_ptr currentModsPtr = std::make_shared();
- std::vector sortedFontList;
-
TextBoxEditToolAllData get_all_data(const TextBoxCanvasComponent& a);
};
diff --git a/src/DrawingProgram/Tools/EllipseDrawTool.cpp b/src/DrawingProgram/Tools/EllipseDrawTool.cpp
index 633443a..c405f48 100644
--- a/src/DrawingProgram/Tools/EllipseDrawTool.cpp
+++ b/src/DrawingProgram/Tools/EllipseDrawTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EllipseDrawTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/EllipseDrawTool.hpp b/src/DrawingProgram/Tools/EllipseDrawTool.hpp
index 8be5a01..0a719bb 100644
--- a/src/DrawingProgram/Tools/EllipseDrawTool.hpp
+++ b/src/DrawingProgram/Tools/EllipseDrawTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/EraserTool.cpp b/src/DrawingProgram/Tools/EraserTool.cpp
index e7c65e0..8ed6d79 100644
--- a/src/DrawingProgram/Tools/EraserTool.cpp
+++ b/src/DrawingProgram/Tools/EraserTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EraserTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/EraserTool.hpp b/src/DrawingProgram/Tools/EraserTool.hpp
index 2fad49c..5f02eec 100644
--- a/src/DrawingProgram/Tools/EraserTool.hpp
+++ b/src/DrawingProgram/Tools/EraserTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "../../DrawData.hpp"
diff --git a/src/DrawingProgram/Tools/EyeDropperTool.cpp b/src/DrawingProgram/Tools/EyeDropperTool.cpp
index f012fef..139974f 100644
--- a/src/DrawingProgram/Tools/EyeDropperTool.cpp
+++ b/src/DrawingProgram/Tools/EyeDropperTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "EyeDropperTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/EyeDropperTool.hpp b/src/DrawingProgram/Tools/EyeDropperTool.hpp
index 64e8edb..ecf3d7a 100644
--- a/src/DrawingProgram/Tools/EyeDropperTool.hpp
+++ b/src/DrawingProgram/Tools/EyeDropperTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
diff --git a/src/DrawingProgram/Tools/GridModifyTool.cpp b/src/DrawingProgram/Tools/GridModifyTool.cpp
index 4f46e0a..25da419 100644
--- a/src/DrawingProgram/Tools/GridModifyTool.cpp
+++ b/src/DrawingProgram/Tools/GridModifyTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "GridModifyTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/GridModifyTool.hpp b/src/DrawingProgram/Tools/GridModifyTool.hpp
index 08a2c93..c8e7332 100644
--- a/src/DrawingProgram/Tools/GridModifyTool.hpp
+++ b/src/DrawingProgram/Tools/GridModifyTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include "../../WorldGrid.hpp"
diff --git a/src/DrawingProgram/Tools/LassoSelectTool.cpp b/src/DrawingProgram/Tools/LassoSelectTool.cpp
index b323149..4c99e4c 100644
--- a/src/DrawingProgram/Tools/LassoSelectTool.cpp
+++ b/src/DrawingProgram/Tools/LassoSelectTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "LassoSelectTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/LassoSelectTool.hpp b/src/DrawingProgram/Tools/LassoSelectTool.hpp
index bc6dc58..a490e1b 100644
--- a/src/DrawingProgram/Tools/LassoSelectTool.hpp
+++ b/src/DrawingProgram/Tools/LassoSelectTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include "../../DrawData.hpp"
diff --git a/src/DrawingProgram/Tools/LineDrawTool.cpp b/src/DrawingProgram/Tools/LineDrawTool.cpp
index 743c237..9848f1d 100644
--- a/src/DrawingProgram/Tools/LineDrawTool.cpp
+++ b/src/DrawingProgram/Tools/LineDrawTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "LineDrawTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/LineDrawTool.hpp b/src/DrawingProgram/Tools/LineDrawTool.hpp
index 33c0bde..3c557e2 100644
--- a/src/DrawingProgram/Tools/LineDrawTool.hpp
+++ b/src/DrawingProgram/Tools/LineDrawTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/PanCanvasTool.cpp b/src/DrawingProgram/Tools/PanCanvasTool.cpp
index d00e5ae..a9e5dfb 100644
--- a/src/DrawingProgram/Tools/PanCanvasTool.cpp
+++ b/src/DrawingProgram/Tools/PanCanvasTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "PanCanvasTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/PanCanvasTool.hpp b/src/DrawingProgram/Tools/PanCanvasTool.hpp
index ec82d96..09363aa 100644
--- a/src/DrawingProgram/Tools/PanCanvasTool.hpp
+++ b/src/DrawingProgram/Tools/PanCanvasTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
diff --git a/src/DrawingProgram/Tools/RectDrawTool.cpp b/src/DrawingProgram/Tools/RectDrawTool.cpp
index 0b40f9a..760df66 100644
--- a/src/DrawingProgram/Tools/RectDrawTool.cpp
+++ b/src/DrawingProgram/Tools/RectDrawTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "RectDrawTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/RectDrawTool.hpp b/src/DrawingProgram/Tools/RectDrawTool.hpp
index b469125..bae46b6 100644
--- a/src/DrawingProgram/Tools/RectDrawTool.hpp
+++ b/src/DrawingProgram/Tools/RectDrawTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/RectSelectTool.cpp b/src/DrawingProgram/Tools/RectSelectTool.cpp
index 80a6307..ce745ac 100644
--- a/src/DrawingProgram/Tools/RectSelectTool.cpp
+++ b/src/DrawingProgram/Tools/RectSelectTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "RectSelectTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/RectSelectTool.hpp b/src/DrawingProgram/Tools/RectSelectTool.hpp
index d220e5e..a11cff3 100644
--- a/src/DrawingProgram/Tools/RectSelectTool.hpp
+++ b/src/DrawingProgram/Tools/RectSelectTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/ScreenshotTool.cpp b/src/DrawingProgram/Tools/ScreenshotTool.cpp
index 7a8c62d..4900753 100644
--- a/src/DrawingProgram/Tools/ScreenshotTool.cpp
+++ b/src/DrawingProgram/Tools/ScreenshotTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ScreenshotTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/ScreenshotTool.hpp b/src/DrawingProgram/Tools/ScreenshotTool.hpp
index 7c2d6b0..92a3dff 100644
--- a/src/DrawingProgram/Tools/ScreenshotTool.hpp
+++ b/src/DrawingProgram/Tools/ScreenshotTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/TextBoxTool.cpp b/src/DrawingProgram/Tools/TextBoxTool.cpp
index b52b46d..f66918b 100644
--- a/src/DrawingProgram/Tools/TextBoxTool.cpp
+++ b/src/DrawingProgram/Tools/TextBoxTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "TextBoxTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
@@ -46,6 +64,8 @@ void TextBoxTool::input_mouse_button_on_canvas_callback(const InputManager::Mous
newTextBox.d.p2 = ensure_points_have_distance(newTextBox.d.p1, newTextBox.d.p2, MINIMUM_DISTANCE_BETWEEN_BOUNDS);
newTextBox.d.editing = true;
newContainer->coords = drawP.world.drawData.cam.c;
+ if(drawP.world.main.g.gui.io.isTouchDevice)
+ newContainer->coords.scale_about_double(drawP.world.drawData.cam.c.from_space(startAt), 1.0 / drawP.world.main.g.final_gui_scale());
objInfoBeingEdited = drawP.layerMan.add_component_to_layer_being_edited(newContainer);
}
else if(!button.down && objInfoBeingEdited) {
diff --git a/src/DrawingProgram/Tools/TextBoxTool.hpp b/src/DrawingProgram/Tools/TextBoxTool.hpp
index 5ab5197..b4bcda9 100644
--- a/src/DrawingProgram/Tools/TextBoxTool.hpp
+++ b/src/DrawingProgram/Tools/TextBoxTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
#include
diff --git a/src/DrawingProgram/Tools/ZoomCanvasTool.cpp b/src/DrawingProgram/Tools/ZoomCanvasTool.cpp
index 31678ed..30403a8 100644
--- a/src/DrawingProgram/Tools/ZoomCanvasTool.cpp
+++ b/src/DrawingProgram/Tools/ZoomCanvasTool.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ZoomCanvasTool.hpp"
#include "../DrawingProgram.hpp"
#include "../../MainProgram.hpp"
diff --git a/src/DrawingProgram/Tools/ZoomCanvasTool.hpp b/src/DrawingProgram/Tools/ZoomCanvasTool.hpp
index 4dc3a36..4dff0c3 100644
--- a/src/DrawingProgram/Tools/ZoomCanvasTool.hpp
+++ b/src/DrawingProgram/Tools/ZoomCanvasTool.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "DrawingProgramToolBase.hpp"
diff --git a/src/FileHelpers.cpp b/src/FileHelpers.cpp
index 9455f36..2a5907a 100644
--- a/src/FileHelpers.cpp
+++ b/src/FileHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "FileHelpers.hpp"
#include
#include
diff --git a/src/FileHelpers.hpp b/src/FileHelpers.hpp
index 02b9536..a201740 100644
--- a/src/FileHelpers.hpp
+++ b/src/FileHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
diff --git a/src/FontData.cpp b/src/FontData.cpp
index 7ce2ff8..f9076ad 100644
--- a/src/FontData.cpp
+++ b/src/FontData.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "FontData.hpp"
#include
#include
diff --git a/src/FontData.hpp b/src/FontData.hpp
index 4c1e2ef..5cdd3bf 100644
--- a/src/FontData.hpp
+++ b/src/FontData.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include
#include
diff --git a/src/GUIHolder.cpp b/src/GUIHolder.cpp
index 841c221..dd54a57 100644
--- a/src/GUIHolder.cpp
+++ b/src/GUIHolder.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "GUIHolder.hpp"
#include
#include
@@ -126,6 +144,10 @@ void GUIHolder::input_paste_callback(const CustomEvents::PasteEvent& paste) {
gui.input_paste_callback(paste);
}
+void GUIHolder::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {
+ gui.input_android_text_box_input_callback(textboxInput);
+}
+
void GUIHolder::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {
gui.input_text_key_callback(key);
}
diff --git a/src/GUIHolder.hpp b/src/GUIHolder.hpp
index 047dca4..7da824f 100644
--- a/src/GUIHolder.hpp
+++ b/src/GUIHolder.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "CustomEvents.hpp"
@@ -22,6 +40,7 @@ class GUIHolder {
void draw(SkCanvas* canvas, bool skiaAA);
void input_paste_callback(const CustomEvents::PasteEvent& paste);
+ void input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput);
void input_text_key_callback(const InputManager::KeyCallbackArgs& key);
void input_text_callback(const InputManager::TextCallbackArgs& text);
void input_key_callback(const InputManager::KeyCallbackArgs& key);
diff --git a/src/GUIStuff/ClayImplement.cpp b/src/GUIStuff/ClayImplement.cpp
index 1ff0eb0..402a532 100644
--- a/src/GUIStuff/ClayImplement.cpp
+++ b/src/GUIStuff/ClayImplement.cpp
@@ -1,2 +1,20 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#define CLAY_IMPLEMENTATION
#include
diff --git a/src/GUIStuff/ElementHelpers/ButtonHelpers.cpp b/src/GUIStuff/ElementHelpers/ButtonHelpers.cpp
index 8b1fd09..3478507 100644
--- a/src/GUIStuff/ElementHelpers/ButtonHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/ButtonHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ButtonHelpers.hpp"
#include "../Elements/SVGIcon.hpp"
#include "../Elements/LayoutElement.hpp"
diff --git a/src/GUIStuff/ElementHelpers/ButtonHelpers.hpp b/src/GUIStuff/ElementHelpers/ButtonHelpers.hpp
index c99312c..1d77883 100644
--- a/src/GUIStuff/ElementHelpers/ButtonHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/ButtonHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "../Elements/SelectableButton.hpp"
diff --git a/src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp b/src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp
index 161cbfb..11f2df9 100644
--- a/src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CheckBoxHelpers.hpp"
#include "LayoutHelpers.hpp"
#include "TextLabelHelpers.hpp"
diff --git a/src/GUIStuff/ElementHelpers/CheckBoxHelpers.hpp b/src/GUIStuff/ElementHelpers/CheckBoxHelpers.hpp
index 33fc304..5b6057a 100644
--- a/src/GUIStuff/ElementHelpers/CheckBoxHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/CheckBoxHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
diff --git a/src/GUIStuff/ElementHelpers/ColorPickerHelpers.hpp b/src/GUIStuff/ElementHelpers/ColorPickerHelpers.hpp
index f152d6d..9533a14 100644
--- a/src/GUIStuff/ElementHelpers/ColorPickerHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/ColorPickerHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "ColorPickerItemsHelpers.hpp"
#include "../Elements/ColorPickerButton.hpp"
diff --git a/src/GUIStuff/ElementHelpers/ColorPickerItemsHelpers.hpp b/src/GUIStuff/ElementHelpers/ColorPickerItemsHelpers.hpp
index 70d8ff0..4044331 100644
--- a/src/GUIStuff/ElementHelpers/ColorPickerItemsHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/ColorPickerItemsHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "TextBoxHelpers.hpp"
diff --git a/src/GUIStuff/ElementHelpers/DropdownHelpers.hpp b/src/GUIStuff/ElementHelpers/DropdownHelpers.hpp
new file mode 100644
index 0000000..2f4c5f7
--- /dev/null
+++ b/src/GUIStuff/ElementHelpers/DropdownHelpers.hpp
@@ -0,0 +1,53 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
+#pragma once
+#include "../GUIManager.hpp"
+#include "../Elements/DropDown.hpp"
+
+namespace GUIStuff { namespace ElementHelpers {
+
+template void number_dropdown(GUIManager& gui, const char* id, T* data, int32_t minData, int32_t maxData, int32_t step, const std::function& onChange = nullptr) {
+ std::vector dropdownStrings;
+ size_t closestSelectionDistance = std::numeric_limits::max();
+ std::shared_ptr currentSelection = std::make_shared(0);
+ {
+ size_t i = 0;
+ for(int32_t newSelection = minData; newSelection <= maxData; newSelection += step) {
+ size_t newDistance = std::abs(static_cast(*data) - newSelection);
+ if(newDistance < closestSelectionDistance) {
+ closestSelectionDistance = newDistance;
+ *currentSelection = i;
+ }
+ dropdownStrings.emplace_back(std::to_string(newSelection));
+ i++;
+ }
+ }
+
+ gui.element>(id, currentSelection.get(), dropdownStrings, DropdownOptions{
+ .onClick = [minData, step, data, onChange, currentSelection] {
+ int32_t newVal = minData;
+ for(size_t i = 0; i < *currentSelection; i++)
+ newVal += step;
+ *data = static_cast(newVal);
+ if(onChange) onChange();
+ }
+ });
+}
+
+}}
diff --git a/src/GUIStuff/ElementHelpers/LayoutHelpers.cpp b/src/GUIStuff/ElementHelpers/LayoutHelpers.cpp
index 6a720a5..5615692 100644
--- a/src/GUIStuff/ElementHelpers/LayoutHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/LayoutHelpers.cpp
@@ -1,6 +1,25 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "LayoutHelpers.hpp"
#include "../Elements/LayoutElement.hpp"
#include "Helpers/ConvertVec.hpp"
+#include "../Elements/ManyElementScrollArea.hpp"
namespace GUIStuff { namespace ElementHelpers {
@@ -213,4 +232,130 @@ void window_gap_side_bar(GUIManager& gui, const WindowFillSideBarConfig::Directi
}
}
+void bottom_offset_setup(GUIManager& gui, float dropdownHeight, Clay_FloatingElementConfig& floatConfig, float& maxHeight, const DropDownPopupLayout& d) {
+ auto& bb = d.button->get_bb().value();
+
+ float xOffset = bb.center().x() - d.entrySize.x() * 0.5f;
+
+ if(xOffset < 0.0f)
+ xOffset = 0.0f;
+ else if(xOffset + d.entrySize.x() > gui.io.safeWindowRect.max.x())
+ xOffset = gui.io.safeWindowRect.max.x() - d.entrySize.x();
+
+ floatConfig = {
+ .offset = {
+ .x = xOffset,
+ .y = bb.max.y() + d.dropdownOffset
+ },
+ .zIndex = gui.get_z_index(),
+ .attachPoints = {
+ .element = CLAY_ATTACH_POINT_LEFT_TOP,
+ .parent = CLAY_ATTACH_POINT_LEFT_TOP
+ },
+ .attachTo = CLAY_ATTACH_TO_ROOT
+ };
+
+ maxHeight = std::max(gui.io.safeWindowRect.max.y() - bb.max.y() - d.dropdownOffset, 0.0f);
+}
+
+void top_offset_setup(GUIManager& gui, float dropdownHeight, Clay_FloatingElementConfig& floatConfig, float& maxHeight, const DropDownPopupLayout& d) {
+ auto& bb = d.button->get_bb().value();
+
+ float xOffset = bb.center().x() - d.entrySize.x() * 0.5f;
+
+ if(xOffset < 0.0f)
+ xOffset = 0.0f;
+ else if(xOffset + d.entrySize.x() > gui.io.safeWindowRect.max.x())
+ xOffset = gui.io.safeWindowRect.max.x() - d.entrySize.x();
+
+ floatConfig = {
+ .offset = {
+ .x = xOffset,
+ .y = bb.min.y() - d.dropdownOffset
+ },
+ .zIndex = gui.get_z_index(),
+ .attachPoints = {
+ .element = CLAY_ATTACH_POINT_LEFT_BOTTOM,
+ .parent = CLAY_ATTACH_POINT_LEFT_TOP
+ },
+ .attachTo = CLAY_ATTACH_TO_ROOT
+ };
+
+ maxHeight = std::max(bb.min.y() - gui.io.safeWindowRect.min.y() - d.dropdownOffset, 0.0f);
+}
+
+void left_right_offset_setup(GUIManager& gui, float dropdownHeight, Clay_FloatingElementConfig& floatConfig, float& maxHeight, bool isRightSide, const DropDownPopupLayout& d) {
+ auto& bb = d.button->get_bb().value();
+ float offsetY = bb.center().y() - dropdownHeight * 0.5f;
+ if(dropdownHeight >= gui.io.safeWindowRect.height() || offsetY < gui.io.safeWindowRect.min.y())
+ offsetY = gui.io.safeWindowRect.min.y();
+ else if(offsetY + dropdownHeight > gui.io.safeWindowRect.max.y())
+ offsetY -= (offsetY + dropdownHeight) - gui.io.safeWindowRect.max.y();
+ floatConfig = {
+ .offset = {
+ .x = isRightSide ? bb.max.x() + d.dropdownOffset : bb.min.x() - bb.width() - d.dropdownOffset,
+ .y = offsetY
+ },
+ .zIndex = gui.get_z_index(),
+ .attachPoints = {
+ .element = CLAY_ATTACH_POINT_LEFT_TOP,
+ .parent = CLAY_ATTACH_POINT_LEFT_TOP
+ },
+ .attachTo = CLAY_ATTACH_TO_ROOT
+ };
+ maxHeight = gui.io.safeWindowRect.height();
+}
+
+void dropdown_many_element_popup_layout(GUIManager& gui, const char* id, const DropDownPopupLayout& d) {
+ if(!d.button->get_bb().has_value())
+ return;
+ gui.element(id, [&](LayoutElement* l, const Clay_ElementId& lId) {
+ float dropdownHeight = d.entrySize.y() * d.entryCount + d.dropdownOffset;
+ Clay_FloatingElementConfig floatConfig;
+ float maxHeight = gui.io.safeWindowRect.height();
+ auto& buttonBB = d.button->get_bb().value();
+ if(buttonBB.max.y() + dropdownHeight > gui.io.safeWindowRect.max.y()) {
+ float rightSideWidth = gui.io.safeWindowRect.max.x() - buttonBB.max.x();
+ float leftSideWidth = buttonBB.min.x() - gui.io.safeWindowRect.min.x();
+ if(rightSideWidth > d.entrySize.x() || leftSideWidth > d.entrySize.x())
+ left_right_offset_setup(gui, dropdownHeight, floatConfig, maxHeight, rightSideWidth >= leftSideWidth, d);
+ else {
+ if(gui.io.safeWindowRect.max.y() - buttonBB.max.y() >= buttonBB.min.y() - gui.io.safeWindowRect.min.y())
+ bottom_offset_setup(gui, dropdownHeight, floatConfig, maxHeight, d);
+ else
+ top_offset_setup(gui, dropdownHeight, floatConfig, maxHeight, d);
+ }
+ }
+ else
+ bottom_offset_setup(gui, dropdownHeight, floatConfig, maxHeight, d);
+ CLAY(lId, {
+ .layout = {
+ .sizing = {.width = CLAY_SIZING_FIXED(d.entrySize.x()), .height = CLAY_SIZING_FIT(0, maxHeight)},
+ .childGap = 0
+ },
+ .backgroundColor = convert_vec4(gui.io.theme->backColor1),
+ .cornerRadius = CLAY_CORNER_RADIUS(4),
+ .floating = floatConfig,
+ .border = {
+ .color = convert_vec4(gui.io.theme->fillColor2),
+ .width = CLAY_BORDER_OUTSIDE(1)
+ }
+ }) {
+ gui.element("dropdown scroll area", ManyElementScrollArea::Options{
+ .entryHeight = d.entrySize.y(),
+ .entryCount = d.entryCount,
+ .clipHorizontal = true,
+ .elementContent = d.entryLayout
+ });
+ }
+ }, LayoutElement::Callbacks {
+ .onClick = [&, d](LayoutElement* l, const InputManager::MouseButtonCallbackArgs& m) {
+ if(!l->mouseHovering && !l->childMouseHovering && m.down && !d.button->mouseHovering && d.isOpen) {
+ *d.isOpen = false;
+ gui.set_to_layout();
+ }
+ }
+ });
+}
+
}}
diff --git a/src/GUIStuff/ElementHelpers/LayoutHelpers.hpp b/src/GUIStuff/ElementHelpers/LayoutHelpers.hpp
index a7da200..b328497 100644
--- a/src/GUIStuff/ElementHelpers/LayoutHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/LayoutHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "../Elements/LayoutElement.hpp"
@@ -23,4 +41,15 @@ struct WindowFillSideBarConfig {
void window_fill_side_bar(GUIManager& gui, const WindowFillSideBarConfig& config, const std::function& innerContent);
void window_gap_side_bar(GUIManager& gui, const WindowFillSideBarConfig::Direction& dir);
+struct DropDownPopupLayout {
+ float dropdownOffset = 4.0f;
+ Element* button = nullptr;
+ bool* isOpen;
+ Vector2f entrySize;
+ size_t entryCount;
+ std::function entryLayout;
+};
+
+void dropdown_many_element_popup_layout(GUIManager& gui, const char* id, const DropDownPopupLayout& d);
+
}}
diff --git a/src/GUIStuff/ElementHelpers/NumberSliderHelpers.hpp b/src/GUIStuff/ElementHelpers/NumberSliderHelpers.hpp
index bd5ec84..0bfaf0e 100644
--- a/src/GUIStuff/ElementHelpers/NumberSliderHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/NumberSliderHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "TextBoxHelpers.hpp"
diff --git a/src/GUIStuff/ElementHelpers/PopupHelpers.cpp b/src/GUIStuff/ElementHelpers/PopupHelpers.cpp
index 19ac737..0f76f1d 100644
--- a/src/GUIStuff/ElementHelpers/PopupHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/PopupHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "PopupHelpers.hpp"
namespace GUIStuff { namespace ElementHelpers {
diff --git a/src/GUIStuff/ElementHelpers/PopupHelpers.hpp b/src/GUIStuff/ElementHelpers/PopupHelpers.hpp
index 7fdc614..a6fcac5 100644
--- a/src/GUIStuff/ElementHelpers/PopupHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/PopupHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "../Elements/PaintCircleMenu.hpp"
diff --git a/src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp b/src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp
index 51dfdf4..f3b839e 100644
--- a/src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "RadioButtonHelpers.hpp"
#include "../Elements/RadioButton.hpp"
#include "LayoutHelpers.hpp"
diff --git a/src/GUIStuff/ElementHelpers/RadioButtonHelpers.hpp b/src/GUIStuff/ElementHelpers/RadioButtonHelpers.hpp
index a7b0b4f..269629b 100644
--- a/src/GUIStuff/ElementHelpers/RadioButtonHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/RadioButtonHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
diff --git a/src/GUIStuff/ElementHelpers/TextBoxHelpers.cpp b/src/GUIStuff/ElementHelpers/TextBoxHelpers.cpp
index 658f535..680a8a3 100644
--- a/src/GUIStuff/ElementHelpers/TextBoxHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/TextBoxHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "TextBoxHelpers.hpp"
#include "LayoutHelpers.hpp"
diff --git a/src/GUIStuff/ElementHelpers/TextBoxHelpers.hpp b/src/GUIStuff/ElementHelpers/TextBoxHelpers.hpp
index 8ba9405..5776f1e 100644
--- a/src/GUIStuff/ElementHelpers/TextBoxHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/TextBoxHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
#include "../Elements/TextBox.hpp"
diff --git a/src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp b/src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp
index 081742a..3a482fd 100644
--- a/src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp
+++ b/src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "TextLabelHelpers.hpp"
#include "../Elements/MutableTextLabel.hpp"
#include "Helpers/ConvertVec.hpp"
diff --git a/src/GUIStuff/ElementHelpers/TextLabelHelpers.hpp b/src/GUIStuff/ElementHelpers/TextLabelHelpers.hpp
index 8a8d3e9..a2ee966 100644
--- a/src/GUIStuff/ElementHelpers/TextLabelHelpers.hpp
+++ b/src/GUIStuff/ElementHelpers/TextLabelHelpers.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "../GUIManager.hpp"
diff --git a/src/GUIStuff/Elements/AlphaSlider.cpp b/src/GUIStuff/Elements/AlphaSlider.cpp
index 9e714bf..c9b2024 100644
--- a/src/GUIStuff/Elements/AlphaSlider.cpp
+++ b/src/GUIStuff/Elements/AlphaSlider.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "AlphaSlider.hpp"
#include "../GUIManager.hpp"
#include "ColorPicker.hpp"
diff --git a/src/GUIStuff/Elements/AlphaSlider.hpp b/src/GUIStuff/Elements/AlphaSlider.hpp
index bb8eef6..bd36a75 100644
--- a/src/GUIStuff/Elements/AlphaSlider.hpp
+++ b/src/GUIStuff/Elements/AlphaSlider.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Element.hpp"
diff --git a/src/GUIStuff/Elements/CheckBox.cpp b/src/GUIStuff/Elements/CheckBox.cpp
index 64234e3..04a58a6 100644
--- a/src/GUIStuff/Elements/CheckBox.cpp
+++ b/src/GUIStuff/Elements/CheckBox.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "CheckBox.hpp"
#include
#include
diff --git a/src/GUIStuff/Elements/CheckBox.hpp b/src/GUIStuff/Elements/CheckBox.hpp
index b8747ea..8d8963b 100644
--- a/src/GUIStuff/Elements/CheckBox.hpp
+++ b/src/GUIStuff/Elements/CheckBox.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Element.hpp"
diff --git a/src/GUIStuff/Elements/ColorPicker.decl.hpp b/src/GUIStuff/Elements/ColorPicker.decl.hpp
index 1be99a6..1f5c0ef 100644
--- a/src/GUIStuff/Elements/ColorPicker.decl.hpp
+++ b/src/GUIStuff/Elements/ColorPicker.decl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Element.hpp"
#include
diff --git a/src/GUIStuff/Elements/ColorPicker.hpp b/src/GUIStuff/Elements/ColorPicker.hpp
index d45c611..a3c6d7e 100644
--- a/src/GUIStuff/Elements/ColorPicker.hpp
+++ b/src/GUIStuff/Elements/ColorPicker.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "ColorPicker.decl.hpp"
#include "ColorPicker.impl.hpp"
diff --git a/src/GUIStuff/Elements/ColorPicker.impl.hpp b/src/GUIStuff/Elements/ColorPicker.impl.hpp
index 8957237..8b138ae 100644
--- a/src/GUIStuff/Elements/ColorPicker.impl.hpp
+++ b/src/GUIStuff/Elements/ColorPicker.impl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "ColorPicker.decl.hpp"
#include "../GUIManager.hpp"
diff --git a/src/GUIStuff/Elements/ColorPickerButton.decl.hpp b/src/GUIStuff/Elements/ColorPickerButton.decl.hpp
index 476efd9..53886ad 100644
--- a/src/GUIStuff/Elements/ColorPickerButton.decl.hpp
+++ b/src/GUIStuff/Elements/ColorPickerButton.decl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Element.hpp"
diff --git a/src/GUIStuff/Elements/ColorPickerButton.hpp b/src/GUIStuff/Elements/ColorPickerButton.hpp
index 52564ed..483bc3a 100644
--- a/src/GUIStuff/Elements/ColorPickerButton.hpp
+++ b/src/GUIStuff/Elements/ColorPickerButton.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "ColorPickerButton.decl.hpp"
#include "ColorPickerButton.impl.hpp"
diff --git a/src/GUIStuff/Elements/ColorPickerButton.impl.hpp b/src/GUIStuff/Elements/ColorPickerButton.impl.hpp
index 26b6e47..6518ea4 100644
--- a/src/GUIStuff/Elements/ColorPickerButton.impl.hpp
+++ b/src/GUIStuff/Elements/ColorPickerButton.impl.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ColorPickerButton.decl.hpp"
#include "../ElementHelpers/ColorPickerItemsHelpers.hpp"
#include "../ElementHelpers/ButtonHelpers.hpp"
diff --git a/src/GUIStuff/Elements/ColorPickerShaders.cpp b/src/GUIStuff/Elements/ColorPickerShaders.cpp
index 950ce4f..953d5e0 100644
--- a/src/GUIStuff/Elements/ColorPickerShaders.cpp
+++ b/src/GUIStuff/Elements/ColorPickerShaders.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ColorPicker.decl.hpp"
#include
diff --git a/src/GUIStuff/Elements/ColorRectangleDisplay.cpp b/src/GUIStuff/Elements/ColorRectangleDisplay.cpp
index 048eff7..9c106ab 100644
--- a/src/GUIStuff/Elements/ColorRectangleDisplay.cpp
+++ b/src/GUIStuff/Elements/ColorRectangleDisplay.cpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#include "ColorRectangleDisplay.hpp"
#include "../GUIManager.hpp"
diff --git a/src/GUIStuff/Elements/ColorRectangleDisplay.hpp b/src/GUIStuff/Elements/ColorRectangleDisplay.hpp
index 5e97579..14f6974 100644
--- a/src/GUIStuff/Elements/ColorRectangleDisplay.hpp
+++ b/src/GUIStuff/Elements/ColorRectangleDisplay.hpp
@@ -1,3 +1,21 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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 .
+ */
+
#pragma once
#include "Element.hpp"
#include
diff --git a/src/GUIStuff/Elements/DropDown.hpp b/src/GUIStuff/Elements/DropDown.hpp
index d07d7d2..8c78ed9 100644
--- a/src/GUIStuff/Elements/DropDown.hpp
+++ b/src/GUIStuff/Elements/DropDown.hpp
@@ -1,11 +1,28 @@
+/*
+ * InfiniPaint
+ * Copyright (C) 2025-2026 Yousef Khadadeh
+ *
+ * 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