aboutsummaryrefslogtreecommitdiff
path: root/vbox.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-03 21:23:10 +0200
committerJavier <dev.git@javispedro.com>2022-04-03 21:23:10 +0200
commita5abb118e0e61587adfa7b4e4cc72948311381d3 (patch)
treeb226705401bd0b4c78399c621cebc1fbab6003b9 /vbox.h
parent7d93442564b57c2d292df7f823c2115d3e0b8c12 (diff)
downloadvbados-a5abb118e0e61587adfa7b4e4cc72948311381d3.tar.gz
vbados-a5abb118e0e61587adfa7b4e4cc72948311381d3.zip
try to handle graphical cursor rendering in a more generic way
Diffstat (limited to 'vbox.h')
-rw-r--r--vbox.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/vbox.h b/vbox.h
index 69721aa..a4ad727 100644
--- a/vbox.h
+++ b/vbox.h
@@ -145,4 +145,13 @@ static int vbox_set_pointer_visible(LPVBOXCOMM vb, bool visible)
return req->header.rc;
}
+/** Computes size of a VMMDevReqMousePointer message. */
+static inline unsigned vbox_req_mouse_pointer_size(unsigned width, unsigned height)
+{
+ const unsigned and_mask_size = (width + 7) / 8 * height;
+ const unsigned xor_mask_size = width * height * 4;
+ const unsigned data_size = and_mask_size + xor_mask_size;
+ return MAX(sizeof(VMMDevReqMousePointer), 24 + 20 + data_size);
+}
+
#endif