Tuesday, May 2, 2017

Month One
Author: Nic Russell
Posted: 2 May 2017

        Month one of the Gateware final project consists of picking a library to research and then gathering all necessary information required to build a multi-platform version of that library. The deliverables for month one is a research paper describing the purpose and per-platform findings of your individual research, as well as a workable demo of the basic functionality of your program on each platform.

        My library is a window creation and manager library that must be able to handle creating, moving, resizing, and destroying a window on the Windows, Mac, and Linux platforms with a single interface. This required me to become something of an expert in the respective window API's for each platform. The win32 API for Windows gave me the least trouble just because I was already familiar with the structures and routines required to create a window. The only extra information I needed to gather was the id's for all the window messages I would be handling in my program as well as how to extract relevant window information from the events.

        Linux research presented much more of a challenge because I wasn't actually sure what the lowest level end-user accessible window API was for Linux. It turns out it is the X11 library, but the issue with that is it is highly recommended for almost any application to use a wrapper around X11 that handles some of the more esoteric or difficult to use structures and routines. However, for our purposes we must not use any 3rd party packages so that our end-users won't have to download anything but our libraries. X11 is a bit less professionally documented than win32 because there is no official licensed documentation. The only reliable resource for X11 other than a textbook is a blogger's personal documentation project for X11 that is thankfully free to use online. Utilizing this X11 bible I was able to find all the creation routines event messages and data extraction I needed to build a quick demo.

        Mac research was even more slow-going because I have never owned or really used a Mac at all, so just simple things like navigating the IDE and GUI for Mac slowed me down considerably. As far as the research goes, I quickly realized that I would have to learn a new language for Mac development. I picked Objective-C over Swift because it is at least a little closer to C style than swift. The lowest level library that Mac uses for window creation is the Cocoa library, which has expansive professional documentation and demo applications available for research. It didn't take too long to get a workable demo of a window up, but it took much longer to figure out the messaging system and events as they are much different than win32 or X11.

        Overall throughout the month I was able to create my three demos from the pages of notes I took on all three platforms. These demos consisted of a single file that opens a window in whatever style I choose, and allows the user to move, resize, maximize, and minimize the window. This is essentially all my library needs to be able to do, but the tricky part will be developing the back-end to work for any platform with one codebase. With all the information I accumulated I had no trouble writing a research paper with plenty of code examples and per-platform information that highlights the issues to take into consideration when building one interface for these three very different API's. The most important part of the research paper is the Suggested Interface section, in which we write out what we think our interface should look like. Based on my instructor's initial approval of my demo interface, I feel I am well prepared and ready to start building the test suite for my library and eventually actually develop the library itself.

No comments:

Post a Comment