Win32 API 日本語リファレンス
ホームGraphics.Gdi › AXESLISTA

AXESLISTA

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

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

フィールド

フィールドサイズx64x86説明
axlReservedDWORD4+0+0予約済みです。STAMP_AXESLIST でなければなりません。
axlNumAxesDWORD4+4+4指定されたマルチプルマスターフォントの軸の数です。
axlAxisInfoAXISINFOA384+8+8AXISINFO 構造体の配列です。各 AXISINFO 構造体には、指定されたマルチプルマスターフォントの 1 つの軸に関する情報が格納されます。これは、DESIGNVECTOR 構造体の dvValues 配列に対応します。

公式ドキュメント

AXESLIST 構造体には、マルチプルマスターフォントのすべての軸に関する情報が格納されます。

解説(Remarks)

PostScript Open Type フォントは、マルチプルマスター機能をサポートしていません。

マルチプルマスターフォントの軸に関する情報は、AXISINFO 構造体によって指定されます。axlNumAxes メンバーは axlAxisInfo の実際のサイズを指定します。一方、MM_MAX_NUMAXES (値は 16) は axlAxisInfo に許容される最大サイズです。

メモ

wingdi.h ヘッダーは、UNICODE プリプロセッサ定数の定義に基づいてこの関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして AXESLIST を定義します。エンコーディングに依存しないエイリアスの使用と、エンコーディングに依存するコードを混在させると、不一致が生じ、コンパイルエラーや実行時エラーの原因となることがあります。詳細については、関数プロトタイプの規則を参照してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// AXISINFOA  (x64 24 / x86 24 バイト)
typedef struct AXISINFOA {
    INT axMinValue;
    INT axMaxValue;
    BYTE axAxisName[16];
} AXISINFOA;

// AXESLISTA  (x64 392 / x86 392 バイト)
typedef struct AXESLISTA {
    DWORD axlReserved;
    DWORD axlNumAxes;
    AXISINFOA axlAxisInfo[16];
} AXESLISTA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AXISINFOA
{
    public int axMinValue;
    public int axMaxValue;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] axAxisName;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AXESLISTA
{
    public uint axlReserved;
    public uint axlNumAxes;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public AXISINFOA[] axlAxisInfo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AXISINFOA
    Public axMinValue As Integer
    Public axMaxValue As Integer
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public axAxisName() As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AXESLISTA
    Public axlReserved As UInteger
    Public axlNumAxes As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public axlAxisInfo() As AXISINFOA
End Structure
import ctypes
from ctypes import wintypes

class AXISINFOA(ctypes.Structure):
    _fields_ = [
        ("axMinValue", ctypes.c_int),
        ("axMaxValue", ctypes.c_int),
        ("axAxisName", ctypes.c_ubyte * 16),
    ]

class AXESLISTA(ctypes.Structure):
    _fields_ = [
        ("axlReserved", wintypes.DWORD),
        ("axlNumAxes", wintypes.DWORD),
        ("axlAxisInfo", AXISINFOA * 16),
    ]
#[repr(C)]
pub struct AXISINFOA {
    pub axMinValue: i32,
    pub axMaxValue: i32,
    pub axAxisName: [u8; 16],
}

#[repr(C)]
pub struct AXESLISTA {
    pub axlReserved: u32,
    pub axlNumAxes: u32,
    pub axlAxisInfo: [AXISINFOA; 16],
}
import "golang.org/x/sys/windows"

type AXISINFOA struct {
	axMinValue int32
	axMaxValue int32
	axAxisName [16]byte
}

type AXESLISTA struct {
	axlReserved uint32
	axlNumAxes uint32
	axlAxisInfo [16]AXISINFOA
}
type
  AXISINFOA = record
    axMinValue: Integer;
    axMaxValue: Integer;
    axAxisName: array[0..15] of Byte;
  end;

  AXESLISTA = record
    axlReserved: DWORD;
    axlNumAxes: DWORD;
    axlAxisInfo: array[0..15] of AXISINFOA;
  end;
const AXISINFOA = extern struct {
    axMinValue: i32,
    axMaxValue: i32,
    axAxisName: [16]u8,
};

const AXESLISTA = extern struct {
    axlReserved: u32,
    axlNumAxes: u32,
    axlAxisInfo: [16]AXISINFOA,
};
type
  AXISINFOA {.bycopy.} = object
    axMinValue: int32
    axMaxValue: int32
    axAxisName: array[16, uint8]

  AXESLISTA {.bycopy.} = object
    axlReserved: uint32
    axlNumAxes: uint32
    axlAxisInfo: array[16, AXISINFOA]
struct AXISINFOA
{
    int axMinValue;
    int axMaxValue;
    ubyte[16] axAxisName;
}

struct AXESLISTA
{
    uint axlReserved;
    uint axlNumAxes;
    AXISINFOA[16] axlAxisInfo;
}

HSP用 定義

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

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

#defstruct global AXESLISTA
    #field int axlReserved
    #field int axlNumAxes
    #field AXISINFOA axlAxisInfo 16
#endstruct

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