Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, October 12, 2011

Teaser: Project NGtk - Native Gui ToolKit

Recently, I wasn't exactly active in GIMP and other projects. The main reason for that is an open-source university project I am doing as part of my studies, in the course Advanced Topics in Operating Systems. I believe pictures can demonstrate better than words, so take a look:

Click on the image to view it in fullsize

Project NGtk is an extremly light-weight library for creating GUI's on different platforms. It includes the following features/concepts:
  • Has support for the following widgets and events:
    • Button (stable)
    • Labels (stable)
    • Text-Entries (stable on 2 of 3 platforms)
    • Windows (stable)
    • Mouse up/down/click events
    • Keyboard key type events, with translation from key code to ascii
  • Works on the following platforms:
    • Windows - Uses native Windows widgets via the windows API.
      For this backend, the only dependancy is the windows libraries which already ship with Windows.
    • Unix/Linux Terminal - Any terminal which NCurses works on (which should be most modern terminals). This means you can also use this via SSH without X11-forwarding! Unlike many curses applications, NGtk includes full support for mouse cursor in the terminal.
      For this backend, the only dependancy is NCurses, which is shipped with most (if not all) modern linux distributions. NCurses supports a large variety of terminals.
    • Xlib - Any operating system which has an Xlib (X11) client library. This means graphical Linux/Unix work environments.
      The only dependancy for this backend is an Xlib implementation, which is shipped with all modern graphical Linux/Unix environments.
    • Gtk+ wrapper - Support planned for near future. This will practically be a simple API wrapper to give API consistent with other NGtk backends.
  • 30 KB for the core library + 30 KB for each "adapter" (backend library). Just for comparision, Gtk+-3 is approximatly 4 MB (130 times bigger), not including it's dependancies.
  • Written in C
  • Object-Oriented structure - NGtk uses a very small C object system that was written as part of this project to make it easy to rogram, and without requiring C++. The object system is easy to learn and well documented.
  • Display "Resolution" Independant - Forget the term pixel, as it doesn't exist in NGtk. Since NGtk is meant for a wide amount of platforms, such as the terminal (where a the smallest unit, a "pixel", can actually be a whole letter), NGtk will handle sizing of widgets itself. You can specify logic layouts, but no need to actually specify a size for widgets. There is a built-in interface for accepting custom made layouts (anything from grids, relative sizings, etc.), and writing new layouts is easy.
As you can see, NGtk doesn't have any real dependancy - the only dependancy it has is the existance of the graphical system that you wish to use. It is also not a replacement for Gtk+/Qt/etc. - it's targetted only at people who want very light-weight GUIs (both in features and in actual library disk size), and want to acheive maximal support. The NGtk goal is to achieve a state where every platform with a compiler will have an NGtk backend that will work on it without requiring any library which isn't already on the platform.

The first stable release of NGtk will happen this week when I hand in the project to my university. You can already find the project source by googling it, but I do recommend waiting for the official stable release.

Regarding my GSoC project: no I haven't forgotten. It won't make it in time for 2.8, but I will work on it as soon as I can hand in NGtk to my proffessor. Sorry to disappoint the people who wanted to see it soon, but it just won't happen...

Saturday, September 24, 2011

Saving Vertical space in GNOME 3 (Especially for Firefox)

I have been using GNOME 3 for more than a week now. I really like it, and after tweaking my desktop back to show the files and launchers (like in GNOME 2) I really felt at home.

However, not everything is great with GNOME 3. One of the most irritating features of it, is the gigantic titlebar of windows. I actually like gigantic titlebars, but not when I need to maximize my working area. The web is full of people complaining "Why Firefox on Linux can't be space efficient as it is on Windows 7?" This is even more critical when in the fallback mode, you have two very thick panels that also take additional vertical space (I switch between fallback and regular all the time because of some hardware limitations).

Comparision between Firefox titlebar on Windows 7 and GNOME 3 (fullsize)

 As you can see, the Windows 7 setup takes much less space, by combining the titlebar with the tab area. Very neat!

Anyway, I'm here to say that you can make Firefox on Linux thinner. I'm not talking about fullscreen mode in firefox - since I do like seeing my tabs and toolbars (Which firefox hides in fulscreen mode).

In Linux, windows are displayed and managed using a special program called a Window Manager. We are going to request the window manager to display Firefox in full-screen. This is different from firefox's built-in full-screen mode! In the full-screen mode created by the window manager, Firefox will continue to show it's tabs and toolbars like before, but it's titlebar will be gone and it will fill the area that was used by the gnome panels!
  1. Open the System Settings dialog (in fallback mode, it's in Applications → System Tools) and Choose Keyboard. (Screenshot)
  2. Switch to the Shortcuts tab and choose Windows from the options on the side. (Screenshot)
  3. Find the Toggle fullscreen mode option, and assign a new keyboard shortcut which is easy to remember (I used Ctrl+Alt+F). To assign a new shortcut, click on the area which displays the shortcut (it displays Disabled if no shortcut is set) and type the desired key combination.
Now, whenever you open Firefox (or any other program that needs more vertical space, without sacrificing any toolbars that disappear in the built-in fullscreen mode of that program) simply type the shortcut from above to go fullscreen! Type again to get out of the full-screen mode.
You are going to miss the close/un-maximize/minimize buttons in fullscreen mode. However, you can probably live without them (or if you like keyboard shortcuts, configure some for these also!) when working in fullscreen.

That's it, I hope it helps those of you who need to use more height of their screen and don't like the built-in fullscreen modes (if any) of their programs. If anyone knows any better way (especially for Firefox on GNOME 3), please leave a comment :)

Friday, January 14, 2011

A very complete guide about compiling GIMP (Linux)

I have just published a very very detailed guide about compiling GIMP from source, with explanations of what does each step mean (instead of just giving commands for people to follow like dummies). You can find it here.

Corrections/Suggestions/Comments will be happily accepted!

Update (15 Jan, 2011): Added instructions about updating your build

Monday, October 11, 2010

Guide - Upgrading Ubuntu 10.04 to 10.10

This post describes the not-so-smooth update from Ubuntu 10.04 to 10.10. The "One Click Upgrade" did not really work here :P Took me several hours to get this right, and I used several backups to restore my system after bad attempts. Hopefully I'll save you some time and effort on how to do this =)

If the usual upgrade works for you, follow it - the steps here were done because the regular upgrade didn't work (slow internet connection, and some more problems).

Info: I'm running 32-bit Ubuntu, inside Virtualbox (a VM) under Windows XP SP3 host.