LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2006, 03:00 AM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
API for X that works with KDE XFCE etc.


About a year ago, I was working on a library for Windows which would make my life much easier. I simply used the Windows API. I can't seem to find an equivalent in Linux. Everyone wants to use Qt, GTK+, wxWidgets or some other library to design their apps. Then I hear people saying not use Qt because it uses KDE libraries which must be loaded by XFCE or another windows manager and therefore increases memory consumption bla, bla. I want to take things back a step and design the library (I know I'm reinventing the wheel, but I have learned a tremendous amount about Windows this way and hope to do the same with Linux and maybe, just maybe there is a one in a million chance I can make a better library). Where do I start?
 
Old 11-13-2006, 12:31 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
About a year ago, I was working on a library for Windows which would make my life much easier. I simply used the Windows API. I can't seem to find an equivalent in Linux.
It dosn't exist. Instead, you have access to the entire source code for the entire thing.

Of course, you could always use java.
 
Old 11-16-2006, 01:23 AM   #3
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
You mean the KDE, Gnome and XFCE do not develop off the X interface? Or do you mean that KDE, Gnome and XFCE all provide their own API and I should not use X?
 
Old 11-16-2006, 05:17 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Neither - I mean there is no equivalent for the Windows API in Linux. You get API functionality through the libraries.
 
Old 11-16-2006, 08:04 AM   #5
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
^ there is Wine.
 
Old 11-16-2006, 02:45 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
binarybob0001 -

The biggest difference between "the Windows Platform API" (aka "Win32") and Linux is that Win32 is basically one, big, "everything and the kitchen sink" API that includes both OS-level as well as GUI stuff.

But yes, you can safely say that "Xlib" is the Linux equivalent of Win32 for "GUI stuff", just as you can safely say that the GCC runtime is the Linux equivalent of Win32's "OS stuff".

And yes, KDE, Gnome, XFCE (and many others) all sit on top of Xlib.

'Hope that helps .. PSM
 
Old 11-17-2006, 02:35 AM   #7
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
OT - slightly: I understand that ATI complained about the lack of a windows-like api for the linux kernel in a conference earlier this year. The advantage would be that they wouldn't have to revise their drivers for each individual kernel ... the responce, of course, is that if they open-sourced their drivers, the hackers would do it for them.

(ATI then went on to state that 3D graphics is too complicated for the open-source community to make any contribution... that was an interesting conference.)

Anyway, it can be tricky for programmers used to windows to understand why there isn't a similar all-in-one for linux. It's soo hany, after all. (OTOH: 3rd party software is notoriously shakey under windows...)
 
Old 11-17-2006, 03:12 AM   #8
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
See, I'm learning a lot already If all the GUI stuff sits on Xlib, then if I make an Xlib program it should run in KDE, Gnome and XFCE? I imagine a problem would be that KDE probably has a library built on top of Xlib to provide say a standard form of dialog box. Which means if I made my own library on top of Xlib, I may not be able to get the appearance to match the current running windows managers appearance. Is this a valid problem, or are there ways of taking care of these differences?

Just one other thing. Do any of you know of books or websites where I can find the kind of information I'm looking for. I really hate to bug others with (probably stupid) questions if it can be avoided.

Thanks for the help.
 
Old 11-17-2006, 03:36 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
There are ways of tying in with the current running windows manager as well.
gnome uses gtk and kde uses qt and so forth. I understand that if you issue an instruction to draw a window (say) of a given size and so on, this will get passed to the appropriate windows manager and thus get drawn by it. So anything basic should come out right.

Xlib Programming Manual
By Adrian Nye, Tim O'Reilly
 
Old 11-18-2006, 04:52 AM   #10
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Thanks Simon, you have helped my tremendously. I am definitely going to look at that book too.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XFCE 4.4 KDE incompatibilities? milkycow Slackware 2 11-07-2006 06:56 PM
KDE and Gnome applications in XFCE Fritz_Monroe Linux - Newbie 1 07-27-2005 01:26 PM
KDE vs. Xfce JCdude2525 Linux - Software 12 11-02-2004 03:06 PM
KDE hijacks my XFCE ppuru Slackware 12 07-26-2004 10:20 AM
xfce and kde integrated uday Linux - Software 1 02-24-2004 01:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration