Programming :: Xlib Documentation With GUI Programming?
Dec 14, 2008
I want to do some experimentation with GUI programming. What mostly interests me is how the toolkits actually work (what are the drawing mechanisms, how it communicates with X, etc.) and how the window managers work. I know it's quite a lot but I don't plan on developing the next best DE/Toolkit/Window Manager, just to play with API, mostly to learn. It seems that there is a shortage of documentation on this topics, I'm trying to find anything for 2 days now with no result.
I'm making a game with the xlib library. What I want to do is to know if the character is standing on a trap or something else.
So far I've solved that using the coordinates but when I draw circles or stuff not shaped like a rectangle it gets to hard to make the game exact.
So what I'm asking for is if there is some kind of function in the xlib that tells you which color a pixel has. Because then it'd be much easier.
I've searched but I haven't been able to find anything good. I found XGetPixel() but that appears to work only with images, maybe I can make my window to be an "image"?
I'm trying to understand how to use colors in Xlib programming. What I think I understand so far is that modern displays use 24 or 32-bit TrueColor. And TrueColor uses three colormaps, one for each primary color, and a single pixel value is composed of three indices.
Now the part i'm confused about is how to get my programs to use a 32-bit TrueColor visual. I thought I could inheret the visual from the root window to get color but it seems no matter what pixel value I use it's either black or white.
I guess my question is, how can I setup my programs so that I can specify a pixel value that is a combination of RGB values to get the color I want?
I come from windows where I simply used RGB(r,g,b) macro to specify colors and never had to worry about depth and colormaps and visuals, so I'm a bit overwhelmed by all of these concepts.
I am having trouble writing an Xlib application that displays a window. The most frustrating thing is that I've written applications like this before, and never had any problems. For some reason I cannot get this program to work properly. I'm running KDE and when I launch the program, a "button" for the application will appear on the application panel, however, no window will display. It is possible to right click on the panel button and select the Close item which will successfully close the window.
The following is source code that when built will exhibit the behaviour described above code...
I am working on xlib project to develop text editor without using help from any of toolkit/widgets.I get stuck in scrollbar.I have no idea how they work and developed.It become more difficult as I am using low-level C library - xlib.
I am starting to learn Linux graphical programming. Most of codes in my hands were written based on xlib, which is a kind of old graphic lib. I see some developers more interested in openGL. Then what's the difference between xlib and openGL? And which one is more popular used in which industry area?
I'm working on an application which generates random shapes when clicking on a window. I designed the window using Motif. I want to invoke the ButtonPress Event .
I tried to draw two lines with xlib.h in C. If I start this compiled program it show me in most cases a window with two lines as it should be.
But sometimes the two lines are not drawn.If I insert XFlush() before the second XSync() it worked better but not every time.Why?How can I solve the problem?How works the X-Server buffer in detail?
I am looking for a similar script like sydi-linux.py that will work with a Debian box. I want to document my server setup & just looking for an easier way to do it since I have to do this x12.Or do I just need to try & make this script work and shut up about it?
I'm using ubuntu 9.04; I have a large project in windows that I want to "port" it in linux. It uses IPC mechanism "Shared memory" and also "Critical Section" APIs in windows, but unfortunately I have no good reference to change these windows APIs to their equivalent in linux?
Is there a comprehensive documentation or reference for this issues? I mean a table containing the equivalent APIs or systemcalls in windows and linux! For example, what's an alternative for the "InitializeCriticalSection" API in linux? Or an alternative for "CRITICAL_SECTION" structure? Or even an alternative for "RegOpenKeyEx", although we don't have registry in linux!!
I cannot seem to find any good documentation on the role of flags -Bdynamic and -Bstatic in g++. The man pages are not very helpful either.I found an example on the web:"gcc object1.o object2.o -Wl,-Bstatic -lapplejuice -Wl,-Bdynamic -lorangejuice -o binary".According to which -Bstatic instructs the linker to statically link the applejuice library and to dynamically link the orangejuice library. If orangejuice uses the applejuice library anywhere however,the applejuice is also linked dynamically. Is it correct to assume that this is correct and describes the true functionality of those two flags in gcc? (ie: Bstatic and Bdynamic are used for mixing static and shared libraries during linking)Is it correct to assume that the same applies to g++ as well?
I'm trying to build a program called Obpager, but I'm getting an error saying I don't have xlib.h. From what I understand, that file is included in libx11-dev, which I have installed. Any idea?
Code:
dagoss@MAGIC-PORT:~/Downloads/obpager-1.8$ make Compiling src/main.cc In file included from src/main.cc:33:0:
I am seeing a weird error in a font display. I see a small question mark next to a font that I am using as a simple graphic. Does this mean that some function call in xlib is being passed an invalid paramter?
I am interested in learning 3D programming. The thing is, I would hate to put too much effort to learn something that doesn't have future and is dying. My favorite language at the time is Java. My goal is professional programming.
So I have several questions: 1. Should I learn JOGL or start learning C++ and do C++ openGL programming? 2. Is there a big difference between JOGL and C++ openGL programming? 3. Is it worth to learn openGL? Does it have a future? 4. Is it a big difference between openGL and directX coding? 5. If choosing Java, then JOGL or LWJGL?
Groovy is an object-oriented programming language for the Java platform. I do not have experience in Java, only perl and shell scripts. Recently I have been asked to maintain a software written in groovy (also to make enhancements). So can I learn groovy without knowing java language. or isit I have to learn java before venturing into groovy.
I did searched you tube but my results were not great.I have 2 books on KernelProgramming.I feel I need if some where I can get a video tutorial which can help me to understand how to develop a Linux Device driver that will be great.I had a look at Greg Kroah Hartmans video lecture of developing patches on ......I have been reading books and a lot of stuff.So I wish if I could get a video lecture that would be better
I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.
I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":
i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.
I am learning network programming via a book of Richard Stevens.The sample source codes are given here http://www.unpbook.com/unpv13e.tar.gz I downloaded and unzipped the file in /usr/src folder.As per the instructions given in README of downloaded archive I did.
A simple TCP based chat server could allow users to use any TCP client (telnet, for example) to communicate with each other. For this question you should consider a single process, single thread server that can support exactly 2 clients at once, the server simply forwards whatever is sent from one client to the other (in both directions). Your server must not insist on any specific ordering of messages as soon as something is sent from one client it is immediately forwarded to the other client. As soon as either client terminates the connection the server can exit
We have documents on multiple workstations and want to collate them into a single repository to provide text search and download. So far we have implemented rsync to copy files from each workstation under a directory for each workstation on a server (incidentally providing a backup) and have set up text search using Xapian with Omega; users access it via a web browser. Still to do is to set up a system to copy files from each workstation's area on the server to the repository.
Many files are duplicated. In these cases we want to preserve the names but keep a single copy of the file;hard links can be used for that.For each file to be copied from a workstation's area into the collated area we need to check whether it is a duplicate (file size and, if same, MD5 sum) and if so, create a hard link to the original rather than create a copy.A system to detect and replace duplicates in the collated area has been written using ruby and postgresql but the developer cannot commit to continuing this work. It does mean we have a postgresql database populated with "fingerprints" of files in the collated area.My first priority is to get the system working; in the longer term whatever is developed must be maintainable; I do not yet know which language skills are available locally.
I am fluent in bash and competent with awk. Ruby looks nice but I have started to learn python and do think it prudent to learn both at the same time. Python's postgresql capabilities are not settled but may be fine for the simple usage required.What to do? A bash solution would run very slowly but could be developed quickly. Language knowledge aside, I have found it difficult to install ruby on the server (CentOS 5.5;installed rvm but "gem" still not installed; seems a very complex system with its own package management).
i have problem in socket programming, while displaying received message in file,i got a problem... i cant able to write it in the file.... this is the code....
now my problem is run time error i can able to create file but i cant able to write file....log.txt contain nothing.... as here i have give sample code... dont say not initialising function and all.... i have initialised , please only see func1() - my problem is only not able to write msg which i got received from the client..