GUIs inside Operating Systems - user-interface

How do GUIs get built inside operating systems. Lets use two examples, say GTK+ in Ubuntu verses a Java JFrame. I thought that operating systems using some kind of graphical user interface would have to provide some system calls to be able to display windows. So for example, if I installed a version of Ubuntu on a machine, with out downloading any software I should be able to make a system call to display a window. It appears though that isn't the case. I have to install and download the SDK for GTK+ which allows me to create windows with buttons, etc. So then my question is with Java, how does Java then build it's JFrames? I understand that there is a Java Virtual Machine running ontop of the Linux system, but how does the Java virtual machine make calls to actually display the window? Along with GUIs comes the events that the user interacts with them. At the Java level, the JVM handles all the lower level calls, and you get OnClick() events etc. How does the JVM actually call and work with those calls? Same with GDK+? I understand this is a broad question with many different answers, but any help would be greatly appreciated.

Let's take Linux as an example. There are several layers:
Kernel (Linux) and operating system (GNU) - Knows how to work the hardware, including graphics.
Windowing system (X) - Uses graphics functions to draw windows.
Desktop (eg Gnome) - Applies global styles such as window borders.
(Usually) A toolkit such as GTK - Knows about widgets, how to draw them and how to style them.
Your application.
On Windows, the Kernel, OS, windowing system, desktop and widgets are all bundled together. In this case the toolkit probably doesn't draw its own widgets, but uses them directly from Windows.
In any case, the toolkit insulates your application from the platform-specific details and automatically does the right thing.

Related

GNOME/Vala application to run on Windows

I want to port my C# WinForms application to be usable both with Windows and Linux. I have some experience with Java and more experience with Python but I don't really like the first and I'm concerned with the second (I mean the obfuscation, need to install Python on the target PC, etc.) so I've chosen to use Vala and GTK3 toolkit... it is created mainly for making GNOME applications but I've read that it's multiplatform and is compiled fully to C also with all the dependences needed for running the software - but is it right? I mean: would I meet any limitations while creating my application on Linux? I don't want to finish it and then to discover it can't be run on Windows because I've used some GNOME library...
There are a lot of GTK applications that currently work on Windows with no problem.
For example:
GIMP (raster graphics tool - the application for which GTK was built initially)
Inkscape (vector graphics tool)
Geany (Text editor)
Pidgin
Vala apps will work anywhere a GTK apps will. Can't name a Vala app i've seen running on windows but i'll take an interest in this and get back to you.
By the way there are two (maybe several) approaches to writing the app in Vala/GTK, for example including the entire GTK library into the app or not. Geany offers 2 different binary installers meant to allow you to choose if you already have GTK on your windows download a lighter geany-only instaler, if not download the full installer which incorporates its version of GTK.
Here's a site and a tool that will help you with configuring your vala compiler to output windows executables.
I'm not sure if you can use all the tools that Vala needs on Windows. You may have to develop on a linux box.

providing GUI layer to embedded board

I have ported uCLinux on an embedded board and want to provide it a GUI
layer.
Actually my board is consist of an ARM processor and other peripherals and
a touch screen display.
Actually this is a small embedded board which I have made .
I want to display various gui widgets like buttons , scrollbars etc . I
want to use QT for this purpose.
But I don't know how to proceed , how I can make the QT GUI layer to
interact with kernel
So , can you tell me how can I make it to talk to the uClinux kernel, I
mean how can I interface it to the kernel.
Thank you
I'd suggest you to use an embedded Linux build system. The historical one for systems based on uClinux is called uClinux-dist, but you can also use other build systems such as Buildroot. It already integrates Qt, so you'll only have to select an option, run make, and you'll have a Busybox+Qt system ready.
From the graphical side, Qt can directly use the kernel framebuffer, so as soon as your kernel has the framebuffer driver for your platform, you're ok. For the input side (keyboard, mice, touchscreen, etc.), Qt uses the Linux input subsystem, so if your input devices are supported by the kernel, Qt will be able to use them directly, with nothing additional needed.
Take a look at LVGL. It's easy to port and comes with many widgets.

What is inside Windows SDK?

For developing programs for windows, we need windows SDK. I understand that this SDK is what helps to create windows and handle window events and all that. I suppose it also enables us to manipulate with files and registries.
(Does the same SDK is the reason for thread creation and handling?)
All that is fine!
I would like to know what are the files and libraries that come as a part of this SDK. Also does it come when I install the OS or when I install editors like Visual studio? Sometimes I see links to windows SDK separately as such. Is it same as the one that I get when installing Visual Studio or has something more than that.
Base Services:
Provide access to the fundamental resources available to a Windows system.
Included are things like
file systems,
devices,
processes & threads
and error handling.
These functions reside in kernel32.dll on 32-bit Windows.
Advanced Services:
Provide access to functionality that is an addition on the kernel.
Included are things like the
Windows registry
shutdown/restart the system (or abort)
start/stop/create a Windows service
manage user accounts
These functions reside in advapi32.dll on 32-bit Windows.
Graphics Device Interface:
Provides functionality for outputting graphical content to
monitors,
printers
and other output devices.
It resides in gdi32.dll on 32-bit Windows in user-mode. Kernel-mode GDI support is provided by win32k.sys which communicates directly with the graphics driver.
User Interface:
Provides the functionality to create and manage screen windows and most basic controls, such as
buttons and scrollbars,
receive mouse and keyboard input,
and other functionality associated with the GUI part of Windows.
This functional unit resides in user32.dll on 32-bit Windows. Since Windows XP versions, the basic controls reside in comctl32.dll, together with the common controls (Common Control Library).
Common Dialog Box Library:
Provides applications the standard dialog boxes for
opening and saving files,
choosing color and font, etc.
The library resides in comdlg32.dll on 32-bit Windows. It is grouped under the User Interface category of the API.
Common Control Library:
Gives applications access to some advanced controls provided by the operating system. These include things like
status bars,
progress bars,
toolbars
and tabs.
The library resides in comctl32.dll on 32-bit Windows. It is grouped under the User Interface category of the API.
Windows Shell:
Component of the Windows API allows applications to access the
functionality provided by the operating system shell,
as well as change and enhance it.
The component resides in shell32.dll on 32-bit Windows. The Shell Lightweight Utility Functions are in shlwapi.dll. It is grouped under the User Interface category of the API.
Network Services:
Give access to the various networking capabilities of the operating system.
Its sub-components include
NetBIOS,
Winsock,
NetDDE,
RPC and many others.
Internet Explorer web browser APIs:
An embeddable web browser control, contained in shdocvw.dll and mshtml.dll.
The URL monitor service, held in urlmon.dll, which provides COM objects to applications for resolving URLs.
A library for assisting with multi-language and international text support (mlang.dll).
XML support (the MSXML components, held in msxml*.dll).
I have listed only files for 32-bit windows (as that is what many window developers work on)
For more info, please check http://en.wikipedia.org/wiki/Windows_API
EDIT:
Above dlls and all are part of the operating system, not the SDK. The Windows SDK provides import libraries (.lib files) that allow code to dynamically link against these system-provided DLLs.
(This was rightly pointed by Marcelo Cantos. Many thanks to him)
SDK stands for Software Development Kit. It is a big fat collection of headers, libraries, tools and other bits and pieces that developers use to construct software. Microsoft provides many SDK's for their large range of products, and they are not generally deployed to the end-user's desktop. They are usually only installed on developer machines, either as part of a development environment like Visual Studio, or separately (but usually intended for use within VS anyway).
When you talk about the thing that handles windows, threads, etc., you are describing the Windows APIs. The purpose of an SDK is to allow developers to write software that accesses the APIs.
The Windows SDK gives you, as a developer, access to all the services of the Windows platform, including all the things you list.
The SDK is installed as part of the installation of Visual Studio, and usually you'll use the one that came with the compiler, and never have to worry about it. The standalone SDK downloads are there to support two scenarios:
If you use a compiler other that Visual Studio, it may not come with the SDK files, so you can download them separately.
Each new version of Windows includes more features in the API, so to call these new functions you need an updated SDK.

Embedded wxWidgets for ThreadX OS

I'm working on an embedded system using ThreadX. The project will involve a GUI.
I'm looking for a port of wxWidgets for embedded on ThreadX operating system.
My search has turned up wxWidgets for embedded Linux and WinCE.
Also, is wxWidgets difficult to port to a new (different) OS?
Thanks,
(The project tools are C++ using Greenhills compiler and ThreadX operating system with ARM9 processor and conservative amount of RAM and FLASH.)
There is no wxWidgets port to ThreadX. And while porting wx to a new OS is usually not a problem at all, porting it to a different GUI toolkit is quite a lot of work. I don't know anything about GUI in this OS but basically you have the choice between wrapping native GUI widgets in wx API (supposing that the platform does have some native GUI) or implement just a small subset of graphical primitives natively and use wxWidgets own widgets implemented in wx itself (so called wxUniversal port). The latter is usually less work and as it's needed to do the former anyhow, this is what we usually advise people to do first anyhow. But wrapping native widgets (again, if any -- some embedded platforms don't have any native GUI at all) results in more native look-and-feel, of course.
In any case, you shouldn't expect this to be trivial to do, creating a new port will require some effort although usually you can reduce it if your application needs just a subset of wx GUI functionality in the first place. The only simple solution is to make X/DirectFB/GTK+ work on your platform and use the corresponding existing wx port but this might be unacceptable because of extra resources consumption due to the use of another toolkit.
Finally, if you do intend to port wxWidgets to a new platform, wx-dev mailing list would be the right place to ask for help and advice.
Do you have a strong reason not to use Express Logic's own PEGX GUI library?

What are the options available for cross platform rich user interfaces development?

Some of the requirements (restrictions) for such a ui framework/toolkit are:
No single vendor lock down
Ability for real time data visualization
Good initial widgets
Good dash boarding capabilities
cross platform
Good development/debug environment
No flash
It's a pity you can't/won't use Flash. Else I could really recommend Adobe AIR. It has a good editor (Flex Builder built on Eclipse), a good component framework with many out of the box components, charting components set, ability to communicate with many different protocols (and you could write your own protocol implementation), cross platform, runs in the AIR runtime and not in the browser, file IO, ...
I wouldn't pass over Flex/Air (Flash) without a closer consideration but here are a few others I have come across:
wxWidgets
GTK+
Qt
There is also a slashdot post with links to some tookits I haven't heard of. I'll add their recommendations here:
GLUI, an OpenGL-based GUI
Whisper, a Mac/Windows application framework
WxWindows, a framework which supports Windows 3.1/95/98/NT, and Unix with GTK/Motif/Lesstif, and MacOS
YAAF, Yet Another Application Framework, offering suport for Macintosh OS, Windows 95 and Windows NT, and X Windows
CPLAT, a framework for developing MacOS and Windows (Linux soon) applications
Ardi's Carbonless Copies technology, which is a portable rewrite of much of the MacOS API
For general information:
GUI Toolkit/Framework Page
PIGUI FAQ Page
C++ User's Journal PIGUI Page
I might suggest Mozilla XUL, but it has some drawbacks:
No really good development / debug environment (although there are tools and debuggers; they are variable)
You are locked into a vendor, but it is Mozilla.
It is very easy to use though and allows you to reuse your web Javascript skills for a rich-client app.
There's also Java of course. It satifies all your requirements AFAICS.
Plenty of custom charting controls, which are things you will struggle to find for GTK/WxWindows/$other_small_userbase_framework.
If you dont like Swing(its come a long way - Metal is dead, long live SystemDefault L&F!), there are options like SWT or even QT bindings for java(QTJambi).
For C or C++ go QT, its APIs are really nice.
For RCAs check out Eclipse RCP. For RIAs, you might be interested in OpenLaszlo. It's a rich internet platform that can compile both to Flash and DHTML.
http://www.gnustep.org/
"GNUstep is a cross-platform, object-oriented framework for desktop application development. Based on the OpenStep specification originally created by NeXT (now Apple), GNUstep enables developers to rapidly build sophisticated software by employing a large library of reusable software components."
Portable to: Windows, BSD-based systems, Linux-based systems, HP/UX, , Solaris, Sparc, GNUstep Solaris 10 U2 vmware appliance, OpenSolaris, others.
I recently made a pretty complete list here: http://commadot.com/ria-frameworks/
ExtJS is probably my favorite and we use that at work. I think it satisfies your list. Otherwise, there are a bunch of other possibilities on that page.

Resources