This summer, I was pleased to get selected for Google Summer of Code'21 🚀 under the organization Synfig Studio.
Synfig uses widgets from version 3.0 which are deprecated in version 3.14 (3.10). My task will be to find those classes and replace them with their appropriate alternative from GTK 3.0 which will make the code much more effective and will make it easier for us to later switch to upcoming GTK 4.0.
The purpose of creating this repository is to maintain a report summary of my GSoC work and this may also serve as a guide for future GSoC aspirants and a reference to the developers and contributors to the project.
In order to continue with this project, I had to learn using GNU Debugger (gdb). I spent most of my pre GSoC period learning using gdb. I followed this link to learn about gdb.
I learnt the basics of gdb i.e. how breakpoints works, how to delete breakpoints and how to print and display variable values and some other basic stuff before moving onto the actual codebase.
Now after having some decent experience with debugging, I then decided to learn more about Synfig's codebase and was trying to become familiar with it.
Although learning GDB is totally optional for those who are willing to contribute to this project idea. It wasn't of much use to me but still learning it will be a plus in later stages of development in any Cpp based project 😄.
During this period, I learnt a lot, made a lot of mistakes and then corrected them. This itself was a great experience for me.
Classes that I was able to migrate successfully were :
Gtk::HBox
Gtk::VScale
Implemented CSS classes, rather than using fixed width in main code
Gtk::Alignment
Gtk::Application
Removed Gtk::Main
Gtk::HScale
To summarize, I replaced deprecated Gtk GUI components with the perfect updated alternative without changing the GUI behaviour and without any loss of functionality.
Classes that are being migrated were ( work in progress ) :
Gtk::UIManager
Gtk::StockID
Gtk::Action
Gtk::ActionGroup
To Summarize, we still have to work on these remaining classes. I am currently working on Gtk::Action and Gtk::ActionGroup and they have to be replaced by Gio::SimpleAction and Gio::SimpleActionGroup respectively but its not that easy in this case. This migration is not independent i.e. it is dependent on other deprecated classes as well.
StockID is only used with Gtk::Action but it is not used with Gio::SimpleAction. So, we have to remove it side-by-side and have to find perfect alternative for the same. Same is the case with Gtk::UIManager as well which have to be replaced to Gtk::Builder simultaneously.
During this period, I faced a lot of challenges. The very first challenge was to understand the overall Synfig's code. It took me few weeks to get the hang of code but eventually, I was able to understand what's happening under the hood. After becoming familiar with the codebase and little bit knowledge of synfig, then I started contributing to my project idea.
This was the best resource for me to become familiar with the codebase: https://synfig-docs-dev.readthedocs.io/en/latest/common/structure.html
Later when I had to migrate to Gtk::Application from Gtk::Main, it was a challenge itself. I learnt about both of these from the docs ! Tried to make my own apps using Gtkmm, experimented on them and then later implemented the same code in Synfig.
Reference Material that was of great use to me during these times:
List of all deprecated Gtk classes : http://transit.iut2.upmf-grenoble.fr/doc/gtkmm-3.0/reference/html/deprecated.html
Official Gtk documentation : https://docs.gtk.org/gtk3/
Official Gtkmm documentation : https://developer-old.gnome.org/gtkmm-tutorial/3.18/
HowDoIs : https://wiki.gnome.org/HowDoI
Especially these were the most helpful ones :
https://wiki.gnome.org/HowDoI/GtkApplication/
https://wiki.gnome.org/HowDoI/GAction
https://wiki.gnome.org/HowDoI/ApplicationMenu
https://wiki.gnome.org/HowDoI/GMenu
PR Link | Description |
---|---|
#2187 | Implementing Alignment and other classes |
#2195 | Implemented CSS instead of deprecated width |
#2244 | Gtk::Main to Gtk::Application Migration |
#2256 | Gtk::Action to Gtk::SimpleAction Migration |
#2270 | File Menu Migration using Gtk::Builder |
#2256 | Gtk::ActionGroup to Gtk::SimpleActionGroup Migration |
Issue Link | Description |
---|---|
#2123 | Issue for Project Discussion with Mentors |
I would like to thank my mentors for helping me reach this milestone 😄🚀
During this period, I not only learnt about Open Source Culture but also about Industry level code.
Student | Dhairya Bahl |
---|---|
Organization | Synfig-Studio |
Project | Replacement Of Deprecated Gtk Classes |
GitHub | DhairyaBahl |
Dhairya Bahl | |
[email protected] |