+/* Pasting routines */
+
+static void MEventBox1a_receive(GtkClipboard *clipboard,
+ const gchar *text,
+ gpointer data)
+{
+ if(text == NULL) return;
+ Tab *tab = (Tab *)data;
+ gchar buffer[CLIP_BUF];
+ gchar *ptr = buffer, *ptr_ssec, *ptr_snsec, *ptr_esec, *ptr_ensec;
+
+ strncpy(buffer, text, CLIP_BUF);
+
+ /* start */
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_ssec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+ ptr++;
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_snsec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+
+ /* end */
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_esec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+ ptr++;
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_ensec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry1),
+ (double)strtoul(ptr_ssec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry2),
+ (double)strtoul(ptr_snsec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry3),
+ (double)strtoul(ptr_esec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry4),
+ (double)strtoul(ptr_ensec, NULL, 10));
+}
+
+static gboolean on_MEventBox1a_paste(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ Tab *tab = (Tab*)data;
+
+ GtkClipboard *clip = gtk_clipboard_get_for_display(gdk_display_get_default(),
+ GDK_SELECTION_PRIMARY);
+ gtk_clipboard_request_text(clip,
+ (GtkClipboardTextReceivedFunc)MEventBox1a_receive,
+ (gpointer)tab);
+ return 0;
+}
+
+
+/* Start */
+static void MEventBox1b_receive(GtkClipboard *clipboard,
+ const gchar *text,
+ gpointer data)
+{
+ if(text == NULL) return;
+ Tab *tab = (Tab *)data;
+ gchar buffer[CLIP_BUF];
+ gchar *ptr = buffer, *ptr_sec, *ptr_nsec;
+
+ strncpy(buffer, text, CLIP_BUF);
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_sec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+ ptr++;
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_nsec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry1),
+ (double)strtoul(ptr_sec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry2),
+ (double)strtoul(ptr_nsec, NULL, 10));
+}
+
+/* Start */
+static gboolean on_MEventBox1b_paste(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ Tab *tab = (Tab*)data;
+
+ GtkClipboard *clip = gtk_clipboard_get_for_display(gdk_display_get_default(),
+ GDK_SELECTION_PRIMARY);
+ gtk_clipboard_request_text(clip,
+ (GtkClipboardTextReceivedFunc)MEventBox1b_receive,
+ (gpointer)tab);
+ return 0;
+}
+
+/* End */
+static void MEventBox3b_receive(GtkClipboard *clipboard,
+ const gchar *text,
+ gpointer data)
+{
+ if(text == NULL) return;
+ Tab *tab = (Tab *)data;
+ gchar buffer[CLIP_BUF];
+ gchar *ptr = buffer, *ptr_sec, *ptr_nsec;
+
+ strncpy(buffer, text, CLIP_BUF);
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_sec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+ ptr++;
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_nsec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry3),
+ (double)strtoul(ptr_sec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry4),
+ (double)strtoul(ptr_nsec, NULL, 10));
+}
+
+/* End */
+static gboolean on_MEventBox3b_paste(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ Tab *tab = (Tab*)data;
+
+ GtkClipboard *clip = gtk_clipboard_get_for_display(gdk_display_get_default(),
+ GDK_SELECTION_PRIMARY);
+ gtk_clipboard_request_text(clip,
+ (GtkClipboardTextReceivedFunc)MEventBox3b_receive,
+ (gpointer)tab);
+ return 0;
+}
+
+/* Current */
+static void MEventBox5b_receive(GtkClipboard *clipboard,
+ const gchar *text,
+ gpointer data)
+{
+ if(text == NULL) return;
+ Tab *tab = (Tab *)data;
+ gchar buffer[CLIP_BUF];
+ gchar *ptr = buffer, *ptr_sec, *ptr_nsec;
+
+ strncpy(buffer, text, CLIP_BUF);
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_sec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+ ptr++;
+
+ while(!isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* remove leading junk */
+ ptr_nsec = ptr;
+ while(isdigit(*ptr) && ptr < buffer+CLIP_BUF-1) ptr++;
+ /* read all the first number */
+ *ptr = '\0';
+
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry5),
+ (double)strtoul(ptr_sec, NULL, 10));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(tab->MEntry6),
+ (double)strtoul(ptr_nsec, NULL, 10));
+}
+
+/* Current */
+static gboolean on_MEventBox5b_paste(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ Tab *tab = (Tab*)data;
+
+ GtkClipboard *clip = gtk_clipboard_get_for_display(gdk_display_get_default(),
+ GDK_SELECTION_PRIMARY);
+ gtk_clipboard_request_text(clip,
+ (GtkClipboardTextReceivedFunc)MEventBox5b_receive,
+ (gpointer)tab);
+ return 0;
+}
+
+