Commit c39d367d35aaa0812e49a2196ce359da065ef960

Authored by Perry Werneck
1 parent 20612e42
Exists in master and in 1 other branch develop

Adding image copy features to windows version.

Showing 1 changed file with 19 additions and 0 deletions   Show diff stats
src/selection/windows/copy.c
@@ -104,6 +104,20 @@ static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionDa @@ -104,6 +104,20 @@ static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionDa
104 } 104 }
105 break; 105 break;
106 106
  107 + case CLIPBOARD_TYPE_PIXBUFF:
  108 + {
  109 + GdkPixbuf * pixbuff = v3270_get_selection_as_pixbuf(terminal, terminal->selection.blocks, FALSE);
  110 +
  111 + debug("%s: pixbuff=%p (blocks=%p)",__FUNCTION__,pixbuff,terminal->selection.blocks);
  112 +
  113 + if(pixbuff)
  114 + {
  115 + gtk_selection_data_set_pixbuf(selection,pixbuff);
  116 + g_object_unref(pixbuff);
  117 + }
  118 + }
  119 + break;
  120 +
107 default: 121 default:
108 g_warning("Unexpected clipboard type %d\n",target); 122 g_warning("Unexpected clipboard type %d\n",target);
109 } 123 }
@@ -143,6 +157,11 @@ void v3270_update_system_clipboard(GtkWidget *widget) @@ -143,6 +157,11 @@ void v3270_update_system_clipboard(GtkWidget *widget)
143 157
144 } 158 }
145 159
  160 + if(terminal->selection.options & V3270_SELECTION_PIXBUFF)
  161 + {
  162 + gtk_target_list_add_image_targets(list,CLIPBOARD_TYPE_PIXBUFF,TRUE);
  163 + }
  164 +
146 int n_targets; 165 int n_targets;
147 GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets); 166 GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets);
148 167