diff options
author | llyzs <llyzs.vic@gmail.com> | 2011-10-30 07:57:45 +0400 |
---|---|---|
committer | Vic Lee (llyzs) <llyzs@b6cfa94a-2857-405c-b0d6-536ef9fc39e1> | 2011-10-30 07:57:45 +0400 |
commit | 6b51ad3f9ff0e138034c4a3b90994ef77d439c1f (patch) | |
tree | c7904b955470e10b437bbde499c8de29a92eaacc /remmina-plugins | |
parent | 63424bdd34bd5328aab8d859234e919d973371b7 (diff) |
Migrate remmina-plugins to GTK-3.
Diffstat (limited to 'remmina-plugins')
-rw-r--r-- | remmina-plugins/configure.ac | 3 | ||||
-rw-r--r-- | remmina-plugins/nx/remminanxsessionmanager.c | 4 | ||||
-rw-r--r-- | remmina-plugins/nx/remminapluginnx.c | 9 | ||||
-rw-r--r-- | remmina-plugins/vnc/remminapluginvnc.c | 53 | ||||
-rw-r--r-- | remmina-plugins/xdmcp/remminapluginxdmcp.c | 1 |
5 files changed, 34 insertions, 36 deletions
diff --git a/remmina-plugins/configure.ac b/remmina-plugins/configure.ac index df5348a07..fb332a747 100644 --- a/remmina-plugins/configure.ac +++ b/remmina-plugins/configure.ac @@ -56,8 +56,7 @@ AC_SUBST(remmina_datadir) # Checks for libraries. PKG_CHECK_MODULES(REMMINA_PLUGINS, [ - glib-2.0 >= 2.20.0 - gtk+-2.0 >= 2.16.0 + gtk+-3.0 remmina >= 0.9.99 ]) AC_SUBST(REMMINA_PLUGINS_CFLAGS) diff --git a/remmina-plugins/nx/remminanxsessionmanager.c b/remmina-plugins/nx/remminanxsessionmanager.c index cf5261d79..153c0995a 100644 --- a/remmina-plugins/nx/remminanxsessionmanager.c +++ b/remmina-plugins/nx/remminanxsessionmanager.c @@ -73,7 +73,9 @@ remmina_nx_session_manager_send_signal (RemminaPluginNxData *gpdata, gint event_ { guchar dummy = (guchar) event_type; /* Signal the NX thread to resume execution */ - (void) write (gpdata->event_pipe[1], &dummy, 1); + if (write (gpdata->event_pipe[1], &dummy, 1)) + { + } } static void diff --git a/remmina-plugins/nx/remminapluginnx.c b/remmina-plugins/nx/remminapluginnx.c index d42b84d8a..2a92c41be 100644 --- a/remmina-plugins/nx/remminapluginnx.c +++ b/remmina-plugins/nx/remminapluginnx.c @@ -19,6 +19,7 @@ */ #include "common/remminaplugincommon.h" +#include <gtk/gtkx.h> #include <time.h> #include <libssh/libssh.h> #include <X11/Xlib.h> @@ -86,10 +87,6 @@ remmina_plugin_nx_remove_window_id (Window window_id) static void remmina_plugin_nx_on_plug_added (GtkSocket *socket, RemminaProtocolWidget *gp) { - RemminaPluginNxData *gpdata; - - gpdata = (RemminaPluginNxData*) g_object_get_data (G_OBJECT (gp), "plugin-data"); - remmina_plugin_nx_service->protocol_plugin_emit_signal (gp, "connect"); } @@ -208,7 +205,9 @@ remmina_plugin_nx_wait_signal (RemminaPluginNxData *gpdata) FD_ZERO (&set); FD_SET (gpdata->event_pipe[0], &set); select (gpdata->event_pipe[0] + 1, &set, NULL, NULL, NULL); - (void) read (gpdata->event_pipe[0], &dummy, 1); + if (read (gpdata->event_pipe[0], &dummy, 1)) + { + } return (gint) dummy; } diff --git a/remmina-plugins/vnc/remminapluginvnc.c b/remmina-plugins/vnc/remminapluginvnc.c index 25574363d..40bda3d34 100644 --- a/remmina-plugins/vnc/remminapluginvnc.c +++ b/remmina-plugins/vnc/remminapluginvnc.c @@ -78,14 +78,18 @@ typedef struct _RemminaPluginVncData static RemminaPluginService *remmina_plugin_service = NULL; -#define dot_cursor_width 5 -#define dot_cursor_height 5 -#define dot_cursor_x_hot 2 -#define dot_cursor_y_hot 2 -static const gchar dot_cursor_bits[] = { - 0x00, 0x0e, 0x0e, 0x0e, 0x00 }; -static const gchar dot_cursor_mask_bits[] = { - 0x0e, 0x1f, 0x1f, 0x1f, 0x0e }; +static int dot_cursor_x_hot = 2; +static int dot_cursor_y_hot = 2; +static const gchar * dot_cursor_xpm[] = { +"5 5 3 1", +" c None", +". c #000000", +"+ c #FFFFFF", +" ... ", +".+++.", +".+ +.", +".+++.", +" ... "}; #ifdef HAVE_PTHREAD #define LOCK_BUFFER(t) if(t){CANCEL_DEFER}pthread_mutex_lock(&gpdata->buffer_mutex); @@ -243,14 +247,16 @@ remmina_plugin_vnc_update_scale_buffer (RemminaProtocolWidget *gp, gboolean in_t gboolean scale; gint x, y, w, h; GdkPixbuf *pixbuf; + GtkAllocation a; gpdata = (RemminaPluginVncData*) g_object_get_data (G_OBJECT (gp), "plugin-data"); remminafile = remmina_plugin_service->protocol_plugin_get_file (gp); if (gpdata->running) { - width = GTK_WIDGET (gp)->allocation.width; - height = GTK_WIDGET (gp)->allocation.height; + gtk_widget_get_allocation (GTK_WIDGET (gp), &a); + width = a.width; + height = a.height; scale = remmina_plugin_service->protocol_plugin_get_scale (gp); if (scale) { @@ -943,7 +949,7 @@ remmina_plugin_vnc_rfb_cursor_shape (rfbClient *cl, int xhot, int yhot, int widt GdkPixbuf *pixbuf; gp = (RemminaProtocolWidget*) (rfbClientGetClientData (cl, NULL)); - if (!GTK_WIDGET (gp)->window) return; + if (!gtk_widget_get_window (GTK_WIDGET (gp))) return; gpdata = (RemminaPluginVncData*) g_object_get_data (G_OBJECT (gp), "plugin-data"); if (width && height) @@ -970,7 +976,7 @@ remmina_plugin_vnc_rfb_bell (rfbClient *cl) GdkWindow *window; gp = (RemminaProtocolWidget*) (rfbClientGetClientData (cl, NULL)); - window = GTK_WIDGET (gp)->window; + window = gtk_widget_get_window (GTK_WIDGET (gp)); if (window) gdk_window_beep (window); } @@ -1054,10 +1060,8 @@ static void remmina_plugin_vnc_rfb_chat (rfbClient* cl, int value, char *text) { RemminaProtocolWidget *gp; - RemminaPluginVncData *gpdata; gp = (RemminaProtocolWidget*) (rfbClientGetClientData (cl, NULL)); - gpdata = (RemminaPluginVncData*) g_object_get_data (G_OBJECT (gp), "plugin-data"); switch (value) { case rfbTextChatOpen: @@ -1566,26 +1570,19 @@ remmina_plugin_vnc_on_cuttext (GtkClipboard *clipboard, GdkEvent *event, Remmina static void remmina_plugin_vnc_on_realize (RemminaProtocolWidget *gp, gpointer data) { - RemminaPluginVncData *gpdata; RemminaFile *remminafile; GdkCursor *cursor; - GdkPixmap *source, *mask; - GdkColor fg, bg; + GdkPixbuf *pixbuf; - gpdata = (RemminaPluginVncData*) g_object_get_data (G_OBJECT (gp), "plugin-data"); remminafile = remmina_plugin_service->protocol_plugin_get_file (gp); if (remmina_plugin_service->file_get_int (remminafile, "showcursor", FALSE)) { /* Hide local cursor (show a small dot instead) */ - gdk_color_parse ("black", &fg); - gdk_color_parse ("white", &bg); - source = gdk_bitmap_create_from_data (NULL, dot_cursor_bits, dot_cursor_width, dot_cursor_height); - mask = gdk_bitmap_create_from_data (NULL, dot_cursor_mask_bits, dot_cursor_width, dot_cursor_height); - cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, dot_cursor_x_hot, dot_cursor_y_hot); - gdk_pixmap_unref (source); - gdk_pixmap_unref (mask); - gdk_window_set_cursor (GTK_WIDGET (gp)->window, cursor); + pixbuf = gdk_pixbuf_new_from_xpm_data (dot_cursor_xpm); + cursor = gdk_cursor_new_from_pixbuf (gdk_display_get_default (), pixbuf, dot_cursor_x_hot, dot_cursor_y_hot); + gdk_pixbuf_unref (pixbuf); + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (gp)), cursor); gdk_cursor_unref (cursor); } } @@ -1831,7 +1828,7 @@ remmina_plugin_vnc_on_expose (GtkWidget *widget, GdkEventExpose *event, RemminaP x = event->area.x; y = event->area.y; - context = gdk_cairo_create (GDK_DRAWABLE (gpdata->drawing_area->window)); + context = gdk_cairo_create (gtk_widget_get_window (gpdata->drawing_area)); cairo_rectangle (context, x, y, event->area.width, event->area.height); gdk_cairo_set_source_pixbuf (context, buffer, 0, 0); cairo_fill (context); @@ -1868,7 +1865,7 @@ remmina_plugin_vnc_init (RemminaProtocolWidget *gp) gtk_widget_add_events (gpdata->drawing_area, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); - GTK_WIDGET_SET_FLAGS (gpdata->drawing_area, GTK_CAN_FOCUS); + gtk_widget_set_can_focus (gpdata->drawing_area, TRUE); g_signal_connect (G_OBJECT (gpdata->drawing_area), "expose_event", G_CALLBACK (remmina_plugin_vnc_on_expose), gp); diff --git a/remmina-plugins/xdmcp/remminapluginxdmcp.c b/remmina-plugins/xdmcp/remminapluginxdmcp.c index 59a119a14..e160829a7 100644 --- a/remmina-plugins/xdmcp/remminapluginxdmcp.c +++ b/remmina-plugins/xdmcp/remminapluginxdmcp.c @@ -19,6 +19,7 @@ */ #include "common/remminaplugincommon.h" +#include <gtk/gtkx.h> INCLUDE_GET_AVAILABLE_XDISPLAY |