2 Copyright (C) 2009 Red Hat, Inc.
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef _H_FOREIGN_MENU_PROT
19 #define _H_FOREIGN_MENU_PROT
21 #include <spice/types.h>
22 #include <spice/start-packed.h>
24 #define FOREIGN_MENU_MAGIC (*(uint32_t*)"FRGM")
25 #define FOREIGN_MENU_VERSION 1
27 typedef struct SPICE_ATTR_PACKED FrgMenuInitHeader {
33 typedef struct SPICE_ATTR_PACKED FrgMenuInit {
34 FrgMenuInitHeader base;
36 uint8_t title[0]; //UTF8
39 typedef struct SPICE_ATTR_PACKED FrgMenuMsg {
45 //extrenal app -> spice client
46 FOREIGN_MENU_SET_TITLE = 1,
47 FOREIGN_MENU_ADD_ITEM,
48 FOREIGN_MENU_MODIFY_ITEM,
49 FOREIGN_MENU_REMOVE_ITEM,
52 //spice client -> external app
53 FOREIGN_MENU_ITEM_EVENT = 1001,
54 FOREIGN_MENU_APP_ACTIVATED,
55 FOREIGN_MENU_APP_DEACTIVATED,
58 typedef struct SPICE_ATTR_PACKED FrgMenuSetTitle {
60 uint8_t string[0]; //UTF8
64 FOREIGN_MENU_ITEM_TYPE_CHECKED = 1 << 0,
65 FOREIGN_MENU_ITEM_TYPE_DIM = 1 << 1,
66 FOREIGN_MENU_ITEM_TYPE_SEPARATOR = 1 << 2
69 #define FOREIGN_MENU_INVALID_ID 0
71 typedef struct SPICE_ATTR_PACKED FrgMenuAddItem {
76 uint8_t string[0]; //UTF8
77 } FrgMenuAddItem, FrgMenuModItem;
79 typedef struct SPICE_ATTR_PACKED FrgMenuRmItem {
84 typedef struct FrgMenuMsg FrgMenuRmItems;
85 typedef struct FrgMenuMsg FrgMenuDelete;
88 FOREIGN_MENU_EVENT_CLICK,
89 FOREIGN_MENU_EVENT_CHECKED,
90 FOREIGN_MENU_EVENT_UNCHECKED
93 typedef struct SPICE_ATTR_PACKED FrgMenuEvent {
96 uint32_t action; //FOREIGN_MENU_EVENT_?
99 typedef struct FrgMenuMsg FrgMenuActivate;
100 typedef struct FrgMenuMsg FrgMenuDeactivate;
102 #include <spice/end-packed.h>