ホーム › Devices.Display › EngLineTo
EngLineTo
関数サーフェス上に直線を描画する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL EngLineTo(
SURFOBJ* pso,
CLIPOBJ* pco,
BRUSHOBJ* pbo,
INT x1,
INT y1,
INT x2,
INT y2,
RECTL* prclBounds,
DWORD mix
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pso | SURFOBJ* | inout | 描画対象のサーフェスを記述する SURFOBJ 構造体へのポインターです。 |
| pco | CLIPOBJ* | inout | レンダリングを行うクリップ領域を定義する CLIPOBJ 構造体へのポインターです。このクリップ領域の外側のピクセルは影響を受けません。 |
| pbo | BRUSHOBJ* | inout | ラインの描画に使用するブラシを指定する BRUSHOBJ 構造体へのポインターです。 |
| x1 | INT | in | ラインの始点の整数 x 座標を指定します。 |
| y1 | INT | in | ラインの始点の整数 y 座標を指定します。 |
| x2 | INT | in | ラインの終点の整数 x 座標を指定します。 |
| y2 | INT | in | ラインの終点の整数 x 座標および y 座標を指定します。 |
| prclBounds | RECTL* | inout | クリップされていないラインを囲む四角形を記述する RECTL 構造体へのポインターです。ハードウェアによるライン描画をサポートするドライバーは、この四角形を使用して、ラインがハードウェアでレンダリング可能なほど十分小さい座標空間に収まるかどうかを迅速に判断できます。 |
| mix | DWORD | in | 入力されるパターンをデバイスサーフェス上に既に存在するデータとどのように混合するかを定義します。下位バイトはラスター演算を定義します。ラスター演算コードの詳細については、Microsoft Windows SDK のドキュメントを参照してください。 |
戻り値の型: BOOL
公式ドキュメント
EngLineTo 関数は、整数座標のみを使用する単一の実線コスメティックラインを描画します。
戻り値
EngLineTo は、成功した場合は TRUE を返します。それ以外の場合は FALSE を返します。
解説(Remarks)
DrvLineTo をフックしたドライバーは、レンダリングサーフェスがデバイス非依存ビットマップ (DIB) である場合に EngLineTo を呼び出すことができます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL EngLineTo(
SURFOBJ* pso,
CLIPOBJ* pco,
BRUSHOBJ* pbo,
INT x1,
INT y1,
INT x2,
INT y2,
RECTL* prclBounds,
DWORD mix
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool EngLineTo(
IntPtr pso, // SURFOBJ* in/out
IntPtr pco, // CLIPOBJ* in/out
IntPtr pbo, // BRUSHOBJ* in/out
int x1, // INT
int y1, // INT
int x2, // INT
int y2, // INT
IntPtr prclBounds, // RECTL* in/out
uint mix // DWORD
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function EngLineTo(
pso As IntPtr, ' SURFOBJ* in/out
pco As IntPtr, ' CLIPOBJ* in/out
pbo As IntPtr, ' BRUSHOBJ* in/out
x1 As Integer, ' INT
y1 As Integer, ' INT
x2 As Integer, ' INT
y2 As Integer, ' INT
prclBounds As IntPtr, ' RECTL* in/out
mix As UInteger ' DWORD
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' pso : SURFOBJ* in/out
' pco : CLIPOBJ* in/out
' pbo : BRUSHOBJ* in/out
' x1 : INT
' y1 : INT
' x2 : INT
' y2 : INT
' prclBounds : RECTL* in/out
' mix : DWORD
Declare PtrSafe Function EngLineTo Lib "gdi32" ( _
ByVal pso As LongPtr, _
ByVal pco As LongPtr, _
ByVal pbo As LongPtr, _
ByVal x1 As Long, _
ByVal y1 As Long, _
ByVal x2 As Long, _
ByVal y2 As Long, _
ByVal prclBounds As LongPtr, _
ByVal mix As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
EngLineTo = ctypes.windll.gdi32.EngLineTo
EngLineTo.restype = wintypes.BOOL
EngLineTo.argtypes = [
ctypes.c_void_p, # pso : SURFOBJ* in/out
ctypes.c_void_p, # pco : CLIPOBJ* in/out
ctypes.c_void_p, # pbo : BRUSHOBJ* in/out
ctypes.c_int, # x1 : INT
ctypes.c_int, # y1 : INT
ctypes.c_int, # x2 : INT
ctypes.c_int, # y2 : INT
ctypes.c_void_p, # prclBounds : RECTL* in/out
wintypes.DWORD, # mix : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
EngLineTo = Fiddle::Function.new(
lib['EngLineTo'],
[
Fiddle::TYPE_VOIDP, # pso : SURFOBJ* in/out
Fiddle::TYPE_VOIDP, # pco : CLIPOBJ* in/out
Fiddle::TYPE_VOIDP, # pbo : BRUSHOBJ* in/out
Fiddle::TYPE_INT, # x1 : INT
Fiddle::TYPE_INT, # y1 : INT
Fiddle::TYPE_INT, # x2 : INT
Fiddle::TYPE_INT, # y2 : INT
Fiddle::TYPE_VOIDP, # prclBounds : RECTL* in/out
-Fiddle::TYPE_INT, # mix : DWORD
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn EngLineTo(
pso: *mut SURFOBJ, // SURFOBJ* in/out
pco: *mut CLIPOBJ, // CLIPOBJ* in/out
pbo: *mut BRUSHOBJ, // BRUSHOBJ* in/out
x1: i32, // INT
y1: i32, // INT
x2: i32, // INT
y2: i32, // INT
prclBounds: *mut RECTL, // RECTL* in/out
mix: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool EngLineTo(IntPtr pso, IntPtr pco, IntPtr pbo, int x1, int y1, int x2, int y2, IntPtr prclBounds, uint mix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_EngLineTo' -Namespace Win32 -PassThru
# $api::EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)#uselib "GDI32.dll"
#func global EngLineTo "EngLineTo" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; EngLineTo varptr(pso), varptr(pco), varptr(pbo), x1, y1, x2, y2, varptr(prclBounds), mix ; 戻り値は stat
; pso : SURFOBJ* in/out -> "sptr"
; pco : CLIPOBJ* in/out -> "sptr"
; pbo : BRUSHOBJ* in/out -> "sptr"
; x1 : INT -> "sptr"
; y1 : INT -> "sptr"
; x2 : INT -> "sptr"
; y2 : INT -> "sptr"
; prclBounds : RECTL* in/out -> "sptr"
; mix : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global EngLineTo "EngLineTo" var, var, var, int, int, int, int, var, int ; res = EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix) ; pso : SURFOBJ* in/out -> "var" ; pco : CLIPOBJ* in/out -> "var" ; pbo : BRUSHOBJ* in/out -> "var" ; x1 : INT -> "int" ; y1 : INT -> "int" ; x2 : INT -> "int" ; y2 : INT -> "int" ; prclBounds : RECTL* in/out -> "var" ; mix : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global EngLineTo "EngLineTo" sptr, sptr, sptr, int, int, int, int, sptr, int ; res = EngLineTo(varptr(pso), varptr(pco), varptr(pbo), x1, y1, x2, y2, varptr(prclBounds), mix) ; pso : SURFOBJ* in/out -> "sptr" ; pco : CLIPOBJ* in/out -> "sptr" ; pbo : BRUSHOBJ* in/out -> "sptr" ; x1 : INT -> "int" ; y1 : INT -> "int" ; x2 : INT -> "int" ; y2 : INT -> "int" ; prclBounds : RECTL* in/out -> "sptr" ; mix : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL EngLineTo(SURFOBJ* pso, CLIPOBJ* pco, BRUSHOBJ* pbo, INT x1, INT y1, INT x2, INT y2, RECTL* prclBounds, DWORD mix) #uselib "GDI32.dll" #cfunc global EngLineTo "EngLineTo" var, var, var, int, int, int, int, var, int ; res = EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix) ; pso : SURFOBJ* in/out -> "var" ; pco : CLIPOBJ* in/out -> "var" ; pbo : BRUSHOBJ* in/out -> "var" ; x1 : INT -> "int" ; y1 : INT -> "int" ; x2 : INT -> "int" ; y2 : INT -> "int" ; prclBounds : RECTL* in/out -> "var" ; mix : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL EngLineTo(SURFOBJ* pso, CLIPOBJ* pco, BRUSHOBJ* pbo, INT x1, INT y1, INT x2, INT y2, RECTL* prclBounds, DWORD mix) #uselib "GDI32.dll" #cfunc global EngLineTo "EngLineTo" intptr, intptr, intptr, int, int, int, int, intptr, int ; res = EngLineTo(varptr(pso), varptr(pco), varptr(pbo), x1, y1, x2, y2, varptr(prclBounds), mix) ; pso : SURFOBJ* in/out -> "intptr" ; pco : CLIPOBJ* in/out -> "intptr" ; pbo : BRUSHOBJ* in/out -> "intptr" ; x1 : INT -> "int" ; y1 : INT -> "int" ; x2 : INT -> "int" ; y2 : INT -> "int" ; prclBounds : RECTL* in/out -> "intptr" ; mix : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procEngLineTo = gdi32.NewProc("EngLineTo")
)
// pso (SURFOBJ* in/out), pco (CLIPOBJ* in/out), pbo (BRUSHOBJ* in/out), x1 (INT), y1 (INT), x2 (INT), y2 (INT), prclBounds (RECTL* in/out), mix (DWORD)
r1, _, err := procEngLineTo.Call(
uintptr(pso),
uintptr(pco),
uintptr(pbo),
uintptr(x1),
uintptr(y1),
uintptr(x2),
uintptr(y2),
uintptr(prclBounds),
uintptr(mix),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction EngLineTo(
pso: Pointer; // SURFOBJ* in/out
pco: Pointer; // CLIPOBJ* in/out
pbo: Pointer; // BRUSHOBJ* in/out
x1: Integer; // INT
y1: Integer; // INT
x2: Integer; // INT
y2: Integer; // INT
prclBounds: Pointer; // RECTL* in/out
mix: DWORD // DWORD
): BOOL; stdcall;
external 'GDI32.dll' name 'EngLineTo';result := DllCall("GDI32\EngLineTo"
, "Ptr", pso ; SURFOBJ* in/out
, "Ptr", pco ; CLIPOBJ* in/out
, "Ptr", pbo ; BRUSHOBJ* in/out
, "Int", x1 ; INT
, "Int", y1 ; INT
, "Int", x2 ; INT
, "Int", y2 ; INT
, "Ptr", prclBounds ; RECTL* in/out
, "UInt", mix ; DWORD
, "Int") ; return: BOOL●EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix) = DLL("GDI32.dll", "bool EngLineTo(void*, void*, void*, int, int, int, int, void*, dword)")
# 呼び出し: EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)
# pso : SURFOBJ* in/out -> "void*"
# pco : CLIPOBJ* in/out -> "void*"
# pbo : BRUSHOBJ* in/out -> "void*"
# x1 : INT -> "int"
# y1 : INT -> "int"
# x2 : INT -> "int"
# y2 : INT -> "int"
# prclBounds : RECTL* in/out -> "void*"
# mix : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "gdi32" fn EngLineTo(
pso: [*c]SURFOBJ, // SURFOBJ* in/out
pco: [*c]CLIPOBJ, // CLIPOBJ* in/out
pbo: [*c]BRUSHOBJ, // BRUSHOBJ* in/out
x1: i32, // INT
y1: i32, // INT
x2: i32, // INT
y2: i32, // INT
prclBounds: [*c]RECTL, // RECTL* in/out
mix: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;proc EngLineTo(
pso: ptr SURFOBJ, # SURFOBJ* in/out
pco: ptr CLIPOBJ, # CLIPOBJ* in/out
pbo: ptr BRUSHOBJ, # BRUSHOBJ* in/out
x1: int32, # INT
y1: int32, # INT
x2: int32, # INT
y2: int32, # INT
prclBounds: ptr RECTL, # RECTL* in/out
mix: uint32 # DWORD
): int32 {.importc: "EngLineTo", stdcall, dynlib: "GDI32.dll".}pragma(lib, "gdi32");
extern(Windows)
int EngLineTo(
SURFOBJ* pso, // SURFOBJ* in/out
CLIPOBJ* pco, // CLIPOBJ* in/out
BRUSHOBJ* pbo, // BRUSHOBJ* in/out
int x1, // INT
int y1, // INT
int x2, // INT
int y2, // INT
RECTL* prclBounds, // RECTL* in/out
uint mix // DWORD
);ccall((:EngLineTo, "GDI32.dll"), stdcall, Int32,
(Ptr{SURFOBJ}, Ptr{CLIPOBJ}, Ptr{BRUSHOBJ}, Int32, Int32, Int32, Int32, Ptr{RECTL}, UInt32),
pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)
# pso : SURFOBJ* in/out -> Ptr{SURFOBJ}
# pco : CLIPOBJ* in/out -> Ptr{CLIPOBJ}
# pbo : BRUSHOBJ* in/out -> Ptr{BRUSHOBJ}
# x1 : INT -> Int32
# y1 : INT -> Int32
# x2 : INT -> Int32
# y2 : INT -> Int32
# prclBounds : RECTL* in/out -> Ptr{RECTL}
# mix : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t EngLineTo(
void* pso,
void* pco,
void* pbo,
int32_t x1,
int32_t y1,
int32_t x2,
int32_t y2,
void* prclBounds,
uint32_t mix);
]]
local gdi32 = ffi.load("gdi32")
-- gdi32.EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)
-- pso : SURFOBJ* in/out
-- pco : CLIPOBJ* in/out
-- pbo : BRUSHOBJ* in/out
-- x1 : INT
-- y1 : INT
-- x2 : INT
-- y2 : INT
-- prclBounds : RECTL* in/out
-- mix : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('GDI32.dll');
const EngLineTo = lib.func('__stdcall', 'EngLineTo', 'int32_t', ['void *', 'void *', 'void *', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'void *', 'uint32_t']);
// EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)
// pso : SURFOBJ* in/out -> 'void *'
// pco : CLIPOBJ* in/out -> 'void *'
// pbo : BRUSHOBJ* in/out -> 'void *'
// x1 : INT -> 'int32_t'
// y1 : INT -> 'int32_t'
// x2 : INT -> 'int32_t'
// y2 : INT -> 'int32_t'
// prclBounds : RECTL* in/out -> 'void *'
// mix : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("GDI32.dll", {
EngLineTo: { parameters: ["pointer", "pointer", "pointer", "i32", "i32", "i32", "i32", "pointer", "u32"], result: "i32" },
});
// lib.symbols.EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix)
// pso : SURFOBJ* in/out -> "pointer"
// pco : CLIPOBJ* in/out -> "pointer"
// pbo : BRUSHOBJ* in/out -> "pointer"
// x1 : INT -> "i32"
// y1 : INT -> "i32"
// x2 : INT -> "i32"
// y2 : INT -> "i32"
// prclBounds : RECTL* in/out -> "pointer"
// mix : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t EngLineTo(
void* pso,
void* pco,
void* pbo,
int32_t x1,
int32_t y1,
int32_t x2,
int32_t y2,
void* prclBounds,
uint32_t mix);
C, "GDI32.dll");
// $ffi->EngLineTo(pso, pco, pbo, x1, y1, x2, y2, prclBounds, mix);
// pso : SURFOBJ* in/out
// pco : CLIPOBJ* in/out
// pbo : BRUSHOBJ* in/out
// x1 : INT
// y1 : INT
// x2 : INT
// y2 : INT
// prclBounds : RECTL* in/out
// mix : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Gdi32 extends StdCallLibrary {
Gdi32 INSTANCE = Native.load("gdi32", Gdi32.class);
boolean EngLineTo(
Pointer pso, // SURFOBJ* in/out
Pointer pco, // CLIPOBJ* in/out
Pointer pbo, // BRUSHOBJ* in/out
int x1, // INT
int y1, // INT
int x2, // INT
int y2, // INT
Pointer prclBounds, // RECTL* in/out
int mix // DWORD
);
}@[Link("gdi32")]
lib LibGDI32
fun EngLineTo = EngLineTo(
pso : SURFOBJ*, # SURFOBJ* in/out
pco : CLIPOBJ*, # CLIPOBJ* in/out
pbo : BRUSHOBJ*, # BRUSHOBJ* in/out
x1 : Int32, # INT
y1 : Int32, # INT
x2 : Int32, # INT
y2 : Int32, # INT
prclBounds : RECTL*, # RECTL* in/out
mix : UInt32 # DWORD
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef EngLineToNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Int32, Int32, Int32, Int32, Pointer<Void>, Uint32);
typedef EngLineToDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, int, int, int, int, Pointer<Void>, int);
final EngLineTo = DynamicLibrary.open('GDI32.dll')
.lookupFunction<EngLineToNative, EngLineToDart>('EngLineTo');
// pso : SURFOBJ* in/out -> Pointer<Void>
// pco : CLIPOBJ* in/out -> Pointer<Void>
// pbo : BRUSHOBJ* in/out -> Pointer<Void>
// x1 : INT -> Int32
// y1 : INT -> Int32
// x2 : INT -> Int32
// y2 : INT -> Int32
// prclBounds : RECTL* in/out -> Pointer<Void>
// mix : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function EngLineTo(
pso: Pointer; // SURFOBJ* in/out
pco: Pointer; // CLIPOBJ* in/out
pbo: Pointer; // BRUSHOBJ* in/out
x1: Integer; // INT
y1: Integer; // INT
x2: Integer; // INT
y2: Integer; // INT
prclBounds: Pointer; // RECTL* in/out
mix: DWORD // DWORD
): BOOL; stdcall;
external 'GDI32.dll' name 'EngLineTo';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "EngLineTo"
c_EngLineTo :: Ptr () -> Ptr () -> Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> Word32 -> IO CInt
-- pso : SURFOBJ* in/out -> Ptr ()
-- pco : CLIPOBJ* in/out -> Ptr ()
-- pbo : BRUSHOBJ* in/out -> Ptr ()
-- x1 : INT -> Int32
-- y1 : INT -> Int32
-- x2 : INT -> Int32
-- y2 : INT -> Int32
-- prclBounds : RECTL* in/out -> Ptr ()
-- mix : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let englineto =
foreign "EngLineTo"
((ptr void) @-> (ptr void) @-> (ptr void) @-> int32_t @-> int32_t @-> int32_t @-> int32_t @-> (ptr void) @-> uint32_t @-> returning int32_t)
(* pso : SURFOBJ* in/out -> (ptr void) *)
(* pco : CLIPOBJ* in/out -> (ptr void) *)
(* pbo : BRUSHOBJ* in/out -> (ptr void) *)
(* x1 : INT -> int32_t *)
(* y1 : INT -> int32_t *)
(* x2 : INT -> int32_t *)
(* y2 : INT -> int32_t *)
(* prclBounds : RECTL* in/out -> (ptr void) *)
(* mix : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library gdi32 (t "GDI32.dll"))
(cffi:use-foreign-library gdi32)
(cffi:defcfun ("EngLineTo" eng-line-to :convention :stdcall) :int32
(pso :pointer) ; SURFOBJ* in/out
(pco :pointer) ; CLIPOBJ* in/out
(pbo :pointer) ; BRUSHOBJ* in/out
(x1 :int32) ; INT
(y1 :int32) ; INT
(x2 :int32) ; INT
(y2 :int32) ; INT
(prcl-bounds :pointer) ; RECTL* in/out
(mix :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $EngLineTo = Win32::API::More->new('GDI32',
'BOOL EngLineTo(LPVOID pso, LPVOID pco, LPVOID pbo, int x1, int y1, int x2, int y2, LPVOID prclBounds, DWORD mix)');
# my $ret = $EngLineTo->Call($pso, $pco, $pbo, $x1, $y1, $x2, $y2, $prclBounds, $mix);
# pso : SURFOBJ* in/out -> LPVOID
# pco : CLIPOBJ* in/out -> LPVOID
# pbo : BRUSHOBJ* in/out -> LPVOID
# x1 : INT -> int
# y1 : INT -> int
# x2 : INT -> int
# y2 : INT -> int
# prclBounds : RECTL* in/out -> LPVOID
# mix : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。