[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: [Axiom-developer] axiom graphics and porting
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: [Axiom-developer] axiom graphics and porting |
Date: |
27 Apr 2005 11:56:01 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings!
address@hidden writes:
> I've tried 3 paths so far.
>
> First I tried to find an X library that runs natively on windows
> without success. So I started working on one and realized that I
> didn't know enough of the Microsoft C API to manage it.
>
Such ambition!
> Second I tried to use TK as the front end. I was unable to get
> the TK front end to display graphics and was unable to find the
> source code (since remedied by Camm).
>
More here later.
> Third I tried to use McClim. I want to use a lisp-based front end
> and this was my best hope. Unfortunately I was unable to get it to
> work.
>
My understanding is that this will need a backend on Windows anyway.
I *think* it is conventionally built atop clx, which works just about
'out of the box' on gcl, but everyone these days wants something
higher up than raw xlib.
> Finally I wrote a TK-equivalent program in Java. Since it is cross
> platform it will run on linux and windows. I have a small working
> demonstration for the browser.
>
> The plan is to rewrite the browser and graphics in common lisp and
> use a socket based message passing to communicate. The common lisp
> rewrite would make it so much easier to port. And the command
> language for the front end could be easily modified to fit the
> choice of front end (TK, Java, McClim).
>
> I'm unhappy about the need for Java and would much prefer McClim.
Me too! Thankfully, this is not hard.
>
> GCL does not seem to handle run-process correctly so I've been using
> CLISP. The browser and the graphics run in their own process anyway
> so Axiom under GCL can talk to McClim under CLISP.
>
This is a simple missing define:
=============================================================================
--- h/protoize.h 2005-01-16 00:36:20.000000000 +0000
+++ ../gclcvs-2.7.0/h/protoize.h 2005-04-09 13:16:40.000000000 +0000
@@ -604,6 +604,9 @@
gcl_init_symbol_function(void);
void
+gcl_init_socket_function(void);
+
+void
gcl_init_hash(void);
void
--- o/run_process.c 2003-09-14 02:30:45.000000000 +0000
+++ ../gclcvs-2.7.0/o/run_process.c 2005-04-14 21:55:45.000000000 +0000
@@ -16,12 +16,15 @@
*/
-
+#include <string.h>
#define IN_RUN_PROCESS
#include "include.h"
#ifdef RUN_PROCESS
+void setup_stream_buffer(object);
+object make_two_way_stream(object, object);
+
#ifdef __MINGW32__
#include<windows.h>
@@ -29,7 +32,6 @@
#define PIPE_BUFFER_SIZE 2048
void DisplayError ( char *pszAPI );
-void setup_stream_buffer ( object x );
void PrepAndLaunchRedirectedChild ( HANDLE hChildStdOut,
HANDLE hChildStdIn,
HANDLE hChildStdErr,
@@ -425,7 +427,8 @@
return(stream);
}
-object make_socket_stream(host_l,port)
+object
+make_socket_stream(host_l,port)
object host_l;
object port;
{
@@ -445,7 +448,7 @@
}
void
-siLmake_socket_stream()
+FFN(siLmake_socket_stream)()
{
check_arg(2);
vs_base[0] = make_socket_stream(vs_base[0], vs_base[1]);
@@ -462,7 +465,6 @@
int sockets_in[2];
int sockets_out[2];
FILE *fp1, *fp2;
- int pid;
object stream_in, stream_out, stream;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets_in) < 0)
@@ -473,11 +475,12 @@
fp2 = fdopen(sockets_out[0], "w");
#ifdef OVM_IO
+ {int pid;
pid = getpid();
ioctl(sockets_in[0], SIOCSPGRP, (char *)&pid);
if( fcntl(sockets_in[0], F_SETFL, FASYNC | FNDELAY) == -1)
perror("Couldn't control socket");
-
+ }
#endif
@@ -502,7 +505,7 @@
* with "C" type streams.
*/
-
+void
spawn_process_with_streams(istream, ostream, pname, argv)
object istream;
object ostream;
@@ -531,12 +534,10 @@
}
}
-
-
-
}
+void
run_process(filename, argv)
char *filename;
char **argv;
@@ -550,7 +551,8 @@
vs_top = vs_base + 2;
}
-siLrun_process()
+void
+FFN(siLrun_process)()
{
int i;
object arglist;
@@ -567,7 +569,7 @@
}
void
-siLmake_socket_pair()
+FFN(siLmake_socket_pair)()
{
make_socket_pair();
}
--- h/linux.h 2005-04-27 15:44:19.000000000 +0000
+++ ../gclcvs-2.7.0/h/linux.h 2005-03-07 23:12:07.000000000 +0000
@@ -93,7 +93,7 @@
result = (current_mask & sigmask(m) ? signal_mask(m) : 0) \
| (current_mask & sigmask(n) ? signal_mask(n) : 0);
-#undef RUN_PROCESS
+#define RUN_PROCESS
#define IEEEFLOAT
=============================================================================
GCL (GNU Common Lisp) 2.6.6 CLtL1 Apr 27 2005 15:47:01
Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
Binary License: GPL due to GPL'ed components: (READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
>(let ((s (si::run-process "echo" (list "hello" "there")))) (values (read s)
>(read s)))
***** Spawning process echo
HELLO
THERE
>(by)
=============================================================================
So you're ready to go here. Will post this to the errata page for
inclusion in 2.6.7 if any. We still need to decide on a
cross-platform graphics to talk *to*. I feel pretty confident we can
get images displayed in gcl-tk in a cross platform manner. As
discussed elsewhere, this entails a graphics rewrite and is hence a
longer term solution, for which gtk might be a still better option.
Short term, why not just recode the sman C graphics in Windows?
Anyone?
Take care,
> t
>
>
>
> _______________________________________________
> Axiom-developer mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- [Gcl-devel] Re: [Axiom-developer] axiom graphics and porting,
Camm Maguire <=