diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2015-10-17 13:47:17 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-11-12 07:14:32 +0000 |
commit | 2d7b0fc7d046154a393c9a1e5f4b2e9b5fee3738 (patch) | |
tree | 8b14d373b97ea9162a46e8b61f42919f2a6c5514 /ui/gtk/Makefile.am | |
parent | 1ab019f409f2855d3b51717a237cc482242887e9 (diff) |
[GTK] Replace deprecated gdk_pixbuf_new_from_inline()
Use GResource instead, if available. Add autotools and cmake compile time
checks for build requirements (GIO >= 2.32 and GDK-Pixbuf >= 2.26).
Merge all the various static pixbuf csource header files into
a single pixbuf-csource.h header with external linkage through use of the
tools/make-pixbuf-csource.pl script.
Fix inline pixbuf build target for some image paths (broken for GTK
in gb4a4de7).
Add missing 'expert_ok.png' file to distribution (GTK only).
Minor improvements to style/structure of ui/gtk/Makefile.am.
Bug: 10750
Change-Id: I031296b666ee8b92730400dfa6f71f9ee4304863
Reviewed-on: https://code.wireshark.org/review/10992
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/gtk/Makefile.am')
-rw-r--r-- | ui/gtk/Makefile.am | 177 |
1 files changed, 57 insertions, 120 deletions
diff --git a/ui/gtk/Makefile.am b/ui/gtk/Makefile.am index 900b280b4e..e5f532d3d5 100644 --- a/ui/gtk/Makefile.am +++ b/ui/gtk/Makefile.am @@ -26,7 +26,7 @@ if HAVE_WARNINGS_AS_ERRORS AM_CLEAN_CFLAGS = -Werror -Wno-error=deprecated-declarations endif -noinst_LIBRARIES = libgtkui.a +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(PORTAUDIO_INCLUDES) CLEANFILES = \ libgtkui.a \ @@ -38,6 +38,48 @@ MAINTAINERCLEANFILES = \ $(GENERATED_FILES) \ Makefile.in +WIRESHARK_CLEAN_LIBGTKUI_SRC = \ + $(WIRESHARK_GTK_SRC) \ + $(WIRESHARK_TAP_SRC) \ + $(GENERATED_C_FILES) + +EXTRA_DIST = \ + $(GENERATOR_FILES) \ + airpcap_dlg.c \ + airpcap_gui_utils.c \ + capture_if_details_dlg_win32.c \ + capture_if_details_dlg_win32.h \ + CMakeLists.txt \ + doxygen.cfg.in \ + main_airpcap_toolbar.c \ + Makefile.common \ + Makefile.nmake \ + Makefile_custom.common \ + pixbuf-csource.c \ + pixbuf-csource.h + +if HAVE_GRESOURCE +GENERATED_HEADER_FILES += wireshark-gresources.h +GENERATED_C_FILES += wireshark-gresources.c +else +WIRESHARK_CLEAN_LIBGTKUI_SRC += pixbuf-csource.c +endif + +noinst_LIBRARIES = libgtkui.a + +libgtkui_a_SOURCES = \ + $(WIRESHARK_CLEAN_LIBGTKUI_SRC) \ + $(noinst_HEADERS) \ + $(GENERATED_HEADER_FILES) + +libgtkui_a_CFLAGS = $(AM_CLEAN_CFLAGS) + +libgtkui_a_DEPENDENCIES = + +if HAVE_GRESOURCE +main.c: wireshark-gresources.h +endif + # # Build "wireshark-tap-register.c", which contains a function # "register_all_tap_listeners()" @@ -56,137 +98,32 @@ wireshark-tap-register.c: $(WIRESHARK_TAP_SRC) Makefile.common Makefile_custom. @echo Making wireshark-tap-register.c @$(PYTHON) $(top_srcdir)/tools/make-tap-reg.py $(srcdir) taps $(WIRESHARK_TAP_SRC) -WIRESHARK_CLEAN_LIBGTKUI_SRC = \ - $(WIRESHARK_GTK_SRC) \ - $(WIRESHARK_TAP_SRC) \ - $(GENERATED_C_FILES) - -libgtkui_a_SOURCES = \ - $(WIRESHARK_CLEAN_LIBGTKUI_SRC) \ - $(noinst_HEADERS) \ - $(GENERATED_HEADER_FILES) - -libgtkui_a_CFLAGS = $(AM_CLEAN_CFLAGS) - -libgtkui_a_DEPENDENCIES = - -# Common headers -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(PORTAUDIO_INCLUDES) +if HAVE_GRESOURCE +wireshark-gresources.c: main.gresources.xml $(shell glib-compile-resources --sourcedir=$(top_srcdir) --generate-dependencies main.gresources.xml) + @echo Making $@ + @glib-compile-resources --sourcedir=$(top_srcdir) --target=$@ --generate --manual-register $< +wireshark-gresources.h: main.gresources.xml + @echo Making $@ + @glib-compile-resources --sourcedir=$(top_srcdir) --target=$@ --generate --manual-register $< +endif doxygen: if HAVE_DOXYGEN $(DOXYGEN) doxygen.cfg -endif # HAVE_DOXYGEN +endif checkapi: checkapi-base checkapi-todo checkapi-base: $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g deprecated-gtk -build \ - -sourcedir=$(srcdir) \ - $(WIRESHARK_CLEAN_LIBGTKUI_SRC) \ + -sourcedir=$(srcdir) \ + $(WIRESHARK_CLEAN_LIBGTKUI_SRC) \ capture_if_details_dlg_win32.c checkapi-todo: $(PERL) $(top_srcdir)/tools/checkAPIs.pl -M -g deprecated-gtk-todo -build \ - -sourcedir=$(srcdir) \ - $(WIRESHARK_GTK_SRC) \ - $(WIRESHARK_TAP_SRC) \ + -sourcedir=$(srcdir) \ + $(WIRESHARK_GTK_SRC) \ + $(WIRESHARK_TAP_SRC) \ capture_if_details_dlg_win32.c - -expert_indicators.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for elevel in chat error none note warn ok ; do \ - gdk-pixbuf-csource --raw --name=expert_$${elevel}_pb_data $(top_srcdir)/image/expert_$${elevel}.png >> $@ ;\ - done - -capture_comment_icons.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for caction in add update disabled ; do \ - gdk-pixbuf-csource --raw --name=capture_comment_$${caction}_pb_data $(top_srcdir)/image/capture_comment_$${caction}.png >> $@ ;\ - done - -network_icons.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for icon in bluetooth usb wired wireless ; do \ - gdk-pixbuf-csource --raw --name=network_$${icon}_pb_data $(top_srcdir)/image/toolbar/network_$${icon}_16.png >> $@ ;\ - done - -remote_icons.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for icon in arrow globe sat ; do \ - gdk-pixbuf-csource --raw --name=remote_$${icon}_pb_data $(top_srcdir)/image/toolbar/remote_$${icon}_16.png >> $@ ;\ - done - -pipe_icon.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - gdk-pixbuf-csource --raw --name=pipe_pb_data $(top_srcdir)/image/toolbar/pipe_16.png >> $@ - -TOOLBAR_COMMON_ICONS = \ - capture_interfaces \ - gnome_emblem_web - -toolbar_icons.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for icon16 in $(TOOLBAR_COMMON_ICONS) ; do \ - gdk-pixbuf-csource --raw --name=$${icon16}_16_pb_data $(top_srcdir)/image/toolbar/$${icon16}_16.png >> $@ ;\ - done - for icon24 in $(TOOLBAR_COMMON_ICONS) ; do \ - gdk-pixbuf-csource --raw --name=$${icon24}_24_pb_data $(top_srcdir)/image/toolbar/$${icon24}_24.png >> $@ ;\ - done - for icon_size in 16 24 ; do \ - gdk-pixbuf-csource --raw --name=toolbar_wireshark_file_$${icon_size}_pb_data $(top_srcdir)/image/toolbar/$${icon_size}x$${icon_size}/x-capture-file-save.png >> $@ ;\ - gdk-pixbuf-csource --raw --name=capture_options_alt1_$${icon_size}_pb_data $(top_srcdir)/image/toolbar/$${icon_size}x$${icon_size}/x-capture-options.png >> $@ ;\ - gdk-pixbuf-csource --raw --name=capture_restart_$${icon_size}_pb_data $(top_srcdir)/image/toolbar/$${icon_size}x$${icon_size}/x-capture-restart.png >> $@ ;\ - gdk-pixbuf-csource --raw --name=capture_start_$${icon_size}_pb_data $(top_srcdir)/image/toolbar/$${icon_size}x$${icon_size}/x-capture-start.png >> $@ ;\ - gdk-pixbuf-csource --raw --name=capture_stop_$${icon_size}_pb_data $(top_srcdir)/image/toolbar/$${icon_size}x$${icon_size}/x-capture-stop.png >> $@ ;\ - done - -layouts.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for layout_num in 1 2 3 4 5 6 ; do \ - gdk-pixbuf-csource --raw --name=layout_$${layout_num}_pb_data $(top_srcdir)/image/layout_$${layout_num}.png >> $@ ;\ - done - -wsicon.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for layout_num in 16 24 32 48 64 ; do \ - gdk-pixbuf-csource --raw --name=wsicon_$${layout_num}_pb_data $(top_srcdir)/image/wsicon$${layout_num}.png >> $@ ;\ - done - -wsiconcap.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - for layout_num in 16 24 32 48 64 ; do \ - gdk-pixbuf-csource --raw --name=wsiconcap_$${layout_num}_pb_data $(top_srcdir)/image/wsiconcap$${layout_num}.png >> $@ ;\ - done - -wssplash.h: - echo "/* This file was automatically generated. DO NOT EDIT. */" > $@ - echo >> $@ - gdk-pixbuf-csource --raw --name=wssplash_pb_data $(top_srcdir)/image/wssplash_dev.png >> $@ - -clean-pixbufs: - rm expert_indicators.h capture_comment_icons.h network_icons.h remote_icons.h pipe_icon.h \ - toolbar_icons.h layouts.h wsicon.h wsiconcap.h wssplash.h - -EXTRA_DIST = \ - $(GENERATOR_FILES) \ - airpcap_dlg.c \ - airpcap_gui_utils.c \ - capture_if_details_dlg_win32.c \ - capture_if_details_dlg_win32.h \ - CMakeLists.txt \ - doxygen.cfg.in \ - main_airpcap_toolbar.c \ - Makefile.common \ - Makefile.nmake \ - Makefile_custom.common |