/* virt-click * Copyright (C) 2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef click_h_ #define click_h_ #include #include #include enum command_qual { CMD_CLICK }; typedef struct { enum command_qual cmd; union { struct { int x, y; /* x, y location */ int b; /* button number */ } click; }; } command_t; struct self_t; typedef struct { void (*shutdown) (struct self_t *self); int (*click) (struct self_t *self, int x, int y, int b); } callbacks_t; typedef struct self_t { GMainLoop *loop; int ret; gboolean connected; /* Callbacks. */ callbacks_t *callbacks; /* Command. */ command_t command; /* Private data for VNC connections: */ VncConnection *conn; /* Private data for SPICE connections. */ SpiceSession *session; SpiceChannel *display_channel; SpiceChannel *inputs_channel; } self_t; extern gboolean verbose; /* commands.c */ extern int vc_parse_command (self_t *self, gchar **args, guint nr_args); extern void vc_issue_command (self_t *self); /* spice.c */ extern GOptionGroup *vc_spice_cmdline_get_option_group (void); extern gboolean vc_spice_is_selected (void); extern void vc_spice_setup (self_t *self); /* vnc.c */ extern GOptionGroup *vc_vnc_cmdline_get_option_group (void); extern gboolean vc_vnc_is_selected (void); extern void vc_vnc_setup (self_t *self); /* vnc-auth.c */ extern void vc_vnc_auth_credential (VncConnection *conn, GValueArray *credList, gpointer opaque); extern void vc_vnc_auth_choose_type (VncConnection *conn, GValueArray *types, gpointer opaque G_GNUC_UNUSED); #endif /* click_h_ */