Organization
Inkscape
Project Name
GTK4 Migrations
About
Venturing into the realm of open-source creativity and innovation, I, Vaibhav Malik, proudly embarked on a transformative journey during GSoC 2023 with Inkscape as a dedicated mentee.
My attention was directed towards meticulously preparing the toolbar classes utilized in Inkscape for a seamless transition to the GTK4 framework. The process of preparing the Toolbars for the GTK4 port encompassed:
Removing deprecated widgets like
Gtk::Toolbar
andGtk::Tool*
along with their corresponding API.Removing redundant code from the toolbar classes.
Crafting individual .ui files for each toolbar.
Furthermore, I introduced a tailored popover-based resizing mechanism to manage widget overflow within the Toolbars of Inkscape.
This journey has been a rich learning experience, where each line of code written translated into more robust and simplified code for the Inkscape project. In this blog, I've captured the essence of my journey, outlining the core of my endeavours during GSoC 2023. Delve into the blog to gain insight into the scope of work I've undertaken, the challenges I've encountered, and the unwavering support I've received from the community at every juncture of this expedition.
Code
https://gitlab.com/inkscape/inkscape/-/merge_requests/5335
Blogs
Timeline
Community Bonding Period
Leveraging my familiarity with the codebase, I utilized the community bonding period to architect class structures and plan a custom resize handler mechanism for the toolbars.
Coding Period
I commenced by introducing the ToolbarMenuButton
widget class into Inkscape. Subsequently, I implemented a tailored resizing mechanism within the base class of Toolbars in Inkscape to manage the overflow of widgets.
Following that, I embarked on a systematic preparation of each toolbar for the GTK4 port. I systematically eradicated all occurrences of Gtk::Toolbar from the codebase. This comprehensive effort entailed the creation of distinct .ui files for each toolbar intended for porting. Furthermore, I updated the constructor to employ the corresponding .ui file to generate the required toolbar.
Amidst these endeavours, I also converted pointer types to reference types to enhance the overall robustness and safety of the codebase.
Summary
As the 12th week drew to a close, I achieved significant milestones in the preparation for the GTK4 port. I successfully readied all the toolbars for the transition, which involved the creation of individual .ui
files for each toolbar. Additionally, I effectively eliminated all occurrences of Gtk::Toolbar
and from the codebase. Notably, the custom resizing mechanism was functioning as anticipated.
At present, my focus is directed towards resolving the window resize challenges that have arisen as a result of the Toolbars' porting process.
Challenges Faced
It required some time to comprehend the usage of derived widget classes in conjunction with .ui files.
Implementing the resizing mechanism for the toolbars posed a significant challenge on its own.
As of now, I have yet to arrive at the ideal solution for addressing the window resize issues that have emerged due to the preparation of Toolbars for the GTK4 port.
Future Plans
Comprehensive resolution of all issues tied to toolbar and window resizing.
Incorporating group-specific icons into each
ToolbarMenuButton
widget.To assist with any remaining tasks related to the migration to GTK4.