Quick links to related issues: X Client | X Windows Client | X-Client | X Window Clients on Windows

LabF XDK - Make Your Windows X Apps

LabF office building
   Products   DownloadPrice & OrderSupportCompanyTutorialsSitemap
    Previous | Next



Porting X Window Applications to LabF Xserver

When porting any X window application to LabF Xserver (WinaXe, WinaXe Plus or  AceaXe Plus), the first step is to ensure that the build environment is fully set up on LabF Xserver.

Quite often, code for X applications are generated using specific tools. If your code is created using a code generator and the code generator is not available on LabF Xserver, you must take the code that was generated using the code generator to LabF Xserver and port it.

The next step is to compile the source code and resolve issues as they appear. Typical issues are related to path differences, potentially non-existent device files, environment differences, etc. You might need to modify the paths for including the X11 and/or Motif include files and libraries.

There could be differences in the header files and in specific APIs, or there may be missing header files and APIs. The differences can be resolved by writing LabF Xserver (WinaXe, WinaXe Plus or AceaXe Plus) implementations for the APIs and header files.

If your applications include scripts, such as Perl scripts, these will have to be modified to account for the platform differences.

If you are porting a GUI application client receiving input via STDIN, use an alternate method of receiving input, such as a Windows dialog box.

  • Memory Management

    Xlib contains its own memory management routines, including Xfree, Xmalloc, and Xcalloc. In order to maintain compatibility with future versions of the LabF XDK, use these routines instead of Microsoft WIN32 memory management routines.

    Memory allocated by these Xlib routines should be freed using Xlib routines. Similarly, memory that is freed using Xlib routines should be allocated by Xlib routines.

  • The gethostname Function

    Xlib.dll exports the gethostname function. A function by this name is also exported by the Windows Sockets DLL.

    We do not recommend that you use the Xlib.dll version of this function; it is provided by Xlib only for backwards compatibility. In order to ensure that you are using the Windows Sockets version of this function, and not the Xlib.dll version, your link statement must include WSOCK32.lib before Xlib.lib.

  • Setting the Locale for an X Client

    The default value for the run-time control variable XLOCALEDIR is home\x11\locale. The locale.dir file is in the home\x11\locale directory.

    Locale aliases are supported. You can specify your locale alias in the locale.alias file in the home\x11\locale directory.

  • Accepting Localized Input

    X11R6 XIM support is included on the X server side. This support lets local X clients accept localized input when displaying to an X server that supports X11R6 XIM (such as XServer in WinaXe, WinaXe Plus or AceaXe Plus).

  • Restrictions on Developing X Window Applications with XDK

    There are some restrictions on developing an X application code with the LabF XDK:

    • You cannot directly use WinSock API
    • As sockets interface, the BSD sockets interface is implemented in XDK
    • There are no equivalent substitutes for some UNIX system calls/requests (e.g., fork, signal, pipe, etc.)
    • The source errno.h file for an X application may require some changes in the application source code; in some cases, you can also use the xeerrno.h file in the home\XDK\Include\Sys directory of the LabF Xserver (WinaXe, WinaXe Plus or AceaXe Plus) package


    > XDK (X Development Kit)
      > Introduction
      > Content
      > Developing X Clients
      > Porting X Clients

        Previous | Next      
        © LabF. All rights reserved.     Privacy policy     e-mail us at: sales@labf.com