Mir
drag_and_drop.h
Go to the documentation of this file.
1/*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 2 or 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef MIR_DRAG_AND_DROP_H
20#define MIR_DRAG_AND_DROP_H
21
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
30
31typedef struct MirDragAndDropV1
32{
42 void (*request_drag_and_drop)(MirWindow* window, MirCookie const* cookie);
43
53 void (*callback)(MirWindow* window, MirDragAndDropEvent const* event, void* context),
54 void* context);
55
64 MirBlob* (*start_drag_and_drop)(MirDragAndDropEvent const* event);
65
74 MirBlob* (*pointer_drag_and_drop)(MirPointerEvent const* event);
75
77
78static inline MirDragAndDropV1 const* mir_drag_and_drop_v1(MirConnection* connection)
79{
80 return (MirDragAndDropV1 const*) mir_connection_request_extension(connection, "mir_drag_and_drop", 1);
81}
82
83#ifdef __cplusplus
84}
85#endif
86#endif //MIR_DRAG_AND_DROP_H
struct MirDragAndDropEvent MirDragAndDropEvent
Definition: drag_and_drop.h:29
struct MirDragAndDropV1 MirDragAndDropV1
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
struct MirSurface MirWindow
Definition: client_types.h:43
struct MirCookie MirCookie
Definition: event.h:82
struct MirBlob MirBlob
Definition: client_types.h:52
struct MirConnection MirConnection
Definition: client_types.h:41
void const * mir_connection_request_extension(MirConnection *connection, char const *interface, int version)
Request a Mir extension.
Definition: drag_and_drop.h:32
void(* set_start_drag_and_drop_callback)(MirWindow *window, void(*callback)(MirWindow *window, MirDragAndDropEvent const *event, void *context), void *context)
Set the drag and drop callback.
Definition: drag_and_drop.h:52
void(* request_drag_and_drop)(MirWindow *window, MirCookie const *cookie)
Request drag and drop.
Definition: drag_and_drop.h:42

Copyright © 2012-2022 Canonical Ltd.
Generated on Sat 3 Dec 14:36:51 UTC 2022
This documentation is licensed under the GPL version 2 or 3.