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
26 extern "C" {
27 #endif
28 
30 
31 typedef 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 
78 static 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
MirDragAndDropV1
Definition: drag_and_drop.h:32
mir_connection_request_extension
void const * mir_connection_request_extension(MirConnection *connection, char const *interface, int version)
Request a Mir extension.
MirWindow
struct MirSurface MirWindow
Definition: client_types.h:43
MirBlob
struct MirBlob MirBlob
Definition: client_types.h:52
MirConnection
struct MirConnection MirConnection
Definition: client_types.h:41
MirDragAndDropV1::set_start_drag_and_drop_callback
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
MirPointerEvent
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
client_types.h
mir_extension_core.h
MirDragAndDropEvent
struct MirDragAndDropEvent MirDragAndDropEvent
Definition: drag_and_drop.h:29
MirDragAndDropV1
struct MirDragAndDropV1 MirDragAndDropV1
MirDragAndDropV1::request_drag_and_drop
void(* request_drag_and_drop)(MirWindow *window, MirCookie const *cookie)
Request drag and drop.
Definition: drag_and_drop.h:42
MirCookie
struct MirCookie MirCookie
Definition: event.h:82

Copyright © 2012-2020 Canonical Ltd.
Generated on Sun Dec 20 20:38:20 UTC 2020
This documentation is licensed under the GPL version 2 or 3.