Win32 API 日本語リファレンス
ホームDevices.Display › FD_LIGATURE

FD_LIGATURE

構造体
サイズx64: 40 バイト / x86: 28 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
culThisDWORD4+0+0この構造体全体のバイトサイズ。
ulTypeDWORD4+4+4合字の種別を示す値。
cLigaturesDWORD4+8+8格納される合字定義の数。
aligLIGATURE24/16+16+12LIGATURE構造体の配列(可変長)。

各言語での定義

#include <windows.h>

// LIGATURE  (x64 24 / x86 16 バイト)
typedef struct LIGATURE {
    DWORD culSize;
    LPWSTR pwsz;
    DWORD chglyph;
    DWORD ahglyph[1];
} LIGATURE;

// FD_LIGATURE  (x64 40 / x86 28 バイト)
typedef struct FD_LIGATURE {
    DWORD culThis;
    DWORD ulType;
    DWORD cLigatures;
    LIGATURE alig[1];
} FD_LIGATURE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LIGATURE
{
    public uint culSize;
    public IntPtr pwsz;
    public uint chglyph;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] ahglyph;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FD_LIGATURE
{
    public uint culThis;
    public uint ulType;
    public uint cLigatures;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public LIGATURE[] alig;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LIGATURE
    Public culSize As UInteger
    Public pwsz As IntPtr
    Public chglyph As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public ahglyph() As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FD_LIGATURE
    Public culThis As UInteger
    Public ulType As UInteger
    Public cLigatures As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public alig() As LIGATURE
End Structure
import ctypes
from ctypes import wintypes

class LIGATURE(ctypes.Structure):
    _fields_ = [
        ("culSize", wintypes.DWORD),
        ("pwsz", ctypes.c_void_p),
        ("chglyph", wintypes.DWORD),
        ("ahglyph", wintypes.DWORD * 1),
    ]

class FD_LIGATURE(ctypes.Structure):
    _fields_ = [
        ("culThis", wintypes.DWORD),
        ("ulType", wintypes.DWORD),
        ("cLigatures", wintypes.DWORD),
        ("alig", LIGATURE * 1),
    ]
#[repr(C)]
pub struct LIGATURE {
    pub culSize: u32,
    pub pwsz: *mut core::ffi::c_void,
    pub chglyph: u32,
    pub ahglyph: [u32; 1],
}

#[repr(C)]
pub struct FD_LIGATURE {
    pub culThis: u32,
    pub ulType: u32,
    pub cLigatures: u32,
    pub alig: [LIGATURE; 1],
}
import "golang.org/x/sys/windows"

type LIGATURE struct {
	culSize uint32
	pwsz uintptr
	chglyph uint32
	ahglyph [1]uint32
}

type FD_LIGATURE struct {
	culThis uint32
	ulType uint32
	cLigatures uint32
	alig [1]LIGATURE
}
type
  LIGATURE = record
    culSize: DWORD;
    pwsz: Pointer;
    chglyph: DWORD;
    ahglyph: array[0..0] of DWORD;
  end;

  FD_LIGATURE = record
    culThis: DWORD;
    ulType: DWORD;
    cLigatures: DWORD;
    alig: array[0..0] of LIGATURE;
  end;
const LIGATURE = extern struct {
    culSize: u32,
    pwsz: ?*anyopaque,
    chglyph: u32,
    ahglyph: [1]u32,
};

const FD_LIGATURE = extern struct {
    culThis: u32,
    ulType: u32,
    cLigatures: u32,
    alig: [1]LIGATURE,
};
type
  LIGATURE {.bycopy.} = object
    culSize: uint32
    pwsz: pointer
    chglyph: uint32
    ahglyph: array[1, uint32]

  FD_LIGATURE {.bycopy.} = object
    culThis: uint32
    ulType: uint32
    cLigatures: uint32
    alig: array[1, LIGATURE]
struct LIGATURE
{
    uint culSize;
    void* pwsz;
    uint chglyph;
    uint[1] ahglyph;
}

struct FD_LIGATURE
{
    uint culThis;
    uint ulType;
    uint cLigatures;
    LIGATURE[1] alig;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FD_LIGATURE サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; culThis : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulType : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cLigatures : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; alig : LIGATURE (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FD_LIGATURE サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; culThis : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulType : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cLigatures : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; alig : LIGATURE (+16, 24byte)  varptr(st)+16 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global LIGATURE
    #field int culSize
    #field intptr pwsz
    #field int chglyph
    #field int ahglyph 1
#endstruct

#defstruct global FD_LIGATURE
    #field int culThis
    #field int ulType
    #field int cLigatures
    #field LIGATURE alig 1
#endstruct

stdim st, FD_LIGATURE        ; NSTRUCT 変数を確保
st->culThis = 100
mes "culThis=" + st->culThis