ホーム › Devices.Display › CLIPOBJ
CLIPOBJ
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| iUniq | DWORD | 4 | +0 | +0 | クリップ領域の一意識別番号。キャッシュ判定に使う。 |
| rclBounds | RECTL | 16 | +4 | +4 | クリップ領域の外接矩形(RECTL)。 |
| iDComplexity | BYTE | 1 | +20 | +20 | デバイス座標でのクリップ複雑度(DC_TRIVIAL等)。 |
| iFComplexity | BYTE | 1 | +21 | +21 | 矩形数による複雑度(FC_RECT等)。 |
| iMode | BYTE | 1 | +22 | +22 | 列挙モード(TC_RECTANGLES等)。 |
| fjOptions | BYTE | 1 | +23 | +23 | クリップ列挙のオプションフラグ。 |
各言語での定義
#include <windows.h>
// RECTL (x64 16 / x86 16 バイト)
typedef struct RECTL {
INT left;
INT top;
INT right;
INT bottom;
} RECTL;
// CLIPOBJ (x64 24 / x86 24 バイト)
typedef struct CLIPOBJ {
DWORD iUniq;
RECTL rclBounds;
BYTE iDComplexity;
BYTE iFComplexity;
BYTE iMode;
BYTE fjOptions;
} CLIPOBJ;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECTL
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLIPOBJ
{
public uint iUniq;
public RECTL rclBounds;
public byte iDComplexity;
public byte iFComplexity;
public byte iMode;
public byte fjOptions;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECTL
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLIPOBJ
Public iUniq As UInteger
Public rclBounds As RECTL
Public iDComplexity As Byte
Public iFComplexity As Byte
Public iMode As Byte
Public fjOptions As Byte
End Structureimport ctypes
from ctypes import wintypes
class RECTL(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class CLIPOBJ(ctypes.Structure):
_fields_ = [
("iUniq", wintypes.DWORD),
("rclBounds", RECTL),
("iDComplexity", ctypes.c_ubyte),
("iFComplexity", ctypes.c_ubyte),
("iMode", ctypes.c_ubyte),
("fjOptions", ctypes.c_ubyte),
]#[repr(C)]
pub struct RECTL {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct CLIPOBJ {
pub iUniq: u32,
pub rclBounds: RECTL,
pub iDComplexity: u8,
pub iFComplexity: u8,
pub iMode: u8,
pub fjOptions: u8,
}import "golang.org/x/sys/windows"
type RECTL struct {
left int32
top int32
right int32
bottom int32
}
type CLIPOBJ struct {
iUniq uint32
rclBounds RECTL
iDComplexity byte
iFComplexity byte
iMode byte
fjOptions byte
}type
RECTL = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
CLIPOBJ = record
iUniq: DWORD;
rclBounds: RECTL;
iDComplexity: Byte;
iFComplexity: Byte;
iMode: Byte;
fjOptions: Byte;
end;const RECTL = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const CLIPOBJ = extern struct {
iUniq: u32,
rclBounds: RECTL,
iDComplexity: u8,
iFComplexity: u8,
iMode: u8,
fjOptions: u8,
};type
RECTL {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
CLIPOBJ {.bycopy.} = object
iUniq: uint32
rclBounds: RECTL
iDComplexity: uint8
iFComplexity: uint8
iMode: uint8
fjOptions: uint8struct RECTL
{
int left;
int top;
int right;
int bottom;
}
struct CLIPOBJ
{
uint iUniq;
RECTL rclBounds;
ubyte iDComplexity;
ubyte iFComplexity;
ubyte iMode;
ubyte fjOptions;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLIPOBJ サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; iUniq : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; rclBounds : RECTL (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; iDComplexity : BYTE (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; iFComplexity : BYTE (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; iMode : BYTE (+22, 1byte) poke st,22,値 / 値 = peek(st,22)
; fjOptions : BYTE (+23, 1byte) poke st,23,値 / 値 = peek(st,23)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECTL
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global CLIPOBJ
#field int iUniq
#field RECTL rclBounds
#field byte iDComplexity
#field byte iFComplexity
#field byte iMode
#field byte fjOptions
#endstruct
stdim st, CLIPOBJ ; NSTRUCT 変数を確保
st->iUniq = 100
mes "iUniq=" + st->iUniq