라벨이 support인 게시물 표시

OS/2 codes: How to support DBCS #5 Level 3 application(Full-IME)

So far, we've found the way to support DBCS without consideration of IME itself. They are called level 1 application. Level 1 applications are useful. However, they still lack something. Because, a conversion window is not integrated to a working window. For example, let's consider a word processor program. On level 1 application, a size and a type of a font of a conversion window are different from ones in a working window. This looks ugly and uncomfortable. In addition, level 1 applications use over-the-spot input type. That is, a conversion window shows up over a underlying text. Users cannot see the texts under the conversion window until a conversion is completed. In this article, let's find to make level 3 applications, which use IME fully. Making Level 3 Applications To make level 3 applications, you neede OS/2 ToolKit v4.5 or later. And when linking a program, you need to link against os2im.lib . Make sure to add os2tk45/h to C_INCLUDE_PATH and to add os2tk...

OS/2 codes: How to support DBCS #4 Process WM_QUERYCONVERTPOS

이미지
WM_QUERYCONVERTPOS is sent in order to query a position of a conversion window and a candiate window. However, an application is not aware of IME and not needed to control IME at all. Let's see a syntax of WM_QUERYCONVERTPOS. This message is sent by an application to determine whether it is appropriate to begin conversion of DBCS characters. param1 PRECTL pCursorPos /* Cursor position. */ param2 ULONG ulReserved /* Reserved value, should be 0. */ This message may return QCP_CONVERT or QCP_NOCONVERT. If you return QCP_NOCONVERT, then an window does not receive DBCS characters. That is, this has an effect to disable IME. If you return QCP_CONVERT, then an window receives DBCS characters. In this case, [pCursorPos] should be updated. [pCursorPos->xLeft] and [pCursorPos->yBottom] is a bottom-left corner of a conversion window and a upper-left corner of a candidate window. [pCursorPos->xRight] and [pCursorPos-yTop] is a upper-right corner of a ...

OS/2 codes: How to support DBCS #3 Process WM_CHAR

On PM, users' key inputs are delivered with WM_CHAR message. First see a syntax of WM_CHAR. This message is sent when an operator presses a key. param1 USHORT fsflags /* Keyboard control codes. */ UCHAR ucrepeat /* Repeat count. */ UCHAR ucscancode /* Hardware scan code. */ param2 USHORT usch /* Character code. */ USHORT usvk /* Virtual key codes. */ Here, the relavant things are [fsflags](=SHORT1FROMMP(mp1)), [ucscancode](=CHAR4FROMMP(mp1)) and [usch](=SHORT1FROMMP(mp2)). A DBCS character consists of two bytes. So do not assume that [usch] is a single-byte. Then what is the way to distinguish a SBCS character and a DBCS character ? Check a high-byte of [usch]. If it is 0, then a SBCS character, or a DBCS character. If it is a DBCS character, its low-byte is a lead-byte and its high-byte is a trail-byte. You can access these bytes of [usch] with several ways. First is to use [usch] itself. In this case,...

OS/2 codes: How to support DBCS #2 Manipulate DBCS strings

Unlike SBCS, a DBCS(double-byte character set) character consist of two bytes as its name. ^^ So manipulating DBCS strings needs some different works. For example, strlen() returns a length of a string in bytes not in characters. And if walking through DBCS strings, indice should be moved by 2 bytes. To solve the above problems, the most basic is to get an information of DBCS lead-bytes. Here, a lead-byte is first byte of a DBCS character. And second byte is called a trail-byte. On OS/2, there are two ways to do this. One is DosQueryDBCSEnv() , and the other is UniQueryUconvObject() . Using these functions, it is possible to determine a chracter is a SBCS character or a DBCS character. DosQueryDBCSEnv() give a vector of ranges of lead-bytes. Whereas, UniQueryUconvObject() give a vector of a char size in according to a lead-byte. If you prefer compatibility, then use DosQueryDBCSEnv() . If got a information for lead-bytes, now what to do is to determine if a DBCS character. This...

OS/2 codes: How to support DBCS #1 Determine if DBCS env

Most of OS/2 users are in SBCS countries. Naturally, many OS/2 programs are developed in their countries. And those programs lack DBCS support. To begin with this article, I'll write a series of articles for DBCS support. How to determine if DBCS environment OS/2 is based on a code page. And OS/2 provides many APIs for a code page. Out of these, you can use DosQueryDBCSEnv() to determine if DBCS environment because DBCS code pages provides the ranges of DBCS lead-bytes. This is a syntax for DosQueryDBCSEnv(). Obtains a DBCS (double-byte character set) environmental vector that resides in the country file. #define INCL_DOSNLS #include <os2.h> ULONG cb ; /* The length, in bytes, of the data area ( pBuf ) provided by the caller. */ PCOUNTRYCODE pcc ; /* A pointer to the COUNTRYCODE structure in which the country code and code page are identified. */ PCHAR pBuf ; /* The data area where the country-dependent information for the DBCS ...