*
*/
-#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <stdlib.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <glib/gi18n.h>
+
#include "viking.h"
// g_print("clip_get: vc = %p, size = %d\n", vc, sizeof(*vc) + vc->len);
gtk_selection_data_set ( selection_data, selection_data->target, 8, (void *)vc, sizeof(*vc) + vc->len );
}
- if (info==1) {
- if (vc->type == VIK_CLIPBOARD_DATA_LAYER) {
- gtk_selection_data_set_text ( selection_data, VIK_LAYER(vc->clipboard)->name, -1 );
- }
- }
}
static void clip_clear ( GtkClipboard *c, gpointer p )
VikLayersPanel *vlp = p;
vik_clipboard_t *vc;
if (sd->length == -1) {
- g_warning ( "paste failed" );
+ g_warning ( _("paste failed") );
return;
}
// g_print("clip receive: target = %s, type = %s\n", gdk_atom_name(sd->target), gdk_atom_name(sd->type));
// g_print(" sd->data = %p, sd->length = %d, vc->len = %d\n", sd->data, sd->length, vc->len);
if (sd->length != sizeof(*vc) + vc->len) {
- g_warning ( "wrong clipboard data size" );
+ g_warning ( _("wrong clipboard data size") );
return;
}
vik_layer_get_interface(vc->layer_type)->paste_item ( sel, vc->subtype, vc->data, vc->len);
}
else
- a_dialog_error_msg_extra ( VIK_GTK_WINDOW_FROM_WIDGET(GTK_WIDGET(vlp)), "The clipboard contains sublayer data for a %s layers. You must select a layer of this type to paste the clipboard data.", vik_layer_get_interface(vc->layer_type)->name );
+ a_dialog_error_msg_extra ( VIK_GTK_WINDOW_FROM_WIDGET(GTK_WIDGET(vlp)),
+ _("The clipboard contains sublayer data for a %s layers."
+ "You must select a layer of this type to paste the clipboard data."),
+ vik_layer_get_interface(vc->layer_type)->name );
}
}
gint j, k;
cand = s+i;
- // printf("Trying >>>>> %s\n", cand);
-
for (j=0; j<2; j++) {
for (k=0; k<2; k++) {
gchar fmt1[] = "N %d%*[ ]%lf W %d%*[ ]%lf";
if (sel && sel->type == VIK_LAYER_TRW) {
vik_trw_layer_new_waypoint ( VIK_TRW_LAYER(sel), VIK_GTK_WINDOW_FROM_LAYER(sel), &vc );
} else {
- a_dialog_error_msg_extra ( VIK_GTK_WINDOW_FROM_WIDGET(GTK_WIDGET(vlp)), "In order to paste a waypoint, please select an appropriate layer to paste into.", NULL);
+ a_dialog_error_msg_extra ( VIK_GTK_WINDOW_FROM_WIDGET(GTK_WIDGET(vlp)), _("In order to paste a waypoint, please select an appropriate layer to paste into."), NULL);
}
}
static void clip_receive_html ( GtkClipboard *c, GtkSelectionData *sd, gpointer p )
{
VikLayersPanel *vlp = p;
- guint r, w;
+ gsize r, w;
GError *err = NULL;
gchar *s, *span;
gint tag = 0, i;
}
else
{
+ gint ilen;
type = VIK_CLIPBOARD_DATA_LAYER;
- vik_layer_marshall ( sel, &data, &len );
+ vik_layer_marshall ( sel, &data, &ilen );
+ len = ilen;
}
if (data)