move stock icon code from toolbar.c into specific stock_icons file(s)
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 12 Apr 2008 00:49:20 +0000 (00:49 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 12 Apr 2008 00:49:20 +0000 (00:49 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24921 f5534014-38df-0310-8fa8-9805f1628bb7

30 files changed:
gtk/Makefile.am
gtk/Makefile.common
gtk/airpcap_dlg.c
gtk/capture_dlg.c
gtk/capture_if_dlg.c
gtk/capture_info_dlg.c
gtk/capture_prefs.c
gtk/color_dlg.c
gtk/color_edit_dlg.c
gtk/compat_macros.h
gtk/dcerpc_stat.c
gtk/dlg_utils.c
gtk/filter_dlg.c
gtk/find_dlg.c
gtk/follow_stream.c
gtk/io_stat.c
gtk/libui.vcproj
gtk/main.c
gtk/menu.c
gtk/prefs_dlg.c
gtk/print_dlg.c
gtk/print_prefs.c
gtk/rpc_stat.c
gtk/scsi_stat.c
gtk/simple_dialog.c
gtk/stock_icons.c [new file with mode: 0644]
gtk/stock_icons.h [new file with mode: 0644]
gtk/tap_dfilter_dlg.c
gtk/toolbar.c
gtk/uat_gui.c

index 732747c22ee6f1f4a3c7df8150ddc384528aa164..0ac538ecd78ab0a28226198c23655734616bac00 100644 (file)
@@ -117,6 +117,7 @@ noinst_HEADERS = \
        sctp_stat.h     \
        service_response_time_table.h   \
        gui_stat_menu.h \
+       stock_icons.h   \
        stream_prefs.h  \
        summary_dlg.h   \
        supported_protos_dlg.h   \
index f7914045425b697c09756c366737ebeea64b8ff6..e4b6574315c491988b0585b3798202d4c2b037ea 100644 (file)
@@ -110,6 +110,7 @@ WIRESHARK_GTK_SRC = \
        sctp_error_dlg.c        \
        service_response_time_table.c   \
        simple_dialog.c \
+       stock_icons.c   \
        stream_prefs.c  \
        summary_dlg.c   \
        supported_protos_dlg.c  \
index c1675e2eb106cf0e37c153c96184f15200edae99..c4a090fbfd9b79f839d56fd13c1511e9d88e9342 100644 (file)
@@ -51,7 +51,7 @@
 #include "gui_utils.h"
 #include "simple_dialog.h"
 #include "dfilter_expr_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "gtkglobals.h"
 #include "help_dlg.h"
 
index 3042bdd213afe35b31ec91355bfc883e40e5e8c5..ee8c4b49b9580dc8f86cfadc6180f7563cb6d308 100644 (file)
@@ -55,6 +55,7 @@
 #include "ringbuffer.h"
 #include <epan/filesystem.h>
 #include "compat_macros.h"
+#include "stock_icons.h"
 #include "capture_file_dlg.h"
 #include "help_dlg.h"
 #include "gtkglobals.h"
index 3e33dffcee6e0068822c1a4661a2e7a2b8752929..b7190cf871c7c31795fb176f3a8b66235caafaa6 100644 (file)
@@ -42,7 +42,7 @@
 #include "capture-wpcap.h"
 #endif
 
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "simple_dialog.h"
 #include "capture.h"
 #include "capture_dlg.h"
index 512b7104235f2837c3ee962147ac0648a3eacb28..fbe792a191be6eae9a9ecb135e755189742631d4 100644 (file)
@@ -35,7 +35,7 @@
 #ifdef HAVE_LIBPCAP
 
 #include <gtk/gtk.h>
-#include "gtk/compat_macros.h"
+#include "gtk/stock_icons.h"
 
 #include <time.h>
 
index c7390bc93635ae5824d57e62c916a51b9cb02424..4208026c5ccc6ad4884abfe290d37e69b6b3f04c 100644 (file)
@@ -42,7 +42,7 @@
 #include "capture-pcap-util.h"
 #include "capture_ui_utils.h"
 #include "main.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "capture.h"
 #include <epan/strutil.h>
 
index 8d3f4f6c6973e5686e28fa439d84233c30122cbe..4902ed498110f4322c11c48a3d7b78ac6f289120 100644 (file)
@@ -43,6 +43,7 @@
 #include "gui_utils.h"
 #include "dfilter_expr_dlg.h"
 #include "compat_macros.h"
+#include "stock_icons.h"
 #include "filter_dlg.h"
 #include "capture_file_dlg.h"
 #include "gtkglobals.h"
index 9687e5ac3cdf1f6ec92f451289420c9c5f7f5ad3..64f3a67e0e9124cc958e445a69448318760bf842 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "dlg_utils.h"
 #include "gui_utils.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "filter_dlg.h"
 #include "dfilter_expr_dlg.h"
 #include "simple_dialog.h"
index d85150f2d6321c02fe7428a17ea58b370bf20ecd..3c7be349becddb11afd55dab156d00c1f4921c54 100644 (file)
  *              gtk_widget_set_size_request, ...
  */
 
-
-#ifdef HAVE_LIBPCAP
-#define WIRESHARK_STOCK_CAPTURE_INTERFACES       "Wireshark_Stock_CaptureInterfaces"
-#define WIRESHARK_STOCK_CAPTURE_OPTIONS          "Wireshark_Stock_CaptureOptionss"
-#define WIRESHARK_STOCK_CAPTURE_START            "Wireshark_Stock_CaptureStart"
-#define WIRESHARK_STOCK_CAPTURE_STOP             "Wireshark_Stock_CaptureStop"
-#define WIRESHARK_STOCK_CAPTURE_RESTART          "Wireshark_Stock_CaptureRestart"
-#define WIRESHARK_STOCK_CAPTURE_FILTER           "Wireshark_Stock_CaptureFilter"
-#define WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY     "Wireshark_Stock_CaptureFilter_Entry"
-#define WIRESHARK_STOCK_CAPTURE_DETAILS          "Wireshark_Stock_CaptureDetails"
-#endif
-#define WIRESHARK_STOCK_DISPLAY_FILTER           "Wireshark_Stock_DisplayFilter"
-#define WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY     "Wireshark_Stock_DisplayFilter_Entry"
-#define WIRESHARK_STOCK_BROWSE                   "Wireshark_Stock_Browse"
-#define WIRESHARK_STOCK_CREATE_STAT              "Wireshark_Stock_CreateStat"
-#define WIRESHARK_STOCK_EXPORT                   "Wireshark_Stock_Export"
-#define WIRESHARK_STOCK_IMPORT                   "Wireshark_Stock_Import"
-#define WIRESHARK_STOCK_EDIT                     "Wireshark_Stock_Edit"
-#define WIRESHARK_STOCK_ADD_EXPRESSION           "Wireshark_Stock_Edit_Add_Expression"
-#define WIRESHARK_STOCK_DONT_SAVE                "Wireshark_Stock_Continue_without_Saving"
-#define WIRESHARK_STOCK_ABOUT                    "Wireshark_Stock_About"
-#define WIRESHARK_STOCK_COLORIZE                 "Wireshark_Stock_Colorize"
-#define WIRESHARK_STOCK_AUTOSCROLL               "Wireshark_Stock_Autoscroll"
-#define WIRESHARK_STOCK_RESIZE_COLUMNS           "Wireshark_Stock_Resize_Columns"
-#define WIRESHARK_STOCK_TIME                     "Wireshark_Stock_Time"
-#define WIRESHARK_STOCK_INTERNET                 "Wireshark_Stock_Internet"
-#define WIRESHARK_STOCK_WEB_SUPPORT              "Wireshark_Stock_Web_Support"
-#define WIRESHARK_STOCK_WIKI                     "Wireshark_Stock_Wiki"
-#define WIRESHARK_STOCK_CONVERSATIONS            "Wireshark_Stock_Conversations"
-#define WIRESHARK_STOCK_ENDPOINTS                "Wireshark_Stock_Endpoints"
-#define WIRESHARK_STOCK_GRAPHS                   "Wireshark_Stock_Graphs"
-#define WIRESHARK_STOCK_TELEPHONY                "Wireshark_Stock_Telephony"
-#define WIRESHARK_STOCK_DECODE_AS                "Wireshark_Stock_DecodeAs"
-#define WIRESHARK_STOCK_CHECKBOX                 "Wireshark_Stock_Checkbox"
-#define WIRESHARK_STOCK_FILE_SET_LIST            "Wireshark_Stock_File_Set_List"
-#define WIRESHARK_STOCK_FILE_SET_NEXT            "Wireshark_Stock_File_Set_Next"
-#define WIRESHARK_STOCK_FILE_SET_PREVIOUS        "Wireshark_Stock_File_Set_Previous"
-#define WIRESHARK_STOCK_FILTER_OUT_STREAM        "Wireshark_Stock_Filter_Out_This_Stream"
-#define WIRESHARK_STOCK_ENABLE                   "Wireshark_Stock_Enable"
-#define WIRESHARK_STOCK_DISABLE                  "Wireshark_Stock_Disable"
-#define WIRESHARK_STOCK_COLOR1                   "Wireshark_Stock_Color_1"
-#define WIRESHARK_STOCK_COLOR2                   "Wireshark_Stock_Color_2"
-#define WIRESHARK_STOCK_COLOR3                   "Wireshark_Stock_Color_3"
-#define WIRESHARK_STOCK_COLOR4                   "Wireshark_Stock_Color_4"
-#define WIRESHARK_STOCK_COLOR5                   "Wireshark_Stock_Color_5"
-#define WIRESHARK_STOCK_COLOR6                   "Wireshark_Stock_Color_6"
-#define WIRESHARK_STOCK_COLOR7                   "Wireshark_Stock_Color_7"
-#define WIRESHARK_STOCK_COLOR8                   "Wireshark_Stock_Color_8"
-#define WIRESHARK_STOCK_COLOR9                   "Wireshark_Stock_Color_9"
-#define WIRESHARK_STOCK_COLOR0                   "Wireshark_Stock_Color_10"
-
 /* for details, see "Pango Text Attribute Markup" */
 /* maybe it's a good idea to keep this macro beyond the ongoing GTK1 cleanup!
    If we want to change the look of the dialog boxes primary line the other day,
index ce7f9793d12c8da0a5bf5b750e54fdacb7d4457f..01cb0b0ac531dcdd1c57a2c79da545847ed4b3c6 100644 (file)
@@ -52,7 +52,7 @@
 #include <epan/dissectors/packet-dcerpc.h>
 #include "../globals.h"
 #include "filter_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "service_response_time_table.h"
 #include "gtkglobals.h"
 
index 6eac5e021414de1aa8cda603349d00a208058e8d..003b6dcac38b01db8b170be949144e0632870bb1 100644 (file)
@@ -32,7 +32,7 @@
 #include "gtkglobals.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 
 #include <string.h>
 #include <stdarg.h>
index 9de8df2788d19ddc15972b00dac899817eb06e8a..5f59ca54ca2d9b16ca33919217f27f69136fe84b 100644 (file)
@@ -39,7 +39,7 @@
 #include "gui_utils.h"
 #include "simple_dialog.h"
 #include "dfilter_expr_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "gtkglobals.h"
 #include "help_dlg.h"
 #include <epan/prefs.h>
index 544cf87c10d721792d78142fe7ae136788082964..fa9db5576d1689c96294a9e37beef521050bc282 100644 (file)
@@ -42,7 +42,7 @@
 #include "alert_box.h"
 #include "simple_dialog.h"
 #include "dlg_utils.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include <epan/prefs.h>
 #include "prefs_dlg.h"
 #include "keys.h"
index 1f5fcb6c8424f15147a946e7b4d642147c0b00fe..75fea03b6812f8664d552d91c6ddfe466932b438 100644 (file)
@@ -40,7 +40,7 @@
 #include <epan/filesystem.h>
 #include <epan/prefs.h>
 #include <gtk/colors.h>
-#include <gtk/compat_macros.h>
+#include <gtk/stock_icons.h>
 #include <gtk/dlg_utils.h>
 #include <gtk/follow_stream.h>
 #include <gtk/font_utils.h>
index 1dec61e410512bed38834324328c234428f03dcd..cd83f30bbb280a67310cd8e0a3aa03b59d697a45 100644 (file)
@@ -51,7 +51,7 @@
 #include "simple_dialog.h"
 #include "../globals.h"
 #include "../color.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "dlg_utils.h"
 #include "filter_dlg.h"
 #include "help_dlg.h"
index 3297042a09fb6557372007d8d33810e22f10130b..c888b221534c128a06bcee68fbf1c2a4919aef77 100644 (file)
                                RelativePath=".\stats_tree_stat.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath=".\stock_icons.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath=".\stream_prefs.c"\r
                                >\r
                                RelativePath=".\ssl-dlg.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath=".\stock_icons.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath=".\stream_prefs.h"\r
                                >\r
index 28e0712f00e9beb6f32da4ebb39d4d2b1ed1e87f..7695c66fc9ea9ee447d3b464ce4a007b6741814f 100644 (file)
 #include "proto_draw.h"
 #include "keys.h"
 #include "packet_win.h"
+#include "stock_icons.h"
 #include "toolbar.h"
 #include "find_dlg.h"
 #include "packet_list.h"
@@ -2931,6 +2932,8 @@ main(int argc, char *argv[])
 
   font_init();
 
+  stock_icons_init();
+
   /* close the splash screen, as we are going to open the main window now */
   splash_destroy(splash_win);
 
index fa08b82542a7d2181918e4970d712a2060b377c3..fb63a5920792841cb193fa68d82d9f35994eaecf 100644 (file)
@@ -69,6 +69,7 @@
 #include <epan/plugins.h>
 #include <epan/epan_dissect.h>
 #include "compat_macros.h"
+#include "stock_icons.h"
 #include "toolbar.h"
 #include "gtkglobals.h"
 #include "register.h"
index d0559ac67e6a9f022c4fb4f23d290a7965b49a23..1ead8c28584048a0e4a47904a3dd58eb7cc1e9f0 100644 (file)
@@ -49,7 +49,7 @@
 #include "gui_utils.h"
 #include "dlg_utils.h"
 #include "simple_dialog.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "help_dlg.h"
 #include "keys.h"
 #include "uat_gui.h"
index 7d2fdeba190a5d760e1e9fd92a708d762096edb0..ad45d377d1ed3340ab3e4dc8af251b0892fbec79 100644 (file)
@@ -47,7 +47,7 @@
 #ifdef _WIN32
 #include "print_mswin.h"
 #endif
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "range_utils.h"
 #include "help_dlg.h"
 #include "file_util.h"
index eb7aac743bbcc65e8fa9a2c9ff2d84f8f2336c1e..79a2ac78c31f4689a82fbd34b73f76b622e34c55 100644 (file)
@@ -42,7 +42,7 @@
 #endif
 #include "file_dlg.h"
 #include "capture_file_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "gtkglobals.h"
 
 static void printer_browse_file_cb(GtkWidget *file_bt, GtkWidget *file_te);
index 1ef5b027679e55f981df3aa3d4549d3a5331f63e..3d29d58a266c7869385ac9b261e83484c7684ec5 100644 (file)
@@ -49,7 +49,7 @@
 #include "main.h"
 #include "globals.h"
 #include "filter_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "service_response_time_table.h"
 #include "gtkglobals.h"
 
index 60c66cb798ce9b3e5c1f39734e4ea1495b92412d..33279ca0dc9e665a7c38908aa2afc781fe84e458 100644 (file)
@@ -46,7 +46,7 @@
 #include "main.h"
 #include "globals.h"
 #include "filter_dlg.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "service_response_time_table.h"
 #include "gtkglobals.h"
 #include <epan/conversation.h>
index 2617a336799fe066b2a8f69e0852a46cc6533ce1..1fe5767b83ef51cf9379a8e02155dc0fc4985252 100644 (file)
@@ -35,6 +35,7 @@
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "compat_macros.h"
+#include "stock_icons.h"
 
 #include <epan/strutil.h>
 
diff --git a/gtk/stock_icons.c b/gtk/stock_icons.c
new file mode 100644 (file)
index 0000000..eab3c6e
--- /dev/null
@@ -0,0 +1,220 @@
+/* stock_icons.c
+ * Wireshark specific stock icons
+ * Copyright 2003-2008, Ulf Lamping <ulf.lamping@web.de>
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gtk/gtk.h>
+#include "stock_icons.h"
+
+/* these icons are derived from the original stock icons */
+#ifdef HAVE_LIBPCAP
+#include "../image/toolbar/capture_interfaces_24.xpm"
+#include "../image/toolbar/capture_options_24.xpm"
+#include "../image/toolbar/capture_start_24.xpm"
+#include "../image/toolbar/capture_stop_24.xpm"
+#include "../image/toolbar/capture_restart_24.xpm"
+#include "../image/toolbar/capture_filter_24.xpm"
+#include "../image/toolbar/capture_details_24.xpm"
+#endif /* HAVE_LIBPCAP */
+#include "../image/toolbar/display_filter_24.xpm"
+/* these icons are standard stock icons, but used for Wireshark specific stock icon labels */
+#include "../image/toolbar/stock_add_24.xpm"
+#include "../image/toolbar/stock_open_24.xpm"
+#include "../image/toolbar/stock_ok_20.xpm"
+#include "../image/toolbar/stock_save_24.xpm"
+#include "../image/toolbar/stock_properties_24.xpm"
+#include "../image/wsicon16.xpm"
+#include "../image/toolbar/colorize_24.xpm"
+#include "../image/toolbar/autoscroll_24.xpm"
+#include "../image/toolbar/resize_columns_24.xpm"
+#include "../image/toolbar/time_24.xpm"
+#include "../image/toolbar/internet_24.xpm"
+#include "../image/toolbar/web_support_24.xpm"
+#include "../image/toolbar/wiki_24.xpm"
+#include "../image/toolbar/conversations_16.xpm"
+#include "../image/toolbar/endpoints_16.xpm"
+#include "../image/toolbar/graphs_16.xpm"
+#include "../image/toolbar/telephony_16.xpm"
+#include "../image/toolbar/decode_as_16.xpm"
+#include "../image/toolbar/checkbox_16.xpm"
+#include "../image/toolbar/file_set_list_16.xpm"
+#include "../image/toolbar/file_set_next_16.xpm"
+#include "../image/toolbar/file_set_previous_16.xpm"
+#include "../image/toolbar/stock_close_24.xpm"
+#include "../image/toolbar/icon_color_1.xpm"
+#include "../image/toolbar/icon_color_2.xpm"
+#include "../image/toolbar/icon_color_3.xpm"
+#include "../image/toolbar/icon_color_4.xpm"
+#include "../image/toolbar/icon_color_5.xpm"
+#include "../image/toolbar/icon_color_6.xpm"
+#include "../image/toolbar/icon_color_7.xpm"
+#include "../image/toolbar/icon_color_8.xpm"
+#include "../image/toolbar/icon_color_9.xpm"
+#include "../image/toolbar/icon_color_0.xpm"
+
+
+typedef struct stock_pixmap_tag{
+    const char *    name;
+    const char **   xpm_data;
+} stock_pixmap_t;
+
+/* generate application specific stock items */
+void stock_icons_init(void) {
+    GtkIconFactory * factory;
+    gint32 i;
+
+
+    /* register non-standard pixmaps with the gtk-stock engine */
+    static const GtkStockItem stock_items[] = {
+#ifdef HAVE_LIBPCAP
+        { WIRESHARK_STOCK_CAPTURE_INTERFACES,    "_Interfaces",    0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_OPTIONS,       "_Options",       0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_START,         "_Start",         0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_STOP,          "S_top",          0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_RESTART,       "_Restart",       0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_FILTER,        "_CFilter",        0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  "_Capture Filter:",  0, 0, NULL },
+        { WIRESHARK_STOCK_CAPTURE_DETAILS,       "_Details",       0, 0, NULL },
+#endif
+        { WIRESHARK_STOCK_DISPLAY_FILTER,        "_Filter",        0, 0, NULL },
+        { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY,  "_Filter:",  0, 0, NULL },
+        { WIRESHARK_STOCK_BROWSE,                "_Browse...",                0, 0, NULL },
+        { WIRESHARK_STOCK_CREATE_STAT,           "Create _Stat",           0, 0, NULL },
+        { WIRESHARK_STOCK_EXPORT,                "_Export...",                0, 0, NULL },
+        { WIRESHARK_STOCK_IMPORT,                "_Import...",                0, 0, NULL },
+        { WIRESHARK_STOCK_EDIT,                  "_Edit...",                  0, 0, NULL },
+        { WIRESHARK_STOCK_ADD_EXPRESSION,        "_Expression..." ,        0, 0, NULL }, /* plus sign coming from icon */
+        { WIRESHARK_STOCK_DONT_SAVE,             "Continue _without Saving",             0, 0, NULL },
+        { WIRESHARK_STOCK_ABOUT,                 "_About",                 0, 0, NULL },
+        { WIRESHARK_STOCK_COLORIZE,              "_Colorize",              0, 0, NULL },
+        { WIRESHARK_STOCK_AUTOSCROLL,            "_Auto Scroll in Live Capture",            0, 0, NULL },
+        { WIRESHARK_STOCK_RESIZE_COLUMNS,        "Resize Columns",        0, 0, NULL },
+        { WIRESHARK_STOCK_TIME,                  "Time",                  0, 0, NULL },
+        { WIRESHARK_STOCK_INTERNET,              "Internet",              0, 0, NULL },
+        { WIRESHARK_STOCK_WEB_SUPPORT,           "Web Support",           0, 0, NULL },
+        { WIRESHARK_STOCK_WIKI,                  "Wiki",                  0, 0, NULL },
+        { WIRESHARK_STOCK_CONVERSATIONS,         "Conversations",         0, 0, NULL },
+        { WIRESHARK_STOCK_ENDPOINTS,             "Endpoints",             0, 0, NULL },
+        { WIRESHARK_STOCK_GRAPHS,                "Graphs",                0, 0, NULL },
+        { WIRESHARK_STOCK_TELEPHONY,             "Telephony",             0, 0, NULL },
+        { WIRESHARK_STOCK_DECODE_AS,             "Decode As",             0, 0, NULL },
+        { WIRESHARK_STOCK_CHECKBOX,              "Checkbox",              0, 0, NULL },
+        { WIRESHARK_STOCK_FILE_SET_LIST,         "List Files",         0, 0, NULL },
+        { WIRESHARK_STOCK_FILE_SET_NEXT,         "Next File",         0, 0, NULL },
+        { WIRESHARK_STOCK_FILE_SET_PREVIOUS,     "Previous File",     0, 0, NULL },
+        { WIRESHARK_STOCK_FILTER_OUT_STREAM,     "Filter Out This Stream",     0, 0, NULL },
+        { WIRESHARK_STOCK_ENABLE,                "Enable",                0, 0, NULL },
+        { WIRESHARK_STOCK_DISABLE,               "Disable",               0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR1,                "Color 1",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR2,                "Color 2",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR3,                "Color 3",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR4,                "Color 4",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR5,                "Color 5",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR6,                "Color 6",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR7,                "Color 7",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR8,                "Color 8",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR9,                "Color 9",                0, 0, NULL },
+        { WIRESHARK_STOCK_COLOR0,                "Color 10",                0, 0, NULL }
+    };
+
+    static const stock_pixmap_t pixmaps[] = {
+#ifdef HAVE_LIBPCAP
+        { WIRESHARK_STOCK_CAPTURE_INTERFACES,    capture_interfaces_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_OPTIONS,       capture_options_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_START,         capture_start_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_STOP,          capture_stop_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_RESTART,       capture_restart_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_FILTER,        capture_filter_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  capture_filter_24_xpm },
+        { WIRESHARK_STOCK_CAPTURE_DETAILS,       capture_details_24_xpm },
+#endif
+        { WIRESHARK_STOCK_DISPLAY_FILTER,        display_filter_24_xpm },
+        { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY,  display_filter_24_xpm },
+        { WIRESHARK_STOCK_BROWSE,                stock_open_24_xpm },
+        { WIRESHARK_STOCK_CREATE_STAT,           stock_ok_20_xpm },
+        { WIRESHARK_STOCK_EXPORT,                stock_save_24_xpm },    /* XXX: needs a better icon */
+        { WIRESHARK_STOCK_IMPORT,                stock_save_24_xpm },    /* XXX: needs a better icon */
+        { WIRESHARK_STOCK_EDIT,                  stock_properties_24_xpm },
+        { WIRESHARK_STOCK_ADD_EXPRESSION,        stock_add_24_xpm },
+        { WIRESHARK_STOCK_ABOUT,                 wsicon16_xpm },
+        { WIRESHARK_STOCK_COLORIZE,              colorize_24_xpm },
+        { WIRESHARK_STOCK_AUTOSCROLL,            autoscroll_24_xpm },
+        { WIRESHARK_STOCK_RESIZE_COLUMNS,        resize_columns_24_xpm},
+        { WIRESHARK_STOCK_TIME,                  time_24_xpm},
+        { WIRESHARK_STOCK_INTERNET,              internet_24_xpm},
+        { WIRESHARK_STOCK_WEB_SUPPORT,           web_support_24_xpm},
+        { WIRESHARK_STOCK_WIKI,                  wiki_24_xpm},
+        { WIRESHARK_STOCK_CONVERSATIONS,         conversations_16_xpm},
+        { WIRESHARK_STOCK_ENDPOINTS,             endpoints_16_xpm},
+        { WIRESHARK_STOCK_GRAPHS,                graphs_16_xpm},
+        { WIRESHARK_STOCK_TELEPHONY,             telephony_16_xpm},
+        { WIRESHARK_STOCK_DECODE_AS,             decode_as_16_xpm},
+        { WIRESHARK_STOCK_CHECKBOX,              checkbox_16_xpm},
+        { WIRESHARK_STOCK_FILE_SET_LIST,         file_set_list_16_xpm},
+        { WIRESHARK_STOCK_FILE_SET_NEXT,         file_set_next_16_xpm},
+        { WIRESHARK_STOCK_FILE_SET_PREVIOUS,     file_set_previous_16_xpm},
+        { WIRESHARK_STOCK_FILTER_OUT_STREAM,     display_filter_24_xpm},
+        { WIRESHARK_STOCK_ENABLE,                checkbox_16_xpm},
+        { WIRESHARK_STOCK_DISABLE,               stock_close_24_xpm},
+        { WIRESHARK_STOCK_COLOR1,                icon_color_1_xpm},
+        { WIRESHARK_STOCK_COLOR2,                icon_color_2_xpm},
+        { WIRESHARK_STOCK_COLOR3,                icon_color_3_xpm},
+        { WIRESHARK_STOCK_COLOR4,                icon_color_4_xpm},
+        { WIRESHARK_STOCK_COLOR5,                icon_color_5_xpm},
+        { WIRESHARK_STOCK_COLOR6,                icon_color_6_xpm},
+        { WIRESHARK_STOCK_COLOR7,                icon_color_7_xpm},
+        { WIRESHARK_STOCK_COLOR8,                icon_color_8_xpm},
+        { WIRESHARK_STOCK_COLOR9,                icon_color_9_xpm},
+        { WIRESHARK_STOCK_COLOR0,                icon_color_0_xpm},
+        { NULL, NULL }
+    };
+
+    /* Register our stock items */
+    gtk_stock_add (stock_items, G_N_ELEMENTS (stock_items));
+
+    /* Add our custom icon factory to the list of defaults */
+    factory = gtk_icon_factory_new();
+    gtk_icon_factory_add_default(factory);
+
+    /* Create the stock items to add into our icon factory */
+    for (i = 0; pixmaps[i].name != NULL; i++) {
+        GdkPixbuf * pixbuf;
+        GtkIconSet *icon_set;
+
+        pixbuf = gdk_pixbuf_new_from_xpm_data((const char **) (pixmaps[i].xpm_data));
+        g_assert(pixbuf);
+        icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
+        gtk_icon_factory_add (factory, pixmaps[i].name, icon_set);
+        gtk_icon_set_unref (icon_set);
+        g_object_unref (G_OBJECT (pixbuf));
+    }
+
+    /* Drop our reference to the factory, GTK will hold a reference.*/
+    g_object_unref (G_OBJECT (factory));
+}
+
+
diff --git a/gtk/stock_icons.h b/gtk/stock_icons.h
new file mode 100644 (file)
index 0000000..05d8503
--- /dev/null
@@ -0,0 +1,83 @@
+/* stock_icons.h
+ * Wireshark specific stock icons
+ * Copyright 2003-2008, Ulf Lamping <ulf.lamping@web.de>
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __STOCK_ICONS_H__
+#define __STOCK_ICONS_H__
+
+
+#ifdef HAVE_LIBPCAP
+#define WIRESHARK_STOCK_CAPTURE_INTERFACES       "Wireshark_Stock_CaptureInterfaces"
+#define WIRESHARK_STOCK_CAPTURE_OPTIONS          "Wireshark_Stock_CaptureOptionss"
+#define WIRESHARK_STOCK_CAPTURE_START            "Wireshark_Stock_CaptureStart"
+#define WIRESHARK_STOCK_CAPTURE_STOP             "Wireshark_Stock_CaptureStop"
+#define WIRESHARK_STOCK_CAPTURE_RESTART          "Wireshark_Stock_CaptureRestart"
+#define WIRESHARK_STOCK_CAPTURE_FILTER           "Wireshark_Stock_CaptureFilter"
+#define WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY     "Wireshark_Stock_CaptureFilter_Entry"
+#define WIRESHARK_STOCK_CAPTURE_DETAILS          "Wireshark_Stock_CaptureDetails"
+#endif
+#define WIRESHARK_STOCK_DISPLAY_FILTER           "Wireshark_Stock_DisplayFilter"
+#define WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY     "Wireshark_Stock_DisplayFilter_Entry"
+#define WIRESHARK_STOCK_BROWSE                   "Wireshark_Stock_Browse"
+#define WIRESHARK_STOCK_CREATE_STAT              "Wireshark_Stock_CreateStat"
+#define WIRESHARK_STOCK_EXPORT                   "Wireshark_Stock_Export"
+#define WIRESHARK_STOCK_IMPORT                   "Wireshark_Stock_Import"
+#define WIRESHARK_STOCK_EDIT                     "Wireshark_Stock_Edit"
+#define WIRESHARK_STOCK_ADD_EXPRESSION           "Wireshark_Stock_Edit_Add_Expression"
+#define WIRESHARK_STOCK_DONT_SAVE                "Wireshark_Stock_Continue_without_Saving"
+#define WIRESHARK_STOCK_ABOUT                    "Wireshark_Stock_About"
+#define WIRESHARK_STOCK_COLORIZE                 "Wireshark_Stock_Colorize"
+#define WIRESHARK_STOCK_AUTOSCROLL               "Wireshark_Stock_Autoscroll"
+#define WIRESHARK_STOCK_RESIZE_COLUMNS           "Wireshark_Stock_Resize_Columns"
+#define WIRESHARK_STOCK_TIME                     "Wireshark_Stock_Time"
+#define WIRESHARK_STOCK_INTERNET                 "Wireshark_Stock_Internet"
+#define WIRESHARK_STOCK_WEB_SUPPORT              "Wireshark_Stock_Web_Support"
+#define WIRESHARK_STOCK_WIKI                     "Wireshark_Stock_Wiki"
+#define WIRESHARK_STOCK_CONVERSATIONS            "Wireshark_Stock_Conversations"
+#define WIRESHARK_STOCK_ENDPOINTS                "Wireshark_Stock_Endpoints"
+#define WIRESHARK_STOCK_GRAPHS                   "Wireshark_Stock_Graphs"
+#define WIRESHARK_STOCK_TELEPHONY                "Wireshark_Stock_Telephony"
+#define WIRESHARK_STOCK_DECODE_AS                "Wireshark_Stock_DecodeAs"
+#define WIRESHARK_STOCK_CHECKBOX                 "Wireshark_Stock_Checkbox"
+#define WIRESHARK_STOCK_FILE_SET_LIST            "Wireshark_Stock_File_Set_List"
+#define WIRESHARK_STOCK_FILE_SET_NEXT            "Wireshark_Stock_File_Set_Next"
+#define WIRESHARK_STOCK_FILE_SET_PREVIOUS        "Wireshark_Stock_File_Set_Previous"
+#define WIRESHARK_STOCK_FILTER_OUT_STREAM        "Wireshark_Stock_Filter_Out_This_Stream"
+#define WIRESHARK_STOCK_ENABLE                   "Wireshark_Stock_Enable"
+#define WIRESHARK_STOCK_DISABLE                  "Wireshark_Stock_Disable"
+#define WIRESHARK_STOCK_COLOR1                   "Wireshark_Stock_Color_1"
+#define WIRESHARK_STOCK_COLOR2                   "Wireshark_Stock_Color_2"
+#define WIRESHARK_STOCK_COLOR3                   "Wireshark_Stock_Color_3"
+#define WIRESHARK_STOCK_COLOR4                   "Wireshark_Stock_Color_4"
+#define WIRESHARK_STOCK_COLOR5                   "Wireshark_Stock_Color_5"
+#define WIRESHARK_STOCK_COLOR6                   "Wireshark_Stock_Color_6"
+#define WIRESHARK_STOCK_COLOR7                   "Wireshark_Stock_Color_7"
+#define WIRESHARK_STOCK_COLOR8                   "Wireshark_Stock_Color_8"
+#define WIRESHARK_STOCK_COLOR9                   "Wireshark_Stock_Color_9"
+#define WIRESHARK_STOCK_COLOR0                   "Wireshark_Stock_Color_10"
+
+
+void stock_icons_init(void);
+
+#endif /* __STOCK_ICONS_H__ */
index ae94ad6f50f9c7f8225147ef068d3e01149dca97..c8d6e096f765f0a1bef5720cff224e978ebccad2 100644 (file)
@@ -36,7 +36,7 @@
 #include <gtk/gtk.h>
 #include <string.h>
 
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include "../simple_dialog.h"
 #include "dlg_utils.h"
 #include "../file.h"
index 9ccef2f8d4ee21734b8c220113e499f81b2fe463..6e8cd368320e0ff98754dff07c41c9ac950a9bea 100644 (file)
@@ -47,7 +47,7 @@
 #include "main.h"
 #include "help_dlg.h"
 #include "gtkglobals.h"
-#include "toolbar.h"
+#include "stock_icons.h"
 #include "keys.h"
 #include "compat_macros.h"
 #include "recent.h"
 #include "color_filters.h"
 #include "menu.h"
 
-/* these icons are derived from the original stock icons */
-#ifdef HAVE_LIBPCAP
-#include "../image/toolbar/capture_interfaces_24.xpm"
-#include "../image/toolbar/capture_options_24.xpm"
-#include "../image/toolbar/capture_start_24.xpm"
-#include "../image/toolbar/capture_stop_24.xpm"
-#include "../image/toolbar/capture_restart_24.xpm"
-#include "../image/toolbar/capture_filter_24.xpm"
-#include "../image/toolbar/capture_details_24.xpm"
-#endif /* HAVE_LIBPCAP */
-#include "../image/toolbar/display_filter_24.xpm"
-/* these icons are standard stock icons, but used for Wireshark specific stock icon labels */
-#include "../image/toolbar/stock_add_24.xpm"
-#include "../image/toolbar/stock_open_24.xpm"
-#include "../image/toolbar/stock_ok_20.xpm"
-#include "../image/toolbar/stock_save_24.xpm"
-#include "../image/toolbar/stock_properties_24.xpm"
-#include "../image/wsicon16.xpm"
-#include "../image/toolbar/colorize_24.xpm"
-#include "../image/toolbar/autoscroll_24.xpm"
-#include "../image/toolbar/resize_columns_24.xpm"
-#include "../image/toolbar/time_24.xpm"
-#include "../image/toolbar/internet_24.xpm"
-#include "../image/toolbar/web_support_24.xpm"
-#include "../image/toolbar/wiki_24.xpm"
-#include "../image/toolbar/conversations_16.xpm"
-#include "../image/toolbar/endpoints_16.xpm"
-#include "../image/toolbar/graphs_16.xpm"
-#include "../image/toolbar/telephony_16.xpm"
-#include "../image/toolbar/decode_as_16.xpm"
-#include "../image/toolbar/checkbox_16.xpm"
-#include "../image/toolbar/file_set_list_16.xpm"
-#include "../image/toolbar/file_set_next_16.xpm"
-#include "../image/toolbar/file_set_previous_16.xpm"
-#include "../image/toolbar/stock_close_24.xpm"
-#include "../image/toolbar/icon_color_1.xpm"
-#include "../image/toolbar/icon_color_2.xpm"
-#include "../image/toolbar/icon_color_3.xpm"
-#include "../image/toolbar/icon_color_4.xpm"
-#include "../image/toolbar/icon_color_5.xpm"
-#include "../image/toolbar/icon_color_6.xpm"
-#include "../image/toolbar/icon_color_7.xpm"
-#include "../image/toolbar/icon_color_8.xpm"
-#include "../image/toolbar/icon_color_9.xpm"
-#include "../image/toolbar/icon_color_0.xpm"
 
 
 /* XXX: add this key to some .h file, as it adds a key to the top level Widget? */
@@ -132,146 +87,6 @@ static BUTTON_TYPE *save_as_button;
 #define SAVE_BUTTON_TOOLTIP_TEXT "Save this capture file..."
 #define SAVE_AS_BUTTON_TOOLTIP_TEXT "Save this capture file as..."
 
-typedef struct stock_pixmap_tag{
-    const char *    name;
-    const char **   xpm_data;
-} stock_pixmap_t;
-
-/* generate application specific stock items */
-static void wireshark_stock_icons(void) {
-    GtkIconFactory * factory;
-    gint32 i;
-
-
-    /* register non-standard pixmaps with the gtk-stock engine */
-    static const GtkStockItem stock_items[] = {
-#ifdef HAVE_LIBPCAP
-        { WIRESHARK_STOCK_CAPTURE_INTERFACES,    "_Interfaces",    0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_OPTIONS,       "_Options",       0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_START,         "_Start",         0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_STOP,          "S_top",          0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_RESTART,       "_Restart",       0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_FILTER,        "_CFilter",        0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  "_Capture Filter:",  0, 0, NULL },
-        { WIRESHARK_STOCK_CAPTURE_DETAILS,       "_Details",       0, 0, NULL },
-#endif
-        { WIRESHARK_STOCK_DISPLAY_FILTER,        "_Filter",        0, 0, NULL },
-        { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY,  "_Filter:",  0, 0, NULL },
-        { WIRESHARK_STOCK_BROWSE,                "_Browse...",                0, 0, NULL },
-        { WIRESHARK_STOCK_CREATE_STAT,           "Create _Stat",           0, 0, NULL },
-        { WIRESHARK_STOCK_EXPORT,                "_Export...",                0, 0, NULL },
-        { WIRESHARK_STOCK_IMPORT,                "_Import...",                0, 0, NULL },
-        { WIRESHARK_STOCK_EDIT,                  "_Edit...",                  0, 0, NULL },
-        { WIRESHARK_STOCK_ADD_EXPRESSION,        "_Expression..." ,        0, 0, NULL }, /* plus sign coming from icon */
-        { WIRESHARK_STOCK_DONT_SAVE,             "Continue _without Saving",             0, 0, NULL },
-        { WIRESHARK_STOCK_ABOUT,                 "_About",                 0, 0, NULL },
-        { WIRESHARK_STOCK_COLORIZE,              "_Colorize",              0, 0, NULL },
-        { WIRESHARK_STOCK_AUTOSCROLL,            "_Auto Scroll in Live Capture",            0, 0, NULL },
-        { WIRESHARK_STOCK_RESIZE_COLUMNS,        "Resize Columns",        0, 0, NULL },
-        { WIRESHARK_STOCK_TIME,                  "Time",                  0, 0, NULL },
-        { WIRESHARK_STOCK_INTERNET,              "Internet",              0, 0, NULL },
-        { WIRESHARK_STOCK_WEB_SUPPORT,           "Web Support",           0, 0, NULL },
-        { WIRESHARK_STOCK_WIKI,                  "Wiki",                  0, 0, NULL },
-        { WIRESHARK_STOCK_CONVERSATIONS,         "Conversations",         0, 0, NULL },
-        { WIRESHARK_STOCK_ENDPOINTS,             "Endpoints",             0, 0, NULL },
-        { WIRESHARK_STOCK_GRAPHS,                "Graphs",                0, 0, NULL },
-        { WIRESHARK_STOCK_TELEPHONY,             "Telephony",             0, 0, NULL },
-        { WIRESHARK_STOCK_DECODE_AS,             "Decode As",             0, 0, NULL },
-        { WIRESHARK_STOCK_CHECKBOX,              "Checkbox",              0, 0, NULL },
-        { WIRESHARK_STOCK_FILE_SET_LIST,         "List Files",         0, 0, NULL },
-        { WIRESHARK_STOCK_FILE_SET_NEXT,         "Next File",         0, 0, NULL },
-        { WIRESHARK_STOCK_FILE_SET_PREVIOUS,     "Previous File",     0, 0, NULL },
-        { WIRESHARK_STOCK_FILTER_OUT_STREAM,     "Filter Out This Stream",     0, 0, NULL },
-        { WIRESHARK_STOCK_ENABLE,                "Enable",                0, 0, NULL },
-        { WIRESHARK_STOCK_DISABLE,               "Disable",               0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR1,                "Color 1",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR2,                "Color 2",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR3,                "Color 3",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR4,                "Color 4",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR5,                "Color 5",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR6,                "Color 6",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR7,                "Color 7",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR8,                "Color 8",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR9,                "Color 9",                0, 0, NULL },
-        { WIRESHARK_STOCK_COLOR0,                "Color 10",                0, 0, NULL }
-    };
-
-    static const stock_pixmap_t pixmaps[] = {
-#ifdef HAVE_LIBPCAP
-        { WIRESHARK_STOCK_CAPTURE_INTERFACES,    capture_interfaces_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_OPTIONS,       capture_options_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_START,         capture_start_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_STOP,          capture_stop_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_RESTART,       capture_restart_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_FILTER,        capture_filter_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_FILTER_ENTRY,  capture_filter_24_xpm },
-        { WIRESHARK_STOCK_CAPTURE_DETAILS,       capture_details_24_xpm },
-#endif
-        { WIRESHARK_STOCK_DISPLAY_FILTER,        display_filter_24_xpm },
-        { WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY,  display_filter_24_xpm },
-        { WIRESHARK_STOCK_BROWSE,                stock_open_24_xpm },
-        { WIRESHARK_STOCK_CREATE_STAT,           stock_ok_20_xpm },
-        { WIRESHARK_STOCK_EXPORT,                stock_save_24_xpm },    /* XXX: needs a better icon */
-        { WIRESHARK_STOCK_IMPORT,                stock_save_24_xpm },    /* XXX: needs a better icon */
-        { WIRESHARK_STOCK_EDIT,                  stock_properties_24_xpm },
-        { WIRESHARK_STOCK_ADD_EXPRESSION,        stock_add_24_xpm },
-        { WIRESHARK_STOCK_ABOUT,                 wsicon16_xpm },
-        { WIRESHARK_STOCK_COLORIZE,              colorize_24_xpm },
-        { WIRESHARK_STOCK_AUTOSCROLL,            autoscroll_24_xpm },
-        { WIRESHARK_STOCK_RESIZE_COLUMNS,        resize_columns_24_xpm},
-        { WIRESHARK_STOCK_TIME,                  time_24_xpm},
-        { WIRESHARK_STOCK_INTERNET,              internet_24_xpm},
-        { WIRESHARK_STOCK_WEB_SUPPORT,           web_support_24_xpm},
-        { WIRESHARK_STOCK_WIKI,                  wiki_24_xpm},
-        { WIRESHARK_STOCK_CONVERSATIONS,         conversations_16_xpm},
-        { WIRESHARK_STOCK_ENDPOINTS,             endpoints_16_xpm},
-        { WIRESHARK_STOCK_GRAPHS,                graphs_16_xpm},
-        { WIRESHARK_STOCK_TELEPHONY,             telephony_16_xpm},
-        { WIRESHARK_STOCK_DECODE_AS,             decode_as_16_xpm},
-        { WIRESHARK_STOCK_CHECKBOX,              checkbox_16_xpm},
-        { WIRESHARK_STOCK_FILE_SET_LIST,         file_set_list_16_xpm},
-        { WIRESHARK_STOCK_FILE_SET_NEXT,         file_set_next_16_xpm},
-        { WIRESHARK_STOCK_FILE_SET_PREVIOUS,     file_set_previous_16_xpm},
-        { WIRESHARK_STOCK_FILTER_OUT_STREAM,     display_filter_24_xpm},
-        { WIRESHARK_STOCK_ENABLE,                checkbox_16_xpm},
-        { WIRESHARK_STOCK_DISABLE,               stock_close_24_xpm},
-        { WIRESHARK_STOCK_COLOR1,                icon_color_1_xpm},
-        { WIRESHARK_STOCK_COLOR2,                icon_color_2_xpm},
-        { WIRESHARK_STOCK_COLOR3,                icon_color_3_xpm},
-        { WIRESHARK_STOCK_COLOR4,                icon_color_4_xpm},
-        { WIRESHARK_STOCK_COLOR5,                icon_color_5_xpm},
-        { WIRESHARK_STOCK_COLOR6,                icon_color_6_xpm},
-        { WIRESHARK_STOCK_COLOR7,                icon_color_7_xpm},
-        { WIRESHARK_STOCK_COLOR8,                icon_color_8_xpm},
-        { WIRESHARK_STOCK_COLOR9,                icon_color_9_xpm},
-        { WIRESHARK_STOCK_COLOR0,                icon_color_0_xpm},
-        { NULL, NULL }
-    };
-
-    /* Register our stock items */
-    gtk_stock_add (stock_items, G_N_ELEMENTS (stock_items));
-
-    /* Add our custom icon factory to the list of defaults */
-    factory = gtk_icon_factory_new();
-    gtk_icon_factory_add_default(factory);
-
-    /* Create the stock items to add into our icon factory */
-    for (i = 0; pixmaps[i].name != NULL; i++) {
-        GdkPixbuf * pixbuf;
-        GtkIconSet *icon_set;
-
-        pixbuf = gdk_pixbuf_new_from_xpm_data((const char **) (pixmaps[i].xpm_data));
-        g_assert(pixbuf);
-        icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
-        gtk_icon_factory_add (factory, pixmaps[i].name, icon_set);
-        gtk_icon_set_unref (icon_set);
-        g_object_unref (G_OBJECT (pixbuf));
-    }
-
-    /* Drop our reference to the factory, GTK will hold a reference.*/
-    g_object_unref (G_OBJECT (factory));
-}
-
 
 /*
  * Redraw all toolbars (currently only the main toolbar)
@@ -549,9 +364,6 @@ toolbar_new(void)
 
     tooltips = gtk_tooltips_new();
     
-    /* create application specific stock icons */
-    wireshark_stock_icons();
-
     /* this function should be only called once! */
     g_assert(!toolbar_init);
 
index f3dc57306ac0e927cdced38ffba7fcfddc4105c7..ec277013151c5e9759a64bb1fb8915bbc5076e1f 100644 (file)
@@ -52,7 +52,7 @@
 #include "dlg_utils.h"
 #include "help_dlg.h"
 #include "menu.h"
-#include "compat_macros.h"
+#include "stock_icons.h"
 #include <epan/proto.h>
 #include <epan/packet.h>
 #include "../stat_menu.h"