Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Xlc(3X11) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

XLC(3X11)  —  NEWS-OS Programmer’s Manual

NAME

XlcOpen, XlcClose, XlcBCkey, XlcMessage, XlcProperty, XlcOffTheSpot, XlcGetString, XlcConversionEnd, XlcOnTheSpot, XlcFrame, XlcOffset, XlcSendKey, XlcConversionStatus
 − X Language Conversion Library

Syntax

char ∗XlcOpen (display, window, conversion, status)
Display∗display;
WindowWindow;
char∗conversion;
int∗status;
 XlcClose (display, Window, conversion)

Display∗display;
WindowWindow;
char∗conversion;
 XlcBCKey (event)
XKeyEvent∗event;
 XlcMessage (event)
XClientMessageEvent∗event;
 XlcProperty (event)
XPropertyEvent∗evnet;
 Window XlcOffTheSpot (display, window, conversion)
Display∗display;
Windowwindow;
char∗conversion;
 XlcGetString (display, prop_return, event)
Display∗display;
unsigned char∗∗prop_return;
XPropertyEvent∗event;
 XlcConversionEnd (display, window, conversion, discard)
Display∗display;
WindowWindow;
char∗conversion;
Booldiscard,
 Window XlcOnTheSpot (display, window,
foreground, background, border,
border, border_width,
font8, font16, efont16,
x_offset, y_offset, line_height,
frame_x, frame_y,
frame_width, frame_height,
x_offset, y_offset,
line_height, auto_offsetR)
Display∗display;
Windowwindow;
char∗conversion;
unsigned longforeground, background, border;
intborder_width, frame_x, frame_y;
intframe_width, frame_height;
intx_offset, y_offset, line_height;
Fontfont8, font16, efont16;
Boolauto_offset;
 XlcFrame (display, frame_x, frame_y,
      frame_width, frame_height,
        x_offset, y_offset)
Display∗display;
intframe_x, frame_y,
intframe_width, frame_height,
 intx_offset, y_offset;
 XlcOffset (display, x_offset, y_offset)
Display∗display;
intx_offset, y_offset;
XlcConversionStatus ( )

DESCRIPTION

By using the X Language Conversion (Xlc) library, applications can be connected to the Language Conversion server and the results of Japanese, Korean, Chinese(Taiwan) conversion can be obtained. 
Japanese input is possible using SJX for kana−kanji conversion. 
Korean input is possible using SKX for korean conversion. 
Chainese(Taiwan) input is possible using SCX for Chinese(taiwan) conversion. 
The Xlc library includes an interface using a conversion server window and another interface for "on-the-spot" conversion using application windows.
 
Interface Using a Conversion Server Window
 
XlcOpen obtains a name of the conversion.  XlcOffTheSpot makes a connection to the conversion server and sends a request to begin conversion.  XlcClose disconnets it.  XlcOffTheSpot returns the window ID of the conversion server.  if the conversion server is already running a notification to begin conversion is sent to the application in a client message.  When the application receives ClientMessageEvent, it calls XlcMessage for synchronization.  PropertyNotifyEvent reaches the application after conversion is complete.  Accordingly, the window which needs the results of the conversion must be included when PropertyChangeMask is x-selected as input.  It can be checked that the result of the conversion is a Property for the XLc after PropertyNotifyEvent arrives.  The results of conversion can be obtained by using XlcGetString when it is a Property for the Xlc.  The string is returned as COMPOUND TEXT. 
 

char ∗XlcOpen (display, window, conversion, status)
Display∗display;
WindowWindow;
char∗conversion;
int∗status;

 

displaySpecifies the connection to the X server. 

windowSpecifies the window requesting conversion. 

conversionSpecifies the name of the conversion being requested. 
Specifies "JAPANESE_CONVERSION" when using SJX.
Specifies "KOREAN_CONVERSION" when using SKX.
Specifies "CHINESE_CONVERSION" when using SCX.
The name of the conversion is determined in accordance with locale(3) when the conversion is set to 0. 
Specifies "JAPANESE_CONVERSION" when using "Ja_JP(Japan)".
Specifies "KOREAN_CONVERSION" when using "Ko_KR(Korean)".
Specifies "CHINESE_CONVERSION" when using "zh_TW(Taiwan)".

statusA status of the conversion server is returned. When it is 0, it is in conversion. When it is not 0, it is not in conversion. 
 

XlcClose (display, conversion)
Display∗display;
Windowwindow;
char∗conversion;

displaySpecifies the connection to the X server. 

prop_returnSpecifies the window which the conversion being terminated. 

conversionSpecifies the name of the conversion being terminated. 
 

Window XlcOffTheSpot (display, window, conversion)
Display∗display;
Windowwindow;
char∗conversion;

displaySpecifies the connection to the X server. 

prop_returnSpecifies the window requesting conversion. 

conversionSpecifies the name of the conversion being requested. 
 

XlcProperty (event)
XPropertyEvent∗event;

eventSpecifies the PropertyNotifyEvent structure received.  When it is the Property for the Xlc, other than 0 is returned.  Otherwise, 0 is returned. 
 

XlcBCKey (event)
XKeyEvent∗event;

eventSpecifies the KeyPressEvent structure received.  It is dertermined that the key to start the conversion or not.  When it is the key to start the conversion, other than 0 is returned.  Otherwise, 0 is returned. 
 

XlcGetString (display, prop_return, event)
Display∗display;
unsigned char∗∗prop_return;
XPropertyEvent∗event;

 

displaySpecifies the connection to the X server. 

prop_returnReturns a pointer to data.  Use XFree to free this data. 

eventSpecifies the PropertyNotifyEvent structure received. 
 

XlcMessage (event)
XClientMessageEvent∗event;

eventSpecifies the ClientMessageEvent structure received. 
 

XlcConversionEnd (display, window, conversion)
Display∗display;
Windowwindow;
char∗conversion;
 

displaySpecifies the connection to the X server.

windowSpecifies the window which the conversion being terminated.

conversionSpecifies the name of the conversion being terminated.
 

XlcConversionStatus ( )
 Returns the status of the conversion server.
When it is in conversion, other than 0 is returned. Otherwise, 0 is returned.
 Interface Using an Application Window
 Connections are made to the conversion server
using
XlcOnTheSpot
and a conversion request is sent out.
XlcOnTheSpot
specifies "on-the-spot" conversion parameters at this time.
XlcOffTheSpot returns the window ID of the conversion server.
When this request arrives,
sjx, skx, scx creates a display window
on the window requestin conversion and
and displays information
in this display window
during conversion
using the specified foreground, background and font.
 

Window XlcOnTheSpot (display, window, conversion,
foreground, background,
border, border_width,
font8, font16, efont16,
frame_x, frame_y,
frame_width, frame_height,
x_offset, y_offset,
line_height, auto_offset)
Display∗display;
Windowwindow;
char∗conversion;
unsigned longforeground, background, border;
intborder_width, frame_x, frame_y;
        intframe_width, frame_height;
intx_offset, y_offset, line_height;
Fontfont8, font16, efont16;
Boolauto_offset;

 

displaySpecifies the connection to the X server. 

windowSpecifies the window requesting conversion. 

conversionSpecifies the conversion name being requested. 
Specifies "JAPANESE_CONVERSION" when using sjx. 
Specifies "KOREAN_CONVERSION" when using skx. 
Specifies "CHINESE_CONVERSION" when using scx. 

foregroundSpecifies the display foreground. 

backgroundSpecifies the display background. 

borderSpecifies the display border color. 

border_widthSpecifies the display border width. 

font8Specifies the display font (for 1-byte characters). 

font16Specifies the display font of Japanese (for 2-byte characters) when connecting to the sjx kana-kanji conversion server.  Specifies the display font of Korean (for 2-byte characters) when connecting to the skx korean conversion server.  Specifies the Hanzi display font of Chainese (for 2-byte characters) when connecting to the scx chinese (Taiwan) conversion server. 

efont16Specifies the extra character display font of Japanese (for 2-byte characters) when connecting to the sjx kana-kanji conversion server.  Specifies the extra character display font of Chinese(Taiwan)  (for 2-byte characters) when connecting to the scx Chinese (Taiwan) conversion server. 

frame_xSpecifies the x co-ordinate of the conversion frame for relative to the origin of the window requesting conversion. 

frame_ySpecifies the y co-ordinate of the conversion frame relative to the origin of the window requesting conversion. 

frame_widthSpecifies the width of the conversion frame. 

frame_heightSpecifies the height of the conversion frame. 

x_offsetSpecifies the x co-ordinate of the display window (current position) relative to the origin of the window requesting conversion. 

y_offsetSpecifies the y co-ordinate of the display window (current position) relative to the origin of the window requesting conversion. 

line_heightSpecifies a height of one line when the display window contains 2 or more lines. 

auto_offsetThe display window is automatically moved after conversion is complete if this value is TRUE. 
 
The conversion frame is conceptually as shown below.
 

    +----------------------------------------------------------------+
    |        ^            ^   window requesting conversion           |
    |        |            |                                          |
    |        |frame_y     |                                          |
    |        |            |                                          |
    |        v            |   conversion frame                       |
    |<------>+------------|-------------------------+ ^              |
    |frame_x |            |                         | |              |
    |        |            |y_offset                 | |              |
    |        |            v                         | |              |
    |<------------------->+-------+                 | |frame_height  |
    |        | x_offset   |       |                 | |              |
    |        |            +-------+                 | |              |
    |        |            display window            | |              |
    |        +--------------------------------------+ v              |
    |        <-------------- frame_width ----------->                |
    |                                                                |
    +----------------------------------------------------------------+

 
The conversion frame is the specified region used to display the display window created by the conversion server. Applications can specify this region for the conversion server. The entire region comprising the window requesting conversion is selected as the conversion frame when frame_x, frame_y, frame_width, and frame_height are all set to 0.  Applications can specify the current position of a display window using x_offset and y_offset.  sjx skx, and scx displays the conversion process in the display window at the specified position.  Although the display window allows input to continue, the display window will grow in size to the left when the input reaches the right edge of the specified frame.  If the display window reaches the left edge of the frame, filling an entire line, one line will be added to the bottom of the display window.  Input is no longer possible if the display window reaches the bottom of the specified frame.  The display window will automatically be moved by an amount equal to the length of its contents after conversion if auto_offset is set to TRUE.  (Special processing in cases such as when carriage returns (line feeds) have been input is not performed.) 
 
The server is notified by XlcFrame if the conversion frame needs to be modified in cases such as when the application window is to be resized, etc. 
 

XlcFrame (display, frame_x, frame_y,
       frame_width, frame_height,
       x_offset, y_offset)
Display∗display;
intframe_x, frame_y, frame_width,
 frame_height, x_offset, y_offset;

 
The server is notified by XlcOffset when the display window needs to be moved by an application. 
 

XlcOffset (display, x_offset, y_offset)
Display∗display;
intx_offset, y_offset;

 
When an application receives ClientMessageEvent it calls XlcMessage for synchronization.  PropertyNotifyEvent reaches applications after conversion is complete.  Accordingly, the window requesting the results of conversion must be included when PropertyChangeMask is selected as input.  The results of conversion can be obtained by using XlcGetString after PropertyNotifyEvent arrives.  The string is returned as COMPOUND TEXT when conversion is made using sjx, skx, and scx. 
 
 

SEE ALSO

NEWS Programmer’s Manual (section, Japanese Input)
NEWS User’s Manual (section, Japanese Input)
NEWS Software Operation Manual skx(by Daewoo Electronic Co.of Korea)
NEWS Software Operation Manual scx(by Syntra Inforamtion System Inc of Taiwan)
Compound Text Encoding
/usr/lib/libXlc.a
 

Others

skx Korean conversion server is offerd by the spot distributor of Korea. 
scx Chinese(Taiwan)conversion server is offerd by the spot distributor of Taiwan. 
 

Copyright

(c) 1989 1990 Sony Corporation

NEWS-OSRelease 4.1C

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026