Skip to content

Commit

Permalink
Merge pull request #364 from giox069/next
Browse files Browse the repository at this point in the history
Rename relevant CB_FORMAT to CF, many thanks to @tachylatus.
  • Loading branch information
giox069 committed Oct 28, 2014
2 parents 1c6788d + 1263eaf commit 742afc1
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions remmina-plugins/rdp/rdp_cliprdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ UINT32 remmina_rdp_cliprdr_get_format_from_gdkatom(GdkAtom atom)
gchar* name = gdk_atom_name(atom);
if (g_strcmp0("UTF8_STRING", name) == 0 || g_strcmp0("text/plain;charset=utf-8", name) == 0)
{
return CB_FORMAT_UNICODETEXT;
return CF_UNICODETEXT;
}
if (g_strcmp0("TEXT", name) == 0 || g_strcmp0("text/plain", name) == 0)
{
return CB_FORMAT_TEXT;
return CF_TEXT;
}
if (g_strcmp0("text/html", name) == 0)
{
Expand All @@ -66,9 +66,9 @@ UINT32 remmina_rdp_cliprdr_get_format_from_gdkatom(GdkAtom atom)
}
if (g_strcmp0("image/bmp", name) == 0)
{
return CB_FORMAT_DIB;
return CF_DIB;
}
return CB_FORMAT_RAW;
return 0;
}

void remmina_rdp_cliprdr_get_target_types(UINT32** formats, UINT16* size, GdkAtom* types, int count)
Expand All @@ -77,11 +77,11 @@ void remmina_rdp_cliprdr_get_target_types(UINT32** formats, UINT16* size, GdkAto
*size = 1;
*formats = (UINT32*) malloc(sizeof(UINT32) * (count+1));

*formats[0] = CB_FORMAT_RAW;
*formats[0] = 0;
for (i = 0; i < count; i++)
{
UINT32 format = remmina_rdp_cliprdr_get_format_from_gdkatom(types[i]);
if (format != CB_FORMAT_RAW)
if (format != 0)
{
(*formats)[*size] = format;
(*size)++;
Expand Down Expand Up @@ -166,20 +166,20 @@ void remmina_rdp_cliprdr_process_format_list(RemminaProtocolWidget* gp, RDP_CB_F

for (i = 0; i < event->num_formats; i++)
{
if (event->formats[i] == CB_FORMAT_UNICODETEXT)
if (event->formats[i] == CF_UNICODETEXT)
{
GdkAtom atom = gdk_atom_intern("UTF8_STRING", TRUE);
gtk_target_list_add(list, atom, 0, CB_FORMAT_UNICODETEXT);
gtk_target_list_add(list, atom, 0, CF_UNICODETEXT);
}
if (event->formats[i] == CB_FORMAT_TEXT)
if (event->formats[i] == CF_TEXT)
{
GdkAtom atom = gdk_atom_intern("TEXT", TRUE);
gtk_target_list_add(list, atom, 0, CB_FORMAT_TEXT);
gtk_target_list_add(list, atom, 0, CF_TEXT);
}
if (event->formats[i] == CB_FORMAT_DIB)
if (event->formats[i] == CF_DIB)
{
GdkAtom atom = gdk_atom_intern("image/bmp", TRUE);
gtk_target_list_add(list, atom, 0, CB_FORMAT_DIB);
gtk_target_list_add(list, atom, 0, CF_DIB);
}
if (event->formats[i] == CB_FORMAT_JPEG)
{
Expand Down Expand Up @@ -226,23 +226,23 @@ void remmina_rdp_cliprdr_process_data_response(RemminaProtocolWidget* gp, RDP_CB
{
switch (rfi->format)
{
case CB_FORMAT_UNICODETEXT:
case CF_UNICODETEXT:
{
size = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)data, size / 2, (CHAR**)&data, 0, NULL, NULL);
crlf2lf(data, &size);
output = data;
break;
}

case CB_FORMAT_TEXT:
case CF_TEXT:
case CB_FORMAT_HTML:
{
crlf2lf(data, &size);
output = data;
break;
}

case CB_FORMAT_DIB:
case CF_DIB:
{
wStream* s;
UINT16 bpp;
Expand Down Expand Up @@ -333,7 +333,7 @@ void remmina_rdp_cliprdr_request_data(GtkClipboard *clipboard, GtkSelectionData
data = g_async_queue_timeout_pop(rfi->clipboard_queue, 1000000);
if (data != NULL)
{
if (info == CB_FORMAT_PNG || info == CB_FORMAT_DIB || info == CB_FORMAT_JPEG)
if (info == CB_FORMAT_PNG || info == CF_DIB || info == CB_FORMAT_JPEG)
{
gtk_selection_data_set_pixbuf(selection_data, data);
g_object_unref(data);
Expand Down Expand Up @@ -405,8 +405,8 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPl
{
switch (ui->clipboard.format)
{
case CB_FORMAT_TEXT:
case CB_FORMAT_UNICODETEXT:
case CF_TEXT:
case CF_UNICODETEXT:
case CB_FORMAT_HTML:
{
inbuf = (UINT8*)gtk_clipboard_wait_for_text(clipboard);
Expand All @@ -415,7 +415,7 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPl

case CB_FORMAT_PNG:
case CB_FORMAT_JPEG:
case CB_FORMAT_DIB:
case CF_DIB:
{
image = gtk_clipboard_wait_for_image(clipboard);
break;
Expand All @@ -428,14 +428,14 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPl
{
switch (ui->clipboard.format)
{
case CB_FORMAT_TEXT:
case CF_TEXT:
case CB_FORMAT_HTML:
{
size = strlen((char*)inbuf);
outbuf = lf2crlf(inbuf, &size);
break;
}
case CB_FORMAT_UNICODETEXT:
case CF_UNICODETEXT:
{
size = strlen((char*)inbuf);
inbuf = lf2crlf(inbuf, &size);
Expand Down Expand Up @@ -465,7 +465,7 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPl
g_object_unref(image);
break;
}
case CB_FORMAT_DIB:
case CF_DIB:
{
gchar* data;
gsize buffersize;
Expand Down

0 comments on commit 742afc1

Please sign in to comment.