2 * Copyright (C) 1998 Peter Zelezny.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
24 #include "../common/xchat.h"
25 #include "../common/fe.h"
27 #include <gdk-pixbuf/gdk-pixbuf.h>
28 #include <gdk-pixbuf/gdk-pixdata.h>
29 #include <gtk/gtkstock.h>
31 #include "../pixmaps/inline_pngs.h"
36 GdkPixbuf
*pix_purple
;
42 GdkPixbuf
*pix_tray_msg
;
43 GdkPixbuf
*pix_tray_hilight
;
44 GdkPixbuf
*pix_tray_file
;
46 GdkPixbuf
*pix_channel
;
47 GdkPixbuf
*pix_dialog
;
48 GdkPixbuf
*pix_server
;
53 pixmap_load_from_file_real (char *file
)
58 img
= gdk_pixbuf_new_from_file (file
, 0);
61 gdk_pixbuf_render_pixmap_and_mask (img
, &pixmap
, NULL
, 128);
62 gdk_pixbuf_unref (img
);
68 pixmap_load_from_file (char *filename
)
73 if (filename
[0] == '\0')
76 pix
= pixmap_load_from_file_real (filename
);
79 strcpy (buf
, "Cannot open:\n\n");
80 strncpy (buf
+ 14, filename
, sizeof (buf
) - 14);
81 buf
[sizeof (buf
) - 1] = 0;
82 fe_message (buf
, FE_MSG_ERROR
);
88 #define LOADPIX(vv,pp,ff) \
89 vv = gdk_pixbuf_new_from_file (XCHATSHAREDIR"/xchat/"ff, 0); \
91 vv = gdk_pixbuf_new_from_inline (-1, pp, FALSE, 0);
93 #define LOADPIX_DISKONLY(vv,ff) \
94 vv = gdk_pixbuf_new_from_file (XCHATSHAREDIR"/xchat/"ff, 0);
101 pix_book
= gdk_pixbuf_new_from_inline (-1, bookpng
, FALSE
, 0);
103 /* used in About window, tray icon and WindowManager icon. */
104 LOADPIX (pix_xchat
, xchatpng
, "xchat"EXT
);
106 /* userlist icons, with inlined defaults */
107 LOADPIX (pix_hop
, hoppng
, "hop"EXT
);
108 LOADPIX (pix_purple
, purplepng
, "purple"EXT
);
109 LOADPIX (pix_red
, redpng
, "red"EXT
);
110 LOADPIX (pix_op
, oppng
, "op"EXT
);
111 LOADPIX (pix_voice
, voicepng
, "voice"EXT
);
113 /* tray icons, with inlined defaults */
114 LOADPIX (pix_tray_msg
, traymsgpng
, "message"EXT
);
115 LOADPIX (pix_tray_hilight
, trayhilightpng
, "highlight"EXT
);
116 LOADPIX (pix_tray_file
, trayfilepng
, "fileoffer"EXT
);
118 /* treeview icons, no defaults, load from disk only */
119 LOADPIX_DISKONLY (pix_channel
, "channel"EXT
);
120 LOADPIX_DISKONLY (pix_dialog
, "dialog"EXT
);
121 LOADPIX_DISKONLY (pix_server
, "server"EXT
);
122 LOADPIX_DISKONLY (pix_util
, "util"EXT
);