+guac_composite_mode guac_rdp_rop3_composite_mode(guac_client* client,
+ int rop3) {
+
+ /* Translate supported ROP3 opcodes into composite modes */
+ switch (rop3) {
+
+ /* "SRCINVERT" (src ^ dest) */
+ case 0x66: return GUAC_COMP_BINARY_XOR;
+
+ /* "SRCAND" (src & dest) */
+ case 0x88: return GUAC_COMP_BINARY_AND;
+
+ /* "MERGEPAINT" !(src | dest)*/
+ case 0xBB: return GUAC_COMP_BINARY_NOR;
+
+ /* "SRCCOPY" (src) */
+ case 0xCC: return GUAC_COMP_OVER;
+
+ /* "SRCPAINT" (src | dest) */
+ case 0xEE: return GUAC_COMP_BINARY_OR;
+
+ }
+
+ /* Log warning if ROP3 opcode not supported */
+ guac_client_log_info (client, "guac_rdp_rop3_composite_mode: UNSUPPORTED opcode = 0x%02X", rop3);
+ return GUAC_COMP_OVER;
+
+}
+