in Windows, a programmer can use Windows API to write a Windows application. Windows API can be used with C (not necessarily C++). In Windows API you have a message loop and you have to program responses to different messages (eg a right click on client area).
Is there any ubuntu API?
I don't mean Qt or GTK. I'm looking for a raw (C/C++) API so that everything must be (re)designed.
I came to Linux from a Win32 API background. Because Windows wraps up the equivalent of the Linux window manager and desktop environment into a single container, there just isn't a one-to-one match. Gtk and Qt really are more or less the equivalent to the Win API.
Keeping in mind that the Win API itself in most cases is a wrapper on lower levels, if you really want to get down into the low-levels of the windowing system, you can look at X11 programming. For example, X Window System and Brief Intro to X11 Programming. But Gtk and Qt are designed to be wrappers around these functions.