Ethereal-dev: Re: [Ethereal-dev] XUL => native Windows update

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Sat, 07 Feb 2004 12:28:06 +0100
Gerald Combs wrote:

In http://www.ethereal.com/lists/ethereal-dev/200311/msg00481.html I
mentioned that I was working on a way to generate a native Windows
interface for Ethereal from XUL definitions, using Python scripts to
generate C code.  The engine has been named "Xulender" (XUL frontend
generator), and a current version can be found at

    http://www.ethereal.com/~gerald/xulender-040206.tar.gz

If you want to try it out, unpack the archive into a current CVS
directory and run "nmake -f Makefile.nmake.win".  Along with the current
crop of executables, "wethereal.exe" is created.  In its present state
it can open capture files, and not much else.

What works:

The container-based layout system is still rudimentary, but it works.
Callbacks via XUL's "oncommand" attribute work.  It was straightforward
to implement native controls (the detail/tree view and byte view).

What doesn't work:

Windows seems reluctant to return accurate text dimensions.  Maybe I'm
not asking it correctly.  Under the Windows C SDK, windows and dialogs
are laid out using radically different methods and have different event
mechanisms.  The About... dialog is implemented as a window, and it's
clunky.  Apparently, the size assigned to the ComboBox control is the
size of its drop-down menu; this doesn't fit into the current layout
system at all.

I'm going to try to finish the display filter code, and tackle the
capture dialog after that.

Hi Gerald!

This looks promising, although a lot of work to do ;-)

Here's what I got when I first compiled:

--------------------------------------------------------------------------------------------------------------------------
Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.

       cd ..
       cd image
       NMAKE /                   -f Makefile.nmake

Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.

       cd ..
       cd xulender/win32-c-sdk
       NMAKE /                   -f Makefile.nmake

Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.

       env python ..\xulender.py ..\about-dialog.xul
sys:1: DeprecationWarning: Non-ASCII character '\xfc' in file ..\xulender.py on line 3, but no encoding declared; see http://www.python.org/
peps/pep-0263.html for details
dialog [ width: 250 height: 100 id: about-dialog title: About Ethereal ]
-> vbox [ width: 220  height: 95  ]
---> description
---> hbox
-----> spacer [ flex: 1  ]
-----> button [ default: True oncommand: about_dialog_dialog_hide id: about-ok label: OK ]
Writing about-dialog.c
Writing about-dialog.h
Writing about-dialog.rc
       env python ..\xulender.py ..\ethereal-main.xul
sys:1: DeprecationWarning: Non-ASCII character '\xfc' in file ..\xulender.py on line 3, but no encoding declared; see http://www.python.org/
peps/pep-0263.html for details
Traceback (most recent call last):
 File "..\xulender.py", line 82, in ?
   ui_doc = parse(ds)
File "/tmp/python.2664/usr/lib/python2.3/xml/dom/minidom.py", line 1919, in parse File "/tmp/python.2664/usr/lib/python2.3/xml/dom/expatbuilder.py", line 928, in parse File "/tmp/python.2664/usr/lib/python2.3/xml/dom/expatbuilder.py", line 207, in parseFile
xml.parsers.expat.ExpatError: unbound prefix: line 63, column 4
NMAKE : fatal error U1077: 'env' : Rueckgabe-Code '0x1'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\NMAKE.EXE' : Rueckgabe-Code '0x2'
Stop.

D:\ulfl\proj\Ethereal\cvs\ethereal.xul>
--------------------------------------------------------------------------------------------------------------------------

I could remove the DeprecationWarning when simply removing the � char (line 3 in xulender.py), this might be a warning as I'm using python version 2.3

The unbound prefix error was due to the prefix "ethereal:" at line 63 and the following ones in ethereal-main.xul. I simply removed them, and I could compile.
I just don't know if that was the right thing to do.

After fixing this, I could compile and got a wethereal.exe. I could open the about and file open dialogs, but when I tried to load a file, it failed somewhere in the epan code,
regardless of which file I choosed.

Regards, ULFL