ホーム › UI.TabletPC › RECO_LATTICE_ELEMENT
RECO_LATTICE_ELEMENT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| score | INT | 4 | +0 | +0 | この認識候補要素のスコア(評価値)。 |
| type | WORD | 2 | +4 | +4 | pData が指すデータの型を示す値。 |
| pData | BYTE* | 8/4 | +8 | +8 | 認識結果データへのポインタ。型は type に依存。 |
| ulNextColumn | DWORD | 4 | +16 | +12 | この要素が接続する次の列のインデックス。 |
| ulStrokeNumber | DWORD | 4 | +20 | +16 | この要素が含むストローク数。 |
| epProp | RECO_LATTICE_PROPERTIES | 16/8 | +24 | +20 | 要素に付随するプロパティ群 RECO_LATTICE_PROPERTIES。 |
各言語での定義
#include <windows.h>
// RECO_LATTICE_PROPERTIES (x64 16 / x86 8 バイト)
typedef struct RECO_LATTICE_PROPERTIES {
DWORD cProperties;
RECO_LATTICE_PROPERTY** apProps;
} RECO_LATTICE_PROPERTIES;
// RECO_LATTICE_ELEMENT (x64 40 / x86 28 バイト)
typedef struct RECO_LATTICE_ELEMENT {
INT score;
WORD type;
BYTE* pData;
DWORD ulNextColumn;
DWORD ulStrokeNumber;
RECO_LATTICE_PROPERTIES epProp;
} RECO_LATTICE_ELEMENT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECO_LATTICE_PROPERTIES
{
public uint cProperties;
public IntPtr apProps;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECO_LATTICE_ELEMENT
{
public int score;
public ushort type;
public IntPtr pData;
public uint ulNextColumn;
public uint ulStrokeNumber;
public RECO_LATTICE_PROPERTIES epProp;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECO_LATTICE_PROPERTIES
Public cProperties As UInteger
Public apProps As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECO_LATTICE_ELEMENT
Public score As Integer
Public type As UShort
Public pData As IntPtr
Public ulNextColumn As UInteger
Public ulStrokeNumber As UInteger
Public epProp As RECO_LATTICE_PROPERTIES
End Structureimport ctypes
from ctypes import wintypes
class RECO_LATTICE_PROPERTIES(ctypes.Structure):
_fields_ = [
("cProperties", wintypes.DWORD),
("apProps", ctypes.c_void_p),
]
class RECO_LATTICE_ELEMENT(ctypes.Structure):
_fields_ = [
("score", ctypes.c_int),
("type", ctypes.c_ushort),
("pData", ctypes.c_void_p),
("ulNextColumn", wintypes.DWORD),
("ulStrokeNumber", wintypes.DWORD),
("epProp", RECO_LATTICE_PROPERTIES),
]#[repr(C)]
pub struct RECO_LATTICE_PROPERTIES {
pub cProperties: u32,
pub apProps: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct RECO_LATTICE_ELEMENT {
pub score: i32,
pub type: u16,
pub pData: *mut core::ffi::c_void,
pub ulNextColumn: u32,
pub ulStrokeNumber: u32,
pub epProp: RECO_LATTICE_PROPERTIES,
}import "golang.org/x/sys/windows"
type RECO_LATTICE_PROPERTIES struct {
cProperties uint32
apProps uintptr
}
type RECO_LATTICE_ELEMENT struct {
score int32
type uint16
pData uintptr
ulNextColumn uint32
ulStrokeNumber uint32
epProp RECO_LATTICE_PROPERTIES
}type
RECO_LATTICE_PROPERTIES = record
cProperties: DWORD;
apProps: Pointer;
end;
RECO_LATTICE_ELEMENT = record
score: Integer;
type: Word;
pData: Pointer;
ulNextColumn: DWORD;
ulStrokeNumber: DWORD;
epProp: RECO_LATTICE_PROPERTIES;
end;const RECO_LATTICE_PROPERTIES = extern struct {
cProperties: u32,
apProps: ?*anyopaque,
};
const RECO_LATTICE_ELEMENT = extern struct {
score: i32,
type: u16,
pData: ?*anyopaque,
ulNextColumn: u32,
ulStrokeNumber: u32,
epProp: RECO_LATTICE_PROPERTIES,
};type
RECO_LATTICE_PROPERTIES {.bycopy.} = object
cProperties: uint32
apProps: pointer
RECO_LATTICE_ELEMENT {.bycopy.} = object
score: int32
type: uint16
pData: pointer
ulNextColumn: uint32
ulStrokeNumber: uint32
epProp: RECO_LATTICE_PROPERTIESstruct RECO_LATTICE_PROPERTIES
{
uint cProperties;
void* apProps;
}
struct RECO_LATTICE_ELEMENT
{
int score;
ushort type;
void* pData;
uint ulNextColumn;
uint ulStrokeNumber;
RECO_LATTICE_PROPERTIES epProp;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RECO_LATTICE_ELEMENT サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; score : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; type : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; pData : BYTE* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ulNextColumn : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ulStrokeNumber : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; epProp : RECO_LATTICE_PROPERTIES (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RECO_LATTICE_ELEMENT サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; score : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; type : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; pData : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ulNextColumn : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ulStrokeNumber : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; epProp : RECO_LATTICE_PROPERTIES (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECO_LATTICE_PROPERTIES
#field int cProperties
#field intptr apProps
#endstruct
#defstruct global RECO_LATTICE_ELEMENT
#field int score
#field short type
#field intptr pData
#field int ulNextColumn
#field int ulStrokeNumber
#field RECO_LATTICE_PROPERTIES epProp
#endstruct
stdim st, RECO_LATTICE_ELEMENT ; NSTRUCT 変数を確保
st->score = 100
mes "score=" + st->score