comparison src/gtkimhtml.c @ 3630:9682c0e022c6

[gaim-migrate @ 3753] Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 11 Oct 2002 03:14:01 +0000
parents 220bed0e439c
children 91498932cea7
comparison
equal deleted inserted replaced
3629:afc5bb164c5a 3630:9682c0e022c6
21 21
22 #ifdef HAVE_CONFIG_H 22 #ifdef HAVE_CONFIG_H
23 #include <config.h> 23 #include <config.h>
24 #endif 24 #endif
25 #include "gtkimhtml.h" 25 #include "gtkimhtml.h"
26
27 #ifndef _WIN32
26 #include <X11/Xlib.h> 28 #include <X11/Xlib.h>
29 #include <gdk/gdkx.h>
30 #else
31 #include <gdk/gdkwin32.h>
32 #endif
33
27 #include <stdlib.h> 34 #include <stdlib.h>
28 #include <gdk/gdkx.h>
29 #include <gtk/gtk.h> 35 #include <gtk/gtk.h>
30 #include <string.h> 36 #include <string.h>
31 #include <ctype.h> 37 #include <ctype.h>
32 #include <stdio.h> 38 #include <stdio.h>
33 #include <math.h> 39 #include <math.h>
34 #ifdef HAVE_LANGINFO_CODESET 40 #ifdef HAVE_LANGINFO_CODESET
35 #include <langinfo.h> 41 #include <langinfo.h>
36 #include <locale.h> 42 #include <locale.h>
43 #endif
44
45 #ifdef _WIN32
46 /* GDK_SELECTION_PRIMARY is ignored win32 GTK */
47 #undef GDK_SELECTION_PRIMARY
48 #define GDK_SELECTION_PRIMARY GDK_SELECTION_CLIPBOARD
37 #endif 49 #endif
38 50
39 #include <gdk-pixbuf/gdk-pixbuf.h> 51 #include <gdk-pixbuf/gdk-pixbuf.h>
40 #include <gdk-pixbuf/gdk-pixbuf-loader.h> 52 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
41 53
1682 struct imgsv *is = data; 1694 struct imgsv *is = data;
1683 struct im_image *img = is->img; 1695 struct im_image *img = is->img;
1684 const gchar *filename; 1696 const gchar *filename;
1685 FILE *f; 1697 FILE *f;
1686 filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(is->savedialog)); 1698 filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(is->savedialog));
1687 g_print("Saving %s\n", filename); 1699 debug_printf("Saving %s\n", filename);
1688 if (! (f=fopen(filename, "w"))) { 1700 if (! (f=fopen(filename, "w"))) {
1689 /* There should be some sort of dialog */ 1701 /* There should be some sort of dialog */
1690 g_print("Could not open file for writing.\n"); 1702 debug_printf("Could not open file for writing.\n");
1691 gtk_widget_destroy(is->savedialog); 1703 gtk_widget_destroy(is->savedialog);
1692 g_free(is); 1704 g_free(is);
1693 return; 1705 return;
1694 } 1706 }
1695 1707
2084 #define ENCDNG 14 2096 #define ENCDNG 14
2085 2097
2086 static const gchar* 2098 static const gchar*
2087 gtk_imhtml_get_font_name (PangoFontDescription *font) 2099 gtk_imhtml_get_font_name (PangoFontDescription *font)
2088 { 2100 {
2101 #if 0
2102 #ifndef _WIN32
2103 return gdk_x11_font_get_name(font);
2104 #else
2105 #if 0
2106 /* win32 gdkfont.h says this is temporary - GTK 2.0.3 */
2107 return gdk_font_full_name_get(font);
2108 #else
2109 /* So i can build with GTK 2.0.6 */
2110 return "-unknown-arial-normal-r-normal---18--108-120-120-p-0-microsoft-vietnamese-unknown-arial-normal-r-normal---18--108-120-120-p-0-microsoft-vietnamese27";
2111 #endif
2112 #endif
2113 #endif
2089 return pango_font_description_get_family(font); 2114 return pango_font_description_get_family(font);
2090 } 2115 }
2091 2116
2092 static PangoFontDescription * 2117 static PangoFontDescription *
2093 gtk_imhtml_font_load (GtkIMHtml *imhtml, 2118 gtk_imhtml_font_load (GtkIMHtml *imhtml,
3326 memcpy(img->data, imagedata, img->len); 3351 memcpy(img->data, imagedata, img->len);
3327 load = gdk_pixbuf_loader_new(); 3352 load = gdk_pixbuf_loader_new();
3328 3353
3329 if (!gdk_pixbuf_loader_write(load, imagedata, 3354 if (!gdk_pixbuf_loader_write(load, imagedata,
3330 img->len, &err)) 3355 img->len, &err))
3331 g_print("IM Image corrupt or unreadable.\n"); 3356 debug_printf("IM Image corrupt or unreadable.\n");
3332 else 3357 else
3333 imagepb = gdk_pixbuf_loader_get_pixbuf(load); 3358 imagepb = gdk_pixbuf_loader_get_pixbuf(load);
3334 img->pb = imagepb; 3359 img->pb = imagepb;
3335 } 3360 }
3336 if (imagepb) { 3361 if (imagepb) {