# vim:syntax=automake
## Howto
# For each Q_OBJECT:
#   - Add the .moc.cpp to BUILT_SOURCES and nodist_SOURCES_qt4
#   - Add the .cpp to SOURCES_qt4
#   - Add the .hpp to EXTRA_DIST
# For each UI
#   - Add it to EXTRA_DIST
#   - Add the .h to nodist_SOURCES_qt4

AUTOMAKE_OPTIONS = subdir-objects
MOSTLYCLEANFILES = $(UIH)
SUFFIXES += .ui .h .hpp .moc.cpp

nodist_SOURCES_qt4 = \
		main_interface.moc.cpp \
		menus.moc.cpp \
		dialogs_provider.moc.cpp \
		input_manager.moc.cpp \
		dialogs/playlist.moc.cpp \
		dialogs/bookmarks.moc.cpp \
		dialogs/mediainfo.moc.cpp \
		dialogs/extended.moc.cpp \
		dialogs/messages.moc.cpp \
		dialogs/errors.moc.cpp \
		dialogs/preferences.moc.cpp \
		dialogs/interaction.moc.cpp \
		dialogs/sout.moc.cpp \
		dialogs/help.moc.cpp \
		dialogs/gototime.moc.cpp \
		dialogs/open.moc.cpp \
		dialogs/podcast_configuration.moc.cpp \
		dialogs/vlm.moc.cpp \
		components/extended_panels.moc.cpp \
		components/info_panels.moc.cpp \
		components/preferences_widgets.moc.cpp \
		components/complete_preferences.moc.cpp \
		components/simple_preferences.moc.cpp \
		components/open_panels.moc.cpp \
		components/interface_widgets.moc.cpp \
		components/playlist/playlist_model.moc.cpp \
		components/playlist/playlist_item.moc.cpp \
		components/playlist/playlist.moc.cpp \
		components/playlist/panels.moc.cpp \
		components/playlist/selector.moc.cpp \
		util/input_slider.moc.cpp \
		util/customwidgets.moc.cpp \
		resources.cpp \
		ui/equalizer.h \
		ui/v4l2.h \
		ui/video_effects.h \
		ui/open_file.h \
		ui/open_disk.h \
		ui/open_net.h \
		ui/open_capture.h \
		ui/open.h \
		ui/vlm.h \
		ui/podcast_configuration.h \
		ui/sprefs_audio.h \
		ui/sprefs_input.h \
		ui/sprefs_interface.h \
		ui/sprefs_subtitles.h \
		ui/sprefs_video.h \
		ui/streampanel.h \
		ui/sout.h

BUILT_SOURCES += $(nodist_SOURCES_qt4)

resources.cpp: vlc.qrc
	$(RCC) -name vlc -o $@ $<

.hpp.moc.cpp:
	$(MOC) $(DEFS) $(CPPFLAGS) -I$(top_builddir) `$(VLC_CONFIG) --cppflags plugin qt4` -o $@ $<

.ui.h:
	mkdir -p -- ui
	rm -f $@ $@.tmp
	echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@.tmp
	$(UIC) -tr "Q_" $< >> $@.tmp
	sed -e 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@.tmp >$@
	rm -f $@.tmp

SOURCES_qt4 = 	qt4.cpp \
		menus.cpp \
		main_interface.cpp \
		dialogs_provider.cpp \
		input_manager.cpp \
		dialogs/playlist.cpp \
		dialogs/bookmarks.cpp \
		dialogs/preferences.cpp \
		dialogs/mediainfo.cpp \
		dialogs/extended.cpp \
		dialogs/messages.cpp \
		dialogs/errors.cpp \
		dialogs/interaction.cpp \
		dialogs/sout.cpp \
		dialogs/help.cpp \
		dialogs/gototime.cpp \
		dialogs/open.cpp \
		dialogs/vlm.cpp \
		dialogs/podcast_configuration.cpp \
		components/extended_panels.cpp \
		components/info_panels.cpp \
		components/preferences_widgets.cpp \
		components/complete_preferences.cpp \
		components/simple_preferences.cpp \
		components/open_panels.cpp \
		components/interface_widgets.cpp \
		components/playlist/playlist_model.cpp \
		components/playlist/playlist_item.cpp \
		components/playlist/standardpanel.cpp \
		components/playlist/playlist.cpp \
		components/playlist/selector.cpp \
		util/input_slider.cpp \
		util/customwidgets.cpp \
		util/registry.cpp

noinst_HEADERS = \
	qt4.hpp \
	menus.hpp \
	main_interface.hpp \
	dialogs_provider.hpp \
	input_manager.hpp \
	dialogs/playlist.hpp \
	dialogs/bookmarks.hpp \
	dialogs/mediainfo.hpp \
	dialogs/extended.hpp \
	dialogs/messages.hpp \
	dialogs/errors.hpp \
	dialogs/preferences.hpp \
	dialogs/interaction.hpp \
	dialogs/sout.hpp \
	dialogs/help.hpp \
	dialogs/gototime.hpp \
	dialogs/open.hpp \
	dialogs/vlm.hpp \
	dialogs/podcast_configuration.hpp \
	components/extended_panels.hpp \
	components/info_panels.hpp \
	components/preferences_widgets.hpp \
	components/complete_preferences.hpp \
	components/simple_preferences.hpp \
	components/open_panels.hpp \
	components/interface_widgets.hpp \
	components/playlist/playlist_model.hpp \
	components/playlist/playlist_item.hpp \
	components/playlist/panels.hpp \
	components/playlist/playlist.hpp \
	components/playlist/selector.hpp \
	components/playlist/sorting.h \
	util/input_slider.hpp \
	util/customwidgets.hpp \
	util/qvlcframe.hpp \
	util/registry.hpp

EXTRA_DIST += \
	vlc.qrc \
	ui/equalizer.ui \
	ui/v4l2.ui \
	ui/video_effects.ui \
	ui/open_file.ui \
	ui/open_disk.ui \
	ui/open_net.ui \
	ui/open_capture.ui \
	ui/open.ui \
	ui/podcast_configuration.ui \
	ui/sprefs_audio.ui \
	ui/sprefs_input.ui \
	ui/sprefs_interface.ui \
	ui/sprefs_subtitles.ui \
	ui/sprefs_video.ui \
	ui/streampanel.ui \
	ui/sout.ui \
	ui/vlm.ui \
	pixmaps/prefs/advprefs_audio.png \
	pixmaps/prefs/advprefs_codec.png \
	pixmaps/prefs/advprefs_extended.png \
	pixmaps/prefs/advprefs_intf.png \
	pixmaps/prefs/advprefs_playlist.png \
	pixmaps/prefs/advprefs_sout.png \
	pixmaps/prefs/advprefs_video.png \
	pixmaps/prefs/spref_cone_Audio_64.png \
	pixmaps/prefs/spref_cone_Hotkeys_64.png \
	pixmaps/prefs/spref_cone_Input_64.png \
	pixmaps/prefs/spref_cone_Interface_64.png \
	pixmaps/prefs/spref_cone_Subtitles_64.png \
	pixmaps/prefs/spref_cone_Video_64.png \
	pixmaps/types/capture-card_16px.png \
	pixmaps/types/cdda_16px.png \
	pixmaps/types/disc_16px.png \
	pixmaps/types/file-asym_16px.png \
	pixmaps/types/file-wide_16px.png \
	pixmaps/types/folder-blue_16px.png \
	pixmaps/types/folder-grey_16px.png \
	pixmaps/types/harddisk_16px.png \
	pixmaps/types/network_16px.png \
	pixmaps/menus/help_16px.png \
	pixmaps/menus/info_16px.png \
	pixmaps/menus/messages_16px.png \
	pixmaps/menus/preferences_16px.png \
	pixmaps/menus/quit_16px.png \
	pixmaps/menus/settings_16px.png \
	pixmaps/menus/stream_16px.png \
	pixmaps/menus/playlist_16px.png \
	pixmaps/go-next.png \
	pixmaps/next_16px.png \
	pixmaps/next.png \
	pixmaps/noart.png \
	pixmaps/pause_16px.png \
	pixmaps/pause.png \
	pixmaps/play_16px.png \
	pixmaps/playlist/add.png \
	pixmaps/playlist/playlist.png \
	pixmaps/playlist/repeat_all.png \
	pixmaps/playlist/repeat_off.png \
	pixmaps/playlist/repeat_one.png \
	pixmaps/playlist/shuffle_off.png \
	pixmaps/playlist/shuffle_on.png \
	pixmaps/playlist/jumpto.png \
	pixmaps/play.png \
	pixmaps/previous_16px.png \
	pixmaps/previous.png \
	pixmaps/stop_16px.png \
	pixmaps/stop.png \
	pixmaps/eject.png \
	pixmaps/update.png \
	pixmaps/clear.png \
	pixmaps/arrow_down_dark.png \
	pixmaps/types/tape_16px.png \
	pixmaps/types/type_directory.png \
	pixmaps/types/type_file.png \
	pixmaps/types/type_net.png \
	pixmaps/types/type_node.png \
	pixmaps/types/type_playlist.png \
	pixmaps/types/type_unknown.xpm \
	pixmaps/toolbar/extended_16px.png \
	pixmaps/toolbar/record_16px.png \
	pixmaps/toolbar/snapshot.png \
	pixmaps/toolbar/atob.png \
	pixmaps/toolbar/atob_noa.png \
	pixmaps/toolbar/atob_nob.png \
	pixmaps/toolbar/dvd_menu.png \
	pixmaps/toolbar/dvd_next.png \
	pixmaps/toolbar/dvd_prev.png \
	pixmaps/toolbar/tv.png \
	pixmaps/toolbar/fullscreen.png \
	pixmaps/toolbar/defullscreen.png \
	pixmaps/toolbar/tvtelx.png \
	pixmaps/toolbar/tvtelx-transparent.png \
	pixmaps/toolbar/volume-high.png \
	pixmaps/toolbar/volume-medium.png \
	pixmaps/toolbar/volume-low.png \
	pixmaps/toolbar/volume-muted.png \
	pixmaps/toolbar/volume-slider-inside.png \
	pixmaps/toolbar/volume-slider-outside.png
