Archive for July, 2004

Useful Mozilla/Firefox Extensions

After having playing around with extensions for some while, here’s my list of extensions I consider “huge usability improvers”:

  • DictionarySearch: Looks up selected word in an online dictionary by context menu. Hint: You can add custom dictionaries, e.g. “http://dict.leo.org/?search=$”.
  • Diggler: Adds a button next to the location bar that can clear the location bar (much like the one in Konqueror) and also drop down a menu with more actions.
  • Download Manager Tweak: A modification of the Firefox download manager that changes its appearance and allows it to be opened in a separate window, a new tab, or the sidebar.
  • Googlebar: An unofficial Google toolbar for Firefox. Note: There is also GooglebarL10N, which gives you localized version.
  • LiveHTTPHeaders: View HTTP headers of a page and while browsing.
  • Mouse Gestures: Allows you to execute common commands using mouse gestures.
  • ReloadEvery: Reloads webpages every so many seconds or minutes.
  • SuperScroll: Override the default keyscroll and mousewheel settings.
  • Tabbrowser Extensions: Improves tabbed browsing a lot. Note: This extensions seems to seriously slow-down Firefox.
  • Web Search Plus: Uses the current Search Bar engine for context-menu Web Searches.

These two come pre-installed with Firefox:

  • Web Developer: Adds a menu and a toolbar with various web developer tools.
  • Dom Inspector: You’ll need to enable this when you install Firefox – choose the ‘Custom install’ and check the box for ‘Developer tools’. The DOM inspector allows you to view the ‘Document Object Model’ for a web page. See here for more information. Also note that the extension manager of Firefox 0.9.2 seems to have a problem with it (search Google).

Note: This list of extensions is an update of my earlier posting A look at Web Browsers and File Managers.

Leave a Comment

Generating .dll files for JNI under Windows/Cygwin/GCC

In Windows you can use the Cygwin GCC compiler/linker to produce the .dll files needed for JNI (Java Native Interface) applications. Take for example the JNI HelloWorld example from Sun.

But there seem to be several obstacles. First I got compiler errors (concerning undefined jlong type) and after resolving this I wondered how to produce a Win32 native .dll file.

The solution is as follows (my environment is J2SE 1.4.2-b4, Cygwin GCC 3.3.1):

Changes to JDK headers needed for GCC

(Take from here) GCC doesn’t have a __int64 built-in, and this patch basically uses “long long” instead.

  1. Edit the file /include/win32/jni_md.h, Where   is the installation root (eg., c:/jdk1.4.2).

  2. Replace the segment:

    typedef long jint;
    typedef __int64 jlong;
    typedef signed char jbyte;

    with:

    typedef long jint;
    #ifdef __GNUC__typedef long long jlong;
    #else
    typedef __int64 jlong;
    #endif
    typedef signed char jbyte;

Modify the GCC spec file

This modification is only important if the next step (compiling and linking) produces an linker error "dllcrt2.o not found".

(Take from here) In the Cygwin shell edit the file "/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs" (replace 3.3.1 with your GCC version). Find the text "dllcrt2" and replace it with the absolute (Cygwin) path to dllcrt2.o, e.g. "/lib/mingw/dllcrt2".

Compile and Link the .dll file

(Take from here) Call the compiler:

gcc -L /lib/mingw -Wl,--kill-at -mno-cygwin -shared -I /include/ -I /include/win32/ HelloWorldImpl.c -o hello.dll

Replace with the Cygwin path to your J2SE, e.g. "/cygdrive/c/Java/jdk1.4.2".

That's it. Now I get "Hello World!". Fine.

Comments (10)

Follow

Get every new post delivered to your Inbox.