Changeset 106753 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 28, 2024 2:23:51 PM (3 months ago)
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/wayland-helper.h
r106061 r106753 137 137 138 138 /** 139 * Wayland Desktop Environment helper clipboard operations. 140 */ 141 typedef struct 142 { 143 144 /** 145 * Initialization callback. 146 * 147 * @returns IPRT status code. 148 */ 149 DECLCALLBACKMEMBER(int, pfnInit, (void)); 150 151 /** 152 * Termination callback. 153 * 154 * @returns IPRT status code. 155 */ 156 DECLCALLBACKMEMBER(int, pfnTerm, (void)); 157 158 /** 159 * Callback to set host clipboard connection handle. 160 * 161 * @param pCtx Host service connection context. 162 */ 163 DECLCALLBACKMEMBER(void, pfnSetClipboardCtx, (PVBGLR3SHCLCMDCTX pCtx)); 164 165 /** 166 * Callback to force guest to announce its clipboard content. 167 * 168 * @returns IPRT status code. 169 */ 170 DECLCALLBACKMEMBER(int, pfnPopup, (void)); 171 172 /** A callback to notify guest about new content in host clipboard. */ 173 PFNHOSTCLIPREPORTFMTS pfnHGClipReport; 174 175 /** Callback to notify guest that host wants to read clipboard data in specified format. */ 176 PFNHOSTCLIPREAD pfnGHClipRead; 177 178 } VBCLWAYLANDHELPER_CLIPBOARD; 179 180 /** 181 * Wayland Desktop Environment helper DnD operations. 182 */ 183 typedef struct 184 { 185 186 /** 187 * Initialization callback. 188 * 189 * @returns IPRT status code. 190 */ 191 DECLCALLBACKMEMBER(int, pfnInit, (void)); 192 193 /** 194 * Termination callback. 195 * 196 * @returns IPRT status code. 197 */ 198 DECLCALLBACKMEMBER(int, pfnTerm, (void)); 199 200 } VBCLWAYLANDHELPER_DND; 201 202 /** 139 203 * Wayland Desktop Environment helper definition structure. 140 204 */ … … 150 214 * which is compatible with the helper. 151 215 * 152 * @returns Helper capabilities bitmask as described by VBOX_WAYLAND_HELPER_CAP_XXX.216 * @returns Helper capabilities bitmask as described by VBOX_WAYLAND_HELPER_CAP_XXX. 153 217 */ 154 218 DECLCALLBACKMEMBER(int, pfnProbe, (void)); 155 219 156 /** 157 * Initialization callback. 158 * 159 * @returns IPRT status code. 160 */ 161 DECLCALLBACKMEMBER(int, pfnInit, (void)); 162 163 /** 164 * Termination callback. 165 * 166 * @returns IPRT status code. 167 */ 168 DECLCALLBACKMEMBER(int, pfnTerm, (void)); 169 170 /** 171 * Callback to set host clipboard connection handle. 172 * 173 * @param pCtx Host service connection context. 174 */ 175 DECLCALLBACKMEMBER(void, pfnSetClipboardCtx, (PVBGLR3SHCLCMDCTX pCtx)); 176 177 /** 178 * Callback to force guest to announce its clipboard content. 179 * 180 * @returns IPRT status code. 181 */ 182 DECLCALLBACKMEMBER(int, pfnPopup, (void)); 183 184 PFNHOSTCLIPREPORTFMTS pfnHGClipReport; 185 PFNHOSTCLIPREAD pfnGHClipRead; 220 /** Helper functions for clipboard operations. */ 221 VBCLWAYLANDHELPER_CLIPBOARD clip; 222 223 /** Helper functions for DnD operations. */ 224 VBCLWAYLANDHELPER_DND dnd; 186 225 187 226 } VBCLWAYLANDHELPER; -
trunk/src/VBox/Additions/x11/VBoxClient/wayland.cpp
r106061 r106753 85 85 { 86 86 /* Provide helper with host clipboard service connection handle. */ 87 g_pWaylandHelperClipboard-> pfnSetClipboardCtx(&ctx.CmdCtx);87 g_pWaylandHelperClipboard->clip.pfnSetClipboardCtx(&ctx.CmdCtx); 88 88 89 89 /* Process host events. */ 90 90 while (!ASMAtomicReadBool(&g_fShutdown)) 91 91 { 92 rc = VBClClipboardReadHostEvent(&ctx, g_pWaylandHelperClipboard->pfnHGClipReport, 93 g_pWaylandHelperClipboard->pfnGHClipRead); 92 rc = VBClClipboardReadHostEvent(&ctx, 93 g_pWaylandHelperClipboard->clip.pfnHGClipReport, 94 g_pWaylandHelperClipboard->clip.pfnGHClipRead); 94 95 if (RT_FAILURE(rc)) 95 96 { … … 179 180 if (RTStrNCmp(pszValue, "0", GUEST_PROP_MAX_NAME_LEN) == 0) 180 181 { 181 rc = g_pWaylandHelperClipboard-> pfnPopup();182 rc = g_pWaylandHelperClipboard->clip.pfnPopup(); 182 183 VBClLogVerbose(1, "trigger popup, rc=%Rrc\n", rc); 183 184 } … … 238 239 && !RT_VALID_PTR(g_pWaylandHelperClipboard)) 239 240 { 240 if (RT_VALID_PTR(g_apWaylandHelpers[idxHelper]-> pfnInit))241 if (RT_VALID_PTR(g_apWaylandHelpers[idxHelper]->clip.pfnInit)) 241 242 { 242 rc = g_apWaylandHelpers[idxHelper]-> pfnInit();243 rc = g_apWaylandHelpers[idxHelper]->clip.pfnInit(); 243 244 if (RT_SUCCESS(rc)) 244 245 g_pWaylandHelperClipboard = g_apWaylandHelpers[idxHelper]; … … 256 257 && !RT_VALID_PTR(g_pWaylandHelperDnd)) 257 258 { 258 if (RT_VALID_PTR(g_apWaylandHelpers[idxHelper]-> pfnInit))259 if (RT_VALID_PTR(g_apWaylandHelpers[idxHelper]->dnd.pfnInit)) 259 260 { 260 rc = g_apWaylandHelpers[idxHelper]-> pfnInit();261 rc = g_apWaylandHelpers[idxHelper]->dnd.pfnInit(); 261 262 if (RT_SUCCESS(rc)) 262 263 g_pWaylandHelperDnd = g_apWaylandHelpers[idxHelper]; … … 389 390 390 391 if ( RT_VALID_PTR(g_pWaylandHelperClipboard) 391 && RT_VALID_PTR(g_pWaylandHelperClipboard-> pfnTerm))392 rc = g_pWaylandHelperClipboard-> pfnTerm();392 && RT_VALID_PTR(g_pWaylandHelperClipboard->clip.pfnTerm)) 393 rc = g_pWaylandHelperClipboard->clip.pfnTerm(); 393 394 394 395 if ( RT_SUCCESS(rc) 395 396 && RT_VALID_PTR(g_pWaylandHelperDnd) 396 && RT_VALID_PTR(g_pWaylandHelperDnd-> pfnTerm))397 rc = g_pWaylandHelperDnd-> pfnTerm();397 && RT_VALID_PTR(g_pWaylandHelperDnd->dnd.pfnTerm)) 398 rc = g_pWaylandHelperDnd->dnd.pfnTerm(); 398 399 399 400 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.