1. question about liballeg.a

There is an allegro library in the source code called liballeg.a
I would like to know the following.

1. Where is the source that created this library ?

2. Where is the "C" header file for this library ?

3. What specific functions does it contain ?

new topic     » topic index » view message » categorize

2. Re: question about liballeg.a

bernie said...

There is an allegro library in the source code called liballeg.a. I would like to know the following.

Looks like it's part of/included with DJGPP. From be_w.c:

#ifdef EDJGPP 
#include <pc.h> 
#include <sys/farptr.h> 
#include <dpmi.h> 
#include <go32.h> 
#include <allegro.h> 
#else 

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: question about liballeg.a

mattlewis said...
bernie said...

There is an allegro library in the source code called liballeg.a. I would like to know the following.

Looks like it's part of/included with DJGPP. From be_w.c:

#ifdef EDJGPP 
#include <pc.h> 
#include <sys/farptr.h> 
#include <dpmi.h> 
#include <go32.h> 
#include <allegro.h> 
#else 

Matt:

I looked it up in DJGPP and it says this:

All the Allegro functions, variables, and data structures are defined in
allegro.h. You should include this in your programs, and link with
liballeg.a.

My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.

new topic     » goto parent     » topic index » view message » categorize

4. Re: question about liballeg.a

bernie said...

I looked it up in DJGPP and it says this:

All the Allegro functions, variables, and data structures are defined in
allegro.h. You should include this in your programs, and link with
liballeg.a.

My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.

Sounds good. Get on it. smile

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: question about liballeg.a

I vaguely remember that someone had written a library called eu_engine or somesuch that wrapped svgalib on linux and allows graphics support through that.

That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.

mattlewis said...
bernie said...

My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.

Sounds good. Get on it. smile

Matt

new topic     » goto parent     » topic index » view message » categorize

6. Re: question about liballeg.a

jimcbrown said...

I vaguely remember that someone had written a library called eu_engine or somesuch that wrapped svgalib on linux and allows graphics support through that.

That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.

mattlewis said...
bernie said...

My thought is this; code from liballeg.a could be used to allow
EXU to run in the Linux frame buffer with mouse and graphics capabilities.

Sounds good. Get on it. smile

Matt

Jim:
I wrote eu_engine

The svgalib is no longer supported.

I already have written pure euphoria code and tested it to run directly
( without using third-party code ) in the Linux-Frame buffer.

The only problem I have now is not having frame-buffer mouse support.

new topic     » goto parent     » topic index » view message » categorize

7. Re: question about liballeg.a

bernie said...

The only problem I have now is not having frame-buffer mouse support.

What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?

jimcbrown said...

That should still work. A better option would be a port of eu_engine to run under graphapp or EuGTK to allow simulating graphics functions with X11.

I still maintain that this is a nice option to have.

new topic     » goto parent     » topic index » view message » categorize

8. Re: question about liballeg.a

jimcbrown said...
bernie said...

The only problem I have now is not having frame-buffer mouse support.

What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?


Because that gives you the GPM mouse which doesn't seem to work
in frame-buffer mode.

Incidentally my motor library will run X11, Motif, Xt, Athena euphoria
code but they require a lot of work to write a program.

new topic     » goto parent     » topic index » view message » categorize

9. Re: question about liballeg.a

bernie said...
jimcbrown said...
bernie said...

The only problem I have now is not having frame-buffer mouse support.

What's the problem with doing: integer h = open("/dev/mice", "r") ?! or "/dev/psaux", etc?

Because that gives you the GPM mouse which doesn't seem to work
in frame-buffer mode.

What?!

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.

bernie said...

Incidentally my motor library will run X11, Motif, Xt, Athena euphoria
code but they require a lot of work to write a program.

If all you need are graphics primitives, I do not see why this is so much work (other than to create the initial window to draw on).

new topic     » goto parent     » topic index » view message » categorize

10. Re: question about liballeg.a

jimcbrown said...
bernie said...

The only problem I have now is not having frame-buffer mouse support.

What?!

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.

What I think you are forgeting is those are all compiled dlls or compiled
programs or special fbdev's ; not euphoria code.

When you are using the frame-buffer the X11 server is shutdown.

new topic     » goto parent     » topic index » view message » categorize

11. Re: question about liballeg.a

jimcbrown said...

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

On Kubuntu, I can get /dev/input/mice, though it requires root to read.

Matt

new topic     » goto parent     » topic index » view message » categorize

12. Re: question about liballeg.a

bernie said...

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

GPM works (or used to work) by opening /dev/psaux (or whatever device pointed to the mouse) in a daemon process and then allowed client applications to get mouse events by reading a fifo named /dev/gpmctl.

What I think you are forgeting is those are all compiled dlls or compiled
programs or special fbdev's ; not euphoria code.

[/quote]

This comment makes no sense in regard to /dev/psaux or /dev/mice. Those are just regular device files, so in theory you can use getc() and puts() to control them. (For the cases where you can not, you may need to wrap C code to handle ioctl() and read()/write() or write assembly code to make the syscalls into the linux kernel directly.)

For X11, GTK, etc... this is true in that you need to wrap the compiled dlls and call C code from Eu. However, Irv Mullins has already wrapped the minimum you should need to use GTK, so you can just use his euphoria code to make the graphics functions work on linux/X11.

(Technically, you can do X11 programming entirely in euphoria just using socket calls, by working at the X11 network protocol level, and remove Xlib out of the picture entirely.)

bernie said...

When you are using the frame-buffer the X11 server is shutdown.

I assume you mean that having an X11 server running won't help you access the mouse in a framebuffer program. While you can in fact have both running at the same time, you can use only one at a time, so controling the mouse from the X server would be greatly impractial here.

If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.

new topic     » goto parent     » topic index » view message » categorize

13. Re: question about liballeg.a

mattlewis said...
jimcbrown said...

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

On Kubuntu, I can get /dev/input/mice, though it requires root to read.

FYI, here was my code:

integer m = open( "/dev/input/mice", "r" ) 
while 1 do  
	? getc(m) 
end while 

Matt

new topic     » goto parent     » topic index » view message » categorize

14. Re: question about liballeg.a

SVGAlib required suid-root to work. I believe direct framebuffer access also has permission restrictions on the actual device files (/dev/fb0 ?)

So, this is really expected behavior.

mattlewis said...

On Kubuntu, I can get /dev/input/mice, though it requires root to read.

FYI, here was my code:

integer m = open( "/dev/input/mice", "r" ) 
while 1 do  
	? getc(m) 
end while 

Matt

new topic     » goto parent     » topic index » view message » categorize

15. Re: question about liballeg.a

jimcbrown said...

(Technically, you can do X11 programming entirely in euphoria just using socket calls, by working at the X11 network protocol level, and remove Xlib out of the picture entirely.)

I assume you mean that having an X11 server running won't help you access the mouse in a framebuffer program. While you can in fact have both running at the same time, you can use only one at a time, so controling the mouse from the X server would be greatly impractial here.

Yes

jimcbrown said...

If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.


Please show me the euphoria code needed to
use these devices in a frame-buffer.

I am using the standard frame-buffer that is built-in to the
a 2.6 Linux kernel

new topic     » goto parent     » topic index » view message » categorize

16. Re: question about liballeg.a

bernie said...
jimcbrown said...

If I assume correctly, then you are right. However, direct access to /dev/psaux or /dev/mice should work for a framebuffer app.


Please show me the euphoria code needed to
use these devices in a frame-buffer.

I am using the standard frame-buffer that is built-in to the
a 2.6 Linux kernel

Matt Lewis already demonstrated the beginnings of such code.

From there you just need to figure out what protocol the device is using (PS/2, Busmouse, Serial, IMPS/2, etc) and then interpret the datastream as retrieved by getc().

new topic     » goto parent     » topic index » view message » categorize

17. Re: question about liballeg.a

mattlewis said...
mattlewis said...
jimcbrown said...

/dev/mice and /dev/psaux are supported not only by /usr/bin/X (i.e. the X server accessing your video card directly thru the ioports and/or DRM kernel driver) but also by Xfbdev, the implementation of X11 on top of fbdev.

On Kubuntu, I can get /dev/input/mice, though it requires root to read.

FYI, here was my code:

integer m = open( "/dev/input/mice", "r" ) 
while 1 do  
	? getc(m) 
end while 


Matt:
Are you running it in a frame-buffer ?

How do you use that to turn on\off the mouse pointer ?

What should you expect for input from getc(m) ?

new topic     » goto parent     » topic index » view message » categorize

18. Re: question about liballeg.a

bernie said...

Matt:
Are you running it in a frame-buffer ?

How do you use that to turn on\off the mouse pointer ?

What should you expect for input from getc(m) ?

I wasn't running it in a frame buffer, but I don't think it would make a difference. I don't think that /dev/input/mice is provided by X or anything. It's coming from the kernel, so I don't see why you shouldn't be able to read it the same way. I could be wrong, of course, but have you taken a look inside dev? I just did some ls-ing around, found input, under which I had mice, mouse0, mouse1 and mouse2.

I don't know anything about what the data means, but it printed a lot of stuff as I moved the mouse around, so it shouldn't be too difficult to figure out what it's doing. I have no idea how to turn on the cursor.

Matt

new topic     » goto parent     » topic index » view message » categorize

19. Re: question about liballeg.a

mattlewis said...
bernie said...

Matt:
Are you running it in a frame-buffer ?

How do you use that to turn on\off the mouse pointer ?

What should you expect for input from getc(m) ?

I wasn't running it in a frame buffer, but I don't think it would make a difference. I don't think that /dev/input/mice is provided by X or anything. It's coming from the kernel, so I don't see why you shouldn't be able to read it the same way. I could be wrong, of course, but have you taken a look inside dev? I just did some ls-ing around, found input, under which I had mice, mouse0, mouse1 and mouse2.

I don't know anything about what the data means, but it printed a lot of stuff as I moved the mouse around, so it shouldn't be too difficult to figure out what it's doing. I have no idea how to turn on the cursor.

Matt:

/dev/mouse are used for syslinks pointing different mouse devices.

GPM mouse was used in Eu past but that only worked when running in
text console.

I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.

new topic     » goto parent     » topic index » view message » categorize

20. Re: question about liballeg.a

bernie said...

/dev/mouse are used for syslinks pointing different mouse devices.

Correct, but /dev/input/mice is not.

crw-rw-- 1 root root 13, 63 2008-08-15 08:00 /dev/input/mice

It is a device that reports the movements of all non-absolute mice attached to the system.

bernie said...

GPM mouse was used in Eu past but that only worked when running in
text console.

In other words, eu 2.2 would not be able to use the mouse from linux framebuffer either (at least not via get_mouse() ) ?

bernie said...

I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.

What is Cee?

new topic     » goto parent     » topic index » view message » categorize

21. Re: question about liballeg.a

bernie said...

GPM mouse was used in Eu past but that only worked when running in
text console.

jimcbrown said...

In other words, eu 2.2 would not be able to use the mouse from linux framebuffer either (at least not via get_mouse() ) ?

Thats correct it only worked in the text console/terminal.
Remember it used GPM and curses.

bernie said...

I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.

jimcbrown said...

What is Cee?

My abbreviation for "the C Language"

new topic     » goto parent     » topic index » view message » categorize

22. Re: question about liballeg.a

bernie said...
jimcbrown said...
bernie said...

I can get the mouse to run in a frame-buffer with Cee code so I guess
I'll just write a Cee Shared Object and call it from Eu.

What is Cee?

My abbreviation for "the C Language"

If you can give me working C code for that, I can give you working euphoria code that will provide the exact same functionality. The only issue I had was not being familiar enough with the PS/2 protocol.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu