XCB に問題があります。*_reply_t
対*_request_t
タイプの違いがわかりません。
*_reply_t
の代わりに が渡されているように見えますが*_response_t
、構造は大きく異なります。
例えば:
xcb_randr_get_screen_resources_current_reply_t *reply = xcb_randr_get_screen_resources_current_reply(
connection, xcb_randr_get_screen_resources_current(connection, root), NULL);
だから今reply
はのタイプです*_reply_t
。しかし今、私は最初の引数がここのドキュメントに従ってxcb_randr_get_screen_resources_current_outputs
型であることを期待するものを使用する必要があります:xcb_randr_get_screen_resources_current_request_t
http://www.linuxhowtos.org/manpages/3/xcb_randr_get_screen_resources_current_outputs.htm
xcb_randr_output_t *xcb_randr_get_screen_resources_current_outputs(
const xcb_randr_get_screen_resources_current_request_t *reply
);
ただし、最初の呼び出しからの応答のタイプはxcb_randr_get_screen_resources_current_reply_t
( *_reply_t
) です。これをキャストせずに出力呼び出しに渡すにはどうすればよいですか? ドキュメントごとに構造が完全に異なります。
typedef struct xcb_randr_get_screen_resources_current_reply_t {
uint8_t response_type;
uint8_t pad0;
uint16_t sequence;
uint32_t length;
xcb_timestamp_t timestamp;
xcb_timestamp_t config_timestamp;
uint16_t num_crtcs;
uint16_t num_outputs;
uint16_t num_modes;
uint16_t names_len;
uint8_t pad1[8];
} xcb_randr_get_screen_resources_current_reply_t;
そして、の構造体*_request_t
はドキュメントにはありません。ここのソースコードから取得しました:
https://xcb.freedesktop.org/manual/randr_8h_source.html#l00896
typedef struct xcb_randr_get_screen_resources_current_request_t {
uint8_t major_opcode;
uint8_t minor_opcode;
uint16_t length;
xcb_window_t window;
} xcb_randr_get_screen_resources_current_request_t;
私は ctypes を行うので、メソッドの署名のために事前に渡すタイプを宣言する必要があります。reply
そのため、まったく異なる構造 ( ) の何かが、 の構造を持つ 2 番目の呼び出しにどのように入るのかについて、私は非常に混乱していrequest
ます。