Lines Matching refs:info

28     QemuClipboardInfo *info = qemu_clipboard_info(selection);  in qemu_clipboard_peer_owns()  local
30 return info && info->owner == peer; in qemu_clipboard_peer_owns()
36 g_autoptr(QemuClipboardInfo) info = NULL; in qemu_clipboard_peer_release()
40 info = qemu_clipboard_info_new(NULL, selection); in qemu_clipboard_peer_release()
41 qemu_clipboard_update(info); in qemu_clipboard_peer_release()
45 bool qemu_clipboard_check_serial(QemuClipboardInfo *info, bool client) in qemu_clipboard_check_serial() argument
49 if (!info->has_serial || in qemu_clipboard_check_serial()
50 !cbinfo[info->selection] || in qemu_clipboard_check_serial()
51 !cbinfo[info->selection]->has_serial) { in qemu_clipboard_check_serial()
57 ok = info->serial >= cbinfo[info->selection]->serial; in qemu_clipboard_check_serial()
59 ok = info->serial > cbinfo[info->selection]->serial; in qemu_clipboard_check_serial()
62 trace_clipboard_check_serial(cbinfo[info->selection]->serial, info->serial, ok); in qemu_clipboard_check_serial()
66 void qemu_clipboard_update(QemuClipboardInfo *info) in qemu_clipboard_update() argument
71 .info = info, in qemu_clipboard_update()
73 assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT); in qemu_clipboard_update()
81 if (info->types[type].available && !info->types[type].data) { in qemu_clipboard_update()
82 assert(info->owner && info->owner->request); in qemu_clipboard_update()
88 if (cbinfo[info->selection] != info) { in qemu_clipboard_update()
89 qemu_clipboard_info_unref(cbinfo[info->selection]); in qemu_clipboard_update()
90 cbinfo[info->selection] = qemu_clipboard_info_ref(info); in qemu_clipboard_update()
104 QemuClipboardInfo *info = g_new0(QemuClipboardInfo, 1); in qemu_clipboard_info_new() local
106 info->owner = owner; in qemu_clipboard_info_new()
107 info->selection = selection; in qemu_clipboard_info_new()
108 info->refcount = 1; in qemu_clipboard_info_new()
110 return info; in qemu_clipboard_info_new()
113 QemuClipboardInfo *qemu_clipboard_info_ref(QemuClipboardInfo *info) in qemu_clipboard_info_ref() argument
115 info->refcount++; in qemu_clipboard_info_ref()
116 return info; in qemu_clipboard_info_ref()
119 void qemu_clipboard_info_unref(QemuClipboardInfo *info) in qemu_clipboard_info_unref() argument
123 if (!info) { in qemu_clipboard_info_unref()
127 info->refcount--; in qemu_clipboard_info_unref()
128 if (info->refcount > 0) { in qemu_clipboard_info_unref()
133 g_free(info->types[type].data); in qemu_clipboard_info_unref()
135 g_free(info); in qemu_clipboard_info_unref()
138 void qemu_clipboard_request(QemuClipboardInfo *info, in qemu_clipboard_request() argument
141 if (info->types[type].data || in qemu_clipboard_request()
142 info->types[type].requested || in qemu_clipboard_request()
143 !info->types[type].available || in qemu_clipboard_request()
144 !info->owner) in qemu_clipboard_request()
147 assert(info->owner->request); in qemu_clipboard_request()
149 info->types[type].requested = true; in qemu_clipboard_request()
150 info->owner->request(info, type); in qemu_clipboard_request()
161 QemuClipboardInfo *info = qemu_clipboard_info(i); in qemu_clipboard_reset_serial() local
162 if (info) { in qemu_clipboard_reset_serial()
163 info->serial = 0; in qemu_clipboard_reset_serial()
170 QemuClipboardInfo *info, in qemu_clipboard_set_data() argument
176 if (!info || in qemu_clipboard_set_data()
177 info->owner != peer) { in qemu_clipboard_set_data()
181 g_free(info->types[type].data); in qemu_clipboard_set_data()
183 info->types[type].data = g_memdup2(data, size); in qemu_clipboard_set_data()
184 info->types[type].size = size; in qemu_clipboard_set_data()
185 info->types[type].available = true; in qemu_clipboard_set_data()
187 info->types[type].data = NULL; in qemu_clipboard_set_data()
188 info->types[type].size = 0; in qemu_clipboard_set_data()
189 info->types[type].available = false; in qemu_clipboard_set_data()
193 qemu_clipboard_update(info); in qemu_clipboard_set_data()