Create 16x16 and 24x24 versions of the document icon with a contrasting

border. Add them as pixbufs to ui/gtk/toolbar_icons.h and use them to
replace the file icon XPM in stock_icons.c. Add modelines.

svn path=/trunk/; revision=46413
This commit is contained in:
Gerald Combs 2012-12-05 22:28:12 +00:00
parent 025f5d1ecd
commit 07898cae39
9 changed files with 59 additions and 129 deletions

View File

@ -795,6 +795,8 @@ EXTRA_DIST = \
image/toolbar/telephone_16.xpm \
image/toolbar/telephony_16.xpm \
image/toolbar/time_24.xpm \
image/toolbar/toolbar_wireshark_file_16.png \
image/toolbar/toolbar_wireshark_file_24.png \
image/toolbar/voip_flow_24.xpm \
image/toolbar/web_support_24.xpm \
image/toolbar/wep_closed_24.xpm \
@ -814,7 +816,6 @@ EXTRA_DIST = \
image/WiresharkDoc-32.png \
image/WiresharkDoc-48.png \
image/WiresharkDoc-64.png \
image/WiresharkDoc_24.xpm \
image/wiretap.rc.in \
image/wsicon.svg \
image/wsicon16.png \

View File

@ -1,121 +0,0 @@
/* XPM */
static const char * WiresharkDoc_24_xpm[] = {
/* columns rows colors chars-per-pixel */
"24 24 91 1 ",
" c #24A1D5",
". c #119CE0",
"X c #1A9FE2",
"o c #25A3E3",
"O c #2CA5E3",
"+ c #31A7E3",
"@ c #35A8E3",
"# c #3AABE2",
"$ c #53AFDC",
"% c #5FB0D4",
"& c #53B1DD",
"* c #6AB7D5",
"= c #62B5DD",
"- c #69B7DD",
"; c #6FB9DC",
": c #76BFD7",
"> c #43AEE3",
", c #44B0E5",
"< c #4CB2E4",
"1 c #54B3E3",
"2 c #58B5E3",
"3 c #5DB8E5",
"4 c #53B6E8",
"5 c #59B9EA",
"6 c #62BAE4",
"7 c #6CBDE5",
"8 c #6EC0E6",
"9 c #76C1E5",
"0 c #7FC5E6",
"q c #A4A4A2",
"w c #ACACA6",
"e c #ADADAB",
"r c #B3B3AD",
"t c #B3B3B0",
"y c #BABAB4",
"u c #BCBCB9",
"i c #C1BFB4",
"p c #C1C1B5",
"a c #C3C3BD",
"s c #86C0CC",
"d c #80C0DE",
"f c #99C7D1",
"g c #98C9D1",
"h c #A3C6CC",
"j c #B3CED3",
"k c #A6D4DB",
"l c #82C8EC",
"z c #8DCDEC",
"x c #90CEEB",
"c c #BDDBE4",
"v c #A9DBF0",
"b c #C3C3C0",
"n c #CACAC4",
"m c #CECECA",
"M c #CED6CE",
"N c #D2D2C1",
"B c #D2D2CC",
"V c #DBDCCC",
"C c #D7D7D4",
"Z c #DDDDD5",
"A c #DCDCD9",
"S c #DFE2D7",
"D c #E5E5D5",
"F c #EAEAD6",
"G c #E4E4DD",
"H c #EBEBDC",
"J c #F1EFDE",
"K c #F2F2DD",
"L c #C2DEE7",
"P c #C8DCE2",
"I c #C7E0E6",
"U c #CBE2E8",
"Y c #C3E5F5",
"T c #CDE8F6",
"R c #D9EEFA",
"E c #E7E7E1",
"W c #ECECE4",
"Q c #EEEEEB",
"! c #F1EFE7",
"~ c #F4F3E4",
"^ c #F9F7E3",
"/ c #FBFBE5",
"( c #F5F5EC",
") c #FEFEEB",
"_ c #E8F5F8",
"` c #F6F6F2",
"' c #F8F7F6",
"] c #FEFEF3",
"[ c #F5FDFF",
"{ c #FDFEFC",
"} c None",
/* pixels */
"}}}PUUUPLLccLccj}}}}}}}}",
"}}}$<>>#O<5OXX. f}}}}}}}",
"}}}=62<<lYR4OOo#g~}}}}}}",
"}}}-632zT{Y>++O,k{)}}}}}",
"}}};767T{{v##@O,sMSV}}}}",
"}}}:l9z_{{Y34<<,$=*:h}}}",
"}}}`{{{{{{{{{[[[[[[[W}}}",
"}}}'{{{{{{']{{{{{{{{W}}}",
"}}}'{{`CWQA(`CEQEQ{{!}}}",
"}}}`{'bqCneQmqBBeA'{Q}}}",
"}}}'](mmmQtQmmn'uC'{W}}}",
"}}}']'nuECeQmuEAeB'{~}}}",
"}}}`]]]Q](G('W]`HG'{~}}}",
"}}}(]]ZuEZn(An(Eum({W}}}",
"}}}(](arBSqHGy~ntrW{W}}}",
"}}}(]~maBGqDHyWmprW]W}}}",
"}}}())Gm/ZaHDb~EnD(]H}}}",
"}}}()])D^)F//D^)HG)]H}}}",
"}}}())aqVBwKBrKBrV)]H}}}",
"}}}))~maaKwF^yF^yN/]H}}}",
"}}}()/nyFBwDZwDZra/)F}}}",
"}}}^))/K)KFKJF/KFH/)F}}}",
"}}})))))/))/)/))))))H}}}",
"}}}ppppppppppppppppa}}}}",
};

View File

@ -3,7 +3,7 @@
<file>capture_start_24.png</file>
<file>capture_stop_24.png</file>
<file>capture_start_active_24.png</file>
<file>WiresharkDoc-24.png</file>
<file>toolbar/toolbar_wireshark_file_24.png</file>
</qresource>
<qresource prefix="/menu/help">
<file alias="wsicon16.xpm">wsicon16.xpm</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -132,6 +132,16 @@ pipe_icon.h:
echo >> $@
gdk-pixbuf-csource --raw --name=pipe_pb_data $(top_srcdir)/image/toolbar/pipe_16.png >> $@
toolbar_icons.h:
echo "/* This file was automatically generated. DO NOT EDIT. */" > $@
echo >> $@
for icon16 in wireshark_file ; do \
gdk-pixbuf-csource --raw --name=toolbar_$${icon16}_16_pb_data $(top_srcdir)/image/toolbar/toolbar_$${icon16}_16.png >> $@ ;\
done
for icon24 in wireshark_file ; do \
gdk-pixbuf-csource --raw --name=toolbar_$${icon24}_24_pb_data $(top_srcdir)/image/toolbar/toolbar_$${icon24}_24.png >> $@ ;\
done
EXTRA_DIST = \
$(GENERATOR_FILES) \
airpcap_dlg.c \

View File

@ -145,6 +145,7 @@ WIRESHARK_GTK_SRC = \
about_dlg.c main_welcome.c: ../../image/wssplash.xpm ../../image/wssplash-dev.xpm remote_icons.h
main_statusbar.c: expert_indicators.h capture_comment_icons.h
capture_if_dlg.c: network_icons.h remote_icons.h pipe_icon.h
stock_icons.c: toolbar_icons.h
WIRESHARK_TAP_SRC = \
afp_stat.c \
@ -336,6 +337,7 @@ noinst_HEADERS = \
supported_protos_dlg.h \
tap_param_dlg.h \
text_page_utils.h \
toolbar_icons.h \
uat_gui.h \
voip_calls.h \
voip_calls_dlg.h \

View File

@ -28,6 +28,7 @@
#include <gtk/gtk.h>
#include "ui/gtk/stock_icons.h"
#include "ui/gtk/toolbar_icons.h"
/* these icons are derived from the original stock icons */
#include "../../image/toolbar/capture_interfaces_24.xpm"
@ -72,13 +73,18 @@
#include "../../image/toolbar/voip_flow_24.xpm"
#include "../../image/toolbar/telephone_16.xpm"
#include "../../image/toolbar/analyze_24.xpm"
#include "../../image/WiresharkDoc_24.xpm"
typedef struct stock_pixmap_tag{
const char * name;
const char ** xpm_data;
} stock_pixmap_t;
typedef struct stock_pixbuf_tag{
const char * name;
const guint8 * pb_data16; /* Optional */
const guint8 * pb_data24; /* Mandatory */
} stock_pixbuf_t;
/* generate application specific stock items */
void stock_icons_init(void) {
GtkIconFactory * factory;
@ -211,10 +217,13 @@ void stock_icons_init(void) {
{ WIRESHARK_STOCK_TELEPHONE, telephone_16_xpm},
{ WIRESHARK_STOCK_PREPARE_FILTER, display_filter_24_xpm},
{ WIRESHARK_STOCK_ANALYZE, analyze_24_xpm},
{ WIRESHARK_STOCK_FILE, WiresharkDoc_24_xpm},
{ NULL, NULL }
};
static const stock_pixbuf_t pixbufs[] = {
{ WIRESHARK_STOCK_FILE, toolbar_wireshark_file_16_pb_data, toolbar_wireshark_file_24_pb_data},
{ NULL, NULL, NULL }
};
/* Register our stock items */
gtk_stock_add (stock_items, G_N_ELEMENTS (stock_items));
@ -222,7 +231,8 @@ void stock_icons_init(void) {
factory = gtk_icon_factory_new();
gtk_icon_factory_add_default(factory);
/* Create the stock items to add into our icon factory */
/* Add pixmaps our icon factory */
/* Please use pixbufs (below) for new icons */
for (i = 0; pixmaps[i].name != NULL; i++) {
/* The default icon */
pixbuf = gdk_pixbuf_new_from_xpm_data((const char **) (pixmaps[i].xpm_data));
@ -237,6 +247,23 @@ void stock_icons_init(void) {
g_object_unref (G_OBJECT (pixbuf));
}
/* Add pixbufs our icon factory */
for (i = 0; pixbufs[i].name != NULL; i++) {
/* Default image */
icon_set = gtk_icon_set_new_from_pixbuf(gdk_pixbuf_new_from_inline(-1, pixbufs[i].pb_data24, FALSE, NULL));
if (pixbufs[i].pb_data16) {
GtkIconSource *source16 = gtk_icon_source_new();
gtk_icon_source_set_pixbuf(source16, gdk_pixbuf_new_from_inline(-1, pixbufs[i].pb_data16, FALSE, NULL));
gtk_icon_source_set_size_wildcarded(source16, FALSE);
gtk_icon_source_set_size(source16, GTK_ICON_SIZE_MENU);
gtk_icon_set_add_source(icon_set, source16);
}
gtk_icon_factory_add (factory, pixbufs[i].name, icon_set);
gtk_icon_set_unref (icon_set);
}
/* use default stock icons for Wireshark specifics where the icon metapher makes sense */
/* PLEASE DON'T REUSE STOCK ICONS IF THEY ARE USUALLY USED FOR SOME DIFFERENT MEANING!!!) */
icon_set = gtk_icon_factory_lookup_default(GTK_STOCK_OPEN);
@ -270,4 +297,15 @@ void stock_icons_init(void) {
g_object_unref (G_OBJECT (factory));
}
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/

View File

@ -586,7 +586,7 @@
<action name="actionFileSave">
<property name="icon">
<iconset resource="../../image/toolbar.qrc">
<normaloff>:/toolbar/main/WiresharkDoc-24.png</normaloff>:/toolbar/main/WiresharkDoc-24.png</iconset>
<normaloff>:/toolbar/main/toolbar/toolbar_wireshark_file_24.png</normaloff>:/toolbar/main/toolbar/toolbar_wireshark_file_24.png</iconset>
</property>
<property name="text">
<string>&amp;Save</string>
@ -601,7 +601,7 @@
<action name="actionFileSaveAs">
<property name="icon">
<iconset resource="../../image/toolbar.qrc">
<normaloff>:/toolbar/main/WiresharkDoc-24.png</normaloff>:/toolbar/main/WiresharkDoc-24.png</iconset>
<normaloff>:/toolbar/main/toolbar/toolbar_wireshark_file_24.png</normaloff>:/toolbar/main/toolbar/toolbar_wireshark_file_24.png</iconset>
</property>
<property name="text">
<string>Save &amp;As...</string>