Categories
Coding Experience Fun Technical

Implementing Mac Styled PopupMenu’s, First PR After GSoC Accepted!

Introduction

This is a blog and demonstration for my first pull request that got accepted after getting selected into this program! I plan to create a blog entry for each of the features/major changes and keep my audience updated!

Anyways, so the first task was to complete something called Mac popup menus, if you don’t know what it is, then It is nothing but a popup menu (i.e., those whom you click, and they give a bunch of options)! Now this was not completely my work but was of someone else.. I was only tasked to complete their work..!

Menus - Material Design
A typical popup menu

The Menu..

The first thing I did after getting this task was to read the codebase, understand how the menu works and try to understand how the existing code operated! To be frank and honest, this actually took me quite a time, plus university examinations were already taking lots of time!\

Anyways, I kept on reading codes, making changes, getting popup menu to be implemented however..

THE CODE WAS VERY BAD

Ahh.. sorry for shouting, lost my composure there for a second :)! Anyways, by code was very bad I don’t mean the code written at ScummVM (this organization), no it is a piece of art, but I mean the code written by the person before me (the unfinished code).

The more I kept on understanding it, hacking it, etc, The more changes I had to do, at some point of finishing their work, I had to change everything from scratch and implement major functionalities myself.

That day I understood, what happens if you write workaround code in big production software, you make life difficult for the people taking your work, sigh.

Anyways, so getting to the main topic.. I was tasked to implement an unfinished popupmenu, for many of you still not getting feel of what this “MAC STYLED POPUPMENU” (of vintage ages) looks like, here the photo taken from Basilisk II (Mac 7.0 Simulation)

Original Mac Popup Menu, as taken from basilisk II

Looking at the state of the popup menu and current implementation, there were many big and small details that needed to be implemented like:

  1. Alignment issues, the rendered menu was some pixels off it is supposed to be, and in some cases, it was very very far away! (We welcome you, Desktop Mode)
  2. BAD CODE, Improper variable introduction (A variable was there just for bad workaround of bypassing some loops, calling some particular functions.. etc)
  3. Many features not implemented (Like smart menu which remembers your last choice), checkboxes, remember last item, etc!
  4. Some more small bugs that were found on the way, needed to be resolved for proper functioning!

Over time, with proper and lengthy discussions and regular updates to mentor, these bugs were addressed and we reached to a point where popup menu in ScummVM were working (demo gif below):

The final result after implementing the popup menu!

Overall this was quite fun to work with, I got a good understanding of how Mac styled windows (not only popup menu) are created and used throughout the project! Director (the engine I work on) was first built for Mac systems, and thus I believe this knowledge of fundamentals would be very useful for long-term contributions!

Plus it was quite fun to find English-ordered alphabet items on the menu (I bet you didn’t notice) ><! (ie the menu items are Apple, Banana, Cherry, Duck… etc, ordered by first alphabet)

Anyways, with this my first pull request after getting accepted was finished, It was successfully merged (After many review rounds and corrections), here is the link to the pull request – #5005!

It doesn’t end here

My frequency of writing blogs do not match with the speed of my contributions! and thus by the time I started writing this, and by the time I reach to this section.. another two tasks were given, I completed them, and the prs are merged! Giving links, they were #5056 and #5059!

These were technical bugfixes/implementations, things that do not have intuitive GUI that I can show (and you understand)! But hey.. Let’s have an easter egg before I end this, and that is:

The Jumping Windows! #5059

A part of the task given to me, (that I solved in pr #5059), was to implement window location set/get functions, in layman terms basically each Mac window (that’s what they call it XD) has this field called rect which can be used to set/change their location!

Now this function to set the window location was unimplemented, and thus there was this thing where it you are supposed to click on “Change” and it will alternatively teleport(err. move) the window between two positions! Initially before implementing, it was not working but after implementing this function, things successfully worked and the window was happily jumping here and there like a happy kid it is supposed to be.

And if you didn’t realize it, this section was meant to be a troll, (but still, jumping windows were good XDDD), anyways thanks for reading!

The End

Thanks for reading so far, I really appreciate each of you still here with me! Also apologies for bad writing style/punctuation/grammar mistakes, etc! I hope this was a fun read and look forward to the next part!

Categories
Experience Nerdy Talk Opinion

The road to GSoC’23 proposal acceptance!

Greetings everybody,

This is my first blog post after getting my GSoC proposal selected for this wonderful organization, ScummVm!

So here I am expressing my journey and experience before 4th May 2023 (GSoC proposal out), have fun reading!

The Start (Needle in Haystack)

How did I find this organization? What was it that told me this is where I want to contribute?

An interesting quote from an article i stumbled upon!

20. “This is going to sound crazy, but… from the moment I first set eyes on you I haven’t been able to stop thinking about you.” – Leigh Fallon

So how did I set my eyes on ScummVM?

It was April 1st, the organizations were announced, and I was running late in finding my match..

I am, but a very enthusiastic computer guy (the one people love to call tech nerd, but no, I’m not), so from a young age, I have been tinkering with technology, learning new things on the way and experimenting with systems, languages, and technology! Now that’s enough for my introduction. How does this answer the question you may ask, don’t worry, I got you covered! ?

So it was 1st March, and I was scrolling here and there, finding interesting organizations that align with my interests, etc. I shortlisted them, but it was ScummVM, the one and only one to which I decided to actively contribute in and submit a proposal! GSoC permits 3 proposals, but I couldn’t care less because what I found at ScummVM is something that just hooked me up to the community of these crazy game porters!

Listing some things out

The Vision

The Vision of ScummVM and what they are trying to build is so cool that it just attracted me to view their project out and consider contributing! What else could be cooler than something which allows me to play old games ? Look its GAME, I repeat, It’s GAME!!!

For someone like me who played lot of old school RPG games in childhood and have attachments to many of them, I could see why I instantly checked out their project and decided to join discord server of scummvm!

Why in italics? Because that was the most important decision I could take, just joining the discord server and introducing myself in #gsoc-channel resulted in a series of cascades of events that resulted in me writing this blog post!

Explaining better in next:

The Community (AND THE BEST MENTOR SEV)

I cannot stress this out enough, I joined server out of enthusiasm but I stayed because of community, the friendliness of everyone and most important the amazing of a mentor that Sev is!

Who is sev?

If you are associated with ScummVM, I don’t even need to tell you about him, but just in case you have no idea then sev is..

Owner, lead, mentor, and developer for ScummVM (as per discord tags) but for me, he’s one of the best mentors I met till now, from the moment I joined the server and introduced myself in the channel, sev created a separate thread for communications (It was a custom to create a separate thread for each student to avoid spam in main channel) and assigned tasks after some communication! What I really loved about this guy is how he used to treat everyone, with kindness, politeness, and in a friendly way!

and most of all how committed he is to ScummVM, this guy has worked over in this organization for years more than I can count doing my computer science degree.

First Pull Request (Assigned Task)

So I was assigned my first task to implement a wrapper around an external library called mikmod for playing impulse tracker files (basically a very old audio format)! If you couldn’t understand, then don’t worry. Just think of I was assigned a technical task and have to implement an easy feature!

While trying to experiment and work on this, I experienced a lot of troubles, and every time I was gravely stuck, sev helped me out! Finally, after a week or two of tinkering and finishing pr, I got it merged! (With thousands of small code corrections, formatting, changes, etc)

What this first pull request taught me is about code conventions and how strictly it is to be followed!

The codes written for scummvm (and applies are not simply written or programmed. They are, instead, I believe, designed!

While the first pr was accepted, It was the 15th of March already, and I still lacked a lot of preparation, study, and commitment to the organization! Seeing the deadline (4th April) approaching, I decided to one-up my game and start actively working!

Link to merged pr

2nd & 3rd Pull Request

Before 2nd and 3rd pull request, I looked into recommended GSoC projects. I decided to work for the Director engine (after discussion with mentor and finding the priority of what is more needed for scummvm). Finding a goal, I started looking deeply into the director engine and getting some bug fixes, etc. to make me understand the engine before writing a proposal!

In the time span of another 2 weeks (by the end of March), I got another two pull requests accepted, link 1 and link 2

Working was very interesting, and I loved playing games, finding bugs, and fixing them! Not only that, but even the developer documentations are great. What I really loved about ScummVM is about how well-documented their codes are, with such a detailed description of almost everything, It was a lot easier to traverse and find relevant functions, classes, etc!

It didn’t feel like I was working with something that consisted of more than 5 Million lines of code.

But regardless, the journey was fun! I got these two pr accepted and finally wrote out a proposal For which I received a lot of scoldings (Thanks to comic-sans font, never using them again) and suggestions!

The Submission

It was the 4th of April, 2023, I double-checked everything and finally submitted it through the GSoC portal!

What I had to do now, is to wait!

The Result Day

It was the 4th of May 2023, as you have guessed right! The day when the accepted contributor’s list is out! This was the day I was very anxious about, being pessimistic I was hoping I could get selected and contribute to ScummVM during the summer vacations!

Finally, the results were out, as usual, the GSoC dashboard site was crashing and I was very anxious trying to open it and checking my emails every second, in the end since it was quite late in my country, I went to sleep giving up, thought wasn’t selected or so I thought, some one hours and minutes later I got an email from Google informing about my proposal being selected! This was a very happy moment and my friends around me were shouting and cheering for getting it!

Now I know that getting selected and completing the project is a different thing, but I plan to stay committed to this organization and finish all the deliverables, passing the project with flying colors!

The End

Thank you for reading this so far, This was just a small excerpt of events happening around me, but I very strongly believe that this is just the starting! For now, expect more blog posts every week following my adventures!